streamlit-nightly 1.44.2.dev20250406__py3-none-any.whl → 1.44.2.dev20250407__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 (73) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.BcMiTwVB.js → FileDownload.esm.76_siAan.js} +1 -1
  3. streamlit/static/static/js/{FileHelper.DihUx7xB.js → FileHelper.C-t60d9I.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.BCWMbvg-.js → FormClearHelper.BxIPIP5L.js} +1 -1
  5. streamlit/static/static/js/{Hooks.DxswZylT.js → Hooks.CsneG6D-.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.C3IYQW66.js → InputInstructions.CzJqQPUo.js} +1 -1
  7. streamlit/static/static/js/{ProgressBar.DsZ44eAG.js → ProgressBar.rnqmSFc7.js} +1 -1
  8. streamlit/static/static/js/{RenderInPortalIfExists.CJo1XNP4.js → RenderInPortalIfExists.BT1iglcq.js} +1 -1
  9. streamlit/static/static/js/{Toolbar.zC9RMqvO.js → Toolbar.C-G8EZDL.js} +1 -1
  10. streamlit/static/static/js/{base-input.BYAE3JfB.js → base-input.BE23gnVe.js} +1 -1
  11. streamlit/static/static/js/{checkbox.B4yv-nA3.js → checkbox.5KG91rAf.js} +1 -1
  12. streamlit/static/static/js/{createSuper.BYXiuZs5.js → createSuper.Djpx0JHn.js} +1 -1
  13. streamlit/static/static/js/{data-grid-overlay-editor.BRSP4Q5h.js → data-grid-overlay-editor.D5ZEJ6-g.js} +1 -1
  14. streamlit/static/static/js/{downloader.GnadH9DP.js → downloader.2PLh9ewR.js} +1 -1
  15. streamlit/static/static/js/{es6.D8RYB6b-.js → es6.Co_R4Vrv.js} +2 -2
  16. streamlit/static/static/js/{iframeResizer.contentWindow.CjNDfwt8.js → iframeResizer.contentWindow.xC-s1Xv_.js} +1 -1
  17. streamlit/static/static/js/{index.W1F0OM9G.js → index.3lMrZLLw.js} +1 -1
  18. streamlit/static/static/js/{index.Kzz4gUPJ.js → index.5KFYXBbC.js} +4 -4
  19. streamlit/static/static/js/{index.CPBJk1lp.js → index.7G_phRf1.js} +1 -1
  20. streamlit/static/static/js/{index.CdPagNhq.js → index.7c-G8UGV.js} +1 -1
  21. streamlit/static/static/js/{index.BRhhwv-C.js → index.BDCmLPQN.js} +1 -1
  22. streamlit/static/static/js/{index.CDSPljq3.js → index.BDb06VAk.js} +1 -1
  23. streamlit/static/static/js/{index.BPtOLSNm.js → index.BLuvs8YB.js} +1 -1
  24. streamlit/static/static/js/{index.C_2tXwz4.js → index.BhQfRF6s.js} +1 -1
  25. streamlit/static/static/js/{index.PKWaMjh6.js → index.BhwLaup4.js} +1 -1
  26. streamlit/static/static/js/{index.DuHTqH_9.js → index.C4Lfn2XI.js} +1 -1
  27. streamlit/static/static/js/{index.Cxfze3Mk.js → index.CD3nk9Fu.js} +1 -1
  28. streamlit/static/static/js/index.CHq7UPqh.js +1 -0
  29. streamlit/static/static/js/{index.Dgn3lt9J.js → index.CL9k-WRa.js} +1 -1
  30. streamlit/static/static/js/{index.CbT7y4TK.js → index.CLlijDQ8.js} +1 -1
  31. streamlit/static/static/js/{index.B7qpqtD6.js → index.CMDu4q8N.js} +1 -1
  32. streamlit/static/static/js/{index.CzrE9emY.js → index.CNErThK-.js} +1 -1
  33. streamlit/static/static/js/{index.BbAJYVXj.js → index.CVpc4758.js} +1 -1
  34. streamlit/static/static/js/{index.DOpTXgh3.js → index.CbEMdCQd.js} +1 -1
  35. streamlit/static/static/js/{index.CBxn7sji.js → index.CbPbNHEK.js} +1 -1
  36. streamlit/static/static/js/{index.DKCBo3om.js → index.CdIt7R38.js} +1 -1
  37. streamlit/static/static/js/{index.CRMmBBDq.js → index.Cm77Rq1x.js} +1 -1
  38. streamlit/static/static/js/{index.B3WIarqf.js → index.CwBkmOEf.js} +1 -1
  39. streamlit/static/static/js/{index.BC5wAIFM.js → index.D8OA-3wz.js} +1 -1
  40. streamlit/static/static/js/{index.UKdSrnn_.js → index.DEqbXo0i.js} +1 -1
  41. streamlit/static/static/js/{index.CkZkpK4-.js → index.DIQp9MZY.js} +1 -1
  42. streamlit/static/static/js/{index.DuV4oQbx.js → index.DNsBOU6p.js} +5 -5
  43. streamlit/static/static/js/{index.NmHUotTf.js → index.DSs7V2Hz.js} +1 -1
  44. streamlit/static/static/js/{index.nEP2fCOO.js → index.DUB8mvGX.js} +1 -1
  45. streamlit/static/static/js/{index.BDlCQX5I.js → index.DZ1bfx6i.js} +1 -1
  46. streamlit/static/static/js/{index.CrEVoSTM.js → index.DhlyA8r5.js} +1 -1
  47. streamlit/static/static/js/{index.Dcg-1sHd.js → index.DpkiOR-s.js} +1 -1
  48. streamlit/static/static/js/{index.BqkJyhUo.js → index.DyhGBqck.js} +1 -1
  49. streamlit/static/static/js/{index.DRrj4vJq.js → index.G5BB57Lk.js} +1 -1
  50. streamlit/static/static/js/{index.CzUmKu1R.js → index.KrzfTD2f.js} +1 -1
  51. streamlit/static/static/js/{index.Bxba7-Vj.js → index.LEPdg6O5.js} +1 -1
  52. streamlit/static/static/js/{index.Dv3BUspB.js → index.fNuc0k1L.js} +1 -1
  53. streamlit/static/static/js/{index.Dg7ksnn2.js → index.uyVXCnCm.js} +1 -1
  54. streamlit/static/static/js/{input.B970MGo0.js → input.Dj1y6w2g.js} +1 -1
  55. streamlit/static/static/js/{memory.Bds5EpZ8.js → memory.ClgbFfRV.js} +1 -1
  56. streamlit/static/static/js/{mergeWith.zOP131Mw.js → mergeWith.p3MKF-Jv.js} +1 -1
  57. streamlit/static/static/js/{number-overlay-editor.BxGwsHaY.js → number-overlay-editor.DSy8B0d4.js} +1 -1
  58. streamlit/static/static/js/{possibleConstructorReturn.CngyaSWa.js → possibleConstructorReturn.PqdlS9VN.js} +1 -1
  59. streamlit/static/static/js/{sandbox.COLAm094.js → sandbox.JYNAoHIv.js} +1 -1
  60. streamlit/static/static/js/{textarea.DrttbSkr.js → textarea.BRz2PqBl.js} +1 -1
  61. streamlit/static/static/js/{timepicker.D02-j0jX.js → timepicker.CLWT7Rjp.js} +1 -1
  62. streamlit/static/static/js/{toConsumableArray.EMFv73a7.js → toConsumableArray.BesBwzeG.js} +1 -1
  63. streamlit/static/static/js/{uniqueId.CdAsXj9D.js → uniqueId.HRwxnbrd.js} +1 -1
  64. streamlit/static/static/js/{useBasicWidgetState.BDsVFj3k.js → useBasicWidgetState.QU3v4y2-.js} +1 -1
  65. streamlit/static/static/js/{useOnInputChange.C8C1na1y.js → useOnInputChange.BbhxtdXj.js} +1 -1
  66. streamlit/static/static/js/{withFullScreenWrapper.BBFCh9IR.js → withFullScreenWrapper.BhOSdZrO.js} +1 -1
  67. {streamlit_nightly-1.44.2.dev20250406.dist-info → streamlit_nightly-1.44.2.dev20250407.dist-info}/METADATA +1 -1
  68. {streamlit_nightly-1.44.2.dev20250406.dist-info → streamlit_nightly-1.44.2.dev20250407.dist-info}/RECORD +72 -72
  69. streamlit/static/static/js/index.BD4E56NB.js +0 -1
  70. {streamlit_nightly-1.44.2.dev20250406.data → streamlit_nightly-1.44.2.dev20250407.data}/scripts/streamlit.cmd +0 -0
  71. {streamlit_nightly-1.44.2.dev20250406.dist-info → streamlit_nightly-1.44.2.dev20250407.dist-info}/WHEEL +0 -0
  72. {streamlit_nightly-1.44.2.dev20250406.dist-info → streamlit_nightly-1.44.2.dev20250407.dist-info}/entry_points.txt +0 -0
  73. {streamlit_nightly-1.44.2.dev20250406.dist-info → streamlit_nightly-1.44.2.dev20250407.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r as s,bh as U,z as k,cs as W,C as A,j as l,br as L,bF as P,bs as B,ba as D,bt as j}from"./index.Kzz4gUPJ.js";import{u as _}from"./uniqueId.CdAsXj9D.js";import{u as w,a as K,b as O}from"./useOnInputChange.C8C1na1y.js";import{I as $}from"./InputInstructions.C3IYQW66.js";import{a as q}from"./useBasicWidgetState.BDsVFj3k.js";import{T as G}from"./textarea.DrttbSkr.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.BCWMbvg-.js";import"./base-input.BYAE3JfB.js";const x=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,J=a=>a.value??null,Q=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},X=({disabled:a,element:t,widgetMgr:o,fragmentId:u})=>{var f;const p=s.useRef(_("text_area_")).current,[T,S]=U(),[r,n]=s.useState(!1),[C,b]=s.useState(!1),[i,d]=s.useState(()=>x(o,t)??null),I=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[y,c]=q({getStateFromWidgetMgr:x,getDefaultStateFromProto:N,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:o,fragmentId:u,onFormCleared:I});w(y,i,d,r);const e=k(),m=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&m(),b(!1)},[r,m]),V=s.useCallback(()=>{b(!0)},[]),v=K({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),z=O(t.formId,m,r,o,u,!0),{height:g,placeholder:E,formId:h}=t,R=W({formId:h})?o.allowFormEnterToSubmit(h):r,H=C&&T>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:p,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:v,onKeyDown:z,"aria-label":t.label,disabled:a,id:p,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:g?`${g}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.md,paddingLeft:e.spacing.md,paddingBottom:e.spacing.md,paddingTop:e.spacing.md}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l($,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:W({formId:h}),allowEnterToSubmit:R})]})},it=s.memo(X);export{it as default};
1
+ import{r as s,bh as U,z as k,cs as W,C as A,j as l,br as L,bF as P,bs as B,ba as D,bt as j}from"./index.5KFYXBbC.js";import{u as _}from"./uniqueId.HRwxnbrd.js";import{u as w,a as K,b as O}from"./useOnInputChange.BbhxtdXj.js";import{I as $}from"./InputInstructions.CzJqQPUo.js";import{a as q}from"./useBasicWidgetState.QU3v4y2-.js";import{T as G}from"./textarea.BRz2PqBl.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.BxIPIP5L.js";import"./base-input.BE23gnVe.js";const x=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,J=a=>a.value??null,Q=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},X=({disabled:a,element:t,widgetMgr:o,fragmentId:u})=>{var f;const p=s.useRef(_("text_area_")).current,[T,S]=U(),[r,n]=s.useState(!1),[C,b]=s.useState(!1),[i,d]=s.useState(()=>x(o,t)??null),I=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[y,c]=q({getStateFromWidgetMgr:x,getDefaultStateFromProto:N,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:o,fragmentId:u,onFormCleared:I});w(y,i,d,r);const e=k(),m=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&m(),b(!1)},[r,m]),V=s.useCallback(()=>{b(!0)},[]),v=K({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),z=O(t.formId,m,r,o,u,!0),{height:g,placeholder:E,formId:h}=t,R=W({formId:h})?o.allowFormEnterToSubmit(h):r,H=C&&T>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:p,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:v,onKeyDown:z,"aria-label":t.label,disabled:a,id:p,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:g?`${g}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.md,paddingLeft:e.spacing.md,paddingBottom:e.spacing.md,paddingTop:e.spacing.md}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l($,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:W({formId:h}),allowEnterToSubmit:R})]})},it=s.memo(X);export{it as default};
@@ -0,0 +1 @@
1
+ import{r as c,E as C,_ as b,n as d,H as j,C as g,j as a,bo as m,bp as F,b4 as O,b5 as S,cq as _,cr as q,aZ as G,F as K,bE as Y,R as Z,aA as J,bj as Q,M as h,b as f,bl as ee,bk as te,br as ie,bF as se,bs as le,ba as ne,bt as ae}from"./index.5KFYXBbC.js";import{a as I}from"./index.t--hEgTQ.js";import{F as oe}from"./FormClearHelper.BxIPIP5L.js";import{g as M,F as y,b as re,D as de,I as ce,C as pe,a as ge,s as ue}from"./FileHelper.C-t60d9I.js";import{S as he,P as me}from"./ProgressBar.rnqmSFc7.js";import{u as fe}from"./Hooks.CsneG6D-.js";import{U}from"./UploadFileInfo.C-jY39rj.js";var D=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});D.displayName="CloudUpload";var B=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});B.displayName="Error";const V=d("section",{target:"e11x2l790"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=d("div",{target:"e11x2l791"})({marginRight:"auto",alignItems:"center",display:"flex"}),L=d("span",{target:"e11x2l792"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),Fe=d("span",{target:"e11x2l793"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),Se=d("div",{target:"e11x2l794"})({display:"flex",flexDirection:"column"}),E=d("div",{target:"e11x2l795"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),ye=d("ul",{target:"e11x2l796"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),A=d("li",{target:"e11x2l797"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),W=d("div",{target:"e11x2l798"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),k=d("div",{target:"e11x2l799"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),R=d("div",{target:"e11x2l7910"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),xe=d("span",{target:"e11x2l7911"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Ue=d("div",{target:"e11x2l7912"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),H=d("small",{target:"e11x2l7913"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),N=d("span",{target:"e11x2l7914"})({}),we=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[L]:{display:"none"},[E]:{paddingRight:e.spacing.lg},[R]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[W]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[A]:{margin:e.spacing.none,padding:e.spacing.none}}),Ie=d("div",{target:"e11x2l7915"})(({theme:e,width:s})=>{if(s<j("23rem"))return we(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const w=d("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),ve=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(L,{children:a(m,{content:D,size:"threeXL"})}),g(Se,{children:[g(Fe,{children:["Drag and drop file",e?"s":""," here"]}),g(w,{children:[`Limit ${M(t,y.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ze=c.memo(ve),Ce=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(de,{onDrop:e,multiple:s,accept:re(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(V,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ze,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(F,{kind:S.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),be=c.memo(Ce),Me=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),De=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Be=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(Me,{"data-testid":"stFileUploaderPagination",children:[a(w,{children:`Showing page ${e} of ${s}`}),g(De,{children:[a(F,{onClick:i,kind:S.MINIMAL,children:a(m,{content:_,size:"xl"})}),a(F,{onClick:t,kind:S.MINIMAL,children:a(m,{content:q,size:"xl"})})]})]}),Ve=c.memo(Be),z=(e,s)=>Math.ceil(e.length/s),Pe=e=>G(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=c.useState(0),[p,x]=c.useState(()=>z(i,t)),u=fe(i);c.useEffect(()=>{u&&u.length!==i.length&&x(z(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},$=()=>{r(Math.max(0,n-1))},X=i.slice(n*t,n*t+t);return g(K,{children:[a(e,{items:X,...o}),i.length>t?a(Ve,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:$}):null]})},e),Le=({fileInfo:e})=>e.status.type==="uploading"?a(me,{value:e.status.progress,size:he.SMALL}):e.status.type==="error"?g(H,{children:[a(xe,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(N,{children:a(m,{content:B,size:"lg"})})]}):e.status.type==="uploaded"?a(w,{children:M(e.size,y.Byte)}):null,Ee=({fileInfo:e,onDelete:s})=>g(R,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(Ue,{children:a(m,{content:ce,size:"twoXL"})}),g(W,{className:"stFileUploaderFileData",children:[a(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(Le,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(F,{onClick:()=>s(e.id),kind:S.MINIMAL,children:a(m,{content:pe,size:"lg"})})})]}),Ae=c.memo(Ee),We=({items:e,onDelete:s})=>a(ye,{children:e.map(t=>a(A,{children:a(Ae,{fileInfo:t,onDelete:s})},t.id))}),ke=Pe(We),Re=e=>a(E,{children:a(ke,{...e})}),He=c.memo(Re);class Ne extends Z.PureComponent{constructor(s){super(s),this.formClearHelper=new oe,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);J(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}Q(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new U(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>ge(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new U(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{I.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{f.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,x=n.fileId,u=n.fileUrls;return new U(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return ue(s,y.Megabyte,y.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new ee({fileId:n,fileUrls:r,name:i,size:l})});return new te({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(Ie,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(ae,{label:t.label,disabled:i,labelVisibility:ie((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(se,{children:a(le,{content:t.help,placement:ne.TOP_RIGHT})})}),a(be,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(He,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Ge=Y(c.memo(Ne));export{Ge as default};
@@ -1,2 +1,2 @@
1
- import{bv as q,bw as J,r as f,bx as Q,z as Y,by as s,j as S,C as ee,br as te,bz as re,bs as ne,ba as oe,bA as ie,bt as ae,bp as ue,b5 as C,b4 as W,b7 as le}from"./index.Kzz4gUPJ.js";import{a as ce}from"./useBasicWidgetState.BDsVFj3k.js";import"./FormClearHelper.BCWMbvg-.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return me(e)||he(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{bv as q,bw as J,r as f,bx as Q,z as Y,by as s,j as S,C as ee,br as te,bz as re,bs as ne,ba as oe,bA as ie,bt as ae,bp as ue,b5 as C,b4 as W,b7 as le}from"./index.5KFYXBbC.js";import{a as ce}from"./useBasicWidgetState.QU3v4y2-.js";import"./FormClearHelper.BxIPIP5L.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return me(e)||he(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function he(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function me(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Se(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=A(e),o;if(t){var i=A(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return Se(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,P=c===void 0?k.checkbox:c,d=i.children,y=i.selected,h=i.disabled,l=i.onClick,_=i.kind,m=i.shape,w=i.size,I=J(p.Root,z),O=de(I,2),E=O[0],L=O[1],H=this.props["aria-label"]||this.props.ariaLabel,g=P===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(Z){return f.createElement(E,M({"aria-label":H||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:m,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var T=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:h||b.props.disabled,isSelected:T,ref:g?o.childRefs[R]:void 0,tabIndex:!g||T||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var v=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var B=v-1<0?V-1:v-1;l&&l(u,B),o.childRefs[B].current&&o.childRefs[B].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=v+1>V-1?0:v+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){h||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:m,size:w,overrides:pe({BaseButton:{style:function(u){var v=u.$theme;return d.length===1?{}:m!==G.default?{marginLeft:v.sizing.scale100,marginRight:v.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":T,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Pe(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ae(e,t,r){const n=r===s.Style.PILLS?C.PILLS:r===s.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:S(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Ie(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Te(e,t){return e&&(t=`${t}Active`),t}function Be(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Ie(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:h,kind:l,size:_}=Ae(p??"",c??void 0,i),m=Te(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return S(ue,{...d,size:_,kind:m,children:h})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:P,labelVisibility:d,help:y}=r,h=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),m=(O,E)=>{const L=Ce(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const I=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return S(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[S(ae,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??ie.LabelVisibilityOptions.COLLAPSED),children:y&&S(re,{children:S(ne,{content:y,placement:oe.TOP})})}),S(F,{disabled:t,mode:w,onClick:m,selected:i===s.ClickMode.MULTI_SELECT?l:Pe(l),overrides:{Root:{style:f.useCallback(()=>Be(c,h.spacing),[c,h.spacing])}},children:I})]})}const Ue=f.memo(Ge);export{Ue as default};
@@ -1,4 +1,4 @@
1
- import{r as m,bQ as xr,bR as Lr,bS as jr,bT as Br,d as rn,bU as nn,g as an,bv as X,bN as He,bO as Ee,bV as on,bM as Fr,bw as N,G as Wr,bW as sn,bX as Nr,bY as cr,bZ as ln,bx as We,b_ as un,b$ as cn,c0 as dn,A as Vr,I as pn,z as dr,aD as fn,S as jt,M as hn,C as yn,j as Ye,br as gn,bF as vn,bs as mn,ba as bn,bt as Sn}from"./index.Kzz4gUPJ.js";import{a as Dn}from"./useBasicWidgetState.BDsVFj3k.js";import{D as Ce,a as Ie,T as On}from"./timepicker.D02-j0jX.js";import{I as _n}from"./input.B970MGo0.js";import{I as $n}from"./base-input.BYAE3JfB.js";import"./FormClearHelper.BCWMbvg-.js";import"./possibleConstructorReturn.CngyaSWa.js";import"./createSuper.BYXiuZs5.js";var wn=["title","size","color","overrides"];function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gt.apply(this,arguments)}function kn(t,r){if(t==null)return{};var n=Mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Pn(t,r){return Hn(t)||An(t,r)||In(t,r)||Cn()}function Cn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as m,bQ as xr,bR as Lr,bS as jr,bT as Br,d as rn,bU as nn,g as an,bv as X,bN as He,bO as Ee,bV as on,bM as Fr,bw as N,G as Wr,bW as sn,bX as Nr,bY as cr,bZ as ln,bx as We,b_ as un,b$ as cn,c0 as dn,A as Vr,I as pn,z as dr,aD as fn,S as jt,M as hn,C as yn,j as Ye,br as gn,bF as vn,bs as mn,ba as bn,bt as Sn}from"./index.5KFYXBbC.js";import{a as Dn}from"./useBasicWidgetState.QU3v4y2-.js";import{D as Ce,a as Ie,T as On}from"./timepicker.CLWT7Rjp.js";import{I as _n}from"./input.Dj1y6w2g.js";import{I as $n}from"./base-input.BE23gnVe.js";import"./FormClearHelper.BxIPIP5L.js";import"./possibleConstructorReturn.PqdlS9VN.js";import"./createSuper.Djpx0JHn.js";var wn=["title","size","color","overrides"];function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gt.apply(this,arguments)}function kn(t,r){if(t==null)return{};var n=Mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Pn(t,r){return Hn(t)||An(t,r)||In(t,r)||Cn()}function Cn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function In(t,r){if(t){if(typeof t=="string")return pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(t,r)}}function pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function An(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Hn(t){if(Array.isArray(t))return t}function En(t,r){var n=xr(),a=Pn(n,2),e=a[1],o=t.title,i=o===void 0?"Left":o,s=t.size,c=t.color,u=t.overrides,f=u===void 0?{}:u,d=kn(t,wn),y=Lr({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},f&&f.Svg?jr(f.Svg):{});return m.createElement(Br,gt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:c,overrides:{Svg:y}},d),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const fr=m.forwardRef(En);var Rn=["title","size","color","overrides"];function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},vt.apply(this,arguments)}function Tn(t,r){if(t==null)return{};var n=xn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function xn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Ln(t,r){return Wn(t)||Fn(t,r)||Bn(t,r)||jn()}function jn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bn(t,r){if(t){if(typeof t=="string")return hr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hr(t,r)}}function hr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Fn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Wn(t){if(Array.isArray(t))return t}function Nn(t,r){var n=xr(),a=Ln(n,2),e=a[1],o=t.title,i=o===void 0?"Right":o,s=t.size,c=t.color,u=t.overrides,f=u===void 0?{}:u,d=Tn(t,Rn),y=Lr({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},f&&f.Svg?jr(f.Svg):{});return m.createElement(Br,vt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:c,overrides:{Svg:y}},d),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const yr=m.forwardRef(Nn);var at={exports:{}},ot,gr;function Vn(){if(gr)return ot;gr=1;function t(p){return p&&typeof p=="object"&&"default"in p?p.default:p}var r=t(rn()),n=nn();function a(p,b){for(var O=Object.getOwnPropertyNames(b),h=0;h<O.length;h++){var l=O[h],P=Object.getOwnPropertyDescriptor(b,l);P&&P.configurable&&p[l]===void 0&&Object.defineProperty(p,l,P)}return p}function e(){return(e=Object.assign||function(p){for(var b=1;b<arguments.length;b++){var O=arguments[b];for(var h in O)Object.prototype.hasOwnProperty.call(O,h)&&(p[h]=O[h])}return p}).apply(this,arguments)}function o(p,b){p.prototype=Object.create(b.prototype),a(p.prototype.constructor=p,b)}function i(p,b){if(p==null)return{};var O,h,l={},P=Object.keys(p);for(h=0;h<P.length;h++)O=P[h],0<=b.indexOf(O)||(l[O]=p[O]);return l}function s(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}var c=function(p,b,O,h,l,P,Y,te){if(!p){var R;if(b===void 0)R=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[O,h,l,P,Y,te],W=0;(R=new Error(b.replace(/%s/g,function(){return j[W++]}))).name="Invariant Violation"}throw R.framesToPop=1,R}},u=c;function f(p,b,O){if("selectionStart"in p&&"selectionEnd"in p)p.selectionStart=b,p.selectionEnd=O;else{var h=p.createTextRange();h.collapse(!0),h.moveStart("character",b),h.moveEnd("character",O-b),h.select()}}function d(p){var b=0,O=0;if("selectionStart"in p&&"selectionEnd"in p)b=p.selectionStart,O=p.selectionEnd;else{var h=document.selection.createRange();h.parentElement()===p&&(b=-h.moveStart("character",-p.value.length),O=-h.moveEnd("character",-p.value.length))}return{start:b,end:O,length:O-b}}var y={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},g="_";function v(p,b,O){var h="",l="",P=null,Y=[];if(b===void 0&&(b=g),O==null&&(O=y),!p||typeof p!="string")return{maskChar:b,formatChars:O,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var te=!1;return p.split("").forEach(function(R){te=!te&&R==="\\"||(te||!O[R]?(Y.push(h.length),h.length===Y.length-1&&(l+=R)):P=h.length+1,h+=R,!1)}),{maskChar:b,formatChars:O,prefix:l,mask:h,lastEditablePosition:P,permanents:Y}}function S(p,b){return p.permanents.indexOf(b)!==-1}function D(p,b,O){var h=p.mask,l=p.formatChars;if(!O)return!1;if(S(p,b))return h[b]===O;var P=l[h[b]];return new RegExp(P).test(O)}function $(p,b){return b.split("").every(function(O,h){return S(p,h)||!D(p,h,O)})}function _(p,b){var O=p.maskChar,h=p.prefix;if(!O){for(;b.length>h.length&&S(p,b.length-1);)b=b.slice(0,b.length-1);return b.length}for(var l=h.length,P=b.length;P>=h.length;P--){var Y=b[P];if(!S(p,P)&&D(p,P,Y)){l=P+1;break}}return l}function k(p,b){return _(p,b)===p.mask.length}function w(p,b){var O=p.maskChar,h=p.mask,l=p.prefix;if(!O){for((b=A(p,"",b,0)).length<l.length&&(b=l);b.length<h.length&&S(p,b.length);)b+=h[b.length];return b}if(b)return A(p,w(p,""),b,0);for(var P=0;P<h.length;P++)S(p,P)?b+=h[P]:b+=O;return b}function B(p,b,O,h){var l=O+h,P=p.maskChar,Y=p.mask,te=p.prefix,R=b.split("");if(P)return R.map(function(W,re){return re<O||l<=re?W:S(p,re)?Y[re]:P}).join("");for(var j=l;j<R.length;j++)S(p,j)&&(R[j]="");return O=Math.max(te.length,O),R.splice(O,l-O),b=R.join(""),w(p,b)}function A(p,b,O,h){var l=p.mask,P=p.maskChar,Y=p.prefix,te=O.split(""),R=k(p,b);return!P&&h>b.length&&(b+=l.slice(b.length,h)),te.every(function(j){for(;se=j,S(p,z=h)&&se!==l[z];){if(h>=b.length&&(b+=l[h]),W=j,re=h,P&&S(p,re)&&W===P)return!0;if(++h>=l.length)return!1}var W,re,z,se;return!D(p,h,j)&&j!==P||(h<b.length?b=P||R||h<Y.length?b.slice(0,h)+j+b.slice(h+1):(b=b.slice(0,h)+j+b.slice(h),w(p,b)):P||(b+=j),++h<l.length)}),b}function T(p,b,O,h){var l=p.mask,P=p.maskChar,Y=O.split(""),te=h;return Y.every(function(R){for(;W=R,S(p,j=h)&&W!==l[j];)if(++h>=l.length)return!1;var j,W;return(D(p,h,R)||R===P)&&h++,h<l.length}),h-te}function E(p,b){for(var O=b;0<=O;--O)if(!S(p,O))return O;return null}function C(p,b){for(var O=p.mask,h=b;h<O.length;++h)if(!S(p,h))return h;return null}function x(p){return p||p===0?p+"":""}function I(p,b,O,h,l){var P=p.mask,Y=p.prefix,te=p.lastEditablePosition,R=b,j="",W=0,re=0,z=Math.min(l.start,O.start);return O.end>l.start?re=(W=T(p,h,j=R.slice(l.start,O.end),z))?l.length:0:R.length<h.length&&(re=h.length-R.length),R=h,re&&(re===1&&!l.length&&(z=l.start===O.start?C(p,O.start):E(p,O.start)),R=B(p,R,z,re)),R=A(p,R,j,z),(z+=W)>=P.length?z=P.length:z<Y.length&&!W?z=Y.length:z>=Y.length&&z<te&&W&&(z=C(p,z)),j||(j=null),{value:R=w(p,R),enteredString:j,selection:{start:z,end:z}}}function H(){var p=new RegExp("windows","i"),b=new RegExp("phone","i"),O=navigator.userAgent;return p.test(O)&&b.test(O)}function L(p){return typeof p=="function"}function q(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function ge(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function ie(p){return(ge()?q():function(){return setTimeout(p,1e3/60)})(p)}function G(p){(ge()||clearTimeout)(p)}var ee=function(p){function b(h){var l=p.call(this,h)||this;l.focused=!1,l.mounted=!1,l.previousSelection=null,l.selectionDeferId=null,l.saveSelectionLoopDeferId=null,l.saveSelectionLoop=function(){l.previousSelection=l.getSelection(),l.saveSelectionLoopDeferId=ie(l.saveSelectionLoop)},l.runSaveSelectionLoop=function(){l.saveSelectionLoopDeferId===null&&l.saveSelectionLoop()},l.stopSaveSelectionLoop=function(){l.saveSelectionLoopDeferId!==null&&(G(l.saveSelectionLoopDeferId),l.saveSelectionLoopDeferId=null,l.previousSelection=null)},l.getInputDOMNode=function(){if(!l.mounted)return null;var M=n.findDOMNode(s(s(l))),F=typeof window<"u"&&M instanceof window.Element;if(M&&!F)return null;if(M.nodeName!=="INPUT"&&(M=M.querySelector("input")),!M)throw new Error("react-input-mask: inputComponent doesn't contain input node");return M},l.getInputValue=function(){var M=l.getInputDOMNode();return M?M.value:null},l.setInputValue=function(M){var F=l.getInputDOMNode();F&&(l.value=M,F.value=M)},l.setCursorToEnd=function(){var M=_(l.maskOptions,l.value),F=C(l.maskOptions,M);F!==null&&l.setCursorPosition(F)},l.setSelection=function(M,F,U){U===void 0&&(U={});var V=l.getInputDOMNode(),Q=l.isFocused();V&&Q&&(U.deferred||f(V,M,F),l.selectionDeferId!==null&&G(l.selectionDeferId),l.selectionDeferId=ie(function(){l.selectionDeferId=null,f(V,M,F)}),l.previousSelection={start:M,end:F,length:Math.abs(F-M)})},l.getSelection=function(){return d(l.getInputDOMNode())},l.getCursorPosition=function(){return l.getSelection().start},l.setCursorPosition=function(M){l.setSelection(M,M)},l.isFocused=function(){return l.focused},l.getBeforeMaskedValueChangeConfig=function(){var M=l.maskOptions,F=M.mask,U=M.maskChar,V=M.permanents,Q=M.formatChars;return{mask:F,maskChar:U,permanents:V,alwaysShowMask:!!l.props.alwaysShowMask,formatChars:Q}},l.isInputAutofilled=function(M,F,U,V){var Q=l.getInputDOMNode();try{if(Q.matches(":-webkit-autofill"))return!0}catch{}return!l.focused||V.end<U.length&&F.end===M.length},l.onChange=function(M){var F=s(s(l)).beforePasteState,U=s(s(l)).previousSelection,V=l.props.beforeMaskedValueChange,Q=l.getInputValue(),fe=l.value,he=l.getSelection();l.isInputAutofilled(Q,he,fe,U)&&(fe=w(l.maskOptions,""),U={start:0,end:0,length:0}),F&&(U=F.selection,fe=F.value,he={start:U.start+Q.length,end:U.start+Q.length,length:0},Q=fe.slice(0,U.start)+Q+fe.slice(U.end),l.beforePasteState=null);var $e=I(l.maskOptions,Q,he,fe,U),Ve=$e.enteredString,me=$e.selection,ke=$e.value;if(L(V)){var Ae=V({value:ke,selection:me},{value:fe,selection:U},Ve,l.getBeforeMaskedValueChangeConfig());ke=Ae.value,me=Ae.selection}l.setInputValue(ke),L(l.props.onChange)&&l.props.onChange(M),l.isWindowsPhoneBrowser?l.setSelection(me.start,me.end,{deferred:!0}):l.setSelection(me.start,me.end)},l.onFocus=function(M){var F=l.props.beforeMaskedValueChange,U=l.maskOptions,V=U.mask,Q=U.prefix;if(l.focused=!0,l.mounted=!0,V){if(l.value)_(l.maskOptions,l.value)<l.maskOptions.mask.length&&l.setCursorToEnd();else{var fe=w(l.maskOptions,Q),he=w(l.maskOptions,fe),$e=_(l.maskOptions,he),Ve=C(l.maskOptions,$e),me={start:Ve,end:Ve};if(L(F)){var ke=F({value:he,selection:me},{value:l.value,selection:null},null,l.getBeforeMaskedValueChangeConfig());he=ke.value,me=ke.selection}var Ae=he!==l.getInputValue();Ae&&l.setInputValue(he),Ae&&L(l.props.onChange)&&l.props.onChange(M),l.setSelection(me.start,me.end)}l.runSaveSelectionLoop()}L(l.props.onFocus)&&l.props.onFocus(M)},l.onBlur=function(M){var F=l.props.beforeMaskedValueChange,U=l.maskOptions.mask;if(l.stopSaveSelectionLoop(),l.focused=!1,U&&!l.props.alwaysShowMask&&$(l.maskOptions,l.value)){var V="";L(F)&&(V=F({value:V,selection:null},{value:l.value,selection:l.previousSelection},null,l.getBeforeMaskedValueChangeConfig()).value);var Q=V!==l.getInputValue();Q&&l.setInputValue(V),Q&&L(l.props.onChange)&&l.props.onChange(M)}L(l.props.onBlur)&&l.props.onBlur(M)},l.onMouseDown=function(M){if(!l.focused&&document.addEventListener){l.mouseDownX=M.clientX,l.mouseDownY=M.clientY,l.mouseDownTime=new Date().getTime();var F=function U(V){if(document.removeEventListener("mouseup",U),l.focused){var Q=Math.abs(V.clientX-l.mouseDownX),fe=Math.abs(V.clientY-l.mouseDownY),he=Math.max(Q,fe),$e=new Date().getTime()-l.mouseDownTime;(he<=10&&$e<=200||he<=5&&$e<=300)&&l.setCursorToEnd()}};document.addEventListener("mouseup",F)}L(l.props.onMouseDown)&&l.props.onMouseDown(M)},l.onPaste=function(M){L(l.props.onPaste)&&l.props.onPaste(M),M.defaultPrevented||(l.beforePasteState={value:l.getInputValue(),selection:l.getSelection()},l.setInputValue(""))},l.handleRef=function(M){l.props.children==null&&L(l.props.inputRef)&&l.props.inputRef(M)};var P=h.mask,Y=h.maskChar,te=h.formatChars,R=h.alwaysShowMask,j=h.beforeMaskedValueChange,W=h.defaultValue,re=h.value;l.maskOptions=v(P,Y,te),W==null&&(W=""),re==null&&(re=W);var z=x(re);if(l.maskOptions.mask&&(R||z)&&(z=w(l.maskOptions,z),L(j))){var se=h.value;h.value==null&&(se=W),z=j({value:z,selection:null},{value:se=x(se),selection:null},null,l.getBeforeMaskedValueChangeConfig()).value}return l.value=z,l}o(b,p);var O=b.prototype;return O.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=H(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},O.componentDidUpdate=function(){var h=this.previousSelection,l=this.props,P=l.beforeMaskedValueChange,Y=l.alwaysShowMask,te=l.mask,R=l.maskChar,j=l.formatChars,W=this.maskOptions,re=Y||this.isFocused(),z=this.props.value!=null,se=z?x(this.props.value):this.value,M=h?h.start:null;if(this.maskOptions=v(te,R,j),this.maskOptions.mask){!W.mask&&this.isFocused()&&this.runSaveSelectionLoop();var F=this.maskOptions.mask&&this.maskOptions.mask!==W.mask;if(W.mask||z||(se=this.getInputValue()),(F||this.maskOptions.mask&&(se||re))&&(se=w(this.maskOptions,se)),F){var U=_(this.maskOptions,se);(M===null||U<M)&&(M=k(this.maskOptions,se)?U:C(this.maskOptions,U))}!this.maskOptions.mask||!$(this.maskOptions,se)||re||z&&this.props.value||(se="");var V={start:M,end:M};if(L(P)){var Q=P({value:se,selection:V},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());se=Q.value,V=Q.selection}this.value=se;var fe=this.getInputValue()!==this.value;fe?(this.setInputValue(this.value),this.forceUpdate()):F&&this.forceUpdate();var he=!1;V.start!=null&&V.end!=null&&(he=!h||h.start!==V.start||h.end!==V.end),(he||fe)&&this.setSelection(V.start,V.end)}else W.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},O.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&G(this.selectionDeferId),this.stopSaveSelectionLoop()},O.render=function(){var h,l=this.props,P=(l.mask,l.alwaysShowMask,l.maskChar,l.formatChars,l.inputRef,l.beforeMaskedValueChange,l.children),Y=i(l,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(P){L(P)||u(!1);var te=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],R=e({},Y);te.forEach(function(W){return delete R[W]}),h=P(R),te.filter(function(W){return h.props[W]!=null&&h.props[W]!==Y[W]}).length&&u(!1)}else h=r.createElement("input",e({ref:this.handleRef},Y));var j={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(Y.disabled||Y.readOnly||(j.onChange=this.onChange,j.onPaste=this.onPaste,j.onMouseDown=this.onMouseDown),Y.value!=null&&(j.value=this.value)),h=r.cloneElement(h,j)},b}(r.Component);return ot=ee,ot}var vr;function Yn(){return vr||(vr=1,at.exports=Vn()),at.exports}var zn=Yn();const Un=an(zn);var qn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Kn=["Input"],Xn=["mask","maskChar","overrides"];function mr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function it(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?mr(Object(n),!0).forEach(function(a){Qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Qn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function qe(t){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qe(t)}function Ne(){return Ne=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ne.apply(this,arguments)}function mt(t,r){if(t==null)return{};var n=Jn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Jn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}var Yr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var n=t.onChange,a=t.onFocus,e=t.onBlur,o=t.value,i=t.disabled,s=t.readOnly,c=mt(t,qn);return m.createElement(Un,Ne({onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},c),function(u){return m.createElement($n,Ne({ref:r,onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},u))})});Yr.displayName="MaskOverride";function zr(t){var r=t.mask,n=t.maskChar,a=t.overrides;a=a===void 0?{}:a;var e=a.Input,o=e===void 0?{}:e,i=mt(a,Kn),s=mt(t,Xn),c=Yr,u={},f={};typeof o=="function"?c=o:qe(o)==="object"&&(c=o.component||c,u=o.props||{},f=o.style||{}),qe(u)==="object"&&(u=it(it({},u),{},{mask:u.mask||r,maskChar:u.maskChar||n}));var d=it({Input:{component:c,props:u,style:f}},i);return m.createElement(_n,Ne({},s,{overrides:d}))}zr.defaultProps={maskChar:" "};var Bt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Ur=[0,1,2,3,4,5,6],Zn=[0,1,2,3,4,5,6,7,8,9,10,11],oe={high:"high",default:"default"},_e={startDate:"startDate",endDate:"endDate"},Gn={locked:"locked"};function br(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Pe(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?br(Object(n),!0).forEach(function(a){ea(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):br(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ea(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Ft=X("label",function(t){var r=t.$disabled,n=t.$theme,a=n.colors,e=n.typography;return Pe(Pe({},e.font250),{},{width:"100%",color:r?a.contentSecondary:a.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ft.displayName="Label";Ft.displayName="Label";var Wt=X("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Wt.displayName="LabelContainer";Wt.displayName="LabelContainer";var Nt=X("span",function(t){var r=t.$disabled,n=t.$counterError,a=t.$theme,e=a.colors,o=a.typography;return Pe(Pe({},o.font100),{},{flex:0,width:"100%",color:n?e.negative400:r?e.contentSecondary:e.contentPrimary})});Nt.displayName="LabelEndEnhancer";Nt.displayName="LabelEndEnhancer";var Vt=X("div",function(t){var r=t.$error,n=t.$positive,a=t.$theme,e=a.colors,o=a.sizing,i=a.typography,s=e.contentSecondary;return r?s=e.negative400:n&&(s=e.positive400),Pe(Pe({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:o.scale300,marginRight:0,marginBottom:o.scale300,marginLeft:0})});Vt.displayName="Caption";Vt.displayName="Caption";var Yt=X("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});Yt.displayName="ControlContainer";Yt.displayName="ControlContainer";function we(){return we=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},we.apply(this,arguments)}function Ke(t){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ke(t)}function ta(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ra(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function na(t,r,n){return r&&ra(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function aa(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&bt(t,r)}function bt(t,r){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},bt(t,r)}function oa(t){var r=la();return function(){var a=Xe(t),e;if(r){var o=Xe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ia(this,e)}}function ia(t,r){if(r&&(Ke(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sa(t)}function sa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function la(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xe(t)}function ua(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ca(t,r,n,a){return r&&typeof r!="boolean"?typeof r=="function"?r(a):r:n&&typeof n!="boolean"?typeof n=="function"?n(a):n:t?typeof t=="function"?t(a):t:null}var St=function(t){aa(n,t);var r=oa(n);function n(){return ta(this,n),r.apply(this,arguments)}return na(n,[{key:"render",value:function(){var e=this.props,o=e.overrides,i=o.Label,s=o.LabelEndEnhancer,c=o.LabelContainer,u=o.Caption,f=o.ControlContainer,d=e.label,y=e.caption,g=e.disabled,v=e.error,S=e.positive,D=e.htmlFor,$=e.children,_=e.counter,k=m.Children.only($).props,w={$disabled:!!g,$error:!!v,$positive:!!S},B=He(i)||Ft,A=He(s)||Nt,T=He(c)||Wt,E=He(u)||Vt,C=He(f)||Yt,x=ca(y,v,S,w),I=this.props.labelEndEnhancer;if(_){var H=null,L=null,q=null;Ke(_)==="object"&&(L=_.length,H=_.maxLength,q=_.error),H=H||k.maxLength,L==null&&typeof k.value=="string"&&(L=k.value.length),L==null&&(L=0),w.$length=L,H==null?I||(I="".concat(L)):(w.$maxLength=L,I||(I="".concat(L,"/").concat(H)),L>H&&q==null&&(q=!0)),q&&(w.$error=!0,w.$counterError=!0)}return m.createElement(m.Fragment,null,d&&m.createElement(T,we({},w,Ee(c)),m.createElement(B,we({"data-baseweb":"form-control-label",htmlFor:D||k.id},w,Ee(i)),typeof d=="function"?d(w):d),!!I&&m.createElement(A,we({},w,Ee(s)),typeof I=="function"?I(w):I)),m.createElement(on,null,function(ge){return m.createElement(C,we({"data-baseweb":"form-control-container"},w,Ee(f)),m.Children.map($,function(ie,G){if(ie){var ee=ie.key||String(G);return m.cloneElement(ie,{key:ee,"aria-errormessage":v?ge:null,"aria-describedby":y||S?ge:null,disabled:k.disabled||g,error:typeof k.error<"u"?k.error:w.$error,positive:typeof k.positive<"u"?k.positive:w.$positive})}}),(!!y||!!v||S)&&m.createElement(E,we({"data-baseweb":"form-control-caption",id:ge},w,Ee(u)),x))}))}}]),n}(m.Component);ua(St,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Sr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Dr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Sr(Object(n),!0).forEach(function(a){da(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function da(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var pa=function(r){return Zn.map(function(n){return{id:n.toString(),label:r(n)}})},fa=function(r,n){return r.map(function(a){return n.includes(Number(a.id))?a:Dr(Dr({},a),{},{disabled:!0})})},ha=function(r){var n=r.filterMonthsList,a=r.formatMonthLabel,e=pa(a);return n&&(e=fa(e,n)),e};function ya(t){var r=t.$range,n=r===void 0?!1:r,a=t.$disabled,e=a===void 0?!1:a,o=t.$isHighlighted,i=o===void 0?!1:o,s=t.$isHovered,c=s===void 0?!1:s,u=t.$selected,f=u===void 0?!1:u,d=t.$hasRangeSelected,y=d===void 0?!1:d,g=t.$startDate,v=g===void 0?!1:g,S=t.$endDate,D=S===void 0?!1:S,$=t.$pseudoSelected,_=$===void 0?!1:$,k=t.$hasRangeHighlighted,w=k===void 0?!1:k,B=t.$pseudoHighlighted,A=B===void 0?!1:B,T=t.$hasRangeOnRight,E=T===void 0?!1:T,C=t.$startOfMonth,x=C===void 0?!1:C,I=t.$endOfMonth,H=I===void 0?!1:I,L=t.$outsideMonth,q=L===void 0?!1:L;return"".concat(+n).concat(+e).concat(+(i||c)).concat(+f).concat(+y).concat(+v).concat(+D).concat(+_).concat(+w).concat(+A).concat(+(w&&!A&&E)).concat(+(w&&!A&&!E)).concat(+x).concat(+H).concat(+q)}function ga(t,r){return Sa(t)||ba(t,r)||ma(t,r)||va()}function va(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ma(t,r){if(t){if(typeof t=="string")return Or(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Or(t,r)}}function Or(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function ba(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Sa(t){if(Array.isArray(t))return t}function _r(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function ne(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?_r(Object(n),!0).forEach(function(a){Be(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Be(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var zt=X("div",function(t){var r=t.$separateRangeInputs;return ne({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});zt.displayName="StyledInputWrapper";zt.displayName="StyledInputWrapper";var Ut=X("div",function(t){var r=t.$theme;return ne(ne({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});Ut.displayName="StyledInputLabel";Ut.displayName="StyledInputLabel";var qt=X("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});qt.displayName="StyledStartDate";qt.displayName="StyledStartDate";var Kt=X("div",function(t){return t.$theme,{width:"100%"}});Kt.displayName="StyledEndDate";Kt.displayName="StyledEndDate";var Xt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.borders;return ne(ne({},n.font200),{},{color:a.calendarForeground,backgroundColor:a.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});Xt.displayName="StyledRoot";Xt.displayName="StyledRoot";var Qt=X("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Bt.vertical?"column":"row"}});Qt.displayName="StyledMonthContainer";Qt.displayName="StyledMonthContainer";var Jt=X("div",function(t){var r=t.$theme.sizing,n=t.$density;return{paddingTop:r.scale300,paddingBottom:n===oe.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});Jt.displayName="StyledCalendarContainer";Jt.displayName="StyledCalendarContainer";var Qe=X("div",function(t){var r=t.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Qe.displayName="StyledSelectorContainer";Qe.displayName="StyledSelectorContainer";var Zt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.borders,e=r.colors,o=r.sizing,i=t.$density;return ne(ne({},i===oe.high?n.LabelMedium:n.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:o.scale600,paddingBottom:o.scale300,paddingLeft:o.scale600,paddingRight:o.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:a.surfaceBorderRadius,borderTopRightRadius:a.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===oe.high?"calc(".concat(o.scale800," + ").concat(o.scale0,")"):o.scale950})});Zt.displayName="StyledCalendarHeader";Zt.displayName="StyledCalendarHeader";var Gt=X("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Gt.displayName="StyledMonthHeader";Gt.displayName="StyledMonthHeader";var er=X("button",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$isFocusVisible,o=t.$density;return ne(ne({},o===oe.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:a.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(a.accent):"none"}})});er.displayName="StyledMonthYearSelectButton";er.displayName="StyledMonthYearSelectButton";var tr=X("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return Be({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});tr.displayName="StyledMonthYearSelectIconContainer";tr.displayName="StyledMonthYearSelectIconContainer";function qr(t){var r=t.$theme,n=t.$disabled,a=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:a?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var rr=X("button",qr);rr.displayName="StyledPrevButton";rr.displayName="StyledPrevButton";var nr=X("button",qr);nr.displayName="StyledNextButton";nr.displayName="StyledNextButton";var ar=X("div",function(t){return{display:"inline-block"}});ar.displayName="StyledMonth";ar.displayName="StyledMonth";var or=X("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});or.displayName="StyledWeek";or.displayName="StyledWeek";function K(t,r){var n,a=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return n={},Be(n,t,r),Be(n,a,r),Be(n,e,r),n}function st(t,r){var n=r.colors,a={":before":{content:null},":after":{content:null}},e=a,o={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},s={":before":{content:null}},c=1;t&&t[c]==="1"&&(e=o);var u=Object.assign({},K("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),K("000100000000000",{color:n.calendarDayForegroundSelected}),K("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},K("000000000000001",i),K("101000000000000",s),K("101010000000000",s),K("100100000000000",{color:n.calendarDayForegroundSelected}),K("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),K("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111000000000",{color:n.calendarDayForegroundSelected}),K("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("100100001010000",{color:n.calendarDayForegroundSelected}),K("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},K("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},K("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),K("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),K("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),K("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),K("100000000000001",i),K("100000001010001",i),K("100000001001001",i),K("100010000000001",i));return u[t]||e}var ir=X("div",function(t){var r=t.$disabled,n=t.$isFocusVisible,a=t.$isHighlighted,e=t.$peekNextMonth,o=t.$pseudoSelected,i=t.$range,s=t.$selected,c=t.$outsideMonth,u=t.$outsideMonthWithinRange,f=t.$hasDateLabel,d=t.$density,y=t.$hasLockedBehavior,g=t.$selectedInput,v=t.$value,S=t.$theme,D=S.colors,$=S.typography,_=S.sizing,k=ya(t),w;f?d===oe.high?w="60px":w="70px":d===oe.high?w="40px":w="48px";var B=Array.isArray(v)?v:[v,null],A=ga(B,2),T=A[0],E=A[1],C=g===_e.startDate?E!==null&&typeof E<"u":T!==null&&typeof T<"u",x=i&&!(y&&!C);return ne(ne(ne({},d===oe.high?$.ParagraphSmall:$.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&c?"default":"pointer",color:D.calendarForeground,display:"inline-block",width:d===oe.high?"42px":"50px",height:w,lineHeight:d===oe.high?_.scale700:_.scale900,textAlign:"center",paddingTop:_.scale300,paddingBottom:_.scale300,paddingLeft:_.scale300,paddingRight:_.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},st(k,t.$theme)),{},{":after":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!c||e)?"0 0 0 3px ".concat(D.accent):"none",backgroundColor:s?D.calendarDayBackgroundSelectedHighlighted:o&&a?D.calendarDayBackgroundPseudoSelectedHighlighted:D.calendarBackground,height:f?"100%":d===oe.high?"42px":"50px",width:"100%",position:"absolute",top:f?0:"-1px",left:0,paddingTop:_.scale200,paddingBottom:_.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:D.borderSelected,borderBottomColor:D.borderSelected,borderRightColor:D.borderSelected,borderLeftColor:D.borderSelected,borderTopLeftRadius:f?_.scale800:"100%",borderTopRightRadius:f?_.scale800:"100%",borderBottomLeftRadius:f?_.scale800:"100%",borderBottomRightRadius:f?_.scale800:"100%"},st(k,t.$theme)[":after"]||{}),u?{content:null}:{})},x?{":before":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:D.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},st(k,t.$theme)[":before"]||{}),u?{backgroundColor:D.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});ir.displayName="StyledDay";ir.displayName="StyledDay";var sr=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$selected;return ne(ne({},n.ParagraphXSmall),{},{color:e?a.contentInverseTertiary:a.contentTertiary})});sr.displayName="StyledDayLabel";sr.displayName="StyledDayLabel";var lr=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.sizing,o=t.$density;return ne(ne({},n.LabelMedium),{},{color:a.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:o===oe.high?"42px":"50px",height:o===oe.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});lr.displayName="StyledWeekdayHeader";lr.displayName="StyledWeekdayHeader";function Dt(t){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Dt(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ye.apply(this,arguments)}function be(t,r){return $a(t)||_a(t,r)||Oa(t,r)||Da()}function Da(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1 +1 @@
1
- import{n as o,bm as S,i as f,r as g,R as l,j as r,C as u,c5 as m,aC as $}from"./index.Kzz4gUPJ.js";const x=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),y=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),h=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),C=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(y,{className:m({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:u(h,{children:[r(x,{}),r($,{source:e.text,allowHTML:!1}),n&&r(T,{children:C(t)})]})})}const k=g.memo(b);export{k as default};
1
+ import{n as o,bm as S,i as f,r as g,R as l,j as r,C as u,c5 as m,aC as $}from"./index.5KFYXBbC.js";const x=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),y=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),h=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),C=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(y,{className:m({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:u(h,{children:[r(x,{}),r($,{source:e.text,allowHTML:!1}),n&&r(T,{children:C(t)})]})})}const k=g.memo(b);export{k as default};
@@ -1 +1 @@
1
- import{n as l,r as o,j as f,l as v}from"./index.Kzz4gUPJ.js";const A=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),g=l("audio",{target:"ea9qfvi1"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0})),T=v.getLogger("Audio");function y({element:r,endpoints:s,elementMgr:a}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=r,E=o.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),o.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const m=s.buildMediaURL(r.url);return f(A,{children:f(g,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:m,onError:e=>{const t=e.currentTarget.src;T.error(`Client Error: Audio source error - ${t}`),s.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)}})})}const S=o.memo(y);export{S as default};
1
+ import{n as l,r as o,j as f,l as v}from"./index.5KFYXBbC.js";const A=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),g=l("audio",{target:"ea9qfvi1"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0})),T=v.getLogger("Audio");function y({element:r,endpoints:s,elementMgr:a}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=r,E=o.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),o.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const m=s.buildMediaURL(r.url);return f(A,{children:f(g,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:m,onError:e=>{const t=e.currentTarget.src;T.error(`Client Error: Audio source error - ${t}`),s.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)}})})}const S=o.memo(y);export{S as default};
@@ -1,4 +1,4 @@
1
- import{r as u,E as $,_ as H,aW as mt,bj as Ht,bk as Vt,bl as jt,M as X,O as q,R as yt,aD as Gt,n as P,bm as Xt,C as z,j as v,bn as qt,b5 as Yt,bo as Kt,bp as Jt,l as Qt,z as Zt,bq as tt,H as te,aA as ee,br as ie,bs as se,ba as ne,bt as re}from"./index.Kzz4gUPJ.js";import{u as oe,F as ae}from"./FormClearHelper.BCWMbvg-.js";import{T as le,a as ft}from"./Toolbar.zC9RMqvO.js";import{u as ce}from"./Hooks.DxswZylT.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.BcMiTwVB.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});St.displayName="Pause";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});Ct.displayName="PlayArrow";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Et.displayName="Refresh";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Rt.displayName="StopCircle";function R(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(s,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Pt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Pt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function gt(s,t,e){const i=Pt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:gt,default:gt});const me={fetchBlob:function(s,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){R(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);r(h)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-b<o)return;const A=w.clientX,T=w.clientY,k=A-h,W=T-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const I=t.getBoundingClientRect(),{left:U,top:L}=I;f||(i==null||i(h-U,m-L),f=!0),e(k,W,A-U,T-L),h=A,m=T}},S=w=>{if(f){const A=w.clientX,T=w.clientY,k=t.getBoundingClientRect(),{left:W,top:I}=k;n==null||n(A-W,T-I)}c()},y=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},D=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",D),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
1
+ import{r as u,E as $,_ as H,aW as mt,bj as Ht,bk as Vt,bl as jt,M as X,O as q,R as yt,aD as Gt,n as P,bm as Xt,C as z,j as v,bn as qt,b5 as Yt,bo as Kt,bp as Jt,l as Qt,z as Zt,bq as tt,H as te,aA as ee,br as ie,bs as se,ba as ne,bt as re}from"./index.5KFYXBbC.js";import{u as oe,F as ae}from"./FormClearHelper.BxIPIP5L.js";import{T as le,a as ft}from"./Toolbar.C-G8EZDL.js";import{u as ce}from"./Hooks.CsneG6D-.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.76_siAan.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});St.displayName="Pause";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});Ct.displayName="PlayArrow";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Et.displayName="Refresh";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Rt.displayName="StopCircle";function R(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(s,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Pt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Pt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function gt(s,t,e){const i=Pt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:gt,default:gt});const me={fetchBlob:function(s,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){R(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);r(h)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-b<o)return;const A=w.clientX,T=w.clientY,k=A-h,W=T-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const I=t.getBoundingClientRect(),{left:U,top:L}=I;f||(i==null||i(h-U,m-L),f=!0),e(k,W,A-U,T-L),h=A,m=T}},S=w=>{if(f){const A=w.clientX,T=w.clientY,k=t.getBoundingClientRect(),{left:W,top:I}=k;n==null||n(A-W,T-I)}c()},y=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},D=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",D),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;
@@ -1 +1 @@
1
- import{n as g,r as S,C as u,j as i,aC as E,l as y}from"./index.Kzz4gUPJ.js";import{w as L,u as W,E as b}from"./withFullScreenWrapper.BBFCh9IR.js";import{S as p,T as M}from"./Toolbar.zC9RMqvO.js";const O=g("div",{target:"evl31sl0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"})),T=g("div",{target:"evl31sl1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}})),F=g("div",{target:"evl31sl2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),j=y.getLogger("ImageList");var x;(function(e){e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth",e[e.MinImageOrContainer=-4]="MinImageOrContainer",e[e.MaxImageOrContainer=-5]="MaxImageOrContainer"})(x||(x={}));function A({element:e,endpoints:c,disableFullscreenMode:C}){const{expanded:o,width:f,height:s,expand:I,collapse:w}=W(b),m=f||0;let n;const r=e.width;if([-1,-3,-4].includes(r))n=void 0;else if([-2,-5].includes(r))n=m;else if(r>0)n=r;else throw Error(`Invalid image width: ${r}`);const t={};s&&o?(t.maxHeight=s,t.objectFit="contain"):(t.width=n,t.maxWidth="100%");const h=l=>{const a=l.currentTarget.src;j.error(`Client Error: Image source error - ${a}`),c.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",a)};return u(p,{width:m,height:s,useContainerWidth:o,topCentered:!0,children:[i(M,{target:p,isFullScreen:o,onExpand:I,onCollapse:w,disableFullscreenMode:C}),i(O,{className:"stImage","data-testid":"stImage",children:e.imgs.map((l,a)=>{const d=l;return u(T,{"data-testid":"stImageContainer",children:[i("img",{style:t,src:c.buildMediaURL(d.url),alt:a.toString(),onError:h}),d.caption&&i(F,{"data-testid":"stImageCaption",style:t,children:i(E,{source:d.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},a)})})]})}const G=L(A),k=S.memo(G);export{k as default};
1
+ import{n as g,r as S,C as u,j as i,aC as E,l as y}from"./index.5KFYXBbC.js";import{w as L,u as W,E as b}from"./withFullScreenWrapper.BhOSdZrO.js";import{S as p,T as M}from"./Toolbar.C-G8EZDL.js";const O=g("div",{target:"evl31sl0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"})),T=g("div",{target:"evl31sl1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}})),F=g("div",{target:"evl31sl2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),j=y.getLogger("ImageList");var x;(function(e){e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth",e[e.MinImageOrContainer=-4]="MinImageOrContainer",e[e.MaxImageOrContainer=-5]="MaxImageOrContainer"})(x||(x={}));function A({element:e,endpoints:c,disableFullscreenMode:C}){const{expanded:o,width:f,height:s,expand:I,collapse:w}=W(b),m=f||0;let n;const r=e.width;if([-1,-3,-4].includes(r))n=void 0;else if([-2,-5].includes(r))n=m;else if(r>0)n=r;else throw Error(`Invalid image width: ${r}`);const t={};s&&o?(t.maxHeight=s,t.objectFit="contain"):(t.width=n,t.maxWidth="100%");const h=l=>{const a=l.currentTarget.src;j.error(`Client Error: Image source error - ${a}`),c.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",a)};return u(p,{width:m,height:s,useContainerWidth:o,topCentered:!0,children:[i(M,{target:p,isFullScreen:o,onExpand:I,onCollapse:w,disableFullscreenMode:C}),i(O,{className:"stImage","data-testid":"stImage",children:e.imgs.map((l,a)=>{const d=l;return u(T,{"data-testid":"stImageContainer",children:[i("img",{style:t,src:c.buildMediaURL(d.url),alt:a.toString(),onError:h}),d.caption&&i(F,{"data-testid":"stImageCaption",style:t,children:i(E,{source:d.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},a)})})]})}const G=L(A),k=S.memo(G);export{k as default};
@@ -1 +1 @@
1
- import{n as l,k as s,r,j as n}from"./index.Kzz4gUPJ.js";import{P as i,R as m}from"./RenderInPortalIfExists.CJo1XNP4.js";const c=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,p=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,f=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,d=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,B=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,L=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,a=300,h=121,t=20,g=80,u=1e3,x=s("from{transform:translateY(calc(100vh + ",a,"px));}to{transform:translateY(0);}"),_=l("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:"-300px",marginLeft:`${-121/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(g-t)+t}vw`,animationDelay:`${Math.random()*u}ms`,height:`${a}px`,width:`${h}px`,pointerEvents:"none",animationDuration:"750ms",animationName:x,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),w=30,e=[c,p,f,d,B,L],A=e.length,I=({particleType:o})=>n(_,{src:e[o]}),M=({scriptRunId:o})=>n(m,{children:n(i,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:A,numParticles:w,ParticleComponent:I})}),S=r.memo(M);export{w as NUM_BALLOONS,S as default};
1
+ import{n as l,k as s,r,j as n}from"./index.5KFYXBbC.js";import{P as i,R as m}from"./RenderInPortalIfExists.BT1iglcq.js";const c=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,p=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,f=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,d=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,B=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,L=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,a=300,h=121,t=20,g=80,u=1e3,x=s("from{transform:translateY(calc(100vh + ",a,"px));}to{transform:translateY(0);}"),_=l("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:"-300px",marginLeft:`${-121/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(g-t)+t}vw`,animationDelay:`${Math.random()*u}ms`,height:`${a}px`,width:`${h}px`,pointerEvents:"none",animationDuration:"750ms",animationName:x,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),w=30,e=[c,p,f,d,B,L],A=e.length,I=({particleType:o})=>n(_,{src:e[o]}),M=({scriptRunId:o})=>n(m,{children:n(i,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:A,numParticles:w,ParticleComponent:I})}),S=r.memo(M);export{w as NUM_BALLOONS,S as default};
@@ -1 +1 @@
1
- import{n as l,b3 as C,J as b,b4 as n,r as u,b5 as s,j as a,b6 as v,b7 as B,b8 as S}from"./index.Kzz4gUPJ.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e11mkfd20"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=l(e,{target:"e11mkfd21"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e11mkfd22"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e11mkfd23"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:k}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:k,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=u.memo(T);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(S,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
1
+ import{n as l,b3 as C,J as b,b4 as n,r as u,b5 as s,j as a,b6 as v,b7 as B,b8 as S}from"./index.5KFYXBbC.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e11mkfd20"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=l(e,{target:"e11mkfd21"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e11mkfd22"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e11mkfd23"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:k}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:k,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=u.memo(T);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(S,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
@@ -1 +1 @@
1
- import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aP as r,aQ as v,aR as m,F as k,B as z}from"./index.Kzz4gUPJ.js";const R=p("button",{target:"e1rpgzpk0"})(({theme:t})=>({fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,color:t.colors.fadedText60,backgroundColor:t.colors.transparent,fontFamily:"inherit",margin:t.spacing.none,border:"none",boxShadow:"none",padding:t.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:t.spacing.twoXS}})),L=p("div",{target:"e1rpgzpk3"})(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,div:{display:"inline-flex"}}));function B(t){const a=z(t);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:t.spacing.md,width:t.sizes.toastWidth,marginTop:t.spacing.sm,borderTopLeftRadius:t.radii.default,borderTopRightRadius:t.radii.default,borderBottomLeftRadius:t.radii.default,borderBottomRightRadius:t.radii.default,paddingTop:t.spacing.lg,paddingBottom:t.spacing.lg,paddingLeft:t.spacing.twoXL,paddingRight:t.spacing.twoXL,backgroundColor:a?t.colors.gray10:t.colors.gray90,color:t.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:t.colors.fadedText40,width:t.fontSizes.lg,height:t.fontSizes.lg,marginRight:`calc(-1 * ${t.spacing.lg} / 2)`,":hover":{color:t.colors.bodyText}}}}}function E(t){if(t.length>104){let o=t.replace(/^(.{104}[^\s]*).*/,"$1");return o.length>104&&(o=o.substring(0,104).split(" ").slice(0,-1).join(" ")),o.trim()}return t}function D({body:t,icon:a}){const o=T(),n=E(t),d=t!==n,[e,y]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{y(!e)},[e]),c=s.useMemo(()=>B(o),[o]),l=s.useMemo(()=>x(C,{expanded:e,children:[a&&i(w,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(L,{children:[i(h,{source:e?t:n,allowHTML:!1,isToast:!0}),d&&i(R,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,t,a,n,f]);s.useEffect(()=>{if(o.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=i(m,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(k,{children:o.inSidebar&&S})}const I=s.memo(D);export{I as default};
1
+ import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aP as r,aQ as v,aR as m,F as k,B as z}from"./index.5KFYXBbC.js";const R=p("button",{target:"e1rpgzpk0"})(({theme:t})=>({fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,color:t.colors.fadedText60,backgroundColor:t.colors.transparent,fontFamily:"inherit",margin:t.spacing.none,border:"none",boxShadow:"none",padding:t.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:t.spacing.twoXS}})),L=p("div",{target:"e1rpgzpk3"})(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,div:{display:"inline-flex"}}));function B(t){const a=z(t);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:t.spacing.md,width:t.sizes.toastWidth,marginTop:t.spacing.sm,borderTopLeftRadius:t.radii.default,borderTopRightRadius:t.radii.default,borderBottomLeftRadius:t.radii.default,borderBottomRightRadius:t.radii.default,paddingTop:t.spacing.lg,paddingBottom:t.spacing.lg,paddingLeft:t.spacing.twoXL,paddingRight:t.spacing.twoXL,backgroundColor:a?t.colors.gray10:t.colors.gray90,color:t.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:t.colors.fadedText40,width:t.fontSizes.lg,height:t.fontSizes.lg,marginRight:`calc(-1 * ${t.spacing.lg} / 2)`,":hover":{color:t.colors.bodyText}}}}}function E(t){if(t.length>104){let o=t.replace(/^(.{104}[^\s]*).*/,"$1");return o.length>104&&(o=o.substring(0,104).split(" ").slice(0,-1).join(" ")),o.trim()}return t}function D({body:t,icon:a}){const o=T(),n=E(t),d=t!==n,[e,y]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{y(!e)},[e]),c=s.useMemo(()=>B(o),[o]),l=s.useMemo(()=>x(C,{expanded:e,children:[a&&i(w,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(L,{children:[i(h,{source:e?t:n,allowHTML:!1,isToast:!0}),d&&i(R,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,t,a,n,f]);s.useEffect(()=>{if(o.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=i(m,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(k,{children:o.inSidebar&&S})}const I=s.memo(D);export{I as default};
@@ -1,4 +1,4 @@
1
- import{n as s,k as i,r as m,j as e}from"./index.Kzz4gUPJ.js";import{P as c,R as l}from"./RenderInPortalIfExists.CJo1XNP4.js";const p=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,d=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,f=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,S=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>i(`from{transform:translateY(0)
1
+ import{n as s,k as i,r as m,j as e}from"./index.5KFYXBbC.js";import{P as c,R as l}from"./RenderInPortalIfExists.BT1iglcq.js";const p=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,d=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,f=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,S=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>i(`from{transform:translateY(0)
2
2
  rotateX(`,n(360),`deg)
3
3
  rotateY(`,n(360),`deg)
4
4
  rotateZ(`,n(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
@@ -1 +1 @@
1
- import{r as a,E as W,_ as A,n as g,B as ft,z as P,j as n,ba as Z,bu as mt,C as F,bp as tt,b5 as et,bo as T,a$ as yt,bG as Ct,bj as vt,bH as I,bs as It,F as ot,bh as bt,bI as xt,M,bl as wt,bk as St}from"./index.Kzz4gUPJ.js";import{g as Ft,F as N,C as zt,I as Et,E as Ut,a as Tt,s as Ht,u as Bt,b as Rt}from"./FileHelper.DihUx7xB.js";import{I as Dt}from"./InputInstructions.C3IYQW66.js";import{i as Lt}from"./inputUtils.CQWz5UKz.js";import{a as Q}from"./index.t--hEgTQ.js";import{U as nt}from"./UploadFileInfo.C-jY39rj.js";import{T as Mt}from"./textarea.DrttbSkr.js";import"./base-input.BYAE3JfB.js";var at=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.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"}))});at.displayName="AttachFile";var rt=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.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"}))});rt.displayName="ErrorOutline";var it=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.createElement("rect",{width:24,height:24,fill:"none"}),a.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"}))});it.displayName="Send";const $t=g("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=g("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Vt=g("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:r})=>{const p=ft(t),[f,u]=p?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:r?"0":t.radii.chatInput,borderTopLeftRadius:r?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?f:u,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:p?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,cursor:"not-allowed"}}}),Nt=g("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Wt=g("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),At=g("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Pt=g("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Kt=g("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Ot=g("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),_t=g("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Xt=g("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Gt=g("div",{target:"e15560op6"})({display:"flex"}),jt=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),Yt=g("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),qt=g("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Jt=g("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Qt=g("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Zt=g("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function te({children:t,content:e}){const r=P();return n(mt,{content:e,placement:Z.TOP,overrides:{Body:{style:{top:`-${r.sizes.minElementHeight}`}}},children:t})}const ee=({fileInfo:t})=>{const e=P(),{type:r}=t.status;switch(r){case"uploading":return n(Ct,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(te,{content:t.status.errorMessage,children:n(T,{color:e.colors.red,content:rt,size:"lg"})});case"uploaded":return n(T,{content:Et,size:"lg"});default:return yt(r),null}},oe=({fileInfo:t,onDelete:e})=>F(Yt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(qt,{children:n(ee,{fileInfo:t})}),n(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Qt,{children:Ft(t.size,N.Byte)}),n(Zt,{"data-testid":"stChatInputDeleteBtn",children:n(tt,{onClick:()=>e(t.id),kind:et.MINIMAL,children:n(T,{content:zt,size:"lg"})})})]}),ne=a.memo(oe),ae=({items:t,onDelete:e})=>n(Xt,{"data-testid":"stChatUploadedFiles",children:n(Gt,{children:t.map(r=>n(jt,{children:n(ne,{fileInfo:r,onDelete:e})},r.id))})}),re=a.memo(ae),ie=({getNextLocalFileId:t,addFiles:e,updateFile:r,uploadClient:p,element:f,onUploadProgress:u,onUploadComplete:C})=>(b,d)=>{const m=Q.CancelToken.source(),c=new nt(d.name,d.size,t(),{type:"uploading",cancelToken:m,progress:1});e([c]),p.uploadFile({formId:"",...f},b.uploadUrl,d,h=>u(h,c.id),m.token).then(()=>C(c.id,b)).catch(h=>{Q.isCancel(h)||r(c.id,c.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},se=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:r,uploadFile:p,addFiles:f,getNextLocalFileId:u,deleteExistingFiles:C,onUploadComplete:b})=>(d,m)=>{if(!t&&d.length===0&&m.length>1){const c=m.findIndex(h=>{var x;return((x=h.errors)==null?void 0:x[0].code)===Ut.TooManyFiles});c>=0&&(d.push(m[c].file),m.splice(c,1))}if(!t&&d.length>0&&C(),r.fetchFileURLs(d).then(c=>{vt(c,d).forEach(([h,x])=>{p(h,x)})}).catch(c=>{f(d.map(h=>new nt(h.name,h.size,u(),{type:"error",errorMessage:c})))}),m.length>0){const c=m.map(h=>Tt(h,u(),e));f(c)}b()},le=({getRootProps:t,getInputProps:e,acceptFile:r,disabled:p,theme:f})=>F(Kt,{disabled:p,children:[F(Ot,{"data-testid":"stChatInputFileUploadButton",disabled:p,...t(),children:[n("input",{...e()}),n(It,{content:`Upload or drag and drop ${r===I.Multiple?"files":"a file"}`,placement:Z.TOP,onMouseEnterDelay:500,children:n(tt,{kind:et.MINIMAL,disabled:p,children:n(T,{content:at,size:"lg",color:p?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(_t,{})]}),de=a.memo(le),ce=({getRootProps:t,getInputProps:e,acceptFile:r,inputHeight:p})=>F(ot,{children:[n(At,{height:p,...t(),children:n("input",{...e()})}),n(Pt,{height:p,children:`Drag and drop ${r===I.Multiple?"files":"a file"} here`})]}),pe=a.memo(ce),ue=6.5,$=1,k=(t,e,r)=>r.map(p=>p.id===t?e:p),V=(t,e)=>e.find(r=>r.id===t);function ge({disabled:t,element:e,widgetMgr:r,fragmentId:p,uploadClient:f}){const u=P(),{placeholder:C,maxChars:b}=e,d=a.useRef(null),m=a.useRef(0),c=a.useRef({minHeight:0,maxHeight:0}),[h,x]=bt(),[z,B]=a.useState(e.default),[E,R]=a.useState(0),[H,st]=a.useState(!1),[w,S]=a.useState([]),[U,D]=a.useState(!1),L=a.useMemo(()=>w.some(o=>o.status.type==="uploading")?!1:z!==""||w.length>0,[w,z]),v=xt(e.acceptFile),K=Ht(e.maxUploadSizeMb,N.Megabyte,N.Byte),O=a.useCallback(o=>S(i=>[...i,...o]),[]),_=a.useCallback(o=>{S(i=>{const l=V(o,i);return M(l)?i:(l.status.type==="uploading"&&l.status.cancelToken.cancel(),l.status.type==="uploaded"&&l.status.fileUrls.deleteUrl&&f.deleteFile(l.status.fileUrls.deleteUrl),i.filter(s=>s.id!==o))})},[f]),lt=()=>{const o=w.filter(i=>i.status.type==="uploaded").map(i=>{const{name:l,size:s,status:y}=i,{fileId:gt,fileUrls:ht}=y;return new wt({fileId:gt,fileUrls:ht,name:l,size:s})});return new St({uploadedFileInfo:o})},X=()=>m.current++,dt=se({acceptMultipleFiles:v===I.Multiple,maxFileSize:K,uploadClient:f,uploadFile:ie({getNextLocalFileId:X,addFiles:O,updateFile:(o,i)=>{S(l=>k(o,i,l))},uploadClient:f,element:e,onUploadProgress:(o,i)=>{S(l=>{const s=V(i,l);if(M(s)||s.status.type!=="uploading")return l;const y=Math.round(o.loaded*100/o.total);return s.status.progress===y?l:k(i,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:y}),l)})},onUploadComplete:(o,i)=>{S(l=>{const s=V(o,l);return M(s)||s.status.type!=="uploading"?l:k(s.id,s.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),l)})}}),addFiles:O,getNextLocalFileId:X,deleteExistingFiles:()=>w.forEach(o=>_(o.id)),onUploadComplete:()=>{d.current&&d.current.focus()}}),{getRootProps:G,getInputProps:j}=Bt({onDrop:dt,multiple:v===I.Multiple,accept:Rt(e.fileType),maxSize:K}),Y=()=>{let o=0;const{current:i}=d;return i&&(i.style.height="auto",o=i.scrollHeight,i.style.height=""),o},q=()=>{if(d.current&&d.current.focus(),!L||t)return;const o={data:z,fileUploaderState:lt()};r.setChatInputValue(e,o,{fromUi:!0},p),S([]),B(""),R(0)},ct=o=>{const{metaKey:i,ctrlKey:l,shiftKey:s}=o;Lt(o)&&!s&&!l&&!i&&(o.preventDefault(),q())},pt=o=>{const{value:i}=o.target,{maxChars:l}=e;l!==0&&i.length>l||(B(i),R(Y()))};a.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";B(o)}},[e]),a.useLayoutEffect(()=>{if(d.current){const{offsetHeight:o}=d.current;c.current.minHeight=o,c.current.maxHeight=o*ue}},[d]),a.useEffect(()=>{const o=s=>{var y;s.preventDefault(),s.stopPropagation(),!U&&((y=s.dataTransfer)!=null&&y.types.includes("Files"))&&D(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),U&&(s.clientX<=0&&s.clientY<=0||s.clientX>=window.innerWidth&&s.clientY>=window.innerHeight)&&D(!1)},l=s=>{s.preventDefault(),s.stopPropagation(),U&&D(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",l),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",l),window.removeEventListener("dragleave",i)}},[U]),a.useLayoutEffect(()=>{const{minHeight:o}=c.current;st(E>0&&d.current?Math.abs(E-o)>$:!1)},[E]),a.useLayoutEffect(()=>{R(Y())},[C]);const{maxHeight:J}=c.current,ut=v!==I.None&&U;return F(ot,{children:[v===I.None?null:n(re,{items:[...w],onDelete:_}),n($t,{className:"stChatInput","data-testid":"stChatInput",ref:x,children:ut?n(pe,{getRootProps:G,getInputProps:j,acceptFile:v,inputHeight:H?`${E+$}px`:u.sizes.minElementHeight}):F(kt,{extended:H,children:[v===I.None?null:n(de,{getRootProps:G,getInputProps:j,acceptFile:v,disabled:t,theme:u}),n(Mt,{inputRef:d,value:z,placeholder:C,onChange:pt,onKeyDown:ct,"aria-label":C,disabled:t,rows:1,overrides:{Root:{style:{minHeight:u.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:u.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${E+$}px`:"auto",maxHeight:J?`${J}px`:"none",paddingLeft:u.spacing.none,paddingBottom:u.spacing.sm,paddingTop:u.spacing.sm,paddingRight:`calc(${u.iconSizes.xl} + 2 * ${u.spacing.sm} + ${u.spacing.sm})`}}}}),h>u.breakpoints.hideWidgetDetails&&n(Wt,{children:n(Dt,{dirty:L,value:z,maxLength:b,type:"chat",inForm:!1})}),n(Nt,{children:n(Vt,{onClick:q,disabled:!L||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(T,{content:it,size:"xl",color:"inherit"})})})]})})]})}const xe=a.memo(ge);export{xe as default};
1
+ import{r as a,E as W,_ as A,n as g,B as ft,z as P,j as n,ba as Z,bu as mt,C as F,bp as tt,b5 as et,bo as T,a$ as yt,bG as Ct,bj as vt,bH as I,bs as It,F as ot,bh as bt,bI as xt,M,bl as wt,bk as St}from"./index.5KFYXBbC.js";import{g as Ft,F as N,C as zt,I as Et,E as Ut,a as Tt,s as Ht,u as Bt,b as Rt}from"./FileHelper.C-t60d9I.js";import{I as Dt}from"./InputInstructions.CzJqQPUo.js";import{i as Lt}from"./inputUtils.CQWz5UKz.js";import{a as Q}from"./index.t--hEgTQ.js";import{U as nt}from"./UploadFileInfo.C-jY39rj.js";import{T as Mt}from"./textarea.BRz2PqBl.js";import"./base-input.BE23gnVe.js";var at=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.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"}))});at.displayName="AttachFile";var rt=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.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"}))});rt.displayName="ErrorOutline";var it=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(W,A({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),a.createElement("rect",{width:24,height:24,fill:"none"}),a.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"}))});it.displayName="Send";const $t=g("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=g("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Vt=g("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:r})=>{const p=ft(t),[f,u]=p?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:r?"0":t.radii.chatInput,borderTopLeftRadius:r?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?f:u,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:p?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,cursor:"not-allowed"}}}),Nt=g("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Wt=g("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),At=g("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Pt=g("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Kt=g("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Ot=g("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),_t=g("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Xt=g("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Gt=g("div",{target:"e15560op6"})({display:"flex"}),jt=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),Yt=g("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),qt=g("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Jt=g("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Qt=g("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Zt=g("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function te({children:t,content:e}){const r=P();return n(mt,{content:e,placement:Z.TOP,overrides:{Body:{style:{top:`-${r.sizes.minElementHeight}`}}},children:t})}const ee=({fileInfo:t})=>{const e=P(),{type:r}=t.status;switch(r){case"uploading":return n(Ct,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(te,{content:t.status.errorMessage,children:n(T,{color:e.colors.red,content:rt,size:"lg"})});case"uploaded":return n(T,{content:Et,size:"lg"});default:return yt(r),null}},oe=({fileInfo:t,onDelete:e})=>F(Yt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(qt,{children:n(ee,{fileInfo:t})}),n(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Qt,{children:Ft(t.size,N.Byte)}),n(Zt,{"data-testid":"stChatInputDeleteBtn",children:n(tt,{onClick:()=>e(t.id),kind:et.MINIMAL,children:n(T,{content:zt,size:"lg"})})})]}),ne=a.memo(oe),ae=({items:t,onDelete:e})=>n(Xt,{"data-testid":"stChatUploadedFiles",children:n(Gt,{children:t.map(r=>n(jt,{children:n(ne,{fileInfo:r,onDelete:e})},r.id))})}),re=a.memo(ae),ie=({getNextLocalFileId:t,addFiles:e,updateFile:r,uploadClient:p,element:f,onUploadProgress:u,onUploadComplete:C})=>(b,d)=>{const m=Q.CancelToken.source(),c=new nt(d.name,d.size,t(),{type:"uploading",cancelToken:m,progress:1});e([c]),p.uploadFile({formId:"",...f},b.uploadUrl,d,h=>u(h,c.id),m.token).then(()=>C(c.id,b)).catch(h=>{Q.isCancel(h)||r(c.id,c.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},se=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:r,uploadFile:p,addFiles:f,getNextLocalFileId:u,deleteExistingFiles:C,onUploadComplete:b})=>(d,m)=>{if(!t&&d.length===0&&m.length>1){const c=m.findIndex(h=>{var x;return((x=h.errors)==null?void 0:x[0].code)===Ut.TooManyFiles});c>=0&&(d.push(m[c].file),m.splice(c,1))}if(!t&&d.length>0&&C(),r.fetchFileURLs(d).then(c=>{vt(c,d).forEach(([h,x])=>{p(h,x)})}).catch(c=>{f(d.map(h=>new nt(h.name,h.size,u(),{type:"error",errorMessage:c})))}),m.length>0){const c=m.map(h=>Tt(h,u(),e));f(c)}b()},le=({getRootProps:t,getInputProps:e,acceptFile:r,disabled:p,theme:f})=>F(Kt,{disabled:p,children:[F(Ot,{"data-testid":"stChatInputFileUploadButton",disabled:p,...t(),children:[n("input",{...e()}),n(It,{content:`Upload or drag and drop ${r===I.Multiple?"files":"a file"}`,placement:Z.TOP,onMouseEnterDelay:500,children:n(tt,{kind:et.MINIMAL,disabled:p,children:n(T,{content:at,size:"lg",color:p?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(_t,{})]}),de=a.memo(le),ce=({getRootProps:t,getInputProps:e,acceptFile:r,inputHeight:p})=>F(ot,{children:[n(At,{height:p,...t(),children:n("input",{...e()})}),n(Pt,{height:p,children:`Drag and drop ${r===I.Multiple?"files":"a file"} here`})]}),pe=a.memo(ce),ue=6.5,$=1,k=(t,e,r)=>r.map(p=>p.id===t?e:p),V=(t,e)=>e.find(r=>r.id===t);function ge({disabled:t,element:e,widgetMgr:r,fragmentId:p,uploadClient:f}){const u=P(),{placeholder:C,maxChars:b}=e,d=a.useRef(null),m=a.useRef(0),c=a.useRef({minHeight:0,maxHeight:0}),[h,x]=bt(),[z,B]=a.useState(e.default),[E,R]=a.useState(0),[H,st]=a.useState(!1),[w,S]=a.useState([]),[U,D]=a.useState(!1),L=a.useMemo(()=>w.some(o=>o.status.type==="uploading")?!1:z!==""||w.length>0,[w,z]),v=xt(e.acceptFile),K=Ht(e.maxUploadSizeMb,N.Megabyte,N.Byte),O=a.useCallback(o=>S(i=>[...i,...o]),[]),_=a.useCallback(o=>{S(i=>{const l=V(o,i);return M(l)?i:(l.status.type==="uploading"&&l.status.cancelToken.cancel(),l.status.type==="uploaded"&&l.status.fileUrls.deleteUrl&&f.deleteFile(l.status.fileUrls.deleteUrl),i.filter(s=>s.id!==o))})},[f]),lt=()=>{const o=w.filter(i=>i.status.type==="uploaded").map(i=>{const{name:l,size:s,status:y}=i,{fileId:gt,fileUrls:ht}=y;return new wt({fileId:gt,fileUrls:ht,name:l,size:s})});return new St({uploadedFileInfo:o})},X=()=>m.current++,dt=se({acceptMultipleFiles:v===I.Multiple,maxFileSize:K,uploadClient:f,uploadFile:ie({getNextLocalFileId:X,addFiles:O,updateFile:(o,i)=>{S(l=>k(o,i,l))},uploadClient:f,element:e,onUploadProgress:(o,i)=>{S(l=>{const s=V(i,l);if(M(s)||s.status.type!=="uploading")return l;const y=Math.round(o.loaded*100/o.total);return s.status.progress===y?l:k(i,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:y}),l)})},onUploadComplete:(o,i)=>{S(l=>{const s=V(o,l);return M(s)||s.status.type!=="uploading"?l:k(s.id,s.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),l)})}}),addFiles:O,getNextLocalFileId:X,deleteExistingFiles:()=>w.forEach(o=>_(o.id)),onUploadComplete:()=>{d.current&&d.current.focus()}}),{getRootProps:G,getInputProps:j}=Bt({onDrop:dt,multiple:v===I.Multiple,accept:Rt(e.fileType),maxSize:K}),Y=()=>{let o=0;const{current:i}=d;return i&&(i.style.height="auto",o=i.scrollHeight,i.style.height=""),o},q=()=>{if(d.current&&d.current.focus(),!L||t)return;const o={data:z,fileUploaderState:lt()};r.setChatInputValue(e,o,{fromUi:!0},p),S([]),B(""),R(0)},ct=o=>{const{metaKey:i,ctrlKey:l,shiftKey:s}=o;Lt(o)&&!s&&!l&&!i&&(o.preventDefault(),q())},pt=o=>{const{value:i}=o.target,{maxChars:l}=e;l!==0&&i.length>l||(B(i),R(Y()))};a.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";B(o)}},[e]),a.useLayoutEffect(()=>{if(d.current){const{offsetHeight:o}=d.current;c.current.minHeight=o,c.current.maxHeight=o*ue}},[d]),a.useEffect(()=>{const o=s=>{var y;s.preventDefault(),s.stopPropagation(),!U&&((y=s.dataTransfer)!=null&&y.types.includes("Files"))&&D(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),U&&(s.clientX<=0&&s.clientY<=0||s.clientX>=window.innerWidth&&s.clientY>=window.innerHeight)&&D(!1)},l=s=>{s.preventDefault(),s.stopPropagation(),U&&D(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",l),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",l),window.removeEventListener("dragleave",i)}},[U]),a.useLayoutEffect(()=>{const{minHeight:o}=c.current;st(E>0&&d.current?Math.abs(E-o)>$:!1)},[E]),a.useLayoutEffect(()=>{R(Y())},[C]);const{maxHeight:J}=c.current,ut=v!==I.None&&U;return F(ot,{children:[v===I.None?null:n(re,{items:[...w],onDelete:_}),n($t,{className:"stChatInput","data-testid":"stChatInput",ref:x,children:ut?n(pe,{getRootProps:G,getInputProps:j,acceptFile:v,inputHeight:H?`${E+$}px`:u.sizes.minElementHeight}):F(kt,{extended:H,children:[v===I.None?null:n(de,{getRootProps:G,getInputProps:j,acceptFile:v,disabled:t,theme:u}),n(Mt,{inputRef:d,value:z,placeholder:C,onChange:pt,onKeyDown:ct,"aria-label":C,disabled:t,rows:1,overrides:{Root:{style:{minHeight:u.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:u.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${E+$}px`:"auto",maxHeight:J?`${J}px`:"none",paddingLeft:u.spacing.none,paddingBottom:u.spacing.sm,paddingTop:u.spacing.sm,paddingRight:`calc(${u.iconSizes.xl} + 2 * ${u.spacing.sm} + ${u.spacing.sm})`}}}}),h>u.breakpoints.hideWidgetDetails&&n(Wt,{children:n(Dt,{dirty:L,value:z,maxLength:b,type:"chat",inForm:!1})}),n(Nt,{children:n(Vt,{onClick:q,disabled:!L||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(T,{content:it,size:"xl",color:"inherit"})})})]})})]})}const xe=a.memo(ge);export{xe as default};
@@ -1 +1 @@
1
- import{r as l,b5 as a,j as e,b6 as d,bp as u,b4 as c,b7 as B,b8 as b}from"./index.Kzz4gUPJ.js";function m(i){const{disabled:o,element:t,widgetMgr:s,fragmentId:r}=i;let n=a.SECONDARY;return t.type==="primary"?n=a.PRIMARY:t.type==="tertiary"&&(n=a.TERTIARY),e(b,{className:"stButton","data-testid":"stButton",children:e(d,{help:t.help,containerWidth:t.useContainerWidth,children:e(u,{kind:n,size:c.SMALL,disabled:o,containerWidth:t.useContainerWidth,onClick:()=>s.setTriggerValue(t,{fromUi:!0},r),children:e(B,{icon:t.icon,label:t.label})})})})}const h=l.memo(m);export{h as default};
1
+ import{r as l,b5 as a,j as e,b6 as d,bp as u,b4 as c,b7 as B,b8 as b}from"./index.5KFYXBbC.js";function m(i){const{disabled:o,element:t,widgetMgr:s,fragmentId:r}=i;let n=a.SECONDARY;return t.type==="primary"?n=a.PRIMARY:t.type==="tertiary"&&(n=a.TERTIARY),e(b,{className:"stButton","data-testid":"stButton",children:e(d,{help:t.help,containerWidth:t.useContainerWidth,children:e(u,{kind:n,size:c.SMALL,disabled:o,containerWidth:t.useContainerWidth,onClick:()=>s.setTriggerValue(t,{fromUi:!0},r),children:e(B,{icon:t.icon,label:t.label})})})})}const h=l.memo(m);export{h as default};
@@ -1 +1 @@
1
- import{n as T,r,z as M,c1 as W,c2 as C,C as I,j as l,br as V,bF as O,bs as L,ba as N,bt as P,c0 as k,c3 as E,bY as $,c4 as A,bC as B}from"./index.Kzz4gUPJ.js";import{a as F}from"./useBasicWidgetState.BDsVFj3k.js";import"./FormClearHelper.BCWMbvg-.js";const H=T("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getStringArrayValue(t),U=s=>s.default.map(t=>s.options[t])??null,j=s=>s.rawValues??null,G=(s,t,n,p)=>{t.setStringArrayValue(s,n.value,{fromUi:n.fromUi},p)},K=s=>{var S;const{element:t,widgetMgr:n,fragmentId:p}=s,e=M(),[i,m]=F({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:n,fragmentId:p}),h=t.maxSelections>0&&i.length>=t.maxSelections,f=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]),y=r.useMemo(()=>i.map(o=>({value:o,label:o})),[i]),b=r.useCallback(o=>{var c,d;switch(o.type){case"remove":return W(i,(c=o.option)==null?void 0:c.value);case"clear":return[];case"select":return i.concat([(d=o.option)==null?void 0:d.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[i]),v=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&i.length>=t.maxSelections||m({value:b(o),fromUi:!0})},[t.maxSelections,b,m,i.length]),x=r.useCallback((o,c)=>{if(h)return[];const d=o.filter(R=>!i.includes(R.value));return C(d,c)},[h,i]),{options:u}=t;let a=s.disabled,g=t.placeholder;u.length===0&&(t.acceptNewOptions?g="Add options":(g="No options to select",a=!0));const z=u.map(o=>({label:o,value:o})),w=u.length>10;return I("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[l(P,{label:t.label,disabled:a,labelVisibility:V((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(O,{children:l(L,{content:t.help,placement:N.TOP_RIGHT})})}),l(H,{children:l(k,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:g,type:A.select,multi:!0,onChange:v,value:y,disabled:a,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{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:a?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({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:{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:B.isMobile&&w===!1?"readonly":null}},Dropdown:{component:E}}})})]})},q=r.memo(K);export{q as default};
1
+ import{n as T,r,z as M,c1 as W,c2 as C,C as I,j as l,br as V,bF as O,bs as L,ba as N,bt as P,c0 as k,c3 as E,bY as $,c4 as A,bC as B}from"./index.5KFYXBbC.js";import{a as F}from"./useBasicWidgetState.QU3v4y2-.js";import"./FormClearHelper.BxIPIP5L.js";const H=T("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getStringArrayValue(t),U=s=>s.default.map(t=>s.options[t])??null,j=s=>s.rawValues??null,G=(s,t,n,p)=>{t.setStringArrayValue(s,n.value,{fromUi:n.fromUi},p)},K=s=>{var S;const{element:t,widgetMgr:n,fragmentId:p}=s,e=M(),[i,m]=F({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:n,fragmentId:p}),h=t.maxSelections>0&&i.length>=t.maxSelections,f=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]),y=r.useMemo(()=>i.map(o=>({value:o,label:o})),[i]),b=r.useCallback(o=>{var c,d;switch(o.type){case"remove":return W(i,(c=o.option)==null?void 0:c.value);case"clear":return[];case"select":return i.concat([(d=o.option)==null?void 0:d.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[i]),v=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&i.length>=t.maxSelections||m({value:b(o),fromUi:!0})},[t.maxSelections,b,m,i.length]),x=r.useCallback((o,c)=>{if(h)return[];const d=o.filter(R=>!i.includes(R.value));return C(d,c)},[h,i]),{options:u}=t;let a=s.disabled,g=t.placeholder;u.length===0&&(t.acceptNewOptions?g="Add options":(g="No options to select",a=!0));const z=u.map(o=>({label:o,value:o})),w=u.length>10;return I("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[l(P,{label:t.label,disabled:a,labelVisibility:V((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(O,{children:l(L,{content:t.help,placement:N.TOP_RIGHT})})}),l(H,{children:l(k,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:g,type:A.select,multi:!0,onChange:v,value:y,disabled:a,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{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:a?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({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:{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:B.isMobile&&w===!1?"readonly":null}},Dropdown:{component:E}}})})]})},q=r.memo(K);export{q as default};