{"version":3,"file":"CommandLine.B7EwZ8TQ.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/MLzh3GPY94FtG57ic3xv/QAg6ewfOWf6uty09LLhx/CommandLine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * One shell command on one line, with a copy button. Flat, in the site's\n * dark style: the line scrolls sideways when it is longer than the box and\n * fades out at the edge it continues past.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function CommandLine(props){// Literal \"\\n\" sequences become line breaks, so a control set as one\n// string can hold a multi-line config snippet.\nconst command=(props.command||\"\").replace(/\\\\n/g,\"\\n\");const multiline=command.includes(\"\\n\");const scroller=useRef(null);const[copied,setCopied]=useState(false);const[fade,setFade]=useState({left:false,right:false});const measure=()=>{const el=scroller.current;if(!el)return;const max=el.scrollWidth-el.clientWidth;setFade({left:el.scrollLeft>2,right:el.scrollLeft<max-2});};useEffect(()=>{measure();const el=scroller.current;if(!el||typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(measure);ro.observe(el);return()=>ro.disconnect();},[command]);const copy=async()=>{try{await navigator.clipboard.writeText(command);setCopied(true);setTimeout(()=>setCopied(false),1500);}catch{}};const mask=fade.left||fade.right?`linear-gradient(to right, ${fade.left?\"transparent 0, black 28px\":\"black 0\"}, ${fade.right?\"black calc(100% - 40px), transparent 100%\":\"black 100%\"})`:undefined;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:multiline?\"flex-start\":\"center\",gap:10,width:\"100%\",boxSizing:\"border-box\",padding:multiline?\"8px 8px 8px 18px\":\"8px 8px 8px 18px\",borderRadius:14,background:\"rgba(255,255,255,0.04)\",border:\"1px solid rgba(255,255,255,0.08)\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:scroller,onScroll:measure,style:{flex:1,minWidth:0,overflowX:\"auto\",whiteSpace:\"pre\",scrollbarWidth:\"none\",WebkitMaskImage:mask,maskImage:mask,fontFamily:\"ui-monospace, SFMono-Regular, Menlo, monospace\",fontSize:14,lineHeight:multiline?\"22px\":\"36px\",padding:multiline?\"7px 0\":0,color:\"rgba(255,255,255,0.88)\"},children:command}),/*#__PURE__*/_jsx(\"button\",{onClick:copy,\"aria-label\":copied?\"Copied\":\"Copy command\",style:{flex:\"none\",width:36,height:36,borderRadius:999,border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"rgba(255,255,255,0.92)\",color:\"#000\"},children:copied?/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3.5 8.5l3 3 6-7\"})}):/*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"rect\",{x:\"5.5\",y:\"5.5\",width:\"8\",height:\"8\",rx:\"1.8\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M10.5 3.2A1.8 1.8 0 0 0 8.8 2H4a2 2 0 0 0-2 2v4.8a1.8 1.8 0 0 0 1.2 1.7\"})]})})]});}addPropertyControls(CommandLine,{command:{type:ControlType.String,title:\"Command\",defaultValue:\"roomservice scan\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CommandLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CommandLine.map"],"mappings":"6MAOG,SAAwB,EAAY,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