evmux-app-framework 0.0.70 → 0.0.71
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.
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* pinia v2.1.6
|
|
3
3
|
* (c) 2023 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/const sc=Symbol();var ir;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ir||(ir={}));function nc(){const e=Ki(!0),t=e.run(()=>us({}));let s=[],n=[];const r=pn({install(i){r._a=i,i.provide(sc,r),i.config.globalProperties.$pinia=r,n.forEach(o=>s.push(o)),n=[]},use(i){return!this._a&&!tc?n.push(i):s.push(i),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return r}function rc(){let e=null,t=null;return[new Promise((n,r)=>{e=n,t=r}),e,t]}function or(){var e,t,s;for(e="",s=0;s<32;s++)(s==8||s==12||s==16||s==20)&&(e=e+"-"),t=Math.floor(Math.random()*16).toString(16).toUpperCase(),e=e+t;return e.toLowerCase()}class Js{constructor(){this.subscribers={}}init(){}publish(t,s){Array.isArray(this.subscribers[t])&&this.subscribers[t].forEach(n=>{try{n(t,s)}catch(r){console.error(r)}})}subscribe(t,s){return Array.isArray(this.subscribers[t])||(this.subscribers[t]=[]),this.subscribers[t].indexOf(s)>=0?()=>this.unsubscribe(t,s):(this.subscribers[t].push(s),()=>this.unsubscribe(t,s))}unsubscribe(t,s){if(!Array.isArray(this.subscribers[t])||this.subscribers[t].indexOf(s)<0)return!1;this.subscribers[t]=this.subscribers[t].filter(n=>n!==s)}}class ic{constructor(){this._requests={},this._messagesEventHandlers=new Js,window.onmessage=this.onPostMessage.bind(this)}static respondForPromiseBasedRequest(t,s,n="*",r){if(n=="null"&&(n="*"),t.promisedBased){let i={requestGuid:t.requestGuid,response:r};s.postMessage(JSON.stringify(i),"*")}}async sendRequestAsync(t,s=null){let n=or(),[r,i,o]=rc();return this._requests[n]={prom:r,resolve:i,reject:o},t.requestGuid=n,t.promisedBased=!0,s=s||window.parent,s.postMessage(JSON.stringify(t),"*"),r}sendRequest(t,s=null){let n=or();t.requestGuid=n,s=s||window.parent,s.postMessage(JSON.stringify(t),"*")}onPostMessage(t){try{let s=t&&JSON.parse(t.data);if(s.requestName=="EvEvent")this._messagesEventHandlers.publish(s.eventName,s.data);else if(s.requestGuid&&this._requests[s.requestGuid]){let n=this._requests[s.requestGuid];return delete this._requests[s.requestGuid],n.resolve(s)}}catch{}}unregisterFromEvents(){}}class oc{constructor(){this._userApps={},this._userAppInstances={}}updateUserAppData(t,s,n=!1){!n||!this._userApps[t]?this._userApps[t]=s:this._userApps[t]={...this._userApps[t],...s}}updateUserAppInstance(t,s,n=!1){!n||!this._userAppInstances[t]?this._userAppInstances[t]=s:this._userAppInstances[t]={...this._userAppInstances[t],...s}}updateUserAppInstanceSettings(t,s){this._userAppInstances[t]||(this._userAppInstances[t]={},console.warn("app not exist when update")),this._userAppInstances[t].settings=s}getUserAppDataByAppId(t){return this._userApps[t]}getUserAppInstanceById(t,s=!1){let n=this._userAppInstances[t];return n&&s&&(n.appData=this.getUserAppDataByAppId(n.userAppId)),n}}let os=new oc;class it{constructor(){}canHandleRequest(t){return!1}async handleRequest(t){return this[t.request](t)}}class lc extends it{constructor(){super()}canHandleRequest(t){return["getComments"].includes(t.request)}async handleRequest(t){return window.mockComments||[{id:"1fsdf",title:"Sample comment",text:"Comments will appear here once the broadcast starts.",pic:"https://evmuxstatic.s3-eu-west-1.amazonaws.com/AVATAR_EXAMPLE_FREE.jpg",style:"comment",enabled:!0,created_time:new Date(Date.now()-1e3*60),sn:"fb",flags:{sample:!0,star:!1,shown:!1}}]}}class cc extends it{constructor(){super()}canHandleRequest(t){return[J.createNewLayer,J.removeSizeCatcher,J.listScenes,J.switchScene,J.updateLayer].includes(t.request)}async createNewLayer(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}async removeSizeCatcher(t){return!0}async updateLayer(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}async listScenes(t){return window.mockScenes||[{id:497,idx:497,order:0,name:"New Scene",stingerData:{idx:null,time:null,muted:!1,speed:1,volume:100,transitionName:null,transitionDuration:0},backgroundColor:null,overWriteBackgroundColor:!1,layers:[{idx:"e9fe6623-4332-447c-bb1a-ccfe9f794bb3",type:"userapp",name:"TESTAPP",opacity:100,bounds:{x:1280,y:720},pos:{rot:0,top:8.397612310554674,left:13.50375337545383,right:19.829579957879496,bottom:24.93572102277865},crop:{top:0,left:0,right:0,bottom:0},data:{adaptive:!1,aspect:!0,borderRadius:0,userAppInstanceId:"4d532c22-363e-4028-824d-7b029f100916",userAppId:"ce5d32b3-7d6c-4e43-be02-4903d6b49acd",fixedSize:!0,fixedSizeWidth:1280,fixedSizeHeight:720,verticalStreaming:{pos:{rot:0,top:35.052083333333336,left:2.7777777777777777,right:2.7777777777777857,bottom:35.05208333333333},crop:{top:0,left:0,right:0,bottom:0},borderRadius:0,aspect:!0,bounds:{x:1020,y:574},customBounds:{x:1020,y:574},locked:!1,hidden:!1,fixedSizeWidth:1020,fixedSizeHeight:574}},order:0}],thumbnail:{landscape:"https://files.evmux.com/6/scenes/sc_tmb_4971715842178.jpg?Expires=1715885379&Signature=ORHKomQH7iaugP~fHJFYBgZfwoG2lyQOMORSbRld378vCvudJ5gFapWdQNfE~j97UOKuon0uwZ1F741k2YU3qWIFNklDdqU6zuJgxaDTHPM~~TvG9p-Nl0g4BBzGvlyR-JZbUCbpWtg9DczFnQbeFbWynHFdIOGwwh2OQYXuAHlW0v1UDuOnjGRU87XvZ~ReSCW844TuhaPCBPXoMiSt0MHDC-zk~ggmpb7~eQMPjTF5znOdcDB0DdRJ8j~7EYNCFGYGesErpPqH5kOMRLCwmjmvQ4gFJMkNEfPBGdQclanYiSw5iL7KsOErCUtS447euT7wDnRT1N1wgL0LYgJDdQ__&Key-Pair-Id=APKAJQZJ2AA6OYF4WJHA",portrait:null}}]}async switchScene(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}}const Le={settingsUpdated:"settingsUpdated",viewerCountChanged:"viewerCountChanged",keystroke:"keystroke",comments:"comments",appMessaging:"appMessaging",externalAppMessaging:"externalAppMessaging",fastActionButton:"fastActionButton",doubleClickOnWidget:"doubleClickOnWidget",widgetOnFocus:"widgetGotFocus",widgetOnBlur:"widgetOnBlur",studioParamsUpdated:"studioParamsUpdated",signalingEvent:"signalingEvent"};class uc extends it{constructor(){super()}canHandleRequest(t){return[J.raiseExternalAppMessagingEvent,J.setFastActionButtons,J.openSideBarSettings,J.isSudioMode].includes(t.request)}async raiseExternalAppMessagingEvent(t){return Ys._raiseEventForSpecificUserAppInstance(t.data.targetUserAppInstanceId,Le.externalAppMessaging,t.data.data),null}async setFastActionButtons(){return!0}async openSideBarSettings(){return!0}async isSudioMode(){return!0}async handleRequest(t){return this[t.request](t)}}function ge(e=0,t=100){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}class ac extends it{constructor(){super()}canHandleRequest(t){return["getStatistics"].includes(t.request)}async getStatistics(t){return[{viewers:null,type:"linkedinProfile"},{viewers:ge(),type:"twitterProfile",statistics:null,last_subscribers:null},{viewers:ge(),type:"twitchProfile",statistics:{channel:{subscribers:ge()}},last_subscribers:null},{viewers:ge(),type:"evmuxPlayer",statistics:null,last_subscribers:null},{viewers:ge(),type:"youtubeChannel",statistics:{viewCount:ge(),likeCount:ge(),dislikeCount:ge(),favoriteCount:ge(),commentCount:ge()},lastSubscribers:[{name:"Eran Eluz",thumbs:{default:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s88-c-k-c0x00ffffff-no-rj"},medium:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s240-c-k-c0x00ffffff-no-rj"},high:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s800-c-k-c0x00ffffff-no-rj"}}},{name:"Roman Arinenko",thumbs:{default:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s88-c-k-c0x00ffffff-no-rj"},medium:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s240-c-k-c0x00ffffff-no-rj"},high:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s800-c-k-c0x00ffffff-no-rj"}}}]},{viewers:ge(),type:"facebookProfile",statistics:{total_reactions:ge()}}]}}class fc extends it{constructor(){super()}canHandleRequest(t){return[J.displayDateTimePicker,J.displayScenePicker,J.displayRichTextEditor,J.displayToast,J.displayLayerSelector].includes(t.request)}async displayDateTimePicker(t){return{value:window.mockDateTime||new Date().getTime(),dateTimeKey:"result"}}async displayLayerSelector(t){return{value:window.mockLayer||null}}async displayScenePicker(t){return{value:window.mockScene||"simple"}}async displayRichTextEditor(t){return{value:window.mockRichText||"<b>This is a test</b>"}}async displayToast(t){return{value:window.mockToast||{text:"This is a toast",type:"info",uniqCode:"123"}}}}class dc extends it{constructor(){super()}canHandleRequest(t){return[J.getStudioParams,J.getSoundRtc,J.signal].includes(t.request)}async getStudioParams(t){return window.mockStudioParams||{antiScaleValue:1,antiScaleValue2:1}}async signal(t){return null}async getSoundRtc(t){return"webrtc-mock-channel"}}class hc extends it{constructor(){super()}canHandleRequest(t){return[J.logError,J.logInfo,J.logWarning].includes(t.request)}async handleRequest(t){return this[t.request.toLowerCase().replace("log","")](t)}async error(t){return console.error(t.data),!0}async info(t){return console.info(t.data),!0}async warning(t){return console.warn(t.data),!0}}const J={updateSettings:"updateSettings",getSettings:"getSettings",startLoad:"startLoad",loaded:"loaded",registerEvent:"registerEvent",unregisterEvent:"unregisterEvent",EvEvent:"EvEvent",raiseAppMessagingEvent:"raiseAppMessagingEvent",raiseExternalAppMessagingEvent:"raiseExternalAppMessagingEvent",raiseFastAccessButtonEvent:"raiseFastAccessButtonEvent",setFastActionButtons:"setFastActionButtons",createNewLayer:"createNewLayer",listScenes:"listScenes",updateLayer:"updateLayer",switchScene:"switchScene",removeSizeCatcher:"removeSizeCatcher",openSideBarSettings:"openSideBarSettings",displayDateTimePicker:"displayDateTimePicker",displayScenePicker:"displayScenePicker",displayRichTextEditor:"displayRichTextEditor",displayToast:"displayToast",displayLayerSelector:"displayLayerSelector",isSudioMode:"isSudioMode",getStudioParams:"getStudioParams",getSoundRtc:"getSoundRtc",signal:"signal",logError:"logError",logWarning:"logWarning",logInfo:"logInfo"};let Ot=(e,t,s)=>({requestName:e,eventName:t,data:s});class pc{constructor(){this._userAppInstances={},this._messagesEventHandlers=new Js,this._eventHandler=new Js,this._requestHandlers=[]}init(t){window.onmessage=this.onPostMessage.bind(this),this.initRequestHandlerProjectSpecific(t)}initRequestHandlerProjectSpecific(t){this._requestHandlers.push(new lc(t)),this._requestHandlers.push(new cc(t)),this._requestHandlers.push(new uc(t)),this._requestHandlers.push(new ac(t)),this._requestHandlers.push(new fc(t)),this._requestHandlers.push(new dc(t)),this._requestHandlers.push(new hc(t))}_sendPostMessageToUsrAppInstancesComponents(t,s,n=null){let r=JSON.stringify(s);for(const[i,o]of Object.entries(this._userAppInstances[t].instances))n!=i&&o.window.postMessage(r,"*")}_raiseEventForSpecificUserAppInstance(t,s,n,r=null){let i=this._userAppInstances[t];if(i&&i.events&&i.events[s]){let o=Ot("EvEvent",s,n);this._sendPostMessageToUsrAppInstancesComponents(t,o,r)}}raiseEvent(t,s){for(const[n,r]of Object.entries(this._userAppInstances))this._raiseEventForSpecificUserAppInstance(n,t,s)}getAppSettingsForAppInstanceId(t){return os.getUserAppInstanceById(t)}_makeSureAppInstanceExist(t){this._userAppInstances[t]=this._userAppInstances[t]||{},this._userAppInstances[t].instances=this._userAppInstances[t].instances||{},this._userAppInstances[t].events=this._userAppInstances[t].events||{}}updateAndNotifyAppInstancesOnSettingsUpdate(t,s,n){if(os.updateUserAppInstanceSettings(t,s),this._userAppInstances[t]&&this._userAppInstances[t].events[Le.settingsUpdated]){let r=Ot("EvEvent",Le.settingsUpdated,s);this._sendPostMessageToUsrAppInstancesComponents(t,r,n)}}updateAppsAboutStudioParams(t){let s=Ot("EvEvent",Le.studioParamsUpdated,t);Object.keys(this._userAppInstances).forEach(n=>{this._userAppInstances[n].events[Le.studioParamsUpdated]&&this._sendPostMessageToUsrAppInstancesComponents(n,s,null)})}signalApp(t,s){let n=this._userAppInstances[t];if(n&&n.events[Le.signalingEvent]){let r=Ot("EvEvent",Le.signalingEvent,s);this._sendPostMessageToUsrAppInstancesComponents(t,r,null)}}async onPostMessage(t){let s={};try{typeof t.data=="string"||t.data instanceof String?s=JSON.parse(t.data):s=t.data}catch{}let n=null;if(s.request==J.updateSettings)this._userAppInstances[s.userAppInstanceId]&&this.updateSettingsAndPublish(s);else if(s.request==J.raiseAppMessagingEvent)this._userAppInstances[s.userAppInstanceId]&&(this._raiseEventForSpecificUserAppInstance(s.userAppInstanceId,Le.appMessaging,s.data,s.componentId),this._eventHandler.publish("updateEverywhere",s));else if(s.request==J.getSettings)this._userAppInstances[s.userAppInstanceId]&&(Ot("EvMessage","settings",s.data),n=(await os.getUserAppInstanceById(s.userAppInstanceId,!1)).settings);else if(s.request==J.startLoad)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].instances[s.componentId]={window:t.source};else if(s.request==J.loaded)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].instances[s.componentId]={window:t.source},this._eventHandler.publish("appComponentLoaded",s),n=this.getAppSettingsForAppInstanceId(s.userAppInstanceId);else if(s.request==J.registerEvent)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].events[s.data.eventName]=!0;else if(s.request==J.unregisterEvent)this._makeSureAppInstanceExist(s.userAppInstanceId),delete this._userAppInstances[s.userAppInstanceId].events[s.data.eventName];else for(let r=0;r<this._requestHandlers.length;r++)if(this._requestHandlers[r].canHandleRequest(s)){n=await this._requestHandlers[r].handleRequest(s);break}s.promisedBased&&ic.respondForPromiseBasedRequest(s,t.source,t.origin,n)}updateSettingsAndPublish(t){this._eventHandler.publish("updateSettings",t),this._eventHandler.publish("updateEverywhere",t),this.updateAndNotifyAppInstancesOnSettingsUpdate(t.userAppInstanceId,t.data,t.componentId)}onUserAppComponentUnload(t,s){this._userAppInstances[t]&&this._userAppInstances[t].instances[s]&&(delete this._userAppInstances[t].instances[s],Object.keys(this._userAppInstances[t].instances).length==0&&delete this._userAppInstances[t])}}const Ys=new pc,lr=["This song gives me major nostalgic vibes!","Who else is here after watching the movie? Amazing!","Can't believe this video only has a few views. It deserves millions!","This is the most talented guitarist I've ever seen. Mind-blowing!","I keep coming back to this video. It's just so addictive!","I wish I could sing like this. Beautiful voice!","The cinematography in this video is top-notch. So visually stunning!","This dance routine is fire! I need to learn these moves.","Who else is watching this in 2023? Timeless classic!","This tutorial is a lifesaver. Thank you so much!","I can't stop laughing! This video is pure comedy gold.","This track has been on repeat all day. Can't get enough!","I'm so impressed by the production quality. Well done!","This deserves to be the soundtrack of a blockbuster movie.","This video is so underrated. It deserves way more recognition.","This singer has such a unique and soulful voice. Goosebumps!","I've watched this video at least 20 times. It never gets old!","This is the kind of content I subscribe for. Keep it up!","I've been waiting for this collab. They did not disappoint!","This video is so informative. I've learned a lot. Thanks!","Can't believe I discovered this hidden gem. Pure talent!","The energy in this live performance is off the charts!","This video is so heartwarming. It made my day!","The lyrics of this song hit me right in the feels. Emotional!","I can't stop watching this. It's so satisfying to see.","This tutorial is so easy to follow. I finally mastered it!","This is the best cover I've ever heard. Absolutely amazing!","The special effects in this video are mind-blowing. Wow!","This artist is so underrated. They deserve more recognition.","I can't get this song out of my head. It's so catchy!","I'm in awe of the talent displayed in this video. Mesmerizing!","This video is pure art. The visuals are stunning!","This song is my anthem. It speaks to my soul.","I love how positive and uplifting this video is. Great message!","This tutorial saved my life. I was completely lost before!","The choreography in this dance video is out of this world!","This video brings back so many childhood memories. Nostalgic!","I can't believe how young this artist is. Such talent at a young age!","This video deserves all the awards. Brilliant work!","I can't help but smile while watching this video. Pure joy!","This song is so underrated. It needs to go viral!","The editing in this video is on point. So professionally done!","This video inspired me to chase my dreams. Thank you!","The guitar solo in this song gives me goosebumps. Epic!","This video deserves to be trending. Let's make it happen!","I can't get over how beautiful this scenery is. Breathtaking!","This song is my go-to when I need a pick-me-up. Love it!","This video is so relatable. Hits close to home.","I've been following this channel for years. Always amazing content!","This video is the definition of perfection. Flawless execution!"],cr=["TheVloggingGuru","MusicMastermind","TechWizard","GamingProphet","TravelEnthusiast","FoodieExplorer","FashionDiva","ComedyJester","FitnessFreak","ArtisticSoul","MovieBuff","DIYEnthusiast","ScienceGeek","NatureLover","Bookworm","SportsFanatic","PetLover","AdventureSeeker","CookingMaestro","Fashionista","GuitarHero","ComedyGenius","YogaMaster","TechJunkie","PhotographyWhiz","AnimalAdventurer","SingingSensation","GameChanger","FitnessGuru","CreativeMind","MovieCritique","DIYWizard","ScienceExplorer","OutdoorEnthusiast","LiteraryLion","SportsEnthusiast","PetWhisperer","WanderlustSoul","MusicProdigy","TechEnthusiast","CulinaryArtist","FashionIcon","GamingLegend","ComedyMaestro","YogaEnthusiast","TechGuru","PhotographyNinja","AnimalLover","SingingSuperstar","GameMaster","FitnessAddict"];function gc(){return[{id:(Math.random()+1).toString(36).substring(2),title:cr[Math.floor(Math.random()*cr.length)],text:lr[Math.floor(Math.random()*lr.length)],pic:"https://evmuxstatic.s3-eu-west-1.amazonaws.com/AVATAR_EXAMPLE_FREE.jpg",style:"comment",enabled:!0,created_time:new Date(Date.now()-1e3*60),sn:Math.random()>=.5?"fb":"yt",flags:{sample:!1,star:!1,shown:!1}}]}const mc=(e,t)=>{const s=e.__vccOpts||e;for(const[n,r]of t)s[n]=r;return s},An=e=>(To("data-v-f3e17de6"),e=e(),Mo(),e),vc={style:{display:"flex"}},_c={class:"panel"},yc=An(()=>pe("br",null,null,-1)),bc=An(()=>pe("div",{style:{width:"50px"}},null,-1)),wc={class:"panel"},Ec={class:"resizer grayone"},Ac=An(()=>pe("button",null,"sceneUpdated",-1)),xc={__name:"TestHolder",setup(e){Ys.init();let t=window.userAppInstanceId||"914155de-633a-476b-957a-6a7a9e01d6e9",s=window.componentId||"b893da10-5cec-4f11-876c-716addbad4ae",n=window.baseAppSettings||{};os.updateUserAppInstance(t,{id:t,settings:n});const r=us(null),i=us(null);ni(()=>{r.value.src=`widget.html?appInstanceId=${t}&compId=${s}`,i.value.src=`settings.html?appInstanceId=${t}&compId=settings_${s}`});function o(u){Ys.raiseEvent(Le.comments,gc())}return(u,l)=>(ml(),yl("div",null,[pe("div",vc,[pe("div",_c,[qt(" Settings (src/settings.html):"),yc,pe("iframe",{ref_key:"settingsIframe",ref:i,width:"500",height:"500"},null,512)]),bc,pe("div",wc,[qt(" App (src/widget.html): "),pe("div",Ec,[pe("iframe",{ref_key:"wudgetIframe",ref:r,width:"100%",height:"100%"},null,512)])])]),pe("div",null,[qt(" events: "),Ac,qt(),pe("button",{onClick:o},"getComments")])]))}},Ic=mc(xc,[["__scopeId","data-v-f3e17de6"]]);/*!
|
|
5
|
+
*/const sc=Symbol();var ir;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ir||(ir={}));function nc(){const e=Ki(!0),t=e.run(()=>us({}));let s=[],n=[];const r=pn({install(i){r._a=i,i.provide(sc,r),i.config.globalProperties.$pinia=r,n.forEach(o=>s.push(o)),n=[]},use(i){return!this._a&&!tc?n.push(i):s.push(i),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return r}function rc(){let e=null,t=null;return[new Promise((n,r)=>{e=n,t=r}),e,t]}function or(){var e,t,s;for(e="",s=0;s<32;s++)(s==8||s==12||s==16||s==20)&&(e=e+"-"),t=Math.floor(Math.random()*16).toString(16).toUpperCase(),e=e+t;return e.toLowerCase()}class Js{constructor(){this.subscribers={}}init(){}publish(t,s){Array.isArray(this.subscribers[t])&&this.subscribers[t].forEach(n=>{try{n(t,s)}catch(r){console.error(r)}})}subscribe(t,s){return Array.isArray(this.subscribers[t])||(this.subscribers[t]=[]),this.subscribers[t].indexOf(s)>=0?()=>this.unsubscribe(t,s):(this.subscribers[t].push(s),()=>this.unsubscribe(t,s))}unsubscribe(t,s){if(!Array.isArray(this.subscribers[t])||this.subscribers[t].indexOf(s)<0)return!1;this.subscribers[t]=this.subscribers[t].filter(n=>n!==s)}}class ic{constructor(){this._requests={},this._messagesEventHandlers=new Js,window.onmessage=this.onPostMessage.bind(this)}static respondForPromiseBasedRequest(t,s,n="*",r){if(n=="null"&&(n="*"),t.promisedBased){let i={requestGuid:t.requestGuid,response:r};s.postMessage(JSON.stringify(i),"*")}}async sendRequestAsync(t,s=null){let n=or(),[r,i,o]=rc();return this._requests[n]={prom:r,resolve:i,reject:o},t.requestGuid=n,t.promisedBased=!0,s=s||window.parent,s.postMessage(JSON.stringify(t),"*"),r}sendRequest(t,s=null){let n=or();t.requestGuid=n,s=s||window.parent,s.postMessage(JSON.stringify(t),"*")}onPostMessage(t){try{let s=t&&JSON.parse(t.data);if(s.requestName=="EvEvent")this._messagesEventHandlers.publish(s.eventName,s.data);else if(s.requestGuid&&this._requests[s.requestGuid]){let n=this._requests[s.requestGuid];return delete this._requests[s.requestGuid],n.resolve(s)}}catch{}}unregisterFromEvents(){}}class oc{constructor(){this._userApps={},this._userAppInstances={}}updateUserAppData(t,s,n=!1){!n||!this._userApps[t]?this._userApps[t]=s:this._userApps[t]={...this._userApps[t],...s}}updateUserAppInstance(t,s,n=!1){!n||!this._userAppInstances[t]?this._userAppInstances[t]=s:this._userAppInstances[t]={...this._userAppInstances[t],...s}}updateUserAppInstanceSettings(t,s){this._userAppInstances[t]||(this._userAppInstances[t]={},console.warn("app not exist when update")),this._userAppInstances[t].settings=s}getUserAppDataByAppId(t){return this._userApps[t]}getUserAppInstanceById(t,s=!1){let n=this._userAppInstances[t];return n&&s&&(n.appData=this.getUserAppDataByAppId(n.userAppId)),n}}let os=new oc;class it{constructor(){}canHandleRequest(t){return!1}async handleRequest(t){return this[t.request](t)}}class lc extends it{constructor(){super()}canHandleRequest(t){return["getComments"].includes(t.request)}async handleRequest(t){return window.mockComments||[{id:"1fsdf",title:"Sample comment",text:"Comments will appear here once the broadcast starts.",pic:"https://evmuxstatic.s3-eu-west-1.amazonaws.com/AVATAR_EXAMPLE_FREE.jpg",style:"comment",enabled:!0,created_time:new Date(Date.now()-1e3*60),sn:"fb",flags:{sample:!0,star:!1,shown:!1}}]}}class cc extends it{constructor(){super()}canHandleRequest(t){return[J.createNewLayer,J.removeSizeCatcher,J.listScenes,J.switchScene,J.updateLayer].includes(t.request)}async createNewLayer(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}async removeSizeCatcher(t){return!0}async updateLayer(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}async listScenes(t){return window.mockScenes||[{id:497,idx:497,order:0,name:"New Scene",stingerData:{idx:null,time:null,muted:!1,speed:1,volume:100,transitionName:null,transitionDuration:0},backgroundColor:null,overWriteBackgroundColor:!1,layers:[{idx:"e9fe6623-4332-447c-bb1a-ccfe9f794bb3",type:"userapp",name:"TESTAPP",opacity:100,bounds:{x:1280,y:720},pos:{rot:0,top:8.397612310554674,left:13.50375337545383,right:19.829579957879496,bottom:24.93572102277865},crop:{top:0,left:0,right:0,bottom:0},data:{adaptive:!1,aspect:!0,borderRadius:0,userAppInstanceId:"4d532c22-363e-4028-824d-7b029f100916",userAppId:"ce5d32b3-7d6c-4e43-be02-4903d6b49acd",fixedSize:!0,fixedSizeWidth:1280,fixedSizeHeight:720,verticalStreaming:{pos:{rot:0,top:35.052083333333336,left:2.7777777777777777,right:2.7777777777777857,bottom:35.05208333333333},crop:{top:0,left:0,right:0,bottom:0},borderRadius:0,aspect:!0,bounds:{x:1020,y:574},customBounds:{x:1020,y:574},locked:!1,hidden:!1,fixedSizeWidth:1020,fixedSizeHeight:574}},order:0}],thumbnail:{landscape:"https://files.evmux.com/6/scenes/sc_tmb_4971715842178.jpg?Expires=1715885379&Signature=ORHKomQH7iaugP~fHJFYBgZfwoG2lyQOMORSbRld378vCvudJ5gFapWdQNfE~j97UOKuon0uwZ1F741k2YU3qWIFNklDdqU6zuJgxaDTHPM~~TvG9p-Nl0g4BBzGvlyR-JZbUCbpWtg9DczFnQbeFbWynHFdIOGwwh2OQYXuAHlW0v1UDuOnjGRU87XvZ~ReSCW844TuhaPCBPXoMiSt0MHDC-zk~ggmpb7~eQMPjTF5znOdcDB0DdRJ8j~7EYNCFGYGesErpPqH5kOMRLCwmjmvQ4gFJMkNEfPBGdQclanYiSw5iL7KsOErCUtS447euT7wDnRT1N1wgL0LYgJDdQ__&Key-Pair-Id=APKAJQZJ2AA6OYF4WJHA",portrait:null}}]}async switchScene(t){return{userAppInstanceId:"26c6f221-b278-46c8-a69c-ce8379766e24"}}}const Le={settingsUpdated:"settingsUpdated",viewerCountChanged:"viewerCountChanged",keystroke:"keystroke",comments:"comments",appMessaging:"appMessaging",externalAppMessaging:"externalAppMessaging",fastActionButton:"fastActionButton",doubleClickOnWidget:"doubleClickOnWidget",widgetOnFocus:"widgetGotFocus",widgetOnBlur:"widgetOnBlur",studioParamsUpdated:"studioParamsUpdated",signalingEvent:"signalingEvent"};class uc extends it{constructor(){super()}canHandleRequest(t){return[J.raiseExternalAppMessagingEvent,J.setFastActionButtons,J.openSideBarSettings,J.isSudioMode].includes(t.request)}async raiseExternalAppMessagingEvent(t){return Ys._raiseEventForSpecificUserAppInstance(t.data.targetUserAppInstanceId,Le.externalAppMessaging,t.data.data),null}async setFastActionButtons(){return!0}async openSideBarSettings(){return!0}async isSudioMode(){return!0}async handleRequest(t){return this[t.request](t)}}function ge(e=0,t=100){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}class ac extends it{constructor(){super()}canHandleRequest(t){return["getStatistics"].includes(t.request)}async getStatistics(t){return[{viewers:null,type:"linkedinProfile"},{viewers:ge(),type:"twitterProfile",statistics:null,last_subscribers:null},{viewers:ge(),type:"twitchProfile",statistics:{channel:{subscribers:ge()}},last_subscribers:null},{viewers:ge(),type:"evmuxPlayer",statistics:null,last_subscribers:null},{viewers:ge(),type:"youtubeChannel",statistics:{viewCount:ge(),likeCount:ge(),dislikeCount:ge(),favoriteCount:ge(),commentCount:ge()},lastSubscribers:[{name:"Eran Eluz",thumbs:{default:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s88-c-k-c0x00ffffff-no-rj"},medium:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s240-c-k-c0x00ffffff-no-rj"},high:{url:"https://yt3.ggpht.com/ytc/AOPolaSdQs59DTIyTrfPz8ePDpCAQ-0dJuwmvK8W-NpM9As=s800-c-k-c0x00ffffff-no-rj"}}},{name:"Roman Arinenko",thumbs:{default:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s88-c-k-c0x00ffffff-no-rj"},medium:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s240-c-k-c0x00ffffff-no-rj"},high:{url:"https://yt3.ggpht.com/ytc/AOPolaQrO9YkhtcAmG1jvfwX_0xuew_Lh5dcIpb0=s800-c-k-c0x00ffffff-no-rj"}}}]},{viewers:ge(),type:"facebookProfile",statistics:{total_reactions:ge()}}]}}class fc extends it{constructor(){super()}canHandleRequest(t){return[J.displayDateTimePicker,J.displayScenePicker,J.displayRichTextEditor,J.displayToast,J.displayLayerSelector].includes(t.request)}async displayDateTimePicker(t){return{value:window.mockDateTime||new Date().getTime(),dateTimeKey:"result"}}async displayLayerSelector(t){return window.mockLayer}async displayScenePicker(t){return{value:window.mockScene||"simple"}}async displayRichTextEditor(t){return{value:window.mockRichText||"<b>This is a test</b>"}}async displayToast(t){return{value:window.mockToast||{text:"This is a toast",type:"info",uniqCode:"123"}}}}class dc extends it{constructor(){super()}canHandleRequest(t){return[J.getStudioParams,J.getSoundRtc,J.signal].includes(t.request)}async getStudioParams(t){return window.mockStudioParams||{antiScaleValue:1,antiScaleValue2:1}}async signal(t){return null}async getSoundRtc(t){return"webrtc-mock-channel"}}class hc extends it{constructor(){super()}canHandleRequest(t){return[J.logError,J.logInfo,J.logWarning].includes(t.request)}async handleRequest(t){return this[t.request.toLowerCase().replace("log","")](t)}async error(t){return console.error(t.data),!0}async info(t){return console.info(t.data),!0}async warning(t){return console.warn(t.data),!0}}const J={updateSettings:"updateSettings",getSettings:"getSettings",startLoad:"startLoad",loaded:"loaded",registerEvent:"registerEvent",unregisterEvent:"unregisterEvent",EvEvent:"EvEvent",raiseAppMessagingEvent:"raiseAppMessagingEvent",raiseExternalAppMessagingEvent:"raiseExternalAppMessagingEvent",raiseFastAccessButtonEvent:"raiseFastAccessButtonEvent",setFastActionButtons:"setFastActionButtons",createNewLayer:"createNewLayer",listScenes:"listScenes",updateLayer:"updateLayer",switchScene:"switchScene",removeSizeCatcher:"removeSizeCatcher",openSideBarSettings:"openSideBarSettings",displayDateTimePicker:"displayDateTimePicker",displayScenePicker:"displayScenePicker",displayRichTextEditor:"displayRichTextEditor",displayToast:"displayToast",displayLayerSelector:"displayLayerSelector",isSudioMode:"isSudioMode",getStudioParams:"getStudioParams",getSoundRtc:"getSoundRtc",signal:"signal",logError:"logError",logWarning:"logWarning",logInfo:"logInfo"};let Ot=(e,t,s)=>({requestName:e,eventName:t,data:s});class pc{constructor(){this._userAppInstances={},this._messagesEventHandlers=new Js,this._eventHandler=new Js,this._requestHandlers=[]}init(t){window.onmessage=this.onPostMessage.bind(this),this.initRequestHandlerProjectSpecific(t)}initRequestHandlerProjectSpecific(t){this._requestHandlers.push(new lc(t)),this._requestHandlers.push(new cc(t)),this._requestHandlers.push(new uc(t)),this._requestHandlers.push(new ac(t)),this._requestHandlers.push(new fc(t)),this._requestHandlers.push(new dc(t)),this._requestHandlers.push(new hc(t))}_sendPostMessageToUsrAppInstancesComponents(t,s,n=null){let r=JSON.stringify(s);for(const[i,o]of Object.entries(this._userAppInstances[t].instances))n!=i&&o.window.postMessage(r,"*")}_raiseEventForSpecificUserAppInstance(t,s,n,r=null){let i=this._userAppInstances[t];if(i&&i.events&&i.events[s]){let o=Ot("EvEvent",s,n);this._sendPostMessageToUsrAppInstancesComponents(t,o,r)}}raiseEvent(t,s){for(const[n,r]of Object.entries(this._userAppInstances))this._raiseEventForSpecificUserAppInstance(n,t,s)}getAppSettingsForAppInstanceId(t){return os.getUserAppInstanceById(t)}_makeSureAppInstanceExist(t){this._userAppInstances[t]=this._userAppInstances[t]||{},this._userAppInstances[t].instances=this._userAppInstances[t].instances||{},this._userAppInstances[t].events=this._userAppInstances[t].events||{}}updateAndNotifyAppInstancesOnSettingsUpdate(t,s,n){if(os.updateUserAppInstanceSettings(t,s),this._userAppInstances[t]&&this._userAppInstances[t].events[Le.settingsUpdated]){let r=Ot("EvEvent",Le.settingsUpdated,s);this._sendPostMessageToUsrAppInstancesComponents(t,r,n)}}updateAppsAboutStudioParams(t){let s=Ot("EvEvent",Le.studioParamsUpdated,t);Object.keys(this._userAppInstances).forEach(n=>{this._userAppInstances[n].events[Le.studioParamsUpdated]&&this._sendPostMessageToUsrAppInstancesComponents(n,s,null)})}signalApp(t,s){let n=this._userAppInstances[t];if(n&&n.events[Le.signalingEvent]){let r=Ot("EvEvent",Le.signalingEvent,s);this._sendPostMessageToUsrAppInstancesComponents(t,r,null)}}async onPostMessage(t){let s={};try{typeof t.data=="string"||t.data instanceof String?s=JSON.parse(t.data):s=t.data}catch{}let n=null;if(s.request==J.updateSettings)this._userAppInstances[s.userAppInstanceId]&&this.updateSettingsAndPublish(s);else if(s.request==J.raiseAppMessagingEvent)this._userAppInstances[s.userAppInstanceId]&&(this._raiseEventForSpecificUserAppInstance(s.userAppInstanceId,Le.appMessaging,s.data,s.componentId),this._eventHandler.publish("updateEverywhere",s));else if(s.request==J.getSettings)this._userAppInstances[s.userAppInstanceId]&&(Ot("EvMessage","settings",s.data),n=(await os.getUserAppInstanceById(s.userAppInstanceId,!1)).settings);else if(s.request==J.startLoad)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].instances[s.componentId]={window:t.source};else if(s.request==J.loaded)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].instances[s.componentId]={window:t.source},this._eventHandler.publish("appComponentLoaded",s),n=this.getAppSettingsForAppInstanceId(s.userAppInstanceId);else if(s.request==J.registerEvent)this._makeSureAppInstanceExist(s.userAppInstanceId),this._userAppInstances[s.userAppInstanceId].events[s.data.eventName]=!0;else if(s.request==J.unregisterEvent)this._makeSureAppInstanceExist(s.userAppInstanceId),delete this._userAppInstances[s.userAppInstanceId].events[s.data.eventName];else for(let r=0;r<this._requestHandlers.length;r++)if(this._requestHandlers[r].canHandleRequest(s)){n=await this._requestHandlers[r].handleRequest(s);break}s.promisedBased&&ic.respondForPromiseBasedRequest(s,t.source,t.origin,n)}updateSettingsAndPublish(t){this._eventHandler.publish("updateSettings",t),this._eventHandler.publish("updateEverywhere",t),this.updateAndNotifyAppInstancesOnSettingsUpdate(t.userAppInstanceId,t.data,t.componentId)}onUserAppComponentUnload(t,s){this._userAppInstances[t]&&this._userAppInstances[t].instances[s]&&(delete this._userAppInstances[t].instances[s],Object.keys(this._userAppInstances[t].instances).length==0&&delete this._userAppInstances[t])}}const Ys=new pc,lr=["This song gives me major nostalgic vibes!","Who else is here after watching the movie? Amazing!","Can't believe this video only has a few views. It deserves millions!","This is the most talented guitarist I've ever seen. Mind-blowing!","I keep coming back to this video. It's just so addictive!","I wish I could sing like this. Beautiful voice!","The cinematography in this video is top-notch. So visually stunning!","This dance routine is fire! I need to learn these moves.","Who else is watching this in 2023? Timeless classic!","This tutorial is a lifesaver. Thank you so much!","I can't stop laughing! This video is pure comedy gold.","This track has been on repeat all day. Can't get enough!","I'm so impressed by the production quality. Well done!","This deserves to be the soundtrack of a blockbuster movie.","This video is so underrated. It deserves way more recognition.","This singer has such a unique and soulful voice. Goosebumps!","I've watched this video at least 20 times. It never gets old!","This is the kind of content I subscribe for. Keep it up!","I've been waiting for this collab. They did not disappoint!","This video is so informative. I've learned a lot. Thanks!","Can't believe I discovered this hidden gem. Pure talent!","The energy in this live performance is off the charts!","This video is so heartwarming. It made my day!","The lyrics of this song hit me right in the feels. Emotional!","I can't stop watching this. It's so satisfying to see.","This tutorial is so easy to follow. I finally mastered it!","This is the best cover I've ever heard. Absolutely amazing!","The special effects in this video are mind-blowing. Wow!","This artist is so underrated. They deserve more recognition.","I can't get this song out of my head. It's so catchy!","I'm in awe of the talent displayed in this video. Mesmerizing!","This video is pure art. The visuals are stunning!","This song is my anthem. It speaks to my soul.","I love how positive and uplifting this video is. Great message!","This tutorial saved my life. I was completely lost before!","The choreography in this dance video is out of this world!","This video brings back so many childhood memories. Nostalgic!","I can't believe how young this artist is. Such talent at a young age!","This video deserves all the awards. Brilliant work!","I can't help but smile while watching this video. Pure joy!","This song is so underrated. It needs to go viral!","The editing in this video is on point. So professionally done!","This video inspired me to chase my dreams. Thank you!","The guitar solo in this song gives me goosebumps. Epic!","This video deserves to be trending. Let's make it happen!","I can't get over how beautiful this scenery is. Breathtaking!","This song is my go-to when I need a pick-me-up. Love it!","This video is so relatable. Hits close to home.","I've been following this channel for years. Always amazing content!","This video is the definition of perfection. Flawless execution!"],cr=["TheVloggingGuru","MusicMastermind","TechWizard","GamingProphet","TravelEnthusiast","FoodieExplorer","FashionDiva","ComedyJester","FitnessFreak","ArtisticSoul","MovieBuff","DIYEnthusiast","ScienceGeek","NatureLover","Bookworm","SportsFanatic","PetLover","AdventureSeeker","CookingMaestro","Fashionista","GuitarHero","ComedyGenius","YogaMaster","TechJunkie","PhotographyWhiz","AnimalAdventurer","SingingSensation","GameChanger","FitnessGuru","CreativeMind","MovieCritique","DIYWizard","ScienceExplorer","OutdoorEnthusiast","LiteraryLion","SportsEnthusiast","PetWhisperer","WanderlustSoul","MusicProdigy","TechEnthusiast","CulinaryArtist","FashionIcon","GamingLegend","ComedyMaestro","YogaEnthusiast","TechGuru","PhotographyNinja","AnimalLover","SingingSuperstar","GameMaster","FitnessAddict"];function gc(){return[{id:(Math.random()+1).toString(36).substring(2),title:cr[Math.floor(Math.random()*cr.length)],text:lr[Math.floor(Math.random()*lr.length)],pic:"https://evmuxstatic.s3-eu-west-1.amazonaws.com/AVATAR_EXAMPLE_FREE.jpg",style:"comment",enabled:!0,created_time:new Date(Date.now()-1e3*60),sn:Math.random()>=.5?"fb":"yt",flags:{sample:!1,star:!1,shown:!1}}]}const mc=(e,t)=>{const s=e.__vccOpts||e;for(const[n,r]of t)s[n]=r;return s},An=e=>(To("data-v-f3e17de6"),e=e(),Mo(),e),vc={style:{display:"flex"}},_c={class:"panel"},yc=An(()=>pe("br",null,null,-1)),bc=An(()=>pe("div",{style:{width:"50px"}},null,-1)),wc={class:"panel"},Ec={class:"resizer grayone"},Ac=An(()=>pe("button",null,"sceneUpdated",-1)),xc={__name:"TestHolder",setup(e){Ys.init();let t=window.userAppInstanceId||"914155de-633a-476b-957a-6a7a9e01d6e9",s=window.componentId||"b893da10-5cec-4f11-876c-716addbad4ae",n=window.baseAppSettings||{};os.updateUserAppInstance(t,{id:t,settings:n});const r=us(null),i=us(null);ni(()=>{r.value.src=`widget.html?appInstanceId=${t}&compId=${s}`,i.value.src=`settings.html?appInstanceId=${t}&compId=settings_${s}`});function o(u){Ys.raiseEvent(Le.comments,gc())}return(u,l)=>(ml(),yl("div",null,[pe("div",vc,[pe("div",_c,[qt(" Settings (src/settings.html):"),yc,pe("iframe",{ref_key:"settingsIframe",ref:i,width:"500",height:"500"},null,512)]),bc,pe("div",wc,[qt(" App (src/widget.html): "),pe("div",Ec,[pe("iframe",{ref_key:"wudgetIframe",ref:r,width:"100%",height:"100%"},null,512)])])]),pe("div",null,[qt(" events: "),Ac,qt(),pe("button",{onClick:o},"getComments")])]))}},Ic=mc(xc,[["__scopeId","data-v-f3e17de6"]]);/*!
|
|
6
6
|
* vue-router v4.2.5
|
|
7
7
|
* (c) 2023 Eduardo San Martin Morote
|
|
8
8
|
* @license MIT
|