{"version":3,"file":"WorkVideo.DMEnWtwo.mjs","names":["React.useRef","React.useState","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","l","_e","p","c","init_jsx_runtime","ce","de","addPropertyControls","RenderTarget","init_framer_DKgW_P28","ControlType","WorkVideo","props","ref","playing","setPlaying","onCanvas","nah","setNah","el","video","io","entries","mark","tryPlay","e","CSS","style","fit","init_WorkVideo"],"sources":["https:/framerusercontent.com/modules/wp7pfaHy8SuxBajv8Kby/YC5copNS2guh23zxWtC3/WorkVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Video für Kacheln. Liegt über dem Bild und wird erst eingeblendet, wenn es\n// wirklich läuft. Blockiert der Browser Autoplay (z. B. iPhone im\n// Stromsparmodus), bleibt einfach das Bild sichtbar, ohne Play-Knopf.\n// Geladen wird erst, wenn die Kachel 400 px vor dem Sichtbereich liegt.\n// Bei reduzierter Bewegung wird das Video gar nicht geladen.\nconst CSS=`.hono-wv::-webkit-media-controls,.hono-wv::-webkit-media-controls-panel,.hono-wv::-webkit-media-controls-overlay-play-button,.hono-wv::-webkit-media-controls-start-playback-button,.hono-wv::-webkit-media-controls-play-button{display:none!important;-webkit-appearance:none!important;opacity:0!important}`;/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function WorkVideo(props){const{video,fit=\"cover\",style}=props;const ref=React.useRef(null);const[playing,setPlaying]=React.useState(false);const onCanvas=RenderTarget.current()===RenderTarget.canvas;const[nah,setNah]=React.useState(false);React.useEffect(()=>{const el=ref.current;if(!el||!video||onCanvas||nah)return;const reduced=typeof window!==\"undefined\"&&window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(reduced)return;if(typeof IntersectionObserver===\"undefined\"){setNah(true);return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){io.disconnect();setNah(true);}},{rootMargin:\"400px 0px\"});io.observe(el);return()=>io.disconnect();},[video,onCanvas,nah]);React.useEffect(()=>{const el=ref.current;if(!el||!video||onCanvas||!nah)return;el.muted=true;el.defaultMuted=true;el.playsInline=true;const reduced=typeof window!==\"undefined\"&&window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(reduced){el.pause();return;}const mark=()=>{if(!el.paused&&el.readyState>=2)setPlaying(true);};const tryPlay=()=>{const p=el.play();if(p&&typeof p.catch===\"function\")p.catch(()=>{});};el.addEventListener(\"playing\",mark);el.addEventListener(\"timeupdate\",mark);mark();if(el.paused)tryPlay();let io=null;if(typeof IntersectionObserver!==\"undefined\"){io=new IntersectionObserver(entries=>{for(const e of entries){if(e.isIntersecting)tryPlay();else if(!el.paused)el.pause();}});io.observe(el);}return()=>{el.removeEventListener(\"playing\",mark);el.removeEventListener(\"timeupdate\",mark);if(io)io.disconnect();};},[video,onCanvas,nah]);if(!video)return null;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsx(\"video\",{ref:ref,className:\"hono-wv\",src:nah||onCanvas?video:undefined,autoPlay:!onCanvas&&nah,muted:true,loop:true,playsInline:true,controls:false,preload:onCanvas?\"metadata\":nah?\"auto\":\"none\",disablePictureInPicture:true,disableRemotePlayback:true,\"aria-hidden\":\"true\",tabIndex:-1,style:{...style,display:\"block\",// 1 px Überstand auf jeder Seite: An der Subpixel-Kante (v. a. Safari) blitzt\n// sonst das darunterliegende Standbild als dunkle Striche durch.\nwidth:\"calc(100% + 2px)\",height:\"calc(100% + 2px)\",margin:\"-1px\",objectFit:fit,pointerEvents:\"none\",opacity:playing||onCanvas?1:0,transition:\"opacity 0.4s ease\",background:\"transparent\"}})]});}addPropertyControls(WorkVideo,{video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\"]},fit:{type:ControlType.Enum,title:\"Ausschnitt\",options:[\"cover\",\"contain\"],optionTitles:[\"F\\xfcllen\",\"Einpassen\"],defaultValue:\"cover\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WorkVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WorkVideo.map"],"mappings":"A,4NAQG,SAAwBkB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,MAAI,QAAQ,SAAOC,EAAYC,EAAIpB,EAAa,IAAI,EAAO,CAACqB,EAAQC,GAAYrB,EAAe,EAAK,EAAQsB,EAASR,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACS,EAAIC,GAAQxB,EAAe,EAAK,EAAg4C,OAA93CW,MAAoB,CAAC,IAAMc,EAAGN,EAAI,QAAyK,GAA9J,CAACM,GAAI,CAACC,GAAOJ,GAAUC,GAAgClB,IAAS,QAAaA,EAAO,YAAYA,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAmB,OAAO,GAAG,OAAO,qBAAuB,IAAY,CAACmB,EAAO,EAAI,EAAE,MAAO,CAAC,IAAMG,EAAG,IAAI,qBAAqB,GAAS,CAAIC,EAAQ,KAAK,GAAG,EAAE,cAAc,IAAGD,EAAG,WAAW,EAAEH,EAAO,EAAI,EAAG,EAAE,CAAC,WAAW,WAAW,CAAC,EAAiB,OAAfG,EAAG,QAAQF,CAAE,MAAYE,EAAG,WAAW,CAAE,EAAE,CAACD,EAAMJ,EAASC,CAAG,CAAC,EAAEZ,MAAoB,CAAC,IAAMc,EAAGN,EAAI,QAAQ,GAAG,CAACM,GAAI,CAACC,GAAOJ,GAAU,CAACC,EAAI,OAA0L,GAAnL,EAAG,MAAM,GAAK,EAAG,aAAa,GAAK,EAAG,YAAY,GAA0BlB,IAAS,QAAaA,EAAO,YAAYA,EAAO,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