streamlit-nightly 1.42.1.dev20250210__py2.py3-none-any.whl → 1.42.1.dev20250212__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. streamlit/commands/page_config.py +1 -1
  2. streamlit/config.py +9 -0
  3. streamlit/elements/arrow.py +11 -0
  4. streamlit/elements/widgets/data_editor.py +22 -6
  5. streamlit/proto/Arrow_pb2.py +8 -8
  6. streamlit/proto/Arrow_pb2.pyi +7 -2
  7. streamlit/proto/NewSession_pb2.py +16 -16
  8. streamlit/proto/NewSession_pb2.pyi +12 -3
  9. streamlit/static/index.html +1 -1
  10. streamlit/static/static/js/{FileDownload.esm.CJC5yID5.js → FileDownload.esm.gmDYBMnS.js} +1 -1
  11. streamlit/static/static/js/{FileDropzone.BxEWox87.js → FileDropzone.BhS2dkwO.js} +1 -1
  12. streamlit/static/static/js/{FormClearHelper.D3S2tctS.js → FormClearHelper.BjdyfMQx.js} +1 -1
  13. streamlit/static/static/js/{Hooks.BwOODKo2.js → Hooks.BKB06vs4.js} +1 -1
  14. streamlit/static/static/js/{InputInstructions.Cm2uD0mH.js → InputInstructions.BEaJdOY6.js} +1 -1
  15. streamlit/static/static/js/{ProgressBar.BqFWIdp2.js → ProgressBar.DycN90bZ.js} +1 -1
  16. streamlit/static/static/js/{RenderInPortalIfExists.ax0m2H0_.js → RenderInPortalIfExists.BhsYk57k.js} +1 -1
  17. streamlit/static/static/js/{Toolbar.CRowl_WL.js → Toolbar.M28tVbcl.js} +1 -1
  18. streamlit/static/static/js/{base-input.krLFbHyn.js → base-input.BJFXZaN6.js} +1 -1
  19. streamlit/static/static/js/{createSuper.k6SaTk0j.js → createSuper.CR2BB5ll.js} +1 -1
  20. streamlit/static/static/js/{data-grid-overlay-editor.BUaZRQkO.js → data-grid-overlay-editor.DThw5LO3.js} +1 -1
  21. streamlit/static/static/js/{downloader.CFLXdJg2.js → downloader.oXcdDod3.js} +1 -1
  22. streamlit/static/static/js/{es6.gxLg_8ha.js → es6.Dm6Lr5sS.js} +2 -2
  23. streamlit/static/static/js/{iframeResizer.contentWindow.DkwEeyR9.js → iframeResizer.contentWindow.EQIQrAd4.js} +1 -1
  24. streamlit/static/static/js/{index.Cesoqj5i.js → index.0Eb9CO_K.js} +1 -1
  25. streamlit/static/static/js/{index.cRZuEjlj.js → index.B1X_ANFX.js} +1 -1
  26. streamlit/static/static/js/{index.BSsjknPR.js → index.B2zhJEHf.js} +1 -1
  27. streamlit/static/static/js/{index.BOCJ0fVC.js → index.B49jyHZy.js} +1 -1
  28. streamlit/static/static/js/{index.Cj8uDDnI.js → index.BELZ0Ua3.js} +1 -1
  29. streamlit/static/static/js/{index.DXBI5Jkr.js → index.BZUNGvtg.js} +2 -2
  30. streamlit/static/static/js/{index.BOR0ctru.js → index.BjOrvaSf.js} +1 -1
  31. streamlit/static/static/js/{index.DJY4JXFf.js → index.BkwFDrjh.js} +1 -1
  32. streamlit/static/static/js/{index.BdR17uHT.js → index.BmunCvlQ.js} +1 -1
  33. streamlit/static/static/js/{index.Blgy4CCd.js → index.BrTAJ7cx.js} +7 -7
  34. streamlit/static/static/js/{index.CUPb182F.js → index.BzhkD1G1.js} +1 -1
  35. streamlit/static/static/js/{index.DrwNQ7G8.js → index.C-qfcK5k.js} +22 -22
  36. streamlit/static/static/js/{index.DEpXqZe9.js → index.C02XURgk.js} +1 -1
  37. streamlit/static/static/js/{index.BiQ_POiE.js → index.C8ahq2Yl.js} +1 -1
  38. streamlit/static/static/js/{index.BOVOcQJK.js → index.CAvxO15c.js} +1 -1
  39. streamlit/static/static/js/{index.Cksh9dIb.js → index.CIgcpP2h.js} +1 -1
  40. streamlit/static/static/js/{index.Be3Ud760.js → index.CPA4hfh-.js} +15 -15
  41. streamlit/static/static/js/{index.BAHug0jz.js → index.CYO_k8m0.js} +1 -1
  42. streamlit/static/static/js/{index.CoIye-dC.js → index.CYR86Hh7.js} +1 -1
  43. streamlit/static/static/js/{index.PzwaVSFN.js → index.Cb9G_5ys.js} +1 -1
  44. streamlit/static/static/js/{index.BbOp1EEY.js → index.Cm_RlOaX.js} +61 -61
  45. streamlit/static/static/js/{index.C-4bC9wo.js → index.CqE8cJhC.js} +1 -1
  46. streamlit/static/static/js/{index.DooQ24w4.js → index.D-x9B5Oa.js} +1 -1
  47. streamlit/static/static/js/{index.FyfJgAtw.js → index.D2G_9kKo.js} +1 -1
  48. streamlit/static/static/js/{index.D69WEQtH.js → index.DHr41xKA.js} +1 -1
  49. streamlit/static/static/js/{index.BaBZULmv.js → index.DXjCUYHV.js} +1 -1
  50. streamlit/static/static/js/{index.C_Vm41WK.js → index.DhzvJb2S.js} +1 -1
  51. streamlit/static/static/js/{index.D8KPGiS9.js → index.DvCjEp1s.js} +1 -1
  52. streamlit/static/static/js/{index.UW7UEFVt.js → index.DwnmFzkn.js} +1 -1
  53. streamlit/static/static/js/{index.xMCeK5i-.js → index.DxFBqI9I.js} +1 -1
  54. streamlit/static/static/js/{index.C1ewZGYv.js → index.L2uUYiab.js} +1 -1
  55. streamlit/static/static/js/{index.C8CCX_u3.js → index.V7XbIe_g.js} +1 -1
  56. streamlit/static/static/js/{index.CVtSssNQ.js → index.Vm77sF3W.js} +1 -1
  57. streamlit/static/static/js/{index.B7i1hjL6.js → index.X-CeecsU.js} +1 -1
  58. streamlit/static/static/js/{index.C_eNMQ0G.js → index.YLipy1A9.js} +1 -1
  59. streamlit/static/static/js/{index.DxK0b7hW.js → index.tuHBuV8y.js} +1 -1
  60. streamlit/static/static/js/{index.waVftNUu.js → index.xghdNmh6.js} +1 -1
  61. streamlit/static/static/js/{input.RldPkbfl.js → input.Ch5EKcBw.js} +1 -1
  62. streamlit/static/static/js/{memory.CJUkEDwO.js → memory.cKfo0PEw.js} +1 -1
  63. streamlit/static/static/js/{mergeWith.mP6-fMJS.js → mergeWith.CrVvaazT.js} +1 -1
  64. streamlit/static/static/js/{number-overlay-editor.Cexyv1f1.js → number-overlay-editor.C5_oSHKj.js} +1 -1
  65. streamlit/static/static/js/{possibleConstructorReturn.Bfw_ecB7.js → possibleConstructorReturn.B1H1HPCb.js} +1 -1
  66. streamlit/static/static/js/{sandbox.B9QCFfso.js → sandbox.ZiYcTL56.js} +1 -1
  67. streamlit/static/static/js/{textarea.BphfZ_P9.js → textarea.GanBEqei.js} +1 -1
  68. streamlit/static/static/js/{timepicker.BGFe-2JD.js → timepicker.D-6GNeM1.js} +1 -1
  69. streamlit/static/static/js/{toConsumableArray.BtjgDmTZ.js → toConsumableArray.DP3pcQU2.js} +1 -1
  70. streamlit/static/static/js/{uniqueId.BG3aVKeE.js → uniqueId.Br0SB0lz.js} +1 -1
  71. streamlit/static/static/js/{useBasicWidgetState.GQaAM6uH.js → useBasicWidgetState.DDri_chl.js} +1 -1
  72. streamlit/static/static/js/{useOnInputChange.B6mIpebi.js → useOnInputChange.DwB-vggD.js} +1 -1
  73. streamlit/static/static/js/{withFullScreenWrapper.XgZUnj3Y.js → withFullScreenWrapper.sAYwL3bu.js} +1 -1
  74. {streamlit_nightly-1.42.1.dev20250210.dist-info → streamlit_nightly-1.42.1.dev20250212.dist-info}/METADATA +1 -1
  75. {streamlit_nightly-1.42.1.dev20250210.dist-info → streamlit_nightly-1.42.1.dev20250212.dist-info}/RECORD +79 -79
  76. {streamlit_nightly-1.42.1.dev20250210.data → streamlit_nightly-1.42.1.dev20250212.data}/scripts/streamlit.cmd +0 -0
  77. {streamlit_nightly-1.42.1.dev20250210.dist-info → streamlit_nightly-1.42.1.dev20250212.dist-info}/WHEEL +0 -0
  78. {streamlit_nightly-1.42.1.dev20250210.dist-info → streamlit_nightly-1.42.1.dev20250212.dist-info}/entry_points.txt +0 -0
  79. {streamlit_nightly-1.42.1.dev20250210.dist-info → streamlit_nightly-1.42.1.dev20250212.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r as s,E as k,_ as M,n as g,G as ht,y as q,j as a,bb as J,bu as ft,z as w,bp as Q,b7 as Z,bo as E,b1 as mt,bF as yt,bG as S,bs as vt,bj as Ct,bH as wt,K as L,F as G,bl as It,bk as bt}from"./index.Blgy4CCd.js";import{g as xt,F as St,C as Ft,I as Et,E as zt,u as Ut,a as Ht}from"./FileDropzone.BxEWox87.js";import{I as Tt}from"./InputInstructions.Cm2uD0mH.js";import{i as Dt}from"./inputUtils.CQWz5UKz.js";import{a as X}from"./axios.upsvKRUO.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Lt}from"./textarea.BphfZ_P9.js";import"./base-input.krLFbHyn.js";var tt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});tt.displayName="AttachFile";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});et.displayName="ErrorOutline";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});ot.displayName="Send";const Bt=g("div",{target:"e1w2ot2t0"})(({theme:t,width:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,display:"flex",backgroundColor:t.colors.secondaryBg,width:`${e}px`,overflow:"hidden",":focus-within":{borderColor:t.colors.primary},"&.dropzone":{borderColor:t.colors.primary,borderRadius:t.radii.full,height:t.sizes.emptyDropdownHeight}})),Rt=g("div",{target:"e1w2ot2t1"})(({theme:t})=>({position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,gap:t.spacing.sm})),Vt=g("button",{target:"e1w2ot2t2"})(({theme:t,disabled:e,extended:l})=>{const h=ht(t),[y,p]=h?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?y:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:h?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),kt=g("div",{target:"e1w2ot2t3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),Mt=g("div",{target:"e1w2ot2t4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=g("div",{target:"e12v7o8j0"})(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:"auto",height:"100%",width:"100%",color:t.colors.primary,fontWeight:t.fontWeights.bold})),At=g("div",{target:"e12v7o8j1"})(({})=>({display:"flex",alignItems:"top",height:"100%"})),$t=g("div",{target:"e12v7o8j2"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Wt=g("div",{target:"e12v7o8j3"})(({theme:t})=>({left:0,right:0,border:`${t.sizes.borderWidth} solid ${t.colors.transparent}`,minHeight:t.sizes.minChatInputFileListHeight,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),jt=g("div",{target:"e12v7o8j4"})(({})=>({display:"flex"})),Pt=g("div",{target:"e12v7o8j5"})(({})=>({flex:"0 0 auto"})),Kt=g("div",{target:"e12v7o8j6"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Ot=g("div",{target:"e12v7o8j7"})(({theme:t})=>({color:t.colors.fadedText60})),_t=g("div",{target:"e12v7o8j8"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Gt=g("div",{target:"e12v7o8j9"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Xt=g("small",{target:"e12v7o8j10"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Yt({children:t,content:e}){const l=q();return a(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return a(Yt,{content:t.status.errorMessage,children:a(E,{content:et,size:"lg"})});case"uploaded":return a(E,{content:Et,size:"lg"});default:return mt(e),null}},Jt=({fileInfo:t,onDelete:e})=>w(Kt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(Ot,{children:a(qt,{fileInfo:t})}),a(_t,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),a(Gt,{children:xt(t.size,St.Byte)}),a(Xt,{"data-testid":"stChatInputDeleteBtn",children:a(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:a(E,{content:Ft,size:"lg"})})})]}),Qt=({items:t,onDelete:e})=>a(Wt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:t.map(l=>a(Pt,{children:a(Jt,{fileInfo:l,onDelete:e})},l.id))})}),Zt=({getRootProps:t,getInputProps:e,acceptFile:l,showDropzone:h,disabled:y,theme:p})=>h?w(Nt,{...t(),children:[a("input",{...e()}),"Drag and drop files here"]}):w(At,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[a("input",{...e()}),a(vt,{content:`Upload or drag and drop ${l===S.Multiple?"files":"a file"}`,placement:J.TOP,children:a(Q,{kind:Z.MINIMAL,disabled:y,children:a(E,{content:tt,size:"lg",color:p.colors.fadedText60})})})]}),a($t,{})]}),te=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:h,element:y,onUploadProgress:p,onUploadComplete:f})=>(v,m)=>{const u=X.CancelToken.source(),d=new V(m.name,m.size,t(),{type:"uploading",cancelToken:u,progress:1});e([d]),h.uploadFile({formId:"",...y},v.uploadUrl,m,c=>p(c,d.id),u.token).then(()=>f(d.id,v)).catch(c=>{X.isCancel(c)||l(d.id,d.setStatus({type:"error",errorMessage:c?c.toString():"Unknown error"}))})},ee=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:h,getNextLocalFileId:y,deleteExistingFiles:p,onUploadComplete:f})=>(v,m)=>{if(!t&&v.length===0&&m.length>1){const u=m.findIndex(d=>{var c;return((c=d.errors)==null?void 0:c[0].code)===zt.TooManyFiles});u>=0&&(v.push(m[u].file),m.splice(u,1))}if(!t&&v.length>0&&p(),e.fetchFileURLs(v).then(u=>{Ct(u,v).forEach(([d,c])=>{l(d,c)})}).catch(u=>{h(v.map(d=>new V(d.name,d.size,y(),{type:"error",errorMessage:u})))}),m.length>0){const u=m.map(d=>new V(d.file.name,d.file.size,y(),{type:"error",errorMessage:d.errors.map(c=>c.message).filter(c=>!!c).join(", ")}));h(u)}f()},oe=6.5,Y=1,B=(t,e,l)=>l.map(h=>h.id===t?e:h),R=(t,e)=>e.find(l=>l.id===t);function ne({width:t,element:e,widgetMgr:l,fragmentId:h,uploadClient:y}){const p=q(),f=s.useRef(null),v=s.useRef(0),m=s.useRef({minHeight:0,maxHeight:0}),[u,d]=s.useState(!1),[c,z]=s.useState(e.default),[U,N]=s.useState(0),[I,b]=s.useState([]),[F,H]=s.useState(!1),x=wt(e.acceptFile),A=s.useCallback(o=>b(n=>[...n,...o]),[]),$=s.useCallback(o=>{b(n=>{const i=R(o,n);return L(i)?n:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&y.deleteFile(i.status.fileUrls.deleteUrl),n.filter(r=>r.id!==o))})},[y]),nt=()=>{const o=I.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:r,status:C}=n,{fileId:ut,fileUrls:gt}=C;return new It({fileId:ut,fileUrls:gt,name:i,size:r})});return new bt({uploadedFileInfo:o})},W=()=>v.current++,at=ee({acceptMultipleFiles:x===S.Multiple,uploadClient:y,uploadFile:te({getNextLocalFileId:W,addFiles:A,updateFile:(o,n)=>{b(i=>B(o,n,i))},uploadClient:y,element:e,onUploadProgress:(o,n)=>{b(i=>{const r=R(n,i);if(L(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:B(n,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,n)=>{b(i=>{const r=R(o,i);return L(r)||r.status.type!=="uploading"?i:B(r.id,r.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}),i)})}}),addFiles:A,getNextLocalFileId:W,deleteExistingFiles:()=>I.forEach(o=>$(o.id)),onUploadComplete:()=>{f.current&&f.current.focus()}}),{getRootProps:rt,getInputProps:it}=Ut({onDrop:at,multiple:x===S.Multiple,accept:Ht(e.fileType)}),st=()=>{let o=0;const{current:n}=f;if(n){const i=n.placeholder;n.placeholder="",n.style.height="auto",o=n.scrollHeight,n.placeholder=i,n.style.height=""}return o},j=()=>{if(f.current&&f.current.focus(),!u||e.disabled)return;const o={data:c,fileUploaderState:nt()};l.setChatInputValue(e,o,{fromUi:!0},h),d(!1),b([]),z(""),N(0)},lt=o=>{const{metaKey:n,ctrlKey:i,shiftKey:r}=o;Dt(o)&&!r&&!i&&!n&&(o.preventDefault(),j())},dt=o=>{const{value:n}=o.target,{maxChars:i}=e;i!==0&&n.length>i||(z(n),N(st()))};s.useEffect(()=>I.some(o=>o.status.type==="uploading")?d(!1):d(c!==""||I.length>0),[I,c]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";z(o)}},[e]),s.useEffect(()=>{if(f.current){const{offsetHeight:o}=f.current;m.current.minHeight=o,m.current.maxHeight=o*oe}},[f]),s.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!F&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&H(!0)},n=r=>{r.preventDefault(),r.stopPropagation(),F&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&H(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),F&&H(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",n),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",n)}},[F]);const{disabled:T,placeholder:P,maxChars:ct}=e,{minHeight:pt,maxHeight:K}=m.current,O=U>0&&f.current?Math.abs(U-pt)>Y:!1,D=x!==S.None&&F,_="stChatInput";return w(G,{children:[x===S.None?null:a(Qt,{items:[...I],onDelete:$}),a(Bt,{className:D?`${_} dropzone`:_,"data-testid":"stChatInput",width:t,children:w(Rt,{children:[x===S.None?null:a(Zt,{getRootProps:rt,getInputProps:it,acceptFile:x,showDropzone:D,disabled:T,theme:p}),D?null:w(G,{children:[a(Lt,{inputRef:f,value:c,placeholder:P,onChange:dt,onKeyDown:lt,"aria-label":P,disabled:T,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:O?`${U+Y}px`:"auto",maxHeight:K?`${K}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&a(Mt,{children:a(Tt,{dirty:u,value:c,maxLength:ct,type:"chat",inForm:!1})}),a(kt,{children:a(Vt,{onClick:j,disabled:!u||T,extended:O,"data-testid":"stChatInputSubmitButton",children:a(E,{content:ot,size:"xl",color:"inherit"})})})]})]})})]})}const ue=s.memo(ne);export{ue as default};
1
+ import{r as s,E as k,_ as M,n as g,G as ht,y as q,j as a,bb as J,bu as ft,z as w,bp as Q,b7 as Z,bo as E,b1 as mt,bF as yt,bG as S,bs as vt,bj as Ct,bH as wt,K as L,F as G,bl as It,bk as bt}from"./index.BrTAJ7cx.js";import{g as xt,F as St,C as Ft,I as Et,E as zt,u as Ut,a as Ht}from"./FileDropzone.BhS2dkwO.js";import{I as Tt}from"./InputInstructions.BEaJdOY6.js";import{i as Dt}from"./inputUtils.CQWz5UKz.js";import{a as X}from"./axios.upsvKRUO.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Lt}from"./textarea.GanBEqei.js";import"./base-input.BJFXZaN6.js";var tt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});tt.displayName="AttachFile";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});et.displayName="ErrorOutline";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});ot.displayName="Send";const Bt=g("div",{target:"e1w2ot2t0"})(({theme:t,width:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,display:"flex",backgroundColor:t.colors.secondaryBg,width:`${e}px`,overflow:"hidden",":focus-within":{borderColor:t.colors.primary},"&.dropzone":{borderColor:t.colors.primary,borderRadius:t.radii.full,height:t.sizes.emptyDropdownHeight}})),Rt=g("div",{target:"e1w2ot2t1"})(({theme:t})=>({position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,gap:t.spacing.sm})),Vt=g("button",{target:"e1w2ot2t2"})(({theme:t,disabled:e,extended:l})=>{const f=ht(t),[y,p]=f?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?y:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:f?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),kt=g("div",{target:"e1w2ot2t3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),Mt=g("div",{target:"e1w2ot2t4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=g("div",{target:"e12v7o8j0"})(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:"auto",height:"100%",width:"100%",color:t.colors.primary,fontWeight:t.fontWeights.bold})),At=g("div",{target:"e12v7o8j1"})(({})=>({display:"flex",alignItems:"top",height:"100%"})),$t=g("div",{target:"e12v7o8j2"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Wt=g("div",{target:"e12v7o8j3"})(({theme:t})=>({left:0,right:0,border:`${t.sizes.borderWidth} solid ${t.colors.transparent}`,minHeight:t.sizes.minChatInputFileListHeight,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),jt=g("div",{target:"e12v7o8j4"})(({})=>({display:"flex"})),Pt=g("div",{target:"e12v7o8j5"})(({})=>({flex:"0 0 auto"})),Kt=g("div",{target:"e12v7o8j6"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Ot=g("div",{target:"e12v7o8j7"})(({theme:t})=>({color:t.colors.fadedText60})),_t=g("div",{target:"e12v7o8j8"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Gt=g("div",{target:"e12v7o8j9"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Xt=g("small",{target:"e12v7o8j10"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Yt({children:t,content:e}){const l=q();return a(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return a(Yt,{content:t.status.errorMessage,children:a(E,{content:et,size:"lg"})});case"uploaded":return a(E,{content:Et,size:"lg"});default:return mt(e),null}},Jt=({fileInfo:t,onDelete:e})=>w(Kt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(Ot,{children:a(qt,{fileInfo:t})}),a(_t,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),a(Gt,{children:xt(t.size,St.Byte)}),a(Xt,{"data-testid":"stChatInputDeleteBtn",children:a(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:a(E,{content:Ft,size:"lg"})})})]}),Qt=({items:t,onDelete:e})=>a(Wt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:t.map(l=>a(Pt,{children:a(Jt,{fileInfo:l,onDelete:e})},l.id))})}),Zt=({getRootProps:t,getInputProps:e,acceptFile:l,showDropzone:f,disabled:y,theme:p})=>f?w(Nt,{...t(),children:[a("input",{...e()}),"Drag and drop files here"]}):w(At,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[a("input",{...e()}),a(vt,{content:`Upload or drag and drop ${l===S.Multiple?"files":"a file"}`,placement:J.TOP,children:a(Q,{kind:Z.MINIMAL,disabled:y,children:a(E,{content:tt,size:"lg",color:p.colors.fadedText60})})})]}),a($t,{})]}),te=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:f,element:y,onUploadProgress:p,onUploadComplete:m})=>(v,h)=>{const u=X.CancelToken.source(),d=new V(h.name,h.size,t(),{type:"uploading",cancelToken:u,progress:1});e([d]),f.uploadFile({formId:"",...y},v.uploadUrl,h,c=>p(c,d.id),u.token).then(()=>m(d.id,v)).catch(c=>{X.isCancel(c)||l(d.id,d.setStatus({type:"error",errorMessage:c?c.toString():"Unknown error"}))})},ee=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:f,getNextLocalFileId:y,deleteExistingFiles:p,onUploadComplete:m})=>(v,h)=>{if(!t&&v.length===0&&h.length>1){const u=h.findIndex(d=>{var c;return((c=d.errors)==null?void 0:c[0].code)===zt.TooManyFiles});u>=0&&(v.push(h[u].file),h.splice(u,1))}if(!t&&v.length>0&&p(),e.fetchFileURLs(v).then(u=>{Ct(u,v).forEach(([d,c])=>{l(d,c)})}).catch(u=>{f(v.map(d=>new V(d.name,d.size,y(),{type:"error",errorMessage:u})))}),h.length>0){const u=h.map(d=>new V(d.file.name,d.file.size,y(),{type:"error",errorMessage:d.errors.map(c=>c.message).filter(c=>!!c).join(", ")}));f(u)}m()},oe=6.5,Y=1,B=(t,e,l)=>l.map(f=>f.id===t?e:f),R=(t,e)=>e.find(l=>l.id===t);function ne({width:t,element:e,widgetMgr:l,fragmentId:f,uploadClient:y}){const p=q(),m=s.useRef(null),v=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),[u,d]=s.useState(!1),[c,U]=s.useState(e.default),[z,N]=s.useState(0),[A,nt]=s.useState(!1),[I,b]=s.useState([]),[F,H]=s.useState(!1),x=wt(e.acceptFile),$=s.useCallback(o=>b(n=>[...n,...o]),[]),W=s.useCallback(o=>{b(n=>{const i=R(o,n);return L(i)?n:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&y.deleteFile(i.status.fileUrls.deleteUrl),n.filter(r=>r.id!==o))})},[y]),at=()=>{const o=I.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:r,status:C}=n,{fileId:ut,fileUrls:gt}=C;return new It({fileId:ut,fileUrls:gt,name:i,size:r})});return new bt({uploadedFileInfo:o})},j=()=>v.current++,rt=ee({acceptMultipleFiles:x===S.Multiple,uploadClient:y,uploadFile:te({getNextLocalFileId:j,addFiles:$,updateFile:(o,n)=>{b(i=>B(o,n,i))},uploadClient:y,element:e,onUploadProgress:(o,n)=>{b(i=>{const r=R(n,i);if(L(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:B(n,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,n)=>{b(i=>{const r=R(o,i);return L(r)||r.status.type!=="uploading"?i:B(r.id,r.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}),i)})}}),addFiles:$,getNextLocalFileId:j,deleteExistingFiles:()=>I.forEach(o=>W(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:it,getInputProps:st}=Ut({onDrop:rt,multiple:x===S.Multiple,accept:Ht(e.fileType)}),lt=()=>{let o=0;const{current:n}=m;if(n){const i=n.placeholder;n.placeholder="",n.style.height="auto",o=n.scrollHeight,n.placeholder=i,n.style.height=""}return o},P=()=>{if(m.current&&m.current.focus(),!u||e.disabled)return;const o={data:c,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},f),d(!1),b([]),U(""),N(0)},dt=o=>{const{metaKey:n,ctrlKey:i,shiftKey:r}=o;Dt(o)&&!r&&!i&&!n&&(o.preventDefault(),P())},ct=o=>{const{value:n}=o.target,{maxChars:i}=e;i!==0&&n.length>i||(U(n),N(lt()))};s.useEffect(()=>I.some(o=>o.status.type==="uploading")?d(!1):d(c!==""||I.length>0),[I,c]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";U(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*oe}},[m]),s.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!F&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&H(!0)},n=r=>{r.preventDefault(),r.stopPropagation(),F&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&H(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),F&&H(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",n),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",n)}},[F]),s.useEffect(()=>{const{minHeight:o}=h.current;nt(z>0&&m.current?Math.abs(z-o)>Y:!1)},[z]);const{disabled:T,placeholder:K,maxChars:pt}=e,{maxHeight:O}=h.current,D=x!==S.None&&F,_="stChatInput";return w(G,{children:[x===S.None?null:a(Qt,{items:[...I],onDelete:W}),a(Bt,{className:D?`${_} dropzone`:_,"data-testid":"stChatInput",width:t,children:w(Rt,{children:[x===S.None?null:a(Zt,{getRootProps:it,getInputProps:st,acceptFile:x,showDropzone:D,disabled:T,theme:p}),D?null:w(G,{children:[a(Lt,{inputRef:m,value:c,placeholder:K,onChange:ct,onKeyDown:dt,"aria-label":K,disabled:T,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:A?`${z+Y}px`:"auto",maxHeight:O?`${O}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&a(Mt,{children:a(Tt,{dirty:u,value:c,maxLength:pt,type:"chat",inForm:!1})}),a(kt,{children:a(Vt,{onClick:P,disabled:!u||T,extended:A,"data-testid":"stChatInputSubmitButton",children:a(E,{content:ot,size:"xl",color:"inherit"})})})]})]})})]})}const ue=s.memo(ne);export{ue as default};
@@ -1 +1 @@
1
- import{n as f,r,j as c}from"./index.Blgy4CCd.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const n=r.useRef(null),{startTime:a,endTime:d,loop:u,autoplay:p}=t,m=r.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);r.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),r.useEffect(()=>{const e=n.current,i=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",i),()=>{e&&e.removeEventListener("loadedmetadata",i)}},[t]),r.useEffect(()=>{const e=n.current;if(!e)return;let i=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=a||0,e.play()):i||(i=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,a]),r.useEffect(()=>{const e=n.current;if(!e)return;const i=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",i),()=>{e&&e.removeEventListener("ended",i)}},[u,a]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:p&&!m,src:v})})}const h=r.memo(A);export{h as default};
1
+ import{n as f,r,j as c}from"./index.BrTAJ7cx.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const n=r.useRef(null),{startTime:a,endTime:d,loop:u,autoplay:p}=t,m=r.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);r.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),r.useEffect(()=>{const e=n.current,i=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",i),()=>{e&&e.removeEventListener("loadedmetadata",i)}},[t]),r.useEffect(()=>{const e=n.current;if(!e)return;let i=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=a||0,e.play()):i||(i=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,a]),r.useEffect(()=>{const e=n.current;if(!e)return;const i=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",i),()=>{e&&e.removeEventListener("ended",i)}},[u,a]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:p&&!m,src:v})})}const h=r.memo(A);export{h as default};
@@ -1,4 +1,4 @@
1
- import{bv as x,r as g,bI as ae,bJ as T,bK as w,y as le,G as ce,j as S,bL as se,az as ue,z as de,br as fe,aE as ge,bA as he,bs as be,bb as me,bM as ve,bN as pe}from"./index.Blgy4CCd.js";import{a as $e}from"./useBasicWidgetState.GQaAM6uH.js";import"./FormClearHelper.D3S2tctS.js";var L=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),ye=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function P(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?q(Object(o),!0).forEach(function(r){G(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function G(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ke(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.colors;return t?c.tickFillDisabled:o||i?"transparent":r?c.borderNegative:n?c.borderSelected:c.tickBorder}function Te(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,i=r.sizing,l=i.scale300,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n="Right";break;default:case"right":n="Left";break}return r.direction==="rtl"&&n==="Left"?n="Right":r.direction==="rtl"&&n==="Right"&&(n="Left"),G({},"padding".concat(n),l)}function we(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,l=e.$isHovered,n=e.$isActive,c=e.$theme,a=c.colors;return t?o||r?a.tickFillDisabled:a.tickFill:i&&(r||o)?n?a.tickFillErrorSelectedHoverActive:l?a.tickFillErrorSelectedHover:a.tickFillErrorSelected:i?n?a.tickFillErrorHoverActive:l?a.tickFillErrorHover:a.tickFillError:r||o?n?a.tickFillSelectedHoverActive:l?a.tickFillSelectedHover:a.tickFillSelected:n?a.tickFillActive:l?a.tickFillHover:a.tickFill}function xe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var M=x("label",function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});M.displayName="Root";M.displayName="Root";var _=x("span",function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.sizing,a=l.animation,s=o?l.colors.tickMarkFillDisabled:r?l.colors.tickMarkFillError:l.colors.tickMarkFill,y=encodeURIComponent(`
1
+ import{bv as x,r as g,bI as ae,bJ as T,bK as w,y as le,G as ce,j as S,bL as se,az as ue,z as de,br as fe,aE as ge,bA as he,bs as be,bb as me,bM as ve,bN as pe}from"./index.BrTAJ7cx.js";import{a as $e}from"./useBasicWidgetState.DDri_chl.js";import"./FormClearHelper.BjdyfMQx.js";var L=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),ye=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function P(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?q(Object(o),!0).forEach(function(r){G(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function G(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ke(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.colors;return t?c.tickFillDisabled:o||i?"transparent":r?c.borderNegative:n?c.borderSelected:c.tickBorder}function Te(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,i=r.sizing,l=i.scale300,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n="Right";break;default:case"right":n="Left";break}return r.direction==="rtl"&&n==="Left"?n="Right":r.direction==="rtl"&&n==="Right"&&(n="Left"),G({},"padding".concat(n),l)}function we(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,l=e.$isHovered,n=e.$isActive,c=e.$theme,a=c.colors;return t?o||r?a.tickFillDisabled:a.tickFill:i&&(r||o)?n?a.tickFillErrorSelectedHoverActive:l?a.tickFillErrorSelectedHover:a.tickFillErrorSelected:i?n?a.tickFillErrorHoverActive:l?a.tickFillErrorHover:a.tickFillError:r||o?n?a.tickFillSelectedHoverActive:l?a.tickFillSelectedHover:a.tickFillSelected:n?a.tickFillActive:l?a.tickFillHover:a.tickFill}function xe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var M=x("label",function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});M.displayName="Root";M.displayName="Root";var _=x("span",function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.sizing,a=l.animation,s=o?l.colors.tickMarkFillDisabled:r?l.colors.tickMarkFillError:l.colors.tickMarkFill,y=encodeURIComponent(`
2
2
  <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(s,`"/>
4
4
  </svg>