@myop/sdk 0.2.7 → 0.3.9
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/dist/bundled-declarations.d.ts +25 -0
- package/dist/cjs/{_IframeSDK.65146759.js → _IframeSDK.119c0f6d.js} +8 -2
- package/dist/cjs/{_IframeSDK.65146759.js.map → _IframeSDK.119c0f6d.js.map} +3 -3
- package/dist/cjs/_IframeSDK.2c0a1224.min.js +1 -0
- package/dist/cjs/_WebComponentSDK.04e0d474.min.js +1 -0
- package/dist/cjs/{_WebComponentSDK.4a661403.js → _WebComponentSDK.61164d48.js} +8 -2
- package/dist/cjs/{_WebComponentSDK.4a661403.js.map → _WebComponentSDK.61164d48.js.map} +3 -3
- package/dist/cjs/_hostSDK.6d93430d.min.js +1 -0
- package/dist/cjs/{_hostSDK.933cfab5.js → _hostSDK.d6305c86.js} +8 -2
- package/dist/cjs/{_hostSDK.933cfab5.js.map → _hostSDK.d6305c86.js.map} +3 -3
- package/dist/cjs/myop_sdk.js +11 -11
- package/dist/cjs/myop_sdk.js.map +1 -1
- package/dist/cjs/myop_sdk.min.js +1 -1
- package/dist/cjs-bundled/myop_sdk.bundled.js +16 -3
- package/dist/cjs-bundled/myop_sdk.bundled.js.map +3 -3
- package/dist/cjs-bundled/myop_sdk.bundled.min.js +1 -1
- package/dist/module/Iframe/index.js +17 -11
- package/dist/module/Iframe/index.js.map +2 -2
- package/dist/module/SDK.js +17 -11
- package/dist/module/SDK.js.map +2 -2
- package/dist/module/host/embeddedSDK.d.ts +23 -0
- package/dist/module/host/index.js +17 -11
- package/dist/module/host/index.js.map +2 -2
- package/dist/module/webcomponent/index.js +17 -11
- package/dist/module/webcomponent/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.43696632.min.js +0 -1
- package/dist/cjs/_WebComponentSDK.5d90b79c.min.js +0 -1
- package/dist/cjs/_hostSDK.98520a3d.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var MyopSDK=(()=>{var Pe=Object.defineProperty,rs=Object.defineProperties,is=Object.getOwnPropertyDescriptor,as=Object.getOwnPropertyDescriptors,ps=Object.getOwnPropertyNames,fn=Object.getOwnPropertySymbols;var gn=Object.prototype.hasOwnProperty,ds=Object.prototype.propertyIsEnumerable;var Ht=(o,t,e)=>t in o?Pe(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,h=(o,t)=>{for(var e in t||(t={}))gn.call(t,e)&&Ht(o,e,t[e]);if(fn)for(var e of fn(t))ds.call(t,e)&&Ht(o,e,t[e]);return o},U=(o,t)=>rs(o,as(t));var m=(o,t)=>()=>(o&&(t=o(o=0)),t);var Z=(o,t)=>{for(var e in t)Pe(o,e,{get:t[e],enumerable:!0})},cs=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ps(t))!gn.call(o,r)&&r!==e&&Pe(o,r,{get:()=>t[r],enumerable:!(n=is(t,r))||n.enumerable});return o};var ms=o=>cs(Pe({},"__esModule",{value:!0}),o);var s=(o,t,e)=>Ht(o,typeof t!="symbol"?t+"":t,e);var Ae,Ke,_t,K,ee=m(()=>{"use strict";Ae="__federation__",Ke="onLoad",_t="moduleInstance",K=(o,t)=>{window[Ae]&&window[Ae][o]&&window[Ae][o][Ke]&&window[Ae][o][Ke]({[o]:t})}});var le,ze=m(()=>{le="0.2.7"});var l,M=m(()=>{"use strict";l={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var T,ls,fs,Dt,Bt=m(()=>{"use strict";T=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),ls=o=>{let t=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")},fs=o=>{let t=o.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";let e=atob(t);return Uint8Array.from(e,n=>n.charCodeAt(0))},Dt=o=>{let t=fs(o);if(t.length%16!==0)throw new Error("Invalid input length");let e=[];for(let n=0;n<t.length;n+=16)e.push(ls(t.slice(n,n+16)));return e}});var yn,te=m(()=>{"use strict";Bt();yn=o=>new Promise(t=>setTimeout(t,o))});var R,I,Lt,v,k,j,H=m(()=>{"use strict";te();R=class{};s(R,"down","down"),s(R,"up","up");I=class{constructor(){s(this,"id",T());s(this,"myop",!0);s(this,"content");s(this,"source");s(this,"destination");s(this,"route");s(this,"ref");s(this,"direction");s(this,"cleanable",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Lt=class extends I{constructor(e){super();this.ref=e}},v=class extends I{constructor(e){super();this.replayToHandler=e}},k=class extends I{constructor(e){super();this.handler=e;s(this,"handlerUniqueId",T())}},j=class o{constructor(t,e){this.refConfig=t;this.component=e;s(this,"myop",!0);s(this,"__nonProxied");this.__nonProxied=U(h({},this),{component:null})}static create(t,e,n){let r=e;return r||(r={id:"",name:"",description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}}),new o(r,n)}}});var hn,Ot,ne,Mn=m(()=>{"use strict";H();hn="ClickReplayMessage",Ot=class extends k{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",hn);s(this,"messageType","BindClickMessage");s(this,"cleanable",!0)}},ne=class extends v{constructor(){super(...arguments);s(this,"messageType",hn)}}});var Pt,In=m(()=>{"use strict";H();Pt=class extends I{constructor(e,n){super();this.ref=e;s(this,"messageType","ChangeTextMessage");this.content=n}}});var Cn,gs,us,xn,_,oe,At=m(()=>{"use strict";H();Cn="ExecuteScriptReplyMessage",gs=/(?:function\s*\w*\s*\([^)]*\)\s*\{([\s\S]*?)\}|(\([^)]*\)\s*=>\s*\{([\s\S]*?)\}))\s*$/,us=/\(\s*[^)]+\s*\)\s*=>\s*(.+)/,xn=o=>{let t=o.match(gs);if(t)return t[1]||t[3];{let e=o.match(us);if(e)return e[1].trim()}},_=class extends k{constructor(e,n=()=>{},r){super(n);this.scriptInputs=r;s(this,"replyMessageKey",Cn);s(this,"messageType","ExecuteScriptMessage");s(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=xn(this.content)}};s(_,"replierKey","send"),s(_,"completeStreamKey","completeStream");oe=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.content=n;s(this,"messageType",Cn)}}});var W,bn=m(()=>{"use strict";At();W=class extends _{constructor(e,n,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},r);this.scriptInputs=n;this.scriptInputs=U(h({},n),{_script:e.toString()})}}});var wn,Kt,se,Sn=m(()=>{"use strict";H();wn="EventListenerCallbackMessage",Kt=class extends k{constructor(e,n,r){super(r);this.ref=e;this.type=n;this.handler=r;s(this,"replyMessageKey",wn);s(this,"messageType","AddEventListenerMessage");s(this,"cleanable",!0);s(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},se=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.e=n;s(this,"messageType",wn);this.content={e:n}}}});var zt,Tn=m(()=>{"use strict";H();zt=class extends I{constructor(e,n,r){super();this.ref=e;this.name=n;this.value=r;s(this,"messageType","SetAttributeMessage")}}});var En,Ft,re,$t=m(()=>{"use strict";H();En="ElementValueReplayMessage",Ft=class extends k{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",En);s(this,"messageType","GetElementValueMessage")}},re=class extends v{constructor(e){super();this.content=e;s(this,"messageType",En)}}});var Ut,Rn=m(()=>{"use strict";H();Ut=class extends I{constructor(e,n){super();this.ref=e;s(this,"messageType","SetInnerHtml");this.content=n}}});var fe,Se,ie,vn=m(()=>{"use strict";H();fe=class extends I{constructor(e){super();s(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Se=class extends fe{constructor(){super(...arguments);s(this,"messageType","InitResponse")}},ie=class extends I{constructor(){super(...arguments);s(this,"messageType","InitRequest")}}});var kn,Te,N,Fe=m(()=>{"use strict";H();kn="RefComponentCreatedMessage",Te=class extends k{constructor(e,n,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=n;this.options=r;s(this,"replyMessageKey",kn);s(this,"messageType","CreateRefComponentMessage")}},N=class extends v{constructor(e,n,r){super(e);this.replayToHandler=e;this.nestedRefs=n;this.failed=r;s(this,"messageType",kn)}}});var Ee,Wt=m(()=>{"use strict";H();Ee=class extends I{constructor(e,n){super();this.destination=e;this.message=n;s(this,"messageType","EnvelopedMessage");let r=n;this.route=[e,...r.route?r.route:[]]}}});var Hn,Nt,ae,_n=m(()=>{"use strict";H();Hn="DetectedMyopRefsMessage",Nt=class extends k{constructor(){super(...arguments);s(this,"messageType","DetectMyopRefsMessage");s(this,"replyMessageKey",Hn)}},ae=class extends v{constructor(e,n){super(e);this.replayToHandler=e;s(this,"messageType",Hn);this.content=n}isTypeof(e){return e.messageType===this.messageType}}});var Dn,Vt,Re,Bn=m(()=>{"use strict";H();Dn="GetAttributeReplayMessage",Vt=class extends k{constructor(e,n,r){super(r);this.ref=e;this.name=n;s(this,"replyMessageKey",Dn);s(this,"messageType","GetAttributeMessage")}},Re=class extends v{constructor(e){super();this.content=e;s(this,"messageType",Dn)}}});var P,Ln=m(()=>{"use strict";H();P=class extends I{constructor(e){super();this.method=e;s(this,"messageType","ExecuteComponentMethod")}}});var qt,ve,On=m(()=>{"use strict";H();qt=class extends I{constructor(){super(...arguments);s(this,"messageType","SetMutationObserverMessage")}},ve=class extends I{constructor(){super(...arguments);s(this,"messageType","MutationObserverMessage")}}});var Pn,ke,He,An=m(()=>{"use strict";H();Pn="CleanupReplayMessage",ke=class extends k{constructor(e,n){super(n);this.cleanupForMessageId=e;s(this,"replyMessageKey",Pn);s(this,"messageType","CleanupMessage")}},He=class extends v{constructor(e){super();this.customCleanup=e;s(this,"messageType",Pn)}}});var _e,Kn=m(()=>{"use strict";H();_e=class extends I{constructor(){super(...arguments);s(this,"messageType","DisposeMessage")}}});var jt,De,zn=m(()=>{"use strict";H();jt=class extends I{constructor(){super(...arguments);s(this,"cleanable",!0);s(this,"messageType","SetResizeObserverMessage")}},De=class extends I{constructor(){super(...arguments);s(this,"messageType","ResizeObserverMessage")}}});var ge={};Z(ge,{AddEventListenerMessage:()=>Kt,BaseMyopMessage:()=>I,BindClickMessage:()=>Ot,ChangeTextMessage:()=>Pt,CleanupMessage:()=>ke,CleanupReplayMessage:()=>He,ClickReplayMessage:()=>ne,CreateRefComponentMessage:()=>Te,CustomRefMessage:()=>W,DetectMyopRefsMessage:()=>Nt,DetectedMyopRefsMessage:()=>ae,DisposeMessage:()=>_e,ElementValueReplayMessage:()=>re,EnvelopedMessage:()=>Ee,EventListenerCallbackMessage:()=>se,ExecuteComponentMethod:()=>P,ExecuteScriptMessage:()=>_,ExecuteScriptReplyMessage:()=>oe,GetAttributeMessage:()=>Vt,GetAttributeReplayMessage:()=>Re,GetElementValueMessage:()=>Ft,InitMessage:()=>fe,InitRequest:()=>ie,InitResponse:()=>Se,MessageDirection:()=>R,MutationObserverMessage:()=>ve,MyopBindMessage:()=>k,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Lt,Ref:()=>j,RefComponentCreatedMessage:()=>N,ResizeObserverMessage:()=>De,SetAttributeMessage:()=>zt,SetInnerHtml:()=>Ut,SetMutationObserverMessage:()=>qt,SetResizeObserverMessage:()=>jt,stripFunction:()=>xn});var x=m(()=>{"use strict";H();Mn();In();At();bn();Sn();Tn();$t();Rn();vn();Fe();Wt();_n();$t();Bn();Ln();On();An();Kn();zn()});var G,$e=m(()=>{"use strict";M();x();Be();G=class{constructor(t,e,n){this.componentDefinition=t;this.container=e;s(this,"id","");s(this,"messageHandlers",{});s(this,"element");s(this,"_markedForDisposed",!1);s(this,"bind",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,"bindWhen",(t,e,n)=>{if(!n)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(n(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,"isInitiated",!1);s(this,"_whenInitiatedResolve");s(this,"_whenInitiatedReject");s(this,"_whenInitiated",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,"initiated",()=>this._whenInitiated);s(this,"props",{});s(this,"refs",{});this.id=(n==null?void 0:n.id)||A.Instance().assignId(t);let r=n!=null&&n.timeout?n==null?void 0:n.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(r," ").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){if(this._markedForDisposed)throw new Error("InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.");this._markedForDisposed=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let n=t;return this[n.method]?this[n.method](n.content):console.log("method not found ".concat(n.method," on component"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let n=!1;return e.forEach(r=>{n=n||r(t)}),n}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),n=t.handler;delete t.handler,this.send(t),t.handler=n}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let n=t;e=this.bindWhen(n.replyMessageKey,r=>r.replayToHandler===n.handlerUniqueId,n.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new ke(t.id,n=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new _e);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var ue,Fn=m(()=>{"use strict";ue=class{constructor(t,e,n,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=n;this.offsetTop=r;this.offsetLeft=i;s(this,"type","MyopElementRef")}}});var $n,C,Ue,Un=m(()=>{"use strict";$n=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let t=await o;typeof t=="function"&&t()}},C=class{constructor(t){this.messageToHost=t}},Ue=class extends C{constructor(e,n){super(e);this.messageToHost=e;this.context=n}}});var Gt,ye,Wn=m(()=>{"use strict";M();b();x();Gt=class{constructor(t,e){this.id=t;this.context=e;s(this,"send",t=>{})}},ye=class{constructor(){s(this,"messageToHandleAfterInit",[]);s(this,"components",{});s(this,"alwaysPassEnvelopesToHost",!1);s(this,"messageCleanupCache",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let n=e;if(n.direction!==R.down)return;if(n.messageType===l.DisposeMessage){n.destination&&delete this.components[n.destination];return}if(n.messageType===l.InitMessage){let r=n.content.id;if(this.components[r])return;this.components[r]=new Gt(r),this.messageToHost(new Se(r));return}if(n.messageType===l.EnvelopedMessage){let r=n,i=r.message;if(n=i,this.alwaysPassEnvelopesToHost||this.components[n.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===r.destination);if(p){p.send(i);return}}else return}if(n.messageType){if(n.messageType===l.CleanupMessage){let i=n,a=this.messageCleanupCache[i.cleanupForMessageId],p=new He(!!a);p.destination=n.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],$n(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===n.messageType){r=!0;let a=i.executor(n);if(n.cleanable&&a&&(this.messageCleanupCache[n.id]=a),a&&!n.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&n.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var V,pe,Ie,he,de,We,Me,b=m(()=>{"use strict";Fn();Un();Wn();V={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},pe={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},Ie={message:"message",code:"code"},he=class{};s(he,"code","code"),s(he,"component","component");de={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},We={Segment:"Segment",Promo:"Promo",AB:"AB"},Me=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));s(this,"getRoot",()=>this.shadowRoot||this.container)}}});var Xt,ys,Jt,O,ce=m(()=>{"use strict";Xt=o=>o!==Object(o),ys=o=>typeof o=="function",Jt=o=>{if(Xt(o))return!0;if(ys(o)||Object.getPrototypeOf(o))return!1;for(let t in o){let e=o[t];if(typeof e=="object"){if(!Jt(e))return!1}else{if(Xt(e))continue;return!1}}return!0},O=(o,t={},e=!0,n=new WeakMap)=>{if(Xt(o))return o;if(Array.isArray(o)){if(n.has(o))return n.get(o);let r=[];n.set(o,r);for(let i=0;i<o.length;i++){let a=o[i];r[i]=O(a,t,e,n)}return r}if(o!==null&&typeof o=="object"){if(n.has(o))return n.get(o);let r={};n.set(o,r);for(let i in o){let a=typeof t=="boolean"?t:t[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(r[i]=O(o[i],!0,e,n)):typeof a=="object"&&(r[i]=O(o[i],a,e,n)))}return r}return{}}});var Nn,Vn=m(()=>{"use strict";Nn={notSerializableRefCall:(o,t)=>{throw new Error("\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \nThe following types of data are considered non-serializable and cannot be processed:\n\n- Functions\n- DOM elements\n- Class instances\n- Circular references\n- Symbols\n- BigInt values\n\nIn the following execution we detected :\n~~~~~~~~\n").concat(t," \n~~~~~~~~\nas not serializable.\n\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\n\nSuggested Fix:\n1. Remove or replace non-serializable values from your input.\n2. If using objects, ensure they do not contain any functions or circular references.\n3. Convert any class instances to plain objects or JSON-compatible formats.\n4. Use dedicated Myop message.\n\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\n\n"))}}});var Le,qn=m(()=>{"use strict";$e();x();Wt();Le=class extends G{constructor(e,n,r){super(e,n.container,r);this.componentDefinition=e;this.parent=n;s(this,"send",e=>{let n=e.handler,r=super.send(e);return this.parent.send(new Ee(this.id,e)),e.handler=n,r});s(this,"dispose",()=>{this.isInitiated&&this.send(new P("dispose")),super.dispose()})}hide(){this.send(new P("hide"))}show(){this.send(new P("show"))}inspect(){return this.send(new P("inspect"))}setHeightBasedOnDocumentElement(){this.send(new P("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new P("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var hs,Ne,jn,Gn,Xn,Ms,Qt,Yt,Ve=m(()=>{"use strict";x();x();b();ce();Vn();qn();hs=(o,t,e)=>{let n=document.createElement("a");return n.textContent=o,n.style.position="relative",n.style.padding="0 5px",n.style.fontSize="14px",n.style.top="0",n.style.top="".concat(t,"px"),n.style.transform="translateX(-50%)",n.target="_blank",n.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),n},Ne=(o,t,e,n,r,i)=>{let a=hs("".concat(i.name," : ").concat(t),e,i);return n.insertBefore(a,r),r.style.border="1px solid #007BFF",r.style.display="block",()=>{r.style.border="unset",n.removeChild(a)}},jn=(o,t,e)=>o?!1:(console.error("Error: Undefined Prop\n\nIt looks like you've tried to use a prop that hasn't been defined.\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\n\n"+"Prop Name: ".concat(t,"\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\n\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),Gn=(o,t,e)=>{console.error("Error: Code Prop Not Supported\n\nCurrently, code props are only supported in local frame components.\n\u26A0\uFE0F This is a work in progress feature \u2014 code props will be supported in upcoming versions.\n\nIn the meantime, you can use message props.\n\n"+"Prop Name: ".concat(t,"\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\n\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},Xn=(o,t,e)=>{let n=t.reduce((i,a)=>U(h({},i),{[a.name]:h({},a)}),{}),r={get:(i,a)=>{let p=n[a];if(jn(p,a,o))return!1;if(p.behavior.type===Ie.code){if(e.loader.type===V.HTMLLoader&&e.loader.shadowRootMode===pe.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Gn(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(j.create(p.behavior.ref)),c.push(f=>{d(f)}),p.behavior.params&&c.push(...p.behavior.params);let g=ge[p.behavior.message];o.send(new g(...c))}):null},set:(i,a,p)=>{let d=n[a];if(jn(d,a,o))return!1;if(d.behavior.type===Ie.code){if(e.loader.type===V.HTMLLoader&&e.loader.shadowRootMode===pe.localFrame){let g=d.behavior;return o.element.contentWindow[g.remap||a]=p,!0}return Gn(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(j.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let g=ge[d.behavior.message];return o.send(new g(...c)),!0}else throw new Error("Error: Unsupported Behavior\n\nThe 'behavior' field provided is not supported.\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\n\n")+"Prop Name: ".concat(a,"\n")+"Behavior Field: ".concat(d.behavior.type,"\n\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,r),o},Ms=(o,t)=>new Proxy(o,{get(e,n){return e[n]?e[n]:(...i)=>new Promise(a=>{i.forEach(p=>{Jt(p)||Nn.notSerializableRefCall(n,p)}),t.send(new W(({ref:p,propName:d,functionArgs:c,makeSerializable:g})=>{if(p){let f=p[d];return g(typeof f=="function"?p[d](...c):f,!0)}return null},{elementId:e.refConfig.selector,propName:n,functionArgs:i},p=>{a(p.content)}))})},set(e,n,r){return t.send(new W(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:n},i=>{})),!0}}),Qt=async(o,t,e,n)=>{let r=o.component;if(!r)throw new Error("cant createRefComponent with detached ref");return new Promise(async(i,a)=>{let p=new Le(t.type,r,n);e.push(p),await r.initiated();let d=setTimeout(()=>{a("timeout")},5e3);r.send(new Te(o.refConfig,t,U(h({},n||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let g=e.find(f=>f.id==p.id);if(g!==p){r.refs[o.refConfig.name]=g,i(g);return}else p.setInitiated(),r.refs[o.refConfig.name]=p;c.nestedRefs.forEach(f=>{let u=t.instance.resolvedNestedComponents.find(S=>S.type.id===f.componentDefinitionId).type,y=new Le(u,p);y.setInitiated(),p.refs[f.refName]=y,e.push(y)});try{await Yt(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(f){a(f)}}))})},Yt=async(o,t,e,n=!1)=>{o.refs||(o.refs={});let r=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==he.component){if(n){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let g=(d=t.instance.resolvedNestedComponents)==null?void 0:d.find(u=>u.type.id===c);if(!g)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let f=j.create("",i,o);try{let u=await Qt(f,g,e);o.refs[i.name]=u,a()}catch(u){p(u)}}else try{let c=j.create("",i,o);o.refs[i.name]=Ms(c,o),a()}catch(c){}}));try{await Promise.all(r)}catch(i){throw i}}});var Ce,Zt=m(()=>{"use strict";$e();x();Ve();M();Ce=class extends G{constructor(e,n,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,"cleanupInspect");s(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new _(()=>window.document.documentElement.scrollHeight,n=>{this.IframeElement.style.height="".concat(n.content,"px"),e()}))});s(this,"observeSizeBasedOnDocumentElement",()=>this.send(new _(({send:n})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();n({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px")})));s(this,"observeAutoSize",e=>{var pn;let n=this.IframeElement,r=n.contentDocument;if(!r)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let i=(L,$,me)=>$!==void 0&&L<$?$:me!==void 0&&L>me?me:L,a=L=>{if(L===void 0)return;if(typeof L=="number")return L;let $=parseFloat(L);return isNaN($)?void 0:$},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),g=a(e==null?void 0:e.maxHeight),f=(pn=e==null?void 0:e.loaderMinHeight)!=null?pn:50,u=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,S=this.container.getBoundingClientRect(),vt=S.width===0,F=S.height===0||S.height===f,q=(e!=null&&e.forceAutoSize||vt)&&!u,Y=(e!=null&&e.forceAutoSize||F)&&!y;if(!q&&!Y)return()=>{};let we=()=>{var $;let L=n.contentDocument;if(L){let me=L.documentElement.getBoundingClientRect(),dn=Math.ceil(me.width),cn=Math.ceil(me.height),mn=i(dn,p,d),ln=i(cn,c,g);q&&(n.style.width="".concat(mn,"px")),Y&&(n.style.height="".concat(ln,"px"));let os=q&&d!==void 0&&dn>d,ss=Y&&g!==void 0&&cn>g;L.documentElement.style.overflowX=os?"auto":"hidden",L.documentElement.style.overflowY=ss?"auto":"hidden",($=e==null?void 0:e.onSizeChange)==null||$.call(e,{width:mn,height:ln,autoSizingWidth:q,autoSizingHeight:Y})}};we();let kt=new ResizeObserver(we);return kt.observe(r.body),kt.observe(r.documentElement),()=>{kt.disconnect()}});s(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new _(()=>{let{height:n,width:r}=document.documentElement.getBoundingClientRect();return{height:n,width:r}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px"),e()}))});s(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new _(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+"px"},n=>{this.IframeElement.style.height=n.content,e()}))});s(this,"send",e=>{var i,a;let n=h({},e);if(n.messageType===l.ExecuteComponentMethod)return this[n.method](),()=>{};n.direction=R.down;let r=super.send(n);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(n,"*"),r});s(this,"dispose",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});n.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Ne(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var X,qe=m(()=>{"use strict";X=class{constructor(){s(this,"appendChild",(t,e,n)=>{var r;if(n!=null&&n.relative){if(n.relative.direction==="before")return t.insertBefore(e,n.relative.child);if(n.relative.direction==="after"){let i=(r=n.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var Is,je,Jn=m(()=>{"use strict";Zt();qe();te();b();Is=(o,t,e)=>{let n=new URL(o);return n.searchParams.append(t,e),n.toString()},je=class extends X{constructor(){super(...arguments);s(this,"type",V.IframeLoader);s(this,"load",async(e,n,r,i)=>{let a,p=n.loader;if((r==null?void 0:r.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,r),a=r,a.src=p.url;else{let d=T(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let g="\n padding: 0;\n margin: 0;\n position: absolute;\n inset: 0;\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\n width: 100%;\n overflow: hidden;\n border: none;\n opacity: ").concat(i!=null&&i.hidden?"0":"1",";\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\n ");a.style.cssText=g,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([u,y])=>{y===""||y===null||y===void 0?a.setAttribute(u,""):a.setAttribute(u,String(y))});let f=n.loader.url;i!=null&&i._hasParent&&(f=Is(f,"_myop-comp",d)),a.src=f,r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),a=this.appendChild(r,a,i)}return new Ce(e,n,r,a,i)})}}});var Ge,en=m(()=>{"use strict";Ge={webcomponent_message_key:"myop_webcomponent_message"}});var xe,tn=m(()=>{"use strict";en();$e();Ve();xe=class extends G{constructor(e,n,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,"cleanupInspect",()=>{});s(this,"send",e=>{let n=h({},e),r=super.send(n),i=new CustomEvent(Ge.webcomponent_message_key,{detail:n});try{this.customElement.dispatchEvent(i)}catch(a){console.log("error while trying to dispatchEvent",a)}return r});s(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Ne(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}}});var nn,Xe,Qn=m(()=>{"use strict";tn();qe();te();b();nn={},Xe=class extends X{constructor(){super(...arguments);s(this,"type",V.WebComponentLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader;nn[a.url]?console.log("Module alreday loaded or in loading process"):nn[a.url]=new Promise((c,g)=>{let f=a.url,u=document.createElement("script");u.type="module",u.src=f,u.onload=()=>{c()},u.onerror=()=>{g()},document.head.appendChild(u)}),await nn[a.url],await yn(1);let p="myop-comp-".concat(T()),d=document.createElement(a.tag);return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,d,i),new xe(e,n,r,d,i)})}}});var E,z=m(()=>{"use strict";b();E=class extends Ue{constructor(e,n){super(e);this.context=n;s(this,"executor",e=>{if(e.destination){let n=e.destination;if(this.context[n].context){let r=(i,a)=>{this.messageToHost(U(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[n].context,r)}else debugger}else debugger})}}});var D,J=m(()=>{"use strict";D={id:"myop-id"}});var w,Yn,B=m(()=>{"use strict";J();w=(o,t)=>t.querySelectorAll("[".concat(D.id,"='").concat(o.refConfig.selector,"']")),Yn=(o,t)=>{let e=w(o,t);return e.length?e.item(0):null}});var Je,Zn=m(()=>{"use strict";M();x();z();B();Je=class extends E{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"innerExecutor",(e,n,r)=>{let i=w(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{r(new ne(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var Qe,eo=m(()=>{"use strict";M();z();B();Qe=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var Ye,to=m(()=>{"use strict";b();Ye=class extends Me{constructor(e,n){super(e,n);this.container=e;this.shadowRoot=n}}});var Ze,no=m(()=>{"use strict";b();J();z();x();M();Ze=class extends E{constructor(){super(...arguments);s(this,"innerExecutor",(e,n)=>{let r=n.shadowRoot.querySelectorAll("[".concat(D.id,"]")),i=[];r.forEach(a=>{let p=a.getAttribute(D.id);p&&i.push(new ue(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new ae(e.handlerUniqueId,i))});s(this,"messageType",l.DetectMyopRefsMessage)}}});var et,oo=m(()=>{"use strict";M();z();B();et=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var tt,so=m(()=>{"use strict";M();x();z();B();ce();tt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"innerExecutor",(e,n,r)=>{let i=w(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{r(new se(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var nt,ro=m(()=>{"use strict";M();J();Be();Fe();z();nt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"innerExecutor",(e,n,r)=>{(async()=>{let a=n.shadowRoot.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=A.Instance(),d=p.components.find(u=>u.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let g=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),f=[];Object.keys(g.refs).forEach(u=>{let y=g.refs[u];y=y.__nonProxied||y,y.componentDefinition&&f.push({refName:u,componentDefinitionId:y.componentDefinition.id})}),r(new N(e.handlerUniqueId,f))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new N(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var ot,on=m(()=>{"use strict";ce();ot=(o,t,e)=>{let n=o.scriptInputs?o.scriptInputs:{};n.makeSerializable=O,n.send=t,n.rootRef=e,n.__scriptInputs=n;let i=new Function("return (".concat(o.script,")(...arguments)"))(n);t(i)}});var st,io=m(()=>{"use strict";M();x();z();on();st=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"innerExecutor",(e,n,r)=>{ot(e,a=>{r(new oe(e.handlerUniqueId,a))},n)})}}});var ao,rt,po=m(()=>{"use strict";M();x();z();B();J();ce();ao=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(D.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:ao(i),required:i.required,validity:O(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},rt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"innerExecutor",(e,n,r)=>{w(e.ref,n.shadowRoot).forEach(a=>{r(new re(ao(a)),e)})})}}});var it,co=m(()=>{"use strict";M();z();B();it=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var mo={};Z(mo,{WebComponentSDK:()=>be});var be,sn=m(()=>{"use strict";b();M();en();Zn();eo();to();no();ee();x();oo();so();ro();io();po();co();be=class extends ye{constructor(){super(...arguments);s(this,"alwaysPassEnvelopesToHost",!0);s(this,"connectedCallback",(e,n)=>{e.addEventListener(Ge.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new Ye(e,n)}}}),setTimeout(()=>{this.messageToHost(new ie)},1)});s(this,"messageToHost",(e,n)=>{e.direction=R.up,!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,"supportedHandlers",[new Qe(this.messageToHost,this.components),new it(this.messageToHost,this.components),new Je(this.messageToHost,this.components),new Ze(this.messageToHost,this.components),new et(this.messageToHost,this.components),new tt(this.messageToHost,this.components),new st(this.messageToHost,this.components),new rt(this.messageToHost,this.components),new nt(this.messageToHost,this.components)]);s(this,"init",()=>{})}};K("WebComponentSDK",be)});var lo=m(()=>{"use strict";sn()});function Cs(o,t){return class extends HTMLElement{connectedCallback(){let e=t===pe.open?"open":"closed",n=this.attachShadow({mode:e});go().then(r=>{r.connectedCallback(this,n),n.innerHTML=o})}}}var fo,at,go,xs,bs,ws,pt,uo=m(()=>{"use strict";tn();qe();te();b();lo();Zt();fo=[],go=async()=>(at||(at=new be,at.init()),at);xs=(o,t,e)=>{customElements.define(o,Cs(t,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},bs=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\d+)/g,"-$1").toLowerCase(),ws=o=>(o=bs(o),o.replace(/_/g,"-")),pt=class extends X{constructor(){super(...arguments);s(this,"type",V.HTMLLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader,p="myop-comp-".concat(T()),d;if(a.shadowRootMode===pe.localFrame){let c=T(),g="myop-comp-".concat(c),f=document.createElement("iframe");f.id=g,f.style.cssText="\n display: block;\n padding: 0;\n margin: 0;\n position: absolute;\n inset: 0;\n overflow: hidden;\n border: none;\n opacity: ".concat(i!=null&&i.hidden?"0":"1",";\n width: 100%;\n height: 100%;\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\n "),r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),f=this.appendChild(r,f,i);let u=f.contentDocument||f.contentWindow.document;u.open();let y=a.HTML;if(i!=null&&i._inspection){let F=new DOMParser().parseFromString(a.HTML,"text/html"),q=F.getElementById("myop_preview");q==null||q.removeAttribute("type");let Y=F.implementation.createHTMLDocument();Y.body.innerHTML="<script>\n const beforeKeysWindow = new Set(Object.keys(window));\n window.myopState = {\n beforeKeysWindow,\n };\n <\/script>";let we=Y.body.firstChild;we&&F.head&&F.head.insertBefore(F.importNode(we,!0),F.head.firstChild),y=F.documentElement.outerHTML}u.writeln(y),u.writeln('<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\/script>\n <script>\n \n window.__federation__.__public_path__ = window.__federation__.__public_path__;\n \n const __myop_init = async () => {\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\n const sdk = new IframeSDK()\n sdk.init();\n }\n \n __myop_init().then();\n \n <\/script>')),u.close();let S=new Ce(e,n,r,f,i);return a.autoHeight&&(f.onload=()=>{S.observeSizeBasedOnDocumentElement()}),S}if(a.shadowRootMode===pe.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,go().then(g=>{g.connectedCallback(d,d)})}else{let c=ws(e.name+n.id);fo.includes(c)||(xs(c,a.HTML,a.shadowRootMode),fo.push(c)),d=document.createElement(c)}return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(r,d,i),new xe(e,n,r,d,i)})}}});var yo,ho,Mo=m(()=>{"use strict";te();x();yo=(o,t,e)=>{let n="myop-css-".concat(T());return o.send(new _(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let g in i){c+="".concat(g," { ");let f=i[g];for(let u in f)c+="".concat(u,": ").concat(f[u],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(r.shadowRoot||r.container).appendChild(d)},()=>{},{_stylesheet:t,_css:e||"",_tagId:n})),()=>{o.send(new _(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:n}))}},ho=(o,t)=>{let e="myop-css-".concat(T());return o.send(new _(({rootRef:n,_tagId:r,_link:i})=>{let a=document.createElement("link");a.id=r,a.rel="stylesheet",a.href=i,document.head.appendChild(a),(n.shadowRoot||n.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{o.send(new _(({rootRef:n,_tagId:r})=>{let i=(n.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var Ss,rn,Io,Co=m(()=>{"use strict";Ss=(o,t)=>{let e=new RegExp(Object.keys(t).join("|"),"g");return o.replace(e,n=>(t[n]||n).toString())},rn=(o,t)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=h({},o.loader),o.loader.url=Ss(o.loader.url,t),o},Io=o=>async t=>rn(t,o)});var xo,bo,wo=m(()=>{"use strict";x();xo=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.add(r)},{elementId:e,_className:t}))},bo=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.remove(r)},{elementId:e,_className:t}))}});var mt,dt,lt,ct,So=m(()=>{"use strict";te();mt=class mt{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"id",this._runTimeId);s(this,"name",this._runTimeName);s(this,"description","");s(this,"loader",null);s(this,"withLoader",t=>(this.loader=t,this));s(this,"withHTMLLoader",t=>(t.type="HTMLLoader",this.loader=t,this));s(this,"build",()=>this)}};s(mt,"create",()=>new mt);dt=mt,lt=class lt{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,"name",this._runTimeName);s(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});s(this,"withInstance",t=>(this.instance=t,this));s(this,"withType",t=>(this.type=t,this));s(this,"withName",t=>(this.name=t,this));s(this,"withDefaultSkin",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:t.id}},this));s(this,"withRef",t=>(this.type.refs.push(t),this));s(this,"withBasicRef",t=>{let e={id:"",name:t,description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}};return this.type.refs.push(e),this});s(this,"build",()=>JSON.parse(JSON.stringify(this)))}};s(lt,"create",()=>new lt);ct=lt});var Ts,ft,Q,To,Eo=m(()=>{"use strict";b();Ts=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:Ie.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:Ie.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),ft=class ft{constructor(t="https://cloud.myop.dev"){this._baseUrl=t;s(this,"variants",{});s(this,"userFlows",{});s(this,"_defaultEnv","production")}setEnvironment(t){this._defaultEnv=t}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(t,e,n){return"".concat(t,":").concat(e||this._defaultEnv,":").concat(n?"preview":"live")in this.variants}async fetchComponentV2(t,e,n){let r=e||this._defaultEnv,i="".concat(t,":").concat(r,":").concat(n?"preview":"live");return this.variants[i]||(this.variants[i]=new Promise(async(a,p)=>{try{let d="".concat(this._baseUrl,"/consume?id=").concat(t,"&env=").concat(r);n&&(d+="&preview=true");let f=(await(await fetch(d)).json()).item;if(!f){p(new Error('Component "'.concat(t,'" not found')));return}if(!f.consume_variant||!f.consume_variant.length){p(new Error('Component "'.concat(t,'" has no implementation for environment "').concat(r,'"')));return}let u=Ts(f);a(u)}catch(d){p(d)}})),await this.variants[i]}async fetchComponentV1(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&auto=true"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&resolve=components"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchComponent(t,e){return this.fetchComponentV1(t,e)}};s(ft,"Main",new ft);Q=ft,To=Q});var Ro,vo=m(()=>{"use strict";Ro=async o=>await o()});var an={};Z(an,{CloudRepository:()=>Q,ComponentConfig:()=>ct,SkinConfig:()=>dt,addClass:()=>xo,applyStylesheet:()=>yo,applyStylesheetLink:()=>ho,changeSkinUrlByTokenizer:()=>Io,createIframeSkinByTokenizer:()=>rn,exec:()=>Ro,removeClass:()=>bo,v2_CloudRepository:()=>To});var gt=m(()=>{"use strict";Mo();Co();wo();So();Eo();vo()});var ko,Ho=m(()=>{"use strict";Bt();gt();b();ko=async o=>{try{let t=new URL(window.location.href),n=new URLSearchParams(t.search).get("myopOverride");if(n){let[r,...i]=Dt(n);switch(r){case"component":{let[a,p]=i,d=await Q.Main.fetchComponent(a);if(d&&d.type.skins.find(g=>g.id===p))return d.instance.skinSelector={type:de.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Dt(n),c=(await Q.Main.fetchFlow(a)).components.find(g=>g.type.id===o.type.id);if(c&&c.instance.skinSelector.type===de.Segmented&&c.instance.resolvedExperiences){let g=c.instance.resolvedExperiences.find(f=>f.id===p);if((g==null?void 0:g.type)===We.Segment){let f=g,y=c.instance.skinSelector.segments.find(S=>S.segmentId===f.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Bo={};Z(Bo,{HostSDK:()=>A,hostSDK:()=>Do});var _o,A,Do,Be=m(()=>{"use strict";ee();M();x();Jn();Qn();Ve();b();ze();uo();Ho();_o="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",A=class{constructor(){s(this,"components2init",[]);s(this,"components",[]);s(this,"componentsLoaders",[]);s(this,"initiated",!1);s(this,"version",le);s(this,"type2InstanceCount",{});s(this,"assignId",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),"".concat(t.id,"_").concat(++this.type2InstanceCount[t.id])));s(this,"inspected",!1);s(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,"incomingMessageHandler",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new fe(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===P.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let n=this.components.find(r=>r.id===e.destination);if(!n){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(n){if(n.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,"send",t=>{let e=new MessageEvent("",{data:t});this.incomingMessageHandler(e)});s(this,"init",t=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new je,new Xe,new pt];if(this.componentsLoaders=[...e],t){let n={};t.forEach(r=>{let i=new r(this.componentsLoaders);n[i.type]=i}),this.componentsLoaders.forEach(r=>{n[r.type]||(n[r.type]=r)}),this.componentsLoaders=Object.values(n)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});s(this,"_getSkinIdBySkinSelector",async(t,e=[],n)=>{var i;async function r(a,p){for(let d of a)if(await p(d))return d}switch(t.type){case"DedicatedSkin":case de.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case de.Segmented:{let p=await r(t.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(y=>y.type===We.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let f=c.segment,u=(n||{})[f.function];return u?await u():(console.warn("segmentId:".concat(d.segmentId,", ").concat(f.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});s(this,"runSkinSelector",async(t,e)=>{let n=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===n)});s(this,"loaderHooks");s(this,"loadComponent",async(t,e,n)=>{var g,f,u,y;if(!e){debugger;throw new Error("no container was found for this component")}let r=await ko(t);r&&(t=r);let i=h(h({},(g=this.loaderHooks)!=null?g:{}),(f=n==null?void 0:n.hooks)!=null?f:{}),a=e;if(a.myop)if(a.component){t=h({},t),t.instance=h({},t.instance);let S=await this.runSkinSelector(t,i);if(!S)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(u=n==null?void 0:n.hooks)!=null&&u.afterSkinSelected&&(S=await n.hooks.afterSkinSelected(h({},S))),t.instance.skinSelector={type:de.Dedicated,skin:S},n&&(n=h({},n),delete n.hooks),await Qt(a,t,this.components,n)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(y=n==null?void 0:n.hooks)!=null&&y.afterSkinSelected&&(p=await n.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(S=>S.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(t.type,p,e,n);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(S=>S!==c),this.components2init=this.components2init.filter(S=>S!==c),!0)),this.components.push(c),(!n||n.connectProps!==!1)&&(c=Xn(c,t.type.props,p));try{await Yt(c,t,this.components)}catch(S){throw S}return n!=null&&n.skipInit||await c.initiated(),c});s(this,"navigate",async(t,e,n)=>{if(t.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(n!=null&&n.staged){let r=await this.loadComponent(e,t.container,h({hidden:!0,relative:{direction:"after",child:t.element}},n));return n.init&&await n.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,h({relative:{direction:"before",child:r}},n))}})}};s(A,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:_o});if(!window.myop.hostSDK){let o=new A;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:_o}),window.myop.hostSDK=o}Do=window.myop.hostSDK;K("hostSDK",Do)});var ut,Lo=m(()=>{"use strict";M();J();b();x();ut=class extends C{constructor(){super(...arguments);s(this,"messageType",l.DetectMyopRefsMessage);s(this,"executor",e=>{let n=document.querySelectorAll("[".concat(D.id,"]")),r=[];n.forEach(i=>{let a=i.getAttribute(D.id);a&&r.push(new ue(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new ae(e.handlerUniqueId,r))})}}});var yt,Oo=m(()=>{"use strict";M();b();x();B();yt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"executor",e=>{let n=[];return w(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new ne,e)};i.addEventListener("click",a);let p=()=>{i.removeEventListener("click",a)};n.push(p)}),()=>{n.forEach(i=>i())}})}}});var ht,Po=m(()=>{"use strict";M();b();B();ht=class extends C{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var Mt,Ao=m(()=>{"use strict";M();x();b();on();Mt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"executor",e=>{ot(e,r=>{this.messageToHost(new oe(e.handlerUniqueId,r))},new Me(document.documentElement))})}}});var It,Ko=m(()=>{"use strict";M();b();x();ce();B();It=class extends C{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"executor",e=>{let n=w(e.ref,document),r=[];return n.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new se(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var Ct,zo=m(()=>{"use strict";M();b();B();Ct=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var xt,Fo=m(()=>{"use strict";M();J();b();Be();Fe();xt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"executor",e=>{(async()=>{let r=document.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(r.length===1){let a=await A.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new N(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new N(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var $o,Uo=m(()=>{"use strict";$o=(o,t)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let n=new e(t),r={attributes:!0,childList:!0,subtree:!0};return n.observe(o,r),n}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",t,!1),o.addEventListener("DOMNodeRemoved",t,!1))}});var bt,Wo=m(()=>{"use strict";M();x();b();Uo();bt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetMutationObserverMessage);s(this,"executor",e=>{e.source&&$o(document.body,()=>{this.messageToHost(new ve)})})}}});var No,wt,Vo=m(()=>{"use strict";M();J();b();x();ce();B();No=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(D.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:No(i),required:i.required,validity:O(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},wt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{this.messageToHost(new re(No(r)),e)})})}}});var St,qo=m(()=>{"use strict";M();b();x();B();St=class extends C{constructor(){super(...arguments);s(this,"messageType",l.GetAttributeMessage);s(this,"executor",e=>{let n=Yn(e.ref,document);n&&this.messageToHost(new Re(n.getAttribute(e.name)),e)})}}});var Tt,jo=m(()=>{"use strict";x();M();b();Tt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetResizeObserverMessage);s(this,"executor",e=>{let n=new ResizeObserver(r=>{this.messageToHost(new De)});return n.observe(document.body),()=>{n.disconnect()}})}}});var Et,Go=m(()=>{"use strict";M();b();B();Et=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var Xo={};Z(Xo,{IframeSDK:()=>Rt});var Rt,Jo=m(()=>{"use strict";b();Lo();Oo();Po();Ao();ee();Ko();zo();x();Fo();Wo();Vo();ze();qo();jo();Go();Rt=class extends ye{constructor(){super();s(this,"version",le);s(this,"messageToHost",(e,n)=>{var i;!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId);let r=Object.keys(this.components);e.destination||(n!=null&&n.route?e.destination=n.route[n.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(h({},e),"*")});s(this,"supportedHandlers",[new ht(this.messageToHost),new Et(this.messageToHost),new yt(this.messageToHost),new ut(this.messageToHost),new Mt(this.messageToHost),new It(this.messageToHost),new Ct(this.messageToHost),new wt(this.messageToHost),new bt(this.messageToHost),new Tt(this.messageToHost),new St(this.messageToHost),new xt(this.messageToHost)]);s(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new ie)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};K("IframeSDK",Rt)});var Rs={};var Es,Qo=m(()=>{"use strict";x();ee();Es=h({},ge);K("MyopMessages",Es)});var Yo={};Z(Yo,{CloudRepository:()=>Q,ComponentConfig:()=>ct,SkinConfig:()=>dt,addClass:()=>xo,applyStylesheet:()=>yo,applyStylesheetLink:()=>ho,changeSkinUrlByTokenizer:()=>Io,createIframeSkinByTokenizer:()=>rn,exec:()=>Ro,removeClass:()=>bo,v2_CloudRepository:()=>To});var Zo=m(()=>{"use strict";ee();gt();gt();K("MyopHelpers",an)});var Ds={};Z(Ds,{getHostModule:()=>es,getIframeModule:()=>ts,getWebcomponentModule:()=>ns});ee();var un;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(un=document.currentScript)==null?void 0:un.src,t=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,t,e)=>{if(window.__federation__[t])console.log("__federation__ module ".concat(t," already loaded.")),e(window.__federation__[t][_t]);else{let n;window.__federation__[t]={},window.__federation__[t][Ke]=r=>{n&&(document.head.removeChild(n),n=null),window.__federation__[t][_t]=r,e(r)},n=document.createElement("script"),n.type="module",n.src=o,n.async=!0,document.head.appendChild(n)}};ze();console.log("myop root sdk - loaded",document.location.origin);var vs="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",es=()=>Promise.resolve().then(()=>(Be(),Bo)),ts=()=>Promise.resolve().then(()=>(Jo(),Xo)),ns=()=>Promise.resolve().then(()=>(sn(),mo)),ks=()=>Promise.resolve().then(()=>(Qo(),Rs)),Hs=()=>Promise.resolve().then(()=>(Zo(),Yo)),Oe=o=>async()=>(await o()).get(),_s={version:le,getHostModule:Oe(es),getIframeModule:Oe(ts),getWebcomponentModule:Oe(ns),getMyopMessages:Oe(ks),getMyopHelpers:Oe(Hs)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:vs});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=h({rootSDK:_s},window.myop);return ms(Ds);})();
|
|
1
|
+
"use strict";var MyopSDK=(()=>{var ze=Object.defineProperty,ps=Object.defineProperties,ds=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyDescriptors,ms=Object.getOwnPropertyNames,fn=Object.getOwnPropertySymbols;var gn=Object.prototype.hasOwnProperty,ls=Object.prototype.propertyIsEnumerable;var _t=(o,t,e)=>t in o?ze(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,h=(o,t)=>{for(var e in t||(t={}))gn.call(t,e)&&_t(o,e,t[e]);if(fn)for(var e of fn(t))ls.call(t,e)&&_t(o,e,t[e]);return o},U=(o,t)=>ps(o,cs(t));var m=(o,t)=>()=>(o&&(t=o(o=0)),t);var Q=(o,t)=>{for(var e in t)ze(o,e,{get:t[e],enumerable:!0})},fs=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ms(t))!gn.call(o,r)&&r!==e&&ze(o,r,{get:()=>t[r],enumerable:!(n=ds(t,r))||n.enumerable});return o};var gs=o=>fs(ze({},"__esModule",{value:!0}),o);var s=(o,t,e)=>_t(o,typeof t!="symbol"?t+"":t,e);var Fe,$e,Dt,z,Y=m(()=>{"use strict";Fe="__federation__",$e="onLoad",Dt="moduleInstance",z=(o,t)=>{window[Fe]&&window[Fe][o]&&window[Fe][o][$e]&&window[Fe][o][$e]({[o]:t})}});var le,Ue=m(()=>{le="0.3.9"});var l,M=m(()=>{"use strict";l={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var T,us,ys,Bt,Lt=m(()=>{"use strict";T=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),us=o=>{let t=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")},ys=o=>{let t=o.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";let e=atob(t);return Uint8Array.from(e,n=>n.charCodeAt(0))},Bt=o=>{let t=ys(o);if(t.length%16!==0)throw new Error("Invalid input length");let e=[];for(let n=0;n<t.length;n+=16)e.push(us(t.slice(n,n+16)));return e}});var yn,Z=m(()=>{"use strict";Lt();yn=o=>new Promise(t=>setTimeout(t,o))});var R,I,Ot,v,k,q,H=m(()=>{"use strict";Z();R=class{};s(R,"down","down"),s(R,"up","up");I=class{constructor(){s(this,"id",T());s(this,"myop",!0);s(this,"content");s(this,"source");s(this,"destination");s(this,"route");s(this,"ref");s(this,"direction");s(this,"cleanable",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Ot=class extends I{constructor(e){super();this.ref=e}},v=class extends I{constructor(e){super();this.replayToHandler=e}},k=class extends I{constructor(e){super();this.handler=e;s(this,"handlerUniqueId",T())}},q=class o{constructor(t,e){this.refConfig=t;this.component=e;s(this,"myop",!0);s(this,"__nonProxied");this.__nonProxied=U(h({},this),{component:null})}static create(t,e,n){let r=e;return r||(r={id:"",name:"",description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}}),new o(r,n)}}});var hn,Pt,ee,Mn=m(()=>{"use strict";H();hn="ClickReplayMessage",Pt=class extends k{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",hn);s(this,"messageType","BindClickMessage");s(this,"cleanable",!0)}},ee=class extends v{constructor(){super(...arguments);s(this,"messageType",hn)}}});var Kt,In=m(()=>{"use strict";H();Kt=class extends I{constructor(e,n){super();this.ref=e;s(this,"messageType","ChangeTextMessage");this.content=n}}});var Cn,hs,Ms,xn,_,te,At=m(()=>{"use strict";H();Cn="ExecuteScriptReplyMessage",hs=/(?:function\s*\w*\s*\([^)]*\)\s*\{([\s\S]*?)\}|(\([^)]*\)\s*=>\s*\{([\s\S]*?)\}))\s*$/,Ms=/\(\s*[^)]+\s*\)\s*=>\s*(.+)/,xn=o=>{let t=o.match(hs);if(t)return t[1]||t[3];{let e=o.match(Ms);if(e)return e[1].trim()}},_=class extends k{constructor(e,n=()=>{},r){super(n);this.scriptInputs=r;s(this,"replyMessageKey",Cn);s(this,"messageType","ExecuteScriptMessage");s(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=xn(this.content)}};s(_,"replierKey","send"),s(_,"completeStreamKey","completeStream");te=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.content=n;s(this,"messageType",Cn)}}});var W,bn=m(()=>{"use strict";At();W=class extends _{constructor(e,n,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:d})=>{let c=(i.shadowRoot||i.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},r);this.scriptInputs=n;this.scriptInputs=U(h({},n),{_script:e.toString()})}}});var wn,zt,ne,Sn=m(()=>{"use strict";H();wn="EventListenerCallbackMessage",zt=class extends k{constructor(e,n,r){super(r);this.ref=e;this.type=n;this.handler=r;s(this,"replyMessageKey",wn);s(this,"messageType","AddEventListenerMessage");s(this,"cleanable",!0);s(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},ne=class extends v{constructor(e,n){super(e);this.replayToHandler=e;this.e=n;s(this,"messageType",wn);this.content={e:n}}}});var Ft,Tn=m(()=>{"use strict";H();Ft=class extends I{constructor(e,n,r){super();this.ref=e;this.name=n;this.value=r;s(this,"messageType","SetAttributeMessage")}}});var En,$t,oe,Ut=m(()=>{"use strict";H();En="ElementValueReplayMessage",$t=class extends k{constructor(e,n){super(n);this.ref=e;s(this,"replyMessageKey",En);s(this,"messageType","GetElementValueMessage")}},oe=class extends v{constructor(e){super();this.content=e;s(this,"messageType",En)}}});var Wt,Rn=m(()=>{"use strict";H();Wt=class extends I{constructor(e,n){super();this.ref=e;s(this,"messageType","SetInnerHtml");this.content=n}}});var fe,Te,se,vn=m(()=>{"use strict";H();fe=class extends I{constructor(e){super();s(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Te=class extends fe{constructor(){super(...arguments);s(this,"messageType","InitResponse")}},se=class extends I{constructor(){super(...arguments);s(this,"messageType","InitRequest")}}});var kn,Ee,N,We=m(()=>{"use strict";H();kn="RefComponentCreatedMessage",Ee=class extends k{constructor(e,n,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=n;this.options=r;s(this,"replyMessageKey",kn);s(this,"messageType","CreateRefComponentMessage")}},N=class extends v{constructor(e,n,r){super(e);this.replayToHandler=e;this.nestedRefs=n;this.failed=r;s(this,"messageType",kn)}}});var Re,Nt=m(()=>{"use strict";H();Re=class extends I{constructor(e,n){super();this.destination=e;this.message=n;s(this,"messageType","EnvelopedMessage");let r=n;this.route=[e,...r.route?r.route:[]]}}});var Hn,Vt,re,_n=m(()=>{"use strict";H();Hn="DetectedMyopRefsMessage",Vt=class extends k{constructor(){super(...arguments);s(this,"messageType","DetectMyopRefsMessage");s(this,"replyMessageKey",Hn)}},re=class extends v{constructor(e,n){super(e);this.replayToHandler=e;s(this,"messageType",Hn);this.content=n}isTypeof(e){return e.messageType===this.messageType}}});var Dn,qt,ve,Bn=m(()=>{"use strict";H();Dn="GetAttributeReplayMessage",qt=class extends k{constructor(e,n,r){super(r);this.ref=e;this.name=n;s(this,"replyMessageKey",Dn);s(this,"messageType","GetAttributeMessage")}},ve=class extends v{constructor(e){super();this.content=e;s(this,"messageType",Dn)}}});var K,Ln=m(()=>{"use strict";H();K=class extends I{constructor(e){super();this.method=e;s(this,"messageType","ExecuteComponentMethod")}}});var jt,ke,On=m(()=>{"use strict";H();jt=class extends I{constructor(){super(...arguments);s(this,"messageType","SetMutationObserverMessage")}},ke=class extends I{constructor(){super(...arguments);s(this,"messageType","MutationObserverMessage")}}});var Pn,He,_e,Kn=m(()=>{"use strict";H();Pn="CleanupReplayMessage",He=class extends k{constructor(e,n){super(n);this.cleanupForMessageId=e;s(this,"replyMessageKey",Pn);s(this,"messageType","CleanupMessage")}},_e=class extends v{constructor(e){super();this.customCleanup=e;s(this,"messageType",Pn)}}});var De,An=m(()=>{"use strict";H();De=class extends I{constructor(){super(...arguments);s(this,"messageType","DisposeMessage")}}});var Gt,Be,zn=m(()=>{"use strict";H();Gt=class extends I{constructor(){super(...arguments);s(this,"cleanable",!0);s(this,"messageType","SetResizeObserverMessage")}},Be=class extends I{constructor(){super(...arguments);s(this,"messageType","ResizeObserverMessage")}}});var ge={};Q(ge,{AddEventListenerMessage:()=>zt,BaseMyopMessage:()=>I,BindClickMessage:()=>Pt,ChangeTextMessage:()=>Kt,CleanupMessage:()=>He,CleanupReplayMessage:()=>_e,ClickReplayMessage:()=>ee,CreateRefComponentMessage:()=>Ee,CustomRefMessage:()=>W,DetectMyopRefsMessage:()=>Vt,DetectedMyopRefsMessage:()=>re,DisposeMessage:()=>De,ElementValueReplayMessage:()=>oe,EnvelopedMessage:()=>Re,EventListenerCallbackMessage:()=>ne,ExecuteComponentMethod:()=>K,ExecuteScriptMessage:()=>_,ExecuteScriptReplyMessage:()=>te,GetAttributeMessage:()=>qt,GetAttributeReplayMessage:()=>ve,GetElementValueMessage:()=>$t,InitMessage:()=>fe,InitRequest:()=>se,InitResponse:()=>Te,MessageDirection:()=>R,MutationObserverMessage:()=>ke,MyopBindMessage:()=>k,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Ot,Ref:()=>q,RefComponentCreatedMessage:()=>N,ResizeObserverMessage:()=>Be,SetAttributeMessage:()=>Ft,SetInnerHtml:()=>Wt,SetMutationObserverMessage:()=>jt,SetResizeObserverMessage:()=>Gt,stripFunction:()=>xn});var x=m(()=>{"use strict";H();Mn();In();At();bn();Sn();Tn();Ut();Rn();vn();We();Nt();_n();Ut();Bn();Ln();On();Kn();An();zn()});var j,Ne=m(()=>{"use strict";M();x();Le();j=class{constructor(t,e,n){this.componentDefinition=t;this.container=e;s(this,"id","");s(this,"messageHandlers",{});s(this,"element");s(this,"_markedForDisposed",!1);s(this,"bind",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,"bindWhen",(t,e,n)=>{if(!n)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(n(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,"isInitiated",!1);s(this,"_whenInitiatedResolve");s(this,"_whenInitiatedReject");s(this,"_whenInitiated",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,"initiated",()=>this._whenInitiated);s(this,"props",{});s(this,"refs",{});this.id=(n==null?void 0:n.id)||A.Instance().assignId(t);let r=n!=null&&n.timeout?n==null?void 0:n.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(r," ").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){if(this._markedForDisposed)throw new Error("InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.");this._markedForDisposed=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let n=t;return this[n.method]?this[n.method](n.content):console.log("method not found ".concat(n.method," on component"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let n=!1;return e.forEach(r=>{n=n||r(t)}),n}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),n=t.handler;delete t.handler,this.send(t),t.handler=n}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let n=t;e=this.bindWhen(n.replyMessageKey,r=>r.replayToHandler===n.handlerUniqueId,n.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new He(t.id,n=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new De);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var ue,Fn=m(()=>{"use strict";ue=class{constructor(t,e,n,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=n;this.offsetTop=r;this.offsetLeft=i;s(this,"type","MyopElementRef")}}});var $n,C,Ve,Un=m(()=>{"use strict";$n=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let t=await o;typeof t=="function"&&t()}},C=class{constructor(t){this.messageToHost=t}},Ve=class extends C{constructor(e,n){super(e);this.messageToHost=e;this.context=n}}});var Xt,ye,Wn=m(()=>{"use strict";M();b();x();Xt=class{constructor(t,e){this.id=t;this.context=e;s(this,"send",t=>{})}},ye=class{constructor(){s(this,"messageToHandleAfterInit",[]);s(this,"components",{});s(this,"alwaysPassEnvelopesToHost",!1);s(this,"messageCleanupCache",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let n=e;if(n.direction!==R.down)return;if(n.messageType===l.DisposeMessage){n.destination&&delete this.components[n.destination];return}if(n.messageType===l.InitMessage){let r=n.content.id;if(this.components[r])return;this.components[r]=new Xt(r),this.messageToHost(new Te(r));return}if(n.messageType===l.EnvelopedMessage){let r=n,i=r.message;if(n=i,this.alwaysPassEnvelopesToHost||this.components[n.destination]){let a=myop.hostSDK.components.find(d=>d.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(d=>d.id===r.destination);if(p){p.send(i);return}}else return}if(n.messageType){if(n.messageType===l.CleanupMessage){let i=n,a=this.messageCleanupCache[i.cleanupForMessageId],p=new _e(!!a);p.destination=n.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],$n(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===n.messageType){r=!0;let a=i.executor(n);if(n.cleanable&&a&&(this.messageCleanupCache[n.id]=a),a&&!n.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&n.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \nmessageType - ".concat(n.messageType,", handler executor was - ").concat(i.executor,"\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var V,ie,Ie,he,ae,qe,Me,b=m(()=>{"use strict";Fn();Un();Wn();V={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},ie={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},Ie={message:"message",code:"code"},he=class{};s(he,"code","code"),s(he,"component","component");ae={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},qe={Segment:"Segment",Promo:"Promo",AB:"AB"},Me=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));s(this,"getRoot",()=>this.shadowRoot||this.container)}}});var Jt,Is,Qt,O,pe=m(()=>{"use strict";Jt=o=>o!==Object(o),Is=o=>typeof o=="function",Qt=o=>{if(Jt(o))return!0;if(Is(o)||Object.getPrototypeOf(o))return!1;for(let t in o){let e=o[t];if(typeof e=="object"){if(!Qt(e))return!1}else{if(Jt(e))continue;return!1}}return!0},O=(o,t={},e=!0,n=new WeakMap)=>{if(Jt(o))return o;if(Array.isArray(o)){if(n.has(o))return n.get(o);let r=[];n.set(o,r);for(let i=0;i<o.length;i++){let a=o[i];r[i]=O(a,t,e,n)}return r}if(o!==null&&typeof o=="object"){if(n.has(o))return n.get(o);let r={};n.set(o,r);for(let i in o){let a=typeof t=="boolean"?t:t[i];a&&(a===!0?(e?o[i]!==void 0:o[i])&&(r[i]=O(o[i],!0,e,n)):typeof a=="object"&&(r[i]=O(o[i],a,e,n)))}return r}return{}}});var Nn,Vn=m(()=>{"use strict";Nn={notSerializableRefCall:(o,t)=>{throw new Error("\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \nThe following types of data are considered non-serializable and cannot be processed:\n\n- Functions\n- DOM elements\n- Class instances\n- Circular references\n- Symbols\n- BigInt values\n\nIn the following execution we detected :\n~~~~~~~~\n").concat(t," \n~~~~~~~~\nas not serializable.\n\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\n\nSuggested Fix:\n1. Remove or replace non-serializable values from your input.\n2. If using objects, ensure they do not contain any functions or circular references.\n3. Convert any class instances to plain objects or JSON-compatible formats.\n4. Use dedicated Myop message.\n\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\n\n"))}}});var Oe,qn=m(()=>{"use strict";Ne();x();Nt();Oe=class extends j{constructor(e,n,r){super(e,n.container,r);this.componentDefinition=e;this.parent=n;s(this,"send",e=>{let n=e.handler,r=super.send(e);return this.parent.send(new Re(this.id,e)),e.handler=n,r});s(this,"dispose",()=>{this.isInitiated&&this.send(new K("dispose")),super.dispose()})}hide(){this.send(new K("hide"))}show(){this.send(new K("show"))}inspect(){return this.send(new K("inspect"))}setHeightBasedOnDocumentElement(){this.send(new K("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new K("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var Cs,je,jn,Gn,Xn,xs,Yt,Zt,Ge=m(()=>{"use strict";x();x();b();pe();Vn();qn();Cs=(o,t,e)=>{let n=document.createElement("a");return n.textContent=o,n.style.position="relative",n.style.padding="0 5px",n.style.fontSize="14px",n.style.top="0",n.style.top="".concat(t,"px"),n.style.transform="translateX(-50%)",n.target="_blank",n.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),n},je=(o,t,e,n,r,i)=>{let a=Cs("".concat(i.name," : ").concat(t),e,i);return n.insertBefore(a,r),r.style.border="1px solid #007BFF",r.style.display="block",()=>{r.style.border="unset",n.removeChild(a)}},jn=(o,t,e)=>o?!1:(console.error("Error: Undefined Prop\n\nIt looks like you've tried to use a prop that hasn't been defined.\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\n\n"+"Prop Name: ".concat(t,"\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\n\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),Gn=(o,t,e)=>{console.error("Error: Code Prop Not Supported\n\nCurrently, code props are only supported in local frame components.\n\u26A0\uFE0F This is a work in progress feature \u2014 code props will be supported in upcoming versions.\n\nIn the meantime, you can use message props.\n\n"+"Prop Name: ".concat(t,"\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\n\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},Xn=(o,t,e)=>{let n=t.reduce((i,a)=>U(h({},i),{[a.name]:h({},a)}),{}),r={get:(i,a)=>{let p=n[a];if(jn(p,a,o))return!1;if(p.behavior.type===Ie.code){if(e.loader.type===V.HTMLLoader&&e.loader.shadowRootMode===ie.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return Gn(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(q.create(p.behavior.ref)),c.push(f=>{d(f)}),p.behavior.params&&c.push(...p.behavior.params);let g=ge[p.behavior.message];o.send(new g(...c))}):null},set:(i,a,p)=>{let d=n[a];if(jn(d,a,o))return!1;if(d.behavior.type===Ie.code){if(e.loader.type===V.HTMLLoader&&e.loader.shadowRootMode===ie.localFrame){let g=d.behavior;return o.element.contentWindow[g.remap||a]=p,!0}return Gn(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(q.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let g=ge[d.behavior.message];return o.send(new g(...c)),!0}else throw new Error("Error: Unsupported Behavior\n\nThe 'behavior' field provided is not supported.\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\n\n")+"Prop Name: ".concat(a,"\n")+"Behavior Field: ".concat(d.behavior.type,"\n\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,r),o},xs=(o,t)=>new Proxy(o,{get(e,n){return e[n]?e[n]:(...i)=>new Promise(a=>{i.forEach(p=>{Qt(p)||Nn.notSerializableRefCall(n,p)}),t.send(new W(({ref:p,propName:d,functionArgs:c,makeSerializable:g})=>{if(p){let f=p[d];return g(typeof f=="function"?p[d](...c):f,!0)}return null},{elementId:e.refConfig.selector,propName:n,functionArgs:i},p=>{a(p.content)}))})},set(e,n,r){return t.send(new W(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:n},i=>{})),!0}}),Yt=async(o,t,e,n)=>{let r=o.component;if(!r)throw new Error("cant createRefComponent with detached ref");return new Promise(async(i,a)=>{let p=new Oe(t.type,r,n);e.push(p),await r.initiated();let d=setTimeout(()=>{a("timeout")},5e3);r.send(new Ee(o.refConfig,t,U(h({},n||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let g=e.find(f=>f.id==p.id);if(g!==p){r.refs[o.refConfig.name]=g,i(g);return}else p.setInitiated(),r.refs[o.refConfig.name]=p;c.nestedRefs.forEach(f=>{let u=t.instance.resolvedNestedComponents.find(S=>S.type.id===f.componentDefinitionId).type,y=new Oe(u,p);y.setInitiated(),p.refs[f.refName]=y,e.push(y)});try{await Zt(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(f){a(f)}}))})},Zt=async(o,t,e,n=!1)=>{o.refs||(o.refs={});let r=Object.values(o.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var d;if(i.behavior.type==he.component){if(n){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let g=(d=t.instance.resolvedNestedComponents)==null?void 0:d.find(u=>u.type.id===c);if(!g)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let f=q.create("",i,o);try{let u=await Yt(f,g,e);o.refs[i.name]=u,a()}catch(u){p(u)}}else try{let c=q.create("",i,o);o.refs[i.name]=xs(c,o),a()}catch(c){}}));try{await Promise.all(r)}catch(i){throw i}}});var Ce,en=m(()=>{"use strict";Ne();x();Ge();M();Ce=class extends j{constructor(e,n,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,"cleanupInspect");s(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new _(()=>window.document.documentElement.scrollHeight,n=>{this.IframeElement.style.height="".concat(n.content,"px"),e()}))});s(this,"observeSizeBasedOnDocumentElement",()=>this.send(new _(({send:n})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();n({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px")})));s(this,"observeAutoSize",e=>{var Se;let n=this.IframeElement,r=n.contentDocument;if(!r)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let i=(L,$,me)=>$!==void 0&&L<$?$:me!==void 0&&L>me?me:L,a=L=>{if(L===void 0)return;if(typeof L=="number")return L;let $=parseFloat(L);return isNaN($)?void 0:$},p=a(e==null?void 0:e.minWidth),d=a(e==null?void 0:e.maxWidth),c=a(e==null?void 0:e.minHeight),g=a(e==null?void 0:e.maxHeight),f=(Se=e==null?void 0:e.loaderMinHeight)!=null?Se:50,u=(e==null?void 0:e.explicitWidth)!==void 0,y=(e==null?void 0:e.explicitHeight)!==void 0,S=this.container.getBoundingClientRect(),Ke=S.width===0,Ae=S.height===0||S.height===f,we=(e!=null&&e.forceAutoSize||Ke)&&!u,P=(e!=null&&e.forceAutoSize||Ae)&&!y;if(!we&&!P)return()=>{};let de=()=>{var $;let L=n.contentDocument;if(L){let me=L.documentElement.getBoundingClientRect(),dn=Math.ceil(me.width),cn=Math.ceil(me.height),mn=i(dn,p,d),ln=i(cn,c,g);we&&(n.style.width="".concat(mn,"px")),P&&(n.style.height="".concat(ln,"px"));let is=we&&d!==void 0&&dn>d,as=P&&g!==void 0&&cn>g;L.documentElement.style.overflowX=is?"auto":"hidden",L.documentElement.style.overflowY=as?"auto":"hidden",($=e==null?void 0:e.onSizeChange)==null||$.call(e,{width:mn,height:ln,autoSizingWidth:we,autoSizingHeight:P})}};de();let ce=new ResizeObserver(de);return ce.observe(r.body),ce.observe(r.documentElement),()=>{ce.disconnect()}});s(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new _(()=>{let{height:n,width:r}=document.documentElement.getBoundingClientRect();return{height:n,width:r}},n=>{this.IframeElement.style.width="".concat(n.content.width,"px"),this.IframeElement.style.height="".concat(n.content.height,"px"),e()}))});s(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new _(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+"px"},n=>{this.IframeElement.style.height=n.content,e()}))});s(this,"send",e=>{var i,a;let n=h({},e);if(n.messageType===l.ExecuteComponentMethod)return this[n.method](),()=>{};n.direction=R.down;let r=super.send(n);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(n,"*"),r});s(this,"dispose",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});n.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=je(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var G,Xe=m(()=>{"use strict";G=class{constructor(){s(this,"appendChild",(t,e,n)=>{var r;if(n!=null&&n.relative){if(n.relative.direction==="before")return t.insertBefore(e,n.relative.child);if(n.relative.direction==="after"){let i=(r=n.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var bs,Je,Jn=m(()=>{"use strict";en();Xe();Z();b();bs=(o,t,e)=>{let n=new URL(o);return n.searchParams.append(t,e),n.toString()},Je=class extends G{constructor(){super(...arguments);s(this,"type",V.IframeLoader);s(this,"load",async(e,n,r,i)=>{let a,p=n.loader;if((r==null?void 0:r.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,r),a=r,a.src=p.url;else{let d=T(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let g="\n padding: 0;\n margin: 0;\n position: absolute;\n inset: 0;\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\n width: 100%;\n overflow: hidden;\n border: none;\n opacity: ").concat(i!=null&&i.hidden?"0":"1",";\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\n ");a.style.cssText=g,i!=null&&i.elementAttributes&&Object.entries(i.elementAttributes).forEach(([u,y])=>{y===""||y===null||y===void 0?a.setAttribute(u,""):a.setAttribute(u,String(y))});let f=n.loader.url;i!=null&&i._hasParent&&(f=bs(f,"_myop-comp",d)),a.src=f,r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),a=this.appendChild(r,a,i)}return new Ce(e,n,r,a,i)})}}});var Qe,tn=m(()=>{"use strict";Qe={webcomponent_message_key:"myop_webcomponent_message"}});var xe,nn=m(()=>{"use strict";tn();Ne();Ge();xe=class extends j{constructor(e,n,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,"cleanupInspect",()=>{});s(this,"send",e=>{let n=h({},e),r=super.send(n),i=new CustomEvent(Qe.webcomponent_message_key,{detail:n});try{this.customElement.dispatchEvent(i)}catch(a){console.log("error while trying to dispatchEvent",a)}return r});s(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=je(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}}});var on,Ye,Qn=m(()=>{"use strict";nn();Xe();Z();b();on={},Ye=class extends G{constructor(){super(...arguments);s(this,"type",V.WebComponentLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader;on[a.url]?console.log("Module alreday loaded or in loading process"):on[a.url]=new Promise((c,g)=>{let f=a.url,u=document.createElement("script");u.type="module",u.src=f,u.onload=()=>{c()},u.onerror=()=>{g()},document.head.appendChild(u)}),await on[a.url],await yn(1);let p="myop-comp-".concat(T()),d=document.createElement(a.tag);return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),i!=null&&i._environment&&(d._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,d,i),new xe(e,n,r,d,i)})}}});var E,F=m(()=>{"use strict";b();E=class extends Ve{constructor(e,n){super(e);this.context=n;s(this,"executor",e=>{if(e.destination){let n=e.destination;if(this.context[n].context){let r=(i,a)=>{this.messageToHost(U(h({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[n].context,r)}else debugger}else debugger})}}});var D,X=m(()=>{"use strict";D={id:"myop-id"}});var w,Yn,B=m(()=>{"use strict";X();w=(o,t)=>t.querySelectorAll("[".concat(D.id,"='").concat(o.refConfig.selector,"']")),Yn=(o,t)=>{let e=w(o,t);return e.length?e.item(0):null}});var Ze,Zn=m(()=>{"use strict";M();x();F();B();Ze=class extends E{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"innerExecutor",(e,n,r)=>{let i=w(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=()=>{r(new ee(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var et,eo=m(()=>{"use strict";M();F();B();et=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var tt,to=m(()=>{"use strict";b();tt=class extends Me{constructor(e,n){super(e,n);this.container=e;this.shadowRoot=n}}});var nt,no=m(()=>{"use strict";b();X();F();x();M();nt=class extends E{constructor(){super(...arguments);s(this,"innerExecutor",(e,n)=>{let r=n.shadowRoot.querySelectorAll("[".concat(D.id,"]")),i=[];r.forEach(a=>{let p=a.getAttribute(D.id);p&&i.push(new ue(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new re(e.handlerUniqueId,i))});s(this,"messageType",l.DetectMyopRefsMessage)}}});var ot,oo=m(()=>{"use strict";M();F();B();ot=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var st,so=m(()=>{"use strict";M();x();F();B();pe();st=class extends E{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"innerExecutor",(e,n,r)=>{let i=w(e.ref,n.shadowRoot),a=[];return i.forEach(p=>{let d=c=>{r(new ne(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var rt,ro=m(()=>{"use strict";M();X();Le();We();F();rt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"innerExecutor",(e,n,r)=>{(async()=>{let a=n.shadowRoot.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=A.Instance(),d=p.components.find(u=>u.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let g=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),f=[];Object.keys(g.refs).forEach(u=>{let y=g.refs[u];y=y.__nonProxied||y,y.componentDefinition&&f.push({refName:u,componentDefinitionId:y.componentDefinition.id})}),r(new N(e.handlerUniqueId,f))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new N(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var it,sn=m(()=>{"use strict";pe();it=(o,t,e)=>{let n=o.scriptInputs?o.scriptInputs:{};n.makeSerializable=O,n.send=t,n.rootRef=e,n.__scriptInputs=n;let i=new Function("return (".concat(o.script,")(...arguments)"))(n);t(i)}});var at,io=m(()=>{"use strict";M();x();F();sn();at=class extends E{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"innerExecutor",(e,n,r)=>{it(e,a=>{r(new te(e.handlerUniqueId,a))},n)})}}});var ao,pt,po=m(()=>{"use strict";M();x();F();B();X();pe();ao=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(D.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:ao(i),required:i.required,validity:O(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},pt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"innerExecutor",(e,n,r)=>{w(e.ref,n.shadowRoot).forEach(a=>{r(new oe(ao(a)),e)})})}}});var dt,co=m(()=>{"use strict";M();F();B();dt=class extends E{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"innerExecutor",(e,n)=>{w(e.ref,n.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var mo={};Q(mo,{WebComponentSDK:()=>be});var be,rn=m(()=>{"use strict";b();M();tn();Zn();eo();to();no();Y();x();oo();so();ro();io();po();co();be=class extends ye{constructor(){super(...arguments);s(this,"alwaysPassEnvelopesToHost",!0);s(this,"connectedCallback",(e,n)=>{e.addEventListener(Qe.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new tt(e,n)}}}),setTimeout(()=>{this.messageToHost(new se)},1)});s(this,"messageToHost",(e,n)=>{e.direction=R.up,!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,"supportedHandlers",[new et(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new Ze(this.messageToHost,this.components),new nt(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new st(this.messageToHost,this.components),new at(this.messageToHost,this.components),new pt(this.messageToHost,this.components),new rt(this.messageToHost,this.components)]);s(this,"init",()=>{})}};z("WebComponentSDK",be)});var lo=m(()=>{"use strict";rn()});var fo,go=m(()=>{"use strict";fo=""});function ws(o,t){return class extends HTMLElement{connectedCallback(){let e=t===ie.open?"open":"closed",n=this.attachShadow({mode:e});ho().then(r=>{r.connectedCallback(this,n),n.innerHTML=o})}}}var yo,ct,ho,Ss,Ts,Es,mt,Mo=m(()=>{"use strict";nn();Xe();Z();b();lo();en();go();yo=[],ho=async()=>(ct||(ct=new be,ct.init()),ct);Ss=(o,t,e)=>{customElements.define(o,ws(t,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Ts=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\d+)/g,"-$1").toLowerCase(),Es=o=>(o=Ts(o),o.replace(/_/g,"-")),mt=class extends G{constructor(){super(...arguments);s(this,"type",V.HTMLLoader);s(this,"load",async(e,n,r,i)=>{let a=n.loader,p="myop-comp-".concat(T()),d;if(a.shadowRootMode===ie.localFrame){let c=T(),g="myop-comp-".concat(c),f=document.createElement("iframe");f.id=g,f.style.cssText="\n display: block;\n padding: 0;\n margin: 0;\n position: absolute;\n inset: 0;\n overflow: hidden;\n border: none;\n opacity: ".concat(i!=null&&i.hidden?"0":"1",";\n width: 100%;\n height: 100%;\n pointer-events: ").concat(i!=null&&i.hidden?"none":"all",";\n "),r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),f=this.appendChild(r,f,i);let u=f.contentDocument||f.contentWindow.document;u.open();let y=a.HTML;if(i!=null&&i._inspection){let P=new DOMParser().parseFromString(a.HTML,"text/html"),de=P.getElementById("myop_preview");de==null||de.removeAttribute("type");let ce=P.implementation.createHTMLDocument();ce.body.innerHTML="<script>\n const beforeKeysWindow = new Set(Object.keys(window));\n window.myopState = {\n beforeKeysWindow,\n };\n <\/script>";let Se=ce.body.firstChild;Se&&P.head&&P.head.insertBefore(P.importNode(Se,!0),P.head.firstChild),y=P.documentElement.outerHTML}u.writeln(y);let S='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\/script>'),Ke="<script>\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\n const __myop_init = async () => {\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\n const sdk = new IframeSDK();\n sdk.init();\n }\n __myop_init().then();\n <\/script>";u.writeln("".concat(S).concat(Ke)),u.close();let Ae=new Ce(e,n,r,f,i);return a.autoHeight&&(f.onload=()=>{Ae.observeSizeBasedOnDocumentElement()}),Ae}if(a.shadowRootMode===ie.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,ho().then(g=>{g.connectedCallback(d,d)})}else{let c=Es(e.name+n.id);yo.includes(c)||(Ss(c,a.HTML,a.shadowRootMode),yo.push(c)),d=document.createElement(c)}return r.querySelector('[id^="myop-comp-"]')||(r.innerHTML=""),d.id=p,i!=null&&i.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(r,d,i),new xe(e,n,r,d,i)})}}});var Io,Co,xo=m(()=>{"use strict";Z();x();Io=(o,t,e)=>{let n="myop-css-".concat(T());return o.send(new _(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let g in i){c+="".concat(g," { ");let f=i[g];for(let u in f)c+="".concat(u,": ").concat(f[u],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(r.shadowRoot||r.container).appendChild(d)},()=>{},{_stylesheet:t,_css:e||"",_tagId:n})),()=>{o.send(new _(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:n}))}},Co=(o,t)=>{let e="myop-css-".concat(T());return o.send(new _(({rootRef:n,_tagId:r,_link:i})=>{let a=document.createElement("link");a.id=r,a.rel="stylesheet",a.href=i,document.head.appendChild(a),(n.shadowRoot||n.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{o.send(new _(({rootRef:n,_tagId:r})=>{let i=(n.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var Rs,an,bo,wo=m(()=>{"use strict";Rs=(o,t)=>{let e=new RegExp(Object.keys(t).join("|"),"g");return o.replace(e,n=>(t[n]||n).toString())},an=(o,t)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=h({},o.loader),o.loader.url=Rs(o.loader.url,t),o},bo=o=>async t=>an(t,o)});var So,To,Eo=m(()=>{"use strict";x();So=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.add(r)},{elementId:e,_className:t}))},To=(o,t,e)=>{o.send(new W(({ref:n,_className:r})=>{n==null||n.classList.remove(r)},{elementId:e,_className:t}))}});var gt,lt,ut,ft,Ro=m(()=>{"use strict";Z();gt=class gt{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"id",this._runTimeId);s(this,"name",this._runTimeName);s(this,"description","");s(this,"loader",null);s(this,"withLoader",t=>(this.loader=t,this));s(this,"withHTMLLoader",t=>(t.type="HTMLLoader",this.loader=t,this));s(this,"build",()=>this)}};s(gt,"create",()=>new gt);lt=gt,ut=class ut{constructor(){s(this,"_runTimeInstanceId","runtime-instance-id-"+T());s(this,"_runTimeId","runtime-id-"+T());s(this,"_runTimeName","runtime-name-"+T());s(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,"name",this._runTimeName);s(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});s(this,"withInstance",t=>(this.instance=t,this));s(this,"withType",t=>(this.type=t,this));s(this,"withName",t=>(this.name=t,this));s(this,"withDefaultSkin",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:t.id}},this));s(this,"withRef",t=>(this.type.refs.push(t),this));s(this,"withBasicRef",t=>{let e={id:"",name:t,description:"",selectorType:"id-attribute",selector:t,behavior:{type:"code"}};return this.type.refs.push(e),this});s(this,"build",()=>JSON.parse(JSON.stringify(this)))}};s(ut,"create",()=>new ut);ft=ut});var vs,yt,J,vo,ko=m(()=>{"use strict";b();vs=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:Ie.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:Ie.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),yt=class yt{constructor(t="https://cloud.myop.dev"){this._baseUrl=t;s(this,"variants",{});s(this,"userFlows",{});s(this,"_defaultEnv","production")}setEnvironment(t){this._defaultEnv=t}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(t,e,n){return"".concat(t,":").concat(e||this._defaultEnv,":").concat(n?"preview":"live")in this.variants}async fetchComponentV2(t,e,n){let r=e||this._defaultEnv,i="".concat(t,":").concat(r,":").concat(n?"preview":"live");return this.variants[i]||(this.variants[i]=new Promise(async(a,p)=>{try{let d="".concat(this._baseUrl,"/consume?id=").concat(t,"&env=").concat(r);n&&(d+="&preview=true");let f=(await(await fetch(d)).json()).item;if(!f){p(new Error('Component "'.concat(t,'" not found')));return}if(!f.consume_variant||!f.consume_variant.length){p(new Error('Component "'.concat(t,'" has no implementation for environment "').concat(r,'"')));return}let u=vs(f);a(u)}catch(d){p(d)}})),await this.variants[i]}async fetchComponentV1(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&auto=true"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,n)=>{try{let i=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(t,"&resolve=components"))).json();e(i.item)}catch(r){n(r)}})),await this.userFlows[t]}async fetchComponent(t,e){return this.fetchComponentV1(t,e)}};s(yt,"Main",new yt);J=yt,vo=J});var Ho,_o=m(()=>{"use strict";Ho=async o=>await o()});var pn={};Q(pn,{CloudRepository:()=>J,ComponentConfig:()=>ft,SkinConfig:()=>lt,addClass:()=>So,applyStylesheet:()=>Io,applyStylesheetLink:()=>Co,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>an,exec:()=>Ho,removeClass:()=>To,v2_CloudRepository:()=>vo});var ht=m(()=>{"use strict";xo();wo();Eo();Ro();ko();_o()});var Do,Bo=m(()=>{"use strict";Lt();ht();b();Do=async o=>{try{let t=new URL(window.location.href),n=new URLSearchParams(t.search).get("myopOverride");if(n){let[r,...i]=Bt(n);switch(r){case"component":{let[a,p]=i,d=await J.Main.fetchComponent(a);if(d&&d.type.skins.find(g=>g.id===p))return d.instance.skinSelector={type:ae.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=Bt(n),c=(await J.Main.fetchFlow(a)).components.find(g=>g.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ae.Segmented&&c.instance.resolvedExperiences){let g=c.instance.resolvedExperiences.find(f=>f.id===p);if((g==null?void 0:g.type)===qe.Segment){let f=g,y=c.instance.skinSelector.segments.find(S=>S.segmentId===f.segment.id);if(y)return c.instance.skinSelector=y==null?void 0:y.skinSelector,c}}}break}}}finally{return null}}});var Po={};Q(Po,{HostSDK:()=>A,hostSDK:()=>Oo});var Lo,A,Oo,Le=m(()=>{"use strict";Y();M();x();Jn();Qn();Ge();b();Ue();Mo();Bo();Lo="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",A=class{constructor(){s(this,"components2init",[]);s(this,"components",[]);s(this,"componentsLoaders",[]);s(this,"initiated",!1);s(this,"version",le);s(this,"type2InstanceCount",{});s(this,"assignId",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),"".concat(t.id,"_").concat(++this.type2InstanceCount[t.id])));s(this,"inspected",!1);s(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,"incomingMessageHandler",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new fe(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===K.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let n=this.components.find(r=>r.id===e.destination);if(!n){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(n){if(n.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,"send",t=>{let e=new MessageEvent("",{data:t});this.incomingMessageHandler(e)});s(this,"init",t=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new Je,new Ye,new mt];if(this.componentsLoaders=[...e],t){let n={};t.forEach(r=>{let i=new r(this.componentsLoaders);n[i.type]=i}),this.componentsLoaders.forEach(r=>{n[r.type]||(n[r.type]=r)}),this.componentsLoaders=Object.values(n)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});s(this,"_getSkinIdBySkinSelector",async(t,e=[],n)=>{var i;async function r(a,p){for(let d of a)if(await p(d))return d}switch(t.type){case"DedicatedSkin":case ae.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case ae.Segmented:{let p=await r(t.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(y=>y.type===qe.Segment?y.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let f=c.segment,u=(n||{})[f.function];return u?await u():(console.warn("segmentId:".concat(d.segmentId,", ").concat(f.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});s(this,"runSkinSelector",async(t,e)=>{let n=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===n)});s(this,"loaderHooks");s(this,"loadComponent",async(t,e,n)=>{var g,f,u,y;if(!e){debugger;throw new Error("no container was found for this component")}let r=await Do(t);r&&(t=r);let i=h(h({},(g=this.loaderHooks)!=null?g:{}),(f=n==null?void 0:n.hooks)!=null?f:{}),a=e;if(a.myop)if(a.component){t=h({},t),t.instance=h({},t.instance);let S=await this.runSkinSelector(t,i);if(!S)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(u=n==null?void 0:n.hooks)!=null&&u.afterSkinSelected&&(S=await n.hooks.afterSkinSelected(h({},S))),t.instance.skinSelector={type:ae.Dedicated,skin:S},n&&(n=h({},n),delete n.hooks),await Yt(a,t,this.components,n)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(y=n==null?void 0:n.hooks)!=null&&y.afterSkinSelected&&(p=await n.hooks.afterSkinSelected(h({},p)));let d=this.componentsLoaders.find(S=>S.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(t.type,p,e,n);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(S=>S!==c),this.components2init=this.components2init.filter(S=>S!==c),!0)),this.components.push(c),(!n||n.connectProps!==!1)&&(c=Xn(c,t.type.props,p));try{await Zt(c,t,this.components)}catch(S){throw S}return n!=null&&n.skipInit||await c.initiated(),c});s(this,"navigate",async(t,e,n)=>{if(t.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(n!=null&&n.staged){let r=await this.loadComponent(e,t.container,h({hidden:!0,relative:{direction:"after",child:t.element}},n));return n.init&&await n.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,h({relative:{direction:"before",child:r}},n))}})}};s(A,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Lo});if(!window.myop.hostSDK){let o=new A;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Lo}),window.myop.hostSDK=o}Oo=window.myop.hostSDK;z("hostSDK",Oo)});var Mt,Ko=m(()=>{"use strict";M();X();b();x();Mt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.DetectMyopRefsMessage);s(this,"executor",e=>{let n=document.querySelectorAll("[".concat(D.id,"]")),r=[];n.forEach(i=>{let a=i.getAttribute(D.id);a&&r.push(new ue(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new re(e.handlerUniqueId,r))})}}});var It,Ao=m(()=>{"use strict";M();b();x();B();It=class extends C{constructor(){super(...arguments);s(this,"messageType",l.BindClickMessage);s(this,"executor",e=>{let n=[];return w(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new ee,e)};i.addEventListener("click",a);let p=()=>{i.removeEventListener("click",a)};n.push(p)}),()=>{n.forEach(i=>i())}})}}});var Ct,zo=m(()=>{"use strict";M();b();B();Ct=class extends C{constructor(){super(...arguments);s(this,"messageType",l.ChangeTextMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var xt,Fo=m(()=>{"use strict";M();x();b();sn();xt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.ExecuteScriptMessage);s(this,"executor",e=>{it(e,r=>{this.messageToHost(new te(e.handlerUniqueId,r))},new Me(document.documentElement))})}}});var bt,$o=m(()=>{"use strict";M();b();x();pe();B();bt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.AddEventListenerMessage);s(this,"executor",e=>{let n=w(e.ref,document),r=[];return n.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new ne(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var wt,Uo=m(()=>{"use strict";M();b();B();wt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetAttributeMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var St,Wo=m(()=>{"use strict";M();X();b();Le();We();St=class extends C{constructor(){super(...arguments);s(this,"messageType",l.CreateRefComponentMessage);s(this,"executor",e=>{(async()=>{let r=document.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(r.length===1){let a=await A.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new N(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new N(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var No,Vo=m(()=>{"use strict";No=(o,t)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let n=new e(t),r={attributes:!0,childList:!0,subtree:!0};return n.observe(o,r),n}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",t,!1),o.addEventListener("DOMNodeRemoved",t,!1))}});var Tt,qo=m(()=>{"use strict";M();x();b();Vo();Tt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetMutationObserverMessage);s(this,"executor",e=>{e.source&&No(document.body,()=>{this.messageToHost(new ke)})})}}});var jo,Et,Go=m(()=>{"use strict";M();X();b();x();pe();B();jo=o=>{if(!o)return null;if(o.tagName==="FORM"){let t=new FormData(o),e={formData:{},unmappedData:[]},n=o.querySelectorAll("input, select, textarea"),r=-1;return n.forEach(i=>{if(typeof i.value=="string"){let a=i.getAttribute(D.id),p=i.getAttribute("name"),d={id:i.id,name:p,value:jo(i),required:i.required,validity:O(i.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Et=class extends C{constructor(){super(...arguments);s(this,"messageType",l.GetElementValueMessage);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{this.messageToHost(new oe(jo(r)),e)})})}}});var Rt,Xo=m(()=>{"use strict";M();b();x();B();Rt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.GetAttributeMessage);s(this,"executor",e=>{let n=Yn(e.ref,document);n&&this.messageToHost(new ve(n.getAttribute(e.name)),e)})}}});var vt,Jo=m(()=>{"use strict";x();M();b();vt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetResizeObserverMessage);s(this,"executor",e=>{let n=new ResizeObserver(r=>{this.messageToHost(new Be)});return n.observe(document.body),()=>{n.disconnect()}})}}});var kt,Qo=m(()=>{"use strict";M();b();B();kt=class extends C{constructor(){super(...arguments);s(this,"messageType",l.SetInnerHtml);s(this,"executor",e=>{w(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var Yo={};Q(Yo,{IframeSDK:()=>Ht});var Ht,Zo=m(()=>{"use strict";b();Ko();Ao();zo();Fo();Y();$o();Uo();x();Wo();qo();Go();Ue();Xo();Jo();Qo();Ht=class extends ye{constructor(){super();s(this,"version",le);s(this,"messageToHost",(e,n)=>{var i;!e.replayToHandler&&(n!=null&&n.handlerUniqueId)&&(e.replayToHandler=n.handlerUniqueId);let r=Object.keys(this.components);e.destination||(n!=null&&n.route?e.destination=n.route[n.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(h({},e),"*")});s(this,"supportedHandlers",[new Ct(this.messageToHost),new kt(this.messageToHost),new It(this.messageToHost),new Mt(this.messageToHost),new xt(this.messageToHost),new bt(this.messageToHost),new wt(this.messageToHost),new Et(this.messageToHost),new Tt(this.messageToHost),new vt(this.messageToHost),new Rt(this.messageToHost),new St(this.messageToHost)]);s(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new se)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};z("IframeSDK",Ht)});var Hs={};var ks,es=m(()=>{"use strict";x();Y();ks=h({},ge);z("MyopMessages",ks)});var ts={};Q(ts,{CloudRepository:()=>J,ComponentConfig:()=>ft,SkinConfig:()=>lt,addClass:()=>So,applyStylesheet:()=>Io,applyStylesheetLink:()=>Co,changeSkinUrlByTokenizer:()=>bo,createIframeSkinByTokenizer:()=>an,exec:()=>Ho,removeClass:()=>To,v2_CloudRepository:()=>vo});var ns=m(()=>{"use strict";Y();ht();ht();z("MyopHelpers",pn)});var Os={};Q(Os,{getHostModule:()=>os,getIframeModule:()=>ss,getWebcomponentModule:()=>rs});Y();var un;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(un=document.currentScript)==null?void 0:un.src,t=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,t,e)=>{if(window.__federation__[t])console.log("__federation__ module ".concat(t," already loaded.")),e(window.__federation__[t][Dt]);else{let n;window.__federation__[t]={},window.__federation__[t][$e]=r=>{n&&(document.head.removeChild(n),n=null),window.__federation__[t][Dt]=r,e(r)},n=document.createElement("script"),n.type="module",n.src=o,n.async=!0,document.head.appendChild(n)}};Ue();console.log("myop root sdk - loaded",document.location.origin);var _s="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",os=()=>Promise.resolve().then(()=>(Le(),Po)),ss=()=>Promise.resolve().then(()=>(Zo(),Yo)),rs=()=>Promise.resolve().then(()=>(rn(),mo)),Ds=()=>Promise.resolve().then(()=>(es(),Hs)),Bs=()=>Promise.resolve().then(()=>(ns(),ts)),Pe=o=>async()=>(await o()).get(),Ls={version:le,getHostModule:Pe(os),getIframeModule:Pe(ss),getWebcomponentModule:Pe(rs),getMyopMessages:Pe(Ds),getMyopHelpers:Pe(Bs)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:_s});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=h({rootSDK:Ls},window.myop);return gs(Os);})();
|