@stlite/desktop 0.62.1 → 0.62.2

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.
Files changed (58) hide show
  1. package/build/asset-manifest.json +29 -29
  2. package/build/electron/worker.js +11 -18
  3. package/build/index.html +1 -1
  4. package/build/static/css/main.fc8432ac.css +1 -0
  5. package/build/static/js/1046.ac5578f7.chunk.js +1 -0
  6. package/build/static/js/1122.6e3ebec6.chunk.js +1 -0
  7. package/build/static/js/144.9af66e13.chunk.js +1 -0
  8. package/build/static/js/188.b2d8398c.chunk.js +1 -0
  9. package/build/static/js/2664.eabe48f2.chunk.js +1 -0
  10. package/build/static/js/2873.fef955fd.chunk.js +1 -0
  11. package/build/static/js/2940.d2fb8fd8.chunk.js +1 -0
  12. package/build/static/js/{4021.50e4fad7.chunk.js → 4021.8fb78041.chunk.js} +1 -1
  13. package/build/static/js/4482.98a18a0a.chunk.js +17 -0
  14. package/build/static/js/4494.322ddf1c.chunk.js +1 -0
  15. package/build/static/js/4724.db036438.chunk.js +5 -0
  16. package/build/static/js/4831.1e1e6a8e.chunk.js +5 -0
  17. package/build/static/js/5299.37cca9f0.chunk.js +9 -0
  18. package/build/static/js/6802.07e6658b.chunk.js +1 -0
  19. package/build/static/js/698.f3d5f888.chunk.js +1 -0
  20. package/build/static/js/7125.44ce1822.chunk.js +1 -0
  21. package/build/static/js/7579.36786736.chunk.js +1 -0
  22. package/build/static/js/7696.21dc1df4.chunk.js +1 -0
  23. package/build/static/js/{8186.383ded78.chunk.js → 8186.a240968d.chunk.js} +2 -2
  24. package/build/static/js/8798.21c608b2.chunk.js +1 -0
  25. package/build/static/js/8853.aba4297d.chunk.js +5 -0
  26. package/build/static/js/9001.10d51d69.chunk.js +1 -0
  27. package/build/static/js/9005.95d4ec49.chunk.js +5 -0
  28. package/build/static/js/9813.a1d01534.chunk.js +1 -0
  29. package/build/static/js/{9846.e3403599.chunk.js → 9846.7f2d71be.chunk.js} +1 -1
  30. package/build/static/js/main.802bd251.js +28 -0
  31. package/package.json +4 -4
  32. package/wheels/streamlit-1.36.0-cp312-none-any.whl +0 -0
  33. package/build/static/css/main.6fb7674e.css +0 -1
  34. package/build/static/js/1046.3bed3c50.chunk.js +0 -1
  35. package/build/static/js/1122.1fd3187d.chunk.js +0 -1
  36. package/build/static/js/144.546cefc4.chunk.js +0 -1
  37. package/build/static/js/188.d9018bc1.chunk.js +0 -1
  38. package/build/static/js/2664.219ef364.chunk.js +0 -1
  39. package/build/static/js/2873.86ab0f7f.chunk.js +0 -1
  40. package/build/static/js/2940.a8dfa8f6.chunk.js +0 -1
  41. package/build/static/js/4482.6da0ecb0.chunk.js +0 -1
  42. package/build/static/js/4494.280a2293.chunk.js +0 -1
  43. package/build/static/js/4724.85ca8f57.chunk.js +0 -1
  44. package/build/static/js/4831.a2c2c8ad.chunk.js +0 -1
  45. package/build/static/js/5299.478bd9da.chunk.js +0 -1
  46. package/build/static/js/6802.e50f982c.chunk.js +0 -1
  47. package/build/static/js/698.e345ddd0.chunk.js +0 -1
  48. package/build/static/js/7125.b89dc54f.chunk.js +0 -1
  49. package/build/static/js/7579.0cee4fc7.chunk.js +0 -1
  50. package/build/static/js/7696.82915710.chunk.js +0 -1
  51. package/build/static/js/8798.108f543f.chunk.js +0 -1
  52. package/build/static/js/8853.7b55e9e4.chunk.js +0 -1
  53. package/build/static/js/9001.18ff903a.chunk.js +0 -1
  54. package/build/static/js/9005.36ad4e5c.chunk.js +0 -1
  55. package/build/static/js/9813.151e8692.chunk.js +0 -1
  56. package/build/static/js/main.eea22731.js +0 -20
  57. /package/build/static/js/{8186.383ded78.chunk.js.LICENSE.txt → 8186.a240968d.chunk.js.LICENSE.txt} +0 -0
  58. /package/build/static/js/{main.eea22731.js.LICENSE.txt → main.802bd251.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[188],{10266:(e,t,n)=>{n.d(t,{Z:()=>b});var i=n(5057),o=n(56129),l=n.n(o),r=n(47206),a=n(53136),s=n(88916),d=n(73401),c=n(31808),u=n(82160);const m=(0,u.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,u.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:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var p=n(96266);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("2.875rem");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:l,disableFullscreenMode:r}=this.props;let c=a.d,u=this.zoomIn,g="View fullscreen";return e&&(c=s.m,u=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:u,title:g,isExpanded:e,children:(0,p.jsx)(d.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:l,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const f=(0,r.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:l,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:l,collapse:r})}})}}}return n.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,l()(n,e)}},32472:(e,t,n)=>{n.r(t),n.d(t,{default:()=>zt});var i=n(5057),o=n(43128),l=n(6095),r=n(27179),a=n(99430),s=n(23046),d=n(30383),c=n(61078),u=n(83221),m=n(52955),h=n(10266),p=n(60913),g=n(50120),f=n(47206),b=n(18932),v=n(93576),y=n(2648),w=n(98790),x=n(38830),C=n(44088),E=n(73401),S=n(82160),M=n(17966);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 N=n(96266);function I(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const l=(0,f.u)(),r=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(w.Z,{content:(0,N.jsx)(y.ZP,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:w.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(x.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:C.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(E.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),r&&(0,N.jsx)("span",{children:r})]})})})}const _=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:l,target:r,disableFullscreenMode:a}=e;return(0,N.jsx)(T,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:r,children:(0,N.jsxs)(R,{children:[l,t&&!a&&!i&&(0,N.jsx)(I,{label:"Fullscreen",icon:b.i,onClick:()=>t()}),n&&!a&&i&&(0,N.jsx)(I,{label:"Close fullscreen",icon:v.m,onClick:()=>n()})]})})};var O=n(31808),D=n(26849),A=n.n(D),F=n(40807),z=n.n(F),$=n(61918),V=n.n($),H=n(59500),L=n(88084),W=n.n(L),j=(n(56719),n(21763),n(55490));const B=["true","t","yes","y","on","1"],P=["false","f","no","n","off","0"];function Z(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 Y(e){return e.hasOwnProperty("isError")&&e.isError}function U(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function q(){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 J(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function K(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 G(e,t){return(0,g.le)(e)?t||{}:(0,g.le)(t)?e||{}:z()(e,t)}function X(e){if((0,g.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),"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:Q(e))):[Q(t)]}catch(t){return[Q(e)]}}function Q(e){try{try{return A()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return`[${typeof e}]`}}function ee(e){if((0,g.le)(e))return null;if("boolean"===typeof e)return e;const t=Q(e).toLowerCase().trim();return""===t?null:!!B.includes(t)||!P.includes(t)&&void 0}function te(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=V().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 ne(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,g.le)(t)||""===t?(0===n&&(e=Math.round(e)),V()(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[")?j.fu.formatPeriodType(BigInt(e),t):(0,H.sprintf)(t,e)}function ie(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 oe(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 le(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 re=new RegExp(/(\r\n|\n|\r)/gm);function ae(e){return-1!==e.indexOf("\n")?e.replace(re," "):e}var se=n(70714);function de(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)?Q(e):null,i=(0,g.bb)(n)?ae(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,g.le)(e)}}catch(n){return Z(Q(e),`The value cannot be interpreted as a string. Error: ${n}`)}},getCellValue:e=>void 0===e.data?null:e.data}}de.isEditableType=!1;const ce=de;function ue(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n=`Invalid validate regex: ${t.validate}.\nError: ${r}`}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},l=i=>{if((0,g.le)(i))return!e.isRequired;let o=Q(i),l=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),l=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!l||o)};return{...e,kind:"text",sortMode:"default",validateInput:l,getCell(e,t){if("string"===typeof n)return Z(Q(e),n);if(t){const t=l(e);if(!1===t)return Z(Q(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,g.bb)(e)?Q(e):null,n=(0,g.bb)(t)?ae(t):"";return{...i,isMissingValue:(0,g.le)(t),data:t,displayData:n}}catch(r){return Z("Incompatible value",`The value cannot be interpreted as string. Error: ${r}`)}},getCellValue:e=>void 0===e.data?null:e.data}}ue.isEditableType=!0;const me=ue;function he(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function pe(e,t,n,i,l,r,a){var s;const d=G({format:n,step:i,timezone:a},t.columnTypeOptions);let c,u,m;if((0,g.bb)(d.timezone))try{var h;c=(null===(h=he(W()(),d.timezone))||void 0===h?void 0:h.utcOffset())||void 0}catch(b){}(0,g.bb)(d.min_value)&&(u=oe(d.min_value)||void 0),(0,g.bb)(d.max_value)&&(m=oe(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:l,min:u,max:m}},f=e=>{const n=oe(e);return null===n?!t.isRequired:void 0!==n&&(!((0,g.bb)(u)&&r(n)<r(u))&&!((0,g.bb)(m)&&r(n)>r(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return Z(Q(e),"Invalid input.");t instanceof Date&&(e=t)}const i=oe(e);let o="",l="",r=c;if(void 0===i)return Z(Q(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=W().utc(i);if(!e.isValid())return Z(Q(i),`This should never happen. Please report this bug. \nError: ${e.toString()}`);if(d.timezone){try{e=he(e,d.timezone)}catch(b){return Z(e.toISOString(),`Failed to adjust to the provided timezone: ${d.timezone}. \nError: ${b}`)}r=e.utcOffset()}try{l=ie(e,d.format||n)}catch(b){return Z(e.toISOString(),`Failed to format the date for rendering with: ${d.format}. \nError: ${b}`)}o=ie(e,n)}return{...p,copyData:o,isMissingValue:(0,g.le)(i),data:{...p.data,date:i,displayDate:l,timezoneOffset:r}}},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:r(e.data.date)}}}function ge(e){var t,n,i,o,l;let r="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(r="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===(l=e.columnTypeOptions)||void 0===l?void 0:l.timezone);return pe("datetime",e,s?r+"Z":r,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function fe(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"),pe("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function be(e){return pe("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function ve(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=ee(e),void 0===n?Z(Q(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}}ge.isEditableType=!0,fe.isEditableType=!0,be.isEditableType=!0,ve.isEditableType=!0;const ye=ve;function we(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function xe(e){const t=j.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=G({step:we(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),l=(0,g.le)(i.min_value)||i.min_value<0,r=(0,g.bb)(i.step)&&!Number.isNaN(i.step)?le(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:l,fixedDecimals:r,thousandSeparator:""},s=t=>{let n=te(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 Z(Q(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=te(e),o="";if((0,g.bb)(n)){if(Number.isNaN(n))return Z(Q(e),"The value cannot be interpreted as a number.");if((0,g.bb)(r)&&(l=n,n=0===(d=r)?Math.trunc(l):Math.trunc(l*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return Z(Q(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=ne(n,i.format,r)}catch(c){return Z(Q(n),(0,g.bb)(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${c}`:`Failed to format the number. Error: ${c}`)}}var l,d;return{...a,data:n,displayData:o,isMissingValue:(0,g.le)(n),copyData:(0,g.le)(n)?"":Q(n)}},getCellValue:e=>void 0===e.data?null:e.data}}xe.isEditableType=!0;const Ce=xe;function Ee(e){let t="string";const n=G({options:"bool"===j.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 l={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>Q(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,g.bb)(e)&&""!==e&&(n=Q(e)),t&&!l.data.allowedValues.includes(n)?Z(Q(n),"The value is not part of the allowed options."):{...l,isMissingValue:null===n,copyData:n||"",data:{...l.data,value:n}}},getCellValue(e){var n,i,o,l,r,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!==(l=te(null===(r=e.data)||void 0===r?void 0:r.value))&&void 0!==l?l:null:"boolean"===t?null!==(a=ee(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}}}Ee.isEditableType=!0;const Se=Ee;function Me(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)?[]:X(e);return{...t,data:n,isMissingValue:(0,g.le)(e),copyData:(0,g.le)(e)?"":Q(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,g.le)(e.data)||U(e)?null:e.data}}Me.isEditableType=!1;const ke=Me;function Te(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 Re(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===j.fu.getTypeName(n)&&(o=!1),{id:`index-${t}`,name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Ne(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"===j.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 Ie(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?j.fu.getTypeName(e.arrowType):null;let l;if("object"===e.kind)l=e.getCell((0,g.bb)(t.content)?ae(j.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 r,a;let n;var s,d,c;if("time"===i&&(0,g.bb)(null===(r=t.field)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.unit))n=W().unix(j.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(c=d.type)||void 0===c?void 0:c.unit)&&void 0!==s?s:0)).utc().toDate();else n=W().utc(Number(t.content)).toDate();l=e.getCell(n)}else if("decimal"===i){const n=(0,g.le)(t.content)?null:j.fu.format(t.content,t.contentType,t.field);l=e.getCell(n)}else l=e.getCell(t.content);if(Y(l))return l;if(!e.isEditable){if((0,g.bb)(t.displayContent)){var u;const e=ae(t.displayContent);l.kind===o.p6.Text||l.kind===o.p6.Number||l.kind===o.p6.Uri?l={...l,displayData:e}:l.kind===o.p6.Custom&&"date-picker-cell"===(null===(u=l.data)||void 0===u?void 0:u.kind)&&(l={...l,data:{...l.data,displayDate:e}})}n&&t.cssId&&(l=function(e,t,n){const i={},o=Te(t,"color",n);o&&(i.textDark=o);const l=Te(t,"background-color",n);return l&&(i.bgCell=l),"yellow"===l&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(l,t.cssId,n))}return l}function _e(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 l={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},r=i=>{if((0,g.le)(i))return!e.isRequired;const o=Q(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:r,getCell(e,o){if((0,g.le)(e))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return Z(Q(s),n);if(o){if(!1===r(s))return Z(Q(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),{...l,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}}_e.isEditableType=!0;const Oe=_e;function De(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)?[Q(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]}}De.isEditableType=!1;const Ae=De;function Fe(e){const t=we(j.fu.getTypeName(e.arrowType)),n=G({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=ne(n.max_value,n.format)}catch(a){i=Q(n.max_value)}const l=(0,g.le)(n.step)||Number.isNaN(n.step)?void 0:le(n.step),r={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 q();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 Z("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 Z("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const t=te(e);if(Number.isNaN(t)||(0,g.le)(t))return Z(Q(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return Z(Q(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=ne(t,n.format,l)}catch(a){return Z(Q(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{...r,isMissingValue:(0,g.le)(e),copyData:String(t),data:{...r.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}}}Fe.isEditableType=!1;const ze=Fe;function $e(e,t,n){const i=G({y_min:0,y_max:1},t.columnTypeOptions),l={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 Z("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 q();const t=X(e),n=[];let o=[];if(0===t.length)return q();let r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=te(t[i]);if(Number.isNaN(e)||(0,g.le)(e))return Z(Q(t),`The value cannot be interpreted as a numeric array. ${Q(e)} is not a number.`);e>r&&(r=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(r>i.y_max||a<i.y_min)?n.map((e=>r-a===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(r-a))+(i.y_min||0))):n,{...l,copyData:n.join(","),data:{...l.data,values:o,displayValues:n.map((e=>ne(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 Ve(e){return $e("line_chart",e,"line")}function He(e){return $e("bar_chart",e,"bar")}function Le(e){return $e("area_chart",e,"area")}Ve.isEditableType=!1,He.isEditableType=!1,Le.isEditableType=!1;const We=new Map(Object.entries({object:ce,text:me,checkbox:ye,selectbox:Se,list:ke,number:Ce,link:Oe,datetime:ge,date:be,time:fe,line_chart:Ve,bar_chart:He,area_chart:Le,image:Ae,progress:ze})),je=[],Be="_index",Pe="_pos:",Ze={small:75,medium:200,large:400};function Ye(e){if(!(0,g.le)(e))return"number"===typeof e?e:e in Ze?Ze[e]:void 0}function Ue(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Be?n=t.get(e.name):t.has(`${Pe}${e.indexNumber}`)?n=t.get(`${Pe}${e.indexNumber}`):e.isIndex&&t.has(Be)&&(n=t.get(Be)),n?z()({...e},{title:n.label,width:Ye(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 qe(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,g.bb)(n)&&(We.has(n)?i=We.get(n):(0,se.KE)(`Unknown column type configured in column configuration: ${n}`)),(0,g.le)(i)&&(i=function(e){let t=e?j.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?me:["datetime","datetimetz"].includes(t)?ge:"time"===t?fe:"date"===t?be:["object","bytes"].includes(t)?ce:["bool"].includes(t)?ye:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?Ce:"categorical"===t?Se:t.startsWith("list")?ke:ce):ce}(e.arrowType)),i}const Je=function(e,t,n){const o=(0,f.u)(),l=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,se.H)(t),new Map}}(e.columns)),[e.columns]),r=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 l=0;l<i;l++){const n={...Re(e,l),indexNumber:l};t.push(n)}for(let l=0;l<o;l++){const n={...Ne(e,l),indexNumber:l+i};t.push(n)}return t}(t).map((t=>{let i={...t,...Ue(t,l),isStretched:r};const a=qe(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:[ce({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,l,r,n,e.editingMode,e.columnOrder,o])}};function Ke(e){return e.isIndex?Be:(0,g.le)(e.name)?"":e.name}const Ge=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 l={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(l[Ke(o)]=o.getCellValue(e))})),n.edited_rows[i]=l})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,l)=>{const r=t.get(n);if(r){const t=r.getCellValue(e);r.isRequired&&r.isEditable&&U(e)&&(o=!0),(0,g.bb)(t)&&(i[Ke(r)]=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(Ke(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],l=o.get(e);if(l){const e=l.getCell(n);var r;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(r=this.editedCells.get(t))||void 0===r||r.set(l.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],l=o.get(t);if(l){const e=l.getCell(i);e&&n.set(l.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 Xe=n(59990);const Qe=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,Xe.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Xe.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,Xe.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 et=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[l,r]=i;if(l>t.length-1)return Z("Column index out of bounds.","This should never happen. Please report this bug.");if(r>n-1)return Z("Row index out of bounds.","This should never happen. Please report this bug.");const a=t[l],s=a.indexNumber,d=o.current.getOriginalRowIndex(r),c=o.current.isAddedRow(d);if(a.isEditable||c){const e=o.current.getCell(s,d);if((0,g.bb)(e))return e;if(c)return Z("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 Ie(a,e.getCell(d+1,s),e.cssStyles)}catch(u){return Z("Error during cell creation.",`This should never happen. Please report this bug. \nError: ${u}`)}}),[t,n,e,o])}};var tt=n(71325);const nt=function(e,t,n){const[o,l]=i.useState(),{getCellContent:r,getOriginalIndex:a}=(0,tt.fF)({columns:t.map((e=>K(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 l(void 0);t="desc"}l({column:K(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:r}};var it=n(50482),ot=n.n(it);const lt=function(e,t,n,l,r){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)),c=d&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN)),m=u&&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=!ot()(e.rows.toArray(),a.rows.toArray()),n=!ot()(e.columns.toArray(),a.columns.toArray()),i=!ot()(e.current,a.current);let o=d&&t||u&&n,c=e;if((d||u)&&void 0!==e.current&&i&&(c={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(c={...c,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(c={...c,rows:a.rows},o=!0),n&&c.columns.length>=0){let e=c.columns;l.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<c.columns.length&&(c={...c,columns:e})}s(c),o&&r(c)}),[a,d,u,r,l]),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&&u)&&r(n)}),[a,d,u,r]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:c,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:m,isRowSelected:h,isColumnSelected:g,isCellSelected:f,clearSelection:v,processSelectionChange:b}},rt=",",at='"',st='"',dt="\n",ct="\ufeff",ut=new RegExp(`[${[rt,at,dt].join("")}]`);function mt(e){return e.map((e=>function(e){if((0,g.le)(e))return"";const t=Q(e);if(ut.test(t))return`${at}${t.replace(new RegExp(at,"g"),st+at)}${at}`;return t}(e))).join(rt)+dt}async function ht(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(ct));const l=n.map((e=>e.name));await e.write(o.encode(mt(l)));for(let r=0;r<i;r++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,r])))})),await e.write(o.encode(mt(i)))}await e.close()}const pt=function(e,t,o,l){return{exportToCsv:i.useCallback((async()=>{const i=`${(new Date).toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const l=await n.e(5599).then(n.bind(n,95599)),r=await l.showSaveFilePicker({suggestedName:i,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await r.createWritable();await ht(a,e,t,o)}catch(r){if(r instanceof Error&&"AbortError"===r.name)return;try{(0,se.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",r);let n="";const a=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await ht(a.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),c=document.createElement("a");l?c.setAttribute("target","_blank"):c.setAttribute("target","_self"),c.style.display="none",c.href=d,c.download=i,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(d)}catch(r){(0,se.H)("Failed to export data as CSV",r)}}}),[t,o,e,l])}};const gt=function(e,t,n,o,l,r,a,s,d){const c=i.useCallback(((t,i)=>{let[r,a]=t;const d=e[r];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(l(a)),m=o([r,a]),h=d.getCellValue(m),p=d.getCellValue(i);if(!Y(m)&&p===h)return;const g=d.getCell(p,!0);Y(g)?(0,se.KE)(`Not applying the cell edit since it causes this error:\n ${g.data}`):(n.current.setCell(c,u,{...g,lastUpdated:performance.now()}),s())}),[e,n,l,o,s]),u=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||(u(),s())}),[u,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(l(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]}),c([o,i],n.getCell(null)))}return t.length>0&&(s(),r(t)),!1}return!0}),[e,n,t,r,l,s,c,d,a]),p=i.useCallback(((i,a)=>{const[d,c]=i,m=[];for(let h=0;h<a.length;h++){const i=a[h];if(h+c>=n.current.getNumRows()){if(t)break;u()}for(let t=0;t<i.length;t++){const r=i[t],a=h+c,s=t+d;if(s>=e.length)break;const u=e[s];if(u.isEditable){const e=u.getCell(r,!0);if((0,g.bb)(e)&&!Y(e)){const t=u.indexNumber,i=n.current.getOriginalRowIndex(l(a)),r=u.getCellValue(o([s,a]));u.getCellValue(e)!==r&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),r(m))}return!1}),[e,n,t,l,o,u,s,r]),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:c,onPaste:p,onRowAppended:m,onDelete:h,validateCell:f}};const ft=function(e,t){const[n,o]=i.useState(),l=i.useRef(null),r=i.useCallback((n=>{if(clearTimeout(l.current),l.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],r=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,r]);s.isRequired&&s.isEditable&&U(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(l.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,l]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:r}};var bt=n(40047),vt=n(35185),yt=n(60353),wt=n(74625),xt=n(23213);const Ct=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:l,rect:r}=t,a=t.col;if(U(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,bt.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()}(l,r,o))}n()}),[e]),customRenderers:i.useMemo((()=>[vt.Z,yt.Z,wt.Z,xt.ZP,...je]),[])}};const Et=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,l)=>{e.id&&n(new Map(t).set(e.id,l))}),[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}},St=2,Mt=35,kt=50+St,Tt=2*Mt+St;const Rt=function(e,t,n,o,l){let r,a=function(e){return Math.max(e*Mt+St,Tt)}(t+1+(e.editingMode===p.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,Tt),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?r=n:e.width&&(r=Math.min(Math.max(e.width,kt),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:r||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:r||"100%",height:c.height})}),[r]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(l){const t=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:a})}else u({width:r||"100%",height:s})}),[l]),{minHeight:Tt,maxHeight:a,minWidth:kt,maxWidth:d,resizableSize:c,setResizableSize:u}},Nt=(0,S.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),It=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(Nt,{src:n})}):(0,N.jsx)(Nt,{src:n})};var _t=n(98399),Ot=n(73830),Dt=n(37661);const At=function(e){let{top:t,left:n,content:o,clearTooltip:l}=e;const[r,a]=i.useState(!0),s=(0,f.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{a(!1),l()}),[l,a]);return(0,N.jsx)(_t.Z,{content:(0,N.jsx)(Dt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(y.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:Ot.r4.top,accessibilityType:Ot.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,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:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ft=(0,S.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.default},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(27235),n(33091);const zt=(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}=Qe(),{libConfig:{enforceDownloadInNewTab:A=!1}}=i.useContext(O.E),[F,z]=i.useState(!0),[$,V]=i.useState(!1),[H,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),G=0===q&&!(t.editingMode===Y&&U.dataColumns>0),X=q>15e4,Q=i.useRef(new Ge(q)),[ee,te]=i.useState(Q.current.getNumRows());i.useEffect((()=>{Q.current=new Ge(q),te(Q.current.getNumRows())}),[q]);const ne=i.useCallback((()=>{Q.current=new Ge(q),te(Q.current.getNumRows())}),[q]),{columns:ie}=Je(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}=et(n,ie,ee,Q),{columns:le,sortColumn:re,getOriginalIndex:ae,getCellContent:se}=nt(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=>Ke(le[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,Ke]),{gridSelection:ce,isRowSelectionActivated:ue,isMultiRowSelectionActivated:me,isColumnSelectionActivated:he,isMultiColumnSelectionActivated:pe,isRowSelected:ge,isColumnSelected:fe,isCellSelected:be,clearSelection:ve,processSelectionChange:ye}=lt(t,G,b,le,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(!ue&&!he)return;const e=v.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,l,r;const t=le.map((e=>Ke(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===(l=a.selection)||void 0===l||null===(r=l.columns)||void 0===r||r.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(le);let n=v.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Ge(0).toJson([])),e!==n&&v.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},E)})),[t.id,t.formId,v,E,le,Q.current]),{exportToCsv:Ee}=pt(se,le,ee,A),{onCellEdited:Se,onPaste:Me,onRowAppended:ke,onDelete:Te,validateCell:Re}=gt(le,t.editingMode!==Y,Q,se,ae,we,xe,Ce,ve),{tooltip:Ne,clearTooltip:Ie,onItemHovered:_e}=ft(le,se),{drawCell:Oe,customRenderers:De}=Ct(le),Ae=i.useMemo((()=>le.map((e=>K(e)))),[le]),{columns:Fe,onColumnResize:ze}=Et(Ae),{minHeight:$e,maxHeight:Ve,minWidth:He,maxWidth:Le,resizableSize:We,setResizableSize:je}=Rt(t,ee,h,f,y),Be=i.useCallback((e=>{let[t,n]=e;return{...J(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(le.length-1,0)]}}),[le,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=!G&&t.editingMode===Y&&!b,Ze=G?0:le.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,Fe]),(0,N.jsxs)(Ft,{"data-testid":"stDataFrame",className:"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(),H&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{F||B||e.currentTarget.contains(e.relatedTarget)||ve(!0,!0)},children:[(0,N.jsxs)(_,{isFullScreen:y,disableFullscreenMode:w,locked:ge&&!ue||be||B&&F,onExpand:x,onCollapse:C,target:Ft,children:[(ue&&ge||he&&fe)&&(0,N.jsx)(I,{label:"Clear selection",icon:a.x,onClick:()=>{ve(),Ie()}}),Pe&&ge&&(0,N.jsx)(I,{label:"Delete row(s)",icon:s.H,onClick:()=>{Te&&(Te(ce),Ie())}}),Pe&&!ge&&(0,N.jsx)(I,{label:"Add row",icon:d.m,onClick:()=>{ke&&(z(!0),ke(),Ie())}}),!X&&!G&&(0,N.jsx)(I,{label:"Download as CSV",icon:c.k,onClick:()=>Ee()}),!G&&(0,N.jsx)(I,{label:"Search",icon:u.o,onClick:()=>{$?V(!1):(z(!0),V(!0)),Ie()}})]}),(0,N.jsx)(r.e,{"data-testid":"stDataFrameResizable",ref:S,defaultSize:We,style:{border:`1px solid ${T.borderColor}`,borderRadius:`${D}`},minHeight:$e,maxHeight:Ve,minWidth:He,maxWidth:Le,size:We,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Mt],snapGap:Mt/3,onResizeStop:(e,t,n,i)=>{S.current&&je({width:S.current.size.width,height:Ve-S.current.size.height===St?S.current.size.height+St:S.current.size.height})},children:(0,N.jsx)(l.F,{className:"glideDataEditor",ref:M,columns:Fe,rows:G?1:ee,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:Mt,headerHeight:Mt,getCellContent:G?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&&(V((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:$,onSearchClose:()=>{V(!1),Ie()},onHeaderClicked:(e,t)=>{G||X||he||(ue&&ge&&ve(),re(e))},gridSelection:ce,onGridSelectionChange:e=>{(F||B)&&(ye(e),void 0!==Ne&&Ie())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&F?z(!1):"out-of-bounds"===e.kind||F||z(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...P&&{paddingBottom:W?-6:void 0,paddingRight:H?-6:void 0}},drawCell:Oe,customRenderers:De,imageEditorOverride:It,headerIcons:R,validateCell:Re,onPaste:!1,...ue&&{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"},...!G&&t.editingMode!==Z&&!b&&{fillHandle:!B,onCellEdited:Se,onPaste:Me,onDelete:Te},...!G&&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}})}),Ne&&Ne.content&&(0,N.jsx)(At,{top:Ne.top,left:Ne.left,content:Ne.content,clearTooltip:Ie})]})}),!0)},52955:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=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
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[2664],{82664:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(5057),i=o(47206),s=o(5361),a=o(7329),r=o(79220),l=o(50482),d=o.n(l),c=o(50120),h=o(70714),u=o(10266),m=o(64327),g=o(52955),p=o(55490);const f={DATAFRAME_INDEX:"(index)"},b=new Set([p.GI.DatetimeIndex,p.GI.Float64Index,p.GI.Int64Index,p.GI.RangeIndex,p.GI.UInt64Index]);function v(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const o={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;o[t]=e.data})),o}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=e.dimensions,s=p.fu.getTypeName(e.types.index[0]),a=b.has(s);for(let r=t;r<n;r++){const t={};if(a){const o=e.getIndexValue(r,0);t[f.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=e.getDataValue(r,o),i=e.types.data[o],s=p.fu.getTypeName(i);if("datetimetz"!==s&&(n instanceof Date||Number.isFinite(n))&&(s.startsWith("datetime")||"date"===s)){const i=60*new Date(n).getTimezoneOffset()*1e3;t[e.columns[0][o]]=n.valueOf()+i}else t[e.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(t)}return o}var y=o(40807),x=o.n(y),S=o(71486),F=o.n(S),C=o(17966);function z(e,t){const o={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.ny)(t),domain:!1,domainWidth:1,domainColor:(0,C.ny)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:t.spacing.lgPx,labelPadding:t.spacing.lgPx,labelSeparation:t.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.Xy)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.iY)(t),diverging:(0,C.ru)(t),ramp:(0,C.Gy)(t),heatmap:(0,C.Gy)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.Iy)(t)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:t.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?F()({},o,e,((e,t)=>Array.isArray(t)?t:void 0)):o}const W=(0,o(82160).Z)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:o,isFullScreen:n}=e;return{width:o||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:t.zIndices.popupMenu,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText},"a:hover":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25}}}}}),"");var V=o(96266);const I="source";class D extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=I,this.element=null,this.formClearHelper=new g.K,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:o,theme:n,isFullScreen:i,width:s,height:a}=this.props,r=JSON.parse(o.spec),{useContainerWidth:l}=o;if("streamlit"===o.vegaLiteTheme?r.config=z(r.config,n):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=z(r.config,n),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:o,fontSizes:n,genericFonts:i}=t,s={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},a={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,C.ny)(t),...s},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...s},title:{color:o.bodyText,subtitleColor:o.bodyText,...s},header:{labelColor:o.bodyText,titleColor:o.bodyText,...s},view:{stroke:(0,C.ny)(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?x()({},a,e):a}(r.config,n),i?(r.width=s,r.height=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))):l&&(r.width=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))),r.padding||(r.padding={}),null==r.padding.bottom&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return o.selectionMode.length>0&&function(e){"params"in e&&"encoding"in e&&e.params.forEach((t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&"point"===t.select.type&&!("encodings"in t.select)&&(0,c.le)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.bb)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.KE)("Failed to restore view state",i)}t.selectionMode.forEach(((o,n)=>{var i;null===(i=this.vegaView)||void 0===i||i.addSignalListener(o,(0,c.Ds)(150,((o,n)=>{var i;const s=null===(i=this.vegaView)||void 0===i?void 0:i.getState({data:(e,o)=>t.selectionMode.some((t=>`${t}_store`===e)),recurse:!1});(0,c.bb)(s)&&e.setElementState(t.id,"viewState",s);let a=n;"vlPoint"in n&&"or"in n.vlPoint&&(a=n.vlPoint.or);const r=JSON.parse(e.getStringValue(t)||"{}"),l={selection:{...(null===r||void 0===r?void 0:r.selection)||{},[o]:a||{}}};d()(r,l)||e.setStringValue(t,JSON.stringify(l),{fromUi:!0},this.props.fragmentId)})))}));const n=()=>{const o={selection:{}};this.props.element.selectionMode.forEach((e=>{o.selection[e]={}}));const n=e.getStringValue(t),i=n?JSON.parse(n):o;var s;d()(i,o)||(null===(s=this.props.widgetMgr)||void 0===s||s.setStringValue(this.props.element,JSON.stringify(o),{fromUi:!0},this.props.fragmentId))};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,n)}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,m.b)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:o}=e,{element:n,theme:i}=this.props,s=t.spec,{spec:a}=n;if(!this.vegaView||s!==a||o!==i||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!d()(e.element.selectionMode,this.props.element.selectionMode)){(0,h.ji)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,m.b)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=v(t)||{},u=v(n)||{};for(const[d,h]of Object.entries(u)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))u.hasOwnProperty(d)||d===this.defaultDataName||this.updateData(d,null,null);this.vegaView.resize().runAsync()}updateData(e,t,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows)try{this.vegaView.remove(e,a.truthy)}finally{return}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,w(o));const{dataRows:n,dataColumns:i}=t.dimensions,{dataRows:s,dataColumns:r}=o.dimensions;!function(e,t,o,n,i,s){if(o!==s)return!1;if(t>=i)return!1;if(0===t)return!1;const a=s-1,r=t-1;return e.getDataValue(0,a)===n.getDataValue(0,a)&&e.getDataValue(r,a)===n.getDataValue(r,a)}(t,n,i,o,s,r)?(this.vegaView.data(e,w(o)),(0,h.ji)(`Had to clear the ${e} dataset before inserting data through Vega view.`)):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const{element:e}=this.props,t=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.ZP)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=v(e);if(null==t)return null;const o={};for(const[n,i]of Object.entries(t))o[n]=w(i);return o}(e),d=l?Object.keys(l):[];if(1===d.length){const[e]=d;this.defaultDataName=e}else 0===d.length&&n.data&&(this.defaultDataName=I);const c=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(c&&i.insert(this.defaultDataName,c),l)for(const[s,r]of Object.entries(l))i.insert(s,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,V.jsx)(W,{"data-testid":"stArrowVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,u.Z)(D))},10266:(e,t,o)=>{o.d(t,{Z:()=>b});var n=o(5057),i=o(56129),s=o.n(i),a=o(47206),r=o(53136),l=o(88916),d=o(73401),c=o(31808),h=o(82160);const u=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:o}=e;const n=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:o.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:o.colors.fadedText60,borderRadius:"50%",...n,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:o.colors.bodyText,transition:"none"}}}),""),m=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...o?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(96266);class p extends n.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("2.875rem");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:o}=this.state,{children:n,width:i,height:s,disableFullscreenMode:a}=this.props;let c=r.d,h=this.zoomIn,p="View fullscreen";return e&&(c=l.m,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.Z,{content:c})}),n(e?{width:t,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}p.contextType=c.E;const f=(0,a.b)(p);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class o extends n.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:o,height:n,disableFullscreenMode:i}=this.props;return(0,g.jsx)(f,{width:o,height:n,disableFullscreenMode:t||i,children:t=>{let{width:o,height:n,expanded:i,expand:s,collapse:a}=t;return(0,g.jsx)(e,{...this.props,width:o,height:n,isFullScreen:i,expand:s,collapse:a})}})}}}return o.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,s()(o,e)}},52955:(e,t,o)=>{o.d(t,{K:()=>i});var n=o(50120);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),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_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[2873],{32873:(e,o,t)=>{t.r(o),t.d(o,{default:()=>w});var l=t(5057),n=t(47206),i=t(66679),r=t(60913),s=t(10266),c=t(50120),a=t(52955),d=t(40807),p=t.n(d),u=t(17966),h=t(64327),m=t(70714);function f(e,o,t){return e=function(e,o){return(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll("#000032",(0,u.By)(o))).replaceAll("#000033",(0,u.He)(o))).replaceAll("#000034",(0,u.Iy)(o)?o.colors.blue80:o.colors.blue40)).replaceAll("#000035",(0,u.ny)(o))).replaceAll("#000036",(0,u.Xy)(o))).replaceAll("#000037",(0,u.yq)(o))).replaceAll("#000038",o.colors.bgColor)).replaceAll("#000039",o.colors.fadedText05)).replaceAll("#000040",o.colors.bgMix)}(e,o),e=function(e,o,t){const l="#000001",n="#000002",i="#000003",r="#000004",s="#000005",c="#000006",a="#000007",d="#000008",p="#000009",h="#000010";if("streamlit"===t){const t=(0,u.iY)(o);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,t[0])).replaceAll(n,t[1])).replaceAll(i,t[2])).replaceAll(r,t[3])).replaceAll(s,t[4])).replaceAll(c,t[5])).replaceAll(a,t[6])).replaceAll(d,t[7])).replaceAll(p,t[8])).replaceAll(h,t[9])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,"#636efa")).replaceAll(n,"#EF553B")).replaceAll(i,"#00cc96")).replaceAll(r,"#ab63fa")).replaceAll(s,"#FFA15A")).replaceAll(c,"#19d3f3")).replaceAll(a,"#FF6692")).replaceAll(d,"#B6E880")).replaceAll(p,"#FF97FF")).replaceAll(h,"#FECB52");return e}(e,o,t),e=function(e,o,t){const l="#000011",n="#000012",i="#000013",r="#000014",s="#000015",c="#000016",a="#000017",d="#000018",p="#000019",h="#000020";if("streamlit"===t){const t=(0,u.Gy)(o);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,t[0])).replaceAll(n,t[1])).replaceAll(i,t[2])).replaceAll(r,t[3])).replaceAll(s,t[4])).replaceAll(c,t[5])).replaceAll(a,t[6])).replaceAll(d,t[7])).replaceAll(p,t[8])).replaceAll(h,t[9])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,"#0d0887")).replaceAll(n,"#46039f")).replaceAll(i,"#7201a8")).replaceAll(r,"#9c179e")).replaceAll(s,"#bd3786")).replaceAll(c,"#d8576b")).replaceAll(a,"#ed7953")).replaceAll(d,"#fb9f3a")).replaceAll(p,"#fdca26")).replaceAll(h,"#f0f921");return e}(e,o,t),e=function(e,o,t){const l="#000021",n="#000022",i="#000023",r="#000024",s="#000025",c="#000026",a="#000027",d="#000028",p="#000029",h="#000030",m="#000031";if("streamlit"===t){const t=(0,u.ru)(o);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,t[0])).replaceAll(n,t[1])).replaceAll(i,t[2])).replaceAll(r,t[3])).replaceAll(s,t[4])).replaceAll(c,t[5])).replaceAll(a,t[6])).replaceAll(d,t[7])).replaceAll(p,t[8])).replaceAll(h,t[9])).replaceAll(m,t[10])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(l,"#8e0152")).replaceAll(n,"#c51b7d")).replaceAll(i,"#de77ae")).replaceAll(r,"#f1b6da")).replaceAll(s,"#fde0ef")).replaceAll(c,"#f7f7f7")).replaceAll(a,"#e6f5d0")).replaceAll(d,"#b8e186")).replaceAll(p,"#7fbc41")).replaceAll(h,"#4d9221")).replaceAll(m,"#276419");return e}(e,o,t),e}function y(e,o){try{!function(e,o){const{genericFonts:t,colors:l,fontSizes:n}=o,i={font:{color:(0,u.Xy)(o),family:t.bodyFont,size:n.twoSmPx},title:{color:l.headingColor,subtitleColor:l.bodyText,font:{family:t.headingFont,size:n.mdPx,color:l.headingColor},pad:{l:o.spacing.twoXSPx},xanchor:"left",x:0},legend:{title:{font:{size:n.twoSmPx,color:(0,u.Xy)(o)},side:"top"},valign:"top",bordercolor:l.transparent,borderwidth:o.spacing.nonePx,font:{size:n.twoSmPx,color:(0,u.yq)(o)}},paper_bgcolor:l.bgColor,plot_bgcolor:l.bgColor,yaxis:{ticklabelposition:"outside",zerolinecolor:(0,u.ny)(o),title:{font:{color:(0,u.Xy)(o),size:n.smPx},standoff:o.spacing.twoXLPx},tickcolor:(0,u.ny)(o),tickfont:{color:(0,u.Xy)(o),size:n.twoSmPx},gridcolor:(0,u.ny)(o),minor:{gridcolor:(0,u.ny)(o)},automargin:!0},xaxis:{zerolinecolor:(0,u.ny)(o),gridcolor:(0,u.ny)(o),showgrid:!1,tickfont:{color:(0,u.Xy)(o),size:n.twoSmPx},tickcolor:(0,u.ny)(o),title:{font:{color:(0,u.Xy)(o),size:n.smPx},standoff:o.spacing.xlPx},minor:{gridcolor:(0,u.ny)(o)},zeroline:!1,automargin:!0,rangeselector:{bgcolor:l.bgColor,bordercolor:(0,u.ny)(o),borderwidth:1,x:0}},margin:{pad:o.spacing.smPx,r:o.spacing.nonePx,l:o.spacing.nonePx},hoverlabel:{bgcolor:l.bgColor,bordercolor:l.fadedText10,font:{color:(0,u.Xy)(o),family:t.bodyFont,size:n.twoSmPx}},coloraxis:{colorbar:{thickness:16,xpad:o.spacing.twoXLPx,ticklabelposition:"outside",outlinecolor:l.transparent,outlinewidth:8,len:.75,y:.5745,title:{font:{color:(0,u.Xy)(o),size:n.smPx}},tickfont:{color:(0,u.Xy)(o),size:n.twoSmPx}}},ternary:{gridcolor:(0,u.Xy)(o),bgcolor:l.bgColor,title:{font:{family:t.bodyFont,size:n.smPx}},color:(0,u.Xy)(o),aaxis:{gridcolor:(0,u.Xy)(o),linecolor:(0,u.Xy)(o),tickfont:{family:t.bodyFont,size:n.twoSmPx}},baxis:{linecolor:(0,u.Xy)(o),gridcolor:(0,u.Xy)(o),tickfont:{family:t.bodyFont,size:n.twoSmPx}},caxis:{linecolor:(0,u.Xy)(o),gridcolor:(0,u.Xy)(o),tickfont:{family:t.bodyFont,size:n.twoSmPx}}}};p()(e,i)}(e.layout.template.layout,o)}catch(t){const e=(0,h.b)(t);(0,m.H)(e)}"title"in e.layout&&(e.layout.title=p()(e.layout.title,{text:`<b>${e.layout.title.text}</b>`}))}var g=t(96266);const x={width:600,height:470,name:"fullscreen-expand",path:"M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z"},b={width:600,height:470,name:"fullscreen-collapse",path:"M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V64zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32H96v64c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32H32zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V64zM320 320c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320z"};function v(e,o,t){const l=JSON.parse(f(JSON.stringify(e),t,o));return"streamlit"===o?y(l,t):l.layout=function(e,o){const{colors:t,genericFonts:l}=o,n={font:{color:t.bodyText,family:l.bodyFont},paper_bgcolor:t.bgColor,plot_bgcolor:t.secondaryBg};return{...e,font:{...n.font,...e.font},paper_bgcolor:e.paper_bgcolor||n.paper_bgcolor,plot_bgcolor:e.plot_bgcolor||n.plot_bgcolor}}(l.layout,t),l}function A(e,o,t,l){if(!e)return;const n={selection:{points:[],point_indices:[],box:[],lasso:[]}},i=new Set,s=[],a=[],d=[],{selections:p,points:u}=e;if(u&&u.forEach((function(e){d.push({...e,legendgroup:e.data.legendgroup||void 0,data:void 0,fullData:void 0}),(0,c.bb)(e.pointIndex)&&i.add(e.pointIndex),(0,c.bb)(e.pointIndices)&&e.pointIndices.length>0&&e.pointIndices.forEach((e=>i.add(e)))})),p&&p.forEach((e=>{if("rect"===e.type){const o=function(e){return"x0"in e&&"x1"in e&&"y0"in e&&"y1"in e?{x:[e.x0,e.x1],y:[e.y0,e.y1]}:{x:[],y:[]}}(e),t={xref:e.xref,yref:e.yref,x:o.x,y:o.y};s.push(t)}if("path"===e.type){const o=function(e){if(""===e)return{x:[],y:[]};const o=e.replace("M","").replace("Z","").split("L"),t=[],l=[];return o.forEach((e=>{const[o,n]=e.split(",").map(Number);t.push(o),l.push(n)})),{x:t,y:l}}(e.path),t={xref:e.xref,yref:e.yref,x:o.x,y:o.y};a.push(t)}})),n.selection.point_indices=Array.from(i),n.selection.points=d.map((e=>(0,c.KI)(e))),n.selection.box=s,n.selection.lasso=a,n.selection.box.length>0&&!t.selectionMode.includes(r.hP.SelectionMode.BOX))return;if(n.selection.lasso.length>0&&!t.selectionMode.includes(r.hP.SelectionMode.LASSO))return;const h=o.getStringValue(t),m=JSON.stringify(n);h!==m&&o.setStringValue(t,m,{fromUi:!0},l)}const w=(0,s.Z)((function(e){var o,t,s,c,d;let{element:p,width:u,height:h,widgetMgr:m,disabled:f,fragmentId:y,isFullScreen:w,expand:S,collapse:z,disableFullscreenMode:F}=e;const C=(0,n.u)(),M=(0,l.useMemo)((()=>p.spec?JSON.parse(p.spec):{layout:{},data:[],frames:void 0}),[p.id,p.spec]),[P,k]=(0,l.useState)((()=>{const e=m.getElementState(p.id,"figure");return e||v(M,p.theme,C)})),I=p.selectionMode.length>0&&!f,E=I&&p.selectionMode.includes(r.hP.SelectionMode.LASSO),X=I&&p.selectionMode.includes(r.hP.SelectionMode.BOX),L=I&&p.selectionMode.includes(r.hP.SelectionMode.POINTS),T=(0,l.useMemo)((()=>{if(!p.config)return{};const e=JSON.parse(p.config);if(F||(e.modeBarButtonsToAdd=[{name:w?"Close fullscreen":"Fullscreen",icon:w?b:x,click:()=>{w&&z?z():S&&S()}}]),!e.modeBarButtonsToRemove){e.displaylogo=!1;const o=["sendDataToCloud"];I?(E||o.push("lasso2d"),X||o.push("select2d")):o.push("lasso2d","select2d"),e.modeBarButtonsToRemove=o}return e}),[p.id,p.config,w,F,I,E,X,z,S]);(0,l.useEffect)((()=>{k((e=>v(e,p.theme,C)))}),[p.id,C,p.theme]),(0,l.useEffect)((()=>{let e=M.layout.clickmode,o=M.layout.hovermode,t=M.layout.dragmode;f?(e="none",t="pan"):I&&(M.layout.clickmode||(e=L?"event+select":"none"),M.layout.hovermode||(o="closest"),M.layout.dragmode||(t=L?"pan":X?"select":E?"lasso":"pan")),k((l=>l.layout.clickmode===e&&l.layout.hovermode===o&&l.layout.dragmode===t?l:{...l,layout:{...l.layout,clickmode:e,hovermode:o,dragmode:t}}))}),[p.id,I,L,X,E,f]);let W=-1===u?null===(o=P.layout)||void 0===o?void 0:o.width:Math.max(p.useContainerWidth?u:Math.min(null!==(t=M.layout.width)&&void 0!==t?t:u,u),150),_=M.layout.height;w&&(W=u,_=h),P.layout.height===_&&P.layout.width===W||k((e=>({...e,layout:{...e.layout,height:_,width:W}})));const O=(0,l.useCallback)((e=>{A(e,m,p,y)}),[p.id,m,y]),V=(0,l.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!function(e,o,t){const l=e.getStringValue(o),n=JSON.stringify({selection:{points:[],point_indices:[],box:[],lasso:[]}});l!==n&&e.setStringValue(o,n,{fromUi:!0},t)}(m,p,y),e&&setTimeout((()=>{k((e=>({...e,data:e.data.map((e=>({...e,selectedpoints:null}))),layout:{...e.layout,selections:[]}})))}),50)}),[p.id,m,y]);return(0,l.useEffect)((()=>{if(!p.formId||!I)return;const e=new a.K;return e.manageFormClearListener(m,p.formId,V),()=>{e.disconnect()}}),[p.formId,m,I,V]),(0,l.useEffect)((()=>{var e,o,t;if(!I)return;let l;l="select"===(null===(e=P.layout)||void 0===e?void 0:e.dragmode)||"lasso"===(null===(o=P.layout)||void 0===o?void 0:o.dragmode)?"event":L?"event+select":"none",(null===(t=P.layout)||void 0===t?void 0:t.clickmode)!==l&&k((e=>({...e,layout:{...e.layout,clickmode:l}})))}),[null===(s=P.layout)||void 0===s?void 0:s.dragmode]),(0,g.jsx)(i.Z,{className:"stPlotlyChart",data:P.data,layout:P.layout,config:T,frames:null!==(c=P.frames)&&void 0!==c?c:void 0,style:{visibility:void 0===(null===(d=P.layout)||void 0===d?void 0:d.width)?"hidden":void 0},onSelected:I?O:()=>{},onDoubleClick:I?()=>V():void 0,onDeselect:I?()=>{V(!1)}:void 0,onInitialized:e=>{m.setElementState(p.id,"figure",e)},onUpdate:e=>{m.setElementState(p.id,"figure",e),k(e)}},w?"fullscreen":"original")}),!0)},10266:(e,o,t)=>{t.d(o,{Z:()=>g});var l=t(5057),n=t(56129),i=t.n(n),r=t(47206),s=t(53136),c=t(88916),a=t(73401),d=t(31808),p=t(82160);const u=(0,p.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:o,theme:t}=e;const l=o?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:t.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:t.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:t.colors.fadedText60,borderRadius:"50%",...l,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:t.colors.bodyText,transition:"none"}}}),""),h=(0,p.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:o,isExpanded:t}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:o.colors.bgColor,zIndex:o.zIndices.fullscreenWrapper,padding:o.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var m=t(96266);class f extends l.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:o}=this.state;27===e.keyCode&&o&&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),o=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+o)}},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:o,fullHeight:t}=this.state,{children:l,width:n,height:i,disableFullscreenMode:r}=this.props;let d=s.d,p=this.zoomIn,f="View fullscreen";return e&&(d=c.m,p=this.zoomOut,f="Exit fullscreen"),(0,m.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,m.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:p,title:f,isExpanded:e,children:(0,m.jsx)(a.Z,{content:d})}),l(e?{width:o,height:t,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:n,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}f.contextType=d.E;const y=(0,r.b)(f);const g=function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class t extends l.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:t,height:l,disableFullscreenMode:n}=this.props;return(0,m.jsx)(y,{width:t,height:l,disableFullscreenMode:o||n,children:o=>{let{width:t,height:l,expanded:n,expand:i,collapse:r}=o;return(0,m.jsx)(e,{...this.props,width:t,height:l,isFullScreen:n,expand:i,collapse:r})}})}}}return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,i()(t,e)}},52955:(e,o,t)=>{t.d(o,{K:()=>n});var l=t(50120);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,o,t){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===o||(this.disconnect(),(0,l.bM)(o)&&(this.formClearListener=e.addFormClearedListener(o,t),this.lastWidgetMgr=e,this.lastFormId=o))}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_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[2940],{12940:(o,e,r)=>{r.r(e),r.d(e,{default:()=>p});r(5057);var t=r(44088),i=r(92649),a=r(82160),l=r(59990);function s(o,e){switch(o){case t.V5.XSMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.sm}`,fontSize:e.fontSizes.sm};case t.V5.SMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.md}`};case t.V5.LARGE:return{padding:`${e.spacing.md} ${e.spacing.md}`};default:return{padding:`${e.spacing.xs} ${e.spacing.md}`}}}const d=(0,a.Z)("a",{target:"e16zdaao2"})((o=>{let{fluidWidth:e,size:r,theme:t}=o;const i="number"==typeof e?`${e}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,minHeight:t.sizes.minElementHeight,margin:0,lineHeight:t.lineHeights.base,color:t.colors.primary,textDecoration:"none",width:e?i:"auto",userSelect:"none","&:visited":{color:t.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,l.DZ)(t.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...s(r,t)}}),""),n=(0,a.Z)(d,{target:"e16zdaao1"})((o=>{let{theme:e}=o;return{backgroundColor:e.colors.primary,color:e.colors.white,border:`${e.sizes.borderWidth} solid ${e.colors.primary}`,"&:hover":{backgroundColor:(0,l._j)(e.colors.primary,.05),color:e.colors.white},"&:active":{backgroundColor:"transparent",color:e.colors.primary},"&:visited:not(:active)":{color:e.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:e.colors.fadedText10,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}}}),""),c=(0,a.Z)(d,{target:"e16zdaao0"})((o=>{let{theme:e}=o;return{backgroundColor:e.colors.lightenedBg05,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,"&:visited":{color:e.colors.bodyText},"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:e.colors.fadedText10,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}}}),"");var u=r(96266);const b=function(o){let{kind:e,size:r,disabled:i,fluidWidth:a,children:l,autoFocus:s,href:d,rel:b,target:h,onClick:p}=o,g=n;return e===t.nW.SECONDARY&&(g=c),(0,u.jsx)(g,{kind:e,size:r||t.V5.MEDIUM,fluidWidth:a||!1,disabled:i||!1,autoFocus:s||!1,"data-testid":`baseLinkButton-${e}`,href:d,target:h,rel:b,onClick:p,tabIndex:i?-1:0,children:l})};var h=r(2648);const p=function(o){const{disabled:e,element:r,width:a}=o,l={width:a},s="primary"===r.type?t.nW.PRIMARY:t.nW.SECONDARY,d=!r.help||a;return(0,u.jsx)("div",{className:"row-widget stLinkButton","data-testid":"stLinkButton",style:l,children:(0,u.jsx)(i.t,{help:r.help,children:(0,u.jsx)(b,{kind:s,size:t.V5.SMALL,disabled:e,onClick:e=>{o.disabled&&e.preventDefault()},fluidWidth:!!r.useContainerWidth&&d,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":e,children:(0,u.jsx)(h.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4021],{94021:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b});var i=o(5057),r=o(47206),s=o(54281),n=o(17966),a=o(2648),d=o(92421),l=o(85367),c=o(82160);const u=(0,c.Z)("button",{target:"elibz2u3"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,lineHeight:"1.4rem",color:t.colors.fadedText60,backgroundColor:t.colors.transparent,border:"none",boxShadow:"none",padding:"0px","&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}}}),""),p=(0,c.Z)("div",{target:"elibz2u2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:"0.25rem"}}}),""),g=(0,c.Z)("div",{target:"elibz2u0"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base}}),"");var f=o(44005),h=o(96266);const b=(0,r.b)((function(e){let{theme:t,body:o,icon:r,width:c}=e;const b=function(e){if(e.length>104){let t=e.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return e}(o),m=o!==b,[x,w]=(0,i.useState)(!m),[y,v]=(0,i.useState)(0),S=(0,i.useCallback)((()=>{w(!x)}),[x]),T=(0,i.useMemo)((()=>function(e){const t=(0,n.Iy)(e);return{Body:{props:{"data-testid":"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.sidebar,marginTop:"8px",borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:t?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:"calc(-1 * ".concat(e.spacing.lg," / 2)"),":hover":{color:e.colors.bodyText}}}}}(t)),[t]),k=(0,i.useMemo)((()=>(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(p,{expanded:x,children:[r&&(0,h.jsx)(f.p,{iconValue:r,size:"xl",testid:"stToastDynamicIcon"}),(0,h.jsxs)(g,{children:[(0,h.jsx)(a.ZP,{source:x?o:b,allowHTML:!1,isToast:!0}),m&&(0,h.jsx)(u,{"data-testid":"toastViewButton",className:"toastViewButton",onClick:S,children:x?"view less":"view more"})]})]})})),[m,x,o,r,b,S]);(0,i.useEffect)((()=>{if(t.inSidebar)return;const e=s.Z.info(k,{overrides:{...T}});return v(e),()=>{s.Z.update(e,{overrides:{Body:{style:{transitionDuration:0}}}}),s.Z.clear(e)}}),[]),(0,i.useEffect)((()=>{s.Z.update(y,{children:k,overrides:{...T}})}),[y,k,T]);const z=(0,h.jsx)(l.Z,{kind:d.h.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:c});return(0,h.jsx)(h.Fragment,{children:t.inSidebar&&z})}))}}]);
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4021],{94021:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b});var i=o(5057),r=o(47206),s=o(54281),n=o(17966),a=o(2648),d=o(92421),l=o(85367),c=o(82160);const u=(0,c.Z)("button",{target:"elibz2u3"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,lineHeight:"1.4rem",color:t.colors.fadedText60,backgroundColor:t.colors.transparent,border:"none",boxShadow:"none",padding:"0px","&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}}}),""),p=(0,c.Z)("div",{target:"elibz2u2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:"0.25rem"}}}),""),g=(0,c.Z)("div",{target:"elibz2u0"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base}}),"");var f=o(44005),h=o(96266);const b=(0,r.b)((function(e){let{theme:t,body:o,icon:r,width:c}=e;const b=function(e){if(e.length>104){let t=e.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return e}(o),m=o!==b,[x,w]=(0,i.useState)(!m),[y,v]=(0,i.useState)(0),S=(0,i.useCallback)((()=>{w(!x)}),[x]),T=(0,i.useMemo)((()=>function(e){const t=(0,n.Iy)(e);return{Body:{props:{"data-testid":"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.sidebar,marginTop:"8px",borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:t?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,":hover":{color:e.colors.bodyText}}}}}(t)),[t]),k=(0,i.useMemo)((()=>(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(p,{expanded:x,children:[r&&(0,h.jsx)(f.p,{iconValue:r,size:"xl",testid:"stToastDynamicIcon"}),(0,h.jsxs)(g,{children:[(0,h.jsx)(a.ZP,{source:x?o:b,allowHTML:!1,isToast:!0}),m&&(0,h.jsx)(u,{"data-testid":"toastViewButton",className:"toastViewButton",onClick:S,children:x?"view less":"view more"})]})]})})),[m,x,o,r,b,S]);(0,i.useEffect)((()=>{if(t.inSidebar)return;const e=s.Z.info(k,{overrides:{...T}});return v(e),()=>{s.Z.update(e,{overrides:{Body:{style:{transitionDuration:0}}}}),s.Z.clear(e)}}),[]),(0,i.useEffect)((()=>{s.Z.update(y,{children:k,overrides:{...T}})}),[y,k,T]);const z=(0,h.jsx)(l.Z,{kind:d.h.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:c});return(0,h.jsx)(h.Fragment,{children:t.inSidebar&&z})}))}}]);
@@ -0,0 +1,17 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4482],{25094:(t,e,a)=>{a.d(e,{Z:()=>l});var n=a(5057),i=a(66904),r=a.n(i),o=a(7742),s=a.n(o),c=a(96266);const d=t=>{let{className:e,scriptRunId:a,numParticles:n,numParticleTypes:i,ParticleComponent:o}=t;return(0,c.jsx)("div",{className:s()(e,"stHidden"),"data-testid":`${e}`,children:r()(n).map((t=>{const e=Math.floor(Math.random()*i);return(0,c.jsx)(o,{particleType:e},a+t)}))})},l=(0,n.memo)(d)},48833:(t,e,a)=>{a.r(e),a.d(e,{NUM_FLAKES:()=>u,default:()=>k});var n=a(5057);const i=a.p+"static/media/flake-0.beded754e8024c73d9d2.png",r=a.p+"static/media/flake-1.8077dc154e0bf900aa73.png",o=a.p+"static/media/flake-2.e3f07d06933dd0e84c24.png";var s=a(25094),c=a(82160),d=a(21371);const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.random()*(t-e)+e},m=(0,c.Z)("img",{target:"ekdfb790"})((t=>{let{theme:e}=t;return{position:"fixed",top:"-150px",marginLeft:"-75px",zIndex:e.zIndices.balloons,left:`${l(90,10)}vw`,animationDelay:`${l(4e3)}ms`,height:"150px",width:"150px",pointerEvents:"none",animationDuration:"3000ms",animationName:d.F4`
2
+ from {
3
+ transform:
4
+ translateY(0)
5
+ rotateX(${l(360)}deg)
6
+ rotateY(${l(360)}deg)
7
+ rotateZ(${l(360)}deg);
8
+ }
9
+
10
+ to {
11
+ transform:
12
+ translateY(calc(100vh + ${150}px))
13
+ rotateX(0)
14
+ rotateY(0)
15
+ rotateZ(0);
16
+ }
17
+ `,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var p=a(96266);const u=100,f=[i,r,o],h=f.length,g=t=>{let{particleType:e}=t;return(0,p.jsx)(m,{src:f[e]})},x=function(t){let{scriptRunId:e}=t;return(0,p.jsx)(s.Z,{className:"snow",scriptRunId:e,numParticleTypes:h,numParticles:u,ParticleComponent:g})},k=(0,n.memo)(x)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4494],{44494:(e,t,s)=>{s.r(t),s.d(t,{default:()=>C});var i=s(5057),r=s(88084),o=s.n(r),a=s(47206),n=s(80865),l=s(9191),d=s(73830),m=s(52955),p=s(38944),h=s(93905),u=s(21034),c=s(98790),g=s(50120),f=s(96266);const b="YYYY/MM/DD";function v(e){return e.map((e=>new Date(e)))}class y extends i.PureComponent{constructor(){super(...arguments),this.formClearHelper=new m.K,this.state={values:this.initialValue,isRange:this.props.element.isRange,isEmpty:!1},this.commitWidgetValue=e=>{const{widgetMgr:t,element:s,fragmentId:i}=this.props;var r;t.setStringArrayValue(s,(r=this.state.values)?r.map((e=>o()(e).format(b))):[],e,i)},this.onFormCleared=()=>{const e=v(this.props.element.default);this.setState({values:e,isEmpty:!e},(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{date:t}=e;if(null===t||void 0===t)return void this.setState({values:[],isEmpty:!0});const s=[];Array.isArray(t)?t.forEach((e=>{e&&s.push(e)})):s.push(t),this.setState({values:s,isEmpty:!s},(()=>{this.state.isEmpty||this.commitWidgetValue({fromUi:!0})}))},this.handleClose=()=>{const{isEmpty:e}=this.state;e&&this.setState(((e,t)=>({values:v(t.element.default),isEmpty:!v(t.element.default)})),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.getMaxDate=()=>{const{element:e}=this.props,t=e.max;return t&&t.length>0?o()(t,b).toDate():void 0}}get initialValue(){const e=this.props.widgetMgr.getStringArrayValue(this.props.element);return v(void 0!==e?e:this.props.element.default||[])}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1;const t=e.map((e=>new Date(e)));this.setState({values:t,isEmpty:!t},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{width:t,element:s,disabled:i,theme:r,widgetMgr:a}=this.props,{values:m,isRange:v}=this.state,{colors:y,fontSizes:C,lineHeights:W,spacing:D}=r,x={width:t},I=o()(s.min,b).toDate(),k=this.getMaxDate(),F=0===s.default.length&&!i,V=s.format.replaceAll(/[a-zA-Z]/g,"9"),S=s.format.replaceAll("Y","y").replaceAll("D","d");return this.formClearHelper.manageFormClearListener(a,s.formId,this.onFormCleared),(0,f.jsxs)("div",{className:"stDateInput","data-testid":"stDateInput",style:x,children:[(0,f.jsx)(p.O,{label:s.label,disabled:i,labelVisibility:(0,g.iF)(null===(e=s.labelVisibility)||void 0===e?void 0:e.value),children:s.help&&(0,f.jsx)(h.dT,{children:(0,f.jsx)(u.Z,{content:s.help,placement:c.u.TOP_RIGHT})})}),(0,f.jsx)(n.Z,{density:l.pw.high,formatString:S,mask:v?`${V} \u2013 ${V}`:V,placeholder:v?`${s.format} \u2013 ${s.format}`:s.format,disabled:i,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:d.r4.bottomLeft,overrides:{Body:{style:{border:`${r.sizes.borderWidth} solid ${y.fadedText10}`}}}}},CalendarContainer:{style:{fontSize:C.sm,paddingRight:r.spacing.sm,paddingLeft:r.spacing.sm,paddingBottom:r.spacing.sm,paddingTop:r.spacing.sm}},Week:{style:{fontSize:C.sm}},Day:{style:e=>{let{$pseudoHighlighted:t,$pseudoSelected:s,$selected:i,$isHovered:r}=e;return{fontSize:C.sm,lineHeight:W.base,"::before":{backgroundColor:i||s||t||r?`${y.secondaryBg} !important`:y.transparent},"::after":{borderColor:y.transparent}}}},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:y.transparent},":focus":{backgroundColor:y.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.darkGray,transform:"scale(1.41)",width:r.spacing.twoXL,marginRight:"-8px",":hover":{fill:r.colors.bodyText}}}}}},Input:{style:{paddingRight:D.sm,paddingLeft:D.sm,paddingBottom:D.sm,paddingTop:D.sm,lineHeight:W.inputWidget},props:{"data-testid":"stDateInput-Input"}}}}}},value:m,minDate:I,maxDate:k,range:v,clearable:F})]})}}const C=(0,a.b)(y)},52955:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=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,5 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4724],{94778:(e,t,r)=>{r.d(t,{Z:()=>c});r(5057);var n=r(50120),o=r(93905),i=r(82160);const a=r(21371).F4`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,s=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${a}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(96266);const c=e=>{let{dirty:t,value:r,maxLength:i,className:a,type:c="single",inForm:u}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(s,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=u?"submit form":"apply";if("multiline"===c){p(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===c&&p(`Press Enter to ${e}`)}return i&&("chat"!==c||t)&&p(`${r.length}/${i}`,t&&r.length>=i),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:a,children:d})}},44724:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(5057),o=r(47206),i=r(7896),a=r(63947),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(76866),c=r(73401),u=r(94778),d=r(17966),p=r(96216),f=r(82160);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.default,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:`${n}px`}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.default,borderTopLeftRadius:n?t.radii.default:t.radii.none,borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(96266);const x=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const f=(0,o.u)(),[x,w]=(0,n.useState)(!1),[O,j]=(0,n.useState)(r.default),[C,S]=(0,n.useState)(0),k=(0,n.useRef)(null),P=(0,n.useRef)({minHeight:0,maxHeight:0}),R=()=>{k.current&&k.current.focus(),O&&(i.setStringTriggerValue(r,O,{fromUi:!0},a),w(!1),j(""),S(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";j(e),w(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(k.current){const{offsetHeight:e}=k.current;P.current.minHeight=e,P.current.maxHeight=6.5*e}}),[k]);const{disabled:$,placeholder:E,maxChars:I}=r,z=(0,d.Iy)(f),{minHeight:B,maxHeight:T}=P.current,H=z?f.colors.gray70:f.colors.gray80,F=!!(C>0&&k.current)&&Math.abs(C-B)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(l.Z,{inputRef:k,value:O,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(w(""!==t),j(t),S((()=>{let e=0;const{current:t}=k;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),R())},"aria-label":E,disabled:$,rows:1,overrides:{Root:{style:{minHeight:f.sizes.minElementHeight,outline:"none",backgroundColor:f.colors.transparent,borderLeftWidth:f.sizes.borderWidth,borderRightWidth:f.sizes.borderWidth,borderTopWidth:f.sizes.borderWidth,borderBottomWidth:f.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:f.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:f.lineHeights.inputWidget,backgroundColor:f.colors.transparent,"::placeholder":{color:H},height:F?`${C+1}px`:"auto",maxHeight:T?`${T}px`:"none",paddingRight:"3rem",paddingLeft:f.spacing.sm,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:x,value:O,maxLength:I,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:R,disabled:!x||$,extended:F,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},76866:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(5057),o=r(80099),i=r(97135),a=r(18150),s=r(53381),l=r(4547);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||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 m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=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(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const k=S}}]);
@@ -0,0 +1,5 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4831],{94778:(t,e,i)=>{i.d(e,{Z:()=>d});i(5057);var s=i(50120),r=i(93905),o=i(82160);const n=i(21371).F4`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,a=(0,o.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:i,theme:s}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:s.colors.gray,margin:"0 5px"}}:{},...i?{color:s.colors.red,animationName:`${n}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=i(96266);const d=t=>{let{dirty:e,value:i,maxLength:o,className:n,type:d="single",inForm:h}=t;const u=[],c=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.push((0,l.jsx)(a,{includeDot:u.length>0,shouldBlink:e,children:t},u.length))};if(e){const t=h?"submit form":"apply";if("multiline"===d){c(`Press ${(0,s.Ge)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===d&&c(`Press Enter to ${t}`)}return o&&("chat"!==d||e)&&c(`${i.length}/${o}`,e&&i.length>=o),(0,l.jsx)(r.X7,{"data-testid":"InputInstructions",className:n,children:u})}},52955:(t,e,i)=>{i.d(e,{K:()=>r});var s=i(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,i){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,s.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,i),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}}},44831:(t,e,i)=>{i.r(e),i.d(e,{default:()=>M});var s=i(5057),r=i(52707),o=i(84332),n=i(47206),a=i(59500),l=i(52955),d=i(70714),h=i(60913),u=i(96216),c=i(21034),m=i(98790),p=i(73401),g=i(30124),f=i(94778),b=i(38944),v=i(93905),y=i(50120),x=i(82160);const I=(0,x.Z)("div",{target:"e116k4er3"})((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}}),""),C=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),V=(0,x.Z)("button",{target:"e116k4er1"})((t=>{let{theme:e}=t;return{margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.default,borderBottomRightRadius:e.radii.default},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}}),""),w=(0,x.Z)("div",{target:"e116k4er0"})((t=>{let{theme:e,clearable:i}=t;return{position:"absolute",marginRight:e.spacing.twoXS,left:0,right:64+(i?12:0)+"px"}}),"");var F=i(72581),k=i.n(F),D=i(96266);class S extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.inputRef=s.createRef(),this.formatValue=t=>{if((0,y.le)(t))return null;const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,a.sprintf)(e,t)}catch(i){return(0,d.KE)(`Error in sprintf(${e}, ${t}): ${i}`),String(t)}},this.isIntData=()=>this.props.element.dataType===h.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s,fragmentId:r}=this.props,o=this.props.element,n=this.getMin(),a=this.getMax();if((0,y.bb)(e)&&(n>e||e>a)){const t=this.inputRef.current;t&&t.reportValidity()}else{var l;const n=null!==(l=null!==e&&void 0!==e?e:o.default)&&void 0!==l?l:null;this.isIntData()?s.setIntValue(i,n,t,r):s.setDoubleValue(i,n,t,r),this.setState({dirty:!1,value:n,formattedValue:this.formatValue(n)})}},this.onFormCleared=()=>{this.setState(((t,e)=>{var i;return{value:null!==(i=e.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;if(""===e)this.setState({dirty:!0,value:null,formattedValue:null});else{let t;t=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:t,formattedValue:e})}},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,y.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMin())+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMax())-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1},this.id=k()("number_input_")}get initialValue(){var t;const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(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,formattedValue:this.formatValue(null!==t&&void 0!==t?t:null)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return!(0,y.le)(this.state.value)&&this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return!(0,y.le)(this.state.value)&&this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:n,theme:a}=this.props,{formattedValue:l,dirty:d,isFocused:h}=this.state,x={width:i},F=!this.canDecrement||s,k=!this.canIncrement||s,S=(0,y.le)(e.default)&&!s;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),(0,D.jsxs)("div",{className:"stNumberInput","data-testid":"stNumberInput",style:x,children:[(0,D.jsx)(b.O,{label:e.label,disabled:s,labelVisibility:(0,y.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,D.jsx)(v.dT,{children:(0,D.jsx)(c.Z,{content:e.help,placement:m.u.TOP_RIGHT})})}),(0,D.jsxs)(I,{className:h?"focused":"","data-testid":"stNumberInputContainer",children:[(0,D.jsx)(g.Z,{type:"number",inputRef:this.inputRef,value:null!==l&&void 0!==l?l:"",placeholder:e.placeholder,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,clearable:S,clearOnEscape:S,disabled:s,"aria-label":e.label,id:this.id,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.4)",width:a.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),i>u.A.hideNumberInputControls&&(0,D.jsxs)(C,{children:[(0,D.jsx)(V,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:this.modifyValueUsingStep("decrement"),disabled:F,tabIndex:-1,children:(0,D.jsx)(p.Z,{content:r.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,D.jsx)(V,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:this.modifyValueUsingStep("increment"),disabled:k,tabIndex:-1,children:(0,D.jsx)(p.Z,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),i>u.A.hideWidgetDetails&&(0,D.jsx)(w,{clearable:S,children:(0,D.jsx)(f.Z,{dirty:d,value:null!==l&&void 0!==l?l:"",inForm:(0,y.$b)({formId:e.formId})})})]})}}const M=(0,n.b)(S)}}]);
@@ -0,0 +1,9 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[5299],{62817:(t,a,e)=>{e.r(a),e.d(a,{NUM_BALLOONS:()=>h,default:()=>k});var n=e(5057);const i=e.p+"static/media/balloon-0.0e6e96ece0ea0719d6b6.png",o=e.p+"static/media/balloon-1.a503c271109e9a0fdd2d.png",s=e.p+"static/media/balloon-2.872250f3bf3a8965d655.png",r=e.p+"static/media/balloon-3.e772fafd3bfc55fb439b.png",l=e.p+"static/media/balloon-4.1a74162473d81c9cb9ee.png",c=e.p+"static/media/balloon-5.edb75c74c54165b29856.png";var m=e(25094),p=e(82160),d=e(21371);const u=d.F4`
2
+ from {
3
+ transform: translateY(calc(100vh + ${300}px));
4
+ }
5
+
6
+ to {
7
+ transform: translateY(0);
8
+ }
9
+ `,b=(0,p.Z)("img",{target:"earwcwy0"})((t=>{let{theme:a}=t;return{position:"fixed",top:"-300px",marginLeft:"-60.5px",zIndex:a.zIndices.balloons,left:60*Math.random()+20+"vw",animationDelay:1e3*Math.random()+"ms",height:"300px",width:"121px",pointerEvents:"none",animationDuration:"750ms",animationName:u,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var f=e(96266);const h=30,g=[i,o,s,r,l,c],x=g.length,v=t=>{let{particleType:a}=t;return(0,f.jsx)(b,{src:g[a]})},y=t=>{let{scriptRunId:a}=t;return(0,f.jsx)(m.Z,{className:"balloons",scriptRunId:a,numParticleTypes:x,numParticles:h,ParticleComponent:v})},k=(0,n.memo)(y)},25094:(t,a,e)=>{e.d(a,{Z:()=>m});var n=e(5057),i=e(66904),o=e.n(i),s=e(7742),r=e.n(s),l=e(96266);const c=t=>{let{className:a,scriptRunId:e,numParticles:n,numParticleTypes:i,ParticleComponent:s}=t;return(0,l.jsx)("div",{className:r()(a,"stHidden"),"data-testid":`${a}`,children:o()(n).map((t=>{const a=Math.floor(Math.random()*i);return(0,l.jsx)(s,{particleType:a},e+t)}))})},m=(0,n.memo)(c)}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[6802],{70318:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var s=n(5057),o=n(30669),i=n(46928),r=n(70714),d=n(10266);const l=(0,n(82160).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(96266);const c=(0,d.Z)((function(e){let{element:t,isFullScreen:n}=e;const d=`graphviz-chart-${t.elementId}`;return(0,s.useEffect)((()=>{try{if((0,i.graphviz)(`#${d}`).zoom(!1).fit(!0).scale(1).engine(t.engine).renderDot(t.spec),n||t.useContainerWidth){const e=(0,o.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:"graphviz stGraphVizChart","data-testid":"stGraphVizChart",id:d,isFullScreen:n})}))},10266:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});var s=n(5057),o=n(56129),i=n.n(o),r=n(47206),d=n(53136),l=n(88916),a=n(73401),c=n(31808),h=n(82160);const u=(0,h.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,h.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:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var m=n(96266);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("2.875rem");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:o,height:i,disableFullscreenMode:r}=this.props;let c=d.d,h=this.zoomIn,g="View fullscreen";return e&&(c=l.m,h=this.zoomOut,g="Exit fullscreen"),(0,m.jsxs)(p,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,m.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:h,title:g,isExpanded:e,children:(0,m.jsx)(a.Z,{content:c})}),s(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const x=(0,r.b)(g);const w=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:o}=this.props;return(0,m.jsx)(x,{width:n,height:s,disableFullscreenMode:t||o,children:t=>{let{width:n,height:s,expanded:o,expand:i,collapse:r}=t;return(0,m.jsx)(e,{...this.props,width:n,height:s,isFullScreen:o,expand:i,collapse:r})}})}}}return n.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,i()(n,e)}},63778:()=>{},32725:()=>{},14966:()=>{}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[698],{69212:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(5057),r=s(47206),o=s(31808),a=s(17966),n=s(16449),l=s(80099),d=s(96266);let c=function(e){return e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl",e}({});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(o.E),f=!(0,a.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)(n.Z,{value:t,overrides:(0,l.aO)(S,u)})}},30698:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i=s(30967),r=s(51673),o=s(50482),a=s.n(o),n=s(5057),l=s(60913),d=s(73401),c=s(98790),h=s(21034),u=s(38944),g=s(93905),p=s(52955),m=s(70714),f=s(50120),S=s(61914),C=s(69212),R=s(82160),b=s(59990),w=function(e){return e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e}(w||{});function x(e,t){switch(e){case w.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case w.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case w.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}const F=(0,R.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),I=(0,R.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,R.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,R.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,R.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,R.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,R.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}}),""),j=(0,R.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,R.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.fadedText10}`,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:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,b.DZ)(t.colors.primary,.5)}`},...x(w.MEDIUM,t)}}),"");var U=s(96266);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(C.Z,{value:r,size:C.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(96457),z=s(38830),$=s(44088),Z=s(44176);let D=function(e){return e.USER="user",e.ENVIRONMENT="environment",e}({});const O=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(c.Z,{content:"Switch camera",placement:c.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:$.nW.MINIMAL,onClick:t,children:(0,U.jsx)(d.Z,{content:k.Z,size:"twoXL",color:Z.Z.white})})})})};var X=s(85585),B=s(47206),W=s(11226),_=s(74947),A=s.n(_),V=s(11103);let G=function(e){return e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e}({});const N=e=>{let{width:t}=e;return(0,U.jsxs)(I,{width:t,children:[(0,U.jsx)(d.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:r,setClearPhotoInProgress:o,facingMode:a,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,n.useState)(d||G.PENDING),u=(0,n.useRef)(null),[g,p]=(0,n.useState)(s),m=(0,n.useCallback)((0,f.Ds)(1e3,p),[]);(0,n.useEffect)((()=>{m(s)}),[s,m]);const S=(0,B.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===G.SUCCESS||i||r?W.tq&&(0,U.jsx)(O,{switchFacingMode:l}):(0,U.jsx)(N,{width:g}),(0,U.jsx)(I,{"data-testid":"stWebcamStyledBox",hidden:c!==G.SUCCESS&&!i&&!r,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:`${S.radii.default} ${S.radii.default} 0 0`},onUserMediaError:()=>{h(G.ERROR)},onUserMedia:()=>{h(G.SUCCESS),o(!1)},videoConstraints:{width:{ideal:g},facingMode:a}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==G.SUCCESS||i||r,children:"Take Photo"})]})};class K extends n.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new p.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,m.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);a()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if(null==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);null!=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);null!=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(null==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=r.Z.CancelToken.source(),i=new S.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=>{r.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(null==i)return e;const{uploadedFileInfo:r}=i;return null==r||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new S.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 l.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new l.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:r,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(u.O,{label:t.label,disabled:r,labelVisibility:(0,f.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(g.dT,{children:(0,U.jsx)(h.Z,{content:t.help,placement:c.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{width:o,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:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||r,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(d.Z,{content:i.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)(H,{handleCapture:this.handleCapture,width:o,disabled:r,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},61914:(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}}},52955:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=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_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7125],{69212:(e,t,i)=>{i.d(t,{$:()=>p,Z:()=>c});var s=i(5057),l=i(47206),n=i(31808),r=i(17966),a=i(16449),o=i(80099),d=i(96266);let p=function(e){return e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl",e}({});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(n.E),f=!(0,r.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)(a.Z,{value:t,overrides:(0,o.aO)(x,g)})}},61914:(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}}},97125:(e,t,i)=>{i.r(t),i.d(t,{default:()=>he});var s=i(51673),l=i(50482),n=i.n(l),r=i(38954),a=i.n(r),o=i(5057),d=i(60913),p=i(52955),c=i(50120);let g=function(e){return e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b",e}({});const h=(0,c.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(38944),x=i(93905),w=i(21034),y=i(98790),b=i(49525),F=i(38830),S=i(44088),v=i(82160);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}}),""),M=(0,v.Z)("span",{target:"e1b2p2ww12"})((e=>{let{theme:t}=e;return{marginBottom:t.spacing.twoXS}}),""),z=(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"})((()=>({listStyleType:"none",marginBottom:0})),""),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(44071),N=i(73401),W=i(67600),$=i(96266);const O=e=>{let{multiple:t,acceptedExtensions:i,maxSizeBytes:s}=e;return(0,$.jsxs)(I,{"data-testid":"stFileUploaderDropzoneInstructions",children:[(0,$.jsx)(U,{children:(0,$.jsx)(N.Z,{content:V.n,size:"threeXL"})}),(0,$.jsxs)(z,{children:[(0,$.jsxs)(M,{children:["Drag and drop file",t?"s":""," here"]}),(0,$.jsxs)(W.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,$.jsx)(b.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,$.jsxs)(j,{...t(),"data-testid":"stFileUploaderDropzone",isDisabled:n,"aria-label":r,children:[(0,$.jsx)("input",{"data-testid":"stFileUploaderDropzoneInput",...a()}),(0,$.jsx)(O,{multiple:i,acceptedExtensions:s,maxSizeBytes:l}),(0,$.jsx)(F.ZP,{kind:S.nW.SECONDARY,disabled:n,size:S.V5.SMALL,children:"Browse files"})]})}})};var _=i(56129),G=i.n(_),K=i(75427),q=i(5642);const J=(0,v.Z)("div",{target:"e16k0npc1"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:t.spacing.twoXS,marginBottom:t.spacing.twoXS}}),""),Y=(0,v.Z)("div",{target:"e16k0npc0"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"center",color:t.colors.fadedText40}}),""),Q=e=>{let{className:t,currentPage:i,totalPages:s,onNext:l,onPrevious:n}=e;return(0,$.jsxs)(J,{className:t,"data-testid":"stPagination",children:[(0,$.jsx)(W.x,{children:`Showing page ${i} of ${s}`}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(F.ZP,{onClick:n,kind:S.nW.MINIMAL,children:(0,$.jsx)(N.Z,{content:K.s,size:"xl"})}),(0,$.jsx)(F.ZP,{onClick:l,kind:S.nW.MINIMAL,children:(0,$.jsx)(N.Z,{content:q._,size:"xl"})})]})]})};var ee=i(15717);const te=(e,t)=>Math.ceil(e.length/t),ie=e=>G()((t=>{let{pageSize:i,items:s,resetOnAdd:l,...n}=t;const[r,a]=(0,o.useState)(0),[d,p]=(0,o.useState)(te(s,i)),c=(0,ee.D)(s);(0,o.useEffect)((()=>{c&&c.length!==s.length&&p(te(s,i)),c&&c.length<s.length?l&&a(0):r+1>=d&&a(d-1)}),[s,r,i,c,l,d]);const g=s.slice(r*i,r*i+i);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(e,{items:g,...n}),s.length>i?(0,$.jsx)(Q,{className:"streamlit-paginator",pageSize:i,totalPages:d,currentPage:r+1,onNext:()=>{a(Math.min(r+1,d-1))},onPrevious:()=>{a(Math.max(0,r-1))}}):null]})}),e);var se=i(15766),le=i(31906),ne=i(13324),re=i(69212);const ae=e=>{let{fileInfo:t}=e;return"uploading"===t.status.type?(0,$.jsx)(re.Z,{value:t.status.progress,size:re.$.SMALL,overrides:{Bar:{style:{marginLeft:0,marginTop:"4px"}}}}):"error"===t.status.type?(0,$.jsxs)(X,{children:[(0,$.jsx)(T,{"data-testid":"stFileUploaderFileErrorMessage",children:t.status.errorMessage}),(0,$.jsx)(P,{children:(0,$.jsx)(N.Z,{content:se.j,size:"lg"})})]}):"uploaded"===t.status.type?(0,$.jsx)(W.x,{children:m(t.size,g.Byte)}):null},oe=e=>{let{fileInfo:t,onDelete:i}=e;return(0,$.jsxs)(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[(0,$.jsx)(D,{children:(0,$.jsx)(N.Z,{content:le.h,size:"twoXL"})}),(0,$.jsxs)(Z,{className:"stFileUploaderFileData",children:[(0,$.jsx)(R,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:t.name,children:t.name}),(0,$.jsx)(ae,{fileInfo:t})]}),(0,$.jsx)("div",{"data-testid":"stFileUploaderDeleteBtn",children:(0,$.jsx)(F.ZP,{onClick:()=>i(t.id),kind:S.nW.MINIMAL,children:(0,$.jsx)(N.Z,{content:ne.U,size:"lg"})})})]})},de=ie((e=>{let{items:t,onDelete:i}=e;return(0,$.jsx)(C,{children:t.map((e=>(0,$.jsx)(B,{children:(0,$.jsx)(oe,{fileInfo:e,onDelete:i})},e.id)))})})),pe=e=>(0,$.jsx)(L,{children:(0,$.jsx)(de,{...e})});var ce=i(61914);class ge extends o.PureComponent{constructor(e){super(e),this.formClearHelper=new p.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);n()(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)}a()(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=s.Z.CancelToken.source(),l=new ce.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(l),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,l.id)),i.token).then((()=>this.onUploadComplete(l.id,e))).catch((e=>{s.Z.isCancel(e)||this.updateFile(l.id,l.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.onUploadComplete=(e,t)=>{const i=this.getFile(e);null!=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);null!=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(null==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(null==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(null==s)return e;const{uploadedFileInfo:l}=s;return null==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 d.jM({fileId:l,fileUrls:n,name:t,size:i})}));return new d.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,$.jsxs)(A,{"data-testid":"stFileUploader",children:[(0,$.jsx)(f.O,{label:i.label,disabled:s,labelVisibility:(0,c.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,$.jsx)(x.dT,{children:(0,$.jsx)(w.Z,{content:i.help,placement:y.u.TOP_RIGHT})})}),(0,$.jsx)(H,{onDrop:this.dropHandler,multiple:i.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:i.label,disabled:s}),r.length>0&&(0,$.jsx)(pe,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const he=ge},52955:(e,t,i)=>{i.d(t,{K:()=>l});var s=i(50120);class l{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=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
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7579],{97579:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var s=r(5057),n=r(7742),o=r.n(n),i=r(17966),l=r(2648),a=r(31808),d=r(82160),c=r(70765),h=r(69194);const u=(0,d.Z)(c.Q,{shouldForwardProp:h.Z,target:"e1se5lgy2"})((e=>{let{theme:t,usingCustomTheme:r}=e;return{fontSize:t.fontSizes.sm,width:"1.375rem",height:"1.375rem",borderWidth:"3px",radius:"4px",justifyContents:"center",padding:t.spacing.none,margin:t.spacing.none,borderColor:t.colors.fadedText10,borderTopColor:r?t.colors.primary:t.colors.blue70,flexGrow:0,flexShrink:0}}),""),g=(0,d.Z)("div",{target:"e1se5lgy1"})((e=>{let{theme:t,width:r,cache:s}=e;return{width:r,...s?{paddingBottom:"1rem",background:`linear-gradient(to bottom, ${t.colors.bgColor} 0%, ${t.colors.bgColor} 80%, transparent 100%)`}:null}}),""),p=(0,d.Z)("div",{target:"e1se5lgy0"})((e=>{let{theme:t}=e;return{display:"flex",gap:t.spacing.sm,alignItems:"center",width:"100%"}}),"");var m=r(96266);const x=function(e){let{width:t,element:r}=e;const{activeTheme:n}=s.useContext(a.E),d=!(0,i.MJ)(n),{cache:c}=r;return(0,m.jsx)(g,{className:o()({stSpinner:!0,cacheSpinner:c}),"data-testid":"stSpinner",width:t,cache:c,children:(0,m.jsxs)(p,{children:[(0,m.jsx)(u,{usingCustomTheme:d}),(0,m.jsx)(l.ZP,{source:r.text,allowHTML:!1})]})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[7696],{52955:(e,t,i)=>{i.d(t,{K:()=>n});var s=i(50120);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=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}}},87696:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(5057),n=i(8708),o=i.n(n),r=i(55790),a=i(47206),l=i(59500),d=i(52955),h=i(60913),m=i(50120),u=i(88084),c=i.n(u),g=i(38944),p=i(93905),f=i(21034),b=i(98790),v=i(82160),T=i(59990);const y=(0,v.Z)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,T.DZ)(i.colors.primary,.5)}`}}}),""),R=(0,v.Z)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),V=(0,v.Z)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),x=(0,v.Z)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var C=i(96266);class w extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new d.K,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{const{widgetMgr:t,element:i,fragmentId:s}=this.props;t.setDoubleArrayValue(i,this.state.value,e,s)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{const{$value:i,$thumbIndex:n}=e,r=n||0;this.thumbRef[r]=t,this.thumbValueRef[r]||=s.createRef();const a=i?this.formatValue(i[n]):"",l=o()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),d={};return(this.props.element.options.length>0||this.isDateTimeType())&&(d["aria-valuetext"]=a),(0,C.jsx)(y,{...l,disabled:!0===e.$disabled,ref:this.thumbRef[r],"aria-valuetext":a,"aria-label":this.props.element.label,children:(0,C.jsx)(R,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[r],children:a})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,C.jsxs)(V,{"data-testid":"stTickBar",children:[(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMin",children:this.formatValue(s)}),(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,m.Ds)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],n=i.length>1?i[1]:i[0];return s>n&&(s=n),s<e&&(s=e),s>t&&(s=t),n<e&&(n=e),n>t&&(n=t),i.length>1?[s,n]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===h.iR.DataType.DATETIME||e===h.iR.DataType.DATE||e===h.iR.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?c().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),n=t.getBoundingClientRect(),o=i.getBoundingClientRect(),r=n.left+n.width/2,a=r-o.width/2<s.left,l=r+o.width/2>s.right;i.style.left=a?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const n=this.sliderRef.current,o=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,r=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,a=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(n,o,a),this.alignValueOnThumb(n,r,l),n&&o&&r&&a&&l){const e=n.getBoundingClientRect(),t=o.getBoundingClientRect(),i=r.getBoundingClientRect(),s=a.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?a.style.right=d.width+16-(i.right-t.right)+"px":l.style.left=s.width+16-(i.left-t.left)+"px"}}}render(){var e;const{disabled:t,element:i,theme:s,width:n,widgetMgr:o}=this.props,{colors:a,fonts:l,fontSizes:d,spacing:h}=s,u={width:n};return this.formClearHelper.manageFormClearListener(o,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,C.jsxs)("div",{ref:this.sliderRef,className:"stSlider","data-testid":"stSlider",style:u,children:[(0,C.jsx)(g.O,{label:i.label,disabled:t,labelVisibility:(0,m.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,C.jsx)(p.dT,{children:(0,C.jsx)(f.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,C.jsx)(r.Z,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:"4px",...t?{background:a.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,a.b)(w)}}]);