@stlite/desktop 0.79.0 → 0.79.4

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 (67) hide show
  1. package/build/assets/{FileDownload.esm-CUqgQU-j.js → FileDownload.esm-DJAez7Gm.js} +1 -1
  2. package/build/assets/{FormClearHelper-DmeZ2QuQ.js → FormClearHelper-BtlF8Otx.js} +1 -1
  3. package/build/assets/{Hooks-CBIuRW4z.js → Hooks-DirHIiAM.js} +1 -1
  4. package/build/assets/{InputInstructions-iKTPb-Lc.js → InputInstructions-DJSzEvIq.js} +1 -1
  5. package/build/assets/{ProgressBar-Dfr9f8u1.js → ProgressBar-BnrWSmyb.js} +1 -1
  6. package/build/assets/{RenderInPortalIfExists-CxeJAxCs.js → RenderInPortalIfExists-Ca4-_0pe.js} +1 -1
  7. package/build/assets/{Toolbar-CG7W1D-O.js → Toolbar-BsqjDjhG.js} +1 -1
  8. package/build/assets/{base-input-DoV-1XUt.js → base-input-CgYn_7GU.js} +1 -1
  9. package/build/assets/{createSuper-CvaFdVoD.js → createSuper-0pNNY1_M.js} +1 -1
  10. package/build/assets/{data-grid-overlay-editor-CCUG7ReD.js → data-grid-overlay-editor-CNFkKj8T.js} +1 -1
  11. package/build/assets/{downloader-B6rOwzu2.js → downloader-DGmYJOpb.js} +1 -1
  12. package/build/assets/{es6-CTcMcfqp.js → es6-irkMYhr9.js} +2 -2
  13. package/build/assets/{getPrototypeOf-CFHg57KG.js → getPrototypeOf-D0_3wfU4.js} +1 -1
  14. package/build/assets/{iframeResizer.contentWindow-DLNn1A7T.js → iframeResizer.contentWindow-D4yL-VeT.js} +1 -1
  15. package/build/assets/{index-Bp04iQqW.js → index-BByqVhYh.js} +1 -1
  16. package/build/assets/{index-D-lzdDJ5.js → index-BFCLs_X3.js} +1 -1
  17. package/build/assets/{index-CGhw9Sdf.js → index-BFkh2EDe.js} +1 -1
  18. package/build/assets/{index-CWiqZgRl.js → index-BKdmDn79.js} +1 -1
  19. package/build/assets/{index-CoKgwXo8.js → index-BM4uLW3s.js} +1 -1
  20. package/build/assets/{index-ByOIN0Gm.js → index-BQ4RtD02.js} +1 -1
  21. package/build/assets/{index-DjQcVgxO.js → index-BVyxD_B8.js} +1 -1
  22. package/build/assets/{index-hsTwnoRn.js → index-BXRfu-ak.js} +1 -1
  23. package/build/assets/{index-CW4i_Lge.js → index-BcpEGcBW.js} +1 -1
  24. package/build/assets/{index-Dwt05210.js → index-Bo6fA87g.js} +1 -1
  25. package/build/assets/{index-BzTZZCvL.js → index-C1elUt1E.js} +4 -4
  26. package/build/assets/{index-Cua9_98i.js → index-CbfNI9jm.js} +1 -1
  27. package/build/assets/{index-CIL1eIZN.js → index-CcWWS1JT.js} +1 -1
  28. package/build/assets/{index-CIs9EQe5.js → index-ChM6SngL.js} +1 -1
  29. package/build/assets/{index-BhkIHxDp.js → index-D2eWP7lT.js} +1 -1
  30. package/build/assets/{index-BrRb8POj.js → index-DBLWtqmb.js} +1 -1
  31. package/build/assets/{index-CSyyBx79.js → index-DE-qBTEd.js} +1 -1
  32. package/build/assets/{index-Df9nIm6O.js → index-DEXFHxro.js} +1 -1
  33. package/build/assets/{index-D9QNa8Xs.js → index-DUZJI1KN.js} +1 -1
  34. package/build/assets/{index-N6IvabtE.js → index-DVxRcwZL.js} +1 -1
  35. package/build/assets/{index-fudEipDa.js → index-DWA8E9x2.js} +1 -1
  36. package/build/assets/{index-BpeIvyJQ.js → index-DlLUjT1S.js} +1 -1
  37. package/build/assets/{index-DqxtC9MD.js → index-DmCANcEY.js} +1 -1
  38. package/build/assets/{index-qMuFpOqI.js → index-DrFZgW3n.js} +1 -1
  39. package/build/assets/{index-6rnmC53g.js → index-Dx6YQ-Hb.js} +1 -1
  40. package/build/assets/{index-xGO_nKX1.js → index-Hu3FoAZP.js} +1 -1
  41. package/build/assets/{index-DURajqPC.js → index-I5lK7nyO.js} +1 -1
  42. package/build/assets/{index-BTHCcLIl.js → index-ItgUgpY7.js} +1 -1
  43. package/build/assets/{index-DHFNQm8n.js → index-Pb86pUMm.js} +1 -1
  44. package/build/assets/{index-0aipcnh6.js → index-YUTOpyBs.js} +1 -1
  45. package/build/assets/{index-steA8SlM.js → index-ZUNcqgeq.js} +5 -5
  46. package/build/assets/{index-P_LN9wWJ.js → index-ce2FoF0m.js} +1 -1
  47. package/build/assets/{index-BHysWwrh.js → index-gVtKu3MD.js} +1 -1
  48. package/build/assets/{index-DtrE1h0V.js → index-m1mIjWp5.js} +1 -1
  49. package/build/assets/{index-RhMZ16-Y.js → index-w3QLWMIe.js} +1 -1
  50. package/build/assets/{index-C4j64dI5.js → index-xxcWnwsb.js} +1 -1
  51. package/build/assets/{index-OR2HlVVN.js → index-zflrmcBt.js} +1 -1
  52. package/build/assets/{input-BrXgmYe9.js → input-i4Ci2N7G.js} +1 -1
  53. package/build/assets/{memory-Bf74T19z.js → memory-BfVZ1OlY.js} +1 -1
  54. package/build/assets/{number-overlay-editor-20er5Sp-.js → number-overlay-editor-DZNxupwD.js} +1 -1
  55. package/build/assets/{sandbox-CV8SMiuv.js → sandbox-C-kTFbag.js} +1 -1
  56. package/build/assets/{slicedToArray-tqzlNjPF.js → slicedToArray--nOyZAEU.js} +1 -1
  57. package/build/assets/{textarea-DMefjquC.js → textarea-CpIIPJux.js} +1 -1
  58. package/build/assets/{timepicker-D5Qmkk9Q.js → timepicker-BNPmfeK3.js} +1 -1
  59. package/build/assets/{uniqueId-IQr2jcrE.js → uniqueId-BfZwKZCM.js} +1 -1
  60. package/build/assets/{useBasicWidgetState-Cqy4gnzY.js → useBasicWidgetState-D4lxC36U.js} +1 -1
  61. package/build/assets/{useOnInputChange-BD_aeagL.js → useOnInputChange-BtQcqF3z.js} +1 -1
  62. package/build/assets/{withFullScreenWrapper-DIS3bwns.js → withFullScreenWrapper-Cn2wnMdj.js} +1 -1
  63. package/build/assets/{worker-B1MO5Shr.js → worker-CzOlZWlF.js} +14 -11
  64. package/build/electron/worker.js +13 -10
  65. package/build/index.html +1 -1
  66. package/package.json +4 -4
  67. package/wheels/streamlit-1.41.0-cp312-none-any.whl +0 -0
@@ -1,2 +1,2 @@
1
- import{b2 as q,r as f,b3 as H,b4 as J,M as Q,b5 as l,j as d,a_ as Y,a$ as Z,b6 as ee,b7 as te,b0 as re,aK as ne,aX as oe,aG as _,aF as U,al as ie,a2 as ae}from"./index-BzTZZCvL.js";import{a as ce}from"./useBasicWidgetState-Cqy4gnzY.js";import"./FormClearHelper-DmeZ2QuQ.js";var le={primary:"primary",secondary:"secondary",tertiary:"tertiary"},A={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},ue={mini:"mini",default:"default",compact:"compact",large:"large"},R=Object.freeze({radio:"radio",checkbox:"checkbox"}),T=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==A.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});T.displayName="StyledRoot",T.displayName="StyledRoot";function G(e){"@babel/helpers - typeof";return G=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},G(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 se(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){N(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 fe(e,t){return be(e)||ye(e,t)||de(e,t)||pe()}function pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{b2 as q,r as f,b3 as H,b4 as J,M as Q,b5 as l,j as d,a_ as Y,a$ as Z,b6 as ee,b7 as te,b0 as re,aK as ne,aX as oe,aG as _,aF as U,al as ie,a2 as ae}from"./index-C1elUt1E.js";import{a as ce}from"./useBasicWidgetState-D4lxC36U.js";import"./FormClearHelper-BtlF8Otx.js";var le={primary:"primary",secondary:"secondary",tertiary:"tertiary"},A={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},ue={mini:"mini",default:"default",compact:"compact",large:"large"},R=Object.freeze({radio:"radio",checkbox:"checkbox"}),T=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==A.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});T.displayName="StyledRoot",T.displayName="StyledRoot";function G(e){"@babel/helpers - typeof";return G=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},G(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 se(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){N(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 fe(e,t){return be(e)||ye(e,t)||de(e,t)||pe()}function pe(){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 de(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 ye(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 be(e){if(Array.isArray(e))return e}function me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(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 ge(e,t,r){return he(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Se(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 ve(e){var t=Ee();return function(){var r=P(e),n;if(t){var o=P(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oe(this,n)}}function Oe(e,t){if(t&&(G(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 Ee(){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 P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var W=function(e){Se(r,e);var t=ve(r);function r(){var n;me(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)),N(F(n),"childRefs",{}),n}return ge(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?R.checkbox:u,m=o.children,y=o.selected,g=o.disabled,p=o.onClick,b=o.kind,S=o.shape,x=o.size,w=H(a.Root,T),k=fe(w,2),j=k[0],E=k[1],L=this.props["aria-label"]||this.props.ariaLabel,v=s===R.radio,$=f.Children.count(m);return f.createElement(J.Consumer,null,function(K){return f.createElement(j,z({"aria-label":L||K.buttongroup.ariaLabel,"data-baseweb":"button-group",role:v?"radiogroup":"group",$shape:S,$length:m.length},E),f.Children.map(m,function(h,C){if(!f.isValidElement(h))return null;var D=h.props.isSelected?h.props.isSelected:we(y,C);return v&&(n.childRefs[C]=f.createRef()),f.cloneElement(h,{disabled:g||h.props.disabled,isSelected:D,ref:v?n.childRefs[C]:void 0,tabIndex:!v||D||v&&(!y||y===-1)&&C===0?0:-1,onKeyDown:function(c){if(v){var O=Number(y)?Number(y):0;if(c.key==="ArrowUp"||c.key==="ArrowLeft"){c.preventDefault&&c.preventDefault();var I=O-1<0?$-1:O-1;p&&p(c,I),n.childRefs[I].current&&n.childRefs[I].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:b,onClick:function(c){g||(h.props.onClick&&h.props.onClick(c),p&&p(c,C))},shape:S,size:x,overrides:se({BaseButton:{style:function(c){var O=c.$theme;return m.length===1?{}:S!==A.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:v?"radio":"checkbox"}}},h.props.overrides)})}))})}}]),r}(f.Component);N(W,"defaultProps",{disabled:!1,onClick:function(){},shape:A.default,size:ue.default,kind:le.secondary});function je(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Le(e,t,r){return e==l.ClickMode.MULTI_SELECT?je(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Ce(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Re(e,t,r){const n=r===l.Style.PILLS?_.PILLS:r===l.Style.BORDERLESS?_.BORDERLESS_ICON:_.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?U.XSMALL:U.MEDIUM,i=r===l.Style.BORDERLESS?"lg":"base";return{element:d.jsxs(d.Fragment,{children:[t&&d.jsx(ie,{size:i,iconValue:t}),e&&d.jsx(ae,{source:e,allowHTML:!1})]}),kind:n,size:o}}function Pe(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 xe(e,t){return e&&(t=`${t}Active`),t}function De(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 Ie(e,t,r,n,o,i){const a=Pe(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(m,y){const{element:g,kind:p,size:b}=Re(u??"",s??void 0,i),S=xe(!!(a&&!e.selectedContent&&!e.selectedContentIcon),p);return d.jsx(oe,{...m,size:b,kind:S,children:g})})}function Me(e,t){return e.getIntArrayValue(t)}function _e(e){return e.default??null}function Ae(e){return e.value??null}function Te(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:u,style:s,label:m,labelVisibility:y,help:g}=r,p=Q(),[b,S]=ce({getStateFromWidgetMgr:Me,getDefaultStateFromProto:_e,getCurrStateFromProto:Ae,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),x=(j,E)=>{const L=Le(i,E,b);S({value:L,fromUi:!0})};let w;i===l.ClickMode.SINGLE_SELECT?w=R.radio:i===l.ClickMode.MULTI_SELECT&&(w=R.checkbox);const k=f.useMemo(()=>a.map((j,E)=>{const L=Ie(j,E,u,i,b,s);return d.jsx(L,{},`${j.content}-${E}`)}),[i,a,u,s,b]);return d.jsxs("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[d.jsx(Y,{label:m,disabled:t,labelVisibility:Z((y==null?void 0:y.value)??ee.LabelVisibilityOptions.COLLAPSED),children:g&&d.jsx(te,{children:d.jsx(re,{content:g,placement:ne.TOP})})}),d.jsx(W,{disabled:t,mode:w,onClick:x,selected:i===l.ClickMode.MULTI_SELECT?b:Ce(b),overrides:{Root:{style:f.useCallback(()=>De(s,p.spacing),[s,p.spacing])}},children:k})]})}const Ge=f.memo(Te);export{Ge as default};
@@ -1 +1 @@
1
- import{r,E as P,_ as $,c as R,ak as se,bZ as ne,F as K,c7 as y,B as m,j as l,a_ as de,a$ as ue,bc as ce,b0 as pe,aK as me,aY as G}from"./index-BzTZZCvL.js";import{s as be}from"./sprintf-C-r3gIuM.js";import{u as ge}from"./uniqueId-IQr2jcrE.js";import{u as fe}from"./FormClearHelper-DmeZ2QuQ.js";import{I as he}from"./InputInstructions-iKTPb-Lc.js";import{I as ye}from"./input-BrXgmYe9.js";import"./base-input-DoV-1XUt.js";var X=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});X.displayName="Minus";var Y=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const we=R("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),ve=R("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),Z=R("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.default,borderBottomRightRadius:e.radii.default},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),xe=R("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),"");function Ie(e){return m(e)||e===""?void 0:e}const Te=e=>(e.element.dataType===y.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,q=({step:e,dataType:t})=>e||(t===y.DataType.INT?1:.01),N=({value:e,format:t,step:a,dataType:w})=>{if(m(e))return null;let i=Ie(t);if(m(i)&&K(a)){const c=a.toString();w===y.DataType.FLOAT&&a!==0&&c.includes(".")&&(i=`%0.${c.split(".")[1].length}f`)}if(m(i))return e.toString();try{return be.sprintf(i,e)}catch{return String(e)}},ke=(e,t,a)=>m(e)?!1:e-t>=a,Ce=(e,t,a)=>m(e)?!1:e+t<=a,Re=({disabled:e,element:t,widgetMgr:a,width:w,theme:i,fragmentId:c})=>{var O;const{dataType:S,id:V,formId:p,default:B,format:F}=t,b=t.hasMin?t.min:-1/0,g=t.hasMax?t.max:1/0,[s,J]=r.useState(q(t)),M=Te({element:t,widgetMgr:a}),[f,v]=r.useState(!1),[n,x]=r.useState(M),[W,I]=r.useState(N({value:M,...t,step:s})),[A,U]=r.useState(!1),j=r.useRef(null),H=r.useRef(ge("number_input_")),T=ke(n,s,b),k=Ce(n,s,g),_=ne({formId:p}),Q=_?a.allowFormEnterToSubmit(p):f,ee=A&&w>i.breakpoints.hideWidgetDetails;r.useEffect(()=>{J(q({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]);const d=r.useCallback(({value:o,source:u})=>{var h;if(K(o)&&(b>o||o>g))(h=j.current)==null||h.reportValidity();else{const C=o??B??null;switch(S){case y.DataType.INT:a.setIntValue({id:V,formId:p},C,u,c);break;case y.DataType.FLOAT:a.setDoubleValue({id:V,formId:p},C,u,c);break;default:throw new Error("Invalid data type")}v(!1),x(C),I(N({value:C,dataType:S,format:F,step:s}))}},[b,g,j,a,c,s,S,V,p,B,F]),te=r.useCallback(()=>{f&&d({value:n,source:{fromUi:!0}}),U(!1)},[f,n,d]),re=r.useCallback(()=>{U(!0)},[]),L=r.useCallback(()=>{const{value:o}=t;t.setValue=!1,x(o??null),I(N({value:o??null,...t,step:s})),d({value:o??null,source:{fromUi:!1}})},[t,s,d]);r.useEffect(()=>{t.setValue?L():d({value:n,source:{fromUi:!1}})},[]),t.setValue&&L();const z=m(t.default)&&!e,ae=r.useCallback(()=>{const o=t.default??null;x(o),d({value:o,source:{fromUi:!0}})},[t]);fe({element:t,widgetMgr:a,onFormCleared:ae});const oe=o=>{const{value:u}=o.target;if(u==="")v(!0),x(null),I(null);else{let h;t.dataType===y.DataType.INT?h=parseInt(u,10):h=parseFloat(u),v(!0),x(h),I(u)}},D=r.useCallback(()=>{k&&(v(!0),d({value:(n??b)+s,source:{fromUi:!0}}))},[n,b,s,k]),E=r.useCallback(()=>{T&&(v(!0),d({value:(n??g)-s,source:{fromUi:!0}}))},[n,g,s,T]),ie=r.useCallback(o=>{const{key:u}=o;switch(u){case"ArrowUp":o.preventDefault(),D();break;case"ArrowDown":o.preventDefault(),E();break}},[D,E]),le=r.useCallback(o=>{o.key==="Enter"&&(f&&d({value:n,source:{fromUi:!0}}),a.allowFormEnterToSubmit(p)&&a.submitForm(p,c))},[f,n,d,a,p,c]);return l.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:w},children:[l.jsx(de,{label:t.label,disabled:e,labelVisibility:ue((O=t.labelVisibility)==null?void 0:O.value),htmlFor:H.current,children:t.help&&l.jsx(ce,{children:l.jsx(pe,{content:t.help,placement:me.TOP_RIGHT})})}),l.jsxs(we,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[l.jsx(ye,{type:"number",inputRef:j,value:W??"",placeholder:t.placeholder,onBlur:te,onFocus:re,onChange:oe,onKeyPress:le,onKeyDown:ie,clearable:z,clearOnEscape:z,disabled:e,"aria-label":t.label,id:H.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:i.colors.darkGray,padding:i.spacing.threeXS,height:i.sizes.clearIconSize,width:i.sizes.clearIconSize,":hover":{fill:i.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:g,type:"number",inputMode:""},style:{lineHeight:i.lineHeights.inputWidget,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),w>i.breakpoints.hideNumberInputControls&&l.jsxs(ve,{children:[l.jsx(Z,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!T||e,tabIndex:-1,children:l.jsx(G,{content:X,size:"xs",color:T?"inherit":"disabled"})}),l.jsx(Z,{"data-testid":"stNumberInputStepUp",onClick:D,disabled:!k||e,tabIndex:-1,children:l.jsx(G,{content:Y,size:"xs",color:k?"inherit":"disabled"})})]})]}),ee&&l.jsx(xe,{clearable:z,children:l.jsx(he,{dirty:f,value:W??"",inForm:_,allowEnterToSubmit:Q})})]})},Se=se(Re);export{Se as default};
1
+ import{r,E as P,_ as $,c as R,ak as se,bZ as ne,F as K,c7 as y,B as m,j as l,a_ as de,a$ as ue,bc as ce,b0 as pe,aK as me,aY as G}from"./index-C1elUt1E.js";import{s as be}from"./sprintf-C-r3gIuM.js";import{u as ge}from"./uniqueId-BfZwKZCM.js";import{u as fe}from"./FormClearHelper-BtlF8Otx.js";import{I as he}from"./InputInstructions-DJSzEvIq.js";import{I as ye}from"./input-i4Ci2N7G.js";import"./base-input-CgYn_7GU.js";var X=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});X.displayName="Minus";var Y=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const we=R("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),ve=R("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),Z=R("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.default,borderBottomRightRadius:e.radii.default},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),xe=R("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),"");function Ie(e){return m(e)||e===""?void 0:e}const Te=e=>(e.element.dataType===y.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,q=({step:e,dataType:t})=>e||(t===y.DataType.INT?1:.01),N=({value:e,format:t,step:a,dataType:w})=>{if(m(e))return null;let i=Ie(t);if(m(i)&&K(a)){const c=a.toString();w===y.DataType.FLOAT&&a!==0&&c.includes(".")&&(i=`%0.${c.split(".")[1].length}f`)}if(m(i))return e.toString();try{return be.sprintf(i,e)}catch{return String(e)}},ke=(e,t,a)=>m(e)?!1:e-t>=a,Ce=(e,t,a)=>m(e)?!1:e+t<=a,Re=({disabled:e,element:t,widgetMgr:a,width:w,theme:i,fragmentId:c})=>{var O;const{dataType:S,id:V,formId:p,default:B,format:F}=t,b=t.hasMin?t.min:-1/0,g=t.hasMax?t.max:1/0,[s,J]=r.useState(q(t)),M=Te({element:t,widgetMgr:a}),[f,v]=r.useState(!1),[n,x]=r.useState(M),[W,I]=r.useState(N({value:M,...t,step:s})),[A,U]=r.useState(!1),j=r.useRef(null),H=r.useRef(ge("number_input_")),T=ke(n,s,b),k=Ce(n,s,g),_=ne({formId:p}),Q=_?a.allowFormEnterToSubmit(p):f,ee=A&&w>i.breakpoints.hideWidgetDetails;r.useEffect(()=>{J(q({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]);const d=r.useCallback(({value:o,source:u})=>{var h;if(K(o)&&(b>o||o>g))(h=j.current)==null||h.reportValidity();else{const C=o??B??null;switch(S){case y.DataType.INT:a.setIntValue({id:V,formId:p},C,u,c);break;case y.DataType.FLOAT:a.setDoubleValue({id:V,formId:p},C,u,c);break;default:throw new Error("Invalid data type")}v(!1),x(C),I(N({value:C,dataType:S,format:F,step:s}))}},[b,g,j,a,c,s,S,V,p,B,F]),te=r.useCallback(()=>{f&&d({value:n,source:{fromUi:!0}}),U(!1)},[f,n,d]),re=r.useCallback(()=>{U(!0)},[]),L=r.useCallback(()=>{const{value:o}=t;t.setValue=!1,x(o??null),I(N({value:o??null,...t,step:s})),d({value:o??null,source:{fromUi:!1}})},[t,s,d]);r.useEffect(()=>{t.setValue?L():d({value:n,source:{fromUi:!1}})},[]),t.setValue&&L();const z=m(t.default)&&!e,ae=r.useCallback(()=>{const o=t.default??null;x(o),d({value:o,source:{fromUi:!0}})},[t]);fe({element:t,widgetMgr:a,onFormCleared:ae});const oe=o=>{const{value:u}=o.target;if(u==="")v(!0),x(null),I(null);else{let h;t.dataType===y.DataType.INT?h=parseInt(u,10):h=parseFloat(u),v(!0),x(h),I(u)}},D=r.useCallback(()=>{k&&(v(!0),d({value:(n??b)+s,source:{fromUi:!0}}))},[n,b,s,k]),E=r.useCallback(()=>{T&&(v(!0),d({value:(n??g)-s,source:{fromUi:!0}}))},[n,g,s,T]),ie=r.useCallback(o=>{const{key:u}=o;switch(u){case"ArrowUp":o.preventDefault(),D();break;case"ArrowDown":o.preventDefault(),E();break}},[D,E]),le=r.useCallback(o=>{o.key==="Enter"&&(f&&d({value:n,source:{fromUi:!0}}),a.allowFormEnterToSubmit(p)&&a.submitForm(p,c))},[f,n,d,a,p,c]);return l.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:w},children:[l.jsx(de,{label:t.label,disabled:e,labelVisibility:ue((O=t.labelVisibility)==null?void 0:O.value),htmlFor:H.current,children:t.help&&l.jsx(ce,{children:l.jsx(pe,{content:t.help,placement:me.TOP_RIGHT})})}),l.jsxs(we,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[l.jsx(ye,{type:"number",inputRef:j,value:W??"",placeholder:t.placeholder,onBlur:te,onFocus:re,onChange:oe,onKeyPress:le,onKeyDown:ie,clearable:z,clearOnEscape:z,disabled:e,"aria-label":t.label,id:H.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:i.colors.darkGray,padding:i.spacing.threeXS,height:i.sizes.clearIconSize,width:i.sizes.clearIconSize,":hover":{fill:i.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:g,type:"number",inputMode:""},style:{lineHeight:i.lineHeights.inputWidget,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),w>i.breakpoints.hideNumberInputControls&&l.jsxs(ve,{children:[l.jsx(Z,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!T||e,tabIndex:-1,children:l.jsx(G,{content:X,size:"xs",color:T?"inherit":"disabled"})}),l.jsx(Z,{"data-testid":"stNumberInputStepUp",onClick:D,disabled:!k||e,tabIndex:-1,children:l.jsx(G,{content:Y,size:"xs",color:k?"inherit":"disabled"})})]})]}),ee&&l.jsx(xe,{clearable:z,children:l.jsx(he,{dirty:f,value:W??"",inForm:_,allowEnterToSubmit:Q})})]})},Se=se(Re);export{Se as default};
@@ -1,4 +1,4 @@
1
- import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-BzTZZCvL.js";import{a as un}from"./useBasicWidgetState-Cqy4gnzY.js";import{D as oe,a as ae,T as cn,l as Ve}from"./timepicker-D5Qmkk9Q.js";import{I as pn}from"./input-BrXgmYe9.js";import{I as dn}from"./base-input-DoV-1XUt.js";import"./FormClearHelper-DmeZ2QuQ.js";import"./getPrototypeOf-CFHg57KG.js";import"./createSuper-CvaFdVoD.js";var fn=["title","size","color","overrides"];function Ye(){return Ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ye.apply(this,arguments)}function hn(t,r){if(t==null)return{};var o=yn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function yn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function gn(t,r){return Dn(t)||vn(t,r)||bn(t,r)||mn()}function mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-C1elUt1E.js";import{a as un}from"./useBasicWidgetState-D4lxC36U.js";import{D as oe,a as ae,T as cn,l as Ve}from"./timepicker-BNPmfeK3.js";import{I as pn}from"./input-i4Ci2N7G.js";import{I as dn}from"./base-input-CgYn_7GU.js";import"./FormClearHelper-BtlF8Otx.js";import"./getPrototypeOf-D0_3wfU4.js";import"./createSuper-0pNNY1_M.js";var fn=["title","size","color","overrides"];function Ye(){return Ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ye.apply(this,arguments)}function hn(t,r){if(t==null)return{};var o=yn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function yn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function gn(t,r){return Dn(t)||vn(t,r)||bn(t,r)||mn()}function mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bn(t,r){if(t){if(typeof t=="string")return nr(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nr(t,r)}}function nr(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function vn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Dn(t){if(Array.isArray(t))return t}function Sn(t,r){var o=Kt(),n=gn(o,2),e=n[1],a=t.title,i=a===void 0?"Left":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=hn(t,fn),d=Xt({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,Ye({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const or=m.forwardRef(Sn);var On=["title","size","color","overrides"];function We(){return We=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},We.apply(this,arguments)}function wn(t,r){if(t==null)return{};var o=kn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function kn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function Cn(t,r){return Pn(t)||Hn(t,r)||jn(t,r)||Mn()}function Mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jn(t,r){if(t){if(typeof t=="string")return ar(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ar(t,r)}}function ar(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function Hn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Pn(t){if(Array.isArray(t))return t}function En(t,r){var o=Kt(),n=Cn(o,2),e=n[1],a=t.title,i=a===void 0?"Right":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=wn(t,On),d=Xt({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,We({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const ir=m.forwardRef(En);var lr={exports:{}};function An(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var _e=An(m),In=zr;function xn(t,r){for(var o=Object.getOwnPropertyNames(r),n=0;n<o.length;n++){var e=o[n],a=Object.getOwnPropertyDescriptor(r,e);a&&a.configurable&&t[e]===void 0&&Object.defineProperty(t,e,a)}return t}function ze(){return(ze=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function Rn(t,r){t.prototype=Object.create(r.prototype),xn(t.prototype.constructor=t,r)}function Ln(t,r){if(t==null)return{};var o,n,e={},a=Object.keys(t);for(n=0;n<a.length;n++)o=a[n],0<=r.indexOf(o)||(e[o]=t[o]);return e}function ie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var $n=function(t,r,o,n,e,a,i,l){if(!t){var u;if(r===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[o,n,e,a,i,l],y=0;(u=new Error(r.replace(/%s/g,function(){return s[y++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},sr=$n;function ur(t,r,o){if("selectionStart"in t&&"selectionEnd"in t)t.selectionStart=r,t.selectionEnd=o;else{var n=t.createTextRange();n.collapse(!0),n.moveStart("character",r),n.moveEnd("character",o-r),n.select()}}function Bn(t){var r=0,o=0;if("selectionStart"in t&&"selectionEnd"in t)r=t.selectionStart,o=t.selectionEnd;else{var n=document.selection.createRange();n.parentElement()===t&&(r=-n.moveStart("character",-t.value.length),o=-n.moveEnd("character",-t.value.length))}return{start:r,end:o,length:o-r}}var Tn={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},Fn="_";function cr(t,r,o){var n="",e="",a=null,i=[];if(r===void 0&&(r=Fn),o==null&&(o=Tn),!t||typeof t!="string")return{maskChar:r,formatChars:o,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var l=!1;return t.split("").forEach(function(u){l=!l&&u==="\\"||(l||!o[u]?(i.push(n.length),n.length===i.length-1&&(e+=u)):a=n.length+1,n+=u,!1)}),{maskChar:r,formatChars:o,prefix:e,mask:n,lastEditablePosition:a,permanents:i}}function K(t,r){return t.permanents.indexOf(r)!==-1}function Oe(t,r,o){var n=t.mask,e=t.formatChars;if(!o)return!1;if(K(t,r))return n[r]===o;var a=e[n[r]];return new RegExp(a).test(o)}function pr(t,r){return r.split("").every(function(o,n){return K(t,n)||!Oe(t,n,o)})}function fe(t,r){var o=t.maskChar,n=t.prefix;if(!o){for(;r.length>n.length&&K(t,r.length-1);)r=r.slice(0,r.length-1);return r.length}for(var e=n.length,a=r.length;a>=n.length;a--){var i=r[a];if(!K(t,a)&&Oe(t,a,i)){e=a+1;break}}return e}function dr(t,r){return fe(t,r)===t.mask.length}function te(t,r){var o=t.maskChar,n=t.mask,e=t.prefix;if(!o){for((r=Ue(t,"",r,0)).length<e.length&&(r=e);r.length<n.length&&K(t,r.length);)r+=n[r.length];return r}if(r)return Ue(t,te(t,""),r,0);for(var a=0;a<n.length;a++)K(t,a)?r+=n[a]:r+=o;return r}function Nn(t,r,o,n){var e=o+n,a=t.maskChar,i=t.mask,l=t.prefix,u=r.split("");if(a)return u.map(function(y,p){return p<o||e<=p?y:K(t,p)?i[p]:a}).join("");for(var s=e;s<u.length;s++)K(t,s)&&(u[s]="");return o=Math.max(l.length,o),u.splice(o,e-o),r=u.join(""),te(t,r)}function Ue(t,r,o,n){var e=t.mask,a=t.maskChar,i=t.prefix,l=o.split(""),u=dr(t,r);return!a&&n>r.length&&(r+=e.slice(r.length,n)),l.every(function(s){for(;f=s,K(t,d=n)&&f!==e[d];){if(n>=r.length&&(r+=e[n]),y=s,p=n,a&&K(t,p)&&y===a)return!0;if(++n>=e.length)return!1}var y,p,d,f;return!Oe(t,n,s)&&s!==a||(n<r.length?r=a||u||n<i.length?r.slice(0,n)+s+r.slice(n+1):(r=r.slice(0,n)+s+r.slice(n),te(t,r)):a||(r+=s),++n<e.length)}),r}function Vn(t,r,o,n){var e=t.mask,a=t.maskChar,i=o.split(""),l=n;return i.every(function(u){for(;y=u,K(t,s=n)&&y!==e[s];)if(++n>=e.length)return!1;var s,y;return(Oe(t,n,u)||u===a)&&n++,n<e.length}),n-l}function Yn(t,r){for(var o=r;0<=o;--o)if(!K(t,o))return o;return null}function he(t,r){for(var o=t.mask,n=r;n<o.length;++n)if(!K(t,n))return n;return null}function qe(t){return t||t===0?t+"":""}function Wn(t,r,o,n,e){var a=t.mask,i=t.prefix,l=t.lastEditablePosition,u=r,s="",y=0,p=0,d=Math.min(e.start,o.start);return o.end>e.start?p=(y=Vn(t,n,s=u.slice(e.start,o.end),d))?e.length:0:u.length<n.length&&(p=n.length-u.length),u=n,p&&(p===1&&!e.length&&(d=e.start===o.start?he(t,o.start):Yn(t,o.start)),u=Nn(t,u,d,p)),u=Ue(t,u,s,d),(d+=y)>=a.length?d=a.length:d<i.length&&!y?d=i.length:d>=i.length&&d<l&&y&&(d=he(t,d)),s||(s=null),{value:u=te(t,u),enteredString:s,selection:{start:d,end:d}}}function _n(){var t=new RegExp("windows","i"),r=new RegExp("phone","i"),o=navigator.userAgent;return t.test(o)&&r.test(o)}function q(t){return typeof t=="function"}function zn(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function fr(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function hr(t){return(fr()?zn():function(){return setTimeout(t,1e3/60)})(t)}function Ke(t){(fr()||clearTimeout)(t)}var Un=function(t){function r(n){var e=t.call(this,n)||this;e.focused=!1,e.mounted=!1,e.previousSelection=null,e.selectionDeferId=null,e.saveSelectionLoopDeferId=null,e.saveSelectionLoop=function(){e.previousSelection=e.getSelection(),e.saveSelectionLoopDeferId=hr(e.saveSelectionLoop)},e.runSaveSelectionLoop=function(){e.saveSelectionLoopDeferId===null&&e.saveSelectionLoop()},e.stopSaveSelectionLoop=function(){e.saveSelectionLoopDeferId!==null&&(Ke(e.saveSelectionLoopDeferId),e.saveSelectionLoopDeferId=null,e.previousSelection=null)},e.getInputDOMNode=function(){if(!e.mounted)return null;var c=In.findDOMNode(ie(ie(e))),h=typeof window<"u"&&c instanceof window.Element;if(c&&!h)return null;if(c.nodeName!=="INPUT"&&(c=c.querySelector("input")),!c)throw new Error("react-input-mask: inputComponent doesn't contain input node");return c},e.getInputValue=function(){var c=e.getInputDOMNode();return c?c.value:null},e.setInputValue=function(c){var h=e.getInputDOMNode();h&&(e.value=c,h.value=c)},e.setCursorToEnd=function(){var c=fe(e.maskOptions,e.value),h=he(e.maskOptions,c);h!==null&&e.setCursorPosition(h)},e.setSelection=function(c,h,g){g===void 0&&(g={});var b=e.getInputDOMNode(),v=e.isFocused();b&&v&&(g.deferred||ur(b,c,h),e.selectionDeferId!==null&&Ke(e.selectionDeferId),e.selectionDeferId=hr(function(){e.selectionDeferId=null,ur(b,c,h)}),e.previousSelection={start:c,end:h,length:Math.abs(h-c)})},e.getSelection=function(){return Bn(e.getInputDOMNode())},e.getCursorPosition=function(){return e.getSelection().start},e.setCursorPosition=function(c){e.setSelection(c,c)},e.isFocused=function(){return e.focused},e.getBeforeMaskedValueChangeConfig=function(){var c=e.maskOptions,h=c.mask,g=c.maskChar,b=c.permanents,v=c.formatChars;return{mask:h,maskChar:g,permanents:b,alwaysShowMask:!!e.props.alwaysShowMask,formatChars:v}},e.isInputAutofilled=function(c,h,g,b){var v=e.getInputDOMNode();try{if(v.matches(":-webkit-autofill"))return!0}catch{}return!e.focused||b.end<g.length&&h.end===c.length},e.onChange=function(c){var h=ie(ie(e)).beforePasteState,g=ie(ie(e)).previousSelection,b=e.props.beforeMaskedValueChange,v=e.getInputValue(),D=e.value,S=e.getSelection();e.isInputAutofilled(v,S,D,g)&&(D=te(e.maskOptions,""),g={start:0,end:0,length:0}),h&&(g=h.selection,D=h.value,S={start:g.start+v.length,end:g.start+v.length,length:0},v=D.slice(0,g.start)+v+D.slice(g.end),e.beforePasteState=null);var P=Wn(e.maskOptions,v,S,D,g),j=P.enteredString,k=P.selection,H=P.value;if(q(b)){var O=b({value:H,selection:k},{value:D,selection:g},j,e.getBeforeMaskedValueChangeConfig());H=O.value,k=O.selection}e.setInputValue(H),q(e.props.onChange)&&e.props.onChange(c),e.isWindowsPhoneBrowser?e.setSelection(k.start,k.end,{deferred:!0}):e.setSelection(k.start,k.end)},e.onFocus=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions,b=g.mask,v=g.prefix;if(e.focused=!0,e.mounted=!0,b){if(e.value)fe(e.maskOptions,e.value)<e.maskOptions.mask.length&&e.setCursorToEnd();else{var D=te(e.maskOptions,v),S=te(e.maskOptions,D),P=fe(e.maskOptions,S),j=he(e.maskOptions,P),k={start:j,end:j};if(q(h)){var H=h({value:S,selection:k},{value:e.value,selection:null},null,e.getBeforeMaskedValueChangeConfig());S=H.value,k=H.selection}var O=S!==e.getInputValue();O&&e.setInputValue(S),O&&q(e.props.onChange)&&e.props.onChange(c),e.setSelection(k.start,k.end)}e.runSaveSelectionLoop()}q(e.props.onFocus)&&e.props.onFocus(c)},e.onBlur=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions.mask;if(e.stopSaveSelectionLoop(),e.focused=!1,g&&!e.props.alwaysShowMask&&pr(e.maskOptions,e.value)){var b="";q(h)&&(b=h({value:b,selection:null},{value:e.value,selection:e.previousSelection},null,e.getBeforeMaskedValueChangeConfig()).value);var v=b!==e.getInputValue();v&&e.setInputValue(b),v&&q(e.props.onChange)&&e.props.onChange(c)}q(e.props.onBlur)&&e.props.onBlur(c)},e.onMouseDown=function(c){if(!e.focused&&document.addEventListener){e.mouseDownX=c.clientX,e.mouseDownY=c.clientY,e.mouseDownTime=new Date().getTime();var h=function g(b){if(document.removeEventListener("mouseup",g),e.focused){var v=Math.abs(b.clientX-e.mouseDownX),D=Math.abs(b.clientY-e.mouseDownY),S=Math.max(v,D),P=new Date().getTime()-e.mouseDownTime;(S<=10&&P<=200||S<=5&&P<=300)&&e.setCursorToEnd()}};document.addEventListener("mouseup",h)}q(e.props.onMouseDown)&&e.props.onMouseDown(c)},e.onPaste=function(c){q(e.props.onPaste)&&e.props.onPaste(c),c.defaultPrevented||(e.beforePasteState={value:e.getInputValue(),selection:e.getSelection()},e.setInputValue(""))},e.handleRef=function(c){e.props.children==null&&q(e.props.inputRef)&&e.props.inputRef(c)};var a=n.mask,i=n.maskChar,l=n.formatChars,u=n.alwaysShowMask,s=n.beforeMaskedValueChange,y=n.defaultValue,p=n.value;e.maskOptions=cr(a,i,l),y==null&&(y=""),p==null&&(p=y);var d=qe(p);if(e.maskOptions.mask&&(u||d)&&(d=te(e.maskOptions,d),q(s))){var f=n.value;n.value==null&&(f=y),d=s({value:d,selection:null},{value:f=qe(f),selection:null},null,e.getBeforeMaskedValueChangeConfig()).value}return e.value=d,e}Rn(r,t);var o=r.prototype;return o.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=_n(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},o.componentDidUpdate=function(){var n=this.previousSelection,e=this.props,a=e.beforeMaskedValueChange,i=e.alwaysShowMask,l=e.mask,u=e.maskChar,s=e.formatChars,y=this.maskOptions,p=i||this.isFocused(),d=this.props.value!=null,f=d?qe(this.props.value):this.value,c=n?n.start:null;if(this.maskOptions=cr(l,u,s),this.maskOptions.mask){!y.mask&&this.isFocused()&&this.runSaveSelectionLoop();var h=this.maskOptions.mask&&this.maskOptions.mask!==y.mask;if(y.mask||d||(f=this.getInputValue()),(h||this.maskOptions.mask&&(f||p))&&(f=te(this.maskOptions,f)),h){var g=fe(this.maskOptions,f);(c===null||g<c)&&(c=dr(this.maskOptions,f)?g:he(this.maskOptions,g))}!this.maskOptions.mask||!pr(this.maskOptions,f)||p||d&&this.props.value||(f="");var b={start:c,end:c};if(q(a)){var v=a({value:f,selection:b},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());f=v.value,b=v.selection}this.value=f;var D=this.getInputValue()!==this.value;D?(this.setInputValue(this.value),this.forceUpdate()):h&&this.forceUpdate();var S=!1;b.start!=null&&b.end!=null&&(S=!n||n.start!==b.start||n.end!==b.end),(S||D)&&this.setSelection(b.start,b.end)}else y.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},o.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&Ke(this.selectionDeferId),this.stopSaveSelectionLoop()},o.render=function(){var n,e=this.props,a=(e.mask,e.alwaysShowMask,e.maskChar,e.formatChars,e.inputRef,e.beforeMaskedValueChange,e.children),i=Ln(e,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(a){q(a)||sr(!1);var l=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],u=ze({},i);l.forEach(function(y){return delete u[y]}),n=a(u),l.filter(function(y){return n.props[y]!=null&&n.props[y]!==i[y]}).length&&sr(!1)}else n=_e.createElement("input",ze({ref:this.handleRef},i));var s={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(i.disabled||i.readOnly||(s.onChange=this.onChange,s.onPaste=this.onPaste,s.onMouseDown=this.onMouseDown),i.value!=null&&(s.value=this.value)),n=_e.cloneElement(n,s)},r}(_e.Component),qn=Un;lr.exports=qn;var Kn=lr.exports;const Xn=Ur(Kn);var Qn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Zn=["Input"],Gn=["mask","maskChar","overrides"];function yr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Xe(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?yr(Object(o),!0).forEach(function(n){Jn(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):yr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function Jn(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function we(t){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},we(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ye.apply(this,arguments)}function Qe(t,r){if(t==null)return{};var o=eo(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function eo(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}var gr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var o=t.onChange,n=t.onFocus,e=t.onBlur,a=t.value,i=t.disabled,l=t.readOnly,u=Qe(t,Qn);return m.createElement(Xn,ye({onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},u),function(s){return m.createElement(dn,ye({ref:r,onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},s))})});gr.displayName="MaskOverride";function mr(t){var r=t.mask,o=t.maskChar,n=t.overrides;n=n===void 0?{}:n;var e=n.Input,a=e===void 0?{}:e,i=Qe(n,Zn),l=Qe(t,Gn),u=gr,s={},y={};typeof a=="function"?u=a:we(a)==="object"&&(u=a.component||u,s=a.props||{},y=a.style||{}),we(s)==="object"&&(s=Xe(Xe({},s),{},{mask:s.mask||r,maskChar:s.maskChar||o}));var p=Xe({Input:{component:u,props:s,style:y}},i);return m.createElement(pn,ye({},l,{overrides:p}))}mr.defaultProps={maskChar:" "};var Ze=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),br=[0,1,2,3,4,5,6],to=[0,1,2,3,4,5,6,7,8,9,10,11],T={high:"high",default:"default"},re={startDate:"startDate",endDate:"endDate"},ro={default:"default",locked:"locked"};function vr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function le(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?vr(Object(o),!0).forEach(function(n){no(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):vr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function no(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var Ge=x("label",function(t){var r=t.$disabled,o=t.$theme,n=o.colors,e=o.typography;return le(le({},e.font250),{},{width:"100%",color:r?n.contentSecondary:n.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ge.displayName="Label",Ge.displayName="Label";var Je=x("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Je.displayName="LabelContainer",Je.displayName="LabelContainer";var et=x("span",function(t){var r=t.$disabled,o=t.$counterError,n=t.$theme,e=n.colors,a=n.typography;return le(le({},a.font100),{},{flex:0,width:"100%",color:o?e.negative400:r?e.contentSecondary:e.contentPrimary})});et.displayName="LabelEndEnhancer",et.displayName="LabelEndEnhancer";var tt=x("div",function(t){var r=t.$error,o=t.$positive,n=t.$theme,e=n.colors,a=n.sizing,i=n.typography,l=e.contentSecondary;return r?l=e.negative400:o&&(l=e.positive400),le(le({},i.font100),{},{color:l,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});tt.displayName="Caption",tt.displayName="Caption";var rt=x("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});rt.displayName="ControlContainer",rt.displayName="ControlContainer";function ne(){return ne=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ne.apply(this,arguments)}function ke(t){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ke(t)}function oo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ao(t,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function io(t,r,o){return ao(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&nt(t,r)}function nt(t,r){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},nt(t,r)}function so(t){var r=po();return function(){var o=Ce(t),n;if(r){var e=Ce(this).constructor;n=Reflect.construct(o,arguments,e)}else n=o.apply(this,arguments);return uo(this,n)}}function uo(t,r){if(r&&(ke(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return co(t)}function co(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function po(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ce(t)}function fo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ho(t,r,o,n){return r&&typeof r!="boolean"?typeof r=="function"?r(n):r:o&&typeof o!="boolean"?typeof o=="function"?o(n):o:t?typeof t=="function"?t(n):t:null}var ot=function(t){lo(o,t);var r=so(o);function o(){return oo(this,o),r.apply(this,arguments)}return io(o,[{key:"render",value:function(){var n=this.props,e=n.overrides,a=e.Label,i=e.LabelEndEnhancer,l=e.LabelContainer,u=e.Caption,s=e.ControlContainer,y=n.label,p=n.caption,d=n.disabled,f=n.error,c=n.positive,h=n.htmlFor,g=n.children,b=n.counter,v=m.Children.only(g).props,D={$disabled:!!d,$error:!!f,$positive:!!c},S=ue(a)||Ge,P=ue(i)||et,j=ue(l)||Je,k=ue(u)||tt,H=ue(s)||rt,O=ho(p,f,c,D),M=this.props.labelEndEnhancer;if(b){var C=null,w=null,I=null;ke(b)==="object"&&(w=b.length,C=b.maxLength,I=b.error),C=C||v.maxLength,w==null&&typeof v.value=="string"&&(w=v.value.length),w==null&&(w=0),D.$length=w,C==null?M||(M="".concat(w)):(D.$maxLength=w,M||(M="".concat(w,"/").concat(C)),w>C&&I==null&&(I=!0)),I&&(D.$error=!0,D.$counterError=!0)}return m.createElement(m.Fragment,null,y&&m.createElement(j,ne({},D,ce(l)),m.createElement(S,ne({"data-baseweb":"form-control-label",htmlFor:h||v.id},D,ce(a)),typeof y=="function"?y(D):y),!!M&&m.createElement(P,ne({},D,ce(i)),typeof M=="function"?M(D):M)),m.createElement(qr,null,function(G){return m.createElement(H,ne({"data-baseweb":"form-control-container"},D,ce(s)),m.Children.map(g,function(z,Se){if(z){var A=z.key||String(Se);return m.cloneElement(z,{key:A,"aria-errormessage":f?G:null,"aria-describedby":p||c?G:null,disabled:v.disabled||d,error:typeof v.error<"u"?v.error:D.$error,positive:typeof v.positive<"u"?v.positive:D.$positive})}}),(!!p||!!f||c)&&m.createElement(k,ne({"data-baseweb":"form-control-caption",id:G},D,ce(u)),O))}))}}]),o}(m.Component);fo(ot,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Dr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Sr(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Dr(Object(o),!0).forEach(function(n){yo(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Dr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function yo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var go=function(t){return to.map(function(r){return{id:r.toString(),label:t(r)}})},mo=function(t,r){return t.map(function(o){return r.includes(Number(o.id))?o:Sr(Sr({},o),{},{disabled:!0})})},bo=function(t){var r=t.filterMonthsList,o=t.formatMonthLabel,n=go(o);return r&&(n=mo(n,r)),n};function vo(t){var r=t.$range,o=r===void 0?!1:r,n=t.$disabled,e=n===void 0?!1:n,a=t.$isHighlighted,i=a===void 0?!1:a,l=t.$isHovered,u=l===void 0?!1:l,s=t.$selected,y=s===void 0?!1:s,p=t.$hasRangeSelected,d=p===void 0?!1:p,f=t.$startDate,c=f===void 0?!1:f,h=t.$endDate,g=h===void 0?!1:h,b=t.$pseudoSelected,v=b===void 0?!1:b,D=t.$hasRangeHighlighted,S=D===void 0?!1:D,P=t.$pseudoHighlighted,j=P===void 0?!1:P,k=t.$hasRangeOnRight,H=k===void 0?!1:k,O=t.$startOfMonth,M=O===void 0?!1:O,C=t.$endOfMonth,w=C===void 0?!1:C,I=t.$outsideMonth,G=I===void 0?!1:I;return"".concat(+o).concat(+e).concat(+(i||u)).concat(+y).concat(+d).concat(+c).concat(+g).concat(+v).concat(+S).concat(+j).concat(+(S&&!j&&H)).concat(+(S&&!j&&!H)).concat(+M).concat(+w).concat(+G)}function Do(t,r){return ko(t)||wo(t,r)||Oo(t,r)||So()}function So(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(t,r){if(t){if(typeof t=="string")return Or(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Or(t,r)}}function Or(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function wo(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function ko(t){if(Array.isArray(t))return t}function wr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function B(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?wr(Object(o),!0).forEach(function(n){ge(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):wr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ge(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var at=x("div",function(t){var r=t.$separateRangeInputs;return B({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});at.displayName="StyledInputWrapper",at.displayName="StyledInputWrapper";var it=x("div",function(t){var r=t.$theme;return B(B({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});it.displayName="StyledInputLabel",it.displayName="StyledInputLabel";var lt=x("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});lt.displayName="StyledStartDate",lt.displayName="StyledStartDate";var st=x("div",function(t){return t.$theme,{width:"100%"}});st.displayName="StyledEndDate",st.displayName="StyledEndDate";var ut=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.borders;return B(B({},o.font200),{},{color:n.calendarForeground,backgroundColor:n.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});ut.displayName="StyledRoot",ut.displayName="StyledRoot";var ct=x("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Ze.vertical?"column":"row"}});ct.displayName="StyledMonthContainer",ct.displayName="StyledMonthContainer";var pt=x("div",function(t){var r=t.$theme.sizing,o=t.$density;return{paddingTop:r.scale300,paddingBottom:o===T.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});pt.displayName="StyledCalendarContainer",pt.displayName="StyledCalendarContainer";var Me=x("div",function(t){var r=t.$theme,o=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:o}});Me.displayName="StyledSelectorContainer",Me.displayName="StyledSelectorContainer";var dt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.borders,e=r.colors,a=r.sizing,i=t.$density;return B(B({},i===T.high?o.LabelMedium:o.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:a.scale600,paddingBottom:a.scale300,paddingLeft:a.scale600,paddingRight:a.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:n.surfaceBorderRadius,borderTopRightRadius:n.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===T.high?"calc(".concat(a.scale800," + ").concat(a.scale0,")"):a.scale950})});dt.displayName="StyledCalendarHeader",dt.displayName="StyledCalendarHeader";var ft=x("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});ft.displayName="StyledMonthHeader",ft.displayName="StyledMonthHeader";var ht=x("button",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$isFocusVisible,a=t.$density;return B(B({},a===T.high?o.LabelMedium:o.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:n.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(n.accent):"none"}})});ht.displayName="StyledMonthYearSelectButton",ht.displayName="StyledMonthYearSelectButton";var yt=x("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return ge({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});yt.displayName="StyledMonthYearSelectIconContainer",yt.displayName="StyledMonthYearSelectIconContainer";function kr(t){var r=t.$theme,o=t.$disabled,n=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:o?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:o?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":o?{}:{boxShadow:n?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var gt=x("button",kr);gt.displayName="StyledPrevButton",gt.displayName="StyledPrevButton";var mt=x("button",kr);mt.displayName="StyledNextButton",mt.displayName="StyledNextButton";var bt=x("div",function(t){return{display:"inline-block"}});bt.displayName="StyledMonth",bt.displayName="StyledMonth";var vt=x("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});vt.displayName="StyledWeek",vt.displayName="StyledWeek";function R(t,r){var o,n=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return o={},ge(o,t,r),ge(o,n,r),ge(o,e,r),o}function Dt(t,r){var o=r.colors,n={":before":{content:null},":after":{content:null}},e=n,a={color:o.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:o.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},l={":before":{content:null}},u=1;t&&t[u]==="1"&&(e=a);var s=Object.assign({},R("001000000000000",{color:o.calendarDayForegroundPseudoSelected}),R("000100000000000",{color:o.calendarDayForegroundSelected}),R("001100000000000",{color:o.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},R("000000000000001",i),R("101000000000000",l),R("101010000000000",l),R("100100000000000",{color:o.calendarDayForegroundSelected}),R("101100000000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111100000000",{color:o.calendarDayForegroundSelected,":before":{content:null}}),R("101111100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111000000000",{color:o.calendarDayForegroundSelected}),R("100110100000000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("100100001010000",{color:o.calendarDayForegroundSelected}),R("100100001001000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},R("100010010000000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},R("100000001100000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),R("101111000000000",{color:o.calendarDayForegroundSelectedHighlighted}),R("101110100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),R("101010010000000",{color:o.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),R("100000000000001",i),R("100000001010001",i),R("100000001001001",i),R("100010000000001",i));return s[t]||e}var St=x("div",function(t){var r=t.$disabled,o=t.$isFocusVisible,n=t.$isHighlighted,e=t.$peekNextMonth,a=t.$pseudoSelected,i=t.$range,l=t.$selected,u=t.$outsideMonth,s=t.$outsideMonthWithinRange,y=t.$hasDateLabel,p=t.$density,d=t.$hasLockedBehavior,f=t.$selectedInput,c=t.$value,h=t.$theme,g=h.colors,b=h.typography,v=h.sizing,D=vo(t),S;y?p===T.high?S="60px":S="70px":p===T.high?S="40px":S="48px";var P=Array.isArray(c)?c:[c,null],j=Do(P,2),k=j[0],H=j[1],O=f===re.startDate?H!==null&&typeof H<"u":k!==null&&typeof k<"u",M=i&&!(d&&!O);return B(B(B({},p===T.high?b.ParagraphSmall:b.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&u?"default":"pointer",color:g.calendarForeground,display:"inline-block",width:p===T.high?"42px":"50px",height:S,lineHeight:p===T.high?v.scale700:v.scale900,textAlign:"center",paddingTop:v.scale300,paddingBottom:v.scale300,paddingLeft:v.scale300,paddingRight:v.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},Dt(D,t.$theme)),{},{":after":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:o&&(!u||e)?"0 0 0 3px ".concat(g.accent):"none",backgroundColor:l?g.calendarDayBackgroundSelectedHighlighted:a&&n?g.calendarDayBackgroundPseudoSelectedHighlighted:g.calendarBackground,height:y?"100%":p===T.high?"42px":"50px",width:"100%",position:"absolute",top:y?0:"-1px",left:0,paddingTop:v.scale200,paddingBottom:v.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:g.borderSelected,borderBottomColor:g.borderSelected,borderRightColor:g.borderSelected,borderLeftColor:g.borderSelected,borderTopLeftRadius:y?v.scale800:"100%",borderTopRightRadius:y?v.scale800:"100%",borderBottomLeftRadius:y?v.scale800:"100%",borderBottomRightRadius:y?v.scale800:"100%"},Dt(D,t.$theme)[":after"]||{}),s?{content:null}:{})},M?{":before":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:g.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},Dt(D,t.$theme)[":before"]||{}),s?{backgroundColor:g.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});St.displayName="StyledDay",St.displayName="StyledDay";var Ot=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$selected;return B(B({},o.ParagraphXSmall),{},{color:e?n.contentInverseTertiary:n.contentTertiary})});Ot.displayName="StyledDayLabel",Ot.displayName="StyledDayLabel";var wt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.sizing,a=t.$density;return B(B({},o.LabelMedium),{},{color:n.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:a===T.high?"42px":"50px",height:a===T.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});wt.displayName="StyledWeekdayHeader",wt.displayName="StyledWeekdayHeader";function kt(t){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kt(t)}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},U.apply(this,arguments)}function Q(t,r){return Ho(t)||jo(t,r)||Mo(t,r)||Co()}function Co(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1 +1 @@
1
- import{r as a,E as S,_ as B,c,a5 as T,M as L,j as s,aY as V}from"./index-BzTZZCvL.js";import{I as K}from"./InputInstructions-iKTPb-Lc.js";import{i as M}from"./inputUtils-CptNuJwn.js";import{T as A}from"./textarea-DMefjquC.js";import"./base-input-DoV-1XUt.js";var R=a.forwardRef(function(e,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,B({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("rect",{width:24,height:24,fill:"none"}),a.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});R.displayName="Send";const D=c("div",{target:"e1d2x3se4"})(({theme:e,width:r})=>({borderRadius:e.radii.default,display:"flex",backgroundColor:e.colors.widgetBackgroundColor??e.colors.secondaryBg,width:`${r}px`}),""),N=c("div",{target:"e1d2x3se3"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"relative",flexGrow:1,borderRadius:e.radii.default,display:"flex",alignItems:"center"}),""),F=c("button",{target:"e1d2x3se2"})(({theme:e,disabled:r,extended:l})=>{const g=T(e),[t,h]=g?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40];return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:l?"0":e.radii.default,borderTopLeftRadius:l?e.radii.default:"0",borderBottomRightRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:r?t:h,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:g?e.colors.gray10:e.colors.gray90},"&:hover":{backgroundColor:e.colors.primary,color:e.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray}}},""),G=c("div",{target:"e1d2x3se1"})({name:"1v03qtz",styles:"display:flex;align-items:flex-end;height:100%;position:absolute;right:0;pointer-events:none"}),U=c("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"absolute",bottom:"0px",right:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`}),""),_=6.5,k=1;function q({width:e,element:r,widgetMgr:l,fragmentId:g}){const t=L(),[h,p]=a.useState(!1),[u,m]=a.useState(r.default),[f,x]=a.useState(0),n=a.useRef(null),b=a.useRef({minHeight:0,maxHeight:0}),z=()=>{let o=0;const{current:i}=n;if(i){const d=i.placeholder;i.placeholder="",i.style.height="auto",o=i.scrollHeight,i.placeholder=d,i.style.height=""}return o},y=()=>{n.current&&n.current.focus(),u&&(l.setStringTriggerValue(r,u,{fromUi:!0},g),p(!1),m(""),x(0))},j=o=>{const{metaKey:i,ctrlKey:d,shiftKey:E}=o;M(o)&&!E&&!d&&!i&&(o.preventDefault(),y())},I=o=>{const{value:i}=o.target,{maxChars:d}=r;d!==0&&i.length>d||(p(i!==""),m(i),x(z()))};a.useEffect(()=>{if(r.setValue){r.setValue=!1;const o=r.value||"";m(o),p(o!=="")}},[r]),a.useEffect(()=>{if(n.current){const{offsetHeight:o}=n.current;b.current.minHeight=o,b.current.maxHeight=o*_}},[n]);const{disabled:v,placeholder:C,maxChars:W}=r,{minHeight:$,maxHeight:w}=b.current,H=f>0&&n.current?Math.abs(f-$)>k:!1;return s.jsx(D,{className:"stChatInput","data-testid":"stChatInput",width:e,children:s.jsxs(N,{children:[s.jsx(A,{inputRef:n,value:u,placeholder:C,onChange:I,onKeyDown:j,"aria-label":C,disabled:v,rows:1,overrides:{Root:{style:{minHeight:t.sizes.minElementHeight,outline:"none",backgroundColor:t.colors.transparent,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,width:`${e}px`}},InputContainer:{style:{backgroundColor:t.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:t.lineHeights.inputWidget,backgroundColor:t.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:H?`${f+k}px`:"auto",maxHeight:w?`${w}px`:"none",paddingLeft:t.spacing.sm,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,paddingRight:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}}}}),e>t.breakpoints.hideWidgetDetails&&s.jsx(U,{children:s.jsx(K,{dirty:h,value:u,maxLength:W,type:"chat",inForm:!1})}),s.jsx(G,{children:s.jsx(F,{onClick:y,disabled:!h||v,extended:H,"data-testid":"stChatInputSubmitButton",children:s.jsx(V,{content:R,size:"xl",color:"inherit"})})})]})})}export{q as default};
1
+ import{r as a,E as S,_ as B,c,a5 as T,M as L,j as s,aY as V}from"./index-C1elUt1E.js";import{I as K}from"./InputInstructions-DJSzEvIq.js";import{i as M}from"./inputUtils-CptNuJwn.js";import{T as A}from"./textarea-CpIIPJux.js";import"./base-input-CgYn_7GU.js";var R=a.forwardRef(function(e,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,B({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("rect",{width:24,height:24,fill:"none"}),a.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});R.displayName="Send";const D=c("div",{target:"e1d2x3se4"})(({theme:e,width:r})=>({borderRadius:e.radii.default,display:"flex",backgroundColor:e.colors.widgetBackgroundColor??e.colors.secondaryBg,width:`${r}px`}),""),N=c("div",{target:"e1d2x3se3"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"relative",flexGrow:1,borderRadius:e.radii.default,display:"flex",alignItems:"center"}),""),F=c("button",{target:"e1d2x3se2"})(({theme:e,disabled:r,extended:l})=>{const g=T(e),[t,h]=g?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40];return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:l?"0":e.radii.default,borderTopLeftRadius:l?e.radii.default:"0",borderBottomRightRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:r?t:h,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:g?e.colors.gray10:e.colors.gray90},"&:hover":{backgroundColor:e.colors.primary,color:e.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray}}},""),G=c("div",{target:"e1d2x3se1"})({name:"1v03qtz",styles:"display:flex;align-items:flex-end;height:100%;position:absolute;right:0;pointer-events:none"}),U=c("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"absolute",bottom:"0px",right:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`}),""),_=6.5,k=1;function q({width:e,element:r,widgetMgr:l,fragmentId:g}){const t=L(),[h,p]=a.useState(!1),[u,m]=a.useState(r.default),[f,x]=a.useState(0),n=a.useRef(null),b=a.useRef({minHeight:0,maxHeight:0}),z=()=>{let o=0;const{current:i}=n;if(i){const d=i.placeholder;i.placeholder="",i.style.height="auto",o=i.scrollHeight,i.placeholder=d,i.style.height=""}return o},y=()=>{n.current&&n.current.focus(),u&&(l.setStringTriggerValue(r,u,{fromUi:!0},g),p(!1),m(""),x(0))},j=o=>{const{metaKey:i,ctrlKey:d,shiftKey:E}=o;M(o)&&!E&&!d&&!i&&(o.preventDefault(),y())},I=o=>{const{value:i}=o.target,{maxChars:d}=r;d!==0&&i.length>d||(p(i!==""),m(i),x(z()))};a.useEffect(()=>{if(r.setValue){r.setValue=!1;const o=r.value||"";m(o),p(o!=="")}},[r]),a.useEffect(()=>{if(n.current){const{offsetHeight:o}=n.current;b.current.minHeight=o,b.current.maxHeight=o*_}},[n]);const{disabled:v,placeholder:C,maxChars:W}=r,{minHeight:$,maxHeight:w}=b.current,H=f>0&&n.current?Math.abs(f-$)>k:!1;return s.jsx(D,{className:"stChatInput","data-testid":"stChatInput",width:e,children:s.jsxs(N,{children:[s.jsx(A,{inputRef:n,value:u,placeholder:C,onChange:I,onKeyDown:j,"aria-label":C,disabled:v,rows:1,overrides:{Root:{style:{minHeight:t.sizes.minElementHeight,outline:"none",backgroundColor:t.colors.transparent,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,width:`${e}px`}},InputContainer:{style:{backgroundColor:t.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:t.lineHeights.inputWidget,backgroundColor:t.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:H?`${f+k}px`:"auto",maxHeight:w?`${w}px`:"none",paddingLeft:t.spacing.sm,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,paddingRight:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}}}}),e>t.breakpoints.hideWidgetDetails&&s.jsx(U,{children:s.jsx(K,{dirty:h,value:u,maxLength:W,type:"chat",inForm:!1})}),s.jsx(G,{children:s.jsx(F,{onClick:y,disabled:!h||v,extended:H,"data-testid":"stChatInputSubmitButton",children:s.jsx(V,{content:R,size:"xl",color:"inherit"})})})]})})}export{q as default};
@@ -1 +1 @@
1
- import{c as d,aE as f,Q as g,aF as a,aG as l,j as s,aH as y,aI as v}from"./index-BzTZZCvL.js";function C(r,e){switch(r){case a.XSMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.sm}`,fontSize:e.fontSizes.sm};case a.SMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.md}`};case a.LARGE:return{padding:`${e.spacing.md} ${e.spacing.md}`};default:return{padding:`${e.spacing.xs} ${e.spacing.md}`}}}const h=d("a",{target:"e16zdaao3"})(({fluidWidth:r,size:e,theme:o})=>{const i=typeof r=="number"?`${r}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:o.fontWeights.normal,padding:`${o.spacing.xs} ${o.spacing.md}`,borderRadius:o.radii.default,minHeight:o.sizes.minElementHeight,margin:0,lineHeight:o.lineHeights.base,color:o.colors.primary,textDecoration:"none",width:r?i:"auto",userSelect:"none","&:visited":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${g(o.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...C(e,o)}},""),x=d(h,{target:"e16zdaao2"})(({theme:r})=>({backgroundColor:r.colors.primary,color:r.colors.white,border:`${r.sizes.borderWidth} solid ${r.colors.primary}`,"&:hover":{backgroundColor:f(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),""),k=d(h,{target:"e16zdaao1"})(({theme:r})=>({backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),""),$=d(h,{target:"e16zdaao0"})(({theme:r})=>({padding:r.spacing.none,backgroundColor:r.colors.transparent,color:r.colors.bodyText,border:"none","&:visited":{color:r.colors.bodyText},"&:hover":{color:r.colors.primary},"&:active":{color:r.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:r.colors.primary,boxShadow:`0 0 0 0.2rem ${g(r.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),"");function w({kind:r,size:e,disabled:o,fluidWidth:i,children:n,autoFocus:t,href:c,rel:b,target:u,onClick:m}){let p=x;return r===l.SECONDARY?p=k:r===l.TERTIARY&&(p=$),s.jsx(p,{kind:r,size:e||a.MEDIUM,fluidWidth:i||!1,disabled:o||!1,autoFocus:t||!1,href:c,target:u,rel:b,onClick:m,tabIndex:o?-1:0,"data-testid":`stBaseLinkButton-${r}`,children:n})}function z(r){const{disabled:e,element:o,width:i}=r,n={width:i};let t=l.SECONDARY;o.type==="primary"?t=l.PRIMARY:o.type==="tertiary"&&(t=l.TERTIARY);const c=o.help?i:!0,b=u=>{r.disabled&&u.preventDefault()};return s.jsx("div",{className:"stLinkButton","data-testid":"stLinkButton",style:n,children:s.jsx(y,{help:o.help,children:s.jsx(w,{kind:t,size:a.SMALL,disabled:e,onClick:b,fluidWidth:o.useContainerWidth?c:!1,href:o.url,target:"_blank",rel:"noreferrer","aria-disabled":e,children:s.jsx(v,{icon:o.icon,label:o.label})})})})}export{z as default};
1
+ import{c as d,aE as f,Q as g,aF as a,aG as l,j as s,aH as y,aI as v}from"./index-C1elUt1E.js";function C(r,e){switch(r){case a.XSMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.sm}`,fontSize:e.fontSizes.sm};case a.SMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.md}`};case a.LARGE:return{padding:`${e.spacing.md} ${e.spacing.md}`};default:return{padding:`${e.spacing.xs} ${e.spacing.md}`}}}const h=d("a",{target:"e16zdaao3"})(({fluidWidth:r,size:e,theme:o})=>{const i=typeof r=="number"?`${r}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:o.fontWeights.normal,padding:`${o.spacing.xs} ${o.spacing.md}`,borderRadius:o.radii.default,minHeight:o.sizes.minElementHeight,margin:0,lineHeight:o.lineHeights.base,color:o.colors.primary,textDecoration:"none",width:r?i:"auto",userSelect:"none","&:visited":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${g(o.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...C(e,o)}},""),x=d(h,{target:"e16zdaao2"})(({theme:r})=>({backgroundColor:r.colors.primary,color:r.colors.white,border:`${r.sizes.borderWidth} solid ${r.colors.primary}`,"&:hover":{backgroundColor:f(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),""),k=d(h,{target:"e16zdaao1"})(({theme:r})=>({backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),""),$=d(h,{target:"e16zdaao0"})(({theme:r})=>({padding:r.spacing.none,backgroundColor:r.colors.transparent,color:r.colors.bodyText,border:"none","&:visited":{color:r.colors.bodyText},"&:hover":{color:r.colors.primary},"&:active":{color:r.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:r.colors.primary,boxShadow:`0 0 0 0.2rem ${g(r.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}),"");function w({kind:r,size:e,disabled:o,fluidWidth:i,children:n,autoFocus:t,href:c,rel:b,target:u,onClick:m}){let p=x;return r===l.SECONDARY?p=k:r===l.TERTIARY&&(p=$),s.jsx(p,{kind:r,size:e||a.MEDIUM,fluidWidth:i||!1,disabled:o||!1,autoFocus:t||!1,href:c,target:u,rel:b,onClick:m,tabIndex:o?-1:0,"data-testid":`stBaseLinkButton-${r}`,children:n})}function z(r){const{disabled:e,element:o,width:i}=r,n={width:i};let t=l.SECONDARY;o.type==="primary"?t=l.PRIMARY:o.type==="tertiary"&&(t=l.TERTIARY);const c=o.help?i:!0,b=u=>{r.disabled&&u.preventDefault()};return s.jsx("div",{className:"stLinkButton","data-testid":"stLinkButton",style:n,children:s.jsx(y,{help:o.help,children:s.jsx(w,{kind:t,size:a.SMALL,disabled:e,onClick:b,fluidWidth:o.useContainerWidth?c:!1,href:o.url,target:"_blank",rel:"noreferrer","aria-disabled":e,children:s.jsx(v,{icon:o.icon,label:o.label})})})})}export{z as default};
@@ -1,2 +1,2 @@
1
- import{r as at,j as bt}from"./index-BzTZZCvL.js";/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:ie,setPrototypeOf:le,isFrozen:Ge,getPrototypeOf:Ye,getOwnPropertyDescriptor:je}=Object;let{freeze:E,seal:b,create:ce}=Object,{apply:St,construct:Rt}=typeof Reflect<"u"&&Reflect;E||(E=function(r){return r}),b||(b=function(r){return r}),St||(St=function(r,o,l){return r.apply(o,l)}),Rt||(Rt=function(r,o){return new r(...o)});const it=A(Array.prototype.forEach),se=A(Array.prototype.pop),X=A(Array.prototype.push),lt=A(String.prototype.toLowerCase),wt=A(String.prototype.toString),ue=A(String.prototype.match),q=A(String.prototype.replace),Xe=A(String.prototype.indexOf),qe=A(String.prototype.trim),S=A(Object.prototype.hasOwnProperty),_=A(RegExp.prototype.test),$=$e(TypeError);function A(r){return function(o){for(var l=arguments.length,i=new Array(l>1?l-1:0),d=1;d<l;d++)i[d-1]=arguments[d];return St(r,o,i)}}function $e(r){return function(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return Rt(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;le&&le(r,null);let i=o.length;for(;i--;){let d=o[i];if(typeof d=="string"){const h=l(d);h!==d&&(Ge(o)||(o[i]=h),d=h)}r[d]=!0}return r}function Ke(r){for(let o=0;o<r.length;o++)S(r,o)||(r[o]=null);return r}function x(r){const o=ce(null);for(const[l,i]of ie(r))S(r,l)&&(Array.isArray(i)?o[l]=Ke(i):i&&typeof i=="object"&&i.constructor===Object?o[l]=x(i):o[l]=i);return o}function K(r,o){for(;r!==null;){const i=je(r,o);if(i){if(i.get)return A(i.get);if(typeof i.value=="function")return A(i.value)}r=Ye(r)}function l(){return null}return l}const me=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Lt=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ct=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ve=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vt=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ze=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pe=E(["#text"]),fe=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Dt=E(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),de=E(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Je=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Qe=b(/<%[\w\W]*|[\w\W]*%>/gm),tn=b(/\${[\w\W]*}/gm),en=b(/^data-[\-\w.\u00B7-\uFFFF]/),nn=b(/^aria-[\-\w]+$/),ge=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),on=b(/^(?:\w+script|data):/i),rn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),he=b(/^html$/i),an=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var Te=Object.freeze({__proto__:null,MUSTACHE_EXPR:Je,ERB_EXPR:Qe,TMPLIT_EXPR:tn,DATA_ATTR:en,ARIA_ATTR:nn,IS_ALLOWED_URI:ge,IS_SCRIPT_OR_DATA:on,ATTR_WHITESPACE:rn,DOCTYPE_NAME:he,CUSTOM_ELEMENT:an});const V={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=function(){return typeof window>"u"?null:window},cn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let l=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(l=o.getAttribute(i));const d="dompurify"+(l?"#"+l:"");try{return r.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}};function ye(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=t=>ye(t);if(o.version="3.1.7",o.removed=[],!r||!r.document||r.document.nodeType!==V.document)return o.isSupported=!1,o;let{document:l}=r;const i=l,d=i.currentScript,{DocumentFragment:h,HTMLTemplateElement:Z,Node:k,Element:xt,NodeFilter:z,NamedNodeMap:Ee=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:_e,DOMParser:Ae,trustedTypes:J}=r,W=xt.prototype,Ne=K(W,"cloneNode"),be=K(W,"remove"),Se=K(W,"nextSibling"),Re=K(W,"childNodes"),Q=K(W,"parentNode");if(typeof Z=="function"){const t=l.createElement("template");t.content&&t.content.ownerDocument&&(l=t.content.ownerDocument)}let T,B="";const{implementation:st,createNodeIterator:we,createDocumentFragment:Le,getElementsByTagName:Ce}=l,{importNode:ve}=i;let R={};o.isSupported=typeof ie=="function"&&typeof Q=="function"&&st&&st.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ut,ERB_EXPR:mt,TMPLIT_EXPR:pt,DATA_ATTR:De,ARIA_ATTR:Oe,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:kt,CUSTOM_ELEMENT:ke}=Te;let{IS_ALLOWED_URI:It}=Te,m=null;const Mt=a({},[...me,...Lt,...Ct,...vt,...pe]);let p=null;const Ut=a({},[...fe,...Dt,...de,...ct]);let s=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,ft=null,Pt=!0,dt=!0,Ht=!1,Ft=!0,I=!1,gt=!0,D=!1,ht=!1,Tt=!1,M=!1,tt=!1,et=!1,zt=!0,Wt=!1;const Ie="user-content-";let yt=!0,Y=!1,U={},P=null;const Bt=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Gt=null;const Yt=a({},["audio","video","img","source","image","track"]);let Et=null;const jt=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",L="http://www.w3.org/1999/xhtml";let H=L,_t=!1,At=null;const Me=a({},[nt,ot,L],wt);let j=null;const Ue=["application/xhtml+xml","text/html"],Pe="text/html";let f=null,F=null;const He=l.createElement("form"),Xt=function(t){return t instanceof RegExp||t instanceof Function},Nt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(F&&F===t)){if((!t||typeof t!="object")&&(t={}),t=x(t),j=Ue.indexOf(t.PARSER_MEDIA_TYPE)===-1?Pe:t.PARSER_MEDIA_TYPE,f=j==="application/xhtml+xml"?wt:lt,m=S(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,f):Mt,p=S(t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,f):Ut,At=S(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,wt):Me,Et=S(t,"ADD_URI_SAFE_ATTR")?a(x(jt),t.ADD_URI_SAFE_ATTR,f):jt,Gt=S(t,"ADD_DATA_URI_TAGS")?a(x(Yt),t.ADD_DATA_URI_TAGS,f):Yt,P=S(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,f):Bt,G=S(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,f):{},ft=S(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,f):{},U=S(t,"USE_PROFILES")?t.USE_PROFILES:!1,Pt=t.ALLOW_ARIA_ATTR!==!1,dt=t.ALLOW_DATA_ATTR!==!1,Ht=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,I=t.SAFE_FOR_TEMPLATES||!1,gt=t.SAFE_FOR_XML!==!1,D=t.WHOLE_DOCUMENT||!1,M=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,zt=t.SANITIZE_DOM!==!1,Wt=t.SANITIZE_NAMED_PROPS||!1,yt=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,It=t.ALLOWED_URI_REGEXP||ge,H=t.NAMESPACE||L,s=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(s.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(s.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(s.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),I&&(dt=!1),tt&&(M=!0),U&&(m=a({},pe),p=[],U.html===!0&&(a(m,me),a(p,fe)),U.svg===!0&&(a(m,Lt),a(p,Dt),a(p,ct)),U.svgFilters===!0&&(a(m,Ct),a(p,Dt),a(p,ct)),U.mathMl===!0&&(a(m,vt),a(p,de),a(p,ct))),t.ADD_TAGS&&(m===Mt&&(m=x(m)),a(m,t.ADD_TAGS,f)),t.ADD_ATTR&&(p===Ut&&(p=x(p)),a(p,t.ADD_ATTR,f)),t.ADD_URI_SAFE_ATTR&&a(Et,t.ADD_URI_SAFE_ATTR,f),t.FORBID_CONTENTS&&(P===Bt&&(P=x(P)),a(P,t.FORBID_CONTENTS,f)),yt&&(m["#text"]=!0),D&&a(m,["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=cn(J,d)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));E&&E(t),F=t}},qt=a({},["mi","mo","mn","ms","mtext"]),$t=a({},["annotation-xml"]),Fe=a({},["title","style","font","a","script"]),Kt=a({},[...Lt,...Ct,...Ve]),Vt=a({},[...vt,...Ze]),ze=function(t){let n=Q(t);(!n||!n.tagName)&&(n={namespaceURI:H,tagName:"template"});const e=lt(t.tagName),c=lt(n.tagName);return At[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===L?e==="svg":n.namespaceURI===nt?e==="svg"&&(c==="annotation-xml"||qt[c]):!!Kt[e]:t.namespaceURI===nt?n.namespaceURI===L?e==="math":n.namespaceURI===ot?e==="math"&&$t[c]:!!Vt[e]:t.namespaceURI===L?n.namespaceURI===ot&&!$t[c]||n.namespaceURI===nt&&!qt[c]?!1:!Vt[e]&&(Fe[e]||!Kt[e]):!!(j==="application/xhtml+xml"&&At[t.namespaceURI]):!1},O=function(t){X(o.removed,{element:t});try{Q(t).removeChild(t)}catch{be(t)}},rt=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is"&&!p[t])if(M||tt)try{O(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Zt=function(t){let n=null,e=null;if(Tt)t="<remove></remove>"+t;else{const u=ue(t,/^[\r\n\t ]+/);e=u&&u[0]}j==="application/xhtml+xml"&&H===L&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const c=T?T.createHTML(t):t;if(H===L)try{n=new Ae().parseFromString(c,j)}catch{}if(!n||!n.documentElement){n=st.createDocument(H,"template",null);try{n.documentElement.innerHTML=_t?B:c}catch{}}const g=n.body||n.documentElement;return t&&e&&g.insertBefore(l.createTextNode(e),g.childNodes[0]||null),H===L?Ce.call(n,D?"html":"body")[0]:D?n.documentElement:g},Jt=function(t){return we.call(t.ownerDocument||t,t,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Qt=function(t){return t instanceof _e&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof Ee)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},te=function(t){return typeof k=="function"&&t instanceof k},C=function(t,n,e){R[t]&&it(R[t],c=>{c.call(o,n,e,F)})},ee=function(t){let n=null;if(C("beforeSanitizeElements",t,null),Qt(t))return O(t),!0;const e=f(t.nodeName);if(C("uponSanitizeElement",t,{tagName:e,allowedTags:m}),t.hasChildNodes()&&!te(t.firstElementChild)&&_(/<[/\w]/g,t.innerHTML)&&_(/<[/\w]/g,t.textContent)||t.nodeType===V.progressingInstruction||gt&&t.nodeType===V.comment&&_(/<[/\w]/g,t.data))return O(t),!0;if(!m[e]||G[e]){if(!G[e]&&oe(e)&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,e)||s.tagNameCheck instanceof Function&&s.tagNameCheck(e)))return!1;if(yt&&!P[e]){const c=Q(t)||t.parentNode,g=Re(t)||t.childNodes;if(g&&c){const u=g.length;for(let v=u-1;v>=0;--v){const N=Ne(g[v],!0);N.__removalCount=(t.__removalCount||0)+1,c.insertBefore(N,Se(t))}}}return O(t),!0}return t instanceof xt&&!ze(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&_(/<\/no(script|embed|frames)/i,t.innerHTML)?(O(t),!0):(I&&t.nodeType===V.text&&(n=t.textContent,it([ut,mt,pt],c=>{n=q(n,c," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),C("afterSanitizeElements",t,null),!1)},ne=function(t,n,e){if(zt&&(n==="id"||n==="name")&&(e in l||e in He))return!1;if(!(dt&&!ft[n]&&_(De,n))&&!(Pt&&_(Oe,n))){if(!p[n]||ft[n]){if(!(oe(t)&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,t)||s.tagNameCheck instanceof Function&&s.tagNameCheck(t))&&(s.attributeNameCheck instanceof RegExp&&_(s.attributeNameCheck,n)||s.attributeNameCheck instanceof Function&&s.attributeNameCheck(n))||n==="is"&&s.allowCustomizedBuiltInElements&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,e)||s.tagNameCheck instanceof Function&&s.tagNameCheck(e))))return!1}else if(!Et[n]&&!_(It,q(e,kt,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&t!=="script"&&Xe(e,"data:")===0&&Gt[t])&&!(Ht&&!_(xe,q(e,kt,"")))&&e)return!1}return!0},oe=function(t){return t!=="annotation-xml"&&ue(t,ke)},re=function(t){C("beforeSanitizeAttributes",t,null);const{attributes:n}=t;if(!n)return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p};let c=n.length;for(;c--;){const g=n[c],{name:u,namespaceURI:v,value:N}=g,w=f(u);let y=u==="value"?N:qe(N);if(e.attrName=w,e.attrValue=y,e.keepAttr=!0,e.forceKeepAttr=void 0,C("uponSanitizeAttribute",t,e),y=e.attrValue,e.forceKeepAttr||(rt(u,t),!e.keepAttr))continue;if(!Ft&&_(/\/>/i,y)){rt(u,t);continue}I&&it([ut,mt,pt],Be=>{y=q(y,Be," ")});const ae=f(t.nodeName);if(ne(ae,w,y)){if(Wt&&(w==="id"||w==="name")&&(rt(u,t),y=Ie+y),gt&&_(/((--!?|])>)|<\/(style|title)/i,y)){rt(u,t);continue}if(T&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!v)switch(J.getAttributeType(ae,w)){case"TrustedHTML":{y=T.createHTML(y);break}case"TrustedScriptURL":{y=T.createScriptURL(y);break}}try{v?t.setAttributeNS(v,u,y):t.setAttribute(u,y),Qt(t)?O(t):se(o.removed)}catch{}}}C("afterSanitizeAttributes",t,null)},We=function t(n){let e=null;const c=Jt(n);for(C("beforeSanitizeShadowDOM",n,null);e=c.nextNode();)C("uponSanitizeShadowNode",e,null),!ee(e)&&(e.content instanceof h&&t(e.content),re(e));C("afterSanitizeShadowDOM",n,null)};return o.sanitize=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,c=null,g=null,u=null;if(_t=!t,_t&&(t="<!-->"),typeof t!="string"&&!te(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("dirty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||Nt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=f(t.nodeName);if(!m[w]||G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof k)e=Zt("<!---->"),c=e.ownerDocument.importNode(t,!0),c.nodeType===V.element&&c.nodeName==="BODY"||c.nodeName==="HTML"?e=c:e.appendChild(c);else{if(!M&&!I&&!D&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Zt(t),!e)return M?null:et?B:""}e&&Tt&&O(e.firstChild);const v=Jt(Y?t:e);for(;g=v.nextNode();)ee(g)||(g.content instanceof h&&We(g.content),re(g));if(Y)return t;if(M){if(tt)for(u=Le.call(e.ownerDocument);e.firstChild;)u.appendChild(e.firstChild);else u=e;return(p.shadowroot||p.shadowrootmode)&&(u=ve.call(i,u,!0)),u}let N=D?e.outerHTML:e.innerHTML;return D&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&_(he,e.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
1
+ import{r as at,j as bt}from"./index-C1elUt1E.js";/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:ie,setPrototypeOf:le,isFrozen:Ge,getPrototypeOf:Ye,getOwnPropertyDescriptor:je}=Object;let{freeze:E,seal:b,create:ce}=Object,{apply:St,construct:Rt}=typeof Reflect<"u"&&Reflect;E||(E=function(r){return r}),b||(b=function(r){return r}),St||(St=function(r,o,l){return r.apply(o,l)}),Rt||(Rt=function(r,o){return new r(...o)});const it=A(Array.prototype.forEach),se=A(Array.prototype.pop),X=A(Array.prototype.push),lt=A(String.prototype.toLowerCase),wt=A(String.prototype.toString),ue=A(String.prototype.match),q=A(String.prototype.replace),Xe=A(String.prototype.indexOf),qe=A(String.prototype.trim),S=A(Object.prototype.hasOwnProperty),_=A(RegExp.prototype.test),$=$e(TypeError);function A(r){return function(o){for(var l=arguments.length,i=new Array(l>1?l-1:0),d=1;d<l;d++)i[d-1]=arguments[d];return St(r,o,i)}}function $e(r){return function(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return Rt(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;le&&le(r,null);let i=o.length;for(;i--;){let d=o[i];if(typeof d=="string"){const h=l(d);h!==d&&(Ge(o)||(o[i]=h),d=h)}r[d]=!0}return r}function Ke(r){for(let o=0;o<r.length;o++)S(r,o)||(r[o]=null);return r}function x(r){const o=ce(null);for(const[l,i]of ie(r))S(r,l)&&(Array.isArray(i)?o[l]=Ke(i):i&&typeof i=="object"&&i.constructor===Object?o[l]=x(i):o[l]=i);return o}function K(r,o){for(;r!==null;){const i=je(r,o);if(i){if(i.get)return A(i.get);if(typeof i.value=="function")return A(i.value)}r=Ye(r)}function l(){return null}return l}const me=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Lt=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ct=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ve=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vt=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ze=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pe=E(["#text"]),fe=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Dt=E(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),de=E(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Je=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Qe=b(/<%[\w\W]*|[\w\W]*%>/gm),tn=b(/\${[\w\W]*}/gm),en=b(/^data-[\-\w.\u00B7-\uFFFF]/),nn=b(/^aria-[\-\w]+$/),ge=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),on=b(/^(?:\w+script|data):/i),rn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),he=b(/^html$/i),an=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var Te=Object.freeze({__proto__:null,MUSTACHE_EXPR:Je,ERB_EXPR:Qe,TMPLIT_EXPR:tn,DATA_ATTR:en,ARIA_ATTR:nn,IS_ALLOWED_URI:ge,IS_SCRIPT_OR_DATA:on,ATTR_WHITESPACE:rn,DOCTYPE_NAME:he,CUSTOM_ELEMENT:an});const V={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=function(){return typeof window>"u"?null:window},cn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let l=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(l=o.getAttribute(i));const d="dompurify"+(l?"#"+l:"");try{return r.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}};function ye(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=t=>ye(t);if(o.version="3.1.7",o.removed=[],!r||!r.document||r.document.nodeType!==V.document)return o.isSupported=!1,o;let{document:l}=r;const i=l,d=i.currentScript,{DocumentFragment:h,HTMLTemplateElement:Z,Node:k,Element:xt,NodeFilter:z,NamedNodeMap:Ee=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:_e,DOMParser:Ae,trustedTypes:J}=r,W=xt.prototype,Ne=K(W,"cloneNode"),be=K(W,"remove"),Se=K(W,"nextSibling"),Re=K(W,"childNodes"),Q=K(W,"parentNode");if(typeof Z=="function"){const t=l.createElement("template");t.content&&t.content.ownerDocument&&(l=t.content.ownerDocument)}let T,B="";const{implementation:st,createNodeIterator:we,createDocumentFragment:Le,getElementsByTagName:Ce}=l,{importNode:ve}=i;let R={};o.isSupported=typeof ie=="function"&&typeof Q=="function"&&st&&st.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ut,ERB_EXPR:mt,TMPLIT_EXPR:pt,DATA_ATTR:De,ARIA_ATTR:Oe,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:kt,CUSTOM_ELEMENT:ke}=Te;let{IS_ALLOWED_URI:It}=Te,m=null;const Mt=a({},[...me,...Lt,...Ct,...vt,...pe]);let p=null;const Ut=a({},[...fe,...Dt,...de,...ct]);let s=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,ft=null,Pt=!0,dt=!0,Ht=!1,Ft=!0,I=!1,gt=!0,D=!1,ht=!1,Tt=!1,M=!1,tt=!1,et=!1,zt=!0,Wt=!1;const Ie="user-content-";let yt=!0,Y=!1,U={},P=null;const Bt=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Gt=null;const Yt=a({},["audio","video","img","source","image","track"]);let Et=null;const jt=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",L="http://www.w3.org/1999/xhtml";let H=L,_t=!1,At=null;const Me=a({},[nt,ot,L],wt);let j=null;const Ue=["application/xhtml+xml","text/html"],Pe="text/html";let f=null,F=null;const He=l.createElement("form"),Xt=function(t){return t instanceof RegExp||t instanceof Function},Nt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(F&&F===t)){if((!t||typeof t!="object")&&(t={}),t=x(t),j=Ue.indexOf(t.PARSER_MEDIA_TYPE)===-1?Pe:t.PARSER_MEDIA_TYPE,f=j==="application/xhtml+xml"?wt:lt,m=S(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,f):Mt,p=S(t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,f):Ut,At=S(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,wt):Me,Et=S(t,"ADD_URI_SAFE_ATTR")?a(x(jt),t.ADD_URI_SAFE_ATTR,f):jt,Gt=S(t,"ADD_DATA_URI_TAGS")?a(x(Yt),t.ADD_DATA_URI_TAGS,f):Yt,P=S(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,f):Bt,G=S(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,f):{},ft=S(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,f):{},U=S(t,"USE_PROFILES")?t.USE_PROFILES:!1,Pt=t.ALLOW_ARIA_ATTR!==!1,dt=t.ALLOW_DATA_ATTR!==!1,Ht=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,I=t.SAFE_FOR_TEMPLATES||!1,gt=t.SAFE_FOR_XML!==!1,D=t.WHOLE_DOCUMENT||!1,M=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,zt=t.SANITIZE_DOM!==!1,Wt=t.SANITIZE_NAMED_PROPS||!1,yt=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,It=t.ALLOWED_URI_REGEXP||ge,H=t.NAMESPACE||L,s=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(s.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(s.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(s.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),I&&(dt=!1),tt&&(M=!0),U&&(m=a({},pe),p=[],U.html===!0&&(a(m,me),a(p,fe)),U.svg===!0&&(a(m,Lt),a(p,Dt),a(p,ct)),U.svgFilters===!0&&(a(m,Ct),a(p,Dt),a(p,ct)),U.mathMl===!0&&(a(m,vt),a(p,de),a(p,ct))),t.ADD_TAGS&&(m===Mt&&(m=x(m)),a(m,t.ADD_TAGS,f)),t.ADD_ATTR&&(p===Ut&&(p=x(p)),a(p,t.ADD_ATTR,f)),t.ADD_URI_SAFE_ATTR&&a(Et,t.ADD_URI_SAFE_ATTR,f),t.FORBID_CONTENTS&&(P===Bt&&(P=x(P)),a(P,t.FORBID_CONTENTS,f)),yt&&(m["#text"]=!0),D&&a(m,["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=cn(J,d)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));E&&E(t),F=t}},qt=a({},["mi","mo","mn","ms","mtext"]),$t=a({},["annotation-xml"]),Fe=a({},["title","style","font","a","script"]),Kt=a({},[...Lt,...Ct,...Ve]),Vt=a({},[...vt,...Ze]),ze=function(t){let n=Q(t);(!n||!n.tagName)&&(n={namespaceURI:H,tagName:"template"});const e=lt(t.tagName),c=lt(n.tagName);return At[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===L?e==="svg":n.namespaceURI===nt?e==="svg"&&(c==="annotation-xml"||qt[c]):!!Kt[e]:t.namespaceURI===nt?n.namespaceURI===L?e==="math":n.namespaceURI===ot?e==="math"&&$t[c]:!!Vt[e]:t.namespaceURI===L?n.namespaceURI===ot&&!$t[c]||n.namespaceURI===nt&&!qt[c]?!1:!Vt[e]&&(Fe[e]||!Kt[e]):!!(j==="application/xhtml+xml"&&At[t.namespaceURI]):!1},O=function(t){X(o.removed,{element:t});try{Q(t).removeChild(t)}catch{be(t)}},rt=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is"&&!p[t])if(M||tt)try{O(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Zt=function(t){let n=null,e=null;if(Tt)t="<remove></remove>"+t;else{const u=ue(t,/^[\r\n\t ]+/);e=u&&u[0]}j==="application/xhtml+xml"&&H===L&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const c=T?T.createHTML(t):t;if(H===L)try{n=new Ae().parseFromString(c,j)}catch{}if(!n||!n.documentElement){n=st.createDocument(H,"template",null);try{n.documentElement.innerHTML=_t?B:c}catch{}}const g=n.body||n.documentElement;return t&&e&&g.insertBefore(l.createTextNode(e),g.childNodes[0]||null),H===L?Ce.call(n,D?"html":"body")[0]:D?n.documentElement:g},Jt=function(t){return we.call(t.ownerDocument||t,t,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Qt=function(t){return t instanceof _e&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof Ee)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},te=function(t){return typeof k=="function"&&t instanceof k},C=function(t,n,e){R[t]&&it(R[t],c=>{c.call(o,n,e,F)})},ee=function(t){let n=null;if(C("beforeSanitizeElements",t,null),Qt(t))return O(t),!0;const e=f(t.nodeName);if(C("uponSanitizeElement",t,{tagName:e,allowedTags:m}),t.hasChildNodes()&&!te(t.firstElementChild)&&_(/<[/\w]/g,t.innerHTML)&&_(/<[/\w]/g,t.textContent)||t.nodeType===V.progressingInstruction||gt&&t.nodeType===V.comment&&_(/<[/\w]/g,t.data))return O(t),!0;if(!m[e]||G[e]){if(!G[e]&&oe(e)&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,e)||s.tagNameCheck instanceof Function&&s.tagNameCheck(e)))return!1;if(yt&&!P[e]){const c=Q(t)||t.parentNode,g=Re(t)||t.childNodes;if(g&&c){const u=g.length;for(let v=u-1;v>=0;--v){const N=Ne(g[v],!0);N.__removalCount=(t.__removalCount||0)+1,c.insertBefore(N,Se(t))}}}return O(t),!0}return t instanceof xt&&!ze(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&_(/<\/no(script|embed|frames)/i,t.innerHTML)?(O(t),!0):(I&&t.nodeType===V.text&&(n=t.textContent,it([ut,mt,pt],c=>{n=q(n,c," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),C("afterSanitizeElements",t,null),!1)},ne=function(t,n,e){if(zt&&(n==="id"||n==="name")&&(e in l||e in He))return!1;if(!(dt&&!ft[n]&&_(De,n))&&!(Pt&&_(Oe,n))){if(!p[n]||ft[n]){if(!(oe(t)&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,t)||s.tagNameCheck instanceof Function&&s.tagNameCheck(t))&&(s.attributeNameCheck instanceof RegExp&&_(s.attributeNameCheck,n)||s.attributeNameCheck instanceof Function&&s.attributeNameCheck(n))||n==="is"&&s.allowCustomizedBuiltInElements&&(s.tagNameCheck instanceof RegExp&&_(s.tagNameCheck,e)||s.tagNameCheck instanceof Function&&s.tagNameCheck(e))))return!1}else if(!Et[n]&&!_(It,q(e,kt,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&t!=="script"&&Xe(e,"data:")===0&&Gt[t])&&!(Ht&&!_(xe,q(e,kt,"")))&&e)return!1}return!0},oe=function(t){return t!=="annotation-xml"&&ue(t,ke)},re=function(t){C("beforeSanitizeAttributes",t,null);const{attributes:n}=t;if(!n)return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p};let c=n.length;for(;c--;){const g=n[c],{name:u,namespaceURI:v,value:N}=g,w=f(u);let y=u==="value"?N:qe(N);if(e.attrName=w,e.attrValue=y,e.keepAttr=!0,e.forceKeepAttr=void 0,C("uponSanitizeAttribute",t,e),y=e.attrValue,e.forceKeepAttr||(rt(u,t),!e.keepAttr))continue;if(!Ft&&_(/\/>/i,y)){rt(u,t);continue}I&&it([ut,mt,pt],Be=>{y=q(y,Be," ")});const ae=f(t.nodeName);if(ne(ae,w,y)){if(Wt&&(w==="id"||w==="name")&&(rt(u,t),y=Ie+y),gt&&_(/((--!?|])>)|<\/(style|title)/i,y)){rt(u,t);continue}if(T&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!v)switch(J.getAttributeType(ae,w)){case"TrustedHTML":{y=T.createHTML(y);break}case"TrustedScriptURL":{y=T.createScriptURL(y);break}}try{v?t.setAttributeNS(v,u,y):t.setAttribute(u,y),Qt(t)?O(t):se(o.removed)}catch{}}}C("afterSanitizeAttributes",t,null)},We=function t(n){let e=null;const c=Jt(n);for(C("beforeSanitizeShadowDOM",n,null);e=c.nextNode();)C("uponSanitizeShadowNode",e,null),!ee(e)&&(e.content instanceof h&&t(e.content),re(e));C("afterSanitizeShadowDOM",n,null)};return o.sanitize=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,c=null,g=null,u=null;if(_t=!t,_t&&(t="<!-->"),typeof t!="string"&&!te(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("dirty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||Nt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=f(t.nodeName);if(!m[w]||G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof k)e=Zt("<!---->"),c=e.ownerDocument.importNode(t,!0),c.nodeType===V.element&&c.nodeName==="BODY"||c.nodeName==="HTML"?e=c:e.appendChild(c);else{if(!M&&!I&&!D&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Zt(t),!e)return M?null:et?B:""}e&&Tt&&O(e.firstChild);const v=Jt(Y?t:e);for(;g=v.nextNode();)ee(g)||(g.content instanceof h&&We(g.content),re(g));if(Y)return t;if(M){if(tt)for(u=Le.call(e.ownerDocument);e.firstChild;)u.appendChild(e.firstChild);else u=e;return(p.shadowroot||p.shadowrootmode)&&(u=ve.call(i,u,!0)),u}let N=D?e.outerHTML:e.innerHTML;return D&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&_(he,e.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
2
2
  `+N),I&&it([ut,mt,pt],w=>{N=q(N,w," ")}),T&&et?T.createHTML(N):N},o.setConfig=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nt(t),ht=!0},o.clearConfig=function(){F=null,ht=!1},o.isValidAttribute=function(t,n,e){F||Nt({});const c=f(t),g=f(n);return ne(c,g,e)},o.addHook=function(t,n){typeof n=="function"&&(R[t]=R[t]||[],X(R[t],n))},o.removeHook=function(t){if(R[t])return se(R[t])},o.removeHooks=function(t){R[t]&&(R[t]=[])},o.removeAllHooks=function(){R={}},o}var sn=ye();const Ot=r=>{const o={USE_PROFILES:{html:!0},FORCE_BODY:!0};return sn.sanitize(r,o)};function un({element:r,width:o}){const{body:l}=r,[i,d]=at.useState(Ot(l)),h=at.useRef(null);return at.useEffect(()=>{Ot(l)!==i&&d(Ot(l))},[l]),at.useEffect(()=>{var Z,k;((Z=h.current)==null?void 0:Z.clientHeight)===0&&((k=h.current.parentElement)==null?void 0:k.childElementCount)===1&&h.current.parentElement.classList.add("stHtml-empty")}),bt.jsx(bt.Fragment,{children:i&&bt.jsx("div",{className:"stHtml","data-testid":"stHtml",ref:h,style:{width:o},dangerouslySetInnerHTML:{__html:i}})})}export{un as default};
@@ -1 +1 @@
1
- import{r as o,B as h,j as v,bP as c,a$ as I}from"./index-BzTZZCvL.js";import{a as S}from"./useBasicWidgetState-Cqy4gnzY.js";import"./FormClearHelper-DmeZ2QuQ.js";const V=(e,t)=>e.getIntValue(t),w=e=>e.default??null,M=e=>e.value??null,P=(e,t,l,a)=>{t.setIntValue(e,l.value,{fromUi:l.fromUi},a)},U=({disabled:e,element:t,widgetMgr:l,width:a,fragmentId:d})=>{const{options:m,help:u,label:s,labelVisibility:r,placeholder:g}=t,[n,i]=S({getStateFromWidgetMgr:V,getDefaultStateFromProto:w,getCurrStateFromProto:M,updateWidgetMgrState:P,element:t,widgetMgr:l,fragmentId:d}),b=o.useCallback(p=>{i({value:p,fromUi:!0})},[i]),f=h(t.default)&&!e;return v.jsx(c,{label:s,labelVisibility:I(r==null?void 0:r.value),options:m,disabled:e,width:a,onChange:b,value:n,help:u,placeholder:g,clearable:f})},j=o.memo(U);export{j as default};
1
+ import{r as o,B as h,j as v,bP as c,a$ as I}from"./index-C1elUt1E.js";import{a as S}from"./useBasicWidgetState-D4lxC36U.js";import"./FormClearHelper-BtlF8Otx.js";const V=(e,t)=>e.getIntValue(t),w=e=>e.default??null,M=e=>e.value??null,P=(e,t,l,a)=>{t.setIntValue(e,l.value,{fromUi:l.fromUi},a)},U=({disabled:e,element:t,widgetMgr:l,width:a,fragmentId:d})=>{const{options:m,help:u,label:s,labelVisibility:r,placeholder:g}=t,[n,i]=S({getStateFromWidgetMgr:V,getDefaultStateFromProto:w,getCurrStateFromProto:M,updateWidgetMgrState:P,element:t,widgetMgr:l,fragmentId:d}),b=o.useCallback(p=>{i({value:p,fromUi:!0})},[i]),f=h(t.default)&&!e;return v.jsx(c,{label:s,labelVisibility:I(r==null?void 0:r.value),options:m,disabled:e,width:a,onChange:b,value:n,help:u,placeholder:g,clearable:f})},j=o.memo(U);export{j as default};
@@ -1 +1 @@
1
- import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-BzTZZCvL.js";const y=s("div",{target:"e11k5jya2"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),w=s("a",{target:"e11k5jya1"})(({disabled:a,isCurrentPage:r,fluidWidth:n,theme:e})=>({textDecoration:"none",width:typeof n=="number"?`${n}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),L=s("span",{target:"e11k5jya0"})(({disabled:a,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(a,r){return a===null&&r?!0:a===null&&!r?!1:a===!0}function P(a){const{onPageChange:r,currentPageScriptHash:n}=g.useContext(f),e=g.useContext(b),{colors:p}=k(),{disabled:l,element:o,width:i}=a,u={width:i},h=T(o.useContainerWidth,e),d=n===o.pageScriptHash,x=c=>{o.external?l&&c.preventDefault():(c.preventDefault(),l||r(o.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",style:u,children:t.jsx(m,{help:o.help,placement:C.TOP_RIGHT,children:t.jsx(y,{children:t.jsxs(w,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:d,fluidWidth:h?i:!1,href:o.page,target:o.external?"_blank":"",rel:"noreferrer",onClick:x,children:[o.icon&&t.jsx(j,{size:"lg",color:p.bodyText,iconValue:o.icon}),t.jsx(L,{disabled:l,children:t.jsx(v,{source:o.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{P as default};
1
+ import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-C1elUt1E.js";const y=s("div",{target:"e11k5jya2"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),w=s("a",{target:"e11k5jya1"})(({disabled:a,isCurrentPage:r,fluidWidth:n,theme:e})=>({textDecoration:"none",width:typeof n=="number"?`${n}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),L=s("span",{target:"e11k5jya0"})(({disabled:a,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(a,r){return a===null&&r?!0:a===null&&!r?!1:a===!0}function P(a){const{onPageChange:r,currentPageScriptHash:n}=g.useContext(f),e=g.useContext(b),{colors:p}=k(),{disabled:l,element:o,width:i}=a,u={width:i},h=T(o.useContainerWidth,e),d=n===o.pageScriptHash,x=c=>{o.external?l&&c.preventDefault():(c.preventDefault(),l||r(o.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",style:u,children:t.jsx(m,{help:o.help,placement:C.TOP_RIGHT,children:t.jsx(y,{children:t.jsxs(w,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:d,fluidWidth:h?i:!1,href:o.page,target:o.external?"_blank":"",rel:"noreferrer",onClick:x,children:[o.icon&&t.jsx(j,{size:"lg",color:p.bodyText,iconValue:o.icon}),t.jsx(L,{disabled:l,children:t.jsx(v,{source:o.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{P as default};
@@ -1 +1 @@
1
- import{r as y,E,_ as R,c as C,Q as G,j as u,b1 as X,aK as k,aX as q,aG as Q,aY as O,b9 as z,e as J,g as K,a7 as Y,M as Z,ba as ee,bb as te,R as re,O as ie,$ as se,B as P,as as _,aU as ne,aT as ae,a_ as oe,a$ as le,bc as de,b0 as ce}from"./index-BzTZZCvL.js";import{F as he}from"./FormClearHelper-DmeZ2QuQ.js";import{U as V}from"./UploadFileInfo-C-jY39rj.js";import{P as ue,S as pe}from"./ProgressBar-Dfr9f8u1.js";var L=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});L.displayName="Video";var D=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});D.displayName="X";var $=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ge(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const W=C("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=C("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),fe=C("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),me=C("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),ve=C("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),Se=C("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),ye=C("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),we=C("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),be=C("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${G(i.colors.primary,.5)}`},...ge("medium",i)}),"");function H({disabled:i,onClick:l,children:t,progress:s}){return u.jsxs(be,{disabled:i||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[t,s&&u.jsx(we,{children:u.jsx(ue,{value:s,size:pe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const Me=({switchFacingMode:i})=>u.jsx(ye,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(X,{content:"Switch camera",placement:k.TOP_RIGHT,children:u.jsx(q,{kind:Q.MINIMAL,onClick:i,children:u.jsx(O,{content:$,size:"twoXL",color:z.white})})})});var A={exports:{}};(function(i,l){(function(t,s){i.exports=s(y)})(J,function(t){return function(s){var n={};function a(o){if(n[o])return n[o].exports;var p=n[o]={i:o,l:!1,exports:{}};return s[o].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=n,a.d=function(o,p,S){a.o(o,p)||Object.defineProperty(o,p,{enumerable:!0,get:S})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,p){if(p&1&&(o=a(o)),p&8||p&4&&typeof o=="object"&&o&&o.__esModule)return o;var S=Object.create(null);if(a.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:o}),p&2&&typeof o!="string")for(var x in o)a.d(S,x,(function(U){return o[U]}).bind(null,x));return S},a.n=function(o){var p=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(p,"a",p),p},a.o=function(o,p){return Object.prototype.hasOwnProperty.call(o,p)},a.p="",a(a.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,n,a){a.r(n);var o=a("react"),p=function(){var g=function(h,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,d){r.__proto__=d}||function(r,d){for(var c in d)d.hasOwnProperty(c)&&(r[c]=d[c])},g(h,e)};return function(h,e){g(h,e);function r(){this.constructor=h}h.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),S=function(){return S=Object.assign||function(g){for(var h,e=1,r=arguments.length;e<r;e++){h=arguments[e];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},x=function(g,h){var e={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&h.indexOf(r)<0&&(e[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(g);d<r.length;d++)h.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(g,r[d])&&(e[r[d]]=g[r[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(e,r){h.call(navigator,g,e,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var j=function(g){p(h,g);function h(e){var r=g.call(this,e)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return h.prototype.componentDidMount=function(){var e=this,r=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(e){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(r.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(r.videoConstraints),w=e.minScreenshotWidth!==r.minScreenshotWidth,v=e.minScreenshotHeight!==r.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(r){e.removeTrack(r),r.stop()}),e.getAudioTracks().map(function(r){e.removeTrack(r),r.stop()})):e.stop())},h.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(h.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},h.prototype.getScreenshot=function(e){var r=this,d=r.state,c=r.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(e);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(e){var r=this,d=r.state,c=r.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var f=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/f,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*f)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||w,this.canvas.height=(e==null?void 0:e.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,m=M.canvas;return b&&m&&(m.width=(e==null?void 0:e.width)||m.width,m.height=(e==null?void 0:e.height)||m.height,c.mirrored&&(b.translate(m.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||m.width,(e==null?void 0:e.height)||m.height),c.mirrored&&(b.scale(-1,1),b.translate(-m.width,0))),m},h.prototype.requestUserMedia=function(){var e=this,r=this.props,d=function(v,f){var M={video:typeof f<"u"?f:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(m){e.unmounted||b!==e.requestUserMediaId?h.stopMediaStream(m):e.handleUserMedia(null,m)}).catch(function(m){e.handleUserMedia(m)})};if("mediaDevices"in navigator)d(r.audioConstraints,r.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var f=v.deviceId;return typeof f=="string"?f:Array.isArray(f)&&f.length>0?f[0]:typeof f=="object"&&f.ideal?f.ideal:null};MediaStreamTrack.getSources(function(v){var f=null,M=null;v.forEach(function(I){I.kind==="audio"?f=I.id:I.kind==="video"&&(M=I.id)});var b=w(r.audioConstraints);b&&(f=b);var m=w(r.videoConstraints);m&&(M=m),d(c(f),c(M))})}},h.prototype.handleUserMedia=function(e,r){var d=this.props;if(e||!r){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}d.onUserMedia(r)},h.prototype.render=function(){var e=this,r=this,d=r.state,c=r.props,w=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,f=c.style,M=f===void 0?{}:f,b=c.children,m=x(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),I=v?S(S({},M),{transform:(M.transform||"")+" scaleX(-1)"}):M,N={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",S({autoPlay:!0,src:d.src,muted:!w,playsInline:!0,ref:function(B){e.video=B},style:I},m)),b&&b(N))},h.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(o.Component);n.default=j},react:function(s,n){s.exports=t}}).default})})(A);var Ue=A.exports;const xe=K(Ue),Ce=({width:i})=>u.jsxs(T,{width:i,children:[u.jsx(O,{size:"threeXL",color:z.gray60,content:L}),u.jsxs(fe,{children:["This app would like to use your camera.",u.jsx(ve,{href:te,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),je=({handleCapture:i,width:l,disabled:t,clearPhotoInProgress:s,setClearPhotoInProgress:n,facingMode:a,setFacingMode:o,testOverride:p})=>{const[S,x]=y.useState(p||"pending"),U=y.useRef(null),[j,g]=y.useState(l),h=y.useCallback(Y(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function e(){if(U.current!==null){const d=U.current.getScreenshot();i(d)}}const r=Z();return u.jsxs(W,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!t&&!s?u.jsx(Ce,{width:j}):ee&&u.jsx(Me,{switchFacingMode:o}),u.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!t&&!s,width:j,children:!t&&u.jsx(xe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:j,height:j*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),n(!1)},videoConstraints:{width:{ideal:j},facingMode:a}})}),u.jsx(H,{onClick:e,disabled:S!=="success"||t||s,children:"Take Photo"})]})},Ie=150;class Pe extends re.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=t=>{this.setState({clearPhotoInProgress:t})},this.setFacingMode=()=>{this.setState(t=>({facingMode:t.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=t=>{if(t===null)return Promise.resolve();this.setState({imgSrc:t,shutter:!0,minShutterEffectPassed:!1});const s=n=>new Promise(a=>setTimeout(a,n));return Fe(t,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(n=>this.props.uploadClient.fetchFileURLs([n]).then(a=>({file:n,fileUrls:a[0]}))).then(({file:n,fileUrls:a})=>this.uploadFile(a,n)).then(()=>s(Ie)).then(()=>{this.setState((n,a)=>({imgSrc:t,shutter:n.shutter,minShutterEffectPassed:!0}))}).catch(n=>{ie(n)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(t=>this.deleteFile(t.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:n,fragmentId:a}=this.props,o=n.getFileUploaderStateValue(s);se(t,o)||n.setFileUploaderStateValue(s,t,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(P(t))return;this.setState({imgSrc:null});const{widgetMgr:s,element:n,fragmentId:a}=this.props;s.setFileUploaderStateValue(n,t,{fromUi:!0},a)})},this.deleteFile=t=>{const s=this.getFile(t);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(s=>({files:[...s.files,t]}))},this.removeFile=t=>{this.setState(s=>({files:s.files.filter(n=>n.id!==t)}))},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{this.setState(n=>({files:n.files.map(a=>a.id===t?s:a)}))},this.onUploadComplete=(t,s)=>{this.setState(()=>({shutter:!1}));const n=this.getFile(t);P(n)||n.status.type!=="uploading"||this.updateFile(n.id,n.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(t,s)=>{const n=this.getFile(s);if(P(n)||n.status.type!=="uploading")return;const a=Math.round(t.loaded*100/t.total);n.status.progress!==a&&this.updateFile(s,n.setStatus({type:"uploading",cancelToken:n.status.cancelToken,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(t,s)=>{const n=_.CancelToken.source(),a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:n,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,a.id),n.token).then(()=>this.onUploadComplete(a.id,t)).catch(o=>{_.isCancel(o)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:t,element:s}=this.props,n=t.getFileUploaderStateValue(s);if(P(n))return l;const{uploadedFileInfo:a}=n;return P(a)||a.length===0?l:{files:a.map(o=>{const p=o.name,S=o.size,x=o.fileId,U=o.fileUrls;return new V(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:U})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=t=>t.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:n}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,l,{fromUi:!1},n)}createWidgetValue(){const l=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:n,status:a}=t;return new ne({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:n})});return new ae({uploadedFileInfo:l})}render(){var a;const{element:l,widgetMgr:t,disabled:s,width:n}=this.props;return this.formClearHelper.manageFormClearListener(t,l.formId,this.onFormCleared),u.jsxs(W,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(oe,{label:l.label,disabled:s,labelVisibility:le((a=l.labelVisibility)==null?void 0:a.value),children:l.help&&u.jsx(de,{children:u.jsx(ce,{content:l.help,placement:k.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(T,{width:n,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:n,height:n*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(Se,{children:[u.jsx(O,{content:D,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(je,{handleCapture:this.handleCapture,width:n,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Fe(i,l){return fetch(i).then(t=>t.arrayBuffer()).then(t=>new File([t],l,{type:"image/jpeg"}))}export{Pe as default};
1
+ import{r as y,E,_ as R,c as C,Q as G,j as u,b1 as X,aK as k,aX as q,aG as Q,aY as O,b9 as z,e as J,g as K,a7 as Y,M as Z,ba as ee,bb as te,R as re,O as ie,$ as se,B as P,as as _,aU as ne,aT as ae,a_ as oe,a$ as le,bc as de,b0 as ce}from"./index-C1elUt1E.js";import{F as he}from"./FormClearHelper-BtlF8Otx.js";import{U as V}from"./UploadFileInfo-C-jY39rj.js";import{P as ue,S as pe}from"./ProgressBar-BnrWSmyb.js";var L=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});L.displayName="Video";var D=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});D.displayName="X";var $=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ge(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const W=C("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=C("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),fe=C("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),me=C("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),ve=C("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),Se=C("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),ye=C("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),we=C("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),be=C("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${G(i.colors.primary,.5)}`},...ge("medium",i)}),"");function H({disabled:i,onClick:l,children:t,progress:s}){return u.jsxs(be,{disabled:i||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[t,s&&u.jsx(we,{children:u.jsx(ue,{value:s,size:pe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const Me=({switchFacingMode:i})=>u.jsx(ye,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(X,{content:"Switch camera",placement:k.TOP_RIGHT,children:u.jsx(q,{kind:Q.MINIMAL,onClick:i,children:u.jsx(O,{content:$,size:"twoXL",color:z.white})})})});var A={exports:{}};(function(i,l){(function(t,s){i.exports=s(y)})(J,function(t){return function(s){var n={};function a(o){if(n[o])return n[o].exports;var p=n[o]={i:o,l:!1,exports:{}};return s[o].call(p.exports,p,p.exports,a),p.l=!0,p.exports}return a.m=s,a.c=n,a.d=function(o,p,S){a.o(o,p)||Object.defineProperty(o,p,{enumerable:!0,get:S})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,p){if(p&1&&(o=a(o)),p&8||p&4&&typeof o=="object"&&o&&o.__esModule)return o;var S=Object.create(null);if(a.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:o}),p&2&&typeof o!="string")for(var x in o)a.d(S,x,(function(U){return o[U]}).bind(null,x));return S},a.n=function(o){var p=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(p,"a",p),p},a.o=function(o,p){return Object.prototype.hasOwnProperty.call(o,p)},a.p="",a(a.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,n,a){a.r(n);var o=a("react"),p=function(){var g=function(h,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,d){r.__proto__=d}||function(r,d){for(var c in d)d.hasOwnProperty(c)&&(r[c]=d[c])},g(h,e)};return function(h,e){g(h,e);function r(){this.constructor=h}h.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),S=function(){return S=Object.assign||function(g){for(var h,e=1,r=arguments.length;e<r;e++){h=arguments[e];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},x=function(g,h){var e={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&h.indexOf(r)<0&&(e[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(g);d<r.length;d++)h.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(g,r[d])&&(e[r[d]]=g[r[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(e,r){h.call(navigator,g,e,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var j=function(g){p(h,g);function h(e){var r=g.call(this,e)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return h.prototype.componentDidMount=function(){var e=this,r=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(e){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(r.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(r.videoConstraints),w=e.minScreenshotWidth!==r.minScreenshotWidth,v=e.minScreenshotHeight!==r.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(r){e.removeTrack(r),r.stop()}),e.getAudioTracks().map(function(r){e.removeTrack(r),r.stop()})):e.stop())},h.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(h.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},h.prototype.getScreenshot=function(e){var r=this,d=r.state,c=r.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(e);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(e){var r=this,d=r.state,c=r.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var f=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/f,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*f)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||w,this.canvas.height=(e==null?void 0:e.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,m=M.canvas;return b&&m&&(m.width=(e==null?void 0:e.width)||m.width,m.height=(e==null?void 0:e.height)||m.height,c.mirrored&&(b.translate(m.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||m.width,(e==null?void 0:e.height)||m.height),c.mirrored&&(b.scale(-1,1),b.translate(-m.width,0))),m},h.prototype.requestUserMedia=function(){var e=this,r=this.props,d=function(v,f){var M={video:typeof f<"u"?f:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(m){e.unmounted||b!==e.requestUserMediaId?h.stopMediaStream(m):e.handleUserMedia(null,m)}).catch(function(m){e.handleUserMedia(m)})};if("mediaDevices"in navigator)d(r.audioConstraints,r.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var f=v.deviceId;return typeof f=="string"?f:Array.isArray(f)&&f.length>0?f[0]:typeof f=="object"&&f.ideal?f.ideal:null};MediaStreamTrack.getSources(function(v){var f=null,M=null;v.forEach(function(I){I.kind==="audio"?f=I.id:I.kind==="video"&&(M=I.id)});var b=w(r.audioConstraints);b&&(f=b);var m=w(r.videoConstraints);m&&(M=m),d(c(f),c(M))})}},h.prototype.handleUserMedia=function(e,r){var d=this.props;if(e||!r){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}d.onUserMedia(r)},h.prototype.render=function(){var e=this,r=this,d=r.state,c=r.props,w=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,f=c.style,M=f===void 0?{}:f,b=c.children,m=x(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),I=v?S(S({},M),{transform:(M.transform||"")+" scaleX(-1)"}):M,N={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",S({autoPlay:!0,src:d.src,muted:!w,playsInline:!0,ref:function(B){e.video=B},style:I},m)),b&&b(N))},h.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(o.Component);n.default=j},react:function(s,n){s.exports=t}}).default})})(A);var Ue=A.exports;const xe=K(Ue),Ce=({width:i})=>u.jsxs(T,{width:i,children:[u.jsx(O,{size:"threeXL",color:z.gray60,content:L}),u.jsxs(fe,{children:["This app would like to use your camera.",u.jsx(ve,{href:te,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),je=({handleCapture:i,width:l,disabled:t,clearPhotoInProgress:s,setClearPhotoInProgress:n,facingMode:a,setFacingMode:o,testOverride:p})=>{const[S,x]=y.useState(p||"pending"),U=y.useRef(null),[j,g]=y.useState(l),h=y.useCallback(Y(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function e(){if(U.current!==null){const d=U.current.getScreenshot();i(d)}}const r=Z();return u.jsxs(W,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!t&&!s?u.jsx(Ce,{width:j}):ee&&u.jsx(Me,{switchFacingMode:o}),u.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!t&&!s,width:j,children:!t&&u.jsx(xe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:j,height:j*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{x("error")},onUserMedia:()=>{x("success"),n(!1)},videoConstraints:{width:{ideal:j},facingMode:a}})}),u.jsx(H,{onClick:e,disabled:S!=="success"||t||s,children:"Take Photo"})]})},Ie=150;class Pe extends re.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new he,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=t=>{this.setState({clearPhotoInProgress:t})},this.setFacingMode=()=>{this.setState(t=>({facingMode:t.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=t=>{if(t===null)return Promise.resolve();this.setState({imgSrc:t,shutter:!0,minShutterEffectPassed:!1});const s=n=>new Promise(a=>setTimeout(a,n));return Fe(t,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(n=>this.props.uploadClient.fetchFileURLs([n]).then(a=>({file:n,fileUrls:a[0]}))).then(({file:n,fileUrls:a})=>this.uploadFile(a,n)).then(()=>s(Ie)).then(()=>{this.setState((n,a)=>({imgSrc:t,shutter:n.shutter,minShutterEffectPassed:!0}))}).catch(n=>{ie(n)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(t=>this.deleteFile(t.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:s,widgetMgr:n,fragmentId:a}=this.props,o=n.getFileUploaderStateValue(s);se(t,o)||n.setFileUploaderStateValue(s,t,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(P(t))return;this.setState({imgSrc:null});const{widgetMgr:s,element:n,fragmentId:a}=this.props;s.setFileUploaderStateValue(n,t,{fromUi:!0},a)})},this.deleteFile=t=>{const s=this.getFile(t);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(s=>({files:[...s.files,t]}))},this.removeFile=t=>{this.setState(s=>({files:s.files.filter(n=>n.id!==t)}))},this.getFile=t=>this.state.files.find(s=>s.id===t),this.updateFile=(t,s)=>{this.setState(n=>({files:n.files.map(a=>a.id===t?s:a)}))},this.onUploadComplete=(t,s)=>{this.setState(()=>({shutter:!1}));const n=this.getFile(t);P(n)||n.status.type!=="uploading"||this.updateFile(n.id,n.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(t,s)=>{const n=this.getFile(s);if(P(n)||n.status.type!=="uploading")return;const a=Math.round(t.loaded*100/t.total);n.status.progress!==a&&this.updateFile(s,n.setStatus({type:"uploading",cancelToken:n.status.cancelToken,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(t,s)=>{const n=_.CancelToken.source(),a=new V(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:n,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,s,o=>this.onUploadProgress(o,a.id),n.token).then(()=>this.onUploadComplete(a.id,t)).catch(o=>{_.isCancel(o)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:o?o.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:t,element:s}=this.props,n=t.getFileUploaderStateValue(s);if(P(n))return l;const{uploadedFileInfo:a}=n;return P(a)||a.length===0?l:{files:a.map(o=>{const p=o.name,S=o.size,x=o.fileId,U=o.fileUrls;return new V(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:U})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=t=>t.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:n}=this.props;s.getFileUploaderStateValue(t)===void 0&&s.setFileUploaderStateValue(t,l,{fromUi:!1},n)}createWidgetValue(){const l=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:s,size:n,status:a}=t;return new ne({fileId:a.fileId,fileUrls:a.fileUrls,name:s,size:n})});return new ae({uploadedFileInfo:l})}render(){var a;const{element:l,widgetMgr:t,disabled:s,width:n}=this.props;return this.formClearHelper.manageFormClearListener(t,l.formId,this.onFormCleared),u.jsxs(W,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(oe,{label:l.label,disabled:s,labelVisibility:le((a=l.labelVisibility)==null?void 0:a.value),children:l.help&&u.jsx(de,{children:u.jsx(ce,{content:l.help,placement:k.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(T,{width:n,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:n,height:n*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(Se,{children:[u.jsx(O,{content:D,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(je,{handleCapture:this.handleCapture,width:n,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Fe(i,l){return fetch(i).then(t=>t.arrayBuffer()).then(t=>new File([t],l,{type:"image/jpeg"}))}export{Pe as default};
@@ -1 +1 @@
1
- import{R as m,a6 as w,aG as u,b8 as b,j as c,aH as g,aX as y,aF as A,aI as C}from"./index-BzTZZCvL.js";import{c as R}from"./createDownloadLinkElement-DZMwyjvU.js";const T=/%([0-9A-Fa-f]{2})/g,v=/[^\x20-\x7e\xa0-\xff]/g,E=/\\([\u0000-\u007f])/g,p=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,I=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,L=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,z=n=>String(n).replace(v,"?");class ${constructor(t,e){this.type=t,this.parameters=e}}const k=(n,t)=>String.fromCharCode(Number.parseInt(t,16));function U(n){const t=I.exec(n);if(!t)throw new TypeError("invalid extended field value");const e=t[1].toLowerCase(),o=t[2];let r;switch(e){case"iso-8859-1":r=z(o.replace(T,k));break;case"utf-8":try{r=decodeURIComponent(o)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return r}function Z(n){let t=L.exec(n);if(!t)throw new TypeError("invalid type format");let e=t[0].length;const o=t[1].toLowerCase();let r;const s=[],i={};let a;for(e=p.lastIndex=t[0].slice(-1)===";"?e-1:e;t=p.exec(n);){if(t.index!==e)throw new TypeError("invalid parameter format");if(e+=t[0].length,r=t[1].toLowerCase(),a=t[2],s.indexOf(r)!==-1)throw new TypeError("invalid duplicate parameter");if(s.push(r),r.indexOf("*")+1===r.length){r=r.slice(0,-1),a=U(a),i[r]=a;continue}typeof i[r]!="string"&&(a[0]==='"'&&(a=a.slice(1,a.length-1).replace(E,"$1")),i[r]=a)}if(e!==-1&&e!==n.length)throw new TypeError("invalid parameter format");return new $(o,i)}function j(n){const t=Z(n);if(t.type!=="attachment")return;const e=t.parameters.filename;if(typeof e=="string")return e}function D(n,t){n.sendHttpRequest({method:"GET",path:`${t}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:e,headers:o,body:r})=>{if(e!==200)return;const s=o.get("Content-Disposition"),i=(s&&j(s))??"",a=o.get("Content-Type"),f=new Blob([r],a?{type:a}:void 0),d=URL.createObjectURL(f),l=document.createElement("a");l.setAttribute("href",d),l.setAttribute("target","_blank"),l.setAttribute("download",i),l.click(),URL.revokeObjectURL(d),l.remove()})}function _(n,t,e){return R({enforceDownloadInNewTab:e,url:n.buildMediaURL(t),filename:""})}function N(n){const{disabled:t,element:e,widgetMgr:o,width:r,endpoints:s,fragmentId:i}=n,a={width:r},{libConfig:{enforceDownloadInNewTab:f=!1}}=m.useContext(w);let d=u.SECONDARY;e.type==="primary"?d=u.PRIMARY:e.type==="tertiary"&&(d=u.TERTIARY);const l=b(),x=()=>{if(o.setTriggerValue(e,{fromUi:!0},i),e.url.startsWith("/media")){D(l,e.url);return}_(s,e.url,f).click()},h=e.help?r:!0;return c.jsx("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:a,children:c.jsx(g,{help:e.help,children:c.jsx(y,{kind:d,size:A.SMALL,disabled:t,onClick:x,fluidWidth:e.useContainerWidth?h:!1,children:c.jsx(C,{icon:e.icon,label:e.label})})})})}export{N as default};
1
+ import{R as m,a6 as w,aG as u,b8 as b,j as c,aH as g,aX as y,aF as A,aI as C}from"./index-C1elUt1E.js";import{c as R}from"./createDownloadLinkElement-DZMwyjvU.js";const T=/%([0-9A-Fa-f]{2})/g,v=/[^\x20-\x7e\xa0-\xff]/g,E=/\\([\u0000-\u007f])/g,p=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,I=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,L=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,z=n=>String(n).replace(v,"?");class ${constructor(t,e){this.type=t,this.parameters=e}}const k=(n,t)=>String.fromCharCode(Number.parseInt(t,16));function U(n){const t=I.exec(n);if(!t)throw new TypeError("invalid extended field value");const e=t[1].toLowerCase(),o=t[2];let r;switch(e){case"iso-8859-1":r=z(o.replace(T,k));break;case"utf-8":try{r=decodeURIComponent(o)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return r}function Z(n){let t=L.exec(n);if(!t)throw new TypeError("invalid type format");let e=t[0].length;const o=t[1].toLowerCase();let r;const s=[],i={};let a;for(e=p.lastIndex=t[0].slice(-1)===";"?e-1:e;t=p.exec(n);){if(t.index!==e)throw new TypeError("invalid parameter format");if(e+=t[0].length,r=t[1].toLowerCase(),a=t[2],s.indexOf(r)!==-1)throw new TypeError("invalid duplicate parameter");if(s.push(r),r.indexOf("*")+1===r.length){r=r.slice(0,-1),a=U(a),i[r]=a;continue}typeof i[r]!="string"&&(a[0]==='"'&&(a=a.slice(1,a.length-1).replace(E,"$1")),i[r]=a)}if(e!==-1&&e!==n.length)throw new TypeError("invalid parameter format");return new $(o,i)}function j(n){const t=Z(n);if(t.type!=="attachment")return;const e=t.parameters.filename;if(typeof e=="string")return e}function D(n,t){n.sendHttpRequest({method:"GET",path:`${t}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:e,headers:o,body:r})=>{if(e!==200)return;const s=o.get("Content-Disposition"),i=(s&&j(s))??"",a=o.get("Content-Type"),f=new Blob([r],a?{type:a}:void 0),d=URL.createObjectURL(f),l=document.createElement("a");l.setAttribute("href",d),l.setAttribute("target","_blank"),l.setAttribute("download",i),l.click(),URL.revokeObjectURL(d),l.remove()})}function _(n,t,e){return R({enforceDownloadInNewTab:e,url:n.buildMediaURL(t),filename:""})}function N(n){const{disabled:t,element:e,widgetMgr:o,width:r,endpoints:s,fragmentId:i}=n,a={width:r},{libConfig:{enforceDownloadInNewTab:f=!1}}=m.useContext(w);let d=u.SECONDARY;e.type==="primary"?d=u.PRIMARY:e.type==="tertiary"&&(d=u.TERTIARY);const l=b(),x=()=>{if(o.setTriggerValue(e,{fromUi:!0},i),e.url.startsWith("/media")){D(l,e.url);return}_(s,e.url,f).click()},h=e.help?r:!0;return c.jsx("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:a,children:c.jsx(g,{help:e.help,children:c.jsx(y,{kind:d,size:A.SMALL,disabled:t,onClick:x,fluidWidth:e.useContainerWidth?h:!1,children:c.jsx(C,{icon:e.icon,label:e.label})})})})}export{N as default};
@@ -1,4 +1,4 @@
1
- import{k as i,c as r,r as l,j as t}from"./index-BzTZZCvL.js";import{R as m,P as p}from"./RenderInPortalIfExists-CxeJAxCs.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=i`
1
+ import{k as i,c as r,r as l,j as t}from"./index-C1elUt1E.js";import{R as m,P as p}from"./RenderInPortalIfExists-Ca4-_0pe.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=i`
2
2
  from {
3
3
  transform: translateY(calc(100vh + ${n}px));
4
4
  }
@@ -1 +1 @@
1
- import{c as p,ak as y,r as s,j as i,al as w,a2 as S,am as t,an as T,ao as v,a5 as z}from"./index-BzTZZCvL.js";const R=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}}),""),j=p("div",{target:"elibz2u2"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),k=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 B(e){const o=z(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 C(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({theme:e,body:o,icon:n,width:h}){const r=C(o),d=o!==r,[a,m]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{m(!a)},[a]),l=s.useMemo(()=>B(e),[e]),c=s.useMemo(()=>i.jsxs(j,{expanded:a,children:[n&&i.jsx(w,{iconValue:n,size:"xl",testid:"stToastDynamicIcon"}),i.jsxs(k,{children:[i.jsx(S,{source:a?o:r,allowHTML:!1,isToast:!0}),d&&i.jsx(R,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,o,n,r,f]);s.useEffect(()=>{if(e.inSidebar)return;const g=t.info(c,{overrides:{...l}});return b(g),()=>{t.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),t.clear(g)}},[]),s.useEffect(()=>{t.update(u,{children:c,overrides:{...l}})},[u,c,l]);const x=i.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.",width:h});return i.jsx(i.Fragment,{children:e.inSidebar&&x})}const D=y(L);export{D as default};
1
+ import{c as p,ak as y,r as s,j as i,al as w,a2 as S,am as t,an as T,ao as v,a5 as z}from"./index-C1elUt1E.js";const R=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}}),""),j=p("div",{target:"elibz2u2"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),k=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 B(e){const o=z(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 C(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({theme:e,body:o,icon:n,width:h}){const r=C(o),d=o!==r,[a,m]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{m(!a)},[a]),l=s.useMemo(()=>B(e),[e]),c=s.useMemo(()=>i.jsxs(j,{expanded:a,children:[n&&i.jsx(w,{iconValue:n,size:"xl",testid:"stToastDynamicIcon"}),i.jsxs(k,{children:[i.jsx(S,{source:a?o:r,allowHTML:!1,isToast:!0}),d&&i.jsx(R,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,o,n,r,f]);s.useEffect(()=>{if(e.inSidebar)return;const g=t.info(c,{overrides:{...l}});return b(g),()=>{t.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),t.clear(g)}},[]),s.useEffect(()=>{t.update(u,{children:c,overrides:{...l}})},[u,c,l]);const x=i.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.",width:h});return i.jsx(i.Fragment,{children:e.inSidebar&&x})}const D=y(L);export{D as default};