streamlit-nightly 1.41.2.dev20250120__py2.py3-none-any.whl → 1.41.2.dev20250123__py2.py3-none-any.whl
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.
- streamlit/elements/vega_charts.py +19 -5
- streamlit/static/index.html +2 -2
- streamlit/static/static/js/{FileDownload.esm.DW9qPsuf.js → FileDownload.esm.t1Hil-y4.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BP4f-wKq.js → FormClearHelper.rBcBHx-q.js} +1 -1
- streamlit/static/static/js/{Hooks.DNhdjC_E.js → Hooks.B8TnuVtR.js} +1 -1
- streamlit/static/static/js/{InputInstructions.6chqAOMM.js → InputInstructions.CopSVRMj.js} +1 -1
- streamlit/static/static/js/ProgressBar.CH2O9ehW.js +2 -0
- streamlit/static/static/js/{RenderInPortalIfExists.cTCR1GXI.js → RenderInPortalIfExists.MRfetJYl.js} +1 -1
- streamlit/static/static/js/Toolbar.CDCMZRKs.js +1 -0
- streamlit/static/static/js/{base-input.DIQMGXMv.js → base-input.D6xvdW3E.js} +1 -1
- streamlit/static/static/js/{createSuper.Do1oR0VE.js → createSuper.DoZ28Bia.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.0VbWmjRF.js → data-grid-overlay-editor.DXCddEab.js} +1 -1
- streamlit/static/static/js/{downloader.DFiVHqec.js → downloader.C0cVY44J.js} +1 -1
- streamlit/static/static/js/{es6.zKs-XsJ1.js → es6.BLqxZgqS.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.B4u2uvgs.js → getPrototypeOf.kzwmebxc.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.Cfik70yz.js → iframeResizer.contentWindow.DD6xL-U3.js} +1 -1
- streamlit/static/static/js/{index.CTVIegXx.js → index.2GeiiWrC.js} +2 -2
- streamlit/static/static/js/{index.CEyo-K3a.js → index.8xFDRnWS.js} +1 -1
- streamlit/static/static/js/index.B1sQCRIs.js +1 -0
- streamlit/static/static/js/index.B7TeUVfZ.js +1 -0
- streamlit/static/static/js/{index.DZ31yuLl.js → index.BXD6MmFg.js} +1 -1
- streamlit/static/static/js/index.B_czjYL4.js +197 -0
- streamlit/static/static/js/index.Bbg2PQIH.js +3 -0
- streamlit/static/static/js/{index.BTG890If.js → index.BcaoSc9o.js} +13 -13
- streamlit/static/static/js/index.BgLhUQOc.js +1 -0
- streamlit/static/static/js/index.BiBAL3w8.js +1 -0
- streamlit/static/static/js/index.BiI5Rn5J.js +1 -0
- streamlit/static/static/js/{index.Cf3IO5h3.js → index.C5Aw0Bsm.js} +2 -2
- streamlit/static/static/js/index.CBPL_Qdc.js +2 -0
- streamlit/static/static/js/{index.DOO7x26L.js → index.CC_Xa8j8.js} +1 -1
- streamlit/static/static/js/{index.DrXNN7P-.js → index.CDOn4Mmb.js} +1 -1
- streamlit/static/static/js/index.CGJeU1TE.js +1 -0
- streamlit/static/static/js/index.C_RLZUid.js +1 -0
- streamlit/static/static/js/{index.BST23kXB.js → index.CbzQ6_1A.js} +1 -1
- streamlit/static/static/js/{index.CAOOu98T.js → index.CfbgQbfG.js} +1 -1
- streamlit/static/static/js/{index.Ca6320CT.js → index.Co72ELt_.js} +57 -57
- streamlit/static/static/js/{index.CBzV6LFM.js → index.CxXOHy-q.js} +1 -1
- streamlit/static/static/js/index.DCzHBbe3.js +4 -0
- streamlit/static/static/js/{index.D1gCIQ1C.js → index.DDG-Feum.js} +3 -3
- streamlit/static/static/js/{index.DwhO3jNA.js → index.DDQotaI-.js} +2 -2
- streamlit/static/static/js/{index.DqoGamDV.js → index.DDTpwEXp.js} +2 -2
- streamlit/static/static/js/{index.CRt7DW67.js → index.DM6381fy.js} +1 -1
- streamlit/static/static/js/{index.B-nmc5wO.js → index.DMsfllEz.js} +1 -1
- streamlit/static/static/js/{index.Bht8Ku38.js → index.DVTjGtXy.js} +1 -1
- streamlit/static/static/js/index.DY7yFBFm.js +1 -0
- streamlit/static/static/js/{index.B94PZPeI.js → index.DZLrzThj.js} +1 -1
- streamlit/static/static/js/{index.BMaqPVq6.js → index.DdbxtRVV.js} +1 -1
- streamlit/static/static/js/{index.5idohwqh.js → index.DiFAEZZx.js} +1 -1
- streamlit/static/static/js/index.Dlgg4mQO.js +1 -0
- streamlit/static/static/js/index.Dn_JS5iX.js +1 -0
- streamlit/static/static/js/index.R_5wwEBR.js +1 -0
- streamlit/static/static/js/{index.BsLun9mO.js → index.cBacy4AZ.js} +2 -2
- streamlit/static/static/js/{index.DuwDNwdn.js → index.d7tjiBmt.js} +1 -1
- streamlit/static/static/js/{input.hHglMwJu.js → input.uD0SWj1g.js} +1 -1
- streamlit/static/static/js/{memory.BotKhGox.js → memory.DPlzjnEG.js} +1 -1
- streamlit/static/static/js/{mergeWith.dOmek2Nz.js → mergeWith.BtOxrWSG.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DIhHlsX3.js → number-overlay-editor.B6hW-IjG.js} +1 -1
- streamlit/static/static/js/{sandbox.BlY_yl1S.js → sandbox.-4pm4kKk.js} +1 -1
- streamlit/static/static/js/{slicedToArray.xYln54_I.js → slicedToArray.CNy95D8Y.js} +1 -1
- streamlit/static/static/js/{textarea.B9cq_go8.js → textarea.CcFxFL7j.js} +1 -1
- streamlit/static/static/js/{timepicker.R8Q_Yl7H.js → timepicker.Char5nqs.js} +1 -1
- streamlit/static/static/js/{uniqueId.CKxaEvFc.js → uniqueId.CNOVHTVB.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DY0Kwuur.js → useBasicWidgetState.Bu8UvcoI.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CAEw-Xl5.js → useOnInputChange.CF_fWusY.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.bEPeWQAF.js +1 -0
- streamlit/user_info.py +364 -11
- {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/RECORD +75 -75
- streamlit/static/static/js/ProgressBar.D-DmAAiN.js +0 -2
- streamlit/static/static/js/Toolbar.IB7xmaQ3.js +0 -1
- streamlit/static/static/js/index.3XcxQYzA.js +0 -1
- streamlit/static/static/js/index.9Tcn_7uz.js +0 -1
- streamlit/static/static/js/index.BBGa9-EC.js +0 -1
- streamlit/static/static/js/index.BCrCxn8x.js +0 -1
- streamlit/static/static/js/index.BVS_Npso.js +0 -2
- streamlit/static/static/js/index.BuQ40cTc.js +0 -1
- streamlit/static/static/js/index.C2x7lWrn.js +0 -3
- streamlit/static/static/js/index.CLEzQJ1l.js +0 -1
- streamlit/static/static/js/index.Ci9WPusu.js +0 -1
- streamlit/static/static/js/index.CkJysN98.js +0 -1
- streamlit/static/static/js/index.CkgGJqBi.js +0 -197
- streamlit/static/static/js/index.DfqbHOMy.js +0 -1
- streamlit/static/static/js/index.DkCDzK1i.js +0 -4
- streamlit/static/static/js/index.IHJq2nuU.js +0 -1
- streamlit/static/static/js/index.VSTrmYr_.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.Def4ZoAl.js +0 -1
- /streamlit/static/static/css/{index.B26BQfSF.css → index.Bmkmz40k.css} +0 -0
- /streamlit/static/static/css/{index.BWGEWL3m.css → index.DBTu7gXp.css} +0 -0
- /streamlit/static/static/css/{index.CG16XVnL.css → index.DzuxGC_t.css} +0 -0
- {streamlit_nightly-1.41.2.dev20250120.data → streamlit_nightly-1.41.2.dev20250123.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
import{r as y,E as _,_ as T,n as E,ao as J,aB as R,j as p,bt as Q,ba as B,bo as K,b6 as Y,bn as O,bA as A,d as Z,g as ee,aJ as te,ae as re,bB as ie,bC as oe,R as ae,ag as ne,at as se,A as P,aV as V,bk as le,bj as de,bq as ce,bD as ue,br as fe,bs as he,F as pe}from"./index.Ca6320CT.js";import{F as ge}from"./FormClearHelper.BP4f-wKq.js";import{U as W}from"./UploadFileInfo.C-jY39rj.js";import{P as me,S as ve}from"./ProgressBar.D-DmAAiN.js";var z=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(_,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{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"}))});z.displayName="Video";var N=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(_,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{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"}))});N.displayName="X";var $=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(_,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{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";var L;(function(t){t.XSMALL="xsmall",t.SMALL="small",t.MEDIUM="medium",t.LARGE="large"})(L||(L={}));function Se(t,l){switch(t){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 D=E("div",{target:"e1ib77mk0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),k=E("div",{target:"e1ib77mk1"})(({theme:t,width:l})=>({backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),ye=E("p",{target:"e1ib77mk2"})(({theme:t})=>({marginTop:t.spacing.sm,textAlign:"center"})),be=E("img",{target:"e1ib77mk3"})(({theme:t,opacity:l})=>({borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:l})),Me=E("a",{target:"e1ib77mk4"})(({theme:t})=>({color:t.colors.primary,display:"block",textDecoration:"none"})),we=E("span",{target:"e1ib77mk5"})({display:"flex",alignItems:"center"}),Ue=E("div",{target:"e1ib77mk6"})(({theme:t})=>({position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:t.zIndices.priority,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Ce=E("div",{target:"e1ib77mk8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),Ee=E("button",{target:"e1ib77mk9"})(({theme:t})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${J(t.colors.primary,.5)}`},...Se("medium",t)}));function H({disabled:t,onClick:l,children:r,progress:a}){return R(Ee,{disabled:t||!1,onClick:l||(()=>{}),progress:a||null,"data-testid":"stCameraInputButton",children:[r,a&&p(Ce,{children:p(me,{value:a,size:ve.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F;(function(t){t.USER="user",t.ENVIRONMENT="environment"})(F||(F={}));const Ie=({switchFacingMode:t})=>p(Ue,{"data-testid":"stCameraInputSwitchButton",children:p(Q,{content:"Switch camera",placement:B.TOP_RIGHT,children:p(K,{kind:Y.MINIMAL,onClick:t,children:p(O,{content:$,size:"twoXL",color:A.white})})})});var G={exports:{}};(function(t,l){(function(a,o){t.exports=o(y)})(Z,function(r){return function(a){var o={};function n(s){if(o[s])return o[s].exports;var f=o[s]={i:s,l:!1,exports:{}};return a[s].call(f.exports,f,f.exports,n),f.l=!0,f.exports}return n.m=a,n.c=o,n.d=function(s,f,g){n.o(s,f)||Object.defineProperty(s,f,{enumerable:!0,get:g})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,f){if(f&1&&(s=n(s)),f&8||f&4&&typeof s=="object"&&s&&s.__esModule)return s;var g=Object.create(null);if(n.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:s}),f&2&&typeof s!="string")for(var C in s)n.d(g,C,(function(U){return s[U]}).bind(null,C));return g},n.n=function(s){var f=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(f,"a",f),f},n.o=function(s,f){return Object.prototype.hasOwnProperty.call(s,f)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(a,o,n){n.r(o);var s=n("react"),f=function(){var m=function(u,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,d){i.__proto__=d}||function(i,d){for(var c in d)d.hasOwnProperty(c)&&(i[c]=d[c])},m(u,e)};return function(u,e){m(u,e);function i(){this.constructor=u}u.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),g=function(){return g=Object.assign||function(m){for(var u,e=1,i=arguments.length;e<i;e++){u=arguments[e];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(m[d]=u[d])}return m},g.apply(this,arguments)},C=function(m,u){var e={};for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&u.indexOf(i)<0&&(e[i]=m[i]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,i=Object.getOwnPropertySymbols(m);d<i.length;d++)u.indexOf(i[d])<0&&Object.prototype.propertyIsEnumerable.call(m,i[d])&&(e[i[d]]=m[i[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(u){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return e?new Promise(function(i,d){e.call(navigator,u,i,d)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(m){f(u,m);function u(e){var i=m.call(this,e)||this;return i.canvas=null,i.ctx=null,i.requestUserMediaId=0,i.unmounted=!1,i.state={hasUserMedia:!1},i}return u.prototype.componentDidMount=function(){var e=this,i=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}i.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(e){var i=this.props;if(!U()){i.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(i.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(i.videoConstraints),b=e.minScreenshotWidth!==i.minScreenshotWidth,S=e.minScreenshotHeight!==i.minScreenshotHeight;(c||b||S)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(i){e.removeTrack(i),i.stop()}),e.getAudioTracks().map(function(i){e.removeTrack(i),i.stop()})):e.stop())},u.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(u.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},u.prototype.getScreenshot=function(e){var i=this,d=i.state,c=i.props;if(!d.hasUserMedia)return null;var b=this.getCanvas(e);return b&&b.toDataURL(c.screenshotFormat,c.screenshotQuality)},u.prototype.getCanvas=function(e){var i=this,d=i.state,c=i.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var b=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var h=b/S;b=c.minScreenshotWidth||this.video.clientWidth,S=b/h,c.minScreenshotHeight&&S<c.minScreenshotHeight&&(S=c.minScreenshotHeight,b=S*h)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||b,this.canvas.height=(e==null?void 0:e.height)||S,this.ctx=this.canvas.getContext("2d")}var w=this,M=w.ctx,v=w.canvas;return M&&v&&(v.width=(e==null?void 0:e.width)||v.width,v.height=(e==null?void 0:e.height)||v.height,c.mirrored&&(M.translate(v.width,0),M.scale(-1,1)),M.imageSmoothingEnabled=c.imageSmoothing,M.drawImage(this.video,0,0,(e==null?void 0:e.width)||v.width,(e==null?void 0:e.height)||v.height),c.mirrored&&(M.scale(-1,1),M.translate(-v.width,0))),v},u.prototype.requestUserMedia=function(){var e=this,i=this.props,d=function(S,h){var w={video:typeof h<"u"?h:!0};i.audio&&(w.audio=typeof S<"u"?S:!0),e.requestUserMediaId++;var M=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(w).then(function(v){e.unmounted||M!==e.requestUserMediaId?u.stopMediaStream(v):e.handleUserMedia(null,v)}).catch(function(v){e.handleUserMedia(v)})};if("mediaDevices"in navigator)d(i.audioConstraints,i.videoConstraints);else{var c=function(S){return{optional:[{sourceId:S}]}},b=function(S){var h=S.deviceId;return typeof h=="string"?h:Array.isArray(h)&&h.length>0?h[0]:typeof h=="object"&&h.ideal?h.ideal:null};MediaStreamTrack.getSources(function(S){var h=null,w=null;S.forEach(function(x){x.kind==="audio"?h=x.id:x.kind==="video"&&(w=x.id)});var M=b(i.audioConstraints);M&&(h=M);var v=b(i.videoConstraints);v&&(w=v),d(c(h),c(w))})}},u.prototype.handleUserMedia=function(e,i){var d=this.props;if(e||!i){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=i;try{this.video&&(this.video.srcObject=i),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(i)})}d.onUserMedia(i)},u.prototype.render=function(){var e=this,i=this,d=i.state,c=i.props,b=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var S=c.mirrored,h=c.style,w=h===void 0?{}:h,M=c.children,v=C(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),x=S?g(g({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,q={getScreenshot:this.getScreenshot.bind(this)};return s.createElement(s.Fragment,null,s.createElement("video",g({autoPlay:!0,src:d.src,muted:!b,playsInline:!0,ref:function(X){e.video=X},style:x},v)),M&&M(q))},u.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(s.Component);o.default=I},react:function(a,o){a.exports=r}}).default})})(G);var Fe=G.exports;const Re=ee(Fe);var j;(function(t){t.PENDING="pending",t.SUCCESS="success",t.ERROR="error"})(j||(j={}));const xe=({width:t})=>R(k,{width:t,children:[p(O,{size:"threeXL",color:A.gray60,content:z}),R(ye,{children:["This app would like to use your camera.",p(Me,{href:oe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Pe=({handleCapture:t,width:l,disabled:r,clearPhotoInProgress:a,setClearPhotoInProgress:o,facingMode:n,setFacingMode:s,testOverride:f})=>{const[g,C]=y.useState(f||"pending"),U=y.useRef(null),[I,m]=y.useState(l),u=y.useCallback(te(1e3,m),[]);y.useEffect(()=>{u(l)},[l,u]);function e(){if(U.current!==null){const d=U.current.getScreenshot();t(d)}}const i=re();return R(D,{"data-testid":"stCameraInputWebcamComponent",children:[g!=="success"&&!r&&!a?p(xe,{width:I}):ie&&p(Ie,{switchFacingMode:s}),p(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:g!=="success"&&!r&&!a,width:I,children:!r&&p(Re,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${i.radii.default} ${i.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),p(H,{onClick:e,disabled:g!=="success"||r||a,children:"Take Photo"})]})},_e=150;class Le extends ae.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ge,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=r=>{this.setState({clearPhotoInProgress:r})},this.setFacingMode=()=>{this.setState(r=>({facingMode:r.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=r=>{if(r===null)return Promise.resolve();this.setState({imgSrc:r,shutter:!0,minShutterEffectPassed:!1});const a=o=>new Promise(n=>setTimeout(n,o));return Te(r,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>a(_e)).then(()=>{this.setState((o,n)=>({imgSrc:r,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ne(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(r=>this.deleteFile(r.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const r=this.createWidgetValue(),{element:a,widgetMgr:o,fragmentId:n}=this.props,s=o.getFileUploaderStateValue(a);se(r,s)||o.setFileUploaderStateValue(a,r,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const r=this.createWidgetValue();if(P(r))return;this.setState({imgSrc:null});const{widgetMgr:a,element:o,fragmentId:n}=this.props;a.setFileUploaderStateValue(o,r,{fromUi:!0},n)})},this.deleteFile=r=>{const a=this.getFile(r);P(a)||(a.status.type==="uploading"&&a.status.cancelToken.cancel(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(a.status.fileUrls.deleteUrl),this.removeFile(r))},this.addFile=r=>{this.setState(a=>({files:[...a.files,r]}))},this.removeFile=r=>{this.setState(a=>({files:a.files.filter(o=>o.id!==r)}))},this.getFile=r=>this.state.files.find(a=>a.id===r),this.updateFile=(r,a)=>{this.setState(o=>({files:o.files.map(n=>n.id===r?a:n)}))},this.onUploadComplete=(r,a)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(r);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},this.onUploadProgress=(r,a)=>{const o=this.getFile(a);if(P(o)||o.status.type!=="uploading")return;const n=Math.round(r.loaded*100/r.total);o.status.progress!==n&&this.updateFile(a,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(r,a)=>{const o=V.CancelToken.source(),n=new W(a.name,a.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,r.uploadUrl,a,s=>this.onUploadProgress(s,n.id),o.token).then(()=>this.onUploadComplete(n.id,r)).catch(s=>{V.isCancel(s)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:r,element:a}=this.props,o=r.getFileUploaderStateValue(a);if(P(o))return l;const{uploadedFileInfo:n}=o;return P(n)||n.length===0?l:{files:n.map(s=>{const f=s.name,g=s.size,C=s.fileId,U=s.fileUrls;return new W(f,g,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=r=>r.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:r,widgetMgr:a,fragmentId:o}=this.props;a.getFileUploaderStateValue(r)===void 0&&a.setFileUploaderStateValue(r,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(r=>r.status.type==="uploaded").map(r=>{const{name:a,size:o,status:n}=r;return new le({fileId:n.fileId,fileUrls:n.fileUrls,name:a,size:o})});return new de({uploadedFileInfo:l})}render(){var n;const{element:l,widgetMgr:r,disabled:a,width:o}=this.props;return this.formClearHelper.manageFormClearListener(r,l.formId,this.onFormCleared),R(D,{className:"stCameraInput","data-testid":"stCameraInput",children:[p(he,{label:l.label,disabled:a,labelVisibility:ce((n=l.labelVisibility)==null?void 0:n.value),children:l.help&&p(ue,{children:p(fe,{content:l.help,placement:B.TOP_RIGHT})})}),this.state.imgSrc?R(pe,{children:[p(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&p(be,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),p(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||a,children:this.getProgress()?"Uploading...":R(we,{children:[p(O,{content:N,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):p(Pe,{handleCapture:this.handleCapture,width:o,disabled:a,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Te(t,l){return fetch(t).then(r=>r.arrayBuffer()).then(r=>new File([r],l,{type:"image/jpeg"}))}export{Le as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as s,R as g,aA as b,b9 as k,ae as C,j as n,b7 as v,ba as L,aB as y,aO as w,av as S}from"./index.Ca6320CT.js";const T=s("div",{target:"e1xmaixs0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e1xmaixs1"})(({disabled:r,isCurrentPage:o,fluidWidth:t,theme:e})=>({textDecoration:"none",width:typeof t=="number"?`${t}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:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),B=s("span",{target:"e1xmaixs2"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function H(r){const{onPageChange:o,currentPageScriptHash:t}=g.useContext(b),e=g.useContext(k),{colors:u}=C(),{disabled:l,element:a,width:i}=r,p={width:i},f=P(a.useContainerWidth,e),c=t===a.pageScriptHash,x=d=>{a.external?l&&d.preventDefault():(d.preventDefault(),l||o(a.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(v,{help:a.help,placement:L.TOP_RIGHT,children:n(T,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:c,fluidWidth:f?i:!1,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:x,children:[a.icon&&n(w,{size:"lg",color:u.bodyText,iconValue:a.icon}),n(B,{disabled:l,children:n(S,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}export{H as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as o,aB as m,j as i,av as S}from"./index.Ca6320CT.js";import{S as g,T as y}from"./Toolbar.IB7xmaQ3.js";import{w as W,u as b,E as M}from"./withFullScreenWrapper.Def4ZoAl.js";const L=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),O=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),E=o("div",{target:"evl31sl2"})(({theme:t})=>({textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function T({element:t,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:n,width:w,height:r,expand:C,collapse:h}=b(M),d=n?w:u;let l;const a=t.width;if([-1,-3,-4].includes(a))l=void 0;else if([-2,-5].includes(a))l=d;else if(a>0)l=a;else throw Error(`Invalid image width: ${a}`);const e={};return r&&n?(e.maxHeight=r,e.objectFit="contain"):(e.width=l,e.maxWidth="100%"),m(g,{width:d,height:r,useContainerWidth:n,topCentered:!0,children:[i(y,{target:g,isFullScreen:n,onExpand:C,onCollapse:h,disableFullscreenMode:x}),i(L,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const s=I;return m(O,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:f.buildMediaURL(s.url),alt:c.toString()}),s.caption&&i(E,{"data-testid":"stImageCaption",style:e,children:i(S,{source:s.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const R=W(T);export{R as default};
|