1import{m as p,n as P,w as I,F as M,j as e,I as c,T as z,o as B,z as v,C as L,P as R,a0 as Y}from"./index-DeHSVeOk.js";import{r as o}from"./react-vendor-O4qKiryC.js";import{u as A,h as K,L as O,z as V,I as m,P as g}from"./dashboard-DHlA0nCs.js";import{u as H,T as j}from"./i18n-ka0c0WbP.js";import"./firebase-BsxLp04Z.js";import"./useTheme-CftgTo7B.js";import"./index-BK57a5Si.js";import"./play_store_icon-C_2GP4PI.js";import"./index-CFiP56Zo.js";import"./dashboardRoot-DovywXRQ.js";const te=s=>{const b=p.resolve(P),{t:i}=H(),{theme:T}=I(),x=o.useRef(null),[l,d]=o.useState(""),[N,u]=o.useState(!1),[n,r]=o.useState(!1),y=p.resolve(M),{showToastForSaved:k}=A(),{validURL:w,delay:S}=B();o.useEffect(()=>{if(s.item==null||!s.isOpen){r(!1);return}d(s.item.content),s.isFresh&&h()},[s.isOpen,s.isFresh]);const _=()=>{navigator.clipboard.writeText(l),u(!0),setTimeout(()=>{u(!1)},2e3)},D=()=>{const t=l.trim(),a=s.item;if(t.length>0&&a!=null){if(r(!1),a.content.length===0){let C=v.Text;w(t)&&(C=v.Link),a.type=C}a.content=t,y.batchAddItems([a],L.Items),k(a),b.log(R.editText),s.onDismiss()}},E=()=>{if(s.item==null)return"";const t=new Date(s.item.created*1e3);return Y(t).format("D MMM, YYYY h:mm A")},f=()=>{s.onDismiss()},h=async()=>{var t;r(!0),await S(500),(t=x.current)==null||t.focus()},F=t=>{const a=t.target.value;t.target.value="",t.target.value=a};return e.jsxs(K,{open:s.isOpen,onClose:f,className:"relative z-50",children:[e.jsx(O,{className:"fixed inset-0 bg-black/40"}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs(V,{className:"w-[600px] min-h-[70vh] max-h-[90vh] rounded-[10px] cardContainerBgColor flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center mx-3 pt-3 pb-1 flex-shrink-0",children:[e.jsx(m,{onClick:f,className:"w-11 h-11",size:16,icon:c.Xmark,color:"fill-subTextColor dark:fill-subTextColor-dark"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[N?e.jsx(m,{className:"w-11 h-11",icon:c.CheckmarkCircleFill,color:"fill-trackProgressColor"}):e.jsx(m,{className:"w-11 h-11",icon:c.Copy24Regular,onClick:_,color:"fill-subTextColor dark:fill-subTextColor-dark"}),!n&&e.jsx(g,{paddingClassName:"px-4 py-2",className:"text-primaryColor text-base",hoverColorName:"cellHoverColor",onPlainButtonClicked:h,text:i("menu_popup_edit")},"edit"),n&&e.jsx(g,{paddingClassName:"px-4 py-2",className:"text-primaryColor text-base",hoverColorName:"cellHoverColor",onPlainButtonClicked:D,text:i("general_save")},"save")]})]}),e.jsxs("div",{className:"flex gap-2 ml-6 mt-4 mb-4 flex-shrink-0",children:[e.jsx("span",{className:"subTextColor text-xs",children:E()}),e.jsxs("span",{className:"subTextColor text-xs",children:["| Â ",e.jsx(j,{i18nKey:"text_count_words",values:{0:l.length===0?0:l.split(" ").length}})]}),e.jsxs("span",{className:"subTextColor text-xs",children:["| Â ",e.jsx(j,{i18nKey:"text_count_character",values:{0:l.length}})]})]}),e.jsxs("div",{className:"relative flex-1 flex flex-col pl-6 pr-4 pb-4",children:[e.jsx("textarea",{ref:x,disabled:!n,onFocus:F,value:l,onChange:t=>d(t.target.value),className:`flex-1 w-full cardContainerBgColor textColor text-base resize-none outline-none border-none leading-[1.4em] ${T===z.Dark?"dialog-scrollbar-dark":"dialog-scrollbar-light"}`}),l.length===0&&e.jsx("div",{className:"absolute top-1 left-6 pointer-events-none",children:e.jsx("span",{className:"subTextColor text-base",children:`${i("text_start_typing")}...`})})]})]})})]})};export{te as default};
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.