@machinemetrics/mm-react-embeddable 1.0.4 → 1.0.6-0
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/mm-react-embeddable.cjs.js +11 -11
- package/dist/mm-react-embeddable.es.js +353 -337
- package/dist/mm-react-embeddable.umd.js +11 -11
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),H=require("prop-types"),Ye=require("styled-components");var ye={exports:{}},N={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ve;function wr(){if(Ve)return N;Ve=1;var n=v,o=Symbol.for("react.element"),T=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,h=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function k(O,R,S){var m,x={},M=null,A=null;S!==void 0&&(M=""+S),R.key!==void 0&&(M=""+R.key),R.ref!==void 0&&(A=R.ref);for(m in R)c.call(R,m)&&!E.hasOwnProperty(m)&&(x[m]=R[m]);if(O&&O.defaultProps)for(m in R=O.defaultProps,R)x[m]===void 0&&(x[m]=R[m]);return{$$typeof:o,type:O,key:M,ref:A,props:x,_owner:h.current}}return N.Fragment=T,N.jsx=k,N.jsxs=k,N}var G={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+s[
|
|
17
|
+
*/var qe;function Sr(){return qe||(qe=1,process.env.NODE_ENV!=="production"&&function(){var n=v,o=Symbol.for("react.element"),T=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),O=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),i=Symbol.iterator,g="@@iterator";function l(e){if(e===null||typeof e!="object")return null;var r=i&&e[i]||e[g];return typeof r=="function"?r:null}var f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];w("error",e,t)}}function w(e,r,t){{var a=f.ReactDebugCurrentFrame,p=a.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var b=t.map(function(u){return String(u)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var D=!1,Y=!1,$=!1,z=!1,X=!1,U;U=Symbol.for("react.module.reference");function ie(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===E||X||e===h||e===S||e===m||z||e===A||D||Y||$||typeof e=="object"&&e!==null&&(e.$$typeof===M||e.$$typeof===x||e.$$typeof===k||e.$$typeof===O||e.$$typeof===R||e.$$typeof===U||e.getModuleId!==void 0))}function se(e,r,t){var a=e.displayName;if(a)return a;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function Z(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case T:return"Portal";case E:return"Profiler";case h:return"StrictMode";case S:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return Z(r)+".Consumer";case k:var t=e;return Z(t._context)+".Provider";case R:return se(e,e.render,"ForwardRef");case x:var a=e.displayName||null;return a!==null?a:I(e.type)||"Memo";case M:{var p=e,b=p._payload,u=p._init;try{return I(u(b))}catch{return null}}}return null}var W=Object.assign,B=0,he,Ee,Re,_e,we,Se,Ce;function Te(){}Te.__reactDisabledLog=!0;function He(){{if(B===0){he=console.log,Ee=console.info,Re=console.warn,_e=console.error,we=console.group,Se=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Te,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}B++}}function ze(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:he}),info:W({},e,{value:Ee}),warn:W({},e,{value:Re}),error:W({},e,{value:_e}),group:W({},e,{value:we}),groupCollapsed:W({},e,{value:Se}),groupEnd:W({},e,{value:Ce})})}B<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=f.ReactCurrentDispatcher,ce;function Q(e,r,t){{if(ce===void 0)try{throw Error()}catch(p){var a=p.stack.trim().match(/\n( *(at )?)/);ce=a&&a[1]||""}return`
|
|
18
|
+
`+ce+e}}var le=!1,ee;{var Xe=typeof WeakMap=="function"?WeakMap:Map;ee=new Xe}function Oe(e,r){if(!e||le)return"";{var t=ee.get(e);if(t!==void 0)return t}var a;le=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=ue.current,ue.current=null,He();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(j){a=j}Reflect.construct(e,[],u)}else{try{u.call()}catch(j){a=j}e.call(u.prototype)}}else{try{throw Error()}catch(j){a=j}e()}}catch(j){if(j&&a&&typeof j.stack=="string"){for(var s=j.stack.split(`
|
|
19
|
+
`),P=a.stack.split(`
|
|
20
|
+
`),y=s.length-1,_=P.length-1;y>=1&&_>=0&&s[y]!==P[_];)_--;for(;y>=1&&_>=0;y--,_--)if(s[y]!==P[_]){if(y!==1||_!==1)do if(y--,_--,_<0||s[y]!==P[_]){var F=`
|
|
21
|
+
`+s[y].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&ee.set(e,F),F}while(y>=1&&_>=0);break}}}finally{le=!1,ue.current=b,ze(),Error.prepareStackTrace=p}var q=e?e.displayName||e.name:"",L=q?Q(q):"";return typeof e=="function"&&ee.set(e,L),L}function Qe(e,r,t){return Oe(e,!1)}function er(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function re(e,r,t){if(e==null)return"";if(typeof e=="function")return Oe(e,er(e));if(typeof e=="string")return Q(e);switch(e){case S:return Q("Suspense");case m:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case R:return Qe(e.render);case x:return re(e.type,r,t);case M:{var a=e,p=a._payload,b=a._init;try{return re(b(p),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,Pe={},xe=f.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function rr(e,r,t,a,p){{var b=Function.call.bind(J);for(var u in e)if(b(e,u)){var s=void 0;try{if(typeof e[u]!="function"){var P=Error((a||"React class")+": "+t+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}s=e[u](r,u,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){s=y}s&&!(s instanceof Error)&&(te(p),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,u,typeof s),te(null)),s instanceof Error&&!(s.message in Pe)&&(Pe[s.message]=!0,te(p),d("Failed %s type: %s",t,s.message),te(null))}}}var tr=Array.isArray;function fe(e){return tr(e)}function nr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ar(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function ke(e){if(ar(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),je(e)}var K=f.ReactCurrentOwner,or={key:!0,ref:!0,__self:!0,__source:!0},Me,Fe,de;de={};function ir(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function sr(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ur(e,r){if(typeof e.ref=="string"&&K.current&&r&&K.current.stateNode!==r){var t=I(K.current.type);de[t]||(d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',I(K.current.type),e.ref),de[t]=!0)}}function cr(e,r){{var t=function(){Me||(Me=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function lr(e,r){{var t=function(){Fe||(Fe=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var fr=function(e,r,t,a,p,b,u){var s={$$typeof:o,type:e,key:r,ref:t,props:u,_owner:b};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function dr(e,r,t,a,p){{var b,u={},s=null,P=null;t!==void 0&&(ke(t),s=""+t),sr(r)&&(ke(r.key),s=""+r.key),ir(r)&&(P=r.ref,ur(r,p));for(b in r)J.call(r,b)&&!or.hasOwnProperty(b)&&(u[b]=r[b]);if(e&&e.defaultProps){var y=e.defaultProps;for(b in y)u[b]===void 0&&(u[b]=y[b])}if(s||P){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&cr(u,_),P&&lr(u,_)}return fr(e,s,P,p,a,K.current,u)}}var ve=f.ReactCurrentOwner,Ie=f.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(t)}else Ie.setExtraStackFrame(null)}var pe;pe=!1;function ge(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function De(){{if(ve.current){var e=I(ve.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function vr(e){return""}var
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function vr(e){return""}var Ae={};function pr(e){{var r=De();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function $e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=pr(r);if(Ae[t])return;Ae[t]=!0;var a="";e&&e._owner&&e._owner!==ve.current&&(a=" It was passed a child from "+I(e._owner.type)+"."),V(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),V(null)}}function Ue(e,r){{if(typeof e!="object")return;if(fe(e))for(var t=0;t<e.length;t++){var a=e[t];ge(a)&&$e(a,r)}else if(ge(e))e._store&&(e._store.validated=!0);else if(e){var p=l(e);if(typeof p=="function"&&p!==e.entries)for(var b=p.call(e),u;!(u=b.next()).done;)ge(u.value)&&$e(u.value,r)}}}function gr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===R||r.$$typeof===x))t=r.propTypes;else return;if(t){var a=I(r);rr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!pe){pe=!0;var p=I(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){V(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),V(null);break}}e.ref!==null&&(V(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var We={};function Le(e,r,t,a,p,b){{var u=ie(e);if(!u){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var P=vr();P?s+=P:s+=De();var y;e===null?y="null":fe(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(I(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,s)}var _=dr(e,r,t,p,b);if(_==null)return _;if(u){var F=r.children;if(F!==void 0)if(a)if(fe(F)){for(var q=0;q<F.length;q++)Ue(F[q],e);Object.freeze&&Object.freeze(F)}else d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ue(F,e)}if(J.call(r,"key")){var L=I(e),j=Object.keys(r).filter(function(_r){return _r!=="key"}),be=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!We[L+be]){var Rr=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";d(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,be,L,Rr,L),We[L+be]=!0}}return e===c?br(_):gr(_),_}}function mr(e,r,t){return Le(e,r,t,!0)}function yr(e,r,t){return Le(e,r,t,!1)}var hr=yr,Er=mr;G.Fragment=c,G.jsx=hr,G.jsxs=Er}()),G}process.env.NODE_ENV==="production"?ye.exports=wr():ye.exports=Sr();var ae=ye.exports;const C=[];for(let n=0;n<256;++n)C.push((n+256).toString(16).slice(1));function Cr(n,o=0){return(C[n[o+0]]+C[n[o+1]]+C[n[o+2]]+C[n[o+3]]+"-"+C[n[o+4]]+C[n[o+5]]+"-"+C[n[o+6]]+C[n[o+7]]+"-"+C[n[o+8]]+C[n[o+9]]+"-"+C[n[o+10]]+C[n[o+11]]+C[n[o+12]]+C[n[o+13]]+C[n[o+14]]+C[n[o+15]]).toLowerCase()}let me;const Tr=new Uint8Array(16);function Or(){if(!me){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");me=crypto.getRandomValues.bind(crypto)}return me(Tr)}const Pr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ze={randomUUID:Pr};function xr(n,o,T){var h;if(Ze.randomUUID&&!o&&!n)return Ze.randomUUID();n=n||{};const c=n.random??((h=n.rng)==null?void 0:h.call(n))??Or();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,Cr(c)}const oe=v.createContext(null),Be=({children:n})=>{const[o,T]=v.useState({}),c=v.useRef({}),h=v.useRef({}),E=v.useRef({}),k=v.useCallback((i,g)=>{var l;return!!((l=E.current[i])!=null&&l.has(g))},[]),O=v.useCallback((i,g,l)=>{T(f=>({...f,[i]:{origin:g,frameRef:l}}))},[]),R=v.useCallback(i=>{T(g=>{const l={...g};return delete l[i],l}),delete E.current[i]},[]);v.useEffect(()=>{const i=(l=[],f)=>{l.forEach(d=>d(f))},g=l=>{var D,Y,$,z,X;if(!((D=l==null?void 0:l.data)!=null&&D.instanceId))return;const{instanceId:f,type:d}=l.data,w=c.current;if(d==="response"){const{callbackId:U,response:ie,error:se}=l.data,Z=h.current[U];Z&&(Z(ie,se),delete h.current[U]);return}if(d==="mark-registered"){const{requestType:U}=l.data;E.current[f]||(E.current[f]=new Set),E.current[f].add(U);return}i((Y=w[f])==null?void 0:Y[d],l.data),i(($=w["*"])==null?void 0:$[d],l.data),i((z=w[f])==null?void 0:z["*"],l.data),i((X=w["*"])==null?void 0:X["*"],l.data)};return window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}},[o]);const S=v.useCallback((i,g,l)=>{var d,w;const f=o[i];if(!f){console.warn(`Origin not set for id: ${i}. Unable to send message.`);return}(w=(d=f==null?void 0:f.frameRef)==null?void 0:d.current)!=null&&w.contentWindow&&f.frameRef.current.contentWindow.postMessage({type:g,...l,instanceId:i},f.origin)},[o]),m=v.useCallback(async(i,g,l={})=>new Promise((f,d)=>{if(!k(i,g)){d(new Error(`No handler registered for request type: ${g}`));return}const w=xr(),D=(Y,$)=>{delete h.current[w],$?d($):f(Y)};h.current[w]=D,S(i,"request",{callbackId:w,requestType:g,data:l})}),[S,k]),x=v.useCallback((i,g)=>{S(i,"load-options",g)},[S]),M=v.useCallback((i,g)=>{S(i,"validate",g)},[S]),A=v.useMemo(()=>({registerFrame:O,unregisterFrame:R,sendMessage:S,sendRequest:m,loadOptions:x,validate:M,hasHandler:k,addListener:(i,g,l)=>(c.current[i]||(c.current[i]={}),c.current[i][g]||(c.current[i][g]=[]),c.current[i][g].push(l),()=>{c.current[i][g]=c.current[i][g].filter(f=>f!==l)})}),[O,R,S,m,x,M,k]);return ae.jsx(oe.Provider,{value:A,children:n})},ne={},Je=async n=>{try{const o=new URL(n).origin;if(ne[o]!==void 0)return ne[o];const c=await(await fetch(`${o}/mm-app-manifest.json`)).json();if(!c.version)throw new Error("Invalid manifest");return ne[o]=c,c}catch{}return ne[origin]=!1,!1},Ke=async n=>!!await Je(n),Ne=(n,o,T)=>{const c=v.useContext(oe);if(c===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const h=v.useRef(T);v.useEffect(()=>{h.current=T},[T]),v.useEffect(()=>{if(!(!n||!o))return c.addListener(n,o,(...E)=>h.current(...E))},[c,n,o])};Be.propTypes={children:H.node.isRequired};const jr=Ye.default||Ye,kr=jr.iframe`
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
33
33
|
border: none;
|
|
34
34
|
visibility: ${n=>n.$isReady?"visible":"hidden"};
|
|
35
|
-
`,
|
|
35
|
+
`,Ge=({id:n,src:o,path:T,onInit:c=()=>{},context:h={},params:E={},...k})=>{if("isConfiguring"in k)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in h)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in h)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const O=v.useRef(),[R,S]=v.useState(),[m,x]=v.useState(0),{registerFrame:M,unregisterFrame:A,sendMessage:i}=v.useContext(oe),[g,l]=v.useState(!0),[f,d]=v.useState();return v.useEffect(()=>{m&&i(n,"set-context",{context:{...h,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[h,E.colorMode,E.isFullScreen,n,m]),v.useEffect(()=>{m&&(i(n,"set-params",{params:E}),i(n,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,n,m]),v.useEffect(()=>{T!==void 0&&d(T)},[T]),v.useEffect(()=>{f===void 0||!m||i(n,"navigate",{path:f})},[f,m,n,i]),v.useEffect(()=>{if(!(!o||!n||!O))return(async()=>{const w=await Ke(o);if(l(w),w){const D=new URL(o);M(n,D.origin,O),c(),S(`${D.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{A(n)}},[o,n,M,O]),Ne(n,"ready",()=>x(w=>w+1)),g?ae.jsx(kr,{$isReady:m,ref:O,src:R,...k}):ae.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:ae.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ge.propTypes={id:H.string,src:H.string.isRequired,path:H.string,onInit:H.func};exports.MMEmbeddableZone=Ge;exports.MMEmbeddableZoneContext=oe;exports.MMEmbeddableZoneProvider=Be;exports.getAppInfo=Je;exports.testIsEmbeddable=Ke;exports.useEmbeddedEffect=Ne;
|