streamlit 1.52.1__py3-none-any.whl → 1.52.2__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 (98) hide show
  1. streamlit/elements/widgets/data_editor.py +7 -1
  2. streamlit/static/index.html +1 -1
  3. streamlit/static/manifest.json +284 -284
  4. streamlit/static/static/js/{ErrorOutline.esm.sMJdFExW.js → ErrorOutline.esm.LtBTGAgi.js} +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.CV-WYqBn.js → FileDownload.esm.DllwCvQc.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.5nCh9KDY.js → FileHelper.DgwA_xYF.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.-9RbsnV0.js → FormClearHelper.DyYuMYyM.js} +1 -1
  8. streamlit/static/static/js/{InputInstructions.2R3tBtW9.js → InputInstructions.ikAdmYQR.js} +1 -1
  9. streamlit/static/static/js/{Particles.DDHoXFxh.js → Particles.Cg5ey-rW.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.BxmfHxKu.js → ProgressBar.D1rDn4Rn.js} +1 -1
  11. streamlit/static/static/js/{StreamlitSyntaxHighlighter.BFWV0oqR.js → StreamlitSyntaxHighlighter.DU42g8NY.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.DMgU0Vgw.js → Toolbar.0YdWjZhn.js} +1 -1
  13. streamlit/static/static/js/{base-input.BXTqYbyG.js → base-input.DYzkAUR7.js} +1 -1
  14. streamlit/static/static/js/{checkbox.5xWaqPqm.js → checkbox.YeQ8t-PZ.js} +1 -1
  15. streamlit/static/static/js/{createSuper.OIgV8wc-.js → createSuper.CXzRWZIx.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.B4RIu9cw.js → data-grid-overlay-editor.vnwILR0p.js} +1 -1
  17. streamlit/static/static/js/{downloader.DwCJck8O.js → downloader.BdNzicWj.js} +1 -1
  18. streamlit/static/static/js/{embed.HKcgTiLB.js → embed.C_8wI7Q8.js} +1 -1
  19. streamlit/static/static/js/{es6.4AP97RGk.js → es6.D6UMoOIM.js} +2 -2
  20. streamlit/static/static/js/{iframeResizer.contentWindow.BZAsvL9q.js → iframeResizer.contentWindow.DM7vAi8H.js} +1 -1
  21. streamlit/static/static/js/{index.CxXo5UKy.js → index.0CGAg_-3.js} +1 -1
  22. streamlit/static/static/js/{index.CbiYVMT1.js → index.19XigCCW.js} +1 -1
  23. streamlit/static/static/js/{index.CqTPbV5Y.js → index.3bHSf9gi.js} +8 -8
  24. streamlit/static/static/js/{index.Da9gznCC.js → index.B1br6-J8.js} +1 -1
  25. streamlit/static/static/js/{index.DN4sfQLP.js → index.BDyX78eQ.js} +1 -1
  26. streamlit/static/static/js/{index.D52dMvK5.js → index.BEiPXRiB.js} +1 -1
  27. streamlit/static/static/js/{index.DfIRibXG.js → index.BGGsxMsK.js} +1 -1
  28. streamlit/static/static/js/{index.VFDFuf_7.js → index.BK8LGuo5.js} +1 -1
  29. streamlit/static/static/js/{index.Di9I2cid.js → index.BNH1O6vW.js} +1 -1
  30. streamlit/static/static/js/{index.CSbah0y4.js → index.BNJ18Gvk.js} +1 -1
  31. streamlit/static/static/js/{index.BKIlG7Ng.js → index.BSC_e7mC.js} +1 -1
  32. streamlit/static/static/js/{index.q4fLUQtC.js → index.BSsyTGMU.js} +1 -1
  33. streamlit/static/static/js/{index.DMU3coc2.js → index.BTeFWqxT.js} +1 -1
  34. streamlit/static/static/js/index.BVQ-x0jB.js +2 -0
  35. streamlit/static/static/js/{index.CbxllBj8.js → index.BtT26h8D.js} +1 -1
  36. streamlit/static/static/js/{index.NaDyAN1s.js → index.BuO127Fv.js} +1 -1
  37. streamlit/static/static/js/{index.CxbL5FgL.js → index.C4SaLgc9.js} +1 -1
  38. streamlit/static/static/js/{index.DY9Ac89e.js → index.C6PG_WI2.js} +1 -1
  39. streamlit/static/static/js/{index.BVuohWM1.js → index.C9ZwaDT3.js} +1 -1
  40. streamlit/static/static/js/{index.DkpEv0uV.js → index.CCH6P_Oz.js} +1 -1
  41. streamlit/static/static/js/{index.B0TPxAZ1.js → index.CJdAAsMS.js} +1 -1
  42. streamlit/static/static/js/{index.-3selq_5.js → index.CLw67zQa.js} +1 -1
  43. streamlit/static/static/js/{index.BHWBaOWH.js → index.COYdue8P.js} +1 -1
  44. streamlit/static/static/js/index.CPVPS6MS.js +1 -0
  45. streamlit/static/static/js/{index.L7erTnMm.js → index.CQRv0Buu.js} +1 -1
  46. streamlit/static/static/js/{index.BjQIH-3U.js → index.CTssS8CY.js} +1 -1
  47. streamlit/static/static/js/{index.BJas6XzW.js → index.CV56Xzvw.js} +1 -1
  48. streamlit/static/static/js/{index.DwJ9Vhsl.js → index.CVgZcb-2.js} +1 -1
  49. streamlit/static/static/js/{index.BrqtKtSu.js → index.CaMDX02c.js} +1 -1
  50. streamlit/static/static/js/{index.DRDE9rnx.js → index.Cc0FyOvj.js} +1 -1
  51. streamlit/static/static/js/{index.CP2YZ73v.js → index.CccNGpyY.js} +1 -1
  52. streamlit/static/static/js/{index.W-bl3NDo.js → index.CinPJsaI.js} +1 -1
  53. streamlit/static/static/js/{index.CIC9pLsG.js → index.Cys-qREe.js} +1 -1
  54. streamlit/static/static/js/{index.Dg5zbEp2.js → index.DATGLwZn.js} +1 -1
  55. streamlit/static/static/js/{index.Buc7XrOl.js → index.DDuPBAVu.js} +5 -5
  56. streamlit/static/static/js/{index.xZBTXGNC.js → index.DN77pJCq.js} +1 -1
  57. streamlit/static/static/js/{index.BNMLO-0p.js → index.DRgFBrOW.js} +1 -1
  58. streamlit/static/static/js/{index.RNTPpVde.js → index.Dc27IuI8.js} +1 -1
  59. streamlit/static/static/js/{index.DYKCsDvl.js → index.DdjNqo0t.js} +1 -1
  60. streamlit/static/static/js/{index.Ckcqwai8.js → index.DmQGepo0.js} +1 -1
  61. streamlit/static/static/js/{index.6UunrySF.js → index.DmaExHyk.js} +1 -1
  62. streamlit/static/static/js/{index.Cd1D2eGF.js → index.Dou8UoAD.js} +1 -1
  63. streamlit/static/static/js/{index.oyLQ4pue.js → index.Dt4MKWrN.js} +1 -1
  64. streamlit/static/static/js/{index.BMU6zZRk.js → index.M-iumICI.js} +1 -1
  65. streamlit/static/static/js/{index.XYozEjwK.js → index.NjN0yaAC.js} +1 -1
  66. streamlit/static/static/js/{index.BPmBNTel.js → index.OW6D7CJ5.js} +1 -1
  67. streamlit/static/static/js/{index.DBUdji-9.js → index.SnIe8o_F.js} +1 -1
  68. streamlit/static/static/js/{index.1ylynMAS.js → index.xg87JKI8.js} +1 -1
  69. streamlit/static/static/js/{input.CcvrgErO.js → input.-I2c-pPm.js} +1 -1
  70. streamlit/static/static/js/{main.eVHOp4Th.js → main.zgyqwsPV.js} +1 -1
  71. streamlit/static/static/js/{memory.Ck_sLv5Y.js → memory.BTaCc67b.js} +1 -1
  72. streamlit/static/static/js/{number-overlay-editor.DgcLMWOy.js → number-overlay-editor.Bp2-OIVN.js} +1 -1
  73. streamlit/static/static/js/{pandasStylerUtils.DqP0h70z.js → pandasStylerUtils.PlmC_Sod.js} +1 -1
  74. streamlit/static/static/js/{possibleConstructorReturn.C_51n46K.js → possibleConstructorReturn.D2vivPxX.js} +1 -1
  75. streamlit/static/static/js/{sandbox.Q-g3QIZJ.js → sandbox.C-NkJg85.js} +1 -1
  76. streamlit/static/static/js/{styled-components.e0V96rJw.js → styled-components.-ywQNIcz.js} +1 -1
  77. streamlit/static/static/js/{throttle.D3b5WILl.js → throttle.SbSFuU2P.js} +1 -1
  78. streamlit/static/static/js/{timepicker.Bpn70xGc.js → timepicker.BRg2LlYz.js} +1 -1
  79. streamlit/static/static/js/{toConsumableArray.DIN_ys1J.js → toConsumableArray.DmYuqCFN.js} +1 -1
  80. streamlit/static/static/js/uniqueId.DDLECwS_.js +1 -0
  81. streamlit/static/static/js/{useBasicWidgetState.DA3_qaXD.js → useBasicWidgetState.CSKMY_WY.js} +1 -1
  82. streamlit/static/static/js/{useIntlLocale.BSq6SANa.js → useIntlLocale.DrzrdT6m.js} +1 -1
  83. streamlit/static/static/js/{useTextInputAutoExpand.ytEW5QmA.js → useTextInputAutoExpand.BZ_dM91Q.js} +1 -1
  84. streamlit/static/static/js/{useUpdateUiValue.DOxWBNiI.js → useUpdateUiValue.y-s71G-M.js} +1 -1
  85. streamlit/static/static/js/{useWaveformController.BCmk6WLk.js → useWaveformController.Bumwfqnl.js} +1 -1
  86. streamlit/static/static/js/{withCalculatedWidth.ChdrMItN.js → withCalculatedWidth.Dl_TDMaA.js} +1 -1
  87. streamlit/static/static/js/{withFullScreenWrapper.7j_lzlaF.js → withFullScreenWrapper.CWEBbO_P.js} +1 -1
  88. streamlit/web/server/authlib_tornado_integration.py +60 -0
  89. streamlit/web/server/oidc_mixin.py +14 -3
  90. {streamlit-1.52.1.dist-info → streamlit-1.52.2.dist-info}/METADATA +1 -1
  91. {streamlit-1.52.1.dist-info → streamlit-1.52.2.dist-info}/RECORD +95 -95
  92. streamlit/static/static/js/index.B_AvdOKC.js +0 -1
  93. streamlit/static/static/js/index.q9puCQgK.js +0 -2
  94. streamlit/static/static/js/uniqueId.B27POWT6.js +0 -1
  95. {streamlit-1.52.1.data → streamlit-1.52.2.data}/scripts/streamlit.cmd +0 -0
  96. {streamlit-1.52.1.dist-info → streamlit-1.52.2.dist-info}/WHEEL +0 -0
  97. {streamlit-1.52.1.dist-info → streamlit-1.52.2.dist-info}/entry_points.txt +0 -0
  98. {streamlit-1.52.1.dist-info → streamlit-1.52.2.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{x as p,J as o,r as C,K as m,l as g,j as s,M as N,S as T,N as b}from"./index.CqTPbV5Y.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.DqP0h70z.js";import"./moment.C3j7ZXd7.js";import"./_baseIndexOf.BTknn6Gb.js";const M=p("div",{target:"e15vb32f0"})(({theme:t})=>({fontSize:t.fontSizes.md,fontFamily:t.genericFonts.bodyFont,lineHeight:t.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e15vb32f1"})(({theme:t})=>({fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,paddingTop:t.spacing.sm,paddingBottom:0,color:t.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),O=p("div",{target:"e15vb32f2"})(({theme:t,borderMode:e})=>({border:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none",borderRadius:t.radii.default,overflow:"auto"})),v=p("table",{target:"e15vb32f3"})(({theme:t})=>({width:t.sizes.full,color:t.colors.bodyText,borderSpacing:0})),S=(t,e=o.BorderMode.ALL)=>({borderBottom:e!==o.BorderMode.NONE?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:e===o.BorderMode.ALL||e===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:e===o.BorderMode.ALL?"none":void 0,paddingRight:e===o.BorderMode.NONE?"0":t.spacing.xs},verticalAlign:"middle",padding:`${t.spacing.twoXS} ${t.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.xs},"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.xs},fontWeight:t.fontWeights.normal}),u=p("td",{target:"e15vb32f4"})(({theme:t,borderMode:e})=>S(t,e)),B=p("th",{target:"e15vb32f5"})(({theme:t,borderMode:e})=>({...S(t,e),textAlign:"inherit",color:t.colors.fadedText60,"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.sm},"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.sm}})),H=p(u,{target:"e15vb32f6"})(({theme:t})=>({color:t.colors.gray70,fontStyle:"italic",fontSize:t.fontSizes.md,textAlign:"center"}));function R(t){const e=t.data,{cssId:l,cssStyles:n,caption:d}=e.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=e.dimensions,r=m(c),i=t.element.borderMode;return g(M,{className:"stTable","data-testid":"stTable",children:[n&&s("style",{children:n}),s(O,{borderMode:i,children:g(v,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(e,i),s("tbody",{children:r.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):r.map(y=>x(e,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(t,e){const l=e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL;return s("thead",{children:A(t).map((n,d)=>s("tr",{children:n.map((f,c)=>{let a="inherit";if(l&&t.dimensions.numDataRows>0){const{contentType:r}=t.getCell(0,c);a=N(r)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:e,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function x(t,e,l,n){return s("tr",{children:m(l).map(d=>$(t,e,d,n))},e)}function $(t,e,l,n){const{type:d,content:f,contentType:c}=t.getCell(e,l),a=L(t,e,l);let r=a?.displayContent||w(f,c),i=!1;const y={textAlign:N(c)?"right":"left"};switch(r?.endsWith('<span class="pd-t"></span>')&&(r=r.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case b.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);case b.DATA:return g(u,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const Z=C.memo(R);export{Z as default};
1
+ import{x as p,J as o,r as C,K as m,l as g,j as s,M as N,S as T,N as b}from"./index.3bHSf9gi.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.PlmC_Sod.js";import"./moment.C3j7ZXd7.js";import"./_baseIndexOf.BTknn6Gb.js";const M=p("div",{target:"e15vb32f0"})(({theme:t})=>({fontSize:t.fontSizes.md,fontFamily:t.genericFonts.bodyFont,lineHeight:t.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e15vb32f1"})(({theme:t})=>({fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,paddingTop:t.spacing.sm,paddingBottom:0,color:t.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),O=p("div",{target:"e15vb32f2"})(({theme:t,borderMode:e})=>({border:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none",borderRadius:t.radii.default,overflow:"auto"})),v=p("table",{target:"e15vb32f3"})(({theme:t})=>({width:t.sizes.full,color:t.colors.bodyText,borderSpacing:0})),S=(t,e=o.BorderMode.ALL)=>({borderBottom:e!==o.BorderMode.NONE?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:e===o.BorderMode.ALL||e===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:e===o.BorderMode.ALL?"none":void 0,paddingRight:e===o.BorderMode.NONE?"0":t.spacing.xs},verticalAlign:"middle",padding:`${t.spacing.twoXS} ${t.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.xs},"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.xs},fontWeight:t.fontWeights.normal}),u=p("td",{target:"e15vb32f4"})(({theme:t,borderMode:e})=>S(t,e)),B=p("th",{target:"e15vb32f5"})(({theme:t,borderMode:e})=>({...S(t,e),textAlign:"inherit",color:t.colors.fadedText60,"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.sm},"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.sm}})),H=p(u,{target:"e15vb32f6"})(({theme:t})=>({color:t.colors.gray70,fontStyle:"italic",fontSize:t.fontSizes.md,textAlign:"center"}));function R(t){const e=t.data,{cssId:l,cssStyles:n,caption:d}=e.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=e.dimensions,r=m(c),i=t.element.borderMode;return g(M,{className:"stTable","data-testid":"stTable",children:[n&&s("style",{children:n}),s(O,{borderMode:i,children:g(v,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(e,i),s("tbody",{children:r.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):r.map(y=>x(e,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(t,e){const l=e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL;return s("thead",{children:A(t).map((n,d)=>s("tr",{children:n.map((f,c)=>{let a="inherit";if(l&&t.dimensions.numDataRows>0){const{contentType:r}=t.getCell(0,c);a=N(r)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:e,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function x(t,e,l,n){return s("tr",{children:m(l).map(d=>$(t,e,d,n))},e)}function $(t,e,l,n){const{type:d,content:f,contentType:c}=t.getCell(e,l),a=L(t,e,l);let r=a?.displayContent||w(f,c),i=!1;const y={textAlign:N(c)?"right":"left"};switch(r?.endsWith('<span class="pd-t"></span>')&&(r=r.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case b.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);case b.DATA:return g(u,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const Z=C.memo(R);export{Z as default};
@@ -1 +1 @@
1
- import{r as h,g as A,az as gt,L as mt,e as et,l as wt,j as k,m as pt,ab as bt,T as yt,P as X,ac as Dt,aw as Ot,ae as xt,ay as kt,ax as St,S as Tt,k as Mt}from"./index.CqTPbV5Y.js";import{h as P}from"./moment.C3j7ZXd7.js";import{u as Ct}from"./useBasicWidgetState.DA3_qaXD.js";import{e as Yt,u as Wt,D as Et,a as Pt}from"./useIntlLocale.BSq6SANa.js";import{E as vt}from"./ErrorOutline.esm.sMJdFExW.js";import"./FormClearHelper.-9RbsnV0.js";import"./timepicker.Bpn70xGc.js";import"./possibleConstructorReturn.C_51n46K.js";import"./createSuper.OIgV8wc-.js";import"./input.CcvrgErO.js";import"./base-input.BXTqYbyG.js";const rt=6048e5,Ft=864e5,V=Symbol.for("constructDateFrom");function O(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&V in e?e[V](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return O(t||e,e)}let It={};function I(){return It}function v(e,t){const r=I(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=b(e,t?.in),o=a.getDay(),i=(o<n?7:0)+o-n;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(e,t){return v(e,{...t,weekStartsOn:1})}function nt(e,t){const r=b(e,t?.in),n=r.getFullYear(),a=O(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const o=F(a),i=O(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const f=F(i);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function j(e){const t=b(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ht(e,...t){const r=O.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function z(e,t){const r=b(e,t?.in);return r.setHours(0,0,0,0),r}function Bt(e,t,r){const[n,a]=Ht(r?.in,e,t),o=z(n),i=z(a),f=+o-j(o),g=+i-j(i);return Math.round((f-g)/Ft)}function Lt(e,t){const r=nt(e,t),n=O(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),F(n)}function Nt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qt(e){return!(!Nt(e)&&typeof e!="number"||isNaN(+b(e)))}function Rt(e,t){const r=b(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function _t(e,t){const r=b(e,t?.in);return Bt(r,Rt(r))+1}function Gt(e,t){const r=b(e,t?.in),n=+F(r)-+Lt(r);return Math.round(n/rt)+1}function at(e,t){const r=b(e,t?.in),n=r.getFullYear(),a=I(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=O(t?.in||e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const f=v(i,t),g=O(t?.in||e,0);g.setFullYear(n,0,o),g.setHours(0,0,0,0);const y=v(g,t);return+r>=+f?n+1:+r>=+y?n:n-1}function Qt(e,t){const r=I(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=at(e,t),o=O(t?.in||e,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),v(o,t)}function $t(e,t){const r=b(e,t?.in),n=+v(r,t)-+Qt(r,t);return Math.round(n/rt)+1}function s(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const D={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return s(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):s(r+1,2)},d(e,t){return s(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return s(e.getHours()%12||12,t.length)},H(e,t){return s(e.getHours(),t.length)},m(e,t){return s(e.getMinutes(),t.length)},s(e,t){return s(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return s(a,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},U={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){const a=at(e,n),o=a>0?a:1-a;if(t==="YY"){const i=o%100;return s(i,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):s(o,t.length)},R:function(e,t){const r=nt(e);return s(r,t.length)},u:function(e,t){const r=e.getFullYear();return s(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return s(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return s(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return s(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=$t(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):s(a,t.length)},I:function(e,t,r){const n=Gt(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):s(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){const n=_t(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):s(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return s(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return s(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return s(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=M.noon:n===0?a=M.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=M.evening:n>=12?a=M.afternoon:n>=4?a=M.morning:a=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return J(n);case"XXXX":case"XX":return S(n);case"XXXXX":case"XXX":default:return S(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return J(n);case"xxxx":case"xx":return S(n);case"xxxxx":case"xxx":default:return S(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Z(n,":");case"OOOO":default:return"GMT"+S(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Z(n,":");case"zzzz":default:return"GMT"+S(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return s(n,t.length)},T:function(e,t,r){return s(+e,t.length)}};function Z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),o=n%60;return o===0?r+String(a):r+String(a)+t+s(o,2)}function J(e,t){return e%60===0?(e>0?"-":"+")+s(Math.abs(e)/60,2):S(e,t)}function S(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=s(Math.trunc(n/60),2),o=s(n%60,2);return r+a+t+o}const K=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ot=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},At=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return K(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",K(n,t)).replace("{{time}}",ot(a,t))},Xt={p:ot,P:At},Vt=/^D+$/,jt=/^Y+$/,zt=["D","DD","YY","YYYY"];function Ut(e){return Vt.test(e)}function Zt(e){return jt.test(e)}function Jt(e,t,r){const n=Kt(e,t,r);if(console.warn(n),zt.includes(e))throw new RangeError(n)}function Kt(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const te=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,re=/^'([^]*?)'?$/,ne=/''/g,ae=/[a-zA-Z]/;function tt(e,t,r){const n=I(),a=r?.locale??n.locale??Yt,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,f=b(e,r?.in);if(!qt(f))throw new RangeError("Invalid time value");let g=t.match(ee).map(u=>{const d=u[0];if(d==="p"||d==="P"){const c=Xt[d];return c(u,a.formatLong)}return u}).join("").match(te).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:oe(u)};if(U[d])return{isToken:!0,value:u};if(d.match(ae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(g=a.localize.preprocessor(f,g));const y={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return g.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!r?.useAdditionalWeekYearTokens&&Zt(d)||!r?.useAdditionalDayOfYearTokens&&Ut(d))&&Jt(d,t,String(e));const c=U[d[0]];return c(f,d,a.localize,y)}).join("")}function oe(e){const t=e.match(re);return t?t[1].replace(ne,"'"):e}const H="YYYY/MM/DD";function B(e){return e.map(t=>new Date(t))}function se(e){return e?e.map(t=>P(t).format(H)):[]}function ie({disabled:e,element:t,widgetMgr:r,fragmentId:n}){const a=A(),o=h.useContext(gt),[i,f]=Ct({getStateFromWidgetMgr:ce,getDefaultStateFromProto:ue,getCurrStateFromProto:de,updateWidgetMgrState:fe,element:t,widgetMgr:r,fragmentId:n}),[g,y]=h.useState(!1),[u,d]=h.useState(null),{colors:c,fontSizes:L,fontWeights:ct,lineHeights:Q,spacing:m,sizes:w}=A(),{locale:ut}=h.useContext(mt),C=Wt(ut),x=h.useMemo(()=>P(t.min,H).toDate(),[t.min]),T=h.useMemo(()=>it(t),[t]),dt=h.useMemo(()=>{if(!t.isRange)return!1;const l=P().subtract(2,"years").toDate();return x<l},[t.isRange,x]),ft=t.default.length===0&&!e,N=h.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),Y=h.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),q=h.useMemo(()=>tt(x,Y,{locale:C}),[x,Y,C]),R=h.useMemo(()=>T?tt(T,Y,{locale:C}):"",[T,Y,C]),$=h.useCallback(l=>{if(!l)return null;if(t.isRange){const p=l==="End"?`before ${R}`:`after ${q}`;return`**Error**: ${l} date set outside allowed range. Please select a date ${p}.`}return`**Error**: Date set outside allowed range. Please select a date between ${q} and ${R}.`},[t.isRange,R,q]),lt=h.useCallback(({date:l})=>{if(d(null),et(l)){f({value:[],fromUi:!0}),y(!0);return}const p=Array.isArray(l)?l.filter(_=>!!_).map(_=>G(_)):G(l),{errorType:W,newDates:E}=st(p,x,T);W&&d($(W)),f({value:E,fromUi:!0}),y(!E)},[f,$,d,x,T]),ht=h.useCallback(()=>{if(!g)return;const l=B(t.default);f({value:l,fromUi:!0}),y(!l)},[g,t,f]);return wt("div",{className:"stDateInput","data-testid":"stDateInput",children:[k(Dt,{label:t.label,disabled:e,labelVisibility:pt(t.labelVisibility?.value),children:t.help&&k(bt,{children:k(yt,{content:t.help,placement:X.TOP_RIGHT})})}),k(Pt,{locale:C,density:Et.high,formatString:Y,mask:t.isRange?`${N} – ${N}`:N,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:lt,onClose:ht,quickSelect:dt,overrides:{Popover:{props:{ignoreBoundary:o,placement:Ot.bottomLeft,overrides:{Body:{style:{marginTop:m.px}}}}},CalendarContainer:{style:{fontSize:L.sm,paddingRight:m.sm,paddingLeft:m.sm,paddingBottom:m.sm,paddingTop:m.sm}},Week:{style:{fontSize:L.sm}},Day:{style:({$pseudoHighlighted:l,$pseudoSelected:p,$selected:W,$isHovered:E})=>({fontSize:L.sm,lineHeight:Q.base,"::before":{backgroundColor:W||p||l||E?`${c.darkenedBgMix15} !important`:c.transparent},"::after":{borderColor:c.transparent},...Mt(a)&&E&&p&&!W?{color:c.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:u&&k(kt,{content:k(Tt,{source:u,allowHTML:!1}),placement:X.TOP_RIGHT,error:!0,children:k(St,{content:vt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:c.redTextColor,backgroundColor:c.transparent}},Root:{style:({$isFocused:l})=>{const p=xt(c,l);return{borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth,paddingRight:m.twoXS,borderTopColor:p,borderRightColor:p,borderBottomColor:p,borderLeftColor:p,...u&&{backgroundColor:c.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:c.grayTextColor,padding:m.threeXS,height:w.clearIconSize,width:w.clearIconSize,":hover":{fill:c.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:ct.normal,paddingRight:m.sm,paddingLeft:m.md,paddingBottom:m.sm,paddingTop:m.sm,lineHeight:Q.inputWidget,"::placeholder":{color:c.fadedText60},...u&&{color:c.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:w.minElementHeight,borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth}}}}}},value:i,minDate:x,maxDate:T,range:t.isRange,clearable:ft})]})}function ce(e,t){const r=e.getStringArrayValue(t),n=r!==void 0?r:t.default||[];return B(n)}function ue(e){return B(e.default)??[]}function de(e){return B(e.value)??[]}function fe(e,t,r,n){const a=P(e.min,H).toDate(),o=it(e);let i=!0;const f=(r.value||[]).map(y=>G(y)),{errorType:g}=st(f,a,o);g&&(i=!1),i&&t.setStringArrayValue(e,se(r.value),{fromUi:r.fromUi},n)}function st(e,t,r){const n=[];let a=null;return et(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(o=>{o&&(r&&o>r?a="End":o<t&&(a="Start"),n.push(o))}):e&&(r&&e>r?a="End":e<t&&(a="Start"),n.push(e)),{errorType:a,newDates:n})}function it(e){const t=e.max;return t&&t.length>0?P(t,H).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const ke=h.memo(ie);export{ke as default};
1
+ import{r as h,g as A,az as gt,L as mt,e as et,l as wt,j as k,m as pt,ab as bt,T as yt,P as X,ac as Dt,aw as Ot,ae as xt,ay as kt,ax as St,S as Tt,k as Mt}from"./index.3bHSf9gi.js";import{h as P}from"./moment.C3j7ZXd7.js";import{u as Ct}from"./useBasicWidgetState.CSKMY_WY.js";import{e as Yt,u as Wt,D as Et,a as Pt}from"./useIntlLocale.DrzrdT6m.js";import{E as vt}from"./ErrorOutline.esm.LtBTGAgi.js";import"./FormClearHelper.DyYuMYyM.js";import"./timepicker.BRg2LlYz.js";import"./possibleConstructorReturn.D2vivPxX.js";import"./createSuper.CXzRWZIx.js";import"./input.-I2c-pPm.js";import"./base-input.DYzkAUR7.js";const rt=6048e5,Ft=864e5,V=Symbol.for("constructDateFrom");function O(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&V in e?e[V](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return O(t||e,e)}let It={};function I(){return It}function v(e,t){const r=I(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=b(e,t?.in),o=a.getDay(),i=(o<n?7:0)+o-n;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(e,t){return v(e,{...t,weekStartsOn:1})}function nt(e,t){const r=b(e,t?.in),n=r.getFullYear(),a=O(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const o=F(a),i=O(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const f=F(i);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function j(e){const t=b(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ht(e,...t){const r=O.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function z(e,t){const r=b(e,t?.in);return r.setHours(0,0,0,0),r}function Bt(e,t,r){const[n,a]=Ht(r?.in,e,t),o=z(n),i=z(a),f=+o-j(o),g=+i-j(i);return Math.round((f-g)/Ft)}function Lt(e,t){const r=nt(e,t),n=O(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),F(n)}function Nt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qt(e){return!(!Nt(e)&&typeof e!="number"||isNaN(+b(e)))}function Rt(e,t){const r=b(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function _t(e,t){const r=b(e,t?.in);return Bt(r,Rt(r))+1}function Gt(e,t){const r=b(e,t?.in),n=+F(r)-+Lt(r);return Math.round(n/rt)+1}function at(e,t){const r=b(e,t?.in),n=r.getFullYear(),a=I(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=O(t?.in||e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const f=v(i,t),g=O(t?.in||e,0);g.setFullYear(n,0,o),g.setHours(0,0,0,0);const y=v(g,t);return+r>=+f?n+1:+r>=+y?n:n-1}function Qt(e,t){const r=I(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=at(e,t),o=O(t?.in||e,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),v(o,t)}function $t(e,t){const r=b(e,t?.in),n=+v(r,t)-+Qt(r,t);return Math.round(n/rt)+1}function s(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const D={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return s(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):s(r+1,2)},d(e,t){return s(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return s(e.getHours()%12||12,t.length)},H(e,t){return s(e.getHours(),t.length)},m(e,t){return s(e.getMinutes(),t.length)},s(e,t){return s(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return s(a,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},U={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){const a=at(e,n),o=a>0?a:1-a;if(t==="YY"){const i=o%100;return s(i,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):s(o,t.length)},R:function(e,t){const r=nt(e);return s(r,t.length)},u:function(e,t){const r=e.getFullYear();return s(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return s(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return s(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return s(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=$t(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):s(a,t.length)},I:function(e,t,r){const n=Gt(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):s(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){const n=_t(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):s(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return s(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return s(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return s(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=M.noon:n===0?a=M.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=M.evening:n>=12?a=M.afternoon:n>=4?a=M.morning:a=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return J(n);case"XXXX":case"XX":return S(n);case"XXXXX":case"XXX":default:return S(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return J(n);case"xxxx":case"xx":return S(n);case"xxxxx":case"xxx":default:return S(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Z(n,":");case"OOOO":default:return"GMT"+S(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Z(n,":");case"zzzz":default:return"GMT"+S(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return s(n,t.length)},T:function(e,t,r){return s(+e,t.length)}};function Z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),o=n%60;return o===0?r+String(a):r+String(a)+t+s(o,2)}function J(e,t){return e%60===0?(e>0?"-":"+")+s(Math.abs(e)/60,2):S(e,t)}function S(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=s(Math.trunc(n/60),2),o=s(n%60,2);return r+a+t+o}const K=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ot=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},At=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return K(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",K(n,t)).replace("{{time}}",ot(a,t))},Xt={p:ot,P:At},Vt=/^D+$/,jt=/^Y+$/,zt=["D","DD","YY","YYYY"];function Ut(e){return Vt.test(e)}function Zt(e){return jt.test(e)}function Jt(e,t,r){const n=Kt(e,t,r);if(console.warn(n),zt.includes(e))throw new RangeError(n)}function Kt(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const te=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,re=/^'([^]*?)'?$/,ne=/''/g,ae=/[a-zA-Z]/;function tt(e,t,r){const n=I(),a=r?.locale??n.locale??Yt,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,f=b(e,r?.in);if(!qt(f))throw new RangeError("Invalid time value");let g=t.match(ee).map(u=>{const d=u[0];if(d==="p"||d==="P"){const c=Xt[d];return c(u,a.formatLong)}return u}).join("").match(te).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:oe(u)};if(U[d])return{isToken:!0,value:u};if(d.match(ae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(g=a.localize.preprocessor(f,g));const y={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return g.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!r?.useAdditionalWeekYearTokens&&Zt(d)||!r?.useAdditionalDayOfYearTokens&&Ut(d))&&Jt(d,t,String(e));const c=U[d[0]];return c(f,d,a.localize,y)}).join("")}function oe(e){const t=e.match(re);return t?t[1].replace(ne,"'"):e}const H="YYYY/MM/DD";function B(e){return e.map(t=>new Date(t))}function se(e){return e?e.map(t=>P(t).format(H)):[]}function ie({disabled:e,element:t,widgetMgr:r,fragmentId:n}){const a=A(),o=h.useContext(gt),[i,f]=Ct({getStateFromWidgetMgr:ce,getDefaultStateFromProto:ue,getCurrStateFromProto:de,updateWidgetMgrState:fe,element:t,widgetMgr:r,fragmentId:n}),[g,y]=h.useState(!1),[u,d]=h.useState(null),{colors:c,fontSizes:L,fontWeights:ct,lineHeights:Q,spacing:m,sizes:w}=A(),{locale:ut}=h.useContext(mt),C=Wt(ut),x=h.useMemo(()=>P(t.min,H).toDate(),[t.min]),T=h.useMemo(()=>it(t),[t]),dt=h.useMemo(()=>{if(!t.isRange)return!1;const l=P().subtract(2,"years").toDate();return x<l},[t.isRange,x]),ft=t.default.length===0&&!e,N=h.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),Y=h.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),q=h.useMemo(()=>tt(x,Y,{locale:C}),[x,Y,C]),R=h.useMemo(()=>T?tt(T,Y,{locale:C}):"",[T,Y,C]),$=h.useCallback(l=>{if(!l)return null;if(t.isRange){const p=l==="End"?`before ${R}`:`after ${q}`;return`**Error**: ${l} date set outside allowed range. Please select a date ${p}.`}return`**Error**: Date set outside allowed range. Please select a date between ${q} and ${R}.`},[t.isRange,R,q]),lt=h.useCallback(({date:l})=>{if(d(null),et(l)){f({value:[],fromUi:!0}),y(!0);return}const p=Array.isArray(l)?l.filter(_=>!!_).map(_=>G(_)):G(l),{errorType:W,newDates:E}=st(p,x,T);W&&d($(W)),f({value:E,fromUi:!0}),y(!E)},[f,$,d,x,T]),ht=h.useCallback(()=>{if(!g)return;const l=B(t.default);f({value:l,fromUi:!0}),y(!l)},[g,t,f]);return wt("div",{className:"stDateInput","data-testid":"stDateInput",children:[k(Dt,{label:t.label,disabled:e,labelVisibility:pt(t.labelVisibility?.value),children:t.help&&k(bt,{children:k(yt,{content:t.help,placement:X.TOP_RIGHT})})}),k(Pt,{locale:C,density:Et.high,formatString:Y,mask:t.isRange?`${N} – ${N}`:N,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:lt,onClose:ht,quickSelect:dt,overrides:{Popover:{props:{ignoreBoundary:o,placement:Ot.bottomLeft,overrides:{Body:{style:{marginTop:m.px}}}}},CalendarContainer:{style:{fontSize:L.sm,paddingRight:m.sm,paddingLeft:m.sm,paddingBottom:m.sm,paddingTop:m.sm}},Week:{style:{fontSize:L.sm}},Day:{style:({$pseudoHighlighted:l,$pseudoSelected:p,$selected:W,$isHovered:E})=>({fontSize:L.sm,lineHeight:Q.base,"::before":{backgroundColor:W||p||l||E?`${c.darkenedBgMix15} !important`:c.transparent},"::after":{borderColor:c.transparent},...Mt(a)&&E&&p&&!W?{color:c.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:u&&k(kt,{content:k(Tt,{source:u,allowHTML:!1}),placement:X.TOP_RIGHT,error:!0,children:k(St,{content:vt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:c.redTextColor,backgroundColor:c.transparent}},Root:{style:({$isFocused:l})=>{const p=xt(c,l);return{borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth,paddingRight:m.twoXS,borderTopColor:p,borderRightColor:p,borderBottomColor:p,borderLeftColor:p,...u&&{backgroundColor:c.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:c.grayTextColor,padding:m.threeXS,height:w.clearIconSize,width:w.clearIconSize,":hover":{fill:c.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:ct.normal,paddingRight:m.sm,paddingLeft:m.md,paddingBottom:m.sm,paddingTop:m.sm,lineHeight:Q.inputWidget,"::placeholder":{color:c.fadedText60},...u&&{color:c.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:w.minElementHeight,borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth}}}}}},value:i,minDate:x,maxDate:T,range:t.isRange,clearable:ft})]})}function ce(e,t){const r=e.getStringArrayValue(t),n=r!==void 0?r:t.default||[];return B(n)}function ue(e){return B(e.default)??[]}function de(e){return B(e.value)??[]}function fe(e,t,r,n){const a=P(e.min,H).toDate(),o=it(e);let i=!0;const f=(r.value||[]).map(y=>G(y)),{errorType:g}=st(f,a,o);g&&(i=!1),i&&t.setStringArrayValue(e,se(r.value),{fromUi:r.fromUi},n)}function st(e,t,r){const n=[];let a=null;return et(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(o=>{o&&(r&&o>r?a="End":o<t&&(a="Start"),n.push(o))}):e&&(r&&e>r?a="End":e<t&&(a="Start"),n.push(e)),{errorType:a,newDates:n})}function it(e){const t=e.max;return t&&t.length>0?P(t,H).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const ke=h.memo(ie);export{ke as default};
@@ -1 +1 @@
1
- import{r as o,E as T,_ as V,Q as $e,cj as v,ck as me,x as g,l as F,j as a,P as Q,b as ye,B as Ce,ax as z,T as We,a0 as H,g as Z,ay as we,Z as ve,bU as Ne,k as Pe,f as Oe,b1 as qe,cl as Ke,e as j,bM as he,bN as Xe}from"./index.CqTPbV5Y.js";import{g as je,C as Ge,I as Ye,F as _,E as xe,b as _e,s as Qe,u as Ze,a as Je}from"./FileHelper.5nCh9KDY.js";import{u as et}from"./useWaveformController.BCmk6WLk.js";import{I as tt}from"./InputInstructions.2R3tBtW9.js";import{u as ot,T as rt}from"./useTextInputAutoExpand.ytEW5QmA.js";import{i as nt}from"./inputUtils.CptNuJwn.js";import{E as at}from"./ErrorOutline.esm.sMJdFExW.js";import{U as be}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.BXTqYbyG.js";var Ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});Ie.displayName="AttachFile";var Ee=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});Ee.displayName="Check";var ze=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});ze.displayName="Close";var Se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}))});Se.displayName="ErrorOutline";var Fe=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}),o.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"}))});Fe.displayName="Mic";var Ue=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}))});Ue.displayName="Send";const N=$e.getLogger("ChatInput"),Re=(e,t)=>t===v.Directory?{...e,webkitdirectory:"",multiple:!0}:e,it=(e,t)=>{if(!t||t.length===0)return!0;const n=e.name.toLowerCase(),l=n.lastIndexOf(".");if(l===-1||l===n.length-1)return t.some(m=>m===""||m===".");const u=n.substring(l),c=n.substring(l+1);return t.some(m=>{const C=m.toLowerCase();return C.startsWith(".")?u===C:c===C})},st=(e,t)=>it(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},De=e=>{switch(e){case v.None:return"a file";case v.Single:return"a file";case v.Multiple:return"files";case v.Directory:return"a directory";default:return me(e),"a file"}},lt=g("div",{target:"e15560op0"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority})),ct=g("div",{target:"e15560op1"})(({theme:e,height:t})=>({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",height:t,width:"100%",fontWeight:e.fontWeights.bold})),dt=g("div",{target:"e15560op2"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"})),ut=g("div",{target:"e15560op3"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),pt=g("div",{target:"e15560op4"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20})),gt=g("div",{target:"e15560op5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"})),ft=g("div",{target:"e15560op6"})({display:"flex"}),ht=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),mt=g("div",{target:"e15560op8"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS})),yt=g("div",{target:"e15560op9"})(({theme:e})=>({color:e.colors.fadedText60})),Ct=g("div",{target:"e15560op10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60})),wt=g("div",{target:"e15560op11"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60})),vt=g("small",{target:"e15560op12"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}})),xt=({getRootProps:e,getInputProps:t,acceptFile:n,disabled:l,theme:u})=>{const c=Re(t(),n);return F(dt,{disabled:l,children:[F(ut,{"data-testid":"stChatInputFileUploadButton",disabled:l,...e(),children:[a("input",{...c}),a(We,{content:`Upload or drag and drop ${De(n)}`,placement:Q.TOP,onMouseEnterDelay:500,children:a(ye,{kind:Ce.MINIMAL,disabled:l,children:a(z,{content:Ie,size:"lg",color:l?u.colors.fadedText40:u.colors.fadedText60})})})]}),a(pt,{})]})},bt=o.memo(xt),It=({getRootProps:e,getInputProps:t,acceptFile:n,inputHeight:l})=>{const u=Re(t(),n);return F(H,{children:[a(lt,{height:l,...e(),children:a("input",{...u})}),a(ct,{height:l,children:`Drag and drop ${De(n)} here`})]})},Et=o.memo(It);function zt({children:e,content:t}){const n=Z();return a(we,{content:t,placement:Q.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:e})}const St=({fileInfo:e})=>{const t=Z(),{type:n}=e.status;switch(n){case"uploading":return a(ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(zt,{content:e.status.errorMessage,children:a(z,{color:t.colors.redTextColor,content:at,size:"lg"})});case"uploaded":return a(z,{content:Ye,size:"lg"});default:return me(n),null}},Ft=({fileInfo:e,onDelete:t})=>F(mt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(yt,{children:a(St,{fileInfo:e})}),a(Ct,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),a(wt,{children:je(e.size,_.Byte)}),a(vt,{"data-testid":"stChatInputDeleteBtn",children:a(ye,{onClick:()=>t(e.id),kind:Ce.MINIMAL,children:a(z,{content:Ge,size:"lg"})})})]}),Ut=o.memo(Ft),Rt=({items:e,onDelete:t})=>a(gt,{"data-testid":"stChatUploadedFiles",children:a(ft,{children:e.map(n=>a(ht,{children:a(Ut,{fileInfo:n,onDelete:t})},n.id))})}),Dt=o.memo(Rt),Tt=(e,t)=>{const n=[],l=[];return e.forEach(u=>{const c=st(u,t.fileType);c.isValid?n.push(u):l.push({file:u,errors:[{code:xe.FileInvalidType,message:c.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:l}},Vt=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:n,uploadClient:l,uploadFile:u,addFiles:c,getNextLocalFileId:m,deleteExistingFiles:C,onUploadComplete:S,element:w})=>(h,f)=>{if(t&&h.length>0){const{accepted:p,rejected:x}=Tt(h,w);h=p,f=[...f,...x]}if(!e&&h.length===0&&f.length>1){const p=f.findIndex(x=>x.errors?.[0].code===xe.TooManyFiles);p>=0&&(h.push(f[p].file),f.splice(p,1))}if(!e&&h.length>0&&C(),l.fetchFileURLs(h).then(p=>{Ne(p,h).forEach(([x,P])=>{u(x,P)})}).catch(p=>{c(h.map(x=>new be(x.name,x.size,m(),{type:"error",errorMessage:p})))}),f.length>0){const p=f.map(x=>_e(x,m(),n));c(p)}S()},Mt=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:l,element:u,onUploadProgress:c,onUploadComplete:m})=>(C,S)=>{const w=S.webkitRelativePath||S.name,h=new AbortController,f=new be(w,S.size,e(),{type:"uploading",abortController:h,progress:1});t([f]),l.uploadFile({formId:"",...u},C.uploadUrl,S,p=>c(p,f.id),h.signal).then(()=>m(f.id,C)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||n(f.id,f.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},At=g("div",{target:"eyzqfg10"})("border:none;position:relative;display:flex;"),Bt=g("div",{target:"eyzqfg11"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}})),L=g("button",{target:"eyzqfg12"})(({theme:e,disabled:t,extended:n,hasError:l})=>{const u=Pe(e),[c,m]=u?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],C=()=>l?e.colors.redTextColor:t?c:m;return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:n?"0":e.radii.chatInput,borderTopLeftRadius:n?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:C(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?e.colors.gray10:e.colors.gray90},"&:hover":{color:l?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"}}}),kt=g("div",{target:"eyzqfg13"})(({theme:e,isRecording:t})=>({display:"flex",alignItems:t?"center":"flex-end",height:"100%",position:t?"static":"absolute",right:t?void 0:0,bottom:t?void 0:0,marginBottom:t?0:`-${e.sizes.borderWidth}`,pointerEvents:"none",gap:0,paddingRight:t?e.spacing.sm:0})),Lt=g("div",{target:"eyzqfg14"})(({theme:e,acceptAudio:t})=>({position:"absolute",bottom:"0px",right:t?`calc(2 * (${e.iconSizes.xl} + 2 * ${e.spacing.sm}) + 2 * ${e.spacing.sm})`:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`})),Ht=g("div",{target:"eyzqfg15"})(({isRecording:e})=>({display:e?"flex":"none",flex:e?1:void 0,alignItems:"center",minWidth:0})),$t=g("div",{target:"eyzqfg16"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),G=(e,t,n)=>n.map(l=>l.id===e?t:l),Y=(e,t)=>t.find(n=>n.id===e);function Wt({disabled:e,element:t,widgetMgr:n,fragmentId:l,uploadClient:u}){const c=Z(),{placeholder:m,maxChars:C}=t,S=o.useRef(0),w=o.useRef(null),h=o.useRef(!1),f=o.useRef(null),p=o.useRef(null),{width:x,elementRef:P}=Oe(),{innerWidth:J,innerHeight:ee}=qe(),[R,O]=o.useState(t.default),[U,D]=o.useState([]),[M,q]=o.useState(!1),[A,te]=o.useState(!1),[K,B]=o.useState(null),k=t.acceptAudio??!1;o.useEffect(()=>()=>{p.current&&p.current.abort()},[]);const b=ot({textareaRef:w,dependencies:[m]}),$=o.useMemo(()=>U.some(r=>r.status.type==="uploading")?!1:R!==""||U.length>0,[U,R]),E=Ke(t.acceptFile),oe=Qe(t.maxUploadSizeMb,_.Megabyte,_.Byte),re=o.useCallback(r=>D(s=>[...s,...r]),[]),ne=o.useCallback(r=>{r.status.type==="uploading"&&r.status.abortController.abort(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&u.deleteFile(r.status.fileUrls.deleteUrl).catch(s=>{N.error("Failed to delete file from server:",s)})},[u]),ae=o.useCallback(r=>{D(s=>{const d=Y(r,s);return j(d)?s:(ne(d),s.filter(i=>i.id!==r))})},[ne]),ie=o.useCallback(()=>{const r=U.filter(s=>s.status.type==="uploaded").map(s=>{const{name:d,size:i,status:I}=s,{fileId:X,fileUrls:He}=I;return new he({fileId:X,fileUrls:He,name:d,size:i})});return new Xe({uploadedFileInfo:r})},[U]),se=()=>S.current++,Te=Vt({acceptMultipleFiles:E===v.Multiple||E===v.Directory,acceptDirectoryFiles:E===v.Directory,maxFileSize:oe,uploadClient:u,uploadFile:Mt({getNextLocalFileId:se,addFiles:re,updateFile:(r,s)=>{D(d=>G(r,s,d))},uploadClient:u,element:t,onUploadProgress:(r,s)=>{D(d=>{const i=Y(s,d);if(j(i)||i.status.type!=="uploading")return d;const I=Math.round(r.loaded*100/r.total);return i.status.progress===I?d:G(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:I}),d)})},onUploadComplete:(r,s)=>{D(d=>{const i=Y(r,d);return j(i)||i.status.type!=="uploading"?d:G(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),d)})}}),addFiles:re,getNextLocalFileId:se,deleteExistingFiles:()=>U.forEach(r=>ae(r.id)),onUploadComplete:()=>{w.current&&w.current.focus()},element:t}),{getRootProps:le,getInputProps:ce}=Ze({onDrop:Te,multiple:E===v.Multiple||E===v.Directory,accept:Je(t.fileType),maxSize:oe}),W=o.useCallback(r=>{if(w.current&&w.current.focus(),!$&&!r||e)return;const s=ie(),d={data:R,fileUploaderState:s,audioFileInfo:r};n.setChatInputValue(t,d,{fromUi:!0},l),D([]),O(""),b.clearScrollHeight()},[$,e,R,ie,n,t,l,b]),de=o.useCallback(async r=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),d=new File([r],`audio-${s}.wav`,{type:"audio/wav"});try{te(!0);const i=await u.fetchFileURLs([d]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const I=i[0];p.current=new AbortController,await u.uploadFile({formId:"",...t},I.uploadUrl,d,()=>{},p.current.signal);const X=new he({fileId:I.fileId,fileUrls:I,name:d.name,size:d.size});W(X)}catch(i){const I="Recording failed";N.error("Audio upload failed:",i),B(I),w.current&&w.current.focus()}finally{te(!1)}},[u,t,W]),Ve=o.useMemo(()=>({onApprove:de,onPermissionDenied:()=>{const r="Microphone access denied";B(r),N.error("Permission denied:",r)},onError:r=>{B("Recording failed"),N.error("Recording error:",r)},onRecordStart:()=>{B(null)}}),[de]),y=et({containerRef:f,sampleRate:t.audioSampleRate??void 0,events:Ve}),ue=o.useCallback(()=>{W()},[W]),Me=r=>{const{metaKey:s,ctrlKey:d,shiftKey:i}=r;nt(r)&&!i&&!d&&!s&&(r.preventDefault(),ue())},Ae=r=>{const{value:s}=r.target;C!==0&&s.length>C||(O(s),b.updateScrollHeight(),K&&B(null))},pe=o.useCallback(async r=>{r.preventDefault(),r.stopPropagation(),!(!k||e||y.state==="recording")&&await y.start()},[k,e,y]),Be=o.useCallback(()=>{y.cancel(),w.current&&w.current.focus()},[y]),ge=o.useCallback(async()=>{const{blob:r}=await y.stop();await y.approve(r)},[y]),fe=o.useCallback(r=>{pe(r)},[pe]),ke=o.useCallback(()=>{ge()},[ge]);o.useEffect(()=>{if(t.setValue&&!h.current){h.current=!0;const r=t.value||"";O(r)}},[t.setValue,t.value]),o.useEffect(()=>{h.current=!1},[t]),o.useEffect(()=>{const r=i=>{i.preventDefault(),i.stopPropagation(),!M&&i.dataTransfer?.types.includes("Files")&&q(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),M&&(i.clientX<=0&&i.clientY<=0||i.clientX>=J&&i.clientY>=ee)&&q(!1)},d=i=>{i.preventDefault(),i.stopPropagation(),M&&q(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",s)}},[M,J,ee]);const Le=E!==v.None&&M;return F(H,{children:[E===v.None?null:a(Dt,{items:[...U],onDelete:ae}),a(At,{className:"stChatInput","data-testid":"stChatInput",ref:P,children:Le?a(Et,{getRootProps:le,getInputProps:ce,acceptFile:E,inputHeight:b.height}):F(Bt,{extended:b.isExtended||y.state==="recording",children:[a(Ht,{isRecording:y.state==="recording",children:a($t,{ref:f})}),E===v.None||y.state==="recording"?null:a(bt,{getRootProps:le,getInputProps:ce,acceptFile:E,disabled:e,theme:c}),y.state!=="recording"&&a(rt,{inputRef:w,value:R,placeholder:m,onChange:Ae,onKeyDown:Me,"aria-label":m,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.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:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:b.height,maxHeight:b.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:k?`calc(2 * (${c.iconSizes.xl} + 2 * ${c.spacing.sm}))`:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y.state!=="recording"&&x>c.breakpoints.hideWidgetDetails&&a(Lt,{acceptAudio:k,children:a(tt,{dirty:$,value:R,maxLength:C,type:"chat",inForm:!1})}),a(kt,{isRecording:y.state==="recording",children:y.state==="recording"?F(H,{children:[a(L,{onClick:Be,disabled:e,extended:b.isExtended,"data-testid":"stChatInputCancelButton",children:a(z,{content:ze,size:"lg",color:"inherit"})}),a(L,{onClick:ke,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputApproveButton",children:A?a(ve,{size:"lg",iconValue:"spinner"}):a(z,{content:Ee,size:"lg",color:"inherit"})})]}):F(H,{children:[k&&a(H,{children:K?a(we,{content:K,placement:Q.TOP,error:!0,children:a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,hasError:!0,"data-testid":"stChatInputMicButton",children:a(z,{content:Se,size:"xl",color:"inherit"})})}):a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputMicButton",children:a(z,{content:Fe,size:"xl",color:"inherit"})})}),a(L,{onClick:ue,disabled:!$||e||A,extended:b.isExtended,"data-testid":"stChatInputSubmitButton",children:a(z,{content:Ue,size:"xl",color:"inherit"})})]})})]})})]})}const _t=o.memo(Wt);export{_t as default};
1
+ import{r as o,E as T,_ as V,Q as $e,cj as v,ck as me,x as g,l as F,j as a,P as Q,b as ye,B as Ce,ax as z,T as We,a0 as H,g as Z,ay as we,Z as ve,bU as Ne,k as Pe,f as Oe,b1 as qe,cl as Ke,e as j,bM as he,bN as Xe}from"./index.3bHSf9gi.js";import{g as je,C as Ge,I as Ye,F as _,E as xe,b as _e,s as Qe,u as Ze,a as Je}from"./FileHelper.DgwA_xYF.js";import{u as et}from"./useWaveformController.Bumwfqnl.js";import{I as tt}from"./InputInstructions.ikAdmYQR.js";import{u as ot,T as rt}from"./useTextInputAutoExpand.BZ_dM91Q.js";import{i as nt}from"./inputUtils.CptNuJwn.js";import{E as at}from"./ErrorOutline.esm.LtBTGAgi.js";import{U as be}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.DYzkAUR7.js";var Ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});Ie.displayName="AttachFile";var Ee=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});Ee.displayName="Check";var ze=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});ze.displayName="Close";var Se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}))});Se.displayName="ErrorOutline";var Fe=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}),o.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"}))});Fe.displayName="Mic";var Ue=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}))});Ue.displayName="Send";const N=$e.getLogger("ChatInput"),Re=(e,t)=>t===v.Directory?{...e,webkitdirectory:"",multiple:!0}:e,it=(e,t)=>{if(!t||t.length===0)return!0;const n=e.name.toLowerCase(),l=n.lastIndexOf(".");if(l===-1||l===n.length-1)return t.some(m=>m===""||m===".");const u=n.substring(l),c=n.substring(l+1);return t.some(m=>{const C=m.toLowerCase();return C.startsWith(".")?u===C:c===C})},st=(e,t)=>it(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},De=e=>{switch(e){case v.None:return"a file";case v.Single:return"a file";case v.Multiple:return"files";case v.Directory:return"a directory";default:return me(e),"a file"}},lt=g("div",{target:"e15560op0"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority})),ct=g("div",{target:"e15560op1"})(({theme:e,height:t})=>({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",height:t,width:"100%",fontWeight:e.fontWeights.bold})),dt=g("div",{target:"e15560op2"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"})),ut=g("div",{target:"e15560op3"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),pt=g("div",{target:"e15560op4"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20})),gt=g("div",{target:"e15560op5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"})),ft=g("div",{target:"e15560op6"})({display:"flex"}),ht=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),mt=g("div",{target:"e15560op8"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS})),yt=g("div",{target:"e15560op9"})(({theme:e})=>({color:e.colors.fadedText60})),Ct=g("div",{target:"e15560op10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60})),wt=g("div",{target:"e15560op11"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60})),vt=g("small",{target:"e15560op12"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}})),xt=({getRootProps:e,getInputProps:t,acceptFile:n,disabled:l,theme:u})=>{const c=Re(t(),n);return F(dt,{disabled:l,children:[F(ut,{"data-testid":"stChatInputFileUploadButton",disabled:l,...e(),children:[a("input",{...c}),a(We,{content:`Upload or drag and drop ${De(n)}`,placement:Q.TOP,onMouseEnterDelay:500,children:a(ye,{kind:Ce.MINIMAL,disabled:l,children:a(z,{content:Ie,size:"lg",color:l?u.colors.fadedText40:u.colors.fadedText60})})})]}),a(pt,{})]})},bt=o.memo(xt),It=({getRootProps:e,getInputProps:t,acceptFile:n,inputHeight:l})=>{const u=Re(t(),n);return F(H,{children:[a(lt,{height:l,...e(),children:a("input",{...u})}),a(ct,{height:l,children:`Drag and drop ${De(n)} here`})]})},Et=o.memo(It);function zt({children:e,content:t}){const n=Z();return a(we,{content:t,placement:Q.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:e})}const St=({fileInfo:e})=>{const t=Z(),{type:n}=e.status;switch(n){case"uploading":return a(ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(zt,{content:e.status.errorMessage,children:a(z,{color:t.colors.redTextColor,content:at,size:"lg"})});case"uploaded":return a(z,{content:Ye,size:"lg"});default:return me(n),null}},Ft=({fileInfo:e,onDelete:t})=>F(mt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(yt,{children:a(St,{fileInfo:e})}),a(Ct,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),a(wt,{children:je(e.size,_.Byte)}),a(vt,{"data-testid":"stChatInputDeleteBtn",children:a(ye,{onClick:()=>t(e.id),kind:Ce.MINIMAL,children:a(z,{content:Ge,size:"lg"})})})]}),Ut=o.memo(Ft),Rt=({items:e,onDelete:t})=>a(gt,{"data-testid":"stChatUploadedFiles",children:a(ft,{children:e.map(n=>a(ht,{children:a(Ut,{fileInfo:n,onDelete:t})},n.id))})}),Dt=o.memo(Rt),Tt=(e,t)=>{const n=[],l=[];return e.forEach(u=>{const c=st(u,t.fileType);c.isValid?n.push(u):l.push({file:u,errors:[{code:xe.FileInvalidType,message:c.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:l}},Vt=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:n,uploadClient:l,uploadFile:u,addFiles:c,getNextLocalFileId:m,deleteExistingFiles:C,onUploadComplete:S,element:w})=>(h,f)=>{if(t&&h.length>0){const{accepted:p,rejected:x}=Tt(h,w);h=p,f=[...f,...x]}if(!e&&h.length===0&&f.length>1){const p=f.findIndex(x=>x.errors?.[0].code===xe.TooManyFiles);p>=0&&(h.push(f[p].file),f.splice(p,1))}if(!e&&h.length>0&&C(),l.fetchFileURLs(h).then(p=>{Ne(p,h).forEach(([x,P])=>{u(x,P)})}).catch(p=>{c(h.map(x=>new be(x.name,x.size,m(),{type:"error",errorMessage:p})))}),f.length>0){const p=f.map(x=>_e(x,m(),n));c(p)}S()},Mt=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:l,element:u,onUploadProgress:c,onUploadComplete:m})=>(C,S)=>{const w=S.webkitRelativePath||S.name,h=new AbortController,f=new be(w,S.size,e(),{type:"uploading",abortController:h,progress:1});t([f]),l.uploadFile({formId:"",...u},C.uploadUrl,S,p=>c(p,f.id),h.signal).then(()=>m(f.id,C)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||n(f.id,f.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},At=g("div",{target:"eyzqfg10"})("border:none;position:relative;display:flex;"),Bt=g("div",{target:"eyzqfg11"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}})),L=g("button",{target:"eyzqfg12"})(({theme:e,disabled:t,extended:n,hasError:l})=>{const u=Pe(e),[c,m]=u?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],C=()=>l?e.colors.redTextColor:t?c:m;return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:n?"0":e.radii.chatInput,borderTopLeftRadius:n?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:C(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?e.colors.gray10:e.colors.gray90},"&:hover":{color:l?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"}}}),kt=g("div",{target:"eyzqfg13"})(({theme:e,isRecording:t})=>({display:"flex",alignItems:t?"center":"flex-end",height:"100%",position:t?"static":"absolute",right:t?void 0:0,bottom:t?void 0:0,marginBottom:t?0:`-${e.sizes.borderWidth}`,pointerEvents:"none",gap:0,paddingRight:t?e.spacing.sm:0})),Lt=g("div",{target:"eyzqfg14"})(({theme:e,acceptAudio:t})=>({position:"absolute",bottom:"0px",right:t?`calc(2 * (${e.iconSizes.xl} + 2 * ${e.spacing.sm}) + 2 * ${e.spacing.sm})`:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`})),Ht=g("div",{target:"eyzqfg15"})(({isRecording:e})=>({display:e?"flex":"none",flex:e?1:void 0,alignItems:"center",minWidth:0})),$t=g("div",{target:"eyzqfg16"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),G=(e,t,n)=>n.map(l=>l.id===e?t:l),Y=(e,t)=>t.find(n=>n.id===e);function Wt({disabled:e,element:t,widgetMgr:n,fragmentId:l,uploadClient:u}){const c=Z(),{placeholder:m,maxChars:C}=t,S=o.useRef(0),w=o.useRef(null),h=o.useRef(!1),f=o.useRef(null),p=o.useRef(null),{width:x,elementRef:P}=Oe(),{innerWidth:J,innerHeight:ee}=qe(),[R,O]=o.useState(t.default),[U,D]=o.useState([]),[M,q]=o.useState(!1),[A,te]=o.useState(!1),[K,B]=o.useState(null),k=t.acceptAudio??!1;o.useEffect(()=>()=>{p.current&&p.current.abort()},[]);const b=ot({textareaRef:w,dependencies:[m]}),$=o.useMemo(()=>U.some(r=>r.status.type==="uploading")?!1:R!==""||U.length>0,[U,R]),E=Ke(t.acceptFile),oe=Qe(t.maxUploadSizeMb,_.Megabyte,_.Byte),re=o.useCallback(r=>D(s=>[...s,...r]),[]),ne=o.useCallback(r=>{r.status.type==="uploading"&&r.status.abortController.abort(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&u.deleteFile(r.status.fileUrls.deleteUrl).catch(s=>{N.error("Failed to delete file from server:",s)})},[u]),ae=o.useCallback(r=>{D(s=>{const d=Y(r,s);return j(d)?s:(ne(d),s.filter(i=>i.id!==r))})},[ne]),ie=o.useCallback(()=>{const r=U.filter(s=>s.status.type==="uploaded").map(s=>{const{name:d,size:i,status:I}=s,{fileId:X,fileUrls:He}=I;return new he({fileId:X,fileUrls:He,name:d,size:i})});return new Xe({uploadedFileInfo:r})},[U]),se=()=>S.current++,Te=Vt({acceptMultipleFiles:E===v.Multiple||E===v.Directory,acceptDirectoryFiles:E===v.Directory,maxFileSize:oe,uploadClient:u,uploadFile:Mt({getNextLocalFileId:se,addFiles:re,updateFile:(r,s)=>{D(d=>G(r,s,d))},uploadClient:u,element:t,onUploadProgress:(r,s)=>{D(d=>{const i=Y(s,d);if(j(i)||i.status.type!=="uploading")return d;const I=Math.round(r.loaded*100/r.total);return i.status.progress===I?d:G(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:I}),d)})},onUploadComplete:(r,s)=>{D(d=>{const i=Y(r,d);return j(i)||i.status.type!=="uploading"?d:G(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),d)})}}),addFiles:re,getNextLocalFileId:se,deleteExistingFiles:()=>U.forEach(r=>ae(r.id)),onUploadComplete:()=>{w.current&&w.current.focus()},element:t}),{getRootProps:le,getInputProps:ce}=Ze({onDrop:Te,multiple:E===v.Multiple||E===v.Directory,accept:Je(t.fileType),maxSize:oe}),W=o.useCallback(r=>{if(w.current&&w.current.focus(),!$&&!r||e)return;const s=ie(),d={data:R,fileUploaderState:s,audioFileInfo:r};n.setChatInputValue(t,d,{fromUi:!0},l),D([]),O(""),b.clearScrollHeight()},[$,e,R,ie,n,t,l,b]),de=o.useCallback(async r=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),d=new File([r],`audio-${s}.wav`,{type:"audio/wav"});try{te(!0);const i=await u.fetchFileURLs([d]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const I=i[0];p.current=new AbortController,await u.uploadFile({formId:"",...t},I.uploadUrl,d,()=>{},p.current.signal);const X=new he({fileId:I.fileId,fileUrls:I,name:d.name,size:d.size});W(X)}catch(i){const I="Recording failed";N.error("Audio upload failed:",i),B(I),w.current&&w.current.focus()}finally{te(!1)}},[u,t,W]),Ve=o.useMemo(()=>({onApprove:de,onPermissionDenied:()=>{const r="Microphone access denied";B(r),N.error("Permission denied:",r)},onError:r=>{B("Recording failed"),N.error("Recording error:",r)},onRecordStart:()=>{B(null)}}),[de]),y=et({containerRef:f,sampleRate:t.audioSampleRate??void 0,events:Ve}),ue=o.useCallback(()=>{W()},[W]),Me=r=>{const{metaKey:s,ctrlKey:d,shiftKey:i}=r;nt(r)&&!i&&!d&&!s&&(r.preventDefault(),ue())},Ae=r=>{const{value:s}=r.target;C!==0&&s.length>C||(O(s),b.updateScrollHeight(),K&&B(null))},pe=o.useCallback(async r=>{r.preventDefault(),r.stopPropagation(),!(!k||e||y.state==="recording")&&await y.start()},[k,e,y]),Be=o.useCallback(()=>{y.cancel(),w.current&&w.current.focus()},[y]),ge=o.useCallback(async()=>{const{blob:r}=await y.stop();await y.approve(r)},[y]),fe=o.useCallback(r=>{pe(r)},[pe]),ke=o.useCallback(()=>{ge()},[ge]);o.useEffect(()=>{if(t.setValue&&!h.current){h.current=!0;const r=t.value||"";O(r)}},[t.setValue,t.value]),o.useEffect(()=>{h.current=!1},[t]),o.useEffect(()=>{const r=i=>{i.preventDefault(),i.stopPropagation(),!M&&i.dataTransfer?.types.includes("Files")&&q(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),M&&(i.clientX<=0&&i.clientY<=0||i.clientX>=J&&i.clientY>=ee)&&q(!1)},d=i=>{i.preventDefault(),i.stopPropagation(),M&&q(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",s)}},[M,J,ee]);const Le=E!==v.None&&M;return F(H,{children:[E===v.None?null:a(Dt,{items:[...U],onDelete:ae}),a(At,{className:"stChatInput","data-testid":"stChatInput",ref:P,children:Le?a(Et,{getRootProps:le,getInputProps:ce,acceptFile:E,inputHeight:b.height}):F(Bt,{extended:b.isExtended||y.state==="recording",children:[a(Ht,{isRecording:y.state==="recording",children:a($t,{ref:f})}),E===v.None||y.state==="recording"?null:a(bt,{getRootProps:le,getInputProps:ce,acceptFile:E,disabled:e,theme:c}),y.state!=="recording"&&a(rt,{inputRef:w,value:R,placeholder:m,onChange:Ae,onKeyDown:Me,"aria-label":m,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.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:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:b.height,maxHeight:b.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:k?`calc(2 * (${c.iconSizes.xl} + 2 * ${c.spacing.sm}))`:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y.state!=="recording"&&x>c.breakpoints.hideWidgetDetails&&a(Lt,{acceptAudio:k,children:a(tt,{dirty:$,value:R,maxLength:C,type:"chat",inForm:!1})}),a(kt,{isRecording:y.state==="recording",children:y.state==="recording"?F(H,{children:[a(L,{onClick:Be,disabled:e,extended:b.isExtended,"data-testid":"stChatInputCancelButton",children:a(z,{content:ze,size:"lg",color:"inherit"})}),a(L,{onClick:ke,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputApproveButton",children:A?a(ve,{size:"lg",iconValue:"spinner"}):a(z,{content:Ee,size:"lg",color:"inherit"})})]}):F(H,{children:[k&&a(H,{children:K?a(we,{content:K,placement:Q.TOP,error:!0,children:a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,hasError:!0,"data-testid":"stChatInputMicButton",children:a(z,{content:Se,size:"xl",color:"inherit"})})}):a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputMicButton",children:a(z,{content:Fe,size:"xl",color:"inherit"})})}),a(L,{onClick:ue,disabled:!$||e||A,extended:b.isExtended,"data-testid":"stChatInputSubmitButton",children:a(z,{content:Ue,size:"xl",color:"inherit"})})]})})]})})]})}const _t=o.memo(Wt);export{_t as default};
@@ -1,2 +1,2 @@
1
- import{am as q,s as J,r as c,b2 as Q,g as Y,b3 as ee,b4 as l,j as E,l as te,m as re,o as ne,T as oe,P as ie,b5 as ae,ac as ue,b6 as le,b as ce,B as C,c as x,D as se}from"./index.CqTPbV5Y.js";import{u as fe}from"./useBasicWidgetState.DA3_qaXD.js";import"./FormClearHelper.-9RbsnV0.js";var pe={secondary:"secondary"},N={default:"default"},de={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function be(e,t){return ge(e)||Se(e,t)||me(e,t)||he()}function he(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{am as q,s as J,r as c,b2 as Q,g as Y,b3 as ee,b4 as l,j as E,l as te,m as re,o as ne,T as oe,P as ie,b5 as ae,ac as ue,b6 as le,b as ce,B as C,c as x,D as se}from"./index.3bHSf9gi.js";import{u as fe}from"./useBasicWidgetState.CSKMY_WY.js";import"./FormClearHelper.DyYuMYyM.js";var pe={secondary:"secondary"},N={default:"default"},de={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function be(e,t){return ge(e)||Se(e,t)||me(e,t)||he()}function he(){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 me(e,t){if(e){if(typeof e=="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Se(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,d;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,d=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw d}}return n}}function ge(e){if(Array.isArray(e))return e}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(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 Ee(e,t,r){return t&&Oe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},G(e,t)}function we(e){var t=Re();return function(){var n=B(e),o;if(t){var i=B(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Le(this,o)}}function Le(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B(e)}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pe(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var H=function(e){_e(r,e);var t=we(r);function r(){var n;ve(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),V(F(n),"childRefs",{}),n}return Ee(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,d=a===void 0?{}:a,s=i.mode,y=s===void 0?k.checkbox:s,g=i.children,b=i.selected,_=i.disabled,f=i.onClick,h=i.kind,v=i.shape,m=i.size,T=J(d.Root,z),w=be(T,2),I=w[0],R=w[1],L=this.props["aria-label"]||this.props.ariaLabel,p=y===k.radio,W=c.Children.count(g);return c.createElement(Q.Consumer,null,function(Z){return c.createElement(I,$({"aria-label":L||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:p?"radiogroup":"group",$shape:v,$length:g.length},R),c.Children.map(g,function(S,P){if(!c.isValidElement(S))return null;var A=S.props.isSelected?S.props.isSelected:Pe(b,P);return p&&(o.childRefs[P]=c.createRef()),c.cloneElement(S,{disabled:_||S.props.disabled,isSelected:A,ref:p?o.childRefs[P]:void 0,tabIndex:!p||A||p&&(!b||b===-1)&&P===0?0:-1,onKeyDown:function(u){if(p){var O=Number(b)?Number(b):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var D=O-1<0?W-1:O-1;f&&f(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var j=O+1>W-1?0:O+1;f&&f(u,j),o.childRefs[j].current&&o.childRefs[j].current.focus()}}},kind:h,onClick:function(u){_||(S.props.onClick&&S.props.onClick(u),f&&f(u,P))},shape:v,size:m,overrides:ye({BaseButton:{style:function(u){var O=u.$theme;return g.length===1?{}:v!==N.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":A,role:p?"radio":"checkbox"}}},S.props.overrides)})}))})}}]),r}(c.Component);V(H,"defaultProps",{disabled:!1,onClick:function(){},shape:N.default,size:de.default,kind:pe.secondary});function Ce(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function ke(e,t,r){return e===l.ClickMode.MULTI_SELECT?Ce(t,r??[]):r?.includes(t)?[]:[t]}function Be(e){return e.length===0?-1:e[0]}function Te(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===l.Style.PILLS?C.PILLS:r===l.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?x.XSMALL:x.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:E(se,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Ae(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function De(e,t){return e&&(t=`${t}Active`),t}function je(e,t,r){const n={flexWrap:"wrap",maxWidth:r?"100%":"fit-content",margin:"0 0"},o=r?"100%":"auto";switch(e){case l.Style.BORDERLESS:return{...n,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case l.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,width:o};default:return n}}function Me(e,t,r,n,o,i,a){const d=Ae(r,n,o,t);let s=e.content,y=e.contentIcon;return d&&(s=e.selectedContent?e.selectedContent:s,y=e.selectedContentIcon?e.selectedContentIcon:y),c.forwardRef(function(b,_){const{element:f,kind:h,size:v}=Ie(s??"",y??void 0,i),m=De(!!(d&&!e.selectedContent&&!e.selectedContentIcon),h);return E(ce,{...b,size:v,kind:m,containerWidth:a,children:f})})}function $e(e,t){return e.getIntArrayValue(t)}function Ge(e){return e.default??[]}function Ne(e){return e.value??[]}function ze(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:d,selectionVisualization:s,style:y,label:g,labelVisibility:b,help:_}=r,f=Y(),[h,v]=fe({getStateFromWidgetMgr:$e,getDefaultStateFromProto:Ge,getCurrStateFromProto:Ne,updateWidgetMgrState:Te,element:r,widgetMgr:o,fragmentId:n}),m=ee(i),T=(R,L)=>{const p=ke(a,L,h);v({value:p,fromUi:!0})};let w;a===l.ClickMode.SINGLE_SELECT?w=k.radio:a===l.ClickMode.MULTI_SELECT&&(w=k.checkbox);const I=c.useMemo(()=>d.map((R,L)=>{const p=Me(R,L,s,a,h,y,m);return E(p,{},`${R.content}-${L}`)}),[a,d,s,y,h,m]);return te(le,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:m,children:[E(ue,{label:g,disabled:t,labelVisibility:re(b?.value??ae.LabelVisibilityOptions.COLLAPSED),children:_&&E(ne,{children:E(oe,{content:_,placement:ie.TOP})})}),E(H,{disabled:t,mode:w,onClick:T,selected:a===l.ClickMode.MULTI_SELECT?h:Be(h),overrides:{Root:{style:c.useCallback(()=>je(y,f.spacing,m),[y,f.spacing,m])}},children:I})]})}const xe=c.memo(ze);export{xe as default};
@@ -1 +1 @@
1
- import{r as l,e as s,j as d,m as V,U as x}from"./index.CqTPbV5Y.js";import{u as U}from"./useBasicWidgetState.DA3_qaXD.js";import"./FormClearHelper.-9RbsnV0.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(S=>{r({value:S,fromUi:!0})},[r]),m=s(e.default)&&!t;return d(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:m,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
1
+ import{r as l,e as s,j as d,m as V,U as x}from"./index.3bHSf9gi.js";import{u as U}from"./useBasicWidgetState.CSKMY_WY.js";import"./FormClearHelper.DyYuMYyM.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(S=>{r({value:S,fromUi:!0})},[r]),m=s(e.default)&&!t;return d(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:m,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
@@ -1 +1 @@
1
- import{r as o,L as M,F as T,B as m,u as U,l as I,j as u,b as A,c as j,D as F,a as N,G as Y}from"./index.CqTPbV5Y.js";import{c as R}from"./createDownloadLinkElement.ZaXNnPK4.js";function z(S){const{disabled:a,element:r,widgetMgr:B,endpoints:t,fragmentId:g}=S,{help:v,label:x,icon:L,ignoreRerun:h,type:p,url:k,deferredFileId:n}=r,b=r.shortcut?r.shortcut:void 0,[C,f]=o.useState(!1),[i,s]=o.useState(null),{enforceDownloadInNewTab:d=!1}=o.useContext(M),{requestDeferredFile:D}=o.useContext(T);let w=m.SECONDARY;p==="primary"?w=m.PRIMARY:p==="tertiary"&&(w=m.TERTIARY);const c=o.useMemo(()=>t.buildDownloadUrl(k),[t,k]);o.useEffect(()=>{!!n?.length||t.checkSourceUrlResponse(c,"Download Button")},[c,t,n]);const E=o.useCallback(async()=>{if(!D||!n){s("Deferred download not properly configured");return}f(!0),s(null);try{const e=await D(n);if(e.errorMsg){s(e.errorMsg),f(!1);return}const l=t.buildDownloadUrl(e.url);t.checkSourceUrlResponse(l,"Download Button"),R({filename:"",url:l,enforceDownloadInNewTab:d}).click()}catch(e){const l=e instanceof Error?e.message:"Download failed";s(l)}finally{f(!1)}},[D,n,t,d]),y=o.useCallback(()=>{if(a)return;h||B.setTriggerValue(r,{fromUi:!0},g),!!n?.length?E():R({filename:"",url:c,enforceDownloadInNewTab:d}).click()},[a,h,B,r,g,n,E,c,d]);return U({shortcut:b,disabled:a,onActivate:y}),o.useEffect(()=>{if(i){const e=setTimeout(()=>s(null),5e3);return()=>clearTimeout(e)}},[i]),I("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:[u(N,{help:v,containerWidth:!0,children:u(A,{kind:w,size:j.SMALL,disabled:a||C,onClick:y,containerWidth:!0,children:u(F,{icon:C?"spinner":L,label:x,shortcut:b})})}),i&&u(Y,{"data-testid":"stDownloadButtonError",children:i})]})}const K=o.memo(z);export{K as default};
1
+ import{r as o,L as M,F as T,B as m,u as U,l as I,j as u,b as A,c as j,D as F,a as N,G as Y}from"./index.3bHSf9gi.js";import{c as R}from"./createDownloadLinkElement.ZaXNnPK4.js";function z(S){const{disabled:a,element:r,widgetMgr:B,endpoints:t,fragmentId:g}=S,{help:v,label:x,icon:L,ignoreRerun:h,type:p,url:k,deferredFileId:n}=r,b=r.shortcut?r.shortcut:void 0,[C,f]=o.useState(!1),[i,s]=o.useState(null),{enforceDownloadInNewTab:d=!1}=o.useContext(M),{requestDeferredFile:D}=o.useContext(T);let w=m.SECONDARY;p==="primary"?w=m.PRIMARY:p==="tertiary"&&(w=m.TERTIARY);const c=o.useMemo(()=>t.buildDownloadUrl(k),[t,k]);o.useEffect(()=>{!!n?.length||t.checkSourceUrlResponse(c,"Download Button")},[c,t,n]);const E=o.useCallback(async()=>{if(!D||!n){s("Deferred download not properly configured");return}f(!0),s(null);try{const e=await D(n);if(e.errorMsg){s(e.errorMsg),f(!1);return}const l=t.buildDownloadUrl(e.url);t.checkSourceUrlResponse(l,"Download Button"),R({filename:"",url:l,enforceDownloadInNewTab:d}).click()}catch(e){const l=e instanceof Error?e.message:"Download failed";s(l)}finally{f(!1)}},[D,n,t,d]),y=o.useCallback(()=>{if(a)return;h||B.setTriggerValue(r,{fromUi:!0},g),!!n?.length?E():R({filename:"",url:c,enforceDownloadInNewTab:d}).click()},[a,h,B,r,g,n,E,c,d]);return U({shortcut:b,disabled:a,onActivate:y}),o.useEffect(()=>{if(i){const e=setTimeout(()=>s(null),5e3);return()=>clearTimeout(e)}},[i]),I("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:[u(N,{help:v,containerWidth:!0,children:u(A,{kind:w,size:j.SMALL,disabled:a||C,onClick:y,containerWidth:!0,children:u(F,{icon:C?"spinner":L,label:x,shortcut:b})})}),i&&u(Y,{"data-testid":"stDownloadButtonError",children:i})]})}const K=o.memo(z);export{K as default};
@@ -1 +1 @@
1
- import{get as O}from"./index.DfIRibXG.js";import{I as P}from"./index.CqTPbV5Y.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
1
+ import{get as O}from"./index.BGGsxMsK.js";import{I as P}from"./index.3bHSf9gi.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
@@ -1,2 +1,2 @@
1
- import{x as d,r as c,g as m,V as g,W as y,j as t,X as f,k as h}from"./index.CqTPbV5Y.js";import{l as b}from"./index.8HslT92O.js";import{R as u}from"./main.eVHOp4Th.js";const S=d("div",{target:"ec2buac0"})(({theme:o})=>({overflowY:"auto",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}}));function C({element:o}){const e=m(),{copyToClipboard:n}=g(),i=c.useCallback(a=>{n(JSON.stringify(a.src))},[n]);let s;try{s=JSON.parse(o.body)}catch(a){const r=y(a);try{s=b.parse(o.body)}catch{const l=parseInt(r.message.replace(/[^0-9]/g,""),10);return r.message+=`
1
+ import{x as d,r as c,g as m,V as g,W as y,j as t,X as f,k as h}from"./index.3bHSf9gi.js";import{l as b}from"./index.8HslT92O.js";import{R as u}from"./main.zgyqwsPV.js";const S=d("div",{target:"ec2buac0"})(({theme:o})=>({overflowY:"auto",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}}));function C({element:o}){const e=m(),{copyToClipboard:n}=g(),i=c.useCallback(a=>{n(JSON.stringify(a.src))},[n]);let s;try{s=JSON.parse(o.body)}catch(a){const r=y(a);try{s=b.parse(o.body)}catch{const l=parseInt(r.message.replace(/[^0-9]/g,""),10);return r.message+=`
2
2
  ${o.body.substring(0,l+1)} ← here`,t(f,{name:"Json Parse Error",message:r.message})}}const p=h(e)?"rjv-default":"monokai";return t(S,{className:"stJson","data-testid":"stJson",children:t(u,{src:s,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:p,enableClipboard:i,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}})})}const v=c.memo(C);export{v as default};
@@ -1,4 +1,4 @@
1
- import{r as It,cU as Tr,d0 as At,ag as _h,d1 as c5,bs as zu,_ as $D,j as Jf,a0 as l5,x as WD,k as JD,R as XD,d2 as AB,bn as u5,L as f5,g as h5,l as gB,ck as d5,d3 as mB}from"./index.CqTPbV5Y.js";import{_ as gs,a as p5,C as A5}from"./toConsumableArray.DIN_ys1J.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.C_51n46K.js";import{E as KD,w as g5}from"./withFullScreenWrapper.7j_lzlaF.js";import{a as m5,T as _5}from"./Toolbar.DMgU0Vgw.js";import{l as r2}from"./index.8HslT92O.js";import{a as y5}from"./useBasicWidgetState.DA3_qaXD.js";import{u as v5,s as b5}from"./threshold.Q1mXg5rX.js";import"./FormClearHelper.-9RbsnV0.js";import"./value.B4vHRSi7.js";function x5(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 o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(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 Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(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 B5(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 S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(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"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(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(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(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((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-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,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.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,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}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||yd)}group(e,t,n={collapsed:!1}){const i=xB({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||yd)}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()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(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 Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(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 Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(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]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{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){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
1
+ import{r as It,cU as Tr,d0 as At,ag as _h,d1 as c5,bs as zu,_ as $D,j as Jf,a0 as l5,x as WD,k as JD,R as XD,d2 as AB,bn as u5,L as f5,g as h5,l as gB,ck as d5,d3 as mB}from"./index.3bHSf9gi.js";import{_ as gs,a as p5,C as A5}from"./toConsumableArray.DmYuqCFN.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.D2vivPxX.js";import{E as KD,w as g5}from"./withFullScreenWrapper.CWEBbO_P.js";import{a as m5,T as _5}from"./Toolbar.0YdWjZhn.js";import{l as r2}from"./index.8HslT92O.js";import{a as y5}from"./useBasicWidgetState.CSKMY_WY.js";import{u as v5,s as b5}from"./threshold.Q1mXg5rX.js";import"./FormClearHelper.DyYuMYyM.js";import"./value.B4vHRSi7.js";function x5(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 o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(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 Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(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 B5(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 S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(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"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(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(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(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((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-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,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.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,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}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||yd)}group(e,t,n={collapsed:!1}){const i=xB({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||yd)}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()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(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 Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(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 Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(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]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{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){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);