UNPKG

@interopio/browser-platform

Version:

IoConnect Browser main application package

1 lines 2.05 MB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).IoConnectBrowserPlatform=t()}(this,(function(){"use strict";const global=window;function getDefaultExportFromCjs$1$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isMergeableObject$1=function(e){return isNonNullObject$1(e)&&!isSpecial$1(e)};function isNonNullObject$1(e){return!!e&&"object"==typeof e}function isSpecial$1(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||isReactElement$1(e)}var canUseSymbol$1="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=canUseSymbol$1?Symbol.for("react.element"):60103;function isReactElement$1(e){return e.$$typeof===REACT_ELEMENT_TYPE$1}function emptyTarget$1(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified$1(e,t){return!1!==t.clone&&t.isMergeableObject(e)?deepmerge$1(emptyTarget$1(e),e,t):e}function defaultArrayMerge$1(e,t,r){return e.concat(t).map((function(e){return cloneUnlessOtherwiseSpecified$1(e,r)}))}function getMergeFunction$1(e,t){if(!t.customMerge)return deepmerge$1;var r=t.customMerge(e);return"function"==typeof r?r:deepmerge$1}function getEnumerableOwnPropertySymbols$1(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}function getKeys$1(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols$1(e))}function propertyIsOnObject$1(e,t){try{return t in e}catch(e){return!1}}function propertyIsUnsafe$1(e,t){return propertyIsOnObject$1(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function mergeObject$1(e,t,r){var n={};return r.isMergeableObject(e)&&getKeys$1(e).forEach((function(t){n[t]=cloneUnlessOtherwiseSpecified$1(e[t],r)})),getKeys$1(t).forEach((function(o){propertyIsUnsafe$1(e,o)||(propertyIsOnObject$1(e,o)&&r.isMergeableObject(t[o])?n[o]=getMergeFunction$1(o,r)(e[o],t[o],r):n[o]=cloneUnlessOtherwiseSpecified$1(t[o],r))})),n}function deepmerge$1(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||defaultArrayMerge$1,r.isMergeableObject=r.isMergeableObject||isMergeableObject$1,r.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified$1;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):mergeObject$1(e,t,r):cloneUnlessOtherwiseSpecified$1(t,r)}deepmerge$1.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return deepmerge$1(e,r,t)}),{})};var deepmerge_1$1=deepmerge$1,cjs$1=deepmerge_1$1,deepmerge$1$1=getDefaultExportFromCjs$1$1(cjs$1),ok$2$1=function(e){return{ok:!0,result:e}},err$2$1=function(e){return{ok:!1,error:e}},asPromise$2$1=function(e){return!0===e.ok?Promise.resolve(e.result):Promise.reject(e.error)},withDefault$2$1=function(e,t){return!0===t.ok?t.result:e},withException$2$1=function(e){if(!0===e.ok)return e.result;throw e.error},map$2$1=function(e,t){return!0===t.ok?ok$2$1(e(t.result)):t},map2$2$1=function(e,t,r){return!1===t.ok?t:!1===r.ok?r:ok$2$1(e(t.result,r.result))},mapError$2$1=function(e,t){return!0===t.ok?t:err$2$1(e(t.error))},andThen$2$1=function(e,t){return!0===t.ok?e(t.result):t},__assign$2$1=function(){return __assign$2$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign$2$1.apply(this,arguments)};function __rest$2$1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function isEqual$2$1(e,t){if(e===t)return!0;if(null===e&&null===t)return!0;if(typeof e!=typeof t)return!1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!isEqual$2$1(e[r],t[r]))return!1;return!0}var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(r=0;r<n.length;r++){if(!t.hasOwnProperty(n[r]))return!1;if(!isEqual$2$1(e[n[r]],t[n[r]]))return!1}return!0}}var isJsonArray$2$1=function(e){return Array.isArray(e)},isJsonObject$2$1=function(e){return"object"==typeof e&&null!==e&&!isJsonArray$2$1(e)},typeString$2$1=function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}},expectedGot$2$1=function(e,t){return"expected "+e+", got "+typeString$2$1(t)},printPath$2$1=function(e){return e.map((function(e){return"string"==typeof e?"."+e:"["+e+"]"})).join("")},prependAt$2$1=function(e,t){var r=t.at,n=__rest$2$1(t,["at"]);return __assign$2$1({at:e+(r||"")},n)},Decoder$2$1=function(){function e(t){var r=this;this.decode=t,this.run=function(e){return mapError$2$1((function(t){return{kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}}),r.decode(e))},this.runPromise=function(e){return asPromise$2$1(r.run(e))},this.runWithException=function(e){return withException$2$1(r.run(e))},this.map=function(t){return new e((function(e){return map$2$1(t,r.decode(e))}))},this.andThen=function(t){return new e((function(e){return andThen$2$1((function(r){return t(r).decode(e)}),r.decode(e))}))},this.where=function(t,n){return r.andThen((function(r){return t(r)?e.succeed(r):e.fail(n)}))}}return e.string=function(){return new e((function(e){return"string"==typeof e?ok$2$1(e):err$2$1({message:expectedGot$2$1("a string",e)})}))},e.number=function(){return new e((function(e){return"number"==typeof e?ok$2$1(e):err$2$1({message:expectedGot$2$1("a number",e)})}))},e.boolean=function(){return new e((function(e){return"boolean"==typeof e?ok$2$1(e):err$2$1({message:expectedGot$2$1("a boolean",e)})}))},e.constant=function(t){return new e((function(e){return isEqual$2$1(e,t)?ok$2$1(t):err$2$1({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})}))},e.object=function(t){return new e((function(e){if(isJsonObject$2$1(e)&&t){var r={};for(var n in t)if(t.hasOwnProperty(n)){var o=t[n].decode(e[n]);if(!0!==o.ok)return void 0===e[n]?err$2$1({message:"the key '"+n+"' is required but was not present"}):err$2$1(prependAt$2$1("."+n,o.error));void 0!==o.result&&(r[n]=o.result)}return ok$2$1(r)}return isJsonObject$2$1(e)?ok$2$1(e):err$2$1({message:expectedGot$2$1("an object",e)})}))},e.array=function(t){return new e((function(e){if(isJsonArray$2$1(e)&&t){return e.reduce((function(e,r,n){return map2$2$1((function(e,t){return e.concat([t])}),e,function(e,r){return mapError$2$1((function(e){return prependAt$2$1("["+r+"]",e)}),t.decode(e))}(r,n))}),ok$2$1([]))}return isJsonArray$2$1(e)?ok$2$1(e):err$2$1({message:expectedGot$2$1("an array",e)})}))},e.tuple=function(t){return new e((function(e){if(isJsonArray$2$1(e)){if(e.length!==t.length)return err$2$1({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var r=[],n=0;n<t.length;n++){var o=t[n].decode(e[n]);if(!o.ok)return err$2$1(prependAt$2$1("["+n+"]",o.error));r[n]=o.result}return ok$2$1(r)}return err$2$1({message:expectedGot$2$1("a tuple of length "+t.length,e)})}))},e.union=function(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return e.oneOf.apply(e,[t,r].concat(n))},e.intersection=function(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return new e((function(e){return[t,r].concat(n).reduce((function(t,r){return map2$2$1(Object.assign,t,r.decode(e))}),ok$2$1({}))}))},e.anyJson=function(){return new e((function(e){return ok$2$1(e)}))},e.unknownJson=function(){return new e((function(e){return ok$2$1(e)}))},e.dict=function(t){return new e((function(e){if(isJsonObject$2$1(e)){var r={};for(var n in e)if(e.hasOwnProperty(n)){var o=t.decode(e[n]);if(!0!==o.ok)return err$2$1(prependAt$2$1("."+n,o.error));r[n]=o.result}return ok$2$1(r)}return err$2$1({message:expectedGot$2$1("an object",e)})}))},e.optional=function(t){return new e((function(e){return null==e?ok$2$1(void 0):t.decode(e)}))},e.oneOf=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new e((function(e){for(var r=[],n=0;n<t.length;n++){var o=t[n].decode(e);if(!0===o.ok)return o;r[n]=o.error}var i=r.map((function(e){return"at error"+(e.at||"")+": "+e.message})).join('", "');return err$2$1({message:'expected a value matching one of the decoders, got the errors ["'+i+'"]'})}))},e.withDefault=function(t,r){return new e((function(e){return ok$2$1(withDefault$2$1(t,r.decode(e)))}))},e.valueAt=function(t,r){return new e((function(e){for(var n=e,o=0;o<t.length;o++){if(void 0===n)return err$2$1({at:printPath$2$1(t.slice(0,o+1)),message:"path does not exist"});if("string"==typeof t[o]&&!isJsonObject$2$1(n))return err$2$1({at:printPath$2$1(t.slice(0,o+1)),message:expectedGot$2$1("an object",n)});if("number"==typeof t[o]&&!isJsonArray$2$1(n))return err$2$1({at:printPath$2$1(t.slice(0,o+1)),message:expectedGot$2$1("an array",n)});n=n[t[o]]}return mapError$2$1((function(e){return void 0===n?{at:printPath$2$1(t),message:"path does not exist"}:prependAt$2$1(printPath$2$1(t),e)}),r.decode(n))}))},e.succeed=function(t){return new e((function(e){return ok$2$1(t)}))},e.fail=function(t){return new e((function(e){return err$2$1({message:t})}))},e.lazy=function(t){return new e((function(e){return t().decode(e)}))},e}(),string$2$1=Decoder$2$1.string,number$2$1=Decoder$2$1.number,boolean$2$1=Decoder$2$1.boolean,anyJson$2$1=Decoder$2$1.anyJson;Decoder$2$1.unknownJson;var constant$2$1=Decoder$2$1.constant,object$2$1=Decoder$2$1.object,array$2$1=Decoder$2$1.array;Decoder$2$1.tuple,Decoder$2$1.dict;var optional$2$1=Decoder$2$1.optional,oneOf$1$1=Decoder$2$1.oneOf,union$1$1=Decoder$2$1.union,intersection$1=Decoder$2$1.intersection;Decoder$2$1.withDefault,Decoder$2$1.valueAt,Decoder$2$1.succeed,Decoder$2$1.fail;var lazy$1=Decoder$2$1.lazy;const defaultConfig={gateway:{webPlatform:{}},libraries:[],exposeAPI:!0},defaultWidgetConfig$1={awaitFactory:!0,enable:!1,timeout:5e3},defaultModalsConfig={alerts:{enabled:!1},dialogs:{enabled:!1},awaitFactory:!0,timeout:5e3},defaultIntentResolverConfig={enable:!1,timeout:5e3,awaitFactory:!0},Glue42CoreMessageTypes$1={platformUnload:{name:"platformUnload"},transportSwitchRequest:{name:"transportSwitchRequest"},transportSwitchResponse:{name:"transportSwitchResponse"},getCurrentTransport:{name:"getCurrentTransport"},getCurrentTransportResponse:{name:"getCurrentTransportResponse"},checkPreferredLogic:{name:"checkPreferredLogic"},checkPreferredConnection:{name:"checkPreferredConnection"},checkPreferredLogicResponse:{name:"checkPreferredLogicResponse"},checkPreferredConnectionResponse:{name:"checkPreferredConnectionResponse"}},webPlatformTransportName$1="web-platform",latestFDC3Type="latest_fdc3_type",errorChannel$1=new MessageChannel,REQUEST_WIDGET_READY="requestWidgetFactoryReady",REQUEST_MODALS_UI_FACTORY_READY="requestModalsUIFactoryReady",MAX_SET_TIMEOUT_DELAY$1=2147483647,REQUEST_INTENT_RESOLVER_UI_FACTORY_READY="requestIntentResolverUIFactoryReady",extractErrorMsg$2=e=>"string"==typeof e?e:e?.message?"string"==typeof e.message?e.message:JSON.stringify(e.message):JSON.stringify(e),runDecoderWithIOError$1=(e,t)=>{try{return e.runWithException(t)}catch(e){return ioError$1.raiseError(e,!0)}},getSupportedOperationsNames=e=>Object.keys(e).filter((t=>e[t].execute)),handleOperationCheck=(e,t)=>({isSupported:e.some((e=>e.toLowerCase()===t.toLowerCase()))}),getSafeTimeoutDelay$1=e=>Math.min(e,MAX_SET_TIMEOUT_DELAY$1),wrapPromise=()=>{let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}};let IOError$1=class{raiseError(e,t){const r=extractErrorMsg$2(e);if(errorChannel$1.port1.postMessage(r),t)throw e;throw new Error(r)}};const ioError$1=new IOError$1,connectBrowserAppProps$1=["name","title","version","customProperties","icon","caption","type"],fdc3v2AppProps$1=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var ok$1$1=function(e){return{ok:!0,result:e}},err$1$1=function(e){return{ok:!1,error:e}},asPromise$1$1=function(e){return!0===e.ok?Promise.resolve(e.result):Promise.reject(e.error)},withDefault$1$1=function(e,t){return!0===t.ok?t.result:e},withException$1$1=function(e){if(!0===e.ok)return e.result;throw e.error},map$1$1=function(e,t){return!0===t.ok?ok$1$1(e(t.result)):t},map2$1$1=function(e,t,r){return!1===t.ok?t:!1===r.ok?r:ok$1$1(e(t.result,r.result))},mapError$1$1=function(e,t){return!0===t.ok?t:err$1$1(e(t.error))},andThen$1$1=function(e,t){return!0===t.ok?e(t.result):t},__assign$1$1=function(){return __assign$1$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign$1$1.apply(this,arguments)};function __rest$1$1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function isEqual$1$1(e,t){if(e===t)return!0;if(null===e&&null===t)return!0;if(typeof e!=typeof t)return!1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!isEqual$1$1(e[r],t[r]))return!1;return!0}var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(r=0;r<n.length;r++){if(!t.hasOwnProperty(n[r]))return!1;if(!isEqual$1$1(e[n[r]],t[n[r]]))return!1}return!0}}var isJsonArray$1$1=function(e){return Array.isArray(e)},isJsonObject$1$1=function(e){return"object"==typeof e&&null!==e&&!isJsonArray$1$1(e)},typeString$1$1=function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}},expectedGot$1$1=function(e,t){return"expected "+e+", got "+typeString$1$1(t)},printPath$1$1=function(e){return e.map((function(e){return"string"==typeof e?"."+e:"["+e+"]"})).join("")},prependAt$1$1=function(e,t){var r=t.at,n=__rest$1$1(t,["at"]);return __assign$1$1({at:e+(r||"")},n)},Decoder$1$1=function(){function e(t){var r=this;this.decode=t,this.run=function(e){return mapError$1$1((function(t){return{kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}}),r.decode(e))},this.runPromise=function(e){return asPromise$1$1(r.run(e))},this.runWithException=function(e){return withException$1$1(r.run(e))},this.map=function(t){return new e((function(e){return map$1$1(t,r.decode(e))}))},this.andThen=function(t){return new e((function(e){return andThen$1$1((function(r){return t(r).decode(e)}),r.decode(e))}))},this.where=function(t,n){return r.andThen((function(r){return t(r)?e.succeed(r):e.fail(n)}))}}return e.string=function(){return new e((function(e){return"string"==typeof e?ok$1$1(e):err$1$1({message:expectedGot$1$1("a string",e)})}))},e.number=function(){return new e((function(e){return"number"==typeof e?ok$1$1(e):err$1$1({message:expectedGot$1$1("a number",e)})}))},e.boolean=function(){return new e((function(e){return"boolean"==typeof e?ok$1$1(e):err$1$1({message:expectedGot$1$1("a boolean",e)})}))},e.constant=function(t){return new e((function(e){return isEqual$1$1(e,t)?ok$1$1(t):err$1$1({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})}))},e.object=function(t){return new e((function(e){if(isJsonObject$1$1(e)&&t){var r={};for(var n in t)if(t.hasOwnProperty(n)){var o=t[n].decode(e[n]);if(!0!==o.ok)return void 0===e[n]?err$1$1({message:"the key '"+n+"' is required but was not present"}):err$1$1(prependAt$1$1("."+n,o.error));void 0!==o.result&&(r[n]=o.result)}return ok$1$1(r)}return isJsonObject$1$1(e)?ok$1$1(e):err$1$1({message:expectedGot$1$1("an object",e)})}))},e.array=function(t){return new e((function(e){if(isJsonArray$1$1(e)&&t){return e.reduce((function(e,r,n){return map2$1$1((function(e,t){return e.concat([t])}),e,function(e,r){return mapError$1$1((function(e){return prependAt$1$1("["+r+"]",e)}),t.decode(e))}(r,n))}),ok$1$1([]))}return isJsonArray$1$1(e)?ok$1$1(e):err$1$1({message:expectedGot$1$1("an array",e)})}))},e.tuple=function(t){return new e((function(e){if(isJsonArray$1$1(e)){if(e.length!==t.length)return err$1$1({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var r=[],n=0;n<t.length;n++){var o=t[n].decode(e[n]);if(!o.ok)return err$1$1(prependAt$1$1("["+n+"]",o.error));r[n]=o.result}return ok$1$1(r)}return err$1$1({message:expectedGot$1$1("a tuple of length "+t.length,e)})}))},e.union=function(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return e.oneOf.apply(e,[t,r].concat(n))},e.intersection=function(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return new e((function(e){return[t,r].concat(n).reduce((function(t,r){return map2$1$1(Object.assign,t,r.decode(e))}),ok$1$1({}))}))},e.anyJson=function(){return new e((function(e){return ok$1$1(e)}))},e.unknownJson=function(){return new e((function(e){return ok$1$1(e)}))},e.dict=function(t){return new e((function(e){if(isJsonObject$1$1(e)){var r={};for(var n in e)if(e.hasOwnProperty(n)){var o=t.decode(e[n]);if(!0!==o.ok)return err$1$1(prependAt$1$1("."+n,o.error));r[n]=o.result}return ok$1$1(r)}return err$1$1({message:expectedGot$1$1("an object",e)})}))},e.optional=function(t){return new e((function(e){return null==e?ok$1$1(void 0):t.decode(e)}))},e.oneOf=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new e((function(e){for(var r=[],n=0;n<t.length;n++){var o=t[n].decode(e);if(!0===o.ok)return o;r[n]=o.error}var i=r.map((function(e){return"at error"+(e.at||"")+": "+e.message})).join('", "');return err$1$1({message:'expected a value matching one of the decoders, got the errors ["'+i+'"]'})}))},e.withDefault=function(t,r){return new e((function(e){return ok$1$1(withDefault$1$1(t,r.decode(e)))}))},e.valueAt=function(t,r){return new e((function(e){for(var n=e,o=0;o<t.length;o++){if(void 0===n)return err$1$1({at:printPath$1$1(t.slice(0,o+1)),message:"path does not exist"});if("string"==typeof t[o]&&!isJsonObject$1$1(n))return err$1$1({at:printPath$1$1(t.slice(0,o+1)),message:expectedGot$1$1("an object",n)});if("number"==typeof t[o]&&!isJsonArray$1$1(n))return err$1$1({at:printPath$1$1(t.slice(0,o+1)),message:expectedGot$1$1("an array",n)});n=n[t[o]]}return mapError$1$1((function(e){return void 0===n?{at:printPath$1$1(t),message:"path does not exist"}:prependAt$1$1(printPath$1$1(t),e)}),r.decode(n))}))},e.succeed=function(t){return new e((function(e){return ok$1$1(t)}))},e.fail=function(t){return new e((function(e){return err$1$1({message:t})}))},e.lazy=function(t){return new e((function(e){return t().decode(e)}))},e}(),string$1$1=Decoder$1$1.string,number$1$1=Decoder$1$1.number,boolean$1$1=Decoder$1$1.boolean,anyJson$1$1=Decoder$1$1.anyJson;Decoder$1$1.unknownJson;var constant$1$1=Decoder$1$1.constant,object$1$1=Decoder$1$1.object,array$1$1=Decoder$1$1.array;Decoder$1$1.tuple;var dict$1=Decoder$1$1.dict,optional$1$1=Decoder$1$1.optional,oneOf$3=Decoder$1$1.oneOf;Decoder$1$1.union,Decoder$1$1.intersection,Decoder$1$1.withDefault,Decoder$1$1.valueAt,Decoder$1$1.succeed,Decoder$1$1.fail,Decoder$1$1.lazy;const nonEmptyStringDecoder$3$1=string$1$1().where((e=>e.length>0),"Expected a non-empty string"),nonNegativeNumberDecoder$3$1=number$1$1().where((e=>e>=0),"Expected a non-negative number"),intentDefinitionDecoder$1$1=object$1$1({name:nonEmptyStringDecoder$3$1,displayName:optional$1$1(string$1$1()),contexts:optional$1$1(array$1$1(string$1$1())),customConfig:optional$1$1(object$1$1())}),v2TypeDecoder$1=oneOf$3(constant$1$1("web"),constant$1$1("native"),constant$1$1("citrix"),constant$1$1("onlineNative"),constant$1$1("other")),v2DetailsDecoder$1=object$1$1({url:nonEmptyStringDecoder$3$1}),v2IconDecoder$1=object$1$1({src:nonEmptyStringDecoder$3$1,size:optional$1$1(nonEmptyStringDecoder$3$1),type:optional$1$1(nonEmptyStringDecoder$3$1)}),v2ScreenshotDecoder$1=object$1$1({src:nonEmptyStringDecoder$3$1,size:optional$1$1(nonEmptyStringDecoder$3$1),type:optional$1$1(nonEmptyStringDecoder$3$1),label:optional$1$1(nonEmptyStringDecoder$3$1)}),v2ListensForIntentDecoder$1=object$1$1({contexts:array$1$1(nonEmptyStringDecoder$3$1),displayName:optional$1$1(nonEmptyStringDecoder$3$1),resultType:optional$1$1(nonEmptyStringDecoder$3$1),customConfig:optional$1$1(anyJson$1$1())}),v2IntentsDecoder$1=object$1$1({listensFor:optional$1$1(dict$1(v2ListensForIntentDecoder$1)),raises:optional$1$1(dict$1(array$1$1(nonEmptyStringDecoder$3$1)))}),v2UserChannelDecoder$1=object$1$1({broadcasts:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1)),listensFor:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1))}),v2AppChannelDecoder$1=object$1$1({name:nonEmptyStringDecoder$3$1,description:optional$1$1(nonEmptyStringDecoder$3$1),broadcasts:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1)),listensFor:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1))}),v2InteropDecoder$1=object$1$1({intents:optional$1$1(v2IntentsDecoder$1),userChannels:optional$1$1(v2UserChannelDecoder$1),appChannels:optional$1$1(array$1$1(v2AppChannelDecoder$1))}),glue42ApplicationDetailsDecoder$1=object$1$1({url:optional$1$1(nonEmptyStringDecoder$3$1),top:optional$1$1(number$1$1()),left:optional$1$1(number$1$1()),width:optional$1$1(nonNegativeNumberDecoder$3$1),height:optional$1$1(nonNegativeNumberDecoder$3$1)}),glue42HostManifestsBrowserDecoder$1=object$1$1({name:optional$1$1(nonEmptyStringDecoder$3$1),type:optional$1$1(nonEmptyStringDecoder$3$1.where((e=>"window"===e),"Expected a value of window")),title:optional$1$1(nonEmptyStringDecoder$3$1),version:optional$1$1(nonEmptyStringDecoder$3$1),customProperties:optional$1$1(anyJson$1$1()),icon:optional$1$1(string$1$1()),caption:optional$1$1(string$1$1()),details:optional$1$1(glue42ApplicationDetailsDecoder$1),intents:optional$1$1(array$1$1(intentDefinitionDecoder$1$1)),hidden:optional$1$1(boolean$1$1())}),v1DefinitionDecoder$1=object$1$1({name:nonEmptyStringDecoder$3$1,appId:nonEmptyStringDecoder$3$1,title:optional$1$1(nonEmptyStringDecoder$3$1),version:optional$1$1(nonEmptyStringDecoder$3$1),manifest:nonEmptyStringDecoder$3$1,manifestType:nonEmptyStringDecoder$3$1,tooltip:optional$1$1(nonEmptyStringDecoder$3$1),description:optional$1$1(nonEmptyStringDecoder$3$1),contactEmail:optional$1$1(nonEmptyStringDecoder$3$1),supportEmail:optional$1$1(nonEmptyStringDecoder$3$1),publisher:optional$1$1(nonEmptyStringDecoder$3$1),images:optional$1$1(array$1$1(object$1$1({url:optional$1$1(nonEmptyStringDecoder$3$1)}))),icons:optional$1$1(array$1$1(object$1$1({icon:optional$1$1(nonEmptyStringDecoder$3$1)}))),customConfig:anyJson$1$1(),intents:optional$1$1(array$1$1(intentDefinitionDecoder$1$1))}),v2LocalizedDefinitionDecoder$1=object$1$1({appId:optional$1$1(nonEmptyStringDecoder$3$1),name:optional$1$1(nonEmptyStringDecoder$3$1),details:optional$1$1(v2DetailsDecoder$1),version:optional$1$1(nonEmptyStringDecoder$3$1),title:optional$1$1(nonEmptyStringDecoder$3$1),tooltip:optional$1$1(nonEmptyStringDecoder$3$1),lang:optional$1$1(nonEmptyStringDecoder$3$1),description:optional$1$1(nonEmptyStringDecoder$3$1),categories:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1)),icons:optional$1$1(array$1$1(v2IconDecoder$1)),screenshots:optional$1$1(array$1$1(v2ScreenshotDecoder$1)),contactEmail:optional$1$1(nonEmptyStringDecoder$3$1),supportEmail:optional$1$1(nonEmptyStringDecoder$3$1),moreInfo:optional$1$1(nonEmptyStringDecoder$3$1),publisher:optional$1$1(nonEmptyStringDecoder$3$1),customConfig:optional$1$1(array$1$1(anyJson$1$1())),hostManifests:optional$1$1(anyJson$1$1()),interop:optional$1$1(v2InteropDecoder$1)}),v2DefinitionDecoder$1=object$1$1({appId:nonEmptyStringDecoder$3$1,name:optional$1$1(nonEmptyStringDecoder$3$1),type:v2TypeDecoder$1,details:v2DetailsDecoder$1,version:optional$1$1(nonEmptyStringDecoder$3$1),title:optional$1$1(nonEmptyStringDecoder$3$1),tooltip:optional$1$1(nonEmptyStringDecoder$3$1),lang:optional$1$1(nonEmptyStringDecoder$3$1),description:optional$1$1(nonEmptyStringDecoder$3$1),categories:optional$1$1(array$1$1(nonEmptyStringDecoder$3$1)),icons:optional$1$1(array$1$1(v2IconDecoder$1)),screenshots:optional$1$1(array$1$1(v2ScreenshotDecoder$1)),contactEmail:optional$1$1(nonEmptyStringDecoder$3$1),supportEmail:optional$1$1(nonEmptyStringDecoder$3$1),moreInfo:optional$1$1(nonEmptyStringDecoder$3$1),publisher:optional$1$1(nonEmptyStringDecoder$3$1),customConfig:optional$1$1(array$1$1(anyJson$1$1())),hostManifests:optional$1$1(anyJson$1$1()),interop:optional$1$1(v2InteropDecoder$1),localizedVersions:optional$1$1(dict$1(v2LocalizedDefinitionDecoder$1))}),allDefinitionsDecoder$1=oneOf$3(v1DefinitionDecoder$1,v2DefinitionDecoder$1),parseDecoderErrorToStringMessage$1=e=>`${e.kind} at ${e.at}: ${JSON.stringify(e.input)}. Reason - ${e.message}`;let FDC3Service$1=class{fdc3ToDesktopDefinitionType={web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"};toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(e){const t=allDefinitionsDecoder$1.run(e);return t.ok?e.appId&&e.details?{isFdc3:!0,version:"2.0"}:e.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:parseDecoderErrorToStringMessage$1(t.error)}}parseToBrowserBaseAppData(e){const{isFdc3:t,version:r}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const n=allDefinitionsDecoder$1.run(e);if(!n.ok)throw new Error(`Invalid FDC3 ${r} definition. Error: ${parseDecoderErrorToStringMessage$1(n.error)}`);const o=this.getUserPropertiesFromDefinition(e,r),i={url:this.getUrl(e,r)},s={name:e.appId,type:"window",createOptions:i,userProperties:{...o,intents:"1.2"===r?o.intents:this.getIntentsFromV2AppDefinition(e),details:i},title:e.title,version:e.version,icon:this.getIconFromDefinition(e,r),caption:e.description,fdc3:"2.0"===r?{...e,definitionVersion:"2.0"}:void 0},a=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!a)return s;const c=glue42HostManifestsBrowserDecoder$1.run(a);if(!c.ok)throw new Error(`Invalid FDC3 ${r} definition. Error: ${parseDecoderErrorToStringMessage$1(c.error)}`);return Object.keys(c.result).length?this.mergeBaseAppDataWithGlueManifest(s,c.result):s}parseToDesktopAppConfig(e){const{isFdc3:t,version:r}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const n=allDefinitionsDecoder$1.run(e);if(!n.ok)throw new Error(`Invalid FDC3 ${r} definition. Error: ${parseDecoderErrorToStringMessage$1(n.error)}`);if("1.2"===r){const t=e;return{name:t.appId,type:"window",details:{url:this.getUrl(e,r)},version:t.version,title:t.title,tooltip:t.tooltip,caption:t.description,icon:t.icons?.[0].icon,intents:t.intents,customProperties:{manifestType:t.manifestType,images:t.images,contactEmail:t.contactEmail,supportEmail:t.supportEmail,publisher:t.publisher,icons:t.icons,customConfig:t.customConfig}}}const o=e,i={name:o.appId,type:this.fdc3ToDesktopDefinitionType[o.type],details:o.details,version:o.version,title:o.title,tooltip:o.tooltip,caption:o.description,icon:this.getIconFromDefinition(o,"2.0"),intents:this.getIntentsFromV2AppDefinition(o),fdc3:{...o,definitionVersion:"2.0"}},s=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!s)return i;if("object"!=typeof s||Array.isArray(s))throw new Error(`Invalid '${e.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(i,s)}getUserPropertiesFromDefinition(e,t){return"1.2"===t?Object.fromEntries(Object.entries(e).filter((([e])=>!connectBrowserAppProps$1.includes(e)))):Object.fromEntries(Object.entries(e).filter((([e])=>!connectBrowserAppProps$1.includes(e)&&!fdc3v2AppProps$1.includes(e))))}getUrl(e,t){let r;if("1.2"===t){const t=JSON.parse(e.manifest);r=t.details?.url||t.url}else r=e.details?.url;if(!r||"string"!=typeof r)throw new Error(`Invalid FDC3 ${t} definition. Provide valid 'url' under '${"1.2"===t?"manifest":"details"}' key`);return r}getIntentsFromV2AppDefinition(e){const t=e.interop?.intents?.listensFor;if(!t)return;return Object.entries(t).map((e=>{const[t,r]=e;return{name:t,...r}}))}getIconFromDefinition(e,t){return"1.2"===t?e.icons?.find((e=>e.icon))?.icon||void 0:e.icons?.find((e=>e.src))?.src||void 0}mergeBaseAppDataWithGlueManifest(e,t){let r=e;if(t.customProperties&&(r.userProperties={...e.userProperties,...t.customProperties}),t.details){const n={...e.createOptions,...t.details};r.createOptions=n,r.userProperties.details=n}return Array.isArray(t.intents)&&(r.userProperties.intents=(r.userProperties.intents||[]).concat(t.intents)),r={...r,...t},delete r.details,delete r.intents,r}mergeDesktopConfigWithGlueManifest(e,t){const r=Object.assign({},e,t,{details:{...e.details,...t.details}});return Array.isArray(t.intents)&&(r.intents=(e.intents||[]).concat(t.intents)),r}};const decoders$1$1={common:{nonEmptyStringDecoder:nonEmptyStringDecoder$3$1,nonNegativeNumberDecoder:nonNegativeNumberDecoder$3$1},fdc3:{allDefinitionsDecoder:allDefinitionsDecoder$1,v1DefinitionDecoder:v1DefinitionDecoder$1,v2DefinitionDecoder:v2DefinitionDecoder$1}};var INTENTS_ERRORS$1;!function(e){e.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",e.CALLER_NOT_DEFINED="Caller Id is not defined",e.TIMEOUT_HIT="Timeout hit",e.INTENT_NOT_FOUND="Cannot find Intent",e.HANDLER_NOT_FOUND="Cannot find Intent Handler",e.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",e.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",e.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",e.RESOLVER_TIMEOUT="User did not choose a handler",e.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",e.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"}(INTENTS_ERRORS$1||(INTENTS_ERRORS$1={}));let IoC$1$1=class{_fdc3;_decoders=decoders$1$1;_errors={intents:INTENTS_ERRORS$1};get fdc3(){return this._fdc3||(this._fdc3=(new FDC3Service$1).toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};const ioc$1=new IoC$1$1;ioc$1.fdc3;const decoders$2=ioc$1.decoders;ioc$1.errors;const nonEmptyStringDecoder$2$1=string$2$1().where((e=>e.length>0),"Expected a non-empty string"),nonNegativeNumberDecoder$2$1=number$2$1().where((e=>e>=0),"Expected a non-negative number"),optionalNonEmptyStringDecoder=optional$2$1(nonEmptyStringDecoder$2$1),libDomainDecoder$1=oneOf$1$1(constant$2$1("system"),constant$2$1("windows"),constant$2$1("appManager"),constant$2$1("layouts"),constant$2$1("intents"),constant$2$1("notifications"),constant$2$1("channels"),constant$2$1("extension"),constant$2$1("themes"),constant$2$1("prefs"),constant$2$1("ui")),windowOperationTypesDecoder=oneOf$1$1(constant$2$1("openWindow"),constant$2$1("windowHello"),constant$2$1("windowAdded"),constant$2$1("windowRemoved"),constant$2$1("getBounds"),constant$2$1("getFrameBounds"),constant$2$1("getUrl"),constant$2$1("moveResize"),constant$2$1("focus"),constant$2$1("close"),constant$2$1("getTitle"),constant$2$1("setTitle"),constant$2$1("focusChange"),constant$2$1("getChannel"),constant$2$1("notifyChannelsChanged"),constant$2$1("operationCheck")),appManagerOperationTypesDecoder$1=oneOf$1$1(constant$2$1("appHello"),constant$2$1("appDirectoryStateChange"),constant$2$1("instanceStarted"),constant$2$1("instanceStopped"),constant$2$1("applicationStart"),constant$2$1("instanceStop"),constant$2$1("clear"),constant$2$1("operationCheck")),layoutsOperationTypesDecoder$1=oneOf$1$1(constant$2$1("layoutAdded"),constant$2$1("layoutChanged"),constant$2$1("layoutRemoved"),constant$2$1("layoutRenamed"),constant$2$1("get"),constant$2$1("getAll"),constant$2$1("export"),constant$2$1("import"),constant$2$1("remove"),constant$2$1("rename"),constant$2$1("clientSaveRequest"),constant$2$1("getGlobalPermissionState"),constant$2$1("checkGlobalActivated"),constant$2$1("requestGlobalPermission"),constant$2$1("getDefaultGlobal"),constant$2$1("setDefaultGlobal"),constant$2$1("clearDefaultGlobal"),constant$2$1("updateMetadata"),constant$2$1("operationCheck"),constant$2$1("getCurrent"),constant$2$1("defaultLayoutChanged"),constant$2$1("layoutRestored")),notificationsOperationTypesDecoder=oneOf$1$1(constant$2$1("raiseNotification"),constant$2$1("requestPermission"),constant$2$1("notificationShow"),constant$2$1("notificationClick"),constant$2$1("getPermission"),constant$2$1("list"),constant$2$1("notificationRaised"),constant$2$1("notificationClosed"),constant$2$1("click"),constant$2$1("clear"),constant$2$1("clearAll"),constant$2$1("configure"),constant$2$1("getConfiguration"),constant$2$1("configurationChanged"),constant$2$1("setState"),constant$2$1("clearOld"),constant$2$1("activeCountChange"),constant$2$1("stateChange"),constant$2$1("operationCheck"),constant$2$1("getActiveCount")),systemOperationTypesDecoder$1=oneOf$1$1(constant$2$1("getEnvironment"),constant$2$1("getBase"),constant$2$1("platformShutdown"),constant$2$1("isFdc3DataWrappingSupported"),constant$2$1("clientError"),constant$2$1("systemHello"),constant$2$1("operationCheck")),windowRelativeDirectionDecoder$1=oneOf$1$1(constant$2$1("top"),constant$2$1("left"),constant$2$1("right"),constant$2$1("bottom")),windowBoundsDecoder$1=object$2$1({top:number$2$1(),left:number$2$1(),width:nonNegativeNumberDecoder$2$1,height:nonNegativeNumberDecoder$2$1}),windowOpenSettingsDecoder$1=optional$2$1(object$2$1({top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1),context:optional$2$1(anyJson$2$1()),relativeTo:optional$2$1(nonEmptyStringDecoder$2$1),relativeDirection:optional$2$1(windowRelativeDirectionDecoder$1),windowId:optional$2$1(nonEmptyStringDecoder$2$1),layoutComponentId:optional$2$1(nonEmptyStringDecoder$2$1)})),openWindowConfigDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,url:nonEmptyStringDecoder$2$1,options:windowOpenSettingsDecoder$1}),windowHelloDecoder=object$2$1({windowId:optional$2$1(nonEmptyStringDecoder$2$1)}),coreWindowDataDecoder=object$2$1({windowId:nonEmptyStringDecoder$2$1,name:nonEmptyStringDecoder$2$1}),simpleWindowDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1}),helloSuccessDecoder=object$2$1({windows:array$2$1(coreWindowDataDecoder),isWorkspaceFrame:boolean$2$1()}),windowTitleConfigDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,title:string$2$1()}),focusEventDataDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,hasFocus:boolean$2$1()}),windowMoveResizeConfigDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1),relative:optional$2$1(boolean$2$1())}),windowBoundsResultDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,bounds:object$2$1({top:number$2$1(),left:number$2$1(),width:nonNegativeNumberDecoder$2$1,height:nonNegativeNumberDecoder$2$1})}),frameWindowBoundsResultDecoder$1=object$2$1({bounds:object$2$1({top:number$2$1(),left:number$2$1(),width:nonNegativeNumberDecoder$2$1,height:nonNegativeNumberDecoder$2$1})}),windowUrlResultDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,url:nonEmptyStringDecoder$2$1}),anyDecoder$1=anyJson$2$1(),boundsDecoder=object$2$1({top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1)}),instanceDataDecoder$1=object$2$1({id:nonEmptyStringDecoder$2$1,applicationName:nonEmptyStringDecoder$2$1}),iframePermissionsPolicyConfigDecoder$1=object$2$1({flags:string$2$1()}),workspacesSandboxDecoder$1=object$2$1({flags:string$2$1()}),requestChannelSelectorConfigDecoder$1=object$2$1({windowId:nonEmptyStringDecoder$2$1,channelsNames:array$2$1(nonEmptyStringDecoder$2$1)}),channelSelectorDecoder$1=object$2$1({enabled:boolean$2$1()}),applicationDetailsDecoder$1=object$2$1({url:nonEmptyStringDecoder$2$1,top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1),workspacesSandbox:optional$2$1(workspacesSandboxDecoder$1),channelSelector:optional$2$1(channelSelectorDecoder$1),iframePermissionsPolicy:optional$2$1(iframePermissionsPolicyConfigDecoder$1)}),intentDefinitionDecoder$2=object$2$1({name:nonEmptyStringDecoder$2$1,displayName:optional$2$1(string$2$1()),contexts:optional$2$1(array$2$1(string$2$1())),customConfig:optional$2$1(object$2$1())}),applicationDefinitionDecoder=object$2$1({name:nonEmptyStringDecoder$2$1,type:nonEmptyStringDecoder$2$1.where((e=>"window"===e),"Expected a value of window"),title:optional$2$1(nonEmptyStringDecoder$2$1),version:optional$2$1(nonEmptyStringDecoder$2$1),customProperties:optional$2$1(anyJson$2$1()),icon:optional$2$1(string$2$1()),caption:optional$2$1(string$2$1()),details:applicationDetailsDecoder$1,intents:optional$2$1(array$2$1(intentDefinitionDecoder$2)),hidden:optional$2$1(boolean$2$1()),fdc3:optional$2$1(decoders$2.fdc3.v2DefinitionDecoder)}),allApplicationDefinitionsDecoder$1=oneOf$1$1(applicationDefinitionDecoder,decoders$2.fdc3.v2DefinitionDecoder,decoders$2.fdc3.v1DefinitionDecoder);object$2$1({definitions:array$2$1(allApplicationDefinitionsDecoder$1),mode:oneOf$1$1(constant$2$1("replace"),constant$2$1("merge"))});const appRemoveConfigDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1}),appsExportOperationDecoder$1=object$2$1({definitions:array$2$1(applicationDefinitionDecoder)}),applicationDataDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,type:nonEmptyStringDecoder$2$1.where((e=>"window"===e),"Expected a value of window"),instances:array$2$1(instanceDataDecoder$1),userProperties:optional$2$1(anyJson$2$1()),title:optional$2$1(nonEmptyStringDecoder$2$1),version:optional$2$1(nonEmptyStringDecoder$2$1),icon:optional$2$1(nonEmptyStringDecoder$2$1),caption:optional$2$1(nonEmptyStringDecoder$2$1)}),baseApplicationDataDecoder=object$2$1({name:nonEmptyStringDecoder$2$1,type:nonEmptyStringDecoder$2$1.where((e=>"window"===e),"Expected a value of window"),userProperties:anyJson$2$1(),title:optional$2$1(nonEmptyStringDecoder$2$1),version:optional$2$1(nonEmptyStringDecoder$2$1),icon:optional$2$1(nonEmptyStringDecoder$2$1),caption:optional$2$1(nonEmptyStringDecoder$2$1)}),appDirectoryStateChangeDecoder=object$2$1({appsAdded:array$2$1(baseApplicationDataDecoder),appsChanged:array$2$1(baseApplicationDataDecoder),appsRemoved:array$2$1(baseApplicationDataDecoder)}),appHelloSuccessDecoder$1=object$2$1({apps:array$2$1(applicationDataDecoder$1),initialChannelId:optional$2$1(nonEmptyStringDecoder$2$1)}),basicInstanceDataDecoder$1=object$2$1({id:nonEmptyStringDecoder$2$1}),layoutTypeDecoder$1=oneOf$1$1(constant$2$1("Global"),constant$2$1("Activity"),constant$2$1("ApplicationDefault"),constant$2$1("Swimlane"),constant$2$1("Workspace")),componentTypeDecoder$1=oneOf$1$1(constant$2$1("application"),constant$2$1("activity")),windowComponentStateDecoder$1=object$2$1({context:optional$2$1(anyJson$2$1()),bounds:windowBoundsDecoder$1,createArgs:object$2$1({name:optional$2$1(nonEmptyStringDecoder$2$1),url:optional$2$1(nonEmptyStringDecoder$2$1),context:optional$2$1(anyJson$2$1())}),windowState:optional$2$1(nonEmptyStringDecoder$2$1),restoreState:optional$2$1(nonEmptyStringDecoder$2$1),instanceId:nonEmptyStringDecoder$2$1,isCollapsed:optional$2$1(boolean$2$1()),isSticky:optional$2$1(boolean$2$1()),restoreSettings:object$2$1({groupId:optional$2$1(nonEmptyStringDecoder$2$1),groupZOrder:optional$2$1(number$2$1())})}),windowLayoutComponentDecoder$1=object$2$1({type:constant$2$1("window"),componentType:optional$2$1(componentTypeDecoder$1),application:nonEmptyStringDecoder$2$1,state:windowComponentStateDecoder$1}),windowLayoutItemDecoder$1=object$2$1({type:constant$2$1("window"),config:object$2$1({appName:nonEmptyStringDecoder$2$1,url:optional$2$1(nonEmptyStringDecoder$2$1),title:optional$2$1(string$2$1()),allowExtract:optional$2$1(boolean$2$1()),allowReorder:optional$2$1(boolean$2$1()),showCloseButton:optional$2$1(boolean$2$1()),isMaximized:optional$2$1(boolean$2$1())})}),groupLayoutItemDecoder$2=object$2$1({type:constant$2$1("group"),config:anyJson$2$1(),children:array$2$1(oneOf$1$1(windowLayoutItemDecoder$1))}),columnLayoutItemDecoder$2=object$2$1({type:constant$2$1("column"),config:anyJson$2$1(),children:array$2$1(oneOf$1$1(groupLayoutItemDecoder$2,windowLayoutItemDecoder$1,lazy$1((()=>columnLayoutItemDecoder$2)),lazy$1((()=>rowLayoutItemDecoder$2))))}),rowLayoutItemDecoder$2=object$2$1({type:constant$2$1("row"),config:anyJson$2$1(),children:array$2$1(oneOf$1$1(columnLayoutItemDecoder$2,groupLayoutItemDecoder$2,windowLayoutItemDecoder$1,lazy$1((()=>rowLayoutItemDecoder$2))))}),workspaceLayoutComponentStateDecoder$1=object$2$1({config:anyJson$2$1(),context:anyJson$2$1(),children:array$2$1(oneOf$1$1(rowLayoutItemDecoder$2,columnLayoutItemDecoder$2,groupLayoutItemDecoder$2,windowLayoutItemDecoder$1))}),workspaceLayoutComponentDecoder$1=object$2$1({type:constant$2$1("Workspace"),application:optional$2$1(nonEmptyStringDecoder$2$1),state:workspaceLayoutComponentStateDecoder$1}),workspaceFrameComponentStateDecoder$1=object$2$1({bounds:windowBoundsDecoder$1,instanceId:nonEmptyStringDecoder$2$1,selectedWorkspace:nonNegativeNumberDecoder$2$1,workspaces:array$2$1(workspaceLayoutComponentStateDecoder$1),windowState:optional$2$1(nonEmptyStringDecoder$2$1),restoreState:optional$2$1(nonEmptyStringDecoder$2$1),context:optional$2$1(anyJson$2$1())}),workspaceFrameComponentDecoder$1=object$2$1({type:constant$2$1("workspaceFrame"),application:nonEmptyStringDecoder$2$1,componentType:optional$2$1(componentTypeDecoder$1),state:workspaceFrameComponentStateDecoder$1}),glueLayoutDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,type:layoutTypeDecoder$1,token:optional$2$1(nonEmptyStringDecoder$2$1),components:array$2$1(oneOf$1$1(windowLayoutComponentDecoder$1,workspaceLayoutComponentDecoder$1,workspaceFrameComponentDecoder$1)),context:optional$2$1(anyJson$2$1()),metadata:optional$2$1(anyJson$2$1()),version:optional$2$1(number$2$1())}),renamedLayoutNotificationDecoder=object$2$1({name:nonEmptyStringDecoder$2$1,type:layoutTypeDecoder$1,token:optional$2$1(nonEmptyStringDecoder$2$1),components:array$2$1(oneOf$1$1(windowLayoutComponentDecoder$1,workspaceLayoutComponentDecoder$1,workspaceFrameComponentDecoder$1)),context:optional$2$1(anyJson$2$1()),metadata:optional$2$1(anyJson$2$1()),version:optional$2$1(number$2$1()),prevName:nonEmptyStringDecoder$2$1}),newLayoutOptionsDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,context:optional$2$1(anyJson$2$1()),metadata:optional$2$1(anyJson$2$1()),instances:optional$2$1(array$2$1(nonEmptyStringDecoder$2$1)),ignoreInstances:optional$2$1(array$2$1(nonEmptyStringDecoder$2$1))}),restoreOptionsDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,context:optional$2$1(anyJson$2$1()),closeRunningInstance:optional$2$1(boolean$2$1()),closeMe:optional$2$1(boolean$2$1()),timeout:optional$2$1(nonNegativeNumberDecoder$2$1)}),layoutSummaryDecoder$2=object$2$1({name:nonEmptyStringDecoder$2$1,type:layoutTypeDecoder$1,context:optional$2$1(anyJson$2$1()),metadata:optional$2$1(anyJson$2$1())}),simpleLayoutConfigDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,type:layoutTypeDecoder$1}),saveLayoutConfigDecoder$1=object$2$1({layout:newLayoutOptionsDecoder$1}),renameLayoutConfigDecoder$1=object$2$1({layout:glueLayoutDecoder$1,newName:nonEmptyStringDecoder$2$1}),layoutResultDecoder$1=object$2$1({status:nonEmptyStringDecoder$2$1}),updateLayoutMetadataConfigDecoder$1=object$2$1({layout:glueLayoutDecoder$1}),restoreLayoutConfigDecoder$1=object$2$1({layout:restoreOptionsDecoder$1}),getAllLayoutsConfigDecoder$1=object$2$1({type:layoutTypeDecoder$1}),allLayoutsFullConfigDecoder$1=object$2$1({layouts:array$2$1(glueLayoutDecoder$1)}),defaultGlobalChangedDecoder=optional$2$1(object$2$1({name:nonEmptyStringDecoder$2$1})),importModeDecoder$1=oneOf$1$1(constant$2$1("replace"),constant$2$1("merge")),layoutsImportConfigDecoder$1=object$2$1({layouts:array$2$1(glueLayoutDecoder$1),mode:importModeDecoder$1,skipManagerRequest:optional$2$1(boolean$2$1())}),allLayoutsSummariesResultDecoder$1=object$2$1({summaries:array$2$1(layoutSummaryDecoder$2)}),simpleLayoutResultDecoder=object$2$1({layout:glueLayoutDecoder$1}),optionalSimpleLayoutResult$1=object$2$1({layout:optional$2$1(glueLayoutDecoder$1)}),setDefaultGlobalConfigDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1}),intentsOperationTypesDecoder$1=oneOf$1$1(constant$2$1("findIntent"),constant$2$1("getIntents"),constant$2$1("getIntentsByHandler"),constant$2$1("raise"),constant$2$1("filterHandlers")),intentHandlerDecoder$1=object$2$1({applicationName:nonEmptyStringDecoder$2$1,applicationTitle:optional$2$1(string$2$1()),applicationDescription:optional$2$1(string$2$1()),applicationIcon:optional$2$1(string$2$1()),type:oneOf$1$1(constant$2$1("app"),constant$2$1("instance")),displayName:optional$2$1(string$2$1()),contextTypes:optional$2$1(array$2$1(nonEmptyStringDecoder$2$1)),instanceId:optional$2$1(string$2$1()),instanceTitle:optional$2$1(string$2$1()),resultType:optional$2$1(string$2$1())});object$2$1({applicationName:string$2$1(),applicationIcon:optional$2$1(string$2$1()),instanceId:optional$2$1(string$2$1())}),object$2$1({intent:nonEmptyStringDecoder$2$1,handler:intentHandlerDecoder$1});const intentDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,handlers:array$2$1(intentHandlerDecoder$1)}),intentTargetDecoder$1=oneOf$1$1(constant$2$1("startNew"),constant$2$1("reuse"),object$2$1({app:optional$2$1(nonEmptyStringDecoder$2$1),instance:optional$2$1(nonEmptyStringDecoder$2$1)})),intentContextDecoder$1=object$2$1({type:optional$2$1(nonEmptyStringDecoder$2$1),data:optional$2$1(anyJson$2$1())}),intentsDecoder$1=array$2$1(intentDecoder$1),wrappedIntentsDecoder$1=object$2$1({intents:intentsDecoder$1}),intentFilterDecoder=object$2$1({name:optional$2$1(nonEmptyStringDecoder$2$1),contextType:optional$2$1(nonEmptyStringDecoder$2$1),resultType:optional$2$1(nonEmptyStringDecoder$2$1)}),findFilterDecoder=oneOf$1$1(nonEmptyStringDecoder$2$1,intentFilterDecoder),wrappedIntentFilterDecoder$1=object$2$1({filter:optional$2$1(intentFilterDecoder)}),applicationStartOptionsDecoder$1=object$2$1({top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1),relativeTo:optional$2$1(nonEmptyStringDecoder$2$1),relativeDirection:optional$2$1(windowRelativeDirectionDecoder$1),waitForAGMReady:optional$2$1(boolean$2$1()),channelId:optional$2$1(nonEmptyStringDecoder$2$1)}),intentRequestDecoder$1=object$2$1({intent:nonEmptyStringDecoder$2$1,target:optional$2$1(intentTargetDecoder$1),context:optional$2$1(intentContextDecoder$1),options:optional$2$1(applicationStartOptionsDecoder$1),handlers:optional$2$1(array$2$1(intentHandlerDecoder$1)),timeout:optional$2$1(nonNegativeNumberDecoder$2$1),waitUserResponseIndefinitely:optional$2$1(boolean$2$1()),clearSavedHandler:optional$2$1(boolean$2$1())}),originAppDecoder$1=object$2$1({interopInstance:nonEmptyStringDecoder$2$1,name:optional$2$1(nonEmptyStringDecoder$2$1)}),startReasonDecoder$1=object$2$1({originApp:originAppDecoder$1,intentRequest:optional$2$1(intentRequestDecoder$1)}),applicationStartConfigDecoder$1=object$2$1({name:nonEmptyStringDecoder$2$1,waitForAGMReady:boolean$2$1(),id:optional$2$1(nonEmptyStringDecoder$2$1),context:optional$2$1(anyJson$2$1()),top:optional$2$1(number$2$1()),left:optional$2$1(number$2$1()),width:optional$2$1(nonNegativeNumberDecoder$2$1),height:optional$2$1(nonNegativeNumberDecoder$2$1),relativeTo:optional$2$1(nonEmptyStringDecoder$2$1),relativeDirection:optional$2$1(windowRelativeDirectionDecoder$1),forceChromeTab:optional$2$1(boolean$2$1()),layoutComponentId:optional$2$1(nonEmptyStringDecoder$2$1),channelId:optional$2$1(nonEmptyStringDecoder$2$1),startReason:startReasonDecoder$1}),raiseRequestDecoder=oneOf$1$1(nonEmptyStringDecoder$2$1,intentRequestDecoder$1),resolverConfigDecoder$1=object$2$1({enabled:boolean$2$1(),appName:nonEmptyStringDecoder$2$1,waitResponseTimeout:number$2$1()}),handlerFilterDecoder$1=object$2$1({title:optional$2$1(nonEmptyStringDecoder$2$1),openResolver:optional$2$1(boolean$2$1()),timeout:optional$2$1(nonNegativeNumberDecoder$2$1),intent:optional$2$1(nonEmptyStringDecoder$2$1),contextTypes:optional$2$1(array$2$1(nonEmptyStringDecoder$2$1)),resultType:optional$2$1(nonEmptyStringDecoder$2$1),applicationNames:optional$2$1(array$2$1(nonEmptyStringDecoder$2$1))}),embeddedResolverConfigDecoder$1=object$2$1({enabled:boolean$2$1(),initialCaller:object$2$1({instanceId:nonEmptyStringDecoder$2$1})}),raiseIntentRequestDecoder$1=object$2$1({intentRequest:intentRequestDecoder$1,resolverConfig:resolverConfigDecoder$1,embeddedResolverConfig:optional$2$1(embeddedResolverConfigDecoder$1)}),intentResultDecoder$1=object$2$1({request:intentRequestDecoder$1,handler:intentHandlerDecoder$1,result:anyJson$2$1()}),filterHandlersResultDecoder$1=object$