{"version":3,"file":"Utils.C-eoGrPy.mjs","names":[],"sources":["https:/framerusercontent.com/modules/ruY9qHH9jFOgSnjcnW2c/CJ8UTz9nQI6iUqkLK4sw/Utils.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\",subscriptionExpanded:false});// Diese Funktion prüft, ob die Web Share API verfügbar ist\nfunction canShare(){return navigator.share!==undefined;}function copyToClipboard(url){const textarea=document.createElement(\"textarea\");textarea.value=url;document.body.appendChild(textarea);textarea.select();document.execCommand(\"copy\");document.body.removeChild(textarea);alert(\"URL kopiert: \"+url);}// Fallback für Browser, die die Web Share API nicht unterstützen\nfunction fallbackShare(){copyToClipboard(window.location.href);// Hier können Sie auch Social-Media-Sharing-Links einfügen\n}// Diese Funktion wird aufgerufen, wenn der Benutzer auf die Schaltfläche \"Teilen\" klickt\nfunction shareContent(title){// Prüfen, ob die Web Share API verfügbar ist\nif(canShare()){navigator.share({title,text:\"Schauen Sie sich diesen gro\\xdfartigen Artikel an!\",url:window.location.href}).then(()=>{console.log(\"Erfolgreich geteilt!\");}).catch(error=>{console.log(\"Teilen fehlgeschlagen\",error);});}else{fallbackShare();// Fallback für Browser, die die Web Share API nicht unterstützen\nconsole.log(\"Web Share API wird in diesem Browser nicht unterst\\xfctzt.\");}}export function replaceStudioTextWithGetParams(Component){return props=>{const text=props?.children?.props?.children?.props?.children;console.log(\"props\",props);if(text){const urlParams=new URLSearchParams(window?.location?.search);const studio=urlParams.get(\"studio\")?urlParams.get(\"studio\")+\" \":\"\";props.children.props.children.props.children=text.replace(\"[STUDIO] \",studio);console.log(\"replacedText\",props.children.props.children.props.children);}return /*#__PURE__*/_jsx(Component,{...props});};}function addQueryParam(url,param,value){// Prüft, ob die URL bereits Query-Parameter enthält\nif(url.includes(\"?\")){// Wenn ja, fügt den neuen Parameter mit einem '&' hinzu\nurl+=\"&\"+encodeURIComponent(param)+\"=\"+encodeURIComponent(value);}else{// Wenn nicht, startet den Query-String mit '?'\nurl+=\"?\"+encodeURIComponent(param)+\"=\"+encodeURIComponent(value);}return url;}export function addExpanded(Component){return props=>{const[frameHeight,setFrameHeight]=useState(625);const frameRef=useRef(null);const changeParentStyle=()=>{if(frameRef.current&&frameRef.current.parentElement){frameRef.current.parentElement.style.height=\"fit-content\";console.log(\"Parent height set to fit-content\");}};useEffect(()=>{const handleMessage=e=>{if(e?.data?.frameHeight){console.log(\"e\",e?.data?.frameHeight+300);setFrameHeight(e.data.frameHeight);}};window.addEventListener(\"message\",handleMessage);changeParentStyle();return()=>{window.removeEventListener(\"message\",handleMessage);};},[]);useEffect(()=>{changeParentStyle();},[frameRef.current]);props.height=\"fit-content\";props.style.height=\"fit-content\";return /*#__PURE__*/_jsx(\"div\",{ref:frameRef,style:{height:frameHeight,width:\"100%\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}export function setSubscriptionExpanded(Component){return props=>{const[{subscriptionExpanded},setStore]=useStore();return!subscriptionExpanded&&/*#__PURE__*/_jsx(Component,{...props,onClick:()=>setStore({subscriptionExpanded:true})});};}export function withShare(Component){return props=>{console.log(props);return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>shareContent(props.title)});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withShare\":{\"type\":\"reactHoc\",\"name\":\"withShare\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addExpanded\":{\"type\":\"reactHoc\",\"name\":\"addExpanded\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setSubscriptionExpanded\":{\"type\":\"reactHoc\",\"name\":\"setSubscriptionExpanded\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"replaceStudioTextWithGetParams\":{\"type\":\"reactHoc\",\"name\":\"replaceStudioTextWithGetParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}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