@stlite/desktop 0.81.6 → 0.82.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.
Files changed (74) hide show
  1. package/build/assets/{FileDownload.esm-Bpf_IJaz.js → FileDownload.esm-Bzb3HjS9.js} +1 -1
  2. package/build/assets/{FileHelper-BEtUZCB8.js → FileHelper-BNpeYRlH.js} +1 -1
  3. package/build/assets/{FormClearHelper--a7FEpt-.js → FormClearHelper-DxeY-rII.js} +1 -1
  4. package/build/assets/{Hooks-2PqJRMDp.js → Hooks-BOkao1bO.js} +1 -1
  5. package/build/assets/{InputInstructions-GAhfSEnF.js → InputInstructions-DuxSO2sS.js} +1 -1
  6. package/build/assets/{ProgressBar-Col3VLE4.js → ProgressBar-xr2SnNK1.js} +1 -1
  7. package/build/assets/{RenderInPortalIfExists-qnP8SYNG.js → RenderInPortalIfExists-D-C7LcEp.js} +1 -1
  8. package/build/assets/{Toolbar-Ce_uRMJw.js → Toolbar-CJ0mD5An.js} +1 -1
  9. package/build/assets/{base-input-BHEia47e.js → base-input-NsRtpzFx.js} +1 -1
  10. package/build/assets/{checkbox-Cddx6i3F.js → checkbox-Dj0lswiB.js} +1 -1
  11. package/build/assets/{createSuper-RDzkTe3c.js → createSuper-Ipqc67nc.js} +1 -1
  12. package/build/assets/{data-grid-overlay-editor-D6T-ER_q.js → data-grid-overlay-editor-BDv7jlce.js} +1 -1
  13. package/build/assets/{downloader-DaEpMxPx.js → downloader-CaOAUbUF.js} +1 -1
  14. package/build/assets/{es6-CcuZyssh.js → es6-BZHzmZtr.js} +2 -2
  15. package/build/assets/{iframeResizer.contentWindow-DHS7Pu0i.js → iframeResizer.contentWindow-CHGlD-N9.js} +1 -1
  16. package/build/assets/{index-CyYl-5F4.js → index-7fVMC6lw.js} +1 -1
  17. package/build/assets/{index-DW287fpb.js → index-B-LSEdUZ.js} +1 -1
  18. package/build/assets/{index-C-2rT3oM.js → index-B-ykjfbX.js} +1 -1
  19. package/build/assets/{index-DHl89CCF.js → index-B4X2D_eW.js} +1 -1
  20. package/build/assets/{index-D07bwkWY.js → index-BTv0oYZW.js} +1 -1
  21. package/build/assets/{index-BXlqmLSw.js → index-BfXMsSNA.js} +5 -5
  22. package/build/assets/{index-7eIEqW6S.js → index-BtnOdn6v.js} +1 -1
  23. package/build/assets/{index-CreZOv_n.js → index-BwTtx5nh.js} +1 -1
  24. package/build/assets/{index-DpOOTQ4a.js → index-By6Q65Pf.js} +1 -1
  25. package/build/assets/{index-C7q_Bsxr.js → index-C7CxGGAJ.js} +1 -1
  26. package/build/assets/{index-LZMzKd6i.js → index-CA7xtrC9.js} +1 -1
  27. package/build/assets/{index-qnESYKH3.js → index-CHhIqZol.js} +1 -1
  28. package/build/assets/{index-qZBF_Zup.js → index-CRx6-P3W.js} +1 -1
  29. package/build/assets/{index-BWOzAKM3.js → index-CTC0h65f.js} +1 -1
  30. package/build/assets/{index-85lABG_-.js → index-CUa9G_2w.js} +1 -1
  31. package/build/assets/{index-LZAWp2JT.js → index-Ck_7L8T4.js} +1 -1
  32. package/build/assets/{index-BSeIgN9k.js → index-Cns8y39_.js} +1 -1
  33. package/build/assets/{index-vdtOYA7b.js → index-CnyprtY_.js} +1 -1
  34. package/build/assets/{index-DN8Z5yj8.js → index-CoJDuQ5Y.js} +1 -1
  35. package/build/assets/{index-Pc9U3GV3.js → index-Cp10Db30.js} +1 -1
  36. package/build/assets/{index-qBaGcpp3.js → index-Cyc3gr_v.js} +1 -1
  37. package/build/assets/{index-YQk3COsD.js → index-D1dbR74e.js} +1 -1
  38. package/build/assets/{index-C4IBAvYi.js → index-D9Fv1oGe.js} +1 -1
  39. package/build/assets/{index-BQjJjeMH.js → index-D9ZJ5ysG.js} +1 -1
  40. package/build/assets/{index-Oz9-OY6E.js → index-DJZ72tug.js} +1 -1
  41. package/build/assets/{index-C2JTCZRI.js → index-DMVOLuV0.js} +1 -1
  42. package/build/assets/{index-VB1U8aCl.js → index-DX_vgtQT.js} +1 -1
  43. package/build/assets/{index-CZyeXUIr.js → index-DbTxB5ik.js} +1 -1
  44. package/build/assets/{index-DF2Bv2Iu.js → index-DeRs-vXN.js} +1 -1
  45. package/build/assets/{index-ma8H1oet.js → index-DhYvQko1.js} +1 -1
  46. package/build/assets/{index-CngYL5q1.js → index-Dk-OPVLJ.js} +1 -1
  47. package/build/assets/{index-CunpKDCO.js → index-DrIrAYez.js} +1 -1
  48. package/build/assets/{index-CvsR1I3L.js → index-DvUGK7b6.js} +1 -1
  49. package/build/assets/{index-DcrwU5E6.js → index-GJHR2pBi.js} +1 -1
  50. package/build/assets/{index-NYCOzVlX.js → index-OxGwEg3m.js} +12 -12
  51. package/build/assets/{index-BimHN13b.js → index-SCb8nZ6H.js} +1 -1
  52. package/build/assets/{index-DDA7JyBJ.js → index-zPhSbuEH.js} +1 -1
  53. package/build/assets/{inherits-DMADb7u9.js → inherits-BbfuKc-R.js} +1 -1
  54. package/build/assets/{input-DdxVQNZ7.js → input-CkptI290.js} +1 -1
  55. package/build/assets/{memory-_2PWlQG6.js → memory-BDEJOdDh.js} +1 -1
  56. package/build/assets/{mergeWith-THRzgcPq.js → mergeWith-D2cULMN8.js} +1 -1
  57. package/build/assets/{number-overlay-editor-D5Yhw2y2.js → number-overlay-editor-cmVGLaYJ.js} +1 -1
  58. package/build/assets/{sandbox-D8Np0x1K.js → sandbox-VVt-VWM8.js} +1 -1
  59. package/build/assets/{slicedToArray-CiQSSrYz.js → slicedToArray-HZKHLTaA.js} +1 -1
  60. package/build/assets/{textarea-r4-zB_B9.js → textarea-Cy6EVtfz.js} +1 -1
  61. package/build/assets/{timepicker-Dz1EXIQj.js → timepicker-DQlSkM-Q.js} +1 -1
  62. package/build/assets/{uniqueId-C8rYCZew.js → uniqueId-Dka3DuQQ.js} +1 -1
  63. package/build/assets/{useBasicWidgetState-vUy8Wspy.js → useBasicWidgetState-Bm5AJWX7.js} +1 -1
  64. package/build/assets/{useOnInputChange-Cl7V3cFN.js → useOnInputChange-C3lvbUNp.js} +1 -1
  65. package/build/assets/{withFullScreenWrapper-D7Ouz6kJ.js → withFullScreenWrapper-CEJUxUJC.js} +1 -1
  66. package/build/assets/{worker-BlovaCIP.js → worker-eTai8nRu.js} +1 -1
  67. package/build/index.html +1 -1
  68. package/build/pyodide/pyodide-lock.json +1 -1
  69. package/build/pyodide/pyodide.asm.js +1 -1
  70. package/build/pyodide/pyodide.asm.wasm +0 -0
  71. package/build/pyodide/pyodide.mjs +3 -3
  72. package/build/pyodide/python_stdlib.zip +0 -0
  73. package/package.json +6 -6
  74. package/wheels/streamlit-1.44.1-cp312-none-any.whl +0 -0
@@ -1,4 +1,4 @@
1
- import{I as gN,c as yN,G as se,b8 as vN,b9 as qA,ba as bN,bb as xN,bc as Xs,bd as dd,M as _N,A as wN,r as Ne,L as gg,aq as AN,an as EN,aj as WA,ak as HA,W as kN,be as DN,N as GA,b3 as XA,l as VA,j as hd,bf as FN}from"./index-NYCOzVlX.js";import{S as YA,T as CN}from"./Toolbar-Ce_uRMJw.js";import{u as JA,E as QA,w as SN}from"./withFullScreenWrapper-D7Ouz6kJ.js";import{m as $N}from"./mergeWith-THRzgcPq.js";import{a as Cl,n as MN,b as ON,c as pd,t as Aa,p as TN,d as NN,e as BN,i as Co,f as md,g as ZA,l as Vs,h as yg,j as gd,k as KA,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 vg,b as tE,c as UN,R as yd,r as eE,d as bg,e as xg,C as _g,g as nE,h as rE,i as vd,j as wg,n as Ve,k as Sl,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 bd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Ag,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper--a7FEpt-.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:gN(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=yN("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 iE(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:dd(e),domain:!1,domainWidth:1,domainColor:dd(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:xN(e),diverging:bN(e),ramp:qA(e),heatmap:qA(e)},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:vN(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:dd(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:dd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?_N({},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)&&gg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{var u,l;const c=JSON.parse(t);if(n==="streamlit"?c.config=iE(c.config,i):((l=(u=c.usermeta)==null?void 0:u.embedOptions)==null?void 0:l.theme)==="streamlit"?(c.config=iE(c.config,i),c.usermeta.embedOptions.theme=void 0):c.config=fB(c.config,i),o?(c.width=a,c.height=s,"vconcat"in c&&c.vconcat.forEach(f=>{f.width=a})):e&&(c.width=a,"vconcat"in c&&c.vconcat.forEach(f=>{f.width=a})),c.padding||(c.padding={}),gg(c.padding.bottom)&&(c.padding.bottom=dB),c.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(c),c},mB=t=>{const e=wN(),{expanded:n,width:r,height:i}=JA(QA),{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,e,n,r||0,i),[s,c,f,h,e,n,r,i]);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 oE(t){return t==null?null:t.fields}function aE(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 xd(t){throw Error(t)}function Eg(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||xd("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&xd("Access path missing closing bracket: "+t),r&&xd("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function kg(t,e,n){const r=Eg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||aE)(r),[t],e||t)}const bB=kg("id"),Dg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),sE=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 uE=0,lE=1,cE=2,fE=3,dE=4;function EB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||uE;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=lE&&n(e||"error","ERROR",arguments),this},warn(){return r>=cE&&n(e||"warn","WARN",arguments),this},info(){return r>=fE&&n(e||"log","INFO",arguments),this},debug(){return r>=dE&&n(e||"log","DEBUG",arguments),this}}}var _d=Array.isArray;function Ea(t){return t===Object(t)}const hE=t=>t!=="__proto__";function Fg(){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=kB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wd(r,o,i[o],a)}return r},{})}function wd(t,e,n,r){if(!hE(e))return;let i,o;if(Ea(n)&&!_d(n)){o=Ea(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wd(o,i,n[i]):hE(i)&&(o[i]=n[i])}else t[e]=n}function kB(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 Cg(t){return t==null||t===""?null:+t}const pE=t=>e=>t*Math.exp(e),mE=t=>e=>Math.log(t*e),gE=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),yE=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,Ad=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,Cg,Dg)}function FB(t,e){var n=Math.sign(t[0]);return Ed(t,e,mE(n),pE(n))}function CB(t,e,n){return Ed(t,e,Ad(n),Ad(1/n))}function SB(t,e,n){return Ed(t,e,gE(n),yE(n))}function kd(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 kd(t,e,n,Cg,Dg)}function MB(t,e,n){const r=Math.sign(t[0]);return kd(t,e,n,mE(r),pE(r))}function OB(t,e,n,r){return kd(t,e,n,Ad(r),Ad(1/r))}function TB(t,e,n,r){return kd(t,e,n,gE(r),yE(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function $l(t){return t!=null?_d(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 Dd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=$l(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return $l(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Dd(s)?s:kg(s,null,n)),(oE(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Sg=(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 Sg(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=Sg(o(r),o(i));return a*e[s]});function UB(t){return Dd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function $g(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}),$g(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 vE(t){return typeof t=="boolean"}function bE(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Dd(t[Symbol.iterator])}function xE(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?$l(t).map(s=>s.replace(/\\(.)/g,"$1")):$l(t));const r=t&&t.length,i=n&&n.get||aE,o=s=>i(e?[s]:Eg(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 Ml(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"?Ml(i,a)+o:r==="center"?Ml(i,~~(a/2))+o+Ml(i,Math.ceil(a/2)):o+Ml(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return _d(t)?"["+t.map(Qs)+"]":Ea(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=>xE(t)||bE(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 _E(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 Mg(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=Mg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||_E)(r),[t],e||t)}const Cd=wr("id"),Cn=Wn(t=>t,[],"identity"),ka=Wn(()=>0,[],"zero"),Ol=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,wE=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>=wE&&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 AE=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;EE(r,o,i[o],a)}return r},{})}function EE(t,e,n,r){if(!AE(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])?EE(o,i,n[i]):AE(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 kt(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const kE=t=>e=>t*Math.exp(e),DE=t=>e=>Math.log(t*e),FE=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),CE=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,Sd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function $d(t,e,n,r){const i=n(t[0]),o=n(kt(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return $d(t,e,ln,Cn)}function Ez(t,e){var n=Math.sign(t[0]);return $d(t,e,DE(n),kE(n))}function kz(t,e,n){return $d(t,e,Sd(n),Sd(1/n))}function Dz(t,e,n){return $d(t,e,FE(n),CE(n))}function Md(t,e,n,r,i){const o=r(t[0]),a=r(kt(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function SE(t,e,n){return Md(t,e,n,ln,Cn)}function $E(t,e,n){const r=Math.sign(t[0]);return Md(t,e,n,DE(r),kE(r))}function Og(t,e,n,r){return Md(t,e,n,Sd(r),Sd(1/r))}function ME(t,e,n,r){return Md(t,e,n,FE(r),CE(r))}function Fz(t){return 1+~~(new Date(t).getMonth()/3)}function Cz(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 OE(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 Tl=(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 Tl(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=Tl(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function TE(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 Od={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Od}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]===Od&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Od),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!==Od&&(!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=kt(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 Fa(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&&gt(t[Symbol.iterator])}function Ca(t){return typeof t=="number"}function NE(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function BE(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||_E,o=s=>i(e?[s]:Mg(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=kt(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 Td(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"?Td(i,a)+o:r==="center"?Td(i,~~(a/2))+o+Td(i,Math.ceil(a/2)):o+Td(i,a)}function Nd(t){return t&&kt(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 zE(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Ca(t)||Fa(t)?t:Date.parse(t);function RE(t,e){return e=e||qz,t==null||t===""?null:e(t)}function PE(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 LE={},Tg={},Ng=34,zl=10,Bg=13;function jE(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=jE(t);return function(r,i){return e(n(r),i,t)}}function IE(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{I as gN,c as yN,G as se,b8 as vN,b9 as qA,ba as bN,bb as xN,bc as Xs,bd as dd,M as _N,A as wN,r as Ne,L as gg,aq as AN,an as EN,aj as WA,ak as HA,W as kN,be as DN,N as GA,b3 as XA,l as VA,j as hd,bf as FN}from"./index-OxGwEg3m.js";import{S as YA,T as CN}from"./Toolbar-CJ0mD5An.js";import{u as JA,E as QA,w as SN}from"./withFullScreenWrapper-CEJUxUJC.js";import{m as $N}from"./mergeWith-D2cULMN8.js";import{a as Cl,n as MN,b as ON,c as pd,t as Aa,p as TN,d as NN,e as BN,i as Co,f as md,g as ZA,l as Vs,h as yg,j as gd,k as KA,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 vg,b as tE,c as UN,R as yd,r as eE,d as bg,e as xg,C as _g,g as nE,h as rE,i as vd,j as wg,n as Ve,k as Sl,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 bd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Ag,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper-DxeY-rII.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:gN(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=yN("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 iE(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:dd(e),domain:!1,domainWidth:1,domainColor:dd(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:xN(e),diverging:bN(e),ramp:qA(e),heatmap:qA(e)},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:vN(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:dd(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:dd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?_N({},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)&&gg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{var u,l;const c=JSON.parse(t);if(n==="streamlit"?c.config=iE(c.config,i):((l=(u=c.usermeta)==null?void 0:u.embedOptions)==null?void 0:l.theme)==="streamlit"?(c.config=iE(c.config,i),c.usermeta.embedOptions.theme=void 0):c.config=fB(c.config,i),o?(c.width=a,c.height=s,"vconcat"in c&&c.vconcat.forEach(f=>{f.width=a})):e&&(c.width=a,"vconcat"in c&&c.vconcat.forEach(f=>{f.width=a})),c.padding||(c.padding={}),gg(c.padding.bottom)&&(c.padding.bottom=dB),c.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(c),c},mB=t=>{const e=wN(),{expanded:n,width:r,height:i}=JA(QA),{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,e,n,r||0,i),[s,c,f,h,e,n,r,i]);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 oE(t){return t==null?null:t.fields}function aE(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 xd(t){throw Error(t)}function Eg(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||xd("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&xd("Access path missing closing bracket: "+t),r&&xd("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function kg(t,e,n){const r=Eg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||aE)(r),[t],e||t)}const bB=kg("id"),Dg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),sE=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 uE=0,lE=1,cE=2,fE=3,dE=4;function EB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||uE;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=lE&&n(e||"error","ERROR",arguments),this},warn(){return r>=cE&&n(e||"warn","WARN",arguments),this},info(){return r>=fE&&n(e||"log","INFO",arguments),this},debug(){return r>=dE&&n(e||"log","DEBUG",arguments),this}}}var _d=Array.isArray;function Ea(t){return t===Object(t)}const hE=t=>t!=="__proto__";function Fg(){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=kB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wd(r,o,i[o],a)}return r},{})}function wd(t,e,n,r){if(!hE(e))return;let i,o;if(Ea(n)&&!_d(n)){o=Ea(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wd(o,i,n[i]):hE(i)&&(o[i]=n[i])}else t[e]=n}function kB(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 Cg(t){return t==null||t===""?null:+t}const pE=t=>e=>t*Math.exp(e),mE=t=>e=>Math.log(t*e),gE=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),yE=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,Ad=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,Cg,Dg)}function FB(t,e){var n=Math.sign(t[0]);return Ed(t,e,mE(n),pE(n))}function CB(t,e,n){return Ed(t,e,Ad(n),Ad(1/n))}function SB(t,e,n){return Ed(t,e,gE(n),yE(n))}function kd(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 kd(t,e,n,Cg,Dg)}function MB(t,e,n){const r=Math.sign(t[0]);return kd(t,e,n,mE(r),pE(r))}function OB(t,e,n,r){return kd(t,e,n,Ad(r),Ad(1/r))}function TB(t,e,n,r){return kd(t,e,n,gE(r),yE(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function $l(t){return t!=null?_d(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 Dd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=$l(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return $l(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Dd(s)?s:kg(s,null,n)),(oE(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Sg=(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 Sg(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=Sg(o(r),o(i));return a*e[s]});function UB(t){return Dd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function $g(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}),$g(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 vE(t){return typeof t=="boolean"}function bE(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Dd(t[Symbol.iterator])}function xE(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?$l(t).map(s=>s.replace(/\\(.)/g,"$1")):$l(t));const r=t&&t.length,i=n&&n.get||aE,o=s=>i(e?[s]:Eg(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 Ml(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"?Ml(i,a)+o:r==="center"?Ml(i,~~(a/2))+o+Ml(i,Math.ceil(a/2)):o+Ml(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return _d(t)?"["+t.map(Qs)+"]":Ea(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=>xE(t)||bE(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 _E(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 Mg(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=Mg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||_E)(r),[t],e||t)}const Cd=wr("id"),Cn=Wn(t=>t,[],"identity"),ka=Wn(()=>0,[],"zero"),Ol=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,wE=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>=wE&&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 AE=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;EE(r,o,i[o],a)}return r},{})}function EE(t,e,n,r){if(!AE(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])?EE(o,i,n[i]):AE(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 kt(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const kE=t=>e=>t*Math.exp(e),DE=t=>e=>Math.log(t*e),FE=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),CE=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,Sd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function $d(t,e,n,r){const i=n(t[0]),o=n(kt(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return $d(t,e,ln,Cn)}function Ez(t,e){var n=Math.sign(t[0]);return $d(t,e,DE(n),kE(n))}function kz(t,e,n){return $d(t,e,Sd(n),Sd(1/n))}function Dz(t,e,n){return $d(t,e,FE(n),CE(n))}function Md(t,e,n,r,i){const o=r(t[0]),a=r(kt(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function SE(t,e,n){return Md(t,e,n,ln,Cn)}function $E(t,e,n){const r=Math.sign(t[0]);return Md(t,e,n,DE(r),kE(r))}function Og(t,e,n,r){return Md(t,e,n,Sd(r),Sd(1/r))}function ME(t,e,n,r){return Md(t,e,n,FE(r),CE(r))}function Fz(t){return 1+~~(new Date(t).getMonth()/3)}function Cz(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 OE(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 Tl=(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 Tl(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=Tl(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function TE(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 Od={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Od}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]===Od&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Od),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!==Od&&(!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=kt(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 Fa(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&&gt(t[Symbol.iterator])}function Ca(t){return typeof t=="number"}function NE(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function BE(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||_E,o=s=>i(e?[s]:Mg(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=kt(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 Td(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"?Td(i,a)+o:r==="center"?Td(i,~~(a/2))+o+Td(i,Math.ceil(a/2)):o+Td(i,a)}function Nd(t){return t&&kt(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 zE(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Ca(t)||Fa(t)?t:Date.parse(t);function RE(t,e){return e=e||qz,t==null||t===""?null:e(t)}function PE(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 LE={},Tg={},Ng=34,zl=10,Bg=13;function jE(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=jE(t);return function(r,i){return e(n(r),i,t)}}function IE(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):jE(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)===Bg&&--p;function x(){if(v)return Tg;if(b)return b=!1,LE;var A,_=m,E;if(f.charCodeAt(_)===Ng){for(;m++<p&&f.charCodeAt(m)!==Ng||f.charCodeAt(++m)===Ng;);return(A=m)>=p?v=!0:(E=f.charCodeAt(m++))===zl?b=!0:E===Bg&&(b=!0,f.charCodeAt(m)===zl&&++m),f.slice(_+1,A-1).replace(/""/g,'"')}for(;m<p;){if((E=f.charCodeAt(A=m++))===zl)b=!0;else if(E===Bg)b=!0,f.charCodeAt(m)===zl&&++m;else if(E!==n)continue;return f.slice(_,A)}return v=!0,f.slice(_,p)}for(;(y=x())!==Tg;){for(var w=[];y!==LE&&y!==Tg;)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=IE(f)),[d.map(c).join(t)].concat(o(f,d)).join(`
3
3
  `)}function s(f,d){return d==null&&(d=IE(f)),o(f,d).join(`
4
4
  `)}function u(f){return f.map(l).join(`
@@ -1 +1 @@
1
- import{c as w,r as l,A as C,cz as M,cA as W,j as n,bY as T,bZ as j,cb as k,b_ as A,bH as L,cy as B,cB as V,cu as $,cC as H,c8 as N}from"./index-NYCOzVlX.js";import{a as P}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";const O=w("div",{target:"e6zijwc0"})(({theme:i})=>({"span[aria-disabled='true']":{background:i.colors.fadedText05}}),""),E=(i,a)=>i.getIntArrayValue(a),F=i=>i.default??null,G=i=>i.value??null,U=(i,a,t,p)=>{a.setIntArrayValue(i,t.value,{fromUi:t.fromUi},p)},D=i=>{var a;const{element:t,widgetMgr:p,fragmentId:S}=i,e=C(),[r,m]=P({getStateFromWidgetMgr:E,getDefaultStateFromProto:F,getCurrStateFromProto:G,updateWidgetMgrState:U,element:t,widgetMgr:p,fragmentId:S}),u=t.maxSelections>0&&r.length>=t.maxSelections,f=l.useMemo(()=>{if(t.maxSelections===0)return"No results";if(r.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,r.length]),v=l.useMemo(()=>r.map(o=>{const s=t.options[o];return{value:o.toString(),label:s}}),[t.options,r]),h=l.useCallback(o=>{const s=()=>{var c;const g=(c=o.option)==null?void 0:c.value;return parseInt(g,10)};switch(o.type){case"remove":return M(r,s());case"clear":return[];case"select":return r.concat([s()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[r]),y=l.useCallback(o=>{t.maxSelections&&o.type==="select"&&r.length>=t.maxSelections||m({value:h(o),fromUi:!0})},[t.maxSelections,h,m,r.length]),x=l.useCallback((o,s)=>{if(u)return[];const c=o.filter(g=>!r.includes(Number(g.value)));return W(c,s)},[u,r]),{options:d}=t,b=d.length===0?!0:i.disabled,z=d.length===0?"No options to select.":t.placeholder,R=d.map((o,s)=>({label:o,value:s.toString()})),I=d.length>10;return n.jsxs("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n.jsx(T,{label:t.label,disabled:b,labelVisibility:j((a=t.labelVisibility)==null?void 0:a.value),children:t.help&&n.jsx(k,{children:n.jsx(A,{content:t.help,placement:L.TOP_RIGHT})})}),n.jsx(O,{children:n.jsx(B,{options:R,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:H.select,multi:!0,onChange:y,value:v,disabled:b,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:N.isMobile&&I===!1?"readonly":null}},Dropdown:{component:V}}})})]})},K=l.memo(D);export{K as default};
1
+ import{c as w,r as l,A as C,cz as M,cA as W,j as n,bY as T,bZ as j,cb as k,b_ as A,bH as L,cy as B,cB as V,cu as $,cC as H,c8 as N}from"./index-OxGwEg3m.js";import{a as P}from"./useBasicWidgetState-Bm5AJWX7.js";import"./FormClearHelper-DxeY-rII.js";const O=w("div",{target:"e6zijwc0"})(({theme:i})=>({"span[aria-disabled='true']":{background:i.colors.fadedText05}}),""),E=(i,a)=>i.getIntArrayValue(a),F=i=>i.default??null,G=i=>i.value??null,U=(i,a,t,p)=>{a.setIntArrayValue(i,t.value,{fromUi:t.fromUi},p)},D=i=>{var a;const{element:t,widgetMgr:p,fragmentId:S}=i,e=C(),[r,m]=P({getStateFromWidgetMgr:E,getDefaultStateFromProto:F,getCurrStateFromProto:G,updateWidgetMgrState:U,element:t,widgetMgr:p,fragmentId:S}),u=t.maxSelections>0&&r.length>=t.maxSelections,f=l.useMemo(()=>{if(t.maxSelections===0)return"No results";if(r.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,r.length]),v=l.useMemo(()=>r.map(o=>{const s=t.options[o];return{value:o.toString(),label:s}}),[t.options,r]),h=l.useCallback(o=>{const s=()=>{var c;const g=(c=o.option)==null?void 0:c.value;return parseInt(g,10)};switch(o.type){case"remove":return M(r,s());case"clear":return[];case"select":return r.concat([s()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[r]),y=l.useCallback(o=>{t.maxSelections&&o.type==="select"&&r.length>=t.maxSelections||m({value:h(o),fromUi:!0})},[t.maxSelections,h,m,r.length]),x=l.useCallback((o,s)=>{if(u)return[];const c=o.filter(g=>!r.includes(Number(g.value)));return W(c,s)},[u,r]),{options:d}=t,b=d.length===0?!0:i.disabled,z=d.length===0?"No options to select.":t.placeholder,R=d.map((o,s)=>({label:o,value:s.toString()})),I=d.length>10;return n.jsxs("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n.jsx(T,{label:t.label,disabled:b,labelVisibility:j((a=t.labelVisibility)==null?void 0:a.value),children:t.help&&n.jsx(k,{children:n.jsx(A,{content:t.help,placement:L.TOP_RIGHT})})}),n.jsx(O,{children:n.jsx(B,{options:R,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:H.select,multi:!0,onChange:y,value:v,disabled:b,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:N.isMobile&&I===!1?"readonly":null}},Dropdown:{component:V}}})})]})},K=l.memo(D);export{K as default};
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsxRuntimeExports}from"./index-NYCOzVlX.js";/*!
1
+ import{r as reactExports,j as jsxRuntimeExports}from"./index-OxGwEg3m.js";/*!
2
2
  * Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors
3
3
  * All rights reserved.
4
4
  *
@@ -1 +1 @@
1
- import{r as f,A as T,D as y,j as s,cf as L,cg as w,bZ as C,b5 as S,c4 as $,b_ as R,bH as W,I as v,ch as B}from"./index-NYCOzVlX.js";import{a as j}from"./useBasicWidgetState-vUy8Wspy.js";import{S as H,L as X,a as p}from"./checkbox-Cddx6i3F.js";import"./FormClearHelper--a7FEpt-.js";function M({element:e,disabled:a,widgetMgr:c,fragmentId:n}){var g;const[x,h]=j({getStateFromWidgetMgr:I,getDefaultStateFromProto:V,getCurrStateFromProto:F,updateWidgetMgrState:P,element:e,widgetMgr:c,fragmentId:n}),k=f.useCallback(i=>{h({value:i.target.checked,fromUi:!0})},[h]),t=T(),{colors:o,spacing:b,sizes:r}=t,m=y(t),u=a?o.fadedText40:o.bodyText;return s.jsx(L,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s.jsx(H,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===B.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:b.none,marginTop:b.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let d=m?o.bgColor:o.bodyText;return a&&(d=m?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 ${v(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:u}}},children:s.jsxs(w,{visibility:C((g=e.labelVisibility)==null?void 0:g.value),"data-testid":"stWidgetLabel",children:[s.jsx(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&s.jsx($,{color:u,children:s.jsx(R,{content:e.help,placement:W.TOP_RIGHT})})]})})})}function I(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function F(e){return e.value??null}function P(e,a,c,n){a.setBoolValue(e,c.value,{fromUi:c.fromUi},n)}const U=f.memo(M);export{U as default};
1
+ import{r as f,A as T,D as y,j as s,cf as L,cg as w,bZ as C,b5 as S,c4 as $,b_ as R,bH as W,I as v,ch as B}from"./index-OxGwEg3m.js";import{a as j}from"./useBasicWidgetState-Bm5AJWX7.js";import{S as H,L as X,a as p}from"./checkbox-Dj0lswiB.js";import"./FormClearHelper-DxeY-rII.js";function M({element:e,disabled:a,widgetMgr:c,fragmentId:n}){var g;const[x,h]=j({getStateFromWidgetMgr:I,getDefaultStateFromProto:V,getCurrStateFromProto:F,updateWidgetMgrState:P,element:e,widgetMgr:c,fragmentId:n}),k=f.useCallback(i=>{h({value:i.target.checked,fromUi:!0})},[h]),t=T(),{colors:o,spacing:b,sizes:r}=t,m=y(t),u=a?o.fadedText40:o.bodyText;return s.jsx(L,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s.jsx(H,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===B.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:b.none,marginTop:b.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let d=m?o.bgColor:o.bodyText;return a&&(d=m?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 ${v(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:u}}},children:s.jsxs(w,{visibility:C((g=e.labelVisibility)==null?void 0:g.value),"data-testid":"stWidgetLabel",children:[s.jsx(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&s.jsx($,{color:u,children:s.jsx(R,{content:e.help,placement:W.TOP_RIGHT})})]})})})}function I(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function F(e){return e.value??null}function P(e,a,c,n){a.setBoolValue(e,c.value,{fromUi:c.fromUi},n)}const U=f.memo(M);export{U as default};
@@ -1,2 +1,2 @@
1
- import{c0 as K,c1 as Y,r as f,c2 as q,A as J,c3 as l,j as h,bY as Q,bZ as Z,c4 as ee,b_ as te,bH as re,c5 as ne,bV as oe,bC as k,bB as U,bF as ie}from"./index-NYCOzVlX.js";import{a as ae}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";var ce={secondary:"secondary"},I={default:"default"},le={default:"default"},P=Object.freeze({radio:"radio",checkbox:"checkbox"}),T=K("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==I.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});T.displayName="StyledRoot",T.displayName="StyledRoot";function N(e){"@babel/helpers - typeof";return N=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},N(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(n){G(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function se(e,t){return ye(e)||de(e,t)||pe(e,t)||fe()}function fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{c0 as K,c1 as Y,r as f,c2 as q,A as J,c3 as l,j as h,bY as Q,bZ as Z,c4 as ee,b_ as te,bH as re,c5 as ne,bV as oe,bC as k,bB as U,bF as ie}from"./index-OxGwEg3m.js";import{a as ae}from"./useBasicWidgetState-Bm5AJWX7.js";import"./FormClearHelper-DxeY-rII.js";var ce={secondary:"secondary"},I={default:"default"},le={default:"default"},P=Object.freeze({radio:"radio",checkbox:"checkbox"}),T=K("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==I.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});T.displayName="StyledRoot",T.displayName="StyledRoot";function N(e){"@babel/helpers - typeof";return N=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},N(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(n){G(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function se(e,t){return ye(e)||de(e,t)||pe(e,t)||fe()}function fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pe(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function de(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,u;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,u=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw u}}return n}}function ye(e){if(Array.isArray(e))return e}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function he(e,t,r){return t&&me(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},B(e,t)}function Se(e){var t=Oe();return function(){var r=x(e),n;if(t){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ve(this,n)}}function ve(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oe(){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 x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(e)}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ee(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var W=function(e){ge(r,e);var t=Se(r);function r(){var n;be(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),G(F(n),"childRefs",{}),n}return he(r,[{key:"render",value:function(){var n=this,o=this.props,i=o.overrides,a=i===void 0?{}:i,u=o.mode,s=u===void 0?P.checkbox:u,b=o.children,d=o.selected,g=o.disabled,p=o.onClick,y=o.kind,S=o.shape,A=o.size,w=Y(a.Root,T),R=se(w,2),L=R[0],E=R[1],j=this.props["aria-label"]||this.props.ariaLabel,v=s===P.radio,$=f.Children.count(b);return f.createElement(q.Consumer,null,function(H){return f.createElement(L,z({"aria-label":j||H.buttongroup.ariaLabel,"data-baseweb":"button-group",role:v?"radiogroup":"group",$shape:S,$length:b.length},E),f.Children.map(b,function(m,C){if(!f.isValidElement(m))return null;var D=m.props.isSelected?m.props.isSelected:Ee(d,C);return v&&(n.childRefs[C]=f.createRef()),f.cloneElement(m,{disabled:g||m.props.disabled,isSelected:D,ref:v?n.childRefs[C]:void 0,tabIndex:!v||D||v&&(!d||d===-1)&&C===0?0:-1,onKeyDown:function(c){if(v){var O=Number(d)?Number(d):0;if(c.key==="ArrowUp"||c.key==="ArrowLeft"){c.preventDefault&&c.preventDefault();var _=O-1<0?$-1:O-1;p&&p(c,_),n.childRefs[_].current&&n.childRefs[_].current.focus()}if(c.key==="ArrowDown"||c.key==="ArrowRight"){c.preventDefault&&c.preventDefault();var M=O+1>$-1?0:O+1;p&&p(c,M),n.childRefs[M].current&&n.childRefs[M].current.focus()}}},kind:y,onClick:function(c){g||(m.props.onClick&&m.props.onClick(c),p&&p(c,C))},shape:S,size:A,overrides:ue({BaseButton:{style:function(c){var O=c.$theme;return b.length===1?{}:S!==I.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:v?"radio":"checkbox"}}},m.props.overrides)})}))})}}]),r}(f.Component);G(W,"defaultProps",{disabled:!1,onClick:function(){},shape:I.default,size:le.default,kind:ce.secondary});function we(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Le(e,t,r){return e==l.ClickMode.MULTI_SELECT?we(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function je(e){return e.length===0?-1:e[0]}function Ce(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function ke(e,t,r){const n=r===l.Style.PILLS?k.PILLS:r===l.Style.BORDERLESS?k.BORDERLESS_ICON:k.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?U.XSMALL:U.MEDIUM,i=n===k.PILLS||n===k.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:h.jsx(ie,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Re(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Pe(e,t){return e&&(t=`${t}Active`),t}function xe(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case l.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case l.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function Ae(e,t,r,n,o,i){const a=Re(r,n,o,t);let u=e.content,s=e.contentIcon;return a&&(u=e.selectedContent?e.selectedContent:u,s=e.selectedContentIcon?e.selectedContentIcon:s),f.forwardRef(function(b,d){const{element:g,kind:p,size:y}=ke(u??"",s??void 0,i),S=Pe(!!(a&&!e.selectedContent&&!e.selectedContentIcon),p);return h.jsx(oe,{...b,size:y,kind:S,children:g})})}function De(e,t){return e.getIntArrayValue(t)}function _e(e){return e.default??null}function Me(e){return e.value??null}function Ie(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:u,style:s,label:b,labelVisibility:d,help:g}=r,p=J(),[y,S]=ae({getStateFromWidgetMgr:De,getDefaultStateFromProto:_e,getCurrStateFromProto:Me,updateWidgetMgrState:Ce,element:r,widgetMgr:o,fragmentId:n}),A=(L,E)=>{const j=Le(i,E,y);S({value:j,fromUi:!0})};let w;i===l.ClickMode.SINGLE_SELECT?w=P.radio:i===l.ClickMode.MULTI_SELECT&&(w=P.checkbox);const R=f.useMemo(()=>a.map((L,E)=>{const j=Ae(L,E,u,i,y,s);return h.jsx(j,{},`${L.content}-${E}`)}),[i,a,u,s,y]);return h.jsxs("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[h.jsx(Q,{label:b,disabled:t,labelVisibility:Z((d==null?void 0:d.value)??ne.LabelVisibilityOptions.COLLAPSED),children:g&&h.jsx(ee,{children:h.jsx(te,{content:g,placement:re.TOP})})}),h.jsx(W,{disabled:t,mode:w,onClick:A,selected:i===l.ClickMode.MULTI_SELECT?y:je(y),overrides:{Root:{style:f.useCallback(()=>xe(s,p.spacing),[s,p.spacing])}},children:R})]})}const Te=f.memo(Ie);export{Te as default};
@@ -1,3 +1,3 @@
1
- import{c0 as w,ci as be,c1 as O,r as c,A as me,j as m,bY as ge,c4 as ye,b_ as ve,bH as we,b5 as te,bZ as Oe}from"./index-NYCOzVlX.js";import{a as Re}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";var re={vertical:"vertical",horizontal:"horizontal"};function oe(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 L(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?oe(Object(o),!0).forEach(function(r){R(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(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 P=0,x=1,E=2;function I(e){return e.$isActive?E:e.$isHovered?x:P}function ke(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(I(e)){case P:return t.tickFillErrorSelected;case x:return t.tickFillErrorSelectedHover;case E:return t.tickFillErrorSelectedHoverActive}else switch(I(e)){case P:return t.tickFillSelected;case x:return t.tickFillSelectedHover;case E:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function je(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(I(e)){case P:return t.tickFillError;case x:return t.tickFillErrorHover;case E:return t.tickFillErrorHoverActive}else switch(I(e)){case P:return t.tickFill;case x:return t.tickFillHover;case E:return t.tickFillActive}}function $e(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,a=i.scale300;return R({},"padding".concat(n),a)}function Se(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var H=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"}});H.displayName="RadioGroupRoot",H.displayName="RadioGroupRoot";var V=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",d=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(d),u?s.scale200:null),R(t,"marginBottom",r&&!u?null:s.scale200),t});V.displayName="Root",V.displayName="Root";var _=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:je(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});_.displayName="RadioMarkInner",_.displayName="RadioMarkInner";var N=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});N.displayName="RadioMarkOuter",N.displayName="RadioMarkOuter";var U=w("div",function(e){var t=e.$theme.typography;return L(L({verticalAlign:"middle"},$e(e)),{},{color:Se(e)},t.LabelMedium)});U.displayName="Label",U.displayName="Label";var q=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"});q.displayName="Input",q.displayName="Input";var G=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 L(L({},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))});G.displayName="Description",G.displayName="Description";function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function X(){return X=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},X.apply(this,arguments)}function Me(e,t){return Ee(e)||xe(e,t)||Pe(e,t)||Fe()}function Fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{c0 as w,ci as be,c1 as O,r as c,A as me,j as m,bY as ge,c4 as ye,b_ as ve,bH as we,b5 as te,bZ as Oe}from"./index-OxGwEg3m.js";import{a as Re}from"./useBasicWidgetState-Bm5AJWX7.js";import"./FormClearHelper-DxeY-rII.js";var re={vertical:"vertical",horizontal:"horizontal"};function oe(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 L(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?oe(Object(o),!0).forEach(function(r){R(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(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 P=0,x=1,E=2;function I(e){return e.$isActive?E:e.$isHovered?x:P}function ke(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(I(e)){case P:return t.tickFillErrorSelected;case x:return t.tickFillErrorSelectedHover;case E:return t.tickFillErrorSelectedHoverActive}else switch(I(e)){case P:return t.tickFillSelected;case x:return t.tickFillSelectedHover;case E:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function je(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(I(e)){case P:return t.tickFillError;case x:return t.tickFillErrorHover;case E:return t.tickFillErrorHoverActive}else switch(I(e)){case P:return t.tickFill;case x:return t.tickFillHover;case E:return t.tickFillActive}}function $e(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,a=i.scale300;return R({},"padding".concat(n),a)}function Se(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var H=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"}});H.displayName="RadioGroupRoot",H.displayName="RadioGroupRoot";var V=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",d=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(d),u?s.scale200:null),R(t,"marginBottom",r&&!u?null:s.scale200),t});V.displayName="Root",V.displayName="Root";var _=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:je(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});_.displayName="RadioMarkInner",_.displayName="RadioMarkInner";var N=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});N.displayName="RadioMarkOuter",N.displayName="RadioMarkOuter";var U=w("div",function(e){var t=e.$theme.typography;return L(L({verticalAlign:"middle"},$e(e)),{},{color:Se(e)},t.LabelMedium)});U.displayName="Label",U.displayName="Label";var q=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"});q.displayName="Input",q.displayName="Input";var G=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 L(L({},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))});G.displayName="Description",G.displayName="Description";function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function X(){return X=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},X.apply(this,arguments)}function Me(e,t){return Ee(e)||xe(e,t)||Pe(e,t)||Fe()}function Fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pe(e,t){if(e){if(typeof e=="string")return ne(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 ne(e,t)}}function ne(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function xe(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,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 Ee(e){if(Array.isArray(e))return e}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ce(e,t,o){return t&&Ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Te(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&&Y(e,t)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Y(e,t)}function Ae(e){var t=De();return function(){var o=T(e),r;if(t){var n=T(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Be(this,r)}}function Be(e,t){if(t&&(W(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function C(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(e)}function A(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ie=function(e){Te(o,e);var t=Ae(o);function o(){var r;Le(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)),A(C(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),A(C(r),"handleFocus",function(s,u){be(s)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:u}),r.props.onFocus&&r.props.onFocus(s)}),A(C(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 Ce(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,i=n===void 0?{}:n,a=O(i.RadioGroupRoot,H),s=Me(a,2),u=s[0],d=s[1];return c.createElement(u,X({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},d),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(f){return r.handleBlur(f,h)},onFocus:function(f){return r.handleFocus(f,h)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o}(c.Component);A(ie,"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 Z(e){"@babel/helpers - typeof";return Z=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},Z(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 $(e,t){return _e(e)||Ve(e,t)||He(e,t)||ze()}function ze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){if(e){if(typeof e=="string")return ae(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 ae(e,t)}}function ae(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 Ve(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 _e(e){if(Array.isArray(e))return e}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qe(e,t,o){return t&&Ue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},J(e,t)}function We(e){var t=Ye();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 Xe(this,r)}}function Xe(e,t){if(t&&(Z(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}function S(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(){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 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 Ze(e){return e==="top"||e==="left"}function Je(e){return e==="bottom"||e==="right"}var Ke=function(e){return e.stopPropagation()},se=function(e){Ge(o,e);var t=We(o);function o(){var r;Ne(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(S(r),"state",{isActive:!1,isHovered:!1}),M(S(r),"onMouseEnter",function(s){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(s)}),M(S(r),"onMouseLeave",function(s){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(s)}),M(S(r),"onMouseDown",function(s){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(s)}),M(S(r),"onMouseUp",function(s){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(s)}),r}return qe(o,[{key:"componentDidMount",value:function(){var r;this.props.autoFocus&&(r=this.props.inputRef)!==null&&r!==void 0&&r.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var r=this.props.overrides,n=r===void 0?{}:r,i=O(n.Root,V),a=$(i,2),s=a[0],u=a[1],d=O(n.Label,U),p=$(d,2),h=p[0],l=p[1],f=O(n.Input,q),F=$(f,2),D=F[0],k=F[1],z=O(n.Description,G),b=$(z,2),g=b[0],y=b[1],le=O(n.RadioMarkInner,_),K=$(le,2),ce=K[0],ue=K[1],pe=O(n.RadioMarkOuter,N),Q=$(pe,2),fe=Q[0],de=Q[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},ee=c.createElement(h,v({},j,l),this.props.containsInteractiveElement?c.createElement("div",{onClick:function(he){return he.preventDefault()}},this.props.children):this.props.children);return c.createElement(c.Fragment,null,c.createElement(s,v({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},j,u),Ze(this.props.labelPlacement)&&ee,c.createElement(fe,v({},j,de),c.createElement(ce,v({},j,ue))),c.createElement(D,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:Ke,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},j,k)),Je(this.props.labelPlacement)&&ee),!!this.props.description&&c.createElement(g,v({},j,y),this.props.description))}}]),o}(c.Component);M(se,"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 Qe({disabled:e,horizontal:t,value:o,onChange:r,options:n,captions:i,label:a,labelVisibility:s,help:u}){const[d,p]=c.useState(o??null);c.useEffect(()=>{o!==d&&p(o??null)},[o]);const h=c.useCallback(b=>{const g=parseInt(b.target.value,10);p(g),r(g)},[r]),l=me(),f=i.length>0,F=n.length>0,D=F?n:["No options to select."],k=e||!F,z=b=>b==""&&t&&f?"&nbsp;":b;return m.jsxs("div",{className:"stRadio","data-testid":"stRadio",children:[m.jsx(ge,{label:a,disabled:k,labelVisibility:s,children:u&&m.jsx(ye,{children:m.jsx(ve,{content:u,placement:we.TOP_RIGHT})})}),m.jsx(ie,{onChange:h,value:d!==null?d.toString():void 0,disabled:k,align:t?re.horizontal:re.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:f?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:D.map((b,g)=>m.jsxs(se,{value:g.toString(),overrides:{Root:{style:({$isFocusVisible:y})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:f?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:y?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:y})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:y&&!k?l.colors.primary:l.colors.fadedText40})},RadioMarkInner:{style:({$checked:y})=>({height:y?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`,width:y?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`})},Label:{style:{color:k?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[m.jsx(te,{source:b,allowHTML:!1,isLabel:!0,largerLabel:!0}),f&&m.jsx(te,{source:z(i[g]),allowHTML:!1,isCaption:!0,isLabel:!0})]},g))})]})}const et=c.memo(Qe);function tt({disabled:e,element:t,widgetMgr:o,fragmentId:r}){const[n,i]=Re({getStateFromWidgetMgr:rt,getDefaultStateFromProto:ot,getCurrStateFromProto:nt,updateWidgetMgrState:it,element:t,widgetMgr:o,fragmentId:r}),a=c.useCallback(f=>{i({value:f,fromUi:!0})},[i]),{horizontal:s,options:u,captions:d,label:p,labelVisibility:h,help:l}=t;return m.jsx(et,{label:p,onChange:a,options:u,captions:d,disabled:e,horizontal:s,labelVisibility:Oe(h==null?void 0:h.value),value:n??null,help:l})}function rt(e,t){return e.getIntValue(t)}function ot(e){return e.default??null}function nt(e){return e.value??null}function it(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const at=c.memo(tt);export{at as default};
@@ -1 +1 @@
1
- import{c as s,r as b,R as p,b6 as h,bG as x,A as f,j as t,bE as k,bH as m,F as C,b5 as v}from"./index-NYCOzVlX.js";const j=s("div",{target:"e11k5jya2"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"}),""),L=s("a",{target:"e11k5jya1"})(({disabled:r,isCurrentPage:o,containerWidth:i,theme:e})=>({textDecoration:"none",width:i?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),w=s("span",{target:"e11k5jya0"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function y(r){const{onPageChange:o,currentPageScriptHash:i}=p.useContext(h),e=p.useContext(x),{colors:d}=f(),{disabled:n,element:a}=r,l=T(a.useContainerWidth,e),c=i===a.pageScriptHash,u=g=>{a.external?n&&g.preventDefault():(g.preventDefault(),n||o(a.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:t.jsx(k,{help:a.help,placement:m.TOP_RIGHT,containerWidth:l,children:t.jsx(j,{containerWidth:l,children:t.jsxs(L,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:c,containerWidth:l,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:u,children:[a.icon&&t.jsx(C,{size:"lg",color:n?d.fadedText40:d.bodyText,iconValue:a.icon}),t.jsx(w,{disabled:n,children:t.jsx(v,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}const H=b.memo(y);export{H as default};
1
+ import{c as s,r as b,R as p,b6 as h,bG as x,A as f,j as t,bE as k,bH as m,F as C,b5 as v}from"./index-OxGwEg3m.js";const j=s("div",{target:"e11k5jya2"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"}),""),L=s("a",{target:"e11k5jya1"})(({disabled:r,isCurrentPage:o,containerWidth:i,theme:e})=>({textDecoration:"none",width:i?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),w=s("span",{target:"e11k5jya0"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function y(r){const{onPageChange:o,currentPageScriptHash:i}=p.useContext(h),e=p.useContext(x),{colors:d}=f(),{disabled:n,element:a}=r,l=T(a.useContainerWidth,e),c=i===a.pageScriptHash,u=g=>{a.external?n&&g.preventDefault():(g.preventDefault(),n||o(a.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:t.jsx(k,{help:a.help,placement:m.TOP_RIGHT,containerWidth:l,children:t.jsx(j,{containerWidth:l,children:t.jsxs(L,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:c,containerWidth:l,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:u,children:[a.icon&&t.jsx(C,{size:"lg",color:n?d.fadedText40:d.bodyText,iconValue:a.icon}),t.jsx(w,{disabled:n,children:t.jsx(v,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}const H=b.memo(y);export{H as default};
@@ -1 +1 @@
1
- import{r as p,E as S,_ as j,c as d,G as T,j as l,bW as h,bV as f,bB as X,bC as x,cW as W,cX as $,bs as O,ca as _,R as G,b3 as Y,bQ as Q,L as m,b as u,bS as Z,bR as q,bY as J,bZ as K,cb as ee,b_ as te,bH as se}from"./index-NYCOzVlX.js";import{a as U}from"./index-t--hEgTQ.js";import{F as ie}from"./FormClearHelper--a7FEpt-.js";import{g as z,F as w,D as le,b as ae,I as ne,C as oe,a as re,s as de}from"./FileHelper-BEtUZCB8.js";import{P as pe,S as ce}from"./ProgressBar-Col3VLE4.js";import{u as ge}from"./Hooks-2PqJRMDp.js";import{U as F}from"./UploadFileInfo-C-jY39rj.js";var I=p.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(S,j({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),p.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p.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 v=p.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(S,j({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),p.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"}))});v.displayName="Error";const C=d("section",{target:"e1b2p2ww15"})(({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,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${i.colors.primary}`},color:e?i.colors.gray:i.colors.bodyText}),""),M=d("div",{target:"e1b2p2ww14"})({name:"9xni5b",styles:"margin-right:auto;align-items:center;display:flex"}),B=d("span",{target:"e1b2p2ww13"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg}),""),he=d("span",{target:"e1b2p2ww12"})(({theme:e})=>({marginBottom:e.spacing.twoXS}),""),me=d("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),D=d("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}),""),ue=d("ul",{target:"e1b2p2ww9"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none}),""),V=d("li",{target:"e1b2p2ww8"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none}),""),L=d("div",{target:"e1b2p2ww7"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"}),""),k=d("div",{target:"e1b2p2ww6"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),A=d("div",{target:"e1b2p2ww5"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS}),""),fe=d("span",{target:"e1b2p2ww4"})(({theme:e})=>({marginRight:e.spacing.twoXS}),""),xe=d("div",{target:"e1b2p2ww3"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100}),""),H=d("small",{target:"e1b2p2ww2"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}),""),E=d("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),we=e=>({[C]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[M]:{marginBottom:e.spacing.lg},[B]:{display:"none"},[D]:{paddingRight:e.spacing.lg},[A]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[L]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[E]:{display:"none"},[V]:{margin:e.spacing.none,padding:e.spacing.none}}),be=d("div",{target:"e1b2p2ww0"})(({theme:e,width:i})=>{if(i<T("23rem"))return we(e)},""),y=d("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}},""),Fe=({multiple:e,acceptedExtensions:i,maxSizeBytes:t})=>l.jsxs(M,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l.jsx(B,{children:l.jsx(h,{content:I,size:"threeXL"})}),l.jsxs(me,{children:[l.jsxs(he,{children:["Drag and drop file",e?"s":""," here"]}),l.jsxs(y,{children:[`Limit ${z(t,w.Byte,0)} per file`,i.length?` \u2022 ${i.map(s=>s.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),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(C,{...o(),"data-testid":"stFileUploaderDropzone",isDisabled:a,"aria-label":n,children:[l.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),l.jsx(Fe,{multiple:i,acceptedExtensions:t,maxSizeBytes:s}),l.jsx(f,{kind:x.SECONDARY,disabled:a,size:X.SMALL,children:"Browse files"})]})}),Se=d("div",{target:"e1nlpozb1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS}),""),je=d("div",{target:"e1nlpozb0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40}),""),Ue=({currentPage:e,totalPages:i,onNext:t,onPrevious:s})=>l.jsxs(Se,{"data-testid":"stFileUploaderPagination",children:[l.jsx(y,{children:`Showing page ${e} of ${i}`}),l.jsxs(je,{children:[l.jsx(f,{onClick:s,kind:x.MINIMAL,children:l.jsx(h,{content:W,size:"xl"})}),l.jsx(f,{onClick:t,kind:x.MINIMAL,children:l.jsx(h,{content:$,size:"xl"})})]})]}),N=(e,i)=>Math.ceil(e.length/i),ze=e=>O(({pageSize:i,items:t,resetOnAdd:s,...a})=>{const[n,o]=p.useState(0),[r,c]=p.useState(()=>N(t,i)),g=ge(t);p.useEffect(()=>{g&&g.length!==t.length&&c(N(t,i)),g&&g.length<t.length?s&&o(0):n+1>=r&&o(r-1)},[t,n,i,g,s,r]);const b=()=>{o(Math.min(n+1,r-1))},P=()=>{o(Math.max(0,n-1))},R=t.slice(n*i,n*i+i);return l.jsxs(l.Fragment,{children:[l.jsx(e,{items:R,...a}),t.length>i?l.jsx(Ue,{pageSize:i,totalPages:r,currentPage:n+1,onNext:b,onPrevious:P}):null]})},e),Ie=({fileInfo:e})=>e.status.type==="uploading"?l.jsx(pe,{value:e.status.progress,size:ce.SMALL}):e.status.type==="error"?l.jsxs(H,{children:[l.jsx(fe,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l.jsx(E,{children:l.jsx(h,{content:v,size:"lg"})})]}):e.status.type==="uploaded"?l.jsx(y,{children:z(e.size,w.Byte)}):null,ve=({fileInfo:e,onDelete:i})=>l.jsxs(A,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l.jsx(xe,{children:l.jsx(h,{content:ne,size:"twoXL"})}),l.jsxs(L,{className:"stFileUploaderFileData",children:[l.jsx(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),l.jsx(Ie,{fileInfo:e})]}),l.jsx("div",{"data-testid":"stFileUploaderDeleteBtn",children:l.jsx(f,{onClick:()=>i(e.id),kind:x.MINIMAL,children:l.jsx(h,{content:oe,size:"lg"})})})]}),Ce=({items:e,onDelete:i})=>l.jsx(ue,{children:e.map(t=>l.jsx(V,{children:l.jsx(ve,{fileInfo:t,onDelete:i})},t.id))}),Me=ze(Ce),Be=e=>l.jsx(D,{children:l.jsx(Me,{...e})});class De extends G.PureComponent{constructor(i){super(i),this.formClearHelper=new ie,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);Y(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)}Q(o,t).forEach(([r,c])=>{this.uploadFile(r,c)})}).catch(o=>{this.addFiles(t.map(r=>new F(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=U.CancelToken.source(),n=new F(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=>{U.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=>{u.flushSync(()=>{this.setState(s=>({files:[...s.files,t]}))})},this.addFiles=t=>{u.flushSync(()=>{this.setState(s=>({files:[...s.files,...t]}))})},this.removeFile=t=>{u.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)=>{u.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=()=>{u.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,g=o.fileId,b=o.fileUrls;return new F(r,c,this.nextLocalFileId(),{type:"uploaded",fileId:g,fileUrls:b})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const i=this.props.element.maxUploadSizeMb;return de(i,w.Megabyte,w.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 Z({fileId:o,fileUrls:r,name:s,size:a})});return new q({uploadedFileInfo:i})}render(){var i;const{files:t}=this.state,{element:s,disabled:a,widgetMgr:n,width:o}=this.props,r=s.type;this.formClearHelper.manageFormClearListener(n,s.formId,this.onFormCleared);const c=t.slice().reverse();return l.jsxs(be,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[l.jsx(J,{label:s.label,disabled:a,labelVisibility:K((i=s.labelVisibility)==null?void 0:i.value),children:s.help&&l.jsx(ee,{children:l.jsx(te,{content:s.help,placement:se.TOP_RIGHT})})}),l.jsx(ye,{onDrop:this.dropHandler,multiple:s.multipleFiles,acceptedExtensions:r,maxSizeBytes:this.maxUploadSizeInBytes,label:s.label,disabled:a}),c.length>0&&l.jsx(Be,{items:c,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Ve=_(p.memo(De));export{Ve as default};
1
+ import{r as p,E as S,_ as j,c as d,G as T,j as l,bW as h,bV as f,bB as X,bC as x,cW as W,cX as $,bs as O,ca as _,R as G,b3 as Y,bQ as Q,L as m,b as u,bS as Z,bR as q,bY as J,bZ as K,cb as ee,b_ as te,bH as se}from"./index-OxGwEg3m.js";import{a as U}from"./index-t--hEgTQ.js";import{F as ie}from"./FormClearHelper-DxeY-rII.js";import{g as z,F as w,D as le,b as ae,I as ne,C as oe,a as re,s as de}from"./FileHelper-BNpeYRlH.js";import{P as pe,S as ce}from"./ProgressBar-xr2SnNK1.js";import{u as ge}from"./Hooks-BOkao1bO.js";import{U as F}from"./UploadFileInfo-C-jY39rj.js";var I=p.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(S,j({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),p.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),p.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 v=p.forwardRef(function(e,i){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(S,j({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:i}),p.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"}))});v.displayName="Error";const C=d("section",{target:"e1b2p2ww15"})(({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,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${i.colors.primary}`},color:e?i.colors.gray:i.colors.bodyText}),""),M=d("div",{target:"e1b2p2ww14"})({name:"9xni5b",styles:"margin-right:auto;align-items:center;display:flex"}),B=d("span",{target:"e1b2p2ww13"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg}),""),he=d("span",{target:"e1b2p2ww12"})(({theme:e})=>({marginBottom:e.spacing.twoXS}),""),me=d("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),D=d("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}),""),ue=d("ul",{target:"e1b2p2ww9"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none}),""),V=d("li",{target:"e1b2p2ww8"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none}),""),L=d("div",{target:"e1b2p2ww7"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"}),""),k=d("div",{target:"e1b2p2ww6"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),A=d("div",{target:"e1b2p2ww5"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS}),""),fe=d("span",{target:"e1b2p2ww4"})(({theme:e})=>({marginRight:e.spacing.twoXS}),""),xe=d("div",{target:"e1b2p2ww3"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100}),""),H=d("small",{target:"e1b2p2ww2"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}),""),E=d("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),we=e=>({[C]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[M]:{marginBottom:e.spacing.lg},[B]:{display:"none"},[D]:{paddingRight:e.spacing.lg},[A]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[k]:{width:e.sizes.full},[L]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[E]:{display:"none"},[V]:{margin:e.spacing.none,padding:e.spacing.none}}),be=d("div",{target:"e1b2p2ww0"})(({theme:e,width:i})=>{if(i<T("23rem"))return we(e)},""),y=d("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}},""),Fe=({multiple:e,acceptedExtensions:i,maxSizeBytes:t})=>l.jsxs(M,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l.jsx(B,{children:l.jsx(h,{content:I,size:"threeXL"})}),l.jsxs(me,{children:[l.jsxs(he,{children:["Drag and drop file",e?"s":""," here"]}),l.jsxs(y,{children:[`Limit ${z(t,w.Byte,0)} per file`,i.length?` \u2022 ${i.map(s=>s.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),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(C,{...o(),"data-testid":"stFileUploaderDropzone",isDisabled:a,"aria-label":n,children:[l.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),l.jsx(Fe,{multiple:i,acceptedExtensions:t,maxSizeBytes:s}),l.jsx(f,{kind:x.SECONDARY,disabled:a,size:X.SMALL,children:"Browse files"})]})}),Se=d("div",{target:"e1nlpozb1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS}),""),je=d("div",{target:"e1nlpozb0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40}),""),Ue=({currentPage:e,totalPages:i,onNext:t,onPrevious:s})=>l.jsxs(Se,{"data-testid":"stFileUploaderPagination",children:[l.jsx(y,{children:`Showing page ${e} of ${i}`}),l.jsxs(je,{children:[l.jsx(f,{onClick:s,kind:x.MINIMAL,children:l.jsx(h,{content:W,size:"xl"})}),l.jsx(f,{onClick:t,kind:x.MINIMAL,children:l.jsx(h,{content:$,size:"xl"})})]})]}),N=(e,i)=>Math.ceil(e.length/i),ze=e=>O(({pageSize:i,items:t,resetOnAdd:s,...a})=>{const[n,o]=p.useState(0),[r,c]=p.useState(()=>N(t,i)),g=ge(t);p.useEffect(()=>{g&&g.length!==t.length&&c(N(t,i)),g&&g.length<t.length?s&&o(0):n+1>=r&&o(r-1)},[t,n,i,g,s,r]);const b=()=>{o(Math.min(n+1,r-1))},P=()=>{o(Math.max(0,n-1))},R=t.slice(n*i,n*i+i);return l.jsxs(l.Fragment,{children:[l.jsx(e,{items:R,...a}),t.length>i?l.jsx(Ue,{pageSize:i,totalPages:r,currentPage:n+1,onNext:b,onPrevious:P}):null]})},e),Ie=({fileInfo:e})=>e.status.type==="uploading"?l.jsx(pe,{value:e.status.progress,size:ce.SMALL}):e.status.type==="error"?l.jsxs(H,{children:[l.jsx(fe,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l.jsx(E,{children:l.jsx(h,{content:v,size:"lg"})})]}):e.status.type==="uploaded"?l.jsx(y,{children:z(e.size,w.Byte)}):null,ve=({fileInfo:e,onDelete:i})=>l.jsxs(A,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l.jsx(xe,{children:l.jsx(h,{content:ne,size:"twoXL"})}),l.jsxs(L,{className:"stFileUploaderFileData",children:[l.jsx(k,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),l.jsx(Ie,{fileInfo:e})]}),l.jsx("div",{"data-testid":"stFileUploaderDeleteBtn",children:l.jsx(f,{onClick:()=>i(e.id),kind:x.MINIMAL,children:l.jsx(h,{content:oe,size:"lg"})})})]}),Ce=({items:e,onDelete:i})=>l.jsx(ue,{children:e.map(t=>l.jsx(V,{children:l.jsx(ve,{fileInfo:t,onDelete:i})},t.id))}),Me=ze(Ce),Be=e=>l.jsx(D,{children:l.jsx(Me,{...e})});class De extends G.PureComponent{constructor(i){super(i),this.formClearHelper=new ie,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);Y(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)}Q(o,t).forEach(([r,c])=>{this.uploadFile(r,c)})}).catch(o=>{this.addFiles(t.map(r=>new F(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=U.CancelToken.source(),n=new F(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=>{U.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=>{u.flushSync(()=>{this.setState(s=>({files:[...s.files,t]}))})},this.addFiles=t=>{u.flushSync(()=>{this.setState(s=>({files:[...s.files,...t]}))})},this.removeFile=t=>{u.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)=>{u.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=()=>{u.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,g=o.fileId,b=o.fileUrls;return new F(r,c,this.nextLocalFileId(),{type:"uploaded",fileId:g,fileUrls:b})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const i=this.props.element.maxUploadSizeMb;return de(i,w.Megabyte,w.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 Z({fileId:o,fileUrls:r,name:s,size:a})});return new q({uploadedFileInfo:i})}render(){var i;const{files:t}=this.state,{element:s,disabled:a,widgetMgr:n,width:o}=this.props,r=s.type;this.formClearHelper.manageFormClearListener(n,s.formId,this.onFormCleared);const c=t.slice().reverse();return l.jsxs(be,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[l.jsx(J,{label:s.label,disabled:a,labelVisibility:K((i=s.labelVisibility)==null?void 0:i.value),children:s.help&&l.jsx(ee,{children:l.jsx(te,{content:s.help,placement:se.TOP_RIGHT})})}),l.jsx(ye,{onDrop:this.dropHandler,multiple:s.multipleFiles,acceptedExtensions:r,maxSizeBytes:this.maxUploadSizeInBytes,label:s.label,disabled:a}),c.length>0&&l.jsx(Be,{items:c,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Ve=_(p.memo(De));export{Ve as default};
@@ -1 +1 @@
1
- import{r as w,E as R,_ as E,c as x,I as q,j as h,b$ as Q,bH as z,bV as J,bC as Y,bW as O,c7 as _,e as Z,g as K,be as ee,A as te,c8 as re,c9 as ie,ca as se,R as ne,l as oe,b3 as ae,L as P,bS as le,bR as de,bY as ce,bZ as ue,cb as he,b_ as pe}from"./index-NYCOzVlX.js";import{a as V}from"./index-t--hEgTQ.js";import{F as ge}from"./FormClearHelper--a7FEpt-.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{P as fe,S as me}from"./ProgressBar-Col3VLE4.js";var D=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.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"}))});D.displayName="Video";var W=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.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"}))});W.displayName="X";var $=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),w.createElement("rect",{width:24,height:24,fill:"none"}),w.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ve(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=x("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ye=x("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),Se=x("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),be=x("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),we=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),Me=x("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Ue=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ce=x("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(i.colors.primary,.5)}`},...ve("medium",i)}),"");function A({disabled:i,onClick:l,children:e,progress:n}){return h.jsxs(Ce,{disabled:i||!1,onClick:l||(()=>{}),progress:n||null,"data-testid":"stCameraInputButton",children:[e,n?h.jsx(Ue,{children:h.jsx(fe,{value:n,size:me.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const xe=({switchFacingMode:i})=>h.jsx(Me,{"data-testid":"stCameraInputSwitchButton",children:h.jsx(Q,{content:"Switch camera",placement:z.TOP_RIGHT,children:h.jsx(J,{kind:Y.MINIMAL,onClick:i,children:h.jsx(O,{content:$,size:"twoXL",color:_.white})})})});var k={exports:{}},Ie=k.exports,N;function je(){return N||(N=1,function(i,l){(function(e,n){i.exports=n(Z())})(Ie,function(e){return function(n){var o={};function s(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return n[a].call(p.exports,p,p.exports,s),p.l=!0,p.exports}return s.m=n,s.c=o,s.d=function(a,p,y){s.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:y})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,p){if(p&1&&(a=s(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var y=Object.create(null);if(s.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)s.d(y,C,(function(U){return a[U]}).bind(null,C));return y},s.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(p,"a",p),p},s.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},s.p="",s(s.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(n,o,s){s.r(o);var a=s("react"),p=function(){var g=function(u,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,c){r.__proto__=c}||function(r,c){for(var d in c)c.hasOwnProperty(d)&&(r[d]=c[d])},g(u,t)};return function(u,t){g(u,t);function r(){this.constructor=u}u.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),y=function(){return y=Object.assign||function(g){for(var u,t=1,r=arguments.length;t<r;t++){u=arguments[t];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(g[c]=u[c])}return g},y.apply(this,arguments)},C=function(g,u){var t={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&u.indexOf(r)<0&&(t[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(g);c<r.length;c++)u.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(g,r[c])&&(t[r[c]]=g[r[c]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return u?new Promise(function(t,r){u.call(navigator,g,t,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(u,g);function u(t){var r=g.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return u.prototype.componentDidMount=function(){var t=this,r=t.state,c=t.props;if(this.unmounted=!1,!U()){c.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),c.children&&typeof c.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(t){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var c=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),d=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),b=t.minScreenshotWidth!==r.minScreenshotWidth,v=t.minScreenshotHeight!==r.minScreenshotHeight;(d||b||v)&&(this.canvas=null,this.ctx=null),(c||d)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},u.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(u.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},u.prototype.getScreenshot=function(t){var r=this,c=r.state,d=r.props;if(!c.hasUserMedia)return null;var b=this.getCanvas(t);return b&&b.toDataURL(d.screenshotFormat,d.screenshotQuality)},u.prototype.getCanvas=function(t){var r=this,c=r.state,d=r.props;if(!this.video||!c.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var b=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=b/v;b=d.minScreenshotWidth||this.video.clientWidth,v=b/m,d.minScreenshotHeight&&v<d.minScreenshotHeight&&(v=d.minScreenshotHeight,b=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=(t==null?void 0:t.width)||b,this.canvas.height=(t==null?void 0:t.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,S=M.ctx,f=M.canvas;return S&&f&&(f.width=(t==null?void 0:t.width)||f.width,f.height=(t==null?void 0:t.height)||f.height,d.mirrored&&(S.translate(f.width,0),S.scale(-1,1)),S.imageSmoothingEnabled=d.imageSmoothing,S.drawImage(this.video,0,0,(t==null?void 0:t.width)||f.width,(t==null?void 0:t.height)||f.height),d.mirrored&&(S.scale(-1,1),S.translate(-f.width,0))),f},u.prototype.requestUserMedia=function(){var t=this,r=this.props,c=function(v,m){var M={video:typeof m<"u"?m:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),t.requestUserMediaId++;var S=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){t.unmounted||S!==t.requestUserMediaId?u.stopMediaStream(f):t.handleUserMedia(null,f)}).catch(function(f){t.handleUserMedia(f)})};if("mediaDevices"in navigator)c(r.audioConstraints,r.videoConstraints);else{var d=function(v){return{optional:[{sourceId:v}]}},b=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 S=b(r.audioConstraints);S&&(m=S);var f=b(r.videoConstraints);f&&(M=f),c(d(m),d(M))})}},u.prototype.handleUserMedia=function(t,r){var c=this.props;if(t||!r){this.setState({hasUserMedia:!1}),c.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}c.onUserMedia(r)},u.prototype.render=function(){var t=this,r=this,c=r.state,d=r.props,b=d.audio;d.forceScreenshotSourceSize;var v=d.disablePictureInPicture;d.onUserMedia,d.onUserMediaError,d.screenshotFormat,d.screenshotQuality,d.minScreenshotWidth,d.minScreenshotHeight,d.audioConstraints,d.videoConstraints,d.imageSmoothing;var m=d.mirrored,M=d.style,S=M===void 0?{}:M,f=d.children,j=C(d,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?y(y({},S),{transform:(S.transform||"")+" scaleX(-1)"}):S,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",y({autoPlay:!0,disablePictureInPicture:v,src:c.src,muted:!b,playsInline:!0,ref:function(X){t.video=X},style:B},j)),f&&f(G))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(a.Component);o.default=I},react:function(n,o){n.exports=e}}).default})}(k)),k.exports}var Pe=je();const Fe=K(Pe),Re=({width:i})=>h.jsxs(T,{width:i,children:[h.jsx(O,{size:"threeXL",color:_.gray60,content:D}),h.jsxs(ye,{children:["This app would like to use your camera.",h.jsx(be,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ee=({handleCapture:i,width:l,disabled:e,clearPhotoInProgress:n,setClearPhotoInProgress:o,facingMode:s,setFacingMode:a,testOverride:p})=>{const[y,C]=w.useState(p||"pending"),U=w.useRef(null),[I,g]=w.useState(l),u=w.useCallback(ee(1e3,g),[]);w.useEffect(()=>{u(l)},[l,u]);function t(){if(U.current!==null){const c=U.current.getScreenshot();i(c)}}const r=te();return h.jsxs(H,{"data-testid":"stCameraInputWebcamComponent",children:[y!=="success"&&!e&&!n?h.jsx(Re,{width:I}):re.isMobile&&h.jsx(xe,{switchFacingMode:a}),h.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:y!=="success"&&!e&&!n,width:I,children:!e&&h.jsx(Fe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:s}})}),h.jsx(A,{onClick:t,disabled:y!=="success"||e||n,children:"Take Photo"})]})},Oe=150,Te=oe.getLogger("CameraInput");class ke extends ne.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ge,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 n=o=>new Promise(s=>setTimeout(s,o));return ze(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(s=>({file:o,fileUrls:s[0]}))).then(({file:o,fileUrls:s})=>this.uploadFile(s,o)).then(()=>n(Oe)).then(()=>{this.setState((o,s)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{Te.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:n,widgetMgr:o,fragmentId:s}=this.props,a=o.getFileUploaderStateValue(n);ae(e,a)||o.setFileUploaderStateValue(n,e,{fromUi:!0},s)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:n,element:o,fragmentId:s}=this.props;n.setFileUploaderStateValue(o,e,{fromUi:!0},s)})},this.deleteFile=e=>{const n=this.getFile(e);P(n)||(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(n=>({files:[...n.files,e]}))},this.removeFile=e=>{this.setState(n=>({files:n.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(n=>n.id===e),this.updateFile=(e,n)=>{this.setState(o=>({files:o.files.map(s=>s.id===e?n:s)}))},this.onUploadComplete=(e,n)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.onUploadProgress=(e,n)=>{const o=this.getFile(n);if(P(o)||o.status.type!=="uploading")return;const s=Math.round(e.loaded*100/e.total);o.status.progress!==s&&this.updateFile(n,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:s}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,n)=>{const o=V.CancelToken.source(),s=new L(n.name,n.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,n,a=>this.onUploadProgress(a,s.id),o.token).then(()=>this.onUploadComplete(s.id,e)).catch(a=>{V.isCancel(a)||this.updateFile(s.id,s.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:n}=this.props,o=e.getFileUploaderStateValue(n);if(P(o))return l;const{uploadedFileInfo:s}=o;return P(s)||s.length===0?l:{files:s.map(a=>{const p=a.name,y=a.size,C=a.fileId,U=a.fileUrls;return new L(p,y,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:s.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:n,fragmentId:o}=this.props;n.getFileUploaderStateValue(e)===void 0&&n.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:n,size:o,status:s}=e;return new le({fileId:s.fileId,fileUrls:s.fileUrls,name:n,size:o})});return new de({uploadedFileInfo:l})}render(){var l;const{element:e,widgetMgr:n,disabled:o,width:s}=this.props;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),h.jsxs(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h.jsx(ce,{label:e.label,disabled:o,labelVisibility:ue((l=e.labelVisibility)==null?void 0:l.value),children:e.help&&h.jsx(he,{children:h.jsx(pe,{content:e.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?h.jsxs(h.Fragment,{children:[h.jsx(T,{width:s,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h.jsx(Se,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:s,height:s*9/16})}),h.jsx(A,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||o,children:this.getProgress()?"Uploading...":h.jsxs(we,{children:[h.jsx(O,{content:W,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h.jsx(Ee,{handleCapture:this.handleCapture,width:s,disabled:o,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function ze(i,l){return fetch(i).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const _e=se(ke);export{_e as default};
1
+ import{r as w,E as R,_ as E,c as x,I as q,j as h,b$ as Q,bH as z,bV as J,bC as Y,bW as O,c7 as _,e as Z,g as K,be as ee,A as te,c8 as re,c9 as ie,ca as se,R as ne,l as oe,b3 as ae,L as P,bS as le,bR as de,bY as ce,bZ as ue,cb as he,b_ as pe}from"./index-OxGwEg3m.js";import{a as V}from"./index-t--hEgTQ.js";import{F as ge}from"./FormClearHelper-DxeY-rII.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{P as fe,S as me}from"./ProgressBar-xr2SnNK1.js";var D=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.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"}))});D.displayName="Video";var W=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.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"}))});W.displayName="X";var $=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),w.createElement("rect",{width:24,height:24,fill:"none"}),w.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ve(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=x("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ye=x("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),Se=x("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),be=x("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),we=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),Me=x("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Ue=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ce=x("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(i.colors.primary,.5)}`},...ve("medium",i)}),"");function A({disabled:i,onClick:l,children:e,progress:n}){return h.jsxs(Ce,{disabled:i||!1,onClick:l||(()=>{}),progress:n||null,"data-testid":"stCameraInputButton",children:[e,n?h.jsx(Ue,{children:h.jsx(fe,{value:n,size:me.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const xe=({switchFacingMode:i})=>h.jsx(Me,{"data-testid":"stCameraInputSwitchButton",children:h.jsx(Q,{content:"Switch camera",placement:z.TOP_RIGHT,children:h.jsx(J,{kind:Y.MINIMAL,onClick:i,children:h.jsx(O,{content:$,size:"twoXL",color:_.white})})})});var k={exports:{}},Ie=k.exports,N;function je(){return N||(N=1,function(i,l){(function(e,n){i.exports=n(Z())})(Ie,function(e){return function(n){var o={};function s(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return n[a].call(p.exports,p,p.exports,s),p.l=!0,p.exports}return s.m=n,s.c=o,s.d=function(a,p,y){s.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:y})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,p){if(p&1&&(a=s(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var y=Object.create(null);if(s.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)s.d(y,C,(function(U){return a[U]}).bind(null,C));return y},s.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(p,"a",p),p},s.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},s.p="",s(s.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(n,o,s){s.r(o);var a=s("react"),p=function(){var g=function(u,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,c){r.__proto__=c}||function(r,c){for(var d in c)c.hasOwnProperty(d)&&(r[d]=c[d])},g(u,t)};return function(u,t){g(u,t);function r(){this.constructor=u}u.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),y=function(){return y=Object.assign||function(g){for(var u,t=1,r=arguments.length;t<r;t++){u=arguments[t];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(g[c]=u[c])}return g},y.apply(this,arguments)},C=function(g,u){var t={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&u.indexOf(r)<0&&(t[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(g);c<r.length;c++)u.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(g,r[c])&&(t[r[c]]=g[r[c]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return u?new Promise(function(t,r){u.call(navigator,g,t,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(u,g);function u(t){var r=g.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return u.prototype.componentDidMount=function(){var t=this,r=t.state,c=t.props;if(this.unmounted=!1,!U()){c.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),c.children&&typeof c.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(t){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var c=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),d=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),b=t.minScreenshotWidth!==r.minScreenshotWidth,v=t.minScreenshotHeight!==r.minScreenshotHeight;(d||b||v)&&(this.canvas=null,this.ctx=null),(c||d)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},u.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(u.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},u.prototype.getScreenshot=function(t){var r=this,c=r.state,d=r.props;if(!c.hasUserMedia)return null;var b=this.getCanvas(t);return b&&b.toDataURL(d.screenshotFormat,d.screenshotQuality)},u.prototype.getCanvas=function(t){var r=this,c=r.state,d=r.props;if(!this.video||!c.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var b=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=b/v;b=d.minScreenshotWidth||this.video.clientWidth,v=b/m,d.minScreenshotHeight&&v<d.minScreenshotHeight&&(v=d.minScreenshotHeight,b=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=(t==null?void 0:t.width)||b,this.canvas.height=(t==null?void 0:t.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,S=M.ctx,f=M.canvas;return S&&f&&(f.width=(t==null?void 0:t.width)||f.width,f.height=(t==null?void 0:t.height)||f.height,d.mirrored&&(S.translate(f.width,0),S.scale(-1,1)),S.imageSmoothingEnabled=d.imageSmoothing,S.drawImage(this.video,0,0,(t==null?void 0:t.width)||f.width,(t==null?void 0:t.height)||f.height),d.mirrored&&(S.scale(-1,1),S.translate(-f.width,0))),f},u.prototype.requestUserMedia=function(){var t=this,r=this.props,c=function(v,m){var M={video:typeof m<"u"?m:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),t.requestUserMediaId++;var S=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){t.unmounted||S!==t.requestUserMediaId?u.stopMediaStream(f):t.handleUserMedia(null,f)}).catch(function(f){t.handleUserMedia(f)})};if("mediaDevices"in navigator)c(r.audioConstraints,r.videoConstraints);else{var d=function(v){return{optional:[{sourceId:v}]}},b=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 S=b(r.audioConstraints);S&&(m=S);var f=b(r.videoConstraints);f&&(M=f),c(d(m),d(M))})}},u.prototype.handleUserMedia=function(t,r){var c=this.props;if(t||!r){this.setState({hasUserMedia:!1}),c.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}c.onUserMedia(r)},u.prototype.render=function(){var t=this,r=this,c=r.state,d=r.props,b=d.audio;d.forceScreenshotSourceSize;var v=d.disablePictureInPicture;d.onUserMedia,d.onUserMediaError,d.screenshotFormat,d.screenshotQuality,d.minScreenshotWidth,d.minScreenshotHeight,d.audioConstraints,d.videoConstraints,d.imageSmoothing;var m=d.mirrored,M=d.style,S=M===void 0?{}:M,f=d.children,j=C(d,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?y(y({},S),{transform:(S.transform||"")+" scaleX(-1)"}):S,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",y({autoPlay:!0,disablePictureInPicture:v,src:c.src,muted:!b,playsInline:!0,ref:function(X){t.video=X},style:B},j)),f&&f(G))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(a.Component);o.default=I},react:function(n,o){n.exports=e}}).default})}(k)),k.exports}var Pe=je();const Fe=K(Pe),Re=({width:i})=>h.jsxs(T,{width:i,children:[h.jsx(O,{size:"threeXL",color:_.gray60,content:D}),h.jsxs(ye,{children:["This app would like to use your camera.",h.jsx(be,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ee=({handleCapture:i,width:l,disabled:e,clearPhotoInProgress:n,setClearPhotoInProgress:o,facingMode:s,setFacingMode:a,testOverride:p})=>{const[y,C]=w.useState(p||"pending"),U=w.useRef(null),[I,g]=w.useState(l),u=w.useCallback(ee(1e3,g),[]);w.useEffect(()=>{u(l)},[l,u]);function t(){if(U.current!==null){const c=U.current.getScreenshot();i(c)}}const r=te();return h.jsxs(H,{"data-testid":"stCameraInputWebcamComponent",children:[y!=="success"&&!e&&!n?h.jsx(Re,{width:I}):re.isMobile&&h.jsx(xe,{switchFacingMode:a}),h.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:y!=="success"&&!e&&!n,width:I,children:!e&&h.jsx(Fe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:s}})}),h.jsx(A,{onClick:t,disabled:y!=="success"||e||n,children:"Take Photo"})]})},Oe=150,Te=oe.getLogger("CameraInput");class ke extends ne.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ge,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 n=o=>new Promise(s=>setTimeout(s,o));return ze(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(s=>({file:o,fileUrls:s[0]}))).then(({file:o,fileUrls:s})=>this.uploadFile(s,o)).then(()=>n(Oe)).then(()=>{this.setState((o,s)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{Te.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:n,widgetMgr:o,fragmentId:s}=this.props,a=o.getFileUploaderStateValue(n);ae(e,a)||o.setFileUploaderStateValue(n,e,{fromUi:!0},s)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:n,element:o,fragmentId:s}=this.props;n.setFileUploaderStateValue(o,e,{fromUi:!0},s)})},this.deleteFile=e=>{const n=this.getFile(e);P(n)||(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(n=>({files:[...n.files,e]}))},this.removeFile=e=>{this.setState(n=>({files:n.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(n=>n.id===e),this.updateFile=(e,n)=>{this.setState(o=>({files:o.files.map(s=>s.id===e?n:s)}))},this.onUploadComplete=(e,n)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.onUploadProgress=(e,n)=>{const o=this.getFile(n);if(P(o)||o.status.type!=="uploading")return;const s=Math.round(e.loaded*100/e.total);o.status.progress!==s&&this.updateFile(n,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:s}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,n)=>{const o=V.CancelToken.source(),s=new L(n.name,n.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,n,a=>this.onUploadProgress(a,s.id),o.token).then(()=>this.onUploadComplete(s.id,e)).catch(a=>{V.isCancel(a)||this.updateFile(s.id,s.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:n}=this.props,o=e.getFileUploaderStateValue(n);if(P(o))return l;const{uploadedFileInfo:s}=o;return P(s)||s.length===0?l:{files:s.map(a=>{const p=a.name,y=a.size,C=a.fileId,U=a.fileUrls;return new L(p,y,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:s.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:n,fragmentId:o}=this.props;n.getFileUploaderStateValue(e)===void 0&&n.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:n,size:o,status:s}=e;return new le({fileId:s.fileId,fileUrls:s.fileUrls,name:n,size:o})});return new de({uploadedFileInfo:l})}render(){var l;const{element:e,widgetMgr:n,disabled:o,width:s}=this.props;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),h.jsxs(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h.jsx(ce,{label:e.label,disabled:o,labelVisibility:ue((l=e.labelVisibility)==null?void 0:l.value),children:e.help&&h.jsx(he,{children:h.jsx(pe,{content:e.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?h.jsxs(h.Fragment,{children:[h.jsx(T,{width:s,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h.jsx(Se,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:s,height:s*9/16})}),h.jsx(A,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||o,children:this.getProgress()?"Uploading...":h.jsxs(we,{children:[h.jsx(O,{content:W,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h.jsx(Ee,{handleCapture:this.handleCapture,width:s,disabled:o,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function ze(i,l){return fetch(i).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const _e=se(ke);export{_e as default};
@@ -1,4 +1,4 @@
1
- import{c as i,k as r,r as l,j as t}from"./index-NYCOzVlX.js";import{R as m,P as p}from"./RenderInPortalIfExists-qnP8SYNG.js";const c="/assets/balloon-0.Czj7AKwE.png",g="/assets/balloon-1.CNvFFrND.png",d="/assets/balloon-2.DTvC6B1t.png",x="/assets/balloon-3.CgSk4tbL.png",f="/assets/balloon-4.mbtFrzxf.png",b="/assets/balloon-5.CSwkUfRA.png",n=300,h=121,s=20,u=80,C=1e3,N=r`
1
+ import{c as i,k as r,r as l,j as t}from"./index-OxGwEg3m.js";import{R as m,P as p}from"./RenderInPortalIfExists-D-C7LcEp.js";const c="/assets/balloon-0.Czj7AKwE.png",g="/assets/balloon-1.CNvFFrND.png",d="/assets/balloon-2.DTvC6B1t.png",x="/assets/balloon-3.CgSk4tbL.png",f="/assets/balloon-4.mbtFrzxf.png",b="/assets/balloon-5.CSwkUfRA.png",n=300,h=121,s=20,u=80,C=1e3,N=r`
2
2
  from {
3
3
  transform: translateY(calc(100vh + ${n}px));
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r as h,E as U,_ as B,bp as pe,bQ as Ve,bR as _e,bS as $e,L as H,N as X,R as me,b6 as He,c as P,bT as Xe,j as f,bU as Ge,bV as qe,bC as Ye,bW as Ke,l as Qe,A as Ze,bX as ee,G as Je,b3 as et,bY as tt,bZ as it,b_ as rt,bH as st}from"./index-NYCOzVlX.js";import{u as nt,F as ot}from"./FormClearHelper--a7FEpt-.js";import{T as at,a as ge}from"./Toolbar-Ce_uRMJw.js";import{u as lt}from"./Hooks-2PqJRMDp.js";import{c as dt}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ct,D as ht}from"./FileDownload.esm-Bpf_IJaz.js";var fe=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var ve=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});ve.displayName="Pause";var be=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});be.displayName="PlayArrow";var ye=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ye.displayName="Refresh";var we=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});we.displayName="StopCircle";function M(r,e,t,i){return new(t||(t=Promise))(function(s,o){function n(c){try{a(i.next(c))}catch(l){o(l)}}function d(c){try{a(i.throw(c))}catch(l){o(l)}}function a(c){var l;c.done?s(c.value):(l=c.value,l instanceof t?l:new t(function(p){p(l)})).then(n,d)}a((i=i.apply(r,e||[])).next())})}let z=class{constructor(){this.listeners={}}on(r,e,t){if(this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].add(e),t==null?void 0:t.once){const i=()=>{this.un(r,i),this.un(r,e)};return this.on(r,i),i}return()=>this.un(r,e)}un(r,e){var t;(t=this.listeners[r])===null||t===void 0||t.delete(e)}once(r,e){return this.on(r,e,{once:!0})}unAll(){this.listeners={}}emit(r,...e){this.listeners[r]&&this.listeners[r].forEach(t=>t(...e))}};const G={decode:function(r,e){return M(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(r).finally(()=>t.close())})},createBuffer:function(r,e){return typeof r[0]=="number"&&(r=[r]),function(t){const i=t[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let o=0;for(let n=0;n<s;n++){const d=Math.abs(i[n]);d>o&&(o=d)}for(const n of t)for(let d=0;d<s;d++)n[d]/=o}}(r),{duration:e,length:r[0].length,sampleRate:r[0].length/e,numberOfChannels:r.length,getChannelData:t=>r==null?void 0:r[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ce(r,e){const t=e.xmlns?document.createElementNS(e.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(e))if(i==="children")for(const[o,n]of Object.entries(e))typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(Ce(o,n));else i==="style"?Object.assign(t.style,s):i==="textContent"?t.textContent=s:t.setAttribute(i,s.toString());return t}function Se(r,e,t){const i=Ce(r,e||{});return t==null||t.appendChild(i),i}var ut=Object.freeze({__proto__:null,createElement:Se,default:Se});const pt={fetchBlob:function(r,e,t){return M(this,void 0,void 0,function*(){const i=yield fetch(r,t);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return function(s,o){M(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const n=s.body.getReader(),d=Number(s.headers.get("Content-Length"))||0;let a=0;const c=p=>M(this,void 0,void 0,function*(){a+=(p==null?void 0:p.length)||0;const m=Math.round(a/d*100);o(m)}),l=()=>M(this,void 0,void 0,function*(){let p;try{p=yield n.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),e),i.blob()})}};class mt extends z{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,i){return this.media.addEventListener(e,t,i),()=>this.media.removeEventListener(e,t,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const i=this.getSrc();if(e&&i===e)return;this.revokeSrc();const s=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return M(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=Math.max(0,Math.min(e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class I extends z{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=e;const i=this.parentFromOptionsContainer(e.container);this.parent=i;const[s,o]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const i=this.wrapper.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top;return[s/i.width,o/i.height]};if(this.wrapper.addEventListener("click",t=>{const[i,s]=e(t);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const[i,s]=e(t);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:i,clientWidth:s}=this.scrollContainer,o=t/i,n=(t+s)/i;this.emit("scroll",o,n,t,t+s)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,i,s,o=3,n=0,d=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==n)return;p.preventDefault(),p.stopPropagation();let m=p.clientX,u=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),a&&Date.now()-b<d)return;const k=C.clientX,T=C.clientY,D=k-m,j=T-u;if(g||Math.abs(D)>o||Math.abs(j)>o){const W=e.getBoundingClientRect(),{left:_,top:N}=W;g||(i==null||i(m-_,u-N),g=!0),t(D,j,k-_,T-N),m=k,u=T}},y=C=>{if(g){const k=C.clientX,T=C.clientY,D=e.getBoundingClientRect(),{left:j,top:W}=D;s==null||s(k-j,T-W)}c()},x=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||y(C)},w=C=>{g&&(C.stopPropagation(),C.preventDefault())},E=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointerout",x),document.addEventListener("pointercancel",x),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("click",w,{capture:!0}),c=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointerout",x),document.removeEventListener("pointercancel",x),document.removeEventListener("touchmove",E),setTimeout(()=>{document.removeEventListener("click",w,{capture:!0})},10)}};return e.addEventListener("pointerdown",l),()=>{c(),e.removeEventListener("pointerdown",l)}}(this.wrapper,(e,t,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(n=>!n.overlay)?o/s:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return t.innerHTML=`
1
+ import{r as h,E as U,_ as B,bp as pe,bQ as Ve,bR as _e,bS as $e,L as H,N as X,R as me,b6 as He,c as P,bT as Xe,j as f,bU as Ge,bV as qe,bC as Ye,bW as Ke,l as Qe,A as Ze,bX as ee,G as Je,b3 as et,bY as tt,bZ as it,b_ as rt,bH as st}from"./index-OxGwEg3m.js";import{u as nt,F as ot}from"./FormClearHelper-DxeY-rII.js";import{T as at,a as ge}from"./Toolbar-CJ0mD5An.js";import{u as lt}from"./Hooks-BOkao1bO.js";import{c as dt}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ct,D as ht}from"./FileDownload.esm-Bzb3HjS9.js";var fe=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var ve=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});ve.displayName="Pause";var be=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});be.displayName="PlayArrow";var ye=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ye.displayName="Refresh";var we=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});we.displayName="StopCircle";function M(r,e,t,i){return new(t||(t=Promise))(function(s,o){function n(c){try{a(i.next(c))}catch(l){o(l)}}function d(c){try{a(i.throw(c))}catch(l){o(l)}}function a(c){var l;c.done?s(c.value):(l=c.value,l instanceof t?l:new t(function(p){p(l)})).then(n,d)}a((i=i.apply(r,e||[])).next())})}let z=class{constructor(){this.listeners={}}on(r,e,t){if(this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].add(e),t==null?void 0:t.once){const i=()=>{this.un(r,i),this.un(r,e)};return this.on(r,i),i}return()=>this.un(r,e)}un(r,e){var t;(t=this.listeners[r])===null||t===void 0||t.delete(e)}once(r,e){return this.on(r,e,{once:!0})}unAll(){this.listeners={}}emit(r,...e){this.listeners[r]&&this.listeners[r].forEach(t=>t(...e))}};const G={decode:function(r,e){return M(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(r).finally(()=>t.close())})},createBuffer:function(r,e){return typeof r[0]=="number"&&(r=[r]),function(t){const i=t[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let o=0;for(let n=0;n<s;n++){const d=Math.abs(i[n]);d>o&&(o=d)}for(const n of t)for(let d=0;d<s;d++)n[d]/=o}}(r),{duration:e,length:r[0].length,sampleRate:r[0].length/e,numberOfChannels:r.length,getChannelData:t=>r==null?void 0:r[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ce(r,e){const t=e.xmlns?document.createElementNS(e.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(e))if(i==="children")for(const[o,n]of Object.entries(e))typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(Ce(o,n));else i==="style"?Object.assign(t.style,s):i==="textContent"?t.textContent=s:t.setAttribute(i,s.toString());return t}function Se(r,e,t){const i=Ce(r,e||{});return t==null||t.appendChild(i),i}var ut=Object.freeze({__proto__:null,createElement:Se,default:Se});const pt={fetchBlob:function(r,e,t){return M(this,void 0,void 0,function*(){const i=yield fetch(r,t);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return function(s,o){M(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const n=s.body.getReader(),d=Number(s.headers.get("Content-Length"))||0;let a=0;const c=p=>M(this,void 0,void 0,function*(){a+=(p==null?void 0:p.length)||0;const m=Math.round(a/d*100);o(m)}),l=()=>M(this,void 0,void 0,function*(){let p;try{p=yield n.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),e),i.blob()})}};class mt extends z{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,i){return this.media.addEventListener(e,t,i),()=>this.media.removeEventListener(e,t,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const i=this.getSrc();if(e&&i===e)return;this.revokeSrc();const s=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return M(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=Math.max(0,Math.min(e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class I extends z{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=e;const i=this.parentFromOptionsContainer(e.container);this.parent=i;const[s,o]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const i=this.wrapper.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top;return[s/i.width,o/i.height]};if(this.wrapper.addEventListener("click",t=>{const[i,s]=e(t);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const[i,s]=e(t);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:i,clientWidth:s}=this.scrollContainer,o=t/i,n=(t+s)/i;this.emit("scroll",o,n,t,t+s)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,i,s,o=3,n=0,d=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==n)return;p.preventDefault(),p.stopPropagation();let m=p.clientX,u=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),a&&Date.now()-b<d)return;const k=C.clientX,T=C.clientY,D=k-m,j=T-u;if(g||Math.abs(D)>o||Math.abs(j)>o){const W=e.getBoundingClientRect(),{left:_,top:N}=W;g||(i==null||i(m-_,u-N),g=!0),t(D,j,k-_,T-N),m=k,u=T}},y=C=>{if(g){const k=C.clientX,T=C.clientY,D=e.getBoundingClientRect(),{left:j,top:W}=D;s==null||s(k-j,T-W)}c()},x=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||y(C)},w=C=>{g&&(C.stopPropagation(),C.preventDefault())},E=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointerout",x),document.addEventListener("pointercancel",x),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("click",w,{capture:!0}),c=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointerout",x),document.removeEventListener("pointercancel",x),document.removeEventListener("touchmove",E),setTimeout(()=>{document.removeEventListener("click",w,{capture:!0})},10)}};return e.addEventListener("pointerdown",l),()=>{c(),e.removeEventListener("pointerdown",l)}}(this.wrapper,(e,t,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(n=>!n.overlay)?o/s:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return t.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;
@@ -1 +1 @@
1
- import{c as p,r as i,A as x,j as s,F as y,b5 as w,bi as n,D as S,bj as T,bk as v}from"./index-NYCOzVlX.js";const j=p("button",{target:"elibz2u3"})(({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}}),""),z=p("div",{target:"elibz2u2"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),R=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 k(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 B(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 L({body:e,icon:o}){const t=x(),r=B(e),d=e!==r,[a,h]=i.useState(!d),[u,m]=i.useState(0),f=i.useCallback(()=>{h(!a)},[a]),l=i.useMemo(()=>k(t),[t]),c=i.useMemo(()=>s.jsxs(z,{expanded:a,children:[o&&s.jsx(y,{iconValue:o,size:"xl",testid:"stToastDynamicIcon"}),s.jsxs(R,{children:[s.jsx(w,{source:a?e:r,allowHTML:!1,isToast:!0}),d&&s.jsx(j,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,e,o,r,f]);i.useEffect(()=>{if(t.inSidebar)return;const g=n.info(c,{overrides:{...l}});return m(g),()=>{n.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),n.clear(g)}},[]),i.useEffect(()=>{n.update(u,{children:c,overrides:{...l}})},[u,c,l]);const b=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:t.inSidebar&&b})}const C=i.memo(L);export{C as default};
1
+ import{c as p,r as i,A as x,j as s,F as y,b5 as w,bi as n,D as S,bj as T,bk as v}from"./index-OxGwEg3m.js";const j=p("button",{target:"elibz2u3"})(({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}}),""),z=p("div",{target:"elibz2u2"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),R=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 k(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 B(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 L({body:e,icon:o}){const t=x(),r=B(e),d=e!==r,[a,h]=i.useState(!d),[u,m]=i.useState(0),f=i.useCallback(()=>{h(!a)},[a]),l=i.useMemo(()=>k(t),[t]),c=i.useMemo(()=>s.jsxs(z,{expanded:a,children:[o&&s.jsx(y,{iconValue:o,size:"xl",testid:"stToastDynamicIcon"}),s.jsxs(R,{children:[s.jsx(w,{source:a?e:r,allowHTML:!1,isToast:!0}),d&&s.jsx(j,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,e,o,r,f]);i.useEffect(()=>{if(t.inSidebar)return;const g=n.info(c,{overrides:{...l}});return m(g),()=>{n.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),n.clear(g)}},[]),i.useEffect(()=>{n.update(u,{children:c,overrides:{...l}})},[u,c,l]);const b=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:t.inSidebar&&b})}const C=i.memo(L);export{C as default};