@stlite/desktop 0.77.0 → 0.78.0
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.
- package/build/assets/{FileDownload.esm-DJiSKkNf.js → FileDownload.esm-D2QqHv2c.js} +1 -1
- package/build/assets/{FormClearHelper-Dhc_r76k.js → FormClearHelper-DliGOSkq.js} +1 -1
- package/build/assets/{Hooks-DrFfRfR6.js → Hooks-Daeq69Zu.js} +1 -1
- package/build/assets/{InputInstructions-DBmZV4qq.js → InputInstructions-BQD8A2_u.js} +1 -1
- package/build/assets/{ProgressBar-D8toyv14.js → ProgressBar-DuGylkeS.js} +1 -1
- package/build/assets/{RenderInPortalIfExists-BgiI3__B.js → RenderInPortalIfExists-HKy5CC9C.js} +1 -1
- package/build/assets/{Toolbar-BTpOoeAP.js → Toolbar-B9grKd8p.js} +1 -1
- package/build/assets/{base-input-BNFPjj94.js → base-input-DJ1o9wy-.js} +1 -1
- package/build/assets/{createSuper-D-IHZlzE.js → createSuper-BCtrEkDw.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-3T3wOgR5.js → data-grid-overlay-editor-SiNLnLoA.js} +1 -1
- package/build/assets/{downloader-BRNWhhPt.js → downloader-y7WtJrbZ.js} +1 -1
- package/build/assets/{es6-BGfGTfFo.js → es6-ChzZtMws.js} +2 -2
- package/build/assets/{getPrototypeOf-Bfvf6jYJ.js → getPrototypeOf-jxUzvEiF.js} +1 -1
- package/build/assets/{iframeResizer.contentWindow-CAd9E7Yv.js → iframeResizer.contentWindow-VeTSZzxi.js} +1 -1
- package/build/assets/{index-DtCnxC7q.js → index-B2k4Ofkz.js} +1 -1
- package/build/assets/{index-BkQMwfmi.js → index-B7GLWddS.js} +1 -1
- package/build/assets/{index-CCQ8WBbz.js → index-BCDKFsnk.js} +1 -1
- package/build/assets/{index-DXhp4_Bh.js → index-BYdd9282.js} +1 -1
- package/build/assets/{index-DvDmgZ7F.js → index-Bh9EjD0o.js} +1 -1
- package/build/assets/{index-hfjIuaWS.js → index-Bia2Aiul.js} +1 -1
- package/build/assets/{index-uFJhQ6op.js → index-BqYxHJ94.js} +1 -1
- package/build/assets/{index-Bf8NyENV.js → index-Bsw1C-zM.js} +1 -1
- package/build/assets/{index-D20xuISa.js → index-ByZKQf5p.js} +1 -1
- package/build/assets/{index-DSp2Cc2a.js → index-C-G07XIn.js} +1 -1
- package/build/assets/{index-R99zJVpL.js → index-C5VxAqHf.js} +1 -1
- package/build/assets/{index-CSeZQPbV.js → index-C9Os1Tio.js} +1 -1
- package/build/assets/{index-C1nS5RIf.js → index-CFVMKjCp.js} +1 -1
- package/build/assets/{index-DS1KzaKA.js → index-CGRaMNW7.js} +1 -1
- package/build/assets/{index-DEAAmCoL.js → index-CQ8B9Pyu.js} +1 -1
- package/build/assets/{index-BgM3jrky.js → index-CS3mWYPw.js} +1 -1
- package/build/assets/{index-DlrQfTa3.js → index-CSRB3KZi.js} +1 -1
- package/build/assets/{index-BzdmnoFw.js → index-C_q5O89K.js} +1 -1
- package/build/assets/{index-c-P5wgpW.js → index-CnPYErGb.js} +1 -1
- package/build/assets/{index-2GihT9MS.js → index-CpzAXWaZ.js} +1 -1
- package/build/assets/{index-CeMslFeR.js → index-CvKkwQxq.js} +1 -1
- package/build/assets/{index-IG3UXYla.js → index-CxF9whAo.js} +1 -1
- package/build/assets/{index-14giYAR7.js → index-Cxp-1GAt.js} +1 -1
- package/build/assets/{index-DVBTaPM3.js → index-DMBd-bc-.js} +5 -5
- package/build/assets/{index-CzMG-04F.js → index-DXHAdPWu.js} +1 -1
- package/build/assets/{index-DwF2Kd5G.js → index-DYrQR0Ux.js} +1 -1
- package/build/assets/{index-DpQaX_zS.js → index-Dh5Ef2Om.js} +1 -1
- package/build/assets/{index-CWQIbxk6.js → index-Di0b5deS.js} +1 -1
- package/build/assets/{index-Dd4zWSqM.js → index-Dkd6yjmr.js} +1 -1
- package/build/assets/{index-BbkQg7FB.js → index-Do74AQgb.js} +1 -1
- package/build/assets/{index-DLzppoKu.js → index-GTNwQsph.js} +1 -1
- package/build/assets/{index-BCXIPEnn.js → index-JLaGWCy4.js} +1 -1
- package/build/assets/{index-DGyUD6Fc.js → index-NW5mgelH.js} +1 -1
- package/build/assets/{index-CRU3QRmk.js → index-UrV00MOE.js} +1 -1
- package/build/assets/{index-DWl7GYN1.js → index-j3NobT-r.js} +1 -1
- package/build/assets/{index-CqPAWIlG.js → index-lR3NBV82.js} +1 -1
- package/build/assets/{index-lyJc68Dt.js → index-z2lXC7XI.js} +4 -4
- package/build/assets/{input-B0OfG1Hd.js → input-Dhep7xP0.js} +1 -1
- package/build/assets/{memory-Db7tbqiS.js → memory-BqTZFgXm.js} +1 -1
- package/build/assets/{number-overlay-editor-DNvGPhC6.js → number-overlay-editor-BywJqzaW.js} +1 -1
- package/build/assets/{sandbox-0hHf-j9y.js → sandbox-DmnKum9A.js} +1 -1
- package/build/assets/{slicedToArray-C3Kk8BEP.js → slicedToArray-DkF8JK54.js} +1 -1
- package/build/assets/{textarea-DjoYY0dF.js → textarea-CCmBHfjM.js} +1 -1
- package/build/assets/{timepicker-Cn0ZGw9I.js → timepicker-DWOLsPBU.js} +1 -1
- package/build/assets/{uniqueId-K4UOiJl2.js → uniqueId-C3qA3EXY.js} +1 -1
- package/build/assets/{useBasicWidgetState-BzSjsdCt.js → useBasicWidgetState-CDQNZkN8.js} +1 -1
- package/build/assets/{useOnInputChange-VVCu-n8v.js → useOnInputChange-FEZNS9DP.js} +1 -1
- package/build/assets/{withFullScreenWrapper-BggmGF09.js → withFullScreenWrapper-dTVQmtO5.js} +1 -1
- package/build/assets/worker-CLbVOjel.js +117 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/package.json +5 -5
- package/wheels/streamlit-1.41.0-cp312-none-any.whl +0 -0
- package/build/assets/worker-DddKT6_v.js +0 -117
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,E as z,_ as B,aj as ht,aS as Vt,aT as _t,aU as $t,B as $,F as H,R as ut,a6 as Ht,c as R,aV as Xt,j as f,aW as Gt,aX as qt,aG as Yt,aY as Zt,O as Kt,M as Jt,aZ as J,S as Qt,$ as te,a_ as ee,a$ as ie,b0 as se,aK as re}from"./index-lyJc68Dt.js";import{u as ne,F as oe}from"./FormClearHelper-Dhc_r76k.js";import{T as ae,a as pt}from"./Toolbar-BTpOoeAP.js";import{u as le}from"./Hooks-DrFfRfR6.js";import{c as de}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ce,D as he}from"./FileDownload.esm-DJiSKkNf.js";var mt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});mt.displayName="Mic";var gt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});gt.displayName="Pause";var ft=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});ft.displayName="PlayArrow";var vt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});vt.displayName="Refresh";var bt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});bt.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(d){try{c(i.next(d))}catch(l){r(l)}}function o(d){try{c(i.throw(d))}catch(l){r(l)}}function c(d){var l;d.done?n(d.value):(l=d.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}c((i=i.apply(s,t||[])).next())})}let F=class{constructor(){this.listeners={}}on(s,t,e){if(this.listeners[s]||(this.listeners[s]=new Set),this.listeners[s].add(t),e==null?void 0:e.once){const i=()=>{this.un(s,i),this.un(s,t)};return this.on(s,i),i}return()=>this.un(s,t)}un(s,t){var e;(e=this.listeners[s])===null||e===void 0||e.delete(t)}once(s,t){return this.on(s,t,{once:!0})}unAll(){this.listeners={}}emit(s,...t){this.listeners[s]&&this.listeners[s].forEach(e=>e(...t))}};const yt={decode:function(s,t){return E(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 wt(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(wt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Ct(s,t,e){const i=wt(s,t||{});return e==null||e.appendChild(i),i}var ue=Object.freeze({__proto__:null,createElement:Ct,default:Ct});const pe={fetchBlob:function(s,t,e){return E(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){E(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 c=0;const d=p=>E(this,void 0,void 0,function*(){c+=(p==null?void 0:p.length)||0;const h=Math.round(c/o*100);r(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(d(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class me extends F{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;try{this.media.src=n}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(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=t}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 F{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],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 c=matchMedia("(pointer: coarse)").matches;let d=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),c&&Date.now()-b<o)return;const P=C.clientX,W=C.clientY,j=P-h,T=W-m;if(g||Math.abs(j)>r||Math.abs(T)>r){const A=t.getBoundingClientRect(),{left:U,top:L}=A;g||(i==null||i(h-U,m-L),g=!0),e(j,T,P-U,W-L),h=P,m=W}},w=C=>{if(g){const P=C.clientX,W=C.clientY,j=t.getBoundingClientRect(),{left:T,top:A}=j;n==null||n(P-T,W-A)}d()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},M=C=>{g&&(C.stopPropagation(),C.preventDefault())},k=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("click",M,{capture:!0}),d=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",k),setTimeout(()=>{document.removeEventListener("click",M,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{d(),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 z,_ as B,aj as ht,aS as Vt,aT as _t,aU as $t,B as $,F as H,R as ut,a6 as Ht,c as R,aV as Xt,j as f,aW as Gt,aX as qt,aG as Yt,aY as Zt,O as Kt,M as Jt,aZ as J,S as Qt,$ as te,a_ as ee,a$ as ie,b0 as se,aK as re}from"./index-z2lXC7XI.js";import{u as ne,F as oe}from"./FormClearHelper-DliGOSkq.js";import{T as ae,a as pt}from"./Toolbar-B9grKd8p.js";import{u as le}from"./Hooks-Daeq69Zu.js";import{c as de}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ce,D as he}from"./FileDownload.esm-D2QqHv2c.js";var mt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});mt.displayName="Mic";var gt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});gt.displayName="Pause";var ft=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});ft.displayName="PlayArrow";var vt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});vt.displayName="Refresh";var bt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({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"}))});bt.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(d){try{c(i.next(d))}catch(l){r(l)}}function o(d){try{c(i.throw(d))}catch(l){r(l)}}function c(d){var l;d.done?n(d.value):(l=d.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}c((i=i.apply(s,t||[])).next())})}let F=class{constructor(){this.listeners={}}on(s,t,e){if(this.listeners[s]||(this.listeners[s]=new Set),this.listeners[s].add(t),e==null?void 0:e.once){const i=()=>{this.un(s,i),this.un(s,t)};return this.on(s,i),i}return()=>this.un(s,t)}un(s,t){var e;(e=this.listeners[s])===null||e===void 0||e.delete(t)}once(s,t){return this.on(s,t,{once:!0})}unAll(){this.listeners={}}emit(s,...t){this.listeners[s]&&this.listeners[s].forEach(e=>e(...t))}};const yt={decode:function(s,t){return E(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 wt(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(wt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Ct(s,t,e){const i=wt(s,t||{});return e==null||e.appendChild(i),i}var ue=Object.freeze({__proto__:null,createElement:Ct,default:Ct});const pe={fetchBlob:function(s,t,e){return E(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){E(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 c=0;const d=p=>E(this,void 0,void 0,function*(){c+=(p==null?void 0:p.length)||0;const h=Math.round(c/o*100);r(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(d(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class me extends F{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;try{this.media.src=n}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(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=t}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 F{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],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 c=matchMedia("(pointer: coarse)").matches;let d=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),c&&Date.now()-b<o)return;const P=C.clientX,W=C.clientY,j=P-h,T=W-m;if(g||Math.abs(j)>r||Math.abs(T)>r){const A=t.getBoundingClientRect(),{left:U,top:L}=A;g||(i==null||i(h-U,m-L),g=!0),e(j,T,P-U,W-L),h=P,m=W}},w=C=>{if(g){const P=C.clientX,W=C.clientY,j=t.getBoundingClientRect(),{left:T,top:A}=j;n==null||n(P-T,W-A)}d()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},M=C=>{g&&(C.stopPropagation(),C.preventDefault())},k=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("click",M,{capture:!0}),d=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",k),setTimeout(()=>{document.removeEventListener("click",M,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{d(),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{r,M as k,bZ as W,j as s,a_ as H,a$ as D,bc as E,b0 as M,aK as U}from"./index-
|
|
1
|
+
import{r,M as k,bZ as W,j as s,a_ as H,a$ as D,bc as E,b0 as M,aK as U}from"./index-z2lXC7XI.js";import{u as _}from"./uniqueId-C3qA3EXY.js";import{u as A,a as B,b as L}from"./useOnInputChange-FEZNS9DP.js";import{I as P}from"./InputInstructions-BQD8A2_u.js";import{a as K}from"./useBasicWidgetState-CDQNZkN8.js";import{T as $}from"./textarea-CCmBHfjM.js";import"./inputUtils-CptNuJwn.js";import"./FormClearHelper-DliGOSkq.js";import"./base-input-DJ1o9wy-.js";const S=(a,e)=>a.getStringValue(e)??e.default??null,G=a=>a.default??null,N=a=>a.value??null,O=(a,e,i,d)=>{e.setStringValue(a,i.value,{fromUi:i.fromUi},d)},Z=({disabled:a,element:e,widgetMgr:i,fragmentId:d,width:h})=>{var x;const b=r.useRef(_("text_area_")).current,[l,m]=r.useState(!1),[I,c]=r.useState(!1),[o,n]=r.useState(S(i,e)??null),y=r.useCallback(()=>{n(e.default??null),m(!0)},[e]),[C,g]=K({getStateFromWidgetMgr:S,getDefaultStateFromProto:G,getCurrStateFromProto:N,updateWidgetMgrState:O,element:e,widgetMgr:i,fragmentId:d,onFormCleared:y});A(C,o,n,l);const t=k(),u=r.useCallback(()=>{m(!1),g({value:o,fromUi:!0})},[o,g]),T=r.useCallback(()=>{l&&u(),c(!1)},[l,u]),v=r.useCallback(()=>{c(!0)},[]),F=B({formId:e.formId,maxChars:e.maxChars,setDirty:m,setUiValue:n,setValueWithSource:g}),j=L(e.formId,u,l,i,d,!0),w={width:h},{height:f,placeholder:z,formId:p}=e,R=W({formId:p})?i.allowFormEnterToSubmit(p):l,V=I&&h>t.breakpoints.hideWidgetDetails;return s.jsxs("div",{className:"stTextArea","data-testid":"stTextArea",style:w,children:[s.jsx(H,{label:e.label,disabled:a,labelVisibility:D((x=e.labelVisibility)==null?void 0:x.value),htmlFor:b,children:e.help&&s.jsx(E,{children:s.jsx(M,{content:e.help,placement:U.TOP_RIGHT})})}),s.jsx($,{value:o??"",placeholder:z,onBlur:T,onFocus:v,onChange:F,onKeyDown:j,"aria-label":e.label,disabled:a,id:b,overrides:{Input:{style:{lineHeight:t.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:t.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:t.spacing.lg,paddingLeft:t.spacing.lg,paddingBottom:t.spacing.lg,paddingTop:t.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth}}}}),V&&s.jsx(P,{dirty:l,value:o??"",maxLength:e.maxChars,type:"multiline",inForm:W({formId:p}),allowEnterToSubmit:R})]})},q=r.memo(Z);export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as W,r,M as C,bw as T,bx as j,j as l,a_ as k,a$ as L,bc as $,b0 as V,aK as A,bv as N,by as B,br as H,ba as O,bz as P}from"./index-
|
|
1
|
+
import{c as W,r,M as C,bw as T,bx as j,j as l,a_ as k,a$ as L,bc as $,b0 as V,aK as A,bv as N,by as B,br as H,ba as O,bz as P}from"./index-z2lXC7XI.js";import{a as E}from"./useBasicWidgetState-CDQNZkN8.js";import"./FormClearHelper-DliGOSkq.js";const F=W("div",{target:"e6zijwc0"})(({theme:o})=>({"span[aria-disabled='true']":{background:o.colors.fadedText05}}),""),G=(o,t)=>o.getIntArrayValue(t),K=o=>o.default??null,U=o=>o.value??null,D=(o,t,n,p)=>{t.setIntArrayValue(o,n.value,{fromUi:n.fromUi},p)},_=o=>{var S;const{element:t,widgetMgr:n,width:p,fragmentId:f}=o,e=C(),[s,m]=E({getStateFromWidgetMgr:G,getDefaultStateFromProto:K,getCurrStateFromProto:U,updateWidgetMgrState:D,element:t,widgetMgr:n,fragmentId:f}),u=t.maxSelections>0&&s.length>=t.maxSelections,y=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(s.length===t.maxSelections){const i=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${i}. Remove an option first.`}return"No results"},[t.maxSelections,s.length]),v=r.useMemo(()=>s.map(i=>{const a=t.options[i];return{value:i.toString(),label:a}}),[t.options,s]),h=r.useCallback(i=>{const a=()=>{var c;const g=(c=i.option)==null?void 0:c.value;return parseInt(g,10)};switch(i.type){case"remove":return T(s,a());case"clear":return[];case"select":return s.concat([a()]);default:throw new Error(`State transition is unknown: ${i.type}`)}},[s]),x=r.useCallback(i=>{t.maxSelections&&i.type==="select"&&s.length>=t.maxSelections||m({value:h(i),fromUi:!0})},[t.maxSelections,h,m,s.length]),z=r.useCallback((i,a)=>{if(u)return[];const g=i.filter(c=>!s.includes(Number(c.value)));return j(g,a)},[u,s]),w={width:p},{options:d}=t,b=d.length===0?!0:o.disabled,R=d.length===0?"No options to select.":t.placeholder,I=d.map((i,a)=>({label:i,value:a.toString()})),M=d.length>10;return l.jsxs("div",{className:"stMultiSelect","data-testid":"stMultiSelect",style:w,children:[l.jsx(k,{label:t.label,disabled:b,labelVisibility:L((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l.jsx($,{children:l.jsx(V,{content:t.help,placement:A.TOP_RIGHT})})}),l.jsx(F,{children:l.jsx(N,{options:I,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:R,type:B.select,multi:!0,onChange:x,value:v,disabled:b,size:"compact",noResultsMsg:y,filterOptions:z,closeOnSelect:!1,overrides:{SelectArrow:{component:H,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",opacity:"0.7"})},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,":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})`}},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:O&&M===!1?"readonly":null}},Dropdown:{component:P}}})})]})},q=r.memo(_);export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,F as c,j as l,aB as d,aC as n,B as g}from"./index-
|
|
1
|
+
import{c as r,F as c,j as l,aB as d,aC as n,B as g}from"./index-z2lXC7XI.js";const h=r("iframe",{target:"e1u6k47s0"})(({theme:a,disableScrolling:e})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,overflow:e?"hidden":void 0}),"");function m({element:a,width:e}){const i=a.hasWidth?a.width:e,o=s(a.src),t=c(o)?void 0:s(a.srcdoc);return l.jsx(h,{className:"stIFrame","data-testid":"stIFrame",allow:d,disableScrolling:!a.scrolling,src:o,srcDoc:t,width:i,height:a.height,scrolling:a.scrolling?"auto":"no",sandbox:n,title:"st.iframe"})}function s(a){return g(a)||a===""?void 0:a}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,i as a,aV as l,R as d,a6 as c,bA as g,j as o,bB as h,a2 as p}from"./index-
|
|
1
|
+
import{c as r,i as a,aV as l,R as d,a6 as c,bA as g,j as o,bB as h,a2 as p}from"./index-z2lXC7XI.js";const m=r(l,{shouldForwardProp:a,target:"e1se5lgy2"})(({theme:e,usingCustomTheme:t})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,radius:e.radii.md,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:t?e.colors.primary:e.colors.blue70,flexGrow:0,flexShrink:0}),""),u=r("div",{target:"e1se5lgy1"})(({theme:e,width:t,cache:i})=>({width:t,...i?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null}),""),b=r("div",{target:"e1se5lgy0"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"}),"");function x({width:e,element:t}){const{activeTheme:i}=d.useContext(c),n=!g(i),{cache:s}=t;return o.jsx(u,{className:h({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",width:e,cache:s,children:o.jsxs(b,{children:[o.jsx(m,{usingCustomTheme:n}),o.jsx(p,{source:t.text,allowHTML:!1})]})})}export{x as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{bs as Pe,c0 as Ce,c1 as Ie,c2 as we,c3 as Ee,c4 as Te,bF as De,b2 as xe,bk as Re,c5 as _e,bG as $e,aA as ke,r as P,c6 as Be,c as Me,B as R,M as ze,br as Ne,j as S,a_ as Ae,a$ as Le,bc as Fe,b0 as We,aK as Ze}from"./index-
|
|
1
|
+
import{bs as Pe,c0 as Ce,c1 as Ie,c2 as we,c3 as Ee,c4 as Te,bF as De,b2 as xe,bk as Re,c5 as _e,bG as $e,aA as ke,r as P,c6 as Be,c as Me,B as R,M as ze,br as Ne,j as S,a_ as Ae,a$ as Le,bc as Fe,b0 as We,aK as Ze}from"./index-z2lXC7XI.js";import{a as Ve}from"./useBasicWidgetState-CDQNZkN8.js";import{T as He}from"./timepicker-DWOLsPBU.js";import"./FormClearHelper-DliGOSkq.js";import"./getPrototypeOf-jxUzvEiF.js";import"./createSuper-BCtrEkDw.js";var Ue=Pe.Consumer;const Je=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Ue,ThemeProvider:Ce,createThemedStyled:Ie,createThemedUseStyletron:we,createThemedWithStyle:Ee,expandBorderStyles:Te,hexToRgb:De,styled:xe,useStyletron:Re,withStyle:_e,withWrapper:$e},Symbol.toStringTag,{value:"Module"}));var d={};const _=ke(Je);var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.STATE_CHANGE_TYPE=g.SIZE=g.ENHANCER_POSITION=g.CUSTOM_INPUT_TYPE=g.ADJOINED=void 0;var Ge={change:"change"};g.STATE_CHANGE_TYPE=Ge;var Ye={textarea:"textarea"};g.CUSTOM_INPUT_TYPE=Ye;var qe={none:"none",left:"left",right:"right",both:"both"};g.ADJOINED=qe;var Ke={mini:"mini",default:"default",compact:"compact",large:"large"};g.SIZE=Ke;var Xe={start:"start",end:"end"};g.ENHANCER_POSITION=Xe;var E={},y={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.default=te;function k(e){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(e)}function te(e){e=e||{};for(var t=arguments.length<=1?0:arguments.length-1,r,o,n=0;n<t;n++){r=(n+1<1||arguments.length<=n+1?void 0:arguments[n+1])||{};for(var i in r)k(r[i])!==void 0&&(o=r[i],Qe(o)?e[i]=te(e[i]||Array.isArray(o)&&[]||{},o):e[i]=o)}return e}function Qe(e){return Array.isArray(e)||{}.toString.call(e)=="[object Object]"}Object.defineProperty(y,"__esModule",{value:!0}),y.getOverride=ae,y.getOverrideProps=z,y.getOverrides=le,y.mergeConfigurationOverrides=A,y.mergeOverride=ue,y.mergeOverrides=ot,y.toObjectOverride=N,y.useOverrides=nt;var B=tt(P),re=Be,oe=et($);function et(e){return e.__esModule?e:{default:e}}function ne(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ne=function(o){return o?r:t})(e)}function tt(e,t){if(e&&e.__esModule)return e;if(e===null||v(e)!=="object"&&typeof e!="function")return{default:e};var r=ne(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},M.apply(this,arguments)}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(o){rt(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(e)}function ae(e){return(0,re.isValidElementType)(e)?e:e&&v(e)==="object"?e.component:e}function z(e){return e&&v(e)==="object"?v(e.props)==="object"?C(C({},e.props),{},{$style:e.style}):{$style:e.style}:{}}function N(e){return(0,re.isValidElementType)(e)?{component:e}:e||{}}function le(e,t){var r=ae(e)||t;if(e&&v(e)==="object"&&typeof e.props=="function"){var o=B.forwardRef(function(i,a){var c=e.props(i),s=z(C(C({},e),{},{props:c}));return B.createElement(r,M({ref:a},s))});return o.displayName=r.displayName,[o,{}]}var n=z(e);return[r,n]}function ot(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Object.assign({},e,t),o=Object.keys(r);return o.reduce(function(n,i){return n[i]=ue(N(e[i]),N(t[i])),n},{})}function ue(e,t){var r=C(C({},e),t);return e.props&&t.props&&(r.props=A(e.props,t.props)),e.style&&t.style&&(r.style=A(e.style,t.style)),r}function A(e,t){return v(e)==="object"&&v(t)==="object"?(0,oe.default)({},e,t):function(){return(0,oe.default)({},typeof e=="function"?e.apply(void 0,arguments):e,typeof t=="function"?t.apply(void 0,arguments):t)}}function nt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B.useMemo(function(){return Object.keys(e).reduce(function(r,o){return r[o]=le(t[o],e[o]),r},{})},[t])}var T={},I={};Object.defineProperty(I,"__esModule",{value:!0}),I.Svg=void 0,I.getSvgStyles=se;var it=_;function se(e){var t=e.$theme,r=e.$size,o=e.$color,n=t.sizing.scale600;r&&(t.sizing[r]?n=t.sizing[r]:typeof r=="number"?n="".concat(r,"px"):n=r);var i="currentColor";return o&&(t.colors[o]?i=t.colors[o]:i=o),{display:"inline-block",fill:i,color:i,height:n,width:n}}var L=(0,it.styled)("svg",se);I.Svg=L,L.displayName="Svg",L.displayName="Svg";var F={};Object.defineProperty(F,"__esModule",{value:!0}),F.default=at;function at(e){var t={};for(var r in e)r[0]!=="$"&&(t[r]=e[r]);return t}function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var Z=dt(P),lt=y,ut=I,ce=ct(F),st=["children","title","size","color","overrides"];function ct(e){return e.__esModule?e:{default:e}}function de(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(de=function(o){return o?r:t})(e)}function dt(e,t){if(e&&e.__esModule)return e;if(e===null||W(e)!=="object"&&typeof e!="function")return{default:e};var r=de(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},V.apply(this,arguments)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pe(Object(r),!0).forEach(function(o){pt(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function pt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ft(e,t){return mt(e)||yt(e,t)||bt(e,t)||gt()}function gt(){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 bt(e,t){if(e){if(typeof e=="string")return fe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fe(e,t)}}function fe(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function yt(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o=[],n=!0,i=!1,a,c;try{for(r=r.call(e);!(n=(a=r.next()).done)&&(o.push(a.value),!(t&&o.length===t));n=!0);}catch(s){i=!0,c=s}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw c}}return o}}function mt(e){if(Array.isArray(e))return e}function vt(e,t){if(e==null)return{};var r=ht(e,t),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function ht(e,t){if(e==null)return{};var r={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var Ot=function(e,t){var r=e.children,o=e.title,n=e.size,i=e.color,a=e.overrides,c=a===void 0?{}:a,s=vt(e,st),l=(0,lt.getOverrides)(c.Svg,ut.Svg),f=ft(l,2),m=f[0],h=f[1],O=m.__STYLETRON__?D(D({title:o,$color:i,$size:n},s),h):D(D({title:o,color:i,size:n},(0,ce.default)(s)),(0,ce.default)(h));return Z.createElement(m,V({"data-baseweb":"icon",ref:t},O),o?Z.createElement("title",null,o):null,r)},St=Z.forwardRef(Ot);T.default=St;function H(e){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(e)}Object.defineProperty(E,"__esModule",{value:!0}),E.default=void 0;var U=wt(P),jt=_,ge=y,Pt=It(T),Ct=["title","size","color","overrides"];function It(e){return e.__esModule?e:{default:e}}function be(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(be=function(o){return o?r:t})(e)}function wt(e,t){if(e&&e.__esModule)return e;if(e===null||H(e)!=="object"&&typeof e!="function")return{default:e};var r=be(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},J.apply(this,arguments)}function Et(e,t){if(e==null)return{};var r=Tt(e,t),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function Tt(e,t){if(e==null)return{};var r={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}function Dt(e,t){return $t(e)||_t(e,t)||Rt(e,t)||xt()}function xt(){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 Rt(e,t){if(e){if(typeof e=="string")return ye(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(e,t)}}function ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _t(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o=[],n=!0,i=!1,a,c;try{for(r=r.call(e);!(n=(a=r.next()).done)&&(o.push(a.value),!(t&&o.length===t));n=!0);}catch(s){i=!0,c=s}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw c}}return o}}function $t(e){if(Array.isArray(e))return e}function kt(e,t){var r=(0,jt.useStyletron)(),o=Dt(r,2),n=o[1],i=e.title,a=i===void 0?"Delete Alt":i,c=e.size,s=e.color,l=e.overrides,f=l===void 0?{}:l,m=Et(e,Ct),h=(0,ge.mergeOverride)({component:n.icons&&n.icons.DeleteAlt?n.icons.DeleteAlt:null},f&&f.Svg?(0,ge.toObjectOverride)(f.Svg):{});return U.createElement(Pt.default,J({viewBox:"0 0 24 24",ref:t,title:a,size:c,color:s,overrides:{Svg:h}},m),U.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var Bt=U.forwardRef(kt);E.default=Bt,Object.defineProperty(d,"__esModule",{value:!0}),d.getRootStyles=d.getInputStyles=d.getInputContainerStyles=d.StyledMaskToggleButton=d.StyledClearIconContainer=ve=d.StyledClearIcon=d.Root=d.InputEnhancer=d.InputContainer=d.Input=void 0;var j=_,u=g,Mt=zt(E);function zt(e){return e.__esModule?e:{default:e}}function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?me(Object(r),!0).forEach(function(o){p(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G=(0,j.styled)("button",function(e){var t,r=e.$theme,o=e.$size,n=e.$isFocusVisible,i=(t={},p(t,u.SIZE.mini,r.sizing.scale400),p(t,u.SIZE.compact,r.sizing.scale400),p(t,u.SIZE.default,r.sizing.scale300),p(t,u.SIZE.large,r.sizing.scale200),t)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:i,paddingRight:i,outline:n?"solid 3px ".concat(r.colors.accent):"none",color:r.colors.contentPrimary}});d.StyledMaskToggleButton=G,G.displayName="StyledMaskToggleButton",G.displayName="StyledMaskToggleButton";var Y=(0,j.styled)("div",function(e){var t,r=e.$alignTop,o=r===void 0?!1:r,n=e.$size,i=e.$theme,a=(t={},p(t,u.SIZE.mini,i.sizing.scale200),p(t,u.SIZE.compact,i.sizing.scale200),p(t,u.SIZE.default,i.sizing.scale100),p(t,u.SIZE.large,i.sizing.scale0),t)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?i.sizing.scale500:"0px",color:i.colors.contentPrimary}});d.StyledClearIconContainer=Y,Y.displayName="StyledClearIconContainer",Y.displayName="StyledClearIconContainer";var q=(0,j.styled)(Mt.default,function(e){var t=e.$theme,r=e.$isFocusVisible;return{cursor:"pointer",outline:r?"solid 3px ".concat(t.colors.accent):"none"}}),ve=d.StyledClearIcon=q;q.displayName="StyledClearIcon",q.displayName="StyledClearIcon";function Nt(e,t){var r;return(r={},p(r,u.SIZE.mini,{paddingTop:t.scale100,paddingBottom:t.scale100,paddingLeft:t.scale550,paddingRight:t.scale550}),p(r,u.SIZE.compact,{paddingTop:t.scale200,paddingBottom:t.scale200,paddingLeft:t.scale550,paddingRight:t.scale550}),p(r,u.SIZE.default,{paddingTop:t.scale400,paddingBottom:t.scale400,paddingLeft:t.scale550,paddingRight:t.scale550}),p(r,u.SIZE.large,{paddingTop:t.scale550,paddingBottom:t.scale550,paddingLeft:t.scale550,paddingRight:t.scale550}),r)[e]}function At(e,t,r,o,n){var i=e===u.ADJOINED.both||e===u.ADJOINED.left&&o!=="rtl"||e===u.ADJOINED.right&&o==="rtl"||n&&o==="rtl",a=e===u.ADJOINED.both||e===u.ADJOINED.right&&o!=="rtl"||e===u.ADJOINED.left&&o==="rtl"||n&&o!=="rtl";return{paddingLeft:i?r.scale550:"0px",paddingRight:a?r.scale550:"0px"}}function x(e,t){var r;return(r={},p(r,u.SIZE.mini,t.font100),p(r,u.SIZE.compact,t.font200),p(r,u.SIZE.default,t.font300),p(r,u.SIZE.large,t.font400),r)[e]}function Lt(e,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:t?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:r?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}function Ft(e,t){var r=t.inputBorderRadius;return e===u.SIZE.mini&&(r=t.inputBorderRadiusMini),{borderTopLeftRadius:r,borderBottomLeftRadius:r,borderTopRightRadius:r,borderBottomRightRadius:r}}var he=function(e){var t=e.$isFocused,r=e.$adjoined,o=e.$error,n=e.$disabled,i=e.$positive,a=e.$size,c=e.$theme,s=e.$theme,l=s.borders,f=s.colors,m=s.sizing,h=s.typography,O=s.animation,w=e.$hasIconTrailing;return b(b(b(b({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:O.timing200,transitionTimingFunction:O.easeOutCurve},Ft(a,l)),x(a,h)),Lt(n,t,o,i,f)),At(r,a,m,c.direction,w))};d.getRootStyles=he;var K=(0,j.styled)("div",he);d.Root=K,K.displayName="Root",K.displayName="Root";function Wt(e,t){var r;return(r={},p(r,u.SIZE.mini,{paddingRight:t.scale400,paddingLeft:t.scale400}),p(r,u.SIZE.compact,{paddingRight:t.scale400,paddingLeft:t.scale400}),p(r,u.SIZE.default,{paddingRight:t.scale300,paddingLeft:t.scale300}),p(r,u.SIZE.large,{paddingRight:t.scale200,paddingLeft:t.scale200}),r)[e]}function Zt(e,t,r,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var X=(0,j.styled)("div",function(e){var t=e.$size,r=e.$disabled,o=e.$isFocused,n=e.$error,i=e.$positive,a=e.$theme,c=a.colors,s=a.sizing,l=a.typography,f=a.animation;return b(b(b({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:f.timing200,transitionTimingFunction:f.easeOutCurve},x(t,l)),Wt(t,s)),Zt(r,o,n,i,c))});d.InputEnhancer=X,X.displayName="InputEnhancer",X.displayName="InputEnhancer";function Vt(e,t,r,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var Oe=function(e){var t=e.$isFocused,r=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,a=e.$theme,c=a.colors,s=a.typography,l=a.animation;return b(b({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:l.timing200,transitionTimingFunction:l.easeOutCurve},x(i,s)),Vt(o,t,r,n,c))};d.getInputContainerStyles=Oe;var Q=(0,j.styled)("div",Oe);d.InputContainer=Q,Q.displayName="InputContainer",Q.displayName="InputContainer";function Ht(e,t,r,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}var Se=function(e){var t=e.$disabled,r=e.$isFocused,o=e.$error,n=e.$size,i=e.$theme,a=i.colors,c=i.sizing,s=i.typography;return b(b(b({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:t?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},x(n,s)),Nt(n,c)),Ht(t,r,o,a))};d.getInputStyles=Se;var ee=(0,j.styled)("input",Se);d.Input=ee,ee.displayName="Input",ee.displayName="Input";const Ut=Me("div",{target:"e1ipygm10"})({name:"1ucqwki",styles:"position:absolute;top:50%;right:2.05em"});function Jt({disabled:e,element:t,widgetMgr:r,width:o,fragmentId:n}){var O;const[i,a]=Ve({getStateFromWidgetMgr:Gt,getDefaultStateFromProto:Yt,getCurrStateFromProto:qt,updateWidgetMgrState:Kt,element:t,widgetMgr:r,fragmentId:n}),c=R(t.default)&&!e,s={width:o},l=ze(),f={Select:{props:{disabled:e,overrides:{ControlContainer:{style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:l.spacing.sm})},ValueContainer:{style:()=>({lineHeight:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm})},SingleValue:{props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:l.spacing.none,paddingBottom:l.spacing.none})},DropdownListItem:{style:()=>({paddingRight:l.spacing.lg,paddingLeft:l.spacing.lg,paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:l.spacing.px})}}}},SelectArrow:{component:Ne,props:{overrides:{Svg:{style:()=>({width:l.iconSizes.xl,height:l.iconSizes.xl})}}}}}}}},m=P.useCallback(w=>{const je=w===null?null:Xt(w);a({value:je,fromUi:!0})},[a]),h=P.useCallback(()=>{m(null)},[m]);return S.jsxs("div",{className:"stTimeInput","data-testid":"stTimeInput",style:s,children:[S.jsx(Ae,{label:t.label,disabled:e,labelVisibility:Le((O=t.labelVisibility)==null?void 0:O.value),children:t.help&&S.jsx(Fe,{children:S.jsx(We,{content:t.help,placement:Ze.TOP_RIGHT})})}),S.jsx(He,{format:"24",step:t.step?Number(t.step):900,value:R(i)?void 0:Qt(i),onChange:m,overrides:f,nullable:c,creatable:!0,"aria-label":t.label}),c&&!R(i)&&S.jsx(Ut,{onClick:h,"data-testid":"stTimeInputClearButton",children:S.jsx(ve,{overrides:{Svg:{style:{color:l.colors.darkGray,padding:l.spacing.threeXS,height:l.sizes.clearIconSize,width:l.sizes.clearIconSize,":hover":{fill:l.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Gt(e,t){return e.getStringValue(t)??null}function Yt(e){return e.default??null}function qt(e){return e.value??null}function Kt(e,t,r,o){t.setStringValue(e,r.value,{fromUi:r.fromUi},o)}function Xt(e){const t=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0");return`${t}:${r}`}function Qt(e){if(e===null)return null;const[t,r]=e.split(":").map(Number),o=new Date;return o.setHours(t),o.setMinutes(r),o}const er=P.memo(Jt);export{er as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as S,_ as B,c,a5 as T,M as L,j as s,aY as V}from"./index-
|
|
1
|
+
import{r as a,E as S,_ as B,c,a5 as T,M as L,j as s,aY as V}from"./index-z2lXC7XI.js";import{I as K}from"./InputInstructions-BQD8A2_u.js";import{i as M}from"./inputUtils-CptNuJwn.js";import{T as A}from"./textarea-CCmBHfjM.js";import"./base-input-DJ1o9wy-.js";var R=a.forwardRef(function(e,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,B({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("rect",{width:24,height:24,fill:"none"}),a.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});R.displayName="Send";const D=c("div",{target:"e1d2x3se4"})(({theme:e,width:r})=>({borderRadius:e.radii.default,display:"flex",backgroundColor:e.colors.widgetBackgroundColor??e.colors.secondaryBg,width:`${r}px`}),""),N=c("div",{target:"e1d2x3se3"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"relative",flexGrow:1,borderRadius:e.radii.default,display:"flex",alignItems:"center"}),""),F=c("button",{target:"e1d2x3se2"})(({theme:e,disabled:r,extended:l})=>{const g=T(e),[t,h]=g?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40];return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:l?"0":e.radii.default,borderTopLeftRadius:l?e.radii.default:"0",borderBottomRightRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:r?t:h,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:g?e.colors.gray10:e.colors.gray90},"&:hover":{backgroundColor:e.colors.primary,color:e.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray}}},""),G=c("div",{target:"e1d2x3se1"})({name:"1v03qtz",styles:"display:flex;align-items:flex-end;height:100%;position:absolute;right:0;pointer-events:none"}),U=c("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"absolute",bottom:"0px",right:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`}),""),_=6.5,k=1;function q({width:e,element:r,widgetMgr:l,fragmentId:g}){const t=L(),[h,p]=a.useState(!1),[u,m]=a.useState(r.default),[f,x]=a.useState(0),n=a.useRef(null),b=a.useRef({minHeight:0,maxHeight:0}),z=()=>{let o=0;const{current:i}=n;if(i){const d=i.placeholder;i.placeholder="",i.style.height="auto",o=i.scrollHeight,i.placeholder=d,i.style.height=""}return o},y=()=>{n.current&&n.current.focus(),u&&(l.setStringTriggerValue(r,u,{fromUi:!0},g),p(!1),m(""),x(0))},j=o=>{const{metaKey:i,ctrlKey:d,shiftKey:E}=o;M(o)&&!E&&!d&&!i&&(o.preventDefault(),y())},I=o=>{const{value:i}=o.target,{maxChars:d}=r;d!==0&&i.length>d||(p(i!==""),m(i),x(z()))};a.useEffect(()=>{if(r.setValue){r.setValue=!1;const o=r.value||"";m(o),p(o!=="")}},[r]),a.useEffect(()=>{if(n.current){const{offsetHeight:o}=n.current;b.current.minHeight=o,b.current.maxHeight=o*_}},[n]);const{disabled:v,placeholder:C,maxChars:W}=r,{minHeight:$,maxHeight:w}=b.current,H=f>0&&n.current?Math.abs(f-$)>k:!1;return s.jsx(D,{className:"stChatInput","data-testid":"stChatInput",width:e,children:s.jsxs(N,{children:[s.jsx(A,{inputRef:n,value:u,placeholder:C,onChange:I,onKeyDown:j,"aria-label":C,disabled:v,rows:1,overrides:{Root:{style:{minHeight:t.sizes.minElementHeight,outline:"none",backgroundColor:t.colors.transparent,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,width:`${e}px`}},InputContainer:{style:{backgroundColor:t.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:t.lineHeights.inputWidget,backgroundColor:t.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:H?`${f+k}px`:"auto",maxHeight:w?`${w}px`:"none",paddingLeft:t.spacing.sm,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,paddingRight:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}}}}),e>t.breakpoints.hideWidgetDetails&&s.jsx(U,{children:s.jsx(K,{dirty:h,value:u,maxLength:W,type:"chat",inForm:!1})}),s.jsx(G,{children:s.jsx(F,{onClick:y,disabled:!h||v,extended:H,"data-testid":"stChatInputSubmitButton",children:s.jsx(V,{content:R,size:"xl",color:"inherit"})})})]})})}export{q as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-
|
|
1
|
+
import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-z2lXC7XI.js";import{a as un}from"./useBasicWidgetState-CDQNZkN8.js";import{D as oe,a as ae,T as cn,l as Ve}from"./timepicker-DWOLsPBU.js";import{I as pn}from"./input-Dhep7xP0.js";import{I as dn}from"./base-input-DJ1o9wy-.js";import"./FormClearHelper-DliGOSkq.js";import"./getPrototypeOf-jxUzvEiF.js";import"./createSuper-BCtrEkDw.js";var fn=["title","size","color","overrides"];function Ye(){return Ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ye.apply(this,arguments)}function hn(t,r){if(t==null)return{};var o=yn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function yn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function gn(t,r){return Dn(t)||vn(t,r)||bn(t,r)||mn()}function mn(){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 bn(t,r){if(t){if(typeof t=="string")return nr(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nr(t,r)}}function nr(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function vn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Dn(t){if(Array.isArray(t))return t}function Sn(t,r){var o=Kt(),n=gn(o,2),e=n[1],a=t.title,i=a===void 0?"Left":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=hn(t,fn),d=Xt({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,Ye({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),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 or=m.forwardRef(Sn);var On=["title","size","color","overrides"];function We(){return We=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},We.apply(this,arguments)}function wn(t,r){if(t==null)return{};var o=kn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function kn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function Cn(t,r){return Pn(t)||Hn(t,r)||jn(t,r)||Mn()}function Mn(){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 jn(t,r){if(t){if(typeof t=="string")return ar(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ar(t,r)}}function ar(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function Hn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Pn(t){if(Array.isArray(t))return t}function En(t,r){var o=Kt(),n=Cn(o,2),e=n[1],a=t.title,i=a===void 0?"Right":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=wn(t,On),d=Xt({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,We({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),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 ir=m.forwardRef(En);var lr={exports:{}};function An(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var _e=An(m),In=zr;function xn(t,r){for(var o=Object.getOwnPropertyNames(r),n=0;n<o.length;n++){var e=o[n],a=Object.getOwnPropertyDescriptor(r,e);a&&a.configurable&&t[e]===void 0&&Object.defineProperty(t,e,a)}return t}function ze(){return(ze=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function Rn(t,r){t.prototype=Object.create(r.prototype),xn(t.prototype.constructor=t,r)}function Ln(t,r){if(t==null)return{};var o,n,e={},a=Object.keys(t);for(n=0;n<a.length;n++)o=a[n],0<=r.indexOf(o)||(e[o]=t[o]);return e}function ie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var $n=function(t,r,o,n,e,a,i,l){if(!t){var u;if(r===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[o,n,e,a,i,l],y=0;(u=new Error(r.replace(/%s/g,function(){return s[y++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},sr=$n;function ur(t,r,o){if("selectionStart"in t&&"selectionEnd"in t)t.selectionStart=r,t.selectionEnd=o;else{var n=t.createTextRange();n.collapse(!0),n.moveStart("character",r),n.moveEnd("character",o-r),n.select()}}function Bn(t){var r=0,o=0;if("selectionStart"in t&&"selectionEnd"in t)r=t.selectionStart,o=t.selectionEnd;else{var n=document.selection.createRange();n.parentElement()===t&&(r=-n.moveStart("character",-t.value.length),o=-n.moveEnd("character",-t.value.length))}return{start:r,end:o,length:o-r}}var Tn={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},Fn="_";function cr(t,r,o){var n="",e="",a=null,i=[];if(r===void 0&&(r=Fn),o==null&&(o=Tn),!t||typeof t!="string")return{maskChar:r,formatChars:o,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var l=!1;return t.split("").forEach(function(u){l=!l&&u==="\\"||(l||!o[u]?(i.push(n.length),n.length===i.length-1&&(e+=u)):a=n.length+1,n+=u,!1)}),{maskChar:r,formatChars:o,prefix:e,mask:n,lastEditablePosition:a,permanents:i}}function K(t,r){return t.permanents.indexOf(r)!==-1}function Oe(t,r,o){var n=t.mask,e=t.formatChars;if(!o)return!1;if(K(t,r))return n[r]===o;var a=e[n[r]];return new RegExp(a).test(o)}function pr(t,r){return r.split("").every(function(o,n){return K(t,n)||!Oe(t,n,o)})}function fe(t,r){var o=t.maskChar,n=t.prefix;if(!o){for(;r.length>n.length&&K(t,r.length-1);)r=r.slice(0,r.length-1);return r.length}for(var e=n.length,a=r.length;a>=n.length;a--){var i=r[a];if(!K(t,a)&&Oe(t,a,i)){e=a+1;break}}return e}function dr(t,r){return fe(t,r)===t.mask.length}function te(t,r){var o=t.maskChar,n=t.mask,e=t.prefix;if(!o){for((r=Ue(t,"",r,0)).length<e.length&&(r=e);r.length<n.length&&K(t,r.length);)r+=n[r.length];return r}if(r)return Ue(t,te(t,""),r,0);for(var a=0;a<n.length;a++)K(t,a)?r+=n[a]:r+=o;return r}function Nn(t,r,o,n){var e=o+n,a=t.maskChar,i=t.mask,l=t.prefix,u=r.split("");if(a)return u.map(function(y,p){return p<o||e<=p?y:K(t,p)?i[p]:a}).join("");for(var s=e;s<u.length;s++)K(t,s)&&(u[s]="");return o=Math.max(l.length,o),u.splice(o,e-o),r=u.join(""),te(t,r)}function Ue(t,r,o,n){var e=t.mask,a=t.maskChar,i=t.prefix,l=o.split(""),u=dr(t,r);return!a&&n>r.length&&(r+=e.slice(r.length,n)),l.every(function(s){for(;f=s,K(t,d=n)&&f!==e[d];){if(n>=r.length&&(r+=e[n]),y=s,p=n,a&&K(t,p)&&y===a)return!0;if(++n>=e.length)return!1}var y,p,d,f;return!Oe(t,n,s)&&s!==a||(n<r.length?r=a||u||n<i.length?r.slice(0,n)+s+r.slice(n+1):(r=r.slice(0,n)+s+r.slice(n),te(t,r)):a||(r+=s),++n<e.length)}),r}function Vn(t,r,o,n){var e=t.mask,a=t.maskChar,i=o.split(""),l=n;return i.every(function(u){for(;y=u,K(t,s=n)&&y!==e[s];)if(++n>=e.length)return!1;var s,y;return(Oe(t,n,u)||u===a)&&n++,n<e.length}),n-l}function Yn(t,r){for(var o=r;0<=o;--o)if(!K(t,o))return o;return null}function he(t,r){for(var o=t.mask,n=r;n<o.length;++n)if(!K(t,n))return n;return null}function qe(t){return t||t===0?t+"":""}function Wn(t,r,o,n,e){var a=t.mask,i=t.prefix,l=t.lastEditablePosition,u=r,s="",y=0,p=0,d=Math.min(e.start,o.start);return o.end>e.start?p=(y=Vn(t,n,s=u.slice(e.start,o.end),d))?e.length:0:u.length<n.length&&(p=n.length-u.length),u=n,p&&(p===1&&!e.length&&(d=e.start===o.start?he(t,o.start):Yn(t,o.start)),u=Nn(t,u,d,p)),u=Ue(t,u,s,d),(d+=y)>=a.length?d=a.length:d<i.length&&!y?d=i.length:d>=i.length&&d<l&&y&&(d=he(t,d)),s||(s=null),{value:u=te(t,u),enteredString:s,selection:{start:d,end:d}}}function _n(){var t=new RegExp("windows","i"),r=new RegExp("phone","i"),o=navigator.userAgent;return t.test(o)&&r.test(o)}function q(t){return typeof t=="function"}function zn(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function fr(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function hr(t){return(fr()?zn():function(){return setTimeout(t,1e3/60)})(t)}function Ke(t){(fr()||clearTimeout)(t)}var Un=function(t){function r(n){var e=t.call(this,n)||this;e.focused=!1,e.mounted=!1,e.previousSelection=null,e.selectionDeferId=null,e.saveSelectionLoopDeferId=null,e.saveSelectionLoop=function(){e.previousSelection=e.getSelection(),e.saveSelectionLoopDeferId=hr(e.saveSelectionLoop)},e.runSaveSelectionLoop=function(){e.saveSelectionLoopDeferId===null&&e.saveSelectionLoop()},e.stopSaveSelectionLoop=function(){e.saveSelectionLoopDeferId!==null&&(Ke(e.saveSelectionLoopDeferId),e.saveSelectionLoopDeferId=null,e.previousSelection=null)},e.getInputDOMNode=function(){if(!e.mounted)return null;var c=In.findDOMNode(ie(ie(e))),h=typeof window<"u"&&c instanceof window.Element;if(c&&!h)return null;if(c.nodeName!=="INPUT"&&(c=c.querySelector("input")),!c)throw new Error("react-input-mask: inputComponent doesn't contain input node");return c},e.getInputValue=function(){var c=e.getInputDOMNode();return c?c.value:null},e.setInputValue=function(c){var h=e.getInputDOMNode();h&&(e.value=c,h.value=c)},e.setCursorToEnd=function(){var c=fe(e.maskOptions,e.value),h=he(e.maskOptions,c);h!==null&&e.setCursorPosition(h)},e.setSelection=function(c,h,g){g===void 0&&(g={});var b=e.getInputDOMNode(),v=e.isFocused();b&&v&&(g.deferred||ur(b,c,h),e.selectionDeferId!==null&&Ke(e.selectionDeferId),e.selectionDeferId=hr(function(){e.selectionDeferId=null,ur(b,c,h)}),e.previousSelection={start:c,end:h,length:Math.abs(h-c)})},e.getSelection=function(){return Bn(e.getInputDOMNode())},e.getCursorPosition=function(){return e.getSelection().start},e.setCursorPosition=function(c){e.setSelection(c,c)},e.isFocused=function(){return e.focused},e.getBeforeMaskedValueChangeConfig=function(){var c=e.maskOptions,h=c.mask,g=c.maskChar,b=c.permanents,v=c.formatChars;return{mask:h,maskChar:g,permanents:b,alwaysShowMask:!!e.props.alwaysShowMask,formatChars:v}},e.isInputAutofilled=function(c,h,g,b){var v=e.getInputDOMNode();try{if(v.matches(":-webkit-autofill"))return!0}catch{}return!e.focused||b.end<g.length&&h.end===c.length},e.onChange=function(c){var h=ie(ie(e)).beforePasteState,g=ie(ie(e)).previousSelection,b=e.props.beforeMaskedValueChange,v=e.getInputValue(),D=e.value,S=e.getSelection();e.isInputAutofilled(v,S,D,g)&&(D=te(e.maskOptions,""),g={start:0,end:0,length:0}),h&&(g=h.selection,D=h.value,S={start:g.start+v.length,end:g.start+v.length,length:0},v=D.slice(0,g.start)+v+D.slice(g.end),e.beforePasteState=null);var P=Wn(e.maskOptions,v,S,D,g),j=P.enteredString,k=P.selection,H=P.value;if(q(b)){var O=b({value:H,selection:k},{value:D,selection:g},j,e.getBeforeMaskedValueChangeConfig());H=O.value,k=O.selection}e.setInputValue(H),q(e.props.onChange)&&e.props.onChange(c),e.isWindowsPhoneBrowser?e.setSelection(k.start,k.end,{deferred:!0}):e.setSelection(k.start,k.end)},e.onFocus=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions,b=g.mask,v=g.prefix;if(e.focused=!0,e.mounted=!0,b){if(e.value)fe(e.maskOptions,e.value)<e.maskOptions.mask.length&&e.setCursorToEnd();else{var D=te(e.maskOptions,v),S=te(e.maskOptions,D),P=fe(e.maskOptions,S),j=he(e.maskOptions,P),k={start:j,end:j};if(q(h)){var H=h({value:S,selection:k},{value:e.value,selection:null},null,e.getBeforeMaskedValueChangeConfig());S=H.value,k=H.selection}var O=S!==e.getInputValue();O&&e.setInputValue(S),O&&q(e.props.onChange)&&e.props.onChange(c),e.setSelection(k.start,k.end)}e.runSaveSelectionLoop()}q(e.props.onFocus)&&e.props.onFocus(c)},e.onBlur=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions.mask;if(e.stopSaveSelectionLoop(),e.focused=!1,g&&!e.props.alwaysShowMask&&pr(e.maskOptions,e.value)){var b="";q(h)&&(b=h({value:b,selection:null},{value:e.value,selection:e.previousSelection},null,e.getBeforeMaskedValueChangeConfig()).value);var v=b!==e.getInputValue();v&&e.setInputValue(b),v&&q(e.props.onChange)&&e.props.onChange(c)}q(e.props.onBlur)&&e.props.onBlur(c)},e.onMouseDown=function(c){if(!e.focused&&document.addEventListener){e.mouseDownX=c.clientX,e.mouseDownY=c.clientY,e.mouseDownTime=new Date().getTime();var h=function g(b){if(document.removeEventListener("mouseup",g),e.focused){var v=Math.abs(b.clientX-e.mouseDownX),D=Math.abs(b.clientY-e.mouseDownY),S=Math.max(v,D),P=new Date().getTime()-e.mouseDownTime;(S<=10&&P<=200||S<=5&&P<=300)&&e.setCursorToEnd()}};document.addEventListener("mouseup",h)}q(e.props.onMouseDown)&&e.props.onMouseDown(c)},e.onPaste=function(c){q(e.props.onPaste)&&e.props.onPaste(c),c.defaultPrevented||(e.beforePasteState={value:e.getInputValue(),selection:e.getSelection()},e.setInputValue(""))},e.handleRef=function(c){e.props.children==null&&q(e.props.inputRef)&&e.props.inputRef(c)};var a=n.mask,i=n.maskChar,l=n.formatChars,u=n.alwaysShowMask,s=n.beforeMaskedValueChange,y=n.defaultValue,p=n.value;e.maskOptions=cr(a,i,l),y==null&&(y=""),p==null&&(p=y);var d=qe(p);if(e.maskOptions.mask&&(u||d)&&(d=te(e.maskOptions,d),q(s))){var f=n.value;n.value==null&&(f=y),d=s({value:d,selection:null},{value:f=qe(f),selection:null},null,e.getBeforeMaskedValueChangeConfig()).value}return e.value=d,e}Rn(r,t);var o=r.prototype;return o.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=_n(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},o.componentDidUpdate=function(){var n=this.previousSelection,e=this.props,a=e.beforeMaskedValueChange,i=e.alwaysShowMask,l=e.mask,u=e.maskChar,s=e.formatChars,y=this.maskOptions,p=i||this.isFocused(),d=this.props.value!=null,f=d?qe(this.props.value):this.value,c=n?n.start:null;if(this.maskOptions=cr(l,u,s),this.maskOptions.mask){!y.mask&&this.isFocused()&&this.runSaveSelectionLoop();var h=this.maskOptions.mask&&this.maskOptions.mask!==y.mask;if(y.mask||d||(f=this.getInputValue()),(h||this.maskOptions.mask&&(f||p))&&(f=te(this.maskOptions,f)),h){var g=fe(this.maskOptions,f);(c===null||g<c)&&(c=dr(this.maskOptions,f)?g:he(this.maskOptions,g))}!this.maskOptions.mask||!pr(this.maskOptions,f)||p||d&&this.props.value||(f="");var b={start:c,end:c};if(q(a)){var v=a({value:f,selection:b},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());f=v.value,b=v.selection}this.value=f;var D=this.getInputValue()!==this.value;D?(this.setInputValue(this.value),this.forceUpdate()):h&&this.forceUpdate();var S=!1;b.start!=null&&b.end!=null&&(S=!n||n.start!==b.start||n.end!==b.end),(S||D)&&this.setSelection(b.start,b.end)}else y.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},o.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&Ke(this.selectionDeferId),this.stopSaveSelectionLoop()},o.render=function(){var n,e=this.props,a=(e.mask,e.alwaysShowMask,e.maskChar,e.formatChars,e.inputRef,e.beforeMaskedValueChange,e.children),i=Ln(e,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(a){q(a)||sr(!1);var l=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],u=ze({},i);l.forEach(function(y){return delete u[y]}),n=a(u),l.filter(function(y){return n.props[y]!=null&&n.props[y]!==i[y]}).length&&sr(!1)}else n=_e.createElement("input",ze({ref:this.handleRef},i));var s={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(i.disabled||i.readOnly||(s.onChange=this.onChange,s.onPaste=this.onPaste,s.onMouseDown=this.onMouseDown),i.value!=null&&(s.value=this.value)),n=_e.cloneElement(n,s)},r}(_e.Component),qn=Un;lr.exports=qn;var Kn=lr.exports;const Xn=Ur(Kn);var Qn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Zn=["Input"],Gn=["mask","maskChar","overrides"];function yr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Xe(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?yr(Object(o),!0).forEach(function(n){Jn(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):yr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function Jn(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function we(t){"@babel/helpers - typeof";return we=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},we(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ye.apply(this,arguments)}function Qe(t,r){if(t==null)return{};var o=eo(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function eo(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}var gr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var o=t.onChange,n=t.onFocus,e=t.onBlur,a=t.value,i=t.disabled,l=t.readOnly,u=Qe(t,Qn);return m.createElement(Xn,ye({onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},u),function(s){return m.createElement(dn,ye({ref:r,onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},s))})});gr.displayName="MaskOverride";function mr(t){var r=t.mask,o=t.maskChar,n=t.overrides;n=n===void 0?{}:n;var e=n.Input,a=e===void 0?{}:e,i=Qe(n,Zn),l=Qe(t,Gn),u=gr,s={},y={};typeof a=="function"?u=a:we(a)==="object"&&(u=a.component||u,s=a.props||{},y=a.style||{}),we(s)==="object"&&(s=Xe(Xe({},s),{},{mask:s.mask||r,maskChar:s.maskChar||o}));var p=Xe({Input:{component:u,props:s,style:y}},i);return m.createElement(pn,ye({},l,{overrides:p}))}mr.defaultProps={maskChar:" "};var Ze=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),br=[0,1,2,3,4,5,6],to=[0,1,2,3,4,5,6,7,8,9,10,11],T={high:"high",default:"default"},re={startDate:"startDate",endDate:"endDate"},ro={default:"default",locked:"locked"};function vr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function le(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?vr(Object(o),!0).forEach(function(n){no(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):vr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function no(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var Ge=x("label",function(t){var r=t.$disabled,o=t.$theme,n=o.colors,e=o.typography;return le(le({},e.font250),{},{width:"100%",color:r?n.contentSecondary:n.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ge.displayName="Label",Ge.displayName="Label";var Je=x("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Je.displayName="LabelContainer",Je.displayName="LabelContainer";var et=x("span",function(t){var r=t.$disabled,o=t.$counterError,n=t.$theme,e=n.colors,a=n.typography;return le(le({},a.font100),{},{flex:0,width:"100%",color:o?e.negative400:r?e.contentSecondary:e.contentPrimary})});et.displayName="LabelEndEnhancer",et.displayName="LabelEndEnhancer";var tt=x("div",function(t){var r=t.$error,o=t.$positive,n=t.$theme,e=n.colors,a=n.sizing,i=n.typography,l=e.contentSecondary;return r?l=e.negative400:o&&(l=e.positive400),le(le({},i.font100),{},{color:l,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});tt.displayName="Caption",tt.displayName="Caption";var rt=x("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});rt.displayName="ControlContainer",rt.displayName="ControlContainer";function ne(){return ne=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ne.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 oo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ao(t,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function io(t,r,o){return ao(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lo(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&&nt(t,r)}function nt(t,r){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},nt(t,r)}function so(t){var r=po();return function(){var o=Ce(t),n;if(r){var e=Ce(this).constructor;n=Reflect.construct(o,arguments,e)}else n=o.apply(this,arguments);return uo(this,n)}}function uo(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 co(t)}function co(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function po(){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 Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ce(t)}function fo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ho(t,r,o,n){return r&&typeof r!="boolean"?typeof r=="function"?r(n):r:o&&typeof o!="boolean"?typeof o=="function"?o(n):o:t?typeof t=="function"?t(n):t:null}var ot=function(t){lo(o,t);var r=so(o);function o(){return oo(this,o),r.apply(this,arguments)}return io(o,[{key:"render",value:function(){var n=this.props,e=n.overrides,a=e.Label,i=e.LabelEndEnhancer,l=e.LabelContainer,u=e.Caption,s=e.ControlContainer,y=n.label,p=n.caption,d=n.disabled,f=n.error,c=n.positive,h=n.htmlFor,g=n.children,b=n.counter,v=m.Children.only(g).props,D={$disabled:!!d,$error:!!f,$positive:!!c},S=ue(a)||Ge,P=ue(i)||et,j=ue(l)||Je,k=ue(u)||tt,H=ue(s)||rt,O=ho(p,f,c,D),M=this.props.labelEndEnhancer;if(b){var C=null,w=null,I=null;ke(b)==="object"&&(w=b.length,C=b.maxLength,I=b.error),C=C||v.maxLength,w==null&&typeof v.value=="string"&&(w=v.value.length),w==null&&(w=0),D.$length=w,C==null?M||(M="".concat(w)):(D.$maxLength=w,M||(M="".concat(w,"/").concat(C)),w>C&&I==null&&(I=!0)),I&&(D.$error=!0,D.$counterError=!0)}return m.createElement(m.Fragment,null,y&&m.createElement(j,ne({},D,ce(l)),m.createElement(S,ne({"data-baseweb":"form-control-label",htmlFor:h||v.id},D,ce(a)),typeof y=="function"?y(D):y),!!M&&m.createElement(P,ne({},D,ce(i)),typeof M=="function"?M(D):M)),m.createElement(qr,null,function(G){return m.createElement(H,ne({"data-baseweb":"form-control-container"},D,ce(s)),m.Children.map(g,function(z,Se){if(z){var A=z.key||String(Se);return m.cloneElement(z,{key:A,"aria-errormessage":f?G:null,"aria-describedby":p||c?G:null,disabled:v.disabled||d,error:typeof v.error<"u"?v.error:D.$error,positive:typeof v.positive<"u"?v.positive:D.$positive})}}),(!!p||!!f||c)&&m.createElement(k,ne({"data-baseweb":"form-control-caption",id:G},D,ce(u)),O))}))}}]),o}(m.Component);fo(ot,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Dr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Sr(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Dr(Object(o),!0).forEach(function(n){yo(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Dr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function yo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var go=function(t){return to.map(function(r){return{id:r.toString(),label:t(r)}})},mo=function(t,r){return t.map(function(o){return r.includes(Number(o.id))?o:Sr(Sr({},o),{},{disabled:!0})})},bo=function(t){var r=t.filterMonthsList,o=t.formatMonthLabel,n=go(o);return r&&(n=mo(n,r)),n};function vo(t){var r=t.$range,o=r===void 0?!1:r,n=t.$disabled,e=n===void 0?!1:n,a=t.$isHighlighted,i=a===void 0?!1:a,l=t.$isHovered,u=l===void 0?!1:l,s=t.$selected,y=s===void 0?!1:s,p=t.$hasRangeSelected,d=p===void 0?!1:p,f=t.$startDate,c=f===void 0?!1:f,h=t.$endDate,g=h===void 0?!1:h,b=t.$pseudoSelected,v=b===void 0?!1:b,D=t.$hasRangeHighlighted,S=D===void 0?!1:D,P=t.$pseudoHighlighted,j=P===void 0?!1:P,k=t.$hasRangeOnRight,H=k===void 0?!1:k,O=t.$startOfMonth,M=O===void 0?!1:O,C=t.$endOfMonth,w=C===void 0?!1:C,I=t.$outsideMonth,G=I===void 0?!1:I;return"".concat(+o).concat(+e).concat(+(i||u)).concat(+y).concat(+d).concat(+c).concat(+g).concat(+v).concat(+S).concat(+j).concat(+(S&&!j&&H)).concat(+(S&&!j&&!H)).concat(+M).concat(+w).concat(+G)}function Do(t,r){return ko(t)||wo(t,r)||Oo(t,r)||So()}function So(){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 Oo(t,r){if(t){if(typeof t=="string")return Or(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Or(t,r)}}function Or(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function wo(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function ko(t){if(Array.isArray(t))return t}function wr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function B(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?wr(Object(o),!0).forEach(function(n){ge(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):wr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ge(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var at=x("div",function(t){var r=t.$separateRangeInputs;return B({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});at.displayName="StyledInputWrapper",at.displayName="StyledInputWrapper";var it=x("div",function(t){var r=t.$theme;return B(B({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});it.displayName="StyledInputLabel",it.displayName="StyledInputLabel";var lt=x("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});lt.displayName="StyledStartDate",lt.displayName="StyledStartDate";var st=x("div",function(t){return t.$theme,{width:"100%"}});st.displayName="StyledEndDate",st.displayName="StyledEndDate";var ut=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.borders;return B(B({},o.font200),{},{color:n.calendarForeground,backgroundColor:n.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});ut.displayName="StyledRoot",ut.displayName="StyledRoot";var ct=x("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Ze.vertical?"column":"row"}});ct.displayName="StyledMonthContainer",ct.displayName="StyledMonthContainer";var pt=x("div",function(t){var r=t.$theme.sizing,o=t.$density;return{paddingTop:r.scale300,paddingBottom:o===T.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});pt.displayName="StyledCalendarContainer",pt.displayName="StyledCalendarContainer";var Me=x("div",function(t){var r=t.$theme,o=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:o}});Me.displayName="StyledSelectorContainer",Me.displayName="StyledSelectorContainer";var dt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.borders,e=r.colors,a=r.sizing,i=t.$density;return B(B({},i===T.high?o.LabelMedium:o.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:a.scale600,paddingBottom:a.scale300,paddingLeft:a.scale600,paddingRight:a.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:n.surfaceBorderRadius,borderTopRightRadius:n.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===T.high?"calc(".concat(a.scale800," + ").concat(a.scale0,")"):a.scale950})});dt.displayName="StyledCalendarHeader",dt.displayName="StyledCalendarHeader";var ft=x("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});ft.displayName="StyledMonthHeader",ft.displayName="StyledMonthHeader";var ht=x("button",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$isFocusVisible,a=t.$density;return B(B({},a===T.high?o.LabelMedium:o.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:n.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(n.accent):"none"}})});ht.displayName="StyledMonthYearSelectButton",ht.displayName="StyledMonthYearSelectButton";var yt=x("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return ge({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});yt.displayName="StyledMonthYearSelectIconContainer",yt.displayName="StyledMonthYearSelectIconContainer";function kr(t){var r=t.$theme,o=t.$disabled,n=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:o?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:o?"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":o?{}:{boxShadow:n?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var gt=x("button",kr);gt.displayName="StyledPrevButton",gt.displayName="StyledPrevButton";var mt=x("button",kr);mt.displayName="StyledNextButton",mt.displayName="StyledNextButton";var bt=x("div",function(t){return{display:"inline-block"}});bt.displayName="StyledMonth",bt.displayName="StyledMonth";var vt=x("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});vt.displayName="StyledWeek",vt.displayName="StyledWeek";function R(t,r){var o,n=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return o={},ge(o,t,r),ge(o,n,r),ge(o,e,r),o}function Dt(t,r){var o=r.colors,n={":before":{content:null},":after":{content:null}},e=n,a={color:o.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:o.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"}},l={":before":{content:null}},u=1;t&&t[u]==="1"&&(e=a);var s=Object.assign({},R("001000000000000",{color:o.calendarDayForegroundPseudoSelected}),R("000100000000000",{color:o.calendarDayForegroundSelected}),R("001100000000000",{color:o.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},R("000000000000001",i),R("101000000000000",l),R("101010000000000",l),R("100100000000000",{color:o.calendarDayForegroundSelected}),R("101100000000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111100000000",{color:o.calendarDayForegroundSelected,":before":{content:null}}),R("101111100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111000000000",{color:o.calendarDayForegroundSelected}),R("100110100000000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("100100001010000",{color:o.calendarDayForegroundSelected}),R("100100001001000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},R("100010010000000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},R("100000001100000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),R("101111000000000",{color:o.calendarDayForegroundSelectedHighlighted}),R("101110100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),R("101010010000000",{color:o.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),R("100000000000001",i),R("100000001010001",i),R("100000001001001",i),R("100010000000001",i));return s[t]||e}var St=x("div",function(t){var r=t.$disabled,o=t.$isFocusVisible,n=t.$isHighlighted,e=t.$peekNextMonth,a=t.$pseudoSelected,i=t.$range,l=t.$selected,u=t.$outsideMonth,s=t.$outsideMonthWithinRange,y=t.$hasDateLabel,p=t.$density,d=t.$hasLockedBehavior,f=t.$selectedInput,c=t.$value,h=t.$theme,g=h.colors,b=h.typography,v=h.sizing,D=vo(t),S;y?p===T.high?S="60px":S="70px":p===T.high?S="40px":S="48px";var P=Array.isArray(c)?c:[c,null],j=Do(P,2),k=j[0],H=j[1],O=f===re.startDate?H!==null&&typeof H<"u":k!==null&&typeof k<"u",M=i&&!(d&&!O);return B(B(B({},p===T.high?b.ParagraphSmall:b.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&u?"default":"pointer",color:g.calendarForeground,display:"inline-block",width:p===T.high?"42px":"50px",height:S,lineHeight:p===T.high?v.scale700:v.scale900,textAlign:"center",paddingTop:v.scale300,paddingBottom:v.scale300,paddingLeft:v.scale300,paddingRight:v.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},Dt(D,t.$theme)),{},{":after":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:o&&(!u||e)?"0 0 0 3px ".concat(g.accent):"none",backgroundColor:l?g.calendarDayBackgroundSelectedHighlighted:a&&n?g.calendarDayBackgroundPseudoSelectedHighlighted:g.calendarBackground,height:y?"100%":p===T.high?"42px":"50px",width:"100%",position:"absolute",top:y?0:"-1px",left:0,paddingTop:v.scale200,paddingBottom:v.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:g.borderSelected,borderBottomColor:g.borderSelected,borderRightColor:g.borderSelected,borderLeftColor:g.borderSelected,borderTopLeftRadius:y?v.scale800:"100%",borderTopRightRadius:y?v.scale800:"100%",borderBottomLeftRadius:y?v.scale800:"100%",borderBottomRightRadius:y?v.scale800:"100%"},Dt(D,t.$theme)[":after"]||{}),s?{content:null}:{})},M?{":before":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:g.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"},Dt(D,t.$theme)[":before"]||{}),s?{backgroundColor:g.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});St.displayName="StyledDay",St.displayName="StyledDay";var Ot=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$selected;return B(B({},o.ParagraphXSmall),{},{color:e?n.contentInverseTertiary:n.contentTertiary})});Ot.displayName="StyledDayLabel",Ot.displayName="StyledDayLabel";var wt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.sizing,a=t.$density;return B(B({},o.LabelMedium),{},{color:n.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:a===T.high?"42px":"50px",height:a===T.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"})});wt.displayName="StyledWeekdayHeader",wt.displayName="StyledWeekdayHeader";function kt(t){"@babel/helpers - typeof";return kt=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},kt(t)}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},U.apply(this,arguments)}function Q(t,r){return Ho(t)||jo(t,r)||Mo(t,r)||Co()}function Co(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,E,_ as R,c as C,Q as G,j as u,b1 as X,aK as k,aX as q,aG as Q,aY as O,b9 as z,e as J,g as K,a7 as Y,M as Z,ba as ee,bb as te,R as re,O as ie,$ as se,B as P,as as _,aU as ne,aT as ae,a_ as oe,a$ as le,bc as de,b0 as ce}from"./index-lyJc68Dt.js";import{F as he}from"./FormClearHelper-Dhc_r76k.js";import{U as V}from"./UploadFileInfo-C-jY39rj.js";import{P as ue,S as pe}from"./ProgressBar-D8toyv14.js";var L=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});L.displayName="Video";var D=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});D.displayName="X";var $=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ge(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const W=C("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=C("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),fe=C("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),me=C("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),ve=C("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),Se=C("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),ye=C("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),we=C("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),be=C("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${G(i.colors.primary,.5)}`},...ge("medium",i)}),"");function H({disabled:i,onClick:l,children:t,progress:s}){return u.jsxs(be,{disabled:i||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[t,s&&u.jsx(we,{children:u.jsx(ue,{value:s,size:pe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const Me=({switchFacingMode:i})=>u.jsx(ye,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(X,{content:"Switch camera",placement:k.TOP_RIGHT,children:u.jsx(q,{kind:Q.MINIMAL,onClick:i,children:u.jsx(O,{content:$,size:"twoXL",color:z.white})})})});var A={exports:{}};(function(i,l){(function(t,s){i.exports=s(y)})(J,function(t){return function(s){var n={};function a(o){if(n[o])return n[o].exports;var p=n[o]={i:o,l:!1,exports:{}};return s[o].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=n,a.d=function(o,p,S){a.o(o,p)||Object.defineProperty(o,p,{enumerable:!0,get:S})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,p){if(p&1&&(o=a(o)),p&8||p&4&&typeof o=="object"&&o&&o.__esModule)return o;var S=Object.create(null);if(a.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:o}),p&2&&typeof o!="string")for(var x in o)a.d(S,x,(function(U){return o[U]}).bind(null,x));return S},a.n=function(o){var p=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(p,"a",p),p},a.o=function(o,p){return Object.prototype.hasOwnProperty.call(o,p)},a.p="",a(a.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,n,a){a.r(n);var o=a("react"),p=function(){var g=function(h,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,d){r.__proto__=d}||function(r,d){for(var c in d)d.hasOwnProperty(c)&&(r[c]=d[c])},g(h,e)};return function(h,e){g(h,e);function r(){this.constructor=h}h.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),S=function(){return S=Object.assign||function(g){for(var h,e=1,r=arguments.length;e<r;e++){h=arguments[e];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},x=function(g,h){var e={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&h.indexOf(r)<0&&(e[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(g);d<r.length;d++)h.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(g,r[d])&&(e[r[d]]=g[r[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(e,r){h.call(navigator,g,e,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var j=function(g){p(h,g);function h(e){var r=g.call(this,e)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return h.prototype.componentDidMount=function(){var e=this,r=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(e){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(r.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(r.videoConstraints),w=e.minScreenshotWidth!==r.minScreenshotWidth,v=e.minScreenshotHeight!==r.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(r){e.removeTrack(r),r.stop()}),e.getAudioTracks().map(function(r){e.removeTrack(r),r.stop()})):e.stop())},h.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(h.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},h.prototype.getScreenshot=function(e){var r=this,d=r.state,c=r.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(e);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(e){var r=this,d=r.state,c=r.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var f=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/f,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*f)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||w,this.canvas.height=(e==null?void 0:e.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,m=M.canvas;return b&&m&&(m.width=(e==null?void 0:e.width)||m.width,m.height=(e==null?void 0:e.height)||m.height,c.mirrored&&(b.translate(m.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||m.width,(e==null?void 0:e.height)||m.height),c.mirrored&&(b.scale(-1,1),b.translate(-m.width,0))),m},h.prototype.requestUserMedia=function(){var e=this,r=this.props,d=function(v,f){var M={video:typeof f<"u"?f:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(m){e.unmounted||b!==e.requestUserMediaId?h.stopMediaStream(m):e.handleUserMedia(null,m)}).catch(function(m){e.handleUserMedia(m)})};if("mediaDevices"in navigator)d(r.audioConstraints,r.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var f=v.deviceId;return typeof f=="string"?f:Array.isArray(f)&&f.length>0?f[0]:typeof f=="object"&&f.ideal?f.ideal:null};MediaStreamTrack.getSources(function(v){var f=null,M=null;v.forEach(function(I){I.kind==="audio"?f=I.id:I.kind==="video"&&(M=I.id)});var b=w(r.audioConstraints);b&&(f=b);var m=w(r.videoConstraints);m&&(M=m),d(c(f),c(M))})}},h.prototype.handleUserMedia=function(e,r){var d=this.props;if(e||!r){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}d.onUserMedia(r)},h.prototype.render=function(){var e=this,r=this,d=r.state,c=r.props,w=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,f=c.style,M=f===void 0?{}:f,b=c.children,m=x(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),I=v?S(S({},M),{transform:(M.transform||"")+" scaleX(-1)"}):M,N={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",S({autoPlay:!0,src:d.src,muted:!w,playsInline:!0,ref:function(B){e.video=B},style:I},m)),b&&b(N))},h.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(o.Component);n.default=j},react:function(s,n){s.exports=t}}).default})})(A);var Ue=A.exports;const xe=K(Ue),Ce=({width:i})=>u.jsxs(T,{width:i,children:[u.jsx(O,{size:"threeXL",color:z.gray60,content:L}),u.jsxs(fe,{children:["This app would like to use your camera.",u.jsx(ve,{href:te,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),je=({handleCapture:i,width:l,disabled:t,clearPhotoInProgress:s,setClearPhotoInProgress:n,facingMode:a,setFacingMode:o,testOverride:p})=>{const[S,x]=y.useState(p||"pending"),U=y.useRef(null),[j,g]=y.useState(l),h=y.useCallback(Y(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function e(){if(U.current!==null){const d=U.current.getScreenshot();i(d)}}const r=Z();return u.jsxs(W,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!t&&!s?u.jsx(Ce,{width:j}):ee&&u.jsx(Me,{switchFacingMode:o}),u.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!t&&!s,width:j,children:!t&&u.jsx(xe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:j,height:j*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),n(!1)},videoConstraints:{width:{ideal:j},facingMode:a}})}),u.jsx(H,{onClick:e,disabled:S!=="success"||t||s,children:"Take Photo"})]})},Ie=150;class Pe extends re.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=t=>{this.setState({clearPhotoInProgress:t})},this.setFacingMode=()=>{this.setState(t=>({facingMode:t.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=t=>{if(t===null)return Promise.resolve();this.setState({imgSrc:t,shutter:!0,minShutterEffectPassed:!1});const s=n=>new Promise(a=>setTimeout(a,n));return Fe(t,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(n=>this.props.uploadClient.fetchFileURLs([n]).then(a=>({file:n,fileUrls:a[0]}))).then(({file:n,fileUrls:a})=>this.uploadFile(a,n)).then(()=>s(Ie)).then(()=>{this.setState((n,a)=>({imgSrc:t,shutter:n.shutter,minShutterEffectPassed:!0}))}).catch(n=>{ie(n)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(t=>this.deleteFile(t.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:n,fragmentId:a}=this.props,o=n.getFileUploaderStateValue(s);se(t,o)||n.setFileUploaderStateValue(s,t,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(P(t))return;this.setState({imgSrc:null});const{widgetMgr:s,element:n,fragmentId:a}=this.props;s.setFileUploaderStateValue(n,t,{fromUi:!0},a)})},this.deleteFile=t=>{const s=this.getFile(t);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(s=>({files:[...s.files,t]}))},this.removeFile=t=>{this.setState(s=>({files:s.files.filter(n=>n.id!==t)}))},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{this.setState(n=>({files:n.files.map(a=>a.id===t?s:a)}))},this.onUploadComplete=(t,s)=>{this.setState(()=>({shutter:!1}));const n=this.getFile(t);P(n)||n.status.type!=="uploading"||this.updateFile(n.id,n.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(t,s)=>{const n=this.getFile(s);if(P(n)||n.status.type!=="uploading")return;const a=Math.round(t.loaded*100/t.total);n.status.progress!==a&&this.updateFile(s,n.setStatus({type:"uploading",cancelToken:n.status.cancelToken,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(t,s)=>{const n=_.CancelToken.source(),a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:n,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,a.id),n.token).then(()=>this.onUploadComplete(a.id,t)).catch(o=>{_.isCancel(o)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:t,element:s}=this.props,n=t.getFileUploaderStateValue(s);if(P(n))return l;const{uploadedFileInfo:a}=n;return P(a)||a.length===0?l:{files:a.map(o=>{const p=o.name,S=o.size,x=o.fileId,U=o.fileUrls;return new V(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:U})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=t=>t.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:n}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,l,{fromUi:!1},n)}createWidgetValue(){const l=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:n,status:a}=t;return new ne({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:n})});return new ae({uploadedFileInfo:l})}render(){var a;const{element:l,widgetMgr:t,disabled:s,width:n}=this.props;return this.formClearHelper.manageFormClearListener(t,l.formId,this.onFormCleared),u.jsxs(W,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(oe,{label:l.label,disabled:s,labelVisibility:le((a=l.labelVisibility)==null?void 0:a.value),children:l.help&&u.jsx(de,{children:u.jsx(ce,{content:l.help,placement:k.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(T,{width:n,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:n,height:n*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(Se,{children:[u.jsx(O,{content:D,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(je,{handleCapture:this.handleCapture,width:n,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Fe(i,l){return fetch(i).then(t=>t.arrayBuffer()).then(t=>new File([t],l,{type:"image/jpeg"}))}export{Pe as default};
|
|
1
|
+
import{r as y,E,_ as R,c as C,Q as G,j as u,b1 as X,aK as k,aX as q,aG as Q,aY as O,b9 as z,e as J,g as K,a7 as Y,M as Z,ba as ee,bb as te,R as re,O as ie,$ as se,B as P,as as _,aU as ne,aT as ae,a_ as oe,a$ as le,bc as de,b0 as ce}from"./index-z2lXC7XI.js";import{F as he}from"./FormClearHelper-DliGOSkq.js";import{U as V}from"./UploadFileInfo-C-jY39rj.js";import{P as ue,S as pe}from"./ProgressBar-DuGylkeS.js";var L=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});L.displayName="Video";var D=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});D.displayName="X";var $=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ge(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const W=C("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=C("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),fe=C("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),me=C("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),ve=C("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),Se=C("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),ye=C("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),we=C("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),be=C("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${G(i.colors.primary,.5)}`},...ge("medium",i)}),"");function H({disabled:i,onClick:l,children:t,progress:s}){return u.jsxs(be,{disabled:i||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[t,s&&u.jsx(we,{children:u.jsx(ue,{value:s,size:pe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const Me=({switchFacingMode:i})=>u.jsx(ye,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(X,{content:"Switch camera",placement:k.TOP_RIGHT,children:u.jsx(q,{kind:Q.MINIMAL,onClick:i,children:u.jsx(O,{content:$,size:"twoXL",color:z.white})})})});var A={exports:{}};(function(i,l){(function(t,s){i.exports=s(y)})(J,function(t){return function(s){var n={};function a(o){if(n[o])return n[o].exports;var p=n[o]={i:o,l:!1,exports:{}};return s[o].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=n,a.d=function(o,p,S){a.o(o,p)||Object.defineProperty(o,p,{enumerable:!0,get:S})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,p){if(p&1&&(o=a(o)),p&8||p&4&&typeof o=="object"&&o&&o.__esModule)return o;var S=Object.create(null);if(a.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:o}),p&2&&typeof o!="string")for(var x in o)a.d(S,x,(function(U){return o[U]}).bind(null,x));return S},a.n=function(o){var p=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(p,"a",p),p},a.o=function(o,p){return Object.prototype.hasOwnProperty.call(o,p)},a.p="",a(a.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,n,a){a.r(n);var o=a("react"),p=function(){var g=function(h,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,d){r.__proto__=d}||function(r,d){for(var c in d)d.hasOwnProperty(c)&&(r[c]=d[c])},g(h,e)};return function(h,e){g(h,e);function r(){this.constructor=h}h.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),S=function(){return S=Object.assign||function(g){for(var h,e=1,r=arguments.length;e<r;e++){h=arguments[e];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},x=function(g,h){var e={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&h.indexOf(r)<0&&(e[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(g);d<r.length;d++)h.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(g,r[d])&&(e[r[d]]=g[r[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(e,r){h.call(navigator,g,e,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var j=function(g){p(h,g);function h(e){var r=g.call(this,e)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return h.prototype.componentDidMount=function(){var e=this,r=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(e){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(r.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(r.videoConstraints),w=e.minScreenshotWidth!==r.minScreenshotWidth,v=e.minScreenshotHeight!==r.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(r){e.removeTrack(r),r.stop()}),e.getAudioTracks().map(function(r){e.removeTrack(r),r.stop()})):e.stop())},h.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(h.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},h.prototype.getScreenshot=function(e){var r=this,d=r.state,c=r.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(e);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(e){var r=this,d=r.state,c=r.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var f=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/f,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*f)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||w,this.canvas.height=(e==null?void 0:e.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,m=M.canvas;return b&&m&&(m.width=(e==null?void 0:e.width)||m.width,m.height=(e==null?void 0:e.height)||m.height,c.mirrored&&(b.translate(m.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||m.width,(e==null?void 0:e.height)||m.height),c.mirrored&&(b.scale(-1,1),b.translate(-m.width,0))),m},h.prototype.requestUserMedia=function(){var e=this,r=this.props,d=function(v,f){var M={video:typeof f<"u"?f:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(m){e.unmounted||b!==e.requestUserMediaId?h.stopMediaStream(m):e.handleUserMedia(null,m)}).catch(function(m){e.handleUserMedia(m)})};if("mediaDevices"in navigator)d(r.audioConstraints,r.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var f=v.deviceId;return typeof f=="string"?f:Array.isArray(f)&&f.length>0?f[0]:typeof f=="object"&&f.ideal?f.ideal:null};MediaStreamTrack.getSources(function(v){var f=null,M=null;v.forEach(function(I){I.kind==="audio"?f=I.id:I.kind==="video"&&(M=I.id)});var b=w(r.audioConstraints);b&&(f=b);var m=w(r.videoConstraints);m&&(M=m),d(c(f),c(M))})}},h.prototype.handleUserMedia=function(e,r){var d=this.props;if(e||!r){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}d.onUserMedia(r)},h.prototype.render=function(){var e=this,r=this,d=r.state,c=r.props,w=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,f=c.style,M=f===void 0?{}:f,b=c.children,m=x(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),I=v?S(S({},M),{transform:(M.transform||"")+" scaleX(-1)"}):M,N={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",S({autoPlay:!0,src:d.src,muted:!w,playsInline:!0,ref:function(B){e.video=B},style:I},m)),b&&b(N))},h.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(o.Component);n.default=j},react:function(s,n){s.exports=t}}).default})})(A);var Ue=A.exports;const xe=K(Ue),Ce=({width:i})=>u.jsxs(T,{width:i,children:[u.jsx(O,{size:"threeXL",color:z.gray60,content:L}),u.jsxs(fe,{children:["This app would like to use your camera.",u.jsx(ve,{href:te,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),je=({handleCapture:i,width:l,disabled:t,clearPhotoInProgress:s,setClearPhotoInProgress:n,facingMode:a,setFacingMode:o,testOverride:p})=>{const[S,x]=y.useState(p||"pending"),U=y.useRef(null),[j,g]=y.useState(l),h=y.useCallback(Y(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function e(){if(U.current!==null){const d=U.current.getScreenshot();i(d)}}const r=Z();return u.jsxs(W,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!t&&!s?u.jsx(Ce,{width:j}):ee&&u.jsx(Me,{switchFacingMode:o}),u.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!t&&!s,width:j,children:!t&&u.jsx(xe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:j,height:j*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),n(!1)},videoConstraints:{width:{ideal:j},facingMode:a}})}),u.jsx(H,{onClick:e,disabled:S!=="success"||t||s,children:"Take Photo"})]})},Ie=150;class Pe extends re.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=t=>{this.setState({clearPhotoInProgress:t})},this.setFacingMode=()=>{this.setState(t=>({facingMode:t.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=t=>{if(t===null)return Promise.resolve();this.setState({imgSrc:t,shutter:!0,minShutterEffectPassed:!1});const s=n=>new Promise(a=>setTimeout(a,n));return Fe(t,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(n=>this.props.uploadClient.fetchFileURLs([n]).then(a=>({file:n,fileUrls:a[0]}))).then(({file:n,fileUrls:a})=>this.uploadFile(a,n)).then(()=>s(Ie)).then(()=>{this.setState((n,a)=>({imgSrc:t,shutter:n.shutter,minShutterEffectPassed:!0}))}).catch(n=>{ie(n)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(t=>this.deleteFile(t.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:n,fragmentId:a}=this.props,o=n.getFileUploaderStateValue(s);se(t,o)||n.setFileUploaderStateValue(s,t,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(P(t))return;this.setState({imgSrc:null});const{widgetMgr:s,element:n,fragmentId:a}=this.props;s.setFileUploaderStateValue(n,t,{fromUi:!0},a)})},this.deleteFile=t=>{const s=this.getFile(t);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(s=>({files:[...s.files,t]}))},this.removeFile=t=>{this.setState(s=>({files:s.files.filter(n=>n.id!==t)}))},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{this.setState(n=>({files:n.files.map(a=>a.id===t?s:a)}))},this.onUploadComplete=(t,s)=>{this.setState(()=>({shutter:!1}));const n=this.getFile(t);P(n)||n.status.type!=="uploading"||this.updateFile(n.id,n.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(t,s)=>{const n=this.getFile(s);if(P(n)||n.status.type!=="uploading")return;const a=Math.round(t.loaded*100/t.total);n.status.progress!==a&&this.updateFile(s,n.setStatus({type:"uploading",cancelToken:n.status.cancelToken,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(t,s)=>{const n=_.CancelToken.source(),a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:n,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,a.id),n.token).then(()=>this.onUploadComplete(a.id,t)).catch(o=>{_.isCancel(o)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:t,element:s}=this.props,n=t.getFileUploaderStateValue(s);if(P(n))return l;const{uploadedFileInfo:a}=n;return P(a)||a.length===0?l:{files:a.map(o=>{const p=o.name,S=o.size,x=o.fileId,U=o.fileUrls;return new V(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:U})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=t=>t.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:n}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,l,{fromUi:!1},n)}createWidgetValue(){const l=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:n,status:a}=t;return new ne({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:n})});return new ae({uploadedFileInfo:l})}render(){var a;const{element:l,widgetMgr:t,disabled:s,width:n}=this.props;return this.formClearHelper.manageFormClearListener(t,l.formId,this.onFormCleared),u.jsxs(W,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(oe,{label:l.label,disabled:s,labelVisibility:le((a=l.labelVisibility)==null?void 0:a.value),children:l.help&&u.jsx(de,{children:u.jsx(ce,{content:l.help,placement:k.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(T,{width:n,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:n,height:n*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(Se,{children:[u.jsx(O,{content:D,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(je,{handleCapture:this.handleCapture,width:n,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Fe(i,l){return fetch(i).then(t=>t.arrayBuffer()).then(t=>new File([t],l,{type:"image/jpeg"}))}export{Pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-
|
|
1
|
+
import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-z2lXC7XI.js";const y=s("div",{target:"e11k5jya2"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),w=s("a",{target:"e11k5jya1"})(({disabled:a,isCurrentPage:r,fluidWidth:n,theme:e})=>({textDecoration:"none",width:typeof n=="number"?`${n}px`:"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:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?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},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),L=s("span",{target:"e11k5jya0"})(({disabled:a,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(a,r){return a===null&&r?!0:a===null&&!r?!1:a===!0}function P(a){const{onPageChange:r,currentPageScriptHash:n}=g.useContext(f),e=g.useContext(b),{colors:p}=k(),{disabled:l,element:o,width:i}=a,u={width:i},h=T(o.useContainerWidth,e),d=n===o.pageScriptHash,x=c=>{o.external?l&&c.preventDefault():(c.preventDefault(),l||r(o.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",style:u,children:t.jsx(m,{help:o.help,placement:C.TOP_RIGHT,children:t.jsx(y,{children:t.jsxs(w,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:d,fluidWidth:h?i:!1,href:o.page,target:o.external?"_blank":"",rel:"noreferrer",onClick:x,children:[o.icon&&t.jsx(j,{size:"lg",color:p.bodyText,iconValue:o.icon}),t.jsx(L,{disabled:l,children:t.jsx(v,{source:o.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,aL as r,j as t,a2 as o}from"./index-
|
|
1
|
+
import{c as a,aL as r,j as t,a2 as o}from"./index-z2lXC7XI.js";import{P as i}from"./ProgressBar-DuGylkeS.js";const l=a("div",{target:"e18r7x300"})(({theme:e})=>({paddingBottom:e.spacing.sm,lineHeight:"normal",color:r(e)}),"");function d({element:e,width:s}){return t.jsxs("div",{className:"stProgress","data-testid":"stProgress",children:[t.jsx(l,{children:t.jsx(o,{source:e.text,allowHTML:!1,isLabel:!0})}),t.jsx(i,{value:e.value,width:s})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,u as v,j as T}from"./index-
|
|
1
|
+
import{r as s,u as v,j as T}from"./index-z2lXC7XI.js";function y({element:t,width:c,endpoints:m,elementMgr:d}){const n=s.useRef(null),{startTime:u,endTime:a,loop:i,autoplay:l}=t,f=s.useMemo(()=>{if(!t.id)return!0;const e=d.getElementState(t.id,"preventAutoplay");return e||d.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,d]);s.useEffect(()=>{n.current&&(n.current.currentTime=u)},[u]),s.useEffect(()=>{const e=n.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),s.useEffect(()=>{const e=n.current;if(!e)return;let r=!1;const o=()=>{a>0&&e.currentTime>=a&&(i?(e.currentTime=u||0,e.play()):r||(r=!0,e.pause()))};return a>0&&e.addEventListener("timeupdate",o),()=>{e&&a>0&&e.removeEventListener("timeupdate",o)}},[a,i,u]),s.useEffect(()=>{const e=n.current;if(!e)return;const r=()=>{i&&(e.currentTime=u||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[i,u]);const p=v(t.url),E=m.buildMediaURL(p);return T.jsx("audio",{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:l&&!f,src:E,style:{width:c}})}export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b2 as R,bd as be,r as c,b3 as O,M as me,j as g,a_ as ge,b7 as ye,b0 as ve,aK as we,a2 as ne,a$ as Re}from"./index-
|
|
1
|
+
import{b2 as R,bd as be,r as c,b3 as O,M as me,j as g,a_ as ge,b7 as ye,b0 as ve,aK as we,a2 as ne,a$ as Re}from"./index-z2lXC7XI.js";import{a as Oe}from"./useBasicWidgetState-CDQNZkN8.js";import"./FormClearHelper-DliGOSkq.js";var ie={vertical:"vertical",horizontal:"horizontal"};function ae(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function C(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(o),!0).forEach(function(r){k(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ae(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function k(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var L=0,I=1,T=2;function B(e){return e.$isActive?T:e.$isHovered?I:L}function ke(e){var t=e.$theme.colors,o=e.$disabled,r=e.$checked,n=e.$isFocusVisible,s=e.$error;if(o)return t.tickFillDisabled;if(r)if(s)switch(B(e)){case L:return t.tickFillErrorSelected;case I:return t.tickFillErrorSelectedHover;case T:return t.tickFillErrorSelectedHoverActive}else switch(B(e)){case L:return t.tickFillSelected;case I:return t.tickFillSelectedHover;case T:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:s?t.tickBorderError:t.tickBorder;return null}function je(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(B(e)){case L:return t.tickFillError;case I:return t.tickFillErrorHover;case T:return t.tickFillErrorHoverActive}else switch(B(e)){case L:return t.tickFill;case I:return t.tickFillHover;case T:return t.tickFillActive}}function $e(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var s=r.sizing,i=s.scale300;return k({},"padding".concat(n),i)}function Se(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var U=R("div",function(e){var t=e.$disabled,o=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:o==="horizontal"?"row":"column",alignItems:o==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});U.displayName="RadioGroupRoot",U.displayName="RadioGroupRoot";var q=R("label",function(e){var t,o=e.$disabled,r=e.$hasDescription,n=e.$labelPlacement,s=e.$theme,i=e.$align,a=s.sizing,u=i==="horizontal",f=s.direction==="rtl"?"Left":"Right";return t={flexDirection:n==="top"||n==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",marginTop:a.scale200},k(t,"margin".concat(f),u?a.scale200:null),k(t,"marginBottom",r&&!u?null:a.scale200),t});q.displayName="Root",q.displayName="Root";var G=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:je(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});G.displayName="RadioMarkInner",G.displayName="RadioMarkInner";var W=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});W.displayName="RadioMarkOuter",W.displayName="RadioMarkOuter";var X=R("div",function(e){var t=e.$theme.typography;return C(C({verticalAlign:"middle"},$e(e)),{},{color:Se(e)},t.LabelMedium)});X.displayName="Label",X.displayName="Label";var K=R("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});K.displayName="Input",K.displayName="Input";var J=R("div",function(e){var t,o=e.$theme,r=e.$align,n=r==="horizontal",s=o.direction==="rtl"?"Right":"Left",i=o.direction==="rtl"?"Left":"Right";return C(C({},o.typography.ParagraphSmall),{},(t={color:o.colors.contentSecondary,cursor:"auto"},k(t,"margin".concat(s),r==="horizontal"?null:o.sizing.scale900),k(t,"margin".concat(i),n?o.sizing.scale200:null),k(t,"maxWidth","240px"),t))});J.displayName="Description",J.displayName="Description";function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(e)}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Y.apply(this,arguments)}function Me(e,t){return Ee(e)||xe(e,t)||Pe(e,t)||Fe()}function Fe(){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 Pe(e,t){if(e){if(typeof e=="string")return se(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return se(e,t)}}function se(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function xe(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,s=!1,i,a;try{for(o=o.call(e);!(n=(i=o.next()).done)&&(r.push(i.value),!(t&&r.length===t));n=!0);}catch(u){s=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw a}}return r}}function Ee(e){if(Array.isArray(e))return e}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Te(e,t,o){return Ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Z(e,t)}function Be(e){var t=De();return function(){var o=D(e),r;if(t){var n=D(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Ae(this,r)}}function Ae(e,t){if(t&&(Q(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}function A(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(){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 D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},D(e)}function z(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var le=function(e){Ce(o,e);var t=Be(o);function o(){var r;Le(this,o);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),z(A(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),z(A(r),"handleFocus",function(a,u){be(a)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:u}),r.props.onFocus&&r.props.onFocus(a)}),z(A(r),"handleBlur",function(a,u){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(a)}),r}return Te(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,s=n===void 0?{}:n,i=O(s.RadioGroupRoot,U),a=Me(i,2),u=a[0],f=a[1];return c.createElement(u,Y({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},f),c.Children.map(this.props.children,function(p,d){if(!c.isValidElement(p))return null;var h=r.props.value===p.props.value;return c.cloneElement(p,{align:r.props.align,autoFocus:r.props.autoFocus,checked:h,disabled:r.props.disabled||p.props.disabled,error:r.props.error,isFocused:r.state.focusedRadioIndex===d,isFocusVisible:r.state.isFocusVisible,tabIndex:d===0&&!r.props.value||h?"0":"-1",labelPlacement:r.props.labelPlacement,name:r.props.name,onBlur:function(l){return r.handleBlur(l,d)},onFocus:function(l){return r.handleFocus(l,d)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o}(c.Component);z(le,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});function ee(e){"@babel/helpers - typeof";return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},w.apply(this,arguments)}function F(e,t){return _e(e)||He(e,t)||Ve(e,t)||ze()}function ze(){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 Ve(e,t){if(e){if(typeof e=="string")return ce(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ce(e,t)}}function ce(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function He(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,s=!1,i,a;try{for(o=o.call(e);!(n=(i=o.next()).done)&&(r.push(i.value),!(t&&r.length===t));n=!0);}catch(u){s=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw a}}return r}}function _e(e){if(Array.isArray(e))return e}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qe(e,t,o){return Ue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&te(e,t)}function te(e,t){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},te(e,t)}function We(e){var t=Ke();return function(){var o=V(e),r;if(t){var n=V(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Xe(this,r)}}function Xe(e,t){if(t&&(ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}function P(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(){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 V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(e)}function x(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Je(e){return e==="top"||e==="left"}function Qe(e){return e==="bottom"||e==="right"}var Ye=function(e){return e.stopPropagation()},ue=function(e){Ge(o,e);var t=We(o);function o(){var r;Ne(this,o);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),x(P(r),"state",{isActive:!1,isHovered:!1}),x(P(r),"onMouseEnter",function(a){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(a)}),x(P(r),"onMouseLeave",function(a){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(a)}),x(P(r),"onMouseDown",function(a){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(a)}),x(P(r),"onMouseUp",function(a){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(a)}),r}return qe(o,[{key:"componentDidMount",value:function(){var r;this.props.autoFocus&&(r=this.props.inputRef)!==null&&r!==void 0&&r.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var r=this.props.overrides,n=r===void 0?{}:r,s=O(n.Root,q),i=F(s,2),a=i[0],u=i[1],f=O(n.Label,X),p=F(f,2),d=p[0],h=p[1],l=O(n.Input,K),b=F(l,2),j=b[0],H=b[1],$=O(n.Description,J),E=F($,2),_=E[0],S=E[1],N=O(n.RadioMarkInner,G),m=F(N,2),y=m[0],v=m[1],pe=O(n.RadioMarkOuter,W),re=F(pe,2),de=re[0],fe=re[1],M={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},oe=c.createElement(d,w({},M,h),this.props.containsInteractiveElement?c.createElement("div",{onClick:function(he){return he.preventDefault()}},this.props.children):this.props.children);return c.createElement(c.Fragment,null,c.createElement(a,w({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},M,u),Je(this.props.labelPlacement)&&oe,c.createElement(de,w({},M,fe),c.createElement(y,w({},M,v))),c.createElement(j,w({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:Ye,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},M,H)),Qe(this.props.labelPlacement)&&oe),!!this.props.description&&c.createElement(_,w({},M,S),this.props.description))}}]),o}(c.Component);x(ue,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:c.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function Ze({disabled:e,horizontal:t,width:o,value:r,onChange:n,options:s,captions:i,label:a,labelVisibility:u,help:f}){const[p,d]=c.useState(r??null);c.useEffect(()=>{r!==p&&d(r??null)},[r]);const h=c.useCallback(m=>{const y=parseInt(m.target.value,10);d(y),n(y)},[n]),l=me(),{colors:b,radii:j}=l,H={width:o},$=i.length>0,E=s.length>0,_=E?s:["No options to select."],S=e||!E,N=m=>m==""&&t&&$?" ":m;return g.jsxs("div",{className:"stRadio","data-testid":"stRadio",style:H,children:[g.jsx(ge,{label:a,disabled:S,labelVisibility:u,children:f&&g.jsx(ye,{children:g.jsx(ve,{content:f,placement:we.TOP_RIGHT})})}),g.jsx(le,{onChange:h,value:p!==null?p.toString():void 0,disabled:S,align:t?ie.horizontal:ie.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:$?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:_.map((m,y)=>g.jsxs(ue,{value:y.toString(),overrides:{Root:{style:({$isFocusVisible:v})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:$?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:v?b.darkenedBgMix25:"",borderTopLeftRadius:j.md,borderTopRightRadius:j.md,borderBottomLeftRadius:j.md,borderBottomRightRadius:j.md})},RadioMarkOuter:{style:({$checked:v})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:v&&!S?b.primary:b.fadedText40})},RadioMarkInner:{style:({$checked:v})=>({height:v?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`,width:v?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`})},Label:{style:{color:S?b.fadedText40:b.bodyText,position:"relative",top:l.spacing.px}}},children:[g.jsx(ne,{source:m,allowHTML:!1,isLabel:!0,largerLabel:!0}),$&&g.jsx(ne,{source:N(i[y]),allowHTML:!1,isCaption:!0,isLabel:!0})]},y))})]})}const et=c.memo(Ze);function tt({disabled:e,element:t,widgetMgr:o,width:r,fragmentId:n}){const[s,i]=Oe({getStateFromWidgetMgr:rt,getDefaultStateFromProto:ot,getCurrStateFromProto:nt,updateWidgetMgrState:it,element:t,widgetMgr:o,fragmentId:n}),a=c.useCallback(b=>{i({value:b,fromUi:!0})},[i]),{horizontal:u,options:f,captions:p,label:d,labelVisibility:h,help:l}=t;return g.jsx(et,{label:d,onChange:a,options:f,captions:p,width:r,disabled:e,horizontal:u,labelVisibility:Re(h==null?void 0:h.value),value:s??null,help:l})}function rt(e,t){return e.getIntValue(t)}function ot(e){return e.default??null}function nt(e){return e.value??null}function it(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const at=c.memo(tt);export{at as default};
|