streamlit 1.48.0__py3-none-any.whl → 1.49.0__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/__init__.py +3 -10
- streamlit/commands/logo.py +4 -3
- streamlit/commands/navigation.py +1 -1
- streamlit/commands/page_config.py +4 -1
- streamlit/components/v1/custom_component.py +2 -2
- streamlit/config.py +82 -1
- streamlit/connections/snowflake_connection.py +3 -1
- streamlit/delta_generator.py +3 -0
- streamlit/elements/arrow.py +155 -70
- streamlit/elements/bokeh_chart.py +13 -3
- streamlit/elements/deck_gl_json_chart.py +0 -1
- streamlit/elements/dialog_decorator.py +7 -59
- streamlit/elements/form.py +10 -1
- streamlit/elements/graphviz_chart.py +57 -6
- streamlit/elements/heading.py +17 -16
- streamlit/elements/iframe.py +13 -22
- streamlit/elements/image.py +64 -37
- streamlit/elements/layouts.py +2 -2
- streamlit/elements/lib/built_in_chart_utils.py +2 -5
- streamlit/elements/lib/column_config_utils.py +18 -4
- streamlit/elements/lib/column_types.py +75 -30
- streamlit/elements/lib/dialog.py +3 -3
- streamlit/elements/lib/image_utils.py +19 -11
- streamlit/elements/lib/layout_utils.py +15 -2
- streamlit/elements/lib/utils.py +20 -41
- streamlit/elements/markdown.py +7 -6
- streamlit/elements/media.py +6 -13
- streamlit/elements/metric.py +78 -1
- streamlit/elements/pdf.py +192 -0
- streamlit/elements/plotly_chart.py +3 -2
- streamlit/elements/pyplot.py +53 -11
- streamlit/elements/toast.py +81 -5
- streamlit/elements/vega_charts.py +3 -8
- streamlit/elements/widgets/audio_input.py +0 -1
- streamlit/elements/widgets/button.py +0 -4
- streamlit/elements/widgets/button_group.py +5 -4
- streamlit/elements/widgets/camera_input.py +0 -1
- streamlit/elements/widgets/chat.py +11 -13
- streamlit/elements/widgets/checkbox.py +0 -1
- streamlit/elements/widgets/color_picker.py +0 -1
- streamlit/elements/widgets/data_editor.py +142 -62
- streamlit/elements/widgets/file_uploader.py +74 -37
- streamlit/elements/widgets/multiselect.py +0 -1
- streamlit/elements/widgets/number_input.py +0 -1
- streamlit/elements/widgets/radio.py +0 -1
- streamlit/elements/widgets/select_slider.py +0 -1
- streamlit/elements/widgets/selectbox.py +0 -1
- streamlit/elements/widgets/slider.py +0 -1
- streamlit/elements/widgets/text_widgets.py +0 -2
- streamlit/elements/widgets/time_widgets.py +0 -2
- streamlit/errors.py +11 -0
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/Arrow_pb2.py +14 -8
- streamlit/proto/Arrow_pb2.pyi +11 -3
- streamlit/proto/Block_pb2.py +16 -16
- streamlit/proto/Block_pb2.pyi +2 -0
- streamlit/proto/ChatInput_pb2.py +3 -3
- streamlit/proto/ChatInput_pb2.pyi +2 -0
- streamlit/proto/FileUploader_pb2.py +2 -2
- streamlit/proto/FileUploader_pb2.pyi +5 -1
- streamlit/proto/GraphVizChart_pb2.py +4 -2
- streamlit/proto/GraphVizChart_pb2.pyi +1 -1
- streamlit/proto/IFrame_pb2.py +8 -2
- streamlit/proto/IFrame_pb2.pyi +3 -0
- streamlit/proto/Image_pb2.py +4 -2
- streamlit/proto/Image_pb2.pyi +1 -10
- streamlit/proto/Metric_pb2.py +8 -6
- streamlit/proto/Metric_pb2.pyi +34 -10
- streamlit/proto/Toast_pb2.py +2 -2
- streamlit/proto/Toast_pb2.pyi +10 -1
- streamlit/runtime/caching/__init__.py +14 -2
- streamlit/runtime/caching/cache_data_api.py +0 -17
- streamlit/runtime/caching/cache_resource_api.py +0 -16
- streamlit/runtime/caching/cached_message_replay.py +8 -20
- streamlit/runtime/caching/hashing.py +31 -1
- streamlit/runtime/credentials.py +4 -4
- streamlit/runtime/fragment.py +0 -42
- streamlit/runtime/websocket_session_manager.py +1 -1
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +224 -252
- streamlit/static/static/css/{index.CJVRHjQZ.css → index.C8X8rNzw.css} +1 -1
- streamlit/static/static/css/index.COe1010n.css +1 -0
- streamlit/static/static/js/{ErrorOutline.esm.D_4oFNKB.js → ErrorOutline.esm.u9XvzxL8.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.NPgaLlUE.js → FileDownload.esm.CaRyZ-b2.js} +1 -1
- streamlit/static/static/js/FileHelper.Dk2SwIi3.js +5 -0
- streamlit/static/static/js/FormClearHelper.l_UPPvkg.js +1 -0
- streamlit/static/static/js/{Hooks.BGm9sd4U.js → Hooks.BxrVEftw.js} +1 -1
- streamlit/static/static/js/InputInstructions.C254RU9X.js +1 -0
- streamlit/static/static/js/Particles.DkY6FDnc.js +1 -0
- streamlit/static/static/js/ProgressBar.BPtSM82n.js +2 -0
- streamlit/static/static/js/Toolbar.BO_3WBaS.js +1 -0
- streamlit/static/static/js/{base-input.DeBqm5mN.js → base-input.egUI4LjJ.js} +4 -4
- streamlit/static/static/js/{checkbox.C0odQfKb.js → checkbox.ButpszcE.js} +2 -2
- streamlit/static/static/js/createSuper.DYJA5xa6.js +1 -0
- streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +1 -0
- streamlit/static/static/js/{downloader.Bx1D0jhz.js → downloader.B3TjsSPZ.js} +1 -1
- streamlit/static/static/js/es6.BYSNuG4D.js +2 -0
- streamlit/static/static/js/iframeResizer.contentWindow.CNPHJsF2.js +1 -0
- streamlit/static/static/js/index.0tDq1WXk.js +1 -0
- streamlit/static/static/js/index.BBnWuh07.js +976 -0
- streamlit/static/static/js/index.BDZorv41.js +1 -0
- streamlit/static/static/js/{index.DwaoC4Zp.js → index.BH79B25f.js} +3 -3
- streamlit/static/static/js/index.BeTC4Yl-.js +197 -0
- streamlit/static/static/js/index.BnOd05Ko.js +2 -0
- streamlit/static/static/js/index.BoJaJReB.js +1 -0
- streamlit/static/static/js/index.Bp1Of6L8.js +1 -0
- streamlit/static/static/js/index.Bpe4-O2W.js +1 -0
- streamlit/static/static/js/index.BrD9sbpx.js +1 -0
- streamlit/static/static/js/index.C1qCS-sd.js +1 -0
- streamlit/static/static/js/index.C3EXAI-u.js +1 -0
- streamlit/static/static/js/index.C77g9sAQ.js +3 -0
- streamlit/static/static/js/{index.PyIqRRSR.js → index.CFePF7s4.js} +1 -1
- streamlit/static/static/js/index.CFjU0x00.js +1 -0
- streamlit/static/static/js/index.Ca3y4ztK.js +1 -0
- streamlit/static/static/js/{index.ClRTsv8m.js → index.Cb9gN2T2.js} +2 -2
- streamlit/static/static/js/{index.wDYef4mQ.js → index.CbwuUwu4.js} +9 -9
- streamlit/static/static/js/index.CeXLlclc.js +1 -0
- streamlit/static/static/js/index.CfiZGqj3.js +3 -0
- streamlit/static/static/js/index.CjQnYKID.js +1 -0
- streamlit/static/static/js/index.Cl_966eE.js +3858 -0
- streamlit/static/static/js/{index.DCpyIFTV.js → index.CqSRo6zQ.js} +1 -1
- streamlit/static/static/js/index.CuEFSQ-o.js +1 -0
- streamlit/static/static/js/index.D4jR1m1z.js +1 -0
- streamlit/static/static/js/index.DGcW849X.js +1 -0
- streamlit/static/static/js/index.DKb-BAE2.js +1 -0
- streamlit/static/static/js/index.DP1rDFP0.js +1 -0
- streamlit/static/static/js/{index.HeVbRh9H.js → index.DStzYLqM.js} +2 -2
- streamlit/static/static/js/index.DVKQKDLu.js +1 -0
- streamlit/static/static/js/index.DWedOrkQ.js +1 -0
- streamlit/static/static/js/index.DYbRPmVF.js +1 -0
- streamlit/static/static/js/index.DgpIMUsr.js +1 -0
- streamlit/static/static/js/index.DtwkPJs5.js +5367 -0
- streamlit/static/static/js/{index.CnfWsQzS.js → index.MQLQLR5Z.js} +1 -1
- streamlit/static/static/js/index.uInpwWAP.js +1 -0
- streamlit/static/static/js/index.z992t-BQ.js +7 -0
- streamlit/static/static/js/{input.BL2buuce.js → input.CbP5ZuQ7.js} +2 -2
- streamlit/static/static/js/{memory.CUxjUWS7.js → memory.BuacVo2L.js} +1 -1
- streamlit/static/static/js/number-overlay-editor.BZb9zRl_.js +9 -0
- streamlit/static/static/js/{possibleConstructorReturn.DbvQboK3.js → possibleConstructorReturn.DSM84rOS.js} +1 -1
- streamlit/static/static/js/{sandbox.6lnFVWhX.js → sandbox.C480llMG.js} +1 -1
- streamlit/static/static/js/{timepicker.Bg4xAK95.js → timepicker.BunxCVp7.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.D9x7Ktv4.js → toConsumableArray.B4o8rEx1.js} +3 -3
- streamlit/static/static/js/uniqueId.tii0yosY.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CUSYQZpm.js → useBasicWidgetState.Bnm4FD6K.js} +1 -1
- streamlit/static/static/js/useTextInputAutoExpand.Dgtwc1m0.js +2 -0
- streamlit/static/static/js/useUpdateUiValue.DjXdMFGw.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
- streamlit/user_info.py +16 -13
- streamlit/web/server/browser_websocket_handler.py +15 -0
- streamlit/web/server/oauth_authlib_routes.py +3 -59
- {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/METADATA +4 -2
- {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/RECORD +157 -160
- streamlit/static/static/css/index.CQt5TjGB.css +0 -1
- streamlit/static/static/js/FileHelper.B2t9ikoS.js +0 -5
- streamlit/static/static/js/FormClearHelper.BLEIUk6L.js +0 -1
- streamlit/static/static/js/InputInstructions.DtUxCBS8.js +0 -1
- streamlit/static/static/js/Particles.BDRPO7r3.js +0 -1
- streamlit/static/static/js/ProgressBar.B64DUUqp.js +0 -2
- streamlit/static/static/js/Toolbar.B3FquPk5.js +0 -1
- streamlit/static/static/js/createSuper.DqQ5L3XG.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.DbNsQa8Y.js +0 -1
- streamlit/static/static/js/es6.CbPK4m0H.js +0 -2
- streamlit/static/static/js/iframeResizer.contentWindow.CfLKrptA.js +0 -1
- streamlit/static/static/js/index.0XDwe9RV.js +0 -203
- streamlit/static/static/js/index.4lI9TuZm.js +0 -3
- streamlit/static/static/js/index.6s0nVIis.js +0 -3855
- streamlit/static/static/js/index.9E7bRUBU.js +0 -1
- streamlit/static/static/js/index.B9PgeLrZ.js +0 -1
- streamlit/static/static/js/index.B9vzGbOt.js +0 -1
- streamlit/static/static/js/index.BDrQKMCm.js +0 -1
- streamlit/static/static/js/index.BPsoiGgP.js +0 -1
- streamlit/static/static/js/index.CJzdLAun.js +0 -1
- streamlit/static/static/js/index.CNNlC1NL.js +0 -1
- streamlit/static/static/js/index.CO1sClzJ.js +0 -2
- streamlit/static/static/js/index.CZnagxXD.js +0 -1
- streamlit/static/static/js/index.Cb0xSF7V.js +0 -5366
- streamlit/static/static/js/index.CgUt3tz_.js +0 -1
- streamlit/static/static/js/index.CjImmcsV.js +0 -1
- streamlit/static/static/js/index.CrJ1XD_V.js +0 -1
- streamlit/static/static/js/index.CtiKsjSC.js +0 -1
- streamlit/static/static/js/index.CwAuytgV.js +0 -1
- streamlit/static/static/js/index.D7GB-kly.js +0 -1
- streamlit/static/static/js/index.DA5wU0mQ.js +0 -1
- streamlit/static/static/js/index.DE9wNOje.js +0 -1
- streamlit/static/static/js/index.DHnB-C8A.js +0 -1
- streamlit/static/static/js/index.DRTn9zvD.js +0 -1
- streamlit/static/static/js/index.DjMjyJl9.js +0 -7
- streamlit/static/static/js/index.DvRPFfw6.js +0 -781
- streamlit/static/static/js/index.F9tSej94.js +0 -1
- streamlit/static/static/js/index.J2D_m7LY.js +0 -197
- streamlit/static/static/js/index.dfivzJNz.js +0 -1
- streamlit/static/static/js/index.mRztGO69.js +0 -3
- streamlit/static/static/js/index.tB1kn_7z.js +0 -1
- streamlit/static/static/js/mergeWith.C1kp1zIi.js +0 -1
- streamlit/static/static/js/number-overlay-editor.WpheGpmR.js +0 -9
- streamlit/static/static/js/threshold.DjX0wlsa.js +0 -1
- streamlit/static/static/js/timer.CAwTRJ_g.js +0 -1
- streamlit/static/static/js/uniqueId.Bm8FHN92.js +0 -1
- streamlit/static/static/js/useTextInputAutoExpand.Bf2egQOG.js +0 -2
- streamlit/static/static/js/useUpdateUiValue.lE5xnYWF.js +0 -1
- streamlit/static/static/js/value.CgPGBV_l.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.CCOXR7N6.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DsbC8sYI.woff2 +0 -0
- {streamlit-1.48.0.data → streamlit-1.49.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/WHEEL +0 -0
- {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as T,r as i,u as b,bl as L,j as p,l as N}from"./index.DvRPFfw6.js";const U=T("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:g,url:l,startTime:a,subtitles:d,endTime:o,loop:u,autoplay:m,muted:E}=r;let v=b(l);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),y=i.useMemo(()=>JSON.stringify(d?d.map(e=>s.buildMediaURL(`${e.url}`)):[]),[d,s]);i.useEffect(()=>{const e=JSON.parse(y);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[y,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const c=()=>{o>0&&e.currentTime>=o&&(u?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",c),()=>{e&&o>0&&e.removeEventListener("timeupdate",c)}},[o,u,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),u){t.searchParams.append("loop","1");const c=t.pathname.split("/").pop();c&&t.searchParams.append("playlist",c)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(g===L.Type.YOUTUBE_IFRAME)return p(U,{className:"stVideo","data-testid":"stVideo",title:l,src:V(l),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;R.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(l),style:A,crossOrigin:v,onError:h,children:d&&d.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const w=i.memo(O);export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as i,k as m,r as c,j as n,a as p}from"./index.DvRPFfw6.js";import{P as f,R as d}from"./Particles.BDRPO7r3.js";const g=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,B=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,L=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,h=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,u=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,x=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,e=121,s=20,A=80,_=1e3,I=m("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),M=i("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-e/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(A-s)+s}vw`,animationDelay:`${Math.random()*_}ms`,height:`${t}px`,width:`${e}px`,pointerEvents:"none",animationDuration:"750ms",animationName:I,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),b=30,l=[g,B,L,h,u,x],w=l.length,E=({particleType:o,resourceCrossOriginMode:r})=>{const a=l[o];return n(M,{src:a,crossOrigin:p(r,a)})},N=({scriptRunId:o})=>n(d,{children:n(f,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:w,numParticles:b,ParticleComponent:E})}),P=c.memo(N);export{b as NUM_BALLOONS,P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as m,r as C,aK as E,aE as h,j as a,u as L,aJ as S,l as y}from"./index.DvRPFfw6.js";import{w as W,E as b}from"./withFullScreenWrapper.CCOXR7N6.js";import{S as u,T as v}from"./Toolbar.B3FquPk5.js";const T=m("div",{target:"evl31sl0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"})),F=m("div",{target:"evl31sl1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}})),j=m("div",{target:"evl31sl2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),M=y.getLogger("ImageList"),R=({itemKey:e,image:t,imgStyle:n,buildMediaURL:i,handleImageError:c})=>{const s=L(t.url);return h(F,{"data-testid":"stImageContainer",children:[a("img",{style:n,src:i(t.url),alt:e,onError:c,crossOrigin:s}),t.caption&&a(j,{"data-testid":"stImageCaption",style:n,children:a(S,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function G({element:e,endpoints:t,disableFullscreenMode:n}){const{expanded:i,width:c,height:s,expand:x,collapse:f}=E(b),p=c||0;let d;const o=e.width;if([-1,-3,-4].includes(o))d=void 0;else if([-2,-5].includes(o))d=p;else if(o>0)d=o;else throw Error(`Invalid image width: ${o}`);const r={};s&&i?(r.maxHeight=s,r.objectFit="contain",r.width="100%"):(r.width=d??"100%",r.maxWidth="100%");const w=g=>{const l=g.currentTarget.src;M.error(`Client Error: Image source error - ${l}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",l)};return h(u,{width:p,height:s,useContainerWidth:i,topCentered:!0,children:[a(v,{target:u,isFullScreen:i,onExpand:x,onCollapse:f,disableFullscreenMode:n}),a(T,{className:"stImage","data-testid":"stImage",children:e.imgs.map((g,l)=>a(R,{itemKey:l.toString(),image:g,imgStyle:r,buildMediaURL:I=>t.buildMediaURL(I),handleImageError:w},l))})]})}const H=W(G),k=C.memo(H);export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,E as M,_ as J,s as k,cI as y,D as m,H as Q,l as ft,ap as bt,aT as mt,cy as ht,aq as q,aE as F,j as c,bu as gt,bL as It,bv as yt,bc as Tt,bw as wt,aF as Ct,bq as G}from"./index.DvRPFfw6.js";import{u as St}from"./uniqueId.Bm8FHN92.js";import{I as vt}from"./InputInstructions.DtUxCBS8.js";import{u as Vt}from"./FormClearHelper.BLEIUk6L.js";import{s as xt}from"./sprintf.D7DtBTRn.js";import{I as kt}from"./input.BL2buuce.js";import"./base-input.DeBqm5mN.js";var Y=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,J({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Y.displayName="Minus";var Z=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,J({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Z.displayName="Plus";const Dt=k("div",{target:"eaba2yi0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Et=k("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),X=k("button",{target:"eaba2yi2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Rt=k("div",{target:"eaba2yi3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Nt=ft.getLogger("NumberInput");function Ft(t){return m(t)||t===""?void 0:t}const z=({value:t,format:e,step:a,dataType:b})=>{if(m(t))return null;let o=Ft(e);if(m(o)&&Q(a)){const p=a.toString();b===y.DataType.FLOAT&&a!==0&&p.includes(".")&&(o=`%0.${p.split(".")[1].length}f`)}if(m(o))return t.toString();try{return xt.sprintf(o,t)}catch(p){return Nt.warn(`Error in sprintf(${o}, ${t}): ${p}`),String(t)}},zt=(t,e,a)=>m(t)?!1:t-e>=a,Wt=(t,e,a)=>m(t)?!1:t+e<=a,Lt=t=>(t.element.dataType===y.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,K=({step:t,dataType:e})=>t||(e===y.DataType.INT?1:.01),Bt=({disabled:t,element:e,widgetMgr:a,fragmentId:b})=>{const o=bt(),{dataType:p,id:C,formId:f,default:W,format:L,icon:D,min:h,max:g}=e,[B,tt]=mt(),[s,et]=r.useState(()=>K(e)),H=Lt({element:e,widgetMgr:a}),[I,T]=r.useState(!1),[l,w]=r.useState(H),[P,S]=r.useState(()=>z({value:H,...e,step:s})),[U,A]=r.useState(!1),v=r.useRef(null),$=r.useRef(St("number_input_")),V=zt(l,s,h),x=Wt(l,s,g),O=ht({formId:f}),ot=O?a.allowFormEnterToSubmit(f):I,rt=U&&B>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{et(K({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=r.useCallback(({value:n,source:i})=>{if(Q(n)&&(h>n||n>g))v.current?.reportValidity();else{const d=n??W??null;switch(p){case y.DataType.INT:a.setIntValue({id:C,formId:f},d,i,b);break;case y.DataType.FLOAT:a.setDoubleValue({id:C,formId:f},d,i,b);break;default:throw new Error("Invalid data type")}T(!1),w(d),S(z({value:d,dataType:p,format:L,step:s}))}},[h,g,v,a,b,s,p,C,f,W,L]),nt=r.useCallback(()=>{I&&u({value:l,source:{fromUi:!0}}),A(!1)},[I,l,u]),at=r.useCallback(()=>{A(!0)},[]),j=r.useCallback(()=>{const{value:n}=e;e.setValue=!1,w(n??null),S(z({value:n??null,...e,step:s})),u({value:n??null,source:{fromUi:!1}})},[e,s,u]);r.useEffect(()=>{e.setValue?j():u({value:l,source:{fromUi:!1}});const n=v.current;if(n){const i=d=>{d.preventDefault()};return n.addEventListener("wheel",i),()=>{n.removeEventListener("wheel",i)}}},[]),e.setValue&&j();const E=m(e.default)&&!t,st=r.useCallback(()=>{const n=e.default??null;w(n),u({value:n,source:{fromUi:!0}})},[e]);Vt({element:e,widgetMgr:a,onFormCleared:st});const it=n=>{const{value:i}=n.target;if(i==="")T(!0),w(null),S(null);else{let d;e.dataType===y.DataType.INT?d=parseInt(i,10):d=parseFloat(i),T(!0),w(d),S(i)}},R=r.useCallback(()=>{x&&(T(!0),u({value:(l??h)+s,source:{fromUi:!0}}))},[l,h,s,x]),N=r.useCallback(()=>{V&&(T(!0),u({value:(l??g)-s,source:{fromUi:!0}}))},[l,g,s,V]),lt=r.useCallback(n=>{const{key:i}=n;switch(i){case"ArrowUp":n.preventDefault(),R();break;case"ArrowDown":n.preventDefault(),N();break}},[R,N]),ct=r.useCallback(n=>{n.key==="Enter"&&(I&&u({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,b))},[I,l,u,a,f,b]),_=D?.startsWith(":material"),ut=_?"lg":"base",dt=q(o.iconSizes.lg)+2*q(o.spacing.twoXS),pt=D?o.breakpoints.hideNumberInputControls+dt:o.breakpoints.hideNumberInputControls;return F("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:tt,children:[c(wt,{label:e.label,disabled:t,labelVisibility:gt(e.labelVisibility?.value),htmlFor:$.current,children:e.help&&c(It,{children:c(yt,{content:e.help,placement:Tt.TOP_RIGHT})})}),F(Dt,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[c(kt,{type:"number",inputRef:v,value:P??"",placeholder:e.placeholder,onBlur:nt,onFocus:at,onChange:it,onKeyPress:ct,onKeyDown:lt,clearable:E,clearOnEscape:E,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&c(Ct,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:ut}),id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.darkGray,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:h,max:g,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:D?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:_?o.colors.fadedText60:"inherit"}}}}),B>pt&&F(Et,{children:[c(X,{"data-testid":"stNumberInputStepDown",onClick:N,disabled:!V||t,tabIndex:-1,children:c(G,{content:Y,size:"xs",color:V?"inherit":o.colors.disabled})}),c(X,{"data-testid":"stNumberInputStepUp",onClick:R,disabled:!x||t,tabIndex:-1,children:c(G,{content:Z,size:"xs",color:x?"inherit":o.colors.disabled})})]})]}),rt&&c(Rt,{clearable:E,children:c(vt,{dirty:I,value:P??"",inForm:O,allowEnterToSubmit:ot})})]})},_t=r.memo(Bt);export{_t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,L as h,b8 as i,j as e,b9 as k,br as g,b7 as R,ba as C}from"./index.DvRPFfw6.js";import{c as L}from"./createDownloadLinkElement.ZaXNnPK4.js";function x(d){const{disabled:c,element:l,widgetMgr:u,endpoints:t,fragmentId:f}=d,{help:m,label:B,icon:b,ignoreRerun:w,type:s,url:r}=l,{libConfig:{enforceDownloadInNewTab:D=!1}}=o.useContext(h);let n=i.SECONDARY;s==="primary"?n=i.PRIMARY:s==="tertiary"&&(n=i.TERTIARY);const a=o.useMemo(()=>t.buildDownloadUrl(r),[t,r]);o.useEffect(()=>{t.checkSourceUrlResponse(a,"Download Button")},[a,t]);const p=()=>{w||u.setTriggerValue(l,{fromUi:!0},f),L({filename:"",url:a,enforceDownloadInNewTab:D}).click()};return e("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:e(k,{help:m,containerWidth:!0,children:e(g,{kind:n,size:R.SMALL,disabled:c,onClick:p,containerWidth:!0,children:e(C,{icon:b,label:B})})})})}const A=o.memo(x);export{A as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as c,r as a,j as o,aE as p,cc as f,bp as S,aJ as g}from"./index.DvRPFfw6.js";const x=c("div",{target:"e8cs83k0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e8cs83k1"})({display:"flex",alignItems:"center",width:"100%"}),$=c("div",{target:"e8cs83k2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("div",{target:"e8cs83k3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function b({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),r=a.useRef(null);return a.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const u=(Date.now()-r.current)/1e3;l(u)}};i();const d=setInterval(i,100);return()=>clearInterval(d)},[t]),o(x,{className:f({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:p(T,{children:[o(S,{size:"base",margin:"0 md 0 0",padding:"0"}),p($,{children:[o(g,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(b);export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as W,r,ap as C,c6 as I,c7 as V,c8 as H,c9 as L,aE as O,j as n,bu as $,bL as P,bv as E,bc as k,bw as B,c5 as F,ca as N,c1 as A,cb as D,bH as U}from"./index.DvRPFfw6.js";import{a as j}from"./useBasicWidgetState.CUSYQZpm.js";import"./FormClearHelper.BLEIUk6L.js";const G=W("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),K=(s,t)=>s.getStringArrayValue(t),Y=s=>s.default.map(t=>s.options[t])??null,_=s=>s.rawValues??null,X=(s,t,a,c)=>{t.setStringArrayValue(s,a.value,{fromUi:a.fromUi},c)},q=s=>{const{element:t,widgetMgr:a,fragmentId:c}=s,e=C(),h=r.useContext(I),[i,p]=j({getStateFromWidgetMgr:K,getDefaultStateFromProto:Y,getCurrStateFromProto:_,updateWidgetMgrState:X,element:t,widgetMgr:a,fragmentId:c}),g=t.maxSelections>0&&i.length>=t.maxSelections,b=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(i.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,i.length]),S=r.useMemo(()=>i.map(o=>({value:o,label:o})),[i]),m=r.useCallback(o=>{switch(o.type){case"remove":return V(i,o.option?.value);case"clear":return[];case"select":return i.concat([o.option?.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[i]),f=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&i.length>=t.maxSelections||p({value:m(o),fromUi:!0})},[t.maxSelections,m,p,i.length]),y=r.useCallback((o,l)=>{if(g)return[];const R=o.filter(T=>!i.includes(T.value));return H(R,l)},[g,i]),{options:d}=t,{placeholder:x,shouldDisable:v}=L(t.placeholder,d,t.acceptNewOptions??!1,!0),u=s.disabled||v,z=d.map((o,l)=>({label:o,value:o,id:`${o}_${l}`})),w=d.length>10,M=r.useMemo(()=>{const o=e.fontSizes.baseFontSize*1.6+14;return`${Math.round(o*4.25)}px`},[e.fontSizes.baseFontSize]);return O("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n(B,{label:t.label,disabled:u,labelVisibility:$(t.labelVisibility?.value),children:t.help&&n(P,{children:n(E,{content:t.help,placement:k.TOP_RIGHT})})}),n(G,{children:n(F,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:x,type:D.select,multi:!0,onChange:f,value:S,disabled:u,size:"compact",noResultsMsg:b,filterOptions:y,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{ignoreBoundary:h,overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:A,props:{style:{cursor:"pointer"},overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{maxHeight:M,minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:u?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({overflowY:"auto",paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{fontWeight:e.fontWeights.normal,borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:U()&&w===!1?"readonly":null}},Dropdown:{component:N}}})})]})},ee=r.memo(q);export{ee as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as We,by as J,r as x,c2 as ht,bR as gt,bz as G,c3 as pt,c4 as vt,s as Ke,ax as mt,bJ as bt,ap as yt,aS as Tt,cv as Ot,j as ae,aE as kt,bu as wt,bL as Rt,bv as St,bc as Mt,bw as _t,J as $t,cw as _e}from"./index.DvRPFfw6.js";import{s as Fe}from"./sprintf.D7DtBTRn.js";import{a as Et}from"./useBasicWidgetState.CUSYQZpm.js";import"./FormClearHelper.BLEIUk6L.js";var se={},U={},ue={},ce={},je;function $e(){if(je)return ce;je=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"}(e||(ce.Direction=e={})),ce}var Ve;function Xe(){return Ve||(Ve=1,function(e){var r=ue&&ue.__spreadArray||function(i,s,c){if(c||arguments.length===2)for(var m=0,R=s.length,p;m<R;m++)(p||!(m in s))&&(p||(p=Array.prototype.slice.call(s,0,m)),p[m]=s[m]);return i.concat(p||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=We(),o=$e(),g=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=g;function _(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=_;function u(i,s,c){var m=(s-i)/c,R=8,p=Number(m.toFixed(R));return parseInt(p.toString(),10)===p}e.isStepDivisible=u;function h(i,s,c,m,R,p,O){var $=1e11;if(i=Math.round(i*$)/$,!p){var D=O[s-1],I=O[s+1];if(D&&D>i)return D;if(I&&I<i)return I}if(i>m)return m;if(i<c)return c;var N=Math.floor(i*$-c*$)%Math.floor(R*$),V=Math.floor(i*$-Math.abs(N)),q=N===0?i:V/$,P=Math.abs(N/$)<R/2?q:q+R,B=(0,e.getStepDecimals)(R);return parseFloat(P.toFixed(B))}e.normalizeValue=h;function j(i,s,c){return(i-s)/(c-s)}e.relativeValue=j;function F(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=F;function A(i,s,c){if(s>=c)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(c,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>c)throw new RangeError("value (".concat(i,") is bigger than max (").concat(c,")"))}e.checkBoundaries=A;function S(i,s,c){return i<s?s:i>c?c:i}e.checkValuesAgainstBoundaries=S;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(s,c){return i[c]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,c){var m=c?-1:1;i.forEach(function(R,p){return v(R,m*s[p].x,s[p].y)})}e.translateThumbs=a;function l(i,s,c,m){for(var R=0,p=L(i[0],s,c,m),O=1;O<i.length;O++){var $=L(i[O],s,c,m);$<p&&(p=$,R=O)}return R}e.getClosestThumbIndex=l;function v(i,s,c){i.style.transform="translate(".concat(s,"px, ").concat(c,"px)")}e.translate=v;var f=function(i){var s=[],c=null,m=function(){for(var R=[],p=0;p<arguments.length;p++)R[p]=arguments[p];s=R,!c&&(c=requestAnimationFrame(function(){c=null,i.apply(void 0,s)}))};return m};e.schd=f;function b(i,s,c){var m=i.slice(0);return m[s]=c,m}e.replaceAt=b;function E(i){var s=i.values,c=i.colors,m=i.min,R=i.max,p=i.direction,O=p===void 0?o.Direction.Right:p,$=i.rtl,D=$===void 0?!1:$;D&&O===o.Direction.Right?O=o.Direction.Left:D&&o.Direction.Left&&(O=o.Direction.Right);var I=s.slice(0).sort(function(V,q){return V-q}).map(function(V){return(V-m)/(R-m)*100}),N=I.reduce(function(V,q,P){return"".concat(V,", ").concat(c[P]," ").concat(q,"%, ").concat(c[P+1]," ").concat(q,"%")},"");return"linear-gradient(".concat(O,", ").concat(c[0]," 0%").concat(N,", ").concat(c[c.length-1]," 100%)")}e.getTrackBackground=E;function k(){}e.voidFn=k;function T(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=T;var w=function(i,s,c,m,R){R===void 0&&(R=function(O){return O});var p=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(O,$){var D=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(c)&&$.childElementCount===0){var I=$.cloneNode(!0);I.innerHTML=R(s.toFixed(m)),I.style.visibility="hidden",document.body.appendChild(I),D=Math.ceil(I.getBoundingClientRect().width),document.body.removeChild(I)}return D>O?D:O},i.getBoundingClientRect().width));return p},C=function(i,s,c,m,R,p,O){O===void 0&&(O=function(I){return I});var $=[],D=function(I){var N=w(c[I],m[I],R,p,O),V=s[I].x;s.forEach(function(q,P){var B=q.x,Z=w(c[P],m[P],R,p,O);I!==P&&(V>=B&&V<=B+Z||V+N>=B&&V+N<=B+Z)&&($.includes(P)||($.push(I),$.push(P),$=r(r([],$,!0),[I,P],!1),D(P)))})};return D(i),Array.from(new Set($.sort()))},M=function(i,s,c,m,R,p){m===void 0&&(m=.1),R===void 0&&(R=" - "),p===void 0&&(p=function(P){return P});var O=(0,e.getStepDecimals)(m),$=(0,n.useState)({}),D=$[0],I=$[1],N=(0,n.useState)(p(s[c].toFixed(O))),V=N[0],q=N[1];return(0,n.useEffect)(function(){if(i){var P=i.getThumbs();if(P.length<1)return;var B={},Z=i.getOffsets(),re=C(c,Z,P,s,R,O,p),le=p(s[c].toFixed(O));if(re.length){var Q=re.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[Z[pe[ge]].x],!1):[Z[pe[ge]].x]},[]);if(Math.min.apply(Math,Q)===Z[c].x){var de=[];re.forEach(function(ee){de.push(s[ee].toFixed(O))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(p).join(R);var fe=Math.min.apply(Math,Q),he=Math.max.apply(Math,Q),Me=P[re[Q.indexOf(he)]].getBoundingClientRect().width;B.left="".concat(Math.abs(fe-(he+Me))/2,"px"),B.transform="translate(-50%, 0)"}else B.visibility="hidden"}q(le),I(B)}},[i,s]),[V,D]};e.useThumbOverlap=M;function L(i,s,c,m){var R=i.getBoundingClientRect(),p=R.left,O=R.top,$=R.width,D=R.height;return F(m)?Math.abs(c-(O+D/2)):Math.abs(s-(p+$/2))}var H=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=H}(ue)),ue}var ze;function It(){if(ze)return U;ze=1;var e=U&&U.__extends||function(){var S=function(y,d){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(t[l]=a[l])},S(y,d)};return function(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");S(y,d);function t(){this.constructor=y}y.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=U&&U.__createBinding||(Object.create?function(S,y,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(y,d);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[d]}}),Object.defineProperty(S,t,a)}:function(S,y,d,t){t===void 0&&(t=d),S[t]=y[d]}),n=U&&U.__setModuleDefault||(Object.create?function(S,y){Object.defineProperty(S,"default",{enumerable:!0,value:y})}:function(S,y){S.default=y}),o=U&&U.__importStar||function(S){if(S&&S.__esModule)return S;var y={};if(S!=null)for(var d in S)d!=="default"&&Object.prototype.hasOwnProperty.call(S,d)&&r(y,S,d);return n(y,S),y},g=U&&U.__spreadArray||function(S,y,d){if(d||arguments.length===2)for(var t=0,a=y.length,l;t<a;t++)(l||!(t in y))&&(l||(l=Array.prototype.slice.call(y,0,t)),l[t]=y[t]);return S.concat(l||Array.prototype.slice.call(y))};Object.defineProperty(U,"__esModule",{value:!0});var _=o(We()),u=Xe(),h=$e(),j=["ArrowRight","ArrowUp","k","PageUp"],F=["ArrowLeft","ArrowDown","j","PageDown"],A=function(S){e(y,S);function y(d){var t=S.call(this,d)||this;if(t.trackRef=_.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,l){return l}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,l=a.direction,v=a.values,f=a.min,b=a.max,E=t.trackRef.current;if(!E)return console.warn("No track element found."),[];var k=E.getBoundingClientRect(),T=(0,u.getPaddingAndBorder)(E);return t.getThumbs().map(function(w,C){var M={x:0,y:0},L=w.getBoundingClientRect(),H=(0,u.getMargin)(w);switch(l){case h.Direction.Right:return M.x=(H.left+T.left)*-1,M.y=((L.height-k.height)/2+T.top)*-1,M.x+=k.width*(0,u.relativeValue)(v[C],f,b)-L.width/2,M;case h.Direction.Left:return M.x=(H.right+T.right)*-1,M.y=((L.height-k.height)/2+T.top)*-1,M.x+=k.width-k.width*(0,u.relativeValue)(v[C],f,b)-L.width/2,M;case h.Direction.Up:return M.x=((L.width-k.width)/2+H.left+T.left)*-1,M.y=-T.left,M.y+=k.height-k.height*(0,u.relativeValue)(v[C],f,b)-L.height/2,M;case h.Direction.Down:return M.x=((L.width-k.width)/2+H.left+T.left)*-1,M.y=-T.left,M.y+=k.height*(0,u.relativeValue)(v[C],f,b)-L.height/2,M;default:return(0,u.assertUnreachable)(l)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(l){return l===a.target||l.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var l;if(!(a.button!==0||(0,u.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(f){var b;return(b=f.current)===null||b===void 0?void 0:b.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var v=(0,u.getClosestThumbIndex)(t.thumbRefs.map(function(f){return f.current}),a.clientX,a.clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,u.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var l;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(f){var b;return(b=f.current)===null||b===void 0?void 0:b.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var v=(0,u.getClosestThumbIndex)(t.thumbRefs.map(function(f){return f.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var l=(0,u.isTouchEvent)(a);if(!(!l&&a.button!==0)){var v=t.getTargetIndex(a);v!==-1&&(l?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:v,thumbZIndexes:t.state.thumbZIndexes.map(function(f,b){return b===v?Math.max.apply(Math,t.state.thumbZIndexes):f<=t.state.thumbZIndexes[v]?f:f-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var l=t.props,v=l.values,f=l.onChange,b=l.step,E=l.rtl,k=l.direction,T=t.state.isChanged,w=t.getTargetIndex(a.nativeEvent),C=E||k===h.Direction.Left||k===h.Direction.Down?-1:1;w!==-1&&(j.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:w,isChanged:!0}),f((0,u.replaceAt)(v,w,t.normalizeValue(v[w]+C*(a.key==="PageUp"?b*10:b),w)))):F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:w,isChanged:!0}),f((0,u.replaceAt)(v,w,t.normalizeValue(v[w]-C*(a.key==="PageDown"?b*10:b),w)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){T&&t.fireOnFinalChange()}):T&&t.fireOnFinalChange())},t.onKeyUp=function(a){var l=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){l&&t.fireOnFinalChange()})},t.onMove=function(a,l){var v=t.state,f=v.draggedThumbIndex,b=v.draggedTrackPos,E=t.props,k=E.direction,T=E.min,w=E.max,C=E.onChange,M=E.values,L=E.step,H=E.rtl;if(f===-1&&b[0]===-1&&b[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),c=(0,u.isVertical)(k)?s.height:s.width;if(b[0]!==-1&&b[1]!==-1){var m=a-b[0],R=l-b[1],p=0;switch(k){case h.Direction.Right:case h.Direction.Left:p=m/c*(w-T);break;case h.Direction.Down:case h.Direction.Up:p=R/c*(w-T);break;default:(0,u.assertUnreachable)(k)}if(H&&(p*=-1),Math.abs(p)>=L/2){for(var O=0;O<t.thumbRefs.length;O++){if(M[O]===w&&Math.sign(p)===1||M[O]===T&&Math.sign(p)===-1)return;var $=M[O]+p;$>w?p=w-M[O]:$<T&&(p=T-M[O])}for(var D=M.slice(0),O=0;O<t.thumbRefs.length;O++)D=(0,u.replaceAt)(D,O,t.normalizeValue(M[O]+p,O));t.setState({draggedTrackPos:[a,l]}),C(D)}}else{var I=0;switch(k){case h.Direction.Right:I=(a-s.left)/c*(w-T)+T;break;case h.Direction.Left:I=(c-(a-s.left))/c*(w-T)+T;break;case h.Direction.Down:I=(l-s.top)/c*(w-T)+T;break;case h.Direction.Up:I=(c-(l-s.top))/c*(w-T)+T;break;default:(0,u.assertUnreachable)(k)}H&&(I=w+T-I),Math.abs(M[f]-I)>=L/2&&C((0,u.replaceAt)(M,f,t.normalizeValue(I,f)))}},t.normalizeValue=function(a,l){var v=t.props,f=v.min,b=v.max,E=v.step,k=v.allowOverlap,T=v.values;return(0,u.normalizeValue)(a,l,f,b,E,k,T)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,l=a.onFinalChange,v=a.values;l&&l(v)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var l=0;l<t.numOfMarks+1;l++)t.markRefs[l]=_.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),l=parseInt(a.width,10),v=parseInt(a.height,10),f=parseInt(a.paddingLeft,10),b=parseInt(a.paddingTop,10),E=[],k=0;k<t.numOfMarks+1;k++){var T=9999,w=9999;if(t.markRefs[k].current){var C=t.markRefs[k].current.getBoundingClientRect();T=C.height,w=C.width}t.props.direction===h.Direction.Left||t.props.direction===h.Direction.Right?E.push([Math.round(l/t.numOfMarks*k+f-w/2),-Math.round((T-v)/2)]):E.push([Math.round(v/t.numOfMarks*k+b-T/2),-Math.round((w-l)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,u.schd)(t.onMouseMove),t.schdOnTouchMove=(0,u.schd)(t.onTouchMove),t.schdOnEnd=(0,u.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return _.createRef()}),t.updateMarkRefs(d),t}return y.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,l=t.min,v=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,u.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(f){return(0,u.checkBoundaries)(f,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(f){(0,u.isStepDivisible)(l,f,v)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(d,t){var a=this.props,l=a.max,v=a.min,f=a.step,b=a.values,E=a.rtl;(d.max!==l||d.min!==v||d.step!==f)&&this.updateMarkRefs(this.props),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==l||d.min!==v||d.step!==f||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),b.forEach(function(k){(0,u.isStepDivisible)(v,k,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var d=this,t=this.props,a=t.label,l=t.labelledBy,v=t.renderTrack,f=t.renderThumb,b=t.renderMark,E=b===void 0?function(){return null}:b,k=t.values,T=t.min,w=t.max,C=t.allowOverlap,M=t.disabled,L=this.state,H=L.draggedThumbIndex,i=L.thumbZIndexes,s=L.markOffsets;return v({props:{style:{transform:"scale(1)",cursor:H>-1?"grabbing":this.props.draggableTrack?(0,u.isVertical)(this.props.direction)?"ns-resize":"ew-resize":k.length===1&&!M?"pointer":"inherit"},onMouseDown:M?u.voidFn:this.onMouseDownTrack,onTouchStart:M?u.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:M,children:g(g([],s.map(function(c,m,R){return E({props:{style:d.props.direction===h.Direction.Left||d.props.direction===h.Direction.Right?{position:"absolute",left:"".concat(c[0],"px"),marginTop:"".concat(c[1],"px")}:{position:"absolute",top:"".concat(c[0],"px"),marginLeft:"".concat(c[1],"px")},key:"mark".concat(m),ref:d.markRefs[m]},index:m})}),!0),k.map(function(c,m){var R=d.state.draggedThumbIndex===m;return f({index:m,value:c,isDragged:R,props:{style:{position:"absolute",zIndex:i[m],cursor:M?"inherit":R?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:m,tabIndex:M?void 0:0,"aria-valuemax":C?w:k[m+1]||w,"aria-valuemin":C?T:k[m-1]||T,"aria-valuenow":c,draggable:!1,ref:d.thumbRefs[m],"aria-label":a,"aria-labelledby":l,role:"slider",onKeyDown:M?u.voidFn:d.onKeyDown,onKeyUp:M?u.voidFn:d.onKeyUp}})}),!0)})},y.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:h.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(_.Component);return U.default=A,U}var Ne;function xt(){return Ne||(Ne=1,function(e){var r=se&&se.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(It());e.Range=n.default;var o=Xe();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var g=$e();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return g.Direction}})}(se)),se}var Ye=xt();function Ue(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ue(Object(n),!0).forEach(function(o){Ct(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ct(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var me=J("div",{position:"relative",width:"100%"});me.displayName="Root";me.displayName="Root";me.displayName="StyledRoot";var be=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,g=e.$disabled,_=e.$isDragged,u=r.sizing,h="inherit";return g?h="not-allowed":_?h="grabbing":o.length===1&&(h="pointer"),{paddingTop:u.scale600,paddingBottom:u.scale600,paddingRight:u.scale600,paddingLeft:u.scale600,display:"flex",cursor:h,backgroundColor:r.colors.sliderTrackFill}});be.displayName="Track";be.displayName="Track";be.displayName="StyledTrack";var ye=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,g=e.$min,_=e.$max,u=e.$disabled,h=r.colors,j=r.borders,F=r.direction,A=r.borders.useRoundedCorners?j.radius100:0;return{borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,background:Ye.getTrackBackground({values:o,colors:o.length===1?[u?h.borderOpaque:h.primary,u?h.backgroundSecondary:h.borderOpaque]:[u?h.backgroundSecondary:h.borderOpaque,u?h.borderOpaque:h.primary,u?h.backgroundSecondary:h.borderOpaque],min:g||0,max:_||0,rtl:F==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:u?"not-allowed":"inherit"}});ye.displayName="InnerTrack";ye.displayName="InnerTrack";ye.displayName="StyledInnerTrack";var Te=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});Te.displayName="Mark";Te.displayName="Mark";Te.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var ke=J("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});ke.displayName="TickBar";ke.displayName="TickBar";ke.displayName="StyledTickBar";var we=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,g=e.$thumbIndex,_=e.$disabled,u=o.length===2&&g===0,h=o.length===2&&g===1;return r.direction==="rtl"&&(h||u)&&(u=!u,h=!h),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:_?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:_?"not-allowed":"inherit"}});we.displayName="Thumb";we.displayName="Thumb";we.displayName="StyledThumb";var Re=J("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});Re.displayName="InnerThumb";Re.displayName="InnerThumb";Re.displayName="StyledInnerThumb";var Se=J("div",function(e){var r=e.$disabled,n=e.$theme;return ve(ve({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Se.displayName="ThumbValue";Se.displayName="ThumbValue";Se.displayName="StyledThumbValue";function He(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),n.push.apply(n,o)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?He(Object(n),!0).forEach(function(o){Pt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Pt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return Ft(e)||Lt(e,r)||At(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,r){if(e){if(typeof e=="string")return qe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qe(e,r)}}function qe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Lt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],g=!0,_=!1,u,h;try{for(n=n.call(e);!(g=(u=n.next()).done)&&(o.push(u.value),!(r&&o.length===r));g=!0);}catch(j){_=!0,h=j}finally{try{!g&&n.return!=null&&n.return()}finally{if(_)throw h}}return o}}function Ft(e){if(Array.isArray(e))return e}var jt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function Vt(e){var r=e.overrides,n=r===void 0?{}:r,o=e.disabled,g=o===void 0?!1:o,_=e.marks,u=_===void 0?!1:_,h=e.onChange,j=h===void 0?function(){}:h,F=e.onFinalChange,A=F===void 0?function(){}:F,S=e.min,y=S===void 0?0:S,d=e.max,t=d===void 0?100:d,a=e.step,l=a===void 0?1:a,v=e.persistentThumb,f=v===void 0?!1:v,b=e.valueToLabel,E=b===void 0?function(Y){return Y}:b,k=e.value,T=x.useContext(ht),w=x.useState(!1),C=K(w,2),M=C[0],L=C[1],H=x.useState(!1),i=K(H,2),s=i[0],c=i[1],m=x.useState(!1),R=K(m,2),p=R[0],O=R[1],$=x.useState(-1),D=K($,2),I=D[0],N=D[1],V=x.useCallback(function(Y){gt(Y)&&O(!0);var z=Y.target.parentNode.firstChild===Y.target?0:1;N(z)},[]),q=x.useCallback(function(Y){p!==!1&&O(!1),N(-1)},[]),P=jt(k),B={$disabled:g,$step:l,$min:y,$max:t,$marks:u,$value:P,$isFocusVisible:p},Z=G(n.Root,me),re=K(Z,2),le=re[0],Q=re[1],de=G(n.Track,be),fe=K(de,2),he=fe[0],Me=fe[1],ee=G(n.InnerTrack,ye),oe=K(ee,2),ge=oe[0],pe=oe[1],Ze=G(n.Thumb,we),Ee=K(Ze,2),Ge=Ee[0],Je=Ee[1],Qe=G(n.InnerThumb,Re),Ie=K(Qe,2),et=Ie[0],tt=Ie[1],rt=G(n.ThumbValue,Se),xe=K(rt,2),nt=xe[0],at=xe[1],it=G(n.Tick,Oe),Ce=K(it,2),De=Ce[0],Pe=Ce[1],ot=G(n.TickBar,ke),Be=K(ot,2),st=Be[0],ut=Be[1],ct=G(n.Mark,Te),Ae=K(ct,2),lt=Ae[0],dt=Ae[1];return x.createElement(le,X({"data-baseweb":"slider"},B,Q,{onFocus:vt(Q,V),onBlur:pt(Q,q)}),x.createElement(Ye.Range,X({step:l,min:y,max:t,values:P,disabled:g,onChange:function(z){return j({value:z})},onFinalChange:function(z){return A({value:z})},rtl:T.direction==="rtl",renderTrack:function(z){var te=z.props,W=z.children,ne=z.isDragged;return x.createElement(he,X({onMouseDown:te.onMouseDown,onTouchStart:te.onTouchStart,$isDragged:ne},B,Me),x.createElement(ge,X({$isDragged:ne,ref:te.ref},B,pe),W))},renderThumb:function(z){var te=z.props,W=z.index,ne=z.isDragged,Le=f||(!!W&&s||!W&&M||ne)&&!g;return x.createElement(Ge,X({},te,{onMouseEnter:function(){W===0?L(!0):c(!0)},onMouseLeave:function(){W===0?L(!1):c(!1)},$thumbIndex:W,$isDragged:ne,style:Dt({},te.style)},B,Je,{$isFocusVisible:p&&I===W}),Le&&x.createElement(nt,X({$thumbIndex:W,$isDragged:ne},B,at),E(P[W])),Le&&x.createElement(et,X({$thumbIndex:W,$isDragged:ne},B,tt)))}},u?{renderMark:function(z){var te=z.props,W=z.index;return x.createElement(lt,X({$markIndex:W},te,B,dt))}}:{})),x.createElement(st,X({},B,ut),x.createElement(De,X({},B,Pe),E(y)),x.createElement(De,X({},B,Pe),E(t))))}const zt=Ke("div",{target:"e43yrtf0"})(({disabled:e,theme:r})=>({alignItems:"center",backgroundColor:e?r.colors.gray:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${mt(r.colors.primary,.5)}`}})),Nt=Ke("div",{target:"e43yrtf1"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Ut=200;function Ht({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[g,_]=Et({getStateFromWidgetMgr:qt,getDefaultStateFromProto:Wt,getCurrStateFromProto:Kt,updateWidgetMgrState:Xt,element:r,widgetMgr:n,fragmentId:o}),[u,h]=x.useState(g),j=x.useRef(null),[F]=x.useState([]),[A]=x.useState([]),S=yt(),y=u.map(f=>Zt(f,r)),d=r.label;x.useEffect(()=>{h(g)},[g]);const t=x.useCallback(Tt(Ut,f=>{_({value:f,fromUi:!0})}),[]),a=x.useCallback(({value:f})=>{h(f),t(f)},[t]),l=x.useCallback(x.forwardRef(function(b,E){const{$thumbIndex:k}=b,T=k||0;F[T]=E,A[T]||=x.createRef();const w=Ot(b,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),C=y[T];return ae(zt,{...w,disabled:b.$disabled===!0,ref:F[T],"aria-valuetext":C,"aria-label":d,children:ae(Nt,{"data-testid":"stSliderThumbValue",disabled:b.$disabled===!0,ref:A[T],children:C})})}),[]);x.useEffect(()=>{A.map((w,C)=>{w.current&&(w.current.innerText=y[C])}),F.map((w,C)=>{w.current&&w.current.setAttribute("aria-valuetext",y[C])});const f=j.current??null,b=F[0].current,E=F[1]?.current,k=A[0].current,T=A[1]?.current;Jt(f,b,E,k,T)});const v=x.useCallback(({$disabled:f})=>({height:S.spacing.twoXS,...f?{background:S.colors.darkenedBgMix25}:{}}),[S.colors.darkenedBgMix25,S.spacing.twoXS]);return kt("div",{ref:j,className:"stSlider","data-testid":"stSlider",children:[ae(_t,{label:r.label,disabled:e,labelVisibility:wt(r.labelVisibility?.value),children:r.help&&ae(Rt,{children:ae(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),ae(Vt,{min:r.min,max:r.max,step:r.step,value:Gt(u,r),onChange:a,disabled:e,overrides:{Thumb:l,Track:{style:{backgroundColor:"none !important",paddingLeft:S.spacing.none,paddingRight:S.spacing.none,paddingTop:`calc((${S.sizes.minElementHeight} - ${S.spacing.twoXS}) / 2)`,paddingBottom:`calc((${S.sizes.minElementHeight} - ${S.spacing.twoXS}) / 2)`}},InnerTrack:{style:v},TickBar:()=>null}})]})}function qt(e,r){return e.getDoubleArrayValue(r)}function Wt(e){return e.default}function Kt(e){return e.value}function Xt(e,r,n,o){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function Yt(e){const{dataType:r}=e;return r===_e.DataType.DATETIME||r===_e.DataType.DATE||r===_e.DataType.TIME}function Zt(e,r){const{format:n,options:o}=r;return Yt(r)?$t.utc(e/1e3).format(n):o.length>0?Fe.sprintf(n,o[e]):Fe.sprintf(n,e)}function Gt(e,r){const{min:n,max:o}=r;let g=e[0],_=e.length>1?e[1]:e[0];return g>_&&(g=_),g<n&&(g=n),g>o&&(g=o),_<n&&(_=n),_>o&&(_=o),e.length>1?[g,_]:[g]}function Jt(e,r,n,o,g){!e||!r||!o||(ie(e,r,o),n&&g&&(ie(e,n,g),Qt(e,r,n,o,g)))}function ie(e,r,n){const o=e.getBoundingClientRect(),g=r.getBoundingClientRect(),_=n.getBoundingClientRect(),u=g.left+g.width/2,h=u-_.width/2<o.left,j=u+_.width/2>o.right;n.style.left=h?"0":"",n.style.right=j?"0":""}function Qt(e,r,n,o,g){const u=e.getBoundingClientRect(),h=r.getBoundingClientRect(),j=n.getBoundingClientRect(),F=o.getBoundingClientRect(),A=g.getBoundingClientRect(),S=u.left+u.width/2,y=h.left+h.width/2,d=j.left+j.width/2,t=y-F.width/2>=u.left,a=d+A.width/2<=u.right,l=h.left-F.width>=u.left,v=j.right+A.width<=u.right,f=t?F.width/2:F.width,b=a?A.width/2:A.width,E=y+f;if(d-b-E>24){ie(e,r,o),ie(e,n,g);return}if(l&&v){o.style.left="",o.style.right=`${Math.round(h.width)}px`,g.style.left=`${Math.round(j.width)}px`,g.style.right="";return}y<S?(ie(e,r,o),g.style.left=`${Math.round(y+f+24-d)}px`,g.style.right=""):(ie(e,n,g),o.style.left="",o.style.right=`${-Math.round(d-b-24-y)}px`)}const ar=bt(x.memo(Ht));export{ar as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,ap as k,aD as T,j as n,aE as y,bu as C,aJ as S,bD as L,bv as W,bc as B,bO as w,ax as R,bP as E,bQ as P}from"./index.DvRPFfw6.js";import{a as $}from"./useBasicWidgetState.CUSYQZpm.js";import{a as v,L as X,S as m}from"./checkbox.C0odQfKb.js";import"./FormClearHelper.BLEIUk6L.js";function H({element:e,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=$({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:I,updateWidgetMgrState:j,element:e,widgetMgr:s,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=k(),{colors:o,spacing:h,sizes:r}=t,b=T(t),u=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:X.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} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.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:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.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:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${R(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:u}}},children:y(w,{visibility:C(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(L,{color:u,children:n(W,{content:e.help,placement:B.TOP_RIGHT})})]})})})}function M(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function I(e){return e.value??null}function j(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const U=p.memo(H);export{U as default};
|