{"version":3,"file":"script.js","sources":["../../../dev/templates/trip/script.js"],"sourcesContent":["function scrollToElementOnPageLoad() {\n\t// Default configuration options\n\tconst defaults = {\n\t\tscrollDuration: 500, // Duration of the smooth scroll in milliseconds\n\t\teasingType: \"ease-in-out\", // Type of easing\n\t\teasingStrength: \"medium\", // Strength of easing\n\t\toffset: -350, // Offset value in pixels\n\t\ttargetElement: document.querySelector(\"[js-scroll-to-me]\"), // Element to scroll to\n\t\tanimationDelay: 100 // Delay in milliseconds to wait for other animations\n\t};\n\n\tif (defaults.targetElement) {\n\t\t// Wait for the specified delay before starting the scroll\n\t\tsetTimeout(function () {\n\t\t\ttry {\n\t\t\t\tsmoothScrollTo();\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Error:\", error);\n\t\t\t}\n\t\t}, defaults.animationDelay);\n\t}\n\n\t// Function to perform the smooth scroll\n\tfunction smoothScrollTo() {\n\t\tconst { scrollDuration, easingType, easingStrength, offset, targetElement } = defaults;\n\t\tconst easingStrengthMultipliers = {\n\t\t\tstrong: 3,\n\t\t\tmedium: 1,\n\t\t\tgentle: 4\n\t\t};\n\t\tconst easingFunctions = {\n\t\t\t\"ease-in\": (progressRatio, multiplier) => progressRatio ** multiplier,\n\t\t\t\"ease-out\": (progressRatio, multiplier) => 1 - (1 - progressRatio) ** multiplier,\n\t\t\t\"ease-in-out\": (progressRatio, multiplier) => (progressRatio < 0.5 ? multiplier * progressRatio ** multiplier : 1 - multiplier * (1 - progressRatio) ** multiplier)\n\t\t};\n\t\tconst multiplier = easingStrengthMultipliers[easingStrength] || easingStrengthMultipliers.medium;\n\t\tconst easingFunction = easingFunctions[easingType] || easingFunctions[\"ease-in-out\"];\n\t\tconst targetPosition = targetElement.getBoundingClientRect().top + offset;\n\t\tconst startPosition = window.pageYOffset;\n\t\tconst distance = targetPosition - startPosition;\n\t\tlet start = null;\n\n\t\tfunction step(timestamp) {\n\t\t\tif (!start) start = timestamp;\n\t\t\tconst progress = timestamp - start;\n\t\t\tconst progressRatio = Math.min(progress / scrollDuration, 1);\n\t\t\tconst easing = easingFunction(progressRatio, multiplier);\n\t\t\twindow.scrollTo(0, startPosition + distance * easing);\n\t\t\tif (progress < scrollDuration) window.requestAnimationFrame(step);\n\t\t}\n\n\t\twindow.requestAnimationFrame(step);\n\t}\n}\n\n// Call the function to initiate the smooth scroll on page load\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\tscrollToElementOnPageLoad();\n});\n"],"names":[],"mappings":"AAAA,SAAS,yBAAyB,GAAG;AACrC;AACA,CAAC,MAAM,QAAQ,GAAG;AAClB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,UAAU,EAAE,aAAa;AAC3B,EAAE,cAAc,EAAE,QAAQ;AAC1B,EAAE,MAAM,EAAE,CAAC,GAAG;AACd,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAC;AAC5D,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,CAAC;AACH;AACA,CAAC,IAAI,QAAQ,CAAC,aAAa,EAAE;AAC7B;AACA,EAAE,UAAU,CAAC,YAAY;AACzB,GAAG,IAAI;AACP,IAAI,cAAc,EAAE,CAAC;AACrB,IAAI,CAAC,OAAO,KAAK,EAAE;AACnB,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACnC,IAAI;AACJ,GAAG,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;AAC9B,EAAE;AACF;AACA;AACA,CAAC,SAAS,cAAc,GAAG;AAC3B,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;AACzF,EAAE,MAAM,yBAAyB,GAAG;AACpC,GAAG,MAAM,EAAE,CAAC;AACZ,GAAG,MAAM,EAAE,CAAC;AACZ,GAAG,MAAM,EAAE,CAAC;AACZ,GAAG,CAAC;AACJ,EAAE,MAAM,eAAe,GAAG;AAC1B,G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