@myop/vue 0.0.30 → 0.0.32

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.
@@ -1,17 +1,17 @@
1
- (function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@myop/sdk/host"),require("@myop/sdk/helpers")):typeof define=="function"&&define.amd?define(["exports","vue","@myop/sdk/host","@myop/sdk/helpers"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d["@myop/vue"]={},d.Vue,d.host,d.helpers))})(this,(function(d,i,V,P){"use strict";const Ke=["innerHTML"],ye=i.defineComponent({__name:"MyopLoader",props:{opacity:{default:1},fadeDuration:{default:200}},setup(e){const t=e,n=i.useSlots(),o=a=>!a||a.length===0?!1:a.some(u=>typeof u.children=="string"?u.children.trim()!=="":Array.isArray(u.children)?o(u.children):!!(u.type&&typeof u.type!="symbol"||u.children)),s=i.computed(()=>{const a=n.default;if(!a)return!1;const u=a();return o(u)}),r=i.computed(()=>({...V.containerStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),l=i.computed(()=>({...V.loaderStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),c=V.getMyopLogoHtml();return(a,u)=>s.value?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(r.value)},[i.renderSlot(a.$slots,"default")],4)):(i.openBlock(),i.createElementBlock("div",{key:1,style:i.normalizeStyle(l.value),innerHTML:i.unref(c)},null,12,Ke))}}),Ye=["innerHTML"],ge=i.defineComponent({__name:"MyopFallback",setup(e){const t=i.useSlots(),n=c=>!c||c.length===0?!1:c.some(a=>typeof a.children=="string"?a.children.trim()!=="":Array.isArray(a.children)?n(a.children):!!(a.type&&typeof a.type!="symbol"||a.children)),o=i.computed(()=>{const c=t.default;if(!c)return!1;const a=c();return n(a)}),s={position:"absolute",top:"0",left:"0",right:"0",bottom:"0"},r={...V.fallbackStyleObject},l=V.getMyopLogoHtml();return(c,a)=>o.value?(i.openBlock(),i.createElementBlock("div",{key:0,style:s},[i.renderSlot(c.$slots,"default")])):(i.openBlock(),i.createElementBlock("div",{key:1,style:r,innerHTML:i.unref(l)},null,8,Ye))}}),Ge=i.defineComponent({name:"MyopComponent",__name:"MyopComponent",props:{componentId:{},componentConfig:{},data:{},fadeDuration:{default:200},autoSize:{type:Boolean,default:!0},environment:{},preview:{type:Boolean},on:{}},emits:["load","error","sizeChange","cta"],setup(e,{expose:t,emit:n}){const o=i.useSlots(),s=f=>!f||f.length===0?!1:f.some(p=>typeof p.children=="string"?p.children.trim()!=="":Array.isArray(p.children)?s(p.children):!!(p.type&&typeof p.type!="symbol"||p.children)),r=i.computed(()=>{const f=o.loader;if(!f)return!1;const p=f();return s(p)});i.computed(()=>{const f=o.fallback;if(!f)return!1;const p=f();return s(p)});const l=e,c=n,a=i.ref(null),u=i.shallowRef(null),m=l.componentId?Le(l.componentId):!1,g=i.ref(!m),R=i.ref(1),k=i.ref(!1),D=i.ref(!1),F=i.ref(void 0),ve=i.ref({fillWidth:!1,fillHeight:!1}),pe=i.ref(!1),G=i.ref(null);let A=null;const de=()=>{R.value=0,setTimeout(()=>{g.value=!1},l.fadeDuration)},me=f=>{console.error("[MyopComponent] Error:",f),de(),k.value=!0,c("error",f)},he=async f=>{var O,X,Ue;pe.value=!0;let p=!1;try{const y=JSON.parse(JSON.stringify({componentId:f.componentId,data:f.data,environment:f.environment,preview:f.preview,autoSize:f.autoSize}));if(!y.componentId&&!f.componentConfig){me("No component configuration provided");return}const Zt=y.preview===!0?!0:void 0,en=f.componentConfig?JSON.parse(JSON.stringify(f.componentConfig)):await Pe().fetchComponentV2(y.componentId,y.environment,Zt);if(!a.value){me("Container element not found");return}const tn=i.markRaw({data:y.data,_environment:{props:y}}),Be=await V.hostSDK.loadComponent(en,a.value,tn);if(p){Be.dispose();return}if(u.value=i.markRaw(Be),await u.value.initiated(),p){(O=u.value)==null||O.dispose();return}if(await new Promise(Z=>requestAnimationFrame(Z)),p||!u.value||u.value.markedForDisposed){u.value&&!u.value.markedForDisposed&&u.value.dispose();return}D.value=!0;const H=(X=u.value)==null?void 0:X.sizeMeta,Je=(H==null?void 0:H.width)==="100%",We=(H==null?void 0:H.height)==="100%";ve.value={fillWidth:Je,fillHeight:We},(!(l.autoSize??!0)||Je&&We)&&de(),(Ue=u.value)!=null&&Ue.props&&(u.value.props.myop_cta_handler=(Z,qe)=>{l.on&&l.on(Z,qe),c("cta",Z,qe)}),c("load",u.value)}catch(y){p||me((y==null?void 0:y.message)||"Unknown error")}finally{if(pe.value=!1,G.value!==null&&!p){const y=G.value;G.value=null,await he(y)}}return()=>{p=!0}},Gt=()=>{var p;if(!D.value||!((p=u.value)!=null&&p.observeAutoSize))return;let f=!0;A=u.value.observeAutoSize({explicitWidth:void 0,explicitHeight:void 0,forceAutoSize:l.autoSize??!0,loaderMinHeight:50,onSizeChange:O=>{c("sizeChange",O),F.value=O,f&&(f=!1,de())}})};i.watch(()=>l.componentId,async(f,p)=>{f!==p&&(D.value=!1,k.value=!1,g.value=!0,R.value=1,u.value&&(u.value.dispose(),u.value=null),A&&(A(),A=null),pe.value?G.value={...l}:await he(l))}),i.watch(()=>l.data,f=>{var p;if(D.value&&f!==void 0&&u.value){const O=(p=u.value.props)==null?void 0:p.myop_init_interface;if(O){const X=JSON.parse(JSON.stringify(f));O(X)}}},{deep:!0}),i.watch(()=>D.value,f=>{f&&Gt()}),i.onMounted(async()=>{(l.componentId||l.componentConfig)&&await he(l)}),i.onUnmounted(()=>{A&&A(),u.value&&u.value.dispose()});const Q=i.computed(()=>g.value?50:void 0),je=i.computed(()=>!(l.autoSize??!0)||!D.value||ve.value.fillHeight),Qt=i.computed(()=>{var f,p;return je.value?{position:"relative",width:"100%",height:"100%",minHeight:Q.value?`${Q.value}px`:void 0}:{position:"relative",width:(f=F.value)!=null&&f.autoSizingWidth?`${F.value.width}px`:"100%",height:(p=F.value)!=null&&p.height?`${F.value.height}px`:void 0,minHeight:Q.value?`${Q.value}px`:void 0}}),Xt=i.computed(()=>{var f;return je.value?{position:"absolute",inset:"0"}:{width:"100%",height:(f=F.value)!=null&&f.height?`${F.value.height}px`:void 0}});return t({myopComponent:u,isLoaded:D}),(f,p)=>(i.openBlock(),i.createElementBlock("div",{style:i.normalizeStyle(Qt.value)},[i.createElementVNode("div",{ref_key:"myopContainer",ref:a,style:i.normalizeStyle(Xt.value)},null,4),g.value&&r.value?(i.openBlock(),i.createBlock(ye,{key:0,opacity:R.value,"fade-duration":e.fadeDuration},{default:i.withCtx(()=>[i.renderSlot(f.$slots,"loader")]),_:3},8,["opacity","fade-duration"])):i.createCommentVNode("",!0),k.value?(i.openBlock(),i.createBlock(ge,{key:1},{default:i.withCtx(()=>[i.renderSlot(f.$slots,"fallback")]),_:3})):i.createCommentVNode("",!0)],4))}});/**
1
+ (function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@myop/sdk/host"),require("@myop/sdk/helpers")):typeof define=="function"&&define.amd?define(["exports","vue","@myop/sdk/host","@myop/sdk/helpers"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d["@myop/vue"]={},d.Vue,d.host,d.helpers))})(this,(function(d,s,V,g){"use strict";const Je=["innerHTML"],he=s.defineComponent({__name:"MyopLoader",props:{opacity:{default:1},fadeDuration:{default:200}},setup(e){const t=e,n=s.useSlots(),o=a=>!a||a.length===0?!1:a.some(u=>typeof u.children=="string"?u.children.trim()!=="":Array.isArray(u.children)?o(u.children):!!(u.type&&typeof u.type!="symbol"||u.children)),i=s.computed(()=>{const a=n.default;if(!a)return!1;const u=a();return o(u)}),r=s.computed(()=>({...V.containerStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),l=s.computed(()=>({...V.loaderStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),c=V.getMyopLogoHtml();return(a,u)=>i.value?(s.openBlock(),s.createElementBlock("div",{key:0,style:s.normalizeStyle(r.value)},[s.renderSlot(a.$slots,"default")],4)):(s.openBlock(),s.createElementBlock("div",{key:1,style:s.normalizeStyle(l.value),innerHTML:s.unref(c)},null,12,Je))}}),We=["innerHTML"],ye=s.defineComponent({__name:"MyopFallback",setup(e){const t=s.useSlots(),n=c=>!c||c.length===0?!1:c.some(a=>typeof a.children=="string"?a.children.trim()!=="":Array.isArray(a.children)?n(a.children):!!(a.type&&typeof a.type!="symbol"||a.children)),o=s.computed(()=>{const c=t.default;if(!c)return!1;const a=c();return n(a)}),i={position:"absolute",top:"0",left:"0",right:"0",bottom:"0"},r={...V.fallbackStyleObject},l=V.getMyopLogoHtml();return(c,a)=>o.value?(s.openBlock(),s.createElementBlock("div",{key:0,style:i},[s.renderSlot(c.$slots,"default")])):(s.openBlock(),s.createElementBlock("div",{key:1,style:r,innerHTML:s.unref(l)},null,8,We))}}),qe=s.defineComponent({name:"MyopComponent",__name:"MyopComponent",props:{componentId:{},componentConfig:{},data:{},fadeDuration:{default:200},autoSize:{type:Boolean,default:!0},environment:{},preview:{type:Boolean},on:{}},emits:["load","error","sizeChange","cta"],setup(e,{expose:t,emit:n}){const o=s.useSlots(),i=f=>!f||f.length===0?!1:f.some(p=>typeof p.children=="string"?p.children.trim()!=="":Array.isArray(p.children)?i(p.children):!!(p.type&&typeof p.type!="symbol"||p.children)),r=s.computed(()=>{const f=o.loader;if(!f)return!1;const p=f();return i(p)});s.computed(()=>{const f=o.fallback;if(!f)return!1;const p=f();return i(p)});const l=e,c=n,a=s.ref(null),u=s.shallowRef(null),m=l.componentId?g.isPreloaded(l.componentId):!1,_=s.ref(!m),D=s.ref(1),w=s.ref(!1),R=s.ref(!1),F=s.ref(void 0),ze=s.ref({fillWidth:!1,fillHeight:!1}),fe=s.ref(!1),Y=s.ref(null);let A=null;const pe=()=>{D.value=0,setTimeout(()=>{_.value=!1},l.fadeDuration)},de=f=>{console.error("[MyopComponent] Error:",f),pe(),w.value=!0,c("error",f)},me=async f=>{var O,Q,je;fe.value=!0;let p=!1;try{const y=JSON.parse(JSON.stringify({componentId:f.componentId,data:f.data,environment:f.environment,preview:f.preview,autoSize:f.autoSize}));if(!y.componentId&&!f.componentConfig){de("No component configuration provided");return}const Bt=y.preview===!0?!0:void 0,Jt=f.componentConfig?JSON.parse(JSON.stringify(f.componentConfig)):await g.getCloudRepository().fetchComponentV2(y.componentId,y.environment,Bt);if(!a.value){de("Container element not found");return}const Wt=s.markRaw({data:y.data,_environment:{props:y}}),Le=await V.hostSDK.loadComponent(Jt,a.value,Wt);if(p){Le.dispose();return}if(u.value=s.markRaw(Le),await u.value.initiated(),p){(O=u.value)==null||O.dispose();return}if(await new Promise(X=>requestAnimationFrame(X)),p||!u.value||u.value.markedForDisposed){u.value&&!u.value.markedForDisposed&&u.value.dispose();return}R.value=!0;const H=(Q=u.value)==null?void 0:Q.sizeMeta,ve=(H==null?void 0:H.width)==="100%",Ue=(H==null?void 0:H.height)==="100%";ze.value={fillWidth:ve,fillHeight:Ue},(!(l.autoSize??!0)||ve&&Ue)&&pe(),(je=u.value)!=null&&je.props&&(u.value.props.myop_cta_handler=(X,Be)=>{l.on&&l.on(X,Be),c("cta",X,Be)}),c("load",u.value)}catch(y){p||de((y==null?void 0:y.message)||"Unknown error")}finally{if(fe.value=!1,Y.value!==null&&!p){const y=Y.value;Y.value=null,await me(y)}}return()=>{p=!0}},Lt=()=>{var p;if(!R.value||!((p=u.value)!=null&&p.observeAutoSize))return;let f=!0;A=u.value.observeAutoSize({explicitWidth:void 0,explicitHeight:void 0,forceAutoSize:l.autoSize??!0,loaderMinHeight:50,onSizeChange:O=>{c("sizeChange",O),F.value=O,f&&(f=!1,pe())}})};s.watch(()=>l.componentId,async(f,p)=>{f!==p&&(R.value=!1,w.value=!1,_.value=!0,D.value=1,u.value&&(u.value.dispose(),u.value=null),A&&(A(),A=null),fe.value?Y.value={...l}:await me(l))}),s.watch(()=>l.data,f=>{var p;if(R.value&&f!==void 0&&u.value){const O=(p=u.value.props)==null?void 0:p.myop_init_interface;if(O){const Q=JSON.parse(JSON.stringify(f));O(Q)}}},{deep:!0}),s.watch(()=>R.value,f=>{f&&Lt()}),s.onMounted(async()=>{(l.componentId||l.componentConfig)&&await me(l)}),s.onUnmounted(()=>{A&&A(),u.value&&u.value.dispose()});const G=s.computed(()=>_.value?50:void 0),xe=s.computed(()=>!(l.autoSize??!0)||!R.value||ze.value.fillHeight),vt=s.computed(()=>{var f,p;return xe.value?{position:"relative",width:"100%",height:"100%",minHeight:G.value?`${G.value}px`:void 0}:{position:"relative",width:(f=F.value)!=null&&f.autoSizingWidth?`${F.value.width}px`:"100%",height:(p=F.value)!=null&&p.height?`${F.value.height}px`:void 0,minHeight:G.value?`${G.value}px`:void 0}}),Ut=s.computed(()=>{var f;return xe.value?{position:"absolute",inset:"0"}:{width:"100%",height:(f=F.value)!=null&&f.height?`${F.value.height}px`:void 0}});return t({myopComponent:u,isLoaded:R}),(f,p)=>(s.openBlock(),s.createElementBlock("div",{style:s.normalizeStyle(vt.value)},[s.createElementVNode("div",{ref_key:"myopContainer",ref:a,style:s.normalizeStyle(Ut.value)},null,4),_.value&&r.value?(s.openBlock(),s.createBlock(he,{key:0,opacity:D.value,"fade-duration":e.fadeDuration},{default:s.withCtx(()=>[s.renderSlot(f.$slots,"loader")]),_:3},8,["opacity","fade-duration"])):s.createCommentVNode("",!0),w.value?(s.openBlock(),s.createBlock(ye,{key:1},{default:s.withCtx(()=>[s.renderSlot(f.$slots,"fallback")]),_:3})):s.createCommentVNode("",!0)],4))}});/**
2
2
  * @vue/shared v3.5.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/const Qe=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const _e=()=>{},Xe=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ee=Object.assign,_=Array.isArray,C=e=>typeof e=="function",S=e=>typeof e=="string",Ze=e=>typeof e=="symbol",z=e=>e!==null&&typeof e=="object",et=e=>(z(e)||C(e))&&C(e.then)&&C(e.catch),Ce=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},tt=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),nt=Ce(e=>e?`on${tt(e)}`:"");let Ee;const L=()=>Ee||(Ee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function te(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=S(o)?it(o):te(o);if(s)for(const r in s)t[r]=s[r]}return t}else if(S(e)||z(e))return e}const ot=/;(?![^(]*\))/g,rt=/:([^]+)/,st=/\/\*[^]*?\*\//g;function it(e){const t={};return e.replace(st,"").split(ot).forEach(n=>{if(n){const o=n.split(rt);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ne(e){let t="";if(S(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const o=ne(e[n]);o&&(t+=o+" ")}else if(z(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
5
+ **/const Ke=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const ge=()=>{},Ye=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Z=Object.assign,C=Array.isArray,b=e=>typeof e=="function",S=e=>typeof e=="string",Ge=e=>typeof e=="symbol",P=e=>e!==null&&typeof e=="object",Qe=e=>(P(e)||b(e))&&b(e.then)&&b(e.catch),_e=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Xe=_e(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ze=_e(e=>e?`on${Xe(e)}`:"");let Ce;const x=()=>Ce||(Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ee(e){if(C(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=S(o)?ot(o):ee(o);if(i)for(const r in i)t[r]=i[r]}return t}else if(S(e)||P(e))return e}const et=/;(?![^(]*\))/g,tt=/:([^]+)/,nt=/\/\*[^]*?\*\//g;function ot(e){const t={};return e.replace(nt,"").split(et).forEach(n=>{if(n){const o=n.split(tt);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function te(e){let t="";if(S(e))t=e;else if(C(e))for(let n=0;n<e.length;n++){const o=te(e[n]);o&&(t+=o+" ")}else if(P(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
6
6
  * @vue/reactivity v3.5.27
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ze));function oe(e){return e?!!e.__v_raw:!1}function v(e){const t=e&&e.__v_raw;return t?v(t):e}function Se(e){return e?e.__v_isRef===!0:!1}/**
9
+ **/process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ge));function ne(e){return e?!!e.__v_raw:!1}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function be(e){return e?e.__v_isRef===!0:!1}/**
10
10
  * @vue/runtime-core v3.5.27
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/const I=[];function lt(e){I.push(e)}function at(){I.pop()}let re=!1;function N(e,...t){if(re)return;re=!0;const n=I.length?I[I.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=ct();if(o)j(o,n,11,[e+t.map(r=>{var l,c;return(c=(l=r.toString)==null?void 0:l.call(r))!=null?c:JSON.stringify(r)}).join(""),n&&n.proxy,s.map(({vnode:r})=>`at <${ze(n,r.type)}>`).join(`
14
- `),s]);else{const r=[`[Vue warn]: ${e}`,...t];s.length&&r.push(`
15
- `,...ut(s)),console.warn(...r)}re=!1}function ct(){let e=I[I.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function ut(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
16
- `],...ft(n))}),t}function ft({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,s=` at <${ze(e.component,e.type,o)}`,r=">"+n;return e.props?[s,...pt(e.props),r]:[s+r]}function pt(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...Ne(o,e[o]))}),n.length>3&&t.push(" ..."),t}function Ne(e,t,n){return S(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Se(t)?(t=Ne(e,v(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):C(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=v(t),n?t:[`${e}=`,t])}const se={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function j(e,t,n,o){try{return o?e(...o):e()}catch(s){ie(s,t,n)}}function be(e,t,n,o){if(C(e)){const s=j(e,t,n,o);return s&&et(s)&&s.catch(r=>{ie(r,t,n)}),s}if(_(e)){const s=[];for(let r=0;r<e.length;r++)s.push(be(e[r],t,n,o));return s}else process.env.NODE_ENV!=="production"&&N(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function ie(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Qe;if(t){let c=t.parent;const a=t.proxy,u=process.env.NODE_ENV!=="production"?se[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const m=c.ec;if(m){for(let g=0;g<m.length;g++)if(m[g](e,a,u)===!1)return}c=c.parent}if(r){j(r,null,10,[e,a,u]);return}}dt(e,n,s,o,l)}function dt(e,t,n,o=!0,s=!1){if(process.env.NODE_ENV!=="production"){const r=se[t];if(n&&lt(n),N(`Unhandled error${r?` during execution of ${r}`:""}`),n&&at(),o)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const h=[];let E=-1;const T=[];let b=null,$=0;const mt=Promise.resolve();let le=null;const ht=100;function yt(e){let t=E+1,n=h.length;for(;t<n;){const o=t+n>>>1,s=h[o],r=x(s);r<e||r===e&&s.flags&2?t=o+1:n=o}return t}function gt(e){if(!(e.flags&1)){const t=x(e),n=h[h.length-1];!n||!(e.flags&2)&&t>=x(n)?h.push(e):h.splice(yt(t),0,e),e.flags|=1,we()}}function we(){le||(le=mt.then(ke))}function _t(e){_(e)?T.push(...e):b&&e.id===-1?b.splice($+1,0,e):e.flags&1||(T.push(e),e.flags|=1),we()}function Ct(e){if(T.length){const t=[...new Set(T)].sort((n,o)=>x(n)-x(o));if(T.length=0,b){b.push(...t);return}for(b=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),$=0;$<b.length;$++){const n=b[$];process.env.NODE_ENV!=="production"&&Oe(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}b=null,$=0}}const x=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ke(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>Oe(e,n):_e;try{for(E=0;E<h.length;E++){const n=h[E];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),j(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;E<h.length;E++){const n=h[E];n&&(n.flags&=-2)}E=-1,h.length=0,Ct(e),le=null,(h.length||T.length)&&ke(e)}}function Oe(e,t){const n=e.get(t)||0;if(n>ht){const o=t.i,s=o&&He(o.type);return ie(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const ae=new Map;process.env.NODE_ENV!=="production"&&(L().__VUE_HMR_RUNTIME__={createRecord:ce(Et),rerender:ce(St),reload:ce(Nt)});const U=new Map;function Et(e,t){return U.has(e)?!1:(U.set(e,{initialDef:B(t),instances:new Set}),!0)}function B(e){return xe(e)?e.__vccOpts:e}function St(e,t){const n=U.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,B(o.type).render=t),o.renderCache=[],o.job.flags&8||o.update()}))}function Nt(e,t){const n=U.get(e);if(!n)return;t=B(t),Ve(n.initialDef,t);const o=[...n.instances];for(let s=0;s<o.length;s++){const r=o[s],l=B(r.type);let c=ae.get(l);c||(l!==n.initialDef&&Ve(l,t),ae.set(l,c=new Set)),c.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(c.add(r),r.ceReload(t.styles),c.delete(r)):r.parent?gt(()=>{r.job.flags&8||(r.parent.update(),c.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(l)}_t(()=>{ae.clear()})}function Ve(e,t){ee(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function ce(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let M,J=[];function Ie(e,t){var n,o;M=e,M?(M.enabled=!0,J.forEach(({event:s,args:r})=>M.emit(s,...r)),J=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Ie(r,t)}),setTimeout(()=>{M||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,J=[])},3e3)):J=[]}let W=null,bt=null;const wt=e=>e.__isTeleport;function Re(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Re(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}L().requestIdleCallback,L().cancelIdleCallback;function kt(e,t,n=Y,o=!1){if(n){const s=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{const c=Lt(n),a=be(t,n,e,l);return c(),a});return o?s.unshift(r):s.push(r),r}else if(process.env.NODE_ENV!=="production"){const s=nt(se[e].replace(/ hook$/,""));N(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Ot=(e=>(t,n=Y)=>{(!Ae||e==="sp")&&kt(e,(...o)=>t(...o),n)})("u"),Vt=Symbol.for("v-ndc"),It={};process.env.NODE_ENV!=="production"&&(It.ownKeys=e=>(N("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const Rt={},De=e=>Object.getPrototypeOf(e)===Rt,Dt=e=>e.__isSuspense,Fe=Symbol.for("v-fgt"),Ft=Symbol.for("v-txt"),Tt=Symbol.for("v-cmt");function $t(e){return e?e.__v_isVNode===!0:!1}const Mt=(...e)=>$e(...e),Te=({key:e})=>e??null,q=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?S(e)||Se(e)||C(e)?{i:W,r:e,k:t,f:!!n}:e:null);function At(e,t=null,n=null,o=0,s=null,r=e===Fe?0:1,l=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Te(t),ref:t&&q(t),scopeId:bt,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:W};return c?(ue(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=S(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&N("VNode created with invalid key (NaN). VNode type:",a.type),a}const Ht=process.env.NODE_ENV!=="production"?Mt:$e;function $e(e,t=null,n=null,o=0,s=null,r=!1){if((!e||e===Vt)&&(process.env.NODE_ENV!=="production"&&!e&&N(`Invalid vnode type when creating vnode: ${e}.`),e=Tt),$t(e)){const c=K(e,t,!0);return n&&ue(c,n),c.patchFlag=-2,c}if(xe(e)&&(e=e.__vccOpts),t){t=zt(t);let{class:c,style:a}=t;c&&!S(c)&&(t.class=ne(c)),z(a)&&(oe(a)&&!_(a)&&(a=ee({},a)),t.style=te(a))}const l=S(e)?1:Dt(e)?128:wt(e)?64:z(e)?4:C(e)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&oe(e)&&(e=v(e),N("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
17
- Component that was made reactive: `,e)),At(e,t,n,o,s,l,r,!0)}function zt(e){return e?oe(e)||De(e)?ee({},e):e:null}function K(e,t,n=!1,o=!1){const{props:s,ref:r,patchFlag:l,children:c,transition:a}=e,u=t?Pt(s||{},t):s,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Te(u),ref:t&&t.ref?n&&r?_(r)?r.concat(q(t)):[r,q(t)]:q(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&_(c)?c.map(Me):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fe?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&K(e.ssContent),ssFallback:e.ssFallback&&K(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Re(m,a.clone(m)),m}function Me(e){const t=K(e);return _(e.children)&&(t.children=e.children.map(Me)),t}function xt(e=" ",t=0){return Ht(Ft,null,e,t)}function ue(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(_(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),ue(e,s()),s._c&&(s._d=!0));return}else n=32,!t._&&!De(t)&&(t._ctx=W);else C(t)?(t={default:t,_ctx:W},n=32):(t=String(t),o&64?(n=16,t=[xt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Pt(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=ne([t.class,o.class]));else if(s==="style")t.style=te([t.style,o.style]);else if(Xe(s)){const r=t[s],l=o[s];l&&r!==l&&!(_(r)&&r.includes(l))&&(t[s]=r?[].concat(r,l):l)}else s!==""&&(t[s]=o[s])}return t}let Y=null,fe;{const e=L(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),r=>{s.length>1?s.forEach(l=>l(r)):s[0](r)}};fe=t("__VUE_INSTANCE_SETTERS__",n=>Y=n),t("__VUE_SSR_SETTERS__",n=>Ae=n)}const Lt=e=>{const t=Y;return fe(e),e.scope.on(),()=>{e.scope.off(),fe(t)}};let Ae=!1;process.env.NODE_ENV;const vt=/(?:^|[-_])\w/g,jt=e=>e.replace(vt,t=>t.toUpperCase()).replace(/[-_]/g,"");function He(e,t=!0){return C(e)?e.displayName||e.name:e.name||t&&e.__name}function ze(e,t,n=!1){let o=He(t);if(!o&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(o=s[1])}if(!o&&e){const s=r=>{for(const l in r)if(r[l]===t)return l};o=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return o?jt(o):n?"App":"Anonymous"}function xe(e){return C(e)&&"__vccOpts"in e}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;const Ut=i.defineComponent({inheritAttrs:!0,__name:"MyopVueComponent",props:{flowId:{},componentId:{},onReady:{type:Function}},setup(e,{expose:t}){const n=e,o=i.useAttrs(),s=i.useSlots(),r=i.ref(null),l=i.ref(!0),c=i.ref(null),a=i.ref(null),u=i.getCurrentInstance(),m=i.ref(null);Ot(()=>{a&&a.value&&a.value(o)}),i.onMounted(async()=>{if(r.value){const R=await P.CloudRepository.Main.fetchComponent(n.componentId,n.flowId);c.value=await V.hostSDK.loadComponent(R,r==null?void 0:r.value,{_environment:{props:o,slots:s,context:u==null?void 0:u.appContext,vueContainerRef:r,defineUpdater:k=>{a.value=k},defineInnerVueComponentRef:k=>{m.value=k.value}}}),l.value=!1,n.onReady&&n.onReady(c.value,m.value)}});const g=i.reactive({});return t(g),i.watchEffect(()=>{Object.assign(g,m.value)}),(R,k)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps(i.unref(o),{ref_key:"myopContainer",ref:r}),null,16),l.value?i.renderSlot(R.$slots,"loading",{key:0}):i.createCommentVNode("",!0)],64))}});let w=P.CloudRepository.Main;const Pe=()=>w,Le=(e,t,n)=>w.isPreloaded(e,t,n),Bt=e=>w.getPreloadedParams(e),Jt=()=>{w=new P.CloudRepository("http://localhost:9292")},Wt=e=>{w=new P.CloudRepository(e)},qt=e=>{w=e},Kt=e=>{w.setEnvironment(e)},Yt=async(e,t,n)=>Promise.allSettled(e.map(o=>w.fetchComponentV2(o,t,n)));d.MyopComponent=Ge,d.MyopContainer=Ut,d.MyopFallback=ge,d.MyopLoader=ye,d.enableLocalDev=Jt,d.getCloudRepository=Pe,d.getPreloadedParams=Bt,d.isPreloaded=Le,d.preloadComponents=Yt,d.setCloudRepository=qt,d.setCloudRepositoryUrl=Wt,d.setEnvironment=Kt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
13
+ **/const I=[];function rt(e){I.push(e)}function it(){I.pop()}let oe=!1;function N(e,...t){if(oe)return;oe=!0;const n=I.length?I[I.length-1].component:null,o=n&&n.appContext.config.warnHandler,i=st();if(o)L(o,n,11,[e+t.map(r=>{var l,c;return(c=(l=r.toString)==null?void 0:l.call(r))!=null?c:JSON.stringify(r)}).join(""),n&&n.proxy,i.map(({vnode:r})=>`at <${He(n,r.type)}>`).join(`
14
+ `),i]);else{const r=[`[Vue warn]: ${e}`,...t];i.length&&r.push(`
15
+ `,...lt(i)),console.warn(...r)}oe=!1}function st(){let e=I[I.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function lt(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
16
+ `],...at(n))}),t}function at({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,i=` at <${He(e.component,e.type,o)}`,r=">"+n;return e.props?[i,...ct(e.props),r]:[i+r]}function ct(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...Ee(o,e[o]))}),n.length>3&&t.push(" ..."),t}function Ee(e,t,n){return S(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:be(t)?(t=Ee(e,j(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):b(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=j(t),n?t:[`${e}=`,t])}const re={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function L(e,t,n,o){try{return o?e(...o):e()}catch(i){ie(i,t,n)}}function Se(e,t,n,o){if(b(e)){const i=L(e,t,n,o);return i&&Qe(i)&&i.catch(r=>{ie(r,t,n)}),i}if(C(e)){const i=[];for(let r=0;r<e.length;r++)i.push(Se(e[r],t,n,o));return i}else process.env.NODE_ENV!=="production"&&N(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function ie(e,t,n,o=!0){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Ke;if(t){let c=t.parent;const a=t.proxy,u=process.env.NODE_ENV!=="production"?re[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const m=c.ec;if(m){for(let _=0;_<m.length;_++)if(m[_](e,a,u)===!1)return}c=c.parent}if(r){L(r,null,10,[e,a,u]);return}}ut(e,n,i,o,l)}function ut(e,t,n,o=!0,i=!1){if(process.env.NODE_ENV!=="production"){const r=re[t];if(n&&rt(n),N(`Unhandled error${r?` during execution of ${r}`:""}`),n&&it(),o)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const h=[];let E=-1;const T=[];let k=null,$=0;const ft=Promise.resolve();let se=null;const pt=100;function dt(e){let t=E+1,n=h.length;for(;t<n;){const o=t+n>>>1,i=h[o],r=z(i);r<e||r===e&&i.flags&2?t=o+1:n=o}return t}function mt(e){if(!(e.flags&1)){const t=z(e),n=h[h.length-1];!n||!(e.flags&2)&&t>=z(n)?h.push(e):h.splice(dt(t),0,e),e.flags|=1,Ne()}}function Ne(){se||(se=ft.then(ke))}function ht(e){C(e)?T.push(...e):k&&e.id===-1?k.splice($+1,0,e):e.flags&1||(T.push(e),e.flags|=1),Ne()}function yt(e){if(T.length){const t=[...new Set(T)].sort((n,o)=>z(n)-z(o));if(T.length=0,k){k.push(...t);return}for(k=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),$=0;$<k.length;$++){const n=k[$];process.env.NODE_ENV!=="production"&&we(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}k=null,$=0}}const z=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ke(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>we(e,n):ge;try{for(E=0;E<h.length;E++){const n=h[E];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),L(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;E<h.length;E++){const n=h[E];n&&(n.flags&=-2)}E=-1,h.length=0,yt(e),se=null,(h.length||T.length)&&ke(e)}}function we(e,t){const n=e.get(t)||0;if(n>pt){const o=t.i,i=o&&Ae(o.type);return ie(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const le=new Map;process.env.NODE_ENV!=="production"&&(x().__VUE_HMR_RUNTIME__={createRecord:ae(gt),rerender:ae(_t),reload:ae(Ct)});const v=new Map;function gt(e,t){return v.has(e)?!1:(v.set(e,{initialDef:U(t),instances:new Set}),!0)}function U(e){return Pe(e)?e.__vccOpts:e}function _t(e,t){const n=v.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,U(o.type).render=t),o.renderCache=[],o.job.flags&8||o.update()}))}function Ct(e,t){const n=v.get(e);if(!n)return;t=U(t),Oe(n.initialDef,t);const o=[...n.instances];for(let i=0;i<o.length;i++){const r=o[i],l=U(r.type);let c=le.get(l);c||(l!==n.initialDef&&Oe(l,t),le.set(l,c=new Set)),c.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(c.add(r),r.ceReload(t.styles),c.delete(r)):r.parent?mt(()=>{r.job.flags&8||(r.parent.update(),c.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(l)}ht(()=>{le.clear()})}function Oe(e,t){Z(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function ae(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let M,B=[];function Ve(e,t){var n,o;M=e,M?(M.enabled=!0,B.forEach(({event:i,args:r})=>M.emit(i,...r)),B=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Ve(r,t)}),setTimeout(()=>{M||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,B=[])},3e3)):B=[]}let J=null,bt=null;const Et=e=>e.__isTeleport;function Ie(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ie(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}x().requestIdleCallback,x().cancelIdleCallback;function St(e,t,n=K,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{const c=Pt(n),a=Se(t,n,e,l);return c(),a});return o?i.unshift(r):i.push(r),r}else if(process.env.NODE_ENV!=="production"){const i=Ze(re[e].replace(/ hook$/,""));N(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Nt=(e=>(t,n=K)=>{(!Me||e==="sp")&&St(e,(...o)=>t(...o),n)})("u"),kt=Symbol.for("v-ndc"),wt={};process.env.NODE_ENV!=="production"&&(wt.ownKeys=e=>(N("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const Ot={},De=e=>Object.getPrototypeOf(e)===Ot,Vt=e=>e.__isSuspense,Re=Symbol.for("v-fgt"),It=Symbol.for("v-txt"),Dt=Symbol.for("v-cmt");function Rt(e){return e?e.__v_isVNode===!0:!1}const Ft=(...e)=>Te(...e),Fe=({key:e})=>e??null,W=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?S(e)||be(e)||b(e)?{i:J,r:e,k:t,f:!!n}:e:null);function Tt(e,t=null,n=null,o=0,i=null,r=e===Re?0:1,l=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fe(t),ref:t&&W(t),scopeId:bt,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:J};return c?(ce(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=S(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&N("VNode created with invalid key (NaN). VNode type:",a.type),a}const $t=process.env.NODE_ENV!=="production"?Ft:Te;function Te(e,t=null,n=null,o=0,i=null,r=!1){if((!e||e===kt)&&(process.env.NODE_ENV!=="production"&&!e&&N(`Invalid vnode type when creating vnode: ${e}.`),e=Dt),Rt(e)){const c=q(e,t,!0);return n&&ce(c,n),c.patchFlag=-2,c}if(Pe(e)&&(e=e.__vccOpts),t){t=Mt(t);let{class:c,style:a}=t;c&&!S(c)&&(t.class=te(c)),P(a)&&(ne(a)&&!C(a)&&(a=Z({},a)),t.style=ee(a))}const l=S(e)?1:Vt(e)?128:Et(e)?64:P(e)?4:b(e)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&ne(e)&&(e=j(e),N("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
17
+ Component that was made reactive: `,e)),Tt(e,t,n,o,i,l,r,!0)}function Mt(e){return e?ne(e)||De(e)?Z({},e):e:null}function q(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:l,children:c,transition:a}=e,u=t?Ht(i||{},t):i,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Fe(u),ref:t&&t.ref?n&&r?C(r)?r.concat(W(t)):[r,W(t)]:W(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&C(c)?c.map($e):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&q(e.ssContent),ssFallback:e.ssFallback&&q(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Ie(m,a.clone(m)),m}function $e(e){const t=q(e);return C(e.children)&&(t.children=e.children.map($e)),t}function At(e=" ",t=0){return $t(It,null,e,t)}function ce(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(C(t))n=16;else if(typeof t=="object")if(o&65){const i=t.default;i&&(i._c&&(i._d=!1),ce(e,i()),i._c&&(i._d=!0));return}else n=32,!t._&&!De(t)&&(t._ctx=J);else b(t)?(t={default:t,_ctx:J},n=32):(t=String(t),o&64?(n=16,t=[At(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ht(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const i in o)if(i==="class")t.class!==o.class&&(t.class=te([t.class,o.class]));else if(i==="style")t.style=ee([t.style,o.style]);else if(Ye(i)){const r=t[i],l=o[i];l&&r!==l&&!(C(r)&&r.includes(l))&&(t[i]=r?[].concat(r,l):l)}else i!==""&&(t[i]=o[i])}return t}let K=null,ue;{const e=x(),t=(n,o)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(o),r=>{i.length>1?i.forEach(l=>l(r)):i[0](r)}};ue=t("__VUE_INSTANCE_SETTERS__",n=>K=n),t("__VUE_SSR_SETTERS__",n=>Me=n)}const Pt=e=>{const t=K;return ue(e),e.scope.on(),()=>{e.scope.off(),ue(t)}};let Me=!1;process.env.NODE_ENV;const zt=/(?:^|[-_])\w/g,xt=e=>e.replace(zt,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ae(e,t=!0){return b(e)?e.displayName||e.name:e.name||t&&e.__name}function He(e,t,n=!1){let o=Ae(t);if(!o&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(o=i[1])}if(!o&&e){const i=r=>{for(const l in r)if(r[l]===t)return l};o=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return o?xt(o):n?"App":"Anonymous"}function Pe(e){return b(e)&&"__vccOpts"in e}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;const jt=s.defineComponent({inheritAttrs:!0,__name:"MyopVueComponent",props:{flowId:{},componentId:{},onReady:{type:Function}},setup(e,{expose:t}){const n=e,o=s.useAttrs(),i=s.useSlots(),r=s.ref(null),l=s.ref(!0),c=s.ref(null),a=s.ref(null),u=s.getCurrentInstance(),m=s.ref(null);Nt(()=>{a&&a.value&&a.value(o)}),s.onMounted(async()=>{if(r.value){const D=await g.CloudRepository.Main.fetchComponent(n.componentId,n.flowId);c.value=await V.hostSDK.loadComponent(D,r==null?void 0:r.value,{_environment:{props:o,slots:i,context:u==null?void 0:u.appContext,vueContainerRef:r,defineUpdater:w=>{a.value=w},defineInnerVueComponentRef:w=>{m.value=w.value}}}),l.value=!1,n.onReady&&n.onReady(c.value,m.value)}});const _=s.reactive({});return t(_),s.watchEffect(()=>{Object.assign(_,m.value)}),(D,w)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",s.mergeProps(s.unref(o),{ref_key:"myopContainer",ref:r}),null,16),l.value?s.renderSlot(D.$slots,"loading",{key:0}):s.createCommentVNode("",!0)],64))}});Object.defineProperty(d,"enableLocalDev",{enumerable:!0,get:()=>g.enableLocalDev}),Object.defineProperty(d,"getCloudRepository",{enumerable:!0,get:()=>g.getCloudRepository}),Object.defineProperty(d,"getPreloadedParams",{enumerable:!0,get:()=>g.getPreloadedParams}),Object.defineProperty(d,"isPreloaded",{enumerable:!0,get:()=>g.isPreloaded}),Object.defineProperty(d,"preloadComponents",{enumerable:!0,get:()=>g.preloadComponents}),Object.defineProperty(d,"setCloudRepository",{enumerable:!0,get:()=>g.setCloudRepository}),Object.defineProperty(d,"setCloudRepositoryUrl",{enumerable:!0,get:()=>g.setCloudRepositoryUrl}),Object.defineProperty(d,"setEnvironment",{enumerable:!0,get:()=>g.setEnvironment}),d.MyopComponent=qe,d.MyopContainer=jt,d.MyopFallback=ye,d.MyopLoader=he,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myop/vue",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -21,6 +21,7 @@
21
21
  "scripts": {
22
22
  "dev": "vite",
23
23
  "build": "vite build && vue-tsc --emitDeclarationOnly",
24
+ "test": "vitest run",
24
25
  "preview": "vite preview",
25
26
  "release": "npm publish --access public"
26
27
  },
@@ -29,13 +30,14 @@
29
30
  "vue": "^3.5.13"
30
31
  },
31
32
  "devDependencies": {
32
- "@myop/sdk": "^0.3.18",
33
+ "@myop/sdk": "^0.3.19",
33
34
  "@types/node": "^22.14.0",
34
35
  "@vitejs/plugin-vue": "^5.2.1",
35
36
  "@vue/tsconfig": "^0.7.0",
36
37
  "prettier": "^3.5.3",
37
38
  "typescript": "~5.7.2",
38
39
  "vite": "^6.2.0",
40
+ "vitest": "^4.0.18",
39
41
  "vue-tsc": "^2.2.4"
40
42
  },
41
43
  "keywords": [