PageSourceSearch

https://wwwy1031-avp-pro.hf.space/static/js/index.DN77pJCq.js

js wwwy1031-avp-pro.hf.space collected 2026-10-03 10:23:28 UTC 13,587 bytes, 1 lines download raw bytes

1import{r as n,E as V,_ as M,x as p,aI as be,l as S,j as l,ax as I,b as L,c as we,B as k,h as Ue,a0 as ve,f as ze,aj as ee,bn as Ce,e as D,bU as Ie,m as Be,ab as Ee,T as De,P as Le,ac as ke,bM as Pe,bN as Ve}from"./index.3bHSf9gi.js";import{u as Me}from"./FormClearHelper.DyYuMYyM.js";import{g as oe,F as P,a as Te,D as Re,I as Ne,C as Ae,s as We,b as He}from"./FileHelper.DgwA_xYF.js";import{S as $e,P as je}from"./ProgressBar.D1rDn4Rn.js";import{U as j}from"./UploadFileInfo.C-jY39rj.js";const Xe=e=>{const t=n.useRef();return n.useEffect(()=>{t.current=e},[e]),t.current};var ne=n.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(V,M({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),n.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var ae=n.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(V,M({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),n.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});ae.displayName="ChevronRight";
1var se=n.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(V,M({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),n.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});se.displayName="CloudUpload";var le=n.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(V,M({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});le.displayName="Error";const ie=p("section",{target:"e16n7gab0"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${t.colors.primary}`},cursor:e?"not-allowed":"pointer"})),Oe=p("div",{target:"e16n7gab1"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),re=p("span",{target:"e16n7gab2"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),ce=p("span",{target:"e16n7gab3"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),_e=p("span",{target:"e16n7gab4"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),qe=p("div",{target:"e16n7gab5"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),Ge=p("span",{target:"e16n7gab6"})({whiteSpace:"nowrap"}),de=p("div",{target:"e16n7gab7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Ke=p("ul",{target:"e16n7gab8"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),pe=p("li",{target:"e16n7gab9"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ue=p("div",{target:"e16n7gab10"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),ge=p("div",{target:"e16n7gab11"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),fe=p("div",{target:"e16n7gab12"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ye=p("span",{target:"e16n7gab13"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Je=p("div",{target:"e16n7gab14"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),he=p("small",{target:"e16n7gab15"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),Fe=p("span",{target:"e16n7gab16"})({}),Qe=e=>({[ie]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[re]:{display:"none"},[ce]:{marginBottom:e.spacing.twoXS},[de]:{paddingRight:e.spacing.lg},[fe]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[ge]:{width:e.sizes.full},[ue]:{flexDirection:"column"},[he]:{height:"auto",whiteSpace:"initial"},[Fe]:{display:"none"},[pe]:{margin:e.spacing.none,padding:e.spacing.none}}),Ze=p("div",{target:"e16n7gab17"})(({theme:e,width:t})=>{if(t<be("23rem"))return Qe(e)}),et=({multiple:e,acceptedExtensions:t,maxSizeBytes:o,acceptDirectory:i=!1,disabled:d})=>{const x=()=>i?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(y=>y.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(o,P.Byte,0)} per file`;
1return S(Oe,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l(re,{children:l(I,{content:se,size:"threeXL"})}),S(qe,{children:[S(ce,{disabled:d,children:["Drag and drop ",x()," here"]}),S(_e,{disabled:d,children:[F(),c()]})]})]})},tt=n.memo(et),ot=({onDrop:e,multiple:t,acceptedExtensions:o,maxSizeBytes:i,disabled:d,label:x,acceptDirectory:c=!1})=>l(Re,{onDrop:e,multiple:t,accept:Te(o),maxSize:i,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:y})=>{const U=y({multiple:t||!!c});return S(ie,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":x,"aria-disabled":d,children:[l("input",{"data-testid":"stFileUploaderDropzoneInput",...U,...c&&{webkitdirectory:""}}),l(tt,{multiple:t,acceptedExtensions:o,maxSizeBytes:i,acceptDirectory:c,disabled:d}),l(Ge,{children:l(L,{kind:k.SECONDARY,disabled:d,size:we.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),nt=n.memo(ot),me=p("small",{target:"ek5bcwe0"})(({kind:e,disabled:t,theme:o})=>{const{redTextColor:i,fadedText60:d,fadedText40:x}=o.colors;let c=d;return t&&(c=x),e==="danger"&&(c=i),{color:c,fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.tight}}),at=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?l(je,{value:e.status.progress,size:$e.SMALL}):e.status.type==="error"?S(he,{children:[l(Ye,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l(Fe,{children:l(I,{content:le,size:"lg"})})]}):e.status.type==="uploaded"?l(me,{disabled:t,children:oe(e.size,P.Byte)}):null,st=({fileInfo:e,onDelete:t,disabled:o})=>S(fe,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l(Je,{disabled:o,children:l(I,{content:Ne,size:"twoXL"})}),S(ue,{className:"stFileUploaderFileData",children:[l(ge,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:o,children:e.name}),l(at,{fileInfo:e,disabled:o})]}),l("div",{"data-testid":"stFileUploaderDeleteBtn",children:l(L,{onClick:()=>t(e.id),kind:k.MINIMAL,disabled:o,"aria-label":`Remove ${e.name}`,children:l(I,{content:Ae,size:"lg"})})})]}),lt=n.memo(st),it=p("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),rt=p("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),ct=({currentPage:e,totalPages:t,onNext:o,onPrevious:i})=>S(it,{"data-testid":"stFileUploaderPagination",children:[l(me,{children:`Showing page ${e} of ${t}`}),S(rt,{children:[l(L,{onClick:i,kind:k.MINIMAL,children:l(I,{content:ne,size:"xl"})}),l(L,{onClick:o,kind:k.MINIMAL,children:l(I,{content:ae,size:"xl"})})]})]}),dt=n.memo(ct),te=(e,t)=>Math.ceil(e.length/t),pt=e=>Ue(({pageSize:o,items:i,resetOnAdd:d,...x})=>{const[c,F]=n.useState(0),[y,U]=n.useState(()=>te(i,o)),u=Xe(i);n.useEffect(()=>{u&&u.length!==i.length&&U(te(i,o)),u&&u.length<i.length?d&&F(0):c+1>=y&&F(y-1)},[i,c,o,u,d,y]);const B=()=>{F(Math.min(c+1,y-1))},v=()=>{F(Math.max(0,c-1))},T=i.slice(c*o,c*o+o);return S(ve,{children:[l(e,{items:T,...x}),i.length>o?l(dt,{pageSize:o,totalPages:y,currentPage:c+1,onNext:B,onPrevious:v}):null]})},e),ut=({items:e,onDelete:t,disabled:o})=>l(Ke,{children:e.map(i=>l(pe,{children:l(lt,{fileInfo:i,onDelete:t,disabled:o})},i.id))}),gt=pt(ut),ft=e=>l(de,{children:l(gt,{...e})}),ht=n.memo(ft),Ft=(e,t)=>{const o=t.getFileUploaderStateValue(e);if(D(o))return{files:[],nextLocalId:1};const{uploadedFileInfo:i}=o;if(D(i)||i.length===0)return{files:[],nextLocalId:1};let d=1;return{files:i.map(c=>{const F=c.name,y=c.size,U=c.fileId,u=c.fileUrls,B=new j(F,y,d,{type:"uploaded",fileId:U,fileUrls:u});return d+=1,B}),nextLocalId:d}},$=e=>{const t=e.filter(o=>o.status.type==="uploaded").map(o=>{const{name:i,size:d,status:x}=o,{fileId:c,fileUrls:F}=x;return new Pe({fileId:c,fileUrls:F,name:i,size:d})});return new Ve({uploadedFileInfo:t})},mt=({disabled:e,element:t,widgetMgr:o,uploadClient:i,fragmentId:d})=>{const{width:x,elementRef:c}=ze(),{files:F,nextLocalId:y}=n.useMemo(()=>Ft(t,o),[t,o]),U=n.useRef(y),[u,B]=n.useState(()=>F),v=n.useRef(u);n.useEffect(()=>{v.current=u},[u]);const[T,X]=n.useState(!1),E=n.useCallback(()=>{const a=U.current;return U.current+=1,a},[]),R=n.useMemo(()=>{const a=t.maxUploadSizeMb;return We(a,P.Megabyte,P.Byte)},[t.maxUploadSizeMb]),w=n.useCallback(a=>{ee.flushSync(()=>{B(s=>{const r=typeof a=="function"?a(s):a;return v.current=r,r})})},[]),N=n.useCallback(a=>{ee.flushSync(()=>{X(a)})},[X]),O=n.useCallback(a=>{w(s=>[...s,a])},[w]),A=n.useCallback(a=>{a.length!==0&&w(s=>
1[...s,...a])},[w]),_=n.useCallback(a=>{w(s=>s.filter(r=>r.id!==a))},[w]),z=n.useCallback((a,s)=>{w(r=>r.map(g=>g.id===a?s:g))},[w]),C=n.useCallback(a=>v.current.find(s=>s.id===a),[]),q=u.some(a=>a.status.type==="uploading")||T?"updating":"ready";n.useEffect(()=>{o.getFileUploaderStateValue(t)===void 0&&o.setFileUploaderStateValue(t,$(v.current),{fromUi:!1},d)},[o,t,d]),n.useEffect(()=>{if(q!=="ready")return;const a=$(u),s=o.getFileUploaderStateValue(t);Ce(a,s)||o.setFileUploaderStateValue(t,a,{fromUi:!0},d)},[q,u,o,t,d]);const ye=n.useCallback(()=>{w(()=>[]);const a=$([]);o.setFileUploaderStateValue(t,a,{fromUi:!0},d)},[t,d,w,o]);Me({element:t,widgetMgr:o,onFormCleared:ye});const G=n.useCallback(a=>{const s=t.type;if(!s||s.length===0)return!0;const r=a.name.toLowerCase();return s.some(g=>r.endsWith(g.toLowerCase()))},[t.type]),K=n.useCallback(a=>{const s=[],r=[];return a.forEach(g=>{G(g)?s.push(g):r.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:s,rejected:r}},[G]),Y=n.useCallback((a,s)=>{const r=C(a);D(r)||r.status.type!=="uploading"||z(r.id,r.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},[C,z]),J=n.useCallback((a,s)=>{const r=C(s);if(D(r)||r.status.type!=="uploading")return;const g=Math.round(a.loaded*100/a.total);r.status.progress!==g&&z(s,r.setStatus({type:"uploading",abortController:r.status.abortController,progress:g}))},[C,z]),Q=n.useCallback((a,s)=>{const r=new AbortController,g=s.webkitRelativePath||s.name,f=new j(g,s.size,E(),{type:"uploading",abortController:r,progress:1});O(f),i.uploadFile(t,a.uploadUrl,s,h=>J(h,f.id),r.signal).then(()=>Y(f.id,a)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||z(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[O,t,E,Y,J,z,i]),W=n.useCallback(a=>
1{if(e)return;const s=C(a);D(s)||(s.status.type==="uploading"&&s.status.abortController.abort(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&i.deleteFile(s.status.fileUrls.deleteUrl),_(a))},[e,C,_,i]),xe=n.useCallback((a,s)=>{const{multipleFiles:r}=t,g=!!t.acceptDirectory;let f=[...a],h=[...s];if(g&&f.length>0){const{accepted:b,rejected:m}=K(f);f=b,h=[...h,...m]}if(!r&&f.length===0&&h.length>1){const b=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");b>=0&&(f.push(h[b].file),h.splice(b,1))}if(i.fetchFileURLs(f).then(b=>{if(!r&&f.length>0){const m=v.current.find(H=>H.status.type!=="error");if(m){N(!0);try{W(m.id)}finally{N(!1)}}}Ie(b,f).forEach(([m,H])=>{Q(m,H)})}).catch(b=>{A(f.map(m=>new j(m.name,m.size,E(),{type:"error",errorMessage:b})))}),h.length>0){const b=h.map(m=>He(m,E(),R));A(b)}},[A,W,t,K,R,E,i,Q,N]),Z=n.useMemo(()=>u.slice().reverse(),[u]),Se=t.type;return S(Ze,{className:"stFileUploader","data-testid":"stFileUploader",width:x,ref:c,children:[l(ke,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&l(Ee,{children:l(De,{content:t.help,placement:Le.TOP_RIGHT})})}),l(nt,{onDrop:xe,multiple:t.multipleFiles,acceptedExtensions:Se,maxSizeBytes:R,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&l(ht,{items:Z,pageSize:3,onDelete:W,resetOnAdd:!0,disabled:e})]})},Ut=n.memo(mt);export{Ut 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.