streamlit-nightly 1.53.2.dev20260127__py3-none-any.whl → 1.53.2.dev20260128__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/config.py +11 -0
- streamlit/proto/NewSession_pb2.py +24 -22
- streamlit/proto/NewSession_pb2.pyi +23 -1
- streamlit/runtime/app_session.py +19 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +296 -296
- streamlit/static/static/js/{ErrorOutline.esm.DiaGWPsE.js → ErrorOutline.esm.D71F8ziR.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.D-Qgpk5d.js → FileDownload.esm.yTkppsJy.js} +1 -1
- streamlit/static/static/js/{FileHelper.DmtDDGp0.js → FileHelper.hUOqtbwa.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BM3uDLnU.js → FormClearHelper.DN8D_YXO.js} +1 -1
- streamlit/static/static/js/{InputInstructions.B2YZ5Lle.js → InputInstructions.DbssY6d4.js} +1 -1
- streamlit/static/static/js/{Particles.BzfZrl-0.js → Particles.BznyVdfo.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DWErD3j3.js → ProgressBar.C5uBOtcx.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.DB31rUPf.js → StreamlitSyntaxHighlighter.Nf1895x-.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.D3oUYYYd.js → TableChart.esm.DHKzVs3a.js} +1 -1
- streamlit/static/static/js/{Toolbar.CPyjMABY.js → Toolbar.CQsWYXer.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.C1NBCx-y.js → WidgetLabelHelpIconInline.6xCU76OE.js} +1 -1
- streamlit/static/static/js/{base-input.C_CrNgNd.js → base-input.Cs-E6S71.js} +1 -1
- streamlit/static/static/js/{checkbox.S6O8DPFl.js → checkbox.OTGupu18.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.B-5tIJBw.js → createDownloadLinkElement.DnBEQQbK.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BW5aAEJN.js → data-grid-overlay-editor.COiiMi5r.js} +1 -1
- streamlit/static/static/js/{downloader.BswLlj7p.js → downloader.K0GUNeuj.js} +1 -1
- streamlit/static/static/js/{embed.QjYZXbaW.js → embed.o8HvK3mH.js} +1 -1
- streamlit/static/static/js/{es6.Dm_kl6Cp.js → es6.BHy5pqTP.js} +2 -2
- streamlit/static/static/js/{formatNumber.CH39oSMw.js → formatNumber.BK7h0k2z.js} +1 -1
- streamlit/static/static/js/{iconPosition.Dp9f2jam.js → iconPosition.2YynQUxu.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.DOprY46-.js → iframeResizer.contentWindow.D5h3hQuU.js} +1 -1
- streamlit/static/static/js/{index.DypwtfIh.js → index.5zqfJ-in.js} +1 -1
- streamlit/static/static/js/{index.BNsCI-Q1.js → index.6c-qDsD7.js} +1 -1
- streamlit/static/static/js/{index.BFxjXeYb.js → index.8MlRyIxN.js} +1 -1
- streamlit/static/static/js/{index.DoRYpzHm.js → index.BIqcOZ_u.js} +1 -1
- streamlit/static/static/js/{index.BQu5Qf_i.js → index.BPdmXoYW.js} +1 -1
- streamlit/static/static/js/{index.DK9Im19R.js → index.BZ-GJVxB.js} +1 -1
- streamlit/static/static/js/{index.TTO_Lb69.js → index.BfMPq234.js} +1 -1
- streamlit/static/static/js/{index.OI2eh_me.js → index.Bfo1cXfC.js} +1 -1
- streamlit/static/static/js/{index.X1r5cenD.js → index.Bgf49D1Z.js} +1 -1
- streamlit/static/static/js/{index.CfXTal6g.js → index.Bqmx23jK.js} +1 -1
- streamlit/static/static/js/{index.BaKZ4ira.js → index.BtRWcqZV.js} +1 -1
- streamlit/static/static/js/{index.6OwBTJdz.js → index.BtuskCwg.js} +1 -1
- streamlit/static/static/js/{index.Bwaj-9Zv.js → index.BzTVI_BY.js} +1 -1
- streamlit/static/static/js/{index.BxtweGcn.js → index.C2EoeVjP.js} +1 -1
- streamlit/static/static/js/{index.CuJ82OKQ.js → index.C65jHNhe.js} +1 -1
- streamlit/static/static/js/{index.DsZNm1_D.js → index.C6wyTXhz.js} +1 -1
- streamlit/static/static/js/{index.C57ViuAX.js → index.C7wst9Tm.js} +1 -1
- streamlit/static/static/js/{index.BcUwq6kI.js → index.COh5V_89.js} +1 -1
- streamlit/static/static/js/{index.DTUAvbJ0.js → index.CSPY26T2.js} +1 -1
- streamlit/static/static/js/{index.6iOQDEVC.js → index.CUkhn-vu.js} +1 -1
- streamlit/static/static/js/{index.B6Sk5Jwr.js → index.CX0KdFyR.js} +1 -1
- streamlit/static/static/js/{index.Cw5Xlisw.js → index.CYhhEdja.js} +1 -1
- streamlit/static/static/js/{index.JKOtpaMf.js → index.CZf7Go1Z.js} +1 -1
- streamlit/static/static/js/{index.s9zpEF8P.js → index.Cb03y5I8.js} +1 -1
- streamlit/static/static/js/{index.CivdhE_9.js → index.CdsyTabv.js} +1 -1
- streamlit/static/static/js/{index.CYxcFtYt.js → index.CgVv04GM.js} +1 -1
- streamlit/static/static/js/{index.B0Wcvg8a.js → index.CjRU8O1O.js} +1 -1
- streamlit/static/static/js/{index.gsc49XzN.js → index.CwtpGPHA.js} +1 -1
- streamlit/static/static/js/{index.DMwRlpNi.js → index.CxWzt6oi.js} +1 -1
- streamlit/static/static/js/{index.CkSzTTpO.js → index.DBPWUJsj.js} +5 -5
- streamlit/static/static/js/{index.BlgpfTUq.js → index.DJfMW0Gy.js} +1 -1
- streamlit/static/static/js/{index.BYjec3-R.js → index.DLUSo6de.js} +1 -1
- streamlit/static/static/js/{index.-7yn3zqE.js → index.DL_yE83J.js} +1 -1
- streamlit/static/static/js/{index.CDZffl1q.js → index.DVRCyxMp.js} +1 -1
- streamlit/static/static/js/{index.B9XI6y3j.js → index.Dc5-tFdw.js} +1 -1
- streamlit/static/static/js/{index.Cb7V19H9.js → index.DcngUOyD.js} +1 -1
- streamlit/static/static/js/{index.BBVcEzWu.js → index.Dh3PJIlq.js} +1 -1
- streamlit/static/static/js/{index.BUOjbZl6.js → index.DlgcEr0f.js} +1 -1
- streamlit/static/static/js/{index.wKGUZfH4.js → index.DxGXuhh6.js} +1 -1
- streamlit/static/static/js/{index.6UQ__fP7.js → index.DxfYCrPp.js} +1 -1
- streamlit/static/static/js/{index.Ci3x7GcT.js → index.HmRK3HyC.js} +1 -1
- streamlit/static/static/js/{index.D1tkD8Lg.js → index.TjMWsKSH.js} +1 -1
- streamlit/static/static/js/{index.4QSKV4yi.js → index.VwDKazgt.js} +1 -1
- streamlit/static/static/js/{index.lMhsw-5K.js → index.aCorc3Yt.js} +26 -26
- streamlit/static/static/js/{index.CAzk7fUP.js → index.cfuZ69LI.js} +1 -1
- streamlit/static/static/js/{index.BlchQrZL.js → index.hlAfdSqC.js} +1 -1
- streamlit/static/static/js/{index.tjRGlTlQ.js → index.iUV9rb8C.js} +1 -1
- streamlit/static/static/js/{index.BUbgW8RJ.js → index.q0ceUXt6.js} +1 -1
- streamlit/static/static/js/{input.CIKqvWjB.js → input.CXGIJ7D6.js} +1 -1
- streamlit/static/static/js/{main.BkNqoTrd.js → main.CCVkbuxC.js} +1 -1
- streamlit/static/static/js/{memory.DNcbFok2.js → memory.CNbnYs2A.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DwjiYKav.js → number-overlay-editor.CvI6wkld.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BSc50we3.js → pandasStylerUtils.CFSReOTm.js} +1 -1
- streamlit/static/static/js/{sandbox.DJL9Gdcf.js → sandbox.Bld0L3us.js} +1 -1
- streamlit/static/static/js/{styled-components.D4jE1G9j.js → styled-components.BoUHK6TA.js} +1 -1
- streamlit/static/static/js/{throttle.dHeXiPIK.js → throttle.ByDFm7WV.js} +1 -1
- streamlit/static/static/js/{timepicker.CIpoSUyW.js → timepicker.CN6CUZEL.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.AOXQx2YY.js → toConsumableArray.DwMycSpg.js} +1 -1
- streamlit/static/static/js/uniqueId.DcCWa2cf.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.BwQxG7iA.js → useBasicWidgetState.Bg0ZMUt5.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.JXPZPWaJ.js → useIntlLocale.DgBUDcPA.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.CD_nhoE_.js → useTextInputAutoExpand.DDBezxks.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.Cl1Y22Ao.js → useUpdateUiValue.Df1h6fXC.js} +1 -1
- streamlit/static/static/js/{useWaveformController.DJhScSDn.js → useWaveformController.DbWw5MEk.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.CrAfFzO9.js → withCalculatedWidth.YaK0HIIP.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.EdE3zOz5.js → withFullScreenWrapper.CcWCKoY8.js} +1 -1
- streamlit/web/bootstrap.py +5 -2
- streamlit/web/server/server_util.py +22 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/RECORD +101 -101
- streamlit/static/static/js/uniqueId.DRPc21MO.js +0 -1
- {streamlit_nightly-1.53.2.dev20260127.data → streamlit_nightly-1.53.2.dev20260128.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Bt,cY as Er,c_ as ef,cX as tf,d6 as At,ag as uh,d7 as gs,d8 as wN,cV as j2,cZ as ku,d9 as ap,da as H2,_ as KR,j as Gf,$ as TN,z as ZR,m as YR,W as QR,db as rC,bh as EN,L as CN,l as SN,o as nC,ct as IN,dc as iC}from"./index.
|
|
1
|
+
import{r as Bt,cY as Er,c_ as ef,cX as tf,d6 as At,ag as uh,d7 as gs,d8 as wN,cV as j2,cZ as ku,d9 as ap,da as H2,_ as KR,j as Gf,$ as TN,z as ZR,m as YR,W as QR,db as rC,bh as EN,L as CN,l as SN,o as nC,ct as IN,dc as iC}from"./index.aCorc3Yt.js";import{_ as BN,C as PN}from"./toConsumableArray.DwMycSpg.js";import{E as e4,w as MN}from"./withFullScreenWrapper.CcWCKoY8.js";import{a as RN,T as ON}from"./Toolbar.CQsWYXer.js";import{l as d1}from"./index.8HslT92O.js";import{a as DN}from"./useBasicWidgetState.Bg0ZMUt5.js";import{u as FN,s as LN}from"./threshold.CUNQbqMA.js";import"./FormClearHelper.DN8D_YXO.js";import"./value.DaKxGC7O.js";function kN(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function sC(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const t4=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),oC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);oC&&parseFloat(oC[1]);const aC=globalThis,lC=globalThis.process||{},NN=globalThis.navigator||{};function r4(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function fh(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||r4()}function UN(r){return fh()?r4()?"Electron":(NN.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const n4="4.1.0";function zN(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class VN{constructor(e,t,n="sessionStorage"){this.storage=zN(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function GN(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function jN(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var Dm;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Dm||(Dm={}));const HN=10;function cC(r){return typeof r!="string"?r:(r=r.toUpperCase(),Dm[r]||Dm.WHITE)}function WN(r,e,t){return!fh&&typeof r=="string"&&(e&&(r=`\x1B[${cC(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${cC(t)+HN}m${r}\x1B[49m`)),r}function $N(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(l=>s===l)||(i[s]=o.bind(r)))}}function W2(r,e){if(!r)throw new Error("Assertion failed")}function ld(){let r;if(fh()&&aC.performance)r=aC?.performance?.now?.();else if("hrtime"in lC){const e=lC?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const cd={debug:fh()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},XN={enabled:!0,level:0};function ud(){}const uC={},fC={once:!0};class wp{constructor({id:e}={id:""}){this.VERSION=n4,this._startTs=ld(),this._deltaTs=ld(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new VN(`__probe-${this.id}__`,XN),this.timeStamp(`${this.id} started`),$N(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,cd.warn,arguments,fC)}error(e){return this._getLogFunction(0,e,cd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,cd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,cd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,cd.debug||cd.info,arguments,fC)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ud,n&&[n],{tag:JN(t)}):ud}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||ud)}group(e,t,n={collapsed:!1}){const i=hC({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||ud)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=i4(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=hC({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,W2(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=ld();const o=s.tag||s.message;if(s.once&&o)if(!uC[o])uC[o]=ld();else return ud;return t=qN(this.id,s.message,s),n.bind(console,t,...s.args)}return ud}}wp.VERSION=n4;function i4(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return W2(Number.isFinite(e)&&e>=0),e}function hC(r){const{logLevel:e,message:t}=r;r.logLevel=i4(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return W2(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function qN(r,e,t){if(typeof e=="string"){const n=t.time?jN(GN(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=WN(e,t.color,t.background)}return e}function JN(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}globalThis.probe={};const s4=new wp({id:"@probe.gl/log"}),Qy="4.3.3",KN=Qy[0]>="0"&&Qy[0]<="9"?`v${Qy}`:"";function ZN(){const r=new wp({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=r,globalThis.loaders.version=KN,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=r,r}const YN=ZN();function QN(r,e){return o4(r||{},e)}function o4(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=o4(n[i]||{},e[i],t+1):n[i]=e[i];return n}const e5="latest";function t5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.3"),globalThis._loadersgl_.version}const r5=t5();function qu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Kf=typeof process!="object"||String(process)!=="[object process]"||process.browser,n5=typeof window<"u"&&typeof window.orientation<"u",dC=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);dC&&parseFloat(dC[1]);class i5{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){qu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){qu(this.isRunning),this.isRunning=!1,this._reject(e)}}class ev{terminate(){}}const tv=new Map;function s5(r){qu(r.source&&!r.url||!r.source&&r.url);let e=tv.get(r.source||r.url);return e||(r.url&&(e=o5(r.url),tv.set(r.url,e)),r.source&&(e=a4(r.source),tv.set(r.source,e))),qu(e),e}function o5(r){if(!r.startsWith("http"))return r;const e=a5(r);return a4(e)}function a4(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function a5(r){return`try {
|
|
2
2
|
importScripts('${r}');
|
|
3
3
|
} catch (error) {
|
|
4
4
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as c,r as a,j as o,o as u,ak as g,Y as f,q as S}from"./index.
|
|
1
|
+
import{z as c,r as a,j as o,o as u,ak as g,Y as f,q as S}from"./index.aCorc3Yt.js";const x=c("div",{target:"e1l5y6pi0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e1l5y6pi1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"e1l5y6pi2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"e1l5y6pi3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,r=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${r})`};function w({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const r=()=>{if(i.current!==null){const m=(Date.now()-i.current)/1e3;l(m)}};r();const p=setInterval(r,100);return()=>clearInterval(p)},[t]),o(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(f,{size:"lg",iconValue:"spinner"}),u($,{children:[o(S,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(w);export{v as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as c,a3 as l,r as i,j as a,b2 as p}from"./index.
|
|
1
|
+
import{z as c,a3 as l,r as i,j as a,b2 as p}from"./index.aCorc3Yt.js";import{P as d,R as f}from"./Particles.BznyVdfo.js";const g=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,u=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,E=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,s=150,S=10,w=90,x=4e3,e=(t,n=0)=>Math.random()*(t-n)+n,_=()=>l(`from{transform:translateY(0)
|
|
2
2
|
rotateX(`,e(360),`deg)
|
|
3
3
|
rotateY(`,e(360),`deg)
|
|
4
4
|
rotateZ(`,e(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,E as H,_ as D,z as k,o as O,j as U,ay as ge,P as he,b as ve,B as me,ax as q,bN as re,al as Se,ag as be,bg as ye,l as Ce,bO as Ue,k as we,aj as Me,e as W,V as xe,bh as Ee,p as Ie,ab as Fe,ac as Re,$ as ke,bP as _e,bQ as Oe}from"./index.lMhsw-5K.js";import{U as ie}from"./UploadFileInfo.Dr-zDST7.js";import{u as Pe}from"./FormClearHelper.BM3uDLnU.js";import{P as Te,S as Le}from"./ProgressBar.DWErD3j3.js";import{b as We}from"./urls.BwSlolu9.js";var oe=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:a}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.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"}))});oe.displayName="SwitchCamera";var ne=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ne.displayName="Video";var ae=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ae.displayName="X";function Ve(e,a){switch(e){case"xsmall":return{padding:`${a.spacing.twoXS} ${a.spacing.sm}`,fontSize:a.fontSizes.sm};case"small":return{padding:`${a.spacing.twoXS} ${a.spacing.md}`};case"large":return{padding:`${a.spacing.md} ${a.spacing.md}`};default:return{padding:`${a.spacing.xs} ${a.spacing.md}`}}}const se=k("div",{target:"exxgkyt0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),G=k("div",{target:"exxgkyt1"})(({theme:e,width:a})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,width:"100%",height:a*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),je=k("p",{target:"exxgkyt2"})(({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"})),Be=k("img",{target:"exxgkyt3"})(({theme:e,opacity:a})=>({borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,objectFit:"contain",opacity:a})),$e=k("a",{target:"exxgkyt4"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none",display:"block"})),ze=k("span",{target:"exxgkyt5"})({display:"flex",alignItems:"center"}),Ae=k("div",{target:"exxgkyt6"})(({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:e.zIndices.priority,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Ne=k("div",{target:"exxgkyt8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),He=k("button",{target:"exxgkyt9"})(({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:`0 0 ${e.radii.default} ${e.radii.default}`,"&: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,borderColor:e.colors.borderColor,backgroundColor:e.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:e.spacing.none,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},...Ve("medium",e)}));function De({disabled:e,onClick:a,children:d,progress:h}){return O(He,{disabled:e||!1,onClick:a||(()=>{}),progress:h||null,"data-testid":"stCameraInputButton",children:[d,h?U(Ne,{children:U(Te,{value:h,size:Le.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const le=n.memo(De);var B=(function(e){return e.USER="user",e.ENVIRONMENT="environment",e})({});const qe=({switchFacingMode:e})=>U(Ae,{"data-testid":"stCameraInputSwitchButton",children:U(ge,{content:"Switch camera",placement:he.TOP_RIGHT,children:U(ve,{kind:me.MINIMAL,onClick:e,children:U(q,{content:oe,size:"twoXL",color:re.white})})})}),Ge=n.memo(qe);var $={exports:{}},Xe=$.exports,te;function Qe(){return te||(te=1,(function(e,a){(function(h,v){e.exports=v(Se())})(Xe,function(d){return(function(h){var v={};function p(o){if(v[o])return v[o].exports;var f=v[o]={i:o,l:!1,exports:{}};return h[o].call(f.exports,f,f.exports,p),f.l=!0,f.exports}return p.m=h,p.c=v,p.d=function(o,f,m){p.o(o,f)||Object.defineProperty(o,f,{enumerable:!0,get:m})},p.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},p.t=function(o,f){if(f&1&&(o=p(o)),f&8||f&4&&typeof o=="object"&&o&&o.__esModule)return o;var m=Object.create(null);if(p.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:o}),f&2&&typeof o!="string")for(var F in o)p.d(m,F,(function(I){return o[I]}).bind(null,F));return m},p.n=function(o){var f=o&&o.__esModule?function(){return o.default}:function(){return o};return p.d(f,"a",f),f},p.o=function(o,f){return Object.prototype.hasOwnProperty.call(o,f)},p.p="",p(p.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(h,v,p){p.r(v);var o=p("react"),f=(function(){var b=function(i,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)s.hasOwnProperty(l)&&(r[l]=s[l])},b(i,t)};return function(i,t){b(i,t);function r(){this.constructor=i}i.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),m=function(){return m=Object.assign||function(b){for(var i,t=1,r=arguments.length;t<r;t++){i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(b[s]=i[s])}return b},m.apply(this,arguments)},F=function(b,i){var t={};for(var r in b)Object.prototype.hasOwnProperty.call(b,r)&&i.indexOf(r)<0&&(t[r]=b[r]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(b);s<r.length;s++)i.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(b,r[s])&&(t[r[s]]=b[r[s]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(i){var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise(function(r,s){t.call(navigator,i,r,s)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function I(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var R=(function(b){f(i,b);function i(t){var r=b.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return i.prototype.componentDidMount=function(){var t=this,r=t.state,s=t.props;if(this.unmounted=!1,!I()){s.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),s.children&&typeof s.children!="function"&&console.warn("children must be a function")},i.prototype.componentDidUpdate=function(t){var r=this.props;if(!I()){r.onUserMediaError("getUserMedia not supported");return}var s=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),l=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),M=t.minScreenshotWidth!==r.minScreenshotWidth,y=t.minScreenshotHeight!==r.minScreenshotHeight;(l||M||y)&&(this.canvas=null,this.ctx=null),(s||l)&&(this.stopAndCleanup(),this.requestUserMedia())},i.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},i.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},i.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(i.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},i.prototype.getScreenshot=function(t){var r=this,s=r.state,l=r.props;if(!s.hasUserMedia)return null;var M=this.getCanvas(t);return M&&M.toDataURL(l.screenshotFormat,l.screenshotQuality)},i.prototype.getCanvas=function(t){var r=this,s=r.state,l=r.props;if(!this.video||!s.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,y=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var C=M/y;M=l.minScreenshotWidth||this.video.clientWidth,y=M/C,l.minScreenshotHeight&&y<l.minScreenshotHeight&&(y=l.minScreenshotHeight,M=y*C)}this.canvas=document.createElement("canvas"),this.canvas.width=t?.width||M,this.canvas.height=t?.height||y,this.ctx=this.canvas.getContext("2d")}var E=this,w=E.ctx,S=E.canvas;return w&&S&&(S.width=t?.width||S.width,S.height=t?.height||S.height,l.mirrored&&(w.translate(S.width,0),w.scale(-1,1)),w.imageSmoothingEnabled=l.imageSmoothing,w.drawImage(this.video,0,0,t?.width||S.width,t?.height||S.height),l.mirrored&&(w.scale(-1,1),w.translate(-S.width,0))),S},i.prototype.requestUserMedia=function(){var t=this,r=this.props,s=function(y,C){var E={video:typeof C<"u"?C:!0};r.audio&&(E.audio=typeof y<"u"?y:!0),t.requestUserMediaId++;var w=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(E).then(function(S){t.unmounted||w!==t.requestUserMediaId?i.stopMediaStream(S):t.handleUserMedia(null,S)}).catch(function(S){t.handleUserMedia(S)})};if("mediaDevices"in navigator)s(r.audioConstraints,r.videoConstraints);else{var l=function(y){return{optional:[{sourceId:y}]}},M=function(y){var C=y.deviceId;return typeof C=="string"?C:Array.isArray(C)&&C.length>0?C[0]:typeof C=="object"&&C.ideal?C.ideal:null};MediaStreamTrack.getSources(function(y){var C=null,E=null;y.forEach(function(_){_.kind==="audio"?C=_.id:_.kind==="video"&&(E=_.id)});var w=M(r.audioConstraints);w&&(C=w);var S=M(r.videoConstraints);S&&(E=S),s(l(C),l(E))})}},i.prototype.handleUserMedia=function(t,r){var s=this.props;if(t||!r){this.setState({hasUserMedia:!1}),s.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}s.onUserMedia(r)},i.prototype.render=function(){var t=this,r=this,s=r.state,l=r.props,M=l.audio;l.forceScreenshotSourceSize;var y=l.disablePictureInPicture;l.onUserMedia,l.onUserMediaError,l.screenshotFormat,l.screenshotQuality,l.minScreenshotWidth,l.minScreenshotHeight,l.audioConstraints,l.videoConstraints,l.imageSmoothing;var C=l.mirrored,E=l.style,w=E===void 0?{}:E,S=l.children,_=F(l,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),z=C?m(m({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,V={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",m({autoPlay:!0,disablePictureInPicture:y,src:s.src,muted:!M,playsInline:!0,ref:function(j){t.video=j},style:z},_)),S&&S(V))},i.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},i})(o.Component);v.default=R}),react:(function(h,v){h.exports=d})}).default})})($)),$.exports}var Je=Qe();const Ke=be(Je),Ye=({width:e})=>O(G,{width:e,children:[U(q,{size:"threeXL",color:re.gray60,content:ne}),O(je,{children:["This app would like to use your camera.",U($e,{href:We,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ze=({handleCapture:e,width:a,disabled:d,clearPhotoInProgress:h,setClearPhotoInProgress:v,facingMode:p,setFacingMode:o,testOverride:f})=>{const[m,F]=n.useState(f||"pending"),I=n.useRef(null),[R,b]=n.useState(a),i=n.useCallback(ye(1e3,b),[]);n.useEffect(()=>{i(a)},[a,i]);function t(){if(I.current!==null){const s=I.current.getScreenshot();e(s)}}const r=Ce();return O(se,{"data-testid":"stCameraInputWebcamComponent",children:[m!=="success"&&!d&&!h?U(Ye,{width:R}):Ue()&&U(Ge,{switchFacingMode:o}),U(G,{"data-testid":"stCameraInputWebcamStyledBox",hidden:m!=="success"&&!d&&!h,width:R,children:!d&&U(Ke,{audio:!1,ref:I,screenshotFormat:"image/jpeg",screenshotQuality:1,width:R,height:R*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{F("error")},onUserMedia:()=>{F("success"),v(!1)},videoConstraints:{width:{ideal:R},facingMode:p}})}),U(le,{onClick:t,disabled:m!=="success"||d||h,children:"Take Photo"})]})},et=n.memo(Ze),ce="RESTORED_FROM_WIDGET",tt=150,rt=xe.getLogger("CameraInput"),N=e=>{const a=e.filter(d=>d.status.type==="uploaded").map(d=>{const{name:h,size:v,status:p}=d,{fileId:o,fileUrls:f}=p;return new _e({fileId:o,fileUrls:f,name:h,size:v})});return new Oe({uploadedFileInfo:a})},it=(e,a)=>{const d=a.getFileUploaderStateValue(e);if(W(d))return{files:[],nextLocalId:1,imgSrc:null};const{uploadedFileInfo:h}=d;if(W(h)||h.length===0)return{files:[],nextLocalId:1,imgSrc:null};let v=1;const p=h.map(o=>{const f=o.name,m=o.size,F=o.fileId,I=o.fileUrls,R=new ie(f,m,v,{type:"uploaded",fileId:F,fileUrls:I});return v+=1,R});return{files:p,nextLocalId:v,imgSrc:p.length>0?ce:null}};function ot(e,a){return fetch(e).then(d=>d.arrayBuffer()).then(d=>new File([d],a,{type:"image/jpeg"}))}const nt=({element:e,widgetMgr:a,uploadClient:d,disabled:h,fragmentId:v,testOverride:p})=>{const{width:o,elementRef:f}=we(),m=n.useRef(null);m.current===null&&(m.current=it(e,a));const{files:F,nextLocalId:I,imgSrc:R}=m.current,b=n.useRef(I),[i,t]=n.useState(()=>F),r=n.useRef(i);n.useLayoutEffect(()=>{r.current=i},[i]);const[s,l]=n.useState(()=>R),[M,y]=n.useState(!1),[C,E]=n.useState(!0),[w,S]=n.useState(!1),[_,z]=n.useState(B.USER),V=n.useCallback(()=>{const c=b.current;return b.current+=1,c},[]),j=n.useMemo(()=>{const c=u=>u.status.type==="uploading";return i.some(c)?"updating":"ready"},[i]),A=n.useMemo(()=>{if(i.length>0&&i[i.length-1].status.type==="uploading")return i[i.length-1].status.progress},[i]),de=n.useCallback(()=>{z(c=>c===B.USER?B.ENVIRONMENT:B.USER)},[]),P=n.useCallback(c=>r.current.find(u=>u.id===c),[]),X=n.useCallback(c=>{Me.flushSync(()=>{t(u=>[...u,c])})},[]),Q=n.useCallback(c=>{t(u=>u.filter(g=>g.id!==c))},[]),T=n.useCallback((c,u)=>{t(g=>g.map(x=>x.id===c?u:x))},[]),J=n.useCallback((c,u)=>{y(!1);const g=P(c);W(g)||g.status.type!=="uploading"||T(g.id,g.setStatus({type:"uploaded",fileId:u.fileId,fileUrls:u}))},[P,T]),K=n.useCallback((c,u)=>{const g=P(u);if(W(g)||g.status.type!=="uploading")return;const x=Math.round(c.loaded*100/c.total);g.status.progress!==x&&T(u,g.setStatus({type:"uploading",abortController:g.status.abortController,progress:x}))},[P,T]),Y=n.useCallback((c,u)=>{const g=new AbortController,x=new ie(u.name,u.size,V(),{type:"uploading",abortController:g,progress:1});X(x),d.uploadFile(e,c.uploadUrl,u,L=>K(L,x.id),g.signal).then(()=>J(x.id,c)).catch(L=>{L instanceof DOMException&&L.name==="AbortError"||T(x.id,x.setStatus({type:"error",errorMessage:L?L.toString():"Unknown error"}))})},[X,e,V,J,K,T,d]),Z=n.useCallback(c=>{const u=P(c);W(u)||(u.status.type==="uploading"&&u.status.abortController.abort(),u.status.type==="uploaded"&&u.status.fileUrls.deleteUrl&&d.deleteFile(u.status.fileUrls.deleteUrl),Q(c))},[P,Q,d]),ee=n.useCallback(c=>{if(c===null)return Promise.resolve();l(c),y(!0),E(!1);const u=g=>new Promise(x=>setTimeout(x,g));return ot(c,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(g=>d.fetchFileURLs([g]).then(x=>({file:g,fileUrls:x[0]}))).then(({file:g,fileUrls:x})=>Y(x,g)).then(()=>u(tt)).then(()=>{E(!0)}).catch(g=>{rt.error(g)})},[d,Y]),ue=n.useCallback(c=>{ee(c)},[ee]),fe=n.useCallback(()=>{i.length!==0&&(i.forEach(c=>Z(c.id)),l(null),S(!0))},[i,Z]);n.useEffect(()=>{a.getFileUploaderStateValue(e)===void 0&&a.setFileUploaderStateValue(e,N(i),{fromUi:!1},v)},[]),n.useEffect(()=>{if(j!=="ready")return;const c=N(i),u=a.getFileUploaderStateValue(e);Ee(c,u)||a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[j,i,a,e,v]);const pe=n.useCallback(()=>{t([]),l(null);const c=N([]);a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[e,v,a]);return Pe({element:e,widgetMgr:a,onFormCleared:pe}),O(se,{className:"stCameraInput","data-testid":"stCameraInput",ref:f,children:[U(Re,{label:e.label,disabled:h,labelVisibility:Ie(e.labelVisibility?.value),children:e.help&&U(Fe,{content:e.help,label:e.label})}),s?O(ke,{children:[U(G,{width:o,children:s!==ce&&U(Be,{src:s,alt:"Snapshot",opacity:M||!C?"50%":"100%",width:o,height:o*9/16})}),U(le,{onClick:fe,progress:A,disabled:!!A||h,children:A?"Uploading...":O(ze,{children:[U(q,{content:ae,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):U(et,{handleCapture:ue,width:o,disabled:h,clearPhotoInProgress:w,setClearPhotoInProgress:S,facingMode:_,setFacingMode:de,testOverride:p})]})},ut=n.memo(nt);export{ut as default};
|
|
1
|
+
import{r as n,E as H,_ as D,z as k,o as O,j as U,ay as ge,P as he,b as ve,B as me,ax as q,bN as re,al as Se,ag as be,bg as ye,l as Ce,bO as Ue,k as we,aj as Me,e as W,V as xe,bh as Ee,p as Ie,ab as Fe,ac as Re,$ as ke,bP as _e,bQ as Oe}from"./index.aCorc3Yt.js";import{U as ie}from"./UploadFileInfo.Dr-zDST7.js";import{u as Pe}from"./FormClearHelper.DN8D_YXO.js";import{P as Te,S as Le}from"./ProgressBar.C5uBOtcx.js";import{b as We}from"./urls.BwSlolu9.js";var oe=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:a}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.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"}))});oe.displayName="SwitchCamera";var ne=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ne.displayName="Video";var ae=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ae.displayName="X";function Ve(e,a){switch(e){case"xsmall":return{padding:`${a.spacing.twoXS} ${a.spacing.sm}`,fontSize:a.fontSizes.sm};case"small":return{padding:`${a.spacing.twoXS} ${a.spacing.md}`};case"large":return{padding:`${a.spacing.md} ${a.spacing.md}`};default:return{padding:`${a.spacing.xs} ${a.spacing.md}`}}}const se=k("div",{target:"exxgkyt0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),G=k("div",{target:"exxgkyt1"})(({theme:e,width:a})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,width:"100%",height:a*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),je=k("p",{target:"exxgkyt2"})(({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"})),Be=k("img",{target:"exxgkyt3"})(({theme:e,opacity:a})=>({borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,objectFit:"contain",opacity:a})),$e=k("a",{target:"exxgkyt4"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none",display:"block"})),ze=k("span",{target:"exxgkyt5"})({display:"flex",alignItems:"center"}),Ae=k("div",{target:"exxgkyt6"})(({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:e.zIndices.priority,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Ne=k("div",{target:"exxgkyt8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),He=k("button",{target:"exxgkyt9"})(({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:`0 0 ${e.radii.default} ${e.radii.default}`,"&: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,borderColor:e.colors.borderColor,backgroundColor:e.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:e.spacing.none,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},...Ve("medium",e)}));function De({disabled:e,onClick:a,children:d,progress:h}){return O(He,{disabled:e||!1,onClick:a||(()=>{}),progress:h||null,"data-testid":"stCameraInputButton",children:[d,h?U(Ne,{children:U(Te,{value:h,size:Le.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const le=n.memo(De);var B=(function(e){return e.USER="user",e.ENVIRONMENT="environment",e})({});const qe=({switchFacingMode:e})=>U(Ae,{"data-testid":"stCameraInputSwitchButton",children:U(ge,{content:"Switch camera",placement:he.TOP_RIGHT,children:U(ve,{kind:me.MINIMAL,onClick:e,children:U(q,{content:oe,size:"twoXL",color:re.white})})})}),Ge=n.memo(qe);var $={exports:{}},Xe=$.exports,te;function Qe(){return te||(te=1,(function(e,a){(function(h,v){e.exports=v(Se())})(Xe,function(d){return(function(h){var v={};function p(o){if(v[o])return v[o].exports;var f=v[o]={i:o,l:!1,exports:{}};return h[o].call(f.exports,f,f.exports,p),f.l=!0,f.exports}return p.m=h,p.c=v,p.d=function(o,f,m){p.o(o,f)||Object.defineProperty(o,f,{enumerable:!0,get:m})},p.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},p.t=function(o,f){if(f&1&&(o=p(o)),f&8||f&4&&typeof o=="object"&&o&&o.__esModule)return o;var m=Object.create(null);if(p.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:o}),f&2&&typeof o!="string")for(var F in o)p.d(m,F,(function(I){return o[I]}).bind(null,F));return m},p.n=function(o){var f=o&&o.__esModule?function(){return o.default}:function(){return o};return p.d(f,"a",f),f},p.o=function(o,f){return Object.prototype.hasOwnProperty.call(o,f)},p.p="",p(p.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(h,v,p){p.r(v);var o=p("react"),f=(function(){var b=function(i,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)s.hasOwnProperty(l)&&(r[l]=s[l])},b(i,t)};return function(i,t){b(i,t);function r(){this.constructor=i}i.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),m=function(){return m=Object.assign||function(b){for(var i,t=1,r=arguments.length;t<r;t++){i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(b[s]=i[s])}return b},m.apply(this,arguments)},F=function(b,i){var t={};for(var r in b)Object.prototype.hasOwnProperty.call(b,r)&&i.indexOf(r)<0&&(t[r]=b[r]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(b);s<r.length;s++)i.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(b,r[s])&&(t[r[s]]=b[r[s]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(i){var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise(function(r,s){t.call(navigator,i,r,s)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function I(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var R=(function(b){f(i,b);function i(t){var r=b.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return i.prototype.componentDidMount=function(){var t=this,r=t.state,s=t.props;if(this.unmounted=!1,!I()){s.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),s.children&&typeof s.children!="function"&&console.warn("children must be a function")},i.prototype.componentDidUpdate=function(t){var r=this.props;if(!I()){r.onUserMediaError("getUserMedia not supported");return}var s=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),l=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),M=t.minScreenshotWidth!==r.minScreenshotWidth,y=t.minScreenshotHeight!==r.minScreenshotHeight;(l||M||y)&&(this.canvas=null,this.ctx=null),(s||l)&&(this.stopAndCleanup(),this.requestUserMedia())},i.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},i.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},i.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(i.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},i.prototype.getScreenshot=function(t){var r=this,s=r.state,l=r.props;if(!s.hasUserMedia)return null;var M=this.getCanvas(t);return M&&M.toDataURL(l.screenshotFormat,l.screenshotQuality)},i.prototype.getCanvas=function(t){var r=this,s=r.state,l=r.props;if(!this.video||!s.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,y=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var C=M/y;M=l.minScreenshotWidth||this.video.clientWidth,y=M/C,l.minScreenshotHeight&&y<l.minScreenshotHeight&&(y=l.minScreenshotHeight,M=y*C)}this.canvas=document.createElement("canvas"),this.canvas.width=t?.width||M,this.canvas.height=t?.height||y,this.ctx=this.canvas.getContext("2d")}var E=this,w=E.ctx,S=E.canvas;return w&&S&&(S.width=t?.width||S.width,S.height=t?.height||S.height,l.mirrored&&(w.translate(S.width,0),w.scale(-1,1)),w.imageSmoothingEnabled=l.imageSmoothing,w.drawImage(this.video,0,0,t?.width||S.width,t?.height||S.height),l.mirrored&&(w.scale(-1,1),w.translate(-S.width,0))),S},i.prototype.requestUserMedia=function(){var t=this,r=this.props,s=function(y,C){var E={video:typeof C<"u"?C:!0};r.audio&&(E.audio=typeof y<"u"?y:!0),t.requestUserMediaId++;var w=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(E).then(function(S){t.unmounted||w!==t.requestUserMediaId?i.stopMediaStream(S):t.handleUserMedia(null,S)}).catch(function(S){t.handleUserMedia(S)})};if("mediaDevices"in navigator)s(r.audioConstraints,r.videoConstraints);else{var l=function(y){return{optional:[{sourceId:y}]}},M=function(y){var C=y.deviceId;return typeof C=="string"?C:Array.isArray(C)&&C.length>0?C[0]:typeof C=="object"&&C.ideal?C.ideal:null};MediaStreamTrack.getSources(function(y){var C=null,E=null;y.forEach(function(_){_.kind==="audio"?C=_.id:_.kind==="video"&&(E=_.id)});var w=M(r.audioConstraints);w&&(C=w);var S=M(r.videoConstraints);S&&(E=S),s(l(C),l(E))})}},i.prototype.handleUserMedia=function(t,r){var s=this.props;if(t||!r){this.setState({hasUserMedia:!1}),s.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}s.onUserMedia(r)},i.prototype.render=function(){var t=this,r=this,s=r.state,l=r.props,M=l.audio;l.forceScreenshotSourceSize;var y=l.disablePictureInPicture;l.onUserMedia,l.onUserMediaError,l.screenshotFormat,l.screenshotQuality,l.minScreenshotWidth,l.minScreenshotHeight,l.audioConstraints,l.videoConstraints,l.imageSmoothing;var C=l.mirrored,E=l.style,w=E===void 0?{}:E,S=l.children,_=F(l,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),z=C?m(m({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,V={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",m({autoPlay:!0,disablePictureInPicture:y,src:s.src,muted:!M,playsInline:!0,ref:function(j){t.video=j},style:z},_)),S&&S(V))},i.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},i})(o.Component);v.default=R}),react:(function(h,v){h.exports=d})}).default})})($)),$.exports}var Je=Qe();const Ke=be(Je),Ye=({width:e})=>O(G,{width:e,children:[U(q,{size:"threeXL",color:re.gray60,content:ne}),O(je,{children:["This app would like to use your camera.",U($e,{href:We,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ze=({handleCapture:e,width:a,disabled:d,clearPhotoInProgress:h,setClearPhotoInProgress:v,facingMode:p,setFacingMode:o,testOverride:f})=>{const[m,F]=n.useState(f||"pending"),I=n.useRef(null),[R,b]=n.useState(a),i=n.useCallback(ye(1e3,b),[]);n.useEffect(()=>{i(a)},[a,i]);function t(){if(I.current!==null){const s=I.current.getScreenshot();e(s)}}const r=Ce();return O(se,{"data-testid":"stCameraInputWebcamComponent",children:[m!=="success"&&!d&&!h?U(Ye,{width:R}):Ue()&&U(Ge,{switchFacingMode:o}),U(G,{"data-testid":"stCameraInputWebcamStyledBox",hidden:m!=="success"&&!d&&!h,width:R,children:!d&&U(Ke,{audio:!1,ref:I,screenshotFormat:"image/jpeg",screenshotQuality:1,width:R,height:R*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{F("error")},onUserMedia:()=>{F("success"),v(!1)},videoConstraints:{width:{ideal:R},facingMode:p}})}),U(le,{onClick:t,disabled:m!=="success"||d||h,children:"Take Photo"})]})},et=n.memo(Ze),ce="RESTORED_FROM_WIDGET",tt=150,rt=xe.getLogger("CameraInput"),N=e=>{const a=e.filter(d=>d.status.type==="uploaded").map(d=>{const{name:h,size:v,status:p}=d,{fileId:o,fileUrls:f}=p;return new _e({fileId:o,fileUrls:f,name:h,size:v})});return new Oe({uploadedFileInfo:a})},it=(e,a)=>{const d=a.getFileUploaderStateValue(e);if(W(d))return{files:[],nextLocalId:1,imgSrc:null};const{uploadedFileInfo:h}=d;if(W(h)||h.length===0)return{files:[],nextLocalId:1,imgSrc:null};let v=1;const p=h.map(o=>{const f=o.name,m=o.size,F=o.fileId,I=o.fileUrls,R=new ie(f,m,v,{type:"uploaded",fileId:F,fileUrls:I});return v+=1,R});return{files:p,nextLocalId:v,imgSrc:p.length>0?ce:null}};function ot(e,a){return fetch(e).then(d=>d.arrayBuffer()).then(d=>new File([d],a,{type:"image/jpeg"}))}const nt=({element:e,widgetMgr:a,uploadClient:d,disabled:h,fragmentId:v,testOverride:p})=>{const{width:o,elementRef:f}=we(),m=n.useRef(null);m.current===null&&(m.current=it(e,a));const{files:F,nextLocalId:I,imgSrc:R}=m.current,b=n.useRef(I),[i,t]=n.useState(()=>F),r=n.useRef(i);n.useLayoutEffect(()=>{r.current=i},[i]);const[s,l]=n.useState(()=>R),[M,y]=n.useState(!1),[C,E]=n.useState(!0),[w,S]=n.useState(!1),[_,z]=n.useState(B.USER),V=n.useCallback(()=>{const c=b.current;return b.current+=1,c},[]),j=n.useMemo(()=>{const c=u=>u.status.type==="uploading";return i.some(c)?"updating":"ready"},[i]),A=n.useMemo(()=>{if(i.length>0&&i[i.length-1].status.type==="uploading")return i[i.length-1].status.progress},[i]),de=n.useCallback(()=>{z(c=>c===B.USER?B.ENVIRONMENT:B.USER)},[]),P=n.useCallback(c=>r.current.find(u=>u.id===c),[]),X=n.useCallback(c=>{Me.flushSync(()=>{t(u=>[...u,c])})},[]),Q=n.useCallback(c=>{t(u=>u.filter(g=>g.id!==c))},[]),T=n.useCallback((c,u)=>{t(g=>g.map(x=>x.id===c?u:x))},[]),J=n.useCallback((c,u)=>{y(!1);const g=P(c);W(g)||g.status.type!=="uploading"||T(g.id,g.setStatus({type:"uploaded",fileId:u.fileId,fileUrls:u}))},[P,T]),K=n.useCallback((c,u)=>{const g=P(u);if(W(g)||g.status.type!=="uploading")return;const x=Math.round(c.loaded*100/c.total);g.status.progress!==x&&T(u,g.setStatus({type:"uploading",abortController:g.status.abortController,progress:x}))},[P,T]),Y=n.useCallback((c,u)=>{const g=new AbortController,x=new ie(u.name,u.size,V(),{type:"uploading",abortController:g,progress:1});X(x),d.uploadFile(e,c.uploadUrl,u,L=>K(L,x.id),g.signal).then(()=>J(x.id,c)).catch(L=>{L instanceof DOMException&&L.name==="AbortError"||T(x.id,x.setStatus({type:"error",errorMessage:L?L.toString():"Unknown error"}))})},[X,e,V,J,K,T,d]),Z=n.useCallback(c=>{const u=P(c);W(u)||(u.status.type==="uploading"&&u.status.abortController.abort(),u.status.type==="uploaded"&&u.status.fileUrls.deleteUrl&&d.deleteFile(u.status.fileUrls.deleteUrl),Q(c))},[P,Q,d]),ee=n.useCallback(c=>{if(c===null)return Promise.resolve();l(c),y(!0),E(!1);const u=g=>new Promise(x=>setTimeout(x,g));return ot(c,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(g=>d.fetchFileURLs([g]).then(x=>({file:g,fileUrls:x[0]}))).then(({file:g,fileUrls:x})=>Y(x,g)).then(()=>u(tt)).then(()=>{E(!0)}).catch(g=>{rt.error(g)})},[d,Y]),ue=n.useCallback(c=>{ee(c)},[ee]),fe=n.useCallback(()=>{i.length!==0&&(i.forEach(c=>Z(c.id)),l(null),S(!0))},[i,Z]);n.useEffect(()=>{a.getFileUploaderStateValue(e)===void 0&&a.setFileUploaderStateValue(e,N(i),{fromUi:!1},v)},[]),n.useEffect(()=>{if(j!=="ready")return;const c=N(i),u=a.getFileUploaderStateValue(e);Ee(c,u)||a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[j,i,a,e,v]);const pe=n.useCallback(()=>{t([]),l(null);const c=N([]);a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[e,v,a]);return Pe({element:e,widgetMgr:a,onFormCleared:pe}),O(se,{className:"stCameraInput","data-testid":"stCameraInput",ref:f,children:[U(Re,{label:e.label,disabled:h,labelVisibility:Ie(e.labelVisibility?.value),children:e.help&&U(Fe,{content:e.help,label:e.label})}),s?O(ke,{children:[U(G,{width:o,children:s!==ce&&U(Be,{src:s,alt:"Snapshot",opacity:M||!C?"50%":"100%",width:o,height:o*9/16})}),U(le,{onClick:fe,progress:A,disabled:!!A||h,children:A?"Uploading...":O(ze,{children:[U(q,{content:ae,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):U(et,{handleCapture:ue,width:o,disabled:h,clearPhotoInProgress:w,setClearPhotoInProgress:S,facingMode:_,setFacingMode:de,testOverride:p})]})},ut=n.memo(nt);export{ut as default};
|