@fynd-design-engineering/fynd-one-v2 3.3.58 → 3.3.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let l=window.gsap;if(!l){console.error("GSAP is not loaded. Please ensure the GSAP CDN is included.");return}let d=document.querySelector('[data-popup-video="wrapper"]'),r=document.querySelector('[data-popup-video="content"]'),c=document.querySelector('[data-popup-video="overlay"]'),f=document.querySelectorAll('[data-popup-video-trigger="open"]'),v=document.querySelectorAll('[data-popup-video-trigger="close"]');if(d||console.error('Missing [data-popup-video="wrapper"] element.'),r||console.error('Missing [data-popup-video="content"] element.'),c||console.error('Missing [data-popup-video="overlay"] element.'),f.length||console.warn('No [data-popup-video="open-trigger"] elements found.'),v.length||console.warn('No [data-popup-video="close-trigger"] elements found.'),!d||!r||!c)return;l.set(d,{display:"none"}),l.set([c,r],{opacity:0}),l.set(r,{scale:.9});let u=null,s=null;function b(e){try{let o=new URL(e);if(o.hostname.includes("youtube.com")){if(o.searchParams.get("v"))return o.searchParams.get("v");let t=o.pathname.split("/").filter(Boolean),i=t.indexOf("embed");if(i!==-1&&t[i+1])return t[i+1]}if(o.hostname==="youtu.be"){let t=o.pathname.split("/").filter(Boolean);if(t[0])return t[0]}return null}catch{return null}}let m=null;function E(){return window.YT&&window.YT.Player?Promise.resolve():m||(m=new Promise(e=>{let o="onYouTubeIframeAPIReady",t=window;if(t.YT&&t.YT.Player){e();return}let i=document.createElement("script");i.src="https://www.youtube.com/iframe_api",i.async=!0;let n=t[o];t[o]=function(){typeof n=="function"&&n(),e()},document.head.appendChild(i)}),m)}function y(){if(u&&typeof u.destroy=="function")try{u.stopVideo?.(),u.destroy()}catch{}u=null,s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function g(){if(!r)return;let e=r.querySelector('video[data-popup-video="injected"]');if(e){try{e.pause(),e.removeAttribute("src"),e.querySelectorAll("source").forEach(o=>o.remove()),e.load()}catch{}e.remove()}}function T(e,o){let t=!!(e&&e.trim()),i=!!(o&&o.trim());if(!t&&!i)return console.error("openVideoModal requires at least one of linkMP4 or linkWebm when no YouTube URL is provided."),null;let n=document.createElement("video");if(n.setAttribute("data-popup-video","injected"),n.setAttribute("playsinline",""),n.setAttribute("controls",""),n.setAttribute("autoplay",""),i){let a=document.createElement("source");a.src=o.trim(),a.type="video/webm",n.appendChild(a)}if(t){let a=document.createElement("source");a.src=e.trim(),a.type="video/mp4",n.appendChild(a)}return n}async function w(e,o,t){if(!d||!r||!c){console.error("Modal elements missing. Cannot open modal.");return}y(),g();let i=!!(t&&t.trim()),n=!0;if(i){let a=b(t.trim());if(!a)console.error("Invalid YouTube URL on trigger."),n=!1;else{s=document.createElement("div"),s.setAttribute("data-popup-video","youtube-container"),s.style.width="100%",s.style.aspectRatio="16 / 9",r.appendChild(s);try{await E(),u=new window.YT.Player(s,{width:"100%",height:"100%",videoId:a,playerVars:{autoplay:1,controls:1,rel:0,modestbranding:1,playsinline:1,origin:window.location.origin},events:{onReady:p=>{try{p.target.unMute?.(),p.target.setVolume?.(100),p.target.playVideo?.()}catch{}}}})}catch(p){console.error("Failed to initialize YouTube player:",p),y(),n=!1}}}else{let a=T(e,o);a?r.appendChild(a):n=!1}n&&(l.set([c,r],{opacity:0}),l.set(r,{scale:.9}),l.set(d,{display:"flex"}),l.to(c,{opacity:1,duration:.3,ease:"power2.out"}),l.to(r,{opacity:1,scale:1,duration:.35,delay:.3,ease:"power2.out"}),console.log("Video modal opened."))}function h(){if(!d||!r||!c){console.error("Modal elements missing. Cannot close modal.");return}l.timeline({defaults:{ease:"power2.inOut"},onComplete:()=>{y(),g(),l.set(d,{display:"none"}),console.log("Video modal closed.")}}).to(r,{opacity:0,scale:.9,duration:.25},0).to(c,{opacity:0,duration:.25},0)}f.forEach(e=>e.addEventListener("click",()=>{if(!d){console.error("Wrapper not found. Cannot open modal.");return}let o=e.getAttribute("data-video-mp4"),t=e.getAttribute("data-video-webm"),i=e.getAttribute("data-youtube-url");w(o,t,i)})),v.forEach(e=>e.addEventListener("click",()=>{if(!d){console.error("Wrapper not found. Cannot close modal.");return}h()})),window.openVideoModal=w,window.closeVideoModal=h});})();
1
+ "use strict";(()=>{function b(){return window.location.hostname==="fynd-one-master.webflow.io"}document.addEventListener("DOMContentLoaded",()=>{let l=window.gsap;if(!l){console.error("GSAP is not loaded. Please ensure the GSAP CDN is included.");return}let d=document.querySelector('[data-popup-video="wrapper"]'),r=document.querySelector('[data-popup-video="content"]'),c=document.querySelector('[data-popup-video="overlay"]'),f=document.querySelectorAll('[data-popup-video-trigger="open"]'),g=document.querySelectorAll('[data-popup-video-trigger="close"]');if(b()&&(d||console.error('Missing [data-popup-video="wrapper"] element.'),r||console.error('Missing [data-popup-video="content"] element.'),c||console.error('Missing [data-popup-video="overlay"] element.')),f.length||console.warn('No [data-popup-video="open-trigger"] elements found.'),g.length||console.warn('No [data-popup-video="close-trigger"] elements found.'),!d||!r||!c)return;l.set(d,{display:"none"}),l.set([c,r],{opacity:0}),l.set(r,{scale:.9});let u=null,s=null;function E(e){try{let t=new URL(e);if(t.hostname.includes("youtube.com")){if(t.searchParams.get("v"))return t.searchParams.get("v");let o=t.pathname.split("/").filter(Boolean),i=o.indexOf("embed");if(i!==-1&&o[i+1])return o[i+1]}if(t.hostname==="youtu.be"){let o=t.pathname.split("/").filter(Boolean);if(o[0])return o[0]}return null}catch{return null}}let m=null;function T(){return window.YT&&window.YT.Player?Promise.resolve():m||(m=new Promise(e=>{let t="onYouTubeIframeAPIReady",o=window;if(o.YT&&o.YT.Player){e();return}let i=document.createElement("script");i.src="https://www.youtube.com/iframe_api",i.async=!0;let n=o[t];o[t]=function(){typeof n=="function"&&n(),e()},document.head.appendChild(i)}),m)}function y(){if(u&&typeof u.destroy=="function")try{u.stopVideo?.(),u.destroy()}catch{}u=null,s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function v(){if(!r)return;let e=r.querySelector('video[data-popup-video="injected"]');if(e){try{e.pause(),e.removeAttribute("src"),e.querySelectorAll("source").forEach(t=>t.remove()),e.load()}catch{}e.remove()}}function M(e,t){let o=!!(e&&e.trim()),i=!!(t&&t.trim());if(!o&&!i)return console.error("openVideoModal requires at least one of linkMP4 or linkWebm when no YouTube URL is provided."),null;let n=document.createElement("video");if(n.setAttribute("data-popup-video","injected"),n.setAttribute("playsinline",""),n.setAttribute("controls",""),n.setAttribute("autoplay",""),i){let a=document.createElement("source");a.src=t.trim(),a.type="video/webm",n.appendChild(a)}if(o){let a=document.createElement("source");a.src=e.trim(),a.type="video/mp4",n.appendChild(a)}return n}async function w(e,t,o){if(!d||!r||!c){console.error("Modal elements missing. Cannot open modal.");return}y(),v();let i=!!(o&&o.trim()),n=!0;if(i){let a=E(o.trim());if(!a)console.error("Invalid YouTube URL on trigger."),n=!1;else{s=document.createElement("div"),s.setAttribute("data-popup-video","youtube-container"),s.style.width="100%",s.style.aspectRatio="16 / 9",r.appendChild(s);try{await T(),u=new window.YT.Player(s,{width:"100%",height:"100%",videoId:a,playerVars:{autoplay:1,controls:1,rel:0,modestbranding:1,playsinline:1,origin:window.location.origin},events:{onReady:p=>{try{p.target.unMute?.(),p.target.setVolume?.(100),p.target.playVideo?.()}catch{}}}})}catch(p){console.error("Failed to initialize YouTube player:",p),y(),n=!1}}}else{let a=M(e,t);a?r.appendChild(a):n=!1}n&&(l.set([c,r],{opacity:0}),l.set(r,{scale:.9}),l.set(d,{display:"flex"}),l.to(c,{opacity:1,duration:.3,ease:"power2.out"}),l.to(r,{opacity:1,scale:1,duration:.35,delay:.3,ease:"power2.out"}),console.log("Video modal opened."))}function h(){if(!d||!r||!c){console.error("Modal elements missing. Cannot close modal.");return}l.timeline({defaults:{ease:"power2.inOut"},onComplete:()=>{y(),v(),l.set(d,{display:"none"}),console.log("Video modal closed.")}}).to(r,{opacity:0,scale:.9,duration:.25},0).to(c,{opacity:0,duration:.25},0)}f.forEach(e=>e.addEventListener("click",()=>{if(!d){console.error("Wrapper not found. Cannot open modal.");return}let t=e.getAttribute("data-video-mp4"),o=e.getAttribute("data-video-webm"),i=e.getAttribute("data-youtube-url");w(t,o,i)})),g.forEach(e=>e.addEventListener("click",()=>{if(!d){console.error("Wrapper not found. Cannot close modal.");return}h()})),window.openVideoModal=w,window.closeVideoModal=h});})();
@@ -1 +1 @@
1
- "use strict";(()=>{async function h(){try{let e=await fetch("https://ipwho.is/");if(!e.ok)throw new Error("Failed to fetch geolocation");let n=await e.json();return n.success===!1?(console.error("Geolocation lookup failed:",n.message),null):{ip:n.ip,country:n.country,region:n.region,city:n.city,latitude:n.latitude,longitude:n.longitude,isp:n.connection?.isp||"",timezone:n.timezone?.id||""}}catch(e){return console.error("Error fetching geolocation:",e),null}}var b="geo:data:v1",d="geo_country",g=7*24*60*60*1e3;function w(e,n,t){document.cookie=`${encodeURIComponent(e)}=${encodeURIComponent(n)}; Max-Age=${t}; Path=/; SameSite=Lax; Secure`}function C(e){let n=`${encodeURIComponent(e)}=`,t=document.cookie.split("; ");for(let o of t)if(o.startsWith(n))return decodeURIComponent(o.slice(n.length));return null}function A(e){try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);return!t?.expiresAt||Date.now()>t.expiresAt?(localStorage.removeItem(e),null):t.data}catch{return localStorage.removeItem(e),null}}function B(e,n,t){let o={data:n,expiresAt:Date.now()+t};try{localStorage.setItem(e,JSON.stringify(o))}catch{}}async function f(e){if(typeof window>"u")return null;if(!(e?.forceRefresh??!1)){let o=A(b);if(o)return window.__GEO=o,C(d)||w(d,o.country??"",Math.floor(g/1e3)),o}let t=null;try{t=await h()}catch(o){console.warn("getGeolocation() failed; defaulting to India:",o)}return t||(t={country:"India"}),B(b,t,g),w(d,t.country??"",Math.floor(g/1e3)),window.__GEO=t,t}function v(){return C(d)}function x(e,n,t="auto"){let r=(window||{}).gsap;if(!r){console.warn("GSAP not found on window. Did you include it globally?");return}let i=document.querySelector(e),u=document.querySelector(n);if(!i||!u){console.warn("openBanner: Element(s) not found for selectors:",{mainSelector:e,innerSelector:n});return}r.set(i,{height:0,overflow:"hidden"}),r.set(u,{opacity:0});let s=r.timeline();return s.to(i,{height:t,duration:.5,ease:"power2.out"}),s.to(u,{opacity:1,duration:.3,ease:"power1.out"},.2),s}function S(e,n,t=0){let r=(window||{}).gsap;if(!r){console.warn("GSAP not found on window. Did you include it globally?");return}let i=document.querySelector(e),u=document.querySelector(n);if(!i||!u){console.warn("closeBanner: Element(s) not found for selectors:",{mainSelector:e,innerSelector:n});return}r.set(i,{overflow:"hidden"});let s=r.timeline();return s.to(u,{opacity:0,duration:.25,ease:"power1.out"}),s.to(i,{height:t,duration:.45,ease:"power2.inOut"},.2),s}function E(e,n,t){let o=new Date;o.setTime(o.getTime()+t*60*60*1e3),document.cookie=`${e}=${n}; expires=${o.toUTCString()}; path=/`}function T(e){let n=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return n?n[2]:null}function m(){let e=window.innerWidth;return e>=992?"desktop":e>=768?"tablet":e>=480?"mobileLandscape":"mobilePortrait"}var l=[{country:"united arab emirates",aliases:["uae","u.a.e","united arab emirates"],countryCode:"ae",url:"/ae",tagline:"You're in the UAE. Welcome!"},{country:"saudi arabia",aliases:["saudi","ksa","kingdom of saudi arabia"],countryCode:"sa",url:"/sa",tagline:"Hello Saudi Arabia!"},{country:"south africa",aliases:["rsa"],countryCode:"za",url:"/za",tagline:"Hi South Africa!"},{country:"malaysia",countryCode:"my",url:"/my",tagline:"Selamat datang, Malaysia!"},{country:"indonesia",aliases:["idn"],countryCode:"id",url:"/id",tagline:"Halo Indonesia!"},{country:"philippines",aliases:["phl","the philippines"],countryCode:"ph",url:"/ph",tagline:"Kumusta, Philippines!"},{country:"india",aliases:["bharat"],countryCode:"in",url:"/in",tagline:"This country is India. Hi some text"},{country:"global",aliases:["global","rest of world","others"],countryCode:"global",url:"/global",tagline:"This is rest of world. Hi some text"}];function c(e){return(e??"").trim().toLowerCase()}function k(e){let n=e.trim();return n?n.startsWith("/")?n:`/${n}`:"/"}async function $(){if(typeof window>"u")return null;let e=v();if(e)return c(e);let n=await f();return c(n?.country)}function L(e){let n=c(e);if(!n)return null;let t=l.find(i=>c(i.countryCode)===n);if(t)return t;let o=l.find(i=>c(i.country)===n);if(o)return o;let r=l.find(i=>(i.aliases??[]).some(u=>c(u)===n));return r||null}function p(){let e=l.find(n=>n.country==="global");if(!e)throw new Error("[geo-banner] Global config not found in COUNTRY_CONFIG");return e}function N(e){if(typeof window>"u")return;let n=c(e),t=l.find(r=>c(r.countryCode)===n)||p(),o=document.querySelector('[fynd-banner-field="link"]');if(o){let r=window.location.origin;o.href=`${r}${k(t.url)}`}}function R(e,n){let t=L(n)??l.find(s=>s.country==="global");if(!t)return console.warn("[geo-banner] No matching config for",n),!1;let o=t.countryCode,r=Array.from(e.options),i=r.find(s=>c(s.value)===c(o));if(!i)return console.warn("[geo-banner] No matching <option> for",o,"on",e),!1;let u=e.value;return e.value=i.value,e.value!==i.value&&(e.selectedIndex=r.indexOf(i)),r.forEach(s=>s.selected=s===i),u!==e.value&&(e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))),console.log("[geo-banner] Select updated \u2192",t.country,"(",t.countryCode,")"),!0}function q(e){if(typeof window>"u")return;let n=c(e),t=l.find(i=>c(i.countryCode)===n)||p(),o=document.querySelector("#geoswitch-select")||document.querySelector('[fynd-banner-field="geoswitch"]');o?(console.log(`country code is ${t.countryCode}`),R(o,t.countryCode),o.value=t.countryCode,o.dispatchEvent(new Event("change",{bubbles:!0}))):console.warn('[geo-banner] Select not found: #geoswitch-select / [fynd-banner-field="geoswitch"]');let r=document.querySelector('[fynd-banner-field="link"]');if(r){let i=window.location.origin;r.href=`${i}${k(t.url)}`}}async function G(){if(typeof window>"u")return p();document.readyState==="loading"&&await new Promise(r=>{document.addEventListener("DOMContentLoaded",()=>r(),{once:!0})});let e=await $(),t=L(e)??p();console.log("[geo-banner] rawCountry:",e,"\u2192 resolved:",t.countryCode),q(t.countryCode);let o=document.querySelector('[fynd-banner-field="geoswitch"]');return o&&!o.__geoHandlerAttached&&(o.addEventListener("change",r=>{let i=r.target.value;N(i)}),o.__geoHandlerAttached=!0),t}var I={"/global":{mode:"country",countries:["India"]},"/":{mode:"notCountry",countries:["India"]}},M='[fynd-navigation="ip-banner"]',D='[fynd-navigation="ip-banner-inner"]',F='[fynd-navigation="ip-banner-close"]',se=document.querySelector('[fynd-navigation="announcement-bar"]'),ce=document.querySelector('[fynd-navigation="announcement-list"]'),a={ipbanner:{visibility:!1,height:{desktop:"56px",tablet:"60px",mobileLandscape:"120px",mobilePortrait:"120px"}},announcementbar:{visibility:!1,height:{desktop:"40px",tablet:"40px",mobileLandscape:"40px",mobilePortrait:"46px"}},default:{visibility:!0,height:{desktop:"70px",tablet:"64px",mobileLandscape:"40px",mobilePortrait:"64px"}}};window.navigationData=a;function y(e,n){let t=o=>{if(typeof o=="number")return o;let r=parseInt(o,10);return isNaN(r)?0:r};return`${t(e)+t(n)}px`}function H(e,n){let t=o=>{if(typeof o=="number")return o;let r=parseInt(o,10);return isNaN(r)?0:r};return`${t(e)-t(n)}px`}var P=e=>{try{let n=e.split("?")[0].split("#")[0];return n==="/"?"/":n.replace(/\/+$/,"")||"/"}catch{return"/"}};function U(e){let n=P(e),t="";for(let o of Object.keys(I)){let r=P(o);(n===r||n.startsWith(r+"/"))&&r.length>t.length&&(t=r)}return t?{key:t,rule:I[t]}:null}function Y(e,n){let t=U(e);if(!t)return!1;let{rule:o}=t,r=(n?.country||"").toLowerCase();switch(o.mode){case"always":return!0;case"country":return o.countries.some(i=>i.toLowerCase()===r);case"notCountry":return!o.countries.some(i=>i.toLowerCase()===r);case"predicate":return!!o.test?.(n);default:return!1}}function z(){let e=document.querySelector('[fynd-navigation="announcement-swiper"]');if(e&&!e.__swiperInstance)try{let n=window.Swiper,t=new n(e,{slidesPerView:1,spaceBetween:0,effect:"fade",fadeEffect:{crossFade:!0},autoplay:{delay:3e3,disableOnInteraction:!1},loop:!0,speed:1e3,allowTouchMove:!1,on:{init:function(){this.slides.length<=1&&this.autoplay&&typeof this.autoplay.stop=="function"&&this.autoplay.stop()}}});e.__swiperInstance=t}catch(n){console.warn("Announcement Swiper init failed:",n)}}function _(){let e='[fynd-navigation="dropdown-container"]',n=document.querySelector(e);if(!n){console.warn(`initDesktopDropdownMenu: element not found: ${e}`);return}let t=m?.()??"unknown";if(t!=="desktop"){n.style.transition=n.style.transition||"transform 0.3s ease",n.style.transform="translateY(0px)";return}let o=a.default.height?.[t],r=!1;if(a.announcementbar?.visibility){let i=a.announcementbar.height?.[t];o=y(o,i),o=H(o,"46px"),r=!0}a.ipbanner?.visibility&&(o=y(o,"0px"),r||(o=H(o,"46px"))),n.style.transform=`translateY(${o})`}function O(){let e=document.querySelector('[fynd-navigation="spacer"][data-wf--navigation-spacer--variant="dynamic"]');if(!e){console.warn("initNavigationSpacer: spacer element not found");return}let n=r=>{if(typeof r=="number")return r;if(typeof r=="string"){let i=parseFloat(r);return Number.isFinite(i)?i:0}return 0},t=m?.()??"desktop",o=a.default.height?.[t];if(a.announcementbar?.visibility){let r=a.announcementbar.height?.[t];o=y(o,r)}if(a.ipbanner?.visibility){let r=n(a.ipbanner.height?.[t]);o=y(o,r)}e.style.height=`${o}`}async function K(){if(T("ipBannerClosed")==="true"){a.ipbanner.visibility=!1;return}let n=await f(),t=window.location.pathname||"/",o=Y(t,n??void 0),r=await G();if(o&&r){x(M,D,a.ipbanner.height.desktop),a.ipbanner.visibility=!0;let i=document.querySelector(F);i&&i.addEventListener("click",()=>{S(M,D),E("ipBannerClosed","true",24),a.ipbanner.visibility=!1,_(),O()})}else a.ipbanner.visibility=!1}document.addEventListener("DOMContentLoaded",async()=>{await K(),z(),_(),O()});})();
1
+ "use strict";(()=>{async function h(){try{let e=await fetch("https://ipwho.is/");if(!e.ok)throw new Error("Failed to fetch geolocation");let n=await e.json();return n.success===!1?(console.error("Geolocation lookup failed:",n.message),null):{ip:n.ip,country:n.country,region:n.region,city:n.city,latitude:n.latitude,longitude:n.longitude,isp:n.connection?.isp||"",timezone:n.timezone?.id||""}}catch(e){return console.error("Error fetching geolocation:",e),null}}var b="geo:data:v1",d="geo_country",g=7*24*60*60*1e3;function w(e,n,t){document.cookie=`${encodeURIComponent(e)}=${encodeURIComponent(n)}; Max-Age=${t}; Path=/; SameSite=Lax; Secure`}function C(e){let n=`${encodeURIComponent(e)}=`,t=document.cookie.split("; ");for(let o of t)if(o.startsWith(n))return decodeURIComponent(o.slice(n.length));return null}function A(e){try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);return!t?.expiresAt||Date.now()>t.expiresAt?(localStorage.removeItem(e),null):t.data}catch{return localStorage.removeItem(e),null}}function B(e,n,t){let o={data:n,expiresAt:Date.now()+t};try{localStorage.setItem(e,JSON.stringify(o))}catch{}}async function f(e){if(typeof window>"u")return null;if(!(e?.forceRefresh??!1)){let o=A(b);if(o)return window.__GEO=o,C(d)||w(d,o.country??"",Math.floor(g/1e3)),o}let t=null;try{t=await h()}catch(o){console.warn("getGeolocation() failed; defaulting to India:",o)}return t||(t={country:"India"}),B(b,t,g),w(d,t.country??"",Math.floor(g/1e3)),window.__GEO=t,t}function v(){return C(d)}function x(e,n,t="auto"){let r=(window||{}).gsap;if(!r){console.warn("GSAP not found on window. Did you include it globally?");return}let i=document.querySelector(e),u=document.querySelector(n);if(!i||!u){console.warn("openBanner: Element(s) not found for selectors:",{mainSelector:e,innerSelector:n});return}r.set(i,{height:0,overflow:"hidden"}),r.set(u,{opacity:0});let s=r.timeline();return s.to(i,{height:t,duration:.5,ease:"power2.out"}),s.to(u,{opacity:1,duration:.3,ease:"power1.out"},.2),s}function S(e,n,t=0){let r=(window||{}).gsap;if(!r){console.warn("GSAP not found on window. Did you include it globally?");return}let i=document.querySelector(e),u=document.querySelector(n);if(!i||!u){console.warn("closeBanner: Element(s) not found for selectors:",{mainSelector:e,innerSelector:n});return}r.set(i,{overflow:"hidden"});let s=r.timeline();return s.to(u,{opacity:0,duration:.25,ease:"power1.out"}),s.to(i,{height:t,duration:.45,ease:"power2.inOut"},.2),s}function E(e,n,t){let o=new Date;o.setTime(o.getTime()+t*60*60*1e3),document.cookie=`${e}=${n}; expires=${o.toUTCString()}; path=/`}function T(e){let n=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return n?n[2]:null}function m(){let e=window.innerWidth;return e>=992?"desktop":e>=768?"tablet":e>=480?"mobileLandscape":"mobilePortrait"}var l=[{country:"united arab emirates",aliases:["uae","u.a.e","united arab emirates"],countryCode:"ae",url:"/ae",tagline:"You're in the UAE. Welcome!"},{country:"saudi arabia",aliases:["saudi","ksa","kingdom of saudi arabia"],countryCode:"sa",url:"/sa",tagline:"Hello Saudi Arabia!"},{country:"south africa",aliases:["rsa"],countryCode:"za",url:"/za",tagline:"Hi South Africa!"},{country:"malaysia",countryCode:"my",url:"/my",tagline:"Selamat datang, Malaysia!"},{country:"indonesia",aliases:["idn"],countryCode:"id",url:"/id",tagline:"Halo Indonesia!"},{country:"philippines",aliases:["phl","the philippines"],countryCode:"ph",url:"/ph",tagline:"Kumusta, Philippines!"},{country:"india",aliases:["bharat"],countryCode:"in",url:"/in",tagline:"This country is India. Hi some text"},{country:"global",aliases:["global","rest of world","others"],countryCode:"global",url:"/global",tagline:"This is rest of world. Hi some text"}];function c(e){return(e??"").trim().toLowerCase()}function k(e){let n=e.trim();return n?n.startsWith("/")?n:`/${n}`:"/"}async function $(){if(typeof window>"u")return null;let e=v();if(e)return c(e);let n=await f();return c(n?.country)}function L(e){let n=c(e);if(!n)return null;let t=l.find(i=>c(i.countryCode)===n);if(t)return t;let o=l.find(i=>c(i.country)===n);if(o)return o;let r=l.find(i=>(i.aliases??[]).some(u=>c(u)===n));return r||null}function p(){let e=l.find(n=>n.country==="global");if(!e)throw new Error("[geo-banner] Global config not found in COUNTRY_CONFIG");return e}function N(e){if(typeof window>"u")return;let n=c(e),t=l.find(r=>c(r.countryCode)===n)||p(),o=document.querySelector('[fynd-banner-field="link"]');if(o){let r=window.location.origin;o.href=`${r}${k(t.url)}`}}function R(e,n){let t=L(n)??l.find(s=>s.country==="global");if(!t)return console.warn("[geo-banner] No matching config for",n),!1;let o=t.countryCode,r=Array.from(e.options),i=r.find(s=>c(s.value)===c(o));if(!i)return console.warn("[geo-banner] No matching <option> for",o,"on",e),!1;let u=e.value;return e.value=i.value,e.value!==i.value&&(e.selectedIndex=r.indexOf(i)),r.forEach(s=>s.selected=s===i),u!==e.value&&(e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))),console.log("[geo-banner] Select updated \u2192",t.country,"(",t.countryCode,")"),!0}function q(e){if(typeof window>"u")return;let n=c(e),t=l.find(i=>c(i.countryCode)===n)||p(),o=document.querySelector("#geoswitch-select")||document.querySelector('[fynd-banner-field="geoswitch"]');o?(console.log(`country code is ${t.countryCode}`),R(o,t.countryCode),o.value=t.countryCode,o.dispatchEvent(new Event("change",{bubbles:!0}))):console.warn('[geo-banner] Select not found: #geoswitch-select / [fynd-banner-field="geoswitch"]');let r=document.querySelector('[fynd-banner-field="link"]');if(r){let i=window.location.origin;r.href=`${i}${k(t.url)}`}}async function G(){if(typeof window>"u")return p();document.readyState==="loading"&&await new Promise(r=>{document.addEventListener("DOMContentLoaded",()=>r(),{once:!0})});let e=await $(),t=L(e)??p();console.log("[geo-banner] rawCountry:",e,"\u2192 resolved:",t.countryCode),q(t.countryCode);let o=document.querySelector('[fynd-banner-field="geoswitch"]');return o&&!o.__geoHandlerAttached&&(o.addEventListener("change",r=>{let i=r.target.value;N(i)}),o.__geoHandlerAttached=!0),t}var I={"/global":{mode:"country",countries:["India"]},"/":{mode:"notCountry",countries:["India"]}},M='[fynd-navigation="ip-banner"]',D='[fynd-navigation="ip-banner-inner"]',F='[fynd-navigation="ip-banner-close"]',se=document.querySelector('[fynd-navigation="announcement-bar"]'),ce=document.querySelector('[fynd-navigation="announcement-list"]'),a={ipbanner:{visibility:!1,height:{desktop:"56px",tablet:"60px",mobileLandscape:"120px",mobilePortrait:"120px"}},announcementbar:{visibility:!0,height:{desktop:"40px",tablet:"40px",mobileLandscape:"40px",mobilePortrait:"46px"}},default:{visibility:!0,height:{desktop:"70px",tablet:"64px",mobileLandscape:"40px",mobilePortrait:"64px"}}};window.navigationData=a;function y(e,n){let t=o=>{if(typeof o=="number")return o;let r=parseInt(o,10);return isNaN(r)?0:r};return`${t(e)+t(n)}px`}function H(e,n){let t=o=>{if(typeof o=="number")return o;let r=parseInt(o,10);return isNaN(r)?0:r};return`${t(e)-t(n)}px`}var P=e=>{try{let n=e.split("?")[0].split("#")[0];return n==="/"?"/":n.replace(/\/+$/,"")||"/"}catch{return"/"}};function U(e){let n=P(e),t="";for(let o of Object.keys(I)){let r=P(o);(n===r||n.startsWith(r+"/"))&&r.length>t.length&&(t=r)}return t?{key:t,rule:I[t]}:null}function Y(e,n){let t=U(e);if(!t)return!1;let{rule:o}=t,r=(n?.country||"").toLowerCase();switch(o.mode){case"always":return!0;case"country":return o.countries.some(i=>i.toLowerCase()===r);case"notCountry":return!o.countries.some(i=>i.toLowerCase()===r);case"predicate":return!!o.test?.(n);default:return!1}}function z(){let e=document.querySelector('[fynd-navigation="announcement-swiper"]');if(e&&!e.__swiperInstance)try{let n=window.Swiper,t=new n(e,{slidesPerView:1,spaceBetween:0,effect:"fade",fadeEffect:{crossFade:!0},autoplay:{delay:3e3,disableOnInteraction:!1},loop:!0,speed:1e3,allowTouchMove:!1,on:{init:function(){this.slides.length<=1&&this.autoplay&&typeof this.autoplay.stop=="function"&&this.autoplay.stop()}}});e.__swiperInstance=t}catch(n){console.warn("Announcement Swiper init failed:",n)}}function _(){let e='[fynd-navigation="dropdown-container"]',n=document.querySelector(e);if(!n){console.warn(`initDesktopDropdownMenu: element not found: ${e}`);return}let t=m?.()??"unknown";if(t!=="desktop"){n.style.transition=n.style.transition||"transform 0.3s ease",n.style.transform="translateY(0px)";return}let o=a.default.height?.[t],r=!1;if(a.announcementbar?.visibility){let i=a.announcementbar.height?.[t];o=y(o,i),o=H(o,"46px"),r=!0}a.ipbanner?.visibility&&(o=y(o,"0px"),r||(o=H(o,"46px"))),n.style.transform=`translateY(${o})`}function O(){let e=document.querySelector('[fynd-navigation="spacer"][data-wf--navigation-spacer--variant="dynamic"]');if(!e){console.warn("initNavigationSpacer: spacer element not found");return}let n=r=>{if(typeof r=="number")return r;if(typeof r=="string"){let i=parseFloat(r);return Number.isFinite(i)?i:0}return 0},t=m?.()??"desktop",o=a.default.height?.[t];if(a.announcementbar?.visibility){let r=a.announcementbar.height?.[t];o=y(o,r)}if(a.ipbanner?.visibility){let r=n(a.ipbanner.height?.[t]);o=y(o,r)}e.style.height=`${o}`}async function K(){if(T("ipBannerClosed")==="true"){a.ipbanner.visibility=!1;return}let n=await f(),t=window.location.pathname||"/",o=Y(t,n??void 0),r=await G();if(o&&r){x(M,D,a.ipbanner.height.desktop),a.ipbanner.visibility=!0;let i=document.querySelector(F);i&&i.addEventListener("click",()=>{S(M,D),E("ipBannerClosed","true",24),a.ipbanner.visibility=!1,_(),O()})}else a.ipbanner.visibility=!1}document.addEventListener("DOMContentLoaded",async()=>{await K(),z(),_(),O()});})();
@@ -1 +1 @@
1
- "use strict";(()=>{var c="user-id";function s(e,n,r=365){let t=new Date(Date.now()+r*864e5).toUTCString(),o=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(n)}; Expires=${t}; Path=/; SameSite=Lax${o}`}function l(e){let n=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return n?decodeURIComponent(n[2]):null}function i(){let e=l(c);return e||(crypto&&"randomUUID"in crypto?e=crypto.randomUUID():e=`rid_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,s(c,e,365*5),console.log("Created new RID:",e),e)}window.getRid=function(){return i()};document.addEventListener("DOMContentLoaded",()=>{let e=i();console.log("RID ready:",e),document.querySelectorAll('a[href*="console.fynd.com"], a[href^="https://console.fynd.com/"], a[href="https://console.fynd.com"]').forEach(t=>{try{let o=new URL(t.href);o.searchParams.set("referrer_uuid",e),t.href=o.toString()}catch{console.warn("Invalid URL in link:",t.href)}});let r=document.getElementById("UUID");r&&(r.value=e,console.log("Filled UUID input with RID:",e))});})();
1
+ "use strict";(()=>{var c="user-id";function s(e,n,r=365){let t=new Date(Date.now()+r*864e5).toUTCString(),o=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(n)}; Expires=${t}; Path=/; SameSite=Lax${o}`}function a(e){let n=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return n?decodeURIComponent(n[2]):null}function i(){let e=a(c);return e||(crypto&&"randomUUID"in crypto?e=crypto.randomUUID():e=`rid_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,s(c,e,365*5),console.log("Created new RID:",e),e)}window.getRid=function(){return i()};document.addEventListener("DOMContentLoaded",()=>{let e=i();document.querySelectorAll('a[href*="console.fynd.com"], a[href^="https://console.fynd.com/"], a[href="https://console.fynd.com"]').forEach(t=>{try{let o=new URL(t.href);o.searchParams.set("referrer_uuid",e),t.href=o.toString()}catch{console.warn("Invalid URL in link:",t.href)}});let r=document.getElementById("UUID");r&&(r.value=e)});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fynd-design-engineering/fynd-one-v2",
3
- "version": "3.3.58",
3
+ "version": "3.3.60",
4
4
  "description": "Updated CDN for fynd.com",
5
5
  "homepage": "https://github.com/Fynd-Design-Engineering/Fynd-Utils/blob/main/README.md",
6
6
  "license": "ISC",