{"version":3,"file":"Youtube_Datenschutz_allgemein.B08dYPCK.mjs","names":["React.useMemo","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/rDVniTeSgPEZllJJgXWG/iaCeZ3gEzjiYRYAXQ3c0/Youtube_Datenschutz_allgemein.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Hilfsfunktion zum Extrahieren der YouTube Video-ID aus verschiedenen URL-Formaten (inkl. Shorts)\nfunction extractYouTubeId(input){if(!input)return\"pubzpz-NF0o\";const trimmed=input.trim();// Prüfen auf Shorts-URL\nconst shortsMatch=trimmed.match(/youtube\\.com\\/shorts\\/([a-zA-Z0-9_-]{11})/);if(shortsMatch&&shortsMatch[1])return shortsMatch[1];// Prüfen auf Standard YouTube-URL (watch?v=...) oder youtu.be/...\nconst standardMatch=trimmed.match(/(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([a-zA-Z0-9_-]{11})/);if(standardMatch&&standardMatch[1])return standardMatch[1];// Falls direkt die 11-stellige ID eingegeben wurde\nif(/^[a-zA-Z0-9_-]{11}$/.test(trimmed))return trimmed;return\"pubzpz-NF0o\";}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function YouTubeDatenschutzvideo(props){const{videoInput,aspectRatio,placeholderBackground,textColor,borderRadius,padding,textFont}=props;const videoId=React.useMemo(()=>extractYouTubeId(videoInput),[videoInput]);const[hasMarketingConsent,setHasMarketingConsent]=React.useState(false);const checkConsent=React.useCallback(()=>{if(typeof window!==\"undefined\"){const consentApi=window.cookieConsent;const hasConsentFn=consentApi&&typeof consentApi.hasConsent===\"function\"?consentApi.hasConsent:null;const nextValue=hasConsentFn?Boolean(hasConsentFn(\"marketing\")):false;React.startTransition(()=>setHasMarketingConsent(nextValue));}else{React.startTransition(()=>setHasMarketingConsent(false));}},[]);React.useEffect(()=>{if(typeof window!==\"undefined\"){checkConsent();const handleConsentUpdated=()=>checkConsent();window.addEventListener(\"cookieConsentUpdated\",handleConsentUpdated);return()=>{window.removeEventListener(\"cookieConsentUpdated\",handleConsentUpdated);};}return;},[checkConsent]);const frameStyle=React.useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",border:\"0\",borderRadius}),[borderRadius]);const placeholderStyle=React.useMemo(()=>({position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:placeholderBackground,color:textColor,borderRadius,padding,textAlign:textFont.textAlign??\"center\",fontSize:textFont.fontSize,lineHeight:textFont.lineHeight,letterSpacing:textFont.letterSpacing,fontFamily:textFont.fontFamily,fontWeight:textFont.fontWeight,fontStyle:textFont.fontStyle}),[borderRadius,padding,placeholderBackground,textColor,textFont]);// Umwandlung des Dropdown-Werts in echtes CSS aspectRatio\nconst formattedAspectRatio=aspectRatio.replace(\"/\",\" / \");return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:formattedAspectRatio,overflow:\"hidden\",borderRadius},children:hasMarketingConsent?/*#__PURE__*/_jsx(\"iframe\",{style:frameStyle,src:`https://www.youtube-nocookie.com/embed/${videoId}`,title:\"YouTube Datenschutzvideo: Eingebettetes Video\",allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\",allowFullScreen:true,loading:\"lazy\",referrerPolicy:\"strict-origin-when-cross-origin\"}):/*#__PURE__*/_jsx(\"div\",{role:\"status\",\"aria-live\":\"polite\",style:placeholderStyle,children:\"Bitte akzeptiere die Marketing-Cookies im Cookie-Banner, um dieses Video anzusehen.\"})});}addPropertyControls(YouTubeDatenschutzvideo,{videoInput:{type:ControlType.String,title:\"Video ID or URL\",defaultValue:\"https://www.youtube.com/shorts/pubzpz-NF0o\"},aspectRatio:{type:ControlType.Enum,title:\"Aspect Ratio\",options:[\"16/9\",\"9/16\",\"4/3\",\"1/1\"],optionTitles:[\"16:9 (Querformat)\",\"9:16 (Hochformat / Short)\",\"4:3\",\"1:1 (Quadrat)\"],defaultValue:\"9/16\"},placeholderBackground:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"20px\"},textFont:{type:ControlType.Font,title:\"Text Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\",textAlign:\"center\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YouTubeDatenschutzvideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Youtube_Datenschutz_allgemein.map"],"mappings":"oNACA,SAAS,EAAiB,EAAM,CAAC,GAAG,CAAC,EAAM,MAAM,cAAc,IAAM,EAAQ,EAAM,KAAK,EAClF,EAAY,EAAQ,MAAM,2CAA2C,EAAE,GAAG,GAAa,EAAY,GAAG,OAAO,EAAY,GAC/H,IAAM,EAAc,EAAQ,MAAM,yFAAyF,EACrE,OAD0E,GAAe,EAAc,GAAU,EAAc,GAClL,sBAAsB,KAAK,CAAO,EAAS,EAAc,aAAc,CAGvE,SAAwB,EAAwB,EAAM,CAAC,GAAK,CAAC,aAAW,cAAY,wBAAsB,YAAU,eAAa,UAAQ,YAAU,EAAY,EAAQA,MAAkB,EAAiB,CAAU,EAAE,CAAC,CAAU,CAAC,EAAO,CAAC,EAAoB,GAAwBC,EAAe,EAAK,EAAQ,EAAaC,MAAsB,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,EAAW,EAAO,cAAoB,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