streamlit-nightly 1.52.3.dev20251228__py3-none-any.whl → 1.52.3.dev20251231__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +304 -303
- streamlit/static/static/js/{ErrorOutline.esm.DcfXgWUn.js → ErrorOutline.esm.bKqSjdNS.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.mv0ER-NN.js → FileDownload.esm.DYcl0HsS.js} +1 -1
- streamlit/static/static/js/{FileHelper.DrrhFRar.js → FileHelper.BG4elCiu.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DyKNX1aO.js → FormClearHelper.CcrsaZUN.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DNVNePDU.js → InputInstructions.B-hrhnKS.js} +1 -1
- streamlit/static/static/js/{Particles.DfQRmRqL.js → Particles.C1lQDBme.js} +1 -1
- streamlit/static/static/js/{ProgressBar.D7gjwuV4.js → ProgressBar.D54tj-jr.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.C4EfgCCA.js → StreamlitSyntaxHighlighter.D6tqIUNe.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.BRwgdYlO.js → TableChart.esm.BsEqAKaW.js} +1 -1
- streamlit/static/static/js/{Toolbar.BwjOKIoX.js → Toolbar.COFccaTT.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.B31eEkR7.js → WidgetLabelHelpIconInline.tetiwgyt.js} +1 -1
- streamlit/static/static/js/{base-input.DfcQke7n.js → base-input.bCQ8S-FY.js} +1 -1
- streamlit/static/static/js/{checkbox.D1dO0sd2.js → checkbox.SvhUmEPl.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.COnF97s_.js → createDownloadLinkElement.mdzy2wqu.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.sTgLsMeV.js → data-grid-overlay-editor.BRpG6UuQ.js} +1 -1
- streamlit/static/static/js/{downloader.DICSpWsQ.js → downloader.BFho_Alx.js} +1 -1
- streamlit/static/static/js/{embed.CdnV1dx9.js → embed.CjSf3HQ8.js} +1 -1
- streamlit/static/static/js/{es6.deJoFr5d.js → es6.DnRofDlD.js} +2 -2
- streamlit/static/static/js/{formatNumber.DK7aeI7k.js → formatNumber.CtWVEKkt.js} +1 -1
- streamlit/static/static/js/{iconPosition.D8Yv5FiE.js → iconPosition.Docx9KVT.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.BU-dAwT1.js → iframeResizer.contentWindow.DPJjr14X.js} +1 -1
- streamlit/static/static/js/{index.mVwG03J8.js → index.-Uw_gjRk.js} +1 -1
- streamlit/static/static/js/{index.pF_JNVHJ.js → index.2hZ1_TTv.js} +1 -1
- streamlit/static/static/js/{index.Ml__cfHd.js → index.3BdSdx9Q.js} +1 -1
- streamlit/static/static/js/{index.B5uiXC5d.js → index.8C-cS-O4.js} +1 -1
- streamlit/static/static/js/{index.BSpyyZms.js → index.8I6SAQDm.js} +1 -1
- streamlit/static/static/js/{index.Bwox_wj7.js → index.B-2OnxuC.js} +1 -1
- streamlit/static/static/js/{index.Bnp4oXTj.js → index.B-k1aQD6.js} +1 -1
- streamlit/static/static/js/{index.AowxKR47.js → index.B4jgy50K.js} +1 -1
- streamlit/static/static/js/{index.CHxfXEQs.js → index.BE-_bdmf.js} +1 -1
- streamlit/static/static/js/{index.DJxfjWh8.js → index.BPDinT9W.js} +1 -1
- streamlit/static/static/js/{index.BO68LeZH.js → index.BWYs56td.js} +1 -1
- streamlit/static/static/js/{index.SS0fb-z0.js → index.BWwP9fh8.js} +1 -1
- streamlit/static/static/js/{index.DQQMDt36.js → index.BZFLbiyp.js} +1 -1
- streamlit/static/static/js/{index.8qTg2RM9.js → index.BakUx9hH.js} +1 -1
- streamlit/static/static/js/{index.CxeI_OXa.js → index.Bd9Ju7cE.js} +1 -1
- streamlit/static/static/js/{index.C93OpKAy.js → index.BkQCUqLQ.js} +1 -1
- streamlit/static/static/js/{index.CsrQPO4k.js → index.Bt-J_LLo.js} +1 -1
- streamlit/static/static/js/{index.DYHH1mfr.js → index.BukrvZZ2.js} +1 -1
- streamlit/static/static/js/index.C3MpZoqE.js +1 -0
- streamlit/static/static/js/{index.Dj7zOkQg.js → index.C40Nq5m8.js} +1 -1
- streamlit/static/static/js/{index.IavvuC7m.js → index.C8fg6FO8.js} +1 -1
- streamlit/static/static/js/{index.BAmLrdtI.js → index.CFRlw_Q4.js} +1 -1
- streamlit/static/static/js/{index.Dhp14dRq.js → index.CNXi20U2.js} +1 -1
- streamlit/static/static/js/{index.D14DFzgI.js → index.CTdvJfB7.js} +1 -1
- streamlit/static/static/js/{index.DryfJqoc.js → index.CggOKbv5.js} +1 -1
- streamlit/static/static/js/{index.DaMZ1GDB.js → index.CoOQHuCm.js} +1 -1
- streamlit/static/static/js/{index.DWULc3YI.js → index.CqMzbjp5.js} +1 -1
- streamlit/static/static/js/{index.MwqhcWcl.js → index.D3xfIqy_.js} +1 -1
- streamlit/static/static/js/{index.DgfqdWkR.js → index.D5m5f2G-.js} +1 -1
- streamlit/static/static/js/{index.mykhZq0V.js → index.D67NXgZL.js} +1 -1
- streamlit/static/static/js/{index.ZSnCX0Ea.js → index.D9DEa36h.js} +1 -1
- streamlit/static/static/js/{index.DvTvKaqe.js → index.DEUimtV1.js} +1 -1
- streamlit/static/static/js/{index.DzIOW22k.js → index.DF31ixLt.js} +1 -1
- streamlit/static/static/js/{index.BKpNjc6p.js → index.DK27W5ov.js} +1 -1
- streamlit/static/static/js/{index.CS3tpmQq.js → index.DQm9mE0T.js} +4 -4
- streamlit/static/static/js/{index.LEwNBspG.js → index.DWUM7LrZ.js} +1 -1
- streamlit/static/static/js/{index.DieTLIPJ.js → index.DYR3j5ZF.js} +1 -1
- streamlit/static/static/js/{index.D_ifDEh-.js → index.DaxZAmvz.js} +1 -1
- streamlit/static/static/js/{index.DaVDJgbA.js → index.Dodgg4y_.js} +1 -1
- streamlit/static/static/js/{index.CoNSg7Jn.js → index.Dq9InAZx.js} +1 -1
- streamlit/static/static/js/{index.CjByu9X-.js → index.DtZbhbEr.js} +1 -1
- streamlit/static/static/js/{index.wNqPEQUk.js → index.DzWfLgsQ.js} +1 -1
- streamlit/static/static/js/{index.12y0V79l.js → index.HrvNEmn1.js} +1 -1
- streamlit/static/static/js/{index.CPwKghBv.js → index.Zx7pc4Ib.js} +1 -1
- streamlit/static/static/js/{index.CQhTluFq.js → index.f-UZuoZE.js} +1 -1
- streamlit/static/static/js/{index.DfbB_5Z-.js → index.qg9M6uCh.js} +1 -1
- streamlit/static/static/js/{index.B-4FZ0nj.js → index.s88CwlpG.js} +5 -5
- streamlit/static/static/js/{index.DRnQbU3d.js → index.zN5Ficl0.js} +1 -1
- streamlit/static/static/js/{input.C1Qtlpog.js → input.DnsJ8I9O.js} +1 -1
- streamlit/static/static/js/{main.Bmkh5wwK.js → main.Cs9yv8mP.js} +1 -1
- streamlit/static/static/js/{memory.sbgNT5rv.js → memory.CnMAyKwP.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.enfKgE8B.js → number-overlay-editor.CMfbFJmW.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.CTK2ZjDI.js → pandasStylerUtils.pLaEIPZw.js} +1 -1
- streamlit/static/static/js/{sandbox.DgbnlVWB.js → sandbox.BcdOGz3D.js} +1 -1
- streamlit/static/static/js/{styled-components.CUUmYQ6I.js → styled-components.571s8DEN.js} +1 -1
- streamlit/static/static/js/{throttle.BMPv1eQF.js → throttle.DM63_0Ui.js} +1 -1
- streamlit/static/static/js/{timepicker.A5q0vGni.js → timepicker.pd9YKJun.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BQcscadC.js → toConsumableArray.C-vxP4eC.js} +1 -1
- streamlit/static/static/js/uniqueId.Cx7-DRlG.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.DxPSDiCY.js → useBasicWidgetState.S1_DeDAF.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.BZEYz-Gh.js → useIntlLocale.BwbkZTj-.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.BcX0HWJh.js → useTextInputAutoExpand.DJy7lTuU.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.BIOar76Q.js → useUpdateUiValue.KsXqwLCs.js} +1 -1
- streamlit/static/static/js/{useWaveformController.Bk9pA3uJ.js → useWaveformController.DQSftrKy.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.Coni8MnB.js → withCalculatedWidth.Cf1aBuuB.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CxRdMHFu.js → withFullScreenWrapper.BBQ6--wm.js} +1 -1
- streamlit/user_info.py +10 -0
- {streamlit_nightly-1.52.3.dev20251228.dist-info → streamlit_nightly-1.52.3.dev20251231.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.52.3.dev20251228.dist-info → streamlit_nightly-1.52.3.dev20251231.dist-info}/RECORD +96 -96
- streamlit/static/static/js/index.DMWRX2hh.js +0 -1
- streamlit/static/static/js/uniqueId.C-ekQlC4.js +0 -1
- {streamlit_nightly-1.52.3.dev20251228.data → streamlit_nightly-1.52.3.dev20251231.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.52.3.dev20251228.dist-info → streamlit_nightly-1.52.3.dev20251231.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.52.3.dev20251228.dist-info → streamlit_nightly-1.52.3.dev20251231.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.52.3.dev20251228.dist-info → streamlit_nightly-1.52.3.dev20251231.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,E as x,_ as b,W as Ze,F as h,ai as ve,m as Je,cs as E,ct as xe,o as z,j as a,P as be,ay as A,az as Ee,a0 as $,b as Qe,B as et,Z as Se,bW as tt,l as rt,k as ot,b7 as nt,cu as at,e as Y,bR as Ce,bS as it}from"./index.CS3tpmQq.js";import{I as lt,g as ye,F as j,E as Ie,b as st,s as ct,u as dt,a as ut}from"./FileHelper.DrrhFRar.js";import{u as pt}from"./useWaveformController.Bk9pA3uJ.js";import{I as gt}from"./InputInstructions.DNVNePDU.js";import{u as ft,T as ht}from"./useTextInputAutoExpand.BcX0HWJh.js";import{i as mt}from"./inputUtils.CptNuJwn.js";import{T as wt}from"./TableChart.esm.BRwgdYlO.js";import{E as vt}from"./ErrorOutline.esm.DcfXgWUn.js";import{U as ze}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.DfcQke7n.js";var Ve=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),r.createElement("path",{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}))});Ve.displayName="Article";var Re=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))});Re.displayName="Code";var Ae=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"}))});Ae.displayName="Description";var De=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}))});De.displayName="Folder";var Fe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))});Fe.displayName="Image";var Me=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 3l.01 10.55c-.59-.34-1.27-.55-2-.55a4.001 4.001 0 100 8c2.22 0 3.99-1.79 3.99-4V7h4V3h-6zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}))});Me.displayName="MusicNote";var ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"}))});ke.displayName="Videocam";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))});Ue.displayName="Add";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"}))});He.displayName="ArrowUpward";var Te=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z"}))});Te.displayName="Cancel";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Ne.displayName="Check";var Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});Be.displayName="Close";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Le.displayName="ErrorOutline";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.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"}),r.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});We.displayName="Mic";const P=Ze.getLogger("ChatInput"),Ct=h("div",{target:"el6d9ej0"})({position:"relative",display:"flex",flexDirection:"column"}),yt=h("div",{target:"el6d9ej1"})(({theme:e})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",padding:e.spacing.lg,gap:e.spacing.lg,borderRadius:e.radii.default,boxSizing:"border-box",":focus-within":{borderColor:e.colors.primary}})),xt=h("div",{target:"el6d9ej2"})(({theme:e})=>({position:"relative",display:"flex",flexDirection:"column",gap:e.spacing.sm})),bt=h("div",{target:"el6d9ej3"})({position:"relative",display:"flex",flexDirection:"column"}),Et=h("div",{target:"el6d9ej4"})(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:e.spacing.sm})),St=h("div",{target:"el6d9ej5"})(({theme:e})=>({display:"flex",flexDirection:"row",flex:"1 0 0",gap:e.spacing.sm,alignItems:"center"})),It=h("div",{target:"el6d9ej6"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center",position:"relative"})),zt=h("div",{target:"el6d9ej7"})(({theme:e})=>({position:"absolute",top:e.spacing.sm,right:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:e.zIndices.priority,"& .stChatInputInstructions":{position:"static"}})),H=h("button",{target:"el6d9ej8"})(({theme:e,disabled:t,hasError:o,primary:s})=>{if(s)return{border:"none",backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.minElementHeight,height:e.sizes.minElementHeight,color:t?e.colors.fadedText40:e.colors.white,cursor:t?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:ve(e)},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}};const c=Je(e),[p,d]=c?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],w=()=>o?e.colors.redTextColor:t?p:d;return{border:"none",backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:w(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:c?e.colors.gray10:e.colors.gray90,boxShadow:ve(e)},"&:hover":{color:o?e.colors.red70:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray60,cursor:"not-allowed"},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}}),Vt=h("div",{target:"el6d9ej9"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Rt=h("div",{target:"el6d9ej10"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),Pe=(e,t)=>t===E.Directory?{...e,webkitdirectory:"",multiple:!0}:e,At=(e,t)=>{if(!t||t.length===0)return!0;const o=e.name.toLowerCase(),s=o.lastIndexOf(".");if(s===-1||s===o.length-1)return t.some(d=>d===""||d===".");const c=o.substring(s),p=o.substring(s+1);return t.some(d=>{const w=d.toLowerCase();return w.startsWith(".")?c===w:p===w})},Dt=(e,t)=>At(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},Q=e=>{switch(e){case E.None:return"a file";case E.Single:return"a file";case E.Multiple:return"files";case E.Directory:return"a directory";default:return xe(e),"a file"}},Ft=h("div",{target:"efarq9u0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),Mt=h("div",{target:"efarq9u1"})(({theme:e})=>({position:"absolute",inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:e.fontWeights.bold,pointerEvents:"none",zIndex:e.zIndices.priority})),kt=h("div",{target:"efarq9u2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),Ut=h("div",{target:"efarq9u3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),Ht=h("div",{target:"efarq9u4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Tt=h("div",{target:"efarq9u5"})({flex:"0 0 auto",maxWidth:"100%"}),Nt=h("div",{target:"efarq9u6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",backgroundColor:t?e.colors.redBackgroundColor:e.colors.bgColor,padding:e.spacing.twoXS,paddingRight:e.spacing.twoXL,borderRadius:e.radii.default,gap:e.spacing.sm,cursor:o?"pointer":"default"})),Bt=h("div",{target:"efarq9u7"})({display:"flex",flexDirection:"column",minWidth:0}),Lt=h("div",{target:"efarq9u8"})(({theme:e,fileStatus:t})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,width:e.sizes.chatInputFileIconSize,height:e.sizes.chatInputFileIconSize,flexShrink:0,...t==="uploaded"&&{backgroundColor:e.colors.bodyText,color:e.colors.bgColor},...t==="uploading"&&{backgroundColor:e.colors.fadedText10,color:e.colors.fadedText60},...t==="error"&&{backgroundColor:e.colors.redBackgroundColor,color:e.colors.redTextColor}})),Wt=h("div",{target:"efarq9u9"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Pt=h("div",{target:"efarq9u10"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),$t=h("div",{target:"efarq9u11"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm})),jt=h("small",{target:"efarq9u12"})(({theme:e})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.twoXS,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,"& button":{display:"flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",minHeight:"unset",minWidth:"unset",maxHeight:"unset",maxWidth:"unset",borderRadius:"50%",backgroundColor:"transparent",color:e.colors.fadedText20,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:e.colors.fadedText40}}})),Ot=({getRootProps:e,getInputProps:t,acceptFile:o,disabled:s})=>{const c=Pe(t(),o),p=e({tabIndex:-1});return z(kt,{"data-testid":"stChatInputFileUploadButton",disabled:s,...p,children:[a("input",{...c}),a(Ee,{content:`Upload or drag and drop ${Q(o)}`,placement:be.TOP,onMouseEnterDelay:500,children:a(H,{disabled:s,"aria-label":`Upload ${Q(o)}`,children:a(A,{content:Ue,size:"xl",color:"inherit"})})})]})},Xt=r.memo(Ot),qt=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const s=Pe(t(),o);return z($,{children:[a(Ft,{...e(),children:a("input",{...s})}),a(Mt,{children:`Drag and drop ${Q(o)} here`})]})},_t=r.memo(qt),Kt=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),Gt=new Set(["pdf"]),Yt=new Set(["csv","tsv","xlsx","xls"]),Zt=new Set(["txt","md","json","xml","yaml","yml"]),Jt=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),Qt=new Set(["mp3","wav","m4a","ogg","flac","aac"]),er=new Set(["mp4","webm","mov","avi","mkv","wmv"]),tr=new Set(["zip","tar","gz","rar","7z","bz2"]);function rr(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function or(e){const t=rr(e);return Kt.has(t)?Fe:Gt.has(t)?Ve:Yt.has(t)?wt:Zt.has(t)?Ae:Jt.has(t)?Re:Qt.has(t)?Me:er.has(t)?ke:tr.has(t)?De:lt}const nr=36;function ar(e,t=nr){if(e.length<=t)return e;const o=e.lastIndexOf(".");if(!(o>0&&o<e.length-1)){const g=Math.floor((t-3)/2),m=g>0?e.slice(-g):"";return`${e.slice(0,g)}...${m}`}const c=e.slice(o),p=e.slice(0,o),d=t-c.length-3;if(d<=0){const g=Math.floor((t-3)/2),m=g>0?e.slice(-g):"";return`${e.slice(0,g)}...${m}`}const w=Math.ceil(d/2),y=Math.floor(d/2),v=y>0?p.slice(-y):"";return`${p.slice(0,w)}...${v}${c}`}const ir=({fileInfo:e})=>{const{type:t}=e.status;switch(t){case"uploading":return a(Se,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(A,{content:vt,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return a(A,{content:or(e.name),size:"lg"});default:return xe(t),null}},lr=({fileInfo:e,onDelete:t,onRetry:o})=>{const s=e.status.type,c=s==="error",p=s==="uploading",d=c&&o!==void 0&&e.file!==void 0,w=e.status.type==="error"?e.status.errorMessage:"Upload failed",y=r.useCallback(()=>{d&&o(e)},[d,o,e]),v=r.useCallback(V=>{d&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),o(e))},[d,o,e]),g=r.useCallback(V=>{V.stopPropagation(),t(e.id)},[t,e.id]),m=p?`Cancel upload of ${e.name}`:`Remove ${e.name}`,f=ye(e.size,j.Byte),C=c?`${e.name}, ${w}`:`${e.name}, ${f}`;return z(Nt,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:c,isClickable:d,onClick:d?y:void 0,onKeyDown:d?v:void 0,title:d?"Click to retry upload":void 0,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":C,children:[a(Lt,{fileStatus:s,children:a(ir,{fileInfo:e})}),z(Bt,{children:[a(Wt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:ar(e.name)}),c?a($t,{"data-testid":"stChatInputFileError",children:w}):a(Pt,{children:ye(e.size,j.Byte)})]}),a(jt,{"data-testid":"stChatInputDeleteBtn",children:a(Qe,{onClick:g,kind:et.MINIMAL,"aria-label":m,children:a(A,{content:Te,size:"md"})})})]})},sr=r.memo(lr),cr=({items:e,onDelete:t,onRetry:o})=>a(Ut,{"data-testid":"stChatUploadedFiles",children:a(Ht,{children:e.map(s=>a(Tt,{children:a(sr,{fileInfo:s,onDelete:t,onRetry:o})},s.id))})}),dr=r.memo(cr),ur=(e,t)=>{const o=[],s=[];return e.forEach(c=>{const p=Dt(c,t.fileType);p.isValid?o.push(c):s.push({file:c,errors:[{code:Ie.FileInvalidType,message:p.errorMessage||"File type not allowed."}]})}),{accepted:o,rejected:s}},pr=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:o,uploadClient:s,uploadFile:c,addFiles:p,getNextLocalFileId:d,deleteExistingFiles:w,onUploadComplete:y,element:v})=>(g,m)=>{if(t&&g.length>0){const{accepted:f,rejected:C}=ur(g,v);g=f,m=[...m,...C]}if(!e&&g.length===0&&m.length>1){const f=m.findIndex(C=>C.errors?.[0].code===Ie.TooManyFiles);f>=0&&(g.push(m[f].file),m.splice(f,1))}if(!e&&g.length>0&&w(),s.fetchFileURLs(g).then(f=>{tt(f,g).forEach(([C,V])=>{c(C,V)})}).catch(f=>{p(g.map(C=>new ze(C.name,C.size,d(),{type:"error",errorMessage:f},C)))}),m.length>0){const f=m.map(C=>st(C,d(),o));p(f)}y()},gr=({getNextLocalFileId:e,addFiles:t,updateFile:o,uploadClient:s,element:c,onUploadProgress:p,onUploadComplete:d})=>(w,y)=>{const v=y.webkitRelativePath||y.name,g=new AbortController,m=new ze(v,y.size,e(),{type:"uploading",abortController:g,progress:1},y);t([m]),s.uploadFile({formId:"",...c},w.uploadUrl,y,f=>p(f,m.id),g.signal).then(()=>d(m.id,w)).catch(f=>{f instanceof DOMException&&f.name==="AbortError"||o(m.id,m.setStatus({type:"error",errorMessage:f?f.toString():"Unknown error"}))})},Z=(e,t,o)=>o.map(s=>s.id===e?t:s),J=(e,t)=>t.find(o=>o.id===e);function fr({disabled:e,element:t,widgetMgr:o,fragmentId:s,uploadClient:c}){const p=rt(),{placeholder:d,maxChars:w}=t,y=r.useRef(0),v=r.useRef(null),g=r.useRef(!1),m=r.useRef(null),f=r.useRef(null),{width:C,elementRef:V}=ot(),{innerWidth:ee,innerHeight:te}=nt(),[k,O]=r.useState(t.default),[D,F]=r.useState([]),[T,X]=r.useState(!1),[N,re]=r.useState(!1),[q,B]=r.useState(null),_=t.acceptAudio??!1;r.useEffect(()=>()=>{f.current&&f.current.abort()},[]);const U=ft({textareaRef:v,dependencies:[d]}),L=r.useMemo(()=>D.some(n=>n.status.type==="uploading")?!1:k!==""||D.length>0,[D,k]),I=at(t.acceptFile),oe=ct(t.maxUploadSizeMb,j.Megabyte,j.Byte),ne=r.useCallback(n=>F(l=>[...l,...n]),[]),ae=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&c.deleteFile(n.status.fileUrls.deleteUrl).catch(l=>{P.error("Failed to delete file from server:",l)})},[c]),ie=r.useCallback(n=>{F(l=>{const u=J(n,l);return Y(u)?l:(ae(u),l.filter(i=>i.id!==n))})},[ae]),K=r.useRef(null),$e=r.useCallback(n=>{!n.file||n.status.type!=="error"||(F(l=>l.filter(u=>u.id!==n.id)),K.current&&K.current([n.file],[]))},[]),le=r.useCallback(()=>{const n=D.filter(l=>l.status.type==="uploaded").map(l=>{const{name:u,size:i,status:S}=l,{fileId:G,fileUrls:Ye}=S;return new Ce({fileId:G,fileUrls:Ye,name:u,size:i})});return new it({uploadedFileInfo:n})},[D]),se=()=>y.current++,ce=pr({acceptMultipleFiles:I===E.Multiple||I===E.Directory,acceptDirectoryFiles:I===E.Directory,maxFileSize:oe,uploadClient:c,uploadFile:gr({getNextLocalFileId:se,addFiles:ne,updateFile:(n,l)=>{F(u=>Z(n,l,u))},uploadClient:c,element:t,onUploadProgress:(n,l)=>{F(u=>{const i=J(l,u);if(Y(i)||i.status.type!=="uploading")return u;const S=Math.round(n.loaded*100/n.total);return i.status.progress===S?u:Z(l,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:S}),u)})},onUploadComplete:(n,l)=>{F(u=>{const i=J(n,u);return Y(i)||i.status.type!=="uploading"?u:Z(i.id,i.setStatus({type:"uploaded",fileId:l.fileId,fileUrls:l}),u)})}}),addFiles:ne,getNextLocalFileId:se,deleteExistingFiles:()=>D.forEach(n=>ie(n.id)),onUploadComplete:()=>{v.current&&v.current.focus()},element:t});K.current=ce;const{getRootProps:de,getInputProps:ue}=dt({onDrop:ce,multiple:I===E.Multiple||I===E.Directory,accept:ut(t.fileType),maxSize:oe}),W=r.useCallback(n=>{if(v.current&&v.current.focus(),!L&&!n||e)return;const l=le(),u={data:k,fileUploaderState:l,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},s),F([]),O(""),U.clearScrollHeight()},[L,e,k,le,o,t,s,U]),pe=r.useCallback(async n=>{const l=new Date().toISOString().replace(/[:.]/g,"-"),u=new File([n],`audio-${l}.wav`,{type:"audio/wav"});try{re(!0);const i=await c.fetchFileURLs([u]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const S=i[0];f.current=new AbortController,await c.uploadFile({formId:"",...t},S.uploadUrl,u,()=>{},f.current.signal);const G=new Ce({fileId:S.fileId,fileUrls:S,name:u.name,size:u.size});W(G)}catch(i){const S="Recording failed";P.error("Audio upload failed:",i),B(S),v.current&&v.current.focus()}finally{re(!1)}},[c,t,W]),je=r.useMemo(()=>({onApprove:pe,onPermissionDenied:()=>{const n="Microphone access denied";B(n),P.error("Permission denied:",n)},onError:n=>{B("Recording failed"),P.error("Recording error:",n)},onRecordStart:()=>{B(null)}}),[pe]),R=pt({containerRef:m,sampleRate:t.audioSampleRate??void 0,events:je}),ge=r.useCallback(()=>{W()},[W]),Oe=n=>{const{metaKey:l,ctrlKey:u,shiftKey:i}=n;mt(n)&&!i&&!u&&!l&&(n.preventDefault(),ge())},Xe=n=>{const{value:l}=n.target;w!==0&&l.length>w||(O(l),U.updateScrollHeight(),q&&B(null))},fe=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!_||e||R.state==="recording")&&await R.start()},[_,e,R]),qe=r.useCallback(()=>{R.cancel(),v.current&&v.current.focus()},[R]),he=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),me=r.useCallback(n=>{fe(n)},[fe]),_e=r.useCallback(()=>{he()},[he]),Ke=r.useCallback(()=>{v.current&&v.current.focus()},[]);r.useEffect(()=>{if(t.setValue&&!g.current){g.current=!0;const n=t.value||"";O(n)}},[t.setValue,t.value]),r.useEffect(()=>{g.current=!1},[t]),r.useEffect(()=>{const n=i=>{i.preventDefault(),i.stopPropagation(),!T&&i.dataTransfer?.types.includes("Files")&&X(!0)},l=i=>{i.preventDefault(),i.stopPropagation(),T&&(i.clientX<=0&&i.clientY<=0||i.clientX>=ee&&i.clientY>=te)&&X(!1)},u=i=>{i.preventDefault(),i.stopPropagation(),T&&X(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",u),window.addEventListener("dragleave",l),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",u),window.removeEventListener("dragleave",l)}},[T,ee,te]);const Ge=I!==E.None&&T,M=R.state==="recording",we=!M&&C>p.breakpoints.hideWidgetDetails&&w>0;return a(Ct,{className:"stChatInput","data-testid":"stChatInput",ref:V,children:z(yt,{extended:U.isExtended||M,children:[we&&a(zt,{onClick:Ke,id:"stChatInputInstructions",children:a(gt,{dirty:L,value:k,maxLength:w,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),z(xt,{children:[Ge&&a(_t,{getRootProps:de,getInputProps:ue,acceptFile:I}),I!==E.None&&D.length>0&&a(dr,{items:[...D],onDelete:ie,onRetry:$e}),z(bt,{children:[a(Vt,{isRecording:M,children:a(Rt,{ref:m})}),!M&&a($,{children:a(ht,{inputRef:v,value:k,placeholder:d,onChange:Xe,onKeyDown:Oe,"aria-label":d,disabled:e,rows:1,"aria-describedby":we?"stChatInputInstructions":void 0,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",width:"100%"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:p.fontWeights.normal,lineHeight:p.lineHeights.inputWidget,"::placeholder":{color:p.colors.fadedText60},height:U.height,maxHeight:U.maxHeight,overflowY:"auto",paddingLeft:p.spacing.none,paddingRight:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,width:"100%"}}}})})]})]}),z(Et,{children:[z(St,{children:[I!==E.None&&!M&&a(Xt,{getRootProps:de,getInputProps:ue,acceptFile:I,disabled:e}),_&&!M&&a($,{children:q?a(Ee,{content:q,placement:be.TOP,error:!0,children:a(H,{onClick:me,disabled:e||N,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(A,{content:Le,size:"xl",color:"inherit"})})}):a(H,{onClick:me,disabled:e||N,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(A,{content:We,size:"xl",color:"inherit"})})})]}),a(It,{children:M?z($,{children:[a(H,{onClick:qe,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(A,{content:Be,size:"lg",color:"inherit"})}),a(H,{onClick:_e,disabled:e||N,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:N?a(Se,{size:"lg",iconValue:"spinner"}):a(A,{content:Ne,size:"lg",color:"inherit"})})]}):a(H,{onClick:ge,disabled:!L||e||N,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:a(A,{content:He,size:"lg",color:"inherit"})})})]})]})})}const Ir=r.memo(fr);export{Ir as default};
|
|
1
|
+
import{r,E as x,_ as b,W as Ze,F as h,ai as ve,m as Je,cs as E,ct as xe,o as z,j as a,P as be,ay as A,az as Ee,a0 as $,b as Qe,B as et,Z as Se,bW as tt,l as rt,k as ot,b7 as nt,cu as at,e as Y,bR as Ce,bS as it}from"./index.DQm9mE0T.js";import{I as lt,g as ye,F as j,E as Ie,b as st,s as ct,u as dt,a as ut}from"./FileHelper.BG4elCiu.js";import{u as pt}from"./useWaveformController.DQSftrKy.js";import{I as gt}from"./InputInstructions.B-hrhnKS.js";import{u as ft,T as ht}from"./useTextInputAutoExpand.DJy7lTuU.js";import{i as mt}from"./inputUtils.CptNuJwn.js";import{T as wt}from"./TableChart.esm.BsEqAKaW.js";import{E as vt}from"./ErrorOutline.esm.bKqSjdNS.js";import{U as ze}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.bCQ8S-FY.js";var Ve=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),r.createElement("path",{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}))});Ve.displayName="Article";var Re=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))});Re.displayName="Code";var Ae=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"}))});Ae.displayName="Description";var De=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}))});De.displayName="Folder";var Fe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))});Fe.displayName="Image";var Me=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 3l.01 10.55c-.59-.34-1.27-.55-2-.55a4.001 4.001 0 100 8c2.22 0 3.99-1.79 3.99-4V7h4V3h-6zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}))});Me.displayName="MusicNote";var ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"}))});ke.displayName="Videocam";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))});Ue.displayName="Add";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"}))});He.displayName="ArrowUpward";var Te=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z"}))});Te.displayName="Cancel";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Ne.displayName="Check";var Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});Be.displayName="Close";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Le.displayName="ErrorOutline";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(x,b({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.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"}),r.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});We.displayName="Mic";const P=Ze.getLogger("ChatInput"),Ct=h("div",{target:"el6d9ej0"})({position:"relative",display:"flex",flexDirection:"column"}),yt=h("div",{target:"el6d9ej1"})(({theme:e})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",padding:e.spacing.lg,gap:e.spacing.lg,borderRadius:e.radii.default,boxSizing:"border-box",":focus-within":{borderColor:e.colors.primary}})),xt=h("div",{target:"el6d9ej2"})(({theme:e})=>({position:"relative",display:"flex",flexDirection:"column",gap:e.spacing.sm})),bt=h("div",{target:"el6d9ej3"})({position:"relative",display:"flex",flexDirection:"column"}),Et=h("div",{target:"el6d9ej4"})(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:e.spacing.sm})),St=h("div",{target:"el6d9ej5"})(({theme:e})=>({display:"flex",flexDirection:"row",flex:"1 0 0",gap:e.spacing.sm,alignItems:"center"})),It=h("div",{target:"el6d9ej6"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center",position:"relative"})),zt=h("div",{target:"el6d9ej7"})(({theme:e})=>({position:"absolute",top:e.spacing.sm,right:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:e.zIndices.priority,"& .stChatInputInstructions":{position:"static"}})),H=h("button",{target:"el6d9ej8"})(({theme:e,disabled:t,hasError:o,primary:s})=>{if(s)return{border:"none",backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.minElementHeight,height:e.sizes.minElementHeight,color:t?e.colors.fadedText40:e.colors.white,cursor:t?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:ve(e)},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}};const c=Je(e),[p,d]=c?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],w=()=>o?e.colors.redTextColor:t?p:d;return{border:"none",backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:w(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:c?e.colors.gray10:e.colors.gray90,boxShadow:ve(e)},"&:hover":{color:o?e.colors.red70:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray60,cursor:"not-allowed"},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}}),Vt=h("div",{target:"el6d9ej9"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Rt=h("div",{target:"el6d9ej10"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),Pe=(e,t)=>t===E.Directory?{...e,webkitdirectory:"",multiple:!0}:e,At=(e,t)=>{if(!t||t.length===0)return!0;const o=e.name.toLowerCase(),s=o.lastIndexOf(".");if(s===-1||s===o.length-1)return t.some(d=>d===""||d===".");const c=o.substring(s),p=o.substring(s+1);return t.some(d=>{const w=d.toLowerCase();return w.startsWith(".")?c===w:p===w})},Dt=(e,t)=>At(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},Q=e=>{switch(e){case E.None:return"a file";case E.Single:return"a file";case E.Multiple:return"files";case E.Directory:return"a directory";default:return xe(e),"a file"}},Ft=h("div",{target:"efarq9u0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),Mt=h("div",{target:"efarq9u1"})(({theme:e})=>({position:"absolute",inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:e.fontWeights.bold,pointerEvents:"none",zIndex:e.zIndices.priority})),kt=h("div",{target:"efarq9u2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),Ut=h("div",{target:"efarq9u3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),Ht=h("div",{target:"efarq9u4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Tt=h("div",{target:"efarq9u5"})({flex:"0 0 auto",maxWidth:"100%"}),Nt=h("div",{target:"efarq9u6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",backgroundColor:t?e.colors.redBackgroundColor:e.colors.bgColor,padding:e.spacing.twoXS,paddingRight:e.spacing.twoXL,borderRadius:e.radii.default,gap:e.spacing.sm,cursor:o?"pointer":"default"})),Bt=h("div",{target:"efarq9u7"})({display:"flex",flexDirection:"column",minWidth:0}),Lt=h("div",{target:"efarq9u8"})(({theme:e,fileStatus:t})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,width:e.sizes.chatInputFileIconSize,height:e.sizes.chatInputFileIconSize,flexShrink:0,...t==="uploaded"&&{backgroundColor:e.colors.bodyText,color:e.colors.bgColor},...t==="uploading"&&{backgroundColor:e.colors.fadedText10,color:e.colors.fadedText60},...t==="error"&&{backgroundColor:e.colors.redBackgroundColor,color:e.colors.redTextColor}})),Wt=h("div",{target:"efarq9u9"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Pt=h("div",{target:"efarq9u10"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),$t=h("div",{target:"efarq9u11"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm})),jt=h("small",{target:"efarq9u12"})(({theme:e})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.twoXS,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,"& button":{display:"flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",minHeight:"unset",minWidth:"unset",maxHeight:"unset",maxWidth:"unset",borderRadius:"50%",backgroundColor:"transparent",color:e.colors.fadedText20,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:e.colors.fadedText40}}})),Ot=({getRootProps:e,getInputProps:t,acceptFile:o,disabled:s})=>{const c=Pe(t(),o),p=e({tabIndex:-1});return z(kt,{"data-testid":"stChatInputFileUploadButton",disabled:s,...p,children:[a("input",{...c}),a(Ee,{content:`Upload or drag and drop ${Q(o)}`,placement:be.TOP,onMouseEnterDelay:500,children:a(H,{disabled:s,"aria-label":`Upload ${Q(o)}`,children:a(A,{content:Ue,size:"xl",color:"inherit"})})})]})},Xt=r.memo(Ot),qt=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const s=Pe(t(),o);return z($,{children:[a(Ft,{...e(),children:a("input",{...s})}),a(Mt,{children:`Drag and drop ${Q(o)} here`})]})},_t=r.memo(qt),Kt=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),Gt=new Set(["pdf"]),Yt=new Set(["csv","tsv","xlsx","xls"]),Zt=new Set(["txt","md","json","xml","yaml","yml"]),Jt=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),Qt=new Set(["mp3","wav","m4a","ogg","flac","aac"]),er=new Set(["mp4","webm","mov","avi","mkv","wmv"]),tr=new Set(["zip","tar","gz","rar","7z","bz2"]);function rr(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function or(e){const t=rr(e);return Kt.has(t)?Fe:Gt.has(t)?Ve:Yt.has(t)?wt:Zt.has(t)?Ae:Jt.has(t)?Re:Qt.has(t)?Me:er.has(t)?ke:tr.has(t)?De:lt}const nr=36;function ar(e,t=nr){if(e.length<=t)return e;const o=e.lastIndexOf(".");if(!(o>0&&o<e.length-1)){const g=Math.floor((t-3)/2),m=g>0?e.slice(-g):"";return`${e.slice(0,g)}...${m}`}const c=e.slice(o),p=e.slice(0,o),d=t-c.length-3;if(d<=0){const g=Math.floor((t-3)/2),m=g>0?e.slice(-g):"";return`${e.slice(0,g)}...${m}`}const w=Math.ceil(d/2),y=Math.floor(d/2),v=y>0?p.slice(-y):"";return`${p.slice(0,w)}...${v}${c}`}const ir=({fileInfo:e})=>{const{type:t}=e.status;switch(t){case"uploading":return a(Se,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(A,{content:vt,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return a(A,{content:or(e.name),size:"lg"});default:return xe(t),null}},lr=({fileInfo:e,onDelete:t,onRetry:o})=>{const s=e.status.type,c=s==="error",p=s==="uploading",d=c&&o!==void 0&&e.file!==void 0,w=e.status.type==="error"?e.status.errorMessage:"Upload failed",y=r.useCallback(()=>{d&&o(e)},[d,o,e]),v=r.useCallback(V=>{d&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),o(e))},[d,o,e]),g=r.useCallback(V=>{V.stopPropagation(),t(e.id)},[t,e.id]),m=p?`Cancel upload of ${e.name}`:`Remove ${e.name}`,f=ye(e.size,j.Byte),C=c?`${e.name}, ${w}`:`${e.name}, ${f}`;return z(Nt,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:c,isClickable:d,onClick:d?y:void 0,onKeyDown:d?v:void 0,title:d?"Click to retry upload":void 0,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":C,children:[a(Lt,{fileStatus:s,children:a(ir,{fileInfo:e})}),z(Bt,{children:[a(Wt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:ar(e.name)}),c?a($t,{"data-testid":"stChatInputFileError",children:w}):a(Pt,{children:ye(e.size,j.Byte)})]}),a(jt,{"data-testid":"stChatInputDeleteBtn",children:a(Qe,{onClick:g,kind:et.MINIMAL,"aria-label":m,children:a(A,{content:Te,size:"md"})})})]})},sr=r.memo(lr),cr=({items:e,onDelete:t,onRetry:o})=>a(Ut,{"data-testid":"stChatUploadedFiles",children:a(Ht,{children:e.map(s=>a(Tt,{children:a(sr,{fileInfo:s,onDelete:t,onRetry:o})},s.id))})}),dr=r.memo(cr),ur=(e,t)=>{const o=[],s=[];return e.forEach(c=>{const p=Dt(c,t.fileType);p.isValid?o.push(c):s.push({file:c,errors:[{code:Ie.FileInvalidType,message:p.errorMessage||"File type not allowed."}]})}),{accepted:o,rejected:s}},pr=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:o,uploadClient:s,uploadFile:c,addFiles:p,getNextLocalFileId:d,deleteExistingFiles:w,onUploadComplete:y,element:v})=>(g,m)=>{if(t&&g.length>0){const{accepted:f,rejected:C}=ur(g,v);g=f,m=[...m,...C]}if(!e&&g.length===0&&m.length>1){const f=m.findIndex(C=>C.errors?.[0].code===Ie.TooManyFiles);f>=0&&(g.push(m[f].file),m.splice(f,1))}if(!e&&g.length>0&&w(),s.fetchFileURLs(g).then(f=>{tt(f,g).forEach(([C,V])=>{c(C,V)})}).catch(f=>{p(g.map(C=>new ze(C.name,C.size,d(),{type:"error",errorMessage:f},C)))}),m.length>0){const f=m.map(C=>st(C,d(),o));p(f)}y()},gr=({getNextLocalFileId:e,addFiles:t,updateFile:o,uploadClient:s,element:c,onUploadProgress:p,onUploadComplete:d})=>(w,y)=>{const v=y.webkitRelativePath||y.name,g=new AbortController,m=new ze(v,y.size,e(),{type:"uploading",abortController:g,progress:1},y);t([m]),s.uploadFile({formId:"",...c},w.uploadUrl,y,f=>p(f,m.id),g.signal).then(()=>d(m.id,w)).catch(f=>{f instanceof DOMException&&f.name==="AbortError"||o(m.id,m.setStatus({type:"error",errorMessage:f?f.toString():"Unknown error"}))})},Z=(e,t,o)=>o.map(s=>s.id===e?t:s),J=(e,t)=>t.find(o=>o.id===e);function fr({disabled:e,element:t,widgetMgr:o,fragmentId:s,uploadClient:c}){const p=rt(),{placeholder:d,maxChars:w}=t,y=r.useRef(0),v=r.useRef(null),g=r.useRef(!1),m=r.useRef(null),f=r.useRef(null),{width:C,elementRef:V}=ot(),{innerWidth:ee,innerHeight:te}=nt(),[k,O]=r.useState(t.default),[D,F]=r.useState([]),[T,X]=r.useState(!1),[N,re]=r.useState(!1),[q,B]=r.useState(null),_=t.acceptAudio??!1;r.useEffect(()=>()=>{f.current&&f.current.abort()},[]);const U=ft({textareaRef:v,dependencies:[d]}),L=r.useMemo(()=>D.some(n=>n.status.type==="uploading")?!1:k!==""||D.length>0,[D,k]),I=at(t.acceptFile),oe=ct(t.maxUploadSizeMb,j.Megabyte,j.Byte),ne=r.useCallback(n=>F(l=>[...l,...n]),[]),ae=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&c.deleteFile(n.status.fileUrls.deleteUrl).catch(l=>{P.error("Failed to delete file from server:",l)})},[c]),ie=r.useCallback(n=>{F(l=>{const u=J(n,l);return Y(u)?l:(ae(u),l.filter(i=>i.id!==n))})},[ae]),K=r.useRef(null),$e=r.useCallback(n=>{!n.file||n.status.type!=="error"||(F(l=>l.filter(u=>u.id!==n.id)),K.current&&K.current([n.file],[]))},[]),le=r.useCallback(()=>{const n=D.filter(l=>l.status.type==="uploaded").map(l=>{const{name:u,size:i,status:S}=l,{fileId:G,fileUrls:Ye}=S;return new Ce({fileId:G,fileUrls:Ye,name:u,size:i})});return new it({uploadedFileInfo:n})},[D]),se=()=>y.current++,ce=pr({acceptMultipleFiles:I===E.Multiple||I===E.Directory,acceptDirectoryFiles:I===E.Directory,maxFileSize:oe,uploadClient:c,uploadFile:gr({getNextLocalFileId:se,addFiles:ne,updateFile:(n,l)=>{F(u=>Z(n,l,u))},uploadClient:c,element:t,onUploadProgress:(n,l)=>{F(u=>{const i=J(l,u);if(Y(i)||i.status.type!=="uploading")return u;const S=Math.round(n.loaded*100/n.total);return i.status.progress===S?u:Z(l,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:S}),u)})},onUploadComplete:(n,l)=>{F(u=>{const i=J(n,u);return Y(i)||i.status.type!=="uploading"?u:Z(i.id,i.setStatus({type:"uploaded",fileId:l.fileId,fileUrls:l}),u)})}}),addFiles:ne,getNextLocalFileId:se,deleteExistingFiles:()=>D.forEach(n=>ie(n.id)),onUploadComplete:()=>{v.current&&v.current.focus()},element:t});K.current=ce;const{getRootProps:de,getInputProps:ue}=dt({onDrop:ce,multiple:I===E.Multiple||I===E.Directory,accept:ut(t.fileType),maxSize:oe}),W=r.useCallback(n=>{if(v.current&&v.current.focus(),!L&&!n||e)return;const l=le(),u={data:k,fileUploaderState:l,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},s),F([]),O(""),U.clearScrollHeight()},[L,e,k,le,o,t,s,U]),pe=r.useCallback(async n=>{const l=new Date().toISOString().replace(/[:.]/g,"-"),u=new File([n],`audio-${l}.wav`,{type:"audio/wav"});try{re(!0);const i=await c.fetchFileURLs([u]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const S=i[0];f.current=new AbortController,await c.uploadFile({formId:"",...t},S.uploadUrl,u,()=>{},f.current.signal);const G=new Ce({fileId:S.fileId,fileUrls:S,name:u.name,size:u.size});W(G)}catch(i){const S="Recording failed";P.error("Audio upload failed:",i),B(S),v.current&&v.current.focus()}finally{re(!1)}},[c,t,W]),je=r.useMemo(()=>({onApprove:pe,onPermissionDenied:()=>{const n="Microphone access denied";B(n),P.error("Permission denied:",n)},onError:n=>{B("Recording failed"),P.error("Recording error:",n)},onRecordStart:()=>{B(null)}}),[pe]),R=pt({containerRef:m,sampleRate:t.audioSampleRate??void 0,events:je}),ge=r.useCallback(()=>{W()},[W]),Oe=n=>{const{metaKey:l,ctrlKey:u,shiftKey:i}=n;mt(n)&&!i&&!u&&!l&&(n.preventDefault(),ge())},Xe=n=>{const{value:l}=n.target;w!==0&&l.length>w||(O(l),U.updateScrollHeight(),q&&B(null))},fe=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!_||e||R.state==="recording")&&await R.start()},[_,e,R]),qe=r.useCallback(()=>{R.cancel(),v.current&&v.current.focus()},[R]),he=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),me=r.useCallback(n=>{fe(n)},[fe]),_e=r.useCallback(()=>{he()},[he]),Ke=r.useCallback(()=>{v.current&&v.current.focus()},[]);r.useEffect(()=>{if(t.setValue&&!g.current){g.current=!0;const n=t.value||"";O(n)}},[t.setValue,t.value]),r.useEffect(()=>{g.current=!1},[t]),r.useEffect(()=>{const n=i=>{i.preventDefault(),i.stopPropagation(),!T&&i.dataTransfer?.types.includes("Files")&&X(!0)},l=i=>{i.preventDefault(),i.stopPropagation(),T&&(i.clientX<=0&&i.clientY<=0||i.clientX>=ee&&i.clientY>=te)&&X(!1)},u=i=>{i.preventDefault(),i.stopPropagation(),T&&X(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",u),window.addEventListener("dragleave",l),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",u),window.removeEventListener("dragleave",l)}},[T,ee,te]);const Ge=I!==E.None&&T,M=R.state==="recording",we=!M&&C>p.breakpoints.hideWidgetDetails&&w>0;return a(Ct,{className:"stChatInput","data-testid":"stChatInput",ref:V,children:z(yt,{extended:U.isExtended||M,children:[we&&a(zt,{onClick:Ke,id:"stChatInputInstructions",children:a(gt,{dirty:L,value:k,maxLength:w,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),z(xt,{children:[Ge&&a(_t,{getRootProps:de,getInputProps:ue,acceptFile:I}),I!==E.None&&D.length>0&&a(dr,{items:[...D],onDelete:ie,onRetry:$e}),z(bt,{children:[a(Vt,{isRecording:M,children:a(Rt,{ref:m})}),!M&&a($,{children:a(ht,{inputRef:v,value:k,placeholder:d,onChange:Xe,onKeyDown:Oe,"aria-label":d,disabled:e,rows:1,"aria-describedby":we?"stChatInputInstructions":void 0,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",width:"100%"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:p.fontWeights.normal,lineHeight:p.lineHeights.inputWidget,"::placeholder":{color:p.colors.fadedText60},height:U.height,maxHeight:U.maxHeight,overflowY:"auto",paddingLeft:p.spacing.none,paddingRight:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,width:"100%"}}}})})]})]}),z(Et,{children:[z(St,{children:[I!==E.None&&!M&&a(Xt,{getRootProps:de,getInputProps:ue,acceptFile:I,disabled:e}),_&&!M&&a($,{children:q?a(Ee,{content:q,placement:be.TOP,error:!0,children:a(H,{onClick:me,disabled:e||N,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(A,{content:Le,size:"xl",color:"inherit"})})}):a(H,{onClick:me,disabled:e||N,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(A,{content:We,size:"xl",color:"inherit"})})})]}),a(It,{children:M?z($,{children:[a(H,{onClick:qe,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(A,{content:Be,size:"lg",color:"inherit"})}),a(H,{onClick:_e,disabled:e||N,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:N?a(Se,{size:"lg",iconValue:"spinner"}):a(A,{content:Ne,size:"lg",color:"inherit"})})]}):a(H,{onClick:ge,disabled:!L||e||N,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:a(A,{content:He,size:"lg",color:"inherit"})})})]})]})})}const Ir=r.memo(fr);export{Ir as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as T,r as i,V as b,a3 as L,j as p,W as N}from"./index.
|
|
1
|
+
import{F as T,r as i,V as b,a3 as L,j as p,W as N}from"./index.DQm9mE0T.js";const U=T("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:g,url:c,startTime:a,subtitles:l,endTime:o,loop:d,autoplay:m,muted:E}=r;let v=b(c);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),y=i.useMemo(()=>JSON.stringify(l?l.map(e=>s.buildMediaURL(`${e.url}`)):[]),[l,s]);i.useEffect(()=>{const e=JSON.parse(y);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[y,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const u=()=>{o>0&&e.currentTime>=o&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",u),()=>{e&&o>0&&e.removeEventListener("timeupdate",u)}},[o,d,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),d){t.searchParams.append("loop","1");const u=t.pathname.split("/").pop();u&&t.searchParams.append("playlist",u)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(g===L.Type.YOUTUBE_IFRAME)return p(U,{className:"stVideo","data-testid":"stVideo",title:c,src:V(c),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;R.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(c),style:A,crossOrigin:v,onError:h,children:l?.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const w=i.memo(O);export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as c,r as o,j as a,o as u,al as g,Z as f,q as S}from"./index.
|
|
1
|
+
import{F as c,r as o,j as a,o as u,al as g,Z as f,q as S}from"./index.DQm9mE0T.js";const x=c("div",{target:"et5wpae0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"et5wpae1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"et5wpae2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"et5wpae3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),w=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function y({element:e}){const{cache:n,showTime:t}=e,[s,l]=o.useState(0),r=o.useRef(null);return o.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const m=(Date.now()-r.current)/1e3;l(m)}};i();const p=setInterval(i,100);return()=>clearInterval(p)},[t]),a(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[a(f,{size:"lg",iconValue:"spinner"}),u($,{children:[a(S,{source:e.text,allowHTML:!1}),t&&a(h,{children:w(s)})]})]})})}const v=o.memo(y);export{v as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Bt,cZ as Er,c$ as ef,cY as tf,d7 as At,ag as uh,d8 as gs,d9 as wN,cW as j2,c_ as ku,da as ap,db as H2,_ as KR,j as Gf,a0 as TN,F as ZR,m as YR,X as QR,dc as rC,bi as EN,L as CN,l as SN,o as nC,ct as IN,dd as iC}from"./index.
|
|
1
|
+
import{r as Bt,cZ as Er,c$ as ef,cY as tf,d7 as At,ag as uh,d8 as gs,d9 as wN,cW as j2,c_ as ku,da as ap,db as H2,_ as KR,j as Gf,a0 as TN,F as ZR,m as YR,X as QR,dc as rC,bi as EN,L as CN,l as SN,o as nC,ct as IN,dd as iC}from"./index.DQm9mE0T.js";import{_ as BN,C as PN}from"./toConsumableArray.C-vxP4eC.js";import{E as e4,w as MN}from"./withFullScreenWrapper.BBQ6--wm.js";import{a as RN,T as ON}from"./Toolbar.COFccaTT.js";import{l as d1}from"./index.8HslT92O.js";import{a as DN}from"./useBasicWidgetState.S1_DeDAF.js";import{u as FN,s as LN}from"./threshold.CUNQbqMA.js";import"./FormClearHelper.CcrsaZUN.js";import"./value.DaKxGC7O.js";function kN(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function sC(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const t4=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),oC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);oC&&parseFloat(oC[1]);const aC=globalThis,lC=globalThis.process||{},NN=globalThis.navigator||{};function r4(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function fh(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||r4()}function UN(r){return fh()?r4()?"Electron":(NN.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const n4="4.1.0";function zN(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class VN{constructor(e,t,n="sessionStorage"){this.storage=zN(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function GN(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function jN(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var Dm;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Dm||(Dm={}));const HN=10;function cC(r){return typeof r!="string"?r:(r=r.toUpperCase(),Dm[r]||Dm.WHITE)}function WN(r,e,t){return!fh&&typeof r=="string"&&(e&&(r=`\x1B[${cC(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${cC(t)+HN}m${r}\x1B[49m`)),r}function $N(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(l=>s===l)||(i[s]=o.bind(r)))}}function W2(r,e){if(!r)throw new Error("Assertion failed")}function ld(){let r;if(fh()&&aC.performance)r=aC?.performance?.now?.();else if("hrtime"in lC){const e=lC?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const cd={debug:fh()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},XN={enabled:!0,level:0};function ud(){}const uC={},fC={once:!0};class wp{constructor({id:e}={id:""}){this.VERSION=n4,this._startTs=ld(),this._deltaTs=ld(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new VN(`__probe-${this.id}__`,XN),this.timeStamp(`${this.id} started`),$N(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,cd.warn,arguments,fC)}error(e){return this._getLogFunction(0,e,cd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,cd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,cd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,cd.debug||cd.info,arguments,fC)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ud,n&&[n],{tag:JN(t)}):ud}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||ud)}group(e,t,n={collapsed:!1}){const i=hC({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||ud)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=i4(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=hC({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,W2(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=ld();const o=s.tag||s.message;if(s.once&&o)if(!uC[o])uC[o]=ld();else return ud;return t=qN(this.id,s.message,s),n.bind(console,t,...s.args)}return ud}}wp.VERSION=n4;function i4(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return W2(Number.isFinite(e)&&e>=0),e}function hC(r){const{logLevel:e,message:t}=r;r.logLevel=i4(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return W2(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function qN(r,e,t){if(typeof e=="string"){const n=t.time?jN(GN(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=WN(e,t.color,t.background)}return e}function JN(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}globalThis.probe={};const s4=new wp({id:"@probe.gl/log"}),Qy="4.3.3",KN=Qy[0]>="0"&&Qy[0]<="9"?`v${Qy}`:"";function ZN(){const r=new wp({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=r,globalThis.loaders.version=KN,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=r,r}const YN=ZN();function QN(r,e){return o4(r||{},e)}function o4(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=o4(n[i]||{},e[i],t+1):n[i]=e[i];return n}const e5="latest";function t5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.3"),globalThis._loadersgl_.version}const r5=t5();function qu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Kf=typeof process!="object"||String(process)!=="[object process]"||process.browser,n5=typeof window<"u"&&typeof window.orientation<"u",dC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);dC&&parseFloat(dC[1]);class i5{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){qu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){qu(this.isRunning),this.isRunning=!1,this._reject(e)}}class ev{terminate(){}}const tv=new Map;function s5(r){qu(r.source&&!r.url||!r.source&&r.url);let e=tv.get(r.source||r.url);return e||(r.url&&(e=o5(r.url),tv.set(r.url,e)),r.source&&(e=a4(r.source),tv.set(r.source,e))),qu(e),e}function o5(r){if(!r.startsWith("http"))return r;const e=a5(r);return a4(e)}function a4(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function a5(r){return`try {
|
|
2
2
|
importScripts('${r}');
|
|
3
3
|
} catch (error) {
|
|
4
4
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as u,r as L,X as C,o as h,j as i,V as E,q as b,W as v}from"./index.
|
|
1
|
+
import{F as u,r as L,X as C,o as h,j as i,V as E,q as b,W as v}from"./index.DQm9mE0T.js";import{w as W,E as T}from"./withFullScreenWrapper.BBQ6--wm.js";import{S as p,T as y}from"./Toolbar.COFccaTT.js";const F=u("div",{target:"e1mq0gaz0"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),q=u("div",{target:"e1mq0gaz1"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),j=u("div",{target:"e1mq0gaz2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),H=v.getLogger("ImageList");function M(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const R=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=E(t.url);return h(q,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(j,{"data-testid":"stImageCaption",style:r,children:i(b,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function z({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:x,collapse:f}=C(T),g=d||0,I=M(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;H.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return h(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(y,{target:p,isFullScreen:s,onExpand:x,onCollapse:f,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(R,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const G=W(z),A=L.memo(G);export{A as default};
|