1"use strict";(self.webpackChunkcrm_widgets=self.webpackChunkcrm_widgets||[]).push([[1384],{1384:(e,l,t)=>{t.r(l),t.d(l,{default:()=>a});var d=t(2714),i=t(64710),s=t(8822);const a=()=>{const e=(0,s.A)(),{uploadedFiles:l}=e.state,t=(0,i.j7)(),a=(0,d.useRef)(null),n=l.length>0,[o,c]=(0,d.useState)([]);(0,d.useEffect)((()=>{o.map((e=>t.setFieldError("file",e)))}),[o]);const r=t=>{c([]),t=Array.from(t).slice(0,10-l.length);for(const e of t)u(e);e.setState((e=>({uploadedFiles:[...e.uploadedFiles,...t]})))},u=l=>{e.uploadFile(l,{onSuccessCallback:t=>{e.setState((e=>{const d=[...e.uploadedFiles],i=d.find((e=>e.clientId===l.clientId));return i.id=t.id,delete i.request,delete i.clientId,{uploadedFiles:d}}))},onValidationErrors:t=>{c((e=>[...e,t.file])),e.setState((e=>({uploadedFiles:[...e.uploadedFiles].filter((e=>e.clientId!==l.clientId))})))}})};return{name:"file",checkUploadedFiles:n,maxCount:10,errors:o,fileInputRef:a,setErrors:c,onFileInputChange:e=>{t.setFieldTouched("file",!0,!1);const{files:l}=e.target;r(l)},onDrop:e=>{t.setFieldTouched("file",!0,!1),r(e)},deleteFile:l=>{e.deleteFile(l),e.setState((e=>({uploadedFiles:[...e.uploadedFiles].filter((e=>e.id!==l))})))},cancelLoading:t=>{l.find((e=>e.clientId===t)).request.cancel(),e.setState((e=>({uploadedFiles:[...e.uploadedFiles].filter((e=>e.clientId!==t))})))},onTargetClick:()=>{a.current.click()}}}}}]);
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.