iframe-coordinator-cli 6.0.1 → 6.1.1

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.
@@ -16,7 +16,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
16
16
  `+i(o));return s.name="Decoding error",s}).unwrap()}}var ae={},oe={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Err=e.Ok=e.default=void 0;function t(f,c){if(!(f instanceof c))throw new TypeError("Cannot call a class as a function")}function r(f,c){for(var l=0;l<c.length;l++){var v=c[l];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}function n(f,c,l){return c&&r(f.prototype,c),l&&r(f,l),f}var i="Ok",a="Err",o=function(){function f(c){t(this,f),this._r=c}return n(f,[{key:"toString",value:function(){var l=this._r;return l.type===i?"Ok(".concat(String(l.value),")"):"Err(".concat(String(l.error),")")}},{key:"isOk",value:function(){return this._r.type===i}},{key:"isErr",value:function(){return this._r.type===a}},{key:"withDefault",value:function(l){var v=this._r;return v.type===i?v.value:l}},{key:"value",value:function(){var l=this._r;return l.type===i?l.value:void 0}},{key:"errValue",value:function(){var l=this._r;return l.type===a?l.error:void 0}},{key:"unwrap",value:function(){var l=this._r;if(l.type===i)return l.value;throw l.error}},{key:"expect",value:function(l){var v=this._r;if(v.type===i)return v.value;throw l instanceof Error?l:new Error(l)}},{key:"dispatch",value:function(l,v){var p=this._r;return p.type===i?l(p.value):v(p.error)}},{key:"andThen",value:function(l){var v=this._r;return v.type===i?l(v.value):f.err(v.error)}},{key:"map",value:function(l){var v=this._r;return v.type===i?f.ok(l(v.value)):f.err(v.error)}},{key:"mapError",value:function(l){var v=this._r;return v.type===i?f.ok(v.value):f.err(l(v.error))}}],[{key:"ok",value:function(l){return new f({type:i,value:l})}},{key:"err",value:function(l){return new f({type:a,error:l})}}]),f}();e.default=o;var s=function(c){return o.ok(c)};e.Ok=s;var u=function(c){return o.err(c)};e.Err=u})(oe);Object.defineProperty(ae,"__esModule",{value:!0});ae.map=Nu;ae.compose=wo;ae.predicate=Lu;ae.isDate=void 0;var ju=re,Cn=oe,Iu=function(t){return t!=null&&Object.prototype.toString.call(t)==="[object Date]"&&!isNaN(t)};ae.isDate=Iu;function Nu(e,t){return wo(e,function(r){return(0,Cn.Ok)(t(r))})}function wo(e,t){return function(r){return e(r).andThen(t)}}function Lu(e,t){return function(r){return e(r)?(0,Cn.Ok)(r):(0,Cn.Err)((0,ju.annotate)(r,t))}}var St={};Object.defineProperty(St,"__esModule",{value:!0});St.array=Wu;St.poja=void 0;var En=re,xr=oe,Du=ae;function ku(e){return Hu(e)||Uu(e)||Fu()}function Fu(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function Uu(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Hu(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}var Oo=function(t){return Array.isArray(t)?(0,xr.Ok)(t.slice()):(0,xr.Err)((0,En.annotate)(t,"Must be an array"))};St.poja=Oo;function zu(e,t){var r=[],n=0,i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),u;!(i=(u=s.next()).done);i=!0){var f=u.value;try{var c=f.unwrap();r.push(c)}catch(v){var l=ku(t);return l.splice(n,1,(0,En.annotate)(v,v.annotation!==void 0?"".concat(v.annotation," (at index ").concat(n,")"):"index ".concat(n))),(0,xr.Err)((0,En.annotate)(l))}n++}}catch(v){a=!0,o=v}finally{try{!i&&s.return!=null&&s.return()}finally{if(a)throw o}}return(0,xr.Ok)(r)}function Bu(e){return function(t){var r=t.map(e),n=zu(r,t);return n}}function Wu(e){return(0,Du.compose)(Oo,Bu(e))}var Co={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.positiveInteger=ge.integer=ge.positiveNumber=ge.number=void 0;var Gu=re,Bi=oe,Fe=ae,Ku=function(t){return typeof t=="number"&&!Number.isNaN(t)?(0,Bi.Ok)(t):(0,Bi.Err)((0,Gu.annotate)(t,"Must be number"))},Xr=(0,Fe.compose)(Ku,(0,Fe.predicate)(Number.isFinite,"Number must be finite"));ge.number=Xr;var qu=(0,Fe.compose)(Xr,(0,Fe.predicate)(function(e){return e>=0},"Number must be positive"));ge.positiveNumber=qu;var Ju=(0,Fe.compose)(Xr,(0,Fe.predicate)(Number.isInteger,"Number must be an integer"));ge.integer=Ju;var Yu=(0,Fe.compose)(Xr,(0,Fe.predicate)(function(e){return e>=0&&Number.isInteger(e)},"Number must be an integer"));ge.positiveInteger=Yu;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.numericBoolean=e.truthy=e.boolean=void 0;var t=re,r=oe,n=ge,i=ae,a=function(f){return typeof f=="boolean"?(0,r.Ok)(f):(0,r.Err)((0,t.annotate)(f,"Must be boolean"))};e.boolean=a;var o=function(f){return(0,r.Ok)(!!f)};e.truthy=o;var s=(0,i.map)(n.number,function(u){return!!u});e.numericBoolean=s})(Co);var fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.constant=Qu;fe.hardcoded=Vu;fe.unknown=fe.mixed=fe.undefined_=fe.null_=void 0;var ni=re,Ue=oe,Zu=function(t){return t===null?(0,Ue.Ok)(t):(0,Ue.Err)((0,ni.annotate)(t,"Must be null"))};fe.null_=Zu;var Xu=function(t){return t===void 0?(0,Ue.Ok)(t):(0,Ue.Err)((0,ni.annotate)(t,"Must be undefined"))};fe.undefined_=Xu;function Qu(e){return function(t){return t===e?(0,Ue.Ok)(e):(0,Ue.Err)((0,ni.annotate)(t,"Must be constant ".concat(String(e))))}}function Vu(e){return function(t){return(0,Ue.Ok)(e)}}var Eo=function(t){return(0,Ue.Ok)(t)};fe.mixed=Eo;var ef=Eo;fe.unknown=ef;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.date=void 0;var tf=re,Wi=oe,rf=ae,nf=function(t){return(0,rf.isDate)(t)?(0,Wi.Ok)(t):(0,Wi.Err)((0,tf.annotate)(t,"Must be a Date"))};Qr.date=nf;var ii={},le={};Object.defineProperty(le,"__esModule",{value:!0});le.either=xe;le.either3=So;le.either4=$o;le.either5=Ao;le.either6=Po;le.either7=To;le.either8=xo;le.either9=af;le.oneOf=of;var kt=re,Ft=oe;function Gi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return"-"+(0,kt.indent)(e).substring(1)}function xe(e,t){return function(r){return e(r).dispatch(function(n){return(0,Ft.Ok)(n)},function(n){return t(r).dispatch(function(i){return(0,Ft.Ok)(i)},function(i){return(0,Ft.Err)((0,kt.annotate)(r,["Either:",Gi((0,kt.summarize)(n).join(`
17
17
  `)),Gi((0,kt.summarize)(i).join(`
18
18
  `))].join(`
19
- `)))})})}}function So(e,t,r){return xe(e,xe(t,r))}function $o(e,t,r,n){return xe(e,So(t,r,n))}function Ao(e,t,r,n,i){return xe(e,$o(t,r,n,i))}function Po(e,t,r,n,i,a){return xe(e,Ao(t,r,n,i,a))}function To(e,t,r,n,i,a,o){return xe(e,Po(t,r,n,i,a,o))}function xo(e,t,r,n,i,a,o,s){return xe(e,To(t,r,n,i,a,o,s))}function af(e,t,r,n,i,a,o,s,u){return xe(e,xo(t,r,n,i,a,o,s,u))}function of(e){return function(t){var r=!0,n=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(r=(o=a.next()).done);r=!0){var s=o.value;if(s===t)return(0,Ft.Ok)(s)}}catch(u){n=!0,i=u}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return(0,Ft.Err)((0,kt.annotate)(t,"Must be one of ".concat(e.map(function(u){return JSON.stringify(u)}).join(", "))))}}var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.object=jo;Ge.exact=df;Ge.pojo=void 0;var mt=re,Ot=oe,Sn=ae;function Ro(e){return ff(e)||uf(e)||sf()}function sf(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function uf(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function ff(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function cf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){lf(e,i,r[i])})}return e}function lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gr=function(r){return typeof r}:gr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gr(e)}function pf(e){return e!=null&&gr(e)==="object"&&Object.prototype.toString.call(e)==="[object Object]"}function Mo(e,t){var r=new Set,n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=!0){var u=s.value;t.has(u)||r.add(u)}}catch(f){i=!0,a=f}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}var ai=function(t){return pf(t)?(0,Ot.Ok)(cf({},t)):(0,Ot.Err)((0,mt.annotate)(t,"Must be an object"))};Ge.pojo=ai;function jo(e){var t=new Set(Object.keys(e));return(0,Sn.compose)(ai,function(r){for(var n=new Set(Object.keys(r)),i=Mo(t,n),a={},o={},s=0,u=Object.keys(e);s<u.length;s++){var f=u[s],c=e[f],l=r[f],v=c(l);try{a[f]=v.unwrap(),i.delete(f)}catch(b){if(!(0,mt.isAnnotation)(b))throw b;l===void 0?i.add(f):o[f]=b}}var p=Object.keys(o);if(p.length>0||i.size>0){var m;if(p.length>0){var d=p.map(function(b){return[b,o[b]]});m=(0,mt.annotateFields)(r,d)}else m=(0,mt.annotate)(r);if(i.size>0){var y=Ro(i).map(function(b){return'"'.concat(b,'"')}).join(", "),h=i.size>1?"keys":"key";m=(0,mt.annotate)(m,"Missing ".concat(h,": ").concat(y))}return(0,Ot.Err)(m)}return(0,Ot.Ok)(a)})}function df(e){var t=new Set(Object.keys(e)),r=(0,Sn.compose)(ai,function(i){var a=new Set(Object.keys(i)),o=Mo(a,t);return o.size>0?(0,Ot.Err)((0,mt.annotate)(i,"Superfluous keys: ".concat(Ro(o).join(", ")))):(0,Ot.Ok)(i)}),n=jo(e);return(0,Sn.compose)(r,n)}Object.defineProperty(ii,"__esModule",{value:!0});ii.dispatch=mf;var vf=le,hf=Ge;function yf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mf(e,t){var r=(0,hf.object)(yf({},e,(0,vf.oneOf)(Object.keys(t))));return function(n){return r(n).andThen(function(i){var a=i[e],o=t[a];return o(n)})}}var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.fail=bf;var gf=re,_f=oe;function bf(e){return function(t){return(0,_f.Err)((0,gf.annotate)(t,e))}}var si={};Object.defineProperty(si,"__esModule",{value:!0});si.instanceOf=Of;var wf=re,Ki=oe;function Of(e){return function(t){return t instanceof e?(0,Ki.Ok)(t):(0,Ki.Err)((0,wf.annotate)(t,"Must be ".concat(e.name," instance")))}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.mapping=No;Vr.dict=Tf;var qi=re,Ji=oe,Cf=Ge,Io=ae;function Ef(e,t){return Af(e)||$f(e,t)||Sf()}function Sf(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function $f(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}function Af(e){if(Array.isArray(e))return e}function No(e){return(0,Io.compose)(Cf.pojo,function(t){var r=[],n=[];return Object.keys(t).forEach(function(i){var a=t[i],o=e(a);try{var s=o.unwrap();n.length===0&&r.push([i,s])}catch(u){if((0,qi.isAnnotation)(u))r.length=0,n.push([i,u]);else throw u}}),n.length>0?(0,Ji.Err)((0,qi.annotateFields)(t,n)):(0,Ji.Ok)(new Map(r))})}function Pf(e){var t={},r=!0,n=!1,i=void 0;try{for(var a=e.entries()[Symbol.iterator](),o;!(r=(o=a.next()).done);r=!0){var s=Ef(o.value,2),u=s[0],f=s[1];t[u]=f}}catch(c){n=!0,i=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return t}function Tf(e){return(0,Io.map)(No(e),Pf)}var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.optional=Rf;Zt.nullable=Mf;Zt.maybe=If;var xf=re,Yi=oe,Lo=fe,ui=le;function Rf(e){return(0,ui.either)(Lo.undefined_,e)}function Mf(e){return(0,ui.either)(Lo.null_,e)}var jf=function(t){return t==null?(0,Yi.Ok)(t):(0,Yi.Err)((0,xf.annotate)(t,"Must be undefined or null"))};function If(e){return(0,ui.either)(jf,e)}var Te={};Object.defineProperty(Te,"__esModule",{value:!0});Te.regex=Do;Te.url=Te.email=Te.string=void 0;var $n=re,Ut=oe,An=ae,Nf=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,\w]*)?(?:#[.,!/\w]*)?)?$/,Lf=["https"],fi=function(t){return typeof t=="string"?(0,Ut.Ok)(t):(0,Ut.Err)((0,$n.annotate)(t,"Must be string"))};Te.string=fi;function Do(e,t){return(0,An.compose)(fi,(0,An.predicate)(function(r){return e.test(r)},t))}var Df=Do(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email");Te.email=Df;var kf=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lf;return(0,An.compose)(fi,function(r){var n=r.match(Nf);if(n){var i=n[1];return t.length===0||t.includes(i.toLowerCase())?(0,Ut.Ok)(r):(0,Ut.Err)((0,$n.annotate)(r,"URL scheme must be any of: ".concat(t.join(", "))))}else return(0,Ut.Err)((0,$n.annotate)(r,"Must be URL"))})};Te.url=kf;var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.tuple2=Bf;ut.tuple3=Wf;ut.tuple4=Gf;ut.tuple5=Kf;ut.tuple6=qf;var Xt=re,Ee=oe,Ff=St,nt=ae;function Qt(e,t){return zf(e)||Hf(e,t)||Uf()}function Uf(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Hf(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}function zf(e){if(Array.isArray(e))return e}var Vt=function(t){return(0,nt.compose)(Ff.poja,(0,nt.predicate)(function(r){return r.length===t},"Must be a ".concat(t,"-tuple")))};function Bf(e,t){return(0,nt.compose)(Vt(2),function(r){var n=Qt(r,2),i=n[0],a=n[1],o=e(i),s=t(a);try{return(0,Ee.Ok)([o.unwrap(),s.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([o.isErr()?o.errValue():o.value(),s.isErr()?s.errValue():s.value()]))}})}function Wf(e,t,r){return(0,nt.compose)(Vt(3),function(n){var i=Qt(n,3),a=i[0],o=i[1],s=i[2],u=e(a),f=t(o),c=r(s);try{return(0,Ee.Ok)([u.unwrap(),f.unwrap(),c.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([u.isErr()?u.errValue():u.value(),f.isErr()?f.errValue():f.value(),c.isErr()?c.errValue():c.value()]))}})}function Gf(e,t,r,n){return(0,nt.compose)(Vt(4),function(i){var a=Qt(i,4),o=a[0],s=a[1],u=a[2],f=a[3],c=e(o),l=t(s),v=r(u),p=n(f);try{return(0,Ee.Ok)([c.unwrap(),l.unwrap(),v.unwrap(),p.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([c.isErr()?c.errValue():c.value(),l.isErr()?l.errValue():l.value(),v.isErr()?v.errValue():v.value(),p.isErr()?p.errValue():p.value()]))}})}function Kf(e,t,r,n,i){return(0,nt.compose)(Vt(5),function(a){var o=Qt(a,5),s=o[0],u=o[1],f=o[2],c=o[3],l=o[4],v=e(s),p=t(u),m=r(f),d=n(c),y=i(l);try{return(0,Ee.Ok)([v.unwrap(),p.unwrap(),m.unwrap(),d.unwrap(),y.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([v.isErr()?v.errValue():v.value(),p.isErr()?p.errValue():p.value(),m.isErr()?m.errValue():m.value(),d.isErr()?d.errValue():d.value(),y.isErr()?y.errValue():y.value()]))}})}function qf(e,t,r,n,i,a){return(0,nt.compose)(Vt(6),function(o){var s=Qt(o,6),u=s[0],f=s[1],c=s[2],l=s[3],v=s[4],p=s[5],m=e(u),d=t(f),y=r(c),h=n(l),b=i(v),O=a(p);try{return(0,Ee.Ok)([m.unwrap(),d.unwrap(),y.unwrap(),h.unwrap(),b.unwrap(),O.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([m.isErr()?m.errValue():m.value(),d.isErr()?d.errValue():d.value(),y.isErr()?y.errValue():y.value(),h.isErr()?h.errValue():h.value(),b.isErr()?b.errValue():b.value(),O.isErr()?O.errValue():O.value()]))}})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"guard",{enumerable:!0,get:function(){return t.guard}}),Object.defineProperty(e,"compose",{enumerable:!0,get:function(){return r.compose}}),Object.defineProperty(e,"map",{enumerable:!0,get:function(){return r.map}}),Object.defineProperty(e,"predicate",{enumerable:!0,get:function(){return r.predicate}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return n.array}}),Object.defineProperty(e,"poja",{enumerable:!0,get:function(){return n.poja}}),Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return i.boolean}}),Object.defineProperty(e,"numericBoolean",{enumerable:!0,get:function(){return i.numericBoolean}}),Object.defineProperty(e,"truthy",{enumerable:!0,get:function(){return i.truthy}}),Object.defineProperty(e,"constant",{enumerable:!0,get:function(){return a.constant}}),Object.defineProperty(e,"hardcoded",{enumerable:!0,get:function(){return a.hardcoded}}),Object.defineProperty(e,"mixed",{enumerable:!0,get:function(){return a.mixed}}),Object.defineProperty(e,"null_",{enumerable:!0,get:function(){return a.null_}}),Object.defineProperty(e,"undefined_",{enumerable:!0,get:function(){return a.undefined_}}),Object.defineProperty(e,"unknown",{enumerable:!0,get:function(){return a.unknown}}),Object.defineProperty(e,"date",{enumerable:!0,get:function(){return o.date}}),Object.defineProperty(e,"dispatch",{enumerable:!0,get:function(){return s.dispatch}}),Object.defineProperty(e,"either",{enumerable:!0,get:function(){return u.either}}),Object.defineProperty(e,"either3",{enumerable:!0,get:function(){return u.either3}}),Object.defineProperty(e,"either4",{enumerable:!0,get:function(){return u.either4}}),Object.defineProperty(e,"either5",{enumerable:!0,get:function(){return u.either5}}),Object.defineProperty(e,"either6",{enumerable:!0,get:function(){return u.either6}}),Object.defineProperty(e,"either7",{enumerable:!0,get:function(){return u.either7}}),Object.defineProperty(e,"either8",{enumerable:!0,get:function(){return u.either8}}),Object.defineProperty(e,"either9",{enumerable:!0,get:function(){return u.either9}}),Object.defineProperty(e,"oneOf",{enumerable:!0,get:function(){return u.oneOf}}),Object.defineProperty(e,"fail",{enumerable:!0,get:function(){return f.fail}}),Object.defineProperty(e,"instanceOf",{enumerable:!0,get:function(){return c.instanceOf}}),Object.defineProperty(e,"mapping",{enumerable:!0,get:function(){return l.mapping}}),Object.defineProperty(e,"dict",{enumerable:!0,get:function(){return l.dict}}),Object.defineProperty(e,"integer",{enumerable:!0,get:function(){return v.integer}}),Object.defineProperty(e,"number",{enumerable:!0,get:function(){return v.number}}),Object.defineProperty(e,"positiveInteger",{enumerable:!0,get:function(){return v.positiveInteger}}),Object.defineProperty(e,"positiveNumber",{enumerable:!0,get:function(){return v.positiveNumber}}),Object.defineProperty(e,"exact",{enumerable:!0,get:function(){return p.exact}}),Object.defineProperty(e,"object",{enumerable:!0,get:function(){return p.object}}),Object.defineProperty(e,"pojo",{enumerable:!0,get:function(){return p.pojo}}),Object.defineProperty(e,"maybe",{enumerable:!0,get:function(){return m.maybe}}),Object.defineProperty(e,"nullable",{enumerable:!0,get:function(){return m.nullable}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return m.optional}}),Object.defineProperty(e,"email",{enumerable:!0,get:function(){return d.email}}),Object.defineProperty(e,"regex",{enumerable:!0,get:function(){return d.regex}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return d.string}}),Object.defineProperty(e,"url",{enumerable:!0,get:function(){return d.url}}),Object.defineProperty(e,"tuple2",{enumerable:!0,get:function(){return y.tuple2}}),Object.defineProperty(e,"tuple3",{enumerable:!0,get:function(){return y.tuple3}}),Object.defineProperty(e,"tuple4",{enumerable:!0,get:function(){return y.tuple4}}),Object.defineProperty(e,"tuple5",{enumerable:!0,get:function(){return y.tuple5}}),Object.defineProperty(e,"tuple6",{enumerable:!0,get:function(){return y.tuple6}});var t=ri,r=ae,n=St,i=Co,a=fe,o=Qr,s=ii,u=le,f=oi,c=si,l=Vr,v=ge,p=Ge,m=Zt,d=Te,y=ut})(S);const Jf="6.0.0",Rr="iframe-coordinator";function Yf(e){return Object.assign(Object.assign({direction:"HostToClient"},e),{protocol:Rr,version:Jf})}function $e(e,t){return S.object({protocol:S.either(S.constant(Rr),S.hardcoded(Rr)),version:S.either(S.string,S.hardcoded("unknown")),msgType:e,msg:t,direction:S.optional(Zf)})}const Zf=S.either(S.constant("ClientToHost"),S.constant("HostToClient")),Xf=$e(S.constant("clickFired"),S.object({})),Qf=$e(S.constant("registeredKeyFired"),S.object({altKey:S.optional(S.boolean),charCode:S.optional(S.number),code:S.optional(S.string),ctrlKey:S.optional(S.boolean),key:S.string,keyCode:S.optional(S.number),metaKey:S.optional(S.boolean),shiftKey:S.optional(S.boolean)})),Vf=$e(S.constant("client_started"),S.mixed),ec=$e(S.constant("env_init"),S.object({locale:S.string,hostRootUrl:S.string,assignedRoute:S.string,registeredKeys:S.optional(S.array(S.object({key:S.string,altKey:S.optional(S.boolean),ctrlKey:S.optional(S.boolean),metaKey:S.optional(S.boolean),shiftKey:S.optional(S.boolean)}))),custom:S.mixed})),tc=$e(S.constant("modalRequest"),S.object({modalId:S.string,modalData:S.mixed})),rc=$e(S.constant("navRequest"),S.object({url:S.string,history:S.optional(S.either(S.constant("push"),S.constant("replace")))}));function nc(e){return"notifyRequest"}const ic=S.map(S.constant("toastRequest"),nc),Zi=$e(S.either(S.constant("notifyRequest"),ic),S.object({title:S.optional(S.string),message:S.string,custom:S.mixed})),ac=$e(S.constant("pageMetadata"),S.object({title:S.string,breadcrumbs:S.array(S.object({text:S.string,href:S.string})),custom:S.optional(S.mixed)})),oc=$e(S.constant("promptOnLeave"),S.object({shouldPrompt:S.boolean,message:S.optional(S.string)})),ko=$e(S.constant("publish"),S.object({topic:S.string,payload:S.mixed,clientId:S.optional(S.string)}));function sc(e){return S.guard(S.dispatch("msgType",{publish:ko,registeredKeyFired:Qf,client_started:Vf,clickFired:Xf,navRequest:rc,notifyRequest:Zi,toastRequest:Zi,modalRequest:tc,pageMetadata:ac,promptOnLeave:oc}))(e)}function uc(e){return S.guard(S.dispatch("msgType",{publish:ko,env_init:ec}))(e)}const fc="frame-router iframe { width: 100%; height: 100%; }",Xi=["allow-popups-to-escape-sandbox","allow-scripts","allow-same-origin","allow-modals","allow-forms","allow-popups","allow-downloads","allow-top-navigation-by-user-activation"];let or;class cc{constructor(t){this._window=t.mockWindow?t.mockWindow:window,this._postMessageHandler=r=>{this._handlePostMessage(t.onMessage,r)},this._frameLocation="about:blank",this._iframe=this._window.document.createElement("iframe"),this._iframe.setAttribute("frameborder","0"),or||(or=this._window.document.createElement("style"),or.innerText=fc,this._window.document.head.appendChild(or)),this._iframe.setAttribute("sandbox",Xi.join(" "))}setFrameAllow(t){typeof t!="string"&&(t=""),this._iframe.setAttribute("allow",t)}setFrameSandbox(t){typeof t!="string"&&(t="");const r=t.split(" ").concat(Xi),n=[...new Set(r)].join(" ");this._iframe.setAttribute("sandbox",n)}setFrameDefaultTitle(t){typeof t!="string"&&(t=""),this._iframe.setAttribute("title",t)}setFrameLocation(t){return this._frameLocation=t||"about:blank",this._iframe.contentWindow?this._navigateFrame():this._iframe.onload=r=>{this._navigateFrame(),this._iframe.onload=null},this._frameLocation}sendToClient(t){const r=this._expectedClientOrigin();if(this._iframe.contentWindow&&r){const n=Yf(t);let i;try{i=uc(n)}catch(a){throw new Error(`
19
+ `)))})})}}function So(e,t,r){return xe(e,xe(t,r))}function $o(e,t,r,n){return xe(e,So(t,r,n))}function Ao(e,t,r,n,i){return xe(e,$o(t,r,n,i))}function Po(e,t,r,n,i,a){return xe(e,Ao(t,r,n,i,a))}function To(e,t,r,n,i,a,o){return xe(e,Po(t,r,n,i,a,o))}function xo(e,t,r,n,i,a,o,s){return xe(e,To(t,r,n,i,a,o,s))}function af(e,t,r,n,i,a,o,s,u){return xe(e,xo(t,r,n,i,a,o,s,u))}function of(e){return function(t){var r=!0,n=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(r=(o=a.next()).done);r=!0){var s=o.value;if(s===t)return(0,Ft.Ok)(s)}}catch(u){n=!0,i=u}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return(0,Ft.Err)((0,kt.annotate)(t,"Must be one of ".concat(e.map(function(u){return JSON.stringify(u)}).join(", "))))}}var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.object=jo;Ge.exact=df;Ge.pojo=void 0;var mt=re,Ot=oe,Sn=ae;function Ro(e){return ff(e)||uf(e)||sf()}function sf(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function uf(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function ff(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function cf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){lf(e,i,r[i])})}return e}function lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gr=function(r){return typeof r}:gr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gr(e)}function pf(e){return e!=null&&gr(e)==="object"&&Object.prototype.toString.call(e)==="[object Object]"}function Mo(e,t){var r=new Set,n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=!0){var u=s.value;t.has(u)||r.add(u)}}catch(f){i=!0,a=f}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}var ai=function(t){return pf(t)?(0,Ot.Ok)(cf({},t)):(0,Ot.Err)((0,mt.annotate)(t,"Must be an object"))};Ge.pojo=ai;function jo(e){var t=new Set(Object.keys(e));return(0,Sn.compose)(ai,function(r){for(var n=new Set(Object.keys(r)),i=Mo(t,n),a={},o={},s=0,u=Object.keys(e);s<u.length;s++){var f=u[s],c=e[f],l=r[f],v=c(l);try{a[f]=v.unwrap(),i.delete(f)}catch(b){if(!(0,mt.isAnnotation)(b))throw b;l===void 0?i.add(f):o[f]=b}}var p=Object.keys(o);if(p.length>0||i.size>0){var m;if(p.length>0){var d=p.map(function(b){return[b,o[b]]});m=(0,mt.annotateFields)(r,d)}else m=(0,mt.annotate)(r);if(i.size>0){var y=Ro(i).map(function(b){return'"'.concat(b,'"')}).join(", "),h=i.size>1?"keys":"key";m=(0,mt.annotate)(m,"Missing ".concat(h,": ").concat(y))}return(0,Ot.Err)(m)}return(0,Ot.Ok)(a)})}function df(e){var t=new Set(Object.keys(e)),r=(0,Sn.compose)(ai,function(i){var a=new Set(Object.keys(i)),o=Mo(a,t);return o.size>0?(0,Ot.Err)((0,mt.annotate)(i,"Superfluous keys: ".concat(Ro(o).join(", ")))):(0,Ot.Ok)(i)}),n=jo(e);return(0,Sn.compose)(r,n)}Object.defineProperty(ii,"__esModule",{value:!0});ii.dispatch=mf;var vf=le,hf=Ge;function yf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mf(e,t){var r=(0,hf.object)(yf({},e,(0,vf.oneOf)(Object.keys(t))));return function(n){return r(n).andThen(function(i){var a=i[e],o=t[a];return o(n)})}}var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.fail=bf;var gf=re,_f=oe;function bf(e){return function(t){return(0,_f.Err)((0,gf.annotate)(t,e))}}var si={};Object.defineProperty(si,"__esModule",{value:!0});si.instanceOf=Of;var wf=re,Ki=oe;function Of(e){return function(t){return t instanceof e?(0,Ki.Ok)(t):(0,Ki.Err)((0,wf.annotate)(t,"Must be ".concat(e.name," instance")))}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.mapping=No;Vr.dict=Tf;var qi=re,Ji=oe,Cf=Ge,Io=ae;function Ef(e,t){return Af(e)||$f(e,t)||Sf()}function Sf(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function $f(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}function Af(e){if(Array.isArray(e))return e}function No(e){return(0,Io.compose)(Cf.pojo,function(t){var r=[],n=[];return Object.keys(t).forEach(function(i){var a=t[i],o=e(a);try{var s=o.unwrap();n.length===0&&r.push([i,s])}catch(u){if((0,qi.isAnnotation)(u))r.length=0,n.push([i,u]);else throw u}}),n.length>0?(0,Ji.Err)((0,qi.annotateFields)(t,n)):(0,Ji.Ok)(new Map(r))})}function Pf(e){var t={},r=!0,n=!1,i=void 0;try{for(var a=e.entries()[Symbol.iterator](),o;!(r=(o=a.next()).done);r=!0){var s=Ef(o.value,2),u=s[0],f=s[1];t[u]=f}}catch(c){n=!0,i=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return t}function Tf(e){return(0,Io.map)(No(e),Pf)}var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.optional=Rf;Zt.nullable=Mf;Zt.maybe=If;var xf=re,Yi=oe,Lo=fe,ui=le;function Rf(e){return(0,ui.either)(Lo.undefined_,e)}function Mf(e){return(0,ui.either)(Lo.null_,e)}var jf=function(t){return t==null?(0,Yi.Ok)(t):(0,Yi.Err)((0,xf.annotate)(t,"Must be undefined or null"))};function If(e){return(0,ui.either)(jf,e)}var Te={};Object.defineProperty(Te,"__esModule",{value:!0});Te.regex=Do;Te.url=Te.email=Te.string=void 0;var $n=re,Ut=oe,An=ae,Nf=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,\w]*)?(?:#[.,!/\w]*)?)?$/,Lf=["https"],fi=function(t){return typeof t=="string"?(0,Ut.Ok)(t):(0,Ut.Err)((0,$n.annotate)(t,"Must be string"))};Te.string=fi;function Do(e,t){return(0,An.compose)(fi,(0,An.predicate)(function(r){return e.test(r)},t))}var Df=Do(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email");Te.email=Df;var kf=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lf;return(0,An.compose)(fi,function(r){var n=r.match(Nf);if(n){var i=n[1];return t.length===0||t.includes(i.toLowerCase())?(0,Ut.Ok)(r):(0,Ut.Err)((0,$n.annotate)(r,"URL scheme must be any of: ".concat(t.join(", "))))}else return(0,Ut.Err)((0,$n.annotate)(r,"Must be URL"))})};Te.url=kf;var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.tuple2=Bf;ut.tuple3=Wf;ut.tuple4=Gf;ut.tuple5=Kf;ut.tuple6=qf;var Xt=re,Ee=oe,Ff=St,nt=ae;function Qt(e,t){return zf(e)||Hf(e,t)||Uf()}function Uf(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Hf(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}function zf(e){if(Array.isArray(e))return e}var Vt=function(t){return(0,nt.compose)(Ff.poja,(0,nt.predicate)(function(r){return r.length===t},"Must be a ".concat(t,"-tuple")))};function Bf(e,t){return(0,nt.compose)(Vt(2),function(r){var n=Qt(r,2),i=n[0],a=n[1],o=e(i),s=t(a);try{return(0,Ee.Ok)([o.unwrap(),s.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([o.isErr()?o.errValue():o.value(),s.isErr()?s.errValue():s.value()]))}})}function Wf(e,t,r){return(0,nt.compose)(Vt(3),function(n){var i=Qt(n,3),a=i[0],o=i[1],s=i[2],u=e(a),f=t(o),c=r(s);try{return(0,Ee.Ok)([u.unwrap(),f.unwrap(),c.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([u.isErr()?u.errValue():u.value(),f.isErr()?f.errValue():f.value(),c.isErr()?c.errValue():c.value()]))}})}function Gf(e,t,r,n){return(0,nt.compose)(Vt(4),function(i){var a=Qt(i,4),o=a[0],s=a[1],u=a[2],f=a[3],c=e(o),l=t(s),v=r(u),p=n(f);try{return(0,Ee.Ok)([c.unwrap(),l.unwrap(),v.unwrap(),p.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([c.isErr()?c.errValue():c.value(),l.isErr()?l.errValue():l.value(),v.isErr()?v.errValue():v.value(),p.isErr()?p.errValue():p.value()]))}})}function Kf(e,t,r,n,i){return(0,nt.compose)(Vt(5),function(a){var o=Qt(a,5),s=o[0],u=o[1],f=o[2],c=o[3],l=o[4],v=e(s),p=t(u),m=r(f),d=n(c),y=i(l);try{return(0,Ee.Ok)([v.unwrap(),p.unwrap(),m.unwrap(),d.unwrap(),y.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([v.isErr()?v.errValue():v.value(),p.isErr()?p.errValue():p.value(),m.isErr()?m.errValue():m.value(),d.isErr()?d.errValue():d.value(),y.isErr()?y.errValue():y.value()]))}})}function qf(e,t,r,n,i,a){return(0,nt.compose)(Vt(6),function(o){var s=Qt(o,6),u=s[0],f=s[1],c=s[2],l=s[3],v=s[4],p=s[5],m=e(u),d=t(f),y=r(c),h=n(l),b=i(v),O=a(p);try{return(0,Ee.Ok)([m.unwrap(),d.unwrap(),y.unwrap(),h.unwrap(),b.unwrap(),O.unwrap()])}catch{return(0,Ee.Err)((0,Xt.annotate)([m.isErr()?m.errValue():m.value(),d.isErr()?d.errValue():d.value(),y.isErr()?y.errValue():y.value(),h.isErr()?h.errValue():h.value(),b.isErr()?b.errValue():b.value(),O.isErr()?O.errValue():O.value()]))}})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"guard",{enumerable:!0,get:function(){return t.guard}}),Object.defineProperty(e,"compose",{enumerable:!0,get:function(){return r.compose}}),Object.defineProperty(e,"map",{enumerable:!0,get:function(){return r.map}}),Object.defineProperty(e,"predicate",{enumerable:!0,get:function(){return r.predicate}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return n.array}}),Object.defineProperty(e,"poja",{enumerable:!0,get:function(){return n.poja}}),Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return i.boolean}}),Object.defineProperty(e,"numericBoolean",{enumerable:!0,get:function(){return i.numericBoolean}}),Object.defineProperty(e,"truthy",{enumerable:!0,get:function(){return i.truthy}}),Object.defineProperty(e,"constant",{enumerable:!0,get:function(){return a.constant}}),Object.defineProperty(e,"hardcoded",{enumerable:!0,get:function(){return a.hardcoded}}),Object.defineProperty(e,"mixed",{enumerable:!0,get:function(){return a.mixed}}),Object.defineProperty(e,"null_",{enumerable:!0,get:function(){return a.null_}}),Object.defineProperty(e,"undefined_",{enumerable:!0,get:function(){return a.undefined_}}),Object.defineProperty(e,"unknown",{enumerable:!0,get:function(){return a.unknown}}),Object.defineProperty(e,"date",{enumerable:!0,get:function(){return o.date}}),Object.defineProperty(e,"dispatch",{enumerable:!0,get:function(){return s.dispatch}}),Object.defineProperty(e,"either",{enumerable:!0,get:function(){return u.either}}),Object.defineProperty(e,"either3",{enumerable:!0,get:function(){return u.either3}}),Object.defineProperty(e,"either4",{enumerable:!0,get:function(){return u.either4}}),Object.defineProperty(e,"either5",{enumerable:!0,get:function(){return u.either5}}),Object.defineProperty(e,"either6",{enumerable:!0,get:function(){return u.either6}}),Object.defineProperty(e,"either7",{enumerable:!0,get:function(){return u.either7}}),Object.defineProperty(e,"either8",{enumerable:!0,get:function(){return u.either8}}),Object.defineProperty(e,"either9",{enumerable:!0,get:function(){return u.either9}}),Object.defineProperty(e,"oneOf",{enumerable:!0,get:function(){return u.oneOf}}),Object.defineProperty(e,"fail",{enumerable:!0,get:function(){return f.fail}}),Object.defineProperty(e,"instanceOf",{enumerable:!0,get:function(){return c.instanceOf}}),Object.defineProperty(e,"mapping",{enumerable:!0,get:function(){return l.mapping}}),Object.defineProperty(e,"dict",{enumerable:!0,get:function(){return l.dict}}),Object.defineProperty(e,"integer",{enumerable:!0,get:function(){return v.integer}}),Object.defineProperty(e,"number",{enumerable:!0,get:function(){return v.number}}),Object.defineProperty(e,"positiveInteger",{enumerable:!0,get:function(){return v.positiveInteger}}),Object.defineProperty(e,"positiveNumber",{enumerable:!0,get:function(){return v.positiveNumber}}),Object.defineProperty(e,"exact",{enumerable:!0,get:function(){return p.exact}}),Object.defineProperty(e,"object",{enumerable:!0,get:function(){return p.object}}),Object.defineProperty(e,"pojo",{enumerable:!0,get:function(){return p.pojo}}),Object.defineProperty(e,"maybe",{enumerable:!0,get:function(){return m.maybe}}),Object.defineProperty(e,"nullable",{enumerable:!0,get:function(){return m.nullable}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return m.optional}}),Object.defineProperty(e,"email",{enumerable:!0,get:function(){return d.email}}),Object.defineProperty(e,"regex",{enumerable:!0,get:function(){return d.regex}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return d.string}}),Object.defineProperty(e,"url",{enumerable:!0,get:function(){return d.url}}),Object.defineProperty(e,"tuple2",{enumerable:!0,get:function(){return y.tuple2}}),Object.defineProperty(e,"tuple3",{enumerable:!0,get:function(){return y.tuple3}}),Object.defineProperty(e,"tuple4",{enumerable:!0,get:function(){return y.tuple4}}),Object.defineProperty(e,"tuple5",{enumerable:!0,get:function(){return y.tuple5}}),Object.defineProperty(e,"tuple6",{enumerable:!0,get:function(){return y.tuple6}});var t=ri,r=ae,n=St,i=Co,a=fe,o=Qr,s=ii,u=le,f=oi,c=si,l=Vr,v=ge,p=Ge,m=Zt,d=Te,y=ut})(S);const Jf="6.1.0",Rr="iframe-coordinator";function Yf(e){return Object.assign(Object.assign({direction:"HostToClient"},e),{protocol:Rr,version:Jf})}function $e(e,t){return S.object({protocol:S.either(S.constant(Rr),S.hardcoded(Rr)),version:S.either(S.string,S.hardcoded("unknown")),msgType:e,msg:t,direction:S.optional(Zf)})}const Zf=S.either(S.constant("ClientToHost"),S.constant("HostToClient")),Xf=$e(S.constant("clickFired"),S.object({})),Qf=$e(S.constant("registeredKeyFired"),S.object({altKey:S.optional(S.boolean),charCode:S.optional(S.number),code:S.optional(S.string),ctrlKey:S.optional(S.boolean),key:S.string,keyCode:S.optional(S.number),metaKey:S.optional(S.boolean),shiftKey:S.optional(S.boolean)})),Vf=$e(S.constant("client_started"),S.mixed),ec=$e(S.constant("env_init"),S.object({locale:S.string,hostRootUrl:S.string,assignedRoute:S.string,registeredKeys:S.optional(S.array(S.object({key:S.string,altKey:S.optional(S.boolean),ctrlKey:S.optional(S.boolean),metaKey:S.optional(S.boolean),shiftKey:S.optional(S.boolean)}))),custom:S.mixed})),tc=$e(S.constant("modalRequest"),S.object({modalId:S.string,modalData:S.mixed})),rc=$e(S.constant("navRequest"),S.object({url:S.string,history:S.optional(S.either(S.constant("push"),S.constant("replace")))}));function nc(e){return"notifyRequest"}const ic=S.map(S.constant("toastRequest"),nc),Zi=$e(S.either(S.constant("notifyRequest"),ic),S.object({title:S.optional(S.string),message:S.string,custom:S.mixed})),ac=$e(S.constant("pageMetadata"),S.object({title:S.string,breadcrumbs:S.array(S.object({text:S.string,href:S.string})),custom:S.optional(S.mixed)})),oc=$e(S.constant("promptOnLeave"),S.object({shouldPrompt:S.boolean,message:S.optional(S.string)})),ko=$e(S.constant("publish"),S.object({topic:S.string,payload:S.mixed,clientId:S.optional(S.string)}));function sc(e){return S.guard(S.dispatch("msgType",{publish:ko,registeredKeyFired:Qf,client_started:Vf,clickFired:Xf,navRequest:rc,notifyRequest:Zi,toastRequest:Zi,modalRequest:tc,pageMetadata:ac,promptOnLeave:oc}))(e)}function uc(e){return S.guard(S.dispatch("msgType",{publish:ko,env_init:ec}))(e)}const fc="frame-router iframe { width: 100%; height: 100%; }",Xi=["allow-popups-to-escape-sandbox","allow-scripts","allow-same-origin","allow-modals","allow-forms","allow-popups","allow-downloads","allow-top-navigation-by-user-activation"];let or;class cc{constructor(t){this._window=t.mockWindow?t.mockWindow:window,this._postMessageHandler=r=>{this._handlePostMessage(t.onMessage,r)},this._frameLocation="about:blank",this._iframe=this._window.document.createElement("iframe"),this._iframe.setAttribute("frameborder","0"),or||(or=this._window.document.createElement("style"),or.innerText=fc,this._window.document.head.appendChild(or)),this._iframe.setAttribute("sandbox",Xi.join(" "))}setFrameAllow(t){typeof t!="string"&&(t=""),this._iframe.setAttribute("allow",t)}setFrameSandbox(t){typeof t!="string"&&(t="");const r=t.split(" ").concat(Xi),n=[...new Set(r)].join(" ");this._iframe.setAttribute("sandbox",n)}setFrameDefaultTitle(t){typeof t!="string"&&(t=""),this._iframe.setAttribute("title",t)}setFrameLocation(t){return this._frameLocation=t||"about:blank",this._iframe.contentWindow?this._navigateFrame():this._iframe.onload=r=>{this._navigateFrame(),this._iframe.onload=null},this._frameLocation}sendToClient(t){const r=this._expectedClientOrigin();if(this._iframe.contentWindow&&r){const n=Yf(t);let i;try{i=uc(n)}catch(a){throw new Error(`
20
20
  I received invalid data to send to a client application. This is probably due
21
21
  to bad data passed to a frame-router method.
22
22
  `.trim()+`
package/dist/index.html CHANGED
@@ -6,8 +6,8 @@
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
7
  <link rel="icon" href="/favicon.ico" />
8
8
  <title>ifc-wrapper</title>
9
- <script type="module" crossorigin src="/assets/index-CArHK_XP.js"></script>
10
- <link rel="stylesheet" crossorigin href="/assets/index-D3hBVT7E.css">
9
+ <script type="module" crossorigin src="/assets/index-CTFawOOW.js"></script>
10
+ <link rel="stylesheet" crossorigin href="/assets/index-BACxQIa4.css">
11
11
  </head>
12
12
  <body>
13
13
  <noscript>
package/ifc-cli.js CHANGED
@@ -19,9 +19,26 @@ main();
19
19
  function main() {
20
20
  const opts = parseProgramOptions();
21
21
  const indexContent = generateIndex(appPath, opts.clientConfigFile);
22
+ const configuredProxies = loadProxyConfig(opts.proxyConfigFile);
22
23
 
23
24
  app = express();
25
+ // Serve our custom index file with injected frame-router config
24
26
  app.use(/^\/$/, serveIndex(indexContent));
27
+
28
+ // Set up user configured proxies
29
+ configuredProxies.forEach((proxy) => {
30
+ app.use(
31
+ proxy.path,
32
+ createProxyMiddleware({
33
+ target: proxy.target,
34
+ ws: true, // proxy websockets too
35
+ changeOrigin: true, // rewrite the origin header to avoid any potential CORS issues
36
+ followRedirects: true, // ensure redirects from the server will also be proxied
37
+ }),
38
+ );
39
+ });
40
+
41
+ // Deprecated path-based dynamic proxy - to be removed in next major release
25
42
  app.use(
26
43
  "/proxy",
27
44
  createProxyMiddleware({
@@ -35,6 +52,8 @@ function main() {
35
52
  target: `http://localhost:${opts.port}`, //Required by middleware, but should be always overriden by the previous options
36
53
  }),
37
54
  );
55
+
56
+ // Server the static Vue App assets
38
57
  app.use(express.static(appPath));
39
58
 
40
59
  if (opts.ssl) {
@@ -55,6 +74,7 @@ function main() {
55
74
  function parseProgramOptions() {
56
75
  const projRoot = findRoot(process.cwd());
57
76
  const defaultJsConfig = path.join(projRoot, "ifc-cli.config.js");
77
+ const defaultProxyConfig = path.join(projRoot, "ifc-proxy.config.json");
58
78
 
59
79
  program
60
80
  .option(
@@ -62,6 +82,7 @@ function parseProgramOptions() {
62
82
  "iframe client configuration file",
63
83
  defaultJsConfig,
64
84
  )
85
+ .option("-x -proxy-config <proxy_config_file>")
65
86
  .option("-p, --port <port_num>", "port number to host on", 3000)
66
87
  .option("-s, --ssl", "serve over https")
67
88
  .option("--ssl-cert <cert_path>", "certificate file to use for https")
@@ -72,17 +93,29 @@ function parseProgramOptions() {
72
93
 
73
94
  const options = program.opts();
74
95
 
75
- return {
96
+ // Use a proxy config file from the default location as our fallback if needed
97
+ let proxyConfigPath = null;
98
+ if (options.proxyConfig) {
99
+ proxyConfigPath = findConfigFile(options.proxyConfig);
100
+ } else if (fs.existsSync(defaultProxyConfig)) {
101
+ proxyConfigPath = defaultProxyConfig;
102
+ }
103
+
104
+ parsedOpts = {
76
105
  clientConfigFile: findConfigFile(options.configFile),
106
+ proxyConfigFile: proxyConfigPath,
77
107
  port: options.port,
78
108
  ssl: options.ssl,
79
109
  sslCert: options.sslCert,
80
110
  sslKey: options.sslKey,
81
111
  };
112
+
113
+ return parsedOpts;
82
114
  }
83
115
 
84
116
  function showHelpText() {
85
117
  const configExample = path.join(__dirname, "example-ifc.config.js");
118
+ const configContent = fs.readFileSync(configExample).toString();
86
119
  console.log(`
87
120
  This program will start a server for a basic iframe-coordinator host app. In
88
121
  order to configure the frame-router element and any other custom logic needed
@@ -98,8 +131,19 @@ function showHelpText() {
98
131
  function expression.
99
132
 
100
133
  Here is an example config file:
134
+
135
+ ${configContent}
136
+
137
+ ifc-cli can also be configured to proxy requests to a local dev server or
138
+ other server so that embedded apps appear on the same origin as the host.
139
+ That configuration should be a json file mapping server paths to upstream
140
+ targets, e.g.:
141
+
142
+ {
143
+ "/my/app/": "http://localhost:8000/",
144
+ "/another/app/": "http://localhost:9000/"
145
+ }
101
146
  `);
102
- console.log(fs.readFileSync(configExample).toString());
103
147
  }
104
148
 
105
149
  function serveIndex(indexContent) {
@@ -108,6 +152,10 @@ function serveIndex(indexContent) {
108
152
  };
109
153
  }
110
154
 
155
+ /**
156
+ * Build the index file served to clients. This is the `index.html` from this project with the
157
+ * user's configuration file injected into a script tag to enable frame router setup.
158
+ */
111
159
  function generateIndex(appPath, clientConfigFile) {
112
160
  const baseIndex = fs
113
161
  .readFileSync(path.join(appPath, "index.html"))
@@ -117,6 +165,11 @@ function generateIndex(appPath, clientConfigFile) {
117
165
  return $.html();
118
166
  }
119
167
 
168
+ /**
169
+ * Generate a script tag that exports the frame router setup function from the user's config file
170
+ * as a global variable so that ifc-cli's host app can call it when creating the frame-router elemen
171
+ * in the DOM
172
+ */
120
173
  function configScript(scriptFile) {
121
174
  const scriptContents = fs.readFileSync(scriptFile).toString();
122
175
  // This is a bit of a kludge but it should suffice for now.
@@ -142,6 +195,14 @@ function findConfigFile(cliPath) {
142
195
  }
143
196
  }
144
197
 
198
+ function relativizePath(inPath) {
199
+ let outPath = path.relative(process.cwd(), inPath);
200
+ if (!outPath.startsWith(".")) {
201
+ outPath = "./" + outPath;
202
+ }
203
+ return outPath;
204
+ }
205
+
145
206
  function getSslOpts(certPath, keyPath) {
146
207
  if (!certPath || !keyPath) {
147
208
  return devCertAuthority("localhost");
@@ -157,13 +218,18 @@ function getSslOpts(certPath, keyPath) {
157
218
  }
158
219
  }
159
220
 
160
- // Make sure a path isn't interpreted as a module when required.
161
- function relativizePath(inPath) {
162
- let outPath = path.relative(process.cwd(), inPath);
163
- if (!outPath.startsWith(".")) {
164
- outPath = "./" + outPath;
221
+ function loadProxyConfig(path) {
222
+ if (!path) {
223
+ return [];
165
224
  }
166
- return outPath;
225
+
226
+ const proxyConfig = JSON.parse(fs.readFileSync(path).toString());
227
+ return Object.entries(proxyConfig).map(([path, target]) => {
228
+ return {
229
+ path,
230
+ target,
231
+ };
232
+ });
167
233
  }
168
234
 
169
235
  function extractTargetHost(req) {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "iframe-coordinator-cli",
3
- "version": "6.0.1",
3
+ "version": "6.1.1",
4
4
  "description": "CLI for local iframe-coordinator development",
5
5
  "dependencies": {
6
6
  "cheerio": "1.0.0-rc.12",
7
7
  "commander": "^12.1.0",
8
8
  "custom-event-polyfill": "^1.0.7",
9
9
  "dev-cert-authority": "^1.1.1",
10
- "express": "^4.19.2",
10
+ "express": "^4.21.1",
11
11
  "find-root": "^1.1.0",
12
- "http-proxy-middleware": "^2.0.6",
13
- "iframe-coordinator": "6.0.0",
12
+ "http-proxy-middleware": "^3.0.3",
13
+ "iframe-coordinator": "6.1.0",
14
14
  "vue": "^2.7.16",
15
15
  "vue-class-component": "^7.2.6",
16
16
  "vue-notification": "^1.3.20",