mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-07 23:01:06 +02:00
/assets was served uncompressed and without Cache-Control, so phones downloaded the full 11 MB bundle and revalidated it on every load. Text assets are now gzip-compressed once per file and kept in memory, and files with a content hash in their name are marked immutable. The pdf.js runtime data has no hash and is revalidated instead. ----- Load pages and languages when they are needed (#3175) Every page and all 15 languages were one 11 MB script. Pages are now separate files loaded on first open, and only English is bundled; the language in use loads before the first render. A tab left on an older build reloads once when a file is gone, after the server answers again, so a kiosk is never left on the browser's connection error page. The service worker serves hashed files from its cache and drops the previous build's files.
1 line
2.3 KiB
JavaScript
1 line
2.3 KiB
JavaScript
import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,D as n,w as r}from"./client-BdOyoZJz.js";import{t as i}from"./createLucideIcon-Yo2YoYjm.js";import{t as a}from"./check-D1Pn8T1J.js";import{t as o}from"./copy-3N5VKzXz.js";var s=i(`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`}]]),c=i(`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`}]]),l=[120,220,260],u=[55,75,90],d=[35,45,60],f=[50,75,100],p=[{key:`nozzle_temp_presets`,defaults:l,lo:0,hi:320,unit:`C`},{key:`bed_temp_presets`,defaults:u,lo:0,hi:140,unit:`C`},{key:`chamber_temp_presets`,defaults:d,lo:0,hi:65,unit:`C`},{key:`fan_speed_presets`,defaults:f,lo:0,hi:100,unit:`%`}];function m(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 h(e,t){return[{label:`Off`,value:0},...e.map(e=>({label:`${e} ${t}`,value:e}))]}var g=e(n(),1),_=t();function v({value:e,titleKey:t=`printers.copyToClipboard`,copiedTitleKey:n=`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}=r(),[l,u]=(0,g.useState)(!1);return(0,_.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?n:t),children:l?(0,_.jsx)(a,{className:`${s} text-bambu-green`}):(0,_.jsx)(o,{className:s})})}export{l as a,m as c,f as i,c as l,u as n,p as o,d as r,h as s,v as t,s as u}; |