var instafeedApp = (function instafeedLoad(){/*! * Copyright (c) 2023 Mintt Studio * Unauthorized copying, modification, or distribution is prohibited. * For inquiries, contact: business@minttstudio.com */ const e="instafeed.nfcube.com",t="cdn.nfcube.com",i="9.4.2",s=!1;var n=function(){function s(t){this.translations={en:{SHOP_NOW:"Shop now",TAG_PRODUCTS:"Tag products",VIEW_ON_INSTAGRAM:"View on Instagram",HANG_ON:"Hang on we are processing your feed ☕",DELETE:"Delete"},"pt-PT":{SHOP_NOW:"Comprar agora",TAG_PRODUCTS:"Identificar produtos",VIEW_ON_INSTAGRAM:"Ver no Instagram",HANG_ON:"Aguarde, estamos a processar o seu feed ☕",DELETE:"Apagar"},"pt-BR":{SHOP_NOW:"Comprar agora",TAG_PRODUCTS:"Marcar produtos",VIEW_ON_INSTAGRAM:"Ver no Instagram",HANG_ON:"Aguarde, estamos processando seu feed ☕",DELETE:"Delete"},es:{SHOP_NOW:"Comprar ahora",TAG_PRODUCTS:"Etiquetar productos",VIEW_ON_INSTAGRAM:"Ver en Instagram",HANG_ON:"Espera, estamos procesando tu feed ☕",DELETE:"Eliminar"},"ja-JP":{SHOP_NOW:"今すぐ購入",TAG_PRODUCTS:"商品にタグを付ける",VIEW_ON_INSTAGRAM:"Instagramで見る",HANG_ON:"ちょっと待ってください。フィードを処理しています ☕",DELETE:"削除"},fr:{SHOP_NOW:"Acheter",TAG_PRODUCTS:"Étiqueter les produits",VIEW_ON_INSTAGRAM:"Afficher sur Instagram",HANG_ON:"Attendez, nous traitons votre flux ☕",DELETE:"Supprimer"},de:{SHOP_NOW:"Jetzt shoppen",TAG_PRODUCTS:"Produkte taggen",VIEW_ON_INSTAGRAM:"Auf Instagram ansehen",HANG_ON:"Warte, wir verarbeiten deinen Feed ☕",DELETE:"Löschen"},sv:{SHOP_NOW:"Handla nu",TAG_PRODUCTS:"Tagga produkter",VIEW_ON_INSTAGRAM:"Visa på Instagram",HANG_ON:"Vänta, vi bearbetar ditt flöde ☕",DELETE:"Radera"},it:{SHOP_NOW:"Acquista ora",TAG_PRODUCTS:"Tagga prodotti",VIEW_ON_INSTAGRAM:"Visualizza su Instagram",HANG_ON:"Aspetta, stiamo elaborando il tuo feed ☕",DELETE:"Elimina"},da:{SHOP_NOW:"Shop nu",TAG_PRODUCTS:"Tag produkter",VIEW_ON_INSTAGRAM:"Se på Instagram",HANG_ON:"Vent, vi behandler dit feed ☕",DELETE:"Slet"},nl:{SHOP_NOW:"Nu winkelen",TAG_PRODUCTS:"Producten taggen",VIEW_ON_INSTAGRAM:"Bekijk op Instagram",HANG_ON:"Even geduld, we verwerken je feed ☕",DELETE:"Verwijderen"}},this.availableLanguages=["en","es","de","fr","sv","da","it","nl","ja-JP","pt-PT","pt-BR"],this.options={target:"insta-feed",locale:"en",forceUpdate:!1,picturesLoaded:0,picturesNeeded:0,admin:window.location.hostname===e},"undefined"!=typeof Shopify&&Shopify.locale&&this.availableLanguages.includes(Shopify.locale)&&(this.options.locale=Shopify.locale),Object.assign(this.options,t),this.options.admin||this._loadCss(),this._loadRounderCornersCssHack();document.querySelectorAll(".instafeed-lightbox").forEach((e=>{e.parentNode.removeChild(e)}))}return s.prototype.translate=function(e){const t=this.options.locale;return this.translations[t]&&this.translations[t][e]?this.translations[t][e]:e},s.prototype.run=function(){var t=document.getElementById(this.options.target);if(0===t.clientWidth&&parseInt(this.options.autoLayout)>0)return this._checkClientWidth(this,t),!1;parseInt(this.options.autoLayout)>0?(this.options.picturesNeeded=this.options.rows*this._getAutoColumns(t.clientWidth),this._isMobileDevice()&&this._validateCharge(this.options.charge)&&(this.options.picturesNeeded=this.options.rowsMobile*this._getAutoColumns(t.clientWidth))):this._isMobileDevice()&&this._validateCharge(this.options.charge)?this.options.picturesNeeded=this.options.rowsMobile*this.options.columnsMobile:this.options.picturesNeeded=this.options.rows*this.options.columns;const i=this.options.admin?"
"+this.translate("HANG_ON")+"":"";t.innerHTML=`loading bar${i}`;const s=this;return fetch(this._buildUrl()).then((e=>{if(!e.ok)throw new Error(`HTTP error: ${e.status} ${e.statusText}`);return e.json()})).then((e=>{s.parse(e)})).catch((e=>{console.log("Error:",e.message)})),!0},s.prototype.parse=function(t){var i,s,n,o,a,r,d;const l=document.getElementById(this.options.target);if(!l)return console.error("Target element not found"),!1;if("object"!=typeof t)throw new Error("Invalid JSON response");const{meta:{code:p,error_message:c}}=t,u=parseInt(p,10);if(l.innerHTML="",204===u||200!==u)return this.options.admin&&(l.innerHTML=204===u?c:`⚠️ ${c}`,"function"==typeof this.options.error&&this.options.error.call(this,t)),!1;"function"==typeof this.options.success&&this.options.success.call(this,t),r=t.data,i="",s="";var h="standard_resolution",g=parseInt(100-this.options.space),m=0,f=0;f=m=parseInt(this.options.autoLayout)>0?parseFloat(100/this._getAutoColumns(l.clientWidth)).toFixed(6):this._isMobileDevice()&&this._validateCharge(this.options.charge)?parseFloat(100/this.options.columnsMobile).toFixed(6):parseFloat(100/this.options.columns).toFixed(6),parseInt(this.options.layout)>=2&&(f=parseFloat(m*(16/9)).toFixed(6));var v,w="",y="";this._validateCharge(this.options.charge)&&parseInt(this.options.likes)>0&&4!==parseInt(this.options.apiVersion)&&(w="
{{likes}}\x3c!-- {{comments}}--\x3e
",y=" {{likes}} \x3c!--❞ {{comments}}--\x3e");var b="
{{containerContent}}"+("
"+w+"
")+"
",_="",I="";for(1===parseInt(this.options.openIg)?b=""+b+"":3===parseInt(this.options.openIg)&&(this.options.admin&&(I="
<
"),_="
"),n=0,d=r.length;n0&&this._validateCharge(this.options.charge)){var N,O,A=this.options.admin,L=this.options.shopOrigin,x=this.options.target;o.tagged_products.forEach((t=>{if(t.translations&&this.options.locale in t.translations){let e=this.options.locale;"title"in t.translations[e]&&""!==t.translations[e].title.trim()&&(t.title=t.translations[e].title)}A?(N="",O="
product image
"):(N="",O="
product image
"),E+="
"+O+"
"+N+"
"}))}var C="";"video"===o.type&&o.hasOwnProperty("videos")?(C="instafeed-video",imageFullHtml=''):imageFullHtml="Instagram post with the caption: "+this._escapeHtml(this._getObjectProperty(o,"caption.text").substring(0,64))+"...",v="video"===o.type&&parseInt(this.options.autoplay)>0?'':"Instagram post with the caption: "+this._escapeHtml(this._getObjectProperty(o,"caption.text").substring(0,64))+"...";var M=this.options.picturesLoaded-1;1===this.options.picturesLoaded&&(M=Math.min(this.options.picturesNeeded,r.length));var P=this.options.picturesLoaded===this.options.picturesNeeded||this.options.picturesLoaded===r.length?1:this.options.picturesLoaded+1;if(i+=this._makeTemplate(b,{model:o,id:this.options.picturesLoaded,fullId:o.id,minusId:M,plusId:P,link:o.link,image:a.url,video:C,username:o.user.username,fullName:o.user.full_name,userPicture:5===this.options.apiVersion?o.user.profile_picture:"https://"+e+"/assets/img/logo-instagram-transparent.png",imageFullHtml:imageFullHtml,taggedProduct:E,containerContent:v,date:this._timeConverter(o.created_time),caption:this._escapeHtml(this._getObjectProperty(o,"caption.text")),likes:this._shortenLargeNumber(o.likes.count,1),comments:this._shortenLargeNumber(o.comments.count,1),location:this._getObjectProperty(o,"location.name")}),s+=this._makeTemplate(_,{model:o,id:this.options.picturesLoaded,fullId:o.id,minusId:M,plusId:P,link:o.link,image:a.url,video:C,username:o.user.username,fullName:o.user.full_name,userPicture:5===this.options.apiVersion?o.user.profile_picture:"https://"+e+"/assets/img/logo-instagram-transparent.png",imageFullHtml:imageFullHtml,taggedProduct:E,date:this._timeConverter(o.created_time),caption:this._escapeHtml(this._getObjectProperty(o,"caption.text")),likes:this._shortenLargeNumber(o.likes.count,1),comments:this._shortenLargeNumber(o.comments.count,1),location:this._getObjectProperty(o,"location.name")}),this.options.picturesLoaded>=this.options.picturesNeeded||t.data.length===this.options.picturesLoaded)break}if(l.innerHTML="",this._appendHtmlToParent(s),4!==parseInt(this.options.layout)&&5!==parseInt(this.options.layout)){const e=document.createDocumentFragment();this._appendHtmlToParent(i,e),l.appendChild(e)}else window.instafeedSliderNumVisibleImages=parseInt(100/m),window.instafeedSliderTotalImages=this.options.picturesLoaded,l.innerHTML+=this._generateCarouselHTML(r,this._escapeHtml),this._setNumVisibleImages(),l.addEventListener("swiped-left",(function(e){instafeedSliderMove(1,this.options.feedId)})),l.addEventListener("swiped-right",(function(e){instafeedSliderMove(-1,this.options.feedId)}));return this._setFeedHeader(S,T),this._changeMobileDOM(),this._enableLazyLoading(),this._observeAndPlayVideos(),!0},s.prototype._changeMobileDOM=function(){if(this._isMobileDevice(!0)){document.querySelectorAll(".instafeed-post-image").forEach((e=>{const t=e.nextElementSibling,i=t?t.querySelector(".instafeed-header"):null;i&&e.parentNode.insertBefore(i,e)}))}},s.prototype._setFeedHeader=function(e,t){const i=document.getElementById(this.options.target),s=this._validateCharge(this.options.charge)&&5===parseInt(this.options.apiVersion)&&(1===parseInt(this.options.showFollowers)||3===parseInt(this.options.showFollowers)),n=this._validateCharge(this.options.charge)&&5===parseInt(this.options.apiVersion)&&parseInt(this.options.showFollowers)>1,o=s?`

${this._shortenLargeNumber(e)} followers

`:"",a=this.options.title.length>0||"undefined"!=typeof instafeedLocalTitle&&instafeedLocalTitle.length>0;let r="";if(n&&(r+=``),a){r+=`

${"undefined"!=typeof instafeedLocalTitle&&instafeedLocalTitle.length>0?instafeedLocalTitle:this.options.title}

`}s&&(r+=o),(a||s)&&this._appendHtmlToParent(r,i,i.firstChild)},s.prototype._setNumVisibleImages=function(){const e=document.getElementById(this.options.target).offsetWidth,t=e/instafeedSliderNumVisibleImages,i=5===parseInt(this.options.layout)?parseFloat(t*(16/9)).toFixed(6):t;document.querySelectorAll(".instafeed-new-carousel-item").forEach((e=>{e.style.width=`${t}px`,e.style.height=`${i}px`}));const s=document.querySelector(".instafeed-new-carousel-container");s.style.width=`${e}px`,s.style.height=`${i}px`,window.instafeedSliderStepSize=instafeedSliderNumVisibleImages*t},s.prototype._generateCarouselHTML=function(e){let t="",i=0;for(let s of e)i++,t+=this._imageTemplate(s,i);let s="";return i>instafeedSliderNumVisibleImages&&(s=`\n \n \n `),`\n `},s.prototype._imageTemplate=function(t,i){let s=t.images.standard_resolution,n=parseInt(100-this.options.space,10),o=this._escapeHtml(t.caption.text).substring(0,64),a="";const r=this._generateIcon(t);a="video"===t.type&&parseInt(this.options.autoplay,10)>0?`\n \n `:`\n Instagram post with the caption: '${o}...'\n `;return`\n `},s.prototype._generatePostUrl=function(e,t,i){const s=parseInt(this.options.openIg,10);return 1===s?`${e}`:3===s?`${e}`:e},s.prototype._generateIcon=function(t){if(parseInt(this.options.likes)>0&&5===parseInt(this.options.apiVersion))return`\n ${this._shortenLargeNumber(t.likes.count,1)}`;{const i="video"===t.type?"video-icon-v2.svg":"instagram-icon-v2.svg";return`hover icon`}},s.prototype._appendHtmlToParent=function(e,t=document.body,i=null){const s=document.createElement("template");for(s.innerHTML=e;s.content.firstChild;)t.insertBefore(s.content.firstChild,i)},s.prototype._buildUrl=function(){let t,i,s="";if(i=this.options.forceUpdate?1:0,window.location.pathname.includes("/products/")){let e=window.location.pathname.substring(window.location.pathname.indexOf("/products/")+10);e.length>0&&(s="&handle="+e)}return t="https://"+e+"/feed/v"+this.options.apiVersion+"?limit="+this.options.picturesNeeded+"&account="+this.options.shopOrigin+"&fu="+i+"&fid="+this.options.feedId+"&hash="+this.options.hash+"&locale="+this.options.locale+s+"&admin="+ +this.options.admin,t},s.prototype._makeTemplate=function(e,t){return e.replace(/{{([\w[\].]+)}}/g,((e,i)=>{const s=this._getObjectProperty(t,i);return null!==s?s:""}))},s.prototype._getObjectProperty=function(e,t){const i=(t=t.replace(/\[(\w+)\]/g,".$1")).split(".");for(const t of i){if(null===e||!(t in e))return null;e=e[t]}return e},s.prototype._validateCharge=function(e){return parseInt(e)>0},s.prototype._getAutoColumns=function(e){return e<480?2:e<768?3:e<1024?4:e<=1200?5:6},s.prototype._escapeHtml=function(e){return e&&(e=e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")),e},s.prototype._shortenLargeNumber=function(e,t){const i=["k","M","G","T","P","E","Z","Y"];for(let s=i.length-1;s>=0;s--){const n=Math.pow(1e3,s+1);if(e<=-n||e>=n)return+(e/n).toFixed(t)+i[s]}return e},s.prototype._timeConverter=function(e){return new Date(1e3*e).toLocaleDateString(navigator.language,{month:"long",day:"numeric"})},s.prototype._isMobileDevice=function(e=!1){return!(!this.options.admin||this.options.desktopPreview||!1!==e)||(!this.options.admin||!this.options.desktopPreview||!1!==e)&&window.matchMedia("only screen and (max-width: 768px)").matches},s.prototype._checkClientWidth=function(e,t){0===t.clientWidth?setTimeout((()=>{e._checkClientWidth(e,t)}),100):e.run()},s.prototype._loadCss=function(){if(document.currentScript&&!document.currentScript.src.includes(t)&&!document.currentScript.src.includes(e))return!1;const s=document.createElement("link");s.href=`https://${e}/cdn/instafeed-${i}.css`,s.type="text/css",s.rel="stylesheet",s.media="screen,print",document.head.appendChild(s)},s.prototype._loadRounderCornersCssHack=function(){const e=parseInt(this.options.corners),t=parseInt(this.options.layout);e>0&&4!==t&&5!==t&&document.documentElement.style.setProperty("--instafeed-border-radius",`${e}px`)},s.prototype._enableLazyLoading=function(){const e=document.querySelectorAll(".js-lazy-image"),t={rootMargin:"100px 0px",threshold:.01};let i,s=e.length;function n(e){const t=e.dataset.src;var i;if(t.includes("https://"))return(i=t,new Promise(((e,t)=>{const s=new Image;s.src=i,s.onload=e,s.onerror=t}))).then((()=>{!function(e,t){e.classList.add("js-lazy-image--handled"),e.src=t}(e,t)})).catch((e=>{console.log(e)}))}"IntersectionObserver"in window&&e.length?(i=new IntersectionObserver((function(e){0===s&&i.disconnect();e.forEach((e=>{e.intersectionRatio>0&&(s--,i.unobserve(e.target),n(e.target))}))}),t),e.forEach((e=>{e.classList.contains("js-lazy-image--handled")||i.observe(e)}))):function(e){e.forEach((e=>n(e)))}(e)},s.prototype._observeAndPlayVideos=function(){const e=parseInt(this.options.autoplay),t=e=>{e&&e.play()};if(1===e){const e=document.querySelectorAll(".auto-loop-videos");if(!("IntersectionObserver"in window))return void console.warn("IntersectionObserver not supported. Videos will not autoplay.");const i=new IntersectionObserver(((e,i)=>{e.forEach((e=>{e.isIntersecting&&(t(e.target),i.unobserve(e.target))}))}),{threshold:.5});e.forEach((e=>i.observe(e)))}if(2===e){document.querySelectorAll(".instafeed-hover-layer, .instafeed-overlay").forEach((e=>{const i=i=>{const s=(e=>document.getElementById(`inline-video-${e}-instafeed`))(e.getAttribute("data-instafeed-open-id").split("-")[0]);var n;i?(t(s),e.style.opacity=0):((n=s)&&n.pause(),e.style.opacity=1)};e.addEventListener("mouseover",(()=>i(!0))),e.addEventListener("mouseout",(()=>i(!1))),e.addEventListener("touchstart",(()=>i(!0))),e.addEventListener("touchend",(()=>i(!1)))}))}},s}();!function(e,t){e.Instafeed=n}(this),function(){var e,t;function i(e){return`video-${String(e).split("-")[0]}-instafeed`}function n(t){const i=document.getElementById(t);i&&(i.style.setProperty("display","none","important"),document.body.style.overflowY="visible",instafeedModalOpen=null,document.removeEventListener("keydown",e,!1))}window.instafeedModalOpen=null,document.addEventListener("click",(function(o){if(!o.target||!o.target.hasAttribute("data-instafeed-open-id")&&!o.target.hasAttribute("data-instafeed-close-id"))return!1;var a=o.target.hasAttribute("data-instafeed-open-id")?o.target.getAttribute("data-instafeed-open-id"):o.target.getAttribute("data-instafeed-close-id"),r=document.getElementById(i(t)),d=document.getElementById(i(a));if(d&&(d.onplay=()=>{null===instafeedModalOpen&&d.pause()}),r&&r.pause(),o.target.hasAttribute("data-instafeed-open-id")){const t=document.getElementById(a);if(t){instafeedModalOpen&&n(instafeedModalOpen),instafeedModalOpen=a,t.style.setProperty("display","block","important"),document.body.style.overflowY="hidden",d&&d.play();const i=".instafeed-new-arrow",{firstFocusableElement:o,lastFocusableElement:r}=function(e,t){const i=e.querySelectorAll(t),s=i[0],n=i[i.length-1];return{firstFocusableElement:s,lastFocusableElement:n}}(t,i);e=e=>{!function(e,t,i){s;let n="Tab"===e.key||9===e.keyCode;if(!n)return;e.shiftKey?e.target===t&&(i.focus(),e.preventDefault()):e.target===i&&(t.focus(),e.preventDefault())}(e,o,r)},document.addEventListener("keydown",e,!1),t.focus()}}o.target.hasAttribute("data-instafeed-close-id")&&n(a),t=a})),window.addEventListener("keydown",(e=>{const{key:t}=e;if("Escape"===t)instafeedModalOpen&&n(instafeedModalOpen);else if("Enter"===e.key){const e=document.activeElement;(e.classList.contains("instafeed-new-arrow")||e.classList.contains("instafeed-close-button"))&&e.click()}var i=document.getElementById(instafeedModalOpen);if(i){var s="";if("ArrowLeft"===t?s=".instafeed-new-arrow.prev":"ArrowRight"===t&&(s=".instafeed-new-arrow.next"),s){var o=i.querySelector(s);o&&o.click()}}}))}(),window.instafeedSlidersState={},window.instafeedSliderMove=(e,t=0)=>{instafeedSlidersState[t]||(instafeedSlidersState[t]={currentTransform:0,minTransform:0});const i=instafeedSlidersState[t],s=Math.ceil(instafeedSliderTotalImages/instafeedSliderNumVisibleImages)-1,n=instafeedSliderStepSize*s;i.currentTransform+=e*-instafeedSliderStepSize,i.currentTransform<-n&&(i.currentTransform=i.minTransform),i.currentTransform>i.minTransform&&(i.currentTransform=-n),document.querySelector(`.instafeed-new-carousel-wrapper[data-feed-id="${t}"]`).style.transform=`translateX(${i.currentTransform}px)`},function(e,t){"use strict";"function"!=typeof e.CustomEvent&&(e.CustomEvent=function(e,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var s=t.createEvent("CustomEvent");return s.initCustomEvent(e,i.bubbles,i.cancelable,i.detail),s},e.CustomEvent.prototype=e.Event.prototype),t.addEventListener("touchstart",(function(e){"true"!==e.target.getAttribute("data-swipe-ignore")&&(r=e.target,a=Date.now(),i=e.touches[0].clientX,s=e.touches[0].clientY,n=0,o=0)}),!1),t.addEventListener("touchmove",(function(e){if(i&&s){var t=e.touches[0].clientX,a=e.touches[0].clientY;n=i-t,o=s-a}}),!1),t.addEventListener("touchend",(function(e){if(r===e.target){var l=parseInt(d(r,"data-swipe-threshold","20"),10),p=d(r,"data-swipe-unit","px"),c=parseInt(d(r,"data-swipe-timeout","500"),10),u=Date.now()-a,h="",g=e.changedTouches||e.touches||[];if("vh"===p&&(l=Math.round(l/100*t.documentElement.clientHeight)),"vw"===p&&(l=Math.round(l/100*t.documentElement.clientWidth)),Math.abs(n)>Math.abs(o)?Math.abs(n)>l&&u0?"swiped-left":"swiped-right"):Math.abs(o)>l&&u0?"swiped-up":"swiped-down"),""!==h){var m={dir:h.replace(/swiped-/,""),touchType:(g[0]||{}).touchType||"direct",xStart:parseInt(i,10),xEnd:parseInt((g[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((g[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:m})),r.dispatchEvent(new CustomEvent(h,{bubbles:!0,cancelable:!0,detail:m}))}i=null,s=null,a=null}}),!1);var i=null,s=null,n=null,o=null,a=null,r=null;function d(e,i,s){for(;e&&e!==t.documentElement;){var n=e.getAttribute(i);if(n)return n;e=e.parentNode}return s}}(window,document);if (document.getElementById('insta-feed') !== null) {var feed = new Instafeed({ account: '', hash: 'e7417e7f0da6fe61850a7598725e5a46', apiVersion: 4, shopOrigin: 'ferne-boutique.myshopify.com', title: '@ FOLLOW US ON INSTAGRAM', openIg: 1, space: 1, corners: 0, likes: 1, showFollowers: 0, layout: 0, filter: '', public: 0, columns: 6, columnsMobile: 6, rows: 1, rowsMobile: 1, autoplay: 0, autoLayout: 0, feedId: 0, charge: '0' });feed.run();}return instafeedLoad;})();window.addEventListener('resize', ((lastWidth) => () => window.innerWidth !== lastWidth && (lastWidth = window.innerWidth, instafeedApp()))(window.innerWidth));document.addEventListener('shopify:section:load',()=>{instafeedApp()});