PageSourceSearch

https://opengvlab-videochat2.hf.space/static/js/4666.3802f070.chunk.js

js opengvlab-videochat2.hf.space collected 2026-10-03 10:21:27 UTC 15,966 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4666],{90186:function(e,t,n){n.d(t,{$:function(){return i}});var i,r=n(66845),a=n(25621),s=n(66694),o=n(27466),l=n(38570),d=n(80318),u=n(40864);!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(i||(i={})),t.Z=function(e){var t=e.value,n=e.width,c=e.size,p=void 0===c?i.SMALL:c,g=e.overrides,f=(0,a.u)(),m={xs:f.spacing.twoXS,sm:f.spacing.sm,md:f.spacing.lg,lg:f.spacing.xl,xl:f.spacing.twoXL},h=r.useContext(s.E).activeTheme,x=!(0,o.MJ)(h),v={BarContainer:{style:{marginTop:f.spacing.none,marginBottom:f.spacing.none,marginRight:f.spacing.none,marginLeft:f.spacing.none}},Bar:{style:function(e){var t=e.$theme;return{width:n?n.toString():void 0,marginTop:f.spacing.none,marginBottom:f.spacing.none,marginRight:f.spacing.none,marginLeft:f.spacing.none,height:m[p],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:f.spacing.twoXS,borderTopRightRadius:f.spacing.twoXS,borderBottomLeftRadius:f.spacing.twoXS,borderBottomRightRadius:f.spacing.twoXS}}},BarProgress:{style:function(){return{backgroundColor:x?f.colors.primary:f.colors.blue70,borderTopLeftRadius:f.spacing.twoXS,borderTopRightRadius:f.spacing.twoXS,borderBottomLeftRadius:f.spacing.twoXS,borderBottomRightRadius:f.spacing.twoXS}}}};return(0,u.jsx)(l.Z,{value:t,overrides:(0,d.aO)(v,g)})}},77367:function(e,t,n){n.d(t,{R:function(){return a}});var i=n(22951),r=n(91976),a=function(){function e(t,n,r,a){(0,i.Z)(this,e),this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=t,this.size=n,this.id=r,this.status=a}return(0,r.Z)(e,[{key:"setStatus",value:function(t){return new e(this.name,this.size,this.id,t)}}]),e}()},14666:function(e,t,n){n.r(t),n.d(t,{default:function(){return be}});var i,r=n(649),a=n(11026),s=n(22951),o=n(91976),l=n(67591),d=n(94337),u=n(45960),c=n.n(u),p=n(72706),g=n.n(p),f=n(66845),m=n(16295),h=n(87814),x=n(50641);!function(e){e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b"}(i||(i={}));var v=(0,x.rA)()?1024:1e3,w=[i.Gigabyte,i.Megabyte,i.Kilobyte,i.Byte],y=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n||(n=i.Byte),r<0&&(r=0),t<0)throw new Error("Size must be greater than or equal to 0");var a=w.indexOf(n);return a&&t>v/2?e(t/v,w[a-1],r):"".concat(t.toFixed(r)).concat(n.toUpperCase())},b=n(98478),S=n(86659),F=n(8879),Z=n(68411),j=n(50189),I=n(51622),M=n(9003),z=n(81354),L=n(64649),U=n(1515);var k=(0,U.Z)("section",{target:"e1b2p2ww15"})((function(e){var t=e.isDisabled,n=e.theme;return{display:"flex",alignItems:"center",padding:n.spacing.lg,backgroundColor:n.colors.secondaryBg,borderRadius:n.radii.lg,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 1px ".concat(n.colors.primary)},color:t?n.colors.gray:n.colors.bodyText}}),""),C=(0,U.Z)("div",{target:"e1b2p2ww14"})((function(){return{marginRight:"auto",alignItems:"center",display:"flex"}}),""),B=(0,U.Z)("span",{target:"e1b2p2ww13"})((function(e){var t=e.theme;return{color:t.colors.darkenedBgMix100,marginRight:t.spacing.lg}}),""),R=(0,U.Z)("span",{target:"e1b2p2ww12"})((function(e){return{marginBottom:e.theme.spacing.twoXS}}),""),T=(0,U.Z)("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),D=(0,U.Z)("div",{target:"e1b2p2ww10"})((function(e){var t=e.theme;return{left:0,right:0,lineHeight:t.lineHeights.tight,paddingTop:t.spacing.md,paddingLeft:t.spacing.lg,paddingRight:t.spacing.lg}}),""),X=(0,U.Z)("ul",{target:"e1b2p2ww9"})((function(){return{listStyleType:"none",marginBottom:0}}),""),E=(0,U.Z)("li",{target:"e1b2p2ww8"})((function(e){var t=e.theme;return{margin:t.spacing.none,padding:t.spacing.none}}),""),P=(0,U.Z)("div",{target:"e1b2p2ww7"})((function(e){return{display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.theme.spacing.lg,overflow:"hidden"}}),""),A=(0,U.Z)("div",{target:"e1b2p2ww6"})((function(e){var t=e.theme;return{marginRight:t.spacing.sm,marginBottom:t.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),""),V=(0,U.Z)("div",{target:"e1b2p2ww5"})((function(e){return{display:"flex",alignItems:"center",marginBottom:e.theme.spacing.twoXS}}),""),W=(0,U.Z)("span",{target:"e1b2p2ww4"})((function(e){return{marginRight:e.theme.spacing.twoXS}}),""),N=(0,U.Z)("div",{target:"e1b2p2ww3"})((function(e){var t=e.theme;return{display:"flex",padding:t.spacing.twoXS,color:t.colors.darkenedBgMix100}}),""),O=(0,U.Z)("small",{target:"e1b2p2ww2"})((function(e){var t=e.theme;return{color:t.colors.danger,fontSize:t.fontSizes.sm,height:t.fontSizes.sm,lineHeight:t.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),""),H=(0,U.Z)("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),_=function(e){var t;return t={},(0,L.Z)(t,k,{display:"flex",flexDirection:"column",alignItems:"flex-start"}),(0,L.Z)(t,C,{marginBottom:e.spacing.lg}),(0,L.Z)(t,B,{display:"none"}),(0,L.Z)(t,D,{paddingRight:e.spacing.lg}),(0,L.Z)(t,V,{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm}),(0,L.Z)(t,A,{width:e.sizes.full}),(0,L.Z)(t,P,{flexDirection:"column"}),(0,L.Z)(t,O,{height:"auto",whiteSpace:"initial"}),(0,L.Z)(t,H,{display:"none"}),(0,L.Z)(t,E,{margin:e.spacing.none,padding:e.spacing.none}),t},G=(0,U.Z)("div",{target:"e1b2p2ww0"})((function(e){var t=e.theme;return t.inSidebar?_(t):(0,L.Z)({},"@media (max-width: ".concat(t.breakpoints.sm,")"),_(t))}),""),K=n(74529),$=n(46927),q=n(33746),J=n(40864),Y=function(e){var t=e.multiple,n=e.acceptedExtensions,r=e.maxSizeBytes;
1return(0,J.jsxs)(C,{"data-testid":"stFileDropzoneInstructions",children:[(0,J.jsx)(B,{children:(0,J.jsx)($.Z,{content:K.n,size:"threeXL"})}),(0,J.jsxs)(T,{children:[(0,J.jsxs)(R,{children:["Drag and drop file",t?"s":""," here"]}),(0,J.jsxs)(q.x,{children:["Limit ".concat(y(r,i.Byte,0)," per file"),n.length?" \u2022 ".concat(n.map((function(e){return e.replace(/^\./,"").toUpperCase()})).join(", ")):null]})]})]})},Q=function(e){var t=e.onDrop,n=e.multiple,i=e.acceptedExtensions,r=e.maxSizeBytes,a=e.disabled,s=e.label;return(0,J.jsx)(I.ZP,{onDrop:t,multiple:n,accept:i.length?i:void 0,maxSize:r,disabled:a,useFsAccessApi:!1,children:function(e){var t=e.getRootProps,o=e.getInputProps;return(0,J.jsxs)(k,(0,j.Z)((0,j.Z)({},t()),{},{"data-testid":"stFileUploadDropzone",isDisabled:a,"aria-label":s,children:[(0,J.jsx)("input",(0,j.Z)({"data-testid":"stDropzoneInput"},o())),(0,J.jsx)(Y,{multiple:n,acceptedExtensions:i,maxSizeBytes:r}),(0,J.jsx)(M.ZP,{kind:z.nW.SECONDARY,disabled:a,size:z.V5.SMALL,children:"Browse files"})]}))}})},ee=n(53782),te=n(13005),ne=n.n(te),ie=n(30351),re=n(14609),ae=(0,U.Z)("div",{target:"e16k0npc1"})((function(e){var t=e.theme;return{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:t.spacing.twoXS,marginBottom:t.spacing.twoXS}}),""),se=(0,U.Z)("div",{target:"e16k0npc0"})((function(e){return{display:"flex",alignItems:"center",justifyContent:"center",color:e.theme.colors.fadedText40}}),""),oe=function(e){var t=e.className,n=e.currentPage,i=e.totalPages,r=e.onNext,a=e.onPrevious;return(0,J.jsxs)(ae,{className:t,"data-testid":"stPagination",children:[(0,J.jsx)(q.x,{children:"Showing page ".concat(n," of ").concat(i)}),(0,J.jsxs)(se,{children:[(0,J.jsx)(M.ZP,{onClick:a,kind:z.nW.MINIMAL,children:(0,J.jsx)($.Z,{content:ie.s,size:"xl"})}),(0,J.jsx)(M.ZP,{onClick:r,kind:z.nW.MINIMAL,children:(0,J.jsx)($.Z,{content:re._,size:"xl"})})]})]})},le=n(88235),de=["pageSize","items","resetOnAdd"],ue=function(e,t){return Math.ceil(e.length/t)},ce=function(e){return ne()((function(t){var n=t.pageSize,i=t.items,r=t.resetOnAdd,s=(0,ee.Z)(t,de),o=(0,f.useState)(0),l=(0,a.Z)(o,2),d=l[0],u=l[1],c=(0,f.useState)(ue(i,n)),p=(0,a.Z)(c,2),g=p[0],m=p[1],h=(0,le.D)(i);(0,f.useEffect)((function(){h&&h.length!==i.length&&m(ue(i,n)),h&&h.length<i.length?r&&u(0):d+1>=g&&u(g-1)}),[i,d,n,h,r,g]);var x=i.slice(d*n,d*n+n);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(e,(0,j.Z)({items:x},s)),i.length>n?(0,J.jsx)(oe,{className:"streamlit-paginator",pageSize:n,totalPages:g,currentPage:d+1,onNext:function(){u(Math.min(d+1,g-1))},onPrevious:function(){u(Math.max(0,d-1))}}):null]})}),e)},pe=n(62288),ge=n(87847),fe=n(31197),me=n(90186),he=function(e){var t=e.fileInfo;return"uploading"===t.status.type?(0,J.jsx)(me.Z,{value:t.status.progress,size:me.$.SMALL,overrides:{Bar:{style:{marginLeft:0,marginTop:"4px"}}}}):"error"===t.status.type?(0,J.jsxs)(O,{children:[(0,J.jsx)(W,{"data-testid":"stUploadedFileErrorMessage",children:t.status.errorMessage}),(0,J.jsx)(H,{children:(0,J.jsx)($.Z,{content:pe.j,size:"lg"})})]}):"uploaded"===t.status.type?(0,J.jsx)(q.x,{children:y(t.size,i.Byte)}):null},xe=function(e){var t=e.fileInfo,n=e.onDelete;return(0,J.jsxs)(V,{className:"uploadedFile",children:[(0,J.jsx)(N,{children:(0,J.jsx)($.Z,{content:ge.h,size:"twoXL"})}),(0,J.jsxs)(P,{className:"uploadedFileData",children:[(0,J.jsx)(A,{className:"uploadedFileName",title:t.name,children:t.name}),(0,J.jsx)(he,{fileInfo:t})]}),(0,J.jsx)("div",{"data-testid":"fileDeleteBtn",children:(0,J.jsx)(M.ZP,{onClick:function(){return n(t.id)},kind:z.nW.MINIMAL,children:(0,J.jsx)($.Z,{content:fe.U,size:"lg"})})})]})},ve=ce((function(e){var t=e.items,n=e.onDelete;return(0,J.jsx)(X,{children:t.map((function(e){return(0,J.jsx)(E,{children:(0,J.jsx)(xe,{fileInfo:e,onDelete:n})},e.id)}))})})),we=function(e){return(0,J.jsx)(D,{children:(0,J.jsx)(ve,(0,j.Z)({},e))})},ye=n(77367),be=function(e){(0,l.Z)(n,e);var t=(0,d.Z)(n);function n(e){var o;return(0,s.Z)(this,n),(o=t.call(this,e)).formClearHelper=new h.K,o.localFileIdCounter=1,o.componentDidUpdate=function(){if("ready"===o.status){var e=o.createWidgetValue(),t=o.props,n=t.element,i=t.widgetMgr,r=i.getFileUploaderStateValue(n);g().isEqual(e,r)||i.setFileUploaderStateValue(n,e,{fromUi:!0})}},o.reset=function(){o.setState({files:[]})},o.dropHandler=function(e,t){var n=o.props.element.multipleFiles;if(!n&&0===e.length&&t.length>1){var i=t.findIndex((function(e){return 1===e.errors.length&&"too-many-files"===e.errors[0].code}));i>=0&&(e.push(t[i].file),t.splice(i,1))}if(o.props.uploadClient.fetchFileURLs(e).then((function(t){if(!n&&e.length>0){var i=o.state.files.find((function(e){return"error"!==e.status.type}));i&&o.deleteFile(i.id)}g().zip(t,e).forEach((function(e){var t=(0,a.Z)(e,2),n=t[0],i=t[1];o.uploadFile(n,i)}))})).catch((function(t){o.addFiles(e.map((function(e){return new ye.R(e.name,e.size,o.nextLocalFileId(),{type:"error",errorMessage:t})})))})),t.length>0){var r=t.map((function(e){var t=e.file;return new ye.R(t.name,t.size,o.nextLocalFileId(),{type:"error",errorMessage:o.getErrorMessage(e.errors[0].code,e.file)})}));o.addFiles(r)}},o.uploadFile=function(e,t){var n=c().CancelToken.source(),i=new ye.R(t.name,t.size,o.nextLocalFileId(),{type:"uploading",cancelToken:n,progress:1});o.addFile(i),o.props.uploadClient.uploadFile(o.props.element,e.uploadUrl,t,(function(e){return o.onUploadProgress(e,i.id)}),n.token).then((function(){return o.onUploadComplete(i.id,e)})).catch((function(e){c().isCancel(e)||o.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},o.onUploadComplete=function(e,t){var n=o.getFile(e);null!=n&&"uploading"===n.status.type&&o.updateFile(n.id,n.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},o.getErrorMessage=function(e,t){switch(e){case"file-too-large":return"File must be ".concat(y(o.maxUploadSizeInBytes,i.Byte)," or smaller.");case"file-invalid-type":return"".concat(t.type," files are not allowed.");case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},o.deleteFile=function(e){var t=o.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&o.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),o.removeFile(e))},o.addFile=function(e){o.setState((function(t){return{files:[].concat((0,r.Z)(t.files),[e])}}))},o.addFiles=function(e){o.setState((function(t){return{files:[].concat((0,r.Z)(t.files),(0,r.Z)(e))}}))},o.removeFile=function(e){o.setState((function(t){return{files:t.files.filter((function(t){return t.id!==e}))}}))},o.getFile=function(e){return o.state.files.find((function(t){return t.id===e}))},o.updateFile=function(e,t){o.setState((function(n){return{files:n.files.map((function(n){return n.id===e?t:n}))}}))},o.onUploadProgress=function(e,t){var n=o.getFile(t);if(null!=n&&"uploading"===n.status.type){var i=Math.round(100*e.loaded/e.total);
1n.status.progress!==i&&o.updateFile(t,n.setStatus({type:"uploading",cancelToken:n.status.cancelToken,progress:i}))}},o.onFormCleared=function(){o.setState({files:[]},(function(){var e=o.createWidgetValue();null!=e&&o.props.widgetMgr.setFileUploaderStateValue(o.props.element,e,{fromUi:!0})}))},o.state=o.initialValue,o}return(0,o.Z)(n,[{key:"initialValue",get:function(){var e=this,t={files:[],newestServerFileId:0},n=this.props,i=n.widgetMgr,r=n.element,a=i.getFileUploaderStateValue(r);if(null==a)return t;var s=a.uploadedFileInfo;return null==s||0===s.length?t:{files:s.map((function(t){var n=t.name,i=t.size,r=t.fileId,a=t.fileUrls;return new ye.R(n,i,e.nextLocalFileId(),{type:"uploaded",fileId:r,fileUrls:a})}))}}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maxUploadSizeInBytes",get:function(){return function(e,t,n){if(e<0)throw Error("Size must be 0 or greater");var i=w.findIndex((function(e){return e===t})),r=w.findIndex((function(e){return e===n}));if(-1===i||-1===r)throw Error("Unexpected byte unit provided");if(i===r)return e;var a=Math.abs(i-r),s=Math.pow(v,a);return i>r?e/s:e*s}(this.props.element.maxUploadSizeMb,i.Megabyte,i.Byte)}},{key:"status",get:function(){return this.state.files.some((function(e){return"uploading"===e.status.type}))?"updating":"ready"}},{key:"componentDidMount",value:function(){var e=this.createWidgetValue(),t=this.props,n=t.element,i=t.widgetMgr;void 0===i.getFileUploaderStateValue(n)&&i.setFileUploaderStateValue(n,e,{fromUi:!1})}},{key:"createWidgetValue",value:function(){var e=this.state.files.filter((function(e){return"uploaded"===e.status.type})).map((function(e){var t=e.name,n=e.size,i=e.status,r=i.fileId,a=i.fileUrls;return new m.jM({fileId:r,fileUrls:a,name:t,size:n})}));return new m.xO({uploadedFileInfo:e})}},{key:"render",value:function(){var e,t=this.state.files,n=this.props,i=n.element,r=n.disabled,a=n.widgetMgr,s=i.type;this.formClearHelper.manageFormClearListener(a,i.formId,this.onFormCleared);var o=t.slice().reverse();return(0,J.jsxs)(G,{"data-testid":"stFileUploader",children:[(0,J.jsx)(b.O,{label:i.label,disabled:r,labelVisibility:(0,x.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,J.jsx)(S.dT,{children:(0,J.jsx)(F.Z,{content:i.help,placement:Z.u.TOP_RIGHT})})}),(0,J.jsx)(Q,{onDrop:this.dropHandler,multiple:i.multipleFiles,acceptedExtensions:s,maxSizeBytes:this.maxUploadSizeInBytes,label:i.label,disabled:r}),o.length>0&&(0,J.jsx)(we,{items:o,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}},{key:"nextLocalFileId",value:function(){return this.localFileIdCounter++}}]),n}(f.PureComponent)},87814:function(e,t,n){n.d(t,{K:function(){return s}});var i=n(22951),r=n(91976),a=n(50641),s=function(){function e(){(0,i.Z)(this,e),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}return(0,r.Z)(e,[{key:"manageFormClearListener",value:function(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,a.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}},{key:"disconnect",value:function(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}]),e}()}}]);

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.