@stlite/desktop 0.87.0 → 0.88.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/{ErrorOutline.esm-C8z2dN3x.js → ErrorOutline.esm-D5Ifiwqa.js} +1 -1
- package/build/assets/{FileDownload.esm-kSzyJagP.js → FileDownload.esm-DOHSKnrq.js} +1 -1
- package/build/assets/{FileHelper-BbrZYz8x.js → FileHelper-BTXiVf4-.js} +1 -1
- package/build/assets/{FormClearHelper-fvwQICEk.js → FormClearHelper-BC4K9Zmh.js} +1 -1
- package/build/assets/{Hooks-CCS44jMc.js → Hooks-GYU3aDYH.js} +1 -1
- package/build/assets/{InputInstructions-BgxdtQsQ.js → InputInstructions-CqSmotDL.js} +1 -1
- package/build/assets/{Particles-C6lCS8Mc.js → Particles-DKyXwmGK.js} +1 -1
- package/build/assets/{ProgressBar-CXipOcU9.js → ProgressBar-B7cXo5Zk.js} +1 -1
- package/build/assets/{Toolbar-DiWCQxr5.js → Toolbar-CF99-ktZ.js} +1 -1
- package/build/assets/{base-input-D2OIsCyG.js → base-input-Bu7lYJya.js} +1 -1
- package/build/assets/{checkbox-BNaalk8J.js → checkbox-vy_88iMk.js} +1 -1
- package/build/assets/{createSuper-CQM18OGw.js → createSuper-BZDCsfCp.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-CK8RiHSC.js → data-grid-overlay-editor-P0wPqvRS.js} +1 -1
- package/build/assets/{downloader-CE817MUq.js → downloader-E6SH6tis.js} +1 -1
- package/build/assets/{es6-D9GNxEuI.js → es6-lWl2HAKQ.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CNYkPhE6.js → iframeResizer.contentWindow-BblXhc8K.js} +1 -1
- package/build/assets/{index-cAlcGRT2.js → index-3q7VEUlu.js} +1 -1
- package/build/assets/{index-B-7mLFMQ.js → index-9Wb22-Zl.js} +1 -1
- package/build/assets/{index-DCNLpqIv.js → index-B2QqSXxG.js} +4 -4
- package/build/assets/{index-C1VFEx3W.js → index-BAt37HPV.js} +1 -1
- package/build/assets/{index-DFlTnZFo.js → index-BHD6dN1i.js} +1 -1
- package/build/assets/{index-CDtHDDVr.js → index-BHYA8KUU.js} +1 -1
- package/build/assets/{index-B5zkrGKq.js → index-Ba8Fd3Iw.js} +1 -1
- package/build/assets/{index-CjHv4qYi.js → index-Bl3t7YE9.js} +1 -1
- package/build/assets/{index-BGbl-ncy.js → index-C0rU7wjo.js} +1 -1
- package/build/assets/{index-mlKr_pQQ.js → index-C8408c32.js} +1 -1
- package/build/assets/{index--SdlqSfi.js → index-C9dv_cRO.js} +1 -1
- package/build/assets/{index-CnRs0MgX.js → index-CBgaSeZa.js} +1 -1
- package/build/assets/{index-BI9UgvCi.js → index-CESihKoP.js} +1 -1
- package/build/assets/{index-X9E9p-kg.js → index-CHcwRuRz.js} +1 -1
- package/build/assets/{index-C6fUDD3N.js → index-CO2uSAB4.js} +1 -1
- package/build/assets/{index-DFWekVRf.js → index-COVY3it_.js} +1 -1
- package/build/assets/{index-DDiZtaVk.js → index-C_XWYeXZ.js} +1 -1
- package/build/assets/{index-Wzix0Ssr.js → index-CcNoZyGq.js} +1 -1
- package/build/assets/{index-7qt3HHfl.js → index-CeooaFxj.js} +1 -1
- package/build/assets/{index-B3wu97uA.js → index-Ck8oqwxV.js} +1 -1
- package/build/assets/{index-CGMUJ4kd.js → index-D1lT9gPf.js} +1 -1
- package/build/assets/{index-DhqQeff3.js → index-D7qhlvAL.js} +5 -5
- package/build/assets/{index-DqnX_TF4.js → index-DDHABoz7.js} +1 -1
- package/build/assets/{index-DhxOxSgZ.js → index-DKJBdNcR.js} +1 -1
- package/build/assets/{index-CT5_r023.js → index-DLKkPsKG.js} +1 -1
- package/build/assets/{index-CI7_FxNG.js → index-DPhgZ6z8.js} +1 -1
- package/build/assets/{index---v6J_Xe.js → index-DodBZ077.js} +1 -1
- package/build/assets/{index-DXGgezsh.js → index-E1lgIpin.js} +1 -1
- package/build/assets/{index-D0YDqQsn.js → index-IjmnJRcJ.js} +1 -1
- package/build/assets/{index-Vs85zs5K.js → index-J69gSkQ7.js} +1 -1
- package/build/assets/{index-Bnvb95fQ.js → index-LjAoKxoo.js} +1 -1
- package/build/assets/{index-Dc2c4xJB.js → index-NFS9SZBh.js} +1 -1
- package/build/assets/{index-XLeMBlQJ.js → index-UG5gS873.js} +1 -1
- package/build/assets/{index-CxsEqDQL.js → index-oUxYecyl.js} +1 -1
- package/build/assets/{index-BDOZpIxN.js → index-rGN93mnX.js} +1 -1
- package/build/assets/{index-CKEBU2Tu.js → index-sNwZkMcg.js} +1 -1
- package/build/assets/{index-DyVqVg90.js → index-tGudOCY7.js} +1 -1
- package/build/assets/{inherits-BWX75f6B.js → inherits-CxdXuG_P.js} +1 -1
- package/build/assets/{input-DTfsWA-x.js → input-CK3Z1ctS.js} +1 -1
- package/build/assets/{memory-DS2CpVMo.js → memory-F_WtxrTu.js} +1 -1
- package/build/assets/{mergeWith-fWFIuGgc.js → mergeWith-DB-_2-Rw.js} +1 -1
- package/build/assets/{number-overlay-editor-DDQgeQYn.js → number-overlay-editor-B9-dA9Oc.js} +1 -1
- package/build/assets/{sandbox-VD4WfD0W.js → sandbox-OL9X-HVr.js} +1 -1
- package/build/assets/{slicedToArray-CgI3PJi3.js → slicedToArray-Dcf1iVtV.js} +1 -1
- package/build/assets/{timepicker-qd0SiRjC.js → timepicker-CNx-qwHe.js} +1 -1
- package/build/assets/{uniqueId-Dgo2nsPZ.js → uniqueId-B67KB2Sb.js} +1 -1
- package/build/assets/{useBasicWidgetState-9vtYd9vP.js → useBasicWidgetState-DVIC6bdr.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-BFx1z0yW.js → useTextInputAutoExpand-D9ObUIEt.js} +1 -1
- package/build/assets/{useUpdateUiValue-BF7Ryinr.js → useUpdateUiValue-BpA660Wd.js} +1 -1
- package/build/assets/{withFullScreenWrapper-C3PKUCi4.js → withFullScreenWrapper-CQbXKdaQ.js} +1 -1
- package/build/assets/worker-Cet_Vg8m.js +105 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/package.json +5 -5
- package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
- package/build/assets/worker-B7Gzidb7.js +0 -105
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,E as u,_ as x,c as p,aq as W,j as l,bY as g,bX as w,bE as O,bF as b,bR as Y,cf as _,b4 as q,bT as G,cg as j,F as m,d as f,bV as J,bU as K,b$ as Q,c0 as Z,ch as ee,c1 as te,bJ as ie}from"./index-DCNLpqIv.js";import{F as se}from"./FormClearHelper-fvwQICEk.js";import{g as z,F,D as le,b as ae,I as ne,C as oe,a as re,s as de}from"./FileHelper-BbrZYz8x.js";import{P as pe,S as ce}from"./ProgressBar-CXipOcU9.js";import{u as he}from"./Hooks-CCS44jMc.js";import{U as y}from"./UploadFileInfo-C-jY39rj.js";var U=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});U.displayName="ChevronLeft";var v=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});v.displayName="ChevronRight";var I=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});I.displayName="CloudUpload";var C=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const M=p("section",{target:"e1b2p2ww16"})(({isDisabled:e,theme:i})=>({display:"flex",alignItems:"center",padding:i.spacing.lg,backgroundColor:i.colors.secondaryBg,borderRadius:i.radii.default,border:i.colors.widgetBorderColor?`${i.sizes.borderWidth} solid ${i.colors.widgetBorderColor}`:void 0,height:i.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${i.colors.primary}`},cursor:e?"not-allowed":"pointer"}),""),B=p("div",{target:"e1b2p2ww15"})({name:"9xni5b",styles:"margin-right:auto;align-items:center;display:flex"}),V=p("span",{target:"e1b2p2ww14"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg}),""),L=p("span",{target:"e1b2p2ww13"})(({theme:e,disabled:i})=>({color:i?e.colors.fadedText40:e.colors.bodyText}),""),ge=p("span",{target:"e1b2p2ww12"})(({theme:e,disabled:i})=>({fontSize:e.fontSizes.sm,color:i?e.colors.fadedText40:e.colors.fadedText60}),""),me=p("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),E=p("div",{target:"e1b2p2ww10"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg}),""),fe=p("ul",{target:"e1b2p2ww9"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none}),""),A=p("li",{target:"e1b2p2ww8"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none}),""),D=p("div",{target:"e1b2p2ww7"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"}),""),k=p("div",{target:"e1b2p2ww6"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),H=p("div",{target:"e1b2p2ww5"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS}),""),ue=p("span",{target:"e1b2p2ww4"})(({theme:e})=>({marginRight:e.spacing.twoXS}),""),xe=p("div",{target:"e1b2p2ww3"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100}),""),T=p("small",{target:"e1b2p2ww2"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}),""),N=p("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),we=e=>({[M]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto"},[B]:{marginBottom:e.spacing.sm},[V]:{display:"none"},[L]:{marginBottom:e.spacing.twoXS},[E]:{paddingRight:e.spacing.lg},[H]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[D]:{flexDirection:"column"},[T]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[A]:{margin:e.spacing.none,padding:e.spacing.none}}),be=p("div",{target:"e1b2p2ww0"})(({theme:e,width:i})=>{if(i<W("23rem"))return we(e)},""),Fe=({multiple:e,acceptedExtensions:i,maxSizeBytes:t,disabled:s})=>l.jsxs(B,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l.jsx(V,{children:l.jsx(g,{content:I,size:"threeXL"})}),l.jsxs(me,{children:[l.jsxs(L,{disabled:s,children:["Drag and drop file",e?"s":""," here"]}),l.jsxs(ge,{disabled:s,children:[`Limit ${z(t,F.Byte,0)} per file`,i.length?` \u2022 ${i.map(a=>a.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),Se=d.memo(Fe),ye=({onDrop:e,multiple:i,acceptedExtensions:t,maxSizeBytes:s,disabled:a,label:n})=>l.jsx(le,{onDrop:e,multiple:i,accept:ae(t),maxSize:s,disabled:a,useFsAccessApi:!1,children:({getRootProps:o,getInputProps:r})=>l.jsxs(M,{...o(),"data-testid":"stFileUploaderDropzone",isDisabled:a,"aria-label":n,children:[l.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),l.jsx(Se,{multiple:i,acceptedExtensions:t,maxSizeBytes:s,disabled:a}),l.jsx(w,{kind:b.SECONDARY,disabled:a,size:O.SMALL,children:"Browse files"})]})}),je=d.memo(ye),R=p("small",{target:"e1bju1570"})(({kind:e,theme:i})=>{const{danger:t,fadedText60:s}=i.colors;return{color:e==="danger"?t:s,fontSize:i.fontSizes.sm,lineHeight:i.lineHeights.tight}},""),ze=({fileInfo:e})=>e.status.type==="uploading"?l.jsx(pe,{value:e.status.progress,size:ce.SMALL}):e.status.type==="error"?l.jsxs(T,{children:[l.jsx(ue,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l.jsx(N,{children:l.jsx(g,{content:C,size:"lg"})})]}):e.status.type==="uploaded"?l.jsx(R,{children:z(e.size,F.Byte)}):null,Ue=({fileInfo:e,onDelete:i})=>l.jsxs(H,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l.jsx(xe,{children:l.jsx(g,{content:ne,size:"twoXL"})}),l.jsxs(D,{className:"stFileUploaderFileData",children:[l.jsx(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),l.jsx(ze,{fileInfo:e})]}),l.jsx("div",{"data-testid":"stFileUploaderDeleteBtn",children:l.jsx(w,{onClick:()=>i(e.id),kind:b.MINIMAL,children:l.jsx(g,{content:oe,size:"lg"})})})]}),ve=d.memo(Ue),Ie=p("div",{target:"e1nlpozb1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS}),""),Ce=p("div",{target:"e1nlpozb0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40}),""),Me=({currentPage:e,totalPages:i,onNext:t,onPrevious:s})=>l.jsxs(Ie,{"data-testid":"stFileUploaderPagination",children:[l.jsx(R,{children:`Showing page ${e} of ${i}`}),l.jsxs(Ce,{children:[l.jsx(w,{onClick:s,kind:b.MINIMAL,children:l.jsx(g,{content:U,size:"xl"})}),l.jsx(w,{onClick:t,kind:b.MINIMAL,children:l.jsx(g,{content:v,size:"xl"})})]})]}),Be=d.memo(Me),P=(e,i)=>Math.ceil(e.length/i),Ve=e=>Y(({pageSize:i,items:t,resetOnAdd:s,...a})=>{const[n,o]=d.useState(0),[r,c]=d.useState(()=>P(t,i)),h=he(t);d.useEffect(()=>{h&&h.length!==t.length&&c(P(t,i)),h&&h.length<t.length?s&&o(0):n+1>=r&&o(r-1)},[t,n,i,h,s,r]);const S=()=>{o(Math.min(n+1,r-1))},X=()=>{o(Math.max(0,n-1))},$=t.slice(n*i,n*i+i);return l.jsxs(l.Fragment,{children:[l.jsx(e,{items:$,...a}),t.length>i?l.jsx(Be,{pageSize:i,totalPages:r,currentPage:n+1,onNext:S,onPrevious:X}):null]})},e),Le=({items:e,onDelete:i})=>l.jsx(fe,{children:e.map(t=>l.jsx(A,{children:l.jsx(ve,{fileInfo:t,onDelete:i})},t.id))}),Ee=Ve(Le),Ae=e=>l.jsx(E,{children:l.jsx(Ee,{...e})}),De=d.memo(Ae);class ke extends d.PureComponent{constructor(i){super(i),this.formClearHelper=new se,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:a,fragmentId:n}=this.props,o=a.getFileUploaderStateValue(s);q(t,o)||a.setFileUploaderStateValue(s,t,{fromUi:!0},n)},this.dropHandler=(t,s)=>{const{element:a}=this.props,{multipleFiles:n}=a;if(!n&&t.length===0&&s.length>1){const o=s.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");o>=0&&(t.push(s[o].file),s.splice(o,1))}if(this.props.uploadClient.fetchFileURLs(t).then(o=>{if(!n&&t.length>0){const r=this.state.files.find(c=>c.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}G(o,t).forEach(([r,c])=>{this.uploadFile(r,c)})}).catch(o=>{this.addFiles(t.map(r=>new y(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:o})))}),s.length>0){const o=s.map(r=>re(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(o)}},this.uploadFile=(t,s)=>{const a=j.CancelToken.source(),n=new y(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:a,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,n.id),a.token).then(()=>this.onUploadComplete(n.id,t)).catch(o=>{j.isCancel(o)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.onUploadComplete=(t,s)=>{const a=this.getFile(t);m(a)||a.status.type!=="uploading"||this.updateFile(a.id,a.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.deleteFile=t=>{const s=this.getFile(t);m(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=>{f.flushSync(()=>{this.setState(s=>({files:[...s.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(s=>({files:[...s.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(s=>({files:s.files.filter(a=>a.id!==t)}))})},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{f.flushSync(()=>{this.setState(a=>({files:a.files.map(n=>n.id===t?s:n)}))})},this.onUploadProgress=(t,s)=>{const a=this.getFile(s);if(m(a)||a.status.type!=="uploading")return;const n=Math.round(t.loaded*100/t.total);a.status.progress!==n&&this.updateFile(s,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:n}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(m(t))return;const{widgetMgr:s,element:a,fragmentId:n}=this.props;s.setFileUploaderStateValue(a,t,{fromUi:!0},n)})})},this.state=this.initialValue}get initialValue(){const i={files:[]},{widgetMgr:t,element:s}=this.props,a=t.getFileUploaderStateValue(s);if(m(a))return i;const{uploadedFileInfo:n}=a;return m(n)||n.length===0?i:{files:n.map(o=>{const r=o.name,c=o.size,h=o.fileId,S=o.fileUrls;return new y(r,c,this.nextLocalFileId(),{type:"uploaded",fileId:h,fileUrls:S})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const i=this.props.element.maxUploadSizeMb;return de(i,F.Megabyte,F.Byte)}get status(){const i=t=>t.status.type==="uploading";return this.state.files.some(i)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const i=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,i,{fromUi:!1},a)}createWidgetValue(){const i=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:a,status:n}=t,{fileId:o,fileUrls:r}=n;return new J({fileId:o,fileUrls:r,name:s,size:a})});return new K({uploadedFileInfo:i})}render(){const{files:i}=this.state,{element:t,disabled:s,widgetMgr:a,width:n}=this.props,o=t.type;this.formClearHelper.manageFormClearListener(a,t.formId,this.onFormCleared);const r=i.slice().reverse();return l.jsxs(be,{className:"stFileUploader","data-testid":"stFileUploader",width:n,children:[l.jsx(Q,{label:t.label,disabled:s,labelVisibility:Z(t.labelVisibility?.value),children:t.help&&l.jsx(ee,{children:l.jsx(te,{content:t.help,placement:ie.TOP_RIGHT})})}),l.jsx(je,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:o,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:s}),r.length>0&&l.jsx(De,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const He=_(d.memo(ke));export{He as default};
|
|
1
|
+
import{r as d,E as u,_ as x,c as p,aq as W,j as l,bY as g,bX as w,bE as O,bF as b,bR as Y,cf as _,b4 as q,bT as G,cg as j,F as m,d as f,bV as J,bU as K,b$ as Q,c0 as Z,ch as ee,c1 as te,bJ as ie}from"./index-B2QqSXxG.js";import{F as se}from"./FormClearHelper-BC4K9Zmh.js";import{g as z,F,D as le,b as ae,I as ne,C as oe,a as re,s as de}from"./FileHelper-BTXiVf4-.js";import{P as pe,S as ce}from"./ProgressBar-B7cXo5Zk.js";import{u as he}from"./Hooks-GYU3aDYH.js";import{U as y}from"./UploadFileInfo-C-jY39rj.js";var U=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});U.displayName="ChevronLeft";var v=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});v.displayName="ChevronRight";var I=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});I.displayName="CloudUpload";var C=d.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(u,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),d.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const M=p("section",{target:"e1b2p2ww16"})(({isDisabled:e,theme:i})=>({display:"flex",alignItems:"center",padding:i.spacing.lg,backgroundColor:i.colors.secondaryBg,borderRadius:i.radii.default,border:i.colors.widgetBorderColor?`${i.sizes.borderWidth} solid ${i.colors.widgetBorderColor}`:void 0,height:i.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${i.colors.primary}`},cursor:e?"not-allowed":"pointer"}),""),B=p("div",{target:"e1b2p2ww15"})({name:"9xni5b",styles:"margin-right:auto;align-items:center;display:flex"}),V=p("span",{target:"e1b2p2ww14"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg}),""),L=p("span",{target:"e1b2p2ww13"})(({theme:e,disabled:i})=>({color:i?e.colors.fadedText40:e.colors.bodyText}),""),ge=p("span",{target:"e1b2p2ww12"})(({theme:e,disabled:i})=>({fontSize:e.fontSizes.sm,color:i?e.colors.fadedText40:e.colors.fadedText60}),""),me=p("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),E=p("div",{target:"e1b2p2ww10"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg}),""),fe=p("ul",{target:"e1b2p2ww9"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none}),""),A=p("li",{target:"e1b2p2ww8"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none}),""),D=p("div",{target:"e1b2p2ww7"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"}),""),k=p("div",{target:"e1b2p2ww6"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),H=p("div",{target:"e1b2p2ww5"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS}),""),ue=p("span",{target:"e1b2p2ww4"})(({theme:e})=>({marginRight:e.spacing.twoXS}),""),xe=p("div",{target:"e1b2p2ww3"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100}),""),T=p("small",{target:"e1b2p2ww2"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}),""),N=p("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),we=e=>({[M]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto"},[B]:{marginBottom:e.spacing.sm},[V]:{display:"none"},[L]:{marginBottom:e.spacing.twoXS},[E]:{paddingRight:e.spacing.lg},[H]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[D]:{flexDirection:"column"},[T]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[A]:{margin:e.spacing.none,padding:e.spacing.none}}),be=p("div",{target:"e1b2p2ww0"})(({theme:e,width:i})=>{if(i<W("23rem"))return we(e)},""),Fe=({multiple:e,acceptedExtensions:i,maxSizeBytes:t,disabled:s})=>l.jsxs(B,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l.jsx(V,{children:l.jsx(g,{content:I,size:"threeXL"})}),l.jsxs(me,{children:[l.jsxs(L,{disabled:s,children:["Drag and drop file",e?"s":""," here"]}),l.jsxs(ge,{disabled:s,children:[`Limit ${z(t,F.Byte,0)} per file`,i.length?` \u2022 ${i.map(a=>a.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),Se=d.memo(Fe),ye=({onDrop:e,multiple:i,acceptedExtensions:t,maxSizeBytes:s,disabled:a,label:n})=>l.jsx(le,{onDrop:e,multiple:i,accept:ae(t),maxSize:s,disabled:a,useFsAccessApi:!1,children:({getRootProps:o,getInputProps:r})=>l.jsxs(M,{...o(),"data-testid":"stFileUploaderDropzone",isDisabled:a,"aria-label":n,children:[l.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),l.jsx(Se,{multiple:i,acceptedExtensions:t,maxSizeBytes:s,disabled:a}),l.jsx(w,{kind:b.SECONDARY,disabled:a,size:O.SMALL,children:"Browse files"})]})}),je=d.memo(ye),R=p("small",{target:"e1bju1570"})(({kind:e,theme:i})=>{const{danger:t,fadedText60:s}=i.colors;return{color:e==="danger"?t:s,fontSize:i.fontSizes.sm,lineHeight:i.lineHeights.tight}},""),ze=({fileInfo:e})=>e.status.type==="uploading"?l.jsx(pe,{value:e.status.progress,size:ce.SMALL}):e.status.type==="error"?l.jsxs(T,{children:[l.jsx(ue,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l.jsx(N,{children:l.jsx(g,{content:C,size:"lg"})})]}):e.status.type==="uploaded"?l.jsx(R,{children:z(e.size,F.Byte)}):null,Ue=({fileInfo:e,onDelete:i})=>l.jsxs(H,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l.jsx(xe,{children:l.jsx(g,{content:ne,size:"twoXL"})}),l.jsxs(D,{className:"stFileUploaderFileData",children:[l.jsx(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),l.jsx(ze,{fileInfo:e})]}),l.jsx("div",{"data-testid":"stFileUploaderDeleteBtn",children:l.jsx(w,{onClick:()=>i(e.id),kind:b.MINIMAL,children:l.jsx(g,{content:oe,size:"lg"})})})]}),ve=d.memo(Ue),Ie=p("div",{target:"e1nlpozb1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS}),""),Ce=p("div",{target:"e1nlpozb0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40}),""),Me=({currentPage:e,totalPages:i,onNext:t,onPrevious:s})=>l.jsxs(Ie,{"data-testid":"stFileUploaderPagination",children:[l.jsx(R,{children:`Showing page ${e} of ${i}`}),l.jsxs(Ce,{children:[l.jsx(w,{onClick:s,kind:b.MINIMAL,children:l.jsx(g,{content:U,size:"xl"})}),l.jsx(w,{onClick:t,kind:b.MINIMAL,children:l.jsx(g,{content:v,size:"xl"})})]})]}),Be=d.memo(Me),P=(e,i)=>Math.ceil(e.length/i),Ve=e=>Y(({pageSize:i,items:t,resetOnAdd:s,...a})=>{const[n,o]=d.useState(0),[r,c]=d.useState(()=>P(t,i)),h=he(t);d.useEffect(()=>{h&&h.length!==t.length&&c(P(t,i)),h&&h.length<t.length?s&&o(0):n+1>=r&&o(r-1)},[t,n,i,h,s,r]);const S=()=>{o(Math.min(n+1,r-1))},X=()=>{o(Math.max(0,n-1))},$=t.slice(n*i,n*i+i);return l.jsxs(l.Fragment,{children:[l.jsx(e,{items:$,...a}),t.length>i?l.jsx(Be,{pageSize:i,totalPages:r,currentPage:n+1,onNext:S,onPrevious:X}):null]})},e),Le=({items:e,onDelete:i})=>l.jsx(fe,{children:e.map(t=>l.jsx(A,{children:l.jsx(ve,{fileInfo:t,onDelete:i})},t.id))}),Ee=Ve(Le),Ae=e=>l.jsx(E,{children:l.jsx(Ee,{...e})}),De=d.memo(Ae);class ke extends d.PureComponent{constructor(i){super(i),this.formClearHelper=new se,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:a,fragmentId:n}=this.props,o=a.getFileUploaderStateValue(s);q(t,o)||a.setFileUploaderStateValue(s,t,{fromUi:!0},n)},this.dropHandler=(t,s)=>{const{element:a}=this.props,{multipleFiles:n}=a;if(!n&&t.length===0&&s.length>1){const o=s.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");o>=0&&(t.push(s[o].file),s.splice(o,1))}if(this.props.uploadClient.fetchFileURLs(t).then(o=>{if(!n&&t.length>0){const r=this.state.files.find(c=>c.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}G(o,t).forEach(([r,c])=>{this.uploadFile(r,c)})}).catch(o=>{this.addFiles(t.map(r=>new y(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:o})))}),s.length>0){const o=s.map(r=>re(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(o)}},this.uploadFile=(t,s)=>{const a=j.CancelToken.source(),n=new y(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:a,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,n.id),a.token).then(()=>this.onUploadComplete(n.id,t)).catch(o=>{j.isCancel(o)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.onUploadComplete=(t,s)=>{const a=this.getFile(t);m(a)||a.status.type!=="uploading"||this.updateFile(a.id,a.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.deleteFile=t=>{const s=this.getFile(t);m(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=>{f.flushSync(()=>{this.setState(s=>({files:[...s.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(s=>({files:[...s.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(s=>({files:s.files.filter(a=>a.id!==t)}))})},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{f.flushSync(()=>{this.setState(a=>({files:a.files.map(n=>n.id===t?s:n)}))})},this.onUploadProgress=(t,s)=>{const a=this.getFile(s);if(m(a)||a.status.type!=="uploading")return;const n=Math.round(t.loaded*100/t.total);a.status.progress!==n&&this.updateFile(s,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:n}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(m(t))return;const{widgetMgr:s,element:a,fragmentId:n}=this.props;s.setFileUploaderStateValue(a,t,{fromUi:!0},n)})})},this.state=this.initialValue}get initialValue(){const i={files:[]},{widgetMgr:t,element:s}=this.props,a=t.getFileUploaderStateValue(s);if(m(a))return i;const{uploadedFileInfo:n}=a;return m(n)||n.length===0?i:{files:n.map(o=>{const r=o.name,c=o.size,h=o.fileId,S=o.fileUrls;return new y(r,c,this.nextLocalFileId(),{type:"uploaded",fileId:h,fileUrls:S})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const i=this.props.element.maxUploadSizeMb;return de(i,F.Megabyte,F.Byte)}get status(){const i=t=>t.status.type==="uploading";return this.state.files.some(i)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const i=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,i,{fromUi:!1},a)}createWidgetValue(){const i=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:a,status:n}=t,{fileId:o,fileUrls:r}=n;return new J({fileId:o,fileUrls:r,name:s,size:a})});return new K({uploadedFileInfo:i})}render(){const{files:i}=this.state,{element:t,disabled:s,widgetMgr:a,width:n}=this.props,o=t.type;this.formClearHelper.manageFormClearListener(a,t.formId,this.onFormCleared);const r=i.slice().reverse();return l.jsxs(be,{className:"stFileUploader","data-testid":"stFileUploader",width:n,children:[l.jsx(Q,{label:t.label,disabled:s,labelVisibility:Z(t.labelVisibility?.value),children:t.help&&l.jsx(ee,{children:l.jsx(te,{content:t.help,placement:ie.TOP_RIGHT})})}),l.jsx(je,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:o,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:s}),r.length>0&&l.jsx(De,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const He=_(d.memo(ke));export{He as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as m,k as p,r as c,j as n,b as g}from"./index-
|
|
1
|
+
import{c as m,k as p,r as c,j as n,b as g}from"./index-B2QqSXxG.js";import{R as d,P as x}from"./Particles-DKyXwmGK.js";const f="/assets/balloon-0.Czj7AKwE.png",b="/assets/balloon-1.CNvFFrND.png",u="/assets/balloon-2.DTvC6B1t.png",h="/assets/balloon-3.CgSk4tbL.png",C="/assets/balloon-4.mbtFrzxf.png",N="/assets/balloon-5.CSwkUfRA.png",t=300,o=121,e=20,$=80,w=1e3,I=p`
|
|
2
2
|
from {
|
|
3
3
|
transform: translateY(calc(100vh + ${t}px));
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,L as A,bF as h,cb as C,j as f,bH as R,bX as T,bE as E,bI as v}from"./index-
|
|
1
|
+
import{r as d,L as A,bF as h,cb as C,j as f,bH as R,bX as T,bE as E,bI as v}from"./index-B2QqSXxG.js";import{c as I}from"./createDownloadLinkElement-ZaXNnPK4.js";const L=/%([0-9A-Fa-f]{2})/g,$=/[^\x20-\x7e\xa0-\xff]/g,k=/\\([\u0000-\u007f])/g,w=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,z=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,U=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,D=r=>String(r).replace($,"?");class j{constructor(e,t){this.type=e,this.parameters=t}}const Z=(r,e)=>String.fromCharCode(Number.parseInt(e,16));function _(r){const e=z.exec(r);if(!e)throw new TypeError("invalid extended field value");const t=e[1].toLowerCase(),a=e[2];let n;switch(t){case"iso-8859-1":n=D(a.replace(L,Z));break;case"utf-8":try{n=decodeURIComponent(a)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return n}function N(r){let e=U.exec(r);if(!e)throw new TypeError("invalid type format");let t=e[0].length;const a=e[1].toLowerCase();let n;const l=[],i={};let o;for(t=w.lastIndex=e[0].slice(-1)===";"?t-1:t;e=w.exec(r);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,n=e[1].toLowerCase(),o=e[2],l.indexOf(n)!==-1)throw new TypeError("invalid duplicate parameter");if(l.push(n),n.indexOf("*")+1===n.length){n=n.slice(0,-1),o=_(o),i[n]=o;continue}typeof i[n]!="string"&&(o[0]==='"'&&(o=o.slice(1,o.length-1).replace(k,"$1")),i[n]=o)}if(t!==-1&&t!==r.length)throw new TypeError("invalid parameter format");return new j(a,i)}function S(r){const e=N(r);if(e.type!=="attachment")return;const t=e.parameters.filename;if(typeof t=="string")return t}function B(r,e){r.sendHttpRequest({method:"GET",path:`${e}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:t,headers:a,body:n})=>{if(t!==200)return;const l=a.get("Content-Disposition"),i=(l&&S(l))??"",o=a.get("Content-Type"),u=new Blob([n],o?{type:o}:void 0),c=URL.createObjectURL(u),s=document.createElement("a");s.setAttribute("href",c),s.setAttribute("target","_blank"),s.setAttribute("download",i),s.click(),URL.revokeObjectURL(c),s.remove()})}function O(r){const{disabled:e,element:t,widgetMgr:a,endpoints:n,fragmentId:l}=r,{help:i,label:o,icon:u,ignoreRerun:c,type:s,url:m}=t,{libConfig:{enforceDownloadInNewTab:b=!1}}=d.useContext(A);let p=h.SECONDARY;s==="primary"?p=h.PRIMARY:s==="tertiary"&&(p=h.TERTIARY);const x=d.useMemo(()=>n.buildDownloadUrl(m),[n,m]);d.useEffect(()=>{n.checkSourceUrlResponse(x,"Download Button")},[x,n]);const g=C(),y=()=>{if(c||a.setTriggerValue(t,{fromUi:!0},l),t.url.startsWith("/media")){B(g,t.url);return}I({filename:"",url:x,enforceDownloadInNewTab:b}).click()};return f.jsx("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:f.jsx(R,{help:i,containerWidth:!0,children:f.jsx(T,{kind:p,size:E.SMALL,disabled:e,onClick:y,containerWidth:!0,children:f.jsx(v,{icon:u,label:o})})})})}const M=d.memo(O);export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,r as c,L as p,ap as b,j as o,bH as x,bJ as u,b9 as h,bc as f}from"./index-
|
|
1
|
+
import{c as l,r as c,L as p,ap as b,j as o,bH as x,bJ as u,b9 as h,bc as f}from"./index-B2QqSXxG.js";const k=l("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),m=l("a",{target:"e11k5jya1"})(({disabled:t,isCurrentPage:r,theme:e})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.button,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},...t?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),C=l("span",{target:"e11k5jya0"})(({disabled:t,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...t?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function v(t){const{onPageChange:r,currentPageScriptHash:e}=c.useContext(p),{colors:s}=b(),{disabled:n,element:a}=t,i=e===a.pageScriptHash,g=d=>{a.external?n&&d.preventDefault():(d.preventDefault(),n||r(a.pageScriptHash))};return o.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:o.jsx(x,{help:a.help,placement:u.TOP_RIGHT,containerWidth:!0,children:o.jsx(k,{children:o.jsxs(m,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:i,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:g,children:[a.icon&&o.jsx(h,{size:"lg",color:n?s.fadedText40:s.bodyText,iconValue:a.icon}),o.jsx(C,{disabled:n,children:o.jsx(f,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:i,largerLabel:!0,disableLinks:!0})})]})})})})}const L=c.memo(v);export{L as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c3 as w,cn as ge,c4 as O,r as c,ap as ye,j as m,b$ as ve,c9 as we,c1 as Oe,bJ as Re,bc as re,aq as oe,cL as ne,c0 as ke}from"./index-
|
|
1
|
+
import{c3 as w,cn as ge,c4 as O,r as c,ap as ye,j as m,b$ as ve,c9 as we,c1 as Oe,bJ as Re,bc as re,aq as oe,cL as ne,c0 as ke}from"./index-B2QqSXxG.js";import{a as je}from"./useBasicWidgetState-DVIC6bdr.js";import"./FormClearHelper-BC4K9Zmh.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){R(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 R(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var x=0,E=1,L=2;function T(e){return e.$isActive?L:e.$isHovered?E:x}function Se(e){var t=e.$theme.colors,o=e.$disabled,r=e.$checked,n=e.$isFocusVisible,i=e.$error;if(o)return t.tickFillDisabled;if(r)if(i)switch(T(e)){case x:return t.tickFillErrorSelected;case E:return t.tickFillErrorSelectedHover;case L:return t.tickFillErrorSelectedHoverActive}else switch(T(e)){case x:return t.tickFillSelected;case E:return t.tickFillSelectedHover;case L:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function $e(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(T(e)){case x:return t.tickFillError;case E:return t.tickFillErrorHover;case L:return t.tickFillErrorHoverActive}else switch(T(e)){case x:return t.tickFill;case E:return t.tickFillHover;case L:return t.tickFillActive}}function Me(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 i=r.sizing,a=i.scale300;return R({},"padding".concat(n),a)}function Fe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var _=w("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"}});_.displayName="RadioGroupRoot",_.displayName="RadioGroupRoot";var N=w("label",function(e){var t,o=e.$disabled,r=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,u=a==="horizontal",f=i.direction==="rtl"?"Left":"Right";return t={flexDirection:n==="top"||n==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",marginTop:s.scale200},R(t,"margin".concat(f),u?s.scale200:null),R(t,"marginBottom",r&&!u?null:s.scale200),t});N.displayName="Root",N.displayName="Root";var U=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:$e(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}});U.displayName="RadioMarkInner",U.displayName="RadioMarkInner";var q=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:Se(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}});q.displayName="RadioMarkOuter",q.displayName="RadioMarkOuter";var G=w("div",function(e){var t=e.$theme.typography;return C(C({verticalAlign:"middle"},Me(e)),{},{color:Fe(e)},t.LabelMedium)});G.displayName="Label",G.displayName="Label";var W=w("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"});W.displayName="Input",W.displayName="Input";var X=w("div",function(e){var t,o=e.$theme,r=e.$align,n=r==="horizontal",i=o.direction==="rtl"?"Right":"Left",a=o.direction==="rtl"?"Left":"Right";return C(C({},o.typography.ParagraphSmall),{},(t={color:o.colors.contentSecondary,cursor:"auto"},R(t,"margin".concat(i),r==="horizontal"?null:o.sizing.scale900),R(t,"margin".concat(a),n?o.sizing.scale200:null),R(t,"maxWidth","240px"),t))});X.displayName="Description",X.displayName="Description";function J(e){"@babel/helpers - typeof";return J=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},J(e)}function K(){return K=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},K.apply(this,arguments)}function Pe(e,t){return Ie(e)||Le(e,t)||Ee(e,t)||xe()}function xe(){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 Ee(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 Le(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,s=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Ie(e){if(Array.isArray(e))return e}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Te(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 Ae(e,t,o){return t&&Te(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(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&&Q(e,t)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Q(e,t)}function De(e){var t=He();return function(){var o=B(e),r;if(t){var n=B(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return ze(this,r)}}function ze(e,t){if(t&&(J(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 He(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B(e)}function D(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){Be(o,e);var t=De(o);function o(){var r;Ce(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),D(A(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),D(A(r),"handleFocus",function(s,u){ge(s)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:u}),r.props.onFocus&&r.props.onFocus(s)}),D(A(r),"handleBlur",function(s,u){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(s)}),r}return Ae(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,i=n===void 0?{}:n,a=O(i.RadioGroupRoot,_),s=Pe(a,2),u=s[0],f=s[1];return c.createElement(u,K({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,h){if(!c.isValidElement(p))return null;var l=r.props.value===p.props.value;return c.cloneElement(p,{align:r.props.align,autoFocus:r.props.autoFocus,checked:l,disabled:r.props.disabled||p.props.disabled,error:r.props.error,isFocused:r.state.focusedRadioIndex===h,isFocusVisible:r.state.isFocusVisible,tabIndex:h===0&&!r.props.value||l?"0":"-1",labelPlacement:r.props.labelPlacement,name:r.props.name,onBlur:function(d){return r.handleBlur(d,h)},onFocus:function(d){return r.handleFocus(d,h)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o}(c.Component);D(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 Y(e){"@babel/helpers - typeof";return Y=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},Y(e)}function v(){return v=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},v.apply(this,arguments)}function S(e,t){return Ue(e)||Ne(e,t)||_e(e,t)||Ve()}function Ve(){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 _e(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 Ne(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,s=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Ue(e){if(Array.isArray(e))return e}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(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 We(e,t,o){return t&&Ge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xe(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 Je(e){var t=Qe();return function(){var o=z(e),r;if(t){var n=z(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&(Y(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $(e)}function $(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qe(){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 z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},z(e)}function M(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Ye(e){return e==="top"||e==="left"}function Ze(e){return e==="bottom"||e==="right"}var et=function(e){return e.stopPropagation()},ue=function(e){Xe(o,e);var t=Je(o);function o(){var r;qe(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),M($(r),"state",{isActive:!1,isHovered:!1}),M($(r),"onMouseEnter",function(s){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(s)}),M($(r),"onMouseLeave",function(s){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(s)}),M($(r),"onMouseDown",function(s){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(s)}),M($(r),"onMouseUp",function(s){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(s)}),r}return We(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,i=O(n.Root,N),a=S(i,2),s=a[0],u=a[1],f=O(n.Label,G),p=S(f,2),h=p[0],l=p[1],d=O(n.Input,W),F=S(d,2),H=F[0],k=F[1],V=O(n.Description,X),P=S(V,2),I=P[0],g=P[1],y=O(n.RadioMarkInner,U),b=S(y,2),pe=b[0],de=b[1],fe=O(n.RadioMarkOuter,q),ee=S(fe,2),he=ee[0],be=ee[1],j={$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},te=c.createElement(h,v({},j,l),this.props.containsInteractiveElement?c.createElement("div",{onClick:function(me){return me.preventDefault()}},this.props.children):this.props.children);return c.createElement(c.Fragment,null,c.createElement(s,v({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},j,u),Ye(this.props.labelPlacement)&&te,c.createElement(he,v({},j,be),c.createElement(pe,v({},j,de))),c.createElement(H,v({"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:et,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},j,k)),Ze(this.props.labelPlacement)&&te),!!this.props.description&&c.createElement(I,v({},j,g),this.props.description))}}]),o}(c.Component);M(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 tt(e){const t=parseFloat(e.sizes.checkbox),o=parseFloat(e.spacing.threeXS),r=oe(t.toString()),n=Math.round(r*.375);let i=Math.round(oe((t-o).toString()));return i>=r&&(i-=1),[ne(n,"px"),ne(i,"px")]}function rt({disabled:e,horizontal:t,value:o,onChange:r,options:n,captions:i,label:a,labelVisibility:s,help:u}){const[f,p]=c.useState(o??null);c.useEffect(()=>{o!==f&&p(o??null)},[o]);const h=c.useCallback(g=>{const y=parseInt(g.target.value,10);p(y),r(y)},[r]),l=ye(),d=i.length>0,F=n.length>0,H=F?n:["No options to select."],k=e||!F,V=g=>g==""&&t&&d?" ":g,[P,I]=tt(l);return m.jsxs("div",{className:"stRadio","data-testid":"stRadio",children:[m.jsx(ve,{label:a,disabled:k,labelVisibility:s,children:u&&m.jsx(we,{children:m.jsx(Oe,{content:u,placement:Re.TOP_RIGHT})})}),m.jsx(le,{onChange:h,value:f!==null?f.toString():void 0,disabled:k,align:t?ie.horizontal:ie.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:H.map((g,y)=>m.jsxs(ue,{value:y.toString(),overrides:{Root:{style:({$isFocusVisible:b})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:d?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:b?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:b})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:b&&!k?l.colors.primary:l.colors.fadedText40})},RadioMarkInner:{style:({$checked:b})=>({height:b?P:I,width:b?P:I})},Label:{style:{color:k?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[m.jsx(re,{source:g,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&m.jsx(re,{source:V(i[y]),allowHTML:!1,isCaption:!0,isLabel:!0})]},y))})]})}const ot=c.memo(rt);function nt({disabled:e,element:t,widgetMgr:o,fragmentId:r}){const[n,i]=je({getStateFromWidgetMgr:it,getDefaultStateFromProto:at,getCurrStateFromProto:st,updateWidgetMgrState:lt,element:t,widgetMgr:o,fragmentId:r}),a=c.useCallback(d=>{i({value:d,fromUi:!0})},[i]),{horizontal:s,options:u,captions:f,label:p,labelVisibility:h,help:l}=t;return m.jsx(ot,{label:p,onChange:a,options:u,captions:f,disabled:e,horizontal:s,labelVisibility:ke(h?.value),value:n??null,help:l})}function it(e,t){return e.getIntValue(t)}function at(e){return e.default??null}function st(e){return e.value??null}function lt(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const ct=c.memo(nt);export{ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r as n,u as y,a as A,j as f,l as L}from"./index-
|
|
1
|
+
import{c as m,r as n,u as y,a as A,j as f,l as L}from"./index-B2QqSXxG.js";const h=m("div",{target:"exyuj7n1"})(()=>({lineHeight:0}),""),j=m("audio",{target:"exyuj7n0"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0}),""),x=L.getLogger("Audio");function C({element:r,endpoints:d,elementMgr:a}){const o=n.useRef(null),{startTime:i,endTime:s,loop:u,autoplay:g}=r,E=n.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);n.useEffect(()=>{o.current&&(o.current.currentTime=i)},[i]),n.useEffect(()=>{const e=o.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),n.useEffect(()=>{const e=o.current;if(!e)return;let t=!1;const l=()=>{s>0&&e.currentTime>=s&&(u?(e.currentTime=i||0,e.play()):t||(t=!0,e.pause()))};return s>0&&e.addEventListener("timeupdate",l),()=>{e&&s>0&&e.removeEventListener("timeupdate",l)}},[s,u,i]),n.useEffect(()=>{const e=o.current;if(!e)return;const t=()=>{u&&(e.currentTime=i||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,i]);const c=y(r.url),p=A(c),v=d.buildMediaURL(c),T=e=>{const t=e.currentTarget.src;x.error(`Client Error: Audio source error - ${t}`),d.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)};return f.jsx(h,{children:f.jsx(j,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:g&&!E,src:v,onError:T,crossOrigin:p})})}const H=n.memo(C);export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c0 as S,d2 as L,c as P,r as l,bm as _,ap as G,d3 as W,j as s,b$ as $,ch as J,c1 as K,bJ as N}from"./index-
|
|
1
|
+
import{c0 as S,d2 as L,c as P,r as l,bm as _,ap as G,d3 as W,j as s,b$ as $,ch as J,c1 as K,bJ as N}from"./index-B2QqSXxG.js";import{u as O}from"./uniqueId-B67KB2Sb.js";import{I as q}from"./InputInstructions-CqSmotDL.js";import{a as Q}from"./useBasicWidgetState-DVIC6bdr.js";import{u as X,a as Y,b as Z}from"./useUpdateUiValue-BpA660Wd.js";import{u as ee,T as te}from"./useTextInputAutoExpand-D9ObUIEt.js";import"./FormClearHelper-BC4K9Zmh.js";import"./inputUtils-CptNuJwn.js";import"./base-input-Bu7lYJya.js";const ie=(t,e)=>{let a="auto";if(t.heightConfig?.useStretch)a="100%";else if(t.heightConfig?.pixelHeight&&t.heightConfig.pixelHeight>0){const r=S(e.labelVisibility?.value)===L.Collapsed?2:30;a=`${t.heightConfig.pixelHeight-r}px`}return a},ae=P("div",{target:"ezh4s2r0"})({name:"kdbhus",styles:"height:100%;display:flex;flex-direction:column"}),v=(t,e)=>t.getStringValue(e)??e.default??null,le=t=>t.default??null,re=t=>t.value??null,oe=(t,e,a,r)=>{e.setStringValue(t,a.value,{fromUi:a.fromUi},r)},se=({disabled:t,element:e,widgetMgr:a,fragmentId:r,outerElement:h})=>{const c=l.useRef(O("text_area_")).current,[y,H]=_(),[o,m]=l.useState(!1),[I,b]=l.useState(!1),d=h.heightConfig?.useContent??!1,T=h.heightConfig?.useStretch??!1,R=ie(h,e),x=l.useRef(null),[n,g]=l.useState(()=>v(a,e)??null),F=l.useCallback(()=>{g(e.default??null),m(!0)},[e]),[j,u]=Q({getStateFromWidgetMgr:v,getDefaultStateFromProto:le,getCurrStateFromProto:re,updateWidgetMgrState:oe,element:e,widgetMgr:a,fragmentId:r,onFormCleared:F});X(j,n,g,o);const i=G(),{height:k,maxHeight:z,updateScrollHeight:C}=ee({textareaRef:x,dependencies:[e.placeholder]}),p=l.useCallback(()=>{m(!1),u({value:n,fromUi:!0})},[n,u]),V=l.useCallback(()=>{o&&p(),b(!1)},[o,p]),w=l.useCallback(()=>{b(!0)},[]),E=l.useCallback(()=>{d&&C()},[d,C]),A=Y({formId:e.formId,maxChars:e.maxChars,setDirty:m,setUiValue:g,setValueWithSource:u,additionalAction:E}),D=Z(e.formId,p,o,a,r,!0),{placeholder:M,formId:f}=e,U=W({formId:f})?a.allowFormEnterToSubmit(f):o,B=I&&y>i.breakpoints.hideWidgetDetails;return s.jsxs(ae,{className:"stTextArea","data-testid":"stTextArea",ref:H,children:[s.jsx($,{label:e.label,disabled:t,labelVisibility:S(e.labelVisibility?.value),htmlFor:c,children:e.help&&s.jsx(J,{children:s.jsx(K,{content:e.help,placement:N.TOP_RIGHT})})}),s.jsx(te,{inputRef:d?x:void 0,value:n??"",placeholder:M,onBlur:V,onFocus:w,onChange:A,onKeyDown:D,"aria-label":e.label,disabled:t,id:c,overrides:{Input:{style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,height:d?k:R,maxHeight:d?z:"",minHeight:i.sizes.largestElementHeight,resize:T?"none":"vertical",paddingRight:i.spacing.md,paddingLeft:i.spacing.md,paddingBottom:i.spacing.md,paddingTop:i.spacing.md,"::placeholder":{color:i.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,flexGrow:1}}}}),B&&s.jsx(q,{dirty:o,value:n??"",maxLength:e.maxChars,type:"multiline",inForm:W({formId:f}),allowEnterToSubmit:U})]})},de=l.memo(se);export{de as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as i,ap as x,j as s,b9 as y,bc as w,bq as t,b8 as S,br as T,bs as v}from"./index-
|
|
1
|
+
import{c as p,r as i,ap as x,j as s,b9 as y,bc as w,bq as t,b8 as S,br as T,bs as v}from"./index-B2QqSXxG.js";const z=p("button",{target:"elibz2u2"})(({theme:e})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,color:e.colors.fadedText60,backgroundColor:e.colors.transparent,fontFamily:"inherit",margin:e.spacing.none,border:"none",boxShadow:"none",padding:e.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:e.colors.primary}}),""),R=p("div",{target:"elibz2u1"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),j=p("div",{target:"elibz2u0"})(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,div:{display:"inline-flex"}}),"");function C(e){const o=S(e);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.toastWidth,marginTop:e.spacing.sm,borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:o?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:o?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,":hover":{color:e.colors.bodyText}}}}}function L(e){if(e.length>104){let o=e.replace(/^(.{104}[^\s]*).*/,"$1");return o.length>104&&(o=o.substring(0,104).split(" ").slice(0,-1).join(" ")),o.trim()}return e}function k({body:e,icon:o}){const n=x(),r=L(e),d=e!==r,[a,b]=i.useState(!d),[u,h]=i.useState(0),f=i.useCallback(()=>{b(!a)},[a]),l=i.useMemo(()=>C(n),[n]),c=i.useMemo(()=>s.jsxs(R,{expanded:a,children:[o&&s.jsx(y,{iconValue:o,size:"xl",testid:"stToastDynamicIcon"}),s.jsxs(j,{children:[s.jsx(w,{source:a?e:r,allowHTML:!1,isToast:!0}),d&&s.jsx(z,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,e,o,r,f]);i.useEffect(()=>{if(n.inSidebar)return;const g=t.info(c,{overrides:{...l}});return h(g),()=>{t.update(g,{overrides:{Body:{style:{display:"none"}}}}),t.clear(g)}},[]),i.useEffect(()=>{t.update(u,{children:c,overrides:{...l}})},[u,c,l]);const m=s.jsx(T,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`.\n See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return s.jsx(s.Fragment,{children:n.inSidebar&&m})}const B=i.memo(k);export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,E,_ as R,c as x,b1 as q,j as u,c2 as J,bJ as z,bX as Q,bF as Y,bY as O,cc as V,h as K,g as Z,bl as ee,ap as te,cd as re,ce as ie,cf as se,l as oe,b4 as ne,F as P,cg as _,bV as ae,bU as le,b$ as ce,c0 as de,ch as he,c1 as ue}from"./index-DCNLpqIv.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{F as pe}from"./FormClearHelper-fvwQICEk.js";import{P as ge,S as fe}from"./ProgressBar-CXipOcU9.js";var D=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{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"}))});D.displayName="SwitchCamera";var W=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{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"}))});W.displayName="Video";var $=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{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"}))});$.displayName="X";function me(r,l){switch(r){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 A=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=x("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ve=x("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ye=x("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=x("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),be=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=x("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=x("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(r.colors.primary,.5)}`},...me("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return u.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?u.jsx(Me,{children:u.jsx(ge,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const H=y.memo(Ce);var F=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(F||{});const xe=({switchFacingMode:r})=>u.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(J,{content:"Switch camera",placement:z.TOP_RIGHT,children:u.jsx(Q,{kind:Y.MINIMAL,onClick:r,children:u.jsx(O,{content:D,size:"twoXL",color:V.white})})})}),Ie=y.memo(xe);var T={exports:{}},je=T.exports,N;function Pe(){return N||(N=1,function(r,l){(function(e,s){r.exports=s(K())})(je,function(e){return function(s){var o={};function n(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return s[a].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=s,n.c=o,n.d=function(a,p,S){n.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:S})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,p){if(p&1&&(a=n(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var S=Object.create(null);if(n.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)n.d(S,C,(function(U){return a[U]}).bind(null,C));return S},n.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(p,"a",p),p},n.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,o,n){n.r(o);var a=n("react"),p=function(){var g=function(h,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var c in d)d.hasOwnProperty(c)&&(t[c]=d[c])},g(h,i)};return function(h,i){g(h,i);function t(){this.constructor=h}h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),S=function(){return S=Object.assign||function(g){for(var h,i=1,t=arguments.length;i<t;i++){h=arguments[i];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},C=function(g,h){var i={};for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&h.indexOf(t)<0&&(i[t]=g[t]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,t=Object.getOwnPropertySymbols(g);d<t.length;d++)h.indexOf(t[d])<0&&Object.prototype.propertyIsEnumerable.call(g,t[d])&&(i[t[d]]=g[t[d]]);return i};(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(i,t){h.call(navigator,g,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(h,g);function h(i){var t=g.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return h.prototype.componentDidMount=function(){var i=this,t=i.state,d=i.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(i){var t=this.props;if(!U()){t.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),c=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),w=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.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(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},h.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(h.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},h.prototype.getScreenshot=function(i){var t=this,d=t.state,c=t.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(i);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(i){var t=this,d=t.state,c=t.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 m=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/m,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||w,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,f=M.canvas;return b&&f&&(f.width=i?.width||f.width,f.height=i?.height||f.height,c.mirrored&&(b.translate(f.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,i?.width||f.width,i?.height||f.height),c.mirrored&&(b.scale(-1,1),b.translate(-f.width,0))),f},h.prototype.requestUserMedia=function(){var i=this,t=this.props,d=function(v,m){var M={video:typeof m<"u"?m:!0};t.audio&&(M.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var b=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){i.unmounted||b!==i.requestUserMediaId?h.stopMediaStream(f):i.handleUserMedia(null,f)}).catch(function(f){i.handleUserMedia(f)})};if("mediaDevices"in navigator)d(t.audioConstraints,t.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,M=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(M=j.id)});var b=w(t.audioConstraints);b&&(m=b);var f=w(t.videoConstraints);f&&(M=f),d(c(m),c(M))})}},h.prototype.handleUserMedia=function(i,t){var d=this.props;if(i||!t){this.setState({hasUserMedia:!1}),d.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}d.onUserMedia(t)},h.prototype.render=function(){var i=this,t=this,d=t.state,c=t.props,w=c.audio;c.forceScreenshotSourceSize;var v=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var m=c.mirrored,M=c.style,b=M===void 0?{}:M,f=c.children,j=C(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?S(S({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",S({autoPlay:!0,disablePictureInPicture:v,src:d.src,muted:!w,playsInline:!0,ref:function(X){i.video=X},style:B},j)),f&&f(G))},h.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(a.Component);o.default=I},react:function(s,o){s.exports=e}}).default})}(T)),T.exports}var Fe=Pe();const Ee=Z(Fe),Re=({width:r})=>u.jsxs(k,{width:r,children:[u.jsx(O,{size:"threeXL",color:V.gray60,content:W}),u.jsxs(ve,{children:["This app would like to use your camera.",u.jsx(Se,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Oe=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:n,setFacingMode:a,testOverride:p})=>{const[S,C]=y.useState(p||"pending"),U=y.useRef(null),[I,g]=y.useState(l),h=y.useCallback(ee(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function i(){if(U.current!==null){const d=U.current.getScreenshot();r(d)}}const t=te();return u.jsxs(A,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!e&&!s?u.jsx(Re,{width:I}):re()&&u.jsx(Ie,{switchFacingMode:a}),u.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!e&&!s,width:I,children:!e&&u.jsx(Ee,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),u.jsx(H,{onClick:i,disabled:S!=="success"||e||s,children:"Take Photo"})]})},ke=y.memo(Oe),Te=150,ze=oe.getLogger("CameraInput");class Ve extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new pe,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=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(n=>setTimeout(n,o));return _e(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>s(Te)).then(()=>{this.setState((o,n)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ze.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:n}=this.props,a=o.getFileUploaderStateValue(s);ne(e,a)||o.setFileUploaderStateValue(s,e,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:n}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},n)})},this.deleteFile=e=>{const s=this.getFile(e);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(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(n=>n.id===e?s:n)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const n=Math.round(e.loaded*100/e.total);o.status.progress!==n&&this.updateFile(s,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=_.CancelToken.source(),n=new L(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,a=>this.onUploadProgress(a,n.id),o.token).then(()=>this.onUploadComplete(n.id,e)).catch(a=>{_.isCancel(a)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:a?a.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:n}=o;return P(n)||n.length===0?l:{files:n.map(a=>{const p=a.name,S=a.size,C=a.fileId,U=a.fileUrls;return new L(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:n}=e;return new ae({fileId:n.fileId,fileUrls:n.fileUrls,name:s,size:o})});return new le({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),u.jsxs(A,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(ce,{label:l.label,disabled:s,labelVisibility:de(l.labelVisibility?.value),children:l.help&&u.jsx(he,{children:u.jsx(ue,{content:l.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(ye,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(be,{children:[u.jsx(O,{content:$,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(ke,{handleCapture:this.handleCapture,width:o,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 _e(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Le=se(Ve);export{Le as default};
|
|
1
|
+
import{r as y,E,_ as R,c as x,b1 as q,j as u,c2 as J,bJ as z,bX as Q,bF as Y,bY as O,cc as V,h as K,g as Z,bl as ee,ap as te,cd as re,ce as ie,cf as se,l as oe,b4 as ne,F as P,cg as _,bV as ae,bU as le,b$ as ce,c0 as de,ch as he,c1 as ue}from"./index-B2QqSXxG.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{F as pe}from"./FormClearHelper-BC4K9Zmh.js";import{P as ge,S as fe}from"./ProgressBar-B7cXo5Zk.js";var D=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{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"}))});D.displayName="SwitchCamera";var W=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{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"}))});W.displayName="Video";var $=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{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"}))});$.displayName="X";function me(r,l){switch(r){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 A=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=x("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ve=x("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ye=x("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=x("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),be=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=x("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=x("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(r.colors.primary,.5)}`},...me("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return u.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?u.jsx(Me,{children:u.jsx(ge,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const H=y.memo(Ce);var F=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(F||{});const xe=({switchFacingMode:r})=>u.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(J,{content:"Switch camera",placement:z.TOP_RIGHT,children:u.jsx(Q,{kind:Y.MINIMAL,onClick:r,children:u.jsx(O,{content:D,size:"twoXL",color:V.white})})})}),Ie=y.memo(xe);var T={exports:{}},je=T.exports,N;function Pe(){return N||(N=1,function(r,l){(function(e,s){r.exports=s(K())})(je,function(e){return function(s){var o={};function n(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return s[a].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=s,n.c=o,n.d=function(a,p,S){n.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:S})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,p){if(p&1&&(a=n(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var S=Object.create(null);if(n.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)n.d(S,C,(function(U){return a[U]}).bind(null,C));return S},n.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(p,"a",p),p},n.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,o,n){n.r(o);var a=n("react"),p=function(){var g=function(h,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var c in d)d.hasOwnProperty(c)&&(t[c]=d[c])},g(h,i)};return function(h,i){g(h,i);function t(){this.constructor=h}h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),S=function(){return S=Object.assign||function(g){for(var h,i=1,t=arguments.length;i<t;i++){h=arguments[i];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},C=function(g,h){var i={};for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&h.indexOf(t)<0&&(i[t]=g[t]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,t=Object.getOwnPropertySymbols(g);d<t.length;d++)h.indexOf(t[d])<0&&Object.prototype.propertyIsEnumerable.call(g,t[d])&&(i[t[d]]=g[t[d]]);return i};(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(i,t){h.call(navigator,g,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(h,g);function h(i){var t=g.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return h.prototype.componentDidMount=function(){var i=this,t=i.state,d=i.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(i){var t=this.props;if(!U()){t.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),c=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),w=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.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(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},h.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(h.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},h.prototype.getScreenshot=function(i){var t=this,d=t.state,c=t.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(i);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(i){var t=this,d=t.state,c=t.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 m=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/m,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||w,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,f=M.canvas;return b&&f&&(f.width=i?.width||f.width,f.height=i?.height||f.height,c.mirrored&&(b.translate(f.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,i?.width||f.width,i?.height||f.height),c.mirrored&&(b.scale(-1,1),b.translate(-f.width,0))),f},h.prototype.requestUserMedia=function(){var i=this,t=this.props,d=function(v,m){var M={video:typeof m<"u"?m:!0};t.audio&&(M.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var b=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){i.unmounted||b!==i.requestUserMediaId?h.stopMediaStream(f):i.handleUserMedia(null,f)}).catch(function(f){i.handleUserMedia(f)})};if("mediaDevices"in navigator)d(t.audioConstraints,t.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,M=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(M=j.id)});var b=w(t.audioConstraints);b&&(m=b);var f=w(t.videoConstraints);f&&(M=f),d(c(m),c(M))})}},h.prototype.handleUserMedia=function(i,t){var d=this.props;if(i||!t){this.setState({hasUserMedia:!1}),d.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}d.onUserMedia(t)},h.prototype.render=function(){var i=this,t=this,d=t.state,c=t.props,w=c.audio;c.forceScreenshotSourceSize;var v=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var m=c.mirrored,M=c.style,b=M===void 0?{}:M,f=c.children,j=C(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?S(S({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",S({autoPlay:!0,disablePictureInPicture:v,src:d.src,muted:!w,playsInline:!0,ref:function(X){i.video=X},style:B},j)),f&&f(G))},h.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(a.Component);o.default=I},react:function(s,o){s.exports=e}}).default})}(T)),T.exports}var Fe=Pe();const Ee=Z(Fe),Re=({width:r})=>u.jsxs(k,{width:r,children:[u.jsx(O,{size:"threeXL",color:V.gray60,content:W}),u.jsxs(ve,{children:["This app would like to use your camera.",u.jsx(Se,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Oe=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:n,setFacingMode:a,testOverride:p})=>{const[S,C]=y.useState(p||"pending"),U=y.useRef(null),[I,g]=y.useState(l),h=y.useCallback(ee(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function i(){if(U.current!==null){const d=U.current.getScreenshot();r(d)}}const t=te();return u.jsxs(A,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!e&&!s?u.jsx(Re,{width:I}):re()&&u.jsx(Ie,{switchFacingMode:a}),u.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!e&&!s,width:I,children:!e&&u.jsx(Ee,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),u.jsx(H,{onClick:i,disabled:S!=="success"||e||s,children:"Take Photo"})]})},ke=y.memo(Oe),Te=150,ze=oe.getLogger("CameraInput");class Ve extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new pe,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=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(n=>setTimeout(n,o));return _e(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>s(Te)).then(()=>{this.setState((o,n)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ze.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:n}=this.props,a=o.getFileUploaderStateValue(s);ne(e,a)||o.setFileUploaderStateValue(s,e,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:n}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},n)})},this.deleteFile=e=>{const s=this.getFile(e);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(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(n=>n.id===e?s:n)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const n=Math.round(e.loaded*100/e.total);o.status.progress!==n&&this.updateFile(s,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=_.CancelToken.source(),n=new L(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,a=>this.onUploadProgress(a,n.id),o.token).then(()=>this.onUploadComplete(n.id,e)).catch(a=>{_.isCancel(a)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:a?a.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:n}=o;return P(n)||n.length===0?l:{files:n.map(a=>{const p=a.name,S=a.size,C=a.fileId,U=a.fileUrls;return new L(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:n}=e;return new ae({fileId:n.fileId,fileUrls:n.fileUrls,name:s,size:o})});return new le({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),u.jsxs(A,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(ce,{label:l.label,disabled:s,labelVisibility:de(l.labelVisibility?.value),children:l.help&&u.jsx(he,{children:u.jsx(ue,{content:l.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(ye,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(be,{children:[u.jsx(O,{content:$,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(ke,{handleCapture:this.handleCapture,width:o,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 _e(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Le=se(Ve);export{Le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,ap as k,b8 as T,j as c,ck as y,cl as L,c0 as w,bc as C,c9 as S,c1 as $,bJ as R,b1 as W,cm as B}from"./index-
|
|
1
|
+
import{r as u,ap as k,b8 as T,j as c,ck as y,cl as L,c0 as w,bc as C,c9 as S,c1 as $,bJ as R,b1 as W,cm as B}from"./index-B2QqSXxG.js";import{a as v}from"./useBasicWidgetState-DVIC6bdr.js";import{S as j,L as X,a as p}from"./checkbox-vy_88iMk.js";import"./FormClearHelper-BC4K9Zmh.js";function H({element:e,disabled:a,widgetMgr:s,fragmentId:n}){const[f,g]=v({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:F,updateWidgetMgrState:P,element:e,widgetMgr:s,fragmentId:n}),x=u.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=k(),{colors:o,spacing:h,sizes:r}=t,b=T(t),m=a?o.fadedText40:o.bodyText;return c.jsx(y,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:c.jsx(j,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===B.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let d=b?o.bgColor:o.bodyText;return a&&(d=b?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:d,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:d})=>{let l=o.fadedText40;return d&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:d})=>{const l=d&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&d?`0 0 0 0.2rem ${W(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:m}}},children:c.jsxs(L,{visibility:w(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[c.jsx(C,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&c.jsx(S,{color:m,children:c.jsx($,{content:e.help,placement:R.TOP_RIGHT})})]})})})}function M(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function F(e){return e.value??null}function P(e,a,s,n){a.setBoolValue(e,s.value,{fromUi:s.fromUi},n)}const I=u.memo(H);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,r as t,H as i,j as o,bA as c,bB as l,F as d}from"./index-
|
|
1
|
+
import{c as r,r as t,H as i,j as o,bA as c,bB as l,F as d}from"./index-B2QqSXxG.js";const m=r("iframe",{target:"e1u6k47s0"})(({theme:e,disableScrolling:n})=>({width:"100%",colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,overflow:n?"hidden":void 0}),"");function s(e){return d(e)||e===""?void 0:e}function g({element:e}){const n=s(e.src),a=i(n)?void 0:s(e.srcdoc);return o.jsx(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!e.scrolling,src:n,srcDoc:a,height:e.height,scrolling:e.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:e.tabIndex??void 0})}const b=t.memo(g);export{b as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b1 as pN,c as mN,aq as se,bh as gN,bi as yN,bj as Xs,bk as hd,G as vN,ap as bN,r as Ne,F as vg,ao as xN,ak as _N,ag as WA,ah as HA,O as wN,bl as AN,H as GA,b4 as XA,l as VA,bd as kN,bm as EN,j as pd,bn as DN}from"./index-DCNLpqIv.js";import{w as CN,E as FN}from"./withFullScreenWrapper-C3PKUCi4.js";import{S as YA,T as SN}from"./Toolbar-DiWCQxr5.js";import{m as $N}from"./mergeWith-fWFIuGgc.js";import{a as Sl,n as MN,b as ON,c as md,t as Aa,p as TN,d as NN,e as BN,i as Fo,f as gd,g as JA,l as Vs,h as bg,j as yd,k as QA,m as So,o as Ys,q as zN,r as $o,s as RN,u as PN,v as LN,w as jN}from"./threshold-CqET7LYC.js";import{f as IN,a as xg,b as ZA,c as UN,R as vd,r as KA,d as _g,e as wg,C as Ag,g as tk,h as ek,i as bd,j as kg,n as Ve,k as $l,l as qN,m as WN,o as HN,p as GN,q as XN,s as VN,t as YN,u as JN,v as QN,w as ZN,x as KN,y as xd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Eg,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper-fvwQICEk.js";const lB=t=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:t.genericFonts.bodyFont,color:t.colors.bodyText,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,backgroundColor:pN(t.colors.bgColor,.05),fontSize:t.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:t.sizes.maxChartTooltipWidth,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,zIndex:t.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:t.spacing.none,marginBottom:t.spacing.sm,fontSize:t.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:t.spacing.threeXS,paddingBottom:t.spacing.threeXS},"td.key":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.4)`,textAlign:"right",color:t.colors.fadedText60,whiteSpace:"nowrap",paddingRight:t.spacing.twoXS},"td.value":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),cB=mN("div",{target:"egd2k5h0"})(({theme:t,useContainerWidth:e,isFullScreen:n})=>({width:e||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,zIndex:t.zIndices.popup,top:`calc(${t.iconSizes.md} + 2 * ${t.spacing.xs} + ${t.spacing.xs})`,right:0,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:t.radii.default,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:t.colors.darkenedBgMix15,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:t.spacing.xs,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix15},svg:{width:t.iconSizes.md,height:t.iconSizes.md}}}}),"");function nk(t,e){const n={font:e.genericFonts.bodyFont,background:e.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:e.colors.headingColor,titleFontStyle:"normal",fontWeight:e.fontWeights.bold,fontSize:se(e.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.md),titleColor:Xs(e),titleFontStyle:"normal",labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal"},axis:{labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal",titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.sm),titleColor:Xs(e),titleFontStyle:"normal",ticks:!1,gridColor:hd(e),domain:!1,domainWidth:1,domainColor:hd(e),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:se(e.spacing.lg),labelPadding:se(e.spacing.lg),labelSeparation:se(e.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:se(e.fontSizes.sm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),titleFontSize:se(e.fontSizes.sm),titleFontWeight:e.fontWeights.normal,titleFontStyle:"normal",titleColor:Xs(e),titlePadding:5,labelPadding:se(e.spacing.lg),columnPadding:se(e.spacing.sm),rowPadding:se(e.spacing.twoXS),padding:7,symbolStrokeWidth:se(e.spacing.twoXS)},range:{category:e.colors.chartCategoricalColors,diverging:yN(e),ramp:e.colors.chartSequentialColors,heatmap:e.colors.chartSequentialColors},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:gN(e)},bar:{binSpacing:se(e.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return t?$N({},n,t,(r,i)=>Array.isArray(i)?i:void 0):n}function fB(t,e){const{colors:n,fontSizes:r,genericFonts:i}=e,o={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:se(r.twoSm),titleFontSize:se(r.twoSm)},a={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:hd(e),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:hd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?vN({},a,t):a}const dB=20;function hB(t){"params"in t&&"encoding"in t&&t.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&vg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{const u=JSON.parse(t);if(n==="streamlit"?u.config=nk(u.config,i):u.usermeta?.embedOptions?.theme==="streamlit"?(u.config=nk(u.config,i),u.usermeta.embedOptions.theme=void 0):u.config=fB(u.config,i),u.title&&(typeof u.title=="string"&&(u.title={text:u.title}),u.title.limit=u.title.limit??Math.max(a-40,0)),o?(u.width=a,u.height=s,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})):e&&(u.width=a,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})),u.padding||(u.padding={}),vg(u.padding.bottom)&&(u.padding.bottom=dB),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(u),u},mB=(t,e,n,r)=>{const i=bN(),{id:o,formId:a,spec:s,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=t,h=Ne.useMemo(()=>d,[JSON.stringify(d)]),p=Ne.useMemo(()=>pB(s,c,f,h,i,e,n||0,r),[s,c,f,h,i,e,n,r]);return{id:o,formId:a,vegaLiteTheme:f,spec:p,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function Pi(t,e,n){return t.fields=e||[],t.fname=n,t}function gB(t){return t==null?null:t.fname}function rk(t){return t==null?null:t.fields}function ik(t){return t.length===1?yB(t[0]):vB(t)}const yB=t=>function(e){return e[t]},vB=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function _d(t){throw Error(t)}function Dg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||_d("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&_d("Access path missing closing bracket: "+t),r&&_d("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function Cg(t,e,n){const r=Dg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||ik)(r),[t],e||t)}const bB=Cg("id"),Fg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),ok=Pi(()=>!0,[],"true"),wB=Pi(()=>!1,[],"false");function AB(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const ak=0,sk=1,uk=2,lk=3,ck=4;function kB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||ak;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=sk&&n(e||"error","ERROR",arguments),this},warn(){return r>=uk&&n(e||"warn","WARN",arguments),this},info(){return r>=lk&&n(e||"log","INFO",arguments),this},debug(){return r>=ck&&n(e||"log","DEBUG",arguments),this}}}var wd=Array.isArray;function ka(t){return t===Object(t)}const fk=t=>t!=="__proto__";function Sg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=EB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;Ad(r,o,i[o],a)}return r},{})}function Ad(t,e,n,r){if(!fk(e))return;let i,o;if(ka(n)&&!wd(n)){o=ka(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?Ad(o,i,n[i]):fk(i)&&(o[i]=n[i])}else t[e]=n}function EB(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Js(t){return t[t.length-1]}function $g(t){return t==null||t===""?null:+t}const dk=t=>e=>t*Math.exp(e),hk=t=>e=>Math.log(t*e),pk=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,kd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Ed(t,e,n,r){const i=n(t[0]),o=n(Js(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function DB(t,e){return Ed(t,e,$g,Fg)}function CB(t,e){var n=Math.sign(t[0]);return Ed(t,e,hk(n),dk(n))}function FB(t,e,n){return Ed(t,e,kd(n),kd(1/n))}function SB(t,e,n){return Ed(t,e,pk(n),mk(n))}function Dd(t,e,n,r,i){const o=r(t[0]),a=r(Js(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function $B(t,e,n){return Dd(t,e,n,$g,Fg)}function MB(t,e,n){const r=Math.sign(t[0]);return Dd(t,e,n,hk(r),dk(r))}function OB(t,e,n,r){return Dd(t,e,n,kd(r),kd(1/r))}function TB(t,e,n,r){return Dd(t,e,n,pk(r),mk(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Ml(t){return t!=null?wd(t)?t:[t]:[]}function zB(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function Cd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=Ml(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return Ml(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Cd(s)?s:Cg(s,null,n)),(rk(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Mg=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),LB=(t,e)=>t.length===1?jB(t[0],e[0]):IB(t,e,t.length),jB=(t,e)=>function(n,r){return Mg(t(n),t(r))*e},IB=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Mg(o(r),o(i));return a*e[s]});function UB(t){return Cd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function Og(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function WB(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function HB(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}const GB=Object.prototype.hasOwnProperty;function Li(t,e){return GB.call(t,e)}const Fd={};function XB(t){let e={},n;function r(o){return Li(e,o)&&e[o]!==Fd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Fd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Fd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Fd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function VB(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Js(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function YB(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),Og(r,n)}function JB(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function gk(t){return typeof t=="boolean"}function yk(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Cd(t[Symbol.iterator])}function vk(t){return typeof t=="number"}function ZB(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ji(t){return typeof t=="string"}function KB(t,e,n){t&&(t=e?Ml(t).map(s=>s.replace(/\\(.)/g,"$1")):Ml(t));const r=t&&t.length,i=n&&n.get||ik,o=s=>i(e?[s]:Dg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Pi(a,t,"key")}function tz(t,e){const n=t[0],r=Js(t),i=+e;return i?i===1?r:n+i*(r-n):n}const ez=1e4;function nz(t){t=+t||ez;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>Li(e,a)||Li(n,a),get:a=>Li(e,a)?e[a]:Li(n,a)?o(a,n[a]):void 0,set:(a,s)=>Li(e,a)?e[a]=s:o(a,s)}}function rz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Ol(t,e){let n="";for(;--e>=0;)n+=t;return n}function iz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Ol(i,a)+o:r==="center"?Ol(i,~~(a/2))+o+Ol(i,Math.ceil(a/2)):o+Ol(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return wd(t)?"["+t.map(Qs)+"]":ka(t)||ji(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function az(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const sz=t=>vk(t)||yk(t)?t:Date.parse(t);function uz(t,e){return e=e||sz,t==null||t===""?null:e(t)}function lz(t){return t==null||t===""?null:t+""}function cz(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function fz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function dz(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}function Wn(t,e,n){return t.fields=e||[],t.fname=n,t}function ue(t){return t==null?null:t.fname}function un(t){return t==null?null:t.fields}function bk(t){return t.length===1?hz(t[0]):pz(t)}const hz=t=>function(e){return e[t]},pz=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function R(t){throw Error(t)}function Tg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||R("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&R("Access path missing closing bracket: "+t),r&&R("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function wr(t,e,n){const r=Tg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||bk)(r),[t],e||t)}const Sd=wr("id"),Fn=Wn(t=>t,[],"identity"),Ea=Wn(()=>0,[],"zero"),Tl=Wn(()=>1,[],"one"),Ar=Wn(()=>!0,[],"true"),Da=Wn(()=>!1,[],"false");function mz(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const gz=0,xk=1,yz=2,vz=3,bz=4;function xz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mz,r=t||gz;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=xk&&n("error","ERROR",arguments),this},warn(){return r>=yz&&n("warn","WARN",arguments),this},info(){return r>=vz&&n("log","INFO",arguments),this},debug(){return r>=bz&&n("log","DEBUG",arguments),this}}}var K=Array.isArray;function mt(t){return t===Object(t)}const _k=t=>t!=="__proto__";function _z(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=wz(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wk(r,o,i[o],a)}return r},{})}function wk(t,e,n,r){if(!_k(e))return;let i,o;if(mt(n)&&!K(n)){o=mt(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wk(o,i,n[i]):_k(i)&&(o[i]=n[i])}else t[e]=n}function wz(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Et(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const Ak=t=>e=>t*Math.exp(e),kk=t=>e=>Math.log(t*e),Ek=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),Dk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,$d=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Md(t,e,n,r){const i=n(t[0]),o=n(Et(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return Md(t,e,ln,Fn)}function kz(t,e){var n=Math.sign(t[0]);return Md(t,e,kk(n),Ak(n))}function Ez(t,e,n){return Md(t,e,$d(n),$d(1/n))}function Dz(t,e,n){return Md(t,e,Ek(n),Dk(n))}function Od(t,e,n,r,i){const o=r(t[0]),a=r(Et(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ck(t,e,n){return Od(t,e,n,ln,Fn)}function Fk(t,e,n){const r=Math.sign(t[0]);return Od(t,e,n,kk(r),Ak(r))}function Ng(t,e,n,r){return Od(t,e,n,$d(r),$d(1/r))}function Sk(t,e,n,r){return Od(t,e,n,Ek(r),Dk(r))}function Cz(t){return 1+~~(new Date(t).getMonth()/3)}function Fz(t){return 1+~~(new Date(t).getUTCMonth()/3)}function rt(t){return t!=null?K(t)?t:[t]:[]}function Sz(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function gt(t){return typeof t=="function"}const $z="descending";function $k(t,e,n){n=n||{},e=rt(e)||[];const r=[],i=[],o={},a=n.comparator||Mz;return rt(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===$z?-1:1),i.push(s=gt(s)?s:wr(s,null,n)),(un(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Wn(a(i,r),Object.keys(o))}const Td=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),Mz=(t,e)=>t.length===1?Oz(t[0],e[0]):Tz(t,e,t.length),Oz=(t,e)=>function(n,r){return Td(t(n),t(r))*e},Tz=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Td(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function Mk(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function yt(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function Ii(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function Nz(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}function lt(t,e){return Object.hasOwn(t,e)}const Nd={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Nd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Nd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Nd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Nd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function Bz(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Et(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function H(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),yt(r,n)}function Bl(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function zz(t){return typeof t=="boolean"}function Ca(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&>(t[Symbol.iterator])}function Fa(t){return typeof t=="number"}function Ok(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function Tk(t,e,n){t&&(t=e?rt(t).map(s=>s.replace(/\\(.)/g,"$1")):rt(t));const r=t&&t.length,i=n&&n.get||bk,o=s=>i(e?[s]:Tg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Wn(a,t,"key")}function Pz(t,e){const n=t[0],r=Et(t),i=+e;return i?i===1?r:n+i*(r-n):n}const Lz=1e4;function jz(t){t=+t||Lz;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>lt(e,a)||lt(n,a),get:a=>lt(e,a)?e[a]:lt(n,a)?o(a,n[a]):void 0,set:(a,s)=>lt(e,a)?e[a]=s:o(a,s)}}function Iz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Bd(t,e){let n="";for(;--e>=0;)n+=t;return n}function Uz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Bd(i,a)+o:r==="center"?Bd(i,~~(a/2))+o+Bd(i,Math.ceil(a/2)):o+Bd(i,a)}function zd(t){return t&&Et(t)-t[0]||0}function it(t){return K(t)?"["+t.map(it)+"]":mt(t)||Xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Nk(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Fa(t)||Ca(t)?t:Date.parse(t);function Bk(t,e){return e=e||qz,t==null||t===""?null:e(t)}function zk(t){return t==null||t===""?null:t+""}function ti(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Wz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Sa(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}var Rk={},Bg={},zg=34,zl=10,Rg=13;function Pk(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=Pk(t);return function(r,i){return e(n(r),i,t)}}function Lk(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function Sn(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Gz(t){return t<0?"-"+Sn(-t,6):t>9999?"+"+Sn(t,6):Sn(t,4)}function Xz(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":Gz(t.getUTCFullYear())+"-"+Sn(t.getUTCMonth()+1,2)+"-"+Sn(t.getUTCDate(),2)+(i?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"."+Sn(i,3)+"Z":r?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"Z":n||e?"T"+Sn(e,2)+":"+Sn(n,2)+"Z":"")}function Vz(t){var e=new RegExp('["'+t+`
|
|
1
|
+
import{b1 as pN,c as mN,aq as se,bh as gN,bi as yN,bj as Xs,bk as hd,G as vN,ap as bN,r as Ne,F as vg,ao as xN,ak as _N,ag as WA,ah as HA,O as wN,bl as AN,H as GA,b4 as XA,l as VA,bd as kN,bm as EN,j as pd,bn as DN}from"./index-B2QqSXxG.js";import{w as CN,E as FN}from"./withFullScreenWrapper-CQbXKdaQ.js";import{S as YA,T as SN}from"./Toolbar-CF99-ktZ.js";import{m as $N}from"./mergeWith-DB-_2-Rw.js";import{a as Sl,n as MN,b as ON,c as md,t as Aa,p as TN,d as NN,e as BN,i as Fo,f as gd,g as JA,l as Vs,h as bg,j as yd,k as QA,m as So,o as Ys,q as zN,r as $o,s as RN,u as PN,v as LN,w as jN}from"./threshold-CqET7LYC.js";import{f as IN,a as xg,b as ZA,c as UN,R as vd,r as KA,d as _g,e as wg,C as Ag,g as tk,h as ek,i as bd,j as kg,n as Ve,k as $l,l as qN,m as WN,o as HN,p as GN,q as XN,s as VN,t as YN,u as JN,v as QN,w as ZN,x as KN,y as xd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Eg,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper-BC4K9Zmh.js";const lB=t=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:t.genericFonts.bodyFont,color:t.colors.bodyText,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,backgroundColor:pN(t.colors.bgColor,.05),fontSize:t.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:t.sizes.maxChartTooltipWidth,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,zIndex:t.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:t.spacing.none,marginBottom:t.spacing.sm,fontSize:t.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:t.spacing.threeXS,paddingBottom:t.spacing.threeXS},"td.key":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.4)`,textAlign:"right",color:t.colors.fadedText60,whiteSpace:"nowrap",paddingRight:t.spacing.twoXS},"td.value":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),cB=mN("div",{target:"egd2k5h0"})(({theme:t,useContainerWidth:e,isFullScreen:n})=>({width:e||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,zIndex:t.zIndices.popup,top:`calc(${t.iconSizes.md} + 2 * ${t.spacing.xs} + ${t.spacing.xs})`,right:0,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:t.radii.default,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:t.colors.darkenedBgMix15,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:t.spacing.xs,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix15},svg:{width:t.iconSizes.md,height:t.iconSizes.md}}}}),"");function nk(t,e){const n={font:e.genericFonts.bodyFont,background:e.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:e.colors.headingColor,titleFontStyle:"normal",fontWeight:e.fontWeights.bold,fontSize:se(e.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.md),titleColor:Xs(e),titleFontStyle:"normal",labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal"},axis:{labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal",titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.sm),titleColor:Xs(e),titleFontStyle:"normal",ticks:!1,gridColor:hd(e),domain:!1,domainWidth:1,domainColor:hd(e),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:se(e.spacing.lg),labelPadding:se(e.spacing.lg),labelSeparation:se(e.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:se(e.fontSizes.sm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),titleFontSize:se(e.fontSizes.sm),titleFontWeight:e.fontWeights.normal,titleFontStyle:"normal",titleColor:Xs(e),titlePadding:5,labelPadding:se(e.spacing.lg),columnPadding:se(e.spacing.sm),rowPadding:se(e.spacing.twoXS),padding:7,symbolStrokeWidth:se(e.spacing.twoXS)},range:{category:e.colors.chartCategoricalColors,diverging:yN(e),ramp:e.colors.chartSequentialColors,heatmap:e.colors.chartSequentialColors},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:gN(e)},bar:{binSpacing:se(e.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return t?$N({},n,t,(r,i)=>Array.isArray(i)?i:void 0):n}function fB(t,e){const{colors:n,fontSizes:r,genericFonts:i}=e,o={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:se(r.twoSm),titleFontSize:se(r.twoSm)},a={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:hd(e),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:hd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?vN({},a,t):a}const dB=20;function hB(t){"params"in t&&"encoding"in t&&t.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&vg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{const u=JSON.parse(t);if(n==="streamlit"?u.config=nk(u.config,i):u.usermeta?.embedOptions?.theme==="streamlit"?(u.config=nk(u.config,i),u.usermeta.embedOptions.theme=void 0):u.config=fB(u.config,i),u.title&&(typeof u.title=="string"&&(u.title={text:u.title}),u.title.limit=u.title.limit??Math.max(a-40,0)),o?(u.width=a,u.height=s,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})):e&&(u.width=a,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})),u.padding||(u.padding={}),vg(u.padding.bottom)&&(u.padding.bottom=dB),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(u),u},mB=(t,e,n,r)=>{const i=bN(),{id:o,formId:a,spec:s,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=t,h=Ne.useMemo(()=>d,[JSON.stringify(d)]),p=Ne.useMemo(()=>pB(s,c,f,h,i,e,n||0,r),[s,c,f,h,i,e,n,r]);return{id:o,formId:a,vegaLiteTheme:f,spec:p,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function Pi(t,e,n){return t.fields=e||[],t.fname=n,t}function gB(t){return t==null?null:t.fname}function rk(t){return t==null?null:t.fields}function ik(t){return t.length===1?yB(t[0]):vB(t)}const yB=t=>function(e){return e[t]},vB=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function _d(t){throw Error(t)}function Dg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||_d("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&_d("Access path missing closing bracket: "+t),r&&_d("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function Cg(t,e,n){const r=Dg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||ik)(r),[t],e||t)}const bB=Cg("id"),Fg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),ok=Pi(()=>!0,[],"true"),wB=Pi(()=>!1,[],"false");function AB(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const ak=0,sk=1,uk=2,lk=3,ck=4;function kB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||ak;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=sk&&n(e||"error","ERROR",arguments),this},warn(){return r>=uk&&n(e||"warn","WARN",arguments),this},info(){return r>=lk&&n(e||"log","INFO",arguments),this},debug(){return r>=ck&&n(e||"log","DEBUG",arguments),this}}}var wd=Array.isArray;function ka(t){return t===Object(t)}const fk=t=>t!=="__proto__";function Sg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=EB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;Ad(r,o,i[o],a)}return r},{})}function Ad(t,e,n,r){if(!fk(e))return;let i,o;if(ka(n)&&!wd(n)){o=ka(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?Ad(o,i,n[i]):fk(i)&&(o[i]=n[i])}else t[e]=n}function EB(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Js(t){return t[t.length-1]}function $g(t){return t==null||t===""?null:+t}const dk=t=>e=>t*Math.exp(e),hk=t=>e=>Math.log(t*e),pk=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,kd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Ed(t,e,n,r){const i=n(t[0]),o=n(Js(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function DB(t,e){return Ed(t,e,$g,Fg)}function CB(t,e){var n=Math.sign(t[0]);return Ed(t,e,hk(n),dk(n))}function FB(t,e,n){return Ed(t,e,kd(n),kd(1/n))}function SB(t,e,n){return Ed(t,e,pk(n),mk(n))}function Dd(t,e,n,r,i){const o=r(t[0]),a=r(Js(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function $B(t,e,n){return Dd(t,e,n,$g,Fg)}function MB(t,e,n){const r=Math.sign(t[0]);return Dd(t,e,n,hk(r),dk(r))}function OB(t,e,n,r){return Dd(t,e,n,kd(r),kd(1/r))}function TB(t,e,n,r){return Dd(t,e,n,pk(r),mk(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Ml(t){return t!=null?wd(t)?t:[t]:[]}function zB(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function Cd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=Ml(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return Ml(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Cd(s)?s:Cg(s,null,n)),(rk(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Mg=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),LB=(t,e)=>t.length===1?jB(t[0],e[0]):IB(t,e,t.length),jB=(t,e)=>function(n,r){return Mg(t(n),t(r))*e},IB=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Mg(o(r),o(i));return a*e[s]});function UB(t){return Cd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function Og(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function WB(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function HB(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}const GB=Object.prototype.hasOwnProperty;function Li(t,e){return GB.call(t,e)}const Fd={};function XB(t){let e={},n;function r(o){return Li(e,o)&&e[o]!==Fd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Fd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Fd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Fd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function VB(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Js(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function YB(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),Og(r,n)}function JB(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function gk(t){return typeof t=="boolean"}function yk(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Cd(t[Symbol.iterator])}function vk(t){return typeof t=="number"}function ZB(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ji(t){return typeof t=="string"}function KB(t,e,n){t&&(t=e?Ml(t).map(s=>s.replace(/\\(.)/g,"$1")):Ml(t));const r=t&&t.length,i=n&&n.get||ik,o=s=>i(e?[s]:Dg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Pi(a,t,"key")}function tz(t,e){const n=t[0],r=Js(t),i=+e;return i?i===1?r:n+i*(r-n):n}const ez=1e4;function nz(t){t=+t||ez;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>Li(e,a)||Li(n,a),get:a=>Li(e,a)?e[a]:Li(n,a)?o(a,n[a]):void 0,set:(a,s)=>Li(e,a)?e[a]=s:o(a,s)}}function rz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Ol(t,e){let n="";for(;--e>=0;)n+=t;return n}function iz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Ol(i,a)+o:r==="center"?Ol(i,~~(a/2))+o+Ol(i,Math.ceil(a/2)):o+Ol(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return wd(t)?"["+t.map(Qs)+"]":ka(t)||ji(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function az(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const sz=t=>vk(t)||yk(t)?t:Date.parse(t);function uz(t,e){return e=e||sz,t==null||t===""?null:e(t)}function lz(t){return t==null||t===""?null:t+""}function cz(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function fz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function dz(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}function Wn(t,e,n){return t.fields=e||[],t.fname=n,t}function ue(t){return t==null?null:t.fname}function un(t){return t==null?null:t.fields}function bk(t){return t.length===1?hz(t[0]):pz(t)}const hz=t=>function(e){return e[t]},pz=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function R(t){throw Error(t)}function Tg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||R("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&R("Access path missing closing bracket: "+t),r&&R("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function wr(t,e,n){const r=Tg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||bk)(r),[t],e||t)}const Sd=wr("id"),Fn=Wn(t=>t,[],"identity"),Ea=Wn(()=>0,[],"zero"),Tl=Wn(()=>1,[],"one"),Ar=Wn(()=>!0,[],"true"),Da=Wn(()=>!1,[],"false");function mz(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const gz=0,xk=1,yz=2,vz=3,bz=4;function xz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mz,r=t||gz;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=xk&&n("error","ERROR",arguments),this},warn(){return r>=yz&&n("warn","WARN",arguments),this},info(){return r>=vz&&n("log","INFO",arguments),this},debug(){return r>=bz&&n("log","DEBUG",arguments),this}}}var K=Array.isArray;function mt(t){return t===Object(t)}const _k=t=>t!=="__proto__";function _z(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=wz(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wk(r,o,i[o],a)}return r},{})}function wk(t,e,n,r){if(!_k(e))return;let i,o;if(mt(n)&&!K(n)){o=mt(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wk(o,i,n[i]):_k(i)&&(o[i]=n[i])}else t[e]=n}function wz(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Et(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const Ak=t=>e=>t*Math.exp(e),kk=t=>e=>Math.log(t*e),Ek=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),Dk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,$d=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Md(t,e,n,r){const i=n(t[0]),o=n(Et(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return Md(t,e,ln,Fn)}function kz(t,e){var n=Math.sign(t[0]);return Md(t,e,kk(n),Ak(n))}function Ez(t,e,n){return Md(t,e,$d(n),$d(1/n))}function Dz(t,e,n){return Md(t,e,Ek(n),Dk(n))}function Od(t,e,n,r,i){const o=r(t[0]),a=r(Et(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ck(t,e,n){return Od(t,e,n,ln,Fn)}function Fk(t,e,n){const r=Math.sign(t[0]);return Od(t,e,n,kk(r),Ak(r))}function Ng(t,e,n,r){return Od(t,e,n,$d(r),$d(1/r))}function Sk(t,e,n,r){return Od(t,e,n,Ek(r),Dk(r))}function Cz(t){return 1+~~(new Date(t).getMonth()/3)}function Fz(t){return 1+~~(new Date(t).getUTCMonth()/3)}function rt(t){return t!=null?K(t)?t:[t]:[]}function Sz(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function gt(t){return typeof t=="function"}const $z="descending";function $k(t,e,n){n=n||{},e=rt(e)||[];const r=[],i=[],o={},a=n.comparator||Mz;return rt(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===$z?-1:1),i.push(s=gt(s)?s:wr(s,null,n)),(un(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Wn(a(i,r),Object.keys(o))}const Td=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),Mz=(t,e)=>t.length===1?Oz(t[0],e[0]):Tz(t,e,t.length),Oz=(t,e)=>function(n,r){return Td(t(n),t(r))*e},Tz=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Td(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function Mk(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function yt(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function Ii(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function Nz(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}function lt(t,e){return Object.hasOwn(t,e)}const Nd={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Nd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Nd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Nd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Nd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function Bz(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Et(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function H(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),yt(r,n)}function Bl(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function zz(t){return typeof t=="boolean"}function Ca(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&>(t[Symbol.iterator])}function Fa(t){return typeof t=="number"}function Ok(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function Tk(t,e,n){t&&(t=e?rt(t).map(s=>s.replace(/\\(.)/g,"$1")):rt(t));const r=t&&t.length,i=n&&n.get||bk,o=s=>i(e?[s]:Tg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Wn(a,t,"key")}function Pz(t,e){const n=t[0],r=Et(t),i=+e;return i?i===1?r:n+i*(r-n):n}const Lz=1e4;function jz(t){t=+t||Lz;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>lt(e,a)||lt(n,a),get:a=>lt(e,a)?e[a]:lt(n,a)?o(a,n[a]):void 0,set:(a,s)=>lt(e,a)?e[a]=s:o(a,s)}}function Iz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Bd(t,e){let n="";for(;--e>=0;)n+=t;return n}function Uz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Bd(i,a)+o:r==="center"?Bd(i,~~(a/2))+o+Bd(i,Math.ceil(a/2)):o+Bd(i,a)}function zd(t){return t&&Et(t)-t[0]||0}function it(t){return K(t)?"["+t.map(it)+"]":mt(t)||Xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Nk(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Fa(t)||Ca(t)?t:Date.parse(t);function Bk(t,e){return e=e||qz,t==null||t===""?null:e(t)}function zk(t){return t==null||t===""?null:t+""}function ti(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Wz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Sa(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}var Rk={},Bg={},zg=34,zl=10,Rg=13;function Pk(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=Pk(t);return function(r,i){return e(n(r),i,t)}}function Lk(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function Sn(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Gz(t){return t<0?"-"+Sn(-t,6):t>9999?"+"+Sn(t,6):Sn(t,4)}function Xz(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":Gz(t.getUTCFullYear())+"-"+Sn(t.getUTCMonth()+1,2)+"-"+Sn(t.getUTCDate(),2)+(i?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"."+Sn(i,3)+"Z":r?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"Z":n||e?"T"+Sn(e,2)+":"+Sn(n,2)+"Z":"")}function Vz(t){var e=new RegExp('["'+t+`
|
|
2
2
|
\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,m=i(f,function(g,y){if(h)return h(g,y-1);p=g,h=d?Hz(g,d):Pk(g)});return m.columns=p||[],m}function i(f,d){var h=[],p=f.length,m=0,g=0,y,v=p<=0,b=!1;f.charCodeAt(p-1)===zl&&--p,f.charCodeAt(p-1)===Rg&&--p;function x(){if(v)return Bg;if(b)return b=!1,Rk;var A,_=m,k;if(f.charCodeAt(_)===zg){for(;m++<p&&f.charCodeAt(m)!==zg||f.charCodeAt(++m)===zg;);return(A=m)>=p?v=!0:(k=f.charCodeAt(m++))===zl?b=!0:k===Rg&&(b=!0,f.charCodeAt(m)===zl&&++m),f.slice(_+1,A-1).replace(/""/g,'"')}for(;m<p;){if((k=f.charCodeAt(A=m++))===zl)b=!0;else if(k===Rg)b=!0,f.charCodeAt(m)===zl&&++m;else if(k!==n)continue;return f.slice(_,A)}return v=!0,f.slice(_,p)}for(;(y=x())!==Bg;){for(var w=[];y!==Rk&&y!==Bg;)w.push(y),y=x();d&&(w=d(w,g++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(t)})}function a(f,d){return d==null&&(d=Lk(f)),[d.map(c).join(t)].concat(o(f,d)).join(`
|
|
3
3
|
`)}function s(f,d){return d==null&&(d=Lk(f)),o(f,d).join(`
|
|
4
4
|
`)}function u(f){return f.map(l).join(`
|