| 1 |
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{C as t,T as n,k as r,w as i}from"./client-A76-KVrT.js";import{t as a}from"./check-Shq9G40Z.js";import{t as o}from"./copy-3k0AUIiC.js";import{t as s}from"./triangle-alert-D0RZMfK7.js";import{n as c}from"./AuthContext-57h2rDlo.js";var l=t(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),u=t(`scan-eye`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]),d=[120,220,260],f=[55,75,90],p=[35,45,60],m=[50,75,100],h=[{key:`nozzle_temp_presets`,defaults:d,lo:0,hi:320,unit:`C`},{key:`bed_temp_presets`,defaults:f,lo:0,hi:140,unit:`C`},{key:`chamber_temp_presets`,defaults:p,lo:0,hi:65,unit:`C`},{key:`fan_speed_presets`,defaults:m,lo:0,hi:100,unit:`%`}];function g(e,t,n,r){if(!e)return[...t];try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length===3&&t.every(e=>Number.isInteger(e)&&e>=n&&e<=r))return t}catch{}return[...t]}function _(e,t){return[{label:`Off`,value:0},...e.map(e=>({label:`${e} ${t}`,value:e}))]}var v=`OE_FREE_USAGE_LIMIT_REACHED`;function y(e){if(!e)return`idle`;switch(e.class){case`failure`:case`warning`:case`safe`:case`error`:return e.class;default:return`unknown`}}function b(e){return e===`failure`||e===`warning`||e===`safe`}var x=i();function S(){let{t:e}=n(),{hasPermission:t}=c();return t(`settings:read`)?(0,x.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 p-3 bg-amber-50 dark:bg-amber-900/30 border border-amber-300 dark:border-amber-700 rounded text-sm text-amber-800 dark:text-amber-200`,children:[(0,x.jsx)(s,{className:`w-4 h-4 mt-0.5 flex-shrink-0`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{children:e(`octoeverywhere.limitReached`)}),(0,x.jsx)(`a`,{href:`https://octoeverywhere.com/gadgetapi`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block mt-1 underline hover:no-underline`,children:e(`octoeverywhere.setupBilling`)})]})]}):null}var C=e(r(),1);function w({value:e,titleKey:t=`printers.copyToClipboard`,copiedTitleKey:r=`printers.copied`,className:i=`ml-2 p-1 rounded hover:bg-bambu-dark-tertiary text-bambu-gray hover:text-white transition-colors`,iconClassName:s=`w-3.5 h-3.5`}){let{t:c}=n(),[l,u]=(0,C.useState)(!1);return(0,x.jsx)(`button`,{onClick:async()=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))return}finally{document.body.removeChild(t)}}u(!0),setTimeout(()=>u(!1),2e3)}catch{}},className:i,title:c(l?r:t),children:l?(0,x.jsx)(a,{className:`${s} text-bambu-green`}):(0,x.jsx)(o,{className:s})})}export{b as a,m as c,_ as d,g as f,y as i,d as l,l as m,S as n,f as o,u as p,v as r,p as s,w as t,h as u};
|