streamlit-nightly 1.52.3.dev20260102__py3-none-any.whl → 1.52.3.dev20260104__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/layouts.py +10 -2
- streamlit/elements/lib/layout_utils.py +27 -3
- streamlit/elements/space.py +10 -2
- streamlit/errors.py +3 -1
- streamlit/proto/GapSize_pb2.py +2 -2
- streamlit/proto/GapSize_pb2.pyi +8 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +296 -296
- streamlit/static/static/js/{ErrorOutline.esm.0yuPC2le.js → ErrorOutline.esm.DB4TeKXQ.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.3-xCz5Dn.js → FileDownload.esm.B1rsRcZM.js} +1 -1
- streamlit/static/static/js/{FileHelper.B7p1stfH.js → FileHelper.Dy-ENeyM.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.2gb34MMC.js → FormClearHelper.wCJbsz1D.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CMaz--YN.js → InputInstructions.h-b7uu-m.js} +1 -1
- streamlit/static/static/js/{Particles.DD6E7DiG.js → Particles.DMdiwhvk.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CBHvskJx.js → ProgressBar.InacggUW.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.Cbd0Ng31.js → StreamlitSyntaxHighlighter.CyryJTW-.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.DkPOnPiP.js → TableChart.esm.DCIQ3yuB.js} +1 -1
- streamlit/static/static/js/{Toolbar.uViLYWIL.js → Toolbar.CdfNxtO4.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.DrQP-jZR.js → WidgetLabelHelpIconInline.DLM1gtZz.js} +1 -1
- streamlit/static/static/js/{base-input.CWLDgMIQ.js → base-input.BCIrgNRb.js} +1 -1
- streamlit/static/static/js/{checkbox.lSnX8MiZ.js → checkbox.cSjLtYx0.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.qE-XPzHd.js → createDownloadLinkElement.BD_DYT7M.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CixSgiOW.js → data-grid-overlay-editor.BWp1Ajhl.js} +1 -1
- streamlit/static/static/js/{downloader.BR9PJ-pW.js → downloader.CEDLkUji.js} +1 -1
- streamlit/static/static/js/{embed.C4scQ-hW.js → embed.Dn7p4MYf.js} +1 -1
- streamlit/static/static/js/{es6.NjGX1Pno.js → es6.C3cvBhbs.js} +2 -2
- streamlit/static/static/js/{formatNumber.DwAT32vb.js → formatNumber.Bsp-qOPC.js} +1 -1
- streamlit/static/static/js/{iconPosition.BF4yacmi.js → iconPosition.DIRj5SlL.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.BGF3G8-a.js → iframeResizer.contentWindow.tjj-iaW8.js} +1 -1
- streamlit/static/static/js/{index.CsbjfvSm.js → index.2-6ocypr.js} +1 -1
- streamlit/static/static/js/{index.Es18h2ap.js → index.65xiOHvb.js} +1 -1
- streamlit/static/static/js/{index.DUS_Khvb.js → index.7mJnVlDm.js} +1 -1
- streamlit/static/static/js/{index.DEF4aL6h.js → index.B0DCNp1Y.js} +5 -5
- streamlit/static/static/js/{index.L46XQsIY.js → index.BIWD38us.js} +1 -1
- streamlit/static/static/js/{index.CU6HHyYl.js → index.BU_tKVxv.js} +1 -1
- streamlit/static/static/js/{index.B_rx628n.js → index.BXggolS2.js} +1 -1
- streamlit/static/static/js/{index.Bh-DEB0O.js → index.BdwE460H.js} +1 -1
- streamlit/static/static/js/{index.iV4zN5GV.js → index.BgFWPu68.js} +1 -1
- streamlit/static/static/js/{index.CSPw4GmF.js → index.BrhVkvAP.js} +1 -1
- streamlit/static/static/js/{index.CYAiwpaf.js → index.BzF2fUQY.js} +1 -1
- streamlit/static/static/js/{index.Duio3diQ.js → index.C6KU1c_I.js} +1 -1
- streamlit/static/static/js/{index.DPeqx79l.js → index.CJNYj-GU.js} +1 -1
- streamlit/static/static/js/{index.47QtlXbw.js → index.CKv21ig2.js} +1 -1
- streamlit/static/static/js/{index.CrqhxXJA.js → index.CLchkPc0.js} +1 -1
- streamlit/static/static/js/{index.BxQj1n_M.js → index.CMToM8tv.js} +1 -1
- streamlit/static/static/js/{index.AbRqTgeF.js → index.CP-UEHmv.js} +1 -1
- streamlit/static/static/js/{index.Ce0tmU7o.js → index.CQk1zChj.js} +1 -1
- streamlit/static/static/js/{index.BibdADOD.js → index.CU7z3OC0.js} +1 -1
- streamlit/static/static/js/{index.BMEupOtG.js → index.ChoFIv3e.js} +1 -1
- streamlit/static/static/js/{index.DwRMR_Ao.js → index.CkA0etie.js} +1 -1
- streamlit/static/static/js/{index.DkQIXYcv.js → index.CkWtzTE7.js} +1 -1
- streamlit/static/static/js/{index.B2FiJl2X.js → index.ClZw_QCU.js} +1 -1
- streamlit/static/static/js/{index.Cio1dNsf.js → index.Cma1PKQE.js} +1 -1
- streamlit/static/static/js/{index.BMxizVm_.js → index.CpgN7t8w.js} +1 -1
- streamlit/static/static/js/{index.Cd-5Vmzk.js → index.Cqo3gLMs.js} +1 -1
- streamlit/static/static/js/{index.D_zZYX-F.js → index.D-LmUIYK.js} +1 -1
- streamlit/static/static/js/{index.DPn1549d.js → index.D9QOVKpD.js} +1 -1
- streamlit/static/static/js/{index.CW9ezGuy.js → index.DERvWU-H.js} +1 -1
- streamlit/static/static/js/{index.-zR4Ojkd.js → index.DPXljG88.js} +1 -1
- streamlit/static/static/js/{index.x9TEvcRW.js → index.DTtGJWwh.js} +1 -1
- streamlit/static/static/js/{index.DD6jbP16.js → index.D_MQwywr.js} +1 -1
- streamlit/static/static/js/{index.dPnBpGLy.js → index.DbV0rUEu.js} +1 -1
- streamlit/static/static/js/{index.BduCcO_U.js → index.DjxVfGrI.js} +1 -1
- streamlit/static/static/js/{index.Bu9qeYdI.js → index.REjZL5tN.js} +1 -1
- streamlit/static/static/js/{index.BdVxH2a1.js → index.VAsk7L3S.js} +1 -1
- streamlit/static/static/js/{index.ayxJkxJS.js → index.XOden_TM.js} +6 -6
- streamlit/static/static/js/{index.BQm1_d2O.js → index.Y-fts05K.js} +1 -1
- streamlit/static/static/js/{index.BsbD_ZbU.js → index.Y1-tp-v8.js} +1 -1
- streamlit/static/static/js/{index.C1zhyjFt.js → index.Y9iivd6m.js} +1 -1
- streamlit/static/static/js/{index.BD8Aa49F.js → index.ZVTCDY95.js} +1 -1
- streamlit/static/static/js/{index.DgxjQf8D.js → index.glmKpzAC.js} +1 -1
- streamlit/static/static/js/{index.C3Czde8V.js → index.hkR1h-xb.js} +1 -1
- streamlit/static/static/js/{index.C4N9_AWk.js → index.hkwmBmj1.js} +1 -1
- streamlit/static/static/js/{index.BO_-eOf-.js → index.lGfrZbsE.js} +1 -1
- streamlit/static/static/js/{index.BDI5MuEQ.js → index.oX51i0fi.js} +1 -1
- streamlit/static/static/js/{index.DLYqRljk.js → index.qsDXxiva.js} +1 -1
- streamlit/static/static/js/{index.D1JGP_72.js → index.xp9Iy5jw.js} +1 -1
- streamlit/static/static/js/{input.BViGVyAy.js → input.BLVfcIAQ.js} +1 -1
- streamlit/static/static/js/{main.DCurQa2X.js → main.DOT_xSoS.js} +1 -1
- streamlit/static/static/js/{memory.CeqRSVmL.js → memory.BU-JM8pI.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BNei35vX.js → number-overlay-editor.BI4bxl54.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BQNPcCRH.js → pandasStylerUtils.BAO8bi8z.js} +1 -1
- streamlit/static/static/js/{sandbox.Bkc6ExUI.js → sandbox.BEvKSsDs.js} +1 -1
- streamlit/static/static/js/{styled-components.C0Ar4ws1.js → styled-components.BeC32T5O.js} +1 -1
- streamlit/static/static/js/{throttle.DpJVqfiM.js → throttle.BZ3PXlI9.js} +1 -1
- streamlit/static/static/js/{timepicker.plxFjD2l.js → timepicker.BThGAJl8.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.nocm-m15.js → toConsumableArray.CFvVrWwv.js} +1 -1
- streamlit/static/static/js/uniqueId.DDvAwLSm.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CD1aG6-a.js → useBasicWidgetState.DRzRDWGT.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.DLuHgCFO.js → useIntlLocale.CdE4T1Ur.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.5E_gpUfB.js → useTextInputAutoExpand.BVefdTg1.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.DWX5Hfxx.js → useUpdateUiValue.Ce3tYwUF.js} +1 -1
- streamlit/static/static/js/{useWaveformController.B3tf7xqQ.js → useWaveformController.CKTio31b.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.kZou334h.js → withCalculatedWidth.BcZACcrB.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DGTtbbLe.js → withFullScreenWrapper.CZmpHubt.js} +1 -1
- {streamlit_nightly-1.52.3.dev20260102.dist-info → streamlit_nightly-1.52.3.dev20260104.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.52.3.dev20260102.dist-info → streamlit_nightly-1.52.3.dev20260104.dist-info}/RECORD +101 -101
- streamlit/static/static/js/uniqueId.BgdRqRrS.js +0 -1
- {streamlit_nightly-1.52.3.dev20260102.data → streamlit_nightly-1.52.3.dev20260104.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.52.3.dev20260102.dist-info → streamlit_nightly-1.52.3.dev20260104.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.52.3.dev20260102.dist-info → streamlit_nightly-1.52.3.dev20260104.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.52.3.dev20260102.dist-info → streamlit_nightly-1.52.3.dev20260104.dist-info}/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{an as q,x as J,r as c,b8 as Q,l as Y,b9 as ee,ba as l,j as L,o as te,p as re,P as ne,bb as oe,ac as ie,bc as ae,b as ue,B as C,c as x,D as le}from"./index.
|
|
1
|
+
import{an as q,x as J,r as c,b8 as Q,l as Y,b9 as ee,ba as l,j as L,o as te,p as re,P as ne,bb as oe,ac as ie,bc as ae,b as ue,B as C,c as x,D as le}from"./index.XOden_TM.js";import{W as ce}from"./WidgetLabelHelpIconInline.DLM1gtZz.js";import{u as se}from"./useBasicWidgetState.DRzRDWGT.js";import"./FormClearHelper.wCJbsz1D.js";var fe={secondary:"secondary"},N={default:"default"},pe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function $(){return $=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},$.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){return Se(e)||me(e,t)||he(e,t)||be()}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function he(e,t){if(e){if(typeof e=="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,d;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,d=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw d}}return n}}function Se(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(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 Oe(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ee(e,t){if(typeof t!="function"&&t!==null)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&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},G(e,t)}function _e(e){var t=Le();return function(){var n=B(e),o;if(t){var i=B(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return we(this,o)}}function we(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Le(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B(e)}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Re(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var H=(function(e){Ee(r,e);var t=_e(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),V(F(n),"childRefs",{}),n}return Oe(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,d=a===void 0?{}:a,s=i.mode,y=s===void 0?k.checkbox:s,S=i.children,b=i.selected,E=i.disabled,f=i.onClick,h=i.kind,v=i.shape,m=i.size,I=J(d.Root,z),_=ye(I,2),A=_[0],R=_[1],w=this.props["aria-label"]||this.props.ariaLabel,p=y===k.radio,W=c.Children.count(S);return c.createElement(Q.Consumer,null,function(Z){return c.createElement(A,$({"aria-label":w||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:p?"radiogroup":"group",$shape:v,$length:S.length},R),c.Children.map(S,function(g,P){if(!c.isValidElement(g))return null;var D=g.props.isSelected?g.props.isSelected:Re(b,P);return p&&(o.childRefs[P]=c.createRef()),c.cloneElement(g,{disabled:E||g.props.disabled,isSelected:D,ref:p?o.childRefs[P]:void 0,tabIndex:!p||D||p&&(!b||b===-1)&&P===0?0:-1,onKeyDown:function(u){if(p){var O=Number(b)?Number(b):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=O-1<0?W-1:O-1;f&&f(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var j=O+1>W-1?0:O+1;f&&f(u,j),o.childRefs[j].current&&o.childRefs[j].current.focus()}}},kind:h,onClick:function(u){E||(g.props.onClick&&g.props.onClick(u),f&&f(u,P))},shape:v,size:m,overrides:de({BaseButton:{style:function(u){var O=u.$theme;return S.length===1?{}:v!==N.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:p?"radio":"checkbox"}}},g.props.overrides)})}))})}}]),r})(c.Component);V(H,"defaultProps",{disabled:!1,onClick:function(){},shape:N.default,size:pe.default,kind:fe.secondary});function Pe(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e===l.ClickMode.MULTI_SELECT?Pe(t,r??[]):r?.includes(t)?[]:[t]}function ke(e){return e.length===0?-1:e[0]}function Be(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===l.Style.PILLS?C.PILLS:r===l.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?x.XSMALL:x.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:L(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Ae(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function De(e,t){return e&&(t=`${t}Active`),t}function Te(e,t,r){const n={flexWrap:"wrap",maxWidth:r?"100%":"fit-content",margin:"0 0"},o=r?"100%":"auto";switch(e){case l.Style.BORDERLESS:return{...n,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case l.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,width:o};default:return n}}function je(e,t,r,n,o,i,a){const d=Ae(r,n,o,t);let s=e.content,y=e.contentIcon;return d&&(s=e.selectedContent?e.selectedContent:s,y=e.selectedContentIcon?e.selectedContentIcon:y),c.forwardRef(function(b,E){const{element:f,kind:h,size:v}=Ie(s??"",y??void 0,i),m=De(!!(d&&!e.selectedContent&&!e.selectedContentIcon),h);return L(ue,{...b,size:v,kind:m,containerWidth:a,children:f})})}function Me(e,t){return e.getIntArrayValue(t)}function $e(e){return e.default??[]}function Ge(e){return e.value??[]}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:d,selectionVisualization:s,style:y,label:S,labelVisibility:b,help:E}=r,f=Y(),[h,v]=se({getStateFromWidgetMgr:Me,getDefaultStateFromProto:$e,getCurrStateFromProto:Ge,updateWidgetMgrState:Be,element:r,widgetMgr:o,fragmentId:n}),m=ee(i),I=(R,w)=>{const p=Ce(a,w,h);v({value:p,fromUi:!0})};let _;a===l.ClickMode.SINGLE_SELECT?_=k.radio:a===l.ClickMode.MULTI_SELECT&&(_=k.checkbox);const A=c.useMemo(()=>d.map((R,w)=>{const p=je(R,w,s,a,h,y,m);return L(p,{},`${R.content}-${w}`)}),[a,d,s,y,h,m]);return te(ae,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:m,children:[L(ie,{label:S,disabled:t,labelVisibility:re(b?.value??oe.LabelVisibilityOptions.COLLAPSED),children:E&&L(ce,{content:E,placement:ne.TOP,label:S})}),L(H,{disabled:t,mode:_,onClick:I,selected:a===l.ClickMode.MULTI_SELECT?h:ke(h),overrides:{Root:{style:c.useCallback(()=>Te(y,f.spacing,m),[y,f.spacing,m])}},children:A})]})}const xe=c.memo(Ne);export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as u,r as L,X as C,o as x,j as i,V as E,q as b,W as v}from"./index.
|
|
1
|
+
import{F as u,r as L,X as C,o as x,j as i,V as E,q as b,W as v}from"./index.XOden_TM.js";import{w as y,E as W}from"./withFullScreenWrapper.CZmpHubt.js";import{S as p,T}from"./Toolbar.CdfNxtO4.js";const F=u("div",{target:"e1xt4yf90"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),j=u("div",{target:"e1xt4yf91"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),H=u("div",{target:"e1xt4yf92"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),M=v.getLogger("ImageList");function R(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const G=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=E(t.url);return x(j,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(H,{"data-testid":"stImageCaption",style:r,children:i(b,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function O({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:f,collapse:h}=C(W),g=d||0,I=R(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;M.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return x(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(T,{target:p,isFullScreen:s,onExpand:f,onCollapse:h,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(G,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const U=y(O),D=L.memo(U);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as B,_ as X,l as $,e as L,R as Q,Q as K,be as j,bf as z,bg as Y,bh as Z,n as k,bi as M,W as P,X as q,k as ee,b9 as te,bj as ne,j as R,o as re,b2 as se}from"./index.
|
|
1
|
+
import{r as a,E as B,_ as X,l as $,e as L,R as Q,Q as K,be as j,bf as z,bg as Y,bh as Z,n as k,bi as M,W as P,X as q,k as ee,b9 as te,bj as ne,j as R,o as re,b2 as se}from"./index.XOden_TM.js";import{w as oe,E as ae}from"./withFullScreenWrapper.CZmpHubt.js";import{a as _,S as H,T as ce}from"./Toolbar.CdfNxtO4.js";import{R as ie}from"./index.B0DCNp1Y.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.Dn7p4MYf.js";import{u as he}from"./FormClearHelper.wCJbsz1D.js";import{T as ge}from"./TableChart.esm.DCIQ3yuB.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.BAO8bi8z.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.DOT_xSoS.js";import"./throttle.BZ3PXlI9.js";import"./formatNumber.Bsp-qOPC.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.cSjLtYx0.js";import"./createDownloadLinkElement.BD_DYT7M.js";import"./toConsumableArray.CFvVrWwv.js";import"./FileDownload.esm.B1rsRcZM.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,X({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,f,l,u,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(u-40,0)),s&&(t.height=p),e&&(t.width=u,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=u)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return f.length>0&&ye(t),t},we=(n,e,s,r,f)=>{const l=$(),{id:u,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,f,d,h,l,e,s),[t,r,f,d,h,l,e,s]);return{id:u,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,f]of Object.entries(e))s[r]=F(f);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:f,numIndexColumns:l}=n.dimensions,u=n.columnTypes[0]??void 0,p=u&&u.type===Q.INDEX&&(K(u)||j(u)||z(u));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<f;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(j(h)||z(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const De=150,Ve=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:f,selectionMode:l}=n,u=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(De,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const V={id:r,formId:f},N=JSON.parse(e.getStringValue(V)||"{}"),D={selection:{...N?.selection||{},[d]:S||{}}};M(N,D)||e.setStringValue(V,JSON.stringify(D),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){Ve.warn("Failed to restore view state",c)}return t},[r,l,e,f,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:f},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,f,s,l,e]);return{maybeConfigureSelections:u,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),f=a.useRef(null),l=a.useRef(W),u=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:V}=n;a.useEffect(()=>{t.current=S,o.current=V,r.current===null&&(u.current=S,p.current=V)},[S,V]);const N=a.useCallback(()=>{f.current&&f.current(),f.current=null,r.current=null},[]),D=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:A,finalize:T}=await fe(g.current,b,w);r.current=i(A),f.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),u.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=u.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const A=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=A[O];E(r.current,O,x,C)}for(const m of Object.keys(A))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),u.current=g,p.current=b,r.current},[E,c]);return{createView:D,updateView:v,finalizeView:N}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:f,heightConfig:l})=>{const[u,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:V,height:N,elementRef:D}=ee([u],0),E=te(f)||e.useContainerWidth,v=ne(l),g=Ae(e.spec),b=Re(e.spec),w=we(e,g?i??0:V,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:A,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(D.current!==null&&y(D,O),T),[y,T,O,i,d,u,D]),a.useEffect(()=>{A(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),u?R(ie,{data:m??C[0]?.data,height:d??N??void 0,width:f??void 0,customToolbarActions:[R(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[R(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&R(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),R(se,{styles:[me]}),R(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:D})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,r as a,o as t,j as r,q as o}from"./index.
|
|
1
|
+
import{F as e,r as a,o as t,j as r,q as o}from"./index.XOden_TM.js";import{P as i}from"./ProgressBar.InacggUW.js";const l=e("div",{target:"e1jwj65h0"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as f,r as a,l as m,o as x,j as i,Z as v,q as L,$ as r,a0 as R,m as C,n as k,a1 as B,a2 as E}from"./index.
|
|
1
|
+
import{F as f,r as a,l as m,o as x,j as i,Z as v,q as L,$ as r,a0 as R,m as C,n as k,a1 as B,a2 as E}from"./index.XOden_TM.js";const z=f("button",{target:"e1a81sb30"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),H=f("div",{target:"e1a81sb31"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"e1a81sb32"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function M(o){const t=C(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:o.colors.bgColor,filter:t?"brightness(0.98)":"brightness(1.2)",color:o.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:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function I(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function j({element:o}){const{body:t,icon:s,duration:d}=o,n=m(),c=I(t),l=t!==c,[e,T]=a.useState(!l),[b,S]=a.useState(0),y=a.useCallback(()=>{T(!e)},[e]),g=a.useMemo(()=>M(n),[n]),p=a.useMemo(()=>x(H,{expanded:e,children:[s&&i(v,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:e?t:c,allowHTML:!1,isToast:!0}),l&&i(z,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[l,e,t,s,c,y]);a.useEffect(()=>{if(n.inSidebar)return;const w=k(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:w});return S(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),a.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const h=i(E,{kind:B.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."});return i(R,{children:n.inSidebar&&h})}const O=a.memo(j);export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,l as k,m as T,j as n,o as C,p as y,q as S,P as L,t as W,v as w,C as B,w as R}from"./index.
|
|
1
|
+
import{r as m,l as k,m as T,j as n,o as C,p as y,q as S,P as L,t as W,v as w,C as B,w as R}from"./index.XOden_TM.js";import{W as E}from"./WidgetLabelHelpIconInline.DLM1gtZz.js";import{u as P}from"./useBasicWidgetState.DRzRDWGT.js";import{S as v,L as $,a as u}from"./checkbox.cSjLtYx0.js";import"./FormClearHelper.wCJbsz1D.js";function X({element:t,disabled:a,widgetMgr:s,fragmentId:d}){const[p,g]=P({getStateFromWidgetMgr:H,getDefaultStateFromProto:M,getCurrStateFromProto:V,updateWidgetMgrState:F,element:t,widgetMgr:s,fragmentId:d}),f=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),e=k(),{colors:o,spacing:h,sizes:r}=e,b=T(e),x=a?o.fadedText40:o.bodyText;return n(R,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:p,disabled:a,onChange:f,"aria-label":t.label,checkmarkType:t.type===B.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:$.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?o.bgColor:o.bodyText;return a&&(c=b?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${e.spacing.twoXS})`,height:`calc(${r.checkbox} - ${e.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:e.spacing.twoXS,paddingLeft:e.spacing.threeXS,paddingRight:e.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:e.radii.full,borderTopLeftRadius:e.radii.full,borderBottomRightRadius:e.radii.full,borderTopRightRadius:e.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:e.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?w(o.primary):"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:e.lineHeights.small,paddingLeft:e.spacing.sm,position:"relative",color:x}}},children:C(W,{visibility:y(t.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&n(E,{content:t.help,placement:L.TOP_RIGHT,label:t.label})]})})})}function H(t,a){return t.getBoolValue(a)}function M(t){return t.default??null}function V(t){return t.value??null}function F(t,a,s,d){a.setBoolValue(t,s.value,{fromUi:s.fromUi},d)}const A=m.memo(X);export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{F as f,ai as x,r as s,l as b,aJ as y,j as l,aK as S,ax as v,o as h,m as T,Z as R,aL as B,aM as E,aN as J}from"./index.
|
|
1
|
+
import{F as f,ai as x,r as s,l as b,aJ as y,j as l,aK as S,ax as v,o as h,m as T,Z as R,aL as B,aM as E,aN as J}from"./index.XOden_TM.js";import{l as k}from"./index.8HslT92O.js";import{R as j}from"./main.DOT_xSoS.js";const w=f("div",{target:"e1l93qjt0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"e1l93qjt1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),P=f("button",{target:"e1l93qjt2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:x(o)}})),$=f("div",{target:"e1l93qjt3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function I({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=s.useState(!0),r=b(),{colors:i,radii:a}=r,{isCopied:c,copyToClipboard:u,label:m}=y(),g=s.useCallback(()=>{n(!1),d()},[d]),C=s.useCallback(()=>{u(t)},[u,t]);return l(B,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[l("code",{children:t}),l(P,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:l(R,{size:"sm",iconValue:c?":material/check:":":material/content_copy:"})})]}),placement:v.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(r)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:l($,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const F=s.memo(I);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const r=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${r}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function A(){const[o,e]=s.useState(null),t=s.useRef({x:0,y:0});s.useEffect(()=>{const n=r=>{t.current={x:r.clientX,y:r.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=s.useCallback(n=>{const{x:r,y:i}=t.current,a=[...n.namespace,n.name],c=z(a);e({path:c,x:r,y:i})},[]),p=s.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function M({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=A(),{copyToClipboard:n}=y(),r=s.useCallback(c=>{n(JSON.stringify(c.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(c){const u=E(c);try{i=k.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
|
|
2
2
|
${o.body.substring(0,g+1)} ← here`,l(J,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[l(j,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:r,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&l(F,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const D=s.memo(M);export{D as default};
|