1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4002],{4002:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var a=s(95155),r=s(12115),i=s(56303),l=s(65229),n=s(5917),o=s(71629),c=s(34904),d=s(93141);async function h(e,t){let s=new Image;e.startsWith("data:")||(s.crossOrigin="anonymous"),await new Promise((t,a)=>{s.onload=()=>t(),s.onerror=e=>a(Error("Image load failed: ".concat(e))),s.src=e});let a=document.createElement("canvas"),r=a.getContext("2d");return a.width=800,a.height=300,r.drawImage(s,t.x,t.y,t.width,t.height,0,0,a.width,a.height),new Promise((e,t)=>{a.toBlob(s=>{s?e(s):t(Error("Canvas toBlob failed"))},"image/jpeg",.9)})}function x(e){let{imageSrc:t,onCropDone:s,onCancel:x}=e,[m,p]=(0,r.useState)({x:0,y:0}),[b,g]=(0,r.useState)(1),[u,w]=(0,r.useState)(0),[f,j]=(0,r.useState)(null),[C,y]=(0,r.useState)(!1),N=(0,r.useCallback)((e,t)=>{j(t)},[]),v=async()=>{if(f){y(!0);try{let e=await h(t,f);s(e)}catch(e){console.error("Crop failed",e)}finally{y(!1)}}};return(0,a.jsxs)("div",{className:"fixed inset-0 z-[60] flex flex-col bg-black/90",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 bg-black px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Crop Cover Image"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:x,className:"flex items-center gap-1.5 rounded-lg border border-white/20 px-3 py-1.5 text-xs text-white hover:bg-white/10",children:[(0,a.jsx)(l.A,{className:"h-3.5 w-3.5"}),"Cancel"]}),(0,a.jsxs)("button",{onClick:v,disabled:C,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5"}),C?"Cropping...":"Apply Crop"]})]})]}),(0,a.jsx)("div",{style:{position:"relative",flex:1,minHeight:0,overflow:"hidden"},children:(0,a.jsx)(i.Ay,{image:t,crop:m,zoom:b,rotation:u,aspect:800/300,onCropChange:p,onZoomChange:g,onCropComplete:N,cropShape:"rect",showGrid:!0})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-6 border-t border-white/10 bg-black px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 text-zinc-400"}),(0,a.jsx)("input",{type:"range",min:1,max:3,step:.05,value:b,onChange:e=>g(Number(e.target.value)),className:"w-32 accent-blue-500"}),(0,a.jsx)(c.A,{className:"h-4 w-4 text-zinc-400"})]}),(0,a.jsxs)("button",{onClick:()=>w(e=>(e+90)%360),className:"flex items-center gap-1.5 rounded-lg border border-white/20 px-3 py-1.5 text-xs text-white hover:bg-white/10",children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Rotate"]})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.