1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0c707918-41a9-5de6-9131-baeafba60ac1")}catch(e){}}(); 3(self.webpackChunkclient=self.webpackChunkclient||[]).push([["3598"],{50660(e,r,i){i.d(r,{R:()=>d});var o=i(55099),a=i(42062),s=i(31085);let d=e=>{var{currentTime:r,duration:i,disabled:d}=e,t=(0,a.useMemo)(()=>({root:"recorder-track__root",thumb:"recorder-track__thumb",track:"recorder-track__track",rail:"recorder-track__rail",disabled:"recorder-track--disabled",mark:"recorder-track__mark"}),[]),n=(0,a.useMemo)(()=>new Date(i-r).toISOString().substr(14,5),[r,i]);return(0,s.jsxs)("div",{className:"recorder-track",children:[(0,s.jsx)("span",{className:"recorder-duration",children:n}),(0,s.jsx)(o.Ay,{marks:[{value:i}],value:r,defaultValue:0,min:0,max:i,step:1,classes:t,disabled:d})]})}},2909(e,r,i){i.d(r,{VRVideoPreviewRecorder:()=>D});var o,a,s=i(42062),d=i(66691),t=i(13462),n=i(93708),l=i(75841),c=i(91994),v=i(53644),u=i(64147),p=i(6664),h=i(24782),m=i(15526),w=i(56379),g=i(39971),x=i(79942);class f{constructor(e){this.userId=e}getDefaultVRCameraDevice(){var e;return null==(e=w.M.shared(this.userId).vrCamera)?void 0:e.getDefaultVRCameraDevice()}getMediaStream(){return w.M.shared(this.userId).initialized.toSingle().pipe((0,x.Fg)(e=>{var r=w.M.shared(this.userId).vrCamera;return e&&r?g.v.from(r.getVRCameraMedia()):g.v.just(void 0)}))}}f.shared=(0,m.G)(e=>new f(e));var j=i(98153),b=i(15782),_=i(70964),C=i(31085);let y="overlay-vr-video-preview-recorder-recording__video";var S=i(81924),k=i(50660),T=i(20345),R=i(78903),N=i(94375),M=i(12849),I=(o=(0,s.memo)(e=>{var{currentState:r,onConfirm:i,onStartRecordClick:o,currentCountdownTime:a,currentRecordingTime:d,recordingDuration:t,stream:n,recordedVideoSource:l,uploading:c}
3=e,v=(0,s.useRef)(null),u=(0,s.useRef)(null),[p,h]=(0,s.useState)(!1),[m,w]=(0,s.useState)(0),g=(0,s.useMemo)(()=>p?m:d,[d,p,m]),x=(0,s.useCallback)(()=>{var e;null==(e=u.current)||e.play().then(()=>{h(!0)}).catch(e=>{var r;if(null!=(r=u.current)&&r.isConnected)throw e})},[]),f=(0,s.useCallback)(()=>{h(!1)},[]),j=(0,s.useCallback)(()=>{var e,r=Math.round((null==(e=u.current)?void 0:e.currentTime)||0)*N.b.second;w(r>t?t:r)},[t]);(0,s.useEffect)(()=>{null!==v.current&&n&&(v.current.srcObject=n)},[n]);var b=(0,s.useCallback)(()=>{h(!1),w(0),o()},[o]);return(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__wrapper",children:(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-recording__videoContainer",children:[!!c&&(0,C.jsx)(M.Spinner,{type:"red",className:"overlay-vr-video-preview-recorder-recording__spinner"}),"initial"===r&&(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__tipContainer",children:(0,C.jsx)(S.LocalizedText,{variant:"h3",color:"light",href:"/overlay/vr-preview-recorder#recording-tip"})}),("preview"!==r||!l)&&(0,C.jsx)("video",{className:y,autoPlay:!0,playsInline:!0,muted:!0,ref:v}),"preview"===r&&!!l&&(0,C.jsx)("video",{className:y,playsInline:!0,ref:u,src:l,onEnded:f,onTimeUpdate:j}),("initial"===r||"countdown"===r)&&(0,C.jsx)("img",{className:"overlay-vr-video-preview-recorder-recording__safeZone",src:"/i/vr/vr-safe-zone.svg",alt:"VR Safe zone"}),"countdown"===r&&!!a&&(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__countdownContainer",children:a}),(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-recording__sliderContainer",children:[(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-recording__timeLineContainer",children:[(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__timeLine",children:(0,C.jsx)(k.R,{duration:t,currentTime:g})}),"preview"===r&&!!l&&!p&&(0,C.jsx)("button",{className:"overlay-vr-video-preview-recorder-recording__playVideoButton",onClick:x,disabled:c,children:(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__playIconWrapper",children:(0,C.jsx)(R.Icon,{name:"play",size:"normal"})})})]}),(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-recording__buttonContainer",children:["initial"===r&&(0,C.jsx)(T.$,{variant:"vr-light",onClick:o,children:(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#start-recording",variant:"h3",color:"inherit"})}),"countdown"===r&&(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#recording-will-start-in",data:{time:a},color:"light"}),"recording"===r&&(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-recording__recordingLabel",children:(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#recording",color:"danger"})}),"preview"===r&&(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-recording__previewButtonContainer",children:[(0,C.jsx)(T.$,{variant:"vr-light",onClick:b,disabled:c,children:(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#re-record",variant:"h3",color:"inherit"})}),(0,C.jsx)(T.$,{variant:"vr-accent",onClick:i,disabled:c,children:(0,C.jsx)(S.LocalizedText,{href:"/commons#confirm",variant:"h3",color:"inherit"})})]})]})]})]})})}),(0,s.memo)(e=>{var{onConfirm:r}=e,i=(0,c.w)(),a=(0,s.useCallback)(()=>{i&&_.T.shared(i).logPreviewUploadButtonClicked(),r&&r()},[i,r]);return(0,s.useEffect)(()=>{i&&_.T.shared(i).logRecorderShown()},[i]),(0,C.jsx)(o,Object.assign({},e,{onConfirm:a}))})),z=(0,s.memo)(e=>{var{userId:r,recordingDuration:i,countdownDuration:o,onPreviewUpload:a,onPreviewUploadError:t}=e,[l,c]=(0,s.useState)(),[v,u]=(0,s.useState)("initial"),[p,m]=(0,s.useState)(!1),{recordedVideo:w,recordedVideoSource:_,currentRecordingTime:y,currentCountdownTimeInSeconds:S,currentRecordingState:k,startRecording:T}=(0,h.d)({recordingDuration:i,countdownDuration:o}),R=(0,d.uN)(e=>f.shared(r).getMediaStream().pipe((0,x.ex)(r=>{r&&(c(r),e&&T(r.mediaStream,{mimeType:"video/webm",videoBitsPerSecond:1e7}))}
3)),[T,r]);(0,s.useEffect)(()=>(l||R(!1),()=>{null==l||l.mediaStream.getTracks().forEach(e=>e.stop())}),[R,l]);var N=(0,s.useCallback)(()=>{R(!0)},[R]),M=(0,b.A)("commons","something-went-wrong"),z=(0,d.uN)(()=>w&&null!=l&&l.name?(m(!0),n.T.shared(r).upload(w,l.name).pipe((0,x.vV)(a),(0,x.ZC)(()=>(j.A.emit("command.system-message.send","error",M),t(),g.v.just())),(0,x.Zl)(()=>m(!1)))):g.v.just(),[M,a,t,w,null==l?void 0:l.name,r]);return(0,s.useEffect)(()=>{u(k)},[k]),(0,C.jsx)(I,{currentState:v,onStartRecordClick:N,onConfirm:z,recordingDuration:i,currentRecordingTime:y,currentCountdownTime:S,stream:null==l?void 0:l.mediaStream,recordedVideoSource:_,uploading:p})}),V=(a=(0,s.memo)(e=>{var{recordingDuration:r,onNext:i}=e,o={time:r/N.b.second};return(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-tip__wrapper",children:[(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-tip__tipTitle",children:[(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#record",variant:"profile-h2"}),(0,C.jsx)("img",{src:"/i/vr/vr-glasses-no-background.png",alt:"VR Headset"})]}),(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-tip__tipContainer",children:[(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-tip__imageContainer",children:(0,C.jsx)("img",{src:"/i/vr/vr-preview-sample.png",alt:"VR Video Preview Example"})}),(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder-tip__tipTextContainer",children:[(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#tip-line-1"}),(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#tip-line-2",data:o}),(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#tip-line-3"})]})]}),(0,C.jsx)("div",{className:"overlay-vr-video-preview-recorder-tip__buttonContainer",children:(0,C.jsx)(T.$,{variant:"vr-light",onClick:i,blockLevel:!0,children:(0,C.jsx)(S.LocalizedText,{href:"/overlay/vr-preview-recorder#record",color:"inherit",variant:"h3"})})})]})}),(0,s.memo)(e=>{var{onNext:r}=e,i=(0,c.w)(),o=(0,s.useCallback)(()=>{i&&_.T.shared(i).logRecorderTipButtonClicked(),r&&r()},[i,r]);return(0,C.jsx)(a,Object.assign({},e,{onNext:o}))})),L=(0,s.memo)(e=>(0,C.jsx)(V,Object.assign({},e))),P=i(26672);let E=(0,s.memo)(e=>{var{userId:r,currentStep:i,onProceedToRecording:o,closeButtonVisible:a,onClose:s,onPreviewUpload:d,onPreviewUploadError:t,countdownDuration:n,recordingDuration:l}=e;return(0,C.jsxs)("div",{className:"overlay-vr-video-preview-recorder__container",children:[!!a&&(0,C.jsx)(P.J,{onClick:s,className:"overlay-vr-video-preview-recorder__close"}),"tip"===i&&(0,C.jsx)(L,{recordingDuration:l,onNext:o}),"recorder"===i&&(0,C.jsx)(z,{userId:r,countdownDuration:n,recordingDuration:l,onPreviewUpload:d,onPreviewUploadError:t})]})});var D=()=>{var[e,r]=(0,s.useState)("tip"),[i,o]=(0,s.useState)(!1),a=(0,c.w)(),{offer:h,acceptOffer:m,rejectOffer:w}=(0,u.g)(a?p.A.shared(a):void 0),g=(0,s.useCallback)(()=>{r("recorder")},[]),x=(0,d.J2)(()=>a?n.T.shared(a).previewExists:(0,l.of)(!1),[a],!1),f=(0,d.uN)(()=>(0,v.A)(),[]),j=(0,s.useCallback)(()=>{null==w||w(),f()},[f,w]),b=(0,s.useCallback)(()=>{null==m||m(),f()},[f,m]),_=(0,s.useCallback)(()=>{o(!0)},[]),y=(0,d.J2)(()=>t.T.shared().vrVideoPreviewRecorder.countdownDuration,[]),S=(0,d.J2)(()=>t.T.shared().vrVideoPreviewRecorder.recordingDuration,[]);return a&&y&&S&&h?(0,C.jsx)(E,{userId:a,currentStep:e,closeButtonVisible:x||i,onProceedToRecording:g,recordingDuration:S,countdownDuration:y,onClose:j,onPreviewUpload:b,onPreviewUploadError:_}):null}},70964(e,r,i){i.d(r,{T:()=>s});var o=i(15526),a=i(12640);class s{constructor(e){this.userId=e}logRecorderTipShown(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-tip-shown",{}).safeSubscribe()}logRecorderShown(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-shown",{}).safeSubscribe()}logRecorderTipButtonClicked(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-tip-button-clicked",{}).safeSubscribe()}logPreviewUploadButtonClicked(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-upload-button-clicked",{}).safeSubscribe()}logRecorderClosed(){a._.shared(this.userId).logEvent("vr-video-preview-recorder-closed",{}).safeSubscribe()}logPreviewUploadedSuccessfully(){a._.shared(this.userId).logEvent("vr-video-preview-uploaded-successfully",{}).safeSubscribe()}}s.shared=(0,o.G)(e=>new s(e))},53644(e,r,i){i.d(r,{$:()=>d,A:()=>t});var o=i(43751),a=i(79760),s=i(39971),d=()=>new s.v(e=>{o.Y.shared().get(a.A).actions.open("vr-video-preview-recorder",[{props:{},disableManualClose:!0}]),e.success()}),t=()=>new s.v(e=>{o.Y.shared().get(a.A).actions.close("vr-video-preview-recorder"),e.success()})},6664(e,r,i){i.d(r,{A:()=>k});var o=i(89218),a=i(17524),s=i(75841),d=i(15526),t=i(53940),n=i(56177),l=i(84190),c=i(28138),v=i(50626),u=i(15654),p=i(36580),h=i(13462),m=i(93708),w=i(96333),g=i(55952),x=i(39971),f=i(91885),j=i(56379),b=i(77252),_=i(4938),C=i(43751),y=i(79760),S=i(79942);class k extends o.D{constructor(e){super();var r=C.Y.shared().get(y.A).store.rxState().pipe((0,t.p)(e=>!(null!=e&&e.name)),(0,n.s)(1),(0,l.n)(()=>(0,a.z)([m.T.shared(e).get(),h.T.shared().vrVideoPreviewRecorder.previewRecordingExpiryTtl,_.E.shared().currentTime()]).pipe((0,c.T)(e=>{var[r,i,o]=e;return!!r&&o-(r.length?Math.max(...r.filter(e=>"declined"!==e.status).map(e=>new Date(e.created).getTime())):0)>=i}))));this.canOffer=h.T.shared().vrVideoPreviewRecorder.enabled.pipe((0,l.n)(i=>i?j.M.shared(e).initialized.pipe((0,l.n)(i=>i?g.K.shared(e).mcsId(e).asObservable().pipe((0,l.n)(i=>i?b.J.shared(e).status.pipe((0,l.n)(o=>"idle"!==o?(0,s.of)(!1):w._.shared(e).presence(i).pipe((0,c.T)(e=>!!(null!=e&&e.devices.includes("vr"))),(0,v.J)(),(0,c.T)(e=>{var[r,i]=e;return!r&&i}),(0,l.n)(e=>e?r:(0,s.of)(!1))))):(0,s.of)(!1))):(0,s.of)(!1))):(0,s.of)(!1)),(0,u.F)(),(0,p.t)({refCount:!0,bufferSize:1}))}start(){return this.offer.toSingle().pipe((0,S.Fg)(e=>e?x.v.just(f.Q.failure("offer-not-allowed")):x.v.just(f.Q.success({}))))}}k.shared=(0,d.G)(e=>new k(e))},24782(e,r,i){i.d(r,{d:()=>m});var o=i(42062),a=i(66691),s=i(8733),d=i(56607),t=i(17524),n=i(56823),l=i(65052),c=i(66640),v=i(92453),u=i(16220),p=i(94375),h=window.MediaRecorder.isTypeSupp
3orted("video/mp4")?"video/mp4":"video/webm";function m(e){var{recordingDuration:r,countdownDuration:i=0}=e,[m,w]=(0,o.useState)(null),[g,x]=(0,o.useState)(null),[f,j]=(0,o.useState)("initial"),[b,_]=(0,o.useState)(0),[C,y]=(0,o.useState)(null),S=(0,o.useMemo)(()=>r/p.b.second,[r]),k=(0,o.useMemo)(()=>i/p.b.second,[i]),T=(0,o.useRef)(new s.B),R=(0,a.hD)((e,r)=>{if(!e)return d.w;var i=!0,o=null,a=Object.assign({mimeType:h},r);try{var s=[];(o=new window.MediaRecorder(e,a)).ondataavailable=e=>{var r;(null==(r=e.data)?void 0:r.size)>0&&s.push(e.data)},o.start(),j("recording"),o.onstop=()=>{var e=new Blob(s,{type:a.mimeType}),r=URL.createObjectURL(e);x(r),w(e)}}catch(e){i=!1,j("error")}return(0,t.z)([(0,n.O)(0,p.b.second),T.current.pipe((0,l.Z)(!0))]).pipe((0,c.v)(e=>{var[r,o]=e;return o&&i&&r<S}),(0,v.M)(e=>{var[r]=e;return _(r*p.b.second)}),(0,u.j)(()=>{var r;null==(r=o)||r.stop(),null==e||e.getTracks().forEach(e=>e.stop()),_(0),j(e=>"error"===e?e:"preview")}))},[S]),N=(0,a.hD)((e,r)=>(w(null),x(e=>(e&&URL.revokeObjectURL(e),null)),_(0),j("countdown"),(0,n.O)(0,p.b.second).pipe((0,c.v)(e=>e<k),(0,v.M)(e=>y(k-e)),(0,u.j)(()=>{y(null),R(e,r)}))),[k,R]);return{recordedVideo:m,recordedVideoSource:g,currentRecordingTime:b,currentCountdownTimeInSeconds:C,currentRecordingState:f,startRecording:N,stopRecording:(0,o.useCallback)(e=>{e&&j("error"),T.current.next(!1)},[]),resetRecording:(0,o.useCallback)(()=>{T.current.next(!1),w(null),x(null),_(0),y(null),j("initial")},[])}}},93708(e,r,i){i.d(r,{T:()=>h});var o=i(15526),a=i(75841),s=i(48830),d=i(56379),t=i(84190),n=i(15654),l=i(36580),c=i(33702),v=i.n(c),u=i(39971),p=i(79942);class h{constructor(e){this.userId=e,this.previewExists=d.M.shared(e).initialized.pipe((0,t.n)(r=>r?new s.c(r=>{var i=e=>"approved"===e.status||"moderation"===e.status,o=e=>{var o=!!e.previews.length&&e.previews.some(i);r.next(o)},a=d.M.shared(e).vrVideoPreview;return a?(r.next(a.getState().previews.some(i)),a.addStateListener(o)):r.next(!1),()=>{var r;null==(r=d.M.shared(e).vrVideoPreview)||r.removeStateListener(o)}}):(0,a.of)(void 0)),(0,n.F)(v()),(0,l.t)({refCount:!0,bufferSize:1}))}upload(e,r){return d.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(i=>{var o=d.M.shared(this.userId).vrVideoPreview;return i&&o?u.v.from(o.add(e,r)).pipe((0,p.AB)(void 0)):u.v.just()}))}get(){return d.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(e=>{var r=d.M.shared(this.userId).vrVideoPreview;return e&&r?u.v.from(r.get()).pipe((0,p.vV)(e=>e.previews)):u.v.just(void 0)}))}getMediaUri(e,r,i){return d.M.shared(this.userId).initialized.toSingle().pipe((0,p.Fg)(o=>{var a=d.M.shared(this.userId).vrVideoPreview;return o&&a?u.v.from(a.getMediaUri(e,r,i)):u.v.just(void 0)}))}}h.shared=(0,o.G)(e=>new h(e))}}]); 4//# sourceMappingURL=sourcemaps/aa1f493c8463fa93.js.map 5//# debugId=0c707918-41a9-5de6-9131-baeafba60ac1
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.