@candulabs/core
Advanced tools
Comparing version 0.6.0-alpha.1 to 0.6.0-alpha.2
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.6.0-alpha.2](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.6.0-alpha.1...v0.6.0-alpha.2) (2020-10-23) | ||
### Features | ||
* plainjs bug fixes + cleanup ([#215](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/issues/215)) ([06aa981](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/commit/06aa981f2dd795d00ca2f3a87eb98069d27b9a0f)) | ||
# [0.6.0-alpha.1](https://github.com/candulabs/candu-sdk/tree/master/packages/candu-core/compare/v0.5.4...v0.6.0-alpha.1) (2020-10-22) | ||
@@ -8,0 +19,0 @@ |
@@ -16,3 +16,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); | ||
***************************************************************************** */ | ||
var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function __awaiter(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(i,s)}c((a=a.apply(e,t||[])).next())}))}function __generator(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,a&&(n=2&o[0]?a.return:o[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;switch(a=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,a=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],a=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var a=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],i=0,s=o.length;i<s;i++,n++)a[n]=o[i];return a}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=_freeGlobal||freeSelf||Function("return this")(),_root=root,Symbol$1=_root.Symbol,_Symbol=Symbol$1,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),r=e[symToStringTag];try{e[symToStringTag]=void 0;var a=!0}catch(e){}var n=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),n}var _getRawTag=getRawTag,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var _objectToString=objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?_getRawTag(e):_objectToString(e)}var _baseGetTag=baseGetTag;function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject_1(e))return!1;var t=_baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction,coreJsData=_root["__core-js_shared__"],_coreJsData=coreJsData,maskSrcKey=function(){var e=/[^.]+$/.exec(_coreJsData&&_coreJsData.keys&&_coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked,funcProto=Function.prototype,funcToString=funcProto.toString;function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$2=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$1=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject_1(e)||_isMasked(e))&&(isFunction_1(e)?reIsNative:reIsHostCtor).test(_toSource(e))}var _baseIsNative=baseIsNative;function getValue(e,t){return null==e?void 0:e[t]}var _getValue=getValue;function getNative(e,t){var r=_getValue(e,t);return _baseIsNative(r)?r:void 0}var _getNative=getNative,defineProperty=function(){try{var e=_getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_defineProperty=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&_defineProperty?_defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var _baseAssignValue=baseAssignValue;function createBaseFor(e){return function(t,r,a){for(var n=-1,o=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++n];if(!1===r(o[c],c,o))break}return t}}var _createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor;function baseTimes(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes;function isObjectLike(e){return null!=e&&"object"==typeof e}var isObjectLike_1=isObjectLike,argsTag="[object Arguments]";function baseIsArguments(e){return isObjectLike_1(e)&&_baseGetTag(e)==argsTag}var _baseIsArguments=baseIsArguments,objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(e){return isObjectLike_1(e)&&hasOwnProperty$2.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments,isArray=Array.isArray,isArray_1=isArray;function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r?_root.Buffer:void 0,o=(n?n.isBuffer:void 0)||stubFalse_1;e.exports=o})),MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex,MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var isLength_1=isLength,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike_1(e)&&isLength_1(e.length)&&!!typedArrayTags[_baseGetTag(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var _baseIsTypedArray=baseIsTypedArray;function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r&&_freeGlobal.process,o=function(){try{var e=a&&a.require&&a.require("util").types;return e||n&&n.binding&&n.binding("util")}catch(e){}}();e.exports=o})),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray_1(e),a=!r&&isArguments_1(e),n=!r&&!a&&isBuffer_1(e),o=!r&&!a&&!n&&isTypedArray_1(e),i=r||a||n||o,s=i?_baseTimes(e.length,String):[],c=s.length;for(var u in e)!t&&!hasOwnProperty$3.call(e,u)||i&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||_isIndex(u,c))||s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys,objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var _isPrototype=isPrototype;function overArg(e,t){return function(r){return e(t(r))}}var _overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_nativeKeys=nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function baseKeys(e){if(!_isPrototype(e))return _nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys;function isArrayLike(e){return null!=e&&isLength_1(e.length)&&!isFunction_1(e)}var isArrayLike_1=isArrayLike;function keys(e){return isArrayLike_1(e)?_arrayLikeKeys(e):_baseKeys(e)}var keys_1=keys;function baseForOwn(e,t){return e&&_baseFor(e,t,keys_1)}var _baseForOwn=baseForOwn;function listCacheClear(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear;function eq(e,t){return e===t||e!=e&&t!=t}var eq_1=eq;function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq_1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=_assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete;function listCacheGet(e){var t=this.__data__,r=_assocIndexOf(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet;function listCacheHas(e){return _assocIndexOf(this.__data__,e)>-1}var _listCacheHas=listCacheHas;function listCacheSet(e,t){var r=this.__data__,a=_assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet;function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache.prototype.clear=_listCacheClear,ListCache.prototype.delete=_listCacheDelete,ListCache.prototype.get=_listCacheGet,ListCache.prototype.has=_listCacheHas,ListCache.prototype.set=_listCacheSet;var _ListCache=ListCache;function stackClear(){this.__data__=new _ListCache,this.size=0}var _stackClear=stackClear;function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete;function stackGet(e){return this.__data__.get(e)}var _stackGet=stackGet;function stackHas(e){return this.__data__.has(e)}var _stackHas=stackHas,Map=_getNative(_root,"Map"),_Map=Map,nativeCreate=_getNative(Object,"create"),_nativeCreate=nativeCreate;function hashClear(){this.__data__=_nativeCreate?_nativeCreate(null):{},this.size=0}var _hashClear=hashClear;function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete,HASH_UNDEFINED="__lodash_hash_undefined__",objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashGet(e){var t=this.__data__;if(_nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty$5.call(t,e)?t[e]:void 0}var _hashGet=hashGet,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashHas(e){var t=this.__data__;return _nativeCreate?void 0!==t[e]:hasOwnProperty$6.call(t,e)}var _hashHas=hashHas,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet;function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash.prototype.clear=_hashClear,Hash.prototype.delete=_hashDelete,Hash.prototype.get=_hashGet,Hash.prototype.has=_hashHas,Hash.prototype.set=_hashSet;var _Hash=Hash;function mapCacheClear(){this.size=0,this.__data__={hash:new _Hash,map:new(_Map||_ListCache),string:new _Hash}}var _mapCacheClear=mapCacheClear;function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable;function getMapData(e,t){var r=e.__data__;return _isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData;function mapCacheDelete(e){var t=_getMapData(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete;function mapCacheGet(e){return _getMapData(this,e).get(e)}var _mapCacheGet=mapCacheGet;function mapCacheHas(e){return _getMapData(this,e).has(e)}var _mapCacheHas=mapCacheHas;function mapCacheSet(e,t){var r=_getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet;function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache.prototype.clear=_mapCacheClear,MapCache.prototype.delete=_mapCacheDelete,MapCache.prototype.get=_mapCacheGet,MapCache.prototype.has=_mapCacheHas,MapCache.prototype.set=_mapCacheSet;var _MapCache=MapCache,LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof _ListCache){var a=r.__data__;if(!_Map||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new _MapCache(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet;function Stack(e){var t=this.__data__=new _ListCache(e);this.size=t.size}Stack.prototype.clear=_stackClear,Stack.prototype.delete=_stackDelete,Stack.prototype.get=_stackGet,Stack.prototype.has=_stackHas,Stack.prototype.set=_stackSet;var _Stack=Stack,HASH_UNDEFINED$2="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED$2),this}var _setCacheAdd=setCacheAdd;function setCacheHas(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas;function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new _MapCache;++t<r;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache;function arraySome(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome;function cacheHas(e,t){return e.has(t)}var _cacheHas=cacheHas,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function equalArrays(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var _=-1,l=!0,p=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(o.set(e,t),o.set(t,e);++_<s;){var d=e[_],f=t[_];if(a)var g=i?a(f,d,_,t,e,o):a(d,f,_,e,t,o);if(void 0!==g){if(g)continue;l=!1;break}if(p){if(!_arraySome(t,(function(e,t){if(!_cacheHas(p,t)&&(d===e||n(d,e,r,a,o)))return p.push(t)}))){l=!1;break}}else if(d!==f&&!n(d,f,r,a,o)){l=!1;break}}return o.delete(e),o.delete(t),l}var _equalArrays=equalArrays,Uint8Array$1=_root.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray;function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$1="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,r,a,n,o,i){switch(r){case dataViewTag$1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new _Uint8Array(e),new _Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq_1(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$1:var s=_mapToArray;case setTag$1:var c=a&COMPARE_PARTIAL_FLAG$1;if(s||(s=_setToArray),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var _=_equalArrays(s(e),s(t),a,n,o,i);return i.delete(e),_;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag;function arrayPush(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush;function baseGetAllKeys(e,t,r){var a=t(e);return isArray_1(e)?a:_arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys;function arrayFilter(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter;function stubArray(){return[]}var stubArray_1=stubArray,objectProto$9=Object.prototype,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),_arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray_1,_getSymbols=getSymbols;function getAllKeys(e){return _baseGetAllKeys(e,keys_1,_getSymbols)}var _getAllKeys=getAllKeys,COMPARE_PARTIAL_FLAG$2=1,objectProto$a=Object.prototype,hasOwnProperty$7=objectProto$a.hasOwnProperty;function equalObjects(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var u=c;u--;){var _=s[u];if(!(i?_ in t:hasOwnProperty$7.call(t,_)))return!1}var l=o.get(e);if(l&&o.get(t))return l==t;var p=!0;o.set(e,t),o.set(t,e);for(var d=i;++u<c;){var f=e[_=s[u]],g=t[_];if(a)var y=i?a(g,f,_,t,e,o):a(f,g,_,e,t,o);if(!(void 0===y?f===g||n(f,g,r,a,o):y)){p=!1;break}d||(d="constructor"==_)}if(p&&!d){var h=e.constructor,b=t.constructor;h!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof h&&h instanceof h&&"function"==typeof b&&b instanceof b)&&(p=!1)}return o.delete(e),o.delete(t),p}var _equalObjects=equalObjects,DataView=_getNative(_root,"DataView"),_DataView=DataView,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set=_getNative(_root,"Set"),_Set=Set,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$1)&&(getTag=function(e){var t=_baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?_toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$1}return t});var _getTag=getTag,COMPARE_PARTIAL_FLAG$3=1,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty;function baseIsEqualDeep(e,t,r,a,n,o){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),u=s?arrayTag$1:_getTag(t),_=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(u=u==argsTag$2?objectTag$2:u)==objectTag$2,p=c==u;if(p&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,_=!1}if(p&&!_)return o||(o=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,n,o):_equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG$3)){var d=_&&hasOwnProperty$8.call(e,"__wrapped__"),f=l&&hasOwnProperty$8.call(t,"__wrapped__");if(d||f){var g=d?e.value():e,y=f?t.value():t;return o||(o=new _Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new _Stack),_equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,n))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var n=r.length,o=n,i=!a;if(null==e)return!o;for(e=Object(e);n--;){var s=r[n];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var c=(s=r[n])[0],u=e[c],_=s[1];if(i&&s[2]){if(void 0===u&&!(c in e))return!1}else{var l=new _Stack;if(a)var p=a(u,_,c,e,t,l);if(!(void 0===p?_baseIsEqual(_,u,COMPARE_PARTIAL_FLAG$4|COMPARE_UNORDERED_FLAG$2,a,l):p))return!1}}return!0}var _baseIsMatch=baseIsMatch;function isStrictComparable(e){return e==e&&!isObject_1(e)}var _isStrictComparable=isStrictComparable;function getMatchData(e){for(var t=keys_1(e),r=t.length;r--;){var a=t[r],n=e[a];t[r]=[a,n,_isStrictComparable(n)]}return t}var _getMatchData=getMatchData;function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}var _matchesStrictComparable=matchesStrictComparable;function baseMatches(e){var t=_getMatchData(e);return 1==t.length&&t[0][2]?_matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||_baseIsMatch(r,e,t)}}var _baseMatches=baseMatches,symbolTag$1="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag$1}var isSymbol_1=isSymbol,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray_1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol_1(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey,FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize.Cache||_MapCache),r}memoize.Cache=_MapCache;var memoize_1=memoize,MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize_1(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=_memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap,INFINITY=1/0,symbolProto$1=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray_1(e))return _arrayMap(e,baseToString)+"";if(isSymbol_1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _baseToString=baseToString;function toString(e){return null==e?"":_baseToString(e)}var toString_1=toString;function castPath(e,t){return isArray_1(e)?e:_isKey(e,t)?[e]:_stringToPath(toString_1(e))}var _castPath=castPath,INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol_1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _toKey=toKey;function baseGet(e,t){for(var r=0,a=(t=_castPath(t,e)).length;null!=e&&r<a;)e=e[_toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet;function get(e,t,r){var a=null==e?void 0:_baseGet(e,t);return void 0===a?r:a}var get_1=get;function baseHasIn(e,t){return null!=e&&t in Object(e)}var _baseHasIn=baseHasIn;function hasPath(e,t,r){for(var a=-1,n=(t=_castPath(t,e)).length,o=!1;++a<n;){var i=_toKey(t[a]);if(!(o=null!=e&&r(e,i)))break;e=e[i]}return o||++a!=n?o:!!(n=null==e?0:e.length)&&isLength_1(n)&&_isIndex(i,n)&&(isArray_1(e)||isArguments_1(e))}var _hasPath=hasPath;function hasIn(e,t){return null!=e&&_hasPath(e,t,_baseHasIn)}var hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function baseMatchesProperty(e,t){return _isKey(e)&&_isStrictComparable(t)?_matchesStrictComparable(_toKey(e),t):function(r){var a=get_1(r,e);return void 0===a&&a===t?hasIn_1(r,e):_baseIsEqual(t,a,COMPARE_PARTIAL_FLAG$5|COMPARE_UNORDERED_FLAG$3)}}var _baseMatchesProperty=baseMatchesProperty;function identity(e){return e}var identity_1=identity;function baseProperty(e){return function(t){return null==t?void 0:t[e]}}var _baseProperty=baseProperty;function basePropertyDeep(e){return function(t){return _baseGet(t,e)}}var _basePropertyDeep=basePropertyDeep;function property(e){return _isKey(e)?_baseProperty(_toKey(e)):_basePropertyDeep(e)}var property_1=property;function baseIteratee(e){return"function"==typeof e?e:null==e?identity_1:"object"==typeof e?isArray_1(e)?_baseMatchesProperty(e[0],e[1]):_baseMatches(e):property_1(e)}var _baseIteratee=baseIteratee;function mapValues(e,t){var r={};return t=_baseIteratee(t),_baseForOwn(e,(function(e,a,n){_baseAssignValue(r,a,t(e,a,n))})),r}var mapValues_1=mapValues,isUnitlessNumber={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};function prefixKey(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach((function(e){prefixes.forEach((function(t){isUnitlessNumber[prefixKey(t,e)]=isUnitlessNumber[e]}))}));var shorthandPropertyExpansions={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions},CSSProperty_1=CSSProperty;function isNumber(e){return"number"==typeof e}var N,L,C,D,w,M,unpackShorthandStyles=function(e){var t=e.css,r=t.padding,a=t.margin,n=__rest(t,["padding","margin"]),o={};return r&&(o={paddingRight:r,paddingLeft:r,paddingBottom:r,paddingTop:r}),a&&(o=__assign(__assign({},o),{marginRight:a,marginLeft:a,marginBottom:a,marginTop:a})),__assign(__assign({},e),{css:__assign(__assign({},o),n)})},convertStyleNumberValues=function(e){var t=e.css,r={};return Object.entries(t).forEach((function(e){var t=e[0],a=e[1];if(isNumber(a))return CSSProperty_1.isUnitlessNumber[t]?void(r[t]=""+a):void(r[t]=a+"px");r[t]=a})),__assign(__assign({},e),{css:r})},typographyNode=function(e){var t=get_1(e,"data.custom.variant","P");return __assign(__assign({},e),{type:t})},normalizeFlexBasis=function(e){var t=e.css.flexBasis;return"0"===t||"0px"===t?__assign(__assign({},e),{css:__assign(__assign({},e.css),{flexBasis:"0%"})}):e},adaptCustomNodes=function(e){return mapValues_1(e,(function(e){var t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&isObject_1(t.css)&&t.css.flexBasis&&(t=normalizeFlexBasis(t)),t.css&&(t=unpackShorthandStyles(t),t=convertStyleNumberValues(t)),t}))},TutorialDependencies=function(){function e(e){this.adjacencyList={},this.rootDocument=e,this.adjacencyList[e]=[]}return e.prototype.get=function(e){return this.adjacencyList[e]},e.prototype.add=function(e,t){var r=this;if(this.adjacencyList[e]||(this.adjacencyList[e]=[]),!this.adjacencyList[t])return this.adjacencyList[e].push(t),this.adjacencyList[t]=[],!0;if(this.adjacencyList[e].includes(t))return!0;var a=function(t){if(t===e)return!0;for(var n=0,o=r.adjacencyList[t];n<o.length;n++){var i=o[n];if(a(i))return!0}return!1};return!a(t)&&(this.adjacencyList[e].push(t),!0)},e}(),createTutorialDocumentContext=function(e,t){return{id:e,dependencies:t?t.dependencies:new TutorialDependencies(e)}},checkCyclicAndAdd=function(e,t){return e.dependencies.add(e.id,t)},n="Everyone",e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,o=(t||r||Function("return this")()).Symbol,i=Object.prototype,u=i.hasOwnProperty,a=i.toString,c=o?o.toStringTag:void 0,l=function(e){var t=u.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[c]=r:delete e[c]),o},E=Object.prototype.toString,f=function(e){return E.call(e)},s="[object Null]",d="[object Undefined]",v=o?o.toStringTag:void 0,p=function(e){return null==e?void 0===e?d:s:v&&v in Object(e)?l(e):f(e)},T=Array.isArray,O=function(e){return null!=e&&"object"==typeof e},A="[object String]",g=function(e){return"string"==typeof e||!T(e)&&O(e)&&p(e)==A},m="[object Number]",S=function(e){return"number"==typeof e||O(e)&&p(e)==m},_=/^([a-zA-Z0-9]|_|-)+$/,y=function(e){return g(e)&&e.length>=3&&e.length<100&&_.test(e)},P=function(e){return S(e)&&e>=0},b=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10},I=function(e){return P(e)||g(e)&&e.trim().length>0};!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(N||(N={})),function(e){e.BOOTSTRAP="Bootstrap",e.CHANGE_POSITION="ChangePosition",e.CLOSE_PREVIEW="ClosePreview",e.PREVIEW_LOADED="PreviewLoaded",e.SET_AVALIABLE_PORTALS="SetAvaliablePortals",e.SET_CONTENT="SetContent",e.SET_SELECTED_ELEMENT="SetSelectedElement",e.SET_VIEW_MODE="SetViewMode",e.ADD_ELEMENT="AddElement",e.REMOVE_ELEMENT="RemoveElement",e.UPDATE_ELEMENT="UpdateElement",e.SET_ELEMENT="SetElement"}(L||(L={})),(C||(C={})).ON_CLICK="OnClick",function(e){e.NATIVE="Native",e.PENDO="Pendo"}(D||(D={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}(w||(w={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(M||(M={}));var G,B=M.PRIMARY;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(G||(G={}));var x,F,Q,nn,z=function(e){return g(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/)},H=function(e){return P(e)},K=function(e){return y(e)};!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(x||(x={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(F||(F={})),function(e){e.Global="Global",e.Organization="Organization"}(Q||(Q={})),function(e){e.Root="root",e.Rule="rule",e.Atrule="atrule",e.Decl="decl",e.Any="any"}(nn||(nn={}));for(var _a,createLookup=function(e){return e.reduce((function(e,t){var r;return __assign(__assign({},e),((r={})[t]=t,r))}),{})},findMatchingSegment=function(e,t){var r=createLookup(t);return e.content.find((function(e){var t=e.segmentId;return!!r[t]||t===n}))},eventPrefix=function(e){return"candu.sdk."+e},errorPrefix=function(e){return eventPrefix("error."+e)},ERROR_SLUGS={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},EVENT_NAMES={HEARTBEAT:eventPrefix("heartbeat"),PREVIEW_OPEN:eventPrefix("preview.open"),PORTAL:eventPrefix("portal"),TUTORIAL:eventPrefix("tutorial"),TUTORIAL_INTERACTION:eventPrefix("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:errorPrefix("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:errorPrefix("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:errorPrefix("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:errorPrefix("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:errorPrefix("commit_api"),TUTORIAL_LOADING_ERROR:errorPrefix("tutorial"),UNKOWN_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),PORTAL_ERROR:errorPrefix(ERROR_SLUGS.PORTAL_ERROR),PROVIDER_ERROR:errorPrefix(ERROR_SLUGS.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),RENDER_NODE_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:errorPrefix("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:errorPrefix("circular_dependecy_embed_tutorial")},PORTAL_ASSET_NOT_FOUND="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",unknownMessage=function(e){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+e+"."},EVENTING_NOT_INITIALIZED="You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n",PORTAL_NO_SEGMENT_IDS="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",NO_MATCHING_TUTORIALS="The Tutorial will not be rendered because there are no matching segments for the given user.",ERROR_MESSAGES=((_a={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED})[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]=PORTAL_ASSET_NOT_FOUND,_a[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]=PORTAL_NO_SEGMENT_IDS,_a[EVENT_NAMES.NO_MATCHING_TUTORIALS]=NO_MATCHING_TUTORIALS,_a[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",_a[EVENT_NAMES.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",_a[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),_a[EVENT_NAMES.UNKOWN_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",_a[EVENT_NAMES.PORTAL_ERROR]="An error has occured within Portal",_a[EVENT_NAMES.PROVIDER_ERROR]="An error has occured within Provider",_a[EVENT_NAMES.TUTORIAL_ERROR]="An error has occured within Tutorial",_a[EVENT_NAMES.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",_a[EVENT_NAMES.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",_a),defaultStyleguide={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},trackStyleguideProperties=function(e){var t={};return Object.keys(e).forEach((function(r){defaultStyleguide[r]&&(t["styleguide."+r]=e[r].displayName||!0)})),t},LOGGER={error:console.error,warning:console.warn},internalEventing=function(e){var t=e.identify,r=e.track;return{provider:function(e){var a=e.userId,n=e.traits,o=e.styleguide;t(a,n),r(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:function(e){var t=e.tutorialId,a=e.slug,n=e.contentHashId;LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),r(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:a,contentHashId:n})}}},e$1=function(e,t){return function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var a=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}}(t={exports:{}}),t.exports}(),n$1=[],t$1=0;t$1<256;++t$1)n$1[t$1]=(t$1+256).toString(16).substr(1);var a$1,i$1,r$1=function(e,t){var r=t||0,a=n$1;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")},o$1=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||e$1)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;++o)t[a+o]=n[o];return t||r$1(n)};!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(a$1||(a$1={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(i$1||(i$1={}));var u$1,c$1,d$1=function(){return"undefined"!=typeof window&&window.localStorage},p$1=function(e){return function(t){d$1()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))}},l$1={anonymousId:{getOrCreate:(u$1="candu:anonymous_id",c$1=function(){var e=o$1();return p$1("candu:anonymous_id")(e),e},function(){return function(e){return function(){if(d$1()){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}}}(u$1)()||c$1()}),set:p$1("candu:anonymous_id")}},h=l$1.anonymousId.getOrCreate,invariant=function(e,t,r,a,n,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,a,n,o,i,s],_=0;(c=new Error(t.replace(/%s/g,(function(){return u[_++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},browser=invariant,isValidStyleguideProps=function(e){return browser(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object")},providerValidation=function(e){var t=e.clientToken,r=e.userId,a=e.traits,n=e.options,o=e.styleguide,i=__rest(e,["clientToken","userId","traits","options","styleguide"]);return browser(b(t),"(Candu) you must provide a valid clientToken"),browser(!r||I(r),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),browser(!a||isObject_1(a),"(Candu) traits must be undefined or an object"),browser(!n||isObject_1(n),"(Candu) options must be undefined or an object"),__assign(__assign({},i),{clientToken:t,traits:a||{},options:n||{},styleguide:o||{},userId:r||h()})},tutorialValidation=function(e){var t=e.slug,r=e.styleguide,a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.renderedByClient,s=__rest(e,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return isValidStyleguideProps(r),__assign(__assign({},s),{slug:t,styleguide:r||{},contentHashId:a,tutorialId:n,tutorialDocument:o,renderedByClient:i})},portalValidation=function(e){var t=e.slug,r=e.styleguide;return isValidStyleguideProps(r),{slug:t,styleguide:r||{}}};const API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai";var API_BASE_URL$1=API_BASE_URL,CDN_BASE_URL$1=CDN_BASE_URL,ENDPOINTS={segmentMembership:"/api/segmentMemberships",segmentsDefinition:"/api/segmentsDefinition",tutorialMetadata:"/api/tutorialMetadata",tutorialDocuments:"/api/tutorialDocumentsEditor",tutorialProdSocket:"wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod"},fetchURL=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))},fetchFromApi=function(e){return fetchURL(""+API_BASE_URL$1+e)},fetchFromCdn=function(e){return fetchURL(""+CDN_BASE_URL$1+e)},getTutorialDocument=function(e){return{byId:function(t){return fetchFromApi(ENDPOINTS.tutorialDocuments+"?token="+e+"&finder=latestPublished&tutorialId="+t)},bySlug:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")},byContentHash:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")}}},RESOURCES={tutorialDocumentLatestSaved:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.tutorialDocuments+"/"+t+"?token="+e)]}))}))},portalAsset:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromCdn("/portals/"+e+"/"+t+"/head.json")]}))}))},segmentMembership:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.segmentMembership+"/"+t+"?token="+e)]}))}))},segmentDefinition:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.segmentsDefinition+"?token="+e)]}))}))},tutorialMetadata:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.tutorialMetadata+"?token="+e)]}))}))},tutorialSocket:function(e,t,r){var a=ENDPOINTS.tutorialProdSocket+"?clientToken="+e+"&tutorialId="+t,n=new WebSocket(a);return n.onmessage=function(e){var t=JSON.parse(e.data);r(t)},function(){return n.close()}},tutorialDocument:function(e,t,r){var a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.slug,s=getTutorialDocument(t);return H(n)?s.byId(n):K(i)?s.bySlug(i):z(a)?s.byContentHash(a):isObject_1(o)?Promise.resolve(o):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},PreviewContainer=function(){function e(){this.clientSubscribers=[],this.clientSubscriberCleanup=[]}return e.prototype.attachClient=function(e){this.clientSubscriberCleanup=[],this.client=e,this.notifyClientIsReady()},e.prototype.detachClient=function(){this.client=null,this.cleanupSubscribers()},e.prototype.onClientReady=function(e){this.clientSubscribers.push(e),this.client&&this.notifySubscriber(e)},e.prototype.notifyClientIsReady=function(){var e=this;this.clientSubscribers.forEach((function(t){return e.notifySubscriber(t)}))},e.prototype.notifySubscriber=function(e){var t=e(this.client);t&&"function"==typeof t&&this.clientSubscriberCleanup.push(t)},e.prototype.cleanupSubscribers=function(){this.clientSubscriberCleanup.forEach((function(e){return e()})),this.clientSubscriberCleanup=[]},e}();function createSingleton(e){var t,r,a=function(e){return function(){for(var t,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(r.api)return(t=r.api)[e].apply(t,a);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+e)}};return(t=function(){function t(){}return t.init=function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return this.api||(t.api=new(e.bind.apply(e,__spreadArrays([void 0],r)))),t.subscriberCallbacks.forEach((function(e){return e()})),t.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),t},t.onProviderReady=function(e){if(t.api)return e();t.subscriberCallbacks.push(e)},t}()).subscriberCallbacks=[],t.renderTutorial=a("renderTutorial"),t.renderPortal=a("renderPortal"),t.attachClient=a("attachClient"),t.detachClient=a("detachClient"),t.getProvider=a("getProvider"),r=t,window.Candu=r,r}var SingletonAPI=function(){function e(e){this.init(e)}return e.prototype.attachClient=function(e){return this.provider.preview.attachClient(e)},e.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(e.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),e}(),logError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.error.apply(console,e)},logWarning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.warn.apply(console,e)},logger={error:logError,warning:logWarning},getEventHandler=function(e){switch(e.trigger){case C.ON_CLICK:default:return"onClick"}},getActionHandler=function(e,t){var r,a,n;switch(e.handler.type){case w.NAVIGATE:return(r={})[getEventHandler(e)]=function(){var r=e.handler,a=r.href,n=r.target;t(e),"Blank"===n?window.open(a,"_blank"):a&&a.includes("mailto:")?window.location=a:document.location.href=a},r;case w.CHANGE_TUTORIAL:return(a={})[getEventHandler(e)]=function(){var t=e.handler.tutorialId;logError("TODO -> change tutorial",t)},a;case w.OPEN_GUIDE:return(n={})[getEventHandler(e)]=function(){var t=e.handler.guideId;logError("TODO -> open guide",t)},n;default:return{}}},getActionHandlers=function(e,t){var r=e.data;if(!r||!r.actions)return{};var a=function(e){t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,__assign(__assign({},e),t.trackingIdentifiers||{}))};return r.actions.map((function(e){return getActionHandler(e,a)})).reduce((function(e,t){return __assign(__assign({},e),t)}),{})},mapNodeToStyleguide=function(e,t){try{var r=t.provider,a=t.document,n=t.trackingIdentifiers,o=a.nodes[e];if(!o)return logger.error("Document is corrupted. Refusing to move further."),null;var i=function(e){return mapNodeToStyleguide(e,t)},s=o.type,c=o.props,u=o.css,_=__assign(__assign(__assign({},c||{}),{style:u||{},children:(c||{}).children||o.nodes&&o.nodes.map(i)}),getActionHandlers(o,{trackingIdentifiers:n,provider:r})),l={nodeId:e,node:o,document:a,render:{node:i,styleguide:function(e,r){return void 0===r&&(r={}),t.renderNode(e,{api:l,attributes:r})},tutorial:function(e){return t.renderTutorial(e)},portal:function(e){return t.renderPortal(e)}},trackingIdentifiers:n},p=l.render.styleguide(s,_);return p||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)}catch(e){return logger.error(ERROR_MESSAGES[EVENT_NAMES.STYLEGUIDE_MAP_ERROR],e),null}},mergeStyleguidesFromContext=memoize_1((function(e,t){var r,a,n=e.provider,o=e.portal,i=e.tutorial,s=n.styleguide;return i&&(a=i.styleguide),o&&(r=o.styleguide),__assign(__assign(__assign(__assign({},s||{}),r||{}),a||{}),t||{})})),DEFAULT_ALT="",DEFAULT_ALERT_COLOR="#EDEDED",DEFAULT_TAB_HEADER_COLOR="#333745",DEFAULT_TAB_ITEM_COLOR="#838792",DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",DEFAULT_TAB_COLOR="#FEFEFE",STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},attachStylesheet=function(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",CDN_BASE_URL$1+"/styleguides/applications/"+e+"/default/main.css"),document.head.appendChild(t)};exports.DEFAULT_ALERT_COLOR=DEFAULT_ALERT_COLOR,exports.DEFAULT_ALT=DEFAULT_ALT,exports.DEFAULT_TAB_ACTIVE_COLOR=DEFAULT_TAB_ACTIVE_COLOR,exports.DEFAULT_TAB_COLOR=DEFAULT_TAB_COLOR,exports.DEFAULT_TAB_HEADER_COLOR=DEFAULT_TAB_HEADER_COLOR,exports.DEFAULT_TAB_ITEM_COLOR=DEFAULT_TAB_ITEM_COLOR,exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.PreviewContainer=PreviewContainer,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.SingletonAPI=SingletonAPI,exports.TutorialDependencies=TutorialDependencies,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.checkCyclicAndAdd=checkCyclicAndAdd,exports.convertStyleNumberValues=convertStyleNumberValues,exports.createSingleton=createSingleton,exports.createTutorialDocumentContext=createTutorialDocumentContext,exports.defaultStyleguide=defaultStyleguide,exports.findMatchingSegment=findMatchingSegment,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.tutorialValidation=tutorialValidation,exports.unpackShorthandStyles=unpackShorthandStyles; | ||
var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function __awaiter(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(i,s)}c((a=a.apply(e,t||[])).next())}))}function __generator(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,a&&(n=2&o[0]?a.return:o[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;switch(a=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,a=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],a=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var a=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],i=0,s=o.length;i<s;i++,n++)a[n]=o[i];return a}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=_freeGlobal||freeSelf||Function("return this")(),_root=root,Symbol$1=_root.Symbol,_Symbol=Symbol$1,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),r=e[symToStringTag];try{e[symToStringTag]=void 0;var a=!0}catch(e){}var n=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),n}var _getRawTag=getRawTag,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var _objectToString=objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?_getRawTag(e):_objectToString(e)}var _baseGetTag=baseGetTag;function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject_1(e))return!1;var t=_baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction,coreJsData=_root["__core-js_shared__"],_coreJsData=coreJsData,maskSrcKey=function(){var e=/[^.]+$/.exec(_coreJsData&&_coreJsData.keys&&_coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked,funcProto=Function.prototype,funcToString=funcProto.toString;function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$2=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$1=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject_1(e)||_isMasked(e))&&(isFunction_1(e)?reIsNative:reIsHostCtor).test(_toSource(e))}var _baseIsNative=baseIsNative;function getValue(e,t){return null==e?void 0:e[t]}var _getValue=getValue;function getNative(e,t){var r=_getValue(e,t);return _baseIsNative(r)?r:void 0}var _getNative=getNative,defineProperty=function(){try{var e=_getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_defineProperty=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&_defineProperty?_defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var _baseAssignValue=baseAssignValue;function createBaseFor(e){return function(t,r,a){for(var n=-1,o=Object(t),i=a(t),s=i.length;s--;){var c=i[e?s:++n];if(!1===r(o[c],c,o))break}return t}}var _createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor;function baseTimes(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes;function isObjectLike(e){return null!=e&&"object"==typeof e}var isObjectLike_1=isObjectLike,argsTag="[object Arguments]";function baseIsArguments(e){return isObjectLike_1(e)&&_baseGetTag(e)==argsTag}var _baseIsArguments=baseIsArguments,objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(e){return isObjectLike_1(e)&&hasOwnProperty$2.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments,isArray=Array.isArray,isArray_1=isArray;function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r?_root.Buffer:void 0,o=(n?n.isBuffer:void 0)||stubFalse_1;e.exports=o})),MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex,MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var isLength_1=isLength,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike_1(e)&&isLength_1(e.length)&&!!typedArrayTags[_baseGetTag(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var _baseIsTypedArray=baseIsTypedArray;function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule((function(e,t){var r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,n=a&&a.exports===r&&_freeGlobal.process,o=function(){try{var e=a&&a.require&&a.require("util").types;return e||n&&n.binding&&n.binding("util")}catch(e){}}();e.exports=o})),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray_1(e),a=!r&&isArguments_1(e),n=!r&&!a&&isBuffer_1(e),o=!r&&!a&&!n&&isTypedArray_1(e),i=r||a||n||o,s=i?_baseTimes(e.length,String):[],c=s.length;for(var u in e)!t&&!hasOwnProperty$3.call(e,u)||i&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||_isIndex(u,c))||s.push(u);return s}var _arrayLikeKeys=arrayLikeKeys,objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var _isPrototype=isPrototype;function overArg(e,t){return function(r){return e(t(r))}}var _overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_nativeKeys=nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function baseKeys(e){if(!_isPrototype(e))return _nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys;function isArrayLike(e){return null!=e&&isLength_1(e.length)&&!isFunction_1(e)}var isArrayLike_1=isArrayLike;function keys(e){return isArrayLike_1(e)?_arrayLikeKeys(e):_baseKeys(e)}var keys_1=keys;function baseForOwn(e,t){return e&&_baseFor(e,t,keys_1)}var _baseForOwn=baseForOwn;function listCacheClear(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear;function eq(e,t){return e===t||e!=e&&t!=t}var eq_1=eq;function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq_1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=_assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete;function listCacheGet(e){var t=this.__data__,r=_assocIndexOf(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet;function listCacheHas(e){return _assocIndexOf(this.__data__,e)>-1}var _listCacheHas=listCacheHas;function listCacheSet(e,t){var r=this.__data__,a=_assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet;function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache.prototype.clear=_listCacheClear,ListCache.prototype.delete=_listCacheDelete,ListCache.prototype.get=_listCacheGet,ListCache.prototype.has=_listCacheHas,ListCache.prototype.set=_listCacheSet;var _ListCache=ListCache;function stackClear(){this.__data__=new _ListCache,this.size=0}var _stackClear=stackClear;function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete;function stackGet(e){return this.__data__.get(e)}var _stackGet=stackGet;function stackHas(e){return this.__data__.has(e)}var _stackHas=stackHas,Map=_getNative(_root,"Map"),_Map=Map,nativeCreate=_getNative(Object,"create"),_nativeCreate=nativeCreate;function hashClear(){this.__data__=_nativeCreate?_nativeCreate(null):{},this.size=0}var _hashClear=hashClear;function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete,HASH_UNDEFINED="__lodash_hash_undefined__",objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashGet(e){var t=this.__data__;if(_nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty$5.call(t,e)?t[e]:void 0}var _hashGet=hashGet,objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashHas(e){var t=this.__data__;return _nativeCreate?void 0!==t[e]:hasOwnProperty$6.call(t,e)}var _hashHas=hashHas,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet;function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash.prototype.clear=_hashClear,Hash.prototype.delete=_hashDelete,Hash.prototype.get=_hashGet,Hash.prototype.has=_hashHas,Hash.prototype.set=_hashSet;var _Hash=Hash;function mapCacheClear(){this.size=0,this.__data__={hash:new _Hash,map:new(_Map||_ListCache),string:new _Hash}}var _mapCacheClear=mapCacheClear;function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable;function getMapData(e,t){var r=e.__data__;return _isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData;function mapCacheDelete(e){var t=_getMapData(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete;function mapCacheGet(e){return _getMapData(this,e).get(e)}var _mapCacheGet=mapCacheGet;function mapCacheHas(e){return _getMapData(this,e).has(e)}var _mapCacheHas=mapCacheHas;function mapCacheSet(e,t){var r=_getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet;function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache.prototype.clear=_mapCacheClear,MapCache.prototype.delete=_mapCacheDelete,MapCache.prototype.get=_mapCacheGet,MapCache.prototype.has=_mapCacheHas,MapCache.prototype.set=_mapCacheSet;var _MapCache=MapCache,LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof _ListCache){var a=r.__data__;if(!_Map||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new _MapCache(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet;function Stack(e){var t=this.__data__=new _ListCache(e);this.size=t.size}Stack.prototype.clear=_stackClear,Stack.prototype.delete=_stackDelete,Stack.prototype.get=_stackGet,Stack.prototype.has=_stackHas,Stack.prototype.set=_stackSet;var _Stack=Stack,HASH_UNDEFINED$2="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED$2),this}var _setCacheAdd=setCacheAdd;function setCacheHas(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas;function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new _MapCache;++t<r;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache;function arraySome(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome;function cacheHas(e,t){return e.has(t)}var _cacheHas=cacheHas,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function equalArrays(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var _=-1,l=!0,g=r&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;for(o.set(e,t),o.set(t,e);++_<s;){var d=e[_],p=t[_];if(a)var f=i?a(p,d,_,t,e,o):a(d,p,_,e,t,o);if(void 0!==f){if(f)continue;l=!1;break}if(g){if(!_arraySome(t,(function(e,t){if(!_cacheHas(g,t)&&(d===e||n(d,e,r,a,o)))return g.push(t)}))){l=!1;break}}else if(d!==p&&!n(d,p,r,a,o)){l=!1;break}}return o.delete(e),o.delete(t),l}var _equalArrays=equalArrays,Uint8Array$1=_root.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray;function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$1="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag(e,t,r,a,n,o,i){switch(r){case dataViewTag$1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new _Uint8Array(e),new _Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq_1(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$1:var s=_mapToArray;case setTag$1:var c=a&COMPARE_PARTIAL_FLAG$1;if(s||(s=_setToArray),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;a|=COMPARE_UNORDERED_FLAG$1,i.set(e,t);var _=_equalArrays(s(e),s(t),a,n,o,i);return i.delete(e),_;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag;function arrayPush(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush;function baseGetAllKeys(e,t,r){var a=t(e);return isArray_1(e)?a:_arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys;function arrayFilter(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter;function stubArray(){return[]}var stubArray_1=stubArray,objectProto$9=Object.prototype,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),_arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray_1,_getSymbols=getSymbols;function getAllKeys(e){return _baseGetAllKeys(e,keys_1,_getSymbols)}var _getAllKeys=getAllKeys,COMPARE_PARTIAL_FLAG$2=1,objectProto$a=Object.prototype,hasOwnProperty$7=objectProto$a.hasOwnProperty;function equalObjects(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$2,s=_getAllKeys(e),c=s.length;if(c!=_getAllKeys(t).length&&!i)return!1;for(var u=c;u--;){var _=s[u];if(!(i?_ in t:hasOwnProperty$7.call(t,_)))return!1}var l=o.get(e);if(l&&o.get(t))return l==t;var g=!0;o.set(e,t),o.set(t,e);for(var d=i;++u<c;){var p=e[_=s[u]],f=t[_];if(a)var y=i?a(f,p,_,t,e,o):a(p,f,_,e,t,o);if(!(void 0===y?p===f||n(p,f,r,a,o):y)){g=!1;break}d||(d="constructor"==_)}if(g&&!d){var T=e.constructor,b=t.constructor;T!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof T&&T instanceof T&&"function"==typeof b&&b instanceof b)&&(g=!1)}return o.delete(e),o.delete(t),g}var _equalObjects=equalObjects,DataView=_getNative(_root,"DataView"),_DataView=DataView,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set=_getNative(_root,"Set"),_Set=Set,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$1)&&(getTag=function(e){var t=_baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?_toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$1}return t});var _getTag=getTag,COMPARE_PARTIAL_FLAG$3=1,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty;function baseIsEqualDeep(e,t,r,a,n,o){var i=isArray_1(e),s=isArray_1(t),c=i?arrayTag$1:_getTag(e),u=s?arrayTag$1:_getTag(t),_=(c=c==argsTag$2?objectTag$2:c)==objectTag$2,l=(u=u==argsTag$2?objectTag$2:u)==objectTag$2,g=c==u;if(g&&isBuffer_1(e)){if(!isBuffer_1(t))return!1;i=!0,_=!1}if(g&&!_)return o||(o=new _Stack),i||isTypedArray_1(e)?_equalArrays(e,t,r,a,n,o):_equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG$3)){var d=_&&hasOwnProperty$8.call(e,"__wrapped__"),p=l&&hasOwnProperty$8.call(t,"__wrapped__");if(d||p){var f=d?e.value():e,y=p?t.value():t;return o||(o=new _Stack),n(f,y,r,a,o)}}return!!g&&(o||(o=new _Stack),_equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep;function baseIsEqual(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike_1(e)&&!isObjectLike_1(t)?e!=e&&t!=t:_baseIsEqualDeep(e,t,r,a,baseIsEqual,n))}var _baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2;function baseIsMatch(e,t,r,a){var n=r.length,o=n,i=!a;if(null==e)return!o;for(e=Object(e);n--;){var s=r[n];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){var c=(s=r[n])[0],u=e[c],_=s[1];if(i&&s[2]){if(void 0===u&&!(c in e))return!1}else{var l=new _Stack;if(a)var g=a(u,_,c,e,t,l);if(!(void 0===g?_baseIsEqual(_,u,COMPARE_PARTIAL_FLAG$4|COMPARE_UNORDERED_FLAG$2,a,l):g))return!1}}return!0}var _baseIsMatch=baseIsMatch;function isStrictComparable(e){return e==e&&!isObject_1(e)}var _isStrictComparable=isStrictComparable;function getMatchData(e){for(var t=keys_1(e),r=t.length;r--;){var a=t[r],n=e[a];t[r]=[a,n,_isStrictComparable(n)]}return t}var _getMatchData=getMatchData;function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}var _matchesStrictComparable=matchesStrictComparable;function baseMatches(e){var t=_getMatchData(e);return 1==t.length&&t[0][2]?_matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||_baseIsMatch(r,e,t)}}var _baseMatches=baseMatches,symbolTag$1="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag$1}var isSymbol_1=isSymbol,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray_1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol_1(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey,FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize.Cache||_MapCache),r}memoize.Cache=_MapCache;var memoize_1=memoize,MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize_1(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=_memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath;function arrayMap(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap,INFINITY=1/0,symbolProto$1=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray_1(e))return _arrayMap(e,baseToString)+"";if(isSymbol_1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _baseToString=baseToString;function toString(e){return null==e?"":_baseToString(e)}var toString_1=toString;function castPath(e,t){return isArray_1(e)?e:_isKey(e,t)?[e]:_stringToPath(toString_1(e))}var _castPath=castPath,INFINITY$1=1/0;function toKey(e){if("string"==typeof e||isSymbol_1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _toKey=toKey;function baseGet(e,t){for(var r=0,a=(t=_castPath(t,e)).length;null!=e&&r<a;)e=e[_toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet;function get(e,t,r){var a=null==e?void 0:_baseGet(e,t);return void 0===a?r:a}var get_1=get;function baseHasIn(e,t){return null!=e&&t in Object(e)}var _baseHasIn=baseHasIn;function hasPath(e,t,r){for(var a=-1,n=(t=_castPath(t,e)).length,o=!1;++a<n;){var i=_toKey(t[a]);if(!(o=null!=e&&r(e,i)))break;e=e[i]}return o||++a!=n?o:!!(n=null==e?0:e.length)&&isLength_1(n)&&_isIndex(i,n)&&(isArray_1(e)||isArguments_1(e))}var _hasPath=hasPath;function hasIn(e,t){return null!=e&&_hasPath(e,t,_baseHasIn)}var hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function baseMatchesProperty(e,t){return _isKey(e)&&_isStrictComparable(t)?_matchesStrictComparable(_toKey(e),t):function(r){var a=get_1(r,e);return void 0===a&&a===t?hasIn_1(r,e):_baseIsEqual(t,a,COMPARE_PARTIAL_FLAG$5|COMPARE_UNORDERED_FLAG$3)}}var _baseMatchesProperty=baseMatchesProperty;function identity(e){return e}var identity_1=identity;function baseProperty(e){return function(t){return null==t?void 0:t[e]}}var _baseProperty=baseProperty;function basePropertyDeep(e){return function(t){return _baseGet(t,e)}}var _basePropertyDeep=basePropertyDeep;function property(e){return _isKey(e)?_baseProperty(_toKey(e)):_basePropertyDeep(e)}var property_1=property;function baseIteratee(e){return"function"==typeof e?e:null==e?identity_1:"object"==typeof e?isArray_1(e)?_baseMatchesProperty(e[0],e[1]):_baseMatches(e):property_1(e)}var _baseIteratee=baseIteratee;function mapValues(e,t){var r={};return t=_baseIteratee(t),_baseForOwn(e,(function(e,a,n){_baseAssignValue(r,a,t(e,a,n))})),r}var mapValues_1=mapValues,isUnitlessNumber={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};function prefixKey(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach((function(e){prefixes.forEach((function(t){isUnitlessNumber[prefixKey(t,e)]=isUnitlessNumber[e]}))}));var shorthandPropertyExpansions={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions},CSSProperty_1=CSSProperty;function isNumber(e){return"number"==typeof e}var unpackShorthandStyles=function(e){var t=e.css,r=t.padding,a=t.margin,n=__rest(t,["padding","margin"]),o={};return r&&(o={paddingRight:r,paddingLeft:r,paddingBottom:r,paddingTop:r}),a&&(o=__assign(__assign({},o),{marginRight:a,marginLeft:a,marginBottom:a,marginTop:a})),__assign(__assign({},e),{css:__assign(__assign({},o),n)})},convertStyleNumberValues=function(e){var t=e.css,r={};return Object.entries(t).forEach((function(e){var t=e[0],a=e[1];if(isNumber(a))return CSSProperty_1.isUnitlessNumber[t]?void(r[t]=""+a):void(r[t]=a+"px");r[t]=a})),__assign(__assign({},e),{css:r})},typographyNode=function(e){var t=get_1(e,"data.custom.variant","P");return __assign(__assign({},e),{type:t})},normalizeFlexBasis=function(e){var t=e.css.flexBasis;return"0"===t||"0px"===t?__assign(__assign({},e),{css:__assign(__assign({},e.css),{flexBasis:"0%"})}):e},adaptCustomNodes=function(e){return mapValues_1(e,(function(e){var t=e;return"Typography"===t.type&&(t=typographyNode(t)),t.css&&isObject_1(t.css)&&t.css.flexBasis&&(t=normalizeFlexBasis(t)),t.css&&(t=unpackShorthandStyles(t),t=convertStyleNumberValues(t)),t}))},TutorialDependencies=function(){function e(e){this.adjacencyList={},this.rootDocument=e,this.adjacencyList[e]=[]}return e.prototype.get=function(e){return this.adjacencyList[e]},e.prototype.add=function(e,t){var r=this;if(this.adjacencyList[e]||(this.adjacencyList[e]=[]),!this.adjacencyList[t])return this.adjacencyList[e].push(t),this.adjacencyList[t]=[],!0;if(this.adjacencyList[e].includes(t))return!0;var a=function(t){if(t===e)return!0;for(var n=0,o=r.adjacencyList[t];n<o.length;n++){var i=o[n];if(a(i))return!0}return!1};return!a(t)&&(this.adjacencyList[e].push(t),!0)},e}(),createTutorialDocumentContext=function(e,t){return{id:e,dependencies:t?t.dependencies:new TutorialDependencies(e)}},checkCyclicAndAdd=function(e,t){return e.dependencies.add(e.id,t)},DEFAULT_SEGMENT_ID="Everyone",commonjsGlobal$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},freeGlobal$1="object"==typeof commonjsGlobal$1&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,_freeGlobal$1=freeGlobal$1,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=_freeGlobal$1||freeSelf$1||Function("return this")(),_root$1=root$1,Symbol$2=_root$1.Symbol,_Symbol$1=Symbol$2,objectProto$c=Object.prototype,hasOwnProperty$9=objectProto$c.hasOwnProperty,nativeObjectToString$2=objectProto$c.toString,symToStringTag$2=_Symbol$1?_Symbol$1.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$9.call(e,symToStringTag$2),r=e[symToStringTag$2];try{e[symToStringTag$2]=void 0;var a=!0}catch(e){}var n=nativeObjectToString$2.call(e);return a&&(t?e[symToStringTag$2]=r:delete e[symToStringTag$2]),n}var _getRawTag$1=getRawTag$1,objectProto$1$1=Object.prototype,nativeObjectToString$1$1=objectProto$1$1.toString;function objectToString$1(e){return nativeObjectToString$1$1.call(e)}var _objectToString$1=objectToString$1,nullTag$1="[object Null]",undefinedTag$1="[object Undefined]",symToStringTag$1$1=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag$1(e){return null==e?void 0===e?undefinedTag$1:nullTag$1:symToStringTag$1$1&&symToStringTag$1$1 in Object(e)?_getRawTag$1(e):_objectToString$1(e)}var _baseGetTag$1=baseGetTag$1,isArray$1=Array.isArray,isArray_1$1=isArray$1;function isObjectLike$1(e){return null!=e&&"object"==typeof e}var isObjectLike_1$1=isObjectLike$1,stringTag$2="[object String]";function isString(e){return"string"==typeof e||!isArray_1$1(e)&&isObjectLike_1$1(e)&&_baseGetTag$1(e)==stringTag$2}var isString_1=isString,numberTag$2="[object Number]";function isNumber$1(e){return"number"==typeof e||isObjectLike_1$1(e)&&_baseGetTag$1(e)==numberTag$2}var ACTORS,MESSAGES,TRIGGERS,CATEGORIES,HANDLER_TYPES,COLORS,isNumber_1=isNumber$1,identifierRegex=/^([a-zA-Z0-9]|_|-)+$/,isIdentifier=function(e){return isString_1(e)&&e.length>=3&&e.length<100&&identifierRegex.test(e)},IsNumericId=function(e){return isNumber_1(e)&&e>=0},isClientToken=function(e){return isString_1(e)&&!!e.match(/^[0-9a-zA-Z]*$/)&&e.length>=10},isUserId=function(e){return IsNumericId(e)||isString_1(e)&&e.trim().length>0};!function(e){e.SDK="SDK",e.PREVIEW="PREVIEW"}(ACTORS||(ACTORS={})),function(e){e.BOOTSTRAP="Bootstrap",e.CHANGE_POSITION="ChangePosition",e.CLOSE_PREVIEW="ClosePreview",e.PREVIEW_LOADED="PreviewLoaded",e.SET_AVALIABLE_PORTALS="SetAvaliablePortals",e.SET_CONTENT="SetContent",e.SET_SELECTED_ELEMENT="SetSelectedElement",e.SET_VIEW_MODE="SetViewMode",e.ADD_ELEMENT="AddElement",e.REMOVE_ELEMENT="RemoveElement",e.UPDATE_ELEMENT="UpdateElement",e.SET_ELEMENT="SetElement"}(MESSAGES||(MESSAGES={})),function(e){e.ON_CLICK="OnClick"}(TRIGGERS||(TRIGGERS={})),function(e){e.NATIVE="Native",e.PENDO="Pendo"}(CATEGORIES||(CATEGORIES={})),function(e){e.NAVIGATE="Navigate",e.CHANGE_TUTORIAL="ChangeTutorial",e.OPEN_GUIDE="OpenGuide"}(HANDLER_TYPES||(HANDLER_TYPES={})),function(e){e.PRIMARY="primary",e.SECONDARY="primary",e.WARNING="warning",e.DANGER="danger",e.NEUTRAL="neutral",e.ACTIVE="active",e.INFO="info"}(COLORS||(COLORS={}));var Mark,DEFAULT_COLOR=COLORS.PRIMARY;!function(e){e.U="U",e.B="B",e.Em="Em",e.InlineCode="InlineCode"}(Mark||(Mark={}));var FRAME_SIZES,PREVIEW_MODES,StyleguideScope,CSSNodeTypes,isContentHashId=function(e){return isString_1(e)&&!!e.match(/^[0-9a-zA-Z]{40}$/)},isTutorialId=function(e){return IsNumericId(e)},isTutorialSlug=function(e){return isIdentifier(e)};!function(e){e.COLLAPSED="Collapsed",e.EXPANDED="Expanded",e.MINIMIZED="Minimized"}(FRAME_SIZES||(FRAME_SIZES={})),function(e){e.TUTORIAL="Tutorial",e.PORTAL="Portal"}(PREVIEW_MODES||(PREVIEW_MODES={})),function(e){e.Global="Global",e.Organization="Organization"}(StyleguideScope||(StyleguideScope={})),function(e){e.Root="root",e.Rule="rule",e.Atrule="atrule",e.Decl="decl",e.Any="any"}(CSSNodeTypes||(CSSNodeTypes={}));var _a,createLookup=function(e){return e.reduce((function(e,t){var r;return __assign(__assign({},e),((r={})[t]=t,r))}),{})},findMatchingSegment=function(e,t){var r=createLookup(t);return e.content.find((function(e){var t=e.segmentId;return!!r[t]||t===DEFAULT_SEGMENT_ID}))},eventPrefix=function(e){return"candu.sdk."+e},errorPrefix=function(e){return eventPrefix("error."+e)},ERROR_SLUGS={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},EVENT_NAMES={HEARTBEAT:eventPrefix("heartbeat"),PREVIEW_OPEN:eventPrefix("preview.open"),PORTAL:eventPrefix("portal"),TUTORIAL:eventPrefix("tutorial"),TUTORIAL_INTERACTION:eventPrefix("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:errorPrefix("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:errorPrefix("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:errorPrefix("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:errorPrefix("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:errorPrefix("commit_api"),TUTORIAL_LOADING_ERROR:errorPrefix("tutorial"),UNKOWN_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:errorPrefix(ERROR_SLUGS.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),PORTAL_ERROR:errorPrefix(ERROR_SLUGS.PORTAL_ERROR),PROVIDER_ERROR:errorPrefix(ERROR_SLUGS.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),RENDER_NODE_ERROR:errorPrefix(ERROR_SLUGS.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:errorPrefix("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:errorPrefix("circular_dependecy_embed_tutorial")},PORTAL_ASSET_NOT_FOUND="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",unknownMessage=function(e){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+e+"."},EVENTING_NOT_INITIALIZED="You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n",PORTAL_NO_SEGMENT_IDS="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",NO_MATCHING_TUTORIALS="The Tutorial will not be rendered because there are no matching segments for the given user.",ERROR_MESSAGES=((_a={EVENTING_NOT_INITIALIZED:EVENTING_NOT_INITIALIZED})[EVENT_NAMES.PORTAL_ASSET_NOT_FOUND]=PORTAL_ASSET_NOT_FOUND,_a[EVENT_NAMES.PORTAL_NO_SEGMENT_IDS]=PORTAL_NO_SEGMENT_IDS,_a[EVENT_NAMES.NO_MATCHING_TUTORIALS]=NO_MATCHING_TUTORIALS,_a[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",_a[EVENT_NAMES.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",_a[EVENT_NAMES.UNKOWN_INLINE_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_INLINE_NODE_TYPE),_a[EVENT_NAMES.UNKOWN_NODE_TYPE]=unknownMessage(ERROR_SLUGS.UNKOWN_NODE_TYPE),_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",_a[EVENT_NAMES.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",_a[EVENT_NAMES.PORTAL_ERROR]="An error has occured within Portal",_a[EVENT_NAMES.PROVIDER_ERROR]="An error has occured within Provider",_a[EVENT_NAMES.TUTORIAL_ERROR]="An error has occured within Tutorial",_a[EVENT_NAMES.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",_a[EVENT_NAMES.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",_a),defaultStyleguide={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},trackStyleguideProperties=function(e){var t={};return Object.keys(e).forEach((function(r){defaultStyleguide[r]&&(t["styleguide."+r]=e[r].displayName||!0)})),t},LOGGER={error:console.error,warning:console.warn},internalEventing=function(e){var t=e.identify,r=e.track;return{provider:function(e){var a=e.userId,n=e.traits,o=e.styleguide;t(a,n),r(EVENT_NAMES.HEARTBEAT,trackStyleguideProperties(o))},tutorialDocumentLoadingError:function(e){var t=e.tutorialId,a=e.slug,n=e.contentHashId;LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.TUTORIAL_LOADING_ERROR]),r(EVENT_NAMES.TUTORIAL_LOADING_ERROR,{tutorialId:t,slug:a,contentHashId:n})}}};function createCommonjsModule$1(e,t){return e(t={exports:{}},t.exports),t.exports}for(var rngBrowser=createCommonjsModule$1((function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var a=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}})),byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);function bytesToUuid(e,t){var r=t||0,a=byteToHex;return[a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],"-",a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]],a[e[r++]]].join("")}var bytesToUuid_1=bytesToUuid;function v4(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||rngBrowser)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;++o)t[a+o]=n[o];return t||bytesToUuid_1(n)}var Source,EventType,v4_1=v4;!function(e){e.UserGenerated="UserGenerated",e.SDK="SDK"}(Source||(Source={})),function(e){e.Identify="Identify",e.Group="Group",e.Track="Track",e.Page="Page",e.Screen="Screen"}(EventType||(EventType={}));var ANONYMOUS_ID_STORAGE_KEY="candu:anonymous_id",hasStorage=function(){return"undefined"!=typeof window&&window.localStorage},get$1=function(e){return function(){if(hasStorage()){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return null}}}},getOrCreate=function(e,t){return function(){return get$1(e)()||t()}},set=function(e){return function(t){hasStorage()&&null!=t&&window.localStorage.setItem(e,JSON.stringify(t))}},storage={anonymousId:{getOrCreate:getOrCreate(ANONYMOUS_ID_STORAGE_KEY,(function(){var e=v4_1();return set(ANONYMOUS_ID_STORAGE_KEY)(e),e})),set:set(ANONYMOUS_ID_STORAGE_KEY)}},getAnonymousId=storage.anonymousId.getOrCreate,invariant=function(e,t,r,a,n,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,a,n,o,i,s],_=0;(c=new Error(t.replace(/%s/g,(function(){return u[_++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},browser=invariant,isValidStyleguideProps=function(e){return browser(!e||isObject_1(e),"(Candu) styleguide must be undefined or an object")},providerValidation=function(e){var t=e.clientToken,r=e.userId,a=e.traits,n=e.options,o=e.styleguide,i=__rest(e,["clientToken","userId","traits","options","styleguide"]);return browser(isClientToken(t),"(Candu) you must provide a valid clientToken"),browser(!r||isUserId(r),"(Candu) you must provide a valid userId"),isValidStyleguideProps(o),browser(!a||isObject_1(a),"(Candu) traits must be undefined or an object"),browser(!n||isObject_1(n),"(Candu) options must be undefined or an object"),__assign(__assign({},i),{clientToken:t,traits:a||{},options:n||{},styleguide:o||{},userId:r||getAnonymousId()})},tutorialValidation=function(e){var t=e.slug,r=e.styleguide,a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.renderedByClient,s=__rest(e,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return isValidStyleguideProps(r),__assign(__assign({},s),{slug:t,styleguide:r||{},contentHashId:a,tutorialId:n,tutorialDocument:o,renderedByClient:i})},portalValidation=function(e){var t=e.slug,r=e.styleguide;return isValidStyleguideProps(r),{slug:t,styleguide:r||{}}};const API_BASE_URL="https://api.candu.ai",CDN_BASE_URL="https://cdn.candu.ai";var API_BASE_URL$1=API_BASE_URL,CDN_BASE_URL$1=CDN_BASE_URL,ENDPOINTS={segmentMembership:"/api/segmentMemberships",segmentsDefinition:"/api/segmentsDefinition",tutorialMetadata:"/api/tutorialMetadata",tutorialDocuments:"/api/tutorialDocumentsEditor",tutorialProdSocket:"wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod"},fetchURL=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))},fetchFromApi=function(e){return fetchURL(""+API_BASE_URL$1+e)},fetchFromCdn=function(e){return fetchURL(""+CDN_BASE_URL$1+e)},getTutorialDocument=function(e){return{byId:function(t){return fetchFromApi(ENDPOINTS.tutorialDocuments+"?token="+e+"&finder=latestPublished&tutorialId="+t)},bySlug:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")},byContentHash:function(t){return fetchFromCdn("/tutorials/"+e+"/"+t+".json")}}},RESOURCES={tutorialDocumentLatestSaved:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.tutorialDocuments+"/"+t+"?token="+e)]}))}))},portalAsset:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromCdn("/portals/"+e+"/"+t+"/head.json")]}))}))},segmentMembership:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,fetchFromApi(ENDPOINTS.segmentMembership+"/"+t+"?token="+e)]}))}))},segmentDefinition:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.segmentsDefinition+"?token="+e)]}))}))},tutorialMetadata:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetchFromApi(ENDPOINTS.tutorialMetadata+"?token="+e)]}))}))},tutorialSocket:function(e,t,r){var a=ENDPOINTS.tutorialProdSocket+"?clientToken="+e+"&tutorialId="+t,n=new WebSocket(a);return n.onmessage=function(e){var t=JSON.parse(e.data);r(t)},function(){return n.close()}},tutorialDocument:function(e,t,r){var a=e.contentHashId,n=e.tutorialId,o=e.tutorialDocument,i=e.slug,s=getTutorialDocument(t);return isTutorialId(n)?s.byId(n):isTutorialSlug(i)?s.bySlug(i):isContentHashId(a)?s.byContentHash(a):isObject_1(o)?Promise.resolve(o):(LOGGER.error(ERROR_MESSAGES[EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(EVENT_NAMES.NO_VALID_TUTORIAL_IDENTIFIER,{slug:e.slug}),null)}},logError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.error.apply(console,e)},logWarning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.warn.apply(console,e)},logger={error:logError,warning:logWarning},Observer=function(){function e(){this.subscribers=[]}return e.prototype.subscribe=function(e){var t=this;return this.subscribers.push(e),function(){t.subscribers[t.subscribers.indexOf(e)]=function(){}}},e.prototype.notify=function(e){this.subscribers.forEach((function(t){return t(e)}))},e.prototype.clear=function(){this.subscribers=[]},e}(),PreviewContainer=function(){function e(){this.onClientUpdateObserver=new Observer}return e.prototype.attachClient=function(e){this.client=e,this.onClientUpdateObserver.notify({client:e})},e.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},e.prototype.onClientUpdate=function(e){var t=this.onClientUpdateObserver.subscribe(e);return this.client&&e({client:this.client}),t},e}();function createSingleton(e){var t,r,a=function(e){return function(){for(var t,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(r.api)return(t=r.api)[e].apply(t,a);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+e)}};return(t=function(){function t(){}return t.init=function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return this.api||(t.api=new(e.bind.apply(e,__spreadArrays([void 0],r)))),t.subscriberCallbacks.forEach((function(e){return e()})),t.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),t},t.onProviderReady=function(e){if(t.api)return e();t.subscriberCallbacks.push(e)},t}()).subscriberCallbacks=[],t.renderTutorial=a("renderTutorial"),t.renderPortal=a("renderPortal"),t.attachClient=a("attachClient"),t.detachClient=a("detachClient"),t.getProvider=a("getProvider"),r=t,window.Candu=r,r}var SingletonAPI=function(){function e(e){this.init(e)}return e.prototype.attachClient=function(e){return this.provider.preview.attachClient(e)},e.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(e.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),e}(),getEventHandler=function(e){switch(e.trigger){case TRIGGERS.ON_CLICK:default:return"onClick"}},getActionHandler=function(e,t){var r,a,n;switch(e.handler.type){case HANDLER_TYPES.NAVIGATE:return(r={})[getEventHandler(e)]=function(){var r=e.handler,a=r.href,n=r.target;t(e),"Blank"===n?window.open(a,"_blank"):a&&a.includes("mailto:")?window.location=a:document.location.href=a},r;case HANDLER_TYPES.CHANGE_TUTORIAL:return(a={})[getEventHandler(e)]=function(){var t=e.handler.tutorialId;logError("TODO -> change tutorial",t)},a;case HANDLER_TYPES.OPEN_GUIDE:return(n={})[getEventHandler(e)]=function(){var t=e.handler.guideId;logError("TODO -> open guide",t)},n;default:return{}}},getActionHandlers=function(e,t){var r=e.data;if(!r||!r.actions)return{};var a=function(e){t.provider.eventing.track(EVENT_NAMES.TUTORIAL_INTERACTION,__assign(__assign({},e),t.trackingIdentifiers||{}))};return r.actions.map((function(e){return getActionHandler(e,a)})).reduce((function(e,t){return __assign(__assign({},e),t)}),{})},mapNodeToStyleguide=function(e,t){try{var r=t.provider,a=t.document,n=t.trackingIdentifiers,o=a.nodes[e];if(!o)return logger.error("Document is corrupted. Refusing to move further."),null;var i=function(e){return mapNodeToStyleguide(e,t)},s=o.type,c=o.props,u=o.css,_=__assign(__assign(__assign({},c||{}),{style:u||{},children:(c||{}).children||o.nodes&&o.nodes.map(i)}),getActionHandlers(o,{trackingIdentifiers:n,provider:r})),l={nodeId:e,node:o,document:a,render:{node:i,styleguide:function(e,r){return void 0===r&&(r={}),t.renderNode(e,{api:l,attributes:r})},tutorial:function(e){return t.renderTutorial(e)},portal:function(e){return t.renderPortal(e)}},trackingIdentifiers:n},g=l.render.styleguide(s,_);return g||(logger.error(ERROR_MESSAGES[EVENT_NAMES.UNKOWN_NODE_TYPE],{type:s}),r.eventing.track(EVENT_NAMES.UNKOWN_NODE_TYPE,{type:s}),null)}catch(e){return logger.error(ERROR_MESSAGES[EVENT_NAMES.STYLEGUIDE_MAP_ERROR],e),null}},mergeStyleguidesFromContext=memoize_1((function(e,t){var r,a,n=e.provider,o=e.portal,i=e.tutorial,s=n.styleguide;return i&&(a=i.styleguide),o&&(r=o.styleguide),__assign(__assign(__assign(__assign({},s||{}),r||{}),a||{}),t||{})})),DEFAULT_ALT="",DEFAULT_ALERT_COLOR="#EDEDED",DEFAULT_TAB_HEADER_COLOR="#333745",DEFAULT_TAB_ITEM_COLOR="#838792",DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",DEFAULT_TAB_COLOR="#FEFEFE",STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},attachStylesheet=function(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",CDN_BASE_URL$1+"/styleguides/applications/"+e+"/default/main.css"),document.head.appendChild(t)};exports.DEFAULT_ALERT_COLOR=DEFAULT_ALERT_COLOR,exports.DEFAULT_ALT=DEFAULT_ALT,exports.DEFAULT_TAB_ACTIVE_COLOR=DEFAULT_TAB_ACTIVE_COLOR,exports.DEFAULT_TAB_COLOR=DEFAULT_TAB_COLOR,exports.DEFAULT_TAB_HEADER_COLOR=DEFAULT_TAB_HEADER_COLOR,exports.DEFAULT_TAB_ITEM_COLOR=DEFAULT_TAB_ITEM_COLOR,exports.ERROR_MESSAGES=ERROR_MESSAGES,exports.ERROR_SLUGS=ERROR_SLUGS,exports.EVENT_NAMES=EVENT_NAMES,exports.LOGGER=LOGGER,exports.Observer=Observer,exports.PreviewContainer=PreviewContainer,exports.RESOURCES=RESOURCES,exports.STYLEGUIDE_COLORS=STYLEGUIDE_COLORS,exports.SingletonAPI=SingletonAPI,exports.TutorialDependencies=TutorialDependencies,exports.adaptCustomNodes=adaptCustomNodes,exports.attachStylesheet=attachStylesheet,exports.checkCyclicAndAdd=checkCyclicAndAdd,exports.convertStyleNumberValues=convertStyleNumberValues,exports.createSingleton=createSingleton,exports.createTutorialDocumentContext=createTutorialDocumentContext,exports.defaultStyleguide=defaultStyleguide,exports.findMatchingSegment=findMatchingSegment,exports.internalEventing=internalEventing,exports.logError=logError,exports.logWarning=logWarning,exports.logger=logger,exports.mapNodeToStyleguide=mapNodeToStyleguide,exports.mergeStyleguidesFromContext=mergeStyleguidesFromContext,exports.portalValidation=portalValidation,exports.providerValidation=providerValidation,exports.tutorialValidation=tutorialValidation,exports.unpackShorthandStyles=unpackShorthandStyles; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -15,3 +15,3 @@ /*! ***************************************************************************** | ||
***************************************************************************** */ | ||
var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function e(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u="object"==typeof i&&i&&i.Object===Object&&i,c="object"==typeof self&&self&&self.Object===Object&&self,s=u||c||Function("return this")(),l=s.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var h=function(t){var e=d.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=p.call(t);return n&&(e?t[v]=r:delete t[v]),o},y=Object.prototype.toString;var _=function(t){return y.call(t)},b="[object Null]",g="[object Undefined]",E=l?l.toStringTag:void 0;var O=function(t){return null==t?void 0===t?g:b:E&&E in Object(t)?h(t):_(t)};var R=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},T="[object AsyncFunction]",I="[object Function]",m="[object GeneratorFunction]",N="[object Proxy]";var A,j=function(t){if(!R(t))return!1;var e=O(t);return e==I||e==m||e==T||e==N},w=s["__core-js_shared__"],P=(A=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var C=function(t){return!!P&&P in t},D=Function.prototype.toString;var S=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},L=/^\[object .+?Constructor\]$/,U=Function.prototype,k=Object.prototype,x=U.toString,M=k.hasOwnProperty,z=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var B=function(t){return!(!R(t)||C(t))&&(j(t)?z:L).test(S(t))};var W=function(t,e){return null==t?void 0:t[e]};var G=function(t,e){var r=W(t,e);return B(r)?r:void 0},V=function(){try{var t=G(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var F=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},$="[object Arguments]";var J=function(t){return H(t)&&O(t)==$},Z=Object.prototype,q=Z.hasOwnProperty,X=Z.propertyIsEnumerable,Q=J(function(){return arguments}())?J:function(t){return H(t)&&q.call(t,"callee")&&!X.call(t,"callee")},tt=Array.isArray;var et=function(){return!1},rt=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||et;t.exports=i})),nt=9007199254740991,ot=/^(?:0|[1-9]\d*)$/;var it=function(t,e){var r=typeof t;return!!(e=null==e?nt:e)&&("number"==r||"symbol"!=r&&ot.test(t))&&t>-1&&t%1==0&&t<e},at=9007199254740991;var ut=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=at},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var st=function(t){return H(t)&&ut(t.length)&&!!ct[O(t)]};var lt=function(t){return function(e){return t(e)}},ft=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&u.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),dt=ft&&ft.isTypedArray,pt=dt?lt(dt):st,vt=Object.prototype.hasOwnProperty;var ht=function(t,e){var r=tt(t),n=!r&&Q(t),o=!r&&!n&&rt(t),i=!r&&!n&&!o&&pt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var s in t)!e&&!vt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||it(s,c))||u.push(s);return u},yt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var bt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Et=function(t){if(!_t(t))return bt(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Ot=function(t){return null!=t&&ut(t.length)&&!j(t)};var Rt=function(t){return Ot(t)?ht(t):Et(t)};var Tt=function(t,e){return t&&F(t,e,Rt)};var It=function(){this.__data__=[],this.size=0};var mt=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1},At=Array.prototype.splice;var jt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():At.call(e,r,1),--this.size,!0)};var wt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Pt=function(t){return Nt(this.__data__,t)>-1};var Ct=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Dt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=It,Dt.prototype.delete=jt,Dt.prototype.get=wt,Dt.prototype.has=Pt,Dt.prototype.set=Ct;var St=Dt;var Lt=function(){this.__data__=new St,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var kt=function(t){return this.__data__.get(t)};var xt=function(t){return this.__data__.has(t)},Mt=G(s,"Map"),zt=G(Object,"create");var Bt=function(){this.__data__=zt?zt(null):{},this.size=0};var Wt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gt="__lodash_hash_undefined__",Vt=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(zt){var r=e[t];return r===Gt?void 0:r}return Vt.call(e,t)?e[t]:void 0},Ft=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return zt?void 0!==e[t]:Ft.call(e,t)},Ht="__lodash_hash_undefined__";var $t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zt&&void 0===e?Ht:e,this};function Jt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jt.prototype.clear=Bt,Jt.prototype.delete=Wt,Jt.prototype.get=Yt,Jt.prototype.has=Kt,Jt.prototype.set=$t;var Zt=Jt;var qt=function(){this.size=0,this.__data__={hash:new Zt,map:new(Mt||St),string:new Zt}};var Xt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Qt=function(t,e){var r=t.__data__;return Xt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Qt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Qt(this,t).get(t)};var re=function(t){return Qt(this,t).has(t)};var ne=function(t,e){var r=Qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=qt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe,ae=200;var ue=function(t,e){var r=this.__data__;if(r instanceof St){var n=r.__data__;if(!Mt||n.length<ae-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ce(t){var e=this.__data__=new St(t);this.size=e.size}ce.prototype.clear=Lt,ce.prototype.delete=Ut,ce.prototype.get=kt,ce.prototype.has=xt,ce.prototype.set=ue;var se=ce,le="__lodash_hash_undefined__";var fe=function(t){return this.__data__.set(t,le),this};var de=function(t){return this.__data__.has(t)};function pe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}pe.prototype.add=pe.prototype.push=fe,pe.prototype.has=de;var ve=pe;var he=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},_e=1,be=2;var ge=function(t,e,r,n,o,i){var a=r&_e,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=r&be?new ve:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!he(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Ee=s.Uint8Array;var Oe=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Te=1,Ie=2,me="[object Boolean]",Ne="[object Date]",Ae="[object Error]",je="[object Map]",we="[object Number]",Pe="[object RegExp]",Ce="[object Set]",De="[object String]",Se="[object Symbol]",Le="[object ArrayBuffer]",Ue="[object DataView]",ke=l?l.prototype:void 0,xe=ke?ke.valueOf:void 0;var Me=function(t,e,r,n,o,i,a){switch(r){case Ue:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Le:return!(t.byteLength!=e.byteLength||!i(new Ee(t),new Ee(e)));case me:case Ne:case we:return mt(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Pe:case De:return t==e+"";case je:var u=Oe;case Ce:var c=n&Te;if(u||(u=Re),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=Ie,a.set(t,e);var l=ge(u(t),u(e),n,o,i,a);return a.delete(t),l;case Se:if(xe)return xe.call(t)==xe.call(e)}return!1};var ze=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Be=function(t,e,r){var n=e(t);return tt(t)?n:ze(n,r(t))};var We=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Ge=function(){return[]},Ve=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,Fe=Ye?function(t){return null==t?[]:(t=Object(t),We(Ye(t),(function(e){return Ve.call(t,e)})))}:Ge;var Ke=function(t){return Be(t,Rt,Fe)},He=1,$e=Object.prototype.hasOwnProperty;var Je=function(t,e,r,n,o,i){var a=r&He,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:$e.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var y=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===y?v===h||o(v,h,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},Ze=G(s,"DataView"),qe=G(s,"Promise"),Xe=G(s,"Set"),Qe=G(s,"WeakMap"),tr=S(Ze),er=S(Mt),rr=S(qe),nr=S(Xe),or=S(Qe),ir=O;(Ze&&"[object DataView]"!=ir(new Ze(new ArrayBuffer(1)))||Mt&&"[object Map]"!=ir(new Mt)||qe&&"[object Promise]"!=ir(qe.resolve())||Xe&&"[object Set]"!=ir(new Xe)||Qe&&"[object WeakMap]"!=ir(new Qe))&&(ir=function(t){var e=O(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case tr:return"[object DataView]";case er:return"[object Map]";case rr:return"[object Promise]";case nr:return"[object Set]";case or:return"[object WeakMap]"}return e});var ar=ir,ur=1,cr="[object Arguments]",sr="[object Array]",lr="[object Object]",fr=Object.prototype.hasOwnProperty;var dr=function(t,e,r,n,o,i){var a=tt(t),u=tt(e),c=a?sr:ar(t),s=u?sr:ar(e),l=(c=c==cr?lr:c)==lr,f=(s=s==cr?lr:s)==lr,d=c==s;if(d&&rt(t)){if(!rt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new se),a||pt(t)?ge(t,e,r,n,o,i):Me(t,e,c,r,n,o,i);if(!(r&ur)){var p=l&&fr.call(t,"__wrapped__"),v=f&&fr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,y=v?e.value():e;return i||(i=new se),o(h,y,r,n,i)}}return!!d&&(i||(i=new se),Je(t,e,r,n,o,i))};var pr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!H(e)&&!H(r)?e!=e&&r!=r:dr(e,r,n,o,t,i))},vr=1,hr=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new se;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?pr(l,s,vr|hr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!R(t)};var br=function(t){for(var e=Rt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Er=function(t){var e=br(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Or="[object Symbol]";var Rr=function(t){return"symbol"==typeof t||H(t)&&O(t)==Or},Tr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var mr=function(t,e){if(tt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rr(t))||(Ir.test(t)||!Tr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function Ar(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Ar.Cache||ie),r}Ar.Cache=ie;var jr=Ar,wr=500;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cr=/\\(\\)?/g,Dr=function(t){var e=jr(t,(function(t){return r.size===wr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pr,(function(t,r,n,o){e.push(n?o.replace(Cr,"$1"):r||t)})),e}));var Sr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Lr=1/0,Ur=l?l.prototype:void 0,kr=Ur?Ur.toString:void 0;var xr=function t(e){if("string"==typeof e)return e;if(tt(e))return Sr(e,t)+"";if(Rr(e))return kr?kr.call(e):"";var r=e+"";return"0"==r&&1/e==-Lr?"-0":r};var Mr=function(t){return null==t?"":xr(t)};var zr=function(t,e){return tt(t)?t:mr(t,e)?[t]:Dr(Mr(t))},Br=1/0;var Wr=function(t){if("string"==typeof t||Rr(t))return t;var e=t+"";return"0"==e&&1/t==-Br?"-0":e};var Gr=function(t,e){for(var r=0,n=(e=zr(e,t)).length;null!=t&&r<n;)t=t[Wr(e[r++])];return r&&r==n?t:void 0};var Vr=function(t,e,r){var n=null==t?void 0:Gr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Fr=function(t,e,r){for(var n=-1,o=(e=zr(e,t)).length,i=!1;++n<o;){var a=Wr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ut(o)&&it(a,o)&&(tt(t)||Q(t))};var Kr=function(t,e){return null!=t&&Fr(t,e,Yr)},Hr=1,$r=2;var Jr=function(t,e){return mr(t)&&_r(e)?gr(Wr(t),e):function(r){var n=Vr(r,t);return void 0===n&&n===e?Kr(r,t):pr(e,n,Hr|$r)}};var Zr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Xr=function(t){return function(e){return Gr(e,t)}};var Qr=function(t){return mr(t)?qr(Wr(t)):Xr(t)};var tn=function(t){return"function"==typeof t?t:null==t?Zr:"object"==typeof t?tt(t)?Jr(t[0],t[1]):Er(t):Qr(t)};var en=function(t,e){var r={};return e=tn(e),Tt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},rn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var nn=["Webkit","ms","Moz","O"];Object.keys(rn).forEach((function(t){nn.forEach((function(e){rn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=rn[t]}))}));var on={isUnitlessNumber:rn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var an,un,cn,sn,ln,fn,dn=function(r){var n=r.css,o=n.padding,i=n.margin,a=e(n,["padding","margin"]),u={};return o&&(u={paddingRight:o,paddingLeft:o,paddingBottom:o,paddingTop:o}),i&&(u=t(t({},u),{marginRight:i,marginLeft:i,marginBottom:i,marginTop:i})),t(t({},r),{css:t(t({},u),a)})},pn=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return on.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),t(t({},e),{css:n})},vn=function(e){return en(e,(function(e){var r=e;return"Typography"===r.type&&(r=function(e){var r=Vr(e,"data.custom.variant","P");return t(t({},e),{type:r})}(r)),r.css&&R(r.css)&&r.css.flexBasis&&(r=function(e){var r=e.css.flexBasis;return"0"===r||"0px"===r?t(t({},e),{css:t(t({},e.css),{flexBasis:"0%"})}):e}(r)),r.css&&(r=dn(r),r=pn(r)),r}))},hn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),yn=function(t,e){return{id:t,dependencies:e?e.dependencies:new hn(t)}},_n=function(t,e){return t.dependencies.add(t.id,e)},bn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},gn="object"==typeof bn&&bn&&bn.Object===Object&&bn,En="object"==typeof self&&self&&self.Object===Object&&self,On=(gn||En||Function("return this")()).Symbol,Rn=Object.prototype,Tn=Rn.hasOwnProperty,In=Rn.toString,mn=On?On.toStringTag:void 0,Nn=Object.prototype.toString,An=On?On.toStringTag:void 0,jn=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":An&&An in Object(t)?function(t){var e=Tn.call(t,mn),r=t[mn];try{t[mn]=void 0;var n=!0}catch(t){}var o=In.call(t);return n&&(e?t[mn]=r:delete t[mn]),o}(t):function(t){return Nn.call(t)}(t)},wn=Array.isArray,Pn=function(t){return null!=t&&"object"==typeof t},Cn=function(t){return"string"==typeof t||!wn(t)&&Pn(t)&&"[object String]"==jn(t)},Dn=/^([a-zA-Z0-9]|_|-)+$/,Sn=function(t){return function(t){return"number"==typeof t||Pn(t)&&"[object Number]"==jn(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(an||(an={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(un||(un={})),(cn||(cn={})).ON_CLICK="OnClick",function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(ln||(ln={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(fn||(fn={}));var Ln;fn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Ln||(Ln={}));var Un,kn,xn,Mn,zn=function(t){return function(t){return Cn(t)&&t.length>=3&&t.length<100&&Dn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Un||(Un={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(kn||(kn={})),function(t){t.Global="Global",t.Organization="Organization"}(xn||(xn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Mn||(Mn={}));for(var Bn,Wn=function(e,r){var n=r.reduce((function(e,r){var n;return t(t({},e),((n={})[r]=r,n))}),{});return e.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},Gn=function(t){return"candu.sdk."+t},Vn=function(t){return Gn("error."+t)},Yn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Fn={HEARTBEAT:Gn("heartbeat"),PREVIEW_OPEN:Gn("preview.open"),PORTAL:Gn("portal"),TUTORIAL:Gn("tutorial"),TUTORIAL_INTERACTION:Gn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Vn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Vn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Vn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Vn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Vn("commit_api"),TUTORIAL_LOADING_ERROR:Vn("tutorial"),UNKOWN_NODE_TYPE:Vn(Yn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Vn(Yn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Vn(Yn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Vn(Yn.TUTORIAL_ERROR),PORTAL_ERROR:Vn(Yn.PORTAL_ERROR),PROVIDER_ERROR:Vn(Yn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Vn(Yn.TUTORIAL_ERROR),RENDER_NODE_ERROR:Vn(Yn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Vn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Vn("circular_dependecy_embed_tutorial")},Kn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Hn=((Bn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Fn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",Bn[Fn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",Bn[Fn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Bn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Bn[Fn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Bn[Fn.UNKOWN_INLINE_NODE_TYPE]=Kn(Yn.UNKOWN_INLINE_NODE_TYPE),Bn[Fn.UNKOWN_NODE_TYPE]=Kn(Yn.UNKOWN_NODE_TYPE),Bn[Fn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Bn[Fn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Bn[Fn.PORTAL_ERROR]="An error has occured within Portal",Bn[Fn.PROVIDER_ERROR]="An error has occured within Provider",Bn[Fn.TUTORIAL_ERROR]="An error has occured within Tutorial",Bn[Fn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Bn[Fn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Bn),$n={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},Jn={error:console.error,warning:console.warn},Zn=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Fn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){$n[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Jn.error(Hn[Fn.TUTORIAL_LOADING_ERROR]),r(Fn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},qn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),Xn=[],Qn=0;Qn<256;++Qn)Xn[Qn]=(Qn+256).toString(16).substr(1);var to,eo,ro=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||qn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=Xn;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(to||(to={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(eo||(eo={}));var no,oo=function(){return"undefined"!=typeof window&&window.localStorage},io=function(t){return function(e){oo()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},ao={anonymousId:{getOrCreate:("candu:anonymous_id",no=function(){var t=ro();return io("candu:anonymous_id")(t),t},function(){return function(){if(oo()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||no()}),set:io("candu:anonymous_id")}}.anonymousId.getOrCreate,uo=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],l=0;(c=new Error(e.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},co=function(t){return uo(!t||R(t),"(Candu) styleguide must be undefined or an object")},so=function(r){var n=r.clientToken,o=r.userId,i=r.traits,a=r.options,u=r.styleguide,c=e(r,["clientToken","userId","traits","options","styleguide"]);return uo(function(t){return Cn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),uo(!o||function(t){return Sn(t)||Cn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),co(u),uo(!i||R(i),"(Candu) traits must be undefined or an object"),uo(!a||R(a),"(Candu) options must be undefined or an object"),t(t({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||ao()})},lo=function(r){var n=r.slug,o=r.styleguide,i=r.contentHashId,a=r.tutorialId,u=r.tutorialDocument,c=r.renderedByClient,s=e(r,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return co(o),t(t({},s),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},fo=function(t){var e=t.slug,r=t.styleguide;return co(r),{slug:e,styleguide:r||{}}};var po="/api/segmentMemberships",vo="/api/segmentsDefinition",ho="/api/tutorialMetadata",yo="/api/tutorialDocumentsEditor",_o="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",bo=function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},go=function(t){return bo("https://api.candu.ai"+t)},Eo=function(t){return bo("https://cdn.candu.ai"+t)},Oo={tutorialDocumentLatestSaved:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,go(yo+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,Eo("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,go(po+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,go(vo+"?token="+t)]}))}))},tutorialMetadata:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,go(ho+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(_o+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return go(yo+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return Eo("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return Eo("/tutorials/"+t+"/"+e+".json")}}}(e);return function(t){return Sn(t)}(o)?u.byId(o):zn(a)?u.bySlug(a):function(t){return Cn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):R(i)?Promise.resolve(i):(Jn.error(Hn[Fn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Fn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},Ro=function(){function t(){this.clientSubscribers=[],this.clientSubscriberCleanup=[]}return t.prototype.attachClient=function(t){this.clientSubscriberCleanup=[],this.client=t,this.notifyClientIsReady()},t.prototype.detachClient=function(){this.client=null,this.cleanupSubscribers()},t.prototype.onClientReady=function(t){this.clientSubscribers.push(t),this.client&&this.notifySubscriber(t)},t.prototype.notifyClientIsReady=function(){var t=this;this.clientSubscribers.forEach((function(e){return t.notifySubscriber(e)}))},t.prototype.notifySubscriber=function(t){var e=t(this.client);e&&"function"==typeof e&&this.clientSubscriberCleanup.push(e)},t.prototype.cleanupSubscribers=function(){this.clientSubscriberCleanup.forEach((function(t){return t()})),this.clientSubscriberCleanup=[]},t}();function To(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,o([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r}var Io=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),mo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},No=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},Ao={error:mo,warning:No},jo=function(t){switch(t.trigger){case cn.ON_CLICK:default:return"onClick"}},wo=function(e,r){var n=e.data;if(!n||!n.actions)return{};var o=function(e){r.provider.eventing.track(Fn.TUTORIAL_INTERACTION,t(t({},e),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case ln.NAVIGATE:return(r={})[jo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case ln.CHANGE_TUTORIAL:return(n={})[jo(t)]=function(){var e=t.handler.tutorialId;mo("TODO -> change tutorial",e)},n;case ln.OPEN_GUIDE:return(o={})[jo(t)]=function(){var e=t.handler.guideId;mo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(e,r){return t(t({},e),r)}),{})},Po=function(e,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[e];if(!a)return Ao.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return Po(t,r)},c=a.type,s=a.props,l=a.css,f=t(t(t({},s||{}),{style:l||{},children:(s||{}).children||a.nodes&&a.nodes.map(u)}),wo(a,{trackingIdentifiers:i,provider:n})),d={nodeId:e,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(Ao.error(Hn[Fn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Fn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return Ao.error(Hn[Fn.STYLEGUIDE_MAP_ERROR],t),null}},Co=jr((function(e,r){var n,o,i=e.provider,a=e.portal,u=e.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),t(t(t(t({},c||{}),n||{}),o||{}),r||{})})),Do="",So="#EDEDED",Lo="#333745",Uo="#838792",ko="#FEFEFE",xo="#FEFEFE",Mo={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},zo=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)};export{So as DEFAULT_ALERT_COLOR,Do as DEFAULT_ALT,ko as DEFAULT_TAB_ACTIVE_COLOR,xo as DEFAULT_TAB_COLOR,Lo as DEFAULT_TAB_HEADER_COLOR,Uo as DEFAULT_TAB_ITEM_COLOR,Hn as ERROR_MESSAGES,Yn as ERROR_SLUGS,Fn as EVENT_NAMES,Jn as LOGGER,Ro as PreviewContainer,Oo as RESOURCES,Mo as STYLEGUIDE_COLORS,Io as SingletonAPI,hn as TutorialDependencies,vn as adaptCustomNodes,zo as attachStylesheet,_n as checkCyclicAndAdd,pn as convertStyleNumberValues,To as createSingleton,yn as createTutorialDocumentContext,$n as defaultStyleguide,Wn as findMatchingSegment,Zn as internalEventing,mo as logError,No as logWarning,Ao as logger,Po as mapNodeToStyleguide,Co as mergeStyleguidesFromContext,fo as portalValidation,so as providerValidation,lo as tutorialValidation,dn as unpackShorthandStyles}; | ||
var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function e(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u="object"==typeof i&&i&&i.Object===Object&&i,c="object"==typeof self&&self&&self.Object===Object&&self,s=u||c||Function("return this")(),l=s.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var h=function(t){var e=d.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=p.call(t);return n&&(e?t[v]=r:delete t[v]),o},y=Object.prototype.toString;var _=function(t){return y.call(t)},b="[object Null]",g="[object Undefined]",E=l?l.toStringTag:void 0;var O=function(t){return null==t?void 0===t?g:b:E&&E in Object(t)?h(t):_(t)};var T=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R="[object AsyncFunction]",m="[object Function]",I="[object GeneratorFunction]",N="[object Proxy]";var A,j=function(t){if(!T(t))return!1;var e=O(t);return e==m||e==I||e==R||e==N},w=s["__core-js_shared__"],P=(A=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var D=function(t){return!!P&&P in t},C=Function.prototype.toString;var L=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},S=/^\[object .+?Constructor\]$/,U=Function.prototype,k=Object.prototype,x=U.toString,M=k.hasOwnProperty,z=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var B=function(t){return!(!T(t)||D(t))&&(j(t)?z:S).test(L(t))};var W=function(t,e){return null==t?void 0:t[e]};var G=function(t,e){var r=W(t,e);return B(r)?r:void 0},V=function(){try{var t=G(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var F=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},$="[object Arguments]";var J=function(t){return H(t)&&O(t)==$},Z=Object.prototype,q=Z.hasOwnProperty,X=Z.propertyIsEnumerable,Q=J(function(){return arguments}())?J:function(t){return H(t)&&q.call(t,"callee")&&!X.call(t,"callee")},tt=Array.isArray;var et=function(){return!1},rt=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||et;t.exports=i})),nt=9007199254740991,ot=/^(?:0|[1-9]\d*)$/;var it=function(t,e){var r=typeof t;return!!(e=null==e?nt:e)&&("number"==r||"symbol"!=r&&ot.test(t))&&t>-1&&t%1==0&&t<e},at=9007199254740991;var ut=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=at},ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;var st=function(t){return H(t)&&ut(t.length)&&!!ct[O(t)]};var lt=function(t){return function(e){return t(e)}},ft=a((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&u.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),dt=ft&&ft.isTypedArray,pt=dt?lt(dt):st,vt=Object.prototype.hasOwnProperty;var ht=function(t,e){var r=tt(t),n=!r&&Q(t),o=!r&&!n&&rt(t),i=!r&&!n&&!o&&pt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var s in t)!e&&!vt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||it(s,c))||u.push(s);return u},yt=Object.prototype;var _t=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var bt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),gt=Object.prototype.hasOwnProperty;var Et=function(t){if(!_t(t))return bt(t);var e=[];for(var r in Object(t))gt.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Ot=function(t){return null!=t&&ut(t.length)&&!j(t)};var Tt=function(t){return Ot(t)?ht(t):Et(t)};var Rt=function(t,e){return t&&F(t,e,Tt)};var mt=function(){this.__data__=[],this.size=0};var It=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(It(t[r][0],e))return r;return-1},At=Array.prototype.splice;var jt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():At.call(e,r,1),--this.size,!0)};var wt=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Pt=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ct(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=mt,Ct.prototype.delete=jt,Ct.prototype.get=wt,Ct.prototype.has=Pt,Ct.prototype.set=Dt;var Lt=Ct;var St=function(){this.__data__=new Lt,this.size=0};var Ut=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var kt=function(t){return this.__data__.get(t)};var xt=function(t){return this.__data__.has(t)},Mt=G(s,"Map"),zt=G(Object,"create");var Bt=function(){this.__data__=zt?zt(null):{},this.size=0};var Wt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gt="__lodash_hash_undefined__",Vt=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(zt){var r=e[t];return r===Gt?void 0:r}return Vt.call(e,t)?e[t]:void 0},Ft=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return zt?void 0!==e[t]:Ft.call(e,t)},Ht="__lodash_hash_undefined__";var $t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zt&&void 0===e?Ht:e,this};function Jt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jt.prototype.clear=Bt,Jt.prototype.delete=Wt,Jt.prototype.get=Yt,Jt.prototype.has=Kt,Jt.prototype.set=$t;var Zt=Jt;var qt=function(){this.size=0,this.__data__={hash:new Zt,map:new(Mt||Lt),string:new Zt}};var Xt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Qt=function(t,e){var r=t.__data__;return Xt(e)?r["string"==typeof e?"string":"hash"]:r.map};var te=function(t){var e=Qt(this,t).delete(t);return this.size-=e?1:0,e};var ee=function(t){return Qt(this,t).get(t)};var re=function(t){return Qt(this,t).has(t)};var ne=function(t,e){var r=Qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=qt,oe.prototype.delete=te,oe.prototype.get=ee,oe.prototype.has=re,oe.prototype.set=ne;var ie=oe,ae=200;var ue=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!Mt||n.length<ae-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(t,e),this.size=r.size,this};function ce(t){var e=this.__data__=new Lt(t);this.size=e.size}ce.prototype.clear=St,ce.prototype.delete=Ut,ce.prototype.get=kt,ce.prototype.has=xt,ce.prototype.set=ue;var se=ce,le="__lodash_hash_undefined__";var fe=function(t){return this.__data__.set(t,le),this};var de=function(t){return this.__data__.has(t)};function pe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ie;++e<r;)this.add(t[e])}pe.prototype.add=pe.prototype.push=fe,pe.prototype.has=de;var ve=pe;var he=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},_e=1,be=2;var ge=function(t,e,r,n,o,i){var a=r&_e,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,d=r&be?new ve:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(n)var h=a?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!he(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Ee=s.Uint8Array;var Oe=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},Re=1,me=2,Ie="[object Boolean]",Ne="[object Date]",Ae="[object Error]",je="[object Map]",we="[object Number]",Pe="[object RegExp]",De="[object Set]",Ce="[object String]",Le="[object Symbol]",Se="[object ArrayBuffer]",Ue="[object DataView]",ke=l?l.prototype:void 0,xe=ke?ke.valueOf:void 0;var Me=function(t,e,r,n,o,i,a){switch(r){case Ue:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Se:return!(t.byteLength!=e.byteLength||!i(new Ee(t),new Ee(e)));case Ie:case Ne:case we:return It(+t,+e);case Ae:return t.name==e.name&&t.message==e.message;case Pe:case Ce:return t==e+"";case je:var u=Oe;case De:var c=nℜif(u||(u=Te),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=me,a.set(t,e);var l=ge(u(t),u(e),n,o,i,a);return a.delete(t),l;case Le:if(xe)return xe.call(t)==xe.call(e)}return!1};var ze=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Be=function(t,e,r){var n=e(t);return tt(t)?n:ze(n,r(t))};var We=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var Ge=function(){return[]},Ve=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,Fe=Ye?function(t){return null==t?[]:(t=Object(t),We(Ye(t),(function(e){return Ve.call(t,e)})))}:Ge;var Ke=function(t){return Be(t,Tt,Fe)},He=1,$e=Object.prototype.hasOwnProperty;var Je=function(t,e,r,n,o,i){var a=r&He,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in e:$e.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++s<c;){var v=t[l=u[s]],h=e[l];if(n)var y=a?n(h,v,l,e,t,i):n(v,h,l,t,e,i);if(!(void 0===y?v===h||o(v,h,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},Ze=G(s,"DataView"),qe=G(s,"Promise"),Xe=G(s,"Set"),Qe=G(s,"WeakMap"),tr=L(Ze),er=L(Mt),rr=L(qe),nr=L(Xe),or=L(Qe),ir=O;(Ze&&"[object DataView]"!=ir(new Ze(new ArrayBuffer(1)))||Mt&&"[object Map]"!=ir(new Mt)||qe&&"[object Promise]"!=ir(qe.resolve())||Xe&&"[object Set]"!=ir(new Xe)||Qe&&"[object WeakMap]"!=ir(new Qe))&&(ir=function(t){var e=O(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case tr:return"[object DataView]";case er:return"[object Map]";case rr:return"[object Promise]";case nr:return"[object Set]";case or:return"[object WeakMap]"}return e});var ar=ir,ur=1,cr="[object Arguments]",sr="[object Array]",lr="[object Object]",fr=Object.prototype.hasOwnProperty;var dr=function(t,e,r,n,o,i){var a=tt(t),u=tt(e),c=a?sr:ar(t),s=u?sr:ar(e),l=(c=c==cr?lr:c)==lr,f=(s=s==cr?lr:s)==lr,d=c==s;if(d&&rt(t)){if(!rt(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new se),a||pt(t)?ge(t,e,r,n,o,i):Me(t,e,c,r,n,o,i);if(!(r&ur)){var p=l&&fr.call(t,"__wrapped__"),v=f&&fr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,y=v?e.value():e;return i||(i=new se),o(h,y,r,n,i)}}return!!d&&(i||(i=new se),Je(t,e,r,n,o,i))};var pr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!H(e)&&!H(r)?e!=e&&r!=r:dr(e,r,n,o,t,i))},vr=1,hr=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],s=t[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new se;if(n)var d=n(s,l,c,t,e,f);if(!(void 0===d?pr(l,s,vr|hr,n,f):d))return!1}}return!0};var _r=function(t){return t==t&&!T(t)};var br=function(t){for(var e=Tt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_r(o)]}return e};var gr=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Er=function(t){var e=br(t);return 1==e.length&&e[0][2]?gr(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Or="[object Symbol]";var Tr=function(t){return"symbol"==typeof t||H(t)&&O(t)==Or},Rr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mr=/^\w*$/;var Ir=function(t,e){if(tt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Tr(t))||(mr.test(t)||!Rr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function Ar(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Ar.Cache||ie),r}Ar.Cache=ie;var jr=Ar,wr=500;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Cr=function(t){var e=jr(t,(function(t){return r.size===wr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pr,(function(t,r,n,o){e.push(n?o.replace(Dr,"$1"):r||t)})),e}));var Lr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Sr=1/0,Ur=l?l.prototype:void 0,kr=Ur?Ur.toString:void 0;var xr=function t(e){if("string"==typeof e)return e;if(tt(e))return Lr(e,t)+"";if(Tr(e))return kr?kr.call(e):"";var r=e+"";return"0"==r&&1/e==-Sr?"-0":r};var Mr=function(t){return null==t?"":xr(t)};var zr=function(t,e){return tt(t)?t:Ir(t,e)?[t]:Cr(Mr(t))},Br=1/0;var Wr=function(t){if("string"==typeof t||Tr(t))return t;var e=t+"";return"0"==e&&1/t==-Br?"-0":e};var Gr=function(t,e){for(var r=0,n=(e=zr(e,t)).length;null!=t&&r<n;)t=t[Wr(e[r++])];return r&&r==n?t:void 0};var Vr=function(t,e,r){var n=null==t?void 0:Gr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Fr=function(t,e,r){for(var n=-1,o=(e=zr(e,t)).length,i=!1;++n<o;){var a=Wr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ut(o)&&it(a,o)&&(tt(t)||Q(t))};var Kr=function(t,e){return null!=t&&Fr(t,e,Yr)},Hr=1,$r=2;var Jr=function(t,e){return Ir(t)&&_r(e)?gr(Wr(t),e):function(r){var n=Vr(r,t);return void 0===n&&n===e?Kr(r,t):pr(e,n,Hr|$r)}};var Zr=function(t){return t};var qr=function(t){return function(e){return null==e?void 0:e[t]}};var Xr=function(t){return function(e){return Gr(e,t)}};var Qr=function(t){return Ir(t)?qr(Wr(t)):Xr(t)};var tn=function(t){return"function"==typeof t?t:null==t?Zr:"object"==typeof t?tt(t)?Jr(t[0],t[1]):Er(t):Qr(t)};var en=function(t,e){var r={};return e=tn(e),Rt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},rn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var nn=["Webkit","ms","Moz","O"];Object.keys(rn).forEach((function(t){nn.forEach((function(e){rn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=rn[t]}))}));var on={isUnitlessNumber:rn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var an=function(r){var n=r.css,o=n.padding,i=n.margin,a=e(n,["padding","margin"]),u={};return o&&(u={paddingRight:o,paddingLeft:o,paddingBottom:o,paddingTop:o}),i&&(u=t(t({},u),{marginRight:i,marginLeft:i,marginBottom:i,marginTop:i})),t(t({},r),{css:t(t({},u),a)})},un=function(e){var r=e.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return on.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),t(t({},e),{css:n})},cn=function(e){return en(e,(function(e){var r=e;return"Typography"===r.type&&(r=function(e){var r=Vr(e,"data.custom.variant","P");return t(t({},e),{type:r})}(r)),r.css&&T(r.css)&&r.css.flexBasis&&(r=function(e){var r=e.css.flexBasis;return"0"===r||"0px"===r?t(t({},e),{css:t(t({},e.css),{flexBasis:"0%"})}):e}(r)),r.css&&(r=an(r),r=un(r)),r}))},sn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),ln=function(t,e){return{id:t,dependencies:e?e.dependencies:new sn(t)}},fn=function(t,e){return t.dependencies.add(t.id,e)},dn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},pn="object"==typeof dn&&dn&&dn.Object===Object&&dn,vn="object"==typeof self&&self&&self.Object===Object&&self,hn=(pn||vn||Function("return this")()).Symbol,yn=Object.prototype,_n=yn.hasOwnProperty,bn=yn.toString,gn=hn?hn.toStringTag:void 0;var En=function(t){var e=_n.call(t,gn),r=t[gn];try{t[gn]=void 0;var n=!0}catch(t){}var o=bn.call(t);return n&&(e?t[gn]=r:delete t[gn]),o},On=Object.prototype.toString;var Tn=function(t){return On.call(t)},Rn="[object Null]",mn="[object Undefined]",In=hn?hn.toStringTag:void 0;var Nn=function(t){return null==t?void 0===t?mn:Rn:In&&In in Object(t)?En(t):Tn(t)},An=Array.isArray;var jn=function(t){return null!=t&&"object"==typeof t},wn="[object String]";var Pn=function(t){return"string"==typeof t||!An(t)&&jn(t)&&Nn(t)==wn},Dn="[object Number]";var Cn,Ln,Sn,Un,kn,xn,Mn=function(t){return"number"==typeof t||jn(t)&&Nn(t)==Dn},zn=/^([a-zA-Z0-9]|_|-)+$/,Bn=function(t){return Mn(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Cn||(Cn={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(Ln||(Ln={})),function(t){t.ON_CLICK="OnClick"}(Sn||(Sn={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Un||(Un={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(kn||(kn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(xn||(xn={}));var Wn;xn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Wn||(Wn={}));var Gn,Vn,Yn,Fn,Kn=function(t){return Pn(e=t)&&e.length>=3&&e.length<100&&zn.test(e);var e};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Gn||(Gn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Vn||(Vn={})),function(t){t.Global="Global",t.Organization="Organization"}(Yn||(Yn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Fn||(Fn={}));var Hn,$n=function(e,r){var n=r.reduce((function(e,r){var n;return t(t({},e),((n={})[r]=r,n))}),{});return e.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},Jn=function(t){return"candu.sdk."+t},Zn=function(t){return Jn("error."+t)},qn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Xn={HEARTBEAT:Jn("heartbeat"),PREVIEW_OPEN:Jn("preview.open"),PORTAL:Jn("portal"),TUTORIAL:Jn("tutorial"),TUTORIAL_INTERACTION:Jn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Zn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Zn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Zn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Zn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Zn("commit_api"),TUTORIAL_LOADING_ERROR:Zn("tutorial"),UNKOWN_NODE_TYPE:Zn(qn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Zn(qn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Zn(qn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Zn(qn.TUTORIAL_ERROR),PORTAL_ERROR:Zn(qn.PORTAL_ERROR),PROVIDER_ERROR:Zn(qn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Zn(qn.TUTORIAL_ERROR),RENDER_NODE_ERROR:Zn(qn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Zn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Zn("circular_dependecy_embed_tutorial")},Qn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},to=((Hn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Xn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",Hn[Xn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",Hn[Xn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Hn[Xn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Hn[Xn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Hn[Xn.UNKOWN_INLINE_NODE_TYPE]=Qn(qn.UNKOWN_INLINE_NODE_TYPE),Hn[Xn.UNKOWN_NODE_TYPE]=Qn(qn.UNKOWN_NODE_TYPE),Hn[Xn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Hn[Xn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Hn[Xn.PORTAL_ERROR]="An error has occured within Portal",Hn[Xn.PROVIDER_ERROR]="An error has occured within Provider",Hn[Xn.TUTORIAL_ERROR]="An error has occured within Tutorial",Hn[Xn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Hn[Xn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Hn),eo={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},ro={error:console.error,warning:console.warn},no=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Xn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){eo[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;ro.error(to[Xn.TUTORIAL_LOADING_ERROR]),r(Xn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}};for(var oo=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}})),io=[],ao=0;ao<256;++ao)io[ao]=(ao+256).toString(16).substr(1);var uo=function(t,e){var r=e||0,n=io;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")};var co,so,lo=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||oo)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||uo(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(co||(co={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(so||(so={}));var fo,po,vo=function(){return"undefined"!=typeof window&&window.localStorage},ho=function(t){return function(e){vo()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},yo={anonymousId:{getOrCreate:(fo="candu:anonymous_id",po=function(){var t=lo();return ho("candu:anonymous_id")(t),t},function(){return function(t){return function(){if(vo()){var e=window.localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(t){return null}}}}(fo)()||po()}),set:ho("candu:anonymous_id")}}.anonymousId.getOrCreate,_o=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],l=0;(c=new Error(e.replace(/%s/g,(function(){return s[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},bo=function(t){return _o(!t||T(t),"(Candu) styleguide must be undefined or an object")},go=function(r){var n,o,i=r.clientToken,a=r.userId,u=r.traits,c=r.options,s=r.styleguide,l=e(r,["clientToken","userId","traits","options","styleguide"]);return _o(Pn(n=i)&&!!n.match(/^[0-9a-zA-Z]*$/)&&n.length>=10,"(Candu) you must provide a valid clientToken"),_o(!a||(Bn(o=a)||Pn(o)&&o.trim().length>0),"(Candu) you must provide a valid userId"),bo(s),_o(!u||T(u),"(Candu) traits must be undefined or an object"),_o(!c||T(c),"(Candu) options must be undefined or an object"),t(t({},l),{clientToken:i,traits:u||{},options:c||{},styleguide:s||{},userId:a||yo()})},Eo=function(r){var n=r.slug,o=r.styleguide,i=r.contentHashId,a=r.tutorialId,u=r.tutorialDocument,c=r.renderedByClient,s=e(r,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return bo(o),t(t({},s),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},Oo=function(t){var e=t.slug,r=t.styleguide;return bo(r),{slug:e,styleguide:r||{}}};var To="/api/segmentMemberships",Ro="/api/segmentsDefinition",mo="/api/tutorialMetadata",Io="/api/tutorialDocumentsEditor",No="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Ao=function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},jo=function(t){return Ao("https://api.candu.ai"+t)},wo=function(t){return Ao("https://cdn.candu.ai"+t)},Po={tutorialDocumentLatestSaved:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,jo(Io+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,wo("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,jo(To+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,jo(Ro+"?token="+t)]}))}))},tutorialMetadata:function(t){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2,jo(mo+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(No+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n,o=t.contentHashId,i=t.tutorialId,a=t.tutorialDocument,u=t.slug,c=function(t){return{byId:function(e){return jo(Io+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return wo("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return wo("/tutorials/"+t+"/"+e+".json")}}}(e);return Bn(i)?c.byId(i):Kn(u)?c.bySlug(u):Pn(n=o)&&n.match(/^[0-9a-zA-Z]{40}$/)?c.byContentHash(o):T(a)?Promise.resolve(a):(ro.error(to[Xn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Xn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},Do=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},Co=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},Lo={error:Do,warning:Co},So=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),Uo=function(){function t(){this.onClientUpdateObserver=new So}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();function ko(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,o([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r}var xo=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Mo=function(t){switch(t.trigger){case Sn.ON_CLICK:default:return"onClick"}},zo=function(e,r){var n=e.data;if(!n||!n.actions)return{};var o=function(e){r.provider.eventing.track(Xn.TUTORIAL_INTERACTION,t(t({},e),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case kn.NAVIGATE:return(r={})[Mo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case kn.CHANGE_TUTORIAL:return(n={})[Mo(t)]=function(){var e=t.handler.tutorialId;Do("TODO -> change tutorial",e)},n;case kn.OPEN_GUIDE:return(o={})[Mo(t)]=function(){var e=t.handler.guideId;Do("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(e,r){return t(t({},e),r)}),{})},Bo=function(e,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[e];if(!a)return Lo.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return Bo(t,r)},c=a.type,s=a.props,l=a.css,f=t(t(t({},s||{}),{style:l||{},children:(s||{}).children||a.nodes&&a.nodes.map(u)}),zo(a,{trackingIdentifiers:i,provider:n})),d={nodeId:e,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(Lo.error(to[Xn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Xn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return Lo.error(to[Xn.STYLEGUIDE_MAP_ERROR],t),null}},Wo=jr((function(e,r){var n,o,i=e.provider,a=e.portal,u=e.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),t(t(t(t({},c||{}),n||{}),o||{}),r||{})})),Go="",Vo="#EDEDED",Yo="#333745",Fo="#838792",Ko="#FEFEFE",Ho="#FEFEFE",$o={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},Jo=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)};export{Vo as DEFAULT_ALERT_COLOR,Go as DEFAULT_ALT,Ko as DEFAULT_TAB_ACTIVE_COLOR,Ho as DEFAULT_TAB_COLOR,Yo as DEFAULT_TAB_HEADER_COLOR,Fo as DEFAULT_TAB_ITEM_COLOR,to as ERROR_MESSAGES,qn as ERROR_SLUGS,Xn as EVENT_NAMES,ro as LOGGER,So as Observer,Uo as PreviewContainer,Po as RESOURCES,$o as STYLEGUIDE_COLORS,xo as SingletonAPI,sn as TutorialDependencies,cn as adaptCustomNodes,Jo as attachStylesheet,fn as checkCyclicAndAdd,un as convertStyleNumberValues,ko as createSingleton,ln as createTutorialDocumentContext,eo as defaultStyleguide,$n as findMatchingSegment,no as internalEventing,Do as logError,Co as logWarning,Lo as logger,Bo as mapNodeToStyleguide,Wo as mergeStyleguidesFromContext,Oo as portalValidation,go as providerValidation,Eo as tutorialValidation,an as unpackShorthandStyles}; | ||
//# sourceMappingURL=index.es.js.map |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@candulabs/core"]={})}(this,(function(t){"use strict"; | ||
and limitations under the License. | ||
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function i(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,e){return t(e={exports:{}},e.exports),e.exports}var c="object"==typeof a&&a&&a.Object===Object&&a,l="object"==typeof self&&self&&self.Object===Object&&self,s=c||l||Function("return this")(),f=s.Symbol,d=Object.prototype,p=d.hasOwnProperty,v=d.toString,h=f?f.toStringTag:void 0;var y=function(t){var e=p.call(t,h),r=t[h];try{t[h]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[h]=r:delete t[h]),o},_=Object.prototype.toString;var b=function(t){return _.call(t)},g="[object Null]",E="[object Undefined]",O=f?f.toStringTag:void 0;var T=function(t){return null==t?void 0===t?E:g:O&&O in Object(t)?y(t):b(t)};var R=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},m="[object AsyncFunction]",I="[object Function]",A="[object GeneratorFunction]",N="[object Proxy]";var j,w=function(t){if(!R(t))return!1;var e=T(t);return e==I||e==A||e==m||e==N},C=s["__core-js_shared__"],S=(j=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var D=function(t){return!!S&&S in t},P=Function.prototype.toString;var L=function(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""},U=/^\[object .+?Constructor\]$/,k=Function.prototype,x=Object.prototype,M=k.toString,B=x.hasOwnProperty,G=RegExp("^"+M.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var V=function(t){return!(!R(t)||D(t))&&(w(t)?G:U).test(L(t))};var z=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=z(t,e);return V(r)?r:void 0},F=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&F?F(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var H=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var $=function(t){return null!=t&&"object"==typeof t},J="[object Arguments]";var Z=function(t){return $(t)&&T(t)==J},q=Object.prototype,X=q.hasOwnProperty,Q=q.propertyIsEnumerable,tt=Z(function(){return arguments}())?Z:function(t){return $(t)&&X.call(t,"callee")&&!Q.call(t,"callee")},et=Array.isArray;var rt=function(){return!1},nt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||rt;t.exports=i})),ot=9007199254740991,it=/^(?:0|[1-9]\d*)$/;var at=function(t,e){var r=typeof t;return!!(e=null==e?ot:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e},ut=9007199254740991;var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ut},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var st=function(t){return $(t)&&ct(t.length)&&!!lt[T(t)]};var ft=function(t){return function(e){return t(e)}},dt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),pt=dt&&dt.isTypedArray,vt=pt?ft(pt):st,ht=Object.prototype.hasOwnProperty;var yt=function(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&nt(t),i=!r&&!n&&!o&&vt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var l in t)!e&&!ht.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||at(l,c))||u.push(l);return u},_t=Object.prototype;var bt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_t)};var gt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Et=Object.prototype.hasOwnProperty;var Ot=function(t){if(!bt(t))return gt(t);var e=[];for(var r in Object(t))Et.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Tt=function(t){return null!=t&&ct(t.length)&&!w(t)};var Rt=function(t){return Tt(t)?yt(t):Ot(t)};var mt=function(t,e){return t&&H(t,e,Rt)};var It=function(){this.__data__=[],this.size=0};var At=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(At(t[r][0],e))return r;return-1},jt=Array.prototype.splice;var wt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var St=function(t){return Nt(this.__data__,t)>-1};var Dt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Pt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pt.prototype.clear=It,Pt.prototype.delete=wt,Pt.prototype.get=Ct,Pt.prototype.has=St,Pt.prototype.set=Dt;var Lt=Pt;var Ut=function(){this.__data__=new Lt,this.size=0};var kt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var xt=function(t){return this.__data__.get(t)};var Mt=function(t){return this.__data__.has(t)},Bt=W(s,"Map"),Gt=W(Object,"create");var Vt=function(){this.__data__=Gt?Gt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wt="__lodash_hash_undefined__",Ft=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(Gt){var r=e[t];return r===Wt?void 0:r}return Ft.call(e,t)?e[t]:void 0},Ht=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return Gt?void 0!==e[t]:Ht.call(e,t)},$t="__lodash_hash_undefined__";var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Gt&&void 0===e?$t:e,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Vt,Zt.prototype.delete=zt,Zt.prototype.get=Yt,Zt.prototype.has=Kt,Zt.prototype.set=Jt;var qt=Zt;var Xt=function(){this.size=0,this.__data__={hash:new qt,map:new(Bt||Lt),string:new qt}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var te=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var ee=function(t){var e=te(this,t).delete(t);return this.size-=e?1:0,e};var re=function(t){return te(this,t).get(t)};var ne=function(t){return te(this,t).has(t)};var oe=function(t,e){var r=te(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=Xt,ie.prototype.delete=ee,ie.prototype.get=re,ie.prototype.has=ne,ie.prototype.set=oe;var ae=ie,ue=200;var ce=function(t,e){var r=this.__data__;if(r instanceof Lt){var n=r.__data__;if(!Bt||n.length<ue-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ae(n)}return r.set(t,e),this.size=r.size,this};function le(t){var e=this.__data__=new Lt(t);this.size=e.size}le.prototype.clear=Ut,le.prototype.delete=kt,le.prototype.get=xt,le.prototype.has=Mt,le.prototype.set=ce;var se=le,fe="__lodash_hash_undefined__";var de=function(t){return this.__data__.set(t,fe),this};var pe=function(t){return this.__data__.has(t)};function ve(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ae;++e<r;)this.add(t[e])}ve.prototype.add=ve.prototype.push=de,ve.prototype.has=pe;var he=ve;var ye=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var _e=function(t,e){return t.has(e)},be=1,ge=2;var Ee=function(t,e,r,n,o,i){var a=r&be,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,d=r&ge?new he:void 0;for(i.set(t,e),i.set(e,t);++s<u;){var p=t[s],v=e[s];if(n)var h=a?n(v,p,s,e,t,i):n(p,v,s,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!ye(e,(function(t,e){if(!_e(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Oe=s.Uint8Array;var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},me=1,Ie=2,Ae="[object Boolean]",Ne="[object Date]",je="[object Error]",we="[object Map]",Ce="[object Number]",Se="[object RegExp]",De="[object Set]",Pe="[object String]",Le="[object Symbol]",Ue="[object ArrayBuffer]",ke="[object DataView]",xe=f?f.prototype:void 0,Me=xe?xe.valueOf:void 0;var Be=function(t,e,r,n,o,i,a){switch(r){case ke:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ue:return!(t.byteLength!=e.byteLength||!i(new Oe(t),new Oe(e)));case Ae:case Ne:case Ce:return At(+t,+e);case je:return t.name==e.name&&t.message==e.message;case Se:case Pe:return t==e+"";case we:var u=Te;case De:var c=n&me;if(u||(u=Re),t.size!=e.size&&!c)return!1;var l=a.get(t);if(l)return l==e;n|=Ie,a.set(t,e);var s=Ee(u(t),u(e),n,o,i,a);return a.delete(t),s;case Le:if(Me)return Me.call(t)==Me.call(e)}return!1};var Ge=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ve=function(t,e,r){var n=e(t);return et(t)?n:Ge(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var We=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,He=Ye?function(t){return null==t?[]:(t=Object(t),ze(Ye(t),(function(e){return Fe.call(t,e)})))}:We;var Ke=function(t){return Ve(t,Rt,He)},$e=1,Je=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=r&$e,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var l=c;l--;){var s=u[l];if(!(a?s in e:Je.call(e,s)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++l<c;){var v=t[s=u[l]],h=e[s];if(n)var y=a?n(h,v,s,e,t,i):n(v,h,s,t,e,i);if(!(void 0===y?v===h||o(v,h,r,n,i):y)){d=!1;break}p||(p="constructor"==s)}if(d&&!p){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},qe=W(s,"DataView"),Xe=W(s,"Promise"),Qe=W(s,"Set"),tr=W(s,"WeakMap"),er=L(qe),rr=L(Bt),nr=L(Xe),or=L(Qe),ir=L(tr),ar=T;(qe&&"[object DataView]"!=ar(new qe(new ArrayBuffer(1)))||Bt&&"[object Map]"!=ar(new Bt)||Xe&&"[object Promise]"!=ar(Xe.resolve())||Qe&&"[object Set]"!=ar(new Qe)||tr&&"[object WeakMap]"!=ar(new tr))&&(ar=function(t){var e=T(t),r="[object Object]"==e?t.constructor:void 0,n=r?L(r):"";if(n)switch(n){case er:return"[object DataView]";case rr:return"[object Map]";case nr:return"[object Promise]";case or:return"[object Set]";case ir:return"[object WeakMap]"}return e});var ur=ar,cr=1,lr="[object Arguments]",sr="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;var pr=function(t,e,r,n,o,i){var a=et(t),u=et(e),c=a?sr:ur(t),l=u?sr:ur(e),s=(c=c==lr?fr:c)==fr,f=(l=l==lr?fr:l)==fr,d=c==l;if(d&&nt(t)){if(!nt(e))return!1;a=!0,s=!1}if(d&&!s)return i||(i=new se),a||vt(t)?Ee(t,e,r,n,o,i):Be(t,e,c,r,n,o,i);if(!(r&cr)){var p=s&&dr.call(t,"__wrapped__"),v=f&&dr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,y=v?e.value():e;return i||(i=new se),o(h,y,r,n,i)}}return!!d&&(i||(i=new se),Ze(t,e,r,n,o,i))};var vr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!$(e)&&!$(r)?e!=e&&r!=r:pr(e,r,n,o,t,i))},hr=1,yr=2;var _r=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],l=t[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in t))return!1}else{var f=new se;if(n)var d=n(l,s,c,t,e,f);if(!(void 0===d?vr(s,l,hr|yr,n,f):d))return!1}}return!0};var br=function(t){return t==t&&!R(t)};var gr=function(t){for(var e=Rt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,br(o)]}return e};var Er=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Or=function(t){var e=gr(t);return 1==e.length&&e[0][2]?Er(e[0][0],e[0][1]):function(r){return r===t||_r(r,t,e)}},Tr="[object Symbol]";var Rr=function(t){return"symbol"==typeof t||$(t)&&T(t)==Tr},mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var Ar=function(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rr(t))||(Ir.test(t)||!mr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function jr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(jr.Cache||ae),r}jr.Cache=ae;var wr=jr,Cr=500;var Sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Pr=function(t){var e=wr(t,(function(t){return r.size===Cr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Sr,(function(t,r,n,o){e.push(n?o.replace(Dr,"$1"):r||t)})),e}));var Lr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Ur=1/0,kr=f?f.prototype:void 0,xr=kr?kr.toString:void 0;var Mr=function t(e){if("string"==typeof e)return e;if(et(e))return Lr(e,t)+"";if(Rr(e))return xr?xr.call(e):"";var r=e+"";return"0"==r&&1/e==-Ur?"-0":r};var Br=function(t){return null==t?"":Mr(t)};var Gr=function(t,e){return et(t)?t:Ar(t,e)?[t]:Pr(Br(t))},Vr=1/0;var zr=function(t){if("string"==typeof t||Rr(t))return t;var e=t+"";return"0"==e&&1/t==-Vr?"-0":e};var Wr=function(t,e){for(var r=0,n=(e=Gr(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var Fr=function(t,e,r){var n=null==t?void 0:Wr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Hr=function(t,e,r){for(var n=-1,o=(e=Gr(e,t)).length,i=!1;++n<o;){var a=zr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ct(o)&&at(a,o)&&(et(t)||tt(t))};var Kr=function(t,e){return null!=t&&Hr(t,e,Yr)},$r=1,Jr=2;var Zr=function(t,e){return Ar(t)&&br(e)?Er(zr(t),e):function(r){var n=Fr(r,t);return void 0===n&&n===e?Kr(r,t):vr(e,n,$r|Jr)}};var qr=function(t){return t};var Xr=function(t){return function(e){return null==e?void 0:e[t]}};var Qr=function(t){return function(e){return Wr(e,t)}};var tn=function(t){return Ar(t)?Xr(zr(t)):Qr(t)};var en=function(t){return"function"==typeof t?t:null==t?qr:"object"==typeof t?et(t)?Zr(t[0],t[1]):Or(t):tn(t)};var rn=function(t,e){var r={};return e=en(e),mt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},nn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var on=["Webkit","ms","Moz","O"];Object.keys(nn).forEach((function(t){on.forEach((function(e){nn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=nn[t]}))}));var an={isUnitlessNumber:nn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var un,cn,ln,sn,fn,dn,pn=function(t){var n=t.css,o=n.padding,i=n.margin,a=r(n,["padding","margin"]),u={};return o&&(u={paddingRight:o,paddingLeft:o,paddingBottom:o,paddingTop:o}),i&&(u=e(e({},u),{marginRight:i,marginLeft:i,marginBottom:i,marginTop:i})),e(e({},t),{css:e(e({},u),a)})},vn=function(t){var r=t.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return an.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),e(e({},t),{css:n})},hn=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),yn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_n="object"==typeof yn&&yn&&yn.Object===Object&&yn,bn="object"==typeof self&&self&&self.Object===Object&&self,gn=(_n||bn||Function("return this")()).Symbol,En=Object.prototype,On=En.hasOwnProperty,Tn=En.toString,Rn=gn?gn.toStringTag:void 0,mn=Object.prototype.toString,In=gn?gn.toStringTag:void 0,An=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":In&&In in Object(t)?function(t){var e=On.call(t,Rn),r=t[Rn];try{t[Rn]=void 0;var n=!0}catch(t){}var o=Tn.call(t);return n&&(e?t[Rn]=r:delete t[Rn]),o}(t):function(t){return mn.call(t)}(t)},Nn=Array.isArray,jn=function(t){return null!=t&&"object"==typeof t},wn=function(t){return"string"==typeof t||!Nn(t)&&jn(t)&&"[object String]"==An(t)},Cn=/^([a-zA-Z0-9]|_|-)+$/,Sn=function(t){return function(t){return"number"==typeof t||jn(t)&&"[object Number]"==An(t)}(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(un||(un={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(cn||(cn={})),function(t){t.ON_CLICK="OnClick"}(ln||(ln={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(sn||(sn={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(fn||(fn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(dn||(dn={}));var Dn;dn.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Dn||(Dn={}));var Pn,Ln,Un,kn,xn=function(t){return function(t){return wn(t)&&t.length>=3&&t.length<100&&Cn.test(t)}(t)};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Pn||(Pn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Ln||(Ln={})),function(t){t.Global="Global",t.Organization="Organization"}(Un||(Un={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(kn||(kn={}));for(var Mn,Bn=function(t){return"candu.sdk."+t},Gn=function(t){return Bn("error."+t)},Vn={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},zn={HEARTBEAT:Bn("heartbeat"),PREVIEW_OPEN:Bn("preview.open"),PORTAL:Bn("portal"),TUTORIAL:Bn("tutorial"),TUTORIAL_INTERACTION:Bn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Gn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Gn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Gn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Gn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Gn("commit_api"),TUTORIAL_LOADING_ERROR:Gn("tutorial"),UNKOWN_NODE_TYPE:Gn(Vn.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Gn(Vn.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Gn(Vn.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Gn(Vn.TUTORIAL_ERROR),PORTAL_ERROR:Gn(Vn.PORTAL_ERROR),PROVIDER_ERROR:Gn(Vn.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Gn(Vn.TUTORIAL_ERROR),RENDER_NODE_ERROR:Gn(Vn.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Gn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Gn("circular_dependecy_embed_tutorial")},Wn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},Fn=((Mn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[zn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",Mn[zn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",Mn[zn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Mn[zn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Mn[zn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Mn[zn.UNKOWN_INLINE_NODE_TYPE]=Wn(Vn.UNKOWN_INLINE_NODE_TYPE),Mn[zn.UNKOWN_NODE_TYPE]=Wn(Vn.UNKOWN_NODE_TYPE),Mn[zn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Mn[zn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Mn[zn.PORTAL_ERROR]="An error has occured within Portal",Mn[zn.PROVIDER_ERROR]="An error has occured within Provider",Mn[zn.TUTORIAL_ERROR]="An error has occured within Tutorial",Mn[zn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Mn[zn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Mn),Yn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},Hn={error:console.error,warning:console.warn},Kn=function(t,e){return function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}}(e={exports:{}}),e.exports}(),$n=[],Jn=0;Jn<256;++Jn)$n[Jn]=(Jn+256).toString(16).substr(1);var Zn,qn,Xn=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Kn)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||function(t,e){var r=e||0,n=$n;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")}(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(Zn||(Zn={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(qn||(qn={}));var Qn,to=function(){return"undefined"!=typeof window&&window.localStorage},eo=function(t){return function(e){to()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},ro={anonymousId:{getOrCreate:("candu:anonymous_id",Qn=function(){var t=Xn();return eo("candu:anonymous_id")(t),t},function(){return function(){if(to()){var t=window.localStorage.getItem("candu:anonymous_id");if(t)try{return JSON.parse(t)}catch(t){return null}}}()||Qn()}),set:eo("candu:anonymous_id")}}.anonymousId.getOrCreate,no=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,i,a,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},oo=function(t){return no(!t||R(t),"(Candu) styleguide must be undefined or an object")};var io="/api/segmentMemberships",ao="/api/segmentsDefinition",uo="/api/tutorialMetadata",co="/api/tutorialDocumentsEditor",lo="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",so=function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},fo=function(t){return so("https://api.candu.ai"+t)},po=function(t){return so("https://cdn.candu.ai"+t)},vo={tutorialDocumentLatestSaved:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,fo(co+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,po("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,fo(io+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,fo(ao+"?token="+t)]}))}))},tutorialMetadata:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,fo(uo+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(lo+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n=t.contentHashId,o=t.tutorialId,i=t.tutorialDocument,a=t.slug,u=function(t){return{byId:function(e){return fo(co+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return po("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return po("/tutorials/"+t+"/"+e+".json")}}}(e);return function(t){return Sn(t)}(o)?u.byId(o):xn(a)?u.bySlug(a):function(t){return wn(t)&&!!t.match(/^[0-9a-zA-Z]{40}$/)}(n)?u.byContentHash(n):R(i)?Promise.resolve(i):(Hn.error(Fn[zn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(zn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},ho=function(){function t(){this.clientSubscribers=[],this.clientSubscriberCleanup=[]}return t.prototype.attachClient=function(t){this.clientSubscriberCleanup=[],this.client=t,this.notifyClientIsReady()},t.prototype.detachClient=function(){this.client=null,this.cleanupSubscribers()},t.prototype.onClientReady=function(t){this.clientSubscribers.push(t),this.client&&this.notifySubscriber(t)},t.prototype.notifyClientIsReady=function(){var t=this;this.clientSubscribers.forEach((function(e){return t.notifySubscriber(e)}))},t.prototype.notifySubscriber=function(t){var e=t(this.client);e&&"function"==typeof e&&this.clientSubscriberCleanup.push(e)},t.prototype.cleanupSubscribers=function(){this.clientSubscriberCleanup.forEach((function(t){return t()})),this.clientSubscriberCleanup=[]},t}();var yo=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),_o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},bo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},go={error:_o,warning:bo},Eo=function(t){switch(t.trigger){case ln.ON_CLICK:default:return"onClick"}},Oo=function(t,r){var n=t.data;if(!n||!n.actions)return{};var o=function(t){r.provider.eventing.track(zn.TUTORIAL_INTERACTION,e(e({},t),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case fn.NAVIGATE:return(r={})[Eo(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case fn.CHANGE_TUTORIAL:return(n={})[Eo(t)]=function(){var e=t.handler.tutorialId;_o("TODO -> change tutorial",e)},n;case fn.OPEN_GUIDE:return(o={})[Eo(t)]=function(){var e=t.handler.guideId;_o("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(t,r){return e(e({},t),r)}),{})},To=function(t,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[t];if(!a)return go.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return To(t,r)},c=a.type,l=a.props,s=a.css,f=e(e(e({},l||{}),{style:s||{},children:(l||{}).children||a.nodes&&a.nodes.map(u)}),Oo(a,{trackingIdentifiers:i,provider:n})),d={nodeId:t,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(go.error(Fn[zn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(zn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return go.error(Fn[zn.STYLEGUIDE_MAP_ERROR],t),null}},Ro=wr((function(t,r){var n,o,i=t.provider,a=t.portal,u=t.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),e(e(e(e({},c||{}),n||{}),o||{}),r||{})}));t.DEFAULT_ALERT_COLOR="#EDEDED",t.DEFAULT_ALT="",t.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",t.DEFAULT_TAB_COLOR="#FEFEFE",t.DEFAULT_TAB_HEADER_COLOR="#333745",t.DEFAULT_TAB_ITEM_COLOR="#838792",t.ERROR_MESSAGES=Fn,t.ERROR_SLUGS=Vn,t.EVENT_NAMES=zn,t.LOGGER=Hn,t.PreviewContainer=ho,t.RESOURCES=vo,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.SingletonAPI=yo,t.TutorialDependencies=hn,t.adaptCustomNodes=function(t){return rn(t,(function(t){var r=t;return"Typography"===r.type&&(r=function(t){var r=Fr(t,"data.custom.variant","P");return e(e({},t),{type:r})}(r)),r.css&&R(r.css)&&r.css.flexBasis&&(r=function(t){var r=t.css.flexBasis;return"0"===r||"0px"===r?e(e({},t),{css:e(e({},t.css),{flexBasis:"0%"})}):t}(r)),r.css&&(r=pn(r),r=vn(r)),r}))},t.attachStylesheet=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)},t.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},t.convertStyleNumberValues=vn,t.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,i([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r},t.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new hn(t)}},t.defaultStyleguide=Yn,t.findMatchingSegment=function(t,r){var n=r.reduce((function(t,r){var n;return e(e({},t),((n={})[r]=r,n))}),{});return t.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},t.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(zn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Yn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Hn.error(Fn[zn.TUTORIAL_LOADING_ERROR]),r(zn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},t.logError=_o,t.logWarning=bo,t.logger=go,t.mapNodeToStyleguide=To,t.mergeStyleguidesFromContext=Ro,t.portalValidation=function(t){var e=t.slug,r=t.styleguide;return oo(r),{slug:e,styleguide:r||{}}},t.providerValidation=function(t){var n=t.clientToken,o=t.userId,i=t.traits,a=t.options,u=t.styleguide,c=r(t,["clientToken","userId","traits","options","styleguide"]);return no(function(t){return wn(t)&&!!t.match(/^[0-9a-zA-Z]*$/)&&t.length>=10}(n),"(Candu) you must provide a valid clientToken"),no(!o||function(t){return Sn(t)||wn(t)&&t.trim().length>0}(o),"(Candu) you must provide a valid userId"),oo(u),no(!i||R(i),"(Candu) traits must be undefined or an object"),no(!a||R(a),"(Candu) options must be undefined or an object"),e(e({},c),{clientToken:n,traits:i||{},options:a||{},styleguide:u||{},userId:o||ro()})},t.tutorialValidation=function(t){var n=t.slug,o=t.styleguide,i=t.contentHashId,a=t.tutorialId,u=t.tutorialDocument,c=t.renderedByClient,l=r(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return oo(o),e(e({},l),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},t.unpackShorthandStyles=pn,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new r((function(e){e(t.value)})).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function i(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,e){return t(e={exports:{}},e.exports),e.exports}var c="object"==typeof a&&a&&a.Object===Object&&a,l="object"==typeof self&&self&&self.Object===Object&&self,s=c||l||Function("return this")(),f=s.Symbol,d=Object.prototype,p=d.hasOwnProperty,v=d.toString,h=f?f.toStringTag:void 0;var _=function(t){var e=p.call(t,h),r=t[h];try{t[h]=void 0;var n=!0}catch(t){}var o=v.call(t);return n&&(e?t[h]=r:delete t[h]),o},y=Object.prototype.toString;var b=function(t){return y.call(t)},g="[object Null]",E="[object Undefined]",O=f?f.toStringTag:void 0;var T=function(t){return null==t?void 0===t?E:g:O&&O in Object(t)?_(t):b(t)};var R=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},m="[object AsyncFunction]",I="[object Function]",A="[object GeneratorFunction]",N="[object Proxy]";var j,w=function(t){if(!R(t))return!1;var e=T(t);return e==I||e==A||e==m||e==N},C=s["__core-js_shared__"],D=(j=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var P=function(t){return!!D&&D in t},L=Function.prototype.toString;var S=function(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""},U=/^\[object .+?Constructor\]$/,k=Function.prototype,x=Object.prototype,M=k.toString,B=x.hasOwnProperty,G=RegExp("^"+M.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var V=function(t){return!(!R(t)||P(t))&&(w(t)?G:U).test(S(t))};var z=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=z(t,e);return V(r)?r:void 0},F=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=function(t,e,r){"__proto__"==e&&F?F(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var H=function(t){return function(e,r,n){for(var o=-1,i=Object(e),a=n(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===r(i[c],c,i))break}return e}}();var K=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var $=function(t){return null!=t&&"object"==typeof t},J="[object Arguments]";var Z=function(t){return $(t)&&T(t)==J},q=Object.prototype,X=q.hasOwnProperty,Q=q.propertyIsEnumerable,tt=Z(function(){return arguments}())?Z:function(t){return $(t)&&X.call(t,"callee")&&!Q.call(t,"callee")},et=Array.isArray;var rt=function(){return!1},nt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r?s.Buffer:void 0,i=(o?o.isBuffer:void 0)||rt;t.exports=i})),ot=9007199254740991,it=/^(?:0|[1-9]\d*)$/;var at=function(t,e){var r=typeof t;return!!(e=null==e?ot:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e},ut=9007199254740991;var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ut},lt={};lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object Boolean]"]=lt["[object DataView]"]=lt["[object Date]"]=lt["[object Error]"]=lt["[object Function]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object WeakMap]"]=!1;var st=function(t){return $(t)&&ct(t.length)&&!!lt[T(t)]};var ft=function(t){return function(e){return t(e)}},dt=u((function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,o=n&&n.exports===r&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),pt=dt&&dt.isTypedArray,vt=pt?ft(pt):st,ht=Object.prototype.hasOwnProperty;var _t=function(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&nt(t),i=!r&&!n&&!o&&vt(t),a=r||n||o||i,u=a?K(t.length,String):[],c=u.length;for(var l in t)!e&&!ht.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||at(l,c))||u.push(l);return u},yt=Object.prototype;var bt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||yt)};var gt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Et=Object.prototype.hasOwnProperty;var Ot=function(t){if(!bt(t))return gt(t);var e=[];for(var r in Object(t))Et.call(t,r)&&"constructor"!=r&&e.push(r);return e};var Tt=function(t){return null!=t&&ct(t.length)&&!w(t)};var Rt=function(t){return Tt(t)?_t(t):Ot(t)};var mt=function(t,e){return t&&H(t,e,Rt)};var It=function(){this.__data__=[],this.size=0};var At=function(t,e){return t===e||t!=t&&e!=e};var Nt=function(t,e){for(var r=t.length;r--;)if(At(t[r][0],e))return r;return-1},jt=Array.prototype.splice;var wt=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]};var Dt=function(t){return Nt(this.__data__,t)>-1};var Pt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Lt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=It,Lt.prototype.delete=wt,Lt.prototype.get=Ct,Lt.prototype.has=Dt,Lt.prototype.set=Pt;var St=Lt;var Ut=function(){this.__data__=new St,this.size=0};var kt=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var xt=function(t){return this.__data__.get(t)};var Mt=function(t){return this.__data__.has(t)},Bt=W(s,"Map"),Gt=W(Object,"create");var Vt=function(){this.__data__=Gt?Gt(null):{},this.size=0};var zt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wt="__lodash_hash_undefined__",Ft=Object.prototype.hasOwnProperty;var Yt=function(t){var e=this.__data__;if(Gt){var r=e[t];return r===Wt?void 0:r}return Ft.call(e,t)?e[t]:void 0},Ht=Object.prototype.hasOwnProperty;var Kt=function(t){var e=this.__data__;return Gt?void 0!==e[t]:Ht.call(e,t)},$t="__lodash_hash_undefined__";var Jt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Gt&&void 0===e?$t:e,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Vt,Zt.prototype.delete=zt,Zt.prototype.get=Yt,Zt.prototype.has=Kt,Zt.prototype.set=Jt;var qt=Zt;var Xt=function(){this.size=0,this.__data__={hash:new qt,map:new(Bt||St),string:new qt}};var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var te=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map};var ee=function(t){var e=te(this,t).delete(t);return this.size-=e?1:0,e};var re=function(t){return te(this,t).get(t)};var ne=function(t){return te(this,t).has(t)};var oe=function(t,e){var r=te(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=Xt,ie.prototype.delete=ee,ie.prototype.get=re,ie.prototype.has=ne,ie.prototype.set=oe;var ae=ie,ue=200;var ce=function(t,e){var r=this.__data__;if(r instanceof St){var n=r.__data__;if(!Bt||n.length<ue-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ae(n)}return r.set(t,e),this.size=r.size,this};function le(t){var e=this.__data__=new St(t);this.size=e.size}le.prototype.clear=Ut,le.prototype.delete=kt,le.prototype.get=xt,le.prototype.has=Mt,le.prototype.set=ce;var se=le,fe="__lodash_hash_undefined__";var de=function(t){return this.__data__.set(t,fe),this};var pe=function(t){return this.__data__.has(t)};function ve(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ae;++e<r;)this.add(t[e])}ve.prototype.add=ve.prototype.push=de,ve.prototype.has=pe;var he=ve;var _e=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1};var ye=function(t,e){return t.has(e)},be=1,ge=2;var Ee=function(t,e,r,n,o,i){var a=r&be,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,d=r&ge?new he:void 0;for(i.set(t,e),i.set(e,t);++s<u;){var p=t[s],v=e[s];if(n)var h=a?n(v,p,s,e,t,i):n(p,v,s,t,e,i);if(void 0!==h){if(h)continue;f=!1;break}if(d){if(!_e(e,(function(t,e){if(!ye(d,e)&&(p===t||o(p,t,r,n,i)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f},Oe=s.Uint8Array;var Te=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var Re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},me=1,Ie=2,Ae="[object Boolean]",Ne="[object Date]",je="[object Error]",we="[object Map]",Ce="[object Number]",De="[object RegExp]",Pe="[object Set]",Le="[object String]",Se="[object Symbol]",Ue="[object ArrayBuffer]",ke="[object DataView]",xe=f?f.prototype:void 0,Me=xe?xe.valueOf:void 0;var Be=function(t,e,r,n,o,i,a){switch(r){case ke:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ue:return!(t.byteLength!=e.byteLength||!i(new Oe(t),new Oe(e)));case Ae:case Ne:case Ce:return At(+t,+e);case je:return t.name==e.name&&t.message==e.message;case De:case Le:return t==e+"";case we:var u=Te;case Pe:var c=n&me;if(u||(u=Re),t.size!=e.size&&!c)return!1;var l=a.get(t);if(l)return l==e;n|=Ie,a.set(t,e);var s=Ee(u(t),u(e),n,o,i,a);return a.delete(t),s;case Se:if(Me)return Me.call(t)==Me.call(e)}return!1};var Ge=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t};var Ve=function(t,e,r){var n=e(t);return et(t)?n:Ge(n,r(t))};var ze=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i};var We=function(){return[]},Fe=Object.prototype.propertyIsEnumerable,Ye=Object.getOwnPropertySymbols,He=Ye?function(t){return null==t?[]:(t=Object(t),ze(Ye(t),(function(e){return Fe.call(t,e)})))}:We;var Ke=function(t){return Ve(t,Rt,He)},$e=1,Je=Object.prototype.hasOwnProperty;var Ze=function(t,e,r,n,o,i){var a=r&$e,u=Ke(t),c=u.length;if(c!=Ke(e).length&&!a)return!1;for(var l=c;l--;){var s=u[l];if(!(a?s in e:Je.call(e,s)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var d=!0;i.set(t,e),i.set(e,t);for(var p=a;++l<c;){var v=t[s=u[l]],h=e[s];if(n)var _=a?n(h,v,s,e,t,i):n(v,h,s,t,e,i);if(!(void 0===_?v===h||o(v,h,r,n,i):_)){d=!1;break}p||(p="constructor"==s)}if(d&&!p){var y=t.constructor,b=e.constructor;y!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(d=!1)}return i.delete(t),i.delete(e),d},qe=W(s,"DataView"),Xe=W(s,"Promise"),Qe=W(s,"Set"),tr=W(s,"WeakMap"),er=S(qe),rr=S(Bt),nr=S(Xe),or=S(Qe),ir=S(tr),ar=T;(qe&&"[object DataView]"!=ar(new qe(new ArrayBuffer(1)))||Bt&&"[object Map]"!=ar(new Bt)||Xe&&"[object Promise]"!=ar(Xe.resolve())||Qe&&"[object Set]"!=ar(new Qe)||tr&&"[object WeakMap]"!=ar(new tr))&&(ar=function(t){var e=T(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case er:return"[object DataView]";case rr:return"[object Map]";case nr:return"[object Promise]";case or:return"[object Set]";case ir:return"[object WeakMap]"}return e});var ur=ar,cr=1,lr="[object Arguments]",sr="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;var pr=function(t,e,r,n,o,i){var a=et(t),u=et(e),c=a?sr:ur(t),l=u?sr:ur(e),s=(c=c==lr?fr:c)==fr,f=(l=l==lr?fr:l)==fr,d=c==l;if(d&&nt(t)){if(!nt(e))return!1;a=!0,s=!1}if(d&&!s)return i||(i=new se),a||vt(t)?Ee(t,e,r,n,o,i):Be(t,e,c,r,n,o,i);if(!(r&cr)){var p=s&&dr.call(t,"__wrapped__"),v=f&&dr.call(e,"__wrapped__");if(p||v){var h=p?t.value():t,_=v?e.value():e;return i||(i=new se),o(h,_,r,n,i)}}return!!d&&(i||(i=new se),Ze(t,e,r,n,o,i))};var vr=function t(e,r,n,o,i){return e===r||(null==e||null==r||!$(e)&&!$(r)?e!=e&&r!=r:pr(e,r,n,o,t,i))},hr=1,_r=2;var yr=function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var c=(u=r[o])[0],l=t[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in t))return!1}else{var f=new se;if(n)var d=n(l,s,c,t,e,f);if(!(void 0===d?vr(s,l,hr|_r,n,f):d))return!1}}return!0};var br=function(t){return t==t&&!R(t)};var gr=function(t){for(var e=Rt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,br(o)]}return e};var Er=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}};var Or=function(t){var e=gr(t);return 1==e.length&&e[0][2]?Er(e[0][0],e[0][1]):function(r){return r===t||yr(r,t,e)}},Tr="[object Symbol]";var Rr=function(t){return"symbol"==typeof t||$(t)&&T(t)==Tr},mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/;var Ar=function(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rr(t))||(Ir.test(t)||!mr.test(t)||null!=e&&t in Object(e))},Nr="Expected a function";function jr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Nr);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(jr.Cache||ae),r}jr.Cache=ae;var wr=jr,Cr=500;var Dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,Lr=function(t){var e=wr(t,(function(t){return r.size===Cr&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Dr,(function(t,r,n,o){e.push(n?o.replace(Pr,"$1"):r||t)})),e}));var Sr=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Ur=1/0,kr=f?f.prototype:void 0,xr=kr?kr.toString:void 0;var Mr=function t(e){if("string"==typeof e)return e;if(et(e))return Sr(e,t)+"";if(Rr(e))return xr?xr.call(e):"";var r=e+"";return"0"==r&&1/e==-Ur?"-0":r};var Br=function(t){return null==t?"":Mr(t)};var Gr=function(t,e){return et(t)?t:Ar(t,e)?[t]:Lr(Br(t))},Vr=1/0;var zr=function(t){if("string"==typeof t||Rr(t))return t;var e=t+"";return"0"==e&&1/t==-Vr?"-0":e};var Wr=function(t,e){for(var r=0,n=(e=Gr(e,t)).length;null!=t&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0};var Fr=function(t,e,r){var n=null==t?void 0:Wr(t,e);return void 0===n?r:n};var Yr=function(t,e){return null!=t&&e in Object(t)};var Hr=function(t,e,r){for(var n=-1,o=(e=Gr(e,t)).length,i=!1;++n<o;){var a=zr(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&ct(o)&&at(a,o)&&(et(t)||tt(t))};var Kr=function(t,e){return null!=t&&Hr(t,e,Yr)},$r=1,Jr=2;var Zr=function(t,e){return Ar(t)&&br(e)?Er(zr(t),e):function(r){var n=Fr(r,t);return void 0===n&&n===e?Kr(r,t):vr(e,n,$r|Jr)}};var qr=function(t){return t};var Xr=function(t){return function(e){return null==e?void 0:e[t]}};var Qr=function(t){return function(e){return Wr(e,t)}};var tn=function(t){return Ar(t)?Xr(zr(t)):Qr(t)};var en=function(t){return"function"==typeof t?t:null==t?qr:"object"==typeof t?et(t)?Zr(t[0],t[1]):Or(t):tn(t)};var rn=function(t,e){var r={};return e=en(e),mt(t,(function(t,n,o){Y(r,n,e(t,n,o))})),r},nn={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};var on=["Webkit","ms","Moz","O"];Object.keys(nn).forEach((function(t){on.forEach((function(e){nn[function(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}(e,t)]=nn[t]}))}));var an={isUnitlessNumber:nn,shorthandPropertyExpansions:{background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}}};var un=function(t){var n=t.css,o=n.padding,i=n.margin,a=r(n,["padding","margin"]),u={};return o&&(u={paddingRight:o,paddingLeft:o,paddingBottom:o,paddingTop:o}),i&&(u=e(e({},u),{marginRight:i,marginLeft:i,marginBottom:i,marginTop:i})),e(e({},t),{css:e(e({},u),a)})},cn=function(t){var r=t.css,n={};return Object.entries(r).forEach((function(t){var e=t[0],r=t[1];if("number"==typeof r)return an.isUnitlessNumber[e]?void(n[e]=""+r):void(n[e]=r+"px");n[e]=r})),e(e({},t),{css:n})},ln=function(){function t(t){this.adjacencyList={},this.rootDocument=t,this.adjacencyList[t]=[]}return t.prototype.get=function(t){return this.adjacencyList[t]},t.prototype.add=function(t,e){var r=this;if(this.adjacencyList[t]||(this.adjacencyList[t]=[]),!this.adjacencyList[e])return this.adjacencyList[t].push(e),this.adjacencyList[e]=[],!0;if(this.adjacencyList[t].includes(e))return!0;var n=function(e){if(e===t)return!0;for(var o=0,i=r.adjacencyList[e];o<i.length;o++){var a=i[o];if(n(a))return!0}return!1};return!n(e)&&(this.adjacencyList[t].push(e),!0)},t}(),sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},fn="object"==typeof sn&&sn&&sn.Object===Object&&sn,dn="object"==typeof self&&self&&self.Object===Object&&self,pn=(fn||dn||Function("return this")()).Symbol,vn=Object.prototype,hn=vn.hasOwnProperty,_n=vn.toString,yn=pn?pn.toStringTag:void 0;var bn=function(t){var e=hn.call(t,yn),r=t[yn];try{t[yn]=void 0;var n=!0}catch(t){}var o=_n.call(t);return n&&(e?t[yn]=r:delete t[yn]),o},gn=Object.prototype.toString;var En=function(t){return gn.call(t)},On="[object Null]",Tn="[object Undefined]",Rn=pn?pn.toStringTag:void 0;var mn=function(t){return null==t?void 0===t?Tn:On:Rn&&Rn in Object(t)?bn(t):En(t)},In=Array.isArray;var An=function(t){return null!=t&&"object"==typeof t},Nn="[object String]";var jn=function(t){return"string"==typeof t||!In(t)&&An(t)&&mn(t)==Nn},wn="[object Number]";var Cn,Dn,Pn,Ln,Sn,Un,kn=function(t){return"number"==typeof t||An(t)&&mn(t)==wn},xn=/^([a-zA-Z0-9]|_|-)+$/,Mn=function(t){return kn(t)&&t>=0};!function(t){t.SDK="SDK",t.PREVIEW="PREVIEW"}(Cn||(Cn={})),function(t){t.BOOTSTRAP="Bootstrap",t.CHANGE_POSITION="ChangePosition",t.CLOSE_PREVIEW="ClosePreview",t.PREVIEW_LOADED="PreviewLoaded",t.SET_AVALIABLE_PORTALS="SetAvaliablePortals",t.SET_CONTENT="SetContent",t.SET_SELECTED_ELEMENT="SetSelectedElement",t.SET_VIEW_MODE="SetViewMode",t.ADD_ELEMENT="AddElement",t.REMOVE_ELEMENT="RemoveElement",t.UPDATE_ELEMENT="UpdateElement",t.SET_ELEMENT="SetElement"}(Dn||(Dn={})),function(t){t.ON_CLICK="OnClick"}(Pn||(Pn={})),function(t){t.NATIVE="Native",t.PENDO="Pendo"}(Ln||(Ln={})),function(t){t.NAVIGATE="Navigate",t.CHANGE_TUTORIAL="ChangeTutorial",t.OPEN_GUIDE="OpenGuide"}(Sn||(Sn={})),function(t){t.PRIMARY="primary",t.SECONDARY="primary",t.WARNING="warning",t.DANGER="danger",t.NEUTRAL="neutral",t.ACTIVE="active",t.INFO="info"}(Un||(Un={}));var Bn;Un.PRIMARY;!function(t){t.U="U",t.B="B",t.Em="Em",t.InlineCode="InlineCode"}(Bn||(Bn={}));var Gn,Vn,zn,Wn,Fn=function(t){return jn(e=t)&&e.length>=3&&e.length<100&&xn.test(e);var e};!function(t){t.COLLAPSED="Collapsed",t.EXPANDED="Expanded",t.MINIMIZED="Minimized"}(Gn||(Gn={})),function(t){t.TUTORIAL="Tutorial",t.PORTAL="Portal"}(Vn||(Vn={})),function(t){t.Global="Global",t.Organization="Organization"}(zn||(zn={})),function(t){t.Root="root",t.Rule="rule",t.Atrule="atrule",t.Decl="decl",t.Any="any"}(Wn||(Wn={}));var Yn,Hn=function(t){return"candu.sdk."+t},Kn=function(t){return Hn("error."+t)},$n={UNKOWN_NODE_TYPE:"unknown_node_type",UNKOWN_BLOCK_NODE_TYPE:"unkown_block_node_type",UNKOWN_INLINE_NODE_TYPE:"unkown_inline_node_type",UNKOWN_NODE_OBJECT_TYPE:"unkown_node_object_type",TUTORIAL_ERROR:"tutorial_error_boundary",PORTAL_ERROR:"portal_error_boundary",PROVIDER_ERROR:"provider_error_boundary",STYLEGUIDE_MAP_ERROR:"styleguide_map",RENDER_NODE_ERROR:"render_node"},Jn={HEARTBEAT:Hn("heartbeat"),PREVIEW_OPEN:Hn("preview.open"),PORTAL:Hn("portal"),TUTORIAL:Hn("tutorial"),TUTORIAL_INTERACTION:Hn("tutorial.interaction"),PORTAL_ASSET_NOT_FOUND:Kn("portal_asset_not_found"),PORTAL_NO_SEGMENT_IDS:Kn("portal_no_segment_ids"),NO_MATCHING_TUTORIALS:Kn("no_matching_tutorials"),NO_VALID_TUTORIAL_IDENTIFIER:Kn("no_valid_tutorial_identifier"),COMMIT_API_LOADING_ERROR:Kn("commit_api"),TUTORIAL_LOADING_ERROR:Kn("tutorial"),UNKOWN_NODE_TYPE:Kn($n.UNKOWN_NODE_TYPE),UNKOWN_INLINE_NODE_TYPE:Kn($n.UNKOWN_INLINE_NODE_TYPE),UNKOWN_NODE_OBJECT_TYPE:Kn($n.UNKOWN_NODE_OBJECT_TYPE),TUTORIAL_ERROR:Kn($n.TUTORIAL_ERROR),PORTAL_ERROR:Kn($n.PORTAL_ERROR),PROVIDER_ERROR:Kn($n.PROVIDER_ERROR),STYLEGUIDE_MAP_ERROR:Kn($n.TUTORIAL_ERROR),RENDER_NODE_ERROR:Kn($n.TUTORIAL_ERROR),CIRCULAR_DEPENDENCY_EMBED_PORTAL:Kn("circular_dependecy_embed_portal"),CIRCULAR_DEPENDENCY_EMBED_TUTORIAL:Kn("circular_dependecy_embed_tutorial")},Zn=function(t){return"An error has occured while trying to parse your Tutorial.\nUpgrade the SDK to the latest version to get rid of this error.\nErrorCode: "+t+"."},qn=((Yn={EVENTING_NOT_INITIALIZED:"You tried to send an event, but you haven't initialized eventing.\nThis is happening because you called eventing outside the scope of the CanduProvider. It can be fixed by:\n1. Adding CanduProvider to the root of the application.\n2. Initializing a new Eventing object outside of Candu.\nRead here for more context: http://udn.ac/tracking-not-init.\n"})[Jn.PORTAL_ASSET_NOT_FOUND]="Could not find the requested Portal. This could happen because:\n1. The Portal does not exist or it was deleted.\n2. The Portal has not been made avaliable to be rendered.\n3. CORS Authenticaton failed.\nSee http://udn.ac/portal-not-found for more information.\n",Yn[Jn.PORTAL_NO_SEGMENT_IDS]="You have tried to render a Portal that doesn't contain any content.\nAdd content to your Portal: https://udn.ac/update-portals.\n",Yn[Jn.NO_MATCHING_TUTORIALS]="The Tutorial will not be rendered because there are no matching segments for the given user.",Yn[Jn.NO_VALID_TUTORIAL_IDENTIFIER]="(Candu/Tutorial) You must define one of tutorialId, slug, commitId or contentHashId.",Yn[Jn.TUTORIAL_LOADING_ERROR]="An error has occurred while trying to load the Tutorial",Yn[Jn.UNKOWN_INLINE_NODE_TYPE]=Zn($n.UNKOWN_INLINE_NODE_TYPE),Yn[Jn.UNKOWN_NODE_TYPE]=Zn($n.UNKOWN_NODE_TYPE),Yn[Jn.CIRCULAR_DEPENDENCY_EMBED_PORTAL]="Circular dependency found on Embeded Portal. Please take a look at the Portal Content.",Yn[Jn.CIRCULAR_DEPENDENCY_EMBED_TUTORIAL]="Circular dependency found on Embeded Tutorial. Please take a look at the Tutorial Content.",Yn[Jn.PORTAL_ERROR]="An error has occured within Portal",Yn[Jn.PROVIDER_ERROR]="An error has occured within Provider",Yn[Jn.TUTORIAL_ERROR]="An error has occured within Tutorial",Yn[Jn.RENDER_NODE_ERROR]="An error has occured while rendering tutorial node",Yn[Jn.STYLEGUIDE_MAP_ERROR]="An error has occured while mapping node to styleguide",Yn),Xn={Alert:!0,B:!0,Badge:!0,Button:!0,Card:!0,Code:!0,Document:!0,Em:!0,EmbedPortal:!0,EmbedTutorial:!0,Flex:!0,FlexItem:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,Image:!0,InlineCode:!0,Link:!0,List:!0,ListItem:!0,P:!0,RichText:!0,Spacing:!0,Text:!0,U:!0,View:!0,Player:!0},Qn={error:console.error,warning:console.warn};for(var to=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r}}else{var n=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}})),eo=[],ro=0;ro<256;++ro)eo[ro]=(ro+256).toString(16).substr(1);var no=function(t,e){var r=e||0,n=eo;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")};var oo,io,ao=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||to)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||no(o)};!function(t){t.UserGenerated="UserGenerated",t.SDK="SDK"}(oo||(oo={})),function(t){t.Identify="Identify",t.Group="Group",t.Track="Track",t.Page="Page",t.Screen="Screen"}(io||(io={}));var uo,co,lo=function(){return"undefined"!=typeof window&&window.localStorage},so=function(t){return function(e){lo()&&null!=e&&window.localStorage.setItem(t,JSON.stringify(e))}},fo={anonymousId:{getOrCreate:(uo="candu:anonymous_id",co=function(){var t=ao();return so("candu:anonymous_id")(t),t},function(){return function(t){return function(){if(lo()){var e=window.localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(t){return null}}}}(uo)()||co()}),set:so("candu:anonymous_id")}}.anonymousId.getOrCreate,po=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,i,a,u],s=0;(c=new Error(e.replace(/%s/g,(function(){return l[s++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},vo=function(t){return po(!t||R(t),"(Candu) styleguide must be undefined or an object")};var ho="/api/segmentMemberships",_o="/api/segmentsDefinition",yo="/api/tutorialMetadata",bo="/api/tutorialDocumentsEditor",go="wss://2jcfb7pjlf.execute-api.eu-west-1.amazonaws.com/prod",Eo=function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:return[2,e.sent().json()]}}))}))},Oo=function(t){return Eo("https://api.candu.ai"+t)},To=function(t){return Eo("https://cdn.candu.ai"+t)},Ro={tutorialDocumentLatestSaved:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,Oo(bo+"/"+e+"?token="+t)]}))}))},portalAsset:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,To("/portals/"+t+"/"+e+"/head.json")]}))}))},segmentMembership:function(t,e){return n(void 0,void 0,void 0,(function(){return o(this,(function(r){return[2,Oo(ho+"/"+e+"?token="+t)]}))}))},segmentDefinition:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,Oo(_o+"?token="+t)]}))}))},tutorialMetadata:function(t){return n(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,Oo(yo+"?token="+t)]}))}))},tutorialSocket:function(t,e,r){var n=new WebSocket(go+"?clientToken="+t+"&tutorialId="+e);return n.onmessage=function(t){var e=JSON.parse(t.data);r(e)},function(){return n.close()}},tutorialDocument:function(t,e,r){var n,o=t.contentHashId,i=t.tutorialId,a=t.tutorialDocument,u=t.slug,c=function(t){return{byId:function(e){return Oo(bo+"?token="+t+"&finder=latestPublished&tutorialId="+e)},bySlug:function(e){return To("/tutorials/"+t+"/"+e+".json")},byContentHash:function(e){return To("/tutorials/"+t+"/"+e+".json")}}}(e);return Mn(i)?c.byId(i):Fn(u)?c.bySlug(u):jn(n=o)&&n.match(/^[0-9a-zA-Z]{40}$/)?c.byContentHash(o):R(a)?Promise.resolve(a):(Qn.error(qn[Jn.NO_VALID_TUTORIAL_IDENTIFIER]),r.track(Jn.NO_VALID_TUTORIAL_IDENTIFIER,{slug:t.slug}),null)}},mo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.error.apply(console,t)},Io=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.warn.apply(console,t)},Ao={error:mo,warning:Io},No=function(){function t(){this.subscribers=[]}return t.prototype.subscribe=function(t){var e=this;return this.subscribers.push(t),function(){e.subscribers[e.subscribers.indexOf(t)]=function(){}}},t.prototype.notify=function(t){this.subscribers.forEach((function(e){return e(t)}))},t.prototype.clear=function(){this.subscribers=[]},t}(),jo=function(){function t(){this.onClientUpdateObserver=new No}return t.prototype.attachClient=function(t){this.client=t,this.onClientUpdateObserver.notify({client:t})},t.prototype.detachClient=function(){this.client=null,this.onClientUpdateObserver.notify({client:null})},t.prototype.onClientUpdate=function(t){var e=this.onClientUpdateObserver.subscribe(t);return this.client&&t({client:this.client}),e},t}();var wo=function(){function t(t){this.init(t)}return t.prototype.attachClient=function(t){return this.provider.preview.attachClient(t)},t.prototype.detachClient=function(){return this.provider.preview.detachClient()},Object.defineProperty(t.prototype,"provider",{get:function(){return this.getProvider()},enumerable:!0,configurable:!0}),t}(),Co=function(t){switch(t.trigger){case Pn.ON_CLICK:default:return"onClick"}},Do=function(t,r){var n=t.data;if(!n||!n.actions)return{};var o=function(t){r.provider.eventing.track(Jn.TUTORIAL_INTERACTION,e(e({},t),r.trackingIdentifiers||{}))};return n.actions.map((function(t){return function(t,e){var r,n,o;switch(t.handler.type){case Sn.NAVIGATE:return(r={})[Co(t)]=function(){var r=t.handler,n=r.href,o=r.target;e(t),"Blank"===o?window.open(n,"_blank"):n&&n.includes("mailto:")?window.location=n:document.location.href=n},r;case Sn.CHANGE_TUTORIAL:return(n={})[Co(t)]=function(){var e=t.handler.tutorialId;mo("TODO -> change tutorial",e)},n;case Sn.OPEN_GUIDE:return(o={})[Co(t)]=function(){var e=t.handler.guideId;mo("TODO -> open guide",e)},o;default:return{}}}(t,o)})).reduce((function(t,r){return e(e({},t),r)}),{})},Po=function(t,r){try{var n=r.provider,o=r.document,i=r.trackingIdentifiers,a=o.nodes[t];if(!a)return Ao.error("Document is corrupted. Refusing to move further."),null;var u=function(t){return Po(t,r)},c=a.type,l=a.props,s=a.css,f=e(e(e({},l||{}),{style:s||{},children:(l||{}).children||a.nodes&&a.nodes.map(u)}),Do(a,{trackingIdentifiers:i,provider:n})),d={nodeId:t,node:a,document:o,render:{node:u,styleguide:function(t,e){return void 0===e&&(e={}),r.renderNode(t,{api:d,attributes:e})},tutorial:function(t){return r.renderTutorial(t)},portal:function(t){return r.renderPortal(t)}},trackingIdentifiers:i},p=d.render.styleguide(c,f);return p||(Ao.error(qn[Jn.UNKOWN_NODE_TYPE],{type:c}),n.eventing.track(Jn.UNKOWN_NODE_TYPE,{type:c}),null)}catch(t){return Ao.error(qn[Jn.STYLEGUIDE_MAP_ERROR],t),null}},Lo=wr((function(t,r){var n,o,i=t.provider,a=t.portal,u=t.tutorial,c=i.styleguide;return u&&(o=u.styleguide),a&&(n=a.styleguide),e(e(e(e({},c||{}),n||{}),o||{}),r||{})}));t.DEFAULT_ALERT_COLOR="#EDEDED",t.DEFAULT_ALT="",t.DEFAULT_TAB_ACTIVE_COLOR="#FEFEFE",t.DEFAULT_TAB_COLOR="#FEFEFE",t.DEFAULT_TAB_HEADER_COLOR="#333745",t.DEFAULT_TAB_ITEM_COLOR="#838792",t.ERROR_MESSAGES=qn,t.ERROR_SLUGS=$n,t.EVENT_NAMES=Jn,t.LOGGER=Qn,t.Observer=No,t.PreviewContainer=jo,t.RESOURCES=Ro,t.STYLEGUIDE_COLORS={primary:"#6310E5",secondary:"#59C3C3",tertiary:"#4D515D",warning:"#FCAD0D",danger:"#EE4266"},t.SingletonAPI=wo,t.TutorialDependencies=ln,t.adaptCustomNodes=function(t){return rn(t,(function(t){var r=t;return"Typography"===r.type&&(r=function(t){var r=Fr(t,"data.custom.variant","P");return e(e({},t),{type:r})}(r)),r.css&&R(r.css)&&r.css.flexBasis&&(r=function(t){var r=t.css.flexBasis;return"0"===r||"0px"===r?e(e({},t),{css:e(e({},t.css),{flexBasis:"0%"})}):t}(r)),r.css&&(r=un(r),r=cn(r)),r}))},t.attachStylesheet=function(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","https://cdn.candu.ai/styleguides/applications/"+t+"/default/main.css"),document.head.appendChild(e)},t.checkCyclicAndAdd=function(t,e){return t.dependencies.add(t.id,e)},t.convertStyleNumberValues=cn,t.createSingleton=function(t){var e,r,n=function(t){return function(){for(var e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r.api)return(e=r.api)[t].apply(e,n);console.warn("Please initialize the SDK by calling Candu.init() before attempting to call "+t)}};return(e=function(){function e(){}return e.init=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.api||(e.api=new(t.bind.apply(t,i([void 0],r)))),e.subscriberCallbacks.forEach((function(t){return t()})),e.subscriberCallbacks=[],window.postMessage({source:"CANDU_SINGLETON",payload:{type:"INIT"}},window&&window.origin?window.origin:"*"),e},e.onProviderReady=function(t){if(e.api)return t();e.subscriberCallbacks.push(t)},e}()).subscriberCallbacks=[],e.renderTutorial=n("renderTutorial"),e.renderPortal=n("renderPortal"),e.attachClient=n("attachClient"),e.detachClient=n("detachClient"),e.getProvider=n("getProvider"),r=e,window.Candu=r,r},t.createTutorialDocumentContext=function(t,e){return{id:t,dependencies:e?e.dependencies:new ln(t)}},t.defaultStyleguide=Xn,t.findMatchingSegment=function(t,r){var n=r.reduce((function(t,r){var n;return e(e({},t),((n={})[r]=r,n))}),{});return t.content.find((function(t){var e=t.segmentId;return!!n[e]||"Everyone"===e}))},t.internalEventing=function(t){var e=t.identify,r=t.track;return{provider:function(t){var n=t.userId,o=t.traits,i=t.styleguide;e(n,o),r(Jn.HEARTBEAT,function(t){var e={};return Object.keys(t).forEach((function(r){Xn[r]&&(e["styleguide."+r]=t[r].displayName||!0)})),e}(i))},tutorialDocumentLoadingError:function(t){var e=t.tutorialId,n=t.slug,o=t.contentHashId;Qn.error(qn[Jn.TUTORIAL_LOADING_ERROR]),r(Jn.TUTORIAL_LOADING_ERROR,{tutorialId:e,slug:n,contentHashId:o})}}},t.logError=mo,t.logWarning=Io,t.logger=Ao,t.mapNodeToStyleguide=Po,t.mergeStyleguidesFromContext=Lo,t.portalValidation=function(t){var e=t.slug,r=t.styleguide;return vo(r),{slug:e,styleguide:r||{}}},t.providerValidation=function(t){var n,o,i=t.clientToken,a=t.userId,u=t.traits,c=t.options,l=t.styleguide,s=r(t,["clientToken","userId","traits","options","styleguide"]);return po(jn(n=i)&&!!n.match(/^[0-9a-zA-Z]*$/)&&n.length>=10,"(Candu) you must provide a valid clientToken"),po(!a||(Mn(o=a)||jn(o)&&o.trim().length>0),"(Candu) you must provide a valid userId"),vo(l),po(!u||R(u),"(Candu) traits must be undefined or an object"),po(!c||R(c),"(Candu) options must be undefined or an object"),e(e({},s),{clientToken:i,traits:u||{},options:c||{},styleguide:l||{},userId:a||fo()})},t.tutorialValidation=function(t){var n=t.slug,o=t.styleguide,i=t.contentHashId,a=t.tutorialId,u=t.tutorialDocument,c=t.renderedByClient,l=r(t,["slug","styleguide","contentHashId","tutorialId","tutorialDocument","renderedByClient"]);return vo(o),e(e({},l),{slug:n,styleguide:o||{},contentHashId:i,tutorialId:a,tutorialDocument:u,renderedByClient:c})},t.unpackShorthandStyles=un,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
import { PreviewClient } from './types'; | ||
import { Observer, ObserverSubscriber } from '../utils'; | ||
export declare class PreviewContainer { | ||
clientSubscribers: any[]; | ||
clientSubscriberCleanup: any[]; | ||
onClientUpdateObserver: Observer<{ | ||
client: PreviewClient | null; | ||
}>; | ||
client: PreviewClient | null; | ||
attachClient(client: PreviewClient): void; | ||
detachClient(): void; | ||
onClientReady(subscriber: (client: PreviewClient) => void): void; | ||
private notifyClientIsReady; | ||
private notifySubscriber; | ||
private cleanupSubscribers; | ||
onClientUpdate(subscriber: ObserverSubscriber<this['onClientUpdateObserver']>): import("../utils").ObserverUnsubscriber; | ||
} |
export * from './logger'; | ||
export * from './Observer'; |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.6.0-alpha.1", | ||
"version": "0.6.0-alpha.2", | ||
"main": "dist/index.js", | ||
@@ -31,3 +31,3 @@ "module": "dist/index.es.js", | ||
}, | ||
"gitHead": "90de6a16e291bde2835f03227f858ce94289f86f" | ||
"gitHead": "a206ef431b69fe84ae740619f90980c668e0dc0d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
871197
56
1030
3