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":false},"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 _0x313639=_0x3233;function _0x3233($,x){let e=_0x48f0();return(_0x3233=function($,x){return e[$-=219]})($,x)}!function($,x){let e=_0x3233,t=$();for(;;)try{let a=-parseInt(e(610))/1+-parseInt(e(660))/2*(-parseInt(e(616))/3)+parseInt(e(664))/4*(-parseInt(e(328))/5)+-parseInt(e(555))/6+parseInt(e(264))/7+parseInt(e(418))/8+parseInt(e(405))/9*(parseInt(e(410))/10);if(203025===a)break;t.push(t.shift())}catch(i){t.push(t.shift())}}(_0x48f0,203025);try{let $=document[_0x313639(286)](_0x313639(479))?.[_0x313639(540)](_0x313639(413));if($===_0x313639(648)){window.fgData?.[_0x313639(515)]?.gift_icon?.[_0x313639(340)]&&fgGiftIcon&&(window[_0x313639(409)][_0x313639(515)][_0x313639(535)][_0x313639(340)]=fgGiftIcon),window[_0x313639(475)]={},FGSECOMAPP.maxOfferPriority=null,FGSECOMAPP.cartItems=Object[_0x313639(423)](Shopify?.cartItems??{}),FGSECOMAPP.offers=[],FGSECOMAPP[_0x313639(579)]=window.fgData?.[_0x313639(412)]??{},FGSECOMAPP.fgAppearance=window[_0x313639(409)]?.appearance??{},FGSECOMAPP[_0x313639(244)]=FGSECOMAPP[_0x313639(387)]?.[_0x313639(273)]?.[_0x313639(254)],FGSECOMAPP[_0x313639(585)]=FGSECOMAPP[_0x313639(387)]?.[_0x313639(535)],FGSECOMAPP[_0x313639(629)]=FGSECOMAPP.fgAppearance?.[_0x313639(330)],FGSECOMAPP[_0x313639(532)]=[],FGSECOMAPP[_0x313639(500)]=!1,FGSECOMAPP[_0x313639(348)]=[],FGSECOMAPP[_0x313639(652)]=0,FGSECOMAPP[_0x313639(491)]=!1,FGSECOMAPP[_0x313639(678)]={...Shopify?.[_0x313639(678)]},FGSECOMAPP[_0x313639(426)]=Shopify?.reRenderCartCustom??void 0,FGSECOMAPP[_0x313639(619)]=Shopify?.[_0x313639(619)]??void 0,FGSECOMAPP[_0x313639(470)]={},FGSECOMAPP.hasDoneProcessCheckout=!1,FGSECOMAPP[_0x313639(297)]={},FGSECOMAPP[_0x313639(278)]=!1;let x=()=>{let $=_0x313639,x=FGSECOMAPP.fgAppearance?.gift_slider,e=x?.[$(489)]?.[$(394)],t=!g(x)&&void 0!==e&&!e;return t?$(559):""},e=()=>{let $=_0x313639,x=FGSECOMAPP.fgAppearance?.[$(273)],e=x?.disable_slider_checkbox??{};return document[$(603)]($(274))?.checked&&localStorage.setItem($(336),""+Date.now()),e?.[$(378)]?$(226)+e[$(521)]+$(565):""},{fetch:t}=window,a=()=>{let $=_0x313639;document.querySelector($(269))?.getAttribute($(464))!==$(600)&&(window[$(582)]=async(...x)=>{let e=$;try{if(x[0][e(220)]("/cart/add")){i(x[1]);let a=200,_=await t(...x)[e(329)]($=>{let x=e;return a=$[x(527)],$[x(583)]()});if(x[1][e(684)]?.[e(237)]&&200!==a){let c=JSON.parse(x[1][e(534)])?.id,n=document[e(603)]('.btn-add-to-cart[data-variant="'+c+'"]');return n[e(290)]=e(417),n[e(289)][e(586)](e(574))||n[e(289)][e(260)](e(574)),n[e(554)]=!0,n[e(528)][e(259)]=e(349),document[e(643)](e(362))[e(300)]($=>{let x=e;parseInt($[x(540)](x(659)))===c||$[x(289)].contains("sca-fg-out-stock")||($[x(554)]=!1,$[x(528)].backgroundColor=FGSECOMAPP[x(387)]?.gift_slider?.[x(404)]?.[x(539)]??x(487))}),!1}return await K(["/cart/add",...x[e(658)](1)]),await r(x,_),new Response(JSON[e(503)](_))}if(!(x[0][e(220)](e(231))||x[0][e(220)](e(437))))return setTimeout(function(){$_()},1e3),await t(...x);{i(x[1]);let o=200,s=await t(...x).then($=>{let x=e;return o=$[x(527)],$.json()});if(x[1][e(684)]?.[e(596)]&&200!==o)return!1;if(await K([x[0][e(220)](e(231))?e(231):e(437),...x[e(658)](1)]),x[1]?.[e(684)]?.[e(596)])return new Response(JSON[e(503)](s));let l=await t(e(236))[e(329)]($=>{let x=e;return $[x(583)]()});return await r(x,s,l),new Response(JSON[e(503)](l))}}catch(d){return await t(...x)}})};FGSECOMAPP[_0x313639(545)]=()=>{let $=_0x313639;try{if(Shopify?.[$(245)]||typeof Shopify?.getCart!==$(572))return;Shopify[$(597)]=async function(x){let e=$;if(!FGSECOMAPP[e(500)]){FGSECOMAPP[e(500)]=!0,await K(e(236));let t=await fetch("/cart.js",{method:"GET",headers:{Accept:e(327),sca_fetch:e(634),"Content-Type":e(327)}});typeof x===e(572)&&(0>FGSECOMAPP.fgCallback[e(229)](x)&&FGSECOMAPP[e(532)][e(665)](x),x(await t[e(583)]())),FGSECOMAPP.secomappGetCartRunning=!1}FGSECOMAPP[e(533)]()},typeof ShopifyAPI!==$(295)&&typeof ShopifyAPI.getCart!==$(295)&&(ShopifyAPI.getCart=Shopify?.getCart),typeof Shopify?.api!==$(295)&&typeof Shopify?.[$(352)].getCart!==$(295)&&(Shopify[$(352)][$(597)]=Shopify?.[$(597)])}catch(x){console[$(636)](x)}};let i=$=>{let x=_0x313639;try{let e=$?.[x(534)];e instanceof FormData?FGSECOMAPP[x(297)]={sections:e.get(x(490)),sections_url:e[x(672)]("sections_url")}:typeof e===x(651)&&(e=JSON.parse(e),FGSECOMAPP[x(297)]={sections:e?.[x(490)],sections_url:e?.[x(414)]})}catch(t){FGSECOMAPP[x(297)]={}}},r=async($,x,e)=>{let a=_0x313639;try{if($[1]?.[a(684)]?.[a(596)])return;let i={},r=Object[a(462)](x[a(490)]??{})?.[a(449)]($=>g(FGSECOMAPP[a(297)][$]))??[];if(r&&r[a(288)]&&FGSECOMAPP.isUpdateCart&&(i=await t(a(239)+r[a(224)](","))[a(329)]($=>$[a(583)]())),FGSECOMAPP.isUpdateCart=!1,i={...FGSECOMAPP[a(297)],...i},g(i))return;x[a(490)]={...x[a(490)],...i},g(e)||(e[a(490)]={...x[a(490)]})}catch(_){}},_=async($,x,e)=>{let t=_0x313639;e=e?.[t(337)]();document[t(643)](t(495))[t(300)](x=>{let e=t;x[e(554)]=!0;let a=x[e(540)](e(659))-0;a===$&&(x[e(481)]=e(544)),x.style[e(259)]=e(349)});let a=FGSECOMAPP.arrOfferAdded[t(606)](x=>e===x.belongs_to_offer?.[t(337)]()&&$===x.variantId);a?a[t(546)]+=x:FGSECOMAPP[t(348)][t(497)]({variantId:$,belongs_to_offer:e,quantity:x}),localStorage[t(454)](t(482),LZString[t(476)](JSON[t(503)](FGSECOMAPP.arrOfferAdded)));let i=await fetch(t(306),{method:t(590),headers:{Accept:"application/json","Content-Type":t(327),sca_add_gift:t(237)},body:JSON.stringify({quantity:x,id:$})}),r=await i[t(583)]();if(i.ok)return setTimeout(function(){Q()},1e3),r},c=$=>{let x=_0x313639,e=x(518);return!g($)&&(typeof $===x(602)&&($.handle?.includes(e)||$.tags?.[x(220)](x(287)))||"string"==typeof $&&$[x(220)](e))},n=async($,x)=>{let e=_0x313639;try{if(g($)&&g(x))return;let t={};if(FGSECOMAPP[e(249)]?.[e(449)]($=>c($))?.[e(300)]($=>{let x=e;t[$[x(666)]]=$[x(546)]}),($=$?.filter($=>!g($.variant_id)))?.forEach($=>{let x=e;t[$[x(666)]]=(t[$[x(666)]]??0)+($[x(546)]??1)}),Object[e(462)](t)?.forEach($=>{t[$]=t[$]>=0?t[$]:0}),g(Object.keys(t)))return;$?.forEach($=>{let x=e,t=FGSECOMAPP[x(348)][x(606)](e=>$[x(607)]?.[x(337)]()===e[x(576)]?.[x(337)]()&&$[x(666)]===e[x(276)]);t?t[x(546)]+=$[x(546)]:FGSECOMAPP[x(348)][x(497)]({variantId:$[x(666)],belongs_to_offer:$[x(607)]?.[x(337)](),quantity:$.quantity})}),localStorage.setItem(e(482),LZString.compressToBase64(JSON[e(503)](FGSECOMAPP[e(348)]))),FGSECOMAPP.isUpdateCart=!0,await fetch(e(437),{method:e(590),headers:{Accept:"application/json","Content-Type":e(327),sca_process_gifts:!0},body:JSON[e(503)]({updates:t,...FGSECOMAPP.sections_cart})}).then($=>$.json()).then($=>{FGSECOMAPP.sections_cart=$.sections}),document.querySelector(e(269))?.[e(540)](e(464))===e(600)&&location[e(284)]()}catch(a){console[e(636)](a)}},o=0,s=()=>{let $=_0x313639,t=document[$(286)]($(261));if(t)t.innerHTML=$(307)+(FGSECOMAPP[$(244)][$(379)]??$(617))+$(642)+x()+$(270);else{let a=localStorage[$(682)]($(336))-0,i=FGSECOMAPP[$(387)]?.[$(273)]?.[$(567)]??{},r=(i?.[$(613)]??0)*6e4,_=!isNaN(a)&&a+r>Date[$(645)]();if(_||(localStorage[$(343)]($(336)),!(t=document.getElementById($(420)))))return;t[$(481)]=$(549)+(FGSECOMAPP[$(244)][$(379)]??$(617))+'\n \n
\n
\n\n
\n
\n ❮ \n
\n
\n ❯ \n
\n
\n
\n '+e()+$(399)+x()+"\n ",t[$(289)][$(260)]("sca-is-visible-fg"),o++}},l=($,x)=>{let e=_0x313639;return $[e(301)]($=>e(400)+($[e(375)]??x)+e(529)+$.variant_shopify_id+e(296)+$[e(283)]+e(510)+d($)+e(493)+f($[e(653)],$.original_variant_shopify_id,$[e(439)]??0)+e(520)+$[e(408)]+e(219))[e(224)](" \n")},d=$=>{let x=_0x313639;return FGSECOMAPP[x(433)][x(507)](m($?.[x(505)]))},f=($,x,e)=>{let t=_0x313639;e=m(e);let a=g(Shopify?.products[$])?null:Shopify?.products[$],i=a?.[t(543)],r=i&&Array[t(389)](i)&&i[t(288)]>0?i[0][t(505)]??a?.price??100*e:100*e;return x&&(r=a?.[t(543)]?.find($=>x===$.id)?.price??r),FGSECOMAPP.formatter[t(507)](r/100)},u=($,x)=>{let e=_0x313639;return g(Shopify?.[e(246)][$])?x??"#":Shopify?.[e(246)][$][e(442)]},p=($,x)=>{let e=_0x313639;if(FGSECOMAPP.fgAppearanceGiftSlider[e(646)])return g(Shopify?.[e(246)][$])?x[e(425)]("\xbb","")[e(425)](/\(\d*% off\)/,"")??"":Shopify?.[e(246)][$][e(451)]},g=$=>{let x=_0x313639;if(0===$)return!0;if(typeof $==x(663)||"boolean"==typeof $)return!1;if(typeof $==x(295)||null===$)return!0;if(typeof $.length!=x(295))return 0===$[x(288)];let e=0;for(let t in $)$[x(305)](t)&&e++;return 0===e},b=$=>{let x=_0x313639;try{let e={...FGSECOMAPP.scaHandleConfigValue},t=e[$];if(t=t?t[x(251)]():null,!g(t)&&t.length>0)try{return document[x(603)](t),", "+t}catch(a){}return""}catch(i){return""}},h=()=>{let $=_0x313639;try{FGSECOMAPP[$(433)]=new Intl.NumberFormat(Shopify?.[$(608)]??Shopify?.[$(385)],{style:$(593),currency:Shopify?.[$(593)]?.[$(657)]??$(478)})}catch(x){FGSECOMAPP[$(433)]=new Intl[$(334)]($(551),{style:"currency",currency:Shopify?.[$(593)]?.[$(657)]??$(478)})}},m=$=>{let x=_0x313639;$=$??0;let e=Shopify?.currency?.[x(311)]??1;return 1===parseFloat(e)?$:($*e)[x(569)](Shopify?.[x(299)]??2)},v=$=>{let x=_0x313639;return $[x(449)]($=>void 0===$[x(430)]||!0===$.cal_gift_for_other_rules)[x(397)](($,e)=>$+e[x(546)]*(e.final_price??e[x(505)]),0)/100},y=$=>{let x=_0x313639;return $[x(449)]($=>void 0===$[x(430)]||$.cal_gift_for_other_rules).reduce(($,e)=>$+e[x(546)],0)},w=($,x)=>{let e=_0x313639,t=x[e(441)];return g(t)?$:$[e(449)]($=>{let x=e;return!t[x(301)](e=>{let t=x;switch(e[t(681)]){case t(589):return Object[t(423)](e[t(537)])[t(301)]($=>$[t(635)]).flat()[t(301)]($=>$.id)[t(220)]($[t(666)]);case t(459):return Object.keys(e[t(537)])[t(220)]($[t(304)]);case t(566):return Object[t(462)](e[t(537)]).includes($[t(225)]);case t(622):let a=Object[t(462)](e[t(537)]),i=$[t(281)]?.map($=>$.id+"")?.[t(449)]($=>a.includes($));return!g(i);default:return!1}})[x(220)](!1)})},k=($,x)=>{let e=_0x313639;return $?.[e(301)]($=>{let t=e;if(typeof $[t(430)]!==t(295)){let a=FGSECOMAPP.arrOfferAdded?.[t(449)](x=>x[t(276)]===$[t(666)]),i=a?.reduce(($,x)=>$+x[t(546)],0);if(i===$[t(546)]){let r=FGSECOMAPP[t(348)]?.filter($=>{let e=t;if($[e(576)]?.[e(337)]()===x[e(337)]())return!1;let a=FGSECOMAPP.offers?.[e(606)](x=>x.id?.toString()===$.belongs_to_offer?.[e(337)]()),i=a[e(638)]??{};return i.cal_gift_for_other_rules&&100!==parseInt(i[e(250)])})?.reduce(($,x)=>$+x[t(546)],0);return{...$,cal_gift_for_other_rules:r>0,quantity:r??0}}return{...$,cal_gift_for_other_rules:!1,quantity:0}}return{...$}})??[]},C=($,x,e)=>{let t=_0x313639,a=0,i=w(x,$);i=k(i,$[t(607)]);let r;return $.unit===t(291)?r=v(i):$[t(504)]===t(615)&&(r=y(i)),r>=$.min_amount&&(null===$[t(675)]||r<=$.max_amount)&&(a=e[t(234)],$[t(308)]&&(a=Math[t(631)](r/$.min_amount)*a)),a},A=($,x,e)=>{let t=_0x313639,a={},i=[],r=0;return x[t(301)](x=>{let a=t,_=C(x,$,e);0!==_&&(r=_),i[a(665)](_>0)}),a[t(355)]=r,a.condition_result=i,a},S=($,x)=>{let e=_0x313639,t=!1;return 1===$[e(288)]?t=$[0]:2===$[e(288)]&&(x===e(272)&&(t=$[0]&&$[1]),"or"===x&&(t=$[0]||$[1])),t},q=($,x)=>{let e=_0x313639,t=$?.[e(301)]($=>$[e(666)]);FGSECOMAPP[e(348)]=FGSECOMAPP[e(348)][e(449)]($=>t?.[e(220)]($[e(276)]));let a=x[e(516)].map($=>$.variant_shopify_id),i=FGSECOMAPP[e(348)][e(449)]($=>$[e(576)]?.[e(337)]()===x.id?.[e(337)]())?.[e(301)]($=>{let x=e;return $[x(276)]}),r=$.filter($=>{let x=e;return c($)&&($[x(430)]=!1),a[x(220)]($[x(666)])&&i[x(220)]($[x(666)])}),_=r[e(301)]($=>{let t=e,a=x.gift_settings;$[t(430)]=a[t(430)],$[t(576)]=x.id?.[t(337)]();let i=FGSECOMAPP[t(348)]?.[t(449)](e=>e[t(576)]?.[t(337)]()!==x.id?.[t(337)]()&&$[t(666)]===e[t(276)])?.[t(397)](($,x)=>$+x[t(546)],0);return{...$,quantity:$[t(546)]-i}});return _[e(449)]($=>$.belongs_to_offer?.toString()===x.id?.toString())},T=$=>{let x=_0x313639,e=$[x(429)][x(449)](e=>e.belongs_to_offer?.[x(337)]()!==$.id?.toString())[x(301)]($=>$[x(447)]);return Object[x(423)]($.gift_products).filter($=>!e[x(220)]($[x(396)]))},E=($,x)=>{let e=_0x313639,t=q($,x),a=A($,x[e(331)],x.gift_settings),i=S(a.condition_result,x[e(488)]);if(i){let r=t[e(449)]($=>$[e(576)]?.[e(337)]()===x.id?.[e(337)]())[e(397)](($,x)=>$+x[e(546)],0);a[e(355)]=a[e(355)]-r,x[e(429)]=t,x[e(628)]=a[e(355)]}else x.giftsAdded=t,x[e(628)]=0;return"number"==typeof FGSECOMAPP[e(255)]&&x[e(637)]>FGSECOMAPP[e(255)]&&(i=!1),i||!x[e(514)]||FGSECOMAPP[e(255)]!==x[e(637)]||g(t)||(FGSECOMAPP[e(255)]=null),x[e(258)]=i,x[e(514)]&&i&&(null==FGSECOMAPP[e(255)]||x[e(637)]<=FGSECOMAPP[e(255)])&&FGSECOMAPP[e(255)]!==x[e(637)]&&(FGSECOMAPP[e(255)]=x[e(637)]),x},P=$=>{let x=_0x313639,e=$+"=",t=decodeURIComponent(document.cookie).split(";");for(let a=0;a{let e=_0x313639,t=!0,a=!0,i=!0;if(!g($.sub_conditions?.specific_link_address)){let r=P(e(221));t=r&&JSON[e(333)](r).includes($.sub_conditions[e(419)])}if(!g($[e(351)]?.[e(621)])){let{customer_tags:_}=$[e(351)],c=_?.[e(403)]?.some($=>x[e(611)].tags?.[e(220)]($));a=_?.[e(266)]==="include"?c:!c}if(!g($[e(351)]?.customer_order_history)){let n=!0,o=$[e(351)].customer_order_history,s=x[e(611)][e(661)]??[];if(o[e(604)]){let l=Date[e(333)](o[e(604)])/1e3;s=s[e(449)]($=>$[e(279)]>=l)}if(!g(o?.[e(432)])&&(0!==o[e(392)][e(367)]||0!==o[e(392)][e(675)])){let d=o[e(392)][e(367)],f=o[e(392)][e(675)],u=s[e(397)](($,x)=>$+x.total_price,0)/100;n&=(u>=d||!d)&&(u<=f||!f)}if(!g(o?.[e(318)])&&(0!==o.total_spent_on_last_order[e(367)]||0!==o.total_spent_on_last_order[e(675)])){let p=x.customer[e(350)]/100,b=o[e(318)].min_amount,h=o[e(318)].max_amount;n&=(p>=b||!b)&&(p<=h||!h)}if(!g(o?.number_of_order)){let m=!(0!==o[e(310)][e(367)]||0!==o[e(310)].max_amount),v=s[e(288)],y=o[e(310)].min_amount,w=o[e(310)][e(675)];n&=m?g(s):(v>=y||!y)&&(v<=w||!w)}if(o?.[e(519)]){let k=x[e(611)].freegifts??[],C=$[e(516)]?.some($=>k[e(220)]($[e(344)]))||$[e(516)]?.[e(424)]($=>k[e(220)]($.original_variant_shopify_id+"_"+($.original_price-$[e(505)])*100));n&=!C}i=n}return t&&a&&i},L=($,x,e)=>{let t=_0x313639,a=[],i=[],r=[],_=[];for(let n of x){let o=E($,n);if(!o[t(258)]){o.giftsAdded.length>0&&o[t(429)][t(300)]($=>{let x=t;i[x(665)]({variant_id:$[x(666)],quantity:$[x(546)],offer_id:n.id})});continue}if(o[t(628)]<0){o[t(429)][t(300)]($=>{let x=t;i[x(665)]({variant_id:$[x(666)],quantity:$[x(546)],offer_id:n.id})});continue}0!==o[t(628)]&&(n.sub_conditions?I(n,SECOMAPP)&&a[t(665)](n):a.push(n))}if($?.[t(300)]($=>{let x=t;g($[x(576)])&&c($)&&i.push({variant_id:$[x(666)],quantity:$.quantity,offer_id:$[x(576)]?.[x(337)]()})}),e||g(i)){let s=a.map($=>{let x=t;return{id:$.id,offerName:$[x(316)],offerPriority:$[x(637)],stopLowerPriority:$[x(514)],gifts:T($),giftsAvailable:$[x(628)],giftsAdded:$[x(429)],isReachConditions:$.isReachConditions}});if(!g(s)){let l={};for(let d of s){let f=j(FGSECOMAPP[t(579)],d);f?.[t(288)]>0?r=r[t(525)]([...f]):d[t(483)].map($=>{let x=t;l[$[x(396)]]={...$,belongs_to_offer:d.id?.toString()}})}_=Object[t(423)](l)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:_}},G=($,x)=>{let e=_0x313639,t=new Set;return $?.[e(300)]($=>t[e(260)]($[e(607)])),t[e(300)]($=>{let x=e,t=FGSECOMAPP[x(480)]?.find(e=>e.id?.[x(337)]()===$?.[x(337)]());if(g(t)||!t[x(258)]){FGSECOMAPP[x(348)]=FGSECOMAPP[x(348)]?.[x(449)](e=>e[x(576)]?.[x(337)]()!==$?.toString());return}if(t.giftsAvailable>=0)return;let a=[],i=FGSECOMAPP[x(348)]?.[x(449)](e=>e[x(576)]?.toString()===$?.[x(337)]())??[];if(t?.[x(638)]?.[x(620)])a=a[x(525)]([...i]),t[x(628)]=0;else for(let r of i){if(t[x(628)]>=0)break;t.giftsAvailable+=r[x(546)],t[x(628)]<=0?a.push({...r}):(r[x(546)]=t[x(628)],t[x(628)]=0)}a?.[x(300)]($=>{let e=x;FGSECOMAPP[e(348)]=FGSECOMAPP[e(348)]?.filter(x=>$[e(276)]!==x[e(276)]||$[e(576)]?.[e(337)]()!==x[e(576)]?.[e(337)]())})}),x?.[e(449)]($=>{let x=e;return c($)&&($[x(546)]=FGSECOMAPP[x(348)]?.[x(449)](e=>$[x(666)]===e[x(276)])?.[x(397)](($,e)=>$+e[x(546)],0)??0),$[x(546)]>0})??[]},O=async($,x)=>{let e=_0x313639,{arrGiftsAdd:t,arrGiftsRemove:a,arrGiftsData:i}=L($,x,!1),r=G(a,$);if(!g(a)){let _=L(r,x,!0);G(_?.[e(673)],$),t=_?.[e(578)],a=a?.[e(525)](_?.[e(673)])??[],i=_?.arrGiftsData}return await n(t,a),i},j=($,x)=>{let e=_0x313639,t=[];if($[e(662)]){let a=x.gifts,i=a[e(397)](($,x)=>$+x[e(543)].length,0),r=FGSECOMAPP.offers[e(449)]($=>$.id===x.id),_=r[0].gift_settings[e(620)],c=r[0][e(398)];if(1===i||_||c[e(527)]){if($.not_show_gift_if_already_on_cart&&!R(a)||$?.[e(654)]&&!N(a))return!1;if(c[e(527)]){if(c[e(681)]===e(635)){let n=FGSECOMAPP[e(249)];n=n[e(449)]($=>{let x=e;return $[x(447)]===a[0].original_product_shopify_id});let o=a[0][e(543)][e(449)]($=>{let x=e;return n[0][x(666)]===$[x(283)]})[0];if(0===o[e(505)]&&100===parseInt(o[e(250)]))return t[e(665)]({variant_id:o[e(344)],quantity:x[e(628)],offer_id:x.id}),t}else if(_){let s=a?.[e(397)](($,x)=>($+x?.[e(543)]?.length)??0,0);if(!s)return!1;let l=(x?.giftsAvailable??0)/s;for(let d of a)for(let f of d.variants)t[e(665)]({variant_id:f[e(344)],quantity:l,offer_id:x.id});return t}}else{if(_){let u=a?.reduce(($,x)=>($+x?.[e(543)]?.length)??0,0);if(!u)return!1;let p=(x?.[e(628)]??0)/u;for(let g of a)for(let b of g.variants)t[e(665)]({variant_id:b.variant_shopify_id,quantity:p,offer_id:x.id});return t}{let h=a[0].variants[0];if(0===h[e(505)]&&100===parseInt(h.discount_percentage))return console[e(411)](e(623)+a[0].variants[0][e(344)]+" "+a[0][e(543)][0][e(408)]),t.push({variant_id:h[e(344)],quantity:x[e(628)],offer_id:x.id}),t}}}}return!1},D=$=>{let x=_0x313639;return $===x(421)},M=$=>{let x=_0x313639,e=$;if(FGSECOMAPP[x(244)][x(548)]===x(242))for(let t of(e=[],$)){let a=t[x(543)];a&&a.length&&a[x(300)]($=>e[x(665)]({...t,thumbnail:$[x(375)],variants:[$]}))}let i=document[x(286)]("fg-gift-items");i&&(i.innerHTML=e[x(301)]($=>{let e=x,t=$?.[e(543)][0]??{};return e(381)+u($[e(653)],$[e(626)])+'" target="_blank">\n \n "+("by_variants"===FGSECOMAPP[e(244)][e(548)]&&FGSECOMAPP.fgAppearanceGiftSlider.show_variant_title?e(357)+(1===$[e(543)][e(288)]?e(346)+(D(t.variant_title)?e(457):"")+e(353)+t.variant_title+e(243):e(332)+(FGSECOMAPP[e(244)][e(434)]??e(563))+"")+e(536):"")+e(253)+f($[e(653)],t?.original_variant_shopify_id,t?.[e(439)])+e(523)+d(t)+"\n \n "+(FGSECOMAPP.fgAppearanceGiftSlider[e(548)]!==e(242)?e(364)+(1===$[e(543)][e(288)]?''+t[e(408)]+e(618):e(332)+(FGSECOMAPP[e(244)][e(434)]??e(563))+e(618))+'\n \n \n