1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1178],{1178:function(e,t,l){let i;l.r(t);var a=l(85893),o=l(67294),n=l(45697),s=l.n(n),r=l(11752),d=l.n(r),p=l(98364),c=l(5152);let u=l.n(c)()(()=>Promise.all([l.e(40243),l.e(81596)]).then(l.bind(l,81596)),{loadableGenerated:{webpack:()=>[81596]},ssr:!1}),{publicRuntimeConfig:h}=d()(),m="".concat(h.HOST,"s3fileupload");class g extends o.Component{async componentDidMount(){let e=await Promise.all([l.e(15793),l.e(48427)]).then(l.bind(l,15793)),{onComplete:t,onDeleteComplete:a,onValidate:o,onError:n,initialFileList:s,onSubmit:r,multiple:d,itemLimit:p,allowedExtensions:c,uploadFolderFlag:u}=this.props,{uploadCustomPath:h,t:g}=this.props,f=h.replace(/^\/|\/$/g,"");i=new e.default({options:{cors:{expected:!0},debug:!1,multiple:d,validation:{itemLimit:p,allowedExtensions:c},messages:{typeError:g("validation:invalidFileFormateError"),tooManyItemsError:this.props.t("validation:maxFileUploadError")},deleteFile:{enabled:!0,endpoint:"".concat(m,"/uploads/order_artwork/").concat(f),params:{originalName:()=>(null==i?void 0:i.methods.getUploads()).find(e=>"deleting"==e.status).originalName}},request:{endpoint:"".concat(m,"/uploads"),params:{orderItem:"orderItem",uploadFolderFlag:u,uploadCustomPath:"".concat(h,"/")}},formatFileName:()=>({orderItem:"newfileItem"}),retry:{enableAuto:!0}}}),setTimeout(()=>{i&&("function"==typeof(null==i?void 0:i.on)&&(i.on("complete",(e,l,i)=>{(null==i?void 0:i.success)==!0&&(this.addOverlayToFirstFile(),t(e,l,{...i,filepath:(null==i?void 0:i.filepath)||""}),this.checkFileUploadProgressAndUpdate())}),i.on("onAllComplete",(e,t)=>{this.checkFileUploadProgressAndUpdate(!0)}),i.on("deleteComplete",(e,t,l)=>{"function"==typeof this.props.onDeleteComplete&&(this.props.onDeleteComplete(e,t,l),this.addOverlayToFirstFile())}),i.on("validate",e=>o(e)),i.on("submit",e=>{r&&r(e)}),i.on("error",(e,t,l,i)=>{if(void 0==i||0!=i.status&&403!=i.status){let e="[object Object]";l=l.includes(e)?l.replaceAll(e,t):l,this.addOverlayToFirstFile()}n(e,t,"The file ".concat(t," failed to upload. Please try again."),i)}),i.on("statusChange",this._onStatusChange),i.on("progress",this.checkFileUploadProgressAndUpdate)),setTimeout(()=>{this.loadInitialFiles(s)},500),this.setState({isMount:!0}))},500)}componentWillUnmount(){i={}}componentDidUpdate(e){let{initialFileList:t,willCancellAll:l}=this.props;t&&t.length>0&&(!e.initialFileList||0==e.initialFileList.length)&&this.loadInitialFiles(t),!0==l&&l!=e.willCancellAll&&(null==i||i.methods.cancelAll())}loadInitialFiles(e){e&&e.length>0&&(null==i||i.methods.addInitialFiles(e))}render(){let e=this.props.fileInputId?this.props.fileInputId:"file-input-id",t=(0,a.jsxs)("div",{className:"attachText",children:[(0,a.jsx)("img",{alt:"Attach...",src:"../static/images/common/attach-24-filled.svg"}),(0,a.jsx)("span",{children:"Attach here"})]});return(0,a.jsx)("div",{children:(null==i?void 0:i.qq)&&(0,a.jsx)(u,{"dropzone-disabled":"true","fileInput-id":e,uploader:i,"fileInput-disabled":this.props.fileInputDisabled,"fileInput-children":t,"thumbnail-waitingPlaceholder":(0,a.jsx)("img",{width:"100",height:"100",alt:"Loading...",src:"".concat(h.CDN_FOR_STATIC_DATA,"/static/images/common/loader/Loader-GIF-Animation.gif")}),"thumbnail-notAvailablePlaceholder":(0,a.jsx)("img",{width:"100",height:"100",src:"".concat(h.CDN_FOR_STATIC_DATA,"/static/images/common/not-viewable-print-ready.jpg")})})})}constructor(e){super(e),this.checkFileUploadProgressAndUpdate=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=document.querySelectorAll(".react-fine-uploader-gallery-progress-bar-container");t.forEach((l,i)=>{let a=l.querySelector(".react-fine-uploader-gallery-progress-bar");setTimeout(()=>{if(a){let o=parseFloat(a.style.width),n=parseFloat(a.getAttribute("aria-valuenow")),s=parseFloat(a.getAttribute("aria-valuemin"));o>=100||0==n&&0==s?(e||i!=(null==t?void 0:t.length)-1)&&(l.hidden=!0):l.hidden=!1}},500)})},this.addOverlayToFirstFile=()=>{let e=document.getElementsByClassName("react-fine-uploader-gallery-file react-fine-uploader-gallery-files-enter-done");e.length>0&&Array.from(e).forEach((e,t)=>{if(!e.querySelector(".thumbImageOverlay")){let t=document.createElement("div");t.className="thumbImageOverlay",e.appendChild(t)}})},this._onStatusChange=(e,t,l)=>{"upload successful"==t&&"canceled"==l?(this.props.onDeleteComplete(e),setTimeout(()=>{this.addOverlayToFirstFile()},400)):"uploading"==t&&"canceled"==l?(this.props.onDeleteComplete(e),setTimeout(()=>{this.addOverlayToFirstFile()},400)):"upload failed"===t&&"canceled"===l?(this.props.onError(e),setTimeout(()=>{this.addOverlayToFirstFile()},400)):"deleting"===t&&"deleted"===l&&setTimeout(()=>{this.addOverlayToFirstFile()},400)},this.state={isMount:!1}}}g.defaultProps={uploadFolderFlag:0,multiple:!1,itemLimit:1,allowedExtensions:["ai","jpeg","jpg","gif","png","doc","docx","bmp","tif","pdf","xls","xlsx","odt"]}
1,g.propTypes={t:s().func,multiple:s().bool,uploadFolderFlag:s().number,uploadCustomPath:s().string,itemLimit:s().number,onComplete:s().func,onDeleteComplete:s().func,onValidate:s().func,onSubmit:s().func,onError:s().func,allowedExtensions:s().array,fileInputId:s().string,fileInputDisabled:s().any,initialFileList:s().array,willCancellAll:s().bool,from:s().string},t.default=(0,p.Iu)(["validation"])(g)}}]);
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.