streamlit-nightly 1.44.1.dev20250326__py3-none-any.whl → 1.44.1.dev20250327__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 (84) hide show
  1. streamlit/elements/lib/options_selector_utils.py +26 -5
  2. streamlit/elements/widgets/button_group.py +42 -11
  3. streamlit/elements/widgets/multiselect.py +166 -26
  4. streamlit/elements/widgets/selectbox.py +182 -38
  5. streamlit/proto/MultiSelect_pb2.py +4 -2
  6. streamlit/proto/MultiSelect_pb2.pyi +14 -2
  7. streamlit/proto/Selectbox_pb2.py +4 -2
  8. streamlit/proto/Selectbox_pb2.pyi +15 -2
  9. streamlit/static/index.html +1 -1
  10. streamlit/static/static/js/{FileDownload.esm.DyWffVOd.js → FileDownload.esm.jX-9l2Ep.js} +1 -1
  11. streamlit/static/static/js/{FileHelper.C5Rf1fu1.js → FileHelper.aCeQQwv9.js} +1 -1
  12. streamlit/static/static/js/{FormClearHelper.D2MZi-BE.js → FormClearHelper.CWUgHOqb.js} +1 -1
  13. streamlit/static/static/js/{Hooks.UTpr--3H.js → Hooks.z6bpnOa4.js} +1 -1
  14. streamlit/static/static/js/{InputInstructions.oXzay8Sc.js → InputInstructions.CxNXqmaa.js} +1 -1
  15. streamlit/static/static/js/{ProgressBar.Dkc6afbj.js → ProgressBar.DeJx_v03.js} +1 -1
  16. streamlit/static/static/js/{RenderInPortalIfExists.0vQEaJAa.js → RenderInPortalIfExists.BzVEnQEP.js} +1 -1
  17. streamlit/static/static/js/{Toolbar.BLonzKGv.js → Toolbar.Buaxb3gQ.js} +1 -1
  18. streamlit/static/static/js/{base-input.BVhyctGq.js → base-input.B02pchZb.js} +1 -1
  19. streamlit/static/static/js/{checkbox.DqunhWUH.js → checkbox.BNevNWhL.js} +1 -1
  20. streamlit/static/static/js/{createSuper.CpC2DZ-4.js → createSuper.HF1JI-bK.js} +1 -1
  21. streamlit/static/static/js/{data-grid-overlay-editor.BNc7oQAN.js → data-grid-overlay-editor.DHpEpsQ_.js} +1 -1
  22. streamlit/static/static/js/{downloader.BEmsLcSd.js → downloader.B32k91dq.js} +1 -1
  23. streamlit/static/static/js/{es6.Bka7yuWr.js → es6.j4L3xv_m.js} +2 -2
  24. streamlit/static/static/js/{iframeResizer.contentWindow.CseC9_0j.js → iframeResizer.contentWindow.DQOV--zq.js} +1 -1
  25. streamlit/static/static/js/{index.DcA9oLdi.js → index.1tdxODWC.js} +1 -1
  26. streamlit/static/static/js/{index.DDcRBpz_.js → index.B2-yUxP6.js} +1 -1
  27. streamlit/static/static/js/{index.NwBLa4vX.js → index.B28jf8c_.js} +13 -13
  28. streamlit/static/static/js/{index.DTByMWKb.js → index.BBHrAwbG.js} +1 -1
  29. streamlit/static/static/js/{index.DDfr2vz1.js → index.BDIF1v3E.js} +1 -1
  30. streamlit/static/static/js/{index.-uBfKDNW.js → index.BRDvEQpe.js} +1 -1
  31. streamlit/static/static/js/{index.CdRzA4dY.js → index.BT-PT2u0.js} +1 -1
  32. streamlit/static/static/js/{index.DPXDfP7O.js → index.BTG2J5Pk.js} +1 -1
  33. streamlit/static/static/js/{index.-GEjrTbP.js → index.BUz0sS-V.js} +1 -1
  34. streamlit/static/static/js/{index.sEBYkd7C.js → index.BeuGcxG8.js} +1 -1
  35. streamlit/static/static/js/{index.BgAs7EEH.js → index.BnYJb__c.js} +1 -1
  36. streamlit/static/static/js/{index.BGiS_myV.js → index.C-GJaT09.js} +12 -12
  37. streamlit/static/static/js/{index.CSzYGoqF.js → index.C1B9TyzK.js} +1 -1
  38. streamlit/static/static/js/{index.DfLVo1kK.js → index.CDMGlkYx.js} +1 -1
  39. streamlit/static/static/js/{index.DiZnms3l.js → index.CExICAHy.js} +1 -1
  40. streamlit/static/static/js/{index.Dg6pitBN.js → index.CKYXxi_d.js} +1 -1
  41. streamlit/static/static/js/index.CPMy5pwd.js +1 -0
  42. streamlit/static/static/js/{index.RS9NSuPn.js → index.CTgHTp02.js} +1 -1
  43. streamlit/static/static/js/{index.BPrkMaDs.js → index.CTwaWONb.js} +1 -1
  44. streamlit/static/static/js/{index.DH5gmTNJ.js → index.CcMFXZBL.js} +1 -1
  45. streamlit/static/static/js/index.ChvqDLgw.js +1 -0
  46. streamlit/static/static/js/{index.6ZLFnYFv.js → index.ClfebD_T.js} +1 -1
  47. streamlit/static/static/js/{index.CusXODwm.js → index.CpDe9l-f.js} +1 -1
  48. streamlit/static/static/js/{index.ByG1Ipsd.js → index.Cq_L2WtW.js} +1 -1
  49. streamlit/static/static/js/{index.D_RsV5T3.js → index.DBEif7dq.js} +2 -2
  50. streamlit/static/static/js/{index.DYmhwMwG.js → index.DNURUtUa.js} +2 -2
  51. streamlit/static/static/js/{index.DbB5iceE.js → index.DTDyF8nE.js} +1 -1
  52. streamlit/static/static/js/{index.C7zS3xAk.js → index.DaJw5fna.js} +1 -1
  53. streamlit/static/static/js/{index.-Ex9Sw0j.js → index.DbqewZ6W.js} +1 -1
  54. streamlit/static/static/js/{index.DvCWOxpn.js → index.DfvKnm4Q.js} +1 -1
  55. streamlit/static/static/js/{index.B9r4f8yP.js → index.DsRxnb2z.js} +1 -1
  56. streamlit/static/static/js/index.Nb8G9oM-.js +1 -0
  57. streamlit/static/static/js/{index.YDw6DAY-.js → index.R8Go3XlF.js} +1 -1
  58. streamlit/static/static/js/{index.BPw4HKmU.js → index.Uid-bSyh.js} +1 -1
  59. streamlit/static/static/js/{index.CHsi5M24.js → index.V3D0L00K.js} +1 -1
  60. streamlit/static/static/js/{index.K8WjTi1D.js → index.m0rRkw04.js} +1 -1
  61. streamlit/static/static/js/{index.BSsSumHQ.js → index.qkhdJyyt.js} +6 -6
  62. streamlit/static/static/js/{input.Cf4AxOS9.js → input.DogdK8Cg.js} +1 -1
  63. streamlit/static/static/js/{memory.x6zhEJ8E.js → memory.B_1d0kyG.js} +1 -1
  64. streamlit/static/static/js/{mergeWith.DL-_LuL_.js → mergeWith.9h0p6sC_.js} +1 -1
  65. streamlit/static/static/js/{number-overlay-editor.uQEd6gCw.js → number-overlay-editor.yRe6Yodu.js} +1 -1
  66. streamlit/static/static/js/{possibleConstructorReturn.6K8NTHlH.js → possibleConstructorReturn.C73_6grg.js} +1 -1
  67. streamlit/static/static/js/{sandbox.BY_N7kRf.js → sandbox.2u3nOS5d.js} +1 -1
  68. streamlit/static/static/js/{textarea.BoUKtqfY.js → textarea.DFCEFjUj.js} +1 -1
  69. streamlit/static/static/js/{timepicker.uTqYdkda.js → timepicker.GuNna1EN.js} +1 -1
  70. streamlit/static/static/js/{toConsumableArray.CA_5PwDK.js → toConsumableArray.DARzcvE5.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.CmvPTKOg.js → uniqueId.fceb1ayN.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.aMiqPmlk.js → useBasicWidgetState.D6255-xX.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.DXi6gRKL.js → useOnInputChange.BjnOKne4.js} +1 -1
  74. streamlit/static/static/js/{withFullScreenWrapper._ccFC4BV.js → withFullScreenWrapper.B7h9p1kI.js} +1 -1
  75. streamlit/testing/v1/element_tree.py +8 -3
  76. {streamlit_nightly-1.44.1.dev20250326.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/METADATA +1 -1
  77. {streamlit_nightly-1.44.1.dev20250326.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/RECORD +81 -81
  78. streamlit/static/static/js/index.BgstN8el.js +0 -1
  79. streamlit/static/static/js/index.CRpHYHH-.js +0 -1
  80. streamlit/static/static/js/index.DByvN5ny.js +0 -1
  81. {streamlit_nightly-1.44.1.dev20250326.data → streamlit_nightly-1.44.1.dev20250327.data}/scripts/streamlit.cmd +0 -0
  82. {streamlit_nightly-1.44.1.dev20250326.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/WHEEL +0 -0
  83. {streamlit_nightly-1.44.1.dev20250326.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/entry_points.txt +0 -0
  84. {streamlit_nightly-1.44.1.dev20250326.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/top_level.txt +0 -0
@@ -1,2 +1,2 @@
1
- import{d as Ge,bv as J,r as C,bZ as mt,bM as bt,bw as G,b_ as yt,b$ as Tt,n as me,J as kt,bE as Ot,z as wt,aL as Rt,C as ze,j as re,R as Ve,cn as St,br as Mt,bF as _t,bs as $t,ba as Et,bt as It,S as Ct,co as $e}from"./index.NwBLa4vX.js";import{s as Ne}from"./sprintf.D7DtBTRn.js";import{a as xt}from"./useBasicWidgetState.aMiqPmlk.js";import"./FormClearHelper.D2MZi-BE.js";var se={},H={},ue={},ce={},Ue;function Ie(){if(Ue)return ce;Ue=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"}(e||(ce.Direction=e={})),ce}var He;function Je(){return He||(He=1,function(e){var r=ue&&ue.__spreadArray||function(i,o,u){if(u||arguments.length===2)for(var h=0,b=o.length,g;h<b;h++)(g||!(h in o))&&(g||(g=Array.prototype.slice.call(o,0,h)),g[h]=o[h]);return i.concat(g||Array.prototype.slice.call(o))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var a=Ge(),s=Ie(),p=function(i){var o=i.toString().split(".")[1];return o?o.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function c(i,o,u){var h=(o-i)/u,b=8,g=Number(h.toFixed(b));return parseInt(g.toString(),10)===g}e.isStepDivisible=c;function f(i,o,u,h,b,g,O){var _=1e11;if(i=Math.round(i*_)/_,!g){var P=O[o-1],I=O[o+1];if(P&&P>i)return P;if(I&&I<i)return I}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*_-u*_)%Math.floor(b*_),V=Math.floor(i*_-Math.abs(U)),W=U===0?i:V/_,A=Math.abs(U/_)<b/2?W:W+b,L=(0,e.getStepDecimals)(b);return parseFloat(A.toFixed(L))}e.normalizeValue=f;function j(i,o,u){return(i-o)/(u-o)}e.relativeValue=j;function F(i){return i===s.Direction.Up||i===s.Direction.Down}e.isVertical=F;function B(i,o,u){if(o>=u)throw new RangeError("min (".concat(o,") is equal/bigger than max (").concat(u,")"));if(i<o)throw new RangeError("value (".concat(i,") is smaller than min (").concat(o,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=B;function $(i,o,u){return i<o?o:i>u?u:i}e.checkValuesAgainstBoundaries=$;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(o,u){return i[u]<=o}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var o=window.getComputedStyle(i);return{top:parseInt(o["margin-top"],10),bottom:parseInt(o["margin-bottom"],10),left:parseInt(o["margin-left"],10),right:parseInt(o["margin-right"],10)}}e.getMargin=d;function t(i){var o=window.getComputedStyle(i);return{top:parseInt(o["padding-top"],10)+parseInt(o["border-top-width"],10),bottom:parseInt(o["padding-bottom"],10)+parseInt(o["border-bottom-width"],10),left:parseInt(o["padding-left"],10)+parseInt(o["border-left-width"],10),right:parseInt(o["padding-right"],10)+parseInt(o["border-right-width"],10)}}e.getPaddingAndBorder=t;function n(i,o,u){var h=u?-1:1;i.forEach(function(b,g){return v(b,h*o[g].x,o[g].y)})}e.translateThumbs=n;function l(i,o,u,h){for(var b=0,g=x(i[0],o,u,h),O=1;O<i.length;O++){var _=x(i[O],o,u,h);_<g&&(g=_,b=O)}return b}e.getClosestThumbIndex=l;function v(i,o,u){i.style.transform="translate(".concat(o,"px, ").concat(u,"px)")}e.translate=v;var y=function(i){var o=[],u=null,h=function(){for(var b=[],g=0;g<arguments.length;g++)b[g]=arguments[g];o=b,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,o)}))};return h};e.schd=y;function k(i,o,u){var h=i.slice(0);return h[o]=u,h}e.replaceAt=k;function E(i){var o=i.values,u=i.colors,h=i.min,b=i.max,g=i.direction,O=g===void 0?s.Direction.Right:g,_=i.rtl,P=_===void 0?!1:_;P&&O===s.Direction.Right?O=s.Direction.Left:P&&s.Direction.Left&&(O=s.Direction.Right);var I=o.slice(0).sort(function(V,W){return V-W}).map(function(V){return(V-h)/(b-h)*100}),U=I.reduce(function(V,W,A){return"".concat(V,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(O,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=E;function w(){}e.voidFn=w;function R(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(i,o,u,h,b){b===void 0&&(b=function(O){return O});var g=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(O,_){var P=Math.ceil(_.getBoundingClientRect().width);if(_.innerText&&_.innerText.includes(u)&&_.childElementCount===0){var I=_.cloneNode(!0);I.innerHTML=b(o.toFixed(h)),I.style.visibility="hidden",document.body.appendChild(I),P=Math.ceil(I.getBoundingClientRect().width),document.body.removeChild(I)}return P>O?P:O},i.getBoundingClientRect().width));return g},D=function(i,o,u,h,b,g,O){O===void 0&&(O=function(I){return I});var _=[],P=function(I){var U=M(u[I],h[I],b,g,O),V=o[I].x;o.forEach(function(W,A){var L=W.x,X=M(u[A],h[A],b,g,O);I!==A&&(V>=L&&V<=L+X||V+U>=L&&V+U<=L+X)&&(_.includes(A)||(_.push(I),_.push(A),_=r(r([],_,!0),[I,A],!1),P(A)))})};return P(i),Array.from(new Set(_.sort()))},m=function(i,o,u,h,b,g){h===void 0&&(h=.1),b===void 0&&(b=" - "),g===void 0&&(g=function(A){return A});var O=(0,e.getStepDecimals)(h),_=(0,a.useState)({}),P=_[0],I=_[1],U=(0,a.useState)(g(o[u].toFixed(O))),V=U[0],W=U[1];return(0,a.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},X=i.getOffsets(),ne=D(u,X,A,o,b,O,g),le=g(o[u].toFixed(O));if(ne.length){var Q=ne.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[X[pe[ge]].x],!1):[X[pe[ge]].x]},[]);if(Math.min.apply(Math,Q)===X[u].x){var de=[];ne.forEach(function(ee){de.push(o[ee].toFixed(O))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(g).join(b);var fe=Math.min.apply(Math,Q),he=Math.max.apply(Math,Q),_e=A[ne[Q.indexOf(he)]].getBoundingClientRect().width;L.left="".concat(Math.abs(fe-(he+_e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}W(le),I(L)}},[i,o]),[V,P]};e.useThumbOverlap=m;function x(i,o,u,h){var b=i.getBoundingClientRect(),g=b.left,O=b.top,_=b.width,P=b.height;return F(h)?Math.abs(u-(O+P/2)):Math.abs(o-(g+_/2))}var z=function(){var i,o=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(o)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=z}(ue)),ue}var We;function Dt(){if(We)return H;We=1;var e=H&&H.__extends||function(){var $=function(T,d){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])},$(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");$(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=H&&H.__createBinding||(Object.create?function($,T,d,t){t===void 0&&(t=d);var n=Object.getOwnPropertyDescriptor(T,d);(!n||("get"in n?!T.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty($,t,n)}:function($,T,d,t){t===void 0&&(t=d),$[t]=T[d]}),a=H&&H.__setModuleDefault||(Object.create?function($,T){Object.defineProperty($,"default",{enumerable:!0,value:T})}:function($,T){$.default=T}),s=H&&H.__importStar||function($){if($&&$.__esModule)return $;var T={};if($!=null)for(var d in $)d!=="default"&&Object.prototype.hasOwnProperty.call($,d)&&r(T,$,d);return a(T,$),T},p=H&&H.__spreadArray||function($,T,d){if(d||arguments.length===2)for(var t=0,n=T.length,l;t<n;t++)(l||!(t in T))&&(l||(l=Array.prototype.slice.call(T,0,t)),l[t]=T[t]);return $.concat(l||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var S=s(Ge()),c=Je(),f=Ie(),j=["ArrowRight","ArrowUp","k","PageUp"],F=["ArrowLeft","ArrowDown","j","PageDown"],B=function($){e(T,$);function T(d){var t=$.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(n,l){return l}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var n=t.props,l=n.direction,v=n.values,y=n.min,k=n.max,E=t.trackRef.current;if(!E)return console.warn("No track element found."),[];var w=E.getBoundingClientRect(),R=(0,c.getPaddingAndBorder)(E);return t.getThumbs().map(function(M,D){var m={x:0,y:0},x=M.getBoundingClientRect(),z=(0,c.getMargin)(M);switch(l){case f.Direction.Right:return m.x=(z.left+R.left)*-1,m.y=((x.height-w.height)/2+R.top)*-1,m.x+=w.width*(0,c.relativeValue)(v[D],y,k)-x.width/2,m;case f.Direction.Left:return m.x=(z.right+R.right)*-1,m.y=((x.height-w.height)/2+R.top)*-1,m.x+=w.width-w.width*(0,c.relativeValue)(v[D],y,k)-x.width/2,m;case f.Direction.Up:return m.x=((x.width-w.width)/2+z.left+R.left)*-1,m.y=-R.left,m.y+=w.height-w.height*(0,c.relativeValue)(v[D],y,k)-x.height/2,m;case f.Direction.Down:return m.x=((x.width-w.width)/2+z.left+R.left)*-1,m.y=-R.left,m.y+=w.height*(0,c.relativeValue)(v[D],y,k)-x.height/2,m;default:return(0,c.assertUnreachable)(l)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(n){return n.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(n){return t.getThumbs().findIndex(function(l){return l===n.target||l.contains(n.target)})},t.addTouchEvents=function(n){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(n){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(n){var l;if(!(n.button!==0||(0,c.isIOS)()))if(n.persist(),n.preventDefault(),t.addMouseEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.clientX,n.clientY]},function(){return t.onMove(n.clientX,n.clientY)})}else{var v=(0,c.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),n.clientX,n.clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(n.clientX,n.clientY)})}},t.onResize=function(){(0,c.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(n){var l;if(n.persist(),t.addTouchEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.touches[0].clientX,n.touches[0].clientY]},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}else{var v=(0,c.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),n.touches[0].clientX,n.touches[0].clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}},t.onMouseOrTouchStart=function(n){if(!t.props.disabled){var l=(0,c.isTouchEvent)(n);if(!(!l&&n.button!==0)){var v=t.getTargetIndex(n);v!==-1&&(l?t.addTouchEvents(n):t.addMouseEvents(n),t.setState({draggedThumbIndex:v,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===v?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[v]?y:y-1})}))}}},t.onMouseMove=function(n){n.preventDefault(),t.onMove(n.clientX,n.clientY)},t.onTouchMove=function(n){n.preventDefault(),t.onMove(n.touches[0].clientX,n.touches[0].clientY)},t.onKeyDown=function(n){var l=t.props,v=l.values,y=l.onChange,k=l.step,E=l.rtl,w=l.direction,R=t.state.isChanged,M=t.getTargetIndex(n.nativeEvent),D=E||w===f.Direction.Left||w===f.Direction.Down?-1:1;M!==-1&&(j.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,c.replaceAt)(v,M,t.normalizeValue(v[M]+D*(n.key==="PageUp"?k*10:k),M)))):F.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,c.replaceAt)(v,M,t.normalizeValue(v[M]-D*(n.key==="PageDown"?k*10:k),M)))):n.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(n){var l=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){l&&t.fireOnFinalChange()})},t.onMove=function(n,l){var v=t.state,y=v.draggedThumbIndex,k=v.draggedTrackPos,E=t.props,w=E.direction,R=E.min,M=E.max,D=E.onChange,m=E.values,x=E.step,z=E.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var o=i.getBoundingClientRect(),u=(0,c.isVertical)(w)?o.height:o.width;if(k[0]!==-1&&k[1]!==-1){var h=n-k[0],b=l-k[1],g=0;switch(w){case f.Direction.Right:case f.Direction.Left:g=h/u*(M-R);break;case f.Direction.Down:case f.Direction.Up:g=b/u*(M-R);break;default:(0,c.assertUnreachable)(w)}if(z&&(g*=-1),Math.abs(g)>=x/2){for(var O=0;O<t.thumbRefs.length;O++){if(m[O]===M&&Math.sign(g)===1||m[O]===R&&Math.sign(g)===-1)return;var _=m[O]+g;_>M?g=M-m[O]:_<R&&(g=R-m[O])}for(var P=m.slice(0),O=0;O<t.thumbRefs.length;O++)P=(0,c.replaceAt)(P,O,t.normalizeValue(m[O]+g,O));t.setState({draggedTrackPos:[n,l]}),D(P)}}else{var I=0;switch(w){case f.Direction.Right:I=(n-o.left)/u*(M-R)+R;break;case f.Direction.Left:I=(u-(n-o.left))/u*(M-R)+R;break;case f.Direction.Down:I=(l-o.top)/u*(M-R)+R;break;case f.Direction.Up:I=(u-(l-o.top))/u*(M-R)+R;break;default:(0,c.assertUnreachable)(w)}z&&(I=M+R-I),Math.abs(m[y]-I)>=x/2&&D((0,c.replaceAt)(m,y,t.normalizeValue(I,y)))}},t.normalizeValue=function(n,l){var v=t.props,y=v.min,k=v.max,E=v.step,w=v.allowOverlap,R=v.values;return(0,c.normalizeValue)(n,l,y,k,E,w,R)},t.onEnd=function(n){if(n.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var n=t.props,l=n.onFinalChange,v=n.values;l&&l(v)},t.updateMarkRefs=function(n){if(!n.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(n.max-n.min)/t.props.step,t.markRefs=[];for(var l=0;l<t.numOfMarks+1;l++)t.markRefs[l]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var n=window.getComputedStyle(t.trackRef.current),l=parseInt(n.width,10),v=parseInt(n.height,10),y=parseInt(n.paddingLeft,10),k=parseInt(n.paddingTop,10),E=[],w=0;w<t.numOfMarks+1;w++){var R=9999,M=9999;if(t.markRefs[w].current){var D=t.markRefs[w].current.getBoundingClientRect();R=D.height,M=D.width}t.props.direction===f.Direction.Left||t.props.direction===f.Direction.Right?E.push([Math.round(l/t.numOfMarks*w+y-M/2),-Math.round((R-v)/2)]):E.push([Math.round(v/t.numOfMarks*w+k-R/2),-Math.round((M-l)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,c.schd)(t.onMouseMove),t.schdOnTouchMove=(0,c.schd)(t.onTouchMove),t.schdOnEnd=(0,c.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,n=t.values,l=t.min,v=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,c.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,c.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,c.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach(function(y){(0,c.isStepDivisible)(l,y,v)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var n=this.props,l=n.max,v=n.min,y=n.step,k=n.values,E=n.rtl;(d.max!==l||d.min!==v||d.step!==y)&&this.updateMarkRefs(this.props),(0,c.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==l||d.min!==v||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(w){(0,c.isStepDivisible)(v,w,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,n=t.label,l=t.labelledBy,v=t.renderTrack,y=t.renderThumb,k=t.renderMark,E=k===void 0?function(){return null}:k,w=t.values,R=t.min,M=t.max,D=t.allowOverlap,m=t.disabled,x=this.state,z=x.draggedThumbIndex,i=x.thumbZIndexes,o=x.markOffsets;return v({props:{style:{transform:"scale(1)",cursor:z>-1?"grabbing":this.props.draggableTrack?(0,c.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!m?"pointer":"inherit"},onMouseDown:m?c.voidFn:this.onMouseDownTrack,onTouchStart:m?c.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:m,children:p(p([],o.map(function(u,h,b){return E({props:{style:d.props.direction===f.Direction.Left||d.props.direction===f.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(h),ref:d.markRefs[h]},index:h})}),!0),w.map(function(u,h){var b=d.state.draggedThumbIndex===h;return y({index:h,value:u,isDragged:b,props:{style:{position:"absolute",zIndex:i[h],cursor:m?"inherit":b?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:m?void 0:0,"aria-valuemax":D?M:w[h+1]||M,"aria-valuemin":D?R:w[h-1]||R,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":n,"aria-labelledby":l,role:"slider",onKeyDown:m?c.voidFn:d.onKeyDown,onKeyUp:m?c.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:f.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T}(S.Component);return H.default=B,H}var qe;function Pt(){return qe||(qe=1,function(e){var r=se&&se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var a=r(Dt());e.Range=a.default;var s=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})}(se)),se}var Qe=Pt();function Ke(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),a.push.apply(a,s)}return a}function ve(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(a),!0).forEach(function(s){Bt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ke(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Bt(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}var be=J("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$disabled,S=e.$isDragged,c=r.sizing,f="inherit";return p?f="not-allowed":S?f="grabbing":s.length===1&&(f="pointer"),{paddingTop:c.scale600,paddingBottom:c.scale600,paddingRight:c.scale600,paddingLeft:c.scale600,display:"flex",cursor:f,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$min,S=e.$max,c=e.$disabled,f=r.colors,j=r.borders,F=r.direction,B=r.borders.useRoundedCorners?j.radius100:0;return{borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,background:Qe.getTrackBackground({values:s,colors:s.length===1?[c?f.borderOpaque:f.primary,c?f.backgroundSecondary:f.borderOpaque]:[c?f.backgroundSecondary:f.borderOpaque,c?f.borderOpaque:f.primary,c?f.backgroundSecondary:f.borderOpaque],min:p||0,max:S||0,rtl:F==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:c?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=J("div",function(e){var r=e.$theme,a=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:a.scale600,paddingLeft:a.scale600,paddingBottom:a.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$thumbIndex,S=e.$disabled,c=s.length===2&&p===0,f=s.length===2&&p===1;return r.direction==="rtl"&&(f||c)&&(c=!c,f=!f),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=J("div",function(e){var r=e.$disabled,a=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=J("div",function(e){var r=e.$disabled,a=e.$theme;return ve(ve({position:"absolute",top:"-".concat(a.sizing.scale1400)},a.typography.font200),{},{backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill,color:a.colors.contentInversePrimary,paddingLeft:a.sizing.scale600,paddingRight:a.sizing.scale600,paddingTop:a.sizing.scale500,paddingBottom:a.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ye(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),a.push.apply(a,s)}return a}function At(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(a),!0).forEach(function(s){Lt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ye(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Lt(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Y.apply(this,arguments)}function K(e,r){return Vt(e)||zt(e,r)||jt(e,r)||Ft()}function Ft(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{d as Ge,bv as J,r as C,bZ as mt,bM as bt,bw as G,b_ as yt,b$ as Tt,n as me,J as kt,bE as Ot,z as wt,aL as Rt,C as ze,j as re,R as Ve,cn as St,br as Mt,bF as _t,bs as $t,ba as Et,bt as It,S as Ct,co as $e}from"./index.B28jf8c_.js";import{s as Ne}from"./sprintf.D7DtBTRn.js";import{a as xt}from"./useBasicWidgetState.D6255-xX.js";import"./FormClearHelper.CWUgHOqb.js";var se={},H={},ue={},ce={},Ue;function Ie(){if(Ue)return ce;Ue=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"}(e||(ce.Direction=e={})),ce}var He;function Je(){return He||(He=1,function(e){var r=ue&&ue.__spreadArray||function(i,o,u){if(u||arguments.length===2)for(var h=0,b=o.length,g;h<b;h++)(g||!(h in o))&&(g||(g=Array.prototype.slice.call(o,0,h)),g[h]=o[h]);return i.concat(g||Array.prototype.slice.call(o))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var a=Ge(),s=Ie(),p=function(i){var o=i.toString().split(".")[1];return o?o.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function c(i,o,u){var h=(o-i)/u,b=8,g=Number(h.toFixed(b));return parseInt(g.toString(),10)===g}e.isStepDivisible=c;function f(i,o,u,h,b,g,O){var _=1e11;if(i=Math.round(i*_)/_,!g){var P=O[o-1],I=O[o+1];if(P&&P>i)return P;if(I&&I<i)return I}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*_-u*_)%Math.floor(b*_),V=Math.floor(i*_-Math.abs(U)),W=U===0?i:V/_,A=Math.abs(U/_)<b/2?W:W+b,L=(0,e.getStepDecimals)(b);return parseFloat(A.toFixed(L))}e.normalizeValue=f;function j(i,o,u){return(i-o)/(u-o)}e.relativeValue=j;function F(i){return i===s.Direction.Up||i===s.Direction.Down}e.isVertical=F;function B(i,o,u){if(o>=u)throw new RangeError("min (".concat(o,") is equal/bigger than max (").concat(u,")"));if(i<o)throw new RangeError("value (".concat(i,") is smaller than min (").concat(o,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=B;function $(i,o,u){return i<o?o:i>u?u:i}e.checkValuesAgainstBoundaries=$;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(o,u){return i[u]<=o}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var o=window.getComputedStyle(i);return{top:parseInt(o["margin-top"],10),bottom:parseInt(o["margin-bottom"],10),left:parseInt(o["margin-left"],10),right:parseInt(o["margin-right"],10)}}e.getMargin=d;function t(i){var o=window.getComputedStyle(i);return{top:parseInt(o["padding-top"],10)+parseInt(o["border-top-width"],10),bottom:parseInt(o["padding-bottom"],10)+parseInt(o["border-bottom-width"],10),left:parseInt(o["padding-left"],10)+parseInt(o["border-left-width"],10),right:parseInt(o["padding-right"],10)+parseInt(o["border-right-width"],10)}}e.getPaddingAndBorder=t;function n(i,o,u){var h=u?-1:1;i.forEach(function(b,g){return v(b,h*o[g].x,o[g].y)})}e.translateThumbs=n;function l(i,o,u,h){for(var b=0,g=x(i[0],o,u,h),O=1;O<i.length;O++){var _=x(i[O],o,u,h);_<g&&(g=_,b=O)}return b}e.getClosestThumbIndex=l;function v(i,o,u){i.style.transform="translate(".concat(o,"px, ").concat(u,"px)")}e.translate=v;var y=function(i){var o=[],u=null,h=function(){for(var b=[],g=0;g<arguments.length;g++)b[g]=arguments[g];o=b,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,o)}))};return h};e.schd=y;function k(i,o,u){var h=i.slice(0);return h[o]=u,h}e.replaceAt=k;function E(i){var o=i.values,u=i.colors,h=i.min,b=i.max,g=i.direction,O=g===void 0?s.Direction.Right:g,_=i.rtl,P=_===void 0?!1:_;P&&O===s.Direction.Right?O=s.Direction.Left:P&&s.Direction.Left&&(O=s.Direction.Right);var I=o.slice(0).sort(function(V,W){return V-W}).map(function(V){return(V-h)/(b-h)*100}),U=I.reduce(function(V,W,A){return"".concat(V,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(O,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=E;function w(){}e.voidFn=w;function R(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(i,o,u,h,b){b===void 0&&(b=function(O){return O});var g=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(O,_){var P=Math.ceil(_.getBoundingClientRect().width);if(_.innerText&&_.innerText.includes(u)&&_.childElementCount===0){var I=_.cloneNode(!0);I.innerHTML=b(o.toFixed(h)),I.style.visibility="hidden",document.body.appendChild(I),P=Math.ceil(I.getBoundingClientRect().width),document.body.removeChild(I)}return P>O?P:O},i.getBoundingClientRect().width));return g},D=function(i,o,u,h,b,g,O){O===void 0&&(O=function(I){return I});var _=[],P=function(I){var U=M(u[I],h[I],b,g,O),V=o[I].x;o.forEach(function(W,A){var L=W.x,X=M(u[A],h[A],b,g,O);I!==A&&(V>=L&&V<=L+X||V+U>=L&&V+U<=L+X)&&(_.includes(A)||(_.push(I),_.push(A),_=r(r([],_,!0),[I,A],!1),P(A)))})};return P(i),Array.from(new Set(_.sort()))},m=function(i,o,u,h,b,g){h===void 0&&(h=.1),b===void 0&&(b=" - "),g===void 0&&(g=function(A){return A});var O=(0,e.getStepDecimals)(h),_=(0,a.useState)({}),P=_[0],I=_[1],U=(0,a.useState)(g(o[u].toFixed(O))),V=U[0],W=U[1];return(0,a.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},X=i.getOffsets(),ne=D(u,X,A,o,b,O,g),le=g(o[u].toFixed(O));if(ne.length){var Q=ne.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[X[pe[ge]].x],!1):[X[pe[ge]].x]},[]);if(Math.min.apply(Math,Q)===X[u].x){var de=[];ne.forEach(function(ee){de.push(o[ee].toFixed(O))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(g).join(b);var fe=Math.min.apply(Math,Q),he=Math.max.apply(Math,Q),_e=A[ne[Q.indexOf(he)]].getBoundingClientRect().width;L.left="".concat(Math.abs(fe-(he+_e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}W(le),I(L)}},[i,o]),[V,P]};e.useThumbOverlap=m;function x(i,o,u,h){var b=i.getBoundingClientRect(),g=b.left,O=b.top,_=b.width,P=b.height;return F(h)?Math.abs(u-(O+P/2)):Math.abs(o-(g+_/2))}var z=function(){var i,o=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(o)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=z}(ue)),ue}var We;function Dt(){if(We)return H;We=1;var e=H&&H.__extends||function(){var $=function(T,d){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])},$(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");$(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=H&&H.__createBinding||(Object.create?function($,T,d,t){t===void 0&&(t=d);var n=Object.getOwnPropertyDescriptor(T,d);(!n||("get"in n?!T.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty($,t,n)}:function($,T,d,t){t===void 0&&(t=d),$[t]=T[d]}),a=H&&H.__setModuleDefault||(Object.create?function($,T){Object.defineProperty($,"default",{enumerable:!0,value:T})}:function($,T){$.default=T}),s=H&&H.__importStar||function($){if($&&$.__esModule)return $;var T={};if($!=null)for(var d in $)d!=="default"&&Object.prototype.hasOwnProperty.call($,d)&&r(T,$,d);return a(T,$),T},p=H&&H.__spreadArray||function($,T,d){if(d||arguments.length===2)for(var t=0,n=T.length,l;t<n;t++)(l||!(t in T))&&(l||(l=Array.prototype.slice.call(T,0,t)),l[t]=T[t]);return $.concat(l||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var S=s(Ge()),c=Je(),f=Ie(),j=["ArrowRight","ArrowUp","k","PageUp"],F=["ArrowLeft","ArrowDown","j","PageDown"],B=function($){e(T,$);function T(d){var t=$.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(n,l){return l}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var n=t.props,l=n.direction,v=n.values,y=n.min,k=n.max,E=t.trackRef.current;if(!E)return console.warn("No track element found."),[];var w=E.getBoundingClientRect(),R=(0,c.getPaddingAndBorder)(E);return t.getThumbs().map(function(M,D){var m={x:0,y:0},x=M.getBoundingClientRect(),z=(0,c.getMargin)(M);switch(l){case f.Direction.Right:return m.x=(z.left+R.left)*-1,m.y=((x.height-w.height)/2+R.top)*-1,m.x+=w.width*(0,c.relativeValue)(v[D],y,k)-x.width/2,m;case f.Direction.Left:return m.x=(z.right+R.right)*-1,m.y=((x.height-w.height)/2+R.top)*-1,m.x+=w.width-w.width*(0,c.relativeValue)(v[D],y,k)-x.width/2,m;case f.Direction.Up:return m.x=((x.width-w.width)/2+z.left+R.left)*-1,m.y=-R.left,m.y+=w.height-w.height*(0,c.relativeValue)(v[D],y,k)-x.height/2,m;case f.Direction.Down:return m.x=((x.width-w.width)/2+z.left+R.left)*-1,m.y=-R.left,m.y+=w.height*(0,c.relativeValue)(v[D],y,k)-x.height/2,m;default:return(0,c.assertUnreachable)(l)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(n){return n.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(n){return t.getThumbs().findIndex(function(l){return l===n.target||l.contains(n.target)})},t.addTouchEvents=function(n){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(n){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(n){var l;if(!(n.button!==0||(0,c.isIOS)()))if(n.persist(),n.preventDefault(),t.addMouseEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.clientX,n.clientY]},function(){return t.onMove(n.clientX,n.clientY)})}else{var v=(0,c.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),n.clientX,n.clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(n.clientX,n.clientY)})}},t.onResize=function(){(0,c.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(n){var l;if(n.persist(),t.addTouchEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.touches[0].clientX,n.touches[0].clientY]},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}else{var v=(0,c.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),n.touches[0].clientX,n.touches[0].clientY,t.props.direction);(l=t.thumbRefs[v].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:v},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}},t.onMouseOrTouchStart=function(n){if(!t.props.disabled){var l=(0,c.isTouchEvent)(n);if(!(!l&&n.button!==0)){var v=t.getTargetIndex(n);v!==-1&&(l?t.addTouchEvents(n):t.addMouseEvents(n),t.setState({draggedThumbIndex:v,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===v?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[v]?y:y-1})}))}}},t.onMouseMove=function(n){n.preventDefault(),t.onMove(n.clientX,n.clientY)},t.onTouchMove=function(n){n.preventDefault(),t.onMove(n.touches[0].clientX,n.touches[0].clientY)},t.onKeyDown=function(n){var l=t.props,v=l.values,y=l.onChange,k=l.step,E=l.rtl,w=l.direction,R=t.state.isChanged,M=t.getTargetIndex(n.nativeEvent),D=E||w===f.Direction.Left||w===f.Direction.Down?-1:1;M!==-1&&(j.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,c.replaceAt)(v,M,t.normalizeValue(v[M]+D*(n.key==="PageUp"?k*10:k),M)))):F.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,c.replaceAt)(v,M,t.normalizeValue(v[M]-D*(n.key==="PageDown"?k*10:k),M)))):n.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(n){var l=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){l&&t.fireOnFinalChange()})},t.onMove=function(n,l){var v=t.state,y=v.draggedThumbIndex,k=v.draggedTrackPos,E=t.props,w=E.direction,R=E.min,M=E.max,D=E.onChange,m=E.values,x=E.step,z=E.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var o=i.getBoundingClientRect(),u=(0,c.isVertical)(w)?o.height:o.width;if(k[0]!==-1&&k[1]!==-1){var h=n-k[0],b=l-k[1],g=0;switch(w){case f.Direction.Right:case f.Direction.Left:g=h/u*(M-R);break;case f.Direction.Down:case f.Direction.Up:g=b/u*(M-R);break;default:(0,c.assertUnreachable)(w)}if(z&&(g*=-1),Math.abs(g)>=x/2){for(var O=0;O<t.thumbRefs.length;O++){if(m[O]===M&&Math.sign(g)===1||m[O]===R&&Math.sign(g)===-1)return;var _=m[O]+g;_>M?g=M-m[O]:_<R&&(g=R-m[O])}for(var P=m.slice(0),O=0;O<t.thumbRefs.length;O++)P=(0,c.replaceAt)(P,O,t.normalizeValue(m[O]+g,O));t.setState({draggedTrackPos:[n,l]}),D(P)}}else{var I=0;switch(w){case f.Direction.Right:I=(n-o.left)/u*(M-R)+R;break;case f.Direction.Left:I=(u-(n-o.left))/u*(M-R)+R;break;case f.Direction.Down:I=(l-o.top)/u*(M-R)+R;break;case f.Direction.Up:I=(u-(l-o.top))/u*(M-R)+R;break;default:(0,c.assertUnreachable)(w)}z&&(I=M+R-I),Math.abs(m[y]-I)>=x/2&&D((0,c.replaceAt)(m,y,t.normalizeValue(I,y)))}},t.normalizeValue=function(n,l){var v=t.props,y=v.min,k=v.max,E=v.step,w=v.allowOverlap,R=v.values;return(0,c.normalizeValue)(n,l,y,k,E,w,R)},t.onEnd=function(n){if(n.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var n=t.props,l=n.onFinalChange,v=n.values;l&&l(v)},t.updateMarkRefs=function(n){if(!n.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(n.max-n.min)/t.props.step,t.markRefs=[];for(var l=0;l<t.numOfMarks+1;l++)t.markRefs[l]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var n=window.getComputedStyle(t.trackRef.current),l=parseInt(n.width,10),v=parseInt(n.height,10),y=parseInt(n.paddingLeft,10),k=parseInt(n.paddingTop,10),E=[],w=0;w<t.numOfMarks+1;w++){var R=9999,M=9999;if(t.markRefs[w].current){var D=t.markRefs[w].current.getBoundingClientRect();R=D.height,M=D.width}t.props.direction===f.Direction.Left||t.props.direction===f.Direction.Right?E.push([Math.round(l/t.numOfMarks*w+y-M/2),-Math.round((R-v)/2)]):E.push([Math.round(v/t.numOfMarks*w+k-R/2),-Math.round((M-l)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,c.schd)(t.onMouseMove),t.schdOnTouchMove=(0,c.schd)(t.onTouchMove),t.schdOnEnd=(0,c.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,n=t.values,l=t.min,v=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,c.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,c.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,c.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach(function(y){(0,c.isStepDivisible)(l,y,v)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var n=this.props,l=n.max,v=n.min,y=n.step,k=n.values,E=n.rtl;(d.max!==l||d.min!==v||d.step!==y)&&this.updateMarkRefs(this.props),(0,c.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==l||d.min!==v||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(w){(0,c.isStepDivisible)(v,w,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,n=t.label,l=t.labelledBy,v=t.renderTrack,y=t.renderThumb,k=t.renderMark,E=k===void 0?function(){return null}:k,w=t.values,R=t.min,M=t.max,D=t.allowOverlap,m=t.disabled,x=this.state,z=x.draggedThumbIndex,i=x.thumbZIndexes,o=x.markOffsets;return v({props:{style:{transform:"scale(1)",cursor:z>-1?"grabbing":this.props.draggableTrack?(0,c.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!m?"pointer":"inherit"},onMouseDown:m?c.voidFn:this.onMouseDownTrack,onTouchStart:m?c.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:m,children:p(p([],o.map(function(u,h,b){return E({props:{style:d.props.direction===f.Direction.Left||d.props.direction===f.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(h),ref:d.markRefs[h]},index:h})}),!0),w.map(function(u,h){var b=d.state.draggedThumbIndex===h;return y({index:h,value:u,isDragged:b,props:{style:{position:"absolute",zIndex:i[h],cursor:m?"inherit":b?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:m?void 0:0,"aria-valuemax":D?M:w[h+1]||M,"aria-valuemin":D?R:w[h-1]||R,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":n,"aria-labelledby":l,role:"slider",onKeyDown:m?c.voidFn:d.onKeyDown,onKeyUp:m?c.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:f.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T}(S.Component);return H.default=B,H}var qe;function Pt(){return qe||(qe=1,function(e){var r=se&&se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var a=r(Dt());e.Range=a.default;var s=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})}(se)),se}var Qe=Pt();function Ke(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),a.push.apply(a,s)}return a}function ve(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(a),!0).forEach(function(s){Bt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ke(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Bt(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}var be=J("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$disabled,S=e.$isDragged,c=r.sizing,f="inherit";return p?f="not-allowed":S?f="grabbing":s.length===1&&(f="pointer"),{paddingTop:c.scale600,paddingBottom:c.scale600,paddingRight:c.scale600,paddingLeft:c.scale600,display:"flex",cursor:f,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$min,S=e.$max,c=e.$disabled,f=r.colors,j=r.borders,F=r.direction,B=r.borders.useRoundedCorners?j.radius100:0;return{borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,background:Qe.getTrackBackground({values:s,colors:s.length===1?[c?f.borderOpaque:f.primary,c?f.backgroundSecondary:f.borderOpaque]:[c?f.backgroundSecondary:f.borderOpaque,c?f.borderOpaque:f.primary,c?f.backgroundSecondary:f.borderOpaque],min:p||0,max:S||0,rtl:F==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:c?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=J("div",function(e){var r=e.$theme,a=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:a.scale600,paddingLeft:a.scale600,paddingBottom:a.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,p=e.$thumbIndex,S=e.$disabled,c=s.length===2&&p===0,f=s.length===2&&p===1;return r.direction==="rtl"&&(f||c)&&(c=!c,f=!f),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=J("div",function(e){var r=e.$disabled,a=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=J("div",function(e){var r=e.$disabled,a=e.$theme;return ve(ve({position:"absolute",top:"-".concat(a.sizing.scale1400)},a.typography.font200),{},{backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill,color:a.colors.contentInversePrimary,paddingLeft:a.sizing.scale600,paddingRight:a.sizing.scale600,paddingTop:a.sizing.scale500,paddingBottom:a.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ye(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),a.push.apply(a,s)}return a}function At(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(a),!0).forEach(function(s){Lt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ye(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Lt(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Y.apply(this,arguments)}function K(e,r){return Vt(e)||zt(e,r)||jt(e,r)||Ft()}function Ft(){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 jt(e,r){if(e){if(typeof e=="string")return Ze(e,r);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ze(e,r)}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var a=0,s=new Array(r);a<r;a++)s[a]=e[a];return s}function zt(e,r){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var s=[],p=!0,S=!1,c,f;try{for(a=a.call(e);!(p=(c=a.next()).done)&&(s.push(c.value),!(r&&s.length===r));p=!0);}catch(j){S=!0,f=j}finally{try{!p&&a.return!=null&&a.return()}finally{if(S)throw f}}return s}}function Vt(e){if(Array.isArray(e))return e}var Nt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function Ut(e){var r=e.overrides,a=r===void 0?{}:r,s=e.disabled,p=s===void 0?!1:s,S=e.marks,c=S===void 0?!1:S,f=e.onChange,j=f===void 0?function(){}:f,F=e.onFinalChange,B=F===void 0?function(){}:F,$=e.min,T=$===void 0?0:$,d=e.max,t=d===void 0?100:d,n=e.step,l=n===void 0?1:n,v=e.persistentThumb,y=v===void 0?!1:v,k=e.valueToLabel,E=k===void 0?function(Z){return Z}:k,w=e.value,R=C.useContext(mt),M=C.useState(!1),D=K(M,2),m=D[0],x=D[1],z=C.useState(!1),i=K(z,2),o=i[0],u=i[1],h=C.useState(!1),b=K(h,2),g=b[0],O=b[1],_=C.useState(-1),P=K(_,2),I=P[0],U=P[1],V=C.useCallback(function(Z){bt(Z)&&O(!0);var N=Z.target.parentNode.firstChild===Z.target?0:1;U(N)},[]),W=C.useCallback(function(Z){g!==!1&&O(!1),U(-1)},[]),A=Nt(w),L={$disabled:p,$step:l,$min:T,$max:t,$marks:c,$value:A,$isFocusVisible:g},X=G(a.Root,be),ne=K(X,2),le=ne[0],Q=ne[1],de=G(a.Track,ye),fe=K(de,2),he=fe[0],_e=fe[1],ee=G(a.InnerTrack,Te),oe=K(ee,2),ge=oe[0],pe=oe[1],et=G(a.Thumb,Re),Ce=K(et,2),tt=Ce[0],rt=Ce[1],nt=G(a.InnerThumb,Se),xe=K(nt,2),at=xe[0],it=xe[1],ot=G(a.ThumbValue,Me),De=K(ot,2),st=De[0],ut=De[1],ct=G(a.Tick,Oe),Pe=K(ct,2),Be=Pe[0],Ae=Pe[1],lt=G(a.TickBar,we),Le=K(lt,2),dt=Le[0],ft=Le[1],ht=G(a.Mark,ke),Fe=K(ht,2),gt=Fe[0],pt=Fe[1];return C.createElement(le,Y({"data-baseweb":"slider"},L,Q,{onFocus:Tt(Q,V),onBlur:yt(Q,W)}),C.createElement(Qe.Range,Y({step:l,min:T,max:t,values:A,disabled:p,onChange:function(N){return j({value:N})},onFinalChange:function(N){return B({value:N})},rtl:R.direction==="rtl",renderTrack:function(N){var te=N.props,q=N.children,ae=N.isDragged;return C.createElement(he,Y({onMouseDown:te.onMouseDown,onTouchStart:te.onTouchStart,$isDragged:ae},L,_e),C.createElement(ge,Y({$isDragged:ae,ref:te.ref},L,pe),q))},renderThumb:function(N){var te=N.props,q=N.index,ae=N.isDragged,je=y||(!!q&&o||!q&&m||ae)&&!p;return C.createElement(tt,Y({},te,{onMouseEnter:function(){q===0?x(!0):u(!0)},onMouseLeave:function(){q===0?x(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:At({},te.style)},L,rt,{$isFocusVisible:g&&I===q}),je&&C.createElement(st,Y({$thumbIndex:q,$isDragged:ae},L,ut),E(A[q])),je&&C.createElement(at,Y({$thumbIndex:q,$isDragged:ae},L,it)))}},c?{renderMark:function(N){var te=N.props,q=N.index;return C.createElement(gt,Y({$markIndex:q},te,L,pt))}}:{})),C.createElement(dt,Y({},L,ft),C.createElement(Be,Y({},L,Ae),E(T)),C.createElement(Be,Y({},L,Ae),E(t))))}const Ht=me("div",{target:"e8lt0n70"})(({disabled:e,theme:r})=>({alignItems:"center",backgroundColor:e?r.colors.gray:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${kt(r.colors.primary,.5)}`}})),Wt=me("div",{target:"e8lt0n71"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.codeFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),qt=me("div",{target:"e8lt0n72"})(({theme:e})=>({fontSize:e.fontSizes.sm,paddingBottom:e.spacing.none,paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingTop:"0.65em",justifyContent:"space-between",alignItems:"center",display:"flex"})),Xe=me("div",{target:"e8lt0n73"})(({disabled:e,theme:r})=>({lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,fontFamily:r.genericFonts.codeFont,color:e?r.colors.fadedText40:"inherit"})),Kt=200;function Yt({disabled:e,element:r,widgetMgr:a,fragmentId:s}){var D;const[p,S]=xt({getStateFromWidgetMgr:Zt,getDefaultStateFromProto:Xt,getCurrStateFromProto:Gt,updateWidgetMgrState:Jt,element:r,widgetMgr:a,fragmentId:s}),[c,f]=C.useState(p),j=C.useRef(null),[F]=C.useState([]),[B]=C.useState([]),{colors:$,fonts:T,fontSizes:d,spacing:t}=wt(),n=c.map(m=>Ee(m,r)),l=Ee(r.min,r),v=Ee(r.max,r),y=r.label;C.useEffect(()=>{f(p)},[p]);const k=C.useCallback(Rt(Kt,m=>{S({value:m,fromUi:!0})}),[]),E=C.useCallback(({value:m})=>{f(m),k(m)},[k]),w=C.useCallback(()=>ze(qt,{"data-testid":"stSliderTickBar",children:[re(Xe,{disabled:e,"data-testid":"stSliderTickBarMin",children:l}),re(Xe,{disabled:e,"data-testid":"stSliderTickBarMax",children:v})]}),[l,v,e]),R=C.useCallback(Ve.forwardRef(function(x,z){const{$thumbIndex:i}=x,o=i||0;F[o]=z,B[o]||(B[o]=Ve.createRef());const u=St(x,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),h=n[o];return re(Ht,{...u,disabled:x.$disabled===!0,ref:F[o],"aria-valuetext":h,"aria-label":y,children:re(Wt,{"data-testid":"stSliderThumbValue",disabled:x.$disabled===!0,ref:B[o],children:h})})}),[]);C.useEffect(()=>{var u,h;B.map((b,g)=>{b.current&&(b.current.innerText=n[g])}),F.map((b,g)=>{b.current&&b.current.setAttribute("aria-valuetext",n[g])});const m=j.current??null,x=F[0].current,z=(u=F[1])==null?void 0:u.current,i=B[0].current,o=(h=B[1])==null?void 0:h.current;tr(m,x,z,i,o)});const M=C.useCallback(({$disabled:m})=>({height:t.twoXS,...m?{background:$.darkenedBgMix25}:{}}),[$,t]);return ze("div",{ref:j,className:"stSlider","data-testid":"stSlider",children:[re(It,{label:r.label,disabled:e,labelVisibility:Mt((D=r.labelVisibility)==null?void 0:D.value),children:r.help&&re(_t,{children:re($t,{content:r.help,placement:Et.TOP_RIGHT})})}),re(Ut,{min:r.min,max:r.max,step:r.step,value:er(c,r),onChange:E,disabled:e,overrides:{Thumb:R,Tick:{style:{fontFamily:T.monospace}},Track:{style:{backgroundColor:"none !important",paddingBottom:t.none,paddingLeft:t.none,paddingRight:t.none,paddingTop:`calc(${d.sm} * 1.35)`}},InnerTrack:{style:M},TickBar:w}})]})}function Zt(e,r){return e.getDoubleArrayValue(r)}function Xt(e){return e.default}function Gt(e){return e.value}function Jt(e,r,a,s){r.setDoubleArrayValue(e,a.value,{fromUi:a.fromUi},s)}function Qt(e){const{dataType:r}=e;return r===$e.DataType.DATETIME||r===$e.DataType.DATE||r===$e.DataType.TIME}function Ee(e,r){const{format:a,options:s}=r;return Qt(r)?Ct.utc(e/1e3).format(a):s.length>0?Ne.sprintf(a,s[e]):Ne.sprintf(a,e)}function er(e,r){const{min:a,max:s}=r;let p=e[0],S=e.length>1?e[1]:e[0];return p>S&&(p=S),p<a&&(p=a),p>s&&(p=s),S<a&&(S=a),S>s&&(S=s),e.length>1?[p,S]:[p]}function tr(e,r,a,s,p){!e||!r||!s||(ie(e,r,s),a&&p&&(ie(e,a,p),rr(e,r,a,s,p)))}function ie(e,r,a){const s=e.getBoundingClientRect(),p=r.getBoundingClientRect(),S=a.getBoundingClientRect(),c=p.left+p.width/2,f=c-S.width/2<s.left,j=c+S.width/2>s.right;a.style.left=f?"0":"",a.style.right=j?"0":""}function rr(e,r,a,s,p){const c=e.getBoundingClientRect(),f=r.getBoundingClientRect(),j=a.getBoundingClientRect(),F=s.getBoundingClientRect(),B=p.getBoundingClientRect(),$=c.left+c.width/2,T=f.left+f.width/2,d=j.left+j.width/2,t=T-F.width/2>=c.left,n=d+B.width/2<=c.right,l=f.left-F.width>=c.left,v=j.right+B.width<=c.right,y=t?F.width/2:F.width,k=n?B.width/2:B.width,E=T+y;if(d-k-E>24){ie(e,r,s),ie(e,a,p);return}if(l&&v){s.style.left="",s.style.right=`${Math.round(f.width)}px`,p.style.left=`${Math.round(j.width)}px`,p.style.right="";return}T<$?(ie(e,r,s),p.style.left=`${Math.round(T+y+24-d)}px`,p.style.right=""):(ie(e,a,p),s.style.left="",s.style.right=`${-Math.round(d-k-24-T)}px`)}const sr=Ot(C.memo(Yt));export{sr as default};
@@ -1 +1 @@
1
- import{n,r as t,O as i,j as c,b1 as d,b2 as e,M as g}from"./index.NwBLa4vX.js";const l=n("iframe",{target:"e3tg43n0"})(({theme:o,disableScrolling:r})=>({width:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function s(o){return g(o)||o===""?void 0:o}function m({element:o}){const r=s(o.src),a=i(r)?void 0:s(o.srcdoc);return c(l,{className:"stIFrame","data-testid":"stIFrame",allow:e,disableScrolling:!o.scrolling,src:r,srcDoc:a,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:d,title:"st.iframe"})}const I=t.memo(m);export{I as default};
1
+ import{n,r as t,O as i,j as c,b1 as d,b2 as e,M as g}from"./index.B28jf8c_.js";const l=n("iframe",{target:"e3tg43n0"})(({theme:o,disableScrolling:r})=>({width:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function s(o){return g(o)||o===""?void 0:o}function m({element:o}){const r=s(o.src),a=i(r)?void 0:s(o.srcdoc);return c(l,{className:"stIFrame","data-testid":"stIFrame",allow:e,disableScrolling:!o.scrolling,src:r,srcDoc:a,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:d,title:"st.iframe"})}const I=t.memo(m);export{I as default};
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsx}from"./index.NwBLa4vX.js";/*!
1
+ import{r as reactExports,j as jsx}from"./index.B28jf8c_.js";/*!
2
2
  * Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors
3
3
  * All rights reserved.
4
4
  *
@@ -1 +1 @@
1
- import{n as s,r as f,R as u,aD as x,b9 as b,z as k,j as a,b6 as C,ba as L,C as v,D as T,aC as h}from"./index.NwBLa4vX.js";const w=s("div",{target:"e12r95n60"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),S=s("a",{target:"e12r95n61"})(({disabled:r,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),y=s("span",{target:"e12r95n62"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function D(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function P(r){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(x),e=u.useContext(b),{colors:c}=k(),{disabled:t,element:n}=r,i=D(n.useContainerWidth,e),d=l===n.pageScriptHash,p=g=>{n.external?t&&g.preventDefault():(g.preventDefault(),t||o(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(C,{help:n.help,placement:L.TOP_RIGHT,containerWidth:i,children:a(w,{containerWidth:i,children:v(S,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,containerWidth:i,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(T,{size:"lg",color:t?c.fadedText40:c.bodyText,iconValue:n.icon}),a(y,{disabled:t,children:a(h,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const H=f.memo(P);export{H as default};
1
+ import{n as s,r as f,R as u,aD as x,b9 as b,z as k,j as a,b6 as C,ba as L,C as v,D as T,aC as h}from"./index.B28jf8c_.js";const w=s("div",{target:"e12r95n60"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),S=s("a",{target:"e12r95n61"})(({disabled:r,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),y=s("span",{target:"e12r95n62"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function D(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function P(r){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(x),e=u.useContext(b),{colors:c}=k(),{disabled:t,element:n}=r,i=D(n.useContainerWidth,e),d=l===n.pageScriptHash,p=g=>{n.external?t&&g.preventDefault():(g.preventDefault(),t||o(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(C,{help:n.help,placement:L.TOP_RIGHT,containerWidth:i,children:a(w,{containerWidth:i,children:v(S,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,containerWidth:i,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(T,{size:"lg",color:t?c.fadedText40:c.bodyText,iconValue:n.icon}),a(y,{disabled:t,children:a(h,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const H=f.memo(P);export{H as default};
@@ -1 +1 @@
1
- import{r as c,E as C,_ as b,n as d,H as j,C as g,j as a,bo as m,bp as y,b4 as O,b5 as F,cp as _,cq as q,aZ as G,F as K,bE as Y,R as Z,aA as J,bj as Q,M as h,b as f,bl as ee,bk as te,br as ie,bF as se,bs as le,ba as ne,bt as ae}from"./index.NwBLa4vX.js";import{a as I}from"./index.t--hEgTQ.js";import{F as oe}from"./FormClearHelper.D2MZi-BE.js";import{g as M,F as S,b as re,D as de,I as ce,C as pe,a as ge,s as ue}from"./FileHelper.C5Rf1fu1.js";import{S as he,P as me}from"./ProgressBar.Dkc6afbj.js";import{u as fe}from"./Hooks.UTpr--3H.js";import{U as x}from"./UploadFileInfo.C-jY39rj.js";var D=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});D.displayName="CloudUpload";var B=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});B.displayName="Error";const V=d("section",{target:"e17y52ym0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=d("div",{target:"e17y52ym1"})({marginRight:"auto",alignItems:"center",display:"flex"}),L=d("span",{target:"e17y52ym2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),ye=d("span",{target:"e17y52ym3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),Fe=d("div",{target:"e17y52ym4"})({display:"flex",flexDirection:"column"}),E=d("div",{target:"e17y52ym5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Se=d("ul",{target:"e17y52ym6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),A=d("li",{target:"e17y52ym7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),W=d("div",{target:"e17y52ym8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),k=d("div",{target:"e17y52ym9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),R=d("div",{target:"e17y52ym10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ue=d("span",{target:"e17y52ym11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),xe=d("div",{target:"e17y52ym12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),H=d("small",{target:"e17y52ym13"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),N=d("span",{target:"e17y52ym14"})({}),we=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[L]:{display:"none"},[E]:{paddingRight:e.spacing.lg},[R]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[W]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[A]:{margin:e.spacing.none,padding:e.spacing.none}}),Ie=d("div",{target:"e17y52ym15"})(({theme:e,width:s})=>{if(s<j("23rem"))return we(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const w=d("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),ve=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(L,{children:a(m,{content:D,size:"threeXL"})}),g(Fe,{children:[g(ye,{children:["Drag and drop file",e?"s":""," here"]}),g(w,{children:[`Limit ${M(t,S.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ze=c.memo(ve),Ce=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(de,{onDrop:e,multiple:s,accept:re(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(V,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ze,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(y,{kind:F.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),be=c.memo(Ce),Me=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),De=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Be=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(Me,{"data-testid":"stFileUploaderPagination",children:[a(w,{children:`Showing page ${e} of ${s}`}),g(De,{children:[a(y,{onClick:i,kind:F.MINIMAL,children:a(m,{content:_,size:"xl"})}),a(y,{onClick:t,kind:F.MINIMAL,children:a(m,{content:q,size:"xl"})})]})]}),Ve=c.memo(Be),z=(e,s)=>Math.ceil(e.length/s),Pe=e=>G(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=c.useState(0),[p,U]=c.useState(()=>z(i,t)),u=fe(i);c.useEffect(()=>{u&&u.length!==i.length&&U(z(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},$=()=>{r(Math.max(0,n-1))},X=i.slice(n*t,n*t+t);return g(K,{children:[a(e,{items:X,...o}),i.length>t?a(Ve,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:$}):null]})},e),Le=({fileInfo:e})=>e.status.type==="uploading"?a(me,{value:e.status.progress,size:he.SMALL}):e.status.type==="error"?g(H,{children:[a(Ue,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(N,{children:a(m,{content:B,size:"lg"})})]}):e.status.type==="uploaded"?a(w,{children:M(e.size,S.Byte)}):null,Ee=({fileInfo:e,onDelete:s})=>g(R,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(xe,{children:a(m,{content:ce,size:"twoXL"})}),g(W,{className:"stFileUploaderFileData",children:[a(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(Le,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(y,{onClick:()=>s(e.id),kind:F.MINIMAL,children:a(m,{content:pe,size:"lg"})})})]}),Ae=c.memo(Ee),We=({items:e,onDelete:s})=>a(Se,{children:e.map(t=>a(A,{children:a(Ae,{fileInfo:t,onDelete:s})},t.id))}),ke=Pe(We),Re=e=>a(E,{children:a(ke,{...e})}),He=c.memo(Re);class Ne extends Z.PureComponent{constructor(s){super(s),this.formClearHelper=new oe,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);J(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}Q(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new x(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>ge(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new x(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{I.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{f.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,U=n.fileId,u=n.fileUrls;return new x(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return ue(s,S.Megabyte,S.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new ee({fileId:n,fileUrls:r,name:i,size:l})});return new te({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(Ie,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(ae,{label:t.label,disabled:i,labelVisibility:ie((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(se,{children:a(le,{content:t.help,placement:ne.TOP_RIGHT})})}),a(be,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(He,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Ge=Y(c.memo(Ne));export{Ge as default};
1
+ import{r as c,E as C,_ as b,n as d,H as j,C as g,j as a,bo as m,bp as y,b4 as O,b5 as F,cp as _,cq as q,aZ as G,F as K,bE as Y,R as Z,aA as J,bj as Q,M as h,b as f,bl as ee,bk as te,br as ie,bF as se,bs as le,ba as ne,bt as ae}from"./index.B28jf8c_.js";import{a as I}from"./index.t--hEgTQ.js";import{F as oe}from"./FormClearHelper.CWUgHOqb.js";import{g as M,F as S,b as re,D as de,I as ce,C as pe,a as ge,s as ue}from"./FileHelper.aCeQQwv9.js";import{S as he,P as me}from"./ProgressBar.DeJx_v03.js";import{u as fe}from"./Hooks.z6bpnOa4.js";import{U as x}from"./UploadFileInfo.C-jY39rj.js";var D=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});D.displayName="CloudUpload";var B=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});B.displayName="Error";const V=d("section",{target:"e17y52ym0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=d("div",{target:"e17y52ym1"})({marginRight:"auto",alignItems:"center",display:"flex"}),L=d("span",{target:"e17y52ym2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),ye=d("span",{target:"e17y52ym3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),Fe=d("div",{target:"e17y52ym4"})({display:"flex",flexDirection:"column"}),E=d("div",{target:"e17y52ym5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Se=d("ul",{target:"e17y52ym6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),A=d("li",{target:"e17y52ym7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),W=d("div",{target:"e17y52ym8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),k=d("div",{target:"e17y52ym9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),R=d("div",{target:"e17y52ym10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ue=d("span",{target:"e17y52ym11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),xe=d("div",{target:"e17y52ym12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),H=d("small",{target:"e17y52ym13"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),N=d("span",{target:"e17y52ym14"})({}),we=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[L]:{display:"none"},[E]:{paddingRight:e.spacing.lg},[R]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[W]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[A]:{margin:e.spacing.none,padding:e.spacing.none}}),Ie=d("div",{target:"e17y52ym15"})(({theme:e,width:s})=>{if(s<j("23rem"))return we(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const w=d("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),ve=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(L,{children:a(m,{content:D,size:"threeXL"})}),g(Fe,{children:[g(ye,{children:["Drag and drop file",e?"s":""," here"]}),g(w,{children:[`Limit ${M(t,S.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ze=c.memo(ve),Ce=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(de,{onDrop:e,multiple:s,accept:re(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(V,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ze,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(y,{kind:F.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),be=c.memo(Ce),Me=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),De=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Be=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(Me,{"data-testid":"stFileUploaderPagination",children:[a(w,{children:`Showing page ${e} of ${s}`}),g(De,{children:[a(y,{onClick:i,kind:F.MINIMAL,children:a(m,{content:_,size:"xl"})}),a(y,{onClick:t,kind:F.MINIMAL,children:a(m,{content:q,size:"xl"})})]})]}),Ve=c.memo(Be),z=(e,s)=>Math.ceil(e.length/s),Pe=e=>G(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=c.useState(0),[p,U]=c.useState(()=>z(i,t)),u=fe(i);c.useEffect(()=>{u&&u.length!==i.length&&U(z(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},$=()=>{r(Math.max(0,n-1))},X=i.slice(n*t,n*t+t);return g(K,{children:[a(e,{items:X,...o}),i.length>t?a(Ve,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:$}):null]})},e),Le=({fileInfo:e})=>e.status.type==="uploading"?a(me,{value:e.status.progress,size:he.SMALL}):e.status.type==="error"?g(H,{children:[a(Ue,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(N,{children:a(m,{content:B,size:"lg"})})]}):e.status.type==="uploaded"?a(w,{children:M(e.size,S.Byte)}):null,Ee=({fileInfo:e,onDelete:s})=>g(R,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(xe,{children:a(m,{content:ce,size:"twoXL"})}),g(W,{className:"stFileUploaderFileData",children:[a(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(Le,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(y,{onClick:()=>s(e.id),kind:F.MINIMAL,children:a(m,{content:pe,size:"lg"})})})]}),Ae=c.memo(Ee),We=({items:e,onDelete:s})=>a(Se,{children:e.map(t=>a(A,{children:a(Ae,{fileInfo:t,onDelete:s})},t.id))}),ke=Pe(We),Re=e=>a(E,{children:a(ke,{...e})}),He=c.memo(Re);class Ne extends Z.PureComponent{constructor(s){super(s),this.formClearHelper=new oe,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);J(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}Q(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new x(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>ge(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new x(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{I.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{f.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,U=n.fileId,u=n.fileUrls;return new x(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return ue(s,S.Megabyte,S.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new ee({fileId:n,fileUrls:r,name:i,size:l})});return new te({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(Ie,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(ae,{label:t.label,disabled:i,labelVisibility:ie((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(se,{children:a(le,{content:t.help,placement:ne.TOP_RIGHT})})}),a(be,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(He,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Ge=Y(c.memo(Ne));export{Ge as default};
@@ -1 +1 @@
1
- import{r,E as k,_ as V,n as u,B as ft,z as N,j as n,ba as J,bu as mt,C as F,bp as Q,b5 as Z,bo as U,a$ as yt,bG as Ct,bj as vt,bH as x,bs as It,F as tt,bh as xt,bI as wt,M as D,bl as bt,bk as St}from"./index.NwBLa4vX.js";import{g as Ft,F as $,C as zt,I as Et,E as Ut,a as Ht,s as Tt,u as Bt,b as Dt}from"./FileHelper.C5Rf1fu1.js";import{I as Lt}from"./InputInstructions.oXzay8Sc.js";import{i as Mt}from"./inputUtils.CQWz5UKz.js";import{a as q}from"./index.t--hEgTQ.js";import{U as et}from"./UploadFileInfo.C-jY39rj.js";import{T as Rt}from"./textarea.BoUKtqfY.js";import"./base-input.BVhyctGq.js";var ot=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.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"}))});ot.displayName="AttachFile";var nt=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});nt.displayName="ErrorOutline";var at=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.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"}))});at.displayName="Send";const $t=u("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=u("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Vt=u("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:i})=>{const c=ft(t),[f,p]=c?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:i?"0":t.radii.chatInput,borderTopLeftRadius:i?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:c?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Nt=u("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Wt=u("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),At=u("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Pt=u("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Kt=u("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Ot=u("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),_t=u("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Xt=u("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Gt=u("div",{target:"e15560op6"})({display:"flex"}),jt=u("div",{target:"e15560op7"})({flex:"0 0 auto"}),Yt=u("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),qt=u("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Jt=u("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Qt=u("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Zt=u("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function te({children:t,content:e}){const i=N();return n(mt,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${i.sizes.minElementHeight}`}}},children:t})}const ee=({fileInfo:t})=>{const e=N(),{type:i}=t.status;switch(i){case"uploading":return n(Ct,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(te,{content:t.status.errorMessage,children:n(U,{color:e.colors.red,content:nt,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return yt(i),null}},oe=({fileInfo:t,onDelete:e})=>F(Yt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(qt,{children:n(ee,{fileInfo:t})}),n(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Qt,{children:Ft(t.size,$.Byte)}),n(Zt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:zt,size:"lg"})})})]}),ne=r.memo(oe),ae=({items:t,onDelete:e})=>n(Xt,{"data-testid":"stChatUploadedFiles",children:n(Gt,{children:t.map(i=>n(jt,{children:n(ne,{fileInfo:i,onDelete:e})},i.id))})}),re=r.memo(ae),ie=({getNextLocalFileId:t,addFiles:e,updateFile:i,uploadClient:c,element:f,onUploadProgress:p,onUploadComplete:m})=>(w,h)=>{const y=q.CancelToken.source(),g=new et(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([g]),c.uploadFile({formId:"",...f},w.uploadUrl,h,d=>p(d,g.id),y.token).then(()=>m(g.id,w)).catch(d=>{q.isCancel(d)||i(g.id,g.setStatus({type:"error",errorMessage:d?d.toString():"Unknown error"}))})},se=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:i,uploadFile:c,addFiles:f,getNextLocalFileId:p,deleteExistingFiles:m,onUploadComplete:w})=>(h,y)=>{if(!t&&h.length===0&&y.length>1){const g=y.findIndex(d=>{var C;return((C=d.errors)==null?void 0:C[0].code)===Ut.TooManyFiles});g>=0&&(h.push(y[g].file),y.splice(g,1))}if(!t&&h.length>0&&m(),i.fetchFileURLs(h).then(g=>{vt(g,h).forEach(([d,C])=>{c(d,C)})}).catch(g=>{f(h.map(d=>new et(d.name,d.size,p(),{type:"error",errorMessage:g})))}),y.length>0){const g=y.map(d=>Ht(d,p(),e));f(g)}w()},le=({getRootProps:t,getInputProps:e,acceptFile:i,disabled:c,theme:f})=>F(Kt,{disabled:c,children:[F(Ot,{"data-testid":"stChatInputFileUploadButton",disabled:c,...t(),children:[n("input",{...e()}),n(It,{content:`Upload or drag and drop ${i===x.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:c,children:n(U,{content:ot,size:"lg",color:c?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(_t,{})]}),de=r.memo(le),ce=({getRootProps:t,getInputProps:e,acceptFile:i,inputHeight:c})=>F(tt,{children:[n(At,{height:c,...t(),children:n("input",{...e()})}),n(Pt,{height:c,children:`Drag and drop ${i===x.Multiple?"files":"a file"} here`})]}),pe=r.memo(ce),ue=6.5,L=1,M=(t,e,i)=>i.map(c=>c.id===t?e:c),R=(t,e)=>e.find(i=>i.id===t);function ge({disabled:t,element:e,widgetMgr:i,fragmentId:c,uploadClient:f}){const p=N(),m=r.useRef(null),w=r.useRef(0),h=r.useRef({minHeight:0,maxHeight:0}),[y,g]=xt(),[d,C]=r.useState(e.default),[z,W]=r.useState(0),[H,rt]=r.useState(!1),[b,S]=r.useState([]),[E,T]=r.useState(!1),B=r.useMemo(()=>b.some(o=>o.status.type==="uploading")?!1:d!==""||b.length>0,[b,d]),I=wt(e.acceptFile),A=Tt(e.maxUploadSizeMb,$.Megabyte,$.Byte),P=r.useCallback(o=>S(a=>[...a,...o]),[]),K=r.useCallback(o=>{S(a=>{const l=R(o,a);return D(l)?a:(l.status.type==="uploading"&&l.status.cancelToken.cancel(),l.status.type==="uploaded"&&l.status.fileUrls.deleteUrl&&f.deleteFile(l.status.fileUrls.deleteUrl),a.filter(s=>s.id!==o))})},[f]),it=()=>{const o=b.filter(a=>a.status.type==="uploaded").map(a=>{const{name:l,size:s,status:v}=a,{fileId:gt,fileUrls:ht}=v;return new bt({fileId:gt,fileUrls:ht,name:l,size:s})});return new St({uploadedFileInfo:o})},O=()=>w.current++,st=se({acceptMultipleFiles:I===x.Multiple,maxFileSize:A,uploadClient:f,uploadFile:ie({getNextLocalFileId:O,addFiles:P,updateFile:(o,a)=>{S(l=>M(o,a,l))},uploadClient:f,element:e,onUploadProgress:(o,a)=>{S(l=>{const s=R(a,l);if(D(s)||s.status.type!=="uploading")return l;const v=Math.round(o.loaded*100/o.total);return s.status.progress===v?l:M(a,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:v}),l)})},onUploadComplete:(o,a)=>{S(l=>{const s=R(o,l);return D(s)||s.status.type!=="uploading"?l:M(s.id,s.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}),l)})}}),addFiles:P,getNextLocalFileId:O,deleteExistingFiles:()=>b.forEach(o=>K(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:_,getInputProps:X}=Bt({onDrop:st,multiple:I===x.Multiple,accept:Dt(e.fileType),maxSize:A}),lt=()=>{let o=0;const{current:a}=m;if(a){const l=a.placeholder;a.placeholder="",a.style.height="auto",o=a.scrollHeight,a.placeholder=l,a.style.height=""}return o},G=()=>{if(m.current&&m.current.focus(),!B||t)return;const o={data:d,fileUploaderState:it()};i.setChatInputValue(e,o,{fromUi:!0},c),S([]),C(""),W(0)},dt=o=>{const{metaKey:a,ctrlKey:l,shiftKey:s}=o;Mt(o)&&!s&&!l&&!a&&(o.preventDefault(),G())},ct=o=>{const{value:a}=o.target,{maxChars:l}=e;l!==0&&a.length>l||(C(a),W(lt()))};r.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";C(o)}},[e]),r.useLayoutEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ue}},[m]),r.useEffect(()=>{const o=s=>{var v;s.preventDefault(),s.stopPropagation(),!E&&((v=s.dataTransfer)!=null&&v.types.includes("Files"))&&T(!0)},a=s=>{s.preventDefault(),s.stopPropagation(),E&&(s.clientX<=0&&s.clientY<=0||s.clientX>=window.innerWidth&&s.clientY>=window.innerHeight)&&T(!1)},l=s=>{s.preventDefault(),s.stopPropagation(),E&&T(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",l),window.addEventListener("dragleave",a),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",l),window.removeEventListener("dragleave",a)}},[E]),r.useLayoutEffect(()=>{const{minHeight:o}=h.current;rt(z>0&&m.current?Math.abs(z-o)>L:!1)},[z]);const{placeholder:j,maxChars:pt}=e,{maxHeight:Y}=h.current,ut=I!==x.None&&E;return F(tt,{children:[I===x.None?null:n(re,{items:[...b],onDelete:K}),n($t,{className:"stChatInput","data-testid":"stChatInput",ref:g,children:ut?n(pe,{getRootProps:_,getInputProps:X,acceptFile:I,inputHeight:H?`${z+L}px`:p.sizes.minElementHeight}):F(kt,{extended:H,children:[I===x.None?null:n(de,{getRootProps:_,getInputProps:X,acceptFile:I,disabled:t,theme:p}),n(Rt,{inputRef:m,value:d,placeholder:j,onChange:ct,onKeyDown:dt,"aria-label":j,disabled:t,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${z+L}px`:"auto",maxHeight:Y?`${Y}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),y>p.breakpoints.hideWidgetDetails&&n(Wt,{children:n(Lt,{dirty:B,value:d,maxLength:pt,type:"chat",inForm:!1})}),n(Nt,{children:n(Vt,{onClick:G,disabled:!B||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:at,size:"xl",color:"inherit"})})})]})})]})}const we=r.memo(ge);export{we as default};
1
+ import{r,E as k,_ as V,n as u,B as ft,z as N,j as n,ba as J,bu as mt,C as F,bp as Q,b5 as Z,bo as U,a$ as yt,bG as Ct,bj as vt,bH as b,bs as It,F as tt,bh as bt,bI as xt,M as R,bl as wt,bk as St}from"./index.B28jf8c_.js";import{g as Ft,F as $,C as zt,I as Et,E as Ut,a as Tt,s as Ht,u as Bt,b as Rt}from"./FileHelper.aCeQQwv9.js";import{I as Dt}from"./InputInstructions.CxNXqmaa.js";import{i as Lt}from"./inputUtils.CQWz5UKz.js";import{a as q}from"./index.t--hEgTQ.js";import{U as et}from"./UploadFileInfo.C-jY39rj.js";import{T as Mt}from"./textarea.DFCEFjUj.js";import"./base-input.B02pchZb.js";var ot=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.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"}))});ot.displayName="AttachFile";var nt=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});nt.displayName="ErrorOutline";var at=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.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"}))});at.displayName="Send";const $t=u("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=u("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Vt=u("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:i})=>{const c=ft(t),[f,p]=c?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:i?"0":t.radii.chatInput,borderTopLeftRadius:i?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:c?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Nt=u("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Wt=u("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),At=u("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Pt=u("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Kt=u("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Ot=u("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),_t=u("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Xt=u("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Gt=u("div",{target:"e15560op6"})({display:"flex"}),jt=u("div",{target:"e15560op7"})({flex:"0 0 auto"}),Yt=u("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),qt=u("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Jt=u("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Qt=u("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Zt=u("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function te({children:t,content:e}){const i=N();return n(mt,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${i.sizes.minElementHeight}`}}},children:t})}const ee=({fileInfo:t})=>{const e=N(),{type:i}=t.status;switch(i){case"uploading":return n(Ct,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(te,{content:t.status.errorMessage,children:n(U,{color:e.colors.red,content:nt,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return yt(i),null}},oe=({fileInfo:t,onDelete:e})=>F(Yt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(qt,{children:n(ee,{fileInfo:t})}),n(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Qt,{children:Ft(t.size,$.Byte)}),n(Zt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:zt,size:"lg"})})})]}),ne=r.memo(oe),ae=({items:t,onDelete:e})=>n(Xt,{"data-testid":"stChatUploadedFiles",children:n(Gt,{children:t.map(i=>n(jt,{children:n(ne,{fileInfo:i,onDelete:e})},i.id))})}),re=r.memo(ae),ie=({getNextLocalFileId:t,addFiles:e,updateFile:i,uploadClient:c,element:f,onUploadProgress:p,onUploadComplete:m})=>(x,h)=>{const y=q.CancelToken.source(),g=new et(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([g]),c.uploadFile({formId:"",...f},x.uploadUrl,h,d=>p(d,g.id),y.token).then(()=>m(g.id,x)).catch(d=>{q.isCancel(d)||i(g.id,g.setStatus({type:"error",errorMessage:d?d.toString():"Unknown error"}))})},se=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:i,uploadFile:c,addFiles:f,getNextLocalFileId:p,deleteExistingFiles:m,onUploadComplete:x})=>(h,y)=>{if(!t&&h.length===0&&y.length>1){const g=y.findIndex(d=>{var C;return((C=d.errors)==null?void 0:C[0].code)===Ut.TooManyFiles});g>=0&&(h.push(y[g].file),y.splice(g,1))}if(!t&&h.length>0&&m(),i.fetchFileURLs(h).then(g=>{vt(g,h).forEach(([d,C])=>{c(d,C)})}).catch(g=>{f(h.map(d=>new et(d.name,d.size,p(),{type:"error",errorMessage:g})))}),y.length>0){const g=y.map(d=>Tt(d,p(),e));f(g)}x()},le=({getRootProps:t,getInputProps:e,acceptFile:i,disabled:c,theme:f})=>F(Kt,{disabled:c,children:[F(Ot,{"data-testid":"stChatInputFileUploadButton",disabled:c,...t(),children:[n("input",{...e()}),n(It,{content:`Upload or drag and drop ${i===b.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:c,children:n(U,{content:ot,size:"lg",color:c?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(_t,{})]}),de=r.memo(le),ce=({getRootProps:t,getInputProps:e,acceptFile:i,inputHeight:c})=>F(tt,{children:[n(At,{height:c,...t(),children:n("input",{...e()})}),n(Pt,{height:c,children:`Drag and drop ${i===b.Multiple?"files":"a file"} here`})]}),pe=r.memo(ce),ue=6.5,D=1,L=(t,e,i)=>i.map(c=>c.id===t?e:c),M=(t,e)=>e.find(i=>i.id===t);function ge({disabled:t,element:e,widgetMgr:i,fragmentId:c,uploadClient:f}){const p=N(),m=r.useRef(null),x=r.useRef(0),h=r.useRef({minHeight:0,maxHeight:0}),[y,g]=bt(),[d,C]=r.useState(e.default),[z,W]=r.useState(0),[T,rt]=r.useState(!1),[w,S]=r.useState([]),[E,H]=r.useState(!1),B=r.useMemo(()=>w.some(o=>o.status.type==="uploading")?!1:d!==""||w.length>0,[w,d]),I=xt(e.acceptFile),A=Ht(e.maxUploadSizeMb,$.Megabyte,$.Byte),P=r.useCallback(o=>S(a=>[...a,...o]),[]),K=r.useCallback(o=>{S(a=>{const l=M(o,a);return R(l)?a:(l.status.type==="uploading"&&l.status.cancelToken.cancel(),l.status.type==="uploaded"&&l.status.fileUrls.deleteUrl&&f.deleteFile(l.status.fileUrls.deleteUrl),a.filter(s=>s.id!==o))})},[f]),it=()=>{const o=w.filter(a=>a.status.type==="uploaded").map(a=>{const{name:l,size:s,status:v}=a,{fileId:gt,fileUrls:ht}=v;return new wt({fileId:gt,fileUrls:ht,name:l,size:s})});return new St({uploadedFileInfo:o})},O=()=>x.current++,st=se({acceptMultipleFiles:I===b.Multiple,maxFileSize:A,uploadClient:f,uploadFile:ie({getNextLocalFileId:O,addFiles:P,updateFile:(o,a)=>{S(l=>L(o,a,l))},uploadClient:f,element:e,onUploadProgress:(o,a)=>{S(l=>{const s=M(a,l);if(R(s)||s.status.type!=="uploading")return l;const v=Math.round(o.loaded*100/o.total);return s.status.progress===v?l:L(a,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:v}),l)})},onUploadComplete:(o,a)=>{S(l=>{const s=M(o,l);return R(s)||s.status.type!=="uploading"?l:L(s.id,s.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}),l)})}}),addFiles:P,getNextLocalFileId:O,deleteExistingFiles:()=>w.forEach(o=>K(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:_,getInputProps:X}=Bt({onDrop:st,multiple:I===b.Multiple,accept:Rt(e.fileType),maxSize:A}),lt=()=>{let o=0;const{current:a}=m;if(a){const l=a.placeholder;a.placeholder="",a.style.height="auto",o=a.scrollHeight,a.placeholder=l,a.style.height=""}return o},G=()=>{if(m.current&&m.current.focus(),!B||t)return;const o={data:d,fileUploaderState:it()};i.setChatInputValue(e,o,{fromUi:!0},c),S([]),C(""),W(0)},dt=o=>{const{metaKey:a,ctrlKey:l,shiftKey:s}=o;Lt(o)&&!s&&!l&&!a&&(o.preventDefault(),G())},ct=o=>{const{value:a}=o.target,{maxChars:l}=e;l!==0&&a.length>l||(C(a),W(lt()))};r.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";C(o)}},[e]),r.useLayoutEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ue}},[m]),r.useEffect(()=>{const o=s=>{var v;s.preventDefault(),s.stopPropagation(),!E&&((v=s.dataTransfer)!=null&&v.types.includes("Files"))&&H(!0)},a=s=>{s.preventDefault(),s.stopPropagation(),E&&(s.clientX<=0&&s.clientY<=0||s.clientX>=window.innerWidth&&s.clientY>=window.innerHeight)&&H(!1)},l=s=>{s.preventDefault(),s.stopPropagation(),E&&H(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",l),window.addEventListener("dragleave",a),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",l),window.removeEventListener("dragleave",a)}},[E]),r.useLayoutEffect(()=>{const{minHeight:o}=h.current;rt(z>0&&m.current?Math.abs(z-o)>D:!1)},[z]);const{placeholder:j,maxChars:pt}=e,{maxHeight:Y}=h.current,ut=I!==b.None&&E;return F(tt,{children:[I===b.None?null:n(re,{items:[...w],onDelete:K}),n($t,{className:"stChatInput","data-testid":"stChatInput",ref:g,children:ut?n(pe,{getRootProps:_,getInputProps:X,acceptFile:I,inputHeight:T?`${z+D}px`:p.sizes.minElementHeight}):F(kt,{extended:T,children:[I===b.None?null:n(de,{getRootProps:_,getInputProps:X,acceptFile:I,disabled:t,theme:p}),n(Mt,{inputRef:m,value:d,placeholder:j,onChange:ct,onKeyDown:dt,"aria-label":j,disabled:t,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:T?`${z+D}px`:"auto",maxHeight:Y?`${Y}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),y>p.breakpoints.hideWidgetDetails&&n(Wt,{children:n(Dt,{dirty:B,value:d,maxLength:pt,type:"chat",inForm:!1})}),n(Nt,{children:n(Vt,{onClick:G,disabled:!B||t,extended:T,"data-testid":"stChatInputSubmitButton",children:n(U,{content:at,size:"xl",color:"inherit"})})})]})})]})}const xe=r.memo(ge);export{xe as default};
@@ -1,4 +1,4 @@
1
- var WU=Object.defineProperty;var JU=(r,e,t)=>e in r?WU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>JU(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aS as dt,g as sh,aT as Su,_ as VO,j as Ss,C as Jc,aU as Nv,F as uB,aV as kv,aW as XU,aX as fB,aY as KU,aD as YU,aZ as qU,n as HO,B as jO,U as t2,a_ as hB,aA as ZU,z as QU,a$ as e5,b0 as dB}from"./index.NwBLa4vX.js";import{_ as ls,a as t5,C as r5}from"./toConsumableArray.CA_5PwDK.js";import{a as Xu,b as Ku,_ as Qx,c as AA,d as ew}from"./possibleConstructorReturn.6K8NTHlH.js";import{a as n5,T as i5}from"./Toolbar.BLonzKGv.js";import{u as $O,E as WO,w as s5}from"./withFullScreenWrapper._ccFC4BV.js";import{u as o5}from"./useBasicWidgetState.aMiqPmlk.js";import{u as a5,s as c5}from"./threshold.DjX0wlsa.js";import{a as l5}from"./index.t--hEgTQ.js";import"./FormClearHelper.D2MZi-BE.js";import"./value.CgPGBV_l.js";function u5(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 o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const bu={};function jm(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const tw=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),AB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);AB&&parseFloat(AB[1]);const Fu=globalThis,Ta=globalThis.process||{},f5=globalThis.navigator||{};function JO(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function il(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||JO()}function h5(r){return il()?JO()?"Electron":(f5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const sy="4.1.0";function d5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let A5=class{constructor(e,t,n="sessionStorage"){this.storage=d5(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 p5(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 g5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var $m;(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"})($m||($m={}));const m5=10;function pB(r){return typeof r!="string"?r:(r=r.toUpperCase(),$m[r]||$m.WHITE)}function _5(r,e,t){return!il&&typeof r=="string"&&(e&&(r=`\x1B[${pB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${pB(t)+m5}m${r}\x1B[49m`)),r}function y5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function rw(r,e){if(!r)throw new Error("Assertion failed")}function sd(){var e,t,n;let r;if(il()&&Fu.performance)r=(t=(e=Fu==null?void 0:Fu.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Ta){const i=(n=Ta==null?void 0:Ta.hrtime)==null?void 0:n.call(Ta);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const od={debug:il()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},v5={enabled:!0,level:0};function ad(){}const gB={},mB={once:!0};let XO=class{constructor({id:e}={id:""}){this.VERSION=sy,this._startTs=sd(),this._deltaTs=sd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new A5(`__probe-${this.id}__`,v5),this.timeStamp(`${this.id} started`),y5(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((sd()-this._startTs).toPrecision(10))}getDelta(){return Number((sd()-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,od.warn,arguments,mB)}error(e){return this._getLogFunction(0,e,od.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,od.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,od.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,od.debug||od.info,arguments,mB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ad,n&&[n],{tag:x5(t)}):ad}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||ad)}group(e,t,n={collapsed:!1}){const i=_B({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?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||ad)}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()>=KO(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=_B({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,rw(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=sd();const s=o.tag||o.message;if(o.once&&s)if(!gB[s])gB[s]=sd();else return ad;return t=b5(this.id,o.message,o),n.bind(console,t,...o.args)}return ad}};XO.VERSION=sy;function KO(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 rw(Number.isFinite(e)&&e>=0),e}function _B(r){const{logLevel:e,message:t}=r;r.logLevel=KO(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 rw(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function b5(r,e,t){if(typeof e=="string"){const n=t.time?g5(p5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=_5(e,t.color,t.background)}return e}function x5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function w5(r,e){return YO(r||{},e)}function YO(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?n[i]=YO(n[i]||{},e[i],t+1):n[i]=e[i];return n}const C5="latest";function E5(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const T5=E5();function zu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Wf=typeof process!="object"||String(process)!=="[object process]"||process.browser,B5=typeof window<"u"&&typeof window.orientation<"u",yB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);yB&&parseFloat(yB[1]);let S5=class{constructor(e,t){V(this,"name");V(this,"workerThread");V(this,"isRunning",!0);V(this,"result");V(this,"_resolve",()=>{});V(this,"_reject",()=>{});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){zu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zu(this.isRunning),this.isRunning=!1,this._reject(e)}},Uv=class{terminate(){}};const zv=new Map;function I5(r){zu(r.source&&!r.url||!r.source&&r.url);let e=zv.get(r.source||r.url);return e||(r.url&&(e=M5(r.url),zv.set(r.url,e)),r.source&&(e=qO(r.source),zv.set(r.source,e))),zu(e),e}function M5(r){if(!r.startsWith("http"))return r;const e=P5(r);return qO(e)}function qO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function P5(r){return`try {
1
+ var WU=Object.defineProperty;var JU=(r,e,t)=>e in r?WU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>JU(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aS as dt,g as sh,aT as Su,_ as VO,j as Ss,C as Jc,aU as Nv,F as uB,aV as kv,aW as XU,aX as fB,aY as KU,aD as YU,aZ as qU,n as HO,B as jO,U as t2,a_ as hB,aA as ZU,z as QU,a$ as e5,b0 as dB}from"./index.B28jf8c_.js";import{_ as ls,a as t5,C as r5}from"./toConsumableArray.DARzcvE5.js";import{a as Xu,b as Ku,_ as Qx,c as AA,d as ew}from"./possibleConstructorReturn.C73_6grg.js";import{a as n5,T as i5}from"./Toolbar.Buaxb3gQ.js";import{u as $O,E as WO,w as s5}from"./withFullScreenWrapper.B7h9p1kI.js";import{u as o5}from"./useBasicWidgetState.D6255-xX.js";import{u as a5,s as c5}from"./threshold.DjX0wlsa.js";import{a as l5}from"./index.t--hEgTQ.js";import"./FormClearHelper.CWUgHOqb.js";import"./value.CgPGBV_l.js";function u5(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 o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const bu={};function jm(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const tw=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),AB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);AB&&parseFloat(AB[1]);const Fu=globalThis,Ta=globalThis.process||{},f5=globalThis.navigator||{};function JO(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function il(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||JO()}function h5(r){return il()?JO()?"Electron":(f5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const sy="4.1.0";function d5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let A5=class{constructor(e,t,n="sessionStorage"){this.storage=d5(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 p5(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 g5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var $m;(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"})($m||($m={}));const m5=10;function pB(r){return typeof r!="string"?r:(r=r.toUpperCase(),$m[r]||$m.WHITE)}function _5(r,e,t){return!il&&typeof r=="string"&&(e&&(r=`\x1B[${pB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${pB(t)+m5}m${r}\x1B[49m`)),r}function y5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function rw(r,e){if(!r)throw new Error("Assertion failed")}function sd(){var e,t,n;let r;if(il()&&Fu.performance)r=(t=(e=Fu==null?void 0:Fu.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Ta){const i=(n=Ta==null?void 0:Ta.hrtime)==null?void 0:n.call(Ta);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const od={debug:il()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},v5={enabled:!0,level:0};function ad(){}const gB={},mB={once:!0};let XO=class{constructor({id:e}={id:""}){this.VERSION=sy,this._startTs=sd(),this._deltaTs=sd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new A5(`__probe-${this.id}__`,v5),this.timeStamp(`${this.id} started`),y5(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((sd()-this._startTs).toPrecision(10))}getDelta(){return Number((sd()-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,od.warn,arguments,mB)}error(e){return this._getLogFunction(0,e,od.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,od.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,od.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,od.debug||od.info,arguments,mB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ad,n&&[n],{tag:x5(t)}):ad}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||ad)}group(e,t,n={collapsed:!1}){const i=_B({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?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||ad)}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()>=KO(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=_B({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,rw(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=sd();const s=o.tag||o.message;if(o.once&&s)if(!gB[s])gB[s]=sd();else return ad;return t=b5(this.id,o.message,o),n.bind(console,t,...o.args)}return ad}};XO.VERSION=sy;function KO(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 rw(Number.isFinite(e)&&e>=0),e}function _B(r){const{logLevel:e,message:t}=r;r.logLevel=KO(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 rw(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function b5(r,e,t){if(typeof e=="string"){const n=t.time?g5(p5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=_5(e,t.color,t.background)}return e}function x5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function w5(r,e){return YO(r||{},e)}function YO(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?n[i]=YO(n[i]||{},e[i],t+1):n[i]=e[i];return n}const C5="latest";function E5(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const T5=E5();function zu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Wf=typeof process!="object"||String(process)!=="[object process]"||process.browser,B5=typeof window<"u"&&typeof window.orientation<"u",yB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);yB&&parseFloat(yB[1]);let S5=class{constructor(e,t){V(this,"name");V(this,"workerThread");V(this,"isRunning",!0);V(this,"result");V(this,"_resolve",()=>{});V(this,"_reject",()=>{});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){zu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zu(this.isRunning),this.isRunning=!1,this._reject(e)}},Uv=class{terminate(){}};const zv=new Map;function I5(r){zu(r.source&&!r.url||!r.source&&r.url);let e=zv.get(r.source||r.url);return e||(r.url&&(e=M5(r.url),zv.set(r.url,e)),r.source&&(e=qO(r.source),zv.set(r.source,e))),zu(e),e}function M5(r){if(!r.startsWith("http"))return r;const e=P5(r);return qO(e)}function qO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function P5(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);
@@ -1 +1 @@
1
- import{r,R as f,aD as m,b5 as l,j as t,b6 as B,bp as b,b4 as p,b7 as D}from"./index.NwBLa4vX.js";import{c as h}from"./createDownloadLinkElement.DZMwyjvU.js";function w(n,o,e){return h({enforceDownloadInNewTab:e,url:n.buildMediaURL(o),filename:""})}function R(n){const{disabled:o,element:e,widgetMgr:s,endpoints:a,fragmentId:c}=n,{libConfig:{enforceDownloadInNewTab:d=!1}}=f.useContext(m);let i=l.SECONDARY;e.type==="primary"?i=l.PRIMARY:e.type==="tertiary"&&(i=l.TERTIARY),r.useEffect(()=>{a.checkSourceUrlResponse(e.url,"Download Button")},[e.url,a]);const u=()=>{e.ignoreRerun||s.setTriggerValue(e,{fromUi:!0},c),w(a,e.url,d).click()};return t("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:t(B,{help:e.help,containerWidth:e.useContainerWidth,children:t(b,{kind:i,size:p.SMALL,disabled:o,onClick:u,containerWidth:e.useContainerWidth,children:t(D,{icon:e.icon,label:e.label})})})})}const L=r.memo(R);export{L as default};
1
+ import{r,R as f,aD as m,b5 as l,j as t,b6 as B,bp as b,b4 as p,b7 as D}from"./index.B28jf8c_.js";import{c as h}from"./createDownloadLinkElement.DZMwyjvU.js";function w(n,o,e){return h({enforceDownloadInNewTab:e,url:n.buildMediaURL(o),filename:""})}function R(n){const{disabled:o,element:e,widgetMgr:s,endpoints:a,fragmentId:c}=n,{libConfig:{enforceDownloadInNewTab:d=!1}}=f.useContext(m);let i=l.SECONDARY;e.type==="primary"?i=l.PRIMARY:e.type==="tertiary"&&(i=l.TERTIARY),r.useEffect(()=>{a.checkSourceUrlResponse(e.url,"Download Button")},[e.url,a]);const u=()=>{e.ignoreRerun||s.setTriggerValue(e,{fromUi:!0},c),w(a,e.url,d).click()};return t("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:t(B,{help:e.help,containerWidth:e.useContainerWidth,children:t(b,{kind:i,size:p.SMALL,disabled:o,onClick:u,containerWidth:e.useContainerWidth,children:t(D,{icon:e.icon,label:e.label})})})})}const L=r.memo(R);export{L as default};