streamlit-nightly 1.39.1.dev20241021__py2.py3-none-any.whl → 1.39.1.dev20241022__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/elements/widgets/button_group.py +18 -18
- streamlit/static/asset-manifest.json +3 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/223.2359dae5.chunk.js +1 -0
- streamlit/static/static/js/main.b154eb39.js +28 -0
- {streamlit_nightly-1.39.1.dev20241021.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.39.1.dev20241021.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/RECORD +12 -12
- streamlit/static/static/js/223.ad5699f4.chunk.js +0 -1
- streamlit/static/static/js/main.62a02ffe.js +0 -28
- /streamlit/static/static/js/{main.62a02ffe.js.LICENSE.txt → main.b154eb39.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.39.1.dev20241021.data → streamlit_nightly-1.39.1.dev20241022.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.39.1.dev20241021.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.39.1.dev20241021.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.39.1.dev20241021.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/top_level.txt +0 -0
@@ -86,7 +86,7 @@ _STAR_ICON: Final = ":material/star:"
|
|
86
86
|
# in base64 format and send it over the wire as an image.
|
87
87
|
_SELECTED_STAR_ICON: Final = ":material/star_filled:"
|
88
88
|
|
89
|
-
SelectionMode: TypeAlias = Literal["single", "
|
89
|
+
SelectionMode: TypeAlias = Literal["single", "multi"]
|
90
90
|
|
91
91
|
|
92
92
|
class SingleSelectSerde(Generic[T]):
|
@@ -137,7 +137,7 @@ class SingleOrMultiSelectSerde(Generic[T]):
|
|
137
137
|
self,
|
138
138
|
options: Sequence[T],
|
139
139
|
default_values: list[int],
|
140
|
-
type: Literal["single", "
|
140
|
+
type: Literal["single", "multi"],
|
141
141
|
):
|
142
142
|
self.options = options
|
143
143
|
self.default_values = default_values
|
@@ -227,9 +227,9 @@ def _build_proto(
|
|
227
227
|
|
228
228
|
def _maybe_raise_selection_mode_warning(selection_mode: SelectionMode):
|
229
229
|
"""Check if the selection_mode value is valid or raise exception otherwise."""
|
230
|
-
if selection_mode not in ["single", "
|
230
|
+
if selection_mode not in ["single", "multi"]:
|
231
231
|
raise StreamlitAPIException(
|
232
|
-
"The selection_mode argument must be one of ['single', '
|
232
|
+
"The selection_mode argument must be one of ['single', 'multi']. "
|
233
233
|
f"The argument passed was '{selection_mode}'."
|
234
234
|
)
|
235
235
|
|
@@ -410,7 +410,7 @@ class ButtonGroupMixin:
|
|
410
410
|
label: str,
|
411
411
|
options: OptionSequence[V],
|
412
412
|
*,
|
413
|
-
selection_mode: Literal["
|
413
|
+
selection_mode: Literal["multi"] = "multi",
|
414
414
|
default: Sequence[V] | V | None = None,
|
415
415
|
format_func: Callable[[Any], str] | None = None,
|
416
416
|
key: Key | None = None,
|
@@ -427,7 +427,7 @@ class ButtonGroupMixin:
|
|
427
427
|
label: str,
|
428
428
|
options: OptionSequence[V],
|
429
429
|
*,
|
430
|
-
selection_mode: Literal["single", "
|
430
|
+
selection_mode: Literal["single", "multi"] = "single",
|
431
431
|
default: Sequence[V] | V | None = None,
|
432
432
|
format_func: Callable[[Any], str] | None = None,
|
433
433
|
key: Key | None = None,
|
@@ -466,9 +466,9 @@ class ButtonGroupMixin:
|
|
466
466
|
.. |st.markdown| replace:: ``st.markdown``
|
467
467
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
468
468
|
|
469
|
-
selection_mode: "single" or "
|
469
|
+
selection_mode: "single" or "multi"
|
470
470
|
The selection mode for the widget. If "single", only one option can be
|
471
|
-
selected. If "
|
471
|
+
selected. If "multi", multiple options can be selected.
|
472
472
|
|
473
473
|
options: Iterable of V
|
474
474
|
Labels for the select options in an ``Iterable``. This can be a
|
@@ -520,7 +520,7 @@ class ButtonGroupMixin:
|
|
520
520
|
-------
|
521
521
|
list of V or V or None
|
522
522
|
A list of selected options or an empty list if the ``selection_mode`` is
|
523
|
-
"
|
523
|
+
"multi".
|
524
524
|
If the "selection_mode" is "single", the return value is the selected option
|
525
525
|
or None.
|
526
526
|
|
@@ -532,7 +532,7 @@ class ButtonGroupMixin:
|
|
532
532
|
>>>
|
533
533
|
>>> options = ["one", "two", "three", "four", "five"]
|
534
534
|
>>> selection = st.pills(label="Numbered pills",
|
535
|
-
options, selection_mode="
|
535
|
+
options, selection_mode="multi")
|
536
536
|
>>> st.markdown(f"You selected option: '{selection}'.")
|
537
537
|
|
538
538
|
.. output ::
|
@@ -600,7 +600,7 @@ class ButtonGroupMixin:
|
|
600
600
|
label: str,
|
601
601
|
options: OptionSequence[V],
|
602
602
|
*,
|
603
|
-
selection_mode: Literal["
|
603
|
+
selection_mode: Literal["multi"] = "multi",
|
604
604
|
default: Sequence[V] | V | None = None,
|
605
605
|
format_func: Callable[[Any], str] | None = None,
|
606
606
|
key: str | int | None = None,
|
@@ -618,7 +618,7 @@ class ButtonGroupMixin:
|
|
618
618
|
label: str,
|
619
619
|
options: OptionSequence[V],
|
620
620
|
*,
|
621
|
-
selection_mode: Literal["single", "
|
621
|
+
selection_mode: Literal["single", "multi"] = "single",
|
622
622
|
default: Sequence[V] | V | None = None,
|
623
623
|
format_func: Callable[[Any], str] | None = None,
|
624
624
|
key: str | int | None = None,
|
@@ -657,9 +657,9 @@ class ButtonGroupMixin:
|
|
657
657
|
.. |st.markdown| replace:: ``st.markdown``
|
658
658
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
659
659
|
|
660
|
-
selection_mode: "single" or "
|
660
|
+
selection_mode: "single" or "multi"
|
661
661
|
The selection mode for the widget. If "single", only one option can be
|
662
|
-
selected. If "
|
662
|
+
selected. If "multi", multiple options can be selected.
|
663
663
|
|
664
664
|
options: Iterable of V
|
665
665
|
Labels for the select options in an ``Iterable``. This can be a
|
@@ -711,7 +711,7 @@ class ButtonGroupMixin:
|
|
711
711
|
-------
|
712
712
|
list of V or V or None
|
713
713
|
A list of selected options or an empty list if the ``selection_mode`` is
|
714
|
-
"
|
714
|
+
"multi".
|
715
715
|
If the "selection_mode" is "single", the return value is the selected option
|
716
716
|
or None.
|
717
717
|
|
@@ -723,7 +723,7 @@ class ButtonGroupMixin:
|
|
723
723
|
>>>
|
724
724
|
>>> options = ["North", "East", "South", "West"]
|
725
725
|
>>> selection = st.segmented_control(label="Directions",
|
726
|
-
options, selection_mode="
|
726
|
+
options, selection_mode="multi")
|
727
727
|
>>> st.markdown(f"You selected options: '{selection}'.")
|
728
728
|
|
729
729
|
.. output ::
|
@@ -775,7 +775,7 @@ class ButtonGroupMixin:
|
|
775
775
|
*,
|
776
776
|
key: Key | None = None,
|
777
777
|
default: Sequence[V] | V | None = None,
|
778
|
-
selection_mode: Literal["single", "
|
778
|
+
selection_mode: Literal["single", "multi"] = "single",
|
779
779
|
disabled: bool = False,
|
780
780
|
format_func: Callable[[Any], str] | None = None,
|
781
781
|
style: Literal["pills", "segmented_control"] = "segmented_control",
|
@@ -837,7 +837,7 @@ class ButtonGroupMixin:
|
|
837
837
|
label_visibility=label_visibility,
|
838
838
|
)
|
839
839
|
|
840
|
-
if selection_mode == "
|
840
|
+
if selection_mode == "multi":
|
841
841
|
return res.value
|
842
842
|
|
843
843
|
return res.value
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.5513bd04.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.b154eb39.js",
|
5
5
|
"static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
|
6
6
|
"static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
|
7
7
|
"static/js/9077.721329d6.chunk.js": "./static/js/9077.721329d6.chunk.js",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"static/js/8460.38082ffb.chunk.js": "./static/js/8460.38082ffb.chunk.js",
|
12
12
|
"static/js/3861.867f8617.chunk.js": "./static/js/3861.867f8617.chunk.js",
|
13
13
|
"static/js/8642.58110d15.chunk.js": "./static/js/8642.58110d15.chunk.js",
|
14
|
-
"static/js/223.
|
14
|
+
"static/js/223.2359dae5.chunk.js": "./static/js/223.2359dae5.chunk.js",
|
15
15
|
"static/js/8148.5521cded.chunk.js": "./static/js/8148.5521cded.chunk.js",
|
16
16
|
"static/js/84.414fa87b.chunk.js": "./static/js/84.414fa87b.chunk.js",
|
17
17
|
"static/js/9923.2bb9616f.chunk.js": "./static/js/9923.2bb9616f.chunk.js",
|
@@ -155,6 +155,6 @@
|
|
155
155
|
},
|
156
156
|
"entrypoints": [
|
157
157
|
"static/css/main.5513bd04.css",
|
158
|
-
"static/js/main.
|
158
|
+
"static/js/main.b154eb39.js"
|
159
159
|
]
|
160
160
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.b154eb39.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[223],{40223:(e,t,o)=>{o.r(t),o.d(t,{default:()=>je});var i=o(58878),n=o(86411),r=o(83614),l=o(34679),s=o(93594),a=o(78477),c=o(8151),d=o(68994),h=o(16795),u=o(29669);var g=o(85850),m=o(59323),p=o(4494),f=o(53124),b=o.n(f),v=o(32782),x=o(67253),y=o(1780),C=o(84152),w=o(6240),S=o(1637),j=o(90782);const k=e=>{let{error:t,width:o,deltaType:i}=e;return t instanceof F?(0,j.jsx)(w.A,{width:o,name:"No Mapbox token provided",message:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("p",{children:["To use ",(0,j.jsxs)(S.m7,{children:["st.",i]})," or"," ",(0,j.jsx)(S.m7,{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,j.jsxs)("p",{children:["To get a token, create an account at"," ",(0,j.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,j.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,j.jsx)(S.m7,{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,j.jsxs)("p",{children:["See"," ",(0,j.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof A?(0,j.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("p",{children:"This app requires an internet connection."}),(0,j.jsx)("p",{children:"Please check your connection and try again."}),(0,j.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,j.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,j.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:t.message})};class F extends Error{}class A extends Error{}const M="https://data.streamlit.io/tokens.json",T="mapbox",E=e=>t=>{class o extends i.PureComponent{constructor(o){super(o),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await v.A.get(M),{[T]:t}=e.data;if(!t)throw new Error(`Missing token ${T}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,x.$)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new A(`${t.message} (${M})`)}},this.render=()=>{const{mapboxToken:o,mapboxTokenError:i,isFetching:n}=this.state,{width:r}=this.props;return i?(0,j.jsx)(k,{width:r,error:i,deltaType:e}):n?(0,j.jsx)(y.E,{element:u.EA.create({style:u.EA.SkeletonStyle.ELEMENT})}):(0,j.jsx)(t,{...this.props,mapboxToken:o,width:r})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return o.displayName=`withMapboxToken(${t.displayName||t.name})`,o.contextType=C.n,b()(o,t)};var I=o(89653);const N=(0,I.A)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:o}=e;return{position:"relative",height:o,width:t}}),""),O=(0,I.A)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:t.zIndices.priority,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:"hidden",background:t.colors.bgColor},"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"&.mapboxgl-ctrl-icon:hover":{backgroundColor:t.colors.darkenedBgMix25},"& span":{filter:(0,h.iq)(t)?"":"invert(100%)"}}}}),"");var L=o(21640),$=o(71034),W=o.n($),z=o(32735);var V=o(3101),_=o(71279),D=o(95237),B=o(19507),P=o(89428),U=o(28246),J=o(54340),X=o(66643);const q={classes:{...U,...o(43539),...X,...o(41260),..._.bE},functions:{colorBins:D.A,colorCategories:B.A,colorContinuous:P.A}},G=new J.A({configuration:q});var K=o(39017),R=o(86044),Z=o(94514),H=o(10623),Q=o(55296),Y=o(97091),ee=o(25479),te=o(16249),oe=o(46909),ie=o(56605),ne=o(48754),re=o(16389),le=o(57741),se=o(82111),ae=o(40973),ce=o(34632),de=o(34895),he=o(77277),ue=o(39481),ge=o(47605);const me={[re.A.layerName]:["getFillColor"],[le.A.layerName]:["getFillColor"],[se.A.layerName]:["getFillColor"],[ae.A.layerName]:["getFillColor"],[ce.A.layerName]:["getFillColor"],[de.A.layerName]:["getFillColor"],[he.A.layerName]:["getColor"],[K.A.layerName]:["getTargetColor","getSourceColor"],[R.A.layerName]:["getFillColor"],[Z.A.layerName]:["getFillColor"],[H.A.layerName]:["getColor"],[Q.A.layerName]:["getColor"],[Y.A.layerName]:["getColor"],[ee.A.layerName]:["getColor"],[te.A.layerName]:["getFillColor"],[oe.A.layerName]:["getFillColor","getColor","getLineColor"],[ie.A.layerName]:["getFillColor"],[ne.A.layerName]:["getColor"],[ue.A.layerName]:["getColor"],[ge.A.layerName]:["getColor"]},pe=e=>{let{isSelected:t,object:o,objectInfo:i,opacity:n,originalFillFunction:r}=e;const l=(e=>{let{object:t,objectInfo:o,originalFillFunction:i}=e;const n="function"===typeof i?i(t,o):i;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if("string"===typeof n&&n.startsWith("@@=")){const e=G.convert({originalColor:n}).originalColor(t);return[e[0]||0,e[1]||0,e[2]||0,e[3]||255]}return null})({object:o,objectInfo:i,originalFillFunction:r});if(!l)return null;let s=0;return s=t?Math.max("number"===typeof l[3]?l[3]:n,n):Math.min("number"===typeof l[3]?l[3]:n,n),[l[0]||0,l[1]||0,l[2]||0,s]},fe={selection:{indices:{},objects:{}}},be=(e,t)=>{const o=t.match(/{(.*?)}/g);return o&&o.forEach((o=>{const i=o.substring(1,o.length-1);e.object.hasOwnProperty(i)?t=t.replace(o,e.object[i]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(i)&&(t=t.replace(o,e.object.properties[i]))})),t};function ve(e,t){if(!t.id)return fe;const o=e.getElementState(t.id,"selection");return null!==o&&void 0!==o?o:fe}function xe(e,t){if(!t.id)return fe;const o=e.getStringValue(t),i=o?L.A.parse(o):null;return null!==i&&void 0!==i?i:fe}function ye(e,t,o,i){e.id&&t.setStringValue(e,JSON.stringify(o.value),{fromUi:o.fromUi},i)}const Ce=e=>{var t;const{height:o,width:n,expanded:r}=(0,m.i)(p.T),{element:l,fragmentId:s,isLightTheme:a,theme:c,widgetMgr:d}=e,{selectionMode:h,tooltip:u,useContainerWidth:g}=l,f=null!==r&&void 0!==r&&r,[b,v]=(0,V._)({element:l,getDefaultState:ve,getStateFromWidgetMgr:xe,updateWidgetMgrState:ye,widgetMgr:d,fragmentId:s}),[x,y]=(0,i.useState)({bearing:0,pitch:0,zoom:11}),{height:C,width:w}=(e=>{let{container:t,element:o,heightFallback:n="auto",isFullScreen:r,shouldUseContainerWidth:l,widthFallback:s="auto"}=e;return{width:(0,i.useMemo)((()=>l||r?"100%":o.width||t.width||s),[t.width,o.width,r,l,s]),height:(0,i.useMemo)((()=>r&&t.height?t.height:o.height||t.height||n),[r,o.height,t.height,n])}})({element:l,isFullScreen:f,shouldUseContainerWidth:g,container:{height:o,width:n},heightFallback:(null===(t=x.initialViewState)||void 0===t?void 0:t.height)||500}),[S,j]=(0,i.useState)({}),k=h[0],F=void 0!==k,A=F&&Object.keys(b.selection.indices).length>0,M=(0,i.useMemo)((()=>Object.freeze(L.A.parse(l.json))),[f,a,l.json]),T=(0,i.useMemo)((()=>{const e={...M};if(e.mapStyle||(e.mapStyle=`mapbox://styles/mapbox/${a?"light":"dark"}-v9`),e.layers){const t=Object.values(b.selection.indices).some((e=>null===e||void 0===e?void 0:e.length)),o=e.layers.some((e=>Object.hasOwn(e,"pickable")));e.layers=e.layers.map((e=>{var i,n;if(!e||Array.isArray(e)||!F)return e;o||(e.pickable=!0);const r=`${e.id||null}`,l=(null===b||void 0===b||null===(i=b.selection)||void 0===i||null===(n=i.indices)||void 0===n?void 0:n[r])||[],s=me[e["@@type"]];if(!s)return e;const a={...e};return s.forEach((o=>{var i;a.updateTriggers={[o]:[...(null===(i=a.updateTriggers)||void 0===i?void 0:i[o])||[],l,t]};const n=!t,r=e[o];if(n||!r)return a;const s=Math.floor(102),d=(0,z.Du)(c.colors.primary),h=[d[0],d[1],d[2],255],u=(0,z.Du)(c.colors.gray20),g=[u[0],u[1],u[2],s];a[o]=(e,t)=>(e=>{let{isSelected:t,object:o,objectInfo:i,originalFillFunction:n,selectedColor:r,selectedOpacity:l=255,unselectedColor:s,unselectedOpacity:a=Math.floor(102)}=e;return t?pe({opacity:l,isSelected:!0,object:o,objectInfo:i,originalFillFunction:n})||r:pe({opacity:a,isSelected:!1,object:o,objectInfo:i,originalFillFunction:n})||s})({isSelected:l.includes(t.index),object:e,objectInfo:t,originalFillFunction:r,selectedColor:h,unselectedColor:g,selectedOpacity:255,unselectedOpacity:s})})),a}))}return null===e||void 0===e||delete e.views,G.convert(e)}),[b.selection.indices,a,F,M,c.colors.gray20,c.colors.primary]);(0,i.useEffect)((()=>{if(!W()(T.initialViewState,S)){const e=Object.keys(T.initialViewState).reduce(((e,t)=>T.initialViewState[t]===S[t]?e:{...e,[t]:T.initialViewState[t]}),{});y({...x,...e}),j(T.initialViewState)}}),[T.initialViewState,S,x]);const E=(0,i.useCallback)((e=>{if(!e||!e.object||!u)return null;const t=L.A.parse(u);return t.html?t.html=be(e,t.html):t.text=be(e,t.text),t}),[u]),I=(0,i.useCallback)((e=>{let{viewState:t}=e;y(t)}),[y]);return{createTooltip:E,data:b,deck:T,hasActiveSelection:A,height:C,isSelectionModeActivated:F,onViewStateChange:I,selectionMode:k,setSelection:v,viewState:x,width:w}};o(93298);(0,a.mk)([l.y,s.B]);const we=fe.selection,Se=[],je=E("st.pydeck_chart")((e=>{const{disabled:t,disableFullscreenMode:o,element:l,fragmentId:s,mapboxToken:a,widgetMgr:f}=e,{mapboxToken:b}=l,v=(0,c.u)(),{expanded:x,expand:y,collapse:C}=(0,m.i)(p.T),{createTooltip:w,data:S,deck:k,hasActiveSelection:F,height:A,isSelectionModeActivated:M,onViewStateChange:T,selectionMode:E,setSelection:I,viewState:L,width:$}=Ce({element:l,fragmentId:s,isLightTheme:(0,h.iq)(v),theme:v,widgetMgr:f}),[W,z]=(0,i.useState)(!1);(0,i.useEffect)((()=>{z(!0)}),[]);const V=(0,i.useCallback)((e=>{var t;if(void 0===E)return;const{index:o,object:i}=e,n=`${(null===(t=e.layer)||void 0===t?void 0:t.id)||null}`,r=S,l=-1===o,s=(()=>{if(l)return we;switch(E){case u.Xw.SelectionMode.SINGLE_OBJECT:var e;return(null===(e=r.selection.indices[n])||void 0===e?void 0:e[0])===o?we:{indices:{[`${n}`]:[o]},objects:{[`${n}`]:[i]}};case u.Xw.SelectionMode.MULTI_OBJECT:{const e=new Map(((null===r||void 0===r||null===(t=r.selection)||void 0===t||null===(s=t.indices)||void 0===s?void 0:s[n])||[]).map(((e,t)=>{var o,i,l;return[e,null===(o=r.selection)||void 0===o||null===(i=o.objects)||void 0===i||null===(l=i[n])||void 0===l?void 0:l[t]]})));if(e.has(o)?e.delete(o):e.set(o,i),0===e.size){const{[n]:e,...t}=r.selection.indices,{[n]:o,...i}=r.selection.objects;return{indices:t,objects:i}}return{indices:{...r.selection.indices,[`${n}`]:Array.from(e.keys())},objects:{...r.selection.objects,[`${n}`]:Array.from(e.values())}}}default:throw(e=>{throw new Error(`Reached a branch with non-exhaustive item: ${e}`)})(E),new Error("Invalid selection mode")}var t,s})();JSON.stringify(s)!==JSON.stringify(r.selection)&&I({fromUi:!0,value:{selection:s}})}),[E,S,I]),_=(0,i.useCallback)((()=>{I({value:{selection:we},fromUi:!0})}),[I]);return(0,j.jsxs)(N,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:$,height:A,children:[(0,j.jsx)(g.A,{isFullScreen:x,disableFullscreenMode:o,onExpand:y,onCollapse:C,target:N,locked:!(!F||t)||void 0,children:F&&!t&&(0,j.jsx)(g.K,{label:"Clear selection",onClick:_,icon:d.b})}),(0,j.jsxs)(n.A,{viewState:L,onViewStateChange:T,height:A,width:$,layers:W?k.layers:Se,getTooltip:w,ContextProvider:r.wZ.Provider,controller:!0,onClick:M&&!t?V:void 0,children:[(0,j.jsx)(r.b,{height:A,width:$,mapStyle:k.mapStyle&&("string"===typeof k.mapStyle?k.mapStyle:k.mapStyle[0]),mapboxApiAccessToken:b||a}),(0,j.jsx)(O,{children:(0,j.jsx)(r.ov,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})}))},85850:(e,t,o)=>{o.d(t,{K:()=>b,A:()=>v});o(58878);var i=o(8151),n=o(12274),r=o(63186),l=o(4629),s=o(997),a=o(36459),c=o(84720),d=o(64611),h=o(89653),u=o(16795);const g="-2.4rem",m=(0,h.A)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:o,target:i}=e;return{padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?g:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g},...i&&{[`${i}:hover &, ${i}:active &, ${i}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g}}}}}),""),p=(0,h.A)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,u.iq)(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 f=o(90782);function b(e){let{label:t,show_label:o,icon:n,onClick:r}=e;const h=(0,i.u)(),u=o?t:"";return(0,f.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,f.jsx)(s.A,{content:(0,f.jsx)(l.Ay,{source:t,allowHTML:!1,style:{fontSize:h.fontSizes.sm}}),placement:s.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,f.jsxs)(a.Ay,{onClick:e=>{r&&r(),e.stopPropagation()},kind:c.KX.ELEMENT_TOOLBAR,"aria-label":t,children:[n&&(0,f.jsx)(d.A,{content:n,size:"md",testid:"stElementToolbarButtonIcon"}),u&&(0,f.jsx)("span",{children:u})]})})})}const v=e=>{let{onExpand:t,onCollapse:o,isFullScreen:i,locked:l,children:s,target:a,disableFullscreenMode:c}=e;return(0,f.jsx)(m,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:l||i,target:a,children:(0,f.jsxs)(p,{children:[s,t&&!c&&!i&&(0,f.jsx)(b,{label:"Fullscreen",icon:n.g,onClick:()=>t()}),o&&!c&&i&&(0,f.jsx)(b,{label:"Close fullscreen",icon:r.Q,onClick:()=>o()})]})})}},34752:(e,t,o)=>{o.d(t,{X:()=>l,o:()=>r});var i=o(58878),n=o(25571);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(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}}function l(e){let{element:t,widgetMgr:o,onFormCleared:r}=e;(0,i.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,r);return()=>{e.disconnect()}}),[t,o,r])}},3101:(e,t,o)=>{o.d(t,{_:()=>l,t:()=>s});var i=o(58878),n=o(34752),r=o(25571);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:o,updateWidgetMgrState:l,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const[h,u]=(0,i.useState)((()=>{var e;return null!==(e=t(a,s))&&void 0!==e?e:o(a,s)})),[g,m]=(0,i.useState)({value:h,fromUi:!1});(0,i.useEffect)((()=>{(0,r.hX)(g)||(m(null),u(g.value),l(s,a,g,c))}),[g,l,s,a,c]);const p=(0,i.useCallback)((()=>{m({value:o(a,s),fromUi:!0}),null===d||void 0===d||d()}),[m,s,o,a,d]);return(0,n.X)({widgetMgr:a,element:s,onFormCleared:p}),[h,m]}function s(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:o,getCurrStateFromProto:n,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const h=(0,i.useCallback)(((e,t)=>o(t)),[o]),[u,g]=l({getStateFromWidgetMgr:t,getDefaultState:h,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d});return(0,i.useEffect)((()=>{s.setValue&&(s.setValue=!1,g({value:n(s),fromUi:!1}))}),[s,n,g]),[u,g]}}}]);
|