{"version":3,"file":"HomeProcessSlider.CytEKSgO.mjs","names":["React.useRef","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/QhH7vp7SZCU8WSvd4O2C/XZKjkRFisVqW87ZC84WL/HomeProcessSlider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function HomeProcessSlider({content=[],items=3,gap=24,naturalHeight=false,label=\"Vom ersten Gespr\\xe4ch zum fertigen Portrait\",style}){const slides=React.Children.toArray(content);const viewport=React.useRef(null);const[position,setPosition]=React.useState({first:true,last:slides.length<=items,index:0});const visible=Math.max(1,Math.min(items,slides.length||1));const update=React.useCallback(()=>{const el=viewport.current;if(!el)return;const max=Math.max(0,el.scrollWidth-el.clientWidth);const step=(el.clientWidth+gap)/visible;const next={first:el.scrollLeft<=1,last:el.scrollLeft>=max-1,index:Math.min(Math.max(0,slides.length-visible),Math.round(el.scrollLeft/step))};setPosition(old=>old.first===next.first&&old.last===next.last&&old.index===next.index?old:next);},[gap,visible,slides.length]);React.useEffect(()=>{const el=viewport.current;if(!el)return;update();const observer=new ResizeObserver(update);observer.observe(el);return()=>observer.disconnect();},[update]);const move=direction=>{const el=viewport.current;if(!el)return;const step=(el.clientWidth+gap)/visible;const target=Math.max(0,Math.min(el.scrollWidth-el.clientWidth,(Math.round(el.scrollLeft/step)+direction)*step));const reduced=typeof window!==\"undefined\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;el.scrollTo({left:target,behavior:reduced?\"auto\":\"smooth\"});};return /*#__PURE__*/_jsxs(\"section\",{className:naturalHeight?\"fg-process-slider fg-process-natural\":\"fg-process-slider\",\"aria-label\":label,style:{...style,position:\"relative\",width:\"100%\",height:naturalHeight?\"auto\":style?.height||420,minWidth:0,paddingBottom:naturalHeight?92:undefined},children:[/*#__PURE__*/_jsx(\"style\",{children:`.fg-process-slider *{box-sizing:border-box}.fg-process-natural .fg-process-track{height:auto;align-items:stretch}.fg-process-natural .fg-process-slide{height:auto;display:flex;min-height:340px}.fg-process-natural .fg-process-slide>div{flex:1 1 auto}.fg-process-track{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;height:100%;min-width:0}.fg-process-track::-webkit-scrollbar{display:none}.fg-process-slide{scroll-snap-align:start;scroll-snap-stop:always;min-width:0;height:100%}.fg-process-controls{position:absolute;bottom:0;left:0;right:0;height:92px;pointer-events:none;display:flex;justify-content:flex-end;align-items:center;gap:10px;padding:0 24px}.fg-process-controls button{pointer-events:auto;display:flex;justify-content:center;align-items:center;width:44px;height:44px;border:0;border-radius:50%;padding:0;background:#111214;color:#F2EEE8;cursor:pointer}.fg-process-controls button:disabled{opacity:.3;cursor:default}.fg-process-controls button:focus-visible{outline:2px solid #111214;outline-offset:4px;box-shadow:0 0 0 2px #F2EEE8}.fg-process-controls button:hover:not(:disabled){opacity:.75}.fg-process-slider :focus-visible{outline:2px solid #111214;outline-offset:4px}.fg-process-dots{position:absolute;bottom:32px;left:50%;transform:translateX(-50%);display:flex;gap:10px;padding:10px;border-radius:50px;background:#111214;pointer-events:none}.fg-process-dots span{width:10px;height:10px;border-radius:50%;background:#fff;opacity:.5}.fg-process-dots span[data-active=true]{opacity:1}@media(max-width:500px){.fg-process-controls{padding:0}.fg-process-dots{left:0;transform:none}}`}),/*#__PURE__*/_jsx(\"div\",{className:\"fg-process-track\",ref:viewport,tabIndex:0,\"aria-label\":\"Ablaufschritte, horizontal scrollen\",onScroll:update,onKeyDown:event=>{if(event.key===\"ArrowRight\"||event.key===\"ArrowLeft\"){event.preventDefault();move(event.key===\"ArrowRight\"?1:-1);}if(event.key===\"Home\"||event.key===\"End\"){event.preventDefault();viewport.current?.scrollTo({left:event.key===\"Home\"?0:viewport.current.scrollWidth,behavior:\"auto\"});}},children:slides.map((slide,index)=>/*#__PURE__*/_jsx(\"div\",{className:\"fg-process-slide\",role:\"group\",\"aria-label\":`Schritt ${index+1} von ${slides.length}`,style:{flex:`0 0 calc((100% - ${gap*(visible-1)}px) / ${visible})`,marginRight:index<slides.length-1?gap:0},children:/*#__PURE__*/React.isValidElement(slide)?/*#__PURE__*/React.cloneElement(slide,{style:{...slide.props.style,position:\"relative\",left:\"auto\",top:\"auto\",width:\"100%\",height:naturalHeight?\"auto\":\"100%\"}}):slide},index))}),/*#__PURE__*/_jsx(\"div\",{className:\"fg-process-dots\",\"aria-hidden\":\"true\",children:Array.from({length:Math.max(1,slides.length-visible+1)},(_,i)=>/*#__PURE__*/_jsx(\"span\",{\"data-active\":i===position.index},i))}),/*#__PURE__*/_jsxs(\"div\",{className:\"fg-process-controls\",children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Vorheriger Schritt\",disabled:position.first,onClick:()=>move(-1),children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M14 5l-7 7 7 7\"})})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"N\\xe4chster Schritt\",disabled:position.last,onClick:()=>move(1),children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M10 5l7 7-7 7\"})})})]})]});}addPropertyControls(HomeProcessSlider,{naturalHeight:{type:ControlType.Boolean,title:\"naturalHeight\",defaultValue:false},label:{type:ControlType.String,title:\"label\",defaultValue:\"Vom ersten Gespr\\xe4ch zum fertigen Portrait\"},content:{type:ControlType.Slot,title:\"Content\",maxCount:5},items:{type:ControlType.Number,title:\"Items\",min:1,max:3,step:1,defaultValue:3},gap:{type:ControlType.Number,title:\"Gap\",min:0,max:48,defaultValue:24}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HomeProcessSlider\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HomeProcessSlider.map"],"mappings":"yOAGG,SAAwB,EAAkB,CAAC,UAAQ,CAAC,EAAE,QAAM,EAAE,MAAI,GAAG,gBAAc,GAAM,QAAM,4CAA+C,SAAO,CAAC,IAAM,EAAA,EAAsB,QAAQ,CAAO,EAAQ,EAASA,EAAa,IAAI,EAAO,CAAC,EAAS,GAAaC,EAAe,CAAC,MAAM,GAAK,KAAK,EAAO,QAAQ,EAAM,MAAM,CAAC,CAAC,EAAQ,EAAQ,KAAK,IAAI,EAAE,KAAK,IAAI,EAAM,EAAO,QAAQ,CAAC,CAAC,EAAQ,EAAOC,MAAsB,CAAC,IAAM,EAAG,EAAS,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAI,KAAK,IAAI,EAAE,EAAG,YAAY,EAAG,WAAW,EAAQ,GAAM,EAAG,YAAY,GAAK,EAAc,EAAK,CAAC,MAAM,EAAG,YAAY,EAAE,KAAK,EAAG,YAAY,EAAI,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE,EAAO,OAAO,CAAO,EAAE,KAAK,MAAM,EAAG,WAAW,CAAI,CAAC,CAAC,EAAE,EAAY,GAAK,EAAI,QAAQ,EAAK,OAAO,EAAI,OAAO,EAAK,MAAM,EAAI,QAAQ,EAAK,MAAM,EAAI,CAAI,CAAE,EAAE,CAAC,EAAI,EAAQ,EAAO,MAAM,CAAC,EAAE,MAAoB,CAAC,IAAM,EAAG,EAAS,QAAQ,GAAG,CAAC,EAAG,OAAO,EAAO,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