'use strict';var chunkWNS2RBQD_js=require('./chunk-WNS2RBQD.js');require('./chunk-H5NTJZO4.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var I={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},R={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},D={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},E={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},C={display:"flex",flexDirection:"column",gap:8},w={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},S={width:60,fontSize:12,color:"var(--doc-text-muted)"},p={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},T={...p},B={...p,minHeight:60,resize:"vertical",fontFamily:"inherit"},K={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},W={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function F({isOpen:g,onClose:l,onApply:u,currentData:d}){let{t:o}=chunkWNS2RBQD_js.c(),[y,m]=react.useState(""),[i,x]=react.useState(0),[a,c]=react.useState("#000000"),[s,f]=react.useState("solid");react.useEffect(()=>{g&&(m(d?.alt??""),x(d?.borderWidth??0),c(d?.borderColor??"#000000"),f(d?.borderStyle??"solid"));},[g,d]);let b=react.useCallback(()=>{u({alt:y||void 0,borderWidth:i>0?i:void 0,borderColor:i>0?a:void 0,borderStyle:i>0?s:void 0}),l();},[y,i,a,s,u,l]),k=react.useCallback(t=>{t.key==="Escape"&&l(),t.key==="Enter"&&!t.shiftKey&&b();},[l,b]);return g?jsxRuntime.jsx("div",{style:I,onClick:l,onKeyDown:k,children:jsxRuntime.jsxs("div",{style:R,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":o("dialogs.imageProperties.title"),children:[jsxRuntime.jsx("div",{style:D,children:o("dialogs.imageProperties.title")}),jsxRuntime.jsxs("div",{style:E,children:[jsxRuntime.jsxs("div",{style:C,children:[jsxRuntime.jsx("div",{style:w,children:o("dialogs.imageProperties.altText")}),jsxRuntime.jsx("textarea",{style:B,value:y,onChange:t=>m(t.target.value),placeholder:o("dialogs.imageProperties.altTextPlaceholder")})]}),jsxRuntime.jsxs("div",{style:C,children:[jsxRuntime.jsx("div",{style:w,children:o("dialogs.imageProperties.border")}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.width")}),jsxRuntime.jsx("input",{type:"number",style:{...p,maxWidth:80},min:0,max:20,step:.5,value:i,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:o("common.px")})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.style")}),jsxRuntime.jsxs("select",{style:T,value:s,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:o("dialogs.imageProperties.borderStyles.solid")}),jsxRuntime.jsx("option",{value:"dashed",children:o("dialogs.imageProperties.borderStyles.dashed")}),jsxRuntime.jsx("option",{value:"dotted",children:o("dialogs.imageProperties.borderStyles.dotted")}),jsxRuntime.jsx("option",{value:"double",children:o("dialogs.imageProperties.borderStyles.double")}),jsxRuntime.jsx("option",{value:"groove",children:o("dialogs.imageProperties.borderStyles.groove")}),jsxRuntime.jsx("option",{value:"ridge",children:o("dialogs.imageProperties.borderStyles.ridge")}),jsxRuntime.jsx("option",{value:"inset",children:o("dialogs.imageProperties.borderStyles.inset")}),jsxRuntime.jsx("option",{value:"outset",children:o("dialogs.imageProperties.borderStyles.outset")})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:S,children:o("dialogs.imageProperties.color")}),jsxRuntime.jsx("input",{type:"color",value:a,onChange:t=>c(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...p,maxWidth:90},value:a,onChange:t=>c(t.target.value)})]}),i>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${i}px ${s} ${a}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:o("dialogs.imageProperties.preview")})]})]}),jsxRuntime.jsxs("div",{style:K,children:[jsxRuntime.jsx("button",{type:"button",style:W,onClick:l,children:o("common.cancel")}),jsxRuntime.jsx("button",{type:"button",style:{...W,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:o("common.apply")})]})]})}):null}exports.ImagePropertiesDialog=F;