window.fgData={"offers":[],"settings":{"gift_format":"same_as_original_products","auto_add_gift":true,"sync_quantity":false,"cal_gift_discount":"current_price","using_draft_order":false,"select_one_gift_price":false,"manual_input_inventory":false,"compare_gift_price_with_product":false,"delete_gift_after_turn_off_offer":true,"not_show_gift_if_already_on_cart":false},"appearance":{"gift_slider":{"general":{"gift_popup_title":"Select your free gift!","add_to_cart_btn_title":"Add to cart","running_text":"","select_gift_btn":"Select variants","show_product_title":true,"show_variant_title":true,"show_pagination":true,"show_gift_for_customer":"by_variants","number_product_slider":4},"color":{"gift_slider_title_color":"#121212","product_title_color":"#000000","original_price_color":"#121212","discounted_price_color":"#ea5455","add_to_cart_color":"#FFFFFF","add_to_cart_btn_color":"#7367f0"},"others":{"hidden_brand_mark":true},"disable_slider_checkbox":{"enable":false,"time":10,"text":"Don't show this offer again"}},"gift_icon":{"gift_icon_path":"images\/fg-icons\/fg-icon-red.png","shopify_gift_icon_path":"fg-icon-red.png","product_page":{"gift_icon":{"status":true,"size":"50"},"gift_thumbnail":{"status":true,"size":"100","title":"Free Gift"}},"collection_page":{"status":true,"size":"50"}},"promotion_message":{"show_on_cart_page":true,"text_color":"#ffffff","background_color":"#F72119"}}};/* END_FG_DATA */ const _0x2e6852=_0x4220;function _0x4220($,x){let e=_0x1c1f();return(_0x4220=function($,x){return e[$-=404]})($,x)}function _0x1c1f(){let $=["fgAppearancePromotionMessage","not have orders and gifts","/products/","redirected","-sca_clone_freegift","by_variants","arrOfferAdded",".selected-variant","routes","sections_cart","set","sca-is-visible-fg",".sca-fg-notifications","order_created_from",".dropdown-menu","disabled","/cart/add.js","handle","/cart",'\n
\n
\n
\n \n
\n ',"includes","Loading...","show_variant_title","353927irvJgK",'\n \xab\n \xbb\n ','" target="_blank">\n \n
\n
\n\n
\n
\n \n
\n
\n \n
\n
\n
\n ',"hasAttribute","gift_settings","discount_percentage","forEach","data-template","disableShopify_getCart","condition_result","shift","3961576WPhwsX","push","cal_gift_discount","reduce",'\n \n \n \n ',"sca_fg_cart_drawer_query","Add to cart","sca_text_notify_success","sca-gift-thumbnail","hide","application/json;",".fg-secomapp-cart-icon ","addEventListener","is_multiply",'\n
\n
\n
\n\n
\n
\n \n
\n
\n \n
\n
\n
\n ',"number_product_slider","enable_toast_added","gift_icon_path","sca_handle_checkout","reload","original_product_shopify_id","getTime",'\n
\n \n
","#shopify-section-header #cart-icon-bubble","substring","appendChild","start",'a[href*="/products/"]',"event auto process gifts with cart","map","

\n ","tabindex","USD","currentTarget",'" alt="">\n \n
',"original_price","hidden","

","variants_ids","sca_fg_cart_icon_query","floor","have_not_got_gift_from_this_offer","toggle","join","variant_title","gift_slider","parentElement","json","opacity",'"\n data-price="',"scaCustomLoadingCheckout","collections","hasOwnProperty","keys","belongs_to_offer",".sca-promotion-message-layout","sub_conditions","/cart/add","offers","clone_checkout","1353030Kniyjl","#fg-gift-thumbnail-title .glider-next","select_gift_btn","max_gifts_can_get","freegiftProxy","insertBefore","enable_check_variants_has_gift",'">\n ',"reRenderCartCustom","slice","preventDefault",'\n \n
\n
","querySelector","error","#7367f0","timeoutId",'\n
','" data-original-id="',"unit","secomappGetCartRunning","current_variant","setAttribute","\n
","Can not fetch all body","[data-open]",'\n \n ',"get","freegifts-main-popup-container","sca_link_checkout",'

\n ',"fgSettings","maxWidth","sca_process_gifts","mode_override_checkout","[type='submit'][name='add'], [type='button'][name='add'], [data-add-to-cart], [data-action='add-to-cart']","Select your free gift!","product_page","fgCallback",'" alt="">\n

',"stopImmediatePropagation","and","cart","","/cart/update","collection_page","prepend","50%","sections","gift_should_the_same","\n ","replace","getCart","&sca_shop_name=","display","src","compare_gift_price_with_product","boolean","clone_product_handle","headers","compare_at_price",'\n

\n {let $=_0x2e6852,x=FGSECOMAPP[$(643)]?.[$(706)],e=x?.[$(871)]?.hidden_brand_mark,t=!b(x)&&void 0!==e&&!e;return t?'\n \n ':""},e=()=>{let $=_0x2e6852,x=FGSECOMAPP[$(643)]?.gift_slider,e=x?.[$(491)]??{};return document[$(407)](".freegifts-main-container .slide-container #sca-hidden-gift-popup .sca-disable-checkbox")?.[$(876)]&&localStorage[$(853)]("FGSECOMAPP_HIDDEN_GIFT_POPUP",""+Date[$(626)]()),e?.enable?$(587)+e[$(529)]+$(817):""},{fetch:t}=window,a=()=>{let $=_0x2e6852;"fg-checkout"!==document[$(407)]("#secomapp_freegifts_version")?.getAttribute($(561))&&(window.fetch=async(...x)=>{let e=$;try{if(x[0][e(540)]("/cart/add")){i(x[1]);let a=200,r=await t(...x)[e(655)]($=>{let x=e;return(a=$[x(856)],$[x(464)])?$:$.json()})[e(838)]($=>{let x=e;console[x(408)]($)});if(x[1][e(453)]?.[e(813)]&&200!==a){let n=JSON[e(457)](x[1][e(739)])?.id,o=document[e(407)]('.btn-add-to-cart[data-variant="'+n+'"]');return o[e(484)]=e(818),o[e(843)][e(637)](e(679))||o[e(843)][e(507)](e(679)),o.disabled=!0,o[e(808)].backgroundColor="#82868b",document[e(839)](e(862))[e(560)]($=>{let x=e;parseInt($[x(830)](x(847)))===n||$[x(843)][x(637)](x(679))||($[x(476)]=!1,$[x(808)][x(459)]=FGSECOMAPP[x(643)]?.[x(706)]?.[x(519)]?.[x(846)]??x(409))}),!1}return await K([e(718),...x[e(730)](1)]),await c(x,r),new Response(JSON[e(875)](r))}if(!(x[0][e(540)](e(763))||x[0][e(540)](e(438))))return setTimeout(function(){$l()},1e3),await t(...x);{i(x[1]);let l=200,s=await t(...x)[e(655)]($=>{let x=e;return(l=$.status,$[x(464)])?$:$[x(708)]()}).catch($=>{let x=e;console[x(408)]($)});if(x[1][e(453)]?.[e(427)]&&200!==l)return!1;if(await K([x[0][e(540)](e(763))?"/cart/change":e(438),...x[e(730)](1)]),x[1]?.[e(453)]?.[e(427)])return new Response(JSON.stringify(s));let d=await t(e(788))[e(655)]($=>{let x=e;return $[x(708)]()});return await c(x,s,d),new Response(JSON[e(875)](d))}}catch(f){return await t(...x)}})};FGSECOMAPP[_0x2e6852(833)]=()=>{let $=_0x2e6852;try{if(Shopify?.[$(562)]||typeof Shopify?.[$(446)]!==$(627))return;Shopify.getCart=async function(x){let e=$;if(!FGSECOMAPP[e(414)]){FGSECOMAPP[e(414)]=!0,await K("/cart.js");let t=await fetch(e(788),{method:"GET",headers:{Accept:e(486),sca_fetch:"fetch_new_cart","Content-Type":e(486)}});typeof x===e(627)&&(0>FGSECOMAPP[e(432)][e(667)](x)&&FGSECOMAPP[e(432)].push(x),x(await t.json())),FGSECOMAPP[e(414)]=!1}FGSECOMAPP.fetchCheckoutEvents()},typeof ShopifyAPI!==$(747)&&void 0!==ShopifyAPI[$(446)]&&(ShopifyAPI[$(446)]=Shopify?.[$(446)]),typeof Shopify?.[$(632)]!==$(747)&&typeof Shopify?.[$(632)][$(446)]!==$(747)&&(Shopify[$(632)].getCart=Shopify?.getCart)}catch(x){console[$(408)](x)}};let i=$=>{let x=_0x2e6852;try{let e=$?.[x(739)];e instanceof FormData?FGSECOMAPP[x(470)]={sections:e.get(x(442)),sections_url:e[x(421)](x(653))}:typeof e===x(668)&&(e=JSON[x(457)](e),FGSECOMAPP.sections_cart={sections:e?.[x(442)],sections_url:e?.[x(653)]})}catch(t){FGSECOMAPP[x(470)]={}}},r=async()=>{let $=_0x2e6852;if(!b(FGSECOMAPP[$(467)])){let x=[$(861)];for(let e of FGSECOMAPP[$(467)]){let a=FGSECOMAPP[$(719)][$(493)](x=>x.id===e[$(715)])?.[$(717)]?.[$(848)];b(a)||x[$(566)](a)}let i={freegift_attributes:x.toString()};try{await t($(438),{method:$(661),headers:{"X-Requested-With":$(775),"Content-Type":$(575)},body:JSON[$(875)]({attributes:i})})}catch(r){console.error("Update cart.attributes "+r[$(878)])}}},c=async($,x,e)=>{let a=_0x2e6852;try{if($[1]?.[a(453)]?.[a(427)])return;let i={},r=Object.keys(x[a(442)]??{})?.[a(611)]($=>b(FGSECOMAPP[a(470)][$]))??[];if(r&&r[a(532)]&&FGSECOMAPP.isUpdateCart&&(i=await t("/?sections="+r[a(704)](","))[a(655)]($=>$[a(708)]())),FGSECOMAPP[a(601)]=!1,i={...FGSECOMAPP[a(470)],...i},b(i))return;x[a(442)]={...x[a(442)],...i},b(e)||(e[a(442)]={...x[a(442)]})}catch(c){}},n=async($,x,e)=>{let t=_0x2e6852;e=e?.[t(618)]();let a=document.querySelectorAll(t(851));a[t(560)](x=>{let e=t;x[e(476)]=!0;let a=x[e(830)](e(847))-0;a===$&&(x[e(808)][e(769)]=e(823),x[e(799)]='\n \n \n \n \n \n '),x[e(808)].backgroundColor=e(528)});let i=FGSECOMAPP[t(467)].find(x=>e===x[t(715)]?.[t(618)]()&&$===x[t(651)]);i?i[t(746)]+=x:FGSECOMAPP[t(467)][t(506)]({variantId:$,belongs_to_offer:e,quantity:x}),localStorage[t(853)]("sca_offers_added",LZString.compressToBase64(JSON[t(875)](FGSECOMAPP[t(467)])));let r=await fetch(t(477),{method:t(661),headers:{Accept:"application/json","Content-Type":t(486),sca_add_gift:"sca_add_gift"},body:JSON.stringify({quantity:x,id:$})}),c=await r[t(708)]();if(r.ok)return a.forEach(x=>{let e=t;x[e(476)]=!0;let a=x[e(830)](e(847))-0;a===$&&(x[e(808)].padding=e(823),x[e(799)]=e(569)),x.style.backgroundColor=""}),Q(),c},o=$=>{let x=_0x2e6852,e=x(465);return!b($)&&(typeof $===x(546)&&($[x(478)]?.includes(e)||$[x(759)]?.[x(540)](x(460)))||typeof $===x(668)&&$.includes(e))},l=async($,x)=>{let e=_0x2e6852;try{if(b($)&&b(x))return;let t={};if(FGSECOMAPP[e(652)]?.[e(611)]($=>o($))?.[e(560)]($=>{let x=e;t[$[x(736)]]=$[x(746)]}),($=$?.[e(611)]($=>!b($[e(736)])))?.[e(560)]($=>{let x=e;t[$[x(736)]]=(t[$[x(736)]]??0)+($[x(746)]??1)}),Object.keys(t)?.forEach($=>{t[$]=t[$]>=0?t[$]:0}),b(Object[e(714)](t)))return;$?.[e(560)]($=>{let x=e,t=FGSECOMAPP[x(467)][x(493)](e=>$.offer_id?.toString()===e[x(715)]?.[x(618)]()&&$.variant_id===e.variantId);t?t[x(746)]+=$.quantity:FGSECOMAPP[x(467)][x(506)]({variantId:$[x(736)],belongs_to_offer:$[x(835)]?.toString(),quantity:$.quantity})}),localStorage.setItem("sca_offers_added",LZString[e(604)](JSON[e(875)](FGSECOMAPP.arrOfferAdded))),FGSECOMAPP[e(601)]=!0,await fetch("/cart/update",{method:e(661),headers:{Accept:e(486),"Content-Type":e(486),sca_process_gifts:!0},body:JSON.stringify({updates:t,...FGSECOMAPP[e(470)]})})[e(655)](t=>{let a=e;return t.ok&&$.length&&!x[a(532)]&&Q(),t[a(708)]()})[e(655)]($=>{let x=e;FGSECOMAPP[x(470)]=$[x(442)]}),"fg-checkout"===document[e(407)](e(639))?.[e(830)](e(561))&&location[e(584)]()}catch(a){console[e(408)](a)}},s=0,d=()=>{let $=_0x2e6852,t=document[$(495)]("freegifts-main-page-container");if(t)t.innerHTML=$(539)+(FGSECOMAPP.fgAppearanceGiftSlider.gift_popup_title??"Select your free gift!")+$(556)+x()+$(417);else{let a=localStorage[$(530)]($(784))-0,i=FGSECOMAPP[$(643)]?.[$(706)]?.[$(491)]??{},r=(i?.[$(622)]??0)*6e4,c=!isNaN(a)&&a+r>Date[$(626)]();if(c||(localStorage[$(512)]($(784)),!(t=document.getElementById($(422)))))return;t[$(799)]='
\n \n
\n '+(FGSECOMAPP[$(633)][$(537)]??$(430))+$(579)+e()+$(778)+x()+$(406),t[$(843)][$(507)]($(472)),s++}},f=($,x)=>{let e=_0x2e6852;return $.map($=>e(796)+($[e(764)]??x)+e(790)+$[e(531)]+e(412)+$[e(748)]+e(710)+_($)+e(498)+u($)+e(728)+$[e(705)]+e(444))[e(704)](" \n")},_=$=>{let x=_0x2e6852;return FGSECOMAPP.formatter[x(678)](v($?.[x(750)]))},u=$=>{let x=_0x2e6852,e=FGSECOMAPP?.[x(425)]?.[x(567)]===x(454)?$?.[x(742)]:$?.[x(696)];return FGSECOMAPP[x(857)][x(678)](v(e??0))},g=($,x)=>{let e=_0x2e6852;return b(Shopify?.[e(781)][$])?x??"#":Shopify?.[e(781)][$][e(478)]},p=($,x)=>{let e=_0x2e6852;return FGSECOMAPP[e(633)].show_product_title?b(Shopify?.[e(781)][$])?x[e(445)]("\xbb","").replace(/\(\d*% off\)/,"")??"":Shopify?.[e(781)][$][e(792)]:""},b=$=>{let x=_0x2e6852;if(0===$)return!0;if(typeof $==x(649)||typeof $==x(451))return!1;if(typeof $==x(747)||null===$)return!0;if(typeof $[x(532)]!=x(747))return 0===$[x(532)];let e=0;for(let t in $)$[x(713)](t)&&e++;return 0===e},h=$=>{let x=_0x2e6852;try{let e={...FGSECOMAPP[x(752)]},t=e[$];if(t=t?t[x(734)]():null,!b(t)&&t[x(532)]>0)try{return document.querySelector(t),", "+t}catch(a){}return""}catch(i){return""}},m=()=>{let $=_0x2e6852;try{FGSECOMAPP[$(857)]=new Intl[$(860)](Shopify?.[$(621)]??Shopify?.locale,{style:"currency",currency:Shopify?.[$(613)]?.[$(824)]??$(693)})}catch(x){FGSECOMAPP[$(857)]=new Intl[$(860)]($(786),{style:"currency",currency:Shopify?.[$(613)]?.active??$(693)})}},v=$=>{let x=_0x2e6852;$=$??0;let e=Shopify?.currency?.[x(664)]??1;return 1===parseFloat(e)?$:($*e).toFixed(Shopify?.[x(555)]??2)},y=$=>{let x=_0x2e6852;return $[x(611)]($=>void 0===$.cal_gift_for_other_rules||!0===$[x(617)])[x(568)](($,e)=>$+e.quantity*(e[x(489)]??e[x(750)]),0)/100},w=$=>{let x=_0x2e6852;return $[x(611)]($=>void 0===$[x(617)]||$[x(617)])[x(568)](($,e)=>$+e[x(746)],0)},k=($,x)=>{let e=_0x2e6852,t=x[e(647)];return b(t)?$:$[e(611)]($=>{let x=e;return!t[x(690)](e=>{let t=x;switch(e.type){case"variants_ids":return Object[t(508)](e.value)[t(690)]($=>$[t(672)])[t(616)]()[t(690)]($=>$.id)[t(540)]($[t(736)]);case t(789):return Object[t(714)](e.value).includes($[t(485)]);case t(810):return Object[t(714)](e[t(629)])[t(540)]($[t(524)]);case t(676):let a=Object.keys(e[t(629)]),i=$[t(712)]?.map($=>$.id+"")?.filter($=>a.includes($));return!b(i);default:return!1}})[x(540)](!1)})},A=($,x)=>$?.map($=>{let e=_0x4220;if(typeof $[e(617)]!==e(747)){let t=FGSECOMAPP.arrOfferAdded?.filter(x=>x.variantId===$.variant_id),a=t?.[e(568)](($,x)=>$+x[e(746)],0);if(a===$[e(746)]){let i=FGSECOMAPP[e(467)]?.[e(611)]($=>{let t=e;if($.belongs_to_offer?.[t(618)]()===x[t(618)]())return!1;let a=FGSECOMAPP[t(719)]?.find(x=>x.id?.[t(618)]()===$[t(715)]?.[t(618)]()),i=a[t(558)]??{};return i[t(617)]&&100!==parseInt(i[t(559)])})?.[e(568)](($,x)=>$+x.quantity,0);return{...$,cal_gift_for_other_rules:i>0,quantity:i??0}}return{...$,cal_gift_for_other_rules:!1,quantity:0}}return{...$}})??[],C=($,x,e)=>{let t=_0x2e6852,a=0,i=k(x,$);i=A(i,$[t(835)]);let r;return $.unit===t(870)?r=y(i):$[t(413)]===t(497)&&(r=w(i)),r>=$.min_amount&&(null===$[t(756)]||r<=$[t(756)])&&(a=e[t(814)],$[t(578)]&&(a=Math[t(701)](r/$[t(743)])*a)),a},S=($,x,e)=>{let t=_0x2e6852,a={},i=[],r=0;return x[t(690)](x=>{let a=t,c=C(x,$,e);0!==c&&(r=c),i[a(566)](c>0)}),a.max_gifts_can_get=r,a[t(563)]=i,a},T=($,x)=>{let e=_0x2e6852,t=!1;return 1===$[e(532)]?t=$[0]:2===$[e(532)]&&(x===e(435)&&(t=$[0]&&$[1]),"or"===x&&(t=$[0]||$[1])),t},q=($,x)=>{let e=_0x2e6852,t=$?.[e(690)]($=>$[e(736)]);FGSECOMAPP[e(467)]=FGSECOMAPP[e(467)][e(611)]($=>t?.includes($[e(651)]));let a=x[e(800)].map($=>$.variant_shopify_id),i=FGSECOMAPP.arrOfferAdded[e(611)]($=>$[e(715)]?.[e(618)]()===x.id?.[e(618)]())?.map($=>{let x=e;return $[x(651)]}),r=$[e(611)]($=>{let x=e;return o($)&&($[x(617)]=!1),a[x(540)]($[x(736)])&&i.includes($[x(736)])}),c=r[e(690)]($=>{let t=e,a=x[t(558)];$.cal_gift_for_other_rules=a[t(617)],$[t(715)]=x.id?.[t(618)]();let i=FGSECOMAPP[t(467)]?.[t(611)](e=>e[t(715)]?.[t(618)]()!==x.id?.[t(618)]()&&$[t(736)]===e.variantId)?.[t(568)](($,x)=>$+x[t(746)],0);return{...$,quantity:$[t(746)]-i}});return c[e(611)]($=>{let t=e;return $[t(715)]?.toString()===x.id?.[t(618)]()})},E=$=>{let x=_0x2e6852,e=$[x(658)][x(611)](e=>e.belongs_to_offer?.toString()!==$.id?.[x(618)]())[x(690)]($=>$[x(665)]);return Object.values($[x(657)])[x(611)]($=>!e[x(540)]($[x(836)]))},P=($,x)=>{let e=_0x2e6852,t=q($,x),a=S($,x[e(630)],x[e(558)]),i=T(a[e(563)],x[e(869)]);if(i){let r=t[e(611)]($=>$[e(715)]?.[e(618)]()===x.id?.[e(618)]())[e(568)](($,x)=>$+x[e(746)],0);a.max_gifts_can_get=a[e(724)]-r,x[e(658)]=t,x.giftsAvailable=a[e(724)]}else x[e(658)]=t,x[e(844)]=0;return"number"==typeof FGSECOMAPP[e(553)]&&x.priority>FGSECOMAPP[e(553)]&&(i=!1),i||!x.stop_lower_priority||FGSECOMAPP.maxOfferPriority!==x[e(767)]||b(t)||(FGSECOMAPP.maxOfferPriority=null),x.isReachConditions=i,x.stop_lower_priority&&i&&(null==FGSECOMAPP[e(553)]||x.priority<=FGSECOMAPP[e(553)])&&FGSECOMAPP[e(553)]!==x[e(767)]&&(FGSECOMAPP[e(553)]=x[e(767)]),x},I=$=>{let x=_0x2e6852,e=$+"=",t=decodeURIComponent(document[x(513)])[x(656)](";");for(let a=0;a{let e=_0x2e6852,t=!0,a=!0,i=!0;if(!b($.sub_conditions?.[e(848)])){let r=I(e(608));t=r&&JSON[e(457)](r)[e(540)]($.sub_conditions[e(848)])}if(!b($[e(717)]?.[e(641)])){let{customer_tags:c}=$[e(717)],n=c?.value_customer_tags?.[e(488)]($=>x[e(666)][e(759)]?.includes($));a=c?.[e(638)]===e(595)?n:!n}if(!b($[e(717)]?.customer_order_history)){let o=!0,l=$[e(717)][e(794)],s=x.customer.orders??[];if(l.order_created_from){let d=Date.parse(l[e(474)])/1e3;s=s.filter($=>$.created_at>=d)}if(!b(l?.totarrCustomerOrderal_spend_on_order_history)&&(0!==l[e(744)][e(743)]||0!==l[e(744)][e(756)])){let f=l.total_spend_on_order_history.min_amount,_=l[e(744)][e(756)],u=s.reduce(($,x)=>$+x.total_price,0)/100;o&=(u>=f||!f)&&(u<=_||!_)}if(!b(l?.total_spent_on_last_order)&&(0!==l[e(863)][e(743)]||0!==l.total_spent_on_last_order[e(756)])){let g=x.customer.last_total/100,p=l.total_spent_on_last_order.min_amount,h=l[e(863)][e(756)];o&=(g>=p||!p)&&(g<=h||!h)}if(!b(l?.[e(849)])){let m=!(0!==l[e(849)][e(743)]||0!==l[e(849)][e(756)]),v=s[e(532)],y=l[e(849)].min_amount,w=l.number_of_order.max_amount;o&=m?b(s):(v>=y||!y)&&(v<=w||!w)}if(l?.[e(702)]){let k=x[e(666)][e(460)]??[],A=$[e(800)]?.[e(488)]($=>k[e(540)]($[e(531)]))||$[e(800)]?.[e(488)]($=>k[e(540)]($.original_variant_shopify_id+"_"+($.original_price-$.price)*100));o&=!A}i=o}return t&&a&&i},G=($,x,e)=>{let t=_0x2e6852,a=[],i=[],r=[],c=[];for(let n of x){let l=P($,n);if(!l[t(536)]){l[t(658)][t(532)]>0&&l[t(658)].forEach($=>{let x=t;i[x(566)]({variant_id:$.variant_id,quantity:$.quantity,offer_id:n.id})});continue}if(l.giftsAvailable<0){l[t(658)][t(560)]($=>{let x=t;i[x(566)]({variant_id:$[x(736)],quantity:$[x(746)],offer_id:n.id})});continue}0!==l.giftsAvailable&&(n[t(717)]?L(n,SECOMAPP)&&a[t(566)](n):a[t(566)](n))}if($?.[t(560)]($=>{let x=t;b($.belongs_to_offer)&&o($)&&i[x(566)]({variant_id:$[x(736)],quantity:$[x(746)],offer_id:$[x(715)]?.[x(618)]()})}),e||b(i)){let s=a[t(690)]($=>{let x=t;return{id:$.id,offerName:$.offer_name,offerPriority:$[x(767)],stopLowerPriority:$[x(670)],gifts:E($),giftsAvailable:$.giftsAvailable,giftsAdded:$.giftsAdded,isReachConditions:$.isReachConditions}});if(!b(s)){let d={};for(let f of s){let _=M(FGSECOMAPP[t(425)],f);_?.[t(532)]>0?r=r.concat([..._]):f[t(822)].map($=>{let x=t;d[$[x(836)]]={...$,belongs_to_offer:f.id?.[x(618)]()}})}c=Object.values(d)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:c}},O=($,x)=>{let e=_0x2e6852,t=new Set;return $?.[e(560)]($=>t.add($[e(835)])),t.forEach($=>{let x=e,t=FGSECOMAPP[x(719)]?.[x(493)](x=>x.id?.toString()===$?.toString());if(b(t)||!t[x(536)]){FGSECOMAPP[x(467)]=FGSECOMAPP.arrOfferAdded?.[x(611)](e=>e[x(715)]?.[x(618)]()!==$?.[x(618)]());return}if(t[x(844)]>=0)return;let a=[],i=FGSECOMAPP[x(467)]?.[x(611)](e=>e[x(715)]?.toString()===$?.toString())??[];if(t?.[x(558)]?.auto_add_all_gifts)a=a.concat([...i]),t[x(844)]=0;else for(let r of i){if(t[x(844)]>=0)break;t[x(844)]+=r[x(746)],t.giftsAvailable<=0?a[x(566)]({...r}):(r[x(746)]=t.giftsAvailable,t.giftsAvailable=0)}a?.forEach($=>{let e=x;FGSECOMAPP.arrOfferAdded=FGSECOMAPP[e(467)]?.filter(x=>$[e(651)]!==x[e(651)]||$[e(715)]?.[e(618)]()!==x[e(715)]?.[e(618)]())})}),x?.[e(611)]($=>{let x=e;return o($)&&($[x(746)]=FGSECOMAPP[x(467)]?.[x(611)](e=>$[x(736)]===e.variantId)?.reduce(($,e)=>$+e[x(746)],0)??0),$[x(746)]>0})??[]},F=async($,x)=>{let e=_0x2e6852,{arrGiftsAdd:t,arrGiftsRemove:a,arrGiftsData:i}=G($,x,!1),c=O(a,$);if(!b(a)){let n=G(c,x,!0);O(n?.arrGiftsRemove,$),t=n?.arrGiftsAdd,a=a?.[e(791)](n?.[e(518)])??[],i=n?.arrGiftsData}return await l(t,a),await r(),i},M=($,x)=>{let e=_0x2e6852,t=[];if($[e(834)]){let a=x.gifts,i=a[e(568)](($,x)=>$+x.variants[e(532)],0),r=FGSECOMAPP[e(719)][e(611)]($=>$.id===x.id),c=r[0][e(558)].auto_add_all_gifts,n=r[0].gift_should_the_same;if(1===i||c||n[e(856)]){if($[e(821)]&&!D(a)||$?.[e(450)]&&!B(a))return!1;if(n[e(856)]){if("variant"===n.type){let o=FGSECOMAPP[e(652)];o=o[e(611)]($=>$.product_id===a[0].original_product_shopify_id);let l=a[0].variants[e(611)]($=>{let x=e;return o[0][x(736)]===$.original_variant_shopify_id})[0];if(0===l.price&&100===parseInt(l[e(559)]))return t[e(566)]({variant_id:l.variant_shopify_id,quantity:x.giftsAvailable,offer_id:x.id}),t}else if(c){let s=a?.[e(568)](($,x)=>($+x?.variants?.[e(532)])??0,0);if(!s)return!1;let d=(x?.giftsAvailable??0)/s;for(let f of a)for(let _ of f[e(677)])t.push({variant_id:_.variant_shopify_id,quantity:d,offer_id:x.id});return t}}else{if(c){let u=a?.[e(568)](($,x)=>($+x?.variants?.[e(532)])??0,0);if(!u)return!1;let g=(x?.[e(844)]??0)/u;for(let p of a)for(let b of p[e(677)])t[e(566)]({variant_id:b[e(531)],quantity:g,offer_id:x.id});return t}{let h=a[0][e(677)][0];if(0===h[e(750)]&&100===parseInt(h[e(559)]))return console.log(e(782)+a[0][e(677)][0][e(531)]+" "+a[0][e(677)][0][e(705)]),t[e(566)]({variant_id:h[e(531)],quantity:x.giftsAvailable,offer_id:x.id}),t}}}}return!1},H=$=>{let x=_0x2e6852;return $===x(754)},j=$=>{let x=_0x2e6852,e=$;if(FGSECOMAPP[x(633)][x(654)]===x(466))for(let t of(e=[],$)){let a=t[x(677)];a&&a[x(532)]&&a[x(560)]($=>e[x(566)]({...t,thumbnail:$[x(764)],variants:[$]}))}let i=document[x(495)](x(646));i&&(i.innerHTML=e[x(690)]($=>{let e=x,t=$?.variants[0]??{};return e(480)+g($.original_product_shopify_id,$[e(674)])+e(545)+$.thumbnail+e(433)+p($[e(585)],$[e(792)])+e(691)+(FGSECOMAPP.fgAppearanceGiftSlider[e(654)]===e(466)&&FGSECOMAPP.fgAppearanceGiftSlider[e(542)]?e(424)+(1===$.variants.length?e(554)+(H(t[e(705)])?e(645):"")+e(600)+t[e(705)]+e(831):e(659)+(FGSECOMAPP[e(633)][e(723)]??e(603))+"")+"\n

":"")+e(855)+u(t)+e(420)+_(t)+"\n
\n "+("by_variants"!==FGSECOMAPP[e(633)].show_gift_for_customer?e(741)+(1===$[e(677)][e(532)]?''+t[e(705)]+e(437):e(659)+(FGSECOMAPP[e(633)][e(723)]??e(603))+e(437))+e(732)+f($[e(677)],$.thumbnail)+e(683):"")+'\n
\n \n
\n
\n
\n '+$?.[x(690)]($=>x(455)+g($[x(585)],$[x(674)])+x(842)+$[x(764)]+x(695))[x(704)]("")+"\n
\n \n "+($?.[x(532)]>=4?x(544):"")+'\n
\n
\n
\n ',a=x(490)+h(x(619)),i=document[x(407)](a)??document[x(407)](x(429));if(!i)return;i[x(515)][x(808)][x(745)]="100%",i[x(515)][x(808)][x(669)]=x(749),i[x(515)]?.[x(768)]?.includes("sca-fg-form-thumbnail-product-page")||i[x(515)]?.[x(843)]?.[x(507)]("sca-fg-form-thumbnail-product-page");let r=i[x(515)].querySelector("#sca-gift-thumbnail");if(r)r[x(799)]=t;else{(r=document[x(552)](x(526)))[x(416)]("id",x(573));let c=new DOMParser()[x(548)](t,"text/html");r[x(799)]=c[x(739)].innerHTML,i[x(515)][x(726)](r,i)}i[x(515)][x(726)](r,i);let n=document[x(407)]("#fg-gift-thumbnail-title");if(n)switch(e[x(502)]?.[x(751)]){case"32":n[x(808)][x(426)]=x(441);break;case"50":n.style.maxWidth="60%";break;case x(845):n[x(808)][x(426)]=x(648);break;case"160":n.style[x(426)]=x(758);break;case x(505):n[x(808)][x(426)]=x(777);break;default:n[x(808)][x(426)]="60%"}if($?.length>=4)new Glider(document.querySelector(x(772)),{slidesToShow:3,slidesToScroll:1,draggable:!0,dots:".dots-thumbnail",arrows:{prev:x(773),next:x(722)}});else{n&&(n.style.maxWidth=x(777));let o=document[x(407)](x(772));o&&(o[x(808)][x(448)]=x(798))}},$i=()=>{let $=_0x2e6852;if(!(FGSECOMAPP[$(770)][$(431)]??{})[$(510)]?.[$(856)])return;let x='\n free-gift-icon\n ',e=$(735)+h($(642)),t=document[$(407)](e)??document[$(407)]($(404));if(!t)return;t.style[$(458)]="relative",t[$(808)][$(745)]=$(866),t[$(768)]?.[$(540)]($(501))||t[$(843)]?.[$(507)]("sca-fg-form-icon-product-page");let a=t[$(407)]($(797));if(a)a.innerHTML=x;else{(a=document[$(552)]("div"))[$(416)]("id",$(607));let i=new DOMParser()[$(548)](x,$(496));a[$(799)]=i[$(739)][$(799)],t.appendChild(a)}},$r=()=>{let $=_0x2e6852,x=[],e=".fg-secomapp-collection-img, .product-card, #product-grid .grid__item, .card-list .card-list__column, .cc-product-list .product-block, .collection-list.grid .grid__item, .collection-grid.grid .grid__item "+h($(738));return document[$(839)](e).forEach(e=>{let t=$,a=e.querySelector(t(688)),i=a?.[t(830)](t(514))?.[t(656)]("/")??[],r=i?.[t(667)](t(781)),c=r>=0?i[r+1]??null:null;if(c=c?.split("?")?.[t(564)](),o(c)){e[t(809)]();return}let n=e[t(407)](t(535));if(n){e[t(809)]();return}if(b(c))return;let l=decodeURI(c);b(FGSECOMAPP[t(521)][l]?.[t(757)])&&x[t(566)](l),FGSECOMAPP[t(521)][l]={...FGSECOMAPP[t(521)][l],position:e}}),x},$c=$=>{let x=_0x2e6852;Object.keys($)?.[x(560)]($=>{let e=x,t=FGSECOMAPP[e(521)][$]?.[e(458)];if(!t)return;if(!(FGSECOMAPP[e(770)][e(439)]??{})[e(856)])return;let a=e(547)+FGSECOMAPP.fgAppearanceGiftIcon.gift_icon_path+e(605);t.style[e(458)]=e(771),t[e(768)]?.[e(540)](e(590))||t[e(843)]?.[e(507)](e(590));let i=t[e(407)](e(533));if(i)i[e(799)]=a;else{(i=document[e(552)](e(526))).setAttribute("class",e(494));let r=new DOMParser().parseFromString(a,e(496));i.innerHTML=r[e(739)][e(799)],t.appendChild(i)}})},$n=async $=>{let x=_0x2e6852;await t(SECOMAPP[x(725)]+"&sca_products_handle="+LZString[x(762)](JSON[x(875)]($)),{method:"GET",headers:{"Content-Type":x(795)}})[x(655)](async $=>{let e=x,t=await $[e(708)](),a=[];t?.products?.[e(560)]($=>{let x=e;b($?.products?.id)||a.push({...$[x(781)],collections:$[x(712)],variants_quantity:$.variants_quantity})});let i=$t(a);$c(i)})[x(838)]($=>{console.error($)})},$o=async $=>{let x=_0x2e6852,e=[];for(let[t,a]of $.entries())b(FGSECOMAPP[x(521)][a]?.info)&&e[x(566)](a),20===e.length&&(await $n([...e]),e=[]),t===$.length-1&&e.length>0&&(await $n([...e]),e=[])},$l=()=>{let $=_0x2e6852,x=$r(),e=$t();$c(e),$o(x)[$(655)]()},$s=()=>{let $=_0x2e6852;Shopify?.enable_check_variants_has_gift&&document[$(577)]("change",function(){let x=new URL(document.URL),e=parseInt(x.searchParams.get($(672)));$d(isNaN(e)?void 0:e)})},$d=$=>{let x=_0x2e6852;if(!location[x(514)][x(540)](x(463)))return;document[x(407)](x(797))?.[x(809)](),document[x(407)](x(680))?.remove();let e=$t();if(b(e))return;let t=location.pathname[x(656)]("/"),a=t?.[x(667)](x(781)),i=decodeURI(a>=0?t[a+1]??null:null);if(!Object[x(714)](e)?.[x(540)](i))return;let r=e[i],c=FGSECOMAPP.productsInPage[i]?.[x(492)]??[];!(Shopify?.[x(727)]&&(!b($)&&!c[x(540)]($)||b($)&&!b(Shopify?.[x(854)]?.[x(415)])&&!c[x(540)](Shopify?.[x(854)]?.[x(415)]?.id)))&&($a(r),$i(r))};FGSECOMAPP[_0x2e6852(740)]=$=>{let x=_0x2e6852;try{b($)&&($=[...FGSECOMAPP[x(719)]]);let e=location[x(514)][x(540)](x(479)),t=[];if($?.[x(560)]($=>{let e=x;if($.isReachConditions||b($[e(804)])||!b(FGSECOMAPP[e(553)])&&!$[e(536)]&&$.stop_lower_priority&&$[e(767)]>FGSECOMAPP[e(553)])return;let a=$[e(804)];$[e(630)]?.[e(560)]($=>{let x=e,t=k(FGSECOMAPP[x(652)],$);t=A(t,$.offer_id);let i=0,r=null,c=0;"money"===$[x(413)]?(i=y(t),r=x(766),c=Shopify?.[x(628)]??2):$.unit===x(497)&&(i=w(t),r=x(755),c=0);let n=Math.max($[x(743)]-i,0).toFixed(c);a=a[x(877)](r,n)}),t.push(a)}),b(t)){document[x(839)](x(716))[x(560)]($=>$[x(799)]="");return}let a="",i=x(865)+t?.map($=>x(850)+$+x(698))[x(704)]("")+x(406);FGSECOMAPP.fgAppearancePromotionMessage[x(858)]&&(a=i);let r=x(481),c=document.querySelector(r),n=c?.querySelector(x(825)),o=document[x(839)](x(523)+h(x(806))),l=document.querySelectorAll(x(716));if(b(l)){(l=document.createElement(x(526)))[x(416)]("id",x(487)),l.classList[x(507)](x(487));let s=new DOMParser()[x(548)](a,x(496));l[x(799)]=s[x(739)].innerHTML,b(o)?(s=new DOMParser()[x(548)](a,x(496)),l[x(799)]=s[x(739)][x(799)],c&&n&&e?n[x(440)](l):c&&e&&c[x(440)](l)):o?.[x(560)]($=>{let x=l.cloneNode(!0);$.prepend(x)})}else l.forEach($=>$[x(799)]=a);try{document.querySelectorAll(".sca-promotion-glider")[x(560)]($=>{let x=new Glider($);(($,x)=>{let e=_0x4220,t=$[e(820)].childElementCount,a=null,i=1;function r(){a=setTimeout(()=>{let x=_0x4220;i>=t&&(i=0),$[x(620)](i++)},3e3)}$[e(841)][e(577)](e(785),function(){window[e(511)](a),r()}),r()})(x,3e3)})}catch(d){console[x(408)](d)}}catch(f){console.error(f)}},z(FGSECOMAPP[_0x2e6852(652)])[_0x2e6852(655)]()}}catch($f){console[_0x2e6852(644)](_0x2e6852(681),$f)}