@stlite/desktop 0.30.2 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +31 -29
  3. package/build/index.html +1 -1
  4. package/build/static/js/2116.fd3de825.chunk.js +1 -0
  5. package/build/static/js/2523.4761d79a.chunk.js +5 -0
  6. package/build/static/js/2632.de1769ff.chunk.js +1 -0
  7. package/build/static/js/277.d9ceff66.chunk.js +1 -0
  8. package/build/static/js/3376.d5aaecc4.chunk.js +1 -0
  9. package/build/static/js/3392.5ed3420d.chunk.js +1 -0
  10. package/build/static/js/{3977.8a9ac9d7.chunk.js → 3977.24eb5fb8.chunk.js} +1 -1
  11. package/build/static/js/{4210.66c14600.chunk.js → 4210.945a5966.chunk.js} +1 -1
  12. package/build/static/js/{4514.ff4d47b7.chunk.js → 4514.7931bd64.chunk.js} +1 -1
  13. package/build/static/js/{464.8a875fdd.chunk.js → 464.7c22f33c.chunk.js} +1 -1
  14. package/build/static/js/5608.b4074ab9.chunk.js +1 -0
  15. package/build/static/js/{5678.b7f865a0.chunk.js → 5678.729bced9.chunk.js} +1 -1
  16. package/build/static/js/6223.4bb0039e.chunk.js +2 -0
  17. package/build/static/js/6223.4bb0039e.chunk.js.LICENSE.txt +11 -0
  18. package/build/static/js/{6422.f69a61a8.chunk.js → 6422.c2900a88.chunk.js} +1 -1
  19. package/build/static/js/{7073.33f107fd.chunk.js → 7073.0a198301.chunk.js} +1 -1
  20. package/build/static/js/7496.0f941cac.chunk.js +1 -0
  21. package/build/static/js/{761.e16e6486.chunk.js → 761.ca3883de.chunk.js} +1 -1
  22. package/build/static/js/7698.00f5ff0b.chunk.js +1 -0
  23. package/build/static/js/7858.e4a6aa6d.chunk.js +5 -0
  24. package/build/static/js/{7937.a3bc5cdb.chunk.js → 7937.4b1be66e.chunk.js} +1 -1
  25. package/build/static/js/{8355.7352ad1b.chunk.js → 8355.b110abc9.chunk.js} +1 -1
  26. package/build/static/js/{8461.87a9a578.chunk.js → 8461.85faefa1.chunk.js} +1 -1
  27. package/build/static/js/9462.81f9c52a.chunk.js +1 -0
  28. package/build/static/js/9551.c45b17cf.chunk.js +1 -0
  29. package/build/static/js/main.1add465f.js +28 -0
  30. package/build/static/js/{main.4ee8ce64.js.LICENSE.txt → main.1add465f.js.LICENSE.txt} +1 -3
  31. package/build/static/media/checkmark.29851c8e9e6ef0c3d6c1e4efe3c1bb9e.svg +3 -0
  32. package/build/static/media/logo.83ae4f2fb87e38be7cbb8a5d2beb64d2.svg +5 -0
  33. package/build/static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg +9 -0
  34. package/package.json +4 -4
  35. package/build/static/js/2116.2e449b06.chunk.js +0 -1
  36. package/build/static/js/2523.7919ada5.chunk.js +0 -5
  37. package/build/static/js/2632.1bb45c13.chunk.js +0 -1
  38. package/build/static/js/277.fbace0b9.chunk.js +0 -1
  39. package/build/static/js/3376.839fa3bf.chunk.js +0 -1
  40. package/build/static/js/3392.7b32c75f.chunk.js +0 -1
  41. package/build/static/js/458.895bbb73.chunk.js +0 -1
  42. package/build/static/js/5608.314b94e4.chunk.js +0 -1
  43. package/build/static/js/6928.228563da.chunk.js +0 -2
  44. package/build/static/js/6928.228563da.chunk.js.LICENSE.txt +0 -26
  45. package/build/static/js/7496.37614377.chunk.js +0 -1
  46. package/build/static/js/7698.095351a0.chunk.js +0 -1
  47. package/build/static/js/7858.fa281cb7.chunk.js +0 -5
  48. package/build/static/js/9462.ebffc855.chunk.js +0 -1
  49. package/build/static/js/9551.f6ae672e.chunk.js +0 -1
  50. package/build/static/js/main.4ee8ce64.js +0 -28
@@ -1,26 +0,0 @@
1
- /*!
2
- * https://github.com/Starcounter-Jack/JSON-Patch
3
- * (c) 2017-2021 Joachim Wester
4
- * MIT license
5
- */
6
-
7
- /*!
8
- * https://github.com/Starcounter-Jack/JSON-Patch
9
- * (c) 2017-2022 Joachim Wester
10
- * MIT licensed
11
- */
12
-
13
- /*! *****************************************************************************
14
- Copyright (c) Microsoft Corporation.
15
-
16
- Permission to use, copy, modify, and/or distribute this software for any
17
- purpose with or without fee is hereby granted.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
- ***************************************************************************** */
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7496],{77390:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(5057),r=s(31476),o=s(85493),n=s(99362),a=s(16449),l=s(80099),d=s(96266);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function({value:e,width:t,size:s=c.SMALL,overrides:h}){const g=(0,r.u)(),u={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:p}=i.useContext(o.Z),m=!(0,n.MJ)(p),f={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:({$theme:e})=>({width:t?t.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:u[s],backgroundColor:e.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})},BarProgress:{style:({$theme:e})=>({backgroundColor:m?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(a.Z,{value:e,overrides:(0,l.aO)(f,h)})}},77496:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(30967),o=s(10458),n=s.n(o),a=s(65873),l=s.n(a),d=s(5057),c=s(32291),h=s(97292),g=s(54840),u=s(8429),p=s(86964),m=s(56846),f=s(52801),S=s(34422),w=s(41605),x=s(77390),R=s(45490),b=s(59990);function F(e,t){switch(e){case i.XSMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.sm}`,fontSize:t.fontSizes.sm};case i.SMALL:return{padding:`${t.spacing.twoXS} ${t.spacing.md}`};case i.LARGE:return{padding:`${t.spacing.md} ${t.spacing.md}`};default:return{padding:`${t.spacing.xs} ${t.spacing.md}`}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const C=(0,R.Z)("div",{target:"ejtjsn29"})((({theme:e,width:t})=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),j=(0,R.Z)("div",{target:"ejtjsn28"})((({theme:e,width:t})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.md} ${e.radii.md} 0 0`,width:"100%",height:9*t/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),""),I=(0,R.Z)("p",{target:"ejtjsn27"})((({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"})),""),v=(0,R.Z)("img",{target:"ejtjsn26"})((({theme:e,opacity:t})=>({borderRadius:`${e.radii.md} ${e.radii.md} 0 0`,objectFit:"contain",opacity:t})),""),E=(0,R.Z)("a",{target:"ejtjsn25"})((({theme:e})=>({color:e.colors.primary,display:"block",textDecoration:"none"})),""),T=(0,R.Z)("span",{target:"ejtjsn24"})((({theme:e})=>({display:"flex",alignItems:"center"})),""),M=(0,R.Z)("div",{target:"ejtjsn23"})((({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:1,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),""),P=(0,R.Z)("div",{target:"ejtjsn21"})((({theme:e})=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),y=(0,R.Z)("button",{target:"ejtjsn20"})((({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`1px solid ${e.colors.fadedText10}`,borderRadius:`0 0 ${e.radii.md} ${e.radii.md}`,"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:e.colors.fadedText40},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:0,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{boxShadow:`0 0 0 0.2rem ${(0,b.DZ)(e.colors.primary,.5)}`,outline:"none"},...F(i.MEDIUM,e)})),"");var L=s(96266);const U=function({disabled:e,onClick:t,children:s,progress:i}){return(0,L.jsxs)(y,{disabled:e||!1,onClick:t||(()=>{}),progress:i||null,"data-testid":"stCameraInputButton",children:[s,i&&(0,L.jsx)(P,{children:(0,L.jsx)(x.Z,{value:i,size:x.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(90693),$=s(92445),Z=s(3579);let D;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(D||(D={}));const X=({switchFacingMode:e})=>(0,L.jsx)(M,{children:(0,L.jsx)(g.ZP,{content:"Switch camera",placement:g.ug.TOP_RIGHT,children:(0,L.jsx)($.ZP,{kind:$.hY.MINIMAL,onClick:e,children:(0,L.jsx)(h.ZP,{content:k.Z,size:"twoXL",color:Z.Z.white})})})});var O=s(85585),_=s(31476),A=s(11226),B=s(74947),N=s.n(B),z=s(92371);let G;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(G||(G={}));const V=({width:e})=>(0,L.jsxs)(j,{width:e,children:[(0,L.jsx)(h.ZP,{size:"threeXL",color:Z.Z.gray60,content:O.n}),(0,L.jsxs)(I,{children:["This app would like to use your camera.",(0,L.jsx)(E,{href:z.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),W=({handleCapture:e,width:t,disabled:s,clearPhotoInProgress:i,setClearPhotoInProgress:r,facingMode:o,setFacingMode:n})=>{const[a,l]=(0,d.useState)(G.PENDING),c=(0,d.useRef)(null),[h,g]=(0,d.useState)(t),u=(0,d.useCallback)((0,S.Ds)(1e3,g),[]);(0,d.useEffect)((()=>{u(t)}),[t]);const p=(0,_.u)();return(0,L.jsxs)(C,{width:h,children:[a===G.SUCCESS||s||i?A.tq&&(0,L.jsx)(X,{switchFacingMode:n}):(0,L.jsx)(V,{width:h}),(0,L.jsx)(j,{hidden:a!==G.SUCCESS&&!s&&!i,width:h,children:!s&&(0,L.jsx)(N(),{audio:!1,ref:c,screenshotFormat:"image/jpeg",screenshotQuality:1,width:h,height:9*h/16,style:{borderRadius:`${p.radii.md} ${p.radii.md} 0 0`},onUserMediaError:()=>{l(G.ERROR)},onUserMedia:()=>{l(G.SUCCESS),r(!1)},videoConstraints:{width:{ideal:h},facingMode:o}})}),(0,L.jsx)(U,{onClick:function(){if(null!==c.current){const t=c.current.getScreenshot();e(t)}},disabled:a!==G.SUCCESS||s||i,children:"Take Photo"})]})};class H extends d.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.Kz,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===D.USER?D.ENVIRONMENT:D.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});var t,s;return(t=e,s=`camera-input-${(new Date).toISOString().replace(/:/g,"_")}.jpg`,fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.uploadFile(e))).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}))},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=e=>{const{element:t,widgetMgr:s}=this.props;if(e.disabled!==this.props.disabled&&this.props.disabled)return this.reset(),void s.setFileUploaderStateValue(t,new c.xO,{fromUi:!1});if("ready"!==this.status)return;const i=this.createWidgetValue();if(void 0===i)return;const r=s.getFileUploaderStateValue(t);l().isEqual(i,r)||s.setFileUploaderStateValue(t,i,{fromUi:!0})},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();null!=e&&(this.setState({imgSrc:null}),this.props.widgetMgr.setFileUploaderStateValue(this.props.element,e,{fromUi:!0}))}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((e=>({newestServerFileId:Math.max(e.newestServerFileId,t),shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",serverFileId:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=e=>{const t=n().CancelToken.source(),s=new w.R(e.name,e.size,this.nextLocalFileId(),{type:"uploading",cancelToken:t,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e,(e=>this.onUploadProgress(e,s.id)),t.token).then((e=>this.onUploadComplete(s.id,e))).catch((e=>{n().isCancel(e)||this.updateFile(s.id,s.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],newestServerFileId:0,imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:D.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{maxFileId:r,uploadedFileInfo:o}=i;return null==r||0===r||null==o?e:{files:o.map((e=>{const t=e.name,s=e.size,i=e.id;return new w.R(t,s,this.nextLocalFileId(),{type:"uploaded",serverFileId:i})})),newestServerFileId:Number(r),imgSrc:0===o.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:D.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}createWidgetValue(){if(0===this.state.newestServerFileId)return;const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new c.jM({id:i.serverFileId,name:t,size:s})}));return new c.xO({maxFileId:this.state.newestServerFileId,uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,L.jsxs)(C,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,L.jsx)(p.ON,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,L.jsx)(p.dT,{children:(0,L.jsx)(u.Z,{content:t.help,placement:g.ug.TOP_RIGHT})})}),this.state.imgSrc?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(j,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,L.jsx)(v,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,L.jsx)(U,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,L.jsxs)(T,{children:[(0,L.jsx)(h.ZP,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,L.jsx)(W,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=H},41605:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7698],{67698:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var o=s(5057),n=s(31476),i=s(99362),r=s(46540),l=s(85493),a=s(45490),c=s(70765),g=s(69194);const d=(0,a.Z)(c.Q,{shouldForwardProp:g.Z,target:"e17lx80j1"})((({theme:e,$usingCustomTheme:t})=>({marginTop:e.spacing.none,marginBottom:e.spacing.none,marginRight:e.spacing.none,marginLeft:e.spacing.none,borderColor:e.colors.fadedText10,borderTopColor:t?e.colors.primary:e.colors.blue70,flexGrow:0,flexShrink:0})),""),h=(0,a.Z)("div",{target:"e17lx80j0"})((({theme:e})=>({display:"flex",gap:e.spacing.lg,alignItems:"center",width:"100%"})),"");var p=s(96266);const m=function({width:e,element:t}){const s=(0,n.u)(),{activeTheme:a}=o.useContext(l.Z),c=!(0,i.MJ)(a),g={width:e};return(0,p.jsx)("div",{className:"stSpinner",style:g,children:(0,p.jsxs)(h,{children:[(0,p.jsx)(d,{$size:s.iconSizes.twoXL,$usingCustomTheme:c}),(0,p.jsx)(r.Z,{source:t.text,allowHTML:!1})]})})}}}]);
@@ -1,5 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7858],{6757:(t,e,i)=>{i.d(e,{Z:()=>d});i(5057);var s=i(34422),n=i(86964),o=i(45490);const r=i(21371).F4`
2
- 50% {
3
- color: rgba(0, 0, 0, 0);
4
- }
5
- `,a=(0,o.Z)("span",{target:"e1m4n6jn0"})((({includeDot:t,shouldBlink:e,theme:i})=>({...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:i.colors.gray,margin:"0 5px"}}:{},...e?{color:i.colors.red,animationName:`${r}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),"");var l=i(96266);const d=({dirty:t,value:e,maxLength:i,className:o,type:r="single"})=>{const d=[],h=(t,e=!1)=>{d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};return t&&("multiline"===r?(0,s.Ge)()?h("Press \u2318+Enter to apply"):h("Press Ctrl+Enter to apply"):h("Press Enter to apply")),i&&h(`${e.length}/${i}`,t&&e.length>=i),(0,l.jsx)(n.X7,{className:o,children:d})}},7858:(t,e,i)=>{i.r(e),i.d(e,{default:()=>R});var s=i(5057),n=i(52707),o=i(84332),r=i(59500),a=i(56846),l=i(52801),d=i(32291),h=i(8429),u=i(54840),c=i(97292),m=i(30124),p=i(6757),g=i(86964),b=i(34422),f=i(45490);const y=(0,f.Z)("div",{target:"e1jwn65y3"})((({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",border:"1px solid transparent",transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.md,"&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),""),x=(0,f.Z)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),v=(0,f.Z)("button",{target:"e1jwn65y1"})((({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.md,borderBottomRightRadius:t.radii.md},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),""),V=(0,f.Z)("div",{target:"e1jwn65y0"})((({theme:t})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:"64px"})),"");var w=i(96266);class D extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new a.Kz,this.inputRef=s.createRef(),this.formatValue=t=>{const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,r.sprintf)(e,t)}catch(i){return(0,l.KE)(`Error in sprintf(${e}, ${t}): ${i}`),String(t)}},this.isIntData=()=>this.props.element.dataType===d.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s}=this.props,n=this.props.element,o=this.getMin(),r=this.getMax();if(o>e||e>r){const t=this.inputRef.current;t&&t.reportValidity()}else{const o=e||0===e?e:n.default;this.isIntData()?s.setIntValue(i,o,t):s.setDoubleValue(i,o,t),this.setState({dirty:!1,value:o,formattedValue:this.formatValue(o)})}},this.onFormCleared=()=>{this.setState(((t,e)=>({value:e.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;let i;i=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:i,formattedValue:e})},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:e+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:e-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1}}get initialValue(){const t=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==t?t:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:t,formattedValue:this.formatValue(t)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:r}=this.props,{formattedValue:a,dirty:l,isFocused:d}=this.state,f={width:i},D=!this.canDecrement||s,R=!this.canIncrement||s;return this.formClearHelper.manageFormClearListener(r,e.formId,this.onFormCleared),(0,w.jsxs)("div",{className:"stNumberInput",style:f,children:[(0,w.jsx)(g.ON,{label:e.label,disabled:s,labelVisibility:(0,b.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),children:e.help&&(0,w.jsx)(g.dT,{children:(0,w.jsx)(h.Z,{content:e.help,placement:u.ug.TOP_RIGHT})})}),(0,w.jsxs)(y,{className:d?"focused":"",children:[(0,w.jsx)(m.Z,{type:"number",inputRef:this.inputRef,value:a,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:s,"aria-label":e.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),(0,w.jsxs)(x,{children:[(0,w.jsx)(v,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:D,children:(0,w.jsx)(c.ZP,{content:n.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,w.jsx)(v,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:R,children:(0,w.jsx)(c.ZP,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),(0,w.jsx)(V,{children:(0,w.jsx)(p.Z,{dirty:l,value:a,className:"input-instructions"})})]})}}const R=D}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9462],{69462:(t,e,s)=>{s.r(e),s.d(e,{default:()=>n});var r=s(5057),u=s(85493),i=s(22199),a=s(9301),l=s(96266);function n({element:t,width:e}){const s=(0,r.useRef)(null),{getBaseUriParts:n}=(0,r.useContext)(u.Z);(0,r.useEffect)((()=>{s.current&&(s.current.currentTime=t.startTime)}),[t.startTime]);const c=(0,a.O0)(t.url),o=(0,i.Bz)(c,n());return(0,l.jsx)("audio",{id:"audio",ref:s,controls:!0,src:o,className:"stAudio",style:{width:e}})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9551],{29551:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(5057),a=r(85493),n=r(32291),i=r(22199),l=r(9301),o=r(96266);const d=528;function c({element:e,width:t}){const r=(0,s.useRef)(null),{getBaseUriParts:c}=(0,s.useContext)(a.Z),{type:u,url:h}=e,m=(0,l.O0)(h);(0,s.useEffect)((()=>{const t=r.current,s=()=>{t&&(t.currentTime=e.startTime)};return t&&t.addEventListener("loadedmetadata",s),()=>{t&&t.removeEventListener("loadedmetadata",s)}}),[e]);const f=t=>{const{startTime:r}=e;return r?`${t}?start=${r}`:t};if(u===n.nk.Type.YOUTUBE_IFRAME){const e=0!==t?.75*t:d;return(0,o.jsx)("iframe",{title:m,src:f(m),width:t,height:e,frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,o.jsx)("video",{ref:r,controls:!0,src:(0,i.Bz)(m,c()),className:"stVideo",style:{width:t,height:0===t?d:void 0}})}}}]);