PageSourceSearch

https://houseofhur.co.kr/ind-script/optimizer_user.php?filename=jZ…3f117acabe53908821ae407&t=1735019571&user=T

js houseofhur.co.kr collected 2026-10-08 23:32:03 UTC 80,424 bytes, 1,863 lines download raw bytes

1//console.log("@@@ 📁/theme1/main/main.js");
2
3$("#LoadLayer").addClass("custom");
4
5function mainTopSlide() {
6    var module = "#mainTopSlide";
7    var use = $(module+' [use]').attr('use');
8    var time = $(module+' [use]').attr('time');
9
10    if ( use == "Y" ) {
11
12        var swiper = new Swiper( module+" .mySwiper", {
13            initialSlide: 0,
14            slidesPerView: '1',
15            spaceBetween: 10,
16            loop: true,
17            //loopAdditionalSlides: 1,
18            effect: "fade",
19            speed: 500,
20            autoplay: {
21                delay: time,
22                disableOnInteraction: false,
23            },
24            pagination: {
25                el: module+" .swiper-pagination",
26                clickable: true,
27            },
28            navigation: {
29                nextEl: module+" .swiper-button-next",
30                prevEl: module+" .swiper-button-prev",
31            },
32            on: {
33                slideChange : function(index, className) {
34                    if (this.realIndex === 0) {
35                        $(module+" .-fraction > strong").text(this.slides.length);
36                    } else {
37                        $(module+" .-fraction > strong").text(this.realIndex);
38                    }
39                },
40                init: function() {
41                    $(module + " .-fraction > span").text(this.slides.length);
42                },
43            },
44        });
45
46        $(module).addClass('-on');
47        LoadCompleteCustom();
48    } else {
49        $(module).remove();
50        LoadCompleteCustom();
51    }
52}
53
54
55function mainMovieBanners() {
56    var module = "#mainMovieBanners";
57    var use = $(module + ' [use]').attr('use');
58    var time = $(module + ' [use]').attr('time');
59
60    if (use == "Y") {
61
62        var swiper = new Swiper( module+" .mySwiper", {
63            initialSlide: 0,
64            slidesPerView: 'auto',
65            spaceBetween: 15,
66            loop: true,
67            freeMode: true,
68            //loopAdditionalSlides: 1,
69            speed: 700,
70            autoplay: {
71                delay: time,
72                disableOnInteraction: false,
73            },
74            pagination: {
75                el: module+" .swiper-pagination",
76                clickable: true,
77                // type: "progressbar",
78            },
79            navigation: {
80                nextEl: module+" .swiper-button-next",
81                prevEl: module+" .swiper-button-prev",
82            },
83            breakpoints: {
84                992: {
85                    slidesPerView: '5',
86                    freeMode: false,
87                    spaceBetween: 15,
88                },
89            },
90            on: {
91                slideChange : function(index, className) {
92                    if (this.realIndex === 0) {
93                        $(module+" .-fraction > strong").text(this.slides.length);
94                    } else {
95                        $(module+" .-fraction > strong").text(this.realIndex);
96                    }
97                },
98                init: function() {
99                    $(module + " .-fraction > span").text(this.slides.length);
100                },
101            },
102        });
103
104    }
105}
106
107
108function mainBestProduct() {
109    var module = "#mainBestProduct";
110    var use = $(module + ' [use]').attr('use');
111    var time = $(module + ' [use]').attr('time');
112
113    if (use == "Y") {
114
115        if ( window.location.href.indexOf(window.SampleDemo) !== -1 ) {
116            //$sampleSetting1.ProductItems.Links();
117            //$sampleSetting1.ProductThumbs.MainBest();
118        }
119
120        var swiper = new Swiper( module+" .mySwiper", {
121            initialSlide: 0,
122            slidesPerView: 'auto',
123            spaceBetween: 16,
124            loop: false,
125            //loopAdditionalSlides: 1,
126            speed: 700,
127            freeMode: true,
128            autoplay: {
129                delay: time,
130                disableOnInteraction: false,
131            },
132            pagination: {
133                el: module+" .swiper-pagination",
134                // clickable: true,
135                type: "progressbar",
136            },
137            navigation: {
138                nextEl: module+" .swiper-button-next",
139                prevEl: module+" .swiper-button-prev",
140            },
141            scrollbar: {
142                el: ".swiper-scrollbar",
143                hide: false,
144                draggable: true,
145            },
146            breakpoints: {
147                550: {
148                    slidesPerView: '3',
149                    spaceBetween: 16,
150                    freeMode: false,
151                },
152                992: {
153                    slidesPerView: '4',
154                    spaceBetween: 16,
155                    freeMode: false,
156                },
157            },
158            on: {
159                slideChange : function(index, className) {
160                    if (this.realIndex === 0) {
161                        $(module+" .-fraction > strong").text(this.slides.length);
162                    } else {
163                        $(module+" .-fraction > strong").text(this.realIndex);
164                    }
165                },
166                init: function() {
167                    $(module + " .-fraction > span").text(this.slides.length);
168                },
169            },
170        });
171
172    }
173}
174
175function mainGridBanner() {
176    var module = "#mainGridBanner";
177    var use = $(module+' [use]').attr('use');
178
179    if ( use == "Y" ) {
180        $(module+" li .-img a").each(function() {
181            var hrefValue = $(this).attr("href");
182            $(this).closest("li").find("a").attr("href", hrefValue);
183        });
184    }
185
186    if ( window.location.href.indexOf(window.SampleDemo) !== -1 ) {
187        //$sampleSetting1.Main.GridBanner();
188    }
189}
190
191
192$(function() {
193    mainTopSlide();
194    mainMovieBanners();
195    mainBestProduct();
196    mainGridBanner();
197    if ( window.location.href.indexOf(window.SampleDemo) !== -1 ) {
198        //$sampleSetting1.ProductThumbs.MainNormal();
199        //$sampleSetting1.Main.Popup1();
200    }
201});
202function themePrdItems() {
203    //console.log("@@@ 📁/theme1/product/item/item.js");
204    setTimeout(function () {
205        var count = 0;
206        var timeer = setInterval(function () {
207
208            $(".themePrdItems.-loading").each(function() {
209                var self = this; // 현재 .themePrdItems 요소를 가리킴
210
211                iOfftoFixed = 0, // 할인율 소수점자릿수
212                    regexp = /\B(?=(\d{3})+(?!\d))/g,
213                    sSaleTextsSaleText = '';
214
215                customPrice = parseInt( $(this).attr("ec-data-custom").replace(/[^0-9]/g,'') ), //소비자가
216                    productPrice = parseInt($(this).attr("ec-data-price").replace(/[^0-9]/g,'') ); //판매가
217                productSale ='';
218
219                customPriceDisp = $(this).find("li[spec='product_custom']").attr("spec-data"), //소비자가
220                    productPriceDisp = $(this).find("li[spec='product_price']").attr("spec-data"); //판매가
221
222                if ( $(this).find("[spec=prd_price_sale]").length ) {
223                    //할인판매가가 있을 경우
224                    $(this).find("[spec=prd_price_sale] > div > span > span").remove(); //할인율,할인금액은지움
225                    productSale = parseInt( $(this).find("[spec=prd_price_sale] > div > span").text().replace(/[\D]/g, ''), 10);
226                    itemsSale1.call(this);
227                    itemsSale2.call(this);
228                } else {
229                    //할인판매가가 없을 경우
230                    itemsSale1.call(this);
231                }
232
233                function itemsSale1() {
234                    if (customPrice > 0 && productPrice > 0 && productPrice != customPrice) {
235                        sSaleText = (((customPrice - productPrice) / customPrice) * 100).toFixed(iOfftoFixed) + '%';
236                        $(this).addClass('--saled1');
237                        $(this).find('li[spec="product_price"]').prepend('<div spec="product_custom">'+customPriceDisp+'</div><div spec="sale_rate">'+sSaleText+'</div>');
238                    } else {
239                        //소비자가와 판매가가 보다 작거나 같을 때
240                        $(this).find("li[spec='product_custom']").remove();
241                    }
242                }
243
244                function itemsSale2() {
245                    if (productPrice > 0 && productSale > 0 && productSale != productPrice) {
246                        sSaleText = (((productPrice - productSale) / productPrice) * 100).toFixed(iOfftoFixed) + '%';
247                        $(this).addClass('--saled2');
248                        $(this).find('li[spec="prd_price_sale"]').prepend('<div spec="product_price">'+productPriceDisp+'</div><div spec="sale_rate2">'+sSaleText+'</div>');
249                    }
250                }
251
252                $(this).removeClass('-loading');
253
254                //평점
255                // if ($ectconfig.PrdItemReviewPoint === "Y") {
256                //     $.ajax({
257                //         url: '/theme/common/html/review_list.html?board_no=4&link_product_no=' + $(this).attr('ec-data-no'),
258                //         method: 'GET',
259                //         success: function (response) {
260                //             console.log(response);
261                //             const $responseHtml = $(response);
262                //             const $listItems = $responseHtml.find('ul.-boards > li');
263                //
264                //             let totalPoints = 0;
265                //             let itemCount = 0;
266                //             $listItems.each(function() {
267                //                 let point = parseFloat($(this).attr('data-point'));
268                //                 if (point === 0) {
269                //                     point = 5; // point가 0일 경우 5로 변경
270                //                 }
271                //                 if (!isNaN(point)) {
272                //                     totalPoints += point;
273                //                     itemCount++;
274                //                 }
275                //             });
276                //
277                //             const average = totalPoints / itemCount;
278                //             const roundedAverage = Math.ceil(average * 10) / 10;
279                //             if (!isNaN(roundedAverage) && roundedAverage !== 0) {
280                //                 const cafe24skincode = CAFE24.SKIN_CODE;
281                //                 $(self).find('.-info ul.-spec').append('<li data-a="'+totalPoints+'" data-c="'+itemCount+'" spec="review_avg"><strong class="-label"><img src="/skin-'+cafe24skincode+'/theme/icon/point.svg"><font class="--hidden">리뷰평점</font></strong><div>'+roundedAverage+'</div><div class="-count">'+itemCount+'개의 리뷰</div></li>');
282                //             }
283                //         },
284                //         error: function (xhr, status, error) {
285                //             console.error('Error fetching data:', status, error);
286                //         }
287                //     });
288                // }
289
290                //타임특가
291                if ($(this).find(".-promotion_date .discountPeriod").length) {
292                    var discountPeriodText = $(this).find(".-promotion_date .discountPeriod .content p:not(:has(strong))").text();
293
294                    var endDateText = discountPeriodText.split("~")[1].trim();
295                    var endDate = new Date(endDateText.replace(/-/g, "/"));
296
297                    function updateCountdown() {
298                        var now = new Date();
299                        var timeDiff = endDate - now;
300
301                        if (timeDiff <= 0) {
302                            $(self).find(".-promotion_date .-disp").html("<span class='-ended'>종료되었습니다.</span>");
303                            clearInterval(countdownInterval);
304                            return;
305                        }
306
307                        var days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
308                        var hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
309                        var minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
310                        var seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
311
312                        var countdownHtml = `
313            <span class="-days" data-days="${days}"><strong>${days}</strong><span class="-label"></span></span>
314            <span class="-hours" data-hours="${hours}"><strong>${hours}</strong><span class="-label"></span></span>
315            <span class="-minutes" data-minutes="${minutes}"><strong>${minutes}</strong><span class="-label"></span></span>
316            <span class="-seconds" data-seconds="${seconds}"><strong>${seconds}</strong><span class="-label"></span></span>
317            <span class="-remain"></span>
318        `;
319
320                        var $disp = $(self).find(".-promotion_date .-disp");
321                        if (!$disp.length) {
322                            $disp = $('<div class="-disp"></div>');
323                            $(self).find(".-promotion_date").append($disp);
324                        }
325                        $disp.html(countdownHtml);
326                    }
327
328                    var countdownInterval = setInterval(updateCountdown, 1000);
329
330                    // 초기 호출
331                    updateCountdown();
332                }
333
334            });
335
336            count++;
337
338            if ( !$(".themePrdItems.-loading").length ) {
339                //console.log("@@@ 💬themePrdItems "+$(".themePrdItems:not(.-loading)").length+" items");
340                clearInterval(timeer);
341
342                if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
343                    $sampleSetting1.ProductItems.Links();
344                    $sampleSetting1.ProductThumbs.ListNormal();
345                }
346            }
347        }, 100);
348    }, 100);
349
350
351    $(".themePrdItems .-thumb").hover(
352        //효과1
353        //마우스오버시 첫번째 이미지 스케일 애니메이션
354        //이미지줌컴포넌트 themes/addon/zachstronaut/jquery-animate-css-rotate-scale.js
355        // function() {
356        //     $(this).find('.-medium').animate({scale:'1.03'}, 200);
357        // },
358        // function() {
359        //     $(this).find('.-medium').animate({scale:'1'}, 200); //이미지줌컴포넌트 themes/addon/zachstronaut/jquery-animate-css-rotate-scale.js
360        // }
361
362        //효과2
363        //마우스오버시 두번째 이미지 페이드 + 스케일 애니메이션
364        //이미지줌컴포넌트 themes/addon/zachstronaut/jquery-animate-css-rotate-scale.js
365        // function() {
366        //     $(this).find(".-small").show().css('opacity', 0).animate({opacity: 1, scale:'1'}, 350); //이미지줌컴포넌트 themes/addon/zachstronaut/jquery-animate-css-rotate-scale.js
367        // },
368        // function() {
369        //     $(this).find(".-small").animate({opacity: 0,scale:'1'}, 300).fadeOut(200); //이미지줌컴포넌트 themes/addon/zachstronaut/jquery-animate-css-rotate-scale.js
370        // }
371
372        //효과3
373        //마우스오버시 두번째 이미지(애니메이션X)
374        // function() {
375        //     $(this).find(".-small").show();
376        // },
377        // function() {
378        //     $(this).find(".-small").hide();
379        // }
380    );
381}
382
383$(function() {
384    if ( $(".themePrdItems.-loading").length ) {
385        themePrdItems();
386        $(".ec-base-paginate.typeMoreview a.btnMore").click(function() {
387            setTimeout(function () {
388                themePrdItems();
389            }, 150);
390        });
391    }
392});
393
394//console.log("@@@ 📁/theme1/common/js/theme.js");
395
396themeNumber = 1;
397
398function themeJS() {
399    //console.log("@@@ ▶️themeJS");
400
401    $(function() {
402
403        // if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
404        //     $sampleHeaders.set();
405        // } else {
406        //
407        // }
408
409        //IP
410//         var ip;
411//         var country;
412//         var country_code;
413//         var org;
414//         $.ajax({
415//             url: "https://api.ip.pe.kr/json"
416//         }).done(function(api) {
417//             console.log(api.ip);
418//             if ( api.ip == "58.29.182.88" || api.ip == "221.143.144.180" ) {
419//                 //$("body").html('<div>-</div>');
420//             } else {
421//                 $("body").html('<div style="display: flex; position: fixed; left: 0px; top: 0px; width: 100vw; height: 100vh; z-index: 9999999999999; background: #fff; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: #777777;">작업이 진행중 입니다.<br>조금만 기다려 주세요 😄</div>');
422//             }
423//         }).fail(function() {
424//         });
425
426
427        if ( $("div[id*='themeBannersHeader']").length ) {
428            themeHeaderBanner();
429        } else {
430            themeHeader();
431        }
432
433        //게시판목록
434        if ( $('form#boardSearchForm').length ) {
435            $ect.BoardCates();
436        }
437        //게시판작성
438        if ( $('form#boardWriteForm iframe#content_IFRAME').length ) {
439            $ect.BoardWriteEditor();
440        }
441        //게시판상세댓글
442        if ( $('.xans-board-commentpackage:has(form#commentWriteForm) .xans-board-commentwrite').length ) {
443            $ect.BoardCommentWrite();
444        }
445
446
447    });
448
449
450}
451/**
452 * 움직이는 배너 Jquery Plug-in
453 * @author  cafe24
454 */
455
456(function($){
457
458    $.fn.floatBanner = function(options) {
459        options = $.extend({}, $.fn.floatBanner.defaults , options);
460
461        return this.each(function() {
462            var aPosition = $(this).position();
463            var jbOffset = $(this).offset();
464            var node = this;
465
466            $(window).on('scroll', function() {
467                var _top = $(document).scrollTop();
468                _top = (aPosition.top < _top) ? _top : aPosition.top;
469
470                setTimeout(function () {
471                    var newinit = $(document).scrollTop();
472
473                    if ( newinit > jbOffset.top ) {
474                        _top -= jbOffset.top;
475                        var container_height = $("#wrap").height();
476                        var quick_height = $(node).height();
477                        var cul = container_height - quick_height;
478                        if(_top > cul){
479                            _top = cul;
480                        }
481                    } else {
482                        _top = 0;
483                    }
484
485                    $(node).stop().animate({top: _top}, options.animate);
486                }, options.delay);
487            });
488        });
489    };
490
491    $.fn.floatBanner.defaults = {
492        'animate'  : 500,
493        'delay'    : 500
494    };
495
496})(jQuery);
497
498/**
499 * 문서 구동후 시작
500 */
501$(function(){
502    $('#banner:visible, #quick:visible').floatBanner();
503
504    //placeholder
505    $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){
506        var placeholderName = $(this).parents().attr('title');
507        $(this).attr("placeholder", placeholderName);
508    });
509    /* placeholder ie8, ie9 */
510    $.fn.extend({
511        placeholder : function() {
512            //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴
513           if (hasPlaceholderSupport() === true) {
514                return this;
515            }
516            //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행
517            return this.each(function(){
518                var findThis = $(this);
519                var sPlaceholder = findThis.attr('placeholder');
520                if ( ! sPlaceholder) {
521                   return;
522                }
523                findThis.wrap('<label class="ePlaceholder" />');
524                var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : '';
525                findThis.before('<span' + sDisplayPlaceHolder + '>' + sPlaceholder + '</span>');
526                this.onpropertychange = function(e){
527                    e = event || e;
528                    if (e.propertyName == 'value') {
529                        $(this).trigger('focusout');
530                    }
531                };
532                //공통 class
533                var agent = navigator.userAgent.toLowerCase();
534                if (agent.indexOf("msie") != -1) {
535                    $(".ePlaceholder").css({"position":"relative"});
536                    $(".ePlaceholder span").css({"position":"absolute", "padding":"0 4px", "color":"#878787"});
537                    $(".ePlaceholder label").css({"padding":"0"});
538                }
539            });
540        }
541    });
542
543    $(':input[placeholder]').placeholder(); //placeholder() 함수를 호출
544
545    //클릭하면 placeholder 숨김
546    $('body').on('click', '.ePlaceholder span', function(){
547        $(this).hide();
548    });
549
550    //input창 포커스 인 일때 placeholder 숨김
551    $('body').on('focusin', '.ePlaceholder :input', function(){
552        $(this).prev('span').hide();
553    });
554
555    //input창 포커스 아웃 일때 value 가 true 이면 숨김, false 이면 보여짐
556    $('body').on('focusout', '.ePlaceholder :input', function(){
557        if (this.value) {
558            $(this).prev('span').hide();
559        } else {
560            $(this).prev('span').show();
561        }
562    });
563
564    //input에 placeholder가 지원이 되면 true를 안되면 false를 리턴값으로 던져줌
565    function hasPlaceholderSupport() {
566        if ('placeholder' in document.createElement('input')) {
567            return true;
568        } else {
569            return false;
570        }
571    }
572});
573
574/**
575 *  썸네일 이미지 엑박일경우 기본값 설정
576 */
577$(window).on('load', function() {
578    $("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){
579        var $img = new Image();
580        $img.onerror = function () {
581            $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
582        }
583        $img.src = this.src;
584    });
585});
586
587/**
588 *  tooltip
589 */
590$('.eTooltip').each(function(i){
591    $(this).find('.btnClose').attr('tabIndex','-1');
592});
593//tooltip input focus
594$('.eTooltip').find('input').on('focus', function() {
595    var targetName = returnTagetName(this);
596    targetName.siblings('.ec-base-tooltip').show();
597});
598$('.eTooltip').find('input').on('focusout', function() {
599    var targetName = returnTagetName(this);
600    targetName.siblings('.ec-base-tooltip').hide();
601});
602function returnTagetName(_this){
603    var ePlacename = $(_this).parent().attr("class");
604    var targetName;
605    if(ePlacename == "ePlaceholder"){ //ePlaceholder 대응
606        targetName = $(_this).parents();
607    }else{
608        targetName = $(_this);
609    }
610    return targetName;
611}
612
613/**
614 *  eTab
615 */
616$("body").on("click", ".eTab a", function(e){
617    // 클릭한 li 에 selected 클래스 추가, 기존 li에 있는 selected 클래스는 삭제.
618    var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"),
619    _target = $(this).attr("href"),
620    _siblings = $(_target).attr("class"),
621    _arr = _siblings.split(" "),
622    _classSiblings = "."+_arr[0];
623
624    //클릭한 탭에 해당하는 요소는 활성화, 기존 요소는 비활성화 함.
625    $(_target).show().siblings(_classSiblings).hide();
626
627
628    //preventDefault 는 a 태그 처럼 클릭 이벤트 외에 별도의 브라우저 행동을 막기 위해 사용됨.
629    e.preventDefault();
630});
631
632
633
634//window popup script
635function winPop(url) {
636    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
637}
638/**
639 * document.location.href split
640 * return array Param
641 */
642function getQueryString(sKey)
643{
644    var sQueryString = document.location.search.substring(1);
645    var aParam       = {};
646
647    if (sQueryString) {
648        var aFields = sQueryString.split("&");
649        var aField  = [];
650        for (var i=0; i<aFields.length; i++) {
651            aField = aFields[i].split('=');
652            aParam[aField[0]] = aField[1];
653        }
654    }
655
656    aParam.page = aParam.page ? aParam.page : 1;
657    return sKey ? aParam[sKey] : aParam;
658};
659
660$(function(){
661    // tab
662    $.eTab = function(ul){
663        $(ul).find('a').on('click', function(){
664            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
665                _target = $(this).attr('href'),
666                _siblings = '.' + $(_target).attr('class');
667            $(_target).show().siblings(_siblings).hide();
668            return false
669        });
670    }
671    if ( window.call_eTab ) {
672        call_eTab();
673    };
674});
675(function($){
676    $.fn.extend({
677        center: function() {
678            this.each(function() {
679                var
680                    $this = $(this),
681                    $w = $(window);
682                $this.css({
683                    position: "absolute",
684                    top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
685                    left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
686                });
687            });
688            return this;
689        }
690    });
691    $(function() {
692        var $container = function(){/*
693    <div id="modalContainer">
694        <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
695    </div>');
696    */}.toString().slice(14,-3);
697        $('body')
698        .append($('<div id="modalBackpanel"></div>'))
699        .append($($container));
700        function closeModal () {
701            $('#modalContainer').hide();
702            $('#modalBackpanel').hide();
703        }
704        $('#modalBackpanel').on('click',closeModal);
705        zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
706            var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
707            $('#modalContent').attr('src', $url);
708            $('#modalContent').on("load",function(){
709                $(".header .close",this.contentWindow.document.body).on("click", closeModal);
710            });
711            $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
712            $('#modalContainer').center().show();
713        }
714    });
715})(jQuery);
716$(function(){
717    var loginButtons = document.querySelectorAll('.header-login-btn');
718    
719    loginButtons.forEach(function(button) {
720        button.addEventListener('click', function() {
721            var contentValue = document.querySelector('meta[name="path_role"]').getAttribute('content');
722
723            // 회원가입(MEMBER_JOIN)일 경우 returnUrl 없이 리다이렉트
724            if (contentValue == 'MEMBER_JOIN') {
725                window.location.href = '/member/login.html';
726                return true;
727            }
728
729            // 기존 queryString이 있으면 유지함
730            var existingParams = new URLSearchParams(window.location.search);
731            var returnUrl = existingParams.has('returnUrl') ? existingParams.get('returnUrl') : window.location.pathname + window.location.search;
732            existingParams.set('returnUrl', returnUrl);
733
734            window.location.href = '/member/login.html?' + existingParams.toString();
735        });
736    });
737});
738var $ectconfig = {
739
740    themeColorMode: "light",
741    themeSmapleSite: "ecudemo341300",
742    themeBrand: "heys",
743    themeCode: "basic",
744    themeVersion: "2",
745    themeOrigin: "4",
746    themeReleaseDate: "2024.12.04",
747
748    //상세페이지공유기능
749    PrdListSubcateIcon:         "Y", //서브카테고리 아이콘 표시  ["Y" 또는 "N"]
750
751    //상세페이지공유기능
752    PrdDetailKakaoLink:         "Y", //카카오톡 링크 사용유무 : "Y" 또는 "N"
753    PrdDetailKakaoKey:          "카카오개발자센터에서키를발급받아주세요",  //카카오톡 자바스크립트키 ( https://developers.kakao.com )
754    PrdDetaillFacebookLink:     "Y", //페이스북 링크 사용유무 : "Y" 또는 "N"
755
756    //평점기능
757    PrdItemReviewPoint:         "Y", //상품목록 아이템의 리뷰평점 표시 ["Y" 또는 "N"]
758    PrdDetailReviewPoint:       "Y", //상품상세 페이지의 리뷰평점 표시 ["Y" 또는 "N"]
759    PrdDetailReview:            "Y", //상품상세 페이지의 포토리뷰 사용 ["Y" 또는 "N"]
760
761}
762//console.log("@@@ 📁/themes/common/js/functions.js");
763
764SampleDemo = $ectconfig.themeSmapleSite;
765SampleSkin = CAFE24.SKIN_CODE;
766OriginSkin = $ectconfig.themeOrigin;
767
768//----------------------------------------------------------------------------------------------------------------------
769//
770//  ECT common
771
772var $ect = {
773
774    //가로세로 변환시 뷰포트높이값
775    vhSetResize: function () {
776        let isLandscape = window.innerWidth > window.innerHeight;
777        window.addEventListener('resize', () => {
778            const currentIsLandscape = window.innerWidth > window.innerHeight;
779            if (currentIsLandscape && !isLandscape) {
780                //세로모드에서 가로모드로 전환
781                $ect.vhSet();
782            } else if (!currentIsLandscape && isLandscape) {
783                // 가로모드에서 세로모드로 전환
784                $ect.vhSet();
785            }
786            // 현재 상태를 이전 상태로 업데이트
787            isLandscape = currentIsLandscape;
788        });
789        // $ect.vhSet();
790        //console.log("@@@ ▶️vhSetResize");
791    },
792
793    //뷰포트높이값
794    vhSet: function () {
795        let vh = window.innerHeight * 0.01;
796        document.documentElement.style.setProperty('--vh', `${vh}px`);
797        //console.log("@@@ ▶️vhSet");
798        // $("#asdasd").text(vh);
799    },
800
801    //스크롤 포지션 감지
802    noScroll: function () {
803        noScrollPosition = $(window).scrollTop();
804        $("html").addClass('--noScroll');
805        $("html").css('top', -noScrollPosition + 'px');
806        $ect.vhSet();
807        //console.log("@@@ ▶️noScroll");
808    },
809
810    //스크롤 포지션 리셋
811    noScrollReset: function () {
812        $ect.vhSet();
813        $("html").removeClass('--noScroll');
814        $("html").css('top', 'auto');
815        $("html, body").scrollTop(noScrollPosition);
816        $("html").removeClass('-noScroll_headerFixed');
817        //console.log("@@@ ▶️noScrollReset");
818    },
819
820    //스크롤 포지션 리셋 팝업
821    noScrollResetByPopup: function () {
822        setTimeout(function () {
823            const noScrollResetByElements = [
824                '#capp-shop-new-product-optionselect-backlayer',
825                '#modalBackpanel'
826            ];
827            noScrollResetByElements.forEach(selector => {
828                $(document).on('click', selector, function() {
829                    //console.log(`Clicked element: ${selector}`, this);
830                    $ect.noScrollReset();
831                });
832            });
833
834        }, 500);
835    },
836
837    //아코디언
838    Accordions: function () {
839        var accordions = ".accordions";
840        if ( $(accordions+' li').length ) {
841            $(accordions+' > ul > li > .-cont').hide();
842            $(accordions+' > ul > li > strong').click(function() {
843                if ($(this).parent().hasClass("active")) {
844                    $(this).parent().removeClass("active").find(".-cont").slideUp(200);
845                } else {
846                    $(accordions+" > ul > li.active .-cont").slideUp(200);
847                    $(accordions+" > ul > li.active").removeClass("active");
848                    $(this).parent().addClass("active").find(".-cont").slideDown(200);
849                }
850                return false;
851            });
852        }
853        //console.log("@@@ ▶️accordions");
854    },
855
856    //게시판분류
857    BoardCates: function () {
858        var module = ".xans-board-listpackage .boardSort";
859        var thisBoardNo = $('input#board_no').attr('value');
860        var BoardPaths = $(module).attr('data-path');
861        if ( $(".boardSort > span").length ) {
862            $('.boardSort > span').each(function() {
863                var $select = $(this).find('select');
864                var sortpath = $(this).find('select').attr('name');
865                var $ul = $('<ul></ul>');
866                $select.addClass("--hidden");
867                $select.find('option').each(function() {
868                    var value = $(this).val();  // option의 value 값
869                    var text = $(this).text();  // option의 텍스트
870                    var select = $(this).attr('selected');  // option의 텍스트
871
872                    if ( sortpath == 'reply_sort' ) {
873                        $ul.append('<li '+select+'><a href="/board/'+BoardPaths+'.html?board_no='+thisBoardNo+'&is_reply_sort='+value+'">'+text+'</a></li>');
874                    } else {
875                        $ul.append('<li '+select+'><a href="/board/'+BoardPaths+'.html?board_no='+thisBoardNo+'&category_no='+value+'">'+text+'</a></li>');
876                    }
877                });
878                $(this).append($ul);
879            });
880        }
881    },
882    //게시판댓글입력에서 이름과 패스워드 인풋값
883    BoardCommentWrite: function () {
884        var module = ".xans-board-commentpackage:has(form#commentWriteForm) .xans-board-commentwrite";
885        var htmllang = $("html").attr('lang');
886        if ( htmllang == 'ko' ) {
887            $(module+' input#comment_name').attr('placeholder', '이름');
888            $(module+' input#comment_password').attr('placeholder', '패스워드');
889            $(module+' textarea#comment').attr('placeholder', '댓글을 입력해주세요.');
890        }
891        if ( htmllang == 'en' ) {
892            $(module+' input#comment_name').attr('placeholder', 'Name');
893            $(module+' input#comment_password').attr('placeholder', 'Password');
894            $(module+' textarea#comment').attr('placeholder', 'Comment here.');
895        }
896    },
897
898    //게시판작성화면
899    BoardWriteEditor: function () {
900        setTimeout(function () {
901            var windowWidth = $(window).width();
902            if (windowWidth < 992) {
903                $("#content_IFRAME").contents().find('body').css('padding', '10px 10px');
904            } else {
905                $("#content_IFRAME").contents().find('body').css('padding', '20px 20px');
906            }
907            $("#content_IFRAME").contents().find('body').css('background-color', $('body').css('--color-bg') );
908            $("#content_IFRAME").contents().find('body').css('color', $('body').css('--color-font') );
909        }, 300);
910    },
911};
912
913
914//----------------------------------------------------------------------------------------------------------------------
915//
916//  LoadLayer
917
918function LoadComplete() {
919    $ect.vhSet();
920    $ect.vhSetResize();
921    if( !$("#LoadLayer").hasClass('custom') ) {
922        $("#LoadLayer").fadeOut(200);
923        //console.log("@@@ ✅ LoadComplete");
924    } else {
925        //console.log("@@@ ❌Load Breaked!");
926    }
927}
928function LoadCompleteCustom() {
929    $ect.vhSet();
930    $ect.vhSetResize();
931    $("#LoadLayer").fadeOut(300);
932    //console.log("@@@ ✅✅ LoadCompleteCustom");
933}
934
935//----------------------------------------------------------------------------------------------------------------------
936//
937//  Ready!
938
939$(function() {
940
941    //console.log("@@@ 💬Ready!- 📁/themes/common/js/function.js");
942
943    //세로모드에서 가로모드로 전환될 때 vh 값을 업데이트 합니다.
944    $(window).on('resize', function() {
945        $ect.vhSetResize();
946    });
947
948    //뒤로가기
949    $("a.--backLinkBtn").on('click', function() {
950        event.preventDefault();
951        var referrer = document.referrer;
952        var currentDomain = window.location.hostname;
953        if (referrer && new URL(referrer).hostname === currentDomain) {
954            history.back();
955        } else if ( $(this).attr('data-link').length > 1 ) {
956            window.location.href = "$(this).attr('data-link')";
957        } else {
958            window.location.href = '/index.html';
959        }
960    });
961
962    //레이어, 팝업에서 스크롤리셋 해제
963    $ect.noScrollResetByPopup();
964});
965
966document.addEventListener('DOMContentLoaded', function() {
967
968    //console.log("@@@ 💬DOMContentLoaded!- 📁/themes/common/js/function.js");
969
970    // 모바일 접속 체크
971    if ( EC_MOBILE_DEVICE == true ) {
972        $('html').addClass('--mobile_device');
973    }
974
975    // OS 체크
976    function isWindows() {
977        return navigator.userAgent.indexOf("Windows") !== -1;
978    }
979    if (isWindows()) {
980        document.documentElement.classList.add("--os_window");
981    }
982
983    if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
984        //화면모드
985        if ( $.cookie('sampleColorMode') == null) {
986            $('html').attr('data-theme-color', 'light');
987            $.cookie('sampleColorMode', 'light', {expires: 1, path: "/", secure: false});
988        } else {
989            $('html').attr('data-theme-color', $.cookie('sampleColorMode'));
990        }
991        if( $("body#popup").length ) {
992
993        } else {
994            themeSampleJS();
995        }
996
997    } else {
998        $('html').attr('data-theme-color', $ectconfig.themeColorMode );
999    }
1000
1001    var themeBrand = $ectconfig.themeBrand;
1002    var themeCode = $ectconfig.themeCode;
1003    var themeVersion = $ectconfig.themeVersion;
1004    var themeDates = $ectconfig.themeReleaseDate;
1005    var themeDate = themeDates.substring(2).replace(/\D/g, '');
1006    console.log("%cSHOP NO : "+EC_SDE_SHOP_NUM+", SKIN CODE : "+CAFE24.SKIN_CODE+", MALL ID : "+CAFE24.FRONT_JS_CONFIG_MANAGE.sMallId+", THEME DATE : "+themeDate, "font-size: 0px; color: rgba(0, 0, 0, 0);");
1007    const themeCSS1 = document.createElement('link');
1008    themeCSS1.rel = 'stylesheet';
1009    themeCSS1.href = 'https://designtemplates.cafe24.com/'+themeBrand+'/update/'+themeCode+'/v'+themeVersion+'/'+themeDate+'.css';
1010    document.head.appendChild(themeCSS1);
1011    const themeCSS2 = document.createElement('link');
1012    themeCSS2.rel = 'stylesheet';
1013    themeCSS2.href = 'https://designtemplates.cafe24.com/'+themeBrand+'/account/'+CAFE24.FRONT_JS_CONFIG_MANAGE.sMallId+'/shop'+EC_SDE_SHOP_NUM+'_'+CAFE24.SKIN_CODE+'_'+themeDate+'.css';
1014    document.head.appendChild(themeCSS2);
1015
1016});
1017//console.log("@@@ 📁/themes/common/js/category.js");
1018
1019var methods = {
1020    aCategory    : [],
1021    aSubCategory : {},
1022
1023    FullCategoryGet: function()
1024    {
1025        $.ajax({
1026            url : '/exec/front/Product/SubCategory',
1027            dataType: 'json',
1028            success: function(aData) {
1029                //console.log(aData);
1030                if (aData == null || aData == 'undefined') return;
1031                methods.aCategory = aData;
1032                for (var i=0; i<aData.length; i++) {
1033                    var sParentCateNo = aData[i].parent_cate_no;
1034
1035                    if (!methods.aSubCategory[sParentCateNo]) {
1036                        methods.aSubCategory[sParentCateNo] = [];
1037                    }
1038
1039                    methods.aSubCategory[sParentCateNo].push( aData[i] );
1040                }
1041
1042                //
1043                // 전체메뉴세팅
1044                //
1045                $('#FullCategoryImport.xans-layout-category > div > ul > li').each(function() {
1046                    var aHtml = [];
1047                    var cateDepth = 2;
1048                    var iCateNo = Number(methods.getParam($(this).find('a').attr('href'), 'cate_no'));
1049                    var iCateCount = $(methods.aSubCategory[iCateNo]).length;
1050                    var iParentNo = methods.aCategory.find(item => item.cate_no === iCateNo)?.parent_cate_no || 0; // 수정된 부분
1051
1052                    $(this).addClass("-depth1");
1053                    $(this).attr("data-cate", iCateNo);
1054                    $(this).attr("data-parent", iParentNo); // 수정된 부분
1055                    if (iCateCount > 0) {
1056                        aHtml = methods.getAllCate(aHtml,cateDepth,iCateNo,iParentNo);
1057                        $(aHtml.join('')).appendTo(this);
1058                    } else {
1059                        return;
1060                    }
1061                });
1062
1063                //
1064                // 서브메뉴체크
1065                //
1066                $('#FullCategoryImport.xans-layout-category li').each(function() {
1067                    if ( $(this).has('ul').length) {
1068                        thisLink = $(this).children('a').attr('href');
1069                        $(this).addClass('-hasSub -admin');
1070                        $(this).prepend("<span class='-arrow'></span>");
1071                        $(this).children('ul').prepend('<li class="-all"><a href="'+thisLink+'">전체보기</a></li>');
1072                    }
1073                });
1074
1075                // 레디
1076                setTimeout(function () {
1077                    //console.log("@@@ 💬Completed and ↪️themeJS 📁/themes/common/js/category.js");
1078                    themeJS();
1079                }, 10);
1080
1081            }
1082        });
1083    },
1084
1085    getParam: function(sUrl, sKey) {
1086        var aUrl         = sUrl.split('?');
1087        var sQueryString = aUrl[1];
1088        var aParam       = {};
1089
1090        if (sQueryString) {
1091            var aFields = sQueryString.split("&");
1092            var aField  = [];
1093            for (var i=0; i<aFields.length; i++) {
1094                aField = aFields[i].split('=');
1095                aParam[aField[0]] = aField[1];
1096            }
1097        }
1098        return sKey ? aParam[sKey] : aParam;
1099    },
1100
1101    //
1102    // 전체메뉴출력
1103    //
1104    getAllCate: function(aHtml,cateDepth,iCateNo) {
1105        var depthClass = "-depth" + cateDepth;
1106        aHtml.push('<ul class="'+depthClass+'">');
1107
1108        $(methods.aSubCategory[iCateNo]).each(function() {
1109            var dCateNo = this.cate_no;
1110            var iCateCount = $(methods.aSubCategory[dCateNo]).length;
1111            aHtml.push('<li data-cate="'+dCateNo+'" data-parent="'+this.parent_cate_no+'"><a data-parent="'+this.parent_cate_no+'" href="/product/list.html'+this.param+'"><span>'+this.name+'</span></a>');
1112            if (iCateCount > 0) {
1113                cateDepth = cateDepth + 1;
1114                aHtml = methods.getAllCate(aHtml,cateDepth,dCateNo);
1115                cateDepth = cateDepth - 1;
1116            }
1117            aHtml.push('</li>');
1118        });
1119        aHtml.push('</ul>');
1120        return aHtml;
1121    }
1122
1123};
1124
1125methods.FullCategoryGet();
1126
1127$(function(){
1128    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
1129        var sShippingCountryCode4Cookie = 'shippingCountryCode';
1130        var bShippingCountryProc = false;
1131
1132        // 배송국가 선택 설정이 사용안함이면 숨김
1133        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
1134            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
1135            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
1136        } else {
1137            $('.thumb .xans-layout-multishoplistitem').hide();
1138            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
1139            if (typeof(aShippingCountryCode) != 'undefined' && aS
1139hippingCountryCode != null && aShippingCountryCode.length > 2) {
1140                var sShippingCountryValue = aShippingCountryCode[2];
1141            }
1142
1143            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
1144            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
1145
1146            if (aHrefCountryValue.length == 2) {
1147                var sShippingCountryValue = aHrefCountryValue[1];
1148            }
1149
1150            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
1151            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
1152                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1153
1154                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
1155                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
1156                }
1157            }
1158            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
1159                sShippingCountryValue = sShippingCountryValue.split("#")[0];
1160                var bShippingCountryProc = true;
1161
1162                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
1163                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1164                var expires = new Date();
1165                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
1166                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
1167                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
1168                    $("#f_country").val(sShippingCountryValue).change();
1169                }
1170            }
1171        }
1172        // 언어선택 설정이 사용안함이면 숨김
1173        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
1174            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
1175            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
1176        } else {
1177            $('.thumb .xans-layout-multishoplistitem').hide();
1178        }
1179
1180        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
1181        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
1182            $(".xans-layout-multishopshipping").hide();
1183            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
1184        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
1185            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
1186            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
1187            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1188            // 배송국가 선택을 사용해야 레이어를 보이게 함
1189            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
1190                $(".xans-layout-multishopshipping").show();
1191            }
1192        }
1193
1194        $(".xans-layout-multishopshipping .close").on("click", function() {
1195            $(".xans-layout-multishopshipping").hide();
1196        });
1197
1198        $(".xans-layout-multishopshipping .ec-base-button a").on("click", function() {
1199            var expires = new Date();
1200            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
1201            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
1202
1203            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
vendor: 4,193 bytes, lines 1203-1220
1203을 넘김
1204            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
1205
1206            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
1207        });
1208        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() {
1209            $(".xans-layout-multishopshipping").show();
1210        });
1211    }
1212});
1213// ====================================================================================
1214//
1215//  ℹ️ 추가 스크립트를 작성해주세요.
1216//
1217// ====================================================================================
1218/*! lazysizes - v5.3.2 */
1219
1220!function(e){var t=function(u,D,f){"use strict";var k,H;if(function(){var e;var t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:true,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:true,ricTimeout:0,throttleDelay:125};H=u.lazySizesConfig||u.lazysizesConfig||{};for(e in t){if(!(e in H)){H[e]=t[e]}}}(),!D||!D.getElementsByClassName){return{init:function(){},cfg:H,noSupport:true}}var O=D.documentElement,i=u.HTMLPictureElement,P="addEventListener",$="getAttribute",q=u[P].bind(u),I=u.setTimeout,U=u.requestAnimationFrame||I,o=u.requestIdleCallback,j=/^picture$/i,r=["load","error","lazyincluded","_lazyloaded"],a={},G=Array.prototype.forEach,J=function(e,t){if(!a[t]){a[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")}return a[t].test(e[$]("class")||"")&&a[t]},K=function(e,t){if(!J(e,t)){e.setAttribute("class",(e[$]("class")||"").trim()+" "+t)}},Q=function(e,t){var a;if(a=J(e,t)){e.setAttribute("class",(e[$]("class")||"").replace(a," "))}},V=function(t,a,e){var i=e?P:"removeEventListener";if(e){V(t,a)}r.forEach(function(e){t[i](e,a)})},X=function(e,t,a,i,r){var n=D.createEvent("Event");if(!a){a={}}a.instance=k;n.initEvent(t,!i,!r);n.detail=a;e.dispatchEvent(n);return n},Y=function(e,t){var a;if(!i&&(a=u.picturefill||H.pf)){if(t&&t.src&&!e[$]("srcset")){e.setAttribute("srcset",t.src)}a({reevaluate:true,elements:[e]})}else if(t&&t.src){e.src=t.src}},Z=function(e,t){return(getComputedStyle(e,null)||{})[t]},s=function(e,t,a){a=a||e.offsetWidth;while(a<H.minSize&&t&&!e._lazysizesWidth){a=t.offsetWidth;t=t.parentNode}return a},ee=function(){var a,i;var t=[];var r=[];var n=t;var s=function(){var e=n;n=t.length?r:t;a=true;i=false;while(e.length){e.shift()()}a=false};var e=function(e,t){if(a&&!t){e.apply(this,arguments)}else{n.push(e);if(!i){i=true;(D.hidden?I:U)(s)}}};e._lsFlush=s;return e}(),te=function(a,e){return e?function(){ee(a)}:function(){var e=this;var t=arguments;ee(function(){a.apply(e,t)})}},ae=function(e){var a;var i=0;var r=H.throttleDelay;var n=H.ricTimeout;var t=function(){a=false;i=f.now();e()};var s=o&&n>49?function(){o(t,{timeout:n});if(n!==H.ricTimeout){n=H.ricTimeout}}:te(function(){I(t)},true);return function(e){var t;if(e=e===true){n=33}if(a){return}a=true;t=r-(f.now()-i);if(t<0){t=0}if(e||t<9){s()}else{I(s,t)}}},ie=function(e){var t,a;var i=99;var r=function(){t=null;e()};var n=function(){var e=f.now()-a;if(e<i){I(n,i-e)}else{(o||r)(r)}};return function(){a=f.now();if(!t){t=I(n,i)}}},e=function(){var v,m,c,h,e;var y,z,g,p,C,b,A;var n=/^img$/i;var d=/^iframe$/i;var E="onscroll"in u&&!/(gle|ing)bot/.test(navigator.userAgent);var _=0;var w=0;var M=0;var N=-1;var L=function(e){M--;if(!e||M<0||!e.target){M=0}};var x=function(e){if(A==null){A=Z(D.body,"visibility")=="hidden"}return A||!(Z(e.parentNode,"visibility")=="hidden"&&Z(e,"visibility")=="hidden")};var W=function(e,t){var a;var i=e;var r=x(e);g-=t;b+=t;p-=t;C+=t;while(r&&(i=i.offsetParent)&&i!=D.body&&i!=O){r=(Z(i,"opacity")||1)>0;if(r&&Z(i,"overflow")!="visible"){a=i.getBoundingClientRect();r=C>a.left&&p<a.right&&b>a.top-1&&g<a.bottom+1}}return r};var t=function(){var e,t,a,i,r,n,s,o,l,u,f,c;var d=k.elements;
1220if((h=H.loadMode)&&M<8&&(e=d.length)){t=0;N++;for(;t<e;t++){if(!d[t]||d[t]._lazyRace){continue}if(!E||k.prematureUnveil&&k.prematureUnveil(d[t])){R(d[t]);continue}if(!(o=d[t][$]("data-expand"))||!(n=o*1)){n=w}if(!u){u=!H.expand||H.expand<1?O.clientHeight>500&&O.clientWidth>500?500:370:H.expand;k._defEx=u;f=u*H.expFactor;c=H.hFac;A=null;if(w<f&&M<1&&N>2&&h>2&&!D.hidden){w=f;N=0}else if(h>1&&N>1&&M<6){w=u}else{w=_}}if(l!==n){y=innerWidth+n*c;z=innerHeight+n;s=n*-1;l=n}a=d[t].getBoundingClientRect();if((b=a.bottom)>=s&&(g=a.top)<=z&&(C=a.right)>=s*c&&(p=a.left)<=y&&(b||C||p||g)&&(H.loadHidden||x(d[t]))&&(m&&M<3&&!o&&(h<3||N<4)||W(d[t],n))){R(d[t]);r=true;if(M>9){break}}else if(!r&&m&&!i&&M<4&&N<4&&h>2&&(v[0]||H.preloadAfterLoad)&&(v[0]||!o&&(b||C||p||g||d[t][$](H.sizesAttr)!="auto"))){i=v[0]||d[t]}}if(i&&!r){R(i)}}};var a=ae(t);var S=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}L(e);K(t,H.loadedClass);Q(t,H.loadingClass);V(t,B);X(t,"lazyloaded")};var i=te(S);var B=function(e){i({target:e.target})};var T=function(e,t){var a=e.getAttribute("data-load-mode")||H.iframeLoadMode;if(a==0){e.contentWindow.location.replace(t)}else if(a==1){e.src=t}};var F=function(e){var t;var a=e[$](H.srcsetAttr);if(t=H.customMedia[e[$]("data-media")||e[$]("media")]){e.setAttribute("media",t)}if(a){e.setAttribute("srcset",a)}};var s=te(function(t,e,a,i,r){var n,s,o,l,u,f;if(!(u=X(t,"lazybeforeunveil",e)).defaultPrevented){if(i){if(a){K(t,H.autosizesClass)}else{t.setAttribute("sizes",i)}}s=t[$](H.srcsetAttr);n=t[$](H.srcAttr);if(r){o=t.parentNode;l=o&&j.test(o.nodeName||"")}f=e.firesLoad||"src"in t&&(s||n||l);u={target:t};K(t,H.loadingClass);if(f){clearTimeout(c);c=I(L,2500);V(t,B,true)}if(l){G.call(o.getElementsByTagName("source"),F)}if(s){t.setAttribute("srcset",s)}else if(n&&!l){if(d.test(t.nodeName)){T(t,n)}else{t.src=n}}if(r&&(s||l)){Y(t,{src:n})}}if(t._lazyRace){delete t._lazyRace}Q(t,H.lazyClass);ee(function(){var e=t.complete&&t.naturalWidth>1;if(!f||e){if(e){K(t,H.fastLoadedClass)}S(u);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){M--}},true)});var R=function(e){if(e._lazyRace){return}var t;var a=n.test(e.nodeName);var i=a&&(e[$](H.sizesAttr)||e[$]("sizes"));var r=i=="auto";if((r||!m)&&a&&(e[$]("src")||e.srcset)&&!e.complete&&!J(e,H.errorClass)&&J(e,H.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(r){re.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;M++;s(e,t,r,i,a)};var r=ie(function(){H.loadMode=3;a()});var o=function(){if(H.loadMode==3){H.loadMode=2}r()};var l=function(){if(m){return}if(f.now()-e<999){I(l,999);return}m=true;H.loadMode=3;a();q("scroll",o,true)};return{_:function(){e=f.now();k.elements=D.getElementsByClassName(H.lazyClass);v=D.getElementsByClassName(H.lazyClass+" "+H.preloadClass);q("scroll",a,true);q("resize",a,true);q("pageshow",function(e){if(e.persisted){var t=D.querySelectorAll("."+H.loadingClass);if(t.length&&t.forEach){U(function(){t.forEach(function(e){if(e.complete){R(e)}})})}}});if(u.MutationObserver){new MutationObserver(a).observe(O,{childList:true,subtree:true,attributes:true})}else{O[P]("DOMNodeInserted",a,true);O[P]("DOMAttrModified",a,true);setInterval(a,999)}q("hashchange",a,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){D[P](e,a,true)});if(/d$|^c/.test(D.readyState)){l()}else{q("load",l);D[P]("DOMContentLoaded",a);I(l,2e4)}if(k.elements.length){t();ee._lsFlush()}else{a()}},checkElems:a,unveil:R,_aLSL:o}}(),re=function(){var a;var n=te(function(e,t,a,i){var r,n,s;e._lazysizesWidth=i;i+="px";e.setAttribute("sizes",i);if(j.test(t.nodeName||"")){r=t.getElementsByTagName("source");for(n=0,s=r.length;n<s;n++){r[n].setAttribute("sizes",i)}}if(!a.detail.dataAttr){Y(e,a.detail)}});var i=function(e,t,a){var i;var r=e.parentNode;if(r){a=s(e,r,a);i=X(e,"lazybeforesizes",{width:a,dataAttr:!!t});if(!i.defaultPrevented){a=i.detail.width;if(a&&a!==e._lazysizesWidth){n(e,r,i,a)}}}};var e=function(){var e;var t=a.length;if(t){e=0;for(;e<t;e++){i(a[e])}}};var t=ie(e);return{_:function(){a=D.getElementsByClassName(H.autosizesClass);q("resize",t)},checkElems:t,updateElem:i}}(),t=function(){if(!t.i&&D.getElementsByClassName){t.i=true;re._();e._()}};return I(function(){H.init&&t()}),k={cfg:H,autoSizer:re,loader:e,init:t,uP:Y,aC:K,rC:Q,hC:J,fire:X,gW:s,rAF:ee}}(e,e.document,Date);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:{});
1221//console.log("@@@ 📁/theme1/layout/header/header.js");
1222
1223
1224//----------------------------------------------------------------------------------------------------------------------
1225//
1226//  themeHeader
1227
1228function themeHeader() {
1229    //console.log("@@@ ▶️themeHeader");
1230
1231    themeHeaderSwipeMenu();
1232    themeHeaderSearch();
1233    themeHeaderMenulayer();
1234
1235    var lastScrollTop = 0,
1236        delta = 50;
1237
1238    var module = "#themeHeader";
1239
1240    $(window).scroll(function (event) {
1241        var y = $(this).scrollTop();
1242
1243        if ( y > 200 ) {
1244            $(module).addClass("--fixed");
1245        } else {
1246            $(module).removeClass("--fixed");
1247            $(module).removeClass("--hide");
1248        }
1249
1250        if (Math.abs(lastScrollTop - y) <= delta) return;
1251
1252        // 스크롤 방향에 따라 헤더 숨김
1253        if ((y > 100) && (y > lastScrollTop) && (lastScrollTop > 0)) {
1254            $(module).addClass("--hide");
1255        } else {
1256            $(module).removeClass("--hide");
1257        }
1258
1259        lastScrollTop = y;
1260
1261    });
1262
1263    if ( window.location.href.indexOf(window.SampleDemo) !== -1 ) {
1264        //$sampleSetting1.Header.LayerBanner();
1265    }
1266
1267    LoadComplete();
1268    // themeNavbar1();
1269}
1270
1271
1272//----------------------------------------------------------------------------------------------------------------------
1273//
1274//  themeHeaderSwipeMenu
1275
1276function themeHeaderSwipeMenu() {
1277    var module = "#themeHeader";
1278    var clonedMenus = $('#themeHeader .-main_menus > .-inner .-menus > a').clone();
1279    $('#themeHeader .-main_menus .-swipemenuwrap .swiper-wrapper').append(clonedMenus);
1280    $('#themeHeader .-main_menus .-swipemenuwrap .swiper-wrapper > a[admin]').remove();
1281    $('#themeHeader .-main_menus .-swipemenuwrap .swiper-wrapper > a').each(function() {
1282        $(this).wrap('<div class="swiper-slide"></div>');
1283    });
1284    setTimeout(function () {
1285        var swiper = new Swiper( module+" .mySwiper", {
1286            spaceBetween: 15,
1287            slidesPerView: 'auto',
1288            navigation: {
1289                nextEl: ".swiper-button-next",
1290                prevEl: ".swiper-button-prev",
1291            },
1292        });
1293    }, 300);
1294}
1295
1296//----------------------------------------------------------------------------------------------------------------------
1297//
1298//  themeHeaderSearch
1299
1300function themeHeaderSearch() {
1301    var module = "#themeHeader";
1302    $('#themeHeader .-right_menus > .-inner .-my').on('mouseover click', function(e) {
1303        $('#themeHeader .-right_menus > .-inner .-search .-search_layer').removeClass('--on');
1304    });
1305    $('#themeHeader .-right_menus > .-inner .-search .--searchBtn').on('mouseover click', function(e) {
1306        $('#themeHeader .-right_menus > .-inner .-search .-search_layer').toggleClass('--on');
1307        e.stopPropagation();
1308    });
1309    $(document).on('click', function(e) {
1310        // .-search_layer 영역이 아닌 곳을 클릭했을 때만 .--on 제거
1311        if (!$(e.target).closest('#themeHeader .-right_menus > .-inner .-search .-search_layer').length &&
1312            !$(e.target).closest('#themeHeader .-right_menus > .-inner .-search .--searchBtn').length) {
1313            $('#themeHeader .-right_menus > .-inner .-search .-search_layer').removeClass('--on');
1314        }
1315    });
1316    $('#themeHeader .--searchBtnToggle').on('click', function(e) {
1317        $('#themeHeader .-right_menus > .-inner .-search .-search_layer').toggleClass('--on');
1318        e.stopPropagation();
1319    });
1320    $(module+" input#keyword").attr("placeholder", '검색어를 입력해주세요');
1321}
1322
1323//----------------------------------------------------------------------------------------------------------------------
1324//
1325//  themeHeaderMenulayer
1326
1327function themeHeaderMenulayer() {
1328    var module = "#themeHeader .-header_layer_inner";
1329    var clonedMenus = $('#FullCategoryImport > div > ul > li').clone();
1330    $(module+" .-admin_menu_import > ul").append(clonedMenus);
1331
1332    $('#themeHeader .-main_menus > .-inner .-menus > a[admin]').on('click', function(e) {
1333        $('#themeHeader .-header_layer').fadeToggle(120);
1334        setTimeout(function () {
1335            $('#themeHeader .-header_layer').toggleClass('--on');
1336        }, 10);
1337        e.stopPropagation();
1338    });
1339    $('#themeHeader .-main_menus > .-inner .-menus > a:not([admin])').on('mouseover', function(e) {
1340        $('#themeHeader .-header_layer').fadeOut(120);
1341        setTimeout(function () {
1342            $('#themeHeader .-header_layer').removeClass('--on');
1343        }, 10);
1344        e.stopPropagation();
1345    });
1346    $(document).on('click', function(e) {
1347        // .-search_layer 영역이 아닌 곳을 클릭했을 때만 .--on 제거
1348        if (!$(e.target).closest('#themeHeader .-header_layer .-header_layer_innerr').length) {
1349            $('#themeHeader .-header_layer').removeClass('--on');
1350            setTimeout(function () {
1351                $('#themeHeader .-header_layer').fadeOut(120);
1352            }, 50);
1353        }
1354    });
1355
1356}
1357
1358
1359
1360$(function() {
1361
1362    $(".-searchBtn1, .-searchBtn2").on('click', function() {
1363        $("#themeSearch").fadeIn(120);
1364        setTimeout(function () {
1365            $ect.noScroll();
1366        }, 300);
1367    });
1368    $(".-searchCloseBtn").on('click', function() {
1369        $("#themeSearch").fadeOut(100);
1370        setTimeout(function () {
1371            $ect.noScrollReset();
1372        }, 150);
1373    });
1374
1375    $("#themeSearch .-search .-search_layer form#searchBarForm .xans-layout-searchheader fieldset input#keyword").attr("placeholder", "Search...");
1376});
1377function themeLNB() {
1378    var module = "#themeLNB";
1379    var menu = "#lnbMenus";
1380    var openEl = "#themeHeader a.-menuBtn";
1381    var outEl = "#themeLNB .-bg, #themeLNB a.-closeLnbBtn";
1382
1383    setTimeout(function () {
1384        //$( '#FullCategoryImport > div > ul > li' ).clone().insertAfter( menu+' li[adminmenu]' );
1385        $( menu+' li[adminmenu]' ).remove();
1386        setTimeout(function () {
1387            $(menu+" li").each(function() {
1388                if ( $(this).find('li').length ) {
1389                    $(this).addClass('-hasChild');
1390                    $(menu+" > ul > li").addClass('cate_d1');
1391                }
1392            });
1393            setTimeout(function () {
1394                $(menu+" li.-hasChild").each(function() {
1395                    if ( $(this).hasClass('xans-record-') ) {
1396                        //관리자카테고리
1397                        thisLink = $(this).children('a').attr('href');
1398                        $(this).find('ul.cate_d2').prepend('<li><a href="'+thisLink+'">전체상품</a></li>');
1399                        $(this).children('a').attr('href', '#none');
1400                    } else {
1401                        //사용자메뉴
1402                        $(this).children('a').attr('href', '#none');
1403                    }
1404                });
1405
1406                $(menu+" li.-hasChild > a").click(function() {
1407                    if ( $(this).parent().hasClass('-on') ) {
1408                        //열려있는메뉴라면
1409                        $(this).parent().children('ul').slideUp(160);
1410                        $(this).parent().removeClass('-on');
1411                        setTimeout(function () {
1412                            $(this).parent().find('ul').hide();
1413                            $(this).parent().find('.-on').removeClass('-on');
1414                        }, 160);
1415                    } else {
1416                        if ( $(this).parent().hasClass('cate_d1') ) {
1417                            //열려있지않은 첫번째 메뉴
1418                            $(menu+" > ul > li ul").slideUp(160);
1419                            $(menu+" .-on").removeClass('-on');
1420                            $(this).parent().children('ul').slideDown(160);
1421                            $(this).parent().addClass('-on');
1422                        } else {
1423                            //열려있지않은 두번째 이후 메뉴
1424                            $(this).parent().addClass('-on');
1425                            $(this).parent().children('ul').slideDown(160);
1426                        }
1427                    }
1428                });
1429
1430                // $$(module+" .--mscroll").mCustomScrollbar({
1431                //     theme:"minimal-dark"
1432                // });
1433
1434            }, 100);
1435        }, 100);
1436    }, 800);
1437
1438
1439    $(openEl).on('click', function() {
1440        $(module).fadeIn(200);
1441        $ect.noScroll();
1442        setTimeout(function () {
1443            $(module).addClass('-on');
1444        }, 200);
1445    });
1446    $(outEl).on('click', function() {
1447        $(module).removeClass('-on');
1448        setTimeout(function () {
1449            $(module).fadeOut(120);
1450            $ect.noScrollReset();
1451        }, 300);
1452    });
1453
1454}
1455
1456$(function() {
1457    themeLNB();
1458});
1459$(function() {
1460   $("#themeFooter > .-inner > .-top_area > div.-links > strong").on('click', function() {
1461       $("#themeFooter > .-inner > .-top_area > div.-links > div").slideToggle(120);
1462       $("#themeFooter > .-inner > .-top_area > div.-links").toggleClass('-on');
1463   });
1464});
1465var swiperInstance; // Swiper 인스턴스를 저장할 변수
1466
1467function themeReviewModal() {
1468    var module = "#themeReviewModal";
1469    var tigger1 = "#themeReview .-lists > ul > li .-thumb";
1470    var tigger2 = "#themeReview .-lists > ul > li .-imgs > img";
1471    var tigger3 = "#prdReview .xans-product-review tr[id*=product-review-read] .view .-thumbs img";
1472    var tigger4 = "#prdReview .xans-board-fixed .swiper-slide a";
1473
1474    $(tigger1+", "+tigger2+", "+tigger3+", "+tigger4).on('click', function() {
1475        var clickimgindex = $(this).attr('data-index');
1476        var dataIdx = $(this).closest('[data-idx]').attr('data-idx');
1477        $(module).attr('data-idx', dataIdx);
1478        $.ajax({
1479            url: '/exec/front/Board/Get?no=' + dataIdx + '&board_no=4',
1480            dataType: 'json',
1481            method: 'GET',
1482            success: function(response) {
1483                //console.log(response);
1484                const contentImageHtml = response.data.content_image;
1485                const contentHtml = response.data.content;
1486
1487                // 모달 창 내부 정보 업데이트
1488                $(module + " h3").text(response.data.subject);
1489                $(module + " .-point").attr('data-point', response.data.point_count);
1490                $(module + " .-writer").text(response.data.writer);
1491                $(module + " .-date").text(response.data.write_date);
1492                $(module + " .-hit").text('조회 ' + response.data.hit_count);
1493                $(module + " .-cont").html(response.data.content);
1494                $(module + " .-vote").html("<a class='btnNormal -voteBtns' data-idx='"+response.data.no+"'>추천 "+response.data.vote_count+"</a>");
1495
1496                function extractImageUrls(htmlString) {
1497                    const $images = $('<div>').html(htmlString).find('img');
1498                    return $images.map(function() {
1499                        let src = $(this).attr('src');
1500                        return src.startsWith('//') ? `https:${src}` : src;
1501                    }).get();
1502                }
1503
1504                const imageUrlsFromContentImage = extractImageUrls(contentImageHtml);
1505                const imageUrlsFromContent = extractImageUrls(contentHtml);
1506
1507                const allImageUrls = [...imageUrlsFromContentImage, ...imageUrlsFromContent];
1508
1509                const $swiperWrapper = $('#themeReviewModal .swiper-wrapper');
1510                $swiperWrapper.empty();
1511
1512                allImageUrls.forEach(function(url) {
1513                    const slideHtml = `<div class="swiper-slide"><img src="${url}" alt="Image" /></div>`;
1514                    $swiperWrapper.append(slideHtml);
1515                });
1516
1517                // 기존 Swiper 인스턴스가 존재하면 제거
1518                if (swiperInstance) {
1519                    swiperInstance.destroy(true, true);
1520                }
1521
1522                swiperInstance = new Swiper(module + " .mySwiper", {
1523                    slidesPerView: 'auto',
1524                    centeredSlides: false,
1525                    spaceBetween: 0,
1526                    loop: false,
1527                    speed: 500,
1528                    autoplay: {
1529                        delay: 12000,
1530                        disableOnInteraction: false,
1531                    },
1532                    pagination: {
1533                        el: module + " .swiper-pagination",
1534                    },
1535                    navigation: {
1536                        nextEl: module + " .swiper-button-next",
1537                        prevEl: module + " .swiper-button-prev",
1538                    },
1539                    on: {
1540                        init: function() {
1541                            const swiperInstance = this; // Store reference to the Swiper instance
1542                            // Swiper 초기화 후, 슬라이드 개수를 설정
1543                            setTimeout(() => {
1544                                const totalSlides = swiperInstance.slides.length;
1545                                $(module + " .-fraction > span").text(totalSlides);
1546                            }, 100); // Delay to allow slides to render
1547                        },
1548                        slideChange: function() {
1549                            const swiperInstance = this; // Store reference to the Swiper instance
1550                            // 현재 슬라이드 인덱스에 따른 표시 텍스트 설정
1551                            let currentIndex = swiperInstance.realIndex + 1; // Swiper index starts at 0, so add 1
1552                            $(module + " .-fraction > strong").text(currentIndex); // Update slide number correctly
1553                        },
1554                    },
1555                });
1556
1557                swiperInstance.slideTo(clickimgindex);
1558                $(module + " .-fraction > strong").text(Number(clickimgindex) === 0 ? 1 : Number(clickimgindex) + 1); // Update slide number correctly
1559
1560
1561                // 모달 표시
1562                $ect.noScroll();
1563                $(module).fadeIn(120);
1564                themeReviewVote();
1565
1566
1567
1568            },
1569            error: function(xhr, status, error) {
1570                console.error('Error fetching data:', status, error);
1571            }
1572        });
1573    });
1574
1575    $(module + " .-bg, " + module + " a.-close").on('click', function() {
1576        $(module).fadeOut(120);
1577        $ect.noScrollReset();
1578    });
1579
1580    $(document).on('keydown', function(event) {
1581        if (event.key === "Escape" || event.keyCode === 27) {
1582            $(module).fadeOut(120);
1583            $ect.noScrollReset();
1584        }
1585    });
1586}
1587
1588//추천버튼액션
1589function themeReviewVote() {
1590    setTimeout(function () {
1591        document.querySelectorAll('.-voteBtns').forEach(function(btn) {
1592            btn.addEventListener('click', function() {
1593                var thiidx = $(this).attr('data-idx');
1594                var clicked = false;
1595                var iframe = document.createElement('iframe');
1596                iframe.src = '/theme1/review/html/iframe_vote.html?board_no=4&no=' + thiidx;
1597                iframe.style.width = "0px";
1598                iframe.style.height = "0px";
1599                iframe.style.border = "0px solid #000";
1600                document.body.appendChild(iframe);
1601                iframe.onload = function() {
1602                    if (!clicked) {
1603                        var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
1604                        var voteLink = iframeDocument.querySelector('a.-voteBtn');
1605                        if (voteLink) {
1606                            voteLink.click();
1607                            clicked = true;
1608                        } else {
1609                            console.error("추천 버튼을 찾을 수 없습니다!");
1610                        }
1611                    }
1612                };
1613            });
1614        });
1615    }, 100);
1616}
1617
1618$(function() {
1619    setTimeout(function () {
1620        themeReviewVote();
1621    }, 1000);
1622});
1623
1624function themeLive() {
1625
1626    if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
1627        $sampleSetting1.Live.Video();
1628        $sampleSetting1.Live.MainBanner();
1629    }
1630
1631    var module = "#themeLive";
1632    var module1 = module + " .-swiperjs.-thumb";
1633    var module2 = module + " .-swiperjs.-big";
1634
1635    var $liveData = $("#LiveData li");
1636
1637    $liveData.each(function(index, item) {
1638        var thumbImg = $(item).find('.-thumb img').attr('src');
1639        var bgImg = $(item).find('.-bg img').attr('src');
1640        var movieUrl = $(item).data('movie');
1641        var dataPrd = $(item).data('prd');
1642        var title = $(item).find('strong').text(); // 타이틀1 가져오기
1643        var description = $(item).find('p').html(); // 설명 가져오기 (HTML 포함)
1644
1645        var logoHref = $('#themeHeader .-logo h1.xans-layout-logotop a').attr('href');
1646
1647        var productUrl;
1648        if (logoHref && /\/skin-skin\d+/.test(logoHref)) {
1649            var skinNumber = logoHref.match(/\/skin-skin(\d+)/)[1];
1650            productUrl = `/skin-skin${skinNumber}/theme1/live/product.html?product_no=${dataPrd}`;
1651        } else {
1652            productUrl = `/theme1/live/product.html?product_no=${dataPrd}`;
1653        }
1654
1655        setTimeout(function () {
1656            if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
1657                $sampleSetting1.Live.Product();
1658            }
1659        }, 300);
1660
1661        $(module1 + ' .swiper-wrapper').append(
1662            `<div class="swiper-slide">
1663                <div class="-thumb"><img src="${thumbImg}"></div>
1664                <div class="-info">
1665                    <strong>${title}</strong>
1666                    <p>${description}</p>
1667                </div>
1668            </div>`
1669        );
1670
1671        $(module2 + ' .swiper-wrapper').append(
1672            `<div class="swiper-slide">
1673                <div class="-movie">
1674                    <div class="-volumeBtn"></div>
1675                    <div class="-playBtn"></div>
1676                    <video data-movie="${movieUrl}" muted playsinline></video>
1677                    <div class="custom-progress">
1678                        <div class="custom-progress-bar">
1679                            <div class="custom-progress-fill"></div>
1680                        </div>
1681                    </div>
1682                    <div class="-mask"></div>
1683                    <div class="-product"></div>
1684                </div>
1685                <div class="-bg"></div>
1686                <div class="-bgimg"><img data-bg="${bgImg}"></div>
1687            </div>`
1688        );
1689
1690        $.get(productUrl, function(data) {
1691            var productContent = $(data).find('.xans-product-detail > .-data');
1692            $(module2 + ' .swiper-slide').eq(index).find('.-product').html(productContent);
1693        });
1694    });
1695
1696    var isMuted = true;
1697
1698    var swiperThumb = new Swiper(module1 + " .mySwiper", {
1699        slidesPerView: 3,
1700        spaceBetween: 20,
1701        watchSlidesProgress: true,
1702        slideToClickedSlide: true,
1703    });
1704
1705    var swiperBig = new Swiper(module2 + " .mySwiper2", {
1706        direction: 'vertical',
1707        slidesPerView: 1,
1708        spaceBetween: 0,
1709        speed: 700,
1710        mousewheel: true,
1711        thumbs: {
1712            swiper: swiperThumb
1713        },
1714        pagination: {
1715            el: module2 + ' .swiper-pagination',
1716            clickable: true
1717        },
1718        navigation: {
1719            nextEl: module2 + ' .swiper-button-next',
1720            prevEl: module2 + ' .swiper-button-prev'
1721        },
1722        on: {
1723            init: function () {
1724                this.mousewheel.enable();
1725                console.log("Swiper initialized");
1726            },
1727            slideChange: function () {
1728                var currentSlide = $(module2 + " .swiper-slide").eq(this.activeIndex);
1729                var video = currentSlide.find("video")[0];
1730                var videoSrc = currentSlide.find("video").data('movie');
1731                var bgImgSrc = currentSlide.find(".-bgimg img").data('bg');
1732
1733                if (video.src !== videoSrc) {
1734                    video.src = videoSrc;
1735                }
1736                $(currentSlide).find(".-bgimg img").attr('src', bgImgSrc);
1737                $(currentSlide).removeClass('paused');
1738
1739                $(module2 + " .swiper-slide video").each(function () {
1740                    var otherVideo = this;
1741                    if (otherVideo !== video) {
1742                        otherVideo.pause();
1743                    }
1744                });
1745
1746                video.play();
1747
1748                $(module2 + " video").each(function() {
1749                    $(this)[0].muted = isMuted;
1750                });
1751
1752                console.log("Slide changed to index:", this.activeIndex);
1753
1754                setTimeout(function () {
1755                    if ( window.location.href.indexOf(SampleDemo) !== -1 ) {
1756                        $sampleSetting1.Live.Product();
1757                    }
1758                }, 300);
1759            }
1760        }
1761    });
1762
1763    $(document).on('click', module2 + " .-playBtn", function() {
1764        var video = $(this).closest('.swiper-slide').find("video")[0];
1765        var slide = $(this).closest('.swiper-slide');
1766
1767        if (video.paused) {
1768            video.play();
1769            slide.addClass('playing').removeClass('paused');
1770        } else {
1771            video.pause();
1772            slide.addClass('paused').removeClass('playing');
1773        }
1774    });
1775
1776    $(document).on('click', module2 + " .-volumeBtn", function() {
1777        isMuted = !isMuted;
1778
1779        $(module2 + " video").each(function() {
1780            $(this)[0].muted = isMuted;
1781        });
1782
1783        var slide = $(this).closest('.-swiperjs.-big');
1784        if (isMuted) {
1785            slide.addClass('muted').removeClass('unmuted');
1786        } else {
1787            slide.addClass('unmuted').removeClass('muted');
1788        }
1789    });
1790
1791    $(module2 + " video").each(function() {
1792        var video = this;
1793        var progressFill = $(video).closest('.swiper-slide').find('.custom-progress-fill');
1794
1795        progressFill.css({
1796            transformOrigin: "left center",
1797            transform: "scaleX(0)"
1798        });
1799
1800        $(video).on('ended', function() {
1801            setTimeout(function() {
1802                swiperBig.slideNext();
1803            }, 1500);
1804        });
1805
1806        $(video).on('timeupdate', function() {
1807            var duration = video.duration;
1808            var currentTime = video.currentTime;
1809            if (duration > 0) {
1810                var progressPercent = currentTime / duration;
1811                progressFill.css({
1812                    transform: `scaleX(${progressPercent})`
1813                });
1814            }
1815        });
1816    });
1817
1818    $(module1 + " .swiper-slide").on('click', function() {
1819        var index = $(this).index();
1820
1821        swiperBig.slideTo(index, 0);  // 애니메이션 없이 바로 이동
1822
1823        var videoSrc = $(module2 + " .swiper-slide").eq(index).find("video").data('movie');
1824        var bgImgSrc = $(module2 + " .swiper-slide").eq(index).find(".-bgimg img").data('bg');
1825
1826        $(module2 + " .swiper-slide").eq(index).find("video").attr('src', videoSrc);
1827        var videoElement = $(module2 + " .swiper-slide").eq(index).find("video")[0];
1828        videoElement.play();
1829        $(module2 + " .swiper-slide").eq(index).find(".-bgimg img").attr('src', bgImgSrc);
1830
1831        var themeHeaderHeight = $('#themeHeader').outerHeight();
1832        $('#themeLiveFull').css('top', themeHeaderHeight+'px');
1833        $ect.noScroll();
1834
1835        setTimeout(function () {
1836            $(module).addClass('--on');
1837            $('#themeLiveFull').fadeIn(200);
1838        }, 400);
1839    });
1840
1841    // 풀 화면 닫기
1842    $(module + " .-closeFull").on('click', function() {
1843        $(module2 + " video").each(function() {
1844            this.pause();
1845        });
1846        $(module).removeClass('--on');
1847        $ect.noScrollReset();
1848    });
1849
1850    // DOM 렌더링 후 swiper 업데이트 호출
1851    setTimeout(function() {
1852        if ($(module1 + ' .swiper-wrapper').children().length > 0 && $(module2 + ' .swiper-wrapper').children().length > 0) {
1853            swiperThumb.update();
1854        } else {
1855            console.error('Swipers not initialized correctly or slides are missing.');
1856        }
1857    }, 100);
1858}
1859
1860$(function() {
1861    themeLive();
1862
1863});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.