streamlit-nightly 1.37.2.dev20240820__py2.py3-none-any.whl → 1.37.2.dev20240823__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/elements/arrow.py +33 -8
- streamlit/elements/code.py +7 -0
- streamlit/elements/json.py +12 -5
- streamlit/elements/lib/column_types.py +3 -3
- streamlit/elements/map.py +13 -18
- streamlit/elements/vega_charts.py +6 -14
- streamlit/elements/widgets/button.py +24 -0
- streamlit/elements/widgets/button_group.py +2 -2
- streamlit/elements/widgets/data_editor.py +9 -6
- streamlit/elements/widgets/multiselect.py +4 -4
- streamlit/elements/widgets/radio.py +43 -4
- streamlit/elements/widgets/select_slider.py +63 -11
- streamlit/elements/widgets/selectbox.py +4 -4
- streamlit/elements/write.py +1 -1
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +4 -1
- streamlit/proto/Code_pb2.py +2 -2
- streamlit/proto/Code_pb2.pyi +4 -1
- streamlit/runtime/caching/cache_data_api.py +6 -5
- streamlit/runtime/caching/cache_resource_api.py +6 -5
- streamlit/static/asset-manifest.json +24 -24
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{1074.0db34d15.chunk.js → 1074.9d1e63cc.chunk.js} +1 -1
- streamlit/static/static/js/{1116.22f8322c.chunk.js → 1116.85ec79d5.chunk.js} +1 -1
- streamlit/static/static/js/{1168.2a9806f0.chunk.js → 1168.7c30158a.chunk.js} +1 -1
- streamlit/static/static/js/1307.2bdac721.chunk.js +1 -0
- streamlit/static/static/js/{1451.d93e956f.chunk.js → 1451.7ff31fc7.chunk.js} +1 -1
- streamlit/static/static/js/1792.61097259.chunk.js +1 -0
- streamlit/static/static/js/3513.5e3a04f2.chunk.js +1 -0
- streamlit/static/static/js/3599.963d0e5a.chunk.js +5 -0
- streamlit/static/static/js/{4335.bc097c4d.chunk.js → 4335.b166a7b6.chunk.js} +1 -1
- streamlit/static/static/js/{4477.edb1d80a.chunk.js → 4477.568118b6.chunk.js} +1 -1
- streamlit/static/static/js/5106.62135ac5.chunk.js +1 -0
- streamlit/static/static/js/{5441.4cdb2690.chunk.js → 5441.63087272.chunk.js} +1 -1
- streamlit/static/static/js/6013.b6375a8d.chunk.js +5 -0
- streamlit/static/static/js/6718.f5745d2b.chunk.js +1 -0
- streamlit/static/static/js/{7175.70728640.chunk.js → 7175.a10184bd.chunk.js} +1 -1
- streamlit/static/static/js/{7323.4e64ad2c.chunk.js → 7323.05e7058a.chunk.js} +2 -2
- streamlit/static/static/js/7602.a6e1d802.chunk.js +1 -0
- streamlit/static/static/js/7702.b905bebd.chunk.js +1 -0
- streamlit/static/static/js/7805.23670b3c.chunk.js +1 -0
- streamlit/static/static/js/8148.8bd2f9d3.chunk.js +1 -0
- streamlit/static/static/js/8536.bdf41383.chunk.js +1 -0
- streamlit/static/static/js/8691.ee55fefc.chunk.js +5 -0
- streamlit/static/static/js/main.771fbdca.js +28 -0
- {streamlit_nightly-1.37.2.dev20240820.dist-info → streamlit_nightly-1.37.2.dev20240823.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.37.2.dev20240820.dist-info → streamlit_nightly-1.37.2.dev20240823.dist-info}/RECORD +53 -53
- streamlit/static/static/js/1307.74bce9ab.chunk.js +0 -1
- streamlit/static/static/js/1792.eb8a836f.chunk.js +0 -1
- streamlit/static/static/js/3513.577f3dc5.chunk.js +0 -1
- streamlit/static/static/js/3599.eaeac234.chunk.js +0 -5
- streamlit/static/static/js/4666.0e91bb87.chunk.js +0 -1
- streamlit/static/static/js/5106.4c60cfa4.chunk.js +0 -1
- streamlit/static/static/js/6013.fb4531df.chunk.js +0 -5
- streamlit/static/static/js/6718.6fb2aa21.chunk.js +0 -1
- streamlit/static/static/js/7602.33571c14.chunk.js +0 -1
- streamlit/static/static/js/7805.ba32ae70.chunk.js +0 -1
- streamlit/static/static/js/8148.b905db99.chunk.js +0 -1
- streamlit/static/static/js/8536.b7b2ef90.chunk.js +0 -1
- streamlit/static/static/js/8691.93a29403.chunk.js +0 -5
- streamlit/static/static/js/main.ff81c7a3.js +0 -28
- /streamlit/static/static/js/{7323.4e64ad2c.chunk.js.LICENSE.txt → 7323.05e7058a.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{main.ff81c7a3.js.LICENSE.txt → main.771fbdca.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.37.2.dev20240820.data → streamlit_nightly-1.37.2.dev20240823.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.37.2.dev20240820.dist-info → streamlit_nightly-1.37.2.dev20240823.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.37.2.dev20240820.dist-info → streamlit_nightly-1.37.2.dev20240823.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.37.2.dev20240820.dist-info → streamlit_nightly-1.37.2.dev20240823.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(38570),a=s(80318),n=s(27466),l=s(66694),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(l.E),f=!(0,n.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(o.Z,{value:t,overrides:(0,a.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(66845),o=s(47869),a=s(73587),n=s(62813),l=s.n(n),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),b=s(1515),x=s(35704);function w(e,t){switch(e){case i.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case i.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case i.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const I=(0,b.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),F=(0,b.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,b.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,b.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:s}}),""),y=(0,b.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,b.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),j=(0,b.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),L=(0,b.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),T=(0,b.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,x.DZ)(t.colors.primary,.5)}`},...w(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(T,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(L,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),$=s(81354),Z=s(11765);let D;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(D||(D={}));const O=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(j,{"data-testid":"stCameraInputSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:$.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:Z.Z.white})})})})};var X=s(3084),B=s(25621),W=s(91706),_=s(48051),A=s.n(_),V=s(84192);let G;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(G||(G={}));const N=e=>{let{width:t}=e;return(0,U.jsxs)(F,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:Z.Z.gray60,content:X.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:V.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},H=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:o,setClearPhotoInProgress:a,facingMode:n,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,r.useState)(d||G.PENDING),u=(0,r.useRef)(null),[g,p]=(0,r.useState)(s),m=(0,r.useCallback)((0,S.Ds)(1e3,p),[]);(0,r.useEffect)((()=>{m(s)}),[s,m]);const f=(0,B.u)();return(0,U.jsxs)(I,{width:g,"data-testid":"stCameraInputWebcamComponent",children:[c===G.SUCCESS||i||o?W.tq&&(0,U.jsx)(O,{switchFacingMode:l}):(0,U.jsx)(N,{width:g}),(0,U.jsx)(F,{"data-testid":"stCameraInputWebcamStyledBox",hidden:c!==G.SUCCESS&&!i&&!o,width:g,children:!i&&(0,U.jsx)(A(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:`${f.radii.default} ${f.radii.default} 0 0`},onUserMediaError:()=>{h(G.ERROR)},onUserMedia:()=>{h(G.SUCCESS),a(!1)},videoConstraints:{width:{ideal:g},facingMode:n}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==G.SUCCESS||i||o,children:"Take Photo"})]})};class K extends r.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===D.USER?D.ENVIRONMENT:D.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s=`camera-input-${(new Date).toISOString().replace(/:/g,"_")}.jpg`,fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);l()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if((0,S.le)(e))return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);(0,S.le)(t)||("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);(0,S.le)(s)||"uploading"!==s.status.type||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if((0,S.le)(s)||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=a.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{a.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:D.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if((0,S.le)(i))return e;const{uploadedFileInfo:r}=i;return(0,S.le)(r)||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:D.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:r}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(I,{className:"stCameraInput","data-testid":"stCameraInput",width:r,children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F,{width:r,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:r,height:9*r/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:o.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)(H,{handleCapture:this.handleCapture,width:r,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7702],{90186:(e,t,i)=>{i.d(t,{$:()=>p,Z:()=>c});var s=i(66845),l=i(25621),n=i(38570),r=i(80318),a=i(27466),o=i(66694),d=i(40864);let p;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(p||(p={}));const c=function(e){let{value:t,width:i,size:c=p.SMALL,overrides:g}=e;const h=(0,l.u)(),u={xs:h.spacing.twoXS,sm:h.spacing.sm,md:h.spacing.lg,lg:h.spacing.xl,xl:h.spacing.twoXL},{activeTheme:m}=s.useContext(o.E),f=!(0,a.MJ)(m),x={BarContainer:{style:{marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:i?i.toString():void 0,marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none,height:u[c],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?h.colors.primary:h.colors.blue70,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS})}};return(0,d.jsx)(n.Z,{value:t,overrides:(0,r.aO)(x,g)})}},77367:(e,t,i)=>{i.d(t,{R:()=>s});class s{setStatus(e){return new s(this.name,this.size,this.id,e)}constructor(e,t,i,s){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=i,this.status=s}}},27702:(e,t,i)=>{i.r(t),i.d(t,{default:()=>he});var s=i(66845),l=i(73587),n=i(62813),r=i.n(n),a=i(84693),o=i.n(a),d=i(50641),p=i(16295),c=i(87814);let g;!function(e){e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b"}(g||(g={}));const h=(0,d.rA)()?1024:1e3,u=[g.Gigabyte,g.Megabyte,g.Kilobyte,g.Byte],m=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t||(t=g.Byte),i<0&&(i=0),e<0)throw new Error("Size must be greater than or equal to 0");const s=u.indexOf(t);return s&&e>h/2?m(e/h,u[s-1],i):`${e.toFixed(i)}${t.toUpperCase()}`};var f=i(98478),x=i(86659),w=i(8879),b=i(68411),y=i(51622),F=i(9003),S=i(81354),v=i(1515);const j=(0,v.Z)("section",{target:"e1b2p2ww15"})((e=>{let{isDisabled:t,theme:i}=e;return{display:"flex",alignItems:"center",padding:i.spacing.lg,backgroundColor:i.colors.secondaryBg,borderRadius:i.radii.default,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${i.colors.primary}`},color:t?i.colors.gray:i.colors.bodyText}}),""),I=(0,v.Z)("div",{target:"e1b2p2ww14"})((()=>({marginRight:"auto",alignItems:"center",display:"flex"})),""),U=(0,v.Z)("span",{target:"e1b2p2ww13"})((e=>{let{theme:t}=e;return{color:t.colors.darkenedBgMix100,marginRight:t.spacing.lg}}),""),z=(0,v.Z)("span",{target:"e1b2p2ww12"})((e=>{let{theme:t}=e;return{marginBottom:t.spacing.twoXS}}),""),M=(0,v.Z)("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),L=(0,v.Z)("div",{target:"e1b2p2ww10"})((e=>{let{theme:t}=e;return{left:0,right:0,lineHeight:t.lineHeights.tight,paddingTop:t.spacing.md,paddingLeft:t.spacing.lg,paddingRight:t.spacing.lg}}),""),C=(0,v.Z)("ul",{target:"e1b2p2ww9"})((e=>{let{theme:t}=e;return{listStyleType:"none",marginBottom:t.spacing.none}}),""),B=(0,v.Z)("li",{target:"e1b2p2ww8"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,padding:t.spacing.none}}),""),Z=(0,v.Z)("div",{target:"e1b2p2ww7"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"baseline",flex:1,paddingLeft:t.spacing.lg,overflow:"hidden"}}),""),R=(0,v.Z)("div",{target:"e1b2p2ww6"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.sm,marginBottom:t.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),""),k=(0,v.Z)("div",{target:"e1b2p2ww5"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",marginBottom:t.spacing.twoXS}}),""),T=(0,v.Z)("span",{target:"e1b2p2ww4"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.twoXS}}),""),D=(0,v.Z)("div",{target:"e1b2p2ww3"})((e=>{let{theme:t}=e;return{display:"flex",padding:t.spacing.twoXS,color:t.colors.darkenedBgMix100}}),""),X=(0,v.Z)("small",{target:"e1b2p2ww2"})((e=>{let{theme:t}=e;return{color:t.colors.danger,fontSize:t.fontSizes.sm,height:t.fontSizes.sm,lineHeight:t.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),""),P=(0,v.Z)("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),E=e=>({[j]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[I]:{marginBottom:e.spacing.lg},[U]:{display:"none"},[L]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[R]:{width:e.sizes.full},[Z]:{flexDirection:"column"},[X]:{height:"auto",whiteSpace:"initial"},[P]:{display:"none"},[B]:{margin:e.spacing.none,padding:e.spacing.none}}),A=(0,v.Z)("div",{target:"e1b2p2ww0"})((e=>{let{theme:t}=e;return t.inSidebar?E(t):{[`@media (max-width: ${t.breakpoints.sm})`]:E(t)}}),"");var V=i(74529),W=i(46927),$=i(33746),N=i(40864);const O=e=>{let{multiple:t,acceptedExtensions:i,maxSizeBytes:s}=e;return(0,N.jsxs)(I,{"data-testid":"stFileUploaderDropzoneInstructions",children:[(0,N.jsx)(U,{children:(0,N.jsx)(W.Z,{content:V.n,size:"threeXL"})}),(0,N.jsxs)(M,{children:[(0,N.jsxs)(z,{children:["Drag and drop file",t?"s":""," here"]}),(0,N.jsxs)($.x,{children:[`Limit ${m(s,g.Byte,0)} per file`,i.length?` \u2022 ${i.map((e=>e.replace(/^\./,"").toUpperCase())).join(", ")}`:null]})]})]})},H=e=>{let{onDrop:t,multiple:i,acceptedExtensions:s,maxSizeBytes:l,disabled:n,label:r}=e;return(0,N.jsx)(y.ZP,{onDrop:t,multiple:i,accept:s.length?s:void 0,maxSize:l,disabled:n,useFsAccessApi:!1,children:e=>{let{getRootProps:t,getInputProps:a}=e;return(0,N.jsxs)(j,{...t(),"data-testid":"stFileUploaderDropzone",isDisabled:n,"aria-label":r,children:[(0,N.jsx)("input",{"data-testid":"stFileUploaderDropzoneInput",...a()}),(0,N.jsx)(O,{multiple:i,acceptedExtensions:s,maxSizeBytes:l}),(0,N.jsx)(F.ZP,{kind:S.nW.SECONDARY,disabled:n,size:S.V5.SMALL,children:"Browse files"})]})}})};var _=i(13005),G=i.n(_),K=i(88235),q=i(30351),J=i(14609);const Y=(0,v.Z)("div",{target:"e1nlpozb1"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:t.spacing.twoXS,marginBottom:t.spacing.twoXS}}),""),Q=(0,v.Z)("div",{target:"e1nlpozb0"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"center",color:t.colors.fadedText40}}),""),ee=e=>{let{currentPage:t,totalPages:i,onNext:s,onPrevious:l}=e;return(0,N.jsxs)(Y,{"data-testid":"stFileUploaderPagination",children:[(0,N.jsx)($.x,{children:`Showing page ${t} of ${i}`}),(0,N.jsxs)(Q,{children:[(0,N.jsx)(F.ZP,{onClick:l,kind:S.nW.MINIMAL,children:(0,N.jsx)(W.Z,{content:q.s,size:"xl"})}),(0,N.jsx)(F.ZP,{onClick:s,kind:S.nW.MINIMAL,children:(0,N.jsx)(W.Z,{content:J._,size:"xl"})})]})]})},te=(e,t)=>Math.ceil(e.length/t),ie=e=>G()((t=>{let{pageSize:i,items:l,resetOnAdd:n,...r}=t;const[a,o]=(0,s.useState)(0),[d,p]=(0,s.useState)(te(l,i)),c=(0,K.D)(l);(0,s.useEffect)((()=>{c&&c.length!==l.length&&p(te(l,i)),c&&c.length<l.length?n&&o(0):a+1>=d&&o(d-1)}),[l,a,i,c,n,d]);const g=l.slice(a*i,a*i+i);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(e,{items:g,...r}),l.length>i?(0,N.jsx)(ee,{pageSize:i,totalPages:d,currentPage:a+1,onNext:()=>{o(Math.min(a+1,d-1))},onPrevious:()=>{o(Math.max(0,a-1))}}):null]})}),e);var se=i(62288),le=i(87847),ne=i(31197),re=i(90186);const ae=e=>{let{fileInfo:t}=e;return"uploading"===t.status.type?(0,N.jsx)(re.Z,{value:t.status.progress,size:re.$.SMALL,overrides:{Bar:{style:{marginLeft:0,marginTop:"4px"}}}}):"error"===t.status.type?(0,N.jsxs)(X,{children:[(0,N.jsx)(T,{"data-testid":"stFileUploaderFileErrorMessage",children:t.status.errorMessage}),(0,N.jsx)(P,{children:(0,N.jsx)(W.Z,{content:se.j,size:"lg"})})]}):"uploaded"===t.status.type?(0,N.jsx)($.x,{children:m(t.size,g.Byte)}):null},oe=e=>{let{fileInfo:t,onDelete:i}=e;return(0,N.jsxs)(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[(0,N.jsx)(D,{children:(0,N.jsx)(W.Z,{content:le.h,size:"twoXL"})}),(0,N.jsxs)(Z,{className:"stFileUploaderFileData",children:[(0,N.jsx)(R,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:t.name,children:t.name}),(0,N.jsx)(ae,{fileInfo:t})]}),(0,N.jsx)("div",{"data-testid":"stFileUploaderDeleteBtn",children:(0,N.jsx)(F.ZP,{onClick:()=>i(t.id),kind:S.nW.MINIMAL,children:(0,N.jsx)(W.Z,{content:ne.U,size:"lg"})})})]})},de=ie((e=>{let{items:t,onDelete:i}=e;return(0,N.jsx)(C,{children:t.map((e=>(0,N.jsx)(B,{children:(0,N.jsx)(oe,{fileInfo:e,onDelete:i})},e.id)))})})),pe=e=>(0,N.jsx)(L,{children:(0,N.jsx)(de,{...e})});var ce=i(77367);class ge extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new c.K,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:s}=this.props,l=i.getFileUploaderStateValue(t);r()(e,l)||i.setFileUploaderStateValue(t,e,{fromUi:!0},s)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:i}=this.props,{multipleFiles:s}=i;if(!s&&0===e.length&&t.length>1){const i=t.findIndex((e=>1===e.errors.length&&"too-many-files"===e.errors[0].code));i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then((t=>{if(!s&&e.length>0){const e=this.state.files.find((e=>"error"!==e.status.type));e&&(this.forceUpdatingStatus=!0,this.deleteFile(e.id),this.forceUpdatingStatus=!1)}o()(t,e).forEach((e=>{let[t,i]=e;this.uploadFile(t,i)}))})).catch((t=>{this.addFiles(e.map((e=>new ce.R(e.name,e.size,this.nextLocalFileId(),{type:"error",errorMessage:t}))))})),t.length>0){const e=t.map((e=>{const{file:t}=e;return new ce.R(t.name,t.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(e.errors[0].code,e.file)})}));this.addFiles(e)}},this.uploadFile=(e,t)=>{const i=l.Z.CancelToken.source(),s=new ce.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,s.id)),i.token).then((()=>this.onUploadComplete(s.id,e))).catch((e=>{l.Z.isCancel(e)||this.updateFile(s.id,s.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.onUploadComplete=(e,t)=>{const i=this.getFile(e);(0,d.le)(i)||"uploading"!==i.status.type||this.updateFile(i.id,i.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${m(this.maxUploadSizeInBytes,g.Byte)} or smaller.`;case"file-invalid-type":return`${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."}},this.deleteFile=e=>{const t=this.getFile(e);(0,d.le)(t)||("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.addFiles=e=>{this.setState((t=>({files:[...t.files,...e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((i=>({files:i.files.map((i=>i.id===e?t:i))})))},this.onUploadProgress=(e,t)=>{const i=this.getFile(t);if((0,d.le)(i)||"uploading"!==i.status.type)return;const s=Math.round(100*e.loaded/e.total);i.status.progress!==s&&this.updateFile(t,i.setStatus({type:"uploading",cancelToken:i.status.cancelToken,progress:s}))},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if((0,d.le)(e))return;const{widgetMgr:t,element:i,fragmentId:s}=this.props;t.setFileUploaderStateValue(i,e,{fromUi:!0},s)}))},this.state=this.initialValue}get initialValue(){const e={files:[],newestServerFileId:0},{widgetMgr:t,element:i}=this.props,s=t.getFileUploaderStateValue(i);if((0,d.le)(s))return e;const{uploadedFileInfo:l}=s;return(0,d.le)(l)||0===l.length?e:{files:l.map((e=>{const t=e.name,i=e.size,s=e.fileId,l=e.fileUrls;return new ce.R(t,i,this.nextLocalFileId(),{type:"uploaded",fileId:s,fileUrls:l})}))}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){return((e,t,i)=>{if(e<0)throw Error("Size must be 0 or greater");const s=u.findIndex((e=>e===t)),l=u.findIndex((e=>e===i));if(-1===s||-1===l)throw Error("Unexpected byte unit provided");if(s===l)return e;const n=Math.abs(s-l),r=h**n;return s>l?e/r:e*r})(this.props.element.maxUploadSizeMb,g.Megabyte,g.Byte)}get status(){return this.state.files.some((e=>"uploading"===e.status.type))||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:s}=this.props;void 0===i.getFileUploaderStateValue(t)&&i.setFileUploaderStateValue(t,e,{fromUi:!1},s)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:i,status:s}=e,{fileId:l,fileUrls:n}=s;return new p.jM({fileId:l,fileUrls:n,name:t,size:i})}));return new p.xO({uploadedFileInfo:e})}render(){var e;const{files:t}=this.state,{element:i,disabled:s,widgetMgr:l}=this.props,n=i.type;this.formClearHelper.manageFormClearListener(l,i.formId,this.onFormCleared);const r=t.slice().reverse();return(0,N.jsxs)(A,{className:"stFileUploader","data-testid":"stFileUploader",children:[(0,N.jsx)(f.O,{label:i.label,disabled:s,labelVisibility:(0,d.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,N.jsx)(x.dT,{children:(0,N.jsx)(w.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,N.jsx)(H,{onDrop:this.dropHandler,multiple:i.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:i.label,disabled:s}),r.length>0&&(0,N.jsx)(pe,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const he=ge},87814:(e,t,i)=>{i.d(t,{K:()=>l});var s=i(50641);class l{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){(0,s.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7805],{32508:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var s=n(66845),i=n(18157),o=n(91487),r=n(23849),d=n(23593);const l=(0,n(1515).Z)("div",{target:"e1uym6o70"})((e=>{let{theme:t,isFullScreen:n}=e;return{"& *":{fontFamily:t.genericFonts.bodyFont,fontSize:"9.6px"},"& svg":{maxWidth:"100%",width:n?"100%":"auto",height:n?"100%":"auto"},width:n?"100%":"auto",height:n?"100%":"auto"}}),"");var a=n(40864);const h=(0,d.Z)((function(e){let{element:t,isFullScreen:n}=e;const d=`st-graphviz-chart-${t.elementId}`;return(0,s.useEffect)((()=>{try{if((0,o.graphviz)(`#${d}`).zoom(!1).fit(!0).scale(1).engine(t.engine).renderDot(t.spec),n||t.useContainerWidth){const e=(0,i.Ys)(`#${d} > svg`).node();e.removeAttribute("width"),e.removeAttribute("height")}}catch(e){(0,r.H)(e)}}),[d,t.engine,t.spec,t.useContainerWidth,n]),(0,a.jsx)(l,{className:"stGraphVizChart","data-testid":"stGraphVizChart",id:d,isFullScreen:n})}))},23593:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var s=n(66845),i=n(13005),o=n.n(i),r=n(25621),d=n(82218),l=n(97781),a=n(46927),h=n(66694),c=n(1515);const u=(0,c.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const s=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...s,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),p=(0,c.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var m=n(40864);class g extends s.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels(this.props.theme.sizes.fullScreenHeaderHeight);return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:n}=this.state,{children:s,width:i,height:o,disableFullscreenMode:r}=this.props;let h=d.d,c=this.zoomIn,g="View fullscreen";return e&&(h=l.m,c=this.zoomOut,g="Exit fullscreen"),(0,m.jsxs)(p,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,m.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:c,title:g,isExpanded:e,children:(0,m.jsx)(a.Z,{content:h})}),s(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=h.E;const x=(0,r.b)(g);const f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends s.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:s,disableFullscreenMode:i}=this.props;return(0,m.jsx)(x,{width:n,height:s,disableFullscreenMode:t||i,children:t=>{let{width:n,height:s,expanded:i,expand:o,collapse:r}=t;return(0,m.jsx)(e,{...this.props,width:n,height:s,isFullScreen:i,expand:o,collapse:r})}})}}}return n.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,o()(n,e)}},47318:()=>{},57516:()=>{},38728:()=>{}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8148],{23593:(e,t,n)=>{n.d(t,{Z:()=>b});var i=n(66845),o=n(13005),r=n.n(o),l=n(25621),a=n(82218),s=n(97781),d=n(46927),u=n(66694),c=n(1515);const m=(0,c.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),h=(0,c.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var p=n(40864);class g extends i.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels(this.props.theme.sizes.fullScreenHeaderHeight);return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:n}=this.state,{children:i,width:o,height:r,disableFullscreenMode:l}=this.props;let u=a.d,c=this.zoomIn,g="View fullscreen";return e&&(u=s.m,c=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!l&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:c,title:g,isExpanded:e,children:(0,p.jsx)(d.Z,{content:u})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:r,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=u.E;const f=(0,l.b)(g);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(f,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:r,collapse:l}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:r,collapse:l})}})}}}return n.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,r()(n,e)}},75064:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$t});var i=n(66845),o=n(67930),r=n(78170),l=n(17330),a=n(20545),s=n(57463),d=n(97943),u=n(41342),c=n(17875),m=n(87814),h=n(23593),p=n(16295),g=n(50641),f=n(25621),b=n(34367),v=n(31011),y=n(12596),w=n(68411),x=n(9003),C=n(81354),E=n(46927),S=n(1515),M=n(27466);const k="-2.4rem",T=(0,S.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:n?k:"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k},...i&&{[`${i}:hover &, ${i}:active &, ${i}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k}}}}}),""),R=(0,S.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,M.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var I=n(40864);function N(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const r=(0,f.u)(),l=n?t:"";return(0,I.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,I.jsx)(w.Z,{content:(0,I.jsx)(y.ZP,{source:t,allowHTML:!1,style:{fontSize:r.fontSizes.sm}}),placement:w.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,I.jsxs)(x.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:C.nW.ELEMENT_TOOLBAR,children:[i&&(0,I.jsx)(E.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),l&&(0,I.jsx)("span",{children:l})]})})})}const _=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:r,target:l,disableFullscreenMode:a}=e;return(0,I.jsx)(T,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:l,children:(0,I.jsxs)(R,{children:[r,t&&!a&&!i&&(0,I.jsx)(N,{label:"Fullscreen",icon:b.i,onClick:()=>t()}),n&&!a&&i&&(0,I.jsx)(N,{label:"Close fullscreen",icon:v.m,onClick:()=>n()})]})})};var O=n(66694),D=n(38145),F=n.n(D),A=n(96825),z=n.n(A),H=n(29724),$=n.n(H),V=n(52347),L=n(25267),W=n.n(L),j=(n(87717),n(35848)),B=n.n(j),P=n(91191);const Z=["true","t","yes","y","on","1"],Y=["false","f","no","n","off","0"];function U(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=`\u26a0\ufe0f ${e}`,{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?`\n\n${t}\n`:""),displayData:e,isError:!0}}function q(e){return e.hasOwnProperty("isError")&&e.isError}function J(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function K(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function G(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function X(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function Q(e,t){return(0,g.le)(e)?t||{}:(0,g.le)(t)?e||{}:z()(e,t)}function ee(e){if((0,g.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:te(e))):[te(t)]}catch(t){return[te(e)]}}function te(e){try{try{return F()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return`[${typeof e}]`}}function ne(e){if((0,g.le)(e))return null;if("boolean"===typeof e)return e;const t=te(e).toLowerCase().trim();return""===t?null:!!Z.includes(t)||!Y.includes(t)&&void 0}function ie(e){if((0,g.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=$().unformat(e.trim());if((0,g.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function oe(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,g.le)(t)||""===t?(0===n&&(e=Math.round(e)),$()(e).format((0,g.bb)(n)?`0,0.${"0".repeat(n)}`:"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?W().duration(e/1e6,"milliseconds").humanize():t.startsWith("period[")?P.fu.formatPeriodType(BigInt(e),t):(0,V.sprintf)(t,e)}function re(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function le(e){if((0,g.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=W().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=W().utc(e);if(t.isValid())return t.toDate();const n=W().utc(e,[W().HTML5_FMT.TIME_MS,W().HTML5_FMT.TIME_SECONDS,W().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function ae(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const se=new RegExp(/(\r\n|\n|\r)/gm);function de(e){return-1!==e.indexOf("\n")?e.replace(se," "):e}var ue=n(23849);function ce(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,g.bb)(e)?te(e):null,i=(0,g.bb)(n)?de(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,g.le)(e)}}catch(n){return U(te(e),`The value cannot be interpreted as a string. Error: ${n}`)}},getCellValue:e=>void 0===e.data?null:e.data}}ce.isEditableType=!1;const me=ce;function he(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n=`Invalid validate regex: ${t.validate}.\nError: ${l}`}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},r=i=>{if((0,g.le)(i))return!e.isRequired;let o=te(i),r=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),r=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!r||o)};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(e,t){if("string"===typeof n)return U(te(e),n);if(t){const t=r(e);if(!1===t)return U(te(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,g.bb)(e)?te(e):null,n=(0,g.bb)(t)?de(t):"";return{...i,isMissingValue:(0,g.le)(t),data:t,displayData:n}}catch(l){return U("Incompatible value",`The value cannot be interpreted as string. Error: ${l}`)}},getCellValue:e=>void 0===e.data?null:e.data}}he.isEditableType=!0;const pe=he;function ge(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function fe(e,t,n,i,r,l,a){var s;const d=Q({format:n,step:i,timezone:a},t.columnTypeOptions);let u,c,m;if((0,g.bb)(d.timezone))try{var h;u=(null===(h=ge(B()(),d.timezone))||void 0===h?void 0:h.utcOffset())||void 0}catch(b){}(0,g.bb)(d.min_value)&&(c=le(d.min_value)||void 0),(0,g.bb)(d.max_value)&&(m=le(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:r,min:c,max:m}},f=e=>{const n=le(e);return null===n?!t.isRequired:void 0!==n&&(!((0,g.bb)(c)&&l(n)<l(c))&&!((0,g.bb)(m)&&l(n)>l(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return U(te(e),"Invalid input.");t instanceof Date&&(e=t)}const i=le(e);let o="",r="",l=u;if(void 0===i)return U(te(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=B().utc(i);if(!e.isValid())return U(te(i),`This should never happen. Please report this bug. \nError: ${e.toString()}`);if(d.timezone){try{e=ge(e,d.timezone)}catch(b){return U(e.toISOString(),`Failed to adjust to the provided timezone: ${d.timezone}. \nError: ${b}`)}l=e.utcOffset()}try{r=re(e,d.format||n)}catch(b){return U(e.toISOString(),`Failed to format the date for rendering with: ${d.format}. \nError: ${b}`)}o=re(e,n)}return{...p,copyData:o,isMissingValue:(0,g.le)(i),data:{...p.data,date:i,displayDate:r,timezoneOffset:l}}},getCellValue(e){var t;return(0,g.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:l(e.data.date)}}}function be(e){var t,n,i,o,r;let l="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?l="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(l="YYYY-MM-DD HH:mm:ss.SSS");const a=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,g.bb)(a)||(0,g.bb)(null===e||void 0===e||null===(r=e.columnTypeOptions)||void 0===r?void 0:r.timezone);return fe("datetime",e,s?l+"Z":l,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function ve(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),fe("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function ye(e){return fe("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function we(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=ne(e),void 0===n?U(te(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,g.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}be.isEditableType=!0,ve.isEditableType=!0,ye.isEditableType=!0,we.isEditableType=!0;const xe=we;function Ce(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function Ee(e){const t=P.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=Q({step:Ce(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),r=(0,g.le)(i.min_value)||i.min_value<0,l=(0,g.bb)(i.step)&&!Number.isNaN(i.step)?ae(i.step):void 0,a={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:r,fixedDecimals:l,thousandSeparator:""},s=t=>{let n=ie(t);if((0,g.le)(n))return!e.isRequired;if(Number.isNaN(n))return!1;let o=!1;return(0,g.bb)(i.max_value)&&n>i.max_value&&(n=i.max_value,o=!0),!((0,g.bb)(i.min_value)&&n<i.min_value)&&(!o||n)};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(e,t){if(!0===t){const t=s(e);if(!1===t)return U(te(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=ie(e),o="";if((0,g.bb)(n)){if(Number.isNaN(n))return U(te(e),"The value cannot be interpreted as a number.");if((0,g.bb)(l)&&(r=n,n=0===(d=l)?Math.trunc(r):Math.trunc(r*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return U(te(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=oe(n,i.format,l)}catch(u){return U(te(n),(0,g.bb)(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${u}`:`Failed to format the number. Error: ${u}`)}}var r,d;return{...a,data:n,displayData:o,isMissingValue:(0,g.le)(n),copyData:(0,g.le)(n)?"":te(n)}},getCellValue:e=>void 0===e.data?null:e.data}}Ee.isEditableType=!0;const Se=Ee;function Me(e){let t="string";const n=Q({options:"bool"===P.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const r={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>te(e)))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,g.bb)(e)&&""!==e&&(n=te(e)),t&&!r.data.allowedValues.includes(n)?U(te(n),"The value is not part of the allowed options."):{...r,isMissingValue:null===n,copyData:n||"",data:{...r.data,value:n}}},getCellValue(e){var n,i,o,r,l,a,s;return(0,g.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(r=ie(null===(l=e.data)||void 0===l?void 0:l.value))&&void 0!==r?r:null:"boolean"===t?null!==(a=ne(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==a?a:null:null===(o=e.data)||void 0===o?void 0:o.value}}}Me.isEditableType=!0;const ke=Me;function Te(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.le)(e)?[]:ee(e);return{...t,data:n,isMissingValue:(0,g.le)(e),copyData:(0,g.le)(e)?"":te(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,g.le)(e.data)||J(e)?null:e.data}}Te.isEditableType=!1;const Re=Te;function Ie(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Ne(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===P.fu.getTypeName(n)&&(o=!1),{id:`index-${t}`,name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function _e(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,g.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===P.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,g.bb)(n)&&(i={options:n})}return{id:`column-${n}-${t}`,name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?P.fu.getTypeName(e.arrowType):null;let r;if("object"===e.kind)r=e.getCell((0,g.bb)(t.content)?de(P.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,g.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var l,a;let n;var s,d,u;if("time"===i&&(0,g.bb)(null===(l=t.field)||void 0===l||null===(a=l.type)||void 0===a?void 0:a.unit))n=W().unix(P.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(u=d.type)||void 0===u?void 0:u.unit)&&void 0!==s?s:0)).utc().toDate();else n=W().utc(Number(t.content)).toDate();r=e.getCell(n)}else if("decimal"===i){const n=(0,g.le)(t.content)?null:P.fu.format(t.content,t.contentType,t.field);r=e.getCell(n)}else r=e.getCell(t.content);if(q(r))return r;if(!e.isEditable){if((0,g.bb)(t.displayContent)){var c;const e=de(t.displayContent);r.kind===o.p6.Text||r.kind===o.p6.Number||r.kind===o.p6.Uri?r={...r,displayData:e}:r.kind===o.p6.Custom&&"date-picker-cell"===(null===(c=r.data)||void 0===c?void 0:c.kind)&&(r={...r,data:{...r.data,displayDate:e}})}n&&t.cssId&&(r=function(e,t,n){const i={},o=Ie(t,"color",n);o&&(i.textDark=o);const r=Ie(t,"background-color",n);return r&&(i.bgCell=r),"yellow"===r&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(r,t.cssId,n))}return r}function De(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.\nError: ${a}`}if(!(0,g.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(a){i=void 0}const r={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},l=i=>{if((0,g.le)(i))return!e.isRequired;const o=te(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:l,getCell(e,o){if((0,g.le)(e))return{...r,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return U(te(s),n);if(o){if(!1===l(s))return U(te(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,g.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?decodeURI(n[1]):t}catch(a){return t}}(i,s):t.display_text||s),{...r,data:s,displayData:d,isMissingValue:(0,g.le)(s),onClickUri:e=>{window.open(s.startsWith("www.")?`https://${s}`:s,"_blank","noopener,noreferrer"),e.preventDefault()},copyData:s}},getCellValue:e=>(0,g.le)(e.data)?null:e.data}}De.isEditableType=!0;const Fe=De;function Ae(e){const t={kind:o.p6.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.bb)(e)?[te(e)]:[];return{...t,data:n,isMissingValue:!(0,g.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}Ae.isEditableType=!1;const ze=Ae;function He(e){const t=Ce(P.fu.getTypeName(e.arrowType)),n=Q({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=oe(n.max_value,n.format)}catch(a){i=te(n.max_value)}const r=(0,g.le)(n.step)||Number.isNaN(n.step)?void 0:ae(n.step),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,g.le)(e))return K();if((0,g.le)(n.min_value)||(0,g.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return U("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if((0,g.le)(n.step)||Number.isNaN(n.step))return U("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const t=ie(e);if(Number.isNaN(t)||(0,g.le)(t))return U(te(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return U(te(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=oe(t,n.format,r)}catch(a){return U(te(t),(0,g.bb)(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${a}`:`Failed to format the number. Error: ${a}`)}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...l,isMissingValue:(0,g.le)(e),copyData:String(t),data:{...l.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}He.isEditableType=!1;const $e=He;function Ve(e,t,n){const i=Q({y_min:0,y_max:1},t.columnTypeOptions),r={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,g.le)(i.y_min)||(0,g.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return U("Invalid min/max y-axis configuration",`The y_min (${i.y_min}) and y_max (${i.y_max}) configuration options must be valid numbers.`);if((0,g.le)(e))return K();const t=ee(e),n=[];let o=[];if(0===t.length)return K();let l=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=ie(t[i]);if(Number.isNaN(e)||(0,g.le)(e))return U(te(t),`The value cannot be interpreted as a numeric array. ${te(e)} is not a number.`);e>l&&(l=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(l>i.y_max||a<i.y_min)?n.map((e=>l-a===0?l>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(l-a))+(i.y_min||0))):n,{...r,copyData:n.join(","),data:{...r.data,values:o,displayValues:n.map((e=>oe(e)))},isMissingValue:(0,g.le)(e)}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function Le(e){return Ve("line_chart",e,"line")}function We(e){return Ve("bar_chart",e,"bar")}function je(e){return Ve("area_chart",e,"area")}Le.isEditableType=!1,We.isEditableType=!1,je.isEditableType=!1;const Be=new Map(Object.entries({object:me,text:pe,checkbox:xe,selectbox:ke,list:Re,number:Se,link:Fe,datetime:be,date:ye,time:ve,line_chart:Le,bar_chart:We,area_chart:je,image:ze,progress:$e})),Pe=[],Ze="_index",Ye="_pos:",Ue={small:75,medium:200,large:400};function qe(e){if(!(0,g.le)(e))return"number"===typeof e?e:e in Ue?Ue[e]:void 0}function Je(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Ze?n=t.get(e.name):t.has(`${Ye}${e.indexNumber}`)?n=t.get(`${Ye}${e.indexNumber}`):e.isIndex&&t.has(Ze)&&(n=t.get(Ze)),n?z()({...e},{title:n.label,width:qe(n.width),isEditable:(0,g.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Ke(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,g.bb)(n)&&(Be.has(n)?i=Be.get(n):(0,ue.KE)(`Unknown column type configured in column configuration: ${n}`)),(0,g.le)(i)&&(i=function(e){let t=e?P.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty","large_string[pyarrow]"].includes(t)?pe:["datetime","datetimetz"].includes(t)?be:"time"===t?ve:"date"===t?ye:["object","bytes"].includes(t)?me:["bool"].includes(t)?xe:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?Se:"categorical"===t?ke:t.startsWith("list")?Re:me):me}(e.arrowType)),i}const Ge=function(e,t,n){const o=(0,f.u)(),r=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,ue.H)(t),new Map}}(e.columns)),[e.columns]),l=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let r=0;r<i;r++){const n={...Ne(e,r),indexNumber:r};t.push(n)}for(let r=0;r<o;r++){const n={..._e(e,r),indexNumber:r+i};t.push(n)}return t}(t).map((t=>{let i={...t,...Je(t,r),isStretched:l};const a=Ke(i);return(e.editingMode===p.Eh.EditingMode.READ_ONLY||n||!1===a.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==p.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===p.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),a(i,o)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[me({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,r,l,n,e.editingMode,e.columnOrder,o])}};function Xe(e){return e.isIndex?Ze:(0,g.le)(e.name)?"":e.name}const Qe=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const r={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(r[Xe(o)]=o.getCellValue(e))})),n.edited_rows[i]=r})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,r)=>{const l=t.get(n);if(l){const t=l.getCellValue(e);l.isRequired&&l.isEditable&&J(e)&&(o=!0),(0,g.bb)(t)&&(i[Xe(l)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Xe(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],r=o.get(e);if(r){const e=r.getCell(n);var l;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(l=this.editedCells.get(t))||void 0===l||l.set(r.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const n=new Map;t.forEach((e=>{n.set(e.indexNumber,e.getCell(null))})),Object.keys(e).forEach((t=>{const i=e[t],r=o.get(t);if(r){const e=r.getCell(i);e&&n.set(r.indexNumber,e)}})),this.addedRows.push(n)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,g.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var et=n(35704);const tt=function(){const e=(0,f.u)(),t=i.useMemo((()=>({editable:e=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${e.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`})),[]);return{theme:i.useMemo((()=>({accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,et.DZ)(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,et.DZ)(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${e.fontSizes.sm}`,baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,et.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25})),[e]),tableBorderRadius:e.radii.default,headerIcons:t}};const nt=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[r,l]=i;if(r>t.length-1)return U("Column index out of bounds.","This should never happen. Please report this bug.");if(l>n-1)return U("Row index out of bounds.","This should never happen. Please report this bug.");const a=t[r],s=a.indexNumber,d=o.current.getOriginalRowIndex(l),u=o.current.isAddedRow(d);if(a.isEditable||u){const e=o.current.getCell(s,d);if((0,g.bb)(e))return e;if(u)return U("Error during cell creation.",`This should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${d}`)}try{return Oe(a,e.getCell(d+1,s),e.cssStyles)}catch(c){return U("Error during cell creation.",`This should never happen. Please report this bug. \nError: ${c}`)}}),[t,n,e,o])}};var it=n(32700);const ot=function(e,t,n){const[o,r]=i.useState(),{getCellContent:l,getOriginalIndex:a}=(0,it.fF)({columns:t.map((e=>X(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?`\u2191 ${e.title}`:`\u2193 ${e.title}`}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void r(void 0);t="desc"}r({column:X(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:l}};var rt=n(62813),lt=n.n(rt);const at=function(e,t,n,r,l){const[a,s]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),d=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW)||e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_ROW)),u=d&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN)),m=c&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN),h=a.rows.length>0,g=a.columns.length>0,f=void 0!==a.current,b=i.useCallback((e=>{const t=!lt()(e.rows.toArray(),a.rows.toArray()),n=!lt()(e.columns.toArray(),a.columns.toArray()),i=!lt()(e.current,a.current);let o=d&&t||c&&n,u=e;if((d||c)&&void 0!==e.current&&i&&(u={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(u={...u,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(u={...u,rows:a.rows},o=!0),n&&u.columns.length>=0){let e=u.columns;r.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<u.columns.length&&(u={...u,columns:e})}s(u),o&&l(u)}),[a,d,c,l,r]),v=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={columns:t?a.columns:o.EV.empty(),rows:e?a.rows:o.EV.empty(),current:void 0};s(n),(!e&&d||!t&&c)&&l(n)}),[a,d,c,l]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:u,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:m,isRowSelected:h,isColumnSelected:g,isCellSelected:f,clearSelection:v,processSelectionChange:b}},st=",",dt='"',ut='"',ct="\n",mt="\ufeff",ht=new RegExp(`[${[st,dt,ct].join("")}]`);function pt(e){return e.map((e=>function(e){if((0,g.le)(e))return"";const t=te(e);if(ht.test(t))return`${dt}${t.replace(new RegExp(dt,"g"),ut+dt)}${dt}`;return t}(e))).join(st)+ct}async function gt(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(mt));const r=n.map((e=>e.name));await e.write(o.encode(pt(r)));for(let l=0;l<i;l++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,l])))})),await e.write(o.encode(pt(i)))}await e.close()}const ft=function(e,t,o,r){return{exportToCsv:i.useCallback((async()=>{const i=`${(new Date).toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const r=await n.e(5345).then(n.bind(n,95345)),l=await r.showSaveFilePicker({suggestedName:i,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await l.createWritable();await gt(a,e,t,o)}catch(l){if(l instanceof Error&&"AbortError"===l.name)return;try{(0,ue.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",l);let n="";const a=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await gt(a.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),u=document.createElement("a");r?u.setAttribute("target","_blank"):u.setAttribute("target","_self"),u.style.display="none",u.href=d,u.download=i,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)}catch(l){(0,ue.H)("Failed to export data as CSV",l)}}}),[t,o,e,r])}};const bt=function(e,t,n,o,r,l,a,s,d){const u=i.useCallback(((t,i)=>{let[l,a]=t;const d=e[l];if(!d.isEditable)return;const u=d.indexNumber,c=n.current.getOriginalRowIndex(r(a)),m=o([l,a]),h=d.getCellValue(m),p=d.getCellValue(i);if(!q(m)&&p===h)return;const g=d.getCell(p,!0);q(g)?(0,ue.KE)(`Not applying the cell edit since it causes this error:\n ${g.data}`):(n.current.setCell(u,c,{...g,lastUpdated:performance.now()}),s())}),[e,n,r,o,s]),c=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),a()}),[e,n,t,a]),m=i.useCallback((()=>{t||(c(),s())}),[c,s,t]),h=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(r(e))));return n.current.deleteRows(e),a(),d(),s(),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),u([o,i],n.getCell(null)))}return t.length>0&&(s(),l(t)),!1}return!0}),[e,n,t,l,r,s,u,d,a]),p=i.useCallback(((i,a)=>{const[d,u]=i,m=[];for(let h=0;h<a.length;h++){const i=a[h];if(h+u>=n.current.getNumRows()){if(t)break;c()}for(let t=0;t<i.length;t++){const l=i[t],a=h+u,s=t+d;if(s>=e.length)break;const c=e[s];if(c.isEditable){const e=c.getCell(l,!0);if((0,g.bb)(e)&&!q(e)){const t=c.indexNumber,i=n.current.getOriginalRowIndex(r(a)),l=c.getCellValue(o([s,a]));c.getCellValue(e)!==l&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),l(m))}return!1}),[e,n,t,r,o,c,s,l]),f=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:u,onPaste:p,onRowAppended:m,onDelete:h,validateCell:f}};const vt=function(e,t){const[n,o]=i.useState(),r=i.useRef(null),l=i.useCallback((n=>{if(clearTimeout(r.current),r.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],l=n.location[1];let a;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,g.bb)(s))a=s.help;else if("cell"===n.kind){const e=t([i,l]);s.isRequired&&s.isEditable&&J(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(r.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,r]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:l}};var yt=n(39806),wt=n(97613),xt=n(48238),Ct=n(85e3),Et=n(37538);const St=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:r,rect:l}=t,a=t.col;if(J(i)&&a<e.length){const i=e[a];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)?n():(e=>{const{cell:t,theme:n,ctx:i}=e;(0,yt.L6)({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign),i.fillStyle=n.textDark})(t),void(i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(r,l,o))}n()}),[e]),customRenderers:i.useMemo((()=>[wt.Z,xt.Z,Ct.Z,Et.ZP,...Pe]),[])}};const Mt=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,r)=>{e.id&&n(new Map(t).set(e.id,r))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},kt=2,Tt=35,Rt=50+kt,It=2*Tt+kt;const Nt=function(e,t,n,o,r){let l,a=function(e){return Math.max(e*Tt+kt,It)}(t+1+(e.editingMode===p.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,It),a=Math.max(e.height,a)),o&&(s=Math.min(s,o),a=Math.min(a,o),e.height||(s=a));let d=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,Rt),n),d=Math.min(Math.max(e.width,d),n));const[u,c]=i.useState({width:l||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===u.width&&c({width:n,height:u.height})}),[n]),i.useLayoutEffect((()=>{c({width:u.width,height:s})}),[t]),i.useLayoutEffect((()=>{c({width:l||"100%",height:u.height})}),[l]),i.useLayoutEffect((()=>{c({width:u.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(r){const t=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;c({width:t?d:"100%",height:a})}else c({width:l||"100%",height:s})}),[r]),{minHeight:It,maxHeight:a,minWidth:Rt,maxWidth:d,resizableSize:u,setResizableSize:c}},_t=(0,S.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),Ot=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,I.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,I.jsx)(_t,{src:n})}):(0,I.jsx)(_t,{src:n})};var Dt=n(31572),Ft=n(13553),At=n(80152);const zt=function(e){let{top:t,left:n,content:o,clearTooltip:r}=e;const[l,a]=i.useState(!0),s=(0,f.u)(),{colors:d,fontSizes:u,radii:c}=s,m=i.useCallback((()=>{a(!1),r()}),[r,a]);return(0,I.jsx)(Dt.Z,{content:(0,I.jsx)(At.Uo,{"data-testid":"stDataFrameTooltipContent",children:(0,I.jsx)(y.ZP,{style:{fontSize:u.sm},source:o,allowHTML:!1})}),placement:Ft.r4.top,accessibilityType:Ft.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,M.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:u.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:l,children:(0,I.jsx)("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ht=(0,S.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.default},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(2739),n(24665);const $t=(0,h.Z)((function(e){let{element:t,data:n,width:h,height:f,disabled:b,widgetMgr:v,isFullScreen:y,disableFullscreenMode:w,expand:x,collapse:C,fragmentId:E}=e;const S=i.useRef(null),M=i.useRef(null),k=i.useRef(null),{theme:T,headerIcons:R,tableBorderRadius:D}=tt(),{libConfig:{enforceDownloadInNewTab:F=!1}}=i.useContext(O.E),[A,z]=i.useState(!0),[H,$]=i.useState(!1),[V,L]=i.useState(!1),[W,j]=i.useState(!1),B=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),P=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]);(0,g.le)(t.editingMode)&&(t.editingMode=p.Eh.EditingMode.READ_ONLY);const{READ_ONLY:Z,DYNAMIC:Y}=p.Eh.EditingMode,U=n.dimensions,q=Math.max(0,U.rows-1),J=0===q&&!(t.editingMode===Y&&U.dataColumns>0),K=q>15e4,Q=i.useRef(new Qe(q)),[ee,te]=i.useState(Q.current.getNumRows());i.useEffect((()=>{Q.current=new Qe(q),te(Q.current.getNumRows())}),[q]);const ne=i.useCallback((()=>{Q.current=new Qe(q),te(Q.current.getNumRows())}),[q]),{columns:ie}=Ge(t,n,b);i.useEffect((()=>{if(t.editingMode===Z)return;const e=v.getStringValue({id:t.id,formId:t.formId});e&&(Q.current.fromJson(e,ie),te(Q.current.getNumRows()))}),[]);const{getCellContent:oe}=nt(n,ie,ee,Q),{columns:re,sortColumn:le,getOriginalIndex:ae,getCellContent:se}=ot(q,ie,oe),de=i.useCallback((0,g.Ds)(150,(e=>{const n={selection:{rows:[],columns:[]}};n.selection.rows=e.rows.toArray().map((e=>ae(e))),n.selection.columns=e.columns.toArray().map((e=>Xe(re[e])));const i=JSON.stringify(n),o=v.getStringValue({id:t.id,formId:t.formId});void 0!==o&&o===i||v.setStringValue({id:t.id,formId:t.formId},i,{fromUi:!0},E)})),[t.id,t.formId,v,E,ae,Xe]),{gridSelection:ue,isRowSelectionActivated:ce,isMultiRowSelectionActivated:me,isColumnSelectionActivated:he,isMultiColumnSelectionActivated:pe,isRowSelected:ge,isColumnSelected:fe,isCellSelected:be,clearSelection:ve,processSelectionChange:ye}=at(t,J,b,re,de);i.useEffect((()=>{ve(!0,!0)}),[y]);const we=i.useCallback((e=>{var t;null===(t=M.current)||void 0===t||t.updateCells(e)}),[]);i.useEffect((()=>{if(!ce&&!he)return;const e=v.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,r,l;const t=re.map((e=>Xe(e))),a=JSON.parse(e);let s=o.EV.empty(),d=o.EV.empty();if(null===(n=a.selection)||void 0===n||null===(i=n.rows)||void 0===i||i.forEach((e=>{s=s.add(e)})),null===(r=a.selection)||void 0===r||null===(l=r.columns)||void 0===l||l.forEach((e=>{d=d.add(t.indexOf(e))})),s.length>0||d.length>0){ye({rows:s,columns:d,current:void 0})}}}),[]);const xe=i.useCallback((()=>{ee!==Q.current.getNumRows()&&te(Q.current.getNumRows())}),[ee]),Ce=i.useCallback((0,g.Ds)(150,(()=>{const e=Q.current.toJson(re);let n=v.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Qe(0).toJson([])),e!==n&&v.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},E)})),[t.id,t.formId,v,E,re,Q.current]),{exportToCsv:Ee}=ft(se,re,ee,F),{onCellEdited:Se,onPaste:Me,onRowAppended:ke,onDelete:Te,validateCell:Re}=bt(re,t.editingMode!==Y,Q,se,ae,we,xe,Ce,ve),{tooltip:Ie,clearTooltip:Ne,onItemHovered:_e}=vt(re,se),{drawCell:Oe,customRenderers:De}=St(re),Fe=i.useMemo((()=>re.map((e=>X(e)))),[re]),{columns:Ae,onColumnResize:ze}=Mt(Fe),{minHeight:He,maxHeight:$e,minWidth:Ve,maxWidth:Le,resizableSize:We,setResizableSize:je}=Nt(t,ee,h,f,y),Be=i.useCallback((e=>{let[t,n]=e;return{...G(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(re.length-1,0)]}}),[re,T.textLight]);i.useEffect((()=>{if(!t.formId)return;const e=new m.K;return e.manageFormClearListener(v,t.formId,(()=>{ne(),ve()})),()=>{e.disconnect()}}),[t.formId,ne,ve,v]);const Pe=!J&&t.editingMode===Y&&!b,Ze=J?0:re.filter((e=>e.isIndex)).length;return i.useEffect((()=>{setTimeout((()=>{if(k.current&&M.current){var e,t;const n=null===(e=k.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(L(n.height>k.current.clientHeight),j(n.width>k.current.clientWidth))}}),1)}),[We,ee,Ae]),(0,I.jsxs)(Ht,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:P,ref:k,onMouseDown:e=>{if(k.current&&P){const t=k.current.getBoundingClientRect();W&&t.height-7<e.clientY-t.top&&e.stopPropagation(),V&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{A||B||e.currentTarget.contains(e.relatedTarget)||ve(!0,!0)},children:[(0,I.jsxs)(_,{isFullScreen:y,disableFullscreenMode:w,locked:ge&&!ce||be||B&&A,onExpand:x,onCollapse:C,target:Ht,children:[(ce&&ge||he&&fe)&&(0,I.jsx)(N,{label:"Clear selection",icon:a.x,onClick:()=>{ve(),Ne()}}),Pe&&ge&&(0,I.jsx)(N,{label:"Delete row(s)",icon:s.H,onClick:()=>{Te&&(Te(ue),Ne())}}),Pe&&!ge&&(0,I.jsx)(N,{label:"Add row",icon:d.m,onClick:()=>{ke&&(z(!0),ke(),Ne())}}),!K&&!J&&(0,I.jsx)(N,{label:"Download as CSV",icon:u.k,onClick:()=>Ee()}),!J&&(0,I.jsx)(N,{label:"Search",icon:c.o,onClick:()=>{H?$(!1):(z(!0),$(!0)),Ne()}})]}),(0,I.jsx)(l.e,{"data-testid":"stDataFrameResizable",ref:S,defaultSize:We,style:{border:`1px solid ${T.borderColor}`,borderRadius:`${D}`},minHeight:He,maxHeight:$e,minWidth:Ve,maxWidth:Le,size:We,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Tt],snapGap:Tt/3,onResizeStop:(e,t,n,i)=>{S.current&&je({width:S.current.size.width,height:$e-S.current.size.height===kt?S.current.size.height+kt:S.current.size.height})},children:(0,I.jsx)(r.F,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:M,columns:Ae,rows:J?1:ee,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:Tt,headerHeight:Tt,getCellContent:J?Be:se,onColumnResize:B?void 0:ze,resizeIndicator:"header",freezeColumns:Ze,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:B?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:_e,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&($((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:H,onSearchClose:()=>{$(!1),Ne()},onHeaderClicked:(e,t)=>{J||K||he||(ce&&ge&&ve(),le(e))},gridSelection:ue,onGridSelectionChange:e=>{(A||B)&&(ye(e),void 0!==Ie&&Ne())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&A?z(!1):"out-of-bounds"===e.kind||A||z(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...P&&{paddingBottom:W?-6:void 0,paddingRight:V?-6:void 0}},drawCell:Oe,customRenderers:De,imageEditorOverride:Ot,headerIcons:R,validateCell:Re,onPaste:!1,...ce&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:me?"multi":"auto",rowSelect:b?"none":me?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...he&&{columnSelect:b?"none":pe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!J&&t.editingMode!==Z&&!b&&{fillHandle:!B,onCellEdited:Se,onPaste:Me,onDelete:Te},...!J&&t.editingMode===Y&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:"multi",rowSelect:b?"none":"multi",onRowAppended:b?void 0:ke,onHeaderClicked:void 0}})}),Ie&&Ie.content&&(0,I.jsx)(zt,{top:Ie.top,left:Ie.left,content:Ie.content,clearTooltip:Ne})]})}),!0)},87814:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8536],{72394:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>R});var o=i(66845),s=i(70145),n=i(97365),r=i(62813),a=i.n(r),l=i(3717),h=i(25621),d=i(88766),c=i(699),p=i(96260),m=i(24002),u=i(29378),g=i(80248),x=i(87072),w=i(12879),b=i(47203),y=i(61355),S=i(56264),v=i(19754),f=i(27466),k=i(23593),j=i(13005),T=i.n(j),C=i(73587),z=i(63765),E=i(16295),F=i(72012),V=i(66694),Z=i(82309),I=i(40864);const O=e=>{let{error:t,width:i,deltaType:o}=e;return t instanceof D?(0,I.jsx)(Z.Z,{width:i,name:"No Mapbox token provided",message:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("p",{children:["To use ",(0,I.jsxs)("code",{children:["st.",o]})," or ",(0,I.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,I.jsxs)("p",{children:["To get a token, create an account at"," ",(0,I.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,I.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,I.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,I.jsxs)("p",{children:["See"," ",(0,I.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof M?(0,I.jsx)(Z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("p",{children:"This app requires an internet connection."}),(0,I.jsx)("p",{children:"Please check your connection and try again."}),(0,I.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,I.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,I.jsx)(Z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:t.message})};class D extends Error{}class M extends Error{}const P="https://data.streamlit.io/tokens.json",J="mapbox",W=e=>t=>{class i extends o.PureComponent{constructor(i){super(i),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await C.Z.get(P),{[J]:t}=e.data;if(!t)throw new Error(`Missing token ${J}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,z.b)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new M(`${t.message} (${P})`)}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:s}=this.state,{width:n}=this.props;return o?(0,I.jsx)(O,{width:n,error:o,deltaType:e}):s?(0,I.jsx)(F.O,{element:E.Od.create({style:E.Od.SkeletonStyle.ELEMENT})}):(0,I.jsx)(t,{...this.props,mapboxToken:i,width:n})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return i.displayName=`withMapboxToken(${t.displayName||t.name})`,i.contextType=V.E,T()(i,t)};var L=i(1515);const H=(0,L.Z)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:i,theme:o}=e;return{marginTop:o.spacing.sm,position:"relative",height:i,width:t}}),""),N=(0,L.Z)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:1,"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"& span":{filter:(0,f.Iy)(t)?"":"invert(100%)"}}}}),"");i(79259);const $={classes:{...u,...w,...x,...b,CartoLayer:d.Z},functions:{colorBins:c.Z,colorCategories:p.Z,colorContinuous:m.Z}};(0,v.fh)([y.w,S.E]);const B=new g.Z({configuration:$});class _ extends o.PureComponent{constructor(){super(...arguments),this.state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{},id:void 0,pydeckJson:void 0,isFullScreen:!1,isLightTheme:(0,f.Iy)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=e=>{const{element:t}=this.props;if(!e||!e.object||!t.tooltip)return!1;const i=n.Z.parse(t.tooltip);return i.html?i.html=this.interpolate(e,i.html):i.text=this.interpolate(e,i.text),i},this.interpolate=(e,t)=>{const i=t.match(/{(.*?)}/g);return i&&i.forEach((i=>{const o=i.substring(1,i.length-1);e.object.hasOwnProperty(o)?t=t.replace(i,e.object[o]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(o)&&(t=t.replace(i,e.object.properties[o]))})),t},this.onViewStateChange=e=>{let{viewState:t}=e;this.setState({viewState:t})}}static getDerivedStateFromProps(e,t){const i=_.getDeckObject(e,t);if(!a()(i.initialViewState,t.initialViewState)){const e=Object.keys(i.initialViewState).reduce(((e,o)=>i.initialViewState[o]===t.initialViewState[o]?e:{...e,[o]:i.initialViewState[o]}),{});return{viewState:{...t.viewState,...e},initialViewState:i.initialViewState}}return null}render(){const e=_.getDeckObject(this.props,this.state),{viewState:t}=this.state,{width:i}=this.props;return(0,I.jsx)(H,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:i,height:e.initialViewState.height,children:(0,I.jsxs)(s.Z,{viewState:t,onViewStateChange:this.onViewStateChange,height:e.initialViewState.height,width:i,layers:this.state.initialized?e.layers:[],getTooltip:this.createTooltip,ContextProvider:l.X$.Provider,controller:!0,children:[(0,I.jsx)(l.Z3,{height:e.initialViewState.height,width:i,mapStyle:e.mapStyle&&("string"===typeof e.mapStyle?e.mapStyle:e.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,I.jsx)(N,{children:(0,I.jsx)(l.Pv,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})})}}_.getDeckObject=(e,t)=>{var i,o;const{element:s,width:r,height:a,theme:l,isFullScreen:h}=e,d=null!==h&&void 0!==h&&h;var c,p,m;(s.id===t.id&&t.isFullScreen===d&&t.isLightTheme===(0,f.Iy)(l)||(t.pydeckJson=n.Z.parse(s.json),t.id=s.id),null!==(i=t.pydeckJson)&&void 0!==i&&i.mapStyle||(t.pydeckJson.mapStyle=`mapbox://styles/mapbox/${(0,f.Iy)(l)?"light":"dark"}-v9`),h)?Object.assign(null===(c=t.pydeckJson)||void 0===c?void 0:c.initialViewState,{width:r,height:a}):(null!==(p=t.pydeckJson)&&void 0!==p&&null!==(m=p.initialViewState)&&void 0!==m&&m.height||(t.pydeckJson.initialViewState.height=500),s.useContainerWidth&&(t.pydeckJson.initialViewState.width=r));return t.isFullScreen=h,t.isLightTheme=(0,f.Iy)(l),null===(o=t.pydeckJson)||void 0===o||delete o.views,B.convert(t.pydeckJson)};const R=(0,h.b)(W("st.pydeck_chart")((0,k.Z)(_)))},23593:(e,t,i)=>{"use strict";i.d(t,{Z:()=>w});var o=i(66845),s=i(13005),n=i.n(s),r=i(25621),a=i(82218),l=i(97781),h=i(46927),d=i(66694),c=i(1515);const p=(0,c.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:i}=e;const o=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:i.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:i.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:i.colors.fadedText60,borderRadius:"50%",...o,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:i.colors.bodyText,transition:"none"}}}),""),m=(0,c.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:i}=e;return{"&:hover":{[p]:{opacity:1,transform:"scale(1)",transition:"none"}},...i?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var u=i(40864);class g extends o.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels(this.props.theme.sizes.fullScreenHeaderHeight);return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:i}=this.state,{children:o,width:s,height:n,disableFullscreenMode:r}=this.props;let d=a.d,c=this.zoomIn,g="View fullscreen";return e&&(d=l.m,c=this.zoomOut,g="Exit fullscreen"),(0,u.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,u.jsx)(p,{"data-testid":"StyledFullScreenButton",onClick:c,title:g,isExpanded:e,children:(0,u.jsx)(h.Z,{content:d})}),o(e?{width:t,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:s,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=d.E;const x=(0,r.b)(g);const w=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class i extends o.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:i,height:o,disableFullscreenMode:s}=this.props;return(0,u.jsx)(x,{width:i,height:o,disableFullscreenMode:t||s,children:t=>{let{width:i,height:o,expanded:s,expand:n,collapse:r}=t;return(0,u.jsx)(e,{...this.props,width:i,height:o,isFullScreen:s,expand:n,collapse:r})}})}}}return i.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,n()(i,e)}},72709:()=>{},72672:()=>{}}]);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});r(66845);var n=r(50641),o=r(86659),i=r(1515);const s=r(7865).F4`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,a=(0,i.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(40864);const u=t=>{let{dirty:e,value:r,maxLength:i,className:s,type:u="single",inForm:c}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=c?"submit form":"apply";if("multiline"===u){p(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===u&&p(`Press Enter to ${t}`)}return i&&("chat"!==u||e)&&p(`${r.length}/${i}`,e&&r.length>=i),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(70479),i=r.n(o),s=r(82534),a=r(25621),l=r(16295),u=r(87814),c=r(79986),d=r(98478),p=r(86659),h=r(8879),f=r(68411),m=r(50641);const y=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(40864);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new u.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,m.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,m.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===l.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a,theme:l}=this.props,{placeholder:u}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(d.O,{label:n.label,disabled:i,labelVisibility:(0,m.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(p.dT,{children:(0,b.jsx)(h.Z,{content:n.help,placement:f.u.TOP_RIGHT})})}),(0,b.jsx)(s.Z,{value:null!==r&&void 0!==r?r:"",placeholder:u,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}}}}),o>l.breakpoints.hideWidgetDetails&&(0,b.jsx)(c.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,m.$b)({formId:n.formId})})]})}}const v=(0,a.b)(g)},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>S});var n=r(66845),o=r(80318),i=r(32510),s=r(9656),a=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j(t);if(e){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}function w(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(j,t);var e,r,u,f=g(j);function j(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,j);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return w(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),w(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),w(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=j,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),j=h((0,o.jb)(f,a.fC),2),w=j[0],O=j[1],S=h((0,o.jb)(y,a.Fp),2),E=S[0],P=S[1],x=h((0,o.jb)(b,a.Fp),2),W=x[0],I=x[1],T=(0,i.t)(this.props,this.state);return n.createElement(w,p({"data-baseweb":"input"},T,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),C(e)&&n.createElement(E,p({},T,P,{$position:l.Xf.start}),"function"===typeof e?e(T):e),n.createElement(s.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),C(r)&&n.createElement(W,p({},T,I,{$position:l.Xf.end}),"function"===typeof r?r(T):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),j}(n.Component);function F(t,e){return C(t)&&C(e)?l.y4.both:C(t)?l.y4.left:C(e)?l.y4.right:l.y4.none}function C(t){return Boolean(t||0===t)}w(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const S=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
|