streamlit-nightly 1.44.1.dev20250325__py3-none-any.whl → 1.44.1.dev20250326__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 (75) hide show
  1. streamlit/config.py +1 -1
  2. streamlit/proto/MetricsEvent_pb2.py +1 -1
  3. streamlit/proto/MetricsEvent_pb2.pyi +10 -10
  4. streamlit/static/index.html +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.B-UWWWdT.js → FileDownload.esm.DyWffVOd.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.DRtEaIrj.js → FileHelper.C5Rf1fu1.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.B_xJLRtH.js → FormClearHelper.D2MZi-BE.js} +1 -1
  8. streamlit/static/static/js/{Hooks.DtzWH7N2.js → Hooks.UTpr--3H.js} +1 -1
  9. streamlit/static/static/js/{InputInstructions.CkYMcz8B.js → InputInstructions.oXzay8Sc.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.Drx8XNKv.js → ProgressBar.Dkc6afbj.js} +1 -1
  11. streamlit/static/static/js/{RenderInPortalIfExists.BSkIOPqr.js → RenderInPortalIfExists.0vQEaJAa.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.2r5jAJur.js → Toolbar.BLonzKGv.js} +1 -1
  13. streamlit/static/static/js/{base-input.CV_PJtfn.js → base-input.BVhyctGq.js} +1 -1
  14. streamlit/static/static/js/{checkbox.CZjCrRM6.js → checkbox.DqunhWUH.js} +1 -1
  15. streamlit/static/static/js/{createSuper.wNbYZKaS.js → createSuper.CpC2DZ-4.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.CxDiXQOm.js → data-grid-overlay-editor.BNc7oQAN.js} +1 -1
  17. streamlit/static/static/js/{downloader.BKhc9vo-.js → downloader.BEmsLcSd.js} +1 -1
  18. streamlit/static/static/js/{es6.DMMA5jEp.js → es6.Bka7yuWr.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.rU5g5dG9.js → iframeResizer.contentWindow.CseC9_0j.js} +1 -1
  20. streamlit/static/static/js/{index.CY2a3G5f.js → index.-Ex9Sw0j.js} +1 -1
  21. streamlit/static/static/js/{index.PUoEdeCj.js → index.-GEjrTbP.js} +1 -1
  22. streamlit/static/static/js/{index.YSxp_z0H.js → index.-uBfKDNW.js} +1 -1
  23. streamlit/static/static/js/{index.lLHaP-WG.js → index.6ZLFnYFv.js} +1 -1
  24. streamlit/static/static/js/{index.BvR3oAAg.js → index.B9r4f8yP.js} +1 -1
  25. streamlit/static/static/js/{index.DkHRVwYA.js → index.BGiS_myV.js} +1 -1
  26. streamlit/static/static/js/{index.BGHyjPoE.js → index.BPrkMaDs.js} +1 -1
  27. streamlit/static/static/js/{index.DmhhLL_7.js → index.BPw4HKmU.js} +1 -1
  28. streamlit/static/static/js/{index.qaTnk5v5.js → index.BSsSumHQ.js} +5 -5
  29. streamlit/static/static/js/{index.wpF1efVn.js → index.BgAs7EEH.js} +1 -1
  30. streamlit/static/static/js/{index.CEK_kfj1.js → index.BgstN8el.js} +1 -1
  31. streamlit/static/static/js/{index.Dh-GaoLL.js → index.ByG1Ipsd.js} +1 -1
  32. streamlit/static/static/js/{index.B_lGEToe.js → index.C7zS3xAk.js} +1 -1
  33. streamlit/static/static/js/{index.BDnhO8N2.js → index.CHsi5M24.js} +1 -1
  34. streamlit/static/static/js/{index.DMOnosvH.js → index.CRpHYHH-.js} +1 -1
  35. streamlit/static/static/js/{index.BnFXM4vg.js → index.CSzYGoqF.js} +1 -1
  36. streamlit/static/static/js/{index.hYp-Io20.js → index.CdRzA4dY.js} +1 -1
  37. streamlit/static/static/js/{index.COu5ow_u.js → index.CusXODwm.js} +1 -1
  38. streamlit/static/static/js/{index.BKHYl8ma.js → index.DByvN5ny.js} +1 -1
  39. streamlit/static/static/js/{index.CdUwInkp.js → index.DDcRBpz_.js} +1 -1
  40. streamlit/static/static/js/{index.BxcYwJga.js → index.DDfr2vz1.js} +1 -1
  41. streamlit/static/static/js/{index.CjiDtsfR.js → index.DH5gmTNJ.js} +1 -1
  42. streamlit/static/static/js/{index.CcHn1Jbf.js → index.DPXDfP7O.js} +1 -1
  43. streamlit/static/static/js/{index.CLpTIY8k.js → index.DTByMWKb.js} +1 -1
  44. streamlit/static/static/js/{index.BW1ps7Ve.js → index.DYmhwMwG.js} +1 -1
  45. streamlit/static/static/js/{index.Cj6d-zQP.js → index.D_RsV5T3.js} +1 -1
  46. streamlit/static/static/js/{index.6LeN9cCn.js → index.DbB5iceE.js} +1 -1
  47. streamlit/static/static/js/{index.C8fLs5OO.js → index.DcA9oLdi.js} +1 -1
  48. streamlit/static/static/js/{index.B5181i5i.js → index.DfLVo1kK.js} +1 -1
  49. streamlit/static/static/js/{index.C7Pn7DNY.js → index.Dg6pitBN.js} +1 -1
  50. streamlit/static/static/js/{index.poiWcDhd.js → index.DiZnms3l.js} +1 -1
  51. streamlit/static/static/js/{index.C5tuUwoV.js → index.DvCWOxpn.js} +1 -1
  52. streamlit/static/static/js/{index.C5x1XZ52.js → index.K8WjTi1D.js} +1 -1
  53. streamlit/static/static/js/{index.Ci8MtnNW.js → index.NwBLa4vX.js} +9 -9
  54. streamlit/static/static/js/{index.aJaKE3aW.js → index.RS9NSuPn.js} +1 -1
  55. streamlit/static/static/js/{index.B5pjbkNu.js → index.YDw6DAY-.js} +1 -1
  56. streamlit/static/static/js/{index.60o7QeO8.js → index.sEBYkd7C.js} +1 -1
  57. streamlit/static/static/js/{input.hfihv8cy.js → input.Cf4AxOS9.js} +1 -1
  58. streamlit/static/static/js/{memory.CwFUs_rm.js → memory.x6zhEJ8E.js} +1 -1
  59. streamlit/static/static/js/{mergeWith.NipycHTn.js → mergeWith.DL-_LuL_.js} +1 -1
  60. streamlit/static/static/js/{number-overlay-editor.BOZydn7S.js → number-overlay-editor.uQEd6gCw.js} +1 -1
  61. streamlit/static/static/js/{possibleConstructorReturn.BegGyJAz.js → possibleConstructorReturn.6K8NTHlH.js} +1 -1
  62. streamlit/static/static/js/{sandbox.UTLHU4Ul.js → sandbox.BY_N7kRf.js} +1 -1
  63. streamlit/static/static/js/{textarea.dlySzlub.js → textarea.BoUKtqfY.js} +1 -1
  64. streamlit/static/static/js/{timepicker.QFZeHTS5.js → timepicker.uTqYdkda.js} +1 -1
  65. streamlit/static/static/js/{toConsumableArray.D1_QwNnQ.js → toConsumableArray.CA_5PwDK.js} +1 -1
  66. streamlit/static/static/js/{uniqueId.DrcTmetR.js → uniqueId.CmvPTKOg.js} +1 -1
  67. streamlit/static/static/js/{useBasicWidgetState.jMbeuIfG.js → useBasicWidgetState.aMiqPmlk.js} +1 -1
  68. streamlit/static/static/js/{useOnInputChange.CsqSzHwu.js → useOnInputChange.DXi6gRKL.js} +1 -1
  69. streamlit/static/static/js/{withFullScreenWrapper.Cnlc3o1n.js → withFullScreenWrapper._ccFC4BV.js} +1 -1
  70. {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250326.dist-info}/METADATA +1 -1
  71. {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250326.dist-info}/RECORD +75 -75
  72. {streamlit_nightly-1.44.1.dev20250325.data → streamlit_nightly-1.44.1.dev20250326.data}/scripts/streamlit.cmd +0 -0
  73. {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250326.dist-info}/WHEEL +0 -0
  74. {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250326.dist-info}/entry_points.txt +0 -0
  75. {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250326.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as u,E as $,_ as H,aW as mt,bj as Ht,bk as Vt,bl as jt,M as X,O as q,R as yt,aD as Gt,n as P,bm as Xt,C as z,j as v,bn as qt,b5 as Yt,bo as Kt,bp as Jt,l as Qt,z as Zt,bq as tt,H as te,aA as ee,br as ie,bs as se,ba as ne,bt as re}from"./index.Ci8MtnNW.js";import{u as oe,F as ae}from"./FormClearHelper.B_xJLRtH.js";import{T as le,a as ft}from"./Toolbar.2r5jAJur.js";import{u as ce}from"./Hooks.DtzWH7N2.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.B-UWWWdT.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});St.displayName="Pause";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});Ct.displayName="PlayArrow";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Et.displayName="Refresh";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Rt.displayName="StopCircle";function R(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(s,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Pt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Pt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function gt(s,t,e){const i=Pt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:gt,default:gt});const me={fetchBlob:function(s,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){R(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);r(h)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-b<o)return;const A=w.clientX,T=w.clientY,k=A-h,W=T-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const I=t.getBoundingClientRect(),{left:U,top:L}=I;f||(i==null||i(h-U,m-L),f=!0),e(k,W,A-U,T-L),h=A,m=T}},S=w=>{if(f){const A=w.clientX,T=w.clientY,k=t.getBoundingClientRect(),{left:W,top:I}=k;n==null||n(A-W,T-I)}c()},y=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},D=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",D),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
1
+ import{r as u,E as $,_ as H,aW as mt,bj as Ht,bk as Vt,bl as jt,M as X,O as q,R as yt,aD as Gt,n as P,bm as Xt,C as z,j as v,bn as qt,b5 as Yt,bo as Kt,bp as Jt,l as Qt,z as Zt,bq as tt,H as te,aA as ee,br as ie,bs as se,ba as ne,bt as re}from"./index.NwBLa4vX.js";import{u as oe,F as ae}from"./FormClearHelper.D2MZi-BE.js";import{T as le,a as ft}from"./Toolbar.BLonzKGv.js";import{u as ce}from"./Hooks.UTpr--3H.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.DyWffVOd.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});St.displayName="Pause";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});Ct.displayName="PlayArrow";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Et.displayName="Refresh";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Rt.displayName="StopCircle";function R(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(s,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Pt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Pt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function gt(s,t,e){const i=Pt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:gt,default:gt});const me={fetchBlob:function(s,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){R(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);r(h)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-b<o)return;const A=w.clientX,T=w.clientY,k=A-h,W=T-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const I=t.getBoundingClientRect(),{left:U,top:L}=I;f||(i==null||i(h-U,m-L),f=!0),e(k,W,A-U,T-L),h=A,m=T}},S=w=>{if(f){const A=w.clientX,T=w.clientY,k=t.getBoundingClientRect(),{left:W,top:I}=k;n==null||n(A-W,T-I)}c()},y=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},D=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",D),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;
@@ -1 +1 @@
1
- import{n as U,r as a,bi as R,j as m,l as w}from"./index.Ci8MtnNW.js";const A=U("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),O=w.getLogger("Video"),P={width:"100%"};function $({element:r,endpoints:i,elementMgr:p}){const s=a.useRef(null),{type:v,url:f,startTime:n,subtitles:u,endTime:c,loop:l,autoplay:S,muted:g}=r,T=a.useMemo(()=>{if(!r.id)return!0;const e=p.getElementState(r.id,"preventAutoplay");return e||p.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,p]),E=a.useMemo(()=>JSON.stringify(u?u.map(e=>i.buildMediaURL(`${e.url}`)):[]),[u,i]);a.useEffect(()=>{const e=JSON.parse(E);e.length!==0&&e.forEach(t=>{i.checkSourceUrlResponse(t,"Video Subtitle")})},[E,i]),a.useEffect(()=>{s.current&&(s.current.currentTime=n)},[n]),a.useEffect(()=>{const e=s.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),a.useEffect(()=>{const e=s.current;if(!e)return;let t=!1;const d=()=>{c>0&&e.currentTime>=c&&(l?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return c>0&&e.addEventListener("timeupdate",d),()=>{e&&c>0&&e.removeEventListener("timeupdate",d)}},[c,l,n]),a.useEffect(()=>{const e=s.current;if(!e)return;const t=()=>{l&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[l,n]);const V=e=>{const{startTime:t,endTime:d,loop:b,autoplay:L,muted:N}=r,o=new URL(e);if(t&&!isNaN(t)&&o.searchParams.append("start",t.toString()),d&&!isNaN(d)&&o.searchParams.append("end",d.toString()),b){o.searchParams.append("loop","1");const y=o.pathname.split("/").pop();y&&o.searchParams.append("playlist",y)}return L&&o.searchParams.append("autoplay","1"),N&&o.searchParams.append("mute","1"),o.toString()};if(v===R.Type.YOUTUBE_IFRAME)return m(A,{className:"stVideo","data-testid":"stVideo",title:f,src:V(f),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;O.error(`Client Error: Video source error - ${t}`),i.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return m("video",{className:"stVideo","data-testid":"stVideo",ref:s,controls:!0,muted:g,autoPlay:S&&!T,src:i.buildMediaURL(f),style:P,crossOrigin:void 0,onError:h,children:u&&u.map((e,t)=>m("track",{kind:"captions",src:i.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const M=a.memo($);export{M as default};
1
+ import{n as U,r as a,bi as R,j as m,l as w}from"./index.NwBLa4vX.js";const A=U("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),O=w.getLogger("Video"),P={width:"100%"};function $({element:r,endpoints:i,elementMgr:p}){const s=a.useRef(null),{type:v,url:f,startTime:n,subtitles:u,endTime:c,loop:l,autoplay:S,muted:g}=r,T=a.useMemo(()=>{if(!r.id)return!0;const e=p.getElementState(r.id,"preventAutoplay");return e||p.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,p]),E=a.useMemo(()=>JSON.stringify(u?u.map(e=>i.buildMediaURL(`${e.url}`)):[]),[u,i]);a.useEffect(()=>{const e=JSON.parse(E);e.length!==0&&e.forEach(t=>{i.checkSourceUrlResponse(t,"Video Subtitle")})},[E,i]),a.useEffect(()=>{s.current&&(s.current.currentTime=n)},[n]),a.useEffect(()=>{const e=s.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),a.useEffect(()=>{const e=s.current;if(!e)return;let t=!1;const d=()=>{c>0&&e.currentTime>=c&&(l?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return c>0&&e.addEventListener("timeupdate",d),()=>{e&&c>0&&e.removeEventListener("timeupdate",d)}},[c,l,n]),a.useEffect(()=>{const e=s.current;if(!e)return;const t=()=>{l&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[l,n]);const V=e=>{const{startTime:t,endTime:d,loop:b,autoplay:L,muted:N}=r,o=new URL(e);if(t&&!isNaN(t)&&o.searchParams.append("start",t.toString()),d&&!isNaN(d)&&o.searchParams.append("end",d.toString()),b){o.searchParams.append("loop","1");const y=o.pathname.split("/").pop();y&&o.searchParams.append("playlist",y)}return L&&o.searchParams.append("autoplay","1"),N&&o.searchParams.append("mute","1"),o.toString()};if(v===R.Type.YOUTUBE_IFRAME)return m(A,{className:"stVideo","data-testid":"stVideo",title:f,src:V(f),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;O.error(`Client Error: Video source error - ${t}`),i.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return m("video",{className:"stVideo","data-testid":"stVideo",ref:s,controls:!0,muted:g,autoPlay:S&&!T,src:i.buildMediaURL(f),style:P,crossOrigin:void 0,onError:h,children:u&&u.map((e,t)=>m("track",{kind:"captions",src:i.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const M=a.memo($);export{M as default};
@@ -1 +1 @@
1
- import{n as U,r as o,bh as k,z as H,cr as S,C as B,j as r,br as j,bF as O,bs as _,ba as w,bt as K,D as $,cs as q}from"./index.Ci8MtnNW.js";import{u as A}from"./uniqueId.DrcTmetR.js";import{u as G,a as N,b as J}from"./useOnInputChange.CsqSzHwu.js";import{a as M}from"./useBasicWidgetState.jMbeuIfG.js";import{I as Q}from"./InputInstructions.CkYMcz8B.js";import{I as X}from"./input.hfihv8cy.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.B_xJLRtH.js";import"./base-input.CV_PJtfn.js";const Y=U("div",{target:"e1o1zy6o0"})("position:relative;");function Z({disabled:e,element:t,widgetMgr:s,fragmentId:u}){var b,I;const[n,l]=o.useState(()=>W(s,t)??null),[y,T]=k(),[i,d]=o.useState(!1),x=o.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[C,c]=M({getStateFromWidgetMgr:W,getDefaultStateFromProto:tt,getCurrStateFromProto:at,updateWidgetMgrState:et,element:t,widgetMgr:s,fragmentId:u,onFormCleared:x});G(C,n,l,i);const[V,m]=o.useState(!1),a=H(),[h]=o.useState(()=>A("text_input_")),{placeholder:F,formId:f}=t,p=o.useCallback(()=>{d(!1),c({value:n,fromUi:!0})},[n,c]),z=S({formId:f})?s.allowFormEnterToSubmit(f):i,v=V&&y>a.breakpoints.hideWidgetDetails,E=o.useCallback(()=>{i&&p(),m(!1)},[i,p]),R=o.useCallback(()=>{m(!0)},[]),L=N({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:c}),P=J(t.formId,p,i,s,u),g=(b=t.icon)==null?void 0:b.startsWith(":material"),D=g?"lg":"base";return B(Y,{className:"stTextInput","data-testid":"stTextInput",ref:T,children:[r(K,{label:t.label,disabled:e,labelVisibility:j((I=t.labelVisibility)==null?void 0:I.value),htmlFor:h,children:t.help&&r(O,{children:r(_,{content:t.help,placement:w.TOP_RIGHT})})}),r(X,{value:n??"",placeholder:F,onBlur:E,onFocus:R,onChange:L,onKeyPress:P,"aria-label":t.label,disabled:e,id:h,type:ot(t),autoComplete:t.autocomplete,startEnhancer:t.icon&&r($,{"data-testid":"stTextInputIcon",iconValue:t.icon,size:D}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:a.sizes.minElementHeight,borderLeftWidth:a.sizes.borderWidth,borderRightWidth:a.sizes.borderWidth,borderTopWidth:a.sizes.borderWidth,borderBottomWidth:a.sizes.borderWidth,paddingLeft:t.icon?a.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:a.iconSizes.lg,color:g?a.colors.fadedText60:"inherit"}}}}),v&&r(Q,{dirty:i,value:n??"",maxLength:t.maxChars,inForm:S({formId:t.formId}),allowEnterToSubmit:z})]})}function W(e,t){return e.getStringValue(t)??null}function tt(e){return e.default??null}function at(e){return e.value??null}function et(e,t,s,u){t.setStringValue(e,s.value,{fromUi:s.fromUi},u)}function ot(e){return e.type===q.Type.PASSWORD?"password":"text"}const mt=o.memo(Z);export{mt as default};
1
+ import{n as U,r as o,bh as k,z as H,cr as S,C as B,j as r,br as j,bF as O,bs as _,ba as w,bt as K,D as $,cs as q}from"./index.NwBLa4vX.js";import{u as A}from"./uniqueId.CmvPTKOg.js";import{u as G,a as N,b as J}from"./useOnInputChange.DXi6gRKL.js";import{a as M}from"./useBasicWidgetState.aMiqPmlk.js";import{I as Q}from"./InputInstructions.oXzay8Sc.js";import{I as X}from"./input.Cf4AxOS9.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.D2MZi-BE.js";import"./base-input.BVhyctGq.js";const Y=U("div",{target:"e1o1zy6o0"})("position:relative;");function Z({disabled:e,element:t,widgetMgr:s,fragmentId:u}){var b,I;const[n,l]=o.useState(()=>W(s,t)??null),[y,T]=k(),[i,d]=o.useState(!1),x=o.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[C,c]=M({getStateFromWidgetMgr:W,getDefaultStateFromProto:tt,getCurrStateFromProto:at,updateWidgetMgrState:et,element:t,widgetMgr:s,fragmentId:u,onFormCleared:x});G(C,n,l,i);const[V,m]=o.useState(!1),a=H(),[h]=o.useState(()=>A("text_input_")),{placeholder:F,formId:f}=t,p=o.useCallback(()=>{d(!1),c({value:n,fromUi:!0})},[n,c]),z=S({formId:f})?s.allowFormEnterToSubmit(f):i,v=V&&y>a.breakpoints.hideWidgetDetails,E=o.useCallback(()=>{i&&p(),m(!1)},[i,p]),R=o.useCallback(()=>{m(!0)},[]),L=N({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:c}),P=J(t.formId,p,i,s,u),g=(b=t.icon)==null?void 0:b.startsWith(":material"),D=g?"lg":"base";return B(Y,{className:"stTextInput","data-testid":"stTextInput",ref:T,children:[r(K,{label:t.label,disabled:e,labelVisibility:j((I=t.labelVisibility)==null?void 0:I.value),htmlFor:h,children:t.help&&r(O,{children:r(_,{content:t.help,placement:w.TOP_RIGHT})})}),r(X,{value:n??"",placeholder:F,onBlur:E,onFocus:R,onChange:L,onKeyPress:P,"aria-label":t.label,disabled:e,id:h,type:ot(t),autoComplete:t.autocomplete,startEnhancer:t.icon&&r($,{"data-testid":"stTextInputIcon",iconValue:t.icon,size:D}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:a.sizes.minElementHeight,borderLeftWidth:a.sizes.borderWidth,borderRightWidth:a.sizes.borderWidth,borderTopWidth:a.sizes.borderWidth,borderBottomWidth:a.sizes.borderWidth,paddingLeft:t.icon?a.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:a.iconSizes.lg,color:g?a.colors.fadedText60:"inherit"}}}}),v&&r(Q,{dirty:i,value:n??"",maxLength:t.maxChars,inForm:S({formId:t.formId}),allowEnterToSubmit:z})]})}function W(e,t){return e.getStringValue(t)??null}function tt(e){return e.default??null}function at(e){return e.value??null}function et(e,t,s,u){t.setStringValue(e,s.value,{fromUi:s.fromUi},u)}function ot(e){return e.type===q.Type.PASSWORD?"password":"text"}const mt=o.memo(Z);export{mt as default};
@@ -1 +1 @@
1
- import{n as l,r as o,j as f,l as v}from"./index.Ci8MtnNW.js";const A=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),g=l("audio",{target:"ea9qfvi1"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0})),T=v.getLogger("Audio");function y({element:r,endpoints:s,elementMgr:a}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=r,E=o.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),o.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const m=s.buildMediaURL(r.url);return f(A,{children:f(g,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:m,onError:e=>{const t=e.currentTarget.src;T.error(`Client Error: Audio source error - ${t}`),s.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)}})})}const S=o.memo(y);export{S as default};
1
+ import{n as l,r as o,j as f,l as v}from"./index.NwBLa4vX.js";const A=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),g=l("audio",{target:"ea9qfvi1"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0})),T=v.getLogger("Audio");function y({element:r,endpoints:s,elementMgr:a}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=r,E=o.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),o.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const m=s.buildMediaURL(r.url);return f(A,{children:f(g,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:m,onError:e=>{const t=e.currentTarget.src;T.error(`Client Error: Audio source error - ${t}`),s.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)}})})}const S=o.memo(y);export{S as default};
@@ -1 +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.Ci8MtnNW.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.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 +1 @@
1
- import{n as o,bm as S,i as f,r as g,R as l,j as r,C as u,c5 as m,aC as $}from"./index.Ci8MtnNW.js";const x=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),y=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),h=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),C=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(y,{className:m({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:u(h,{children:[r(x,{}),r($,{source:e.text,allowHTML:!1}),n&&r(T,{children:C(t)})]})})}const k=g.memo(b);export{k as default};
1
+ import{n as o,bm as S,i as f,r as g,R as l,j as r,C as u,c5 as m,aC as $}from"./index.NwBLa4vX.js";const x=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),y=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),h=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),C=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(y,{className:m({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:u(h,{children:[r(x,{}),r($,{source:e.text,allowHTML:!1}),n&&r(T,{children:C(t)})]})})}const k=g.memo(b);export{k as default};
@@ -1 +1 @@
1
- import{n as R,r as i,z as T,c1 as M,c2 as W,C,j as l,br as V,bF as L,bs as O,ba as P,bt as k,c0 as E,c3 as N,bY as $,c4 as B,bC as F}from"./index.Ci8MtnNW.js";import{a as A}from"./useBasicWidgetState.jMbeuIfG.js";import"./FormClearHelper.B_xJLRtH.js";const H=R("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getIntArrayValue(t),U=s=>s.default??null,j=s=>s.value??null,G=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},K=s=>{var S;const{element:t,widgetMgr:a,fragmentId:u}=s,e=T(),[n,m]=A({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:a,fragmentId:u}),h=t.maxSelections>0&&n.length>=t.maxSelections,f=i.useMemo(()=>{if(t.maxSelections===0)return"No results";if(n.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,n.length]),y=i.useMemo(()=>n.map(o=>{const r=t.options[o];return{value:o.toString(),label:r}}),[t.options,n]),b=i.useCallback(o=>{const r=()=>{var d;const g=(d=o.option)==null?void 0:d.value;return parseInt(g,10)};switch(o.type){case"remove":return M(n,r());case"clear":return[];case"select":return n.concat([r()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[n]),v=i.useCallback(o=>{t.maxSelections&&o.type==="select"&&n.length>=t.maxSelections||m({value:b(o),fromUi:!0})},[t.maxSelections,b,m,n.length]),x=i.useCallback((o,r)=>{if(h)return[];const g=o.filter(d=>!n.includes(Number(d.value)));return W(g,r)},[h,n]),{options:c}=t,p=c.length===0?!0:s.disabled,z=c.length===0?"No options to select.":t.placeholder,w=c.map((o,r)=>({label:o,value:r.toString()})),I=c.length>10;return C("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[l(k,{label:t.label,disabled:p,labelVisibility:V((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(L,{children:l(O,{content:t.help,placement:P.TOP_RIGHT})})}),l(H,{children:l(E,{options:w,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:B.select,multi:!0,onChange:v,value:y,disabled:p,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:p?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:F.isMobile&&I===!1?"readonly":null}},Dropdown:{component:N}}})})]})},q=i.memo(K);export{q as default};
1
+ import{n as R,r as i,z as T,c1 as M,c2 as W,C,j as l,br as V,bF as L,bs as O,ba as P,bt as k,c0 as E,c3 as N,bY as $,c4 as B,bC as F}from"./index.NwBLa4vX.js";import{a as A}from"./useBasicWidgetState.aMiqPmlk.js";import"./FormClearHelper.D2MZi-BE.js";const H=R("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getIntArrayValue(t),U=s=>s.default??null,j=s=>s.value??null,G=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},K=s=>{var S;const{element:t,widgetMgr:a,fragmentId:u}=s,e=T(),[n,m]=A({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:a,fragmentId:u}),h=t.maxSelections>0&&n.length>=t.maxSelections,f=i.useMemo(()=>{if(t.maxSelections===0)return"No results";if(n.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,n.length]),y=i.useMemo(()=>n.map(o=>{const r=t.options[o];return{value:o.toString(),label:r}}),[t.options,n]),b=i.useCallback(o=>{const r=()=>{var d;const g=(d=o.option)==null?void 0:d.value;return parseInt(g,10)};switch(o.type){case"remove":return M(n,r());case"clear":return[];case"select":return n.concat([r()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[n]),v=i.useCallback(o=>{t.maxSelections&&o.type==="select"&&n.length>=t.maxSelections||m({value:b(o),fromUi:!0})},[t.maxSelections,b,m,n.length]),x=i.useCallback((o,r)=>{if(h)return[];const g=o.filter(d=>!n.includes(Number(d.value)));return W(g,r)},[h,n]),{options:c}=t,p=c.length===0?!0:s.disabled,z=c.length===0?"No options to select.":t.placeholder,w=c.map((o,r)=>({label:o,value:r.toString()})),I=c.length>10;return C("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[l(k,{label:t.label,disabled:p,labelVisibility:V((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(L,{children:l(O,{content:t.help,placement:P.TOP_RIGHT})})}),l(H,{children:l(E,{options:w,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:B.select,multi:!0,onChange:v,value:y,disabled:p,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:p?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:F.isMobile&&I===!1?"readonly":null}},Dropdown:{component:N}}})})]})},q=i.memo(K);export{q as default};
@@ -1 +1 @@
1
- import{n as l,b3 as C,J as b,b4 as n,r as u,b5 as s,j as a,b6 as v,b7 as B,b8 as S}from"./index.Ci8MtnNW.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e11mkfd20"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=l(e,{target:"e11mkfd21"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e11mkfd22"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e11mkfd23"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:k}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:k,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=u.memo(T);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(S,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
1
+ import{n as l,b3 as C,J as b,b4 as n,r as u,b5 as s,j as a,b6 as v,b7 as B,b8 as S}from"./index.NwBLa4vX.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e11mkfd20"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=l(e,{target:"e11mkfd21"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e11mkfd22"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e11mkfd23"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:k}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:k,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=u.memo(T);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(S,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
@@ -1 +1 @@
1
- import{n,r as t,O as i,j as c,b1 as d,b2 as e,M as g}from"./index.Ci8MtnNW.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.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 +1 @@
1
- import{r as s,bh as U,z as k,cr as W,C as A,j as l,br as L,bF as P,bs as B,ba as D,bt as j}from"./index.Ci8MtnNW.js";import{u as _}from"./uniqueId.DrcTmetR.js";import{u as w,a as K,b as O}from"./useOnInputChange.CsqSzHwu.js";import{I as $}from"./InputInstructions.CkYMcz8B.js";import{a as q}from"./useBasicWidgetState.jMbeuIfG.js";import{T as G}from"./textarea.dlySzlub.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.B_xJLRtH.js";import"./base-input.CV_PJtfn.js";const x=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,J=a=>a.value??null,Q=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},X=({disabled:a,element:t,widgetMgr:o,fragmentId:u})=>{var f;const p=s.useRef(_("text_area_")).current,[T,S]=U(),[r,n]=s.useState(!1),[C,b]=s.useState(!1),[i,d]=s.useState(()=>x(o,t)??null),I=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[y,c]=q({getStateFromWidgetMgr:x,getDefaultStateFromProto:N,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:o,fragmentId:u,onFormCleared:I});w(y,i,d,r);const e=k(),h=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&h(),b(!1)},[r,h]),V=s.useCallback(()=>{b(!0)},[]),v=K({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),z=O(t.formId,h,r,o,u,!0),{height:g,placeholder:E,formId:m}=t,R=W({formId:m})?o.allowFormEnterToSubmit(m):r,H=C&&T>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:p,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:v,onKeyDown:z,"aria-label":t.label,disabled:a,id:p,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:g?`${g}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l($,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:W({formId:m}),allowEnterToSubmit:R})]})},it=s.memo(X);export{it as default};
1
+ import{r as s,bh as U,z as k,cr as W,C as A,j as l,br as L,bF as P,bs as B,ba as D,bt as j}from"./index.NwBLa4vX.js";import{u as _}from"./uniqueId.CmvPTKOg.js";import{u as w,a as K,b as O}from"./useOnInputChange.DXi6gRKL.js";import{I as $}from"./InputInstructions.oXzay8Sc.js";import{a as q}from"./useBasicWidgetState.aMiqPmlk.js";import{T as G}from"./textarea.BoUKtqfY.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.D2MZi-BE.js";import"./base-input.BVhyctGq.js";const x=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,J=a=>a.value??null,Q=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},X=({disabled:a,element:t,widgetMgr:o,fragmentId:u})=>{var f;const p=s.useRef(_("text_area_")).current,[T,S]=U(),[r,n]=s.useState(!1),[C,b]=s.useState(!1),[i,d]=s.useState(()=>x(o,t)??null),I=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[y,c]=q({getStateFromWidgetMgr:x,getDefaultStateFromProto:N,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:o,fragmentId:u,onFormCleared:I});w(y,i,d,r);const e=k(),h=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&h(),b(!1)},[r,h]),V=s.useCallback(()=>{b(!0)},[]),v=K({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),z=O(t.formId,h,r,o,u,!0),{height:g,placeholder:E,formId:m}=t,R=W({formId:m})?o.allowFormEnterToSubmit(m):r,H=C&&T>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:p,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:v,onKeyDown:z,"aria-label":t.label,disabled:a,id:p,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:g?`${g}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l($,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:W({formId:m}),allowEnterToSubmit:R})]})},it=s.memo(X);export{it 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.Ci8MtnNW.js";import{a as I}from"./index.t--hEgTQ.js";import{F as oe}from"./FormClearHelper.B_xJLRtH.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.DRtEaIrj.js";import{S as he,P as me}from"./ProgressBar.Drx8XNKv.js";import{u as fe}from"./Hooks.DtzWH7N2.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.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,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.Ci8MtnNW.js";import{s as Ne}from"./sprintf.D7DtBTRn.js";import{a as xt}from"./useBasicWidgetState.jMbeuIfG.js";import"./FormClearHelper.B_xJLRtH.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.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.
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,4 +1,4 @@
1
- import{r as m,bQ as xr,bR as Lr,bS as jr,bT as Br,d as rn,bU as nn,g as an,bv as X,bN as He,bO as Ee,bV as on,bM as Fr,bw as N,G as Wr,bW as sn,bX as Nr,bY as cr,bZ as ln,bx as We,b_ as un,b$ as cn,c0 as dn,A as Vr,I as pn,z as dr,aD as fn,S as jt,M as hn,C as yn,j as Ye,br as gn,bF as vn,bs as mn,ba as bn,bt as Sn}from"./index.Ci8MtnNW.js";import{a as Dn}from"./useBasicWidgetState.jMbeuIfG.js";import{D as Ce,a as Ie,T as On}from"./timepicker.QFZeHTS5.js";import{I as _n}from"./input.hfihv8cy.js";import{I as $n}from"./base-input.CV_PJtfn.js";import"./FormClearHelper.B_xJLRtH.js";import"./possibleConstructorReturn.BegGyJAz.js";import"./createSuper.wNbYZKaS.js";var wn=["title","size","color","overrides"];function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gt.apply(this,arguments)}function kn(t,r){if(t==null)return{};var n=Mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Pn(t,r){return Hn(t)||An(t,r)||In(t,r)||Cn()}function Cn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as m,bQ as xr,bR as Lr,bS as jr,bT as Br,d as rn,bU as nn,g as an,bv as X,bN as He,bO as Ee,bV as on,bM as Fr,bw as N,G as Wr,bW as sn,bX as Nr,bY as cr,bZ as ln,bx as We,b_ as un,b$ as cn,c0 as dn,A as Vr,I as pn,z as dr,aD as fn,S as jt,M as hn,C as yn,j as Ye,br as gn,bF as vn,bs as mn,ba as bn,bt as Sn}from"./index.NwBLa4vX.js";import{a as Dn}from"./useBasicWidgetState.aMiqPmlk.js";import{D as Ce,a as Ie,T as On}from"./timepicker.uTqYdkda.js";import{I as _n}from"./input.Cf4AxOS9.js";import{I as $n}from"./base-input.BVhyctGq.js";import"./FormClearHelper.D2MZi-BE.js";import"./possibleConstructorReturn.6K8NTHlH.js";import"./createSuper.CpC2DZ-4.js";var wn=["title","size","color","overrides"];function gt(){return gt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},gt.apply(this,arguments)}function kn(t,r){if(t==null)return{};var n=Mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Pn(t,r){return Hn(t)||An(t,r)||In(t,r)||Cn()}function Cn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function In(t,r){if(t){if(typeof t=="string")return pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(t,r)}}function pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function An(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Hn(t){if(Array.isArray(t))return t}function En(t,r){var n=xr(),a=Pn(n,2),e=a[1],o=t.title,i=o===void 0?"Left":o,s=t.size,c=t.color,u=t.overrides,f=u===void 0?{}:u,d=kn(t,wn),y=Lr({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},f&&f.Svg?jr(f.Svg):{});return m.createElement(Br,gt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:c,overrides:{Svg:y}},d),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const fr=m.forwardRef(En);var Rn=["title","size","color","overrides"];function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},vt.apply(this,arguments)}function Tn(t,r){if(t==null)return{};var n=xn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function xn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Ln(t,r){return Wn(t)||Fn(t,r)||Bn(t,r)||jn()}function jn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bn(t,r){if(t){if(typeof t=="string")return hr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hr(t,r)}}function hr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Fn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Wn(t){if(Array.isArray(t))return t}function Nn(t,r){var n=xr(),a=Ln(n,2),e=a[1],o=t.title,i=o===void 0?"Right":o,s=t.size,c=t.color,u=t.overrides,f=u===void 0?{}:u,d=Tn(t,Rn),y=Lr({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},f&&f.Svg?jr(f.Svg):{});return m.createElement(Br,vt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:c,overrides:{Svg:y}},d),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const yr=m.forwardRef(Nn);var at={exports:{}},ot,gr;function Vn(){if(gr)return ot;gr=1;function t(p){return p&&typeof p=="object"&&"default"in p?p.default:p}var r=t(rn()),n=nn();function a(p,b){for(var O=Object.getOwnPropertyNames(b),h=0;h<O.length;h++){var l=O[h],P=Object.getOwnPropertyDescriptor(b,l);P&&P.configurable&&p[l]===void 0&&Object.defineProperty(p,l,P)}return p}function e(){return(e=Object.assign||function(p){for(var b=1;b<arguments.length;b++){var O=arguments[b];for(var h in O)Object.prototype.hasOwnProperty.call(O,h)&&(p[h]=O[h])}return p}).apply(this,arguments)}function o(p,b){p.prototype=Object.create(b.prototype),a(p.prototype.constructor=p,b)}function i(p,b){if(p==null)return{};var O,h,l={},P=Object.keys(p);for(h=0;h<P.length;h++)O=P[h],0<=b.indexOf(O)||(l[O]=p[O]);return l}function s(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}var c=function(p,b,O,h,l,P,Y,te){if(!p){var R;if(b===void 0)R=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[O,h,l,P,Y,te],W=0;(R=new Error(b.replace(/%s/g,function(){return j[W++]}))).name="Invariant Violation"}throw R.framesToPop=1,R}},u=c;function f(p,b,O){if("selectionStart"in p&&"selectionEnd"in p)p.selectionStart=b,p.selectionEnd=O;else{var h=p.createTextRange();h.collapse(!0),h.moveStart("character",b),h.moveEnd("character",O-b),h.select()}}function d(p){var b=0,O=0;if("selectionStart"in p&&"selectionEnd"in p)b=p.selectionStart,O=p.selectionEnd;else{var h=document.selection.createRange();h.parentElement()===p&&(b=-h.moveStart("character",-p.value.length),O=-h.moveEnd("character",-p.value.length))}return{start:b,end:O,length:O-b}}var y={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},g="_";function v(p,b,O){var h="",l="",P=null,Y=[];if(b===void 0&&(b=g),O==null&&(O=y),!p||typeof p!="string")return{maskChar:b,formatChars:O,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var te=!1;return p.split("").forEach(function(R){te=!te&&R==="\\"||(te||!O[R]?(Y.push(h.length),h.length===Y.length-1&&(l+=R)):P=h.length+1,h+=R,!1)}),{maskChar:b,formatChars:O,prefix:l,mask:h,lastEditablePosition:P,permanents:Y}}function S(p,b){return p.permanents.indexOf(b)!==-1}function D(p,b,O){var h=p.mask,l=p.formatChars;if(!O)return!1;if(S(p,b))return h[b]===O;var P=l[h[b]];return new RegExp(P).test(O)}function $(p,b){return b.split("").every(function(O,h){return S(p,h)||!D(p,h,O)})}function _(p,b){var O=p.maskChar,h=p.prefix;if(!O){for(;b.length>h.length&&S(p,b.length-1);)b=b.slice(0,b.length-1);return b.length}for(var l=h.length,P=b.length;P>=h.length;P--){var Y=b[P];if(!S(p,P)&&D(p,P,Y)){l=P+1;break}}return l}function k(p,b){return _(p,b)===p.mask.length}function w(p,b){var O=p.maskChar,h=p.mask,l=p.prefix;if(!O){for((b=A(p,"",b,0)).length<l.length&&(b=l);b.length<h.length&&S(p,b.length);)b+=h[b.length];return b}if(b)return A(p,w(p,""),b,0);for(var P=0;P<h.length;P++)S(p,P)?b+=h[P]:b+=O;return b}function B(p,b,O,h){var l=O+h,P=p.maskChar,Y=p.mask,te=p.prefix,R=b.split("");if(P)return R.map(function(W,re){return re<O||l<=re?W:S(p,re)?Y[re]:P}).join("");for(var j=l;j<R.length;j++)S(p,j)&&(R[j]="");return O=Math.max(te.length,O),R.splice(O,l-O),b=R.join(""),w(p,b)}function A(p,b,O,h){var l=p.mask,P=p.maskChar,Y=p.prefix,te=O.split(""),R=k(p,b);return!P&&h>b.length&&(b+=l.slice(b.length,h)),te.every(function(j){for(;se=j,S(p,z=h)&&se!==l[z];){if(h>=b.length&&(b+=l[h]),W=j,re=h,P&&S(p,re)&&W===P)return!0;if(++h>=l.length)return!1}var W,re,z,se;return!D(p,h,j)&&j!==P||(h<b.length?b=P||R||h<Y.length?b.slice(0,h)+j+b.slice(h+1):(b=b.slice(0,h)+j+b.slice(h),w(p,b)):P||(b+=j),++h<l.length)}),b}function T(p,b,O,h){var l=p.mask,P=p.maskChar,Y=O.split(""),te=h;return Y.every(function(R){for(;W=R,S(p,j=h)&&W!==l[j];)if(++h>=l.length)return!1;var j,W;return(D(p,h,R)||R===P)&&h++,h<l.length}),h-te}function E(p,b){for(var O=b;0<=O;--O)if(!S(p,O))return O;return null}function C(p,b){for(var O=p.mask,h=b;h<O.length;++h)if(!S(p,h))return h;return null}function x(p){return p||p===0?p+"":""}function I(p,b,O,h,l){var P=p.mask,Y=p.prefix,te=p.lastEditablePosition,R=b,j="",W=0,re=0,z=Math.min(l.start,O.start);return O.end>l.start?re=(W=T(p,h,j=R.slice(l.start,O.end),z))?l.length:0:R.length<h.length&&(re=h.length-R.length),R=h,re&&(re===1&&!l.length&&(z=l.start===O.start?C(p,O.start):E(p,O.start)),R=B(p,R,z,re)),R=A(p,R,j,z),(z+=W)>=P.length?z=P.length:z<Y.length&&!W?z=Y.length:z>=Y.length&&z<te&&W&&(z=C(p,z)),j||(j=null),{value:R=w(p,R),enteredString:j,selection:{start:z,end:z}}}function H(){var p=new RegExp("windows","i"),b=new RegExp("phone","i"),O=navigator.userAgent;return p.test(O)&&b.test(O)}function L(p){return typeof p=="function"}function q(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function ge(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function ie(p){return(ge()?q():function(){return setTimeout(p,1e3/60)})(p)}function G(p){(ge()||clearTimeout)(p)}var ee=function(p){function b(h){var l=p.call(this,h)||this;l.focused=!1,l.mounted=!1,l.previousSelection=null,l.selectionDeferId=null,l.saveSelectionLoopDeferId=null,l.saveSelectionLoop=function(){l.previousSelection=l.getSelection(),l.saveSelectionLoopDeferId=ie(l.saveSelectionLoop)},l.runSaveSelectionLoop=function(){l.saveSelectionLoopDeferId===null&&l.saveSelectionLoop()},l.stopSaveSelectionLoop=function(){l.saveSelectionLoopDeferId!==null&&(G(l.saveSelectionLoopDeferId),l.saveSelectionLoopDeferId=null,l.previousSelection=null)},l.getInputDOMNode=function(){if(!l.mounted)return null;var M=n.findDOMNode(s(s(l))),F=typeof window<"u"&&M instanceof window.Element;if(M&&!F)return null;if(M.nodeName!=="INPUT"&&(M=M.querySelector("input")),!M)throw new Error("react-input-mask: inputComponent doesn't contain input node");return M},l.getInputValue=function(){var M=l.getInputDOMNode();return M?M.value:null},l.setInputValue=function(M){var F=l.getInputDOMNode();F&&(l.value=M,F.value=M)},l.setCursorToEnd=function(){var M=_(l.maskOptions,l.value),F=C(l.maskOptions,M);F!==null&&l.setCursorPosition(F)},l.setSelection=function(M,F,U){U===void 0&&(U={});var V=l.getInputDOMNode(),Q=l.isFocused();V&&Q&&(U.deferred||f(V,M,F),l.selectionDeferId!==null&&G(l.selectionDeferId),l.selectionDeferId=ie(function(){l.selectionDeferId=null,f(V,M,F)}),l.previousSelection={start:M,end:F,length:Math.abs(F-M)})},l.getSelection=function(){return d(l.getInputDOMNode())},l.getCursorPosition=function(){return l.getSelection().start},l.setCursorPosition=function(M){l.setSelection(M,M)},l.isFocused=function(){return l.focused},l.getBeforeMaskedValueChangeConfig=function(){var M=l.maskOptions,F=M.mask,U=M.maskChar,V=M.permanents,Q=M.formatChars;return{mask:F,maskChar:U,permanents:V,alwaysShowMask:!!l.props.alwaysShowMask,formatChars:Q}},l.isInputAutofilled=function(M,F,U,V){var Q=l.getInputDOMNode();try{if(Q.matches(":-webkit-autofill"))return!0}catch{}return!l.focused||V.end<U.length&&F.end===M.length},l.onChange=function(M){var F=s(s(l)).beforePasteState,U=s(s(l)).previousSelection,V=l.props.beforeMaskedValueChange,Q=l.getInputValue(),fe=l.value,he=l.getSelection();l.isInputAutofilled(Q,he,fe,U)&&(fe=w(l.maskOptions,""),U={start:0,end:0,length:0}),F&&(U=F.selection,fe=F.value,he={start:U.start+Q.length,end:U.start+Q.length,length:0},Q=fe.slice(0,U.start)+Q+fe.slice(U.end),l.beforePasteState=null);var $e=I(l.maskOptions,Q,he,fe,U),Ve=$e.enteredString,me=$e.selection,ke=$e.value;if(L(V)){var Ae=V({value:ke,selection:me},{value:fe,selection:U},Ve,l.getBeforeMaskedValueChangeConfig());ke=Ae.value,me=Ae.selection}l.setInputValue(ke),L(l.props.onChange)&&l.props.onChange(M),l.isWindowsPhoneBrowser?l.setSelection(me.start,me.end,{deferred:!0}):l.setSelection(me.start,me.end)},l.onFocus=function(M){var F=l.props.beforeMaskedValueChange,U=l.maskOptions,V=U.mask,Q=U.prefix;if(l.focused=!0,l.mounted=!0,V){if(l.value)_(l.maskOptions,l.value)<l.maskOptions.mask.length&&l.setCursorToEnd();else{var fe=w(l.maskOptions,Q),he=w(l.maskOptions,fe),$e=_(l.maskOptions,he),Ve=C(l.maskOptions,$e),me={start:Ve,end:Ve};if(L(F)){var ke=F({value:he,selection:me},{value:l.value,selection:null},null,l.getBeforeMaskedValueChangeConfig());he=ke.value,me=ke.selection}var Ae=he!==l.getInputValue();Ae&&l.setInputValue(he),Ae&&L(l.props.onChange)&&l.props.onChange(M),l.setSelection(me.start,me.end)}l.runSaveSelectionLoop()}L(l.props.onFocus)&&l.props.onFocus(M)},l.onBlur=function(M){var F=l.props.beforeMaskedValueChange,U=l.maskOptions.mask;if(l.stopSaveSelectionLoop(),l.focused=!1,U&&!l.props.alwaysShowMask&&$(l.maskOptions,l.value)){var V="";L(F)&&(V=F({value:V,selection:null},{value:l.value,selection:l.previousSelection},null,l.getBeforeMaskedValueChangeConfig()).value);var Q=V!==l.getInputValue();Q&&l.setInputValue(V),Q&&L(l.props.onChange)&&l.props.onChange(M)}L(l.props.onBlur)&&l.props.onBlur(M)},l.onMouseDown=function(M){if(!l.focused&&document.addEventListener){l.mouseDownX=M.clientX,l.mouseDownY=M.clientY,l.mouseDownTime=new Date().getTime();var F=function U(V){if(document.removeEventListener("mouseup",U),l.focused){var Q=Math.abs(V.clientX-l.mouseDownX),fe=Math.abs(V.clientY-l.mouseDownY),he=Math.max(Q,fe),$e=new Date().getTime()-l.mouseDownTime;(he<=10&&$e<=200||he<=5&&$e<=300)&&l.setCursorToEnd()}};document.addEventListener("mouseup",F)}L(l.props.onMouseDown)&&l.props.onMouseDown(M)},l.onPaste=function(M){L(l.props.onPaste)&&l.props.onPaste(M),M.defaultPrevented||(l.beforePasteState={value:l.getInputValue(),selection:l.getSelection()},l.setInputValue(""))},l.handleRef=function(M){l.props.children==null&&L(l.props.inputRef)&&l.props.inputRef(M)};var P=h.mask,Y=h.maskChar,te=h.formatChars,R=h.alwaysShowMask,j=h.beforeMaskedValueChange,W=h.defaultValue,re=h.value;l.maskOptions=v(P,Y,te),W==null&&(W=""),re==null&&(re=W);var z=x(re);if(l.maskOptions.mask&&(R||z)&&(z=w(l.maskOptions,z),L(j))){var se=h.value;h.value==null&&(se=W),z=j({value:z,selection:null},{value:se=x(se),selection:null},null,l.getBeforeMaskedValueChangeConfig()).value}return l.value=z,l}o(b,p);var O=b.prototype;return O.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=H(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},O.componentDidUpdate=function(){var h=this.previousSelection,l=this.props,P=l.beforeMaskedValueChange,Y=l.alwaysShowMask,te=l.mask,R=l.maskChar,j=l.formatChars,W=this.maskOptions,re=Y||this.isFocused(),z=this.props.value!=null,se=z?x(this.props.value):this.value,M=h?h.start:null;if(this.maskOptions=v(te,R,j),this.maskOptions.mask){!W.mask&&this.isFocused()&&this.runSaveSelectionLoop();var F=this.maskOptions.mask&&this.maskOptions.mask!==W.mask;if(W.mask||z||(se=this.getInputValue()),(F||this.maskOptions.mask&&(se||re))&&(se=w(this.maskOptions,se)),F){var U=_(this.maskOptions,se);(M===null||U<M)&&(M=k(this.maskOptions,se)?U:C(this.maskOptions,U))}!this.maskOptions.mask||!$(this.maskOptions,se)||re||z&&this.props.value||(se="");var V={start:M,end:M};if(L(P)){var Q=P({value:se,selection:V},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());se=Q.value,V=Q.selection}this.value=se;var fe=this.getInputValue()!==this.value;fe?(this.setInputValue(this.value),this.forceUpdate()):F&&this.forceUpdate();var he=!1;V.start!=null&&V.end!=null&&(he=!h||h.start!==V.start||h.end!==V.end),(he||fe)&&this.setSelection(V.start,V.end)}else W.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},O.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&G(this.selectionDeferId),this.stopSaveSelectionLoop()},O.render=function(){var h,l=this.props,P=(l.mask,l.alwaysShowMask,l.maskChar,l.formatChars,l.inputRef,l.beforeMaskedValueChange,l.children),Y=i(l,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(P){L(P)||u(!1);var te=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],R=e({},Y);te.forEach(function(W){return delete R[W]}),h=P(R),te.filter(function(W){return h.props[W]!=null&&h.props[W]!==Y[W]}).length&&u(!1)}else h=r.createElement("input",e({ref:this.handleRef},Y));var j={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(Y.disabled||Y.readOnly||(j.onChange=this.onChange,j.onPaste=this.onPaste,j.onMouseDown=this.onMouseDown),Y.value!=null&&(j.value=this.value)),h=r.cloneElement(h,j)},b}(r.Component);return ot=ee,ot}var vr;function Yn(){return vr||(vr=1,at.exports=Vn()),at.exports}var zn=Yn();const Un=an(zn);var qn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Kn=["Input"],Xn=["mask","maskChar","overrides"];function mr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function it(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?mr(Object(n),!0).forEach(function(a){Qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Qn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function qe(t){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qe(t)}function Ne(){return Ne=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ne.apply(this,arguments)}function mt(t,r){if(t==null)return{};var n=Jn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Jn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}var Yr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var n=t.onChange,a=t.onFocus,e=t.onBlur,o=t.value,i=t.disabled,s=t.readOnly,c=mt(t,qn);return m.createElement(Un,Ne({onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},c),function(u){return m.createElement($n,Ne({ref:r,onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},u))})});Yr.displayName="MaskOverride";function zr(t){var r=t.mask,n=t.maskChar,a=t.overrides;a=a===void 0?{}:a;var e=a.Input,o=e===void 0?{}:e,i=mt(a,Kn),s=mt(t,Xn),c=Yr,u={},f={};typeof o=="function"?c=o:qe(o)==="object"&&(c=o.component||c,u=o.props||{},f=o.style||{}),qe(u)==="object"&&(u=it(it({},u),{},{mask:u.mask||r,maskChar:u.maskChar||n}));var d=it({Input:{component:c,props:u,style:f}},i);return m.createElement(_n,Ne({},s,{overrides:d}))}zr.defaultProps={maskChar:" "};var Bt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Ur=[0,1,2,3,4,5,6],Zn=[0,1,2,3,4,5,6,7,8,9,10,11],oe={high:"high",default:"default"},_e={startDate:"startDate",endDate:"endDate"},Gn={locked:"locked"};function br(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Pe(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?br(Object(n),!0).forEach(function(a){ea(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):br(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ea(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Ft=X("label",function(t){var r=t.$disabled,n=t.$theme,a=n.colors,e=n.typography;return Pe(Pe({},e.font250),{},{width:"100%",color:r?a.contentSecondary:a.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ft.displayName="Label";Ft.displayName="Label";var Wt=X("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Wt.displayName="LabelContainer";Wt.displayName="LabelContainer";var Nt=X("span",function(t){var r=t.$disabled,n=t.$counterError,a=t.$theme,e=a.colors,o=a.typography;return Pe(Pe({},o.font100),{},{flex:0,width:"100%",color:n?e.negative400:r?e.contentSecondary:e.contentPrimary})});Nt.displayName="LabelEndEnhancer";Nt.displayName="LabelEndEnhancer";var Vt=X("div",function(t){var r=t.$error,n=t.$positive,a=t.$theme,e=a.colors,o=a.sizing,i=a.typography,s=e.contentSecondary;return r?s=e.negative400:n&&(s=e.positive400),Pe(Pe({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:o.scale300,marginRight:0,marginBottom:o.scale300,marginLeft:0})});Vt.displayName="Caption";Vt.displayName="Caption";var Yt=X("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});Yt.displayName="ControlContainer";Yt.displayName="ControlContainer";function we(){return we=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},we.apply(this,arguments)}function Ke(t){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ke(t)}function ta(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ra(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function na(t,r,n){return r&&ra(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function aa(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&bt(t,r)}function bt(t,r){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},bt(t,r)}function oa(t){var r=la();return function(){var a=Xe(t),e;if(r){var o=Xe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ia(this,e)}}function ia(t,r){if(r&&(Ke(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sa(t)}function sa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function la(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xe(t)}function ua(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ca(t,r,n,a){return r&&typeof r!="boolean"?typeof r=="function"?r(a):r:n&&typeof n!="boolean"?typeof n=="function"?n(a):n:t?typeof t=="function"?t(a):t:null}var St=function(t){aa(n,t);var r=oa(n);function n(){return ta(this,n),r.apply(this,arguments)}return na(n,[{key:"render",value:function(){var e=this.props,o=e.overrides,i=o.Label,s=o.LabelEndEnhancer,c=o.LabelContainer,u=o.Caption,f=o.ControlContainer,d=e.label,y=e.caption,g=e.disabled,v=e.error,S=e.positive,D=e.htmlFor,$=e.children,_=e.counter,k=m.Children.only($).props,w={$disabled:!!g,$error:!!v,$positive:!!S},B=He(i)||Ft,A=He(s)||Nt,T=He(c)||Wt,E=He(u)||Vt,C=He(f)||Yt,x=ca(y,v,S,w),I=this.props.labelEndEnhancer;if(_){var H=null,L=null,q=null;Ke(_)==="object"&&(L=_.length,H=_.maxLength,q=_.error),H=H||k.maxLength,L==null&&typeof k.value=="string"&&(L=k.value.length),L==null&&(L=0),w.$length=L,H==null?I||(I="".concat(L)):(w.$maxLength=L,I||(I="".concat(L,"/").concat(H)),L>H&&q==null&&(q=!0)),q&&(w.$error=!0,w.$counterError=!0)}return m.createElement(m.Fragment,null,d&&m.createElement(T,we({},w,Ee(c)),m.createElement(B,we({"data-baseweb":"form-control-label",htmlFor:D||k.id},w,Ee(i)),typeof d=="function"?d(w):d),!!I&&m.createElement(A,we({},w,Ee(s)),typeof I=="function"?I(w):I)),m.createElement(on,null,function(ge){return m.createElement(C,we({"data-baseweb":"form-control-container"},w,Ee(f)),m.Children.map($,function(ie,G){if(ie){var ee=ie.key||String(G);return m.cloneElement(ie,{key:ee,"aria-errormessage":v?ge:null,"aria-describedby":y||S?ge:null,disabled:k.disabled||g,error:typeof k.error<"u"?k.error:w.$error,positive:typeof k.positive<"u"?k.positive:w.$positive})}}),(!!y||!!v||S)&&m.createElement(E,we({"data-baseweb":"form-control-caption",id:ge},w,Ee(u)),x))}))}}]),n}(m.Component);ua(St,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Sr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Dr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Sr(Object(n),!0).forEach(function(a){da(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function da(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var pa=function(r){return Zn.map(function(n){return{id:n.toString(),label:r(n)}})},fa=function(r,n){return r.map(function(a){return n.includes(Number(a.id))?a:Dr(Dr({},a),{},{disabled:!0})})},ha=function(r){var n=r.filterMonthsList,a=r.formatMonthLabel,e=pa(a);return n&&(e=fa(e,n)),e};function ya(t){var r=t.$range,n=r===void 0?!1:r,a=t.$disabled,e=a===void 0?!1:a,o=t.$isHighlighted,i=o===void 0?!1:o,s=t.$isHovered,c=s===void 0?!1:s,u=t.$selected,f=u===void 0?!1:u,d=t.$hasRangeSelected,y=d===void 0?!1:d,g=t.$startDate,v=g===void 0?!1:g,S=t.$endDate,D=S===void 0?!1:S,$=t.$pseudoSelected,_=$===void 0?!1:$,k=t.$hasRangeHighlighted,w=k===void 0?!1:k,B=t.$pseudoHighlighted,A=B===void 0?!1:B,T=t.$hasRangeOnRight,E=T===void 0?!1:T,C=t.$startOfMonth,x=C===void 0?!1:C,I=t.$endOfMonth,H=I===void 0?!1:I,L=t.$outsideMonth,q=L===void 0?!1:L;return"".concat(+n).concat(+e).concat(+(i||c)).concat(+f).concat(+y).concat(+v).concat(+D).concat(+_).concat(+w).concat(+A).concat(+(w&&!A&&E)).concat(+(w&&!A&&!E)).concat(+x).concat(+H).concat(+q)}function ga(t,r){return Sa(t)||ba(t,r)||ma(t,r)||va()}function va(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ma(t,r){if(t){if(typeof t=="string")return Or(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Or(t,r)}}function Or(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function ba(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(c){o=!0,s=c}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Sa(t){if(Array.isArray(t))return t}function _r(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function ne(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?_r(Object(n),!0).forEach(function(a){Be(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Be(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var zt=X("div",function(t){var r=t.$separateRangeInputs;return ne({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});zt.displayName="StyledInputWrapper";zt.displayName="StyledInputWrapper";var Ut=X("div",function(t){var r=t.$theme;return ne(ne({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});Ut.displayName="StyledInputLabel";Ut.displayName="StyledInputLabel";var qt=X("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});qt.displayName="StyledStartDate";qt.displayName="StyledStartDate";var Kt=X("div",function(t){return t.$theme,{width:"100%"}});Kt.displayName="StyledEndDate";Kt.displayName="StyledEndDate";var Xt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.borders;return ne(ne({},n.font200),{},{color:a.calendarForeground,backgroundColor:a.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});Xt.displayName="StyledRoot";Xt.displayName="StyledRoot";var Qt=X("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Bt.vertical?"column":"row"}});Qt.displayName="StyledMonthContainer";Qt.displayName="StyledMonthContainer";var Jt=X("div",function(t){var r=t.$theme.sizing,n=t.$density;return{paddingTop:r.scale300,paddingBottom:n===oe.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});Jt.displayName="StyledCalendarContainer";Jt.displayName="StyledCalendarContainer";var Qe=X("div",function(t){var r=t.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Qe.displayName="StyledSelectorContainer";Qe.displayName="StyledSelectorContainer";var Zt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.borders,e=r.colors,o=r.sizing,i=t.$density;return ne(ne({},i===oe.high?n.LabelMedium:n.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:o.scale600,paddingBottom:o.scale300,paddingLeft:o.scale600,paddingRight:o.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:a.surfaceBorderRadius,borderTopRightRadius:a.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===oe.high?"calc(".concat(o.scale800," + ").concat(o.scale0,")"):o.scale950})});Zt.displayName="StyledCalendarHeader";Zt.displayName="StyledCalendarHeader";var Gt=X("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Gt.displayName="StyledMonthHeader";Gt.displayName="StyledMonthHeader";var er=X("button",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$isFocusVisible,o=t.$density;return ne(ne({},o===oe.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:a.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(a.accent):"none"}})});er.displayName="StyledMonthYearSelectButton";er.displayName="StyledMonthYearSelectButton";var tr=X("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return Be({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});tr.displayName="StyledMonthYearSelectIconContainer";tr.displayName="StyledMonthYearSelectIconContainer";function qr(t){var r=t.$theme,n=t.$disabled,a=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:a?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var rr=X("button",qr);rr.displayName="StyledPrevButton";rr.displayName="StyledPrevButton";var nr=X("button",qr);nr.displayName="StyledNextButton";nr.displayName="StyledNextButton";var ar=X("div",function(t){return{display:"inline-block"}});ar.displayName="StyledMonth";ar.displayName="StyledMonth";var or=X("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});or.displayName="StyledWeek";or.displayName="StyledWeek";function K(t,r){var n,a=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return n={},Be(n,t,r),Be(n,a,r),Be(n,e,r),n}function st(t,r){var n=r.colors,a={":before":{content:null},":after":{content:null}},e=a,o={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},s={":before":{content:null}},c=1;t&&t[c]==="1"&&(e=o);var u=Object.assign({},K("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),K("000100000000000",{color:n.calendarDayForegroundSelected}),K("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},K("000000000000001",i),K("101000000000000",s),K("101010000000000",s),K("100100000000000",{color:n.calendarDayForegroundSelected}),K("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),K("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111000000000",{color:n.calendarDayForegroundSelected}),K("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("100100001010000",{color:n.calendarDayForegroundSelected}),K("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},K("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},K("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),K("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),K("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),K("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),K("100000000000001",i),K("100000001010001",i),K("100000001001001",i),K("100010000000001",i));return u[t]||e}var ir=X("div",function(t){var r=t.$disabled,n=t.$isFocusVisible,a=t.$isHighlighted,e=t.$peekNextMonth,o=t.$pseudoSelected,i=t.$range,s=t.$selected,c=t.$outsideMonth,u=t.$outsideMonthWithinRange,f=t.$hasDateLabel,d=t.$density,y=t.$hasLockedBehavior,g=t.$selectedInput,v=t.$value,S=t.$theme,D=S.colors,$=S.typography,_=S.sizing,k=ya(t),w;f?d===oe.high?w="60px":w="70px":d===oe.high?w="40px":w="48px";var B=Array.isArray(v)?v:[v,null],A=ga(B,2),T=A[0],E=A[1],C=g===_e.startDate?E!==null&&typeof E<"u":T!==null&&typeof T<"u",x=i&&!(y&&!C);return ne(ne(ne({},d===oe.high?$.ParagraphSmall:$.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&c?"default":"pointer",color:D.calendarForeground,display:"inline-block",width:d===oe.high?"42px":"50px",height:w,lineHeight:d===oe.high?_.scale700:_.scale900,textAlign:"center",paddingTop:_.scale300,paddingBottom:_.scale300,paddingLeft:_.scale300,paddingRight:_.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},st(k,t.$theme)),{},{":after":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!c||e)?"0 0 0 3px ".concat(D.accent):"none",backgroundColor:s?D.calendarDayBackgroundSelectedHighlighted:o&&a?D.calendarDayBackgroundPseudoSelectedHighlighted:D.calendarBackground,height:f?"100%":d===oe.high?"42px":"50px",width:"100%",position:"absolute",top:f?0:"-1px",left:0,paddingTop:_.scale200,paddingBottom:_.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:D.borderSelected,borderBottomColor:D.borderSelected,borderRightColor:D.borderSelected,borderLeftColor:D.borderSelected,borderTopLeftRadius:f?_.scale800:"100%",borderTopRightRadius:f?_.scale800:"100%",borderBottomLeftRadius:f?_.scale800:"100%",borderBottomRightRadius:f?_.scale800:"100%"},st(k,t.$theme)[":after"]||{}),u?{content:null}:{})},x?{":before":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:D.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},st(k,t.$theme)[":before"]||{}),u?{backgroundColor:D.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});ir.displayName="StyledDay";ir.displayName="StyledDay";var sr=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$selected;return ne(ne({},n.ParagraphXSmall),{},{color:e?a.contentInverseTertiary:a.contentTertiary})});sr.displayName="StyledDayLabel";sr.displayName="StyledDayLabel";var lr=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.sizing,o=t.$density;return ne(ne({},n.LabelMedium),{},{color:a.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:o===oe.high?"42px":"50px",height:o===oe.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});lr.displayName="StyledWeekdayHeader";lr.displayName="StyledWeekdayHeader";function Dt(t){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Dt(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ye.apply(this,arguments)}function be(t,r){return $a(t)||_a(t,r)||Oa(t,r)||Da()}function Da(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.