fix(core,ecommerce,board,basic,pay_kginicis,pay_nhnkcp,pay_nicepayments): 7.0.6 회귀 3건·잠복 결함 3건 해소 + 통화 하드코딩 전수 제거
7.0.6 사이클에서 유입된 회귀 3건을 출시 전에 닫는다. 추가옵션 저장소의 반환 타입 선언이 실제 반환(중첩 맵)과 어긋나 추가옵션 있는 상품의 담기· 바로구매가 죽었고, 검색 엔진이 결과 소비 시점에 SELECT 를 재작성해 정렬이 참조하던 스코어 별칭을 지웠으며, 미들웨어 targets 가 늘어난 라우트를 따라가지 못해 비회원 현금영수증이 전면 불능이었다. 셋 다 정적 검사의 사각지대였으므로 룰 2건과 계약 테스트를 함께 세워 재발을 막는다. 같은 유형의 잠복 결함 3건(빈 반환의 타입 불일치 2건, 없는 메서드 호출 1건)도 호출 경로가 생기는 순간 fatal 이므로 함께 닫았다. 브라우저 검수 중 드러난 선행 결함 5건을 이어서 수정한다. 엔진이 event 키로 선언한 액션을 React prop 으로 연결하지 않아 오류 없이 조용히 무반응이었고, 연결한 뒤에는 커스텀 컴포넌트의 이벤트 payload 가 유실됐다. 비회원 주문상세 응답에 현금영수증 키가 없어 발급 결과에 도달할 수 없었으며, 입금확인과 현금영수증 발급이 base 통화 금액을 써서 결제 통화가 다른 주문에서 각각 저장 실패와 잘못된 증빙을 냈다. 마지막으로 통화 단위를 코드·문구에서 걷어내 설정으로 이관한다. 다국어 문구의 원/円, 프론트의 KRW 고정표와 리터럴 폴백 173건, 서버 포맷의 통화 코드 리터럴이 대상이며, 기본 통화가 원이 아닌 상점에서 값은 맞고 단위만 틀린 금액이 예외 없이 나가던 문제였다. 통화 판정을 설정 단일 출처로 모으고 규칙 3건을 정적 검사로 고정했다.
This commit is contained in:
1 parent
7f4e665827
commit
e21bff678f
167 files changed
+3980
-696
No files matched your search
@@ -22,6 +22,9 @@
|
||||
|
||||
### Fixed
|
||||
|
||||
- 관리자가 추가한 통화(예: 파운드)로 볼 때 금액이 원화 기호와 자릿수로 표시되던 문제를 수정했습니다. 이제 환경설정에 등록한 통화 기호와 소수 자릿수를 그대로 따릅니다.
|
||||
- 표시 통화가 정해지지 않은 순간에 금액이 원화로 표시될 수 있던 문제를 수정했습니다. 이제 상점 기본 통화로 표시됩니다.
|
||||
- 기본 통화가 원(KRW)이 아닌 쇼핑몰을 다른 통화로 볼 때, 추가옵션 금액만 기준 통화로 표시되고 그 값이 그대로 총 금액에 더해지던 문제를 수정했습니다. 상품 상세의 추가옵션 선택지·추가옵션 금액·총 금액, 장바구니와 주문서의 추가옵션 줄이 모두 보고 있는 통화로 표시됩니다. 기본 통화가 원인 상점은 이전과 동일합니다.
|
||||
- 주문 상세의 결제 정보 영역에 결제 플러그인이 제공하는 공급가액·부가세·영수증 링크·에스크로 구매확정 버튼이 표시되지 않던 문제를 수정했습니다.
|
||||
- 총 건수를 끝까지 세지 못한 목록에서 페이지 이동 막대가 사라지거나 "1페이지뿐" 으로 잘못 표시되던 문제를 수정했습니다. 마이페이지의 주문·마일리지·위시리스트·알림함, 게시판 목록, 상품 리뷰·문의, 내가 쓴 글 목록이 해당합니다.
|
||||
- 검색 결과의 탭 배지가 끝까지 세지 못한 건수를 정확한 숫자처럼 보여주던 문제를 수정했습니다. 이제 그 경우 숫자 뒤에 "이상" 표시가 붙습니다.
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@ describe('체크아웃 할인/쿠폰 선택 통화 환산 (_checkout_discount.js
|
||||
it('쿠폰 옵션 텍스트는 multi_currency_benefit_formatted 선택통화 폴백을 쓴다 (옵션 텍스트 KRW 고정 차단)', () => {
|
||||
// benefit_formatted 단독 사용 패턴이 없어야 한다(반드시 multi_currency 우선)
|
||||
const benefitMatches = raw.match(/coupon\.benefit_formatted/g) ?? [];
|
||||
const multiMatches = raw.match(/coupon\.multi_currency_benefit_formatted\?\.\[_global\.preferredCurrency \?\? 'KRW'\]/g) ?? [];
|
||||
const multiMatches = raw.match(/coupon\.multi_currency_benefit_formatted\?\.\[_global\.preferredCurrency \?\? _global\.defaultCurrency\]/g) ?? [];
|
||||
// 옵션 텍스트 2곳(주문쿠폰 + 배송비쿠폰) 모두 multi_currency 우선 폴백
|
||||
expect(multiMatches.length).toBeGreaterThanOrEqual(2);
|
||||
// benefit_formatted 가 등장하더라도 항상 multi_currency 폴백의 ?? 우변으로만
|
||||
@@ -39,19 +39,19 @@ describe('체크아웃 할인/쿠폰 선택 통화 환산 (_checkout_discount.js
|
||||
|
||||
it('적용 주문쿠폰 할인액이 summary.multi_currency 선택통화 폴백을 쓴다', () => {
|
||||
expect(raw).toContain(
|
||||
"multi_currency?.[_global.preferredCurrency ?? 'KRW']?.order_coupon_discount_formatted"
|
||||
"multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.order_coupon_discount_formatted"
|
||||
);
|
||||
});
|
||||
|
||||
it('적용 배송비쿠폰 할인액이 summary.multi_currency 선택통화 폴백을 쓴다 (D5 핵심)', () => {
|
||||
expect(raw).toContain(
|
||||
"multi_currency?.[_global.preferredCurrency ?? 'KRW']?.shipping_discount_formatted"
|
||||
"multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.shipping_discount_formatted"
|
||||
);
|
||||
});
|
||||
|
||||
it('적용 할인코드 할인액이 summary.multi_currency 선택통화 폴백을 쓴다', () => {
|
||||
expect(raw).toContain(
|
||||
"multi_currency?.[_global.preferredCurrency ?? 'KRW']?.code_discount_formatted"
|
||||
"multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.code_discount_formatted"
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -77,15 +77,23 @@ describe('U10 — 다운로드 모달 무한스크롤 (버튼식 페이지네이
|
||||
});
|
||||
});
|
||||
|
||||
describe('U10 — 더보기 액션(증분 첫 페이지 로드)', () => {
|
||||
describe('U10 — 더보기 액션(배지와 같은 목록을 연다)', () => {
|
||||
const text = serialize(infoSummary);
|
||||
|
||||
it('더보기 apiCall 이 per_page=8 + page=1 로 첫 페이지를 로드한다', () => {
|
||||
expect(text).toContain('per_page=8&page=1');
|
||||
/*
|
||||
* 「+N」 배지는 이 상품에 적용되는 쿠폰(productDownloadableCoupons)으로 계산된다.
|
||||
* 더보기가 전체 다운로드 쿠폰을 새로 조회하면 이 상품에 적용되지 않는 쿠폰이 섞여
|
||||
* 배지 수와 모달 건수가 어긋나므로, 더보기는 배지와 같은 데이터소스를 그대로 넘긴다.
|
||||
* (종전 테스트는 별도 조회 설계를 고정하고 있었다 — 그 설계가 배지 불일치의 원인이었다.)
|
||||
*/
|
||||
it('더보기가 별도 조회 없이 배지와 같은 데이터소스를 모달에 넘긴다', () => {
|
||||
expect(text).toContain('downloadableCoupons":"{{productDownloadableCoupons.data}}');
|
||||
expect(text).not.toContain('per_page=8&page=1');
|
||||
});
|
||||
|
||||
it('더보기 onSuccess 가 downloadingMore 를 초기화한다', () => {
|
||||
expect(text).toContain('downloadingMore');
|
||||
it('더보기가 모달 로딩 상태를 초기화한다', () => {
|
||||
expect(text).toContain('downloadableCouponsLoading":false');
|
||||
expect(text).toContain('downloadingMore":false');
|
||||
});
|
||||
|
||||
it('downloadableCouponsPage setState 가 제거되었다', () => {
|
||||
|
||||
@@ -29,7 +29,7 @@ const modalText = fs.readFileSync(
|
||||
describe('A1-④ — 쿠폰 모달 다통화 환산', () => {
|
||||
it('정액 할인이 multi_currency_discount_value 선택통화 환산을 표시한다', () => {
|
||||
expect(modalText).toContain('multi_currency_discount_value');
|
||||
expect(modalText).toContain("_global.preferredCurrency ?? 'KRW'");
|
||||
expect(modalText).toContain("_global.preferredCurrency ?? _global.defaultCurrency");
|
||||
});
|
||||
|
||||
it('정액 할인 폴백은 기본통화 숫자 + currency_unit 을 유지한다', () => {
|
||||
|
||||
@@ -67,7 +67,7 @@ describe.each([
|
||||
const strikethrough = nodes.find((n) =>
|
||||
typeof n.text === 'string' && n.text.includes('multi_currency_list_price'));
|
||||
expect(strikethrough).toBeDefined();
|
||||
expect(strikethrough!.text).toContain("_global.preferredCurrency ?? 'KRW'");
|
||||
expect(strikethrough!.text).toContain("_global.preferredCurrency ?? _global.defaultCurrency");
|
||||
expect(strikethrough!.text).toContain('list_price_formatted');
|
||||
expect(strikethrough!.props?.className).toContain('line-through');
|
||||
});
|
||||
@@ -83,7 +83,7 @@ describe.each([
|
||||
expect(secondaryBlock).toBeDefined();
|
||||
expect(secondaryBlock!.if).toContain('discount_rate');
|
||||
expect(secondaryBlock!.iteration?.source).toContain('multi_currency_list_price');
|
||||
expect(secondaryBlock!.iteration?.source).toContain("code !== (_global.preferredCurrency ?? 'KRW')");
|
||||
expect(secondaryBlock!.iteration?.source).toContain("code !== (_global.preferredCurrency ?? _global.defaultCurrency)");
|
||||
});
|
||||
|
||||
it('판매가 표시(multi_currency_selling_price)는 유지된다(비회귀)', () => {
|
||||
|
||||
+6
-6
@@ -30,12 +30,12 @@ describe('마이페이지 결제 정보 — base 통화 고정 + 결제통화
|
||||
|
||||
it('금액 primary 는 preferredCurrency 가 아니라 base(*_formatted)를 바인딩한다', () => {
|
||||
// 회귀: mc_total_amount[preferredCurrency].formatted 를 primary 로 쓰던 패턴 제거
|
||||
expect(s).not.toContain("mc_total_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(s).not.toContain("mc_total_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
expect(s).toContain('order.data.total_amount_formatted');
|
||||
});
|
||||
|
||||
it('보조 통화 iteration 은 주문 base_currency 를 제외한다', () => {
|
||||
expect(s).toContain("order.data.base_currency ?? _global.preferredCurrency ?? 'KRW'");
|
||||
expect(s).toContain("order.data.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency");
|
||||
});
|
||||
|
||||
it('base≠결제 통화일 때 결제 통화 실청구액을 명시한다', () => {
|
||||
@@ -69,7 +69,7 @@ describe('마이페이지 주문 목록 — base 통화 고정', () => {
|
||||
|
||||
it('합계 primary 는 base(*_formatted), 보조 통화는 base_currency 제외', () => {
|
||||
expect(s).toContain('order.total_amount_formatted');
|
||||
expect(s).toContain("order.base_currency ?? _global.preferredCurrency ?? 'KRW'");
|
||||
expect(s).toContain("order.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -78,13 +78,13 @@ describe('마이페이지 주문 상세 상품 카드 — base 통화 고정', (
|
||||
|
||||
it('상품 단가/소계 primary 는 preferredCurrency 가 아니라 base(*_formatted)를 바인딩한다', () => {
|
||||
// 회귀: mc_subtotal_price[preferredCurrency].formatted 를 primary 로 쓰던 패턴 제거
|
||||
expect(s).not.toContain("mc_subtotal_price?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(s).not.toContain("mc_unit_price?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(s).not.toContain("mc_subtotal_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
expect(s).not.toContain("mc_unit_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
expect(s).toContain('item.unit_price_formatted');
|
||||
expect(s).toContain('item.subtotal_price_formatted');
|
||||
});
|
||||
|
||||
it('보조 통화 iteration 은 주문 base_currency 를 제외한다', () => {
|
||||
expect(s).toContain("order.data.base_currency ?? _global.preferredCurrency ?? 'KRW'");
|
||||
expect(s).toContain("order.data.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency");
|
||||
});
|
||||
});
|
||||
@@ -60,7 +60,7 @@ describe('상품상세 총 금액 선택 통화 환산 (_purchase_card.json)', (
|
||||
|
||||
it('옵션 선택형 총 금액은 selectedTotalMultiCurrency 선택통화 포맷 맵을 조회한다 (D2)', () => {
|
||||
expect(optionValueNode).toBeDefined();
|
||||
expect(optionValueNode!.text).toContain("selectedTotalMultiCurrency?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(optionValueNode!.text).toContain("selectedTotalMultiCurrency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
});
|
||||
|
||||
it('옵션 선택형 총 금액은 handler() 표현식 호출과 원(KRW) 하드코딩을 쓰지 않는다 (금지패턴/D2 회귀 차단)', () => {
|
||||
@@ -71,7 +71,7 @@ describe('상품상세 총 금액 선택 통화 환산 (_purchase_card.json)', (
|
||||
|
||||
it('옵션 없는 상품 총 금액은 noOptionTotalMultiCurrency 또는 단가 formatted 폴백을 쓴다 (D3)', () => {
|
||||
expect(noOptionValueNode).toBeDefined();
|
||||
expect(noOptionValueNode!.text).toContain("noOptionTotalMultiCurrency?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(noOptionValueNode!.text).toContain("noOptionTotalMultiCurrency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
// 단가 formatted 폴백(초기 수량 1)
|
||||
expect(noOptionValueNode!.text).toContain('multi_currency_selling_price');
|
||||
});
|
||||
@@ -85,7 +85,7 @@ describe('상품상세 총 금액 선택 통화 환산 (_purchase_card.json)', (
|
||||
it('개별 선택 항목 가격(multiCurrencyTotalPrice formatted)은 유지된다(비회귀)', () => {
|
||||
const text = JSON.stringify(layout);
|
||||
expect(text).toContain('multiCurrencyTotalPrice');
|
||||
expect(text).toContain("?.[_global.preferredCurrency ?? 'KRW']?.formatted");
|
||||
expect(text).toContain("?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted");
|
||||
});
|
||||
|
||||
it('레이아웃 전체에 handler() 표현식 호출이 없다 (엔진 표현식 컨텍스트는 handler 미제공)', () => {
|
||||
|
||||
@@ -1 +1 @@
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-lime-50:oklch(98.6% .031 120.757);--color-lime-100:oklch(96.7% .067 122.328);--color-lime-200:oklch(93.8% .127 124.321);--color-lime-300:oklch(89.7% .196 126.665);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-lime-600:oklch(64.8% .2 131.684);--color-lime-700:oklch(53.2% .157 131.589);--color-lime-800:oklch(45.3% .124 130.933);--color-lime-900:oklch(40.5% .101 131.063);--color-lime-950:oklch(27.4% .072 132.109);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .1Line truncated
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-lime-50:oklch(98.6% .031 120.757);--color-lime-100:oklch(96.7% .067 122.328);--color-lime-200:oklch(93.8% .127 124.321);--color-lime-300:oklch(89.7% .196 126.665);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-lime-600:oklch(64.8% .2 131.684);--color-lime-700:oklch(53.2% .157 131.589);--color-lime-800:oklch(45.3% .124 130.933);--color-lime-900:oklch(40.5% .101 131.063);--color-lime-950:oklch(27.4% .072 132.109);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(Line truncated
|
||||
+13
-14
@@ -1,24 +1,23 @@
|
||||
var SirsoftBasic=(function(ee,c,C,or){"use strict";function ad(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const N=ad(C),sd=()=>window.G7Core,J=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=sd()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return c.jsx("button",{ref:a,className:l,...o,children:e})});J.displayName="Button";const j=C.forwardRef(({children:e,className:t="",...r},n)=>c.jsx("div",{ref:n,className:t,...r,children:e})),te=({children:e,className:t="",...r})=>c.jsx("span",{className:t,...r,children:e}),En=({children:e,className:t="",...r})=>c.jsx("svg",{className:t,...r,children:e}),Et=C.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...d},i)=>{const u=l==="radio"||l==="checkbox",g=C.useRef(!1),p=C.useRef(null);C.useImperativeHandle(i,()=>p.current);const[m,x]=C.useState(a??s??"");C.useEffect(()=>{!u&&!g.current&&a!==void 0&&x(a)},[a,u]);const k=C.useCallback(()=>{g.current=!0},[]),M=C.useCallback(y=>{if(g.current=!1,n){const T=y.target.value;x(T);const I=new Event("change",{bubbles:!0});Object.defineProperty(I,"target",{writable:!1,value:{value:T}}),Object.defineProperty(I,"currentTarget",{writable:!1,value:{value:T}}),n(I)}},[n]),v=C.useCallback(y=>{const T=y.target.value;x(T),!g.current&&n&&n(y)},[n]),E=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:A,formdata:_,...O}=d;if(u)return c.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...O});const w=a!==void 0?{value:m}:{defaultValue:s};return c.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:E,onCompositionStart:k,onCompositionEnd:M,...w,...O})});Et.displayName="Input";const ss=C.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},h)=>{const d=C.useRef(null),i=h||d,[u,g]=C.useState(""),p={},m={};Object.entries(f).forEach(([v,E])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=E:m[v]=E});const x=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),k=C.useCallback(v=>{const E=v.target.files?.[0]||null;if(!E){g(""),r?.(null);return}if(t&&E.size>t*1024*1024){const A=`File size exceeds ${t}MB limit`;n?.(A),i.current&&(i.current.value=""),g("");return}g(E.name),r?.(E)},[t,r,n,i]),M=C.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return c.jsxs(j,{className:`flex items-center gap-2 ${s}`,...p,children:[c.jsx(Et,{ref:i,type:"file",accept:e,onChange:k,disabled:l,className:"hidden",...m}),c.jsx(J,{type:"button",onClick:x,disabled:l,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:o}),c.jsx(te,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&c.jsx(J,{type:"button",onClick:M,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:c.jsx(En,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ss.displayName="FileInput";var rt=(e=>(e.User="fa-user",e.Users="fa-users",e.UserCircle="fa-user-circle",e.UserPlus="fa-user-plus",e.UserMinus="fa-user-minus",e.UserShield="fa-user-shield",e.Search="fa-search",e.Edit="fa-edit",e.Pencil="fa-pencil-alt",e.Trash="fa-trash",e.Save="fa-save",e.Plus="fa-plus",e.Minus="fa-minus",e.Check="fa-check",e.Times="fa-times",e.Download="fa-download",e.Upload="fa-upload",e.Copy="fa-copy",e.ExternalLink="fa-external-link-alt",e.Home="fa-home",e.ChevronLeft="fa-chevron-left",e.ChevronRight="fa-chevron-right",e.ChevronUp="fa-chevron-up",e.ChevronDown="fa-chevron-down",e.AngleLeft="fa-angle-left",e.AngleRight="fa-angle-right",e.AngleUp="fa-angle-up",e.AngleDown="fa-angle-down",e.ArrowUp="fa-arrow-up",e.ArrowDown="fa-arrow-down",e.ArrowLeft="fa-arrow-left",e.ArrowRight="fa-arrow-right",e.Bars="fa-bars",e.EllipsisVertical="fa-ellipsis-v",e.EllipsisHorizontal="fa-ellipsis-h",e.CheckCircle="fa-check-circle",e.TimesCircle="fa-times-circle",e.ExclamationCircle="fa-exclamation-circle",e.ExclamationTriangle="fa-exclamation-triangle",e.InfoCircle="fa-info-circle",e.QuestionCircle="fa-question-circle",e.XCircle="fa-times-circle",e.ShoppingCart="fa-shopping-cart",e.ShoppingBag="fa-shopping-bag",e.CreditCard="fa-credit-card",e.Tag="fa-tagLine truncated
|
||||
var SirsoftBasic=(function(J,d,k,Jt){"use strict";function Dc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const N=Dc(k),Lc=()=>window.G7Core,Q=k.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=Lc()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});Q.displayName="Button";const W=k.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("div",{ref:n,className:t,...r,children:e})),R=({children:e,className:t="",...r})=>d.jsx("span",{className:t,...r,children:e}),fn=({children:e,className:t="",...r})=>d.jsx("svg",{className:t,...r,children:e}),xt=k.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...c},i)=>{const u=l==="radio"||l==="checkbox",g=k.useRef(!1),p=k.useRef(null);k.useImperativeHandle(i,()=>p.current);const[m,w]=k.useState(a??s??"");k.useEffect(()=>{!u&&!g.current&&a!==void 0&&w(a)},[a,u]);const C=k.useCallback(()=>{g.current=!0},[]),O=k.useCallback(y=>{if(g.current=!1,n){const T=y.target.value;w(T);const A=new Event("change",{bubbles:!0});Object.defineProperty(A,"target",{writable:!1,value:{value:T}}),Object.defineProperty(A,"currentTarget",{writable:!1,value:{value:T}}),n(A)}},[n]),v=k.useCallback(y=>{const T=y.target.value;w(T),!g.current&&n&&n(y)},[n]),E=k.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:I,formdata:_,...M}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...M});const x=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:E,onCompositionStart:C,onCompositionEnd:O,...x,...M})});xt.displayName="Input";const ja=k.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},h)=>{const c=k.useRef(null),i=h||c,[u,g]=k.useState(""),p={},m={};Object.entries(f).forEach(([v,E])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=E:m[v]=E});const w=k.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),C=k.useCallback(v=>{const E=v.target.files?.[0]||null;if(!E){g(""),r?.(null);return}if(t&&E.size>t*1024*1024){const I=`File size exceeds ${t}MB limit`;n?.(I),i.current&&(i.current.value=""),g("");return}g(E.name),r?.(E)},[t,r,n,i]),O=k.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return d.jsxs(W,{className:`flex items-center gap-2 ${s}`,...p,children:[d.jsx(xt,{ref:i,type:"file",accept:e,onChange:C,disabled:l,className:"hidden",...m}),d.jsx(Q,{type:"button",onClick:w,disabled:l,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:o}),d.jsx(R,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(Q,{type:"button",onClick:O,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:d.jsx(fn,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ja.displayName="FileInput";var Je=(e=>(e.User="fa-user",e.Users="fa-users",e.UserCircle="fa-user-circle",e.UserPlus="fa-user-plus",e.UserMinus="fa-user-minus",e.UserShield="fa-user-shield",e.Search="fa-search",e.Edit="fa-edit",e.Pencil="fa-pencil-alt",e.Trash="fa-trash",e.Save="fa-save",e.Plus="fa-plus",e.Minus="fa-minus",e.Check="fa-check",e.Times="fa-times",e.Download="fa-download",e.Upload="fa-upload",e.Copy="fa-copy",e.ExternalLink="fa-external-link-alt",e.Home="fa-home",e.ChevronLeft="fa-chevron-left",e.ChevronRight="fa-chevron-right",e.ChevronUp="fa-chevron-up",e.ChevronDown="fa-chevron-down",e.AngleLeft="fa-angle-left",e.AngleRight="fa-angle-right",e.AngleUp="fa-angle-up",e.AngleDown="fa-angle-down",e.ArrowUp="fa-arrow-up",e.ArrowDown="fa-arrow-down",e.ArrowLeft="fa-arrow-left",e.ArrowRight="fa-arrow-right",e.Bars="fa-bars",e.EllipsisVertical="fa-ellipsis-v",e.EllipsisHorizontal="fa-ellipsis-h",e.CheckCircle="fa-check-circle",e.TimesCircle="fa-times-circle",e.ExclamationCircle="fa-exclamation-circle",e.ExclamationTriangle="fa-exclamation-triangle",e.InfoCircle="fa-info-circle",e.QuestionCircle="fa-question-circle",e.XCircle="fa-times-circle",e.ShoppingCart="fa-shopping-cart",e.ShoppingBag="fa-shopping-bag",e.CreditCard="fa-credit-card",e.Tag="fa-tag",eLine truncated
|
||||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||||
${f==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
||||
`,children:[c.jsx(ge,{name:rt.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(J,{onClick:()=>g("light"),className:`
|
||||
`,children:[d.jsx(de,{name:Je.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>g("light"),className:`
|
||||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||||
${f==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
||||
`,children:[c.jsx(ge,{name:rt.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(J,{onClick:()=>g("dark"),className:`
|
||||
`,children:[d.jsx(de,{name:Je.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>g("dark"),className:`
|
||||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||||
${f==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
||||
`,children:[c.jsx(ge,{name:rt.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Sd=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:Nn,default:Nn},Symbol.toStringTag,{value:"Module"})),ps={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},_d="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Ed="grayscale opacity-50",Eo={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Jr=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const d=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=C.useMemo(()=>[ps[n]||ps.md,_d,u?Ed:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?Eo.guest:u?Eo.withdrawn:Eo.normal,x=()=>g?c.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:c.jsx(ge,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?c.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:c.jsx(ge,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):c.jsx(j,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return c.jsx(j,{className:p,id:f,...h,children:d&&!g&&!u?c.jsx(zt,{src:d,alt:i,className:"w-full h-full object-cover"}):x()})},Td=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Jr},Symbol.toStringTag,{value:"Module"})),Nd=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...e)=>console.log("[Comp:SlotContainer]",...e),warn:(...e)=>console.warn("[Comp:SlotContainer]",...e),error:(...e)=>console.error("[Comp:SlotContainer]",...e)};function ms(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const An=({slotId:e,className:t="",emptyContent:r,style:n,id:o,children:a})=>{const[s,l]=C.useState([]),[,f]=C.useState({}),h=C.useCallback(()=>{const p=window.__slotContextValue;if(p)return p;const m=window.G7Core;return m&&m.getSlotContext?.()||null},[]),d=C.useCallback(()=>{const p=h();p&&p.isEnabled&&l(p.getSlotComponents(e))},[e,h]);C.useEffect(()=>{const p=h();return!p||!p.isEnabled?void 0:(d(),p.subscribeToSlot(e,()=>{d(),f({})}))},[e,h,d]);const i=C.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?c.jsx(j,{className:t,style:n,id:o,children:r}):a?c.jsx(j,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(Nd.error("G7Core or DynamicRenderer not available"),null):c.jsxs(j,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:x,parentFormContext:k,getParentComponentContext:M,translationContext:v}=p,E=ms(m,o);return c.jsx(u,{componentDef:E,dataContext:x,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:M?.(),parentFormContextProp:k,isRootRenderer:!1},E.id||`slot-${e}-${p.order}`)}),a]})},Ad=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:An,default:An,scopeSlotChildDef:ms},Symbol.toStringTag,{value:"Module"})),On=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:h=!1,onNotificationClick:d,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:x,dropdownAlign:k="right",className:M="",id:v,editorAttrs:E})=>{const[A,_]=C.useState(!1),O=C.useRef(null),w=C.useRef(null),y=C.useRef(null),T=C.useRef(null),I=C.useRef(new Set),F=C.useRef(u),D=C.useRef(r),L=C.useRef(n),$=C.useRef(e.length),S=C.useRef(-1);C.useEffect(()=>{F.current=u,D.current=r,L.current=n,$.current=e.length}),C.useEffect(()=>{if(!T.current||!y.current||!A)return;S.current=-1;const H=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(L.current||!D.current||S.current!==$.current&&(S.current=$.current,F.current?.()))},{root:y.current,threshold:.1});return H.observe(T.current),()=>H.disconnect()},[A]),C.useEffect(()=>{if(!y.current||!A)return;const H=new IntersectionObserver(B=>{B.forEach(X=>{const G=X.target.getAttribute("data-notification-id"),W=X.target.getAttribute("data-unread")==="true";G&&W&&X.isIntersecting&&I.current.add(G)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>H.observe(B)),()=>H.disconnect()},[A,
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hd(e,t){return $d(e)||Ud(e,t)||Gd(e,t)||zd()}function Gd(e,t){if(e){if(typeof e=="string")return xs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xs(e,t):void 0}}const ks=Object.entries,Cs=Object.setPrototypeOf,jd=Object.isFrozen,Bd=Object.getPrototypeOf,Wd=Object.getOwnPropertyDescriptor;let ut=Object.freeze,ft=Object.seal,Ar=Object.create,Ss=typeof Reflect<"u"&&Reflect,To=Ss.apply,No=Ss.construct;ut||(ut=function(t){return t}),ft||(ft=function(t){return t}),To||(To=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return t.apply(r,o)}),No||(No=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const Or=tt(Array.prototype.forEach),Kd=tt(Array.prototype.lastIndexOf),_s=tt(Array.prototype.pop),Mr=tt(Array.prototype.push),Vd=tt(Array.prototype.splice),ar=Array.isArray,Rr=tt(String.prototype.toLowerCase),Ao=tt(String.prototype.toString),Es=tt(String.prototype.match),en=tt(String.prototype.replace),Ts=tt(String.prototype.indexOf),Yd=tt(String.prototype.trim),Xd=tt(Number.prototype.toString),Zd=tt(Boolean.prototype.toString),Ns=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),As=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),at=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),st=tt(RegExp.prototype.test),hr=qd(TypeError);function tt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return To(e,t,n)}}function qd(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return No(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(Cs&&Cs(e,null),!ar(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(jd(t)||(t[n]=a),o=a)}e[o]=!0}return e}function Qd(e){for(let t=0;t<e.length;t++)at(e,t)||(e[t]=null);return e}function yt(e){const t=Ar(null);for(const n of ks(e)){var r=Hd(n,2);const o=r[0],a=r[1];at(e,o)&&(ar(a)?t[o]=Qd(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=yt(a):t[o]=a)}return t}function Jd(e){switch(typeof e){case"string":return e;case"number":return Xd(e);case"boolean":return Zd(e);case"bigint":return Ns?Ns(e):"0";case"symbol":return As?As(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Zt(t,"toString");if(typeof r=="function"){const n=r(t);return typeof n=="string"?n:tn(n)}return tn(e)}default:return tn(e)}}function Zt(e,t){for(;e!==null;){const n=Wd(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=Bd(e)}function r(){return null}return r}function Rd(e){try{return st(e,""),!0}catch{return!1}}const Os=ut(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Oo=ut(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mo=ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),eu=ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","s
Line truncated
|
||||
`+Yt),re&&(Yt=mo(Yt)),_&&le?F(Yt):Yt},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rs(R),Me=!0,Xe=ce,Fe=Se},t.clearConfig=function(){Zr=null,Me=!1,Xe=null,Fe=null,_=w,O=""},t.isValidAttribute=function(R,P,V){Zr||rs({});const q=Qe(R),de=Qe(P);return rd(q,de,V)},t.addHook=function(R,P){typeof P=="function"&&at(Y,R)&&Mr(Y[R],P)},t.removeHook=function(R,P){if(at(Y,R)){if(P!==void 0){const V=Kd(Y[R],P);return V===-1?void 0:Vd(Y[R],V,1)[0]}return _s(Y[R])}},t.removeHooks=function(R){at(Y,R)&&(Y[R]=[])},t.removeAllHooks=function(){Y=$s()},t}var Do=Us();const pu=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&n.preferredCurrency||"KRW"},[t,r]=C.useState(e);return C.useEffect(()=>{const n=window.G7Core?.state?.subscribe;if(r(e()),typeof n!="function")return;const o=n(a=>{r(a&&a.preferredCurrency||"KRW")});return typeof o=="function"?o:void 0},[]),t},mu=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},bu=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},zs=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=pu(),f=v=>{const E=`multi_currency_${v}`,A=e[E];if(A&&A[l])return A[l].formatted;const _=`${v}_formatted`;return e[_]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",d=f("selling_price"),i=f("list_price"),u=e.discount_rate&&e.discount_rate>0,g=e.sales_status&&e.sales_status!=="on_sale",p=e.labels??[],m=v=>Do.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),x=e.name_highlighted,k=e.description_highlighted??e.short_description,M=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,E=e.product_code??e.id;mu(`${v}/products/${E}`,n)}};return c.jsxs(J,{onClick:M,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${o}`,id:a,...s,children:[c.jsxs(j,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[c.jsx(zt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&c.jsx(j,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:c.jsx(te,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),u&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&c.jsxs(te,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),p.length>0&&c.jsx(j,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,E)=>c.jsx(te,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},E))})]}),c.jsxs(j,{className:"p-4",children:[c.jsxs(j,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&c.jsx(te,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&c.jsx(te,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),x?c.jsx(j,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(x)}}):c.jsx(Tn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),k&&c.jsx(j,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(k)}}),c.jsxs(j,{className:"mt-1.5 flex items-center gap-1",children:[bu(e.rating_avg??0).map((v,E)=>c.jsxs(te,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&c.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&c.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&c.jsx("i",{className:"fa-regular fa-star"})]},E)),c.jsx(te,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),c.jsxs(te,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),c.jsxs(j,{className:"mt-2 flex items-baseline gap-2",children:[c.jsx(te,{className:"font-bold text-gray-900 dark:text-white",children:d}),i&&u&&c.jsx(te,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},yu=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"})),vu={ALLOWED_TAGS:["svg","g","defs","title","desc","rect","circle","ellipse","
Line truncated
|
||||
`,children:[d.jsx(de,{name:Je.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Jc=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:hn,default:hn},Symbol.toStringTag,{value:"Module"})),Qa={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},Rc="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",ed="grayscale opacity-50",co={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Ur=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const c=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=k.useMemo(()=>[Qa[n]||Qa.md,Rc,u?ed:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?co.guest:u?co.withdrawn:co.normal,w=()=>g?d.jsx(W,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(de,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?d.jsx(W,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(de,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):d.jsx(W,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return d.jsx(W,{className:p,id:f,...h,children:c&&!g&&!u?d.jsx(Lt,{src:c,alt:i,className:"w-full h-full object-cover"}):w()})},td=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Ur},Symbol.toStringTag,{value:"Module"})),rd=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...e)=>console.log("[Comp:SlotContainer]",...e),warn:(...e)=>console.warn("[Comp:SlotContainer]",...e),error:(...e)=>console.error("[Comp:SlotContainer]",...e)};function Ja(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const pn=({slotId:e,className:t="",emptyContent:r,style:n,id:o,children:a})=>{const[s,l]=k.useState([]),[,f]=k.useState({}),h=k.useCallback(()=>{const p=window.__slotContextValue;if(p)return p;const m=window.G7Core;return m&&m.getSlotContext?.()||null},[]),c=k.useCallback(()=>{const p=h();p&&p.isEnabled&&l(p.getSlotComponents(e))},[e,h]);k.useEffect(()=>{const p=h();return!p||!p.isEnabled?void 0:(c(),p.subscribeToSlot(e,()=>{c(),f({})}))},[e,h,c]);const i=k.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?d.jsx(W,{className:t,style:n,id:o,children:r}):a?d.jsx(W,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(rd.error("G7Core or DynamicRenderer not available"),null):d.jsxs(W,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:w,parentFormContext:C,getParentComponentContext:O,translationContext:v}=p,E=Ja(m,o);return d.jsx(u,{componentDef:E,dataContext:w,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:O?.(),parentFormContextProp:C,isRootRenderer:!1},E.id||`slot-${e}-${p.order}`)}),a]})},nd=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:pn,default:pn,scopeSlotChildDef:Ja},Symbol.toStringTag,{value:"Module"})),mn=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:h=!1,onNotificationClick:c,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:w,dropdownAlign:C="right",className:O="",id:v,editorAttrs:E})=>{const[I,_]=k.useState(!1),M=k.useRef(null),x=k.useRef(null),y=k.useRef(null),T=k.useRef(null),A=k.useRef(new Set),P=k.useRef(u),D=k.useRef(r),L=k.useRef(n),U=k.useRef(e.length),S=k.useRef(-1);k.useEffect(()=>{P.current=u,D.current=r,L.current=n,U.current=e.length}),k.useEffect(()=>{if(!T.current||!y.current||!I)return;S.current=-1;const G=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(L.current||!D.current||S.current!==U.current&&(S.current=U.current,P.current?.()))},{root:y.current,threshold:.1});return G.observe(T.current),()=>G.disconnect()},[I]),k.useEffect(()=>{if(!y.current||!I)return;const G=new IntersectionObserver(B=>{B.forEach(K=>{const j=K.target.getAttribute("data-notification-id"),H=K.target.getAttribute("data-unread")==="true";j&&H&&K.isIntersecting&&A.current.add(j)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[I,e
Line truncated
|
||||
`+wt),Ge&&bn([P,D,L],Qt=>{wt=Hr(wt,Qt," ")}),E&&Le?E.createHTML(wt):wt},t.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qe(ge),Me=!0},t.clearConfig=function(){Be=null,Me=!1},t.isValidAttribute=function(ge,z,Z){Be||qe({});const ce=$e(ge),Ye=$e(z);return Nc(ce,Ye,Z)},t.addHook=function(ge,z){typeof z=="function"&&zr(A[ge],z)},t.removeHook=function(ge,z){if(z!==void 0){const Z=hd(A[ge],z);return Z===-1?void 0:pd(A[ge],Z,1)[0]}return as(A[ge])},t.removeHooks=function(ge){A[ge]=[]},t.removeAllHooks=function(){A=gs()},t}var wo=hs();const Id=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&(n.preferredCurrency||n.defaultCurrency)||""},[t,r]=k.useState(e);return k.useEffect(()=>{const n=window.G7Core?.state?.subscribe;if(r(e()),typeof n!="function")return;const o=n(a=>{r(a&&(a.preferredCurrency||a.defaultCurrency)||"")});return typeof o=="function"?o:void 0},[]),t},Dd=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},Ld=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},ps=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=Id(),f=v=>{const E=`multi_currency_${v}`,I=e[E];if(I&&I[l])return I[l].formatted;const _=`${v}_formatted`;return e[_]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",c=f("selling_price"),i=f("list_price"),u=e.discount_rate&&e.discount_rate>0,g=e.sales_status&&e.sales_status!=="on_sale",p=e.labels??[],m=v=>wo.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),w=e.name_highlighted,C=e.description_highlighted??e.short_description,O=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,E=e.product_code??e.id;Dd(`${v}/products/${E}`,n)}};return d.jsxs(Q,{onClick:O,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${o}`,id:a,...s,children:[d.jsxs(W,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[d.jsx(Lt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&d.jsx(W,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:d.jsx(R,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),u&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&d.jsxs(R,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),p.length>0&&d.jsx(W,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,E)=>d.jsx(R,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},E))})]}),d.jsxs(W,{className:"p-4",children:[d.jsxs(W,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&d.jsx(R,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&d.jsx(R,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),w?d.jsx(W,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(w)}}):d.jsx(gn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),C&&d.jsx(W,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(C)}}),d.jsxs(W,{className:"mt-1.5 flex items-center gap-1",children:[Ld(e.rating_avg??0).map((v,E)=>d.jsxs(R,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&d.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&d.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&d.jsx("i",{className:"fa-regular fa-star"})]},E)),d.jsx(R,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),d.jsxs(R,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),d.jsxs(W,{className:"mt-2 flex items-baseline gap-2",children:[d.jsx(R,{className:"font-bold text-gray-900 dark:text-white",children:c}),i&&u&&d.jsx(R,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},Pd=Object.freeze(Object.defineProperty({__proto__:null,default:ps},Symbol.toStringTag,{value:"Module"})),$d={ALLOWED_TAGS:["svg","g","defs","title","desc","rect","circle","ellips
Line truncated
|
||||
inline-flex items-center rounded-full border transition-colors
|
||||
${f[o]}
|
||||
${p?`${u.activeColor} border-transparent`:"border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}
|
||||
`,title:ri(u.labelKey),children:[c.jsx(te,{className:h[o],children:u.emoji}),c.jsx(te,{children:ri(u.labelKey)}),g>0&&c.jsx(te,{className:"font-medium",children:g})]},u.type)})})},Ig=Object.freeze(Object.defineProperty({__proto__:null,default:ni},Symbol.toStringTag,{value:"Module"})),jn=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},Mt=(e,t)=>window.G7Core?.t?.(e,t)??e,oi=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l="",id:f,editorAttrs:h})=>{const d=C.useRef(null),[i,u]=C.useState(t),[g,p]=C.useState(!1),[m,x]=C.useState(!1),[k,M]=C.useState("");C.useEffect(()=>{d.current&&!d.current.innerHTML&&(d.current.innerHTML=t)},[t]),C.useEffect(()=>{n&&n(i)},[i,n]);const v=T=>{jn.log("Apply format:",T)},E=async T=>{const I=new FormData;I.append("file",T);try{const F=await fetch(o,{method:"POST",body:I,credentials:"include"});if(!F.ok)throw new Error("업로드 실패");const D=await F.json();jn.log("Image uploaded:",D.url)}catch(F){jn.error("이미지 업로드 오류:",F)}},A=T=>{const I=T.target.files?.[0];I&&E(I)},_=()=>{k&&(jn.log("Insert link:",k),x(!1),M(""))},O=[{format:"bold",icon:"B",title:Mt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Mt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Mt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Mt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Mt("editor.toolbar.code")}],w=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Mt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Mt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Mt("editor.toolbar.blockquote")}];return c.jsxs(j,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[c.jsxs(j,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:O.map(T=>c.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:w.map(T=>c.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:T.label},T.format))}),c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(T=>c.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),c.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[c.jsx(J,{type:"button",onClick:()=>x(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:Mt("editor.toolbar.link"),children:"🔗"}),c.jsxs(Nr,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",c.jsx(Et,{type:"file",accept:"image/*",onChange:A,disabled:s,className:"hidden"})]})]}),c.jsxs(J,{type:"button",onClick:()=>p(!g),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${g?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",Mt("editor.toolbar.code_view")]})]}),g?c.jsx(wo,{value:i,onChange:T=>u(T.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):c.jsx(j,{ref:d,contentEditable:!s,onInput:T=>u(T.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),c.jsx(Et,{type:"hidden",name:e,value:i}),m&&c.jsx(j,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:c.jsxs(j,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[c.jsx(Tn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:Mt("edi
Line truncated
|
||||
`,title:Ml(u.labelKey),children:[d.jsx(R,{className:h[o],children:u.emoji}),d.jsx(R,{children:Ml(u.labelKey)}),g>0&&d.jsx(R,{className:"font-medium",children:g})]},u.type)})})},Yf=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),Mn=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},St=(e,t)=>window.G7Core?.t?.(e,t)??e,Il=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l="",id:f,editorAttrs:h})=>{const c=k.useRef(null),[i,u]=k.useState(t),[g,p]=k.useState(!1),[m,w]=k.useState(!1),[C,O]=k.useState("");k.useEffect(()=>{c.current&&!c.current.innerHTML&&(c.current.innerHTML=t)},[t]),k.useEffect(()=>{n&&n(i)},[i,n]);const v=T=>{Mn.log("Apply format:",T)},E=async T=>{const A=new FormData;A.append("file",T);try{const P=await fetch(o,{method:"POST",body:A,credentials:"include"});if(!P.ok)throw new Error("업로드 실패");const D=await P.json();Mn.log("Image uploaded:",D.url)}catch(P){Mn.error("이미지 업로드 오류:",P)}},I=T=>{const A=T.target.files?.[0];A&&E(A)},_=()=>{C&&(Mn.log("Insert link:",C),w(!1),O(""))},M=[{format:"bold",icon:"B",title:St("editor.toolbar.bold")},{format:"italic",icon:"I",title:St("editor.toolbar.italic")},{format:"underline",icon:"U",title:St("editor.toolbar.underline")},{format:"strike",icon:"S",title:St("editor.toolbar.strike")},{format:"code",icon:"</>",title:St("editor.toolbar.code")}],x=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:St("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:St("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:St("editor.toolbar.blockquote")}];return d.jsxs(W,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[d.jsxs(W,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:M.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:x.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:T.label},T.format))}),d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsxs(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(Q,{type:"button",onClick:()=>w(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:St("editor.toolbar.link"),children:"🔗"}),d.jsxs(yr,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",d.jsx(xt,{type:"file",accept:"image/*",onChange:I,disabled:s,className:"hidden"})]})]}),d.jsxs(Q,{type:"button",onClick:()=>p(!g),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${g?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",St("editor.toolbar.code_view")]})]}),g?d.jsx(no,{value:i,onChange:T=>u(T.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):d.jsx(W,{ref:c,contentEditable:!s,onInput:T=>u(T.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),d.jsx(xt,{type:"hidden",name:e,value:i}),m&&d.jsx(W,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs(W,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[d.jsx(gn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:St("editor
Line truncated
|
||||
whitespace-pre-wrap
|
||||
text-gray-900 dark:text-gray-100
|
||||
font-sans
|
||||
${n}
|
||||
`.trim().replace(/\s+/g," ");return c.jsx(j,{className:i,id:a,...s,children:l})}const f={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},h=C.useMemo(()=>{const i=o?{...f,...o,FORBID_TAGS:[...f.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...f.FORBID_ATTR,...o.FORBID_ATTR||[]]}:f;return Do.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,x)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${x} rel="noopener noreferrer">`:g)},[l,o]),d=`
|
||||
`.trim().replace(/\s+/g," ");return d.jsx(W,{className:i,id:a,...s,children:l})}const f={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},h=k.useMemo(()=>{const i=o?{...f,...o,FORBID_TAGS:[...f.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...f.FORBID_ATTR,...o.FORBID_ATTR||[]]}:f;return wo.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,w)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${w} rel="noopener noreferrer">`:g)},[l,o]),c=`
|
||||
prose dark:prose-invert max-w-none
|
||||
prose-p:my-2
|
||||
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
|
||||
@@ -40,7 +39,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
||||
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
|
||||
after:content-[''] after:block after:clear-both
|
||||
${n}
|
||||
`.trim().replace(/\s+/g," ");return c.jsx(j,{id:a,className:d,dangerouslySetInnerHTML:{__html:h},...s})},Dg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ca},Symbol.toStringTag,{value:"Module"})),da=()=>window.G7Core,ua=(e,t)=>da()?.t?.(e,t)??e,ai=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:d="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[x,k]=C.useState(r),[M,v]=C.useState(e),[E,A]=C.useState(!1);C.useEffect(()=>{k(r)},[r]),C.useEffect(()=>{v(e)},[e]);const _=C.useCallback(y=>{const T=y.target.value;if(v(T),t){const I=da()?.createChangeEvent?.({value:T,name:i,type:"textarea"})??{target:{name:i,value:T}};t(I)}},[t,i]),O=C.useCallback(y=>{const T=y.target.checked;if(k(T),T||A(!1),n){const I=da()?.createChangeEvent?.({checked:T,name:u,type:"checkbox"})??{target:{name:u,checked:T}};n(I)}},[n,u]),w=C.useCallback(()=>{A(y=>!y)},[]);return c.jsxs(j,{className:`space-y-2 ${d}`,id:p,...m,children:[c.jsxs(j,{className:"flex items-center justify-between",children:[s&&c.jsx(Nr,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),c.jsxs(j,{className:"flex items-center gap-3",children:[x&&!g&&c.jsx(J,{type:"button",onClick:w,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${E?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:ua(E?"common.preview_off":"common.preview")}),l&&c.jsxs(Nr,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[c.jsx(Et,{type:"checkbox",name:u,checked:x,onChange:O,disabled:g,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),c.jsx(j,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:ua("common.html_mode")})]})]})]}),!E&&c.jsx(wo,{name:i,value:M,onChange:_,placeholder:a,rows:o,readOnly:g,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${x?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`}),E&&c.jsx(j,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:c.jsx(ca,{content:M,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Lg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:ai},Symbol.toStringTag,{value:"Module"})),si=e=>window.G7Core?.t?.(e)??e,fa=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=C.useState(!1),[h,d]=C.useState(!1),i=C.useRef(null),u=C.useCallback(()=>{if(i.current){const x=i.current.scrollHeight;d(x>e)}},[e]);C.useEffect(()=>{u();const x=i.current;if(!x)return;const k=x.querySelectorAll("img");k.forEach(v=>{v.complete||v.addEventListener("load",u)});let M=null;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(u),M.observe(x)),()=>{k.forEach(v=>{v.removeEventListener("load",u)}),M?.disconnect()}},[u,o]);const g=()=>{f(x=>!x)},p=t||si("sirsoft-ecommerce.shop.product.expand_detail"),m=r||si("sirsoft-ecommerce.shop.product.collapse_detail");return c.jsxs(j,{className:n,id:a,...s,children:[c.jsxs(j,{className:"relative",children:[c.jsx(j,{ref:i,className:!l&&h?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!l&&h?{maxHeight:`${e}px`}:void 0,children:o}),!l&&h&&c.jsx(j,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),h&&c.jsxs(J,{type:"button",onClick:g,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[c.jsx(te,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),c.jsx(ge,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Fg=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:fa,default:fa},Symbol.toStringTag,{value:"Module"})),$g=(e,t)=>window.G7Core?.t?.(e,t)??e
Line truncated
|
||||
`.trim().replace(/\s+/g," ");return d.jsx(W,{id:a,className:c,dangerouslySetInnerHTML:{__html:h},...s})},qf=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:qo},Symbol.toStringTag,{value:"Module"})),Zo=()=>window.G7Core,Qo=(e,t)=>Zo()?.t?.(e,t)??e,Dl=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:c="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[w,C]=k.useState(r),[O,v]=k.useState(e),[E,I]=k.useState(!1);k.useEffect(()=>{C(r)},[r]),k.useEffect(()=>{v(e)},[e]);const _=k.useCallback(y=>{const T=y.target.value;if(v(T),t){const A=Zo()?.createChangeEvent?.({value:T,name:i,type:"textarea"})??{target:{name:i,value:T}};t(A)}},[t,i]),M=k.useCallback(y=>{const T=y.target.checked;if(C(T),T||I(!1),n){const A=Zo()?.createChangeEvent?.({checked:T,name:u,type:"checkbox"})??{target:{name:u,checked:T}};n(A)}},[n,u]),x=k.useCallback(()=>{I(y=>!y)},[]);return d.jsxs(W,{className:`space-y-2 ${c}`,id:p,...m,children:[d.jsxs(W,{className:"flex items-center justify-between",children:[s&&d.jsx(yr,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),d.jsxs(W,{className:"flex items-center gap-3",children:[w&&!g&&d.jsx(Q,{type:"button",onClick:x,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${E?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:Qo(E?"common.preview_off":"common.preview")}),l&&d.jsxs(yr,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(xt,{type:"checkbox",name:u,checked:w,onChange:M,disabled:g,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),d.jsx(W,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Qo("common.html_mode")})]})]})]}),!E&&d.jsx(no,{name:i,value:O,onChange:_,placeholder:a,rows:o,readOnly:g,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${w?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`}),E&&d.jsx(W,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:d.jsx(qo,{content:O,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Zf=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:Dl},Symbol.toStringTag,{value:"Module"})),Ll=e=>window.G7Core?.t?.(e)??e,Jo=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=k.useState(!1),[h,c]=k.useState(!1),i=k.useRef(null),u=k.useCallback(()=>{if(i.current){const w=i.current.scrollHeight;c(w>e)}},[e]);k.useEffect(()=>{u();const w=i.current;if(!w)return;const C=w.querySelectorAll("img");C.forEach(v=>{v.complete||v.addEventListener("load",u)});let O=null;return typeof ResizeObserver<"u"&&(O=new ResizeObserver(u),O.observe(w)),()=>{C.forEach(v=>{v.removeEventListener("load",u)}),O?.disconnect()}},[u,o]);const g=()=>{f(w=>!w)},p=t||Ll("sirsoft-ecommerce.shop.product.expand_detail"),m=r||Ll("sirsoft-ecommerce.shop.product.collapse_detail");return d.jsxs(W,{className:n,id:a,...s,children:[d.jsxs(W,{className:"relative",children:[d.jsx(W,{ref:i,className:!l&&h?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!l&&h?{maxHeight:`${e}px`}:void 0,children:o}),!l&&h&&d.jsx(W,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),h&&d.jsxs(Q,{type:"button",onClick:g,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[d.jsx(R,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),d.jsx(de,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Qf=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:Jo,default:Jo},Symbol.toStringTag,{value:"Module"})),Jf=(e,t)=>window.G7Core?.t?.(e,t)??e,
Line truncated
|
||||
let scriptImported = false
|
||||
self.addEventListener('message', async (e) => {
|
||||
const { file, id, imageCompressionLibUrl, options } = e.data
|
||||
@@ -59,20 +58,20 @@ self.addEventListener('message', async (e) => {
|
||||
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
||||
}
|
||||
})
|
||||
`;let ya;function Xg(e,t){return new Promise(((r,n)=>{ya||(ya=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(Yg));const o=new Worker(ya);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function mt(e,t){return new Promise((function(r,n){let o,a,s,l,f,h;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=g=>{s=g,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof Vg))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(h=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||h)return wi(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var d=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return wi(e,o).then((function(p){try{return a=p,d()}catch(m){return n(m)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Xg(e,o).then((function(g){try{return a=g,d()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=ci(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=gi,mt.getFilefromDataUrl=ba,mt.loadImage=hi,mt.drawImageInCanvas=mi,mt.drawFileInCanvas=Yn,mt.canvasToFile=Xn,mt.getExifOrientation=bi,mt.handleMaxWidthOrHeight=yi,mt.followExifOrientation=vi,mt.cleanupCanvasMemory=qt,mt.isAutoOrientationInBrowser=Gr,mt.approximateBelowMaximumCanvasSizeOfBrowser=pi,mt.copyExifWithoutOrientation=ci,mt.getBrowserName=kr,mt.version="2.0.2";const Zg=window.G7Core,Zn=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},xi=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},ki=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",nt=(e,t)=>Zg?.t?.(e,t)??e,Cr=window.G7Core;function Ci(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:d,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:x,onReorder:k,uploadTriggerEvent:M,confirmBeforeRemove:v,uploadParams:E}=e,[A,_]=C.useState(i),[O,w]=C.useState([]),[y,T]=C.useState(!1),I=C.useRef(null),F=C.useRef(0),D=C.useRef(new Set),L=C.useRef(new Map),[$,S]=C.useState(!1),[b,z]=C.useState(null),[U,H]=C.useState(!1),Y=C.useRef(!1),[B,X]=C.useState([]),G=C.useRef(i),[W,Q]=C.useState(!1),[me,se]=C.useState(0),pe=C.useRef(0),[ne,ce]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(O)},[O,g]);const Se=C.useMemo(()=>{const Z=G.current;return Z===i?Z:Z.length!==i.length?(G.current=i,i):Z.length===0&&i.length===0?Z:i.some((he,ue)=>he.id!==Z[ue]?.id)?(G.current=i,i):Z},[i]);C.useEffect(()=>{if(Y.current)return;const Z=Se.filter(ue=>!D.current.has(ue.id)&&(!ue.hash||!D.current.has(ue.hash))),le=new Set(Z.map(ue=>ue.id)),he=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!D.current.has(ue.id));_([...Z,...he])},[Se]);const ze=C.useCallback(async Z=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await mt(Z,le)},[f]),ie=C.useCallback(async Z=>{const le=A.length+O.length,he=Math.max(0,o-le),ue=Array.from(Z).slice(0,he);if(Z.length>he){const fe=Array.from(Z).slice(he),Le=nt("attachment.upload_limit_exceeded",{max:o});m?.(Le,fe[0]??Z[0])}for(const fe of ue){if(fe.size>a*1024*1024){m?.(`[${fe.name}] 파일 크기(${Zn(fe.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,fe);continue}if(l){const _e="."+fe.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(He=>He.trim().toLowerCase()).some(He=>{if(He.includes("/")){if(He.endsWith("/*
Line truncated
|
||||
`;let oa;function cg(e,t){return new Promise(((r,n)=>{oa||(oa=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(ig));const o=new Worker(oa);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function ct(e,t){return new Promise((function(r,n){let o,a,s,l,f,h;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=g=>{s=g,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof lg))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(h=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||h)return Xl(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var c=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return Xl(e,o).then((function(p){try{return a=p,c()}catch(m){return n(m)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",cg(e,o).then((function(g){try{return a=g,c()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=Fl(e,a))}catch{}return r(a)}}))}ct.getDataUrlFromFile=Gl,ct.getFilefromDataUrl=na,ct.loadImage=jl,ct.drawImageInCanvas=Wl,ct.drawFileInCanvas=Pn,ct.canvasToFile=$n,ct.getExifOrientation=Vl,ct.handleMaxWidthOrHeight=Kl,ct.followExifOrientation=Yl,ct.cleanupCanvasMemory=Kt,ct.isAutoOrientationInBrowser=Nr,ct.approximateBelowMaximumCanvasSizeOfBrowser=Bl,ct.copyExifWithoutOrientation=Fl,ct.getBrowserName=fr,ct.version="2.0.2";const dg=window.G7Core,Fn=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},ql=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},Zl=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",Re=(e,t)=>dg?.t?.(e,t)??e,gr=window.G7Core;function Ql(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:c,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:w,onReorder:C,uploadTriggerEvent:O,confirmBeforeRemove:v,uploadParams:E}=e,[I,_]=k.useState(i),[M,x]=k.useState([]),[y,T]=k.useState(!1),A=k.useRef(null),P=k.useRef(0),D=k.useRef(new Set),L=k.useRef(new Map),[U,S]=k.useState(!1),[b,F]=k.useState(null),[$,G]=k.useState(!1),Y=k.useRef(!1),[B,K]=k.useState([]),j=k.useRef(i),[H,q]=k.useState(!1),[ue,te]=k.useState(0),fe=k.useRef(0),[ee,ke]=k.useState(new Map),me=k.useRef(new Map);k.useEffect(()=>{g?.(M)},[M,g]);const Ge=k.useMemo(()=>{const X=j.current;return X===i?X:X.length!==i.length?(j.current=i,i):X.length===0&&i.length===0?X:i.some((ie,le)=>ie.id!==X[le]?.id)?(j.current=i,i):X},[i]);k.useEffect(()=>{if(Y.current)return;const X=Ge.filter(le=>!D.current.has(le.id)&&(!le.hash||!D.current.has(le.hash))),se=new Set(X.map(le=>le.id)),ie=Array.from(L.current.values()).filter(le=>!se.has(le.id)&&!D.current.has(le.id));_([...X,...ie])},[Ge]);const De=k.useCallback(async X=>{const se={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await ct(X,se)},[f]),ye=k.useCallback(async X=>{const se=I.length+M.length,ie=Math.max(0,o-se),le=Array.from(X).slice(0,ie);if(X.length>ie){const ne=Array.from(X).slice(ie),Te=Re("attachment.upload_limit_exceeded",{max:o});m?.(Te,ne[0]??X[0])}for(const ne of le){if(ne.size>a*1024*1024){m?.(`[${ne.name}] 파일 크기(${Fn(ne.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,ne);continue}if(l){const ve="."+ne.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(Ue=>Ue.trim().toLowerCase()).some(Ue=>{if(Ue.includes("/")){if(Ue.endsWith("/*
Line truncated
|
||||
relative border-2 border-dashed rounded-lg transition-colors
|
||||
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
||||
`,onDragOver:h=>{h.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:h=>{h.preventDefault(),n(!1),t&&r(h.dataTransfer.files)},children:[c.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&c.jsxs(j,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[c.jsx(Ot,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),c.jsx(Ut,{className:"text-sm text-gray-600 dark:text-gray-400",children:nt("attachment.drop_or_click")}),c.jsxs(Ut,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[nt("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function qg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const qn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function va(e){return"nodeType"in e}function Ct(e){var t,r;return e?jr(e)?e:va(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function wa(e){const{Document:t}=Ct(e);return e instanceof t}function dn(e){return jr(e)?!1:e instanceof Ct(e).HTMLElement}function _i(e){return e instanceof Ct(e).SVGElement}function Br(e){return e?jr(e)?e.document:va(e)?wa(e)?e:dn(e)||_i(e)?e.ownerDocument:document:document:document}const Qt=qn?C.useLayoutEffect:C.useEffect;function xa(e){const t=C.useRef(e);return Qt(()=>{t.current=e}),C.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Qg(){const e=C.useRef(null),t=C.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function un(e,t){t===void 0&&(t=[e]);const r=C.useRef(e);return Qt(()=>{r.current!==e&&(r.current=e)},t),r}function fn(e,t){const r=C.useRef();return C.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Qn(e){const t=xa(e),r=C.useRef(null),n=C.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ka(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Ca={};function gn(e,t){return C.useMemo(()=>{if(t)return t;const r=Ca[e]==null?0:Ca[e]+1;return Ca[e]=r,e+"-"+r},[e,t])}function Ei(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,h]of l){const d=a[f];d!=null&&(a[f]=d+e*h)}return a},{...t})}}const Wr=Ei(1),hn=Ei(-1);function Jg(e){return"clientX"in e&&"clientY"in e}function Sa(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Rg(e){if(!e)return!1;const{TouchEvent:t}=Ct(e.target);return t&&e instanceof t}function _a(e){if(Rg(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Jg(e)?{x:e.clientX,y:e.clientY}:null}const pn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pn.Translate.toString(e),pn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Ti="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function eh(e){return e.matches(Ti)?e:e.querySelector(Ti)}const th={display:"none"};function rh(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:th},r)}function nh(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function oh(){const[e,t]=C.useState("");return{announce:C.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Ni=C.createContext(null);function ah(e){const t=C.useContext(Ni);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function sh(){const[e]=C.useState(()=>new Set),t=C.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[C.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const lh={draggable:`
|
||||
`,onDragOver:h=>{h.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:h=>{h.preventDefault(),n(!1),t&&r(h.dataTransfer.files)},children:[d.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&d.jsxs(W,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[d.jsx(Ct,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(Dt,{className:"text-sm text-gray-600 dark:text-gray-400",children:Re("attachment.drop_or_click")}),d.jsxs(Dt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[Re("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function ug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Un=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ar(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function aa(e){return"nodeType"in e}function yt(e){var t,r;return e?Ar(e)?e:aa(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function sa(e){const{Document:t}=yt(e);return e instanceof t}function Qr(e){return Ar(e)?!1:e instanceof yt(e).HTMLElement}function Rl(e){return e instanceof yt(e).SVGElement}function Mr(e){return e?Ar(e)?e.document:aa(e)?sa(e)?e:Qr(e)||Rl(e)?e.ownerDocument:document:document:document}const Yt=Un?k.useLayoutEffect:k.useEffect;function la(e){const t=k.useRef(e);return Yt(()=>{t.current=e}),k.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function fg(){const e=k.useRef(null),t=k.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Jr(e,t){t===void 0&&(t=[e]);const r=k.useRef(e);return Yt(()=>{r.current!==e&&(r.current=e)},t),r}function Rr(e,t){const r=k.useRef();return k.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function zn(e){const t=la(e),r=k.useRef(null),n=k.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ia(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let ca={};function en(e,t){return k.useMemo(()=>{if(t)return t;const r=ca[e]==null?0:ca[e]+1;return ca[e]=r,e+"-"+r},[e,t])}function ei(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,h]of l){const c=a[f];c!=null&&(a[f]=c+e*h)}return a},{...t})}}const Or=ei(1),tn=ei(-1);function gg(e){return"clientX"in e&&"clientY"in e}function da(e){if(!e)return!1;const{KeyboardEvent:t}=yt(e.target);return t&&e instanceof t}function hg(e){if(!e)return!1;const{TouchEvent:t}=yt(e.target);return t&&e instanceof t}function ua(e){if(hg(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return gg(e)?{x:e.clientX,y:e.clientY}:null}const rn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[rn.Translate.toString(e),rn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),ti="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function pg(e){return e.matches(ti)?e:e.querySelector(ti)}const mg={display:"none"};function bg(e){let{id:t,value:r}=e;return k.createElement("div",{id:t,style:mg},r)}function yg(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return k.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function vg(){const[e,t]=k.useState("");return{announce:k.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ri=k.createContext(null);function wg(e){const t=k.useContext(ri);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xg(){const[e]=k.useState(()=>new Set),t=k.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[k.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const kg={draggable:`
|
||||
To pick up a draggable item, press the space bar.
|
||||
While dragging, use the arrow keys to move the item.
|
||||
Press space again to drop the item in its new position, or press escape to cancel.
|
||||
`},ih={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ch(e){let{announcements:t=ih,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=lh}=e;const{announce:a,announcement:s}=oh(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),ah(C.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:g}=i;t.onDragMove&&a(t.onDragMove({active:u,over:g}))},onDragOver(i){let{active:u,over:g}=i;a(t.onDragOver({active:u,over:g}))},onDragEnd(i){let{active:u,over:g}=i;a(t.onDragEnd({active:u,over:g}))},onDragCancel(i){let{active:u,over:g}=i;a(t.onDragCancel({active:u,over:g}))}}),[a,t])),!f)return null;const d=C.createElement(C.Fragment,null,C.createElement(rh,{id:n,value:o.draggable}),C.createElement(nh,{id:l,announcement:s}));return r?or.createPortal(d,r):d}var ot;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ot||(ot={}));function Jn(){}function Ai(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function dh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Kt=Object.freeze({x:0,y:0});function Oi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mi(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function uh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Ii(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function Pi(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Di(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const fh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Di(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Oi(Di(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Mi)},gh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Ii(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Ii(f),d=o.reduce((u,g,p)=>u+Oi(h[p],g),0),i=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Mi)};function hh(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,h=e.width*e.height,d=s*l,i=d/(f+h-d);return Number(i.toFixed(4))}return 0}const ph=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=hh(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(uh)};function mh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Li(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Kt}function bh(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const yh=bh(1);function vh(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function wh(e,t,r){const n=vh(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),h=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:d,height:i,top:h,right:f+d,bottom:h+i,left:f}}const xh={ignoreTransform:!1};function Kr(e,t){t===void 0&&(t=xh);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:d}=Ct(e).getComputedStyle(e);h&&(r=wh(r,h,d))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function Fi(e){return Kr(e,{ignoreTransform:!0})}function kh(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ch(e,t){return t===void 0&&(t=Ct(e).getComputedStyle(e)),t.position==="fixed"}function Sh(e,t){t===void 0&&(t=Ct(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","o
Line truncated
|
||||
`},Cg={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Sg(e){let{announcements:t=Cg,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=kg}=e;const{announce:a,announcement:s}=vg(),l=en("DndLiveRegion"),[f,h]=k.useState(!1);if(k.useEffect(()=>{h(!0)},[]),wg(k.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:g}=i;t.onDragMove&&a(t.onDragMove({active:u,over:g}))},onDragOver(i){let{active:u,over:g}=i;a(t.onDragOver({active:u,over:g}))},onDragEnd(i){let{active:u,over:g}=i;a(t.onDragEnd({active:u,over:g}))},onDragCancel(i){let{active:u,over:g}=i;a(t.onDragCancel({active:u,over:g}))}}),[a,t])),!f)return null;const c=k.createElement(k.Fragment,null,k.createElement(bg,{id:n,value:o.draggable}),k.createElement(yg,{id:l,announcement:s}));return r?Jt.createPortal(c,r):c}var et;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(et||(et={}));function Hn(){}function ni(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function _g(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Gt=Object.freeze({x:0,y:0});function oi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ai(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Eg(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function si(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function li(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ii(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Tg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ii(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=oi(ii(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(ai)},Ng=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=si(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=si(f),c=o.reduce((u,g,p)=>u+oi(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(ai)};function Ag(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,h=e.width*e.height,c=s*l,i=c/(f+h-c);return Number(i.toFixed(4))}return 0}const Mg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=Ag(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(Eg)};function Og(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ci(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Gt}function Ig(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const Dg=Ig(1);function Lg(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Pg(e,t,r){const n=Lg(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),h=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:c,height:i,top:h,right:f+c,bottom:h+i,left:f}}const $g={ignoreTransform:!1};function Ir(e,t){t===void 0&&(t=$g);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=yt(e).getComputedStyle(e);h&&(r=Pg(r,h,c))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function di(e){return Ir(e,{ignoreTransform:!0})}function Fg(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ug(e,t){return t===void 0&&(t=yt(e).getComputedStyle(e)),t.position==="fixed"}function zg(e,t){t===void 0&&(t=yt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","o
Line truncated
|
||||
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
||||
min-w-[300px] max-w-md
|
||||
transition-all duration-300
|
||||
${o.bg}
|
||||
${r?"opacity-100 translate-y-0":`opacity-0 ${s}`}
|
||||
`,role:"alert",children:[c.jsx(ge,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),c.jsx(te,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),c.jsx(J,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":$0("common.close"),children:c.jsx(ge,{name:rt.Times,className:"w-4 h-4"})})]})},G0=Object.freeze(Object.defineProperty({__proto__:null,Toast:$a,default:$a},Symbol.toStringTag,{value:"Module"})),j0=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},Ua=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){j0.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?c.jsxs(j,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[c.jsx(j,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:c.jsx(j,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),c.jsx("style",{children:`
|
||||
`,role:"alert",children:[d.jsx(de,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),d.jsx(R,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),d.jsx(Q,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":Jh("common.close"),children:d.jsx(de,{name:Je.Times,className:"w-4 h-4"})})]})},r0=Object.freeze(Object.defineProperty({__proto__:null,Toast:Ca,default:Ca},Symbol.toStringTag,{value:"Module"})),n0=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},Sa=({className:e="",style:t})=>{const[r,n]=k.useState(!1);return k.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){n0.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?d.jsxs(W,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[d.jsx(W,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:d.jsx(W,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),d.jsx("style",{children:`
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
@@ -84,5 +83,5 @@ self.addEventListener('message', async (e) => {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
}
|
||||
`})]}):null},B0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Ua,default:Ua},Symbol.toStringTag,{value:"Module"})),yc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},za=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){yc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{yc.log("isPending changed:",s),n(s)})},[]),r?c.jsx(j,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},W0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:za,default:za},Symbol.toStringTag,{value:"Module"})),vc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},wc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),K0=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),V0=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),Y0=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),X0=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),xc={DataGrid:(e,t)=>c.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[c.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:c.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[c.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>c.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:c.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[c.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),c.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),c.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),c.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>c.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>c.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>c.jsxs("div",{children:[c.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),c.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>c.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>c.jsxs("div",{className:"rounded-lg overflow-hidden",children:[c.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),c.jsxs("div",{className:"p-3 space-y-2",children:[c.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),c.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>c.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>c.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>c.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:c.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:c.jsxs("div",{className:"flex items-center justify-between h-16",children:[c.jsxs("div",{className:"flex items-center gap-8",children:[c.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),c.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>c.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),c.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>c.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-
Line truncated
|
||||
`})]}):null},o0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Sa,default:Sa},Symbol.toStringTag,{value:"Module"})),Ki=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},_a=({className:e="",style:t})=>{const[r,n]=k.useState(!1);return k.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){Ki.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{Ki.log("isPending changed:",s),n(s)})},[]),r?d.jsx(W,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},a0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:_a,default:_a},Symbol.toStringTag,{value:"Module"})),Yi={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Xi=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),s0=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),l0=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),i0=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),c0=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),qi={DataGrid:(e,t)=>d.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>d.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),d.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>d.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>d.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>d.jsxs("div",{children:[d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),d.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>d.jsxs("div",{className:"rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>d.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>d.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>d.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-8",children:[d.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>d.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),d.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>d.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-
Line truncated
|
||||
//# sourceMappingURL=components.iife.js.map
|
||||
+1
-1
@@ -58,5 +58,5 @@ export interface AvatarUploaderProps {
|
||||
/** 레이아웃 편집기 주입 속성 (편집 모드 전용, 루트에 spread) */
|
||||
editorAttrs?: EditorAttrs;
|
||||
}
|
||||
export declare function AvatarUploader({ src, fallbackText, size, uploadEndpoint, deleteEndpoint, onUploadSuccess, onUploadError, onDeleteSuccess, onDeleteError, showDeleteButton, accept, maxSize, className, uploadButtonText, deleteButtonText, readOnly, confirmDelete, deleteConfirmMessage, confirmUpload, uploadConfirmMessage, uploadSuccessActions, uploadErrorActions, deleteSuccessActions, deleteErrorActions, id, editorAttrs, }: AvatarUploaderProps): import("react").JSX.Element;
|
||||
export declare function AvatarUploader({ src, fallbackText, size, uploadEndpoint, deleteEndpoint, onUploadSuccess, onUploadError, onDeleteSuccess, onDeleteError, showDeleteButton, accept, maxSize, className, uploadButtonText, deleteButtonText, readOnly, confirmDelete, deleteConfirmMessage, confirmUpload, uploadConfirmMessage, uploadSuccessActions, uploadErrorActions, deleteSuccessActions, deleteErrorActions, id, editorAttrs, }: AvatarUploaderProps): import("react/jsx-runtime").JSX.Element;
|
||||
export default AvatarUploader;
|
||||
@@ -7,23 +7,25 @@ interface FormatCurrencyParams {
|
||||
/**
|
||||
* 숫자 값을 통화 형식으로 포맷팅합니다.
|
||||
*
|
||||
* 원화 계열(₩/원)은 금액 뒤에 "원", 그 외는 기호를 앞에 붙입니다
|
||||
* (백엔드 messages.currency.prefix/suffix 와 동일한 표기 규칙).
|
||||
*
|
||||
* @param params.value - 포맷팅할 숫자 값
|
||||
* @param params.currencyCode - 통화 코드 (KRW, USD, JPY 등)
|
||||
* @param params.locale - 로케일 (선택, 미지정 시 통화 기본 로케일 사용)
|
||||
* @param params.currencyCode - 통화 코드 (미지정 시 표시 통화 → 기본 통화 순)
|
||||
* @param params.locale - 로케일 (숫자 구분자용, 미지정 시 브라우저 로케일)
|
||||
* @param context - 핸들러 컨텍스트
|
||||
* @returns 포맷팅된 통화 문자열
|
||||
*
|
||||
* @example
|
||||
* formatCurrencyHandler({ value: 10000, currencyCode: 'KRW' }, context)
|
||||
* // => "₩10,000" 또는 "10,000원"
|
||||
*
|
||||
* formatCurrencyHandler({ value: 99.99, currencyCode: 'USD' }, context)
|
||||
* // => "$99.99"
|
||||
* formatCurrencyHandler({ value: 10000, currencyCode: 'KRW' }, context) // => "10,000원"
|
||||
* formatCurrencyHandler({ value: 99.99, currencyCode: 'USD' }, context) // => "$99.99"
|
||||
*/
|
||||
export declare function formatCurrencyHandler(params: FormatCurrencyParams, context: HandlerContext): string;
|
||||
/**
|
||||
* 통화 심볼만 반환합니다.
|
||||
*
|
||||
* 설정의 symbol 을 우선하고, 없으면 폴백 표, 그것도 없으면 통화 코드를 그대로 돌려줍니다.
|
||||
*
|
||||
* @param currencyCode - 통화 코드
|
||||
* @returns 통화 심볼
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"pattern": "/api/modules/sirsoft-ecommerce/*",
|
||||
"headers": {
|
||||
"X-Cart-Key": "{{_global.cartKey}}",
|
||||
"X-Currency": "{{_global.preferredCurrency ?? _global.defaultCurrency ?? 'KRW'}}",
|
||||
"X-Currency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}",
|
||||
"X-Shipping-Country": "{{_global.preferredShippingCountry ?? _global.modules?.['sirsoft-ecommerce']?.shipping?.default_country ?? 'KR'}}"
|
||||
}
|
||||
},
|
||||
@@ -59,14 +59,14 @@
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"defaultCurrency": "{{_global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency ?? 'KRW'}}"
|
||||
"defaultCurrency": "{{_global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_comment": "선호(표시) 통화를 _global 에 동기 주입. 우선순위 = 로그인 유저 계정 영속 통화(currentUser.ecommerce_preferred_currency, D-LOGIN-CUR) > localStorage 세션값(g7_preferred_currency, ISO형식) > 게스트 사이트 언어(g7_locale) 기반 통화 추정(currencies[].locales 매핑, 회원가입 통화 부여와 동일 입력·우선순위) > default_currency > KRW. 핸들러는 이커머스 모듈 소유(sirsoft-ecommerce.initPreferredCurrency) — 통화=커머스 책임. 모듈 미설치 시 미등록 핸들러로 무동작(통화 globals 자체가 빈 값).",
|
||||
"handler": "sirsoft-ecommerce.initPreferredCurrency",
|
||||
"params": {
|
||||
"defaultCurrency": "{{_global.defaultCurrency ?? 'KRW'}}"
|
||||
"defaultCurrency": "{{_global.defaultCurrency}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -132,7 +132,7 @@
|
||||
"handler": "sirsoft-ecommerce.initPreferredCurrency",
|
||||
"params": {
|
||||
"accountCurrency": "{{response.data?.data?.ecommerce_preferred_currency ?? response.data?.ecommerce_preferred_currency}}",
|
||||
"defaultCurrency": "{{_global.defaultCurrency ?? 'KRW'}}"
|
||||
"defaultCurrency": "{{_global.defaultCurrency}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1889,7 +1889,7 @@
|
||||
"availableLocales": "{{$locales}}",
|
||||
"currentLocale": "{{$locale}}",
|
||||
"availableCurrencies": "{{_global.availableCurrencies ?? []}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency ?? 'KRW'}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}",
|
||||
"className": "hidden",
|
||||
"notifications": "{{(notifications?.data?.data ?? []).map(n => ({ id: n.id, title: n.subject ?? '', message: n.body ?? '', time: n.created_at ?? '', read: !!n.read_at, url: n.url ?? '', data: n.data ?? {} }))}}",
|
||||
"notificationHasMore": "{{_global.notificationsHasMore ?? notifications?.data?.pagination?.has_more_pages ?? false}}",
|
||||
|
||||
@@ -5,22 +5,47 @@
|
||||
},
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "relative" },
|
||||
"props": {
|
||||
"className": "relative"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": { "className": "flex items-center gap-1.5 px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors" },
|
||||
"props": {
|
||||
"className": "flex items-center gap-1.5 px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
|
||||
},
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Icon", "props": { "name": "globe", "className": "w-4 h-4" } },
|
||||
{ "type": "basic", "name": "Span", "text": "{{_global.preferredCurrency ?? 'KRW'}}" },
|
||||
{ "type": "basic", "name": "Icon", "props": { "name": "chevron-down", "className": "w-3 h-3" } }
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"name": "globe",
|
||||
"className": "text-base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"name": "chevron-down",
|
||||
"className": "text-xs"
|
||||
}
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setState",
|
||||
"params": { "target": "local", "showCurrencyDropdown": "{{!_local.showCurrencyDropdown}}" }
|
||||
"params": {
|
||||
"target": "local",
|
||||
"showCurrencyDropdown": "{{!_local.showCurrencyDropdown}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -29,12 +54,17 @@
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{_local.showCurrencyDropdown}}",
|
||||
"props": { "className": "absolute right-0 top-full mt-1 w-44 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 py-1 overflow-hidden" },
|
||||
"props": {
|
||||
"className": "absolute right-0 top-full mt-1 w-44 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 py-1 overflow-hidden"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"iteration": { "source": "{{_global.availableCurrencies ?? []}}", "item_var": "currency" },
|
||||
"iteration": {
|
||||
"source": "{{_global.availableCurrencies ?? []}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
@@ -43,21 +73,47 @@
|
||||
"className": "w-full px-4 py-2.5 text-left text-sm flex items-center gap-3 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors {{_global.preferredCurrency === currency.code ? 'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400' : 'text-gray-700 dark:text-gray-300'}}"
|
||||
},
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-base" }, "text": "{{currency.flag}}" },
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "text-base"
|
||||
},
|
||||
"text": "{{currency.flag}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "flex-1" },
|
||||
"props": {
|
||||
"className": "flex-1"
|
||||
},
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium" }, "text": "{{currency.code}}" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-400 ml-1" }, "text": "({{currency.symbol}})" }
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "font-medium"
|
||||
},
|
||||
"text": "{{currency.code}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "text-gray-500 dark:text-gray-400 ml-1"
|
||||
},
|
||||
"text": "({{currency.symbol}})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"if": "{{_global.preferredCurrency === currency.code}}",
|
||||
"props": { "name": "check", "className": "w-4 h-4" }
|
||||
"props": {
|
||||
"name": "check",
|
||||
"className": "text-base"
|
||||
}
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
@@ -65,9 +121,27 @@
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"actions": [
|
||||
{ "handler": "setState", "params": { "target": "global", "preferredCurrency": "{{currency.code}}" } },
|
||||
{ "handler": "saveToLocalStorage", "params": { "key": "g7_preferred_currency", "value": "{{currency.code}}" } },
|
||||
{ "handler": "setState", "params": { "target": "local", "showCurrencyDropdown": false } }
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"preferredCurrency": "{{currency.code}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "saveToLocalStorage",
|
||||
"params": {
|
||||
"key": "g7_preferred_currency",
|
||||
"value": "{{currency.code}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "local",
|
||||
"showCurrencyDropdown": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -81,12 +155,17 @@
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{_local.showCurrencyDropdown}}",
|
||||
"props": { "className": "fixed inset-0 z-40" },
|
||||
"props": {
|
||||
"className": "fixed inset-0 z-40"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setState",
|
||||
"params": { "target": "local", "showCurrencyDropdown": false }
|
||||
"params": {
|
||||
"target": "local",
|
||||
"showCurrencyDropdown": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-base font-bold text-gray-900 dark:text-white ml-1" },
|
||||
"text": "{{item.mc_final_amount?.[order.data.base_currency ?? _global.preferredCurrency ?? 'KRW']?.formatted ?? item.subtotal_price_formatted ?? ''}}",
|
||||
"text": "{{item.mc_final_amount?.[order.data.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.subtotal_price_formatted ?? ''}}",
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": { "className": "text-sm font-bold text-gray-900 dark:text-white ml-1" }
|
||||
@@ -597,7 +597,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.mc_final_amount ?? item.mc_subtotal_price ?? {}).filter(([code]) => code !== (order.data.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.mc_final_amount ?? item.mc_subtotal_price ?? {}).filter(([code]) => code !== (order.data.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -824,7 +824,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 mt-0.5" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.mc_subtotal_price ?? {}).filter(([code]) => code !== (order.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.mc_subtotal_price ?? {}).filter(([code]) => code !== (order.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -908,7 +908,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(order.mc_total_amount ?? {}).filter(([code]) => code !== (order.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(order.mc_total_amount ?? {}).filter(([code]) => code !== (order.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_total_list_price_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_total_list_price_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
@@ -423,7 +423,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_total_list_price_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_total_list_price_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
@@ -456,7 +456,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_subtotal_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_subtotal_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
@@ -480,7 +480,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_subtotal_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_subtotal_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
@@ -771,7 +771,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block font-normal" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_total_paid_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_original_snapshot?.mc_total_paid_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
@@ -795,7 +795,7 @@
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 block font-normal" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_total_paid_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(_local.refundEstimate?.mc_recalculated_snapshot?.mc_total_paid_amount_formatted ?? {}).filter(([code]) => code !== (_local.refundEstimate?.original_snapshot?.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "mc"
|
||||
},
|
||||
"text": "{{mc[1]}}"
|
||||
|
||||
@@ -541,7 +541,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end mt-0.5" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(order.data.mc_total_amount ?? {}).filter(([code]) => code !== (order.data.base_currency ?? _global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(order.data.mc_total_amount ?? {}).filter(([code]) => code !== (order.data.base_currency ?? _global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-sm font-medium {{Number(shipping.total_shipping_amount ?? 0) === 0 ? 'text-green-600 dark:text-green-400' : 'text-gray-900 dark:text-white'}}" },
|
||||
"text": "{{Number(shipping.total_shipping_amount ?? 0) === 0 ? '$t:mypage.order_detail.free_shipping' : (shipping.mc_total_shipping_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? shipping.total_shipping_amount_formatted ?? '')}}"
|
||||
"text": "{{Number(shipping.total_shipping_amount ?? 0) === 0 ? '$t:mypage.order_detail.free_shipping' : (shipping.mc_total_shipping_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? shipping.total_shipping_amount_formatted ?? '')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1379,7 +1379,7 @@
|
||||
"name": "Select",
|
||||
"props": {
|
||||
"name": "ecommerce_preferred_currency",
|
||||
"value": "{{user.data?.ecommerce_preferred_currency ?? _global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency ?? 'KRW'}}",
|
||||
"value": "{{user.data?.ecommerce_preferred_currency ?? _global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency}}",
|
||||
"options": "{{(_global.modules?.['sirsoft-ecommerce']?.language_currency?.currencies ?? []).filter(c => c.is_default || (c.exchange_rate ?? 0) > 0).map(c => ({ value: c.code, label: c.code + ' (' + (c.symbol ?? c.code) + ')' }))}}",
|
||||
"className": "w-full sm:w-64"
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@
|
||||
"props": {
|
||||
"className": "text-base text-gray-900 dark:text-white font-medium"
|
||||
},
|
||||
"text": "{{user.data?.ecommerce_preferred_currency ?? _global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency ?? 'KRW'}}"
|
||||
"text": "{{user.data?.ecommerce_preferred_currency ?? _global.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
|
||||
@@ -54,14 +54,14 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.selling_price_formatted}}"
|
||||
"text": "{{product.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.selling_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{product.discount_rate > 0}}",
|
||||
"props": { "className": "text-sm text-gray-500 dark:text-gray-400 line-through" },
|
||||
"text": "{{product.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.list_price_formatted}}"
|
||||
"text": "{{product.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.list_price_formatted}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"props": { "className": "text-xs text-gray-500 dark:text-gray-400" },
|
||||
"text": "{{addOpt.group_name}}: {{addOpt.name}}{{(addOpt.custom_text ?? '') !== '' ? ' (' + addOpt.custom_text + ')' : ''}}{{(addOpt.price_adjustment ?? 0) > 0 ? ' (' + (addOpt.price_adjustment_formatted ?? ('+' + addOpt.price_adjustment.toLocaleString())) + ')' : ''}}"
|
||||
"text": "{{addOpt.group_name}}: {{addOpt.name}}{{(addOpt.custom_text ?? '') !== '' ? ' (' + addOpt.custom_text + ')' : ''}}{{(addOpt.price_adjustment ?? 0) > 0 ? ' (' + (addOpt.multi_currency_price_adjustment?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? addOpt.price_adjustment_formatted ?? ('+' + addOpt.price_adjustment.toLocaleString())) + ')' : ''}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -145,7 +145,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 line-through" },
|
||||
"text": "{{item.product_option?.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.product_option?.list_price_formatted ?? ''}}"
|
||||
"text": "{{item.product_option?.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.product_option?.list_price_formatted ?? ''}}"
|
||||
},
|
||||
{
|
||||
"comment": "할인율 칩",
|
||||
@@ -163,7 +163,7 @@
|
||||
"if": "{{(item.product_option?.discount_rate ?? 0) > 0}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_list_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_list_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -180,7 +180,7 @@
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "text-sm font-medium text-gray-900 dark:text-white" },
|
||||
"text": "{{item.product_option?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.product_option?.selling_price_formatted ?? ''}}"
|
||||
"text": "{{item.product_option?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.product_option?.selling_price_formatted ?? ''}}"
|
||||
},
|
||||
{
|
||||
"comment": "보조 통화들 (선택된 통화 제외)",
|
||||
@@ -188,7 +188,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -400,7 +400,7 @@
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.subtotal_formatted}}"
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.subtotal_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "보조 통화들",
|
||||
@@ -408,7 +408,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.multi_currency_subtotal ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.multi_currency_subtotal ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-medium text-gray-900 dark:text-white" },
|
||||
"text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.subtotal_formatted ?? cartItems.data.calculation?.summary?.subtotal_formatted ?? '-'}}"
|
||||
"text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.subtotal_formatted ?? cartItems.data.calculation?.summary?.subtotal_formatted ?? '-'}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -136,7 +136,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.taxable_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.taxable_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.taxable_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -146,7 +146,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.tax_free_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.tax_free_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.tax_free_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -165,7 +165,7 @@
|
||||
"props": { "className": "flex justify-between text-sm" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "$t:shop.cart.discount_total" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-red-600 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.total_discount_formatted ?? cartItems.data.calculation?.summary?.discount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-red-600 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.total_discount_formatted ?? cartItems.data.calculation?.summary?.discount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -181,7 +181,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.coupon_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.product_coupon_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.product_coupon_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -191,7 +191,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.code_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.code_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.code_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -201,7 +201,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.order_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.order_coupon_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.order_coupon_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -223,7 +223,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-medium {{(cartItems.data.calculation?.summary?.total_shipping ?? 0) === 0 ? 'text-green-600 dark:text-green-400' : 'text-gray-900 dark:text-white'}}" },
|
||||
"text": "{{(cartItems.data.calculation?.summary?.total_shipping ?? 0) === 0 ? '$t:shop.free_shipping' : (cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.total_shipping_formatted ?? cartItems.data.calculation?.summary?.shipping_fee_formatted)}}"
|
||||
"text": "{{(cartItems.data.calculation?.summary?.total_shipping ?? 0) === 0 ? '$t:shop.free_shipping' : (cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.total_shipping_formatted ?? cartItems.data.calculation?.summary?.shipping_fee_formatted)}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -241,7 +241,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.base_shipping" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.base_shipping_total_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.base_shipping_total_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -251,7 +251,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.extra_shipping" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.extra_shipping_total_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.extra_shipping_total_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -261,7 +261,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.shipping_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.shipping_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.shipping_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -275,7 +275,7 @@
|
||||
"props": { "className": "flex justify-between text-sm pt-2" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "$t:shop.cart.payment_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-gray-900 dark:text-white" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.payment_amount_formatted ?? cartItems.data.calculation?.summary?.payment_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-gray-900 dark:text-white" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.payment_amount_formatted ?? cartItems.data.calculation?.summary?.payment_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -303,7 +303,7 @@
|
||||
"props": { "className": "flex justify-between items-center" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-lg font-semibold text-gray-900 dark:text-white" }, "text": "$t:shop.cart.total" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-xl font-bold text-gray-900 dark:text-white" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.final_amount_formatted ?? cartItems.data.calculation?.summary?.final_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-xl font-bold text-gray-900 dark:text-white" }, "text": "{{cartItems.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.final_amount_formatted ?? cartItems.data.calculation?.summary?.final_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -312,7 +312,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end mt-1" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(cartItems.data.calculation?.summary?.multi_currency ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(cartItems.data.calculation?.summary?.multi_currency ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
"props": {
|
||||
"value": "{{coupon.id}}"
|
||||
},
|
||||
"text": "{{'[' + coupon.target_type_short_label + '] ' + coupon.localized_name + ' (' + (coupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? 'KRW'] ?? coupon.benefit_formatted) + ')'}}"
|
||||
"text": "{{'[' + coupon.target_type_short_label + '] ' + coupon.localized_name + ' (' + (coupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? _global.defaultCurrency] ?? coupon.benefit_formatted) + ')'}}"
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
@@ -225,7 +225,7 @@
|
||||
"props": { "className": "mt-2 text-sm text-green-600 dark:text-green-400 flex items-center gap-1" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Icon", "props": { "name": "check-circle", "size": "sm" } },
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? 'KRW']?.order_coupon_discount_formatted ?? checkoutData.data.calculation?.summary?.order_coupon_discount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.order_coupon_discount_formatted ?? checkoutData.data.calculation?.summary?.order_coupon_discount_formatted}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -291,7 +291,7 @@
|
||||
"props": {
|
||||
"value": "{{coupon.id}}"
|
||||
},
|
||||
"text": "{{'[' + coupon.target_type_short_label + '] ' + coupon.localized_name + ' (' + (coupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? 'KRW'] ?? coupon.benefit_formatted) + ')'}}"
|
||||
"text": "{{'[' + coupon.target_type_short_label + '] ' + coupon.localized_name + ' (' + (coupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? _global.defaultCurrency] ?? coupon.benefit_formatted) + ')'}}"
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
@@ -349,7 +349,7 @@
|
||||
"props": { "className": "mt-2 text-sm text-green-600 dark:text-green-400 flex items-center gap-1" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Icon", "props": { "name": "check-circle", "size": "sm" } },
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? 'KRW']?.shipping_discount_formatted ?? checkoutData.data.calculation?.summary?.shipping_discount_formatted ?? (checkoutData.data.calculation?.summary?.shipping_discount + '원')}}" }
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.shipping_discount_formatted ?? checkoutData.data.calculation?.summary?.shipping_discount_formatted ?? (checkoutData.data.calculation?.summary?.shipping_discount + '원')}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -459,7 +459,7 @@
|
||||
"props": { "className": "mt-2 text-sm text-green-600 dark:text-green-400 flex items-center gap-1" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Icon", "props": { "name": "check-circle", "size": "sm" } },
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? 'KRW']?.code_discount_formatted ?? checkoutData.data.calculation?.summary?.code_discount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "text": "-{{checkoutData.data.calculation?.summary?.multi_currency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.code_discount_formatted ?? checkoutData.data.calculation?.summary?.code_discount_formatted}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"props": { "className": "text-xs text-gray-500 dark:text-gray-400" },
|
||||
"text": "{{addOpt.group_name ? addOpt.group_name + ': ' : ''}}{{addOpt.name}}{{(addOpt.custom_text ?? '') !== '' ? ' (' + addOpt.custom_text + ')' : ''}}{{(addOpt.price_adjustment ?? 0) > 0 ? ' (' + (addOpt.price_adjustment_formatted ?? ('+' + addOpt.price_adjustment.toLocaleString())) + ')' : ''}}"
|
||||
"text": "{{addOpt.group_name ? addOpt.group_name + ': ' : ''}}{{addOpt.name}}{{(addOpt.custom_text ?? '') !== '' ? ' (' + addOpt.custom_text + ')' : ''}}{{(addOpt.price_adjustment ?? 0) > 0 ? ' (' + (addOpt.multi_currency_price_adjustment?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? addOpt.price_adjustment_formatted ?? ('+' + addOpt.price_adjustment.toLocaleString())) + ')' : ''}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -203,7 +203,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xs text-gray-400 dark:text-gray-500 line-through" },
|
||||
"text": "{{item.product_option?.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.product_option?.list_price_formatted ?? ''}}"
|
||||
"text": "{{item.product_option?.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.product_option?.list_price_formatted ?? ''}}"
|
||||
},
|
||||
{
|
||||
"comment": "할인율 칩",
|
||||
@@ -221,7 +221,7 @@
|
||||
"if": "{{(item.product_option?.discount_rate ?? 0) > 0}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_list_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_list_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -247,7 +247,7 @@
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "{{item.product_option?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.product_option?.selling_price_formatted ?? ''}} × {{item.quantity}}"
|
||||
"text": "{{item.product_option?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.product_option?.selling_price_formatted ?? ''}} × {{item.quantity}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
@@ -262,7 +262,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 mt-0.5" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.product_option?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -555,7 +555,7 @@
|
||||
"name": "Div",
|
||||
"if": "{{(item.product_coupon_discount_amount ?? 0) === 0}}",
|
||||
"props": { "className": "font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.subtotal_formatted}}"
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.subtotal_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "원 판매금액 (할인 있을 때 취소선) - 주 통화",
|
||||
@@ -563,7 +563,7 @@
|
||||
"name": "Div",
|
||||
"if": "{{(item.product_coupon_discount_amount ?? 0) > 0}}",
|
||||
"props": { "className": "text-sm text-gray-400 dark:text-gray-500 line-through" },
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.subtotal_formatted}}"
|
||||
"text": "{{item.multi_currency_subtotal?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.subtotal_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "할인 후 금액 - 주 통화",
|
||||
@@ -571,7 +571,7 @@
|
||||
"name": "Div",
|
||||
"if": "{{(item.product_coupon_discount_amount ?? 0) > 0}}",
|
||||
"props": { "className": "font-bold text-red-600 dark:text-red-400" },
|
||||
"text": "{{item.multi_currency_final_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.final_amount_formatted}}"
|
||||
"text": "{{item.multi_currency_final_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.final_amount_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "원 판매금액 - 보조 통화들 (할인 없을 때)",
|
||||
@@ -580,7 +580,7 @@
|
||||
"if": "{{(item.product_coupon_discount_amount ?? 0) === 0}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.multi_currency_subtotal ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.multi_currency_subtotal ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "subtotalCurrency"
|
||||
},
|
||||
"children": [
|
||||
@@ -599,7 +599,7 @@
|
||||
"if": "{{(item.product_coupon_discount_amount ?? 0) > 0}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.multi_currency_final_amount ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.multi_currency_final_amount ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "finalCurrency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-medium text-gray-900 dark:text-white" },
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.subtotal_formatted ?? checkoutData.data.calculation?.summary?.subtotal_formatted ?? '-'}}"
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.subtotal_formatted ?? checkoutData.data.calculation?.summary?.subtotal_formatted ?? '-'}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -100,7 +100,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.taxable_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.taxable_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.taxable_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -110,7 +110,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.tax_free_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.tax_free_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.tax_free_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -151,7 +151,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-red-600 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.total_discount_formatted ?? checkoutData.data.calculation?.summary?.total_discount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-red-600 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.total_discount_formatted ?? checkoutData.data.calculation?.summary?.total_discount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -168,7 +168,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.coupon_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.product_coupon_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.product_coupon_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -200,7 +200,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.code_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.code_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.code_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -210,7 +210,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.order_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.order_coupon_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.order_coupon_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -254,7 +254,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-medium {{(checkoutData.data.calculation?.summary?.total_shipping ?? 0) === 0 ? 'text-green-600 dark:text-green-400' : 'text-gray-900 dark:text-white'}}" },
|
||||
"text": "{{(checkoutData.data.calculation?.summary?.total_shipping ?? 0) === 0 ? '$t:shop.checkout.free' : (checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.total_shipping_formatted ?? checkoutData.data.calculation?.summary?.total_shipping_formatted)}}"
|
||||
"text": "{{(checkoutData.data.calculation?.summary?.total_shipping ?? 0) === 0 ? '$t:shop.checkout.free' : (checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.total_shipping_formatted ?? checkoutData.data.calculation?.summary?.total_shipping_formatted)}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -272,7 +272,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.base_shipping" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.base_shipping_total_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.base_shipping_total_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -282,7 +282,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.extra_shipping" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.extra_shipping_total_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.extra_shipping_total_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -292,7 +292,7 @@
|
||||
"props": { "className": "flex justify-between text-xs" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-500 dark:text-gray-500" }, "text": "$t:shop.cart.shipping_discount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.shipping_discount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-red-500 dark:text-red-400" }, "text": "-{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.shipping_discount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -339,7 +339,7 @@
|
||||
"props": { "className": "flex justify-between text-sm pt-2" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "$t:shop.cart.payment_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-gray-900 dark:text-white" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.payment_amount_formatted ?? checkoutData.data.calculation?.summary?.payment_amount_formatted ?? '-'}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-medium text-gray-900 dark:text-white" }, "text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.payment_amount_formatted ?? checkoutData.data.calculation?.summary?.payment_amount_formatted ?? '-'}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -391,7 +391,7 @@
|
||||
"props": { "className": "text-lg font-bold text-gray-900 dark:text-white" }
|
||||
}
|
||||
},
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.final_amount_formatted ?? checkoutData.data.calculation?.summary?.final_amount_formatted ?? '-'}}"
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.final_amount_formatted ?? checkoutData.data.calculation?.summary?.final_amount_formatted ?? '-'}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -401,7 +401,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end mt-1" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(checkoutData.data.calculation?.summary?.multi_currency ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(checkoutData.data.calculation?.summary?.multi_currency ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -439,7 +439,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? 'KRW']?.final_amount_formatted ?? checkoutData.data.calculation?.summary?.final_amount_formatted ?? '-'}} $t:shop.checkout.pay_button",
|
||||
"text": "{{checkoutData.data.calculation?.summary?.multi_currency[_global.preferredCurrency ?? _global.defaultCurrency]?.final_amount_formatted ?? checkoutData.data.calculation?.summary?.final_amount_formatted ?? '-'}} $t:shop.checkout.pay_button",
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
|
||||
+6
-6
@@ -105,7 +105,7 @@
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"props": { "className": "text-sm font-medium text-gray-900 dark:text-white" },
|
||||
"text": "{{$parent._local.optionModal.targetItem?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? $parent._local.optionModal.targetItem?.unit_price_formatted}}"
|
||||
"text": "{{$parent._local.optionModal.targetItem?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? $parent._local.optionModal.targetItem?.unit_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "보조 통화들",
|
||||
@@ -113,7 +113,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries($parent._local.optionModal.targetItem?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries($parent._local.optionModal.targetItem?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -277,7 +277,7 @@
|
||||
"className": "w-full",
|
||||
"value": "{{$parent._local.additionalSelections?.[addGroup.id] ?? ''}}",
|
||||
"placeholder": "$t:shop.additional_option_placeholder",
|
||||
"options": "{{[{ value: '', label: $t('shop.additional_option_placeholder') }, ...(addGroup.values ?? []).map(v => ({ value: v.id, label: v.price_adjustment > 0 ? v.name + ' (' + (v.price_adjustment_formatted ?? ('+' + v.price_adjustment.toLocaleString())) + ')' : v.name }))]}}"
|
||||
"options": "{{[{ value: '', label: $t('shop.additional_option_placeholder') }, ...(addGroup.values ?? []).map(v => ({ value: v.id, label: v.price_adjustment > 0 ? v.name + ' (' + (v.multi_currency_price_adjustment?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? v.price_adjustment_formatted ?? ('+' + v.price_adjustment.toLocaleString())) + ')' : v.name }))]}}"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
@@ -355,7 +355,7 @@
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "text-sm font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{$parent._local.matchedOption.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? $parent._local.matchedOption.selling_price_formatted}}"
|
||||
"text": "{{$parent._local.matchedOption.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? $parent._local.matchedOption.selling_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "보조 통화들",
|
||||
@@ -363,7 +363,7 @@
|
||||
"name": "Div",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries($parent._local.matchedOption.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries($parent._local.matchedOption.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -387,7 +387,7 @@
|
||||
"props": { "className": "flex justify-between items-center mt-2 pt-2 border-t border-blue-100 dark:border-blue-800 text-xs text-gray-600 dark:text-gray-300" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "text": "$t:shop.additional_options_amount" },
|
||||
{ "type": "basic", "name": "Span", "text": "{{(() => { const total = ($parent._local.optionProduct?.additional_options ?? []).reduce((sum, g) => sum + (((g.values ?? []).find(v => v.id === Number($parent._local.additionalSelections?.[g.id]))?.price_adjustment) ?? 0), 0); const c = (_global.availableCurrencies ?? []).find(x => x.is_default); const dp = c?.decimal_places ?? 0; const n = total.toLocaleString(undefined, { minimumFractionDigits: dp, maximumFractionDigits: dp }); const s = c?.symbol ?? '₩'; return '+' + ((c?.code === 'KRW' || s === '₩' || s === '원') ? (n + '원') : (s + n)); })()}}" }
|
||||
{ "comment": "추가금은 기본통화 기준 저장값이므로 서버가 준 표시통화 환산값을 우선 합산한다 (없으면 기본통화 값으로 폴백)", "type": "basic", "name": "Span", "text": "{{(() => { const code = _global.preferredCurrency ?? _global.defaultCurrency; const total = ($parent._local.optionProduct?.additional_options ?? []).reduce((sum, g) => { const v = (g.values ?? []).find(v => v.id === Number($parent._local.additionalSelections?.[g.id])); if (!v) return sum; return sum + (v.multi_currency_price_adjustment?.[code]?.price ?? v.price_adjustment ?? 0); }, 0); const cur = (_global.availableCurrencies ?? []).find(x => x.code === code) ?? (_global.availableCurrencies ?? []).find(x => x.is_default); const dp = cur?.decimal_places ?? 0; const n = total.toLocaleString(undefined, { minimumFractionDigits: dp, maximumFractionDigits: dp }); const s = cur?.symbol ?? '₩'; return '+' + ((cur?.code === 'KRW' || s === '₩' || s === '원') ? (n + '원') : (s + n)); })()}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -154,15 +154,15 @@
|
||||
"comment": "정액 할인 — 선택 통화 환산 (A1-④, formatted 가 기호 포함)",
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{coupon.discount_type === 'fixed' && coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? 'KRW']?.formatted}}",
|
||||
"if": "{{coupon.discount_type === 'fixed' && coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}",
|
||||
"props": { "className": "text-xl font-bold text-blue-600 dark:text-blue-400" },
|
||||
"text": "{{coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? 'KRW']?.formatted}}"
|
||||
"text": "{{coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "정액 할인 — 폴백(환산 부재 시 기본통화 숫자 + 단위)",
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{coupon.discount_type === 'fixed' && !coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? 'KRW']?.formatted}}",
|
||||
"if": "{{coupon.discount_type === 'fixed' && !coupon.multi_currency_discount_value?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}",
|
||||
"props": { "className": "text-xl font-bold text-blue-600 dark:text-blue-400" },
|
||||
"text": "{{Number(coupon.discount_value).toLocaleString()}}$t:shop.coupon_download.currency_unit"
|
||||
}
|
||||
@@ -179,15 +179,15 @@
|
||||
"comment": "최소 주문 금액 — 선택 통화 환산 (A1-④, formatted 가 기호 포함)",
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"if": "{{coupon.min_order_amount > 0 && coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted}}",
|
||||
"if": "{{coupon.min_order_amount > 0 && coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}",
|
||||
"props": { "className": "text-xs text-gray-500 dark:text-gray-400 mb-1" },
|
||||
"text": "$t:shop.coupon_download.min_order_amount {{coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted}}"
|
||||
"text": "$t:shop.coupon_download.min_order_amount {{coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "최소 주문 금액 — 폴백(환산 부재 시)",
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"if": "{{coupon.min_order_amount > 0 && !coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted}}",
|
||||
"if": "{{coupon.min_order_amount > 0 && !coupon.multi_currency_min_order_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted}}",
|
||||
"props": { "className": "text-xs text-gray-500 dark:text-gray-400 mb-1" },
|
||||
"text": "$t:shop.coupon_download.min_order_amount {{Number(coupon.min_order_amount).toLocaleString()}}$t:shop.coupon_download.currency_unit"
|
||||
},
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
"name": "Span",
|
||||
"if": "{{product.data.discount_rate > 0}}",
|
||||
"props": { "className": "text-sm text-gray-500 dark:text-gray-400 line-through" },
|
||||
"text": "{{product.data.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data.list_price_formatted}}"
|
||||
"text": "{{product.data.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data.list_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": { "className": "text-2xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.data.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data.selling_price_formatted}}"
|
||||
"text": "{{product.data.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data.selling_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
@@ -81,7 +81,7 @@
|
||||
"value": "{{_local.currentSelection?.[group.id] ?? ''}}",
|
||||
"placeholder": "{{groupIndex === 0 || _local.currentSelection?.[product.data.option_groups[groupIndex - 1]?.id] ? '$t:shop.select' : '$t:shop.select_upper_option_first'}}",
|
||||
"disabled": "{{groupIndex > 0 && !_local.currentSelection?.[product.data.option_groups[groupIndex - 1]?.id]}}",
|
||||
"options": "{{group.values.map(v => ({ value: v.id, label: v.name + (v.additional_price > 0 ? ' (+' + (v.multi_currency_additional_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? v.additional_price_formatted) + ')' : '') }))}}"
|
||||
"options": "{{group.values.map(v => ({ value: v.id, label: v.name + (v.additional_price > 0 ? ' (+' + (v.multi_currency_additional_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? v.additional_price_formatted) + ')' : '') }))}}"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
@@ -105,7 +105,7 @@
|
||||
"optionGroups": "{{product.data.option_groups}}",
|
||||
"currentSelection": "{{_local.currentSelection}}",
|
||||
"selectedItems": "{{_local.selectedItems ?? []}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}"
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -212,7 +212,7 @@
|
||||
"itemIndex": "{{itemIndex}}",
|
||||
"newQuantity": "{{$args[0]}}",
|
||||
"selectedItems": "{{_local.selectedItems}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}"
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -221,7 +221,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-sm font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.totalPriceFormatted}}"
|
||||
"text": "{{item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.totalPriceFormatted}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -276,7 +276,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{(function() { const items = _local.selectedItems ?? []; if (items.length === 0) return product.data.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data.selling_price_formatted; const total = items.reduce((sum, item) => sum + (item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? 'KRW']?.value ?? item.totalPrice), 0); return _global.formatCurrency(total, _global.preferredCurrency ?? 'KRW'); })()}}"
|
||||
"text": "{{(function() { const items = _local.selectedItems ?? []; if (items.length === 0) return product.data.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data.selling_price_formatted; const total = items.reduce((sum, item) => sum + (item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? _global.defaultCurrency]?.value ?? item.totalPrice), 0); return _local.selectedTotalMultiCurrency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? items[0]?.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? String(total); })()}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-sm text-gray-500 dark:text-gray-400 line-through" },
|
||||
"text": "{{product.data?.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.list_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.list_price_formatted}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -48,7 +48,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-2xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -58,7 +58,7 @@
|
||||
"name": "Div",
|
||||
"if": "{{!product.data?.discount_rate || product.data?.discount_rate <= 0}}",
|
||||
"props": { "className": "text-2xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -102,7 +102,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "whitespace-nowrap" },
|
||||
"text": "{{dlCoupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? 'KRW'] ?? dlCoupon.benefit_formatted}}"
|
||||
"text": "{{dlCoupon.multi_currency_benefit_formatted?.[_global.preferredCurrency ?? _global.defaultCurrency] ?? dlCoupon.benefit_formatted}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-sm text-gray-500 dark:text-gray-400 line-through" },
|
||||
"text": "{{product.data?.multi_currency_list_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.list_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_list_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.list_price_formatted}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -38,7 +38,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -48,7 +48,7 @@
|
||||
"name": "Div",
|
||||
"if": "{{!product.data?.discount_rate || product.data?.discount_rate <= 0}}",
|
||||
"props": { "className": "text-xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
"text": "{{product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.selling_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "배송 불가 사전 경고 (B8 — 선택 배송국가로 배송 불가, 모바일 가격 영역)",
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"options": "{{product.data?.options}}",
|
||||
"currentSelection": "{{_local.currentSelection ?? {}}}",
|
||||
"selectedOptionItems": "{{_local.selectedOptionItems ?? []}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}",
|
||||
"additionalOptionGroups": "{{product.data?.additional_options ?? []}}",
|
||||
"newGroupName": "{{group.name_localized}}",
|
||||
"newValue": "{{$event.target.value}}"
|
||||
@@ -264,7 +264,7 @@
|
||||
"className": "w-full",
|
||||
"value": "{{item.additionalOptionSelections?.[addGroup.id] ?? ''}}",
|
||||
"placeholder": "$t:shop.additional_option_placeholder",
|
||||
"options": "{{[{ value: '', label: $t('shop.additional_option_placeholder') }, ...(addGroup.values ?? []).map(v => ({ value: v.id, label: v.price_adjustment > 0 ? v.name + ' (' + (v.price_adjustment_formatted ?? ('+' + v.price_adjustment.toLocaleString())) + ')' : v.name }))]}}"
|
||||
"options": "{{[{ value: '', label: $t('shop.additional_option_placeholder') }, ...(addGroup.values ?? []).map(v => ({ value: v.id, label: v.price_adjustment > 0 ? v.name + ' (' + (v.multi_currency_price_adjustment?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? v.price_adjustment_formatted ?? ('+' + v.price_adjustment.toLocaleString())) + ')' : v.name }))]}}"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
@@ -276,7 +276,7 @@
|
||||
"valueId": "{{$event.target.value}}",
|
||||
"selectedOptionItems": "{{_local.selectedOptionItems}}",
|
||||
"additionalOptionGroups": "{{product.data?.additional_options ?? []}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}"
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -316,7 +316,7 @@
|
||||
"customText": "{{$event.target.value}}",
|
||||
"selectedOptionItems": "{{_local.selectedOptionItems}}",
|
||||
"additionalOptionGroups": "{{product.data?.additional_options ?? []}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}"
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -335,7 +335,7 @@
|
||||
"props": { "className": "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-2" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "text": "$t:shop.additional_options_amount" },
|
||||
{ "type": "basic", "name": "Span", "text": "{{(() => { const c = (_global.availableCurrencies ?? []).find(x => x.is_default); const dp = c?.decimal_places ?? 0; const n = (item.additionalOptionsTotal ?? 0).toLocaleString(undefined, { minimumFractionDigits: dp, maximumFractionDigits: dp }); const s = c?.symbol ?? '₩'; return '+' + ((c?.code === 'KRW' || s === '₩' || s === '원') ? (n + '원') : (s + n)); })()}}" }
|
||||
{ "comment": "추가금은 기본통화 기준으로 저장되므로 표시통화 환산값(핸들러가 서버 맵에서 계산)을 우선 사용한다. 없으면 기본통화 표기로 폴백", "type": "basic", "name": "Span", "text": "{{(() => { const code = _global.preferredCurrency ?? _global.defaultCurrency; const cur = (_global.availableCurrencies ?? []).find(x => x.code === code) ?? (_global.availableCurrencies ?? []).find(x => x.is_default); const converted = item.additionalOptionsMultiCurrencyTotal?.[code]?.value; const amount = converted ?? (item.additionalOptionsTotal ?? 0); const dp = cur?.decimal_places ?? 0; const n = amount.toLocaleString(undefined, { minimumFractionDigits: dp, maximumFractionDigits: dp }); const s = cur?.symbol ?? '₩'; return '+' + ((cur?.code === 'KRW' || s === '₩' || s === '원') ? (n + '원') : (s + n)); })()}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -361,7 +361,7 @@
|
||||
"itemIndex": "{{itemIndex}}",
|
||||
"newQuantity": "{{$args[0]}}",
|
||||
"selectedOptionItems": "{{_local.selectedOptionItems}}",
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? 'KRW'}}"
|
||||
"preferredCurrency": "{{_global.preferredCurrency ?? _global.defaultCurrency}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -370,7 +370,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-sm font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.totalPriceFormatted}}"
|
||||
"text": "{{item.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.totalPriceFormatted}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -404,7 +404,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{(_local.selectedOptionItems ?? []).length === 0 ? '-' : (_local.selectedTotalMultiCurrency?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? _local.selectedOptionItems[0]?.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? _local.selectedOptionItems[0]?.totalPriceFormatted ?? '')}}"
|
||||
"text": "{{(_local.selectedOptionItems ?? []).length === 0 ? '-' : (_local.selectedTotalMultiCurrency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? _local.selectedOptionItems[0]?.multiCurrencyTotalPrice?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? _local.selectedOptionItems[0]?.totalPriceFormatted ?? '')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -425,7 +425,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "text-xl font-bold text-gray-900 dark:text-white" },
|
||||
"text": "{{_local.noOptionTotalMultiCurrency?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? product.data?.selling_price_formatted ?? ''}}"
|
||||
"text": "{{_local.noOptionTotalMultiCurrency?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? product.data?.selling_price_formatted ?? ''}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
"props": { "className": "flex justify-between" },
|
||||
"children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "$t:shop.order_complete.deposit_amount" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-bold text-blue-600 dark:text-blue-400 text-lg" }, "text": "{{orderData?.data?.mc_total_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? orderData?.data?.total_amount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "font-bold text-blue-600 dark:text-blue-400 text-lg" }, "text": "{{orderData?.data?.mc_total_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? orderData?.data?.total_amount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -472,7 +472,7 @@
|
||||
"comment": "단가 x 수량 (주 통화)",
|
||||
"type": "basic", "name": "P",
|
||||
"props": { "className": "text-sm text-gray-600 dark:text-gray-400" },
|
||||
"text": "{{item.mc_unit_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.unit_price_formatted}} x {{item.quantity}}"
|
||||
"text": "{{item.mc_unit_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.unit_price_formatted}} x {{item.quantity}}"
|
||||
},
|
||||
{
|
||||
"comment": "단가 보조 통화들",
|
||||
@@ -481,7 +481,7 @@
|
||||
"if": "{{Object.keys(item.mc_unit_price ?? {}).length > 1}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.mc_unit_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.mc_unit_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -513,7 +513,7 @@
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": { "className": "font-medium text-gray-900 dark:text-white" },
|
||||
"text": "{{item.mc_subtotal_price?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? item.subtotal_price_formatted}}"
|
||||
"text": "{{item.mc_subtotal_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? item.subtotal_price_formatted}}"
|
||||
},
|
||||
{
|
||||
"comment": "소계 보조 통화들",
|
||||
@@ -522,7 +522,7 @@
|
||||
"if": "{{Object.keys(item.mc_subtotal_price ?? {}).length > 1}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(item.mc_subtotal_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(item.mc_subtotal_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
@@ -621,7 +621,7 @@
|
||||
"comment": "상품 금액",
|
||||
"type": "basic", "name": "Div", "props": { "className": "flex justify-between mb-2" }, "children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-600 dark:text-gray-400" }, "text": "$t:shop.order_complete.subtotal" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-900 dark:text-white" }, "text": "{{orderData?.data?.mc_subtotal_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? orderData?.data?.subtotal_amount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-900 dark:text-white" }, "text": "{{orderData?.data?.mc_subtotal_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? orderData?.data?.subtotal_amount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -632,7 +632,7 @@
|
||||
"comment": "Number() 캐스팅 — Order.total_shipping_amount 는 decimal:2 cast 로 '0.00' 문자열이 응답에 올 수 있어 === 0 비교가 false 회귀",
|
||||
"type": "basic", "name": "Span",
|
||||
"props": { "className": "{{Number(orderData?.data?.total_shipping_amount ?? 0) === 0 ? 'text-green-600 dark:text-green-400' : 'text-gray-900 dark:text-white'}}" },
|
||||
"text": "{{Number(orderData?.data?.total_shipping_amount ?? 0) === 0 ? '$t:shop.checkout.free' : (orderData?.data?.mc_total_shipping_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? orderData?.data?.total_shipping_amount_formatted)}}"
|
||||
"text": "{{Number(orderData?.data?.total_shipping_amount ?? 0) === 0 ? '$t:shop.checkout.free' : (orderData?.data?.mc_total_shipping_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? orderData?.data?.total_shipping_amount_formatted)}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -642,7 +642,7 @@
|
||||
"if": "{{(orderData?.data?.total_discount_amount ?? 0) > 0}}",
|
||||
"props": { "className": "flex justify-between mb-2 text-red-600 dark:text-red-400" }, "children": [
|
||||
{ "type": "basic", "name": "Span", "text": "$t:shop.order_complete.discount" },
|
||||
{ "type": "basic", "name": "Span", "text": "-{{orderData?.data?.mc_total_discount_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? orderData?.data?.total_discount_amount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "text": "-{{orderData?.data?.mc_total_discount_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? orderData?.data?.total_discount_amount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -659,7 +659,7 @@
|
||||
"type": "basic", "name": "Div",
|
||||
"props": { "className": "flex justify-between items-center pt-2 border-t border-gray-200 dark:border-gray-700 font-bold text-lg" }, "children": [
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-gray-900 dark:text-white" }, "text": "$t:shop.order_complete.total" },
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-blue-600 dark:text-blue-400" }, "text": "{{orderData?.data?.mc_total_amount?.[_global.preferredCurrency ?? 'KRW']?.formatted ?? orderData?.data?.total_amount_formatted}}" }
|
||||
{ "type": "basic", "name": "Span", "props": { "className": "text-blue-600 dark:text-blue-400" }, "text": "{{orderData?.data?.mc_total_amount?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? orderData?.data?.total_amount_formatted}}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -669,7 +669,7 @@
|
||||
"if": "{{Object.keys(orderData?.data?.mc_total_amount ?? {}).length > 1}}",
|
||||
"props": { "className": "flex flex-wrap gap-x-2 justify-end mt-1" },
|
||||
"iteration": {
|
||||
"source": "{{Object.entries(orderData?.data?.mc_total_amount ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? 'KRW'))}}",
|
||||
"source": "{{Object.entries(orderData?.data?.mc_total_amount ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
|
||||
"item_var": "currency"
|
||||
},
|
||||
"children": [
|
||||
|
||||
@@ -27,12 +27,15 @@ import type { EditorAttrs } from '../../types';
|
||||
* 통화를 바꿔도 카드가 리렌더되지 않았다(상품 리스트/검색/캐러셀 KRW 고정 결함).
|
||||
* → 전체 객체에서 `.preferredCurrency` 키로 접근 + state.subscribe 로 리렌더한다.
|
||||
*
|
||||
* @returns 현재 선호 통화 코드(미설정 시 'KRW')
|
||||
* 표시 통화 미설정 시에는 쇼핑몰 기본 통화로 폴백한다 — 특정 통화를 못 박으면
|
||||
* 그 통화를 쓰지 않는 상점에서 multi_currency 조회가 늘 빗나가 기준통화 폴백이 된다.
|
||||
*
|
||||
* @returns 현재 선호 통화 코드 (없으면 기본 통화, 그것도 없으면 빈 문자열)
|
||||
*/
|
||||
const usePreferredCurrency = (): string => {
|
||||
const read = (): string => {
|
||||
const state = (window as any).G7Core?.state?.get?.();
|
||||
return (state && state.preferredCurrency) || 'KRW';
|
||||
return (state && (state.preferredCurrency || state.defaultCurrency)) || '';
|
||||
};
|
||||
const [currency, setCurrency] = useState<string>(read);
|
||||
|
||||
@@ -42,7 +45,7 @@ const usePreferredCurrency = (): string => {
|
||||
setCurrency(read());
|
||||
if (typeof subscribe !== 'function') return;
|
||||
const unsubscribe = subscribe((state: Record<string, any>) => {
|
||||
setCurrency((state && state.preferredCurrency) || 'KRW');
|
||||
setCurrency((state && (state.preferredCurrency || state.defaultCurrency)) || '');
|
||||
});
|
||||
return typeof unsubscribe === 'function' ? unsubscribe : undefined;
|
||||
}, []);
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 통화 포맷 핸들러의 설정 기반 동작 회귀 테스트
|
||||
*
|
||||
* 종전 formatCurrencyHandler 는 KRW/USD/JPY/CNY/EUR 5종 고정 표를 두고
|
||||
* `CURRENCY_CONFIGS[currency] || CURRENCY_CONFIGS.KRW` 로 폴백했다. 운영자가 관리자에서
|
||||
* 통화를 추가할 수 있으므로(예: GBP), 표에 없는 통화는 값은 그 통화인데 기호·자릿수만
|
||||
* 원화로 표기되는 상태가 됐다.
|
||||
*
|
||||
* 통화 표기는 설정(`language_currency.currencies`)이 정한다는 것을 고정한다.
|
||||
*/
|
||||
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
import { formatCurrencyHandler, getCurrencySymbol } from '../formatCurrency';
|
||||
|
||||
/**
|
||||
* 전역 통화 설정과 표시 통화를 심습니다.
|
||||
*
|
||||
* @param currencies 설정에 등록된 통화 목록
|
||||
* @param preferred 표시 통화 코드
|
||||
*/
|
||||
function installState(currencies: any[], preferred?: string): any {
|
||||
const state: Record<string, any> = {
|
||||
modules: { 'sirsoft-ecommerce': { language_currency: { currencies } } },
|
||||
};
|
||||
|
||||
if (preferred) {
|
||||
state.preferredCurrency = preferred;
|
||||
}
|
||||
|
||||
(window as any).G7Core = { state: { get: () => state } };
|
||||
|
||||
return {
|
||||
setState: () => {},
|
||||
getState: (path: string) => {
|
||||
if (path === '_global.preferredCurrency') return state.preferredCurrency;
|
||||
if (path === '_global.defaultCurrency') return state.defaultCurrency;
|
||||
|
||||
return undefined;
|
||||
},
|
||||
} as any;
|
||||
}
|
||||
|
||||
describe('formatCurrencyHandler — 설정 기반 통화 표기', () => {
|
||||
afterEach(() => {
|
||||
delete (window as any).G7Core;
|
||||
});
|
||||
|
||||
it('설정에만 있는 통화(GBP)를 원화로 폴백하지 않는다', () => {
|
||||
const ctx = installState(
|
||||
[{ code: 'GBP', symbol: '£', decimal_places: 2, is_default: true }],
|
||||
'GBP'
|
||||
);
|
||||
|
||||
const formatted = formatCurrencyHandler({ value: 1234.5 }, ctx);
|
||||
|
||||
expect(formatted).toContain('£');
|
||||
expect(formatted).not.toContain('₩');
|
||||
expect(formatted).not.toContain('원');
|
||||
});
|
||||
|
||||
it('설정의 decimal_places 를 따른다', () => {
|
||||
const ctx = installState(
|
||||
[{ code: 'GBP', symbol: '£', decimal_places: 2, is_default: true }],
|
||||
'GBP'
|
||||
);
|
||||
|
||||
expect(formatCurrencyHandler({ value: 1234.5 }, ctx)).toBe('£1,234.50');
|
||||
});
|
||||
|
||||
it('원화는 기존과 동일하게 금액 뒤에 원을 붙인다', () => {
|
||||
const ctx = installState(
|
||||
[{ code: 'KRW', symbol: '₩', decimal_places: 0, is_default: true }],
|
||||
'KRW'
|
||||
);
|
||||
|
||||
expect(formatCurrencyHandler({ value: 10000 }, ctx)).toBe('10,000원');
|
||||
});
|
||||
|
||||
it('표시 통화가 없으면 기본 통화로 표기한다', () => {
|
||||
const ctx = installState([
|
||||
{ code: 'JPY', symbol: '¥', decimal_places: 0, is_default: true },
|
||||
{ code: 'KRW', symbol: '₩', decimal_places: 0 },
|
||||
]);
|
||||
|
||||
const formatted = formatCurrencyHandler({ value: 5000 }, ctx);
|
||||
|
||||
expect(formatted).toContain('¥');
|
||||
expect(formatted).not.toContain('원');
|
||||
});
|
||||
|
||||
it('통화를 판정할 수 없으면 단위를 임의로 붙이지 않는다', () => {
|
||||
const ctx = installState([]);
|
||||
|
||||
const formatted = formatCurrencyHandler({ value: 3000 }, ctx);
|
||||
|
||||
expect(formatted).not.toContain('원');
|
||||
expect(formatted).not.toContain('₩');
|
||||
});
|
||||
|
||||
it('getCurrencySymbol 은 설정의 기호를 우선한다', () => {
|
||||
installState([{ code: 'CNY', symbol: '元', decimal_places: 2 }]);
|
||||
|
||||
expect(getCurrencySymbol('CNY')).toBe('元');
|
||||
});
|
||||
});
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
/**
|
||||
* @file productOptionsAdditionalCurrency.test.ts
|
||||
* @description 추가옵션 추가금의 통화 환산 회귀 테스트
|
||||
*
|
||||
* 배경: 추가옵션 추가금은 쇼핑몰 **기본 통화** 기준으로 저장되는데, 총액 재계산이 그 값을
|
||||
* KRW 로 간주해 표시통화가 KRW 이면 환산 없이 그대로 더했다. 기본통화가 KRW 인 쇼핑몰에서만
|
||||
* 우연히 맞았고, 기본통화가 JPY 인 쇼핑몰을 KRW 로 보면
|
||||
* "환산된 상품가 + 환산 안 된 추가금" 이라는 통화가 섞인 합계가 표시됐다.
|
||||
*
|
||||
* 서버가 선택지마다 `multi_currency_price_adjustment` 를 내려주므로, 총액은 그 맵의
|
||||
* 표시통화 값을 써야 한다.
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import {
|
||||
updateSelectedItemQuantityHandler,
|
||||
addSelectedItemIfCompleteHandler,
|
||||
} from '../productOptions';
|
||||
|
||||
const mockG7Core = {
|
||||
state: { get: vi.fn(() => ({})), getLocal: vi.fn(() => ({})), setLocal: vi.fn() },
|
||||
toast: { show: vi.fn(), warning: vi.fn() },
|
||||
t: vi.fn((key: string) => key),
|
||||
};
|
||||
|
||||
/**
|
||||
* 기본통화 JPY / 표시통화 KRW 인 쇼핑몰의 옵션 단가 맵.
|
||||
* 상품가 10,000 JPY = 95,000 KRW (1,000 JPY = 9,500 KRW 가정).
|
||||
*/
|
||||
const unitPriceMap = {
|
||||
JPY: { value: 10000, formatted: '¥10,000' },
|
||||
KRW: { value: 95000, formatted: '95,000원' },
|
||||
};
|
||||
|
||||
/**
|
||||
* 추가금 5,000 JPY = 47,500 KRW 인 추가옵션 그룹.
|
||||
*/
|
||||
const additionalOptionGroups = [
|
||||
{
|
||||
id: 10,
|
||||
name: '포장 방식',
|
||||
is_required: false,
|
||||
values: [
|
||||
{
|
||||
id: 24,
|
||||
name: '프리미엄 포장',
|
||||
price_adjustment: 5000,
|
||||
is_default: false,
|
||||
multi_currency_price_adjustment: {
|
||||
JPY: { price: 5000, formatted: '+¥5,000', is_default: true },
|
||||
KRW: { price: 47500, formatted: '+47,500원', is_default: false },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const makeItem = (overrides: any = {}) => ({
|
||||
id: 'opt1',
|
||||
optionId: 1,
|
||||
options: {},
|
||||
optionValues: {},
|
||||
quantity: 1,
|
||||
stock: 99,
|
||||
unitPrice: 10000,
|
||||
unitPriceFormatted: '¥10,000',
|
||||
totalPrice: 15000,
|
||||
totalPriceFormatted: '¥15,000',
|
||||
multiCurrencyUnitPrice: { ...unitPriceMap },
|
||||
multiCurrencyTotalPrice: { ...unitPriceMap },
|
||||
additionalOptionSelections: { 10: 24 },
|
||||
additionalOptionsTotal: 5000,
|
||||
additionalOptionsMultiCurrencyTotal: {
|
||||
JPY: { value: 5000 },
|
||||
KRW: { value: 47500 },
|
||||
},
|
||||
...overrides,
|
||||
});
|
||||
|
||||
describe('추가옵션 추가금 통화 환산 (기본통화 ≠ 표시통화)', () => {
|
||||
beforeEach(() => {
|
||||
(window as any).G7Core = mockG7Core;
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
delete (window as any).G7Core;
|
||||
});
|
||||
|
||||
it('표시통화 KRW 합계에 추가금이 환산되어 더해진다 (기준통화 값이 그대로 섞이지 않는다)', () => {
|
||||
const setState = vi.fn();
|
||||
|
||||
updateSelectedItemQuantityHandler(
|
||||
{
|
||||
handler: 'x',
|
||||
params: {
|
||||
itemIndex: 0,
|
||||
newQuantity: 1,
|
||||
selectedOptionItems: [makeItem()],
|
||||
preferredCurrency: 'KRW',
|
||||
additionalOptionGroups,
|
||||
},
|
||||
} as any,
|
||||
{ setState } as any
|
||||
);
|
||||
|
||||
const arg = setState.mock.calls[0][0];
|
||||
|
||||
// 기대: 95,000(상품가 환산) + 47,500(추가금 환산) = 142,500
|
||||
// 수정 전: 95,000 + 5,000(환산 안 된 기준통화 값) = 100,000
|
||||
expect(arg.selectedTotalMultiCurrency.KRW.value).toBe(142500);
|
||||
|
||||
// 기본통화(JPY)는 원값 그대로 10,000 + 5,000 = 15,000
|
||||
expect(arg.selectedTotalMultiCurrency.JPY.value).toBe(15000);
|
||||
});
|
||||
|
||||
it('수량이 늘면 환산된 추가금도 수량만큼 곱해진다', () => {
|
||||
const setState = vi.fn();
|
||||
|
||||
updateSelectedItemQuantityHandler(
|
||||
{
|
||||
handler: 'x',
|
||||
params: {
|
||||
itemIndex: 0,
|
||||
newQuantity: 3,
|
||||
selectedOptionItems: [makeItem()],
|
||||
preferredCurrency: 'KRW',
|
||||
additionalOptionGroups,
|
||||
},
|
||||
} as any,
|
||||
{ setState } as any
|
||||
);
|
||||
|
||||
const arg = setState.mock.calls[0][0];
|
||||
|
||||
// (95,000 + 47,500) × 3 = 427,500
|
||||
expect(arg.selectedTotalMultiCurrency.KRW.value).toBe(427500);
|
||||
});
|
||||
|
||||
it('추가옵션을 선택하지 않으면 상품가만 환산되어 합계가 된다', () => {
|
||||
const setState = vi.fn();
|
||||
|
||||
updateSelectedItemQuantityHandler(
|
||||
{
|
||||
handler: 'x',
|
||||
params: {
|
||||
itemIndex: 0,
|
||||
newQuantity: 2,
|
||||
selectedOptionItems: [
|
||||
makeItem({
|
||||
additionalOptionSelections: {},
|
||||
additionalOptionsTotal: 0,
|
||||
additionalOptionsMultiCurrencyTotal: undefined,
|
||||
}),
|
||||
],
|
||||
preferredCurrency: 'KRW',
|
||||
additionalOptionGroups,
|
||||
},
|
||||
} as any,
|
||||
{ setState } as any
|
||||
);
|
||||
|
||||
const arg = setState.mock.calls[0][0];
|
||||
expect(arg.selectedTotalMultiCurrency.KRW.value).toBe(190000);
|
||||
});
|
||||
|
||||
// 블럭 생성 시 자동 적용되는 기본 선택지는 **필수 그룹** 한정이므로 is_required: true 로 둔다
|
||||
it('선택 항목 생성 시 통화별 추가금 합계가 항목에 실린다', () => {
|
||||
const setState = vi.fn();
|
||||
|
||||
addSelectedItemIfCompleteHandler(
|
||||
{
|
||||
handler: 'x',
|
||||
params: {
|
||||
productId: 28,
|
||||
optionGroups: [{ name: '길이', values: ['1m'] }],
|
||||
options: [
|
||||
{
|
||||
id: 1,
|
||||
option_values: { 길이: '1m' },
|
||||
stock_quantity: 10,
|
||||
is_active: true,
|
||||
selling_price: 10000,
|
||||
selling_price_formatted: '¥10,000',
|
||||
multi_currency_selling_price: {
|
||||
JPY: { price: 10000, formatted: '¥10,000' },
|
||||
KRW: { price: 95000, formatted: '95,000원' },
|
||||
},
|
||||
},
|
||||
],
|
||||
currentSelection: { 길이: '1m' },
|
||||
selectedOptionItems: [],
|
||||
preferredCurrency: 'KRW',
|
||||
additionalOptionGroups: [
|
||||
{
|
||||
...additionalOptionGroups[0],
|
||||
is_required: true,
|
||||
values: [{ ...additionalOptionGroups[0].values[0], is_default: true }],
|
||||
},
|
||||
],
|
||||
},
|
||||
} as any,
|
||||
{ setState } as any
|
||||
);
|
||||
|
||||
const arg = setState.mock.calls[0][0];
|
||||
const item = arg.selectedOptionItems?.[0];
|
||||
|
||||
expect(item).toBeDefined();
|
||||
expect(item.additionalOptionsMultiCurrencyTotal?.KRW?.value).toBe(47500);
|
||||
expect(arg.selectedTotalMultiCurrency.KRW.value).toBe(142500);
|
||||
});
|
||||
});
|
||||
@@ -2,6 +2,11 @@
|
||||
* 통화 포맷팅 핸들러
|
||||
*
|
||||
* 숫자 값을 통화 형식 문자열로 변환합니다.
|
||||
*
|
||||
* 통화 목록은 운영자가 관리자에서 추가/삭제하므로, 이 핸들러는 통화표를 고정해 두지
|
||||
* 않고 쇼핑몰 설정(`language_currency.currencies`)의 기호(symbol)와 소수 자릿수
|
||||
* (decimal_places)를 따릅니다. 고정 통화표를 두면 설정에 없는 통화가 전부 특정 통화로
|
||||
* 폴백되어(예: GBP 를 ₩ + 0자리로) 값은 맞고 단위만 틀린 금액이 화면에 나갑니다.
|
||||
*/
|
||||
|
||||
import { HandlerContext } from '../types';
|
||||
@@ -14,71 +19,116 @@ interface FormatCurrencyParams {
|
||||
|
||||
interface CurrencyConfig {
|
||||
code: string;
|
||||
symbol: string;
|
||||
locale: string;
|
||||
decimals: number;
|
||||
symbol?: string;
|
||||
decimal_places?: number;
|
||||
is_default?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 통화별 기본 설정
|
||||
* 설정에 symbol 이 비어 있을 때만 쓰는 기호 폴백.
|
||||
* 위안화(CNY)는 엔화(¥)와 구분되도록 元 을 사용합니다 (이커머스 모듈과 동일 규칙).
|
||||
*/
|
||||
const CURRENCY_CONFIGS: Record<string, CurrencyConfig> = {
|
||||
KRW: { code: 'KRW', symbol: '₩', locale: 'ko-KR', decimals: 0 },
|
||||
USD: { code: 'USD', symbol: '$', locale: 'en-US', decimals: 2 },
|
||||
JPY: { code: 'JPY', symbol: '¥', locale: 'ja-JP', decimals: 0 },
|
||||
CNY: { code: 'CNY', symbol: '¥', locale: 'zh-CN', decimals: 2 },
|
||||
EUR: { code: 'EUR', symbol: '€', locale: 'de-DE', decimals: 2 },
|
||||
const SYMBOL_FALLBACK: Record<string, string> = {
|
||||
KRW: '₩',
|
||||
USD: '$',
|
||||
JPY: '¥',
|
||||
CNY: '元',
|
||||
EUR: '€',
|
||||
GBP: '£',
|
||||
};
|
||||
|
||||
/**
|
||||
* 설정에 decimal_places 가 없을 때만 쓰는 소수 자릿수 폴백.
|
||||
*/
|
||||
const DECIMAL_PLACES_FALLBACK: Record<string, number> = {
|
||||
KRW: 0,
|
||||
JPY: 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* 쇼핑몰 설정에 등록된 통화 목록을 전역 상태에서 읽습니다.
|
||||
*
|
||||
* @returns currencies 배열 (읽지 못하면 빈 배열)
|
||||
*/
|
||||
function getConfiguredCurrencies(): CurrencyConfig[] {
|
||||
try {
|
||||
const state = (window as any).G7Core?.state?.get?.() || {};
|
||||
const lc = state?.modules?.['sirsoft-ecommerce']?.language_currency;
|
||||
|
||||
return Array.isArray(lc?.currencies) ? lc.currencies : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 숫자 값을 통화 형식으로 포맷팅합니다.
|
||||
*
|
||||
* 원화 계열(₩/원)은 금액 뒤에 "원", 그 외는 기호를 앞에 붙입니다
|
||||
* (백엔드 messages.currency.prefix/suffix 와 동일한 표기 규칙).
|
||||
*
|
||||
* @param params.value - 포맷팅할 숫자 값
|
||||
* @param params.currencyCode - 통화 코드 (KRW, USD, JPY 등)
|
||||
* @param params.locale - 로케일 (선택, 미지정 시 통화 기본 로케일 사용)
|
||||
* @param params.currencyCode - 통화 코드 (미지정 시 표시 통화 → 기본 통화 순)
|
||||
* @param params.locale - 로케일 (숫자 구분자용, 미지정 시 브라우저 로케일)
|
||||
* @param context - 핸들러 컨텍스트
|
||||
* @returns 포맷팅된 통화 문자열
|
||||
*
|
||||
* @example
|
||||
* formatCurrencyHandler({ value: 10000, currencyCode: 'KRW' }, context)
|
||||
* // => "₩10,000" 또는 "10,000원"
|
||||
*
|
||||
* formatCurrencyHandler({ value: 99.99, currencyCode: 'USD' }, context)
|
||||
* // => "$99.99"
|
||||
* formatCurrencyHandler({ value: 10000, currencyCode: 'KRW' }, context) // => "10,000원"
|
||||
* formatCurrencyHandler({ value: 99.99, currencyCode: 'USD' }, context) // => "$99.99"
|
||||
*/
|
||||
export function formatCurrencyHandler(
|
||||
params: FormatCurrencyParams,
|
||||
context: HandlerContext
|
||||
): string {
|
||||
const { value, currencyCode, locale: customLocale } = params;
|
||||
const currency = currencyCode || context.getState('_global.preferredCurrency') || 'KRW';
|
||||
const currencies = getConfiguredCurrencies();
|
||||
|
||||
const config = CURRENCY_CONFIGS[currency] || CURRENCY_CONFIGS.KRW;
|
||||
const locale = customLocale || config.locale;
|
||||
const code = currencyCode
|
||||
|| context.getState('_global.preferredCurrency')
|
||||
|| context.getState('_global.defaultCurrency')
|
||||
|| currencies.find((c) => c.is_default)?.code;
|
||||
|
||||
try {
|
||||
return new Intl.NumberFormat(locale, {
|
||||
style: 'currency',
|
||||
currency: config.code,
|
||||
minimumFractionDigits: config.decimals,
|
||||
maximumFractionDigits: config.decimals,
|
||||
}).format(value);
|
||||
} catch {
|
||||
// Intl 지원 안 되는 환경 폴백
|
||||
const formatted = value.toLocaleString(undefined, {
|
||||
minimumFractionDigits: config.decimals,
|
||||
maximumFractionDigits: config.decimals,
|
||||
});
|
||||
return `${config.symbol}${formatted}`;
|
||||
if (!code) {
|
||||
// 통화를 판정할 수 없으면 단위를 임의로 붙이지 않는다 — 그것이 곧 하드코딩이다.
|
||||
return value.toLocaleString(customLocale);
|
||||
}
|
||||
|
||||
const config = currencies.find((c) => c.code === code);
|
||||
const symbol = (config?.symbol && config.symbol.length > 0)
|
||||
? config.symbol
|
||||
: (SYMBOL_FALLBACK[code] ?? '');
|
||||
const decimals = config?.decimal_places ?? DECIMAL_PLACES_FALLBACK[code] ?? 2;
|
||||
|
||||
const formatted = value.toLocaleString(customLocale, {
|
||||
minimumFractionDigits: decimals,
|
||||
maximumFractionDigits: decimals,
|
||||
});
|
||||
|
||||
// 기호를 모르면 코드 접미 (백엔드 동일 규칙)
|
||||
if (!symbol) {
|
||||
return `${formatted} ${code}`;
|
||||
}
|
||||
|
||||
if (code === 'KRW' || symbol === '₩' || symbol === '원') {
|
||||
return `${formatted}원`;
|
||||
}
|
||||
|
||||
return `${symbol}${formatted}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 통화 심볼만 반환합니다.
|
||||
*
|
||||
* 설정의 symbol 을 우선하고, 없으면 폴백 표, 그것도 없으면 통화 코드를 그대로 돌려줍니다.
|
||||
*
|
||||
* @param currencyCode - 통화 코드
|
||||
* @returns 통화 심볼
|
||||
*/
|
||||
export function getCurrencySymbol(currencyCode: string): string {
|
||||
return CURRENCY_CONFIGS[currencyCode]?.symbol || currencyCode;
|
||||
const config = getConfiguredCurrencies().find((c) => c.code === currencyCode);
|
||||
|
||||
return (config?.symbol && config.symbol.length > 0)
|
||||
? config.symbol
|
||||
: (SYMBOL_FALLBACK[currencyCode] || currencyCode);
|
||||
}
|
||||
@@ -47,7 +47,11 @@ export function getDisplayPriceHandler(
|
||||
context: HandlerContext
|
||||
): string {
|
||||
const { product, priceField, currencyCode } = params;
|
||||
const preferredCurrency = currencyCode || context.getState('_global.preferredCurrency') || 'KRW';
|
||||
// 통화를 못 박지 않는다 — 판정 실패 시 아래 *_formatted(기준 통화 표기)로 폴백한다.
|
||||
const preferredCurrency = currencyCode
|
||||
|| context.getState('_global.preferredCurrency')
|
||||
|| context.getState('_global.defaultCurrency')
|
||||
|| '';
|
||||
|
||||
const multiCurrencyField = `multi_currency_${priceField}` as keyof Product;
|
||||
const multiCurrencyData = product[multiCurrencyField] as Record<string, CurrencyPrice> | undefined;
|
||||
|
||||
@@ -14,7 +14,25 @@ const logger = ((window as any).G7Core?.createLogger?.('Handler:Currency')) ?? {
|
||||
import { HandlerContext } from '../types';
|
||||
|
||||
const STORAGE_KEY = 'g7_preferred_currency';
|
||||
const DEFAULT_CURRENCY = 'KRW';
|
||||
|
||||
/**
|
||||
* 쇼핑몰 설정의 기본 통화를 전역 상태에서 읽습니다.
|
||||
*
|
||||
* 특정 통화를 상수로 못 박으면 그 통화를 쓰지 않는 상점에서 표시 통화가 잘못 초기화된다.
|
||||
*
|
||||
* @returns 기본 통화 코드 (읽지 못하면 빈 문자열)
|
||||
*/
|
||||
function resolveConfiguredDefaultCurrency(): string {
|
||||
try {
|
||||
const state = (window as any).G7Core?.state?.get?.() || {};
|
||||
|
||||
return state.defaultCurrency
|
||||
|| state?.modules?.['sirsoft-ecommerce']?.language_currency?.default_currency
|
||||
|| '';
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
interface LoadPreferredCurrencyParams {
|
||||
defaultCurrency?: string;
|
||||
@@ -42,7 +60,7 @@ export function loadPreferredCurrencyHandler(
|
||||
params: LoadPreferredCurrencyParams,
|
||||
context: HandlerContext
|
||||
): string {
|
||||
const { defaultCurrency = DEFAULT_CURRENCY } = params;
|
||||
const { defaultCurrency = resolveConfiguredDefaultCurrency() } = params;
|
||||
|
||||
let currency = defaultCurrency;
|
||||
|
||||
|
||||
@@ -61,7 +61,15 @@ interface ProductOptionRecord {
|
||||
interface AdditionalOptionValue {
|
||||
id: number;
|
||||
name: string;
|
||||
/** 추가금 (쇼핑몰 **기본 통화** 기준 — KRW 고정이 아니다) */
|
||||
price_adjustment: number;
|
||||
/**
|
||||
* 통화별 추가금 (서버 `multi_currency_price_adjustment`).
|
||||
*
|
||||
* 표시통화가 기본통화와 다르면 `price_adjustment` 를 그대로 쓰면 안 된다.
|
||||
* 상품가는 환산되어 오는데 추가금만 기준통화로 남으면 합계에서 통화가 섞인다.
|
||||
*/
|
||||
multi_currency_price_adjustment?: Record<string, { price?: number; value?: number; formatted: string }>;
|
||||
is_default: boolean;
|
||||
/** 직접입력 허용 — 이 선택지 선택 시 자유 텍스트 입력칸 노출(입력 필수) */
|
||||
allow_custom_text?: boolean;
|
||||
@@ -99,8 +107,10 @@ interface SelectedItem {
|
||||
additionalOptionSelections?: AdditionalOptionSelections;
|
||||
/** 블럭별 추가옵션 직접입력 텍스트 (그룹ID → custom_text). allow_custom_text 선택지 한정 */
|
||||
additionalOptionCustomTexts?: Record<number, string>;
|
||||
/** 블럭별 추가옵션 추가금 합계 (KRW 기준, 단위당) */
|
||||
/** 블럭별 추가옵션 추가금 합계 (기본 통화 기준, 단위당) */
|
||||
additionalOptionsTotal?: number;
|
||||
/** 블럭별 추가옵션 추가금 합계의 통화별 값 (단위당). 표시통화 합계 계산에 쓴다 */
|
||||
additionalOptionsMultiCurrencyTotal?: Record<string, { value: number }>;
|
||||
}
|
||||
|
||||
interface AddSelectedItemParams {
|
||||
@@ -157,68 +167,126 @@ interface ActionDefinition {
|
||||
}
|
||||
|
||||
/**
|
||||
* 통화별 포맷팅 설정
|
||||
* 통화 코드별 소수 자릿수 폴백 (설정에 decimal_places 가 없을 때만 사용).
|
||||
*/
|
||||
const CURRENCY_CONFIGS: Record<string, { locale: string; decimals: number }> = {
|
||||
KRW: { locale: 'ko-KR', decimals: 0 },
|
||||
USD: { locale: 'en-US', decimals: 2 },
|
||||
JPY: { locale: 'ja-JP', decimals: 0 },
|
||||
CNY: { locale: 'zh-CN', decimals: 2 },
|
||||
EUR: { locale: 'de-DE', decimals: 2 },
|
||||
const DECIMAL_PLACES_FALLBACK: Record<string, number> = {
|
||||
KRW: 0,
|
||||
JPY: 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* 숫자를 통화 형식으로 포맷팅
|
||||
* 쇼핑몰 설정에 등록된 통화 목록을 전역 상태에서 읽습니다.
|
||||
*
|
||||
* @returns currencies 배열 (읽지 못하면 빈 배열)
|
||||
*/
|
||||
function formatPrice(amount: number, currencyCode: string = 'KRW'): string {
|
||||
if (!Number.isFinite(amount)) return '0';
|
||||
const config = CURRENCY_CONFIGS[currencyCode] || CURRENCY_CONFIGS.KRW;
|
||||
function getConfiguredCurrencies(): Array<{ code: string; decimal_places?: number; is_default?: boolean }> {
|
||||
try {
|
||||
return new Intl.NumberFormat(config.locale, {
|
||||
const state = (window as any).G7Core?.state?.get?.() || {};
|
||||
const lc = state?.modules?.['sirsoft-ecommerce']?.language_currency;
|
||||
|
||||
return Array.isArray(lc?.currencies) ? lc.currencies : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 숫자를 통화 형식으로 포맷팅
|
||||
*
|
||||
* 통화 목록은 운영자가 관리자에서 추가/삭제하므로 고정 통화표를 두지 않는다. 설정에 없는
|
||||
* 통화를 특정 통화로 폴백시키면(예: GBP 를 원화 자릿수로) 값은 맞고 단위만 틀린 금액이 나간다.
|
||||
* 자릿수는 설정의 decimal_places 를 따르고, 기호·표기 규칙은 Intl 이 통화 코드로 판정한다.
|
||||
*
|
||||
* @param amount 금액
|
||||
* @param currencyCode 통화 코드 (미지정 시 설정의 기본 통화)
|
||||
* @returns 포맷된 금액 문자열
|
||||
*/
|
||||
function formatPrice(amount: number, currencyCode?: string): string {
|
||||
if (!Number.isFinite(amount)) return '0';
|
||||
|
||||
const currencies = getConfiguredCurrencies();
|
||||
const code = currencyCode || currencies.find((c) => c.is_default)?.code;
|
||||
|
||||
if (!code) {
|
||||
// 통화를 판정할 수 없으면 단위를 임의로 붙이지 않는다.
|
||||
return amount.toLocaleString();
|
||||
}
|
||||
|
||||
const decimals = currencies.find((c) => c.code === code)?.decimal_places
|
||||
?? DECIMAL_PLACES_FALLBACK[code]
|
||||
?? 2;
|
||||
|
||||
try {
|
||||
return new Intl.NumberFormat(undefined, {
|
||||
style: 'currency',
|
||||
currency: currencyCode,
|
||||
minimumFractionDigits: config.decimals,
|
||||
maximumFractionDigits: config.decimals,
|
||||
currency: code,
|
||||
minimumFractionDigits: decimals,
|
||||
maximumFractionDigits: decimals,
|
||||
}).format(amount);
|
||||
} catch {
|
||||
return amount.toLocaleString() + (currencyCode === 'KRW' ? '원' : '');
|
||||
return `${amount.toLocaleString(undefined, {
|
||||
minimumFractionDigits: decimals,
|
||||
maximumFractionDigits: decimals,
|
||||
})} ${code}`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 다중 통화 총 가격 재계산
|
||||
*
|
||||
* 추가옵션 추가금(additionalUnitKrw)이 있으면 KRW 환율 기준으로 환산해 각 통화 단가에 가산한다.
|
||||
* 추가옵션은 공개 응답에 다통화 컬럼이 없으므로(plan §245) 기본통화(KRW) 단가 비율로 환산한다.
|
||||
* 추가옵션 추가금은 서버가 통화별로 환산해 내려준 맵(`additionalUnitByCurrency`)에서 읽는다.
|
||||
*
|
||||
* 종전에는 추가금을 KRW 로 간주해 표시통화가 KRW 이면 환산 없이 그대로 더했다. 추가금은
|
||||
* 쇼핑몰 **기본 통화** 기준이라 기본통화가 KRW 인 쇼핑몰에서만 우연히 맞았고, 기본통화가
|
||||
* 다른 쇼핑몰에서는 "환산된 상품가 + 환산 안 된 추가금" 이라는 통화가 섞인 합계가 나왔다.
|
||||
*
|
||||
* 서버 맵이 없는 응답(구버전)에서는 단가 비율로 환산한다. 이때 기준은 **기본 통화**다 —
|
||||
* 종전처럼 KRW 를 기준으로 잡으면 기본통화가 KRW 가 아닌 쇼핑몰에서 어긋난다. 기본 통화를
|
||||
* 판정할 수 없는 형태(내부 `{value, formatted}` 맵)면 마지막 수단으로 KRW 를 기준으로 둔다.
|
||||
*
|
||||
* @param unitPriceMap 옵션 단가 다통화 맵
|
||||
* @param quantity 수량
|
||||
* @param additionalUnitKrw 추가옵션 추가금 합계 (KRW 기준, 단위당). 기본 0.
|
||||
* @param additionalUnitByCurrency 통화별 추가옵션 추가금 합계 (단위당)
|
||||
* @param additionalUnitBase 기본 통화 기준 추가금 합계 (단위당, 폴백 환산용)
|
||||
*/
|
||||
function recalcMultiCurrencyTotal(
|
||||
unitPriceMap: Record<string, { value: number; formatted: string }> | undefined,
|
||||
quantity: number,
|
||||
additionalUnitKrw: number = 0
|
||||
additionalUnitByCurrency?: Record<string, { value: number }>,
|
||||
additionalUnitBase: number = 0
|
||||
): Record<string, { value: number; formatted: string }> | undefined {
|
||||
if (!unitPriceMap) return undefined;
|
||||
|
||||
// KRW 단가를 환산 기준으로 사용 (옵션의 KRW 단가 대비 타통화 비율)
|
||||
const krwUnit = (unitPriceMap.KRW as any)?.value ?? (unitPriceMap.KRW as any)?.price ?? 0;
|
||||
const readAmount = (entry: any): number => entry?.value ?? entry?.price ?? 0;
|
||||
|
||||
// 폴백 환산의 기준 통화: is_default 로 표시된 통화 → 없으면 KRW (기존 동작 보존)
|
||||
let pivotCode: string | undefined;
|
||||
for (const [code, data] of Object.entries(unitPriceMap)) {
|
||||
if ((data as any)?.is_default) {
|
||||
pivotCode = code;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pivotCode = pivotCode ?? (unitPriceMap.KRW ? 'KRW' : undefined);
|
||||
const pivotUnit = pivotCode ? readAmount(unitPriceMap[pivotCode]) : 0;
|
||||
|
||||
const result: Record<string, { value: number; formatted: string }> = {};
|
||||
for (const [code, data] of Object.entries(unitPriceMap)) {
|
||||
// API는 { price, formatted } 형태, 내부는 { value, formatted } 형태 — 둘 다 지원
|
||||
const unitValue = (data as any)?.value ?? (data as any)?.price ?? 0;
|
||||
// 추가금 통화 환산: KRW 기준 추가금 × (해당통화 단가 / KRW 단가). KRW 자신은 그대로.
|
||||
let additionalConverted = 0;
|
||||
if (additionalUnitKrw > 0) {
|
||||
if (code === 'KRW') {
|
||||
additionalConverted = additionalUnitKrw;
|
||||
} else if (krwUnit > 0) {
|
||||
additionalConverted = (additionalUnitKrw * unitValue) / krwUnit;
|
||||
}
|
||||
const unitValue = readAmount(data);
|
||||
|
||||
let additionalValue: number;
|
||||
if (additionalUnitByCurrency) {
|
||||
// 서버가 통화별로 환산해 준 값이 있으면 그것이 정답이다
|
||||
additionalValue = additionalUnitByCurrency[code]?.value ?? 0;
|
||||
} else if (additionalUnitBase > 0 && code === pivotCode) {
|
||||
additionalValue = additionalUnitBase;
|
||||
} else if (additionalUnitBase > 0 && pivotUnit > 0) {
|
||||
additionalValue = (additionalUnitBase * unitValue) / pivotUnit;
|
||||
} else {
|
||||
additionalValue = 0;
|
||||
}
|
||||
const total = (unitValue + additionalConverted) * quantity;
|
||||
|
||||
const total = (unitValue + additionalValue) * quantity;
|
||||
result[code] = {
|
||||
value: total,
|
||||
formatted: formatPrice(total, code),
|
||||
@@ -279,6 +347,50 @@ function computeAdditionalOptionsTotal(
|
||||
return total;
|
||||
}
|
||||
|
||||
/**
|
||||
* 선택된 추가옵션 추가금의 **통화별** 합계를 계산합니다 (단위당).
|
||||
*
|
||||
* 서버가 선택지마다 내려주는 `multi_currency_price_adjustment` 를 통화코드별로 합산한다.
|
||||
* 그 맵이 없는 선택지(구버전 응답)는 기본통화 값만 있는 셈이므로 합산에서 제외하지 않고
|
||||
* 통화 구분 없이 더하면 통화가 섞이므로, 맵이 있는 선택지만 통화별 합계에 반영한다.
|
||||
*
|
||||
* @param selections 블럭별 추가옵션 선택 (그룹ID → 선택지ID)
|
||||
* @param groups 추가옵션 카탈로그
|
||||
* @returns 통화코드 => { value } 합계 맵 (선택 없음/맵 없음이면 undefined)
|
||||
*/
|
||||
function computeAdditionalOptionsMultiCurrencyTotal(
|
||||
selections: AdditionalOptionSelections | undefined,
|
||||
groups: AdditionalOptionGroup[] | undefined
|
||||
): Record<string, { value: number }> | undefined {
|
||||
if (!selections || !groups?.length) return undefined;
|
||||
|
||||
const totals: Record<string, number> = {};
|
||||
let found = false;
|
||||
|
||||
for (const group of groups) {
|
||||
const valueId = selections[group.id];
|
||||
if (valueId == null) continue;
|
||||
|
||||
const value = group.values?.find(v => v.id === Number(valueId));
|
||||
const map = value?.multi_currency_price_adjustment;
|
||||
if (!map) continue;
|
||||
|
||||
found = true;
|
||||
for (const [code, entry] of Object.entries(map)) {
|
||||
const amount = (entry as any)?.value ?? (entry as any)?.price ?? 0;
|
||||
totals[code] = (totals[code] ?? 0) + amount;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) return undefined;
|
||||
|
||||
const result: Record<string, { value: number }> = {};
|
||||
for (const [code, value] of Object.entries(totals)) {
|
||||
result[code] = { value };
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 추가옵션 선택을 백엔드 입력 형식으로 변환한다.
|
||||
* additional_option_selections: [{ additional_option_id, value_id }]
|
||||
@@ -486,6 +598,10 @@ export function addSelectedItemIfCompleteHandler(
|
||||
additionalOptionSelections,
|
||||
additionalOptionGroups
|
||||
);
|
||||
const additionalOptionsMultiCurrencyTotal = computeAdditionalOptionsMultiCurrencyTotal(
|
||||
additionalOptionSelections,
|
||||
additionalOptionGroups
|
||||
);
|
||||
|
||||
const blockUnitTotal = unitPrice + additionalOptionsTotal;
|
||||
|
||||
@@ -507,10 +623,12 @@ export function addSelectedItemIfCompleteHandler(
|
||||
multiCurrencyTotalPrice: recalcMultiCurrencyTotal(
|
||||
matchedOption.multi_currency_selling_price as any,
|
||||
1,
|
||||
additionalOptionsMultiCurrencyTotal,
|
||||
additionalOptionsTotal
|
||||
),
|
||||
additionalOptionSelections,
|
||||
additionalOptionsTotal,
|
||||
additionalOptionsMultiCurrencyTotal,
|
||||
};
|
||||
|
||||
const nextItems = [...items, newItem];
|
||||
@@ -553,6 +671,7 @@ export function updateSelectedItemQuantityHandler(
|
||||
multiCurrencyTotalPrice: recalcMultiCurrencyTotal(
|
||||
item?.multiCurrencyUnitPrice,
|
||||
newQuantity,
|
||||
item?.additionalOptionsMultiCurrencyTotal,
|
||||
additionalOptionsTotal
|
||||
),
|
||||
};
|
||||
@@ -616,6 +735,10 @@ export function setBlockAdditionalOptionHandler(
|
||||
}
|
||||
|
||||
const additionalOptionsTotal = computeAdditionalOptionsTotal(selections, additionalOptionGroups);
|
||||
const additionalOptionsMultiCurrencyTotal = computeAdditionalOptionsMultiCurrencyTotal(
|
||||
selections,
|
||||
additionalOptionGroups
|
||||
);
|
||||
const unitPrice = item?.unitPrice ?? 0;
|
||||
const quantity = item?.quantity ?? 1;
|
||||
const totalPrice = (unitPrice + additionalOptionsTotal) * quantity;
|
||||
@@ -625,11 +748,13 @@ export function setBlockAdditionalOptionHandler(
|
||||
additionalOptionSelections: selections,
|
||||
additionalOptionCustomTexts: customTexts,
|
||||
additionalOptionsTotal,
|
||||
additionalOptionsMultiCurrencyTotal,
|
||||
totalPrice,
|
||||
totalPriceFormatted: formatPrice(totalPrice, preferredCurrency),
|
||||
multiCurrencyTotalPrice: recalcMultiCurrencyTotal(
|
||||
item?.multiCurrencyUnitPrice,
|
||||
quantity,
|
||||
additionalOptionsMultiCurrencyTotal,
|
||||
additionalOptionsTotal
|
||||
),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user