@pendo/agent 2.283.0 → 2.285.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debugger-plugin.min.js +4 -1
- package/dist/dom.esm.js +9 -19
- package/dist/pendo.debugger.min.js +17 -50
- package/dist/pendo.module.js +727 -4671
- package/dist/pendo.module.min.js +11 -11
- package/dist/pendo.preview.min.js +8 -44
- package/dist/replay.worker.min.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";class t{constructor(t,e){this.path=t,this.handler=e}}class e{routes={};addRoute(e,n){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new t(e,n))}removeRoute(t){this.routes[t].shift()}lookupRouteProvider(){return t=>this.routes[t]?this.routes[t][0].handler:void 0}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=Array.isArray,i="object"==typeof n&&n&&n.Object===Object&&n,a=i,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),u=c.Symbol,d=u,l=Object.prototype,p=l.hasOwnProperty,f=l.toString,h=d?d.toStringTag:void 0;var g=function(t){var e=p.call(t,h),n=t[h];try{t[h]=void 0;var r=!0}catch(t){}var o=f.call(t);return r&&(e?t[h]=n:delete t[h]),o},v=Object.prototype.toString;var b=g,y=function(t){return v.call(t)},m=u?u.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?b(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},_=w,T=j;var P=function(t){return"symbol"==typeof t||T(t)&&"[object Symbol]"==_(t)},O=o,I=P,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var E=function(t,e){if(O(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!I(t))||(C.test(t)||!A.test(t)||null!=e&&t in Object(e))};var S=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},x=w,R=S;var z,N=function(t){if(!R(t))return!1;var e=x(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=r(N),M=c["__core-js_shared__"],$=(z=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var H=function(t){return!!$&&$ in t},k=Function.prototype.toString;var W=function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""},L=N,U=H,F=S,G=W,B=/^\[object .+?Constructor\]$/,q=Function.prototype,Q=Object.prototype,V=q.toString,K=Q.hasOwnProperty,J=RegExp("^"+V.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var X=function(t){return!(!F(t)||U(t))&&(L(t)?J:B).test(G(t))},Y=function(t,e){return null==t?void 0:t[e]};var Z=function(t,e){var n=Y(t,e);return X(n)?n:void 0},tt=Z(Object,"create"),et=tt;var nt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot=tt,it=Object.prototype.hasOwnProperty;var at=function(t){var e=this.__data__;if(ot){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return it.call(e,t)?e[t]:void 0},st=tt,ct=Object.prototype.hasOwnProperty;var ut=tt;var dt=nt,lt=rt,pt=at,ft=function(t){var e=this.__data__;return st?void 0!==e[t]:ct.call(e,t)},ht=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function gt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}gt.prototype.clear=dt,gt.prototype.delete=lt,gt.prototype.get=pt,gt.prototype.has=ft,gt.prototype.set=ht;var vt=gt;var bt=function(){this.__data__=[],this.size=0};var yt=function(t,e){return t===e||t!=t&&e!=e},mt=yt;var wt=function(t,e){for(var n=t.length;n--;)if(mt(t[n][0],e))return n;return-1},jt=wt,_t=Array.prototype.splice;var Tt=wt;var Pt=wt;var Ot=wt;var It=bt,At=function(t){var e=this.__data__,n=jt(e,t);return!(n<0)&&(n==e.length-1?e.pop():_t.call(e,n,1),--this.size,!0)},Ct=function(t){var e=this.__data__,n=Tt(e,t);return n<0?void 0:e[n][1]},Et=function(t){return Pt(this.__data__,t)>-1},St=function(t,e){var n=this.__data__,r=Ot(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xt.prototype.clear=It,xt.prototype.delete=At,xt.prototype.get=Ct,xt.prototype.has=Et,xt.prototype.set=St;var Rt=xt,zt=Z(c,"Map"),Nt=vt,Dt=Rt,Mt=zt;var $t=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Ht=function(t,e){var n=t.__data__;return $t(e)?n["string"==typeof e?"string":"hash"]:n.map},kt=Ht;var Wt=Ht;var Lt=Ht;var Ut=Ht;var Ft=function(){this.size=0,this.__data__={hash:new Nt,map:new(Mt||Dt),string:new Nt}},Gt=function(t){var e=kt(this,t).delete(t);return this.size-=e?1:0,e},Bt=function(t){return Wt(this,t).get(t)},qt=function(t){return Lt(this,t).has(t)},Qt=function(t,e){var n=Ut(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Vt.prototype.clear=Ft,Vt.prototype.delete=Gt,Vt.prototype.get=Bt,Vt.prototype.has=qt,Vt.prototype.set=Qt;var Kt=Vt,Jt=Kt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Xt.Cache||Jt),n}Xt.Cache=Jt;var Yt=Xt;var Zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/\\(\\)?/g,ee=function(t){var e=Yt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Zt,(function(t,n,r,o){e.push(r?o.replace(te,"$1"):n||t)})),e}));var ne=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},re=ne,oe=o,ie=P,ae=u?u.prototype:void 0,se=ae?ae.toString:void 0;var ce=function t(e){if("string"==typeof e)return e;if(oe(e))return re(e,t)+"";if(ie(e))return se?se.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n},ue=ce;var de=function(t){return null==t?"":ue(t)},le=o,pe=E,fe=ee,he=de;var ge=function(t,e){return le(t)?t:pe(t,e)?[t]:fe(he(t))},ve=P;var be=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},ye=ge,me=be;var we=function(t,e){for(var n=0,r=(e=ye(e,t)).length;null!=t&&n<r;)t=t[me(e[n++])];return n&&n==r?t:void 0},je=we;var _e=r((function(t,e,n){var r=null==t?void 0:je(t,e);return void 0===r?n:r}));class Te{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(t,e={}){this.app=t,this.router=t.router,this.config=e,this.events=t.PluginAPI.getEventable()}getConfig(t,e){return _e(this.config,t,e)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var Pe={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},Oe=2147483647,Ie={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:Ae,MIN_WIDTH:Ce,WINDOW_MARGIN:Ee}=Ie;function Se(t,e,n,r,o){let i=0,a=0,s=0,c=0;function u(n){n.preventDefault(),e.css({visibility:"hidden"}),t.releasePointerCapture(n.pointerId),t.removeEventListener("pointermove",d),o()}function d(t){-1===t.button&&0!==t.buttons?(t.preventDefault(),s=i-t.clientX,c=a-t.clientY,i=t.clientX,a=t.clientY,r(s,c)):u(t)}t.addEventListener("pointerdown",(function(r){if(0!==r.button)return;r.preventDefault(),e.css({visibility:"visible"}),i=r.clientX,a=r.clientY,t.setPointerCapture(r.pointerId),t.addEventListener("pointermove",d),n()})),t.addEventListener("pointerup",u),t.addEventListener("pointerout",u)}function xe(t,e){const n=t.offsetLeft-e,r=window.innerWidth-t.offsetWidth-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function Re(t,e){const n=t.offsetTop-e,r=window.innerHeight-t.offsetHeight-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function ze(t,e){const n=t.offsetWidth-e,r=window.innerWidth-t.offsetLeft-Ee;return n>r?r:n<Ce?Ce:n}function Ne(t,e){const n=t.offsetHeight-e,r=window.innerHeight-t.offsetTop-Ee;return n>r?r:n<Ae?Ae:n}class De extends Te{type="frame";destination=window.parent||window.top;origin=window.location.origin;constructor(t,e){super(t,e);const{pendo:n,PluginAPI:r}=t,o=this.getConfig("containerId","pendo-client-app");this.container=n.dom(`<div id="${o}" class="pendo-ignore">`).css({...Pe,height:t.state.height,width:t.state.width,"z-index":Oe-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=n.dom('<div id="pendo-app-draggable-handle">').css({...Pe,"z-index":Oe,height:Ie.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",(()=>{t.state.minimized||(this.container.css({height:Ie.HEIGHT,width:Ie.WIDTH,transition:"all 250ms linear"}),setTimeout((()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())}),250))})).appendTo(this.container),this.resizeHandle=n.dom('<div id="pendo-app-resize-handle">').css({...Pe,"z-index":Oe,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=n.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...Pe,height:"100%",width:"100%"}).on("load",(()=>{if(r.ConfigReader.get("inlineStyleNonce")){const t=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...n)=>{const o=t(e,...n);if("style"===e){const t=r.ConfigReader.get("inlineStyleNonce");t&&o.setAttribute("nonce",t)}return o}}const e=document.createElement("script");var o;e.src=(o=n,o&&o.trustedTypesPolicy?o.trustedTypesPolicy:{createScriptURL:t=>t}).createScriptURL(r.getAssetUrl(t.assetName)),this.frame[0].contentDocument.body.appendChild(e),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()})).appendTo(this.container),this.blockout=n.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":Oe-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(n.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=t=>{let{left:e,top:n,height:r}=t;const{minimized:o,width:i}=t;e=e||Ie.LEFT,n=n||Ie.TOP,r=o?Ie.HEADER_HEIGHT:r,e=xe({offsetLeft:e,offsetWidth:i},0),n=Re({offsetTop:n,offsetHeight:r},0),this.container.css({left:e,top:n,height:r}),this.savePosition()},this.saveSize=()=>{const{offsetHeight:t,offsetWidth:e}=this.container[0];t&&e&&this.app.setProperties({height:t,width:e})},this.savePosition=()=>{const{offsetLeft:t,offsetTop:e}=this.container[0];t&&e&&this.app.setProperties({left:t,top:e})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),function(t,e){const n=t.handle[0],r=t.container[0];Se(n,t.blockout,(function(){n.style.cursor="grabbing"}),(function(t,e){r.style.left=`${xe(r,t)}px`,r.style.top=`${Re(r,e)}px`}),(function(){n.style.cursor="grab",e()}))}(this,this.savePosition),function(t,e){const n=t.resizeHandle[0],r=t.container[0];Se(n,t.blockout,(()=>{}),(function(t,e){r.style.width=`${ze(r,t)}px`,r.style.height=`${Ne(r,e)}px`}),e)}(this,this.saveSize),window.addEventListener("resize",s),this.listeners=[["resize",s]];const i=n._.throttle((()=>function(t){const e=t.offsetLeft+t.offsetWidth+Ee-window.innerWidth;e>0&&(t.style.left=`${xe(t,e)}px`,t.offsetWidth>Ce&&(t.style.width=`${ze(t,e)}px`));const n=t.offsetTop+t.offsetHeight+Ee-window.innerHeight;n>0&&(t.style.top=`${Re(t,n)}px`,t.offsetHeight>Ae&&(t.style.height=`${Ne(t,n)}px`))}(this.container[0])),10),a=n._.debounce((()=>{this.savePosition(),this.saveSize()}),1e3);function s(){i(),a()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach((([t,e])=>window.removeEventListener(t,e))),this.elements.forEach((t=>t.remove())),this.triggerClosed()}}var Me=c,$e=/\s/;var He=function(t){for(var e=t.length;e--&&$e.test(t.charAt(e)););return e},ke=/^\s+/;var We=function(t){return t?t.slice(0,He(t)+1).replace(ke,""):t},Le=S,Ue=P,Fe=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Be=/^0o[0-7]+$/i,qe=parseInt;var Qe=S,Ve=function(){return Me.Date.now()},Ke=function(t){if("number"==typeof t)return t;if(Ue(t))return NaN;if(Le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=Ge.test(t);return n||Be.test(t)?qe(t.slice(2),n?2:8):Fe.test(t)?NaN:+t},Je=Math.max,Xe=Math.min;var Ye=function(t,e,n){var r,o,i,a,s,c,u=0,d=!1,l=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=r,i=o;return r=o=void 0,u=e,a=t.apply(i,n)}function h(t){var n=t-c;return void 0===c||n>=e||n<0||l&&t-u>=i}function g(){var t=Ve();if(h(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-c);return l?Xe(n,i-(t-u)):n}(t))}function v(t){return s=void 0,p&&r?f(t):(r=o=void 0,a)}function b(){var t=Ve(),n=h(t);if(r=arguments,o=this,c=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),d?f(t):a}(c);if(l)return clearTimeout(s),s=setTimeout(g,e),f(c)}return void 0===s&&(s=setTimeout(g,e)),a}return e=Ke(e)||0,Qe(n)&&(d=!!n.leading,i=(l="maxWait"in n)?Je(Ke(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},b.flush=function(){return void 0===s?a:v(Ve())},b},Ze=Ye,tn=S;var en=r((function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return tn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(t,e,{leading:r,maxWait:e,trailing:o})})),nn=de,rn=0;var on=r((function(t){var e=++rn;return nn(t)+e})),an=Rt;var sn=Rt,cn=zt,un=Kt;var dn=Rt,ln=function(){this.__data__=new an,this.size=0},pn=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},fn=function(t){return this.__data__.get(t)},hn=function(t){return this.__data__.has(t)},gn=function(t,e){var n=this.__data__;if(n instanceof sn){var r=n.__data__;if(!cn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new un(r)}return n.set(t,e),this.size=n.size,this};function vn(t){var e=this.__data__=new dn(t);this.size=e.size}vn.prototype.clear=ln,vn.prototype.delete=pn,vn.prototype.get=fn,vn.prototype.has=hn,vn.prototype.set=gn;var bn=vn;var yn=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},mn=Z,wn=function(){try{var t=mn(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),jn=wn;var _n=function(t,e,n){"__proto__"==e&&jn?jn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Tn=_n,Pn=yt,On=Object.prototype.hasOwnProperty;var In=function(t,e,n){var r=t[e];On.call(t,e)&&Pn(r,n)&&(void 0!==n||e in t)||Tn(t,e,n)},An=In,Cn=_n;var En=function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=r?r(n[s],t[s],s,n,t):void 0;void 0===c&&(c=t[s]),o?Cn(n,s,c):An(n,s,c)}return n};var Sn=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},xn=w,Rn=j;var zn=function(t){return Rn(t)&&"[object Arguments]"==xn(t)},Nn=j,Dn=Object.prototype,Mn=Dn.hasOwnProperty,$n=Dn.propertyIsEnumerable,Hn=zn(function(){return arguments}())?zn:function(t){return Nn(t)&&Mn.call(t,"callee")&&!$n.call(t,"callee")},kn=Hn,Wn={exports:{}};var Ln=function(){return!1};!function(t,e){var n=c,r=Ln,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s}(Wn,Wn.exports);var Un=Wn.exports,Fn=/^(?:0|[1-9]\d*)$/;var Gn=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Fn.test(t))&&t>-1&&t%1==0&&t<e};var Bn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},qn=w,Qn=Bn,Vn=j,Kn={};Kn["[object Float32Array]"]=Kn["[object Float64Array]"]=Kn["[object Int8Array]"]=Kn["[object Int16Array]"]=Kn["[object Int32Array]"]=Kn["[object Uint8Array]"]=Kn["[object Uint8ClampedArray]"]=Kn["[object Uint16Array]"]=Kn["[object Uint32Array]"]=!0,Kn["[object Arguments]"]=Kn["[object Array]"]=Kn["[object ArrayBuffer]"]=Kn["[object Boolean]"]=Kn["[object DataView]"]=Kn["[object Date]"]=Kn["[object Error]"]=Kn["[object Function]"]=Kn["[object Map]"]=Kn["[object Number]"]=Kn["[object Object]"]=Kn["[object RegExp]"]=Kn["[object Set]"]=Kn["[object String]"]=Kn["[object WeakMap]"]=!1;var Jn=function(t){return Vn(t)&&Qn(t.length)&&!!Kn[qn(t)]};var Xn=function(t){return function(e){return t(e)}},Yn={exports:{}};!function(t,e){var n=i,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,a=o&&o.exports===r&&n.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}(Yn,Yn.exports);var Zn=Yn.exports,tr=Jn,er=Xn,nr=Zn&&Zn.isTypedArray,rr=nr?er(nr):tr,or=Sn,ir=kn,ar=o,sr=Un,cr=Gn,ur=rr,dr=Object.prototype.hasOwnProperty;var lr=function(t,e){var n=ar(t),r=!n&&ir(t),o=!n&&!r&&sr(t),i=!n&&!r&&!o&&ur(t),a=n||r||o||i,s=a?or(t.length,String):[],c=s.length;for(var u in t)!e&&!dr.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||cr(u,c))||s.push(u);return s},pr=Object.prototype;var fr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pr)};var hr=function(t,e){return function(n){return t(e(n))}},gr=hr(Object.keys,Object),vr=fr,br=gr,yr=Object.prototype.hasOwnProperty;var mr=N,wr=Bn;var jr=function(t){return null!=t&&wr(t.length)&&!mr(t)},_r=lr,Tr=function(t){if(!vr(t))return br(t);var e=[];for(var n in Object(t))yr.call(t,n)&&"constructor"!=n&&e.push(n);return e},Pr=jr;var Or=function(t){return Pr(t)?_r(t):Tr(t)},Ir=En,Ar=Or;var Cr=function(t,e){return t&&Ir(e,Ar(e),t)};var Er=S,Sr=fr,xr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Rr=Object.prototype.hasOwnProperty;var zr=lr,Nr=function(t){if(!Er(t))return xr(t);var e=Sr(t),n=[];for(var r in t)("constructor"!=r||!e&&Rr.call(t,r))&&n.push(r);return n},Dr=jr;var Mr=function(t){return Dr(t)?zr(t,!0):Nr(t)},$r=En,Hr=Mr;var kr=function(t,e){return t&&$r(e,Hr(e),t)},Wr={exports:{}};!function(t,e){var n=c,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}}(Wr,Wr.exports);var Lr=Wr.exports;var Ur=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e};var Fr=function(){return[]},Gr=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i},Br=Fr,qr=Object.prototype.propertyIsEnumerable,Qr=Object.getOwnPropertySymbols,Vr=Qr?function(t){return null==t?[]:(t=Object(t),Gr(Qr(t),(function(e){return qr.call(t,e)})))}:Br,Kr=En,Jr=Vr;var Xr=function(t,e){return Kr(t,Jr(t),e)};var Yr=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Zr=hr(Object.getPrototypeOf,Object),to=Yr,eo=Zr,no=Vr,ro=Fr,oo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)to(e,no(t)),t=eo(t);return e}:ro,io=En,ao=oo;var so=function(t,e){return io(t,ao(t),e)},co=Yr,uo=o;var lo=function(t,e,n){var r=e(t);return uo(t)?r:co(r,n(t))},po=lo,fo=Vr,ho=Or;var go=function(t){return po(t,ho,fo)},vo=lo,bo=oo,yo=Mr;var mo=function(t){return vo(t,yo,bo)},wo=Z(c,"DataView"),jo=zt,_o=Z(c,"Promise"),To=Z(c,"Set"),Po=Z(c,"WeakMap"),Oo=w,Io=W,Ao="[object Map]",Co="[object Promise]",Eo="[object Set]",So="[object WeakMap]",xo="[object DataView]",Ro=Io(wo),zo=Io(jo),No=Io(_o),Do=Io(To),Mo=Io(Po),$o=Oo;(wo&&$o(new wo(new ArrayBuffer(1)))!=xo||jo&&$o(new jo)!=Ao||_o&&$o(_o.resolve())!=Co||To&&$o(new To)!=Eo||Po&&$o(new Po)!=So)&&($o=function(t){var e=Oo(t),n="[object Object]"==e?t.constructor:void 0,r=n?Io(n):"";if(r)switch(r){case Ro:return xo;case zo:return Ao;case No:return Co;case Do:return Eo;case Mo:return So}return e});var Ho=$o,ko=Object.prototype.hasOwnProperty;var Wo=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ko.call(t,"index")&&(n.index=t.index,n.input=t.input),n},Lo=c.Uint8Array;var Uo=function(t){var e=new t.constructor(t.byteLength);return new Lo(e).set(new Lo(t)),e},Fo=Uo;var Go=function(t,e){var n=e?Fo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},Bo=/\w*$/;var qo=function(t){var e=new t.constructor(t.source,Bo.exec(t));return e.lastIndex=t.lastIndex,e},Qo=u?u.prototype:void 0,Vo=Qo?Qo.valueOf:void 0;var Ko=Uo;var Jo=Uo,Xo=Go,Yo=qo,Zo=function(t){return Vo?Object(Vo.call(t)):{}},ti=function(t,e){var n=e?Ko(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var ei=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Jo(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Xo(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ti(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return Yo(t);case"[object Symbol]":return Zo(t)}},ni=S,ri=Object.create,oi=function(){function t(){}return function(e){if(!ni(e))return{};if(ri)return ri(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),ii=Zr,ai=fr;var si=function(t){return"function"!=typeof t.constructor||ai(t)?{}:oi(ii(t))},ci=Ho,ui=j;var di=function(t){return ui(t)&&"[object Map]"==ci(t)},li=Xn,pi=Zn&&Zn.isMap,fi=pi?li(pi):di,hi=Ho,gi=j;var vi=function(t){return gi(t)&&"[object Set]"==hi(t)},bi=Xn,yi=Zn&&Zn.isSet,mi=yi?bi(yi):vi,wi=bn,ji=yn,_i=In,Ti=Cr,Pi=kr,Oi=Lr,Ii=Ur,Ai=Xr,Ci=so,Ei=go,Si=mo,xi=Ho,Ri=Wo,zi=ei,Ni=si,Di=o,Mi=Un,$i=fi,Hi=S,ki=mi,Wi=Or,Li=Mr,Ui="[object Arguments]",Fi="[object Function]",Gi="[object Object]",Bi={};Bi[Ui]=Bi["[object Array]"]=Bi["[object ArrayBuffer]"]=Bi["[object DataView]"]=Bi["[object Boolean]"]=Bi["[object Date]"]=Bi["[object Float32Array]"]=Bi["[object Float64Array]"]=Bi["[object Int8Array]"]=Bi["[object Int16Array]"]=Bi["[object Int32Array]"]=Bi["[object Map]"]=Bi["[object Number]"]=Bi[Gi]=Bi["[object RegExp]"]=Bi["[object Set]"]=Bi["[object String]"]=Bi["[object Symbol]"]=Bi["[object Uint8Array]"]=Bi["[object Uint8ClampedArray]"]=Bi["[object Uint16Array]"]=Bi["[object Uint32Array]"]=!0,Bi["[object Error]"]=Bi[Fi]=Bi["[object WeakMap]"]=!1;var qi=function t(e,n,r,o,i,a){var s,c=1&n,u=2&n,d=4&n;if(r&&(s=i?r(e,o,i,a):r(e)),void 0!==s)return s;if(!Hi(e))return e;var l=Di(e);if(l){if(s=Ri(e),!c)return Ii(e,s)}else{var p=xi(e),f=p==Fi||"[object GeneratorFunction]"==p;if(Mi(e))return Oi(e,c);if(p==Gi||p==Ui||f&&!i){if(s=u||f?{}:Ni(e),!c)return u?Ci(e,Pi(s,e)):Ai(e,Ti(s,e))}else{if(!Bi[p])return i?e:{};s=zi(e,p,c)}}a||(a=new wi);var h=a.get(e);if(h)return h;a.set(e,s),ki(e)?e.forEach((function(o){s.add(t(o,n,r,o,e,a))})):$i(e)&&e.forEach((function(o,i){s.set(i,t(o,n,r,i,e,a))}));var g=l?void 0:(d?u?Si:Ei:u?Li:Wi)(e);return ji(g||e,(function(o,i){g&&(o=e[i=o]),_i(s,i,t(o,n,r,i,e,a))})),s};var Qi=function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i},Vi=we,Ki=Qi;var Ji=ge,Xi=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},Yi=function(t,e){return e.length<2?t:Vi(t,Ki(e,0,-1))},Zi=be;var ta=function(t,e){return e=Ji(e,t),null==(t=Yi(t,e))||delete t[Zi(Xi(e))]},ea=w,na=Zr,ra=j,oa=Function.prototype,ia=Object.prototype,aa=oa.toString,sa=ia.hasOwnProperty,ca=aa.call(Object);var ua=function(t){if(!ra(t)||"[object Object]"!=ea(t))return!1;var e=na(t);if(null===e)return!0;var n=sa.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&aa.call(n)==ca};var da=function(t){return ua(t)?void 0:t},la=kn,pa=o,fa=u?u.isConcatSpreadable:void 0;var ha=Yr,ga=function(t){return pa(t)||la(t)||!!(fa&&t&&t[fa])};var va=function t(e,n,r,o,i){var a=-1,s=e.length;for(r||(r=ga),i||(i=[]);++a<s;){var c=e[a];n>0&&r(c)?n>1?t(c,n-1,r,o,i):ha(i,c):o||(i[i.length]=c)}return i},ba=va;var ya=function(t){return(null==t?0:t.length)?ba(t,1):[]};var ma=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},wa=Math.max;var ja=function(t,e,n){return e=wa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=wa(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),ma(t,this,s)}};var _a=function(t){return t},Ta=function(t){return function(){return t}},Pa=wn,Oa=Pa?function(t,e){return Pa(t,"toString",{configurable:!0,enumerable:!1,value:Ta(e),writable:!0})}:_a,Ia=Date.now;var Aa=function(t){var e=0,n=0;return function(){var r=Ia(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},Ca=Aa(Oa),Ea=ya,Sa=ja,xa=Ca;var Ra=ne,za=qi,Na=ta,Da=ge,Ma=En,$a=da,Ha=mo,ka=r(function(t){return xa(Sa(t,void 0,Ea),t+"")}((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ra(e,(function(e){return e=Da(e,t),r||(r=e.length>1),e})),Ma(t,Ha(t),n),r&&(n=za(n,7,$a));for(var o=e.length;o--;)Na(n,e[o]);return n})));const Wa="promise";function La(t,e,n){this.name=t,this.type=e,this.data=n}La.prototype.toString=function(){return`Message.${this.type} - ${this.name}`};const Ua=t=>{try{const{name:e,type:n,isResponse:r,data:o,requestId:i,sender:a}=t.data||{},s=new La(e,n,null!=o?JSON.parse(o):void 0);return s.requestId=i,s.sender=a,s.destination=t.source,s.isResponse=r,s}catch(t){return!1}},Fa=t=>(t.isResponse=!0,t),Ga=(...t)=>e=>[].concat(t).reduce(((t,n,r,o)=>{const i=n(t,e);return i||o.splice(r,o.length-r),i}),e);var Ba=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var c=a[t?s:++o];if(!1===n(i[c],c,i))break}return e}}(),qa=Or;var Qa=jr;var Va=function(t,e){return function(n,r){if(null==n)return n;if(!Qa(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}((function(t,e){return t&&Ba(t,e,qa)})),Ka=_a;var Ja=yn,Xa=Va,Ya=function(t){return"function"==typeof t?t:Ka},Za=o;var ts=r((function(t,e){return(Za(t)?Ja:Xa)(t,Ya(e))}));const es="disconnected",ns={lastMessageReceivedAt:0,currentConnectionQuality:es,changeCallbacks:{},evalCallbacks:{}},rs=t=>{t!==ns.currentConnectionQuality&&(ns.currentConnectionQuality=t,ts(ns.changeCallbacks,(t=>{t(ns.currentConnectionQuality)})))},os=()=>{if(0===ns.lastMessageReceivedAt)return void rs(es);const t=Date.now()-ns.lastMessageReceivedAt;t<1e4?rs("connected"):(t=>t>1e4)(t)&&((t=>t>3e4)(t)?rs("dead_connection"):rs(es)),ts(ns.evalCallbacks,(t=>{t(ns.currentConnectionQuality)}))};let is;let as=0;const ss=()=>{ns.currentConnectionQuality=es,ns.lastMessageReceivedAt=0},cs={appName:void 0,connectionName:void 0,frameId:void 0,pendingRequests:{},topics:{},senderIds:{},originProvider:void 0,destinationProvider:void 0},us=()=>`${cs.appName}${cs.connectionName}(${cs.frameId})`,ds=t=>{t.sender||(t.sender=us());const e=t.destination||cs.destinationProvider(),n=(t=>{const e=ka(t,["destination","toString","data"]);return e.data=JSON.stringify(t.data,((t,e)=>"function"==typeof e||e instanceof RegExp?e.toString?e.toString():void 0:e)),e})(t),r=fs(t.sender),o=hs(t.sender);if(r||o)r?r.postMessage(n):e.postMessage(n,cs.originProvider());else{const r=new MessageChannel;_s(r.port1,t.sender),e.postMessage(n,cs.originProvider(),[r.port2])}},ls=(t,e,n=1e3)=>new Promise(((r,o)=>{const i=((t,e,n)=>{const r=new La(t,e,n);return e===Wa&&(r.requestId=on()),r})(t,Wa,e),a=setTimeout((()=>{o(`${t} timeout`),vs(i),Ps(i)}),n);gs(i,(()=>clearTimeout(a)),r,o),ds(i)})),ps=t=>(cs.senderIds[t]||(t=>{cs.senderIds[t]||(cs.senderIds[t]={port:void 0,hasTriedToUpgradeToMessageChannel:!1})})(t),cs.senderIds[t]),fs=t=>ps(t).port,hs=t=>ps(t).hasTriedToUpgradeToMessageChannel,gs=(t,e,n,r)=>{cs.pendingRequests[t.requestId]={message:t,clearTimeoutfn:e,resolve:n,reject:r}},vs=t=>{const{requestId:e}=t;return cs.pendingRequests[e].clearTimeoutfn(),delete cs.pendingRequests[e],t},bs="message::ping",ys=Ga((t=>{const e=cs.pendingRequests[t.requestId];return e&&(e.resolve(t.data),vs(t)),t}),(t=>{const e=cs.topics[t.name];return e&&e.forEach((e=>e(t.data))),t}),(t=>{if(!t)return t;if(t.isResponse)return t;if(t.name===bs)return ds(Fa(t)),t;const e=cs.routeHandlerLookup(t.name);if(e){const n=e=>{t.data=e,ds(Fa(t))};e(t,n)}else console.log(us(),`No route handler for ${t.name}`,t);return t}),(ms=()=>{((t=Date.now())=>{ns.lastMessageReceivedAt=t})()},(t,...e)=>(ms(t,...e),t)));var ms;const ws=t=>("*"===cs.originProvider()||t.origin===cs.originProvider())&&t,js=t=>{const e=_e(t,"data.sender");return!(!e||"string"!=typeof e)&&(!!e.includes(cs.appName)&&t)},_s=(t,e)=>{const n=ps(e);n.port=t,n.hasTriedToUpgradeToMessageChannel=!0,n.port.onmessage=Ga(Ua,ys)},Ts=(t,e)=>(!ps(t.sender).hasTriedToUpgradeToMessageChannel&&e.ports&&e.ports[0]&&_s(e.ports[0],t.sender),t),Ps=t=>{(t=>{const e=ps(t);e.port=void 0,e.hasTriedToUpgradeToMessageChannel=!1})(t.sender)};let Os=()=>{};const Is=()=>{Os(),Os=()=>{},is&&is(),ss()},As=en((t=>{"connected"!==t&&cs.usePingAutoReconnect&&ls(bs).catch((()=>{console.log("message::ping timedout")}))}),1e3),Cs=(t,e,n,r,o,i=!1,a)=>{if(!window.addEventListener)return;cs.appName=t,cs.frameId=e,cs.routeHandlerLookup=n,cs.usePingAutoReconnect=i,cs.connectionName=a||"",cs.originProvider=r||(()=>window.location.origin||"*"),cs.destinationProvider=o||(()=>window.parent||window.top),((t={})=>{const e=setInterval(os,100);is=()=>clearInterval(e)})(),(t=>{if(!D(t))return;const e=as++;ns.evalCallbacks[e]=t})(As);const s=Ga(ws,js,Ua,Ts,ys);window.addEventListener("message",s),Os=()=>window.removeEventListener("message",s)},Es=t=>{(t=>{if(!D(t))return;const e=as++;ns.changeCallbacks[e]=t})(t)};function Ss(){return(new Date).getTime()}class xs extends Te{type="window";testUrl="";realUrl=void 0;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",(()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()})),this.testConnection().then((()=>{this.triggerOpened()})).catch((()=>{return this.createWindow(),t=this.app,e=1e3,new Promise(((n,r)=>{const o=Ss(),i=()=>{t.getConnectionStatus()?n():Ss()-o>e?r():setTimeout(i,50)};i()}));var t,e}))}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),ls("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));const t=document.createElement("script");t.src=this.app.PluginAPI.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(t),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const Rs=()=>({});class zs{defaultState={containerType:"frame",minimized:!1,height:500,width:500,left:100,top:100};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(t,n,r,o,i,a=Rs,s=Rs){this.appName=t,this.assetName=n,this.assetStorageKey=r,this.connectionName=o,this.frameConfigProvider=a,this.windowConfigProvider=s,i&&Object.assign(this.defaultState,i),this.router=new e}init(t,e){this.pendo=t,this.PluginAPI=e,this.events=e.getEventable(),this.router.addRoute("app::ping",((t,e)=>{e()})),this.router.addRoute("app::setProperties",(({data:t})=>{this.setProperties(t)})),this.router.addRoute("app::toggleContainer",(()=>{this.setProperties({minimized:!1}),this.toggleContainerType()})),this.router.addRoute("app::windowClosed",(()=>{})),this.loadState(),this.prepContainer()}prepContainer(){this.container="window"===this.state.containerType?new xs(this,this.windowConfigProvider()):new De(this,this.frameConfigProvider())}setConnectionStatus(t){this.isConnected="connected"===t}getConnectionStatus(){return this.isConnected}setProperties(t){Object.assign(this.state,t),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{const t=JSON.parse(this.PluginAPI.agentStorage.read(this.assetStorageKey,!0));this.state=Object.assign({},this.getDefaultState(),this.state,t)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,JSON.stringify(this.state),null,!0)}toggleContainerType(){const t="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:t}),this.stop(),this.start()}start(){this.container||this.prepContainer();const{frameId:t}=this.PluginAPI.EventTracer.addTracerIds({});Cs(this.appName,t,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),Es((t=>{this.setConnectionStatus(t)})),this.container.open().then((()=>{this.events.trigger("mounted")})).catch((()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())}))}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),Is()}}const Ns=t=>({apiKey:t.apiKey,environment:t.debugging.isStagingServer()?"staging":"production",device:t.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:t.areGuidesDisabled()?"disabled":t.debugging.areGuidesDelayed()?"delayed":"enabled"}),Ds=function(){const t={height:Ie.HEIGHT,width:Ie.WIDTH};let e,n;const r=new zs("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",t,(()=>({containerId:"pendo-client-debugger"})),(()=>({title:"Pendo Debugger"}))),o={app:r,init(t,o){e=t,n=o,n.restartDebugger=this.start,r.init(e,n),r.router.addRoute("debugger::connect",((t,o)=>{o({config:n.ConfigReader.audit(),env:Ns(e),container:r.state,events:n.store.state.debugger.eventsCaptured})})),r.router.addRoute("debugger::stop",(()=>{e.disableDebugging()})),r.router.addRoute("debugger::showGuideById",((t,n)=>{n(e.showGuideById(t.data))})),r.router.addRoute("debugger::toggleGuideLoop",(t=>{t.data?e.startGuides():e.stopGuides()})),r.router.addRoute("debugger::tombstoneGuide",(t=>{const r=e.findGuideById(t.data);n.Tombstone.addGuide(r)})),r.router.addRoute("debugger::openGuidePage",(t=>{const r=((t,e,n)=>{const r=e.findGuideById(t);if(!r||!e._.get(r,"attributes.resourceCenter"))return`${n}/guides/${t}`;if(r.attributes.resourceCenter.isTopLevel)return`${n}/resource-center/${r.id}/draft`;const o=e.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter();return o&&o.id?`${n}/resource-center/${o.id}/module/${r.id}`:""})(t.data,e,n.hosts.SERVER);r&&window.open(r,"_blank")})),r.router.addRoute("debugger::restore",(({data:t})=>{(t=>{if(!t||!t.length)return;const e=document.createElement("iframe");e.sandbox="allow-same-origin",e.src="about:blank",e.hidden=!0,document.body.appendChild(e),e.contentWindow.ignoreIframeMonitor=!0,t.forEach((t=>{t.id.split(".").reduce(((t,e,n,r)=>n===r.length-1?(t.destination[e]=t.source[e],t.destination[e]):(t.destination=t.destination[e],t.source=t.source[e],t)),{destination:window,source:e.contentWindow})})),document.body.removeChild(e)})(t)})),r.router.addRoute("debugger::findShadowRoot",((t,e)=>{e((()=>{let t,e=!1,n=0;const r=document.createNodeIterator(document.body,NodeFilter.SHOW_ELEMENT);if(!r||!r.nextNode)return!0;for(;n<1e4&&!e;)n++,t=r.nextNode(),t&&t.shadowRoot&&(e=!0);return e})())})),r.router.addRoute("debugger::sync",((t,o)=>{const i=n.store.subscribe(((t,e)=>{"debugger/eventsCaptured"===t.type&&o({action:"events/eventsCaptured",data:e.debugger.eventsCaptured})})),a=setInterval((()=>{o({action:"agent/sync",data:n.store.state}),o({action:"environment/validateEnvironment",data:e.validateEnvironment(!0)})}),500);r.events.on("unmounted",(()=>{clearInterval(a),i()}))})),r.router.addRoute("debugger::enableEventLogging",(({data:t})=>{r.setProperties({enableEventLogging:t}),n.store.dispatch("debugger/enableEventLogging",t)})),r.router.addRoute("debugger::clearEventsCaptured",(()=>{n.store.dispatch("debugger/clearEventsCaptured")})),r.router.addRoute("debugger::checkGuideEligibility",(({data:t},e)=>{n.store.dispatch("debugger/checkGuideEligibility",{guideId:t,response:e})}))},start(){r.start()},stop(){r.stop(),r.setProperties({enabled:!1,containerType:"frame"})}};return o}();const Ms={initialize:function(t,e){Ds.init(t,e),Ds.start();const n=t.disableDebugging;t.disableDebugging=()=>{Ds.stop(),n()}},teardown:function(){Ds.stop()}},$s=document.getElementById("pendo-debugger-plugin");let Hs="pendo";$s&&(Hs=$s.getAttribute("data-pendo-global-key")||"pendo"),window[Hs].addExtension&&window[Hs].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:Ms})}();
|
|
1
|
+
/*
|
|
2
|
+
@license https://agent.pendo.io/licenses
|
|
3
|
+
*/
|
|
4
|
+
!function(){"use strict";class j{constructor(e,t){this.path=e,this.handler=t}}class k{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new j(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var t=Array.isArray,e="object"==typeof e&&e&&e.Object===Object&&e,n="object"==typeof self&&self&&self.Object===Object&&self,e=e||n||Function("return this")(),n=e.Symbol,i=Object.prototype,L=i.hasOwnProperty,G=i.toString,s=n?n.toStringTag:undefined;var W=Object.prototype.toString;var $=function(e){var t=L.call(e,s),n=e[s];try{e[s]=undefined;var i=!0}catch(o){}var r=G.call(e);return i&&(t?e[s]=n:delete e[s]),r},F=function(e){return W.call(e)},U=n?n.toStringTag:undefined;i=function(e){return null==e?e===undefined?"[object Undefined]":"[object Null]":(U&&U in Object(e)?$:F)(e)};var q=i,B=function(e){return null!=e&&"object"==typeof e};var r=function(e){return"symbol"==typeof e||B(e)&&"[object Symbol]"==q(e)},Q=t,K=r,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/;var Y=function(e,t){var n;return!Q(e)&&(!("number"!=(n=typeof e)&&"symbol"!=n&&"boolean"!=n&&null!=e&&!K(e))||X.test(e)||!J.test(e)||null!=t&&e in Object(t))};var o=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},V=i,Z=o;var i=function(e){return!!Z(e)&&("[object Function]"==(e=V(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)},a=e["__core-js_shared__"],ee=(a=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"";var te=Function.prototype.toString;var ne=i,ie=function(e){return!!ee&&ee in e},re=o,oe=function(e){if(null!=e){try{return te.call(e)}catch(t){}try{return e+""}catch(t){}}return""},se=/^\[object .+?Constructor\]$/,a=Function.prototype,i=Object.prototype,o=a.toString,a=i.hasOwnProperty,ae=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var de=function(e){return!(!re(e)||ie(e))&&(ne(e)?ae:se).test(oe(e))},ue=function(e,t){return null==e?undefined:e[t]};var i=function(e,t){return e=ue(e,t),de(e)?e:undefined},a=i(Object,"create"),ce=a;var le=a,pe=Object.prototype.hasOwnProperty;var he=a,ge=Object.prototype.hasOwnProperty;var fe=a;var o=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},a=function(e){var t,n=this.__data__;return le?"__lodash_hash_undefined__"===(t=n[e])?undefined:t:pe.call(n,e)?n[e]:undefined},d=function(e){var t=this.__data__;return he?t[e]!==undefined:ge.call(t,e)},u=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fe&&t===undefined?"__lodash_hash_undefined__":t,this};function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}c.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},c.prototype["delete"]=o,c.prototype.get=a,c.prototype.has=d,c.prototype.set=u;o=c;var ve=function(e,t){return e===t||e!=e&&t!=t};var a=function(e,t){for(var n=e.length;n--;)if(ve(e[n][0],t))return n;return-1},be=a,me=Array.prototype.splice;var ye=a;var we=a;var _e=a;var d=function(e){var t=this.__data__;return!((e=be(t,e))<0||(e==t.length-1?t.pop():me.call(t,e,1),--this.size,0))},u=function(e){var t=this.__data__;return(e=ye(t,e))<0?undefined:t[e][1]},a=function(e){return-1<we(this.__data__,e)},l=function(e,t){var n=this.__data__,i=_e(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function p(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}p.prototype.clear=function(){this.__data__=[],this.size=0},p.prototype["delete"]=d,p.prototype.get=u,p.prototype.has=a,p.prototype.set=l;var d=p,u=i(e,"Map"),Te=o,Pe=d,Ce=u;var Ie=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var a=function(e,t){return e=e.__data__,Ie(t)?e["string"==typeof t?"string":"hash"]:e.map},Ee=a;var Re=a;var Se=a;var ze=a;l=function(e){return e=Ee(this,e)["delete"](e),this.size-=e?1:0,e},e=function(e){return Re(this,e).get(e)},i=function(e){return Se(this,e).has(e)},o=function(e,t){var n=ze(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function h(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}h.prototype.clear=function(){this.size=0,this.__data__={hash:new Te,map:new(Ce||Pe),string:new Te}},h.prototype["delete"]=l,h.prototype.get=e,h.prototype.has=i,h.prototype.set=o;var Oe=h;function g(i,r){if("function"!=typeof i||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var e=arguments,t=r?r.apply(this,e):e[0],n=o.cache;return n.has(t)?n.get(t):(e=i.apply(this,e),o.cache=n.set(t,e)||n,e)};return o.cache=new(g.Cache||Oe),o}g.Cache=Oe;var Ne=g;var Ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,He=/\\(\\)?/g,d=function(e){var t=(e=Ne(e,function(e){return 500===t.size&&t.clear(),e})).cache;return e}(function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Ae,function(e,t,n,i){r.push(n?i.replace(He,"$1"):t||e)}),r});var De=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r},xe=t,je=r,u=n?n.prototype:undefined,ke=u?u.toString:undefined;var Me=function x(e){var t;return"string"==typeof e?e:xe(e)?De(e,x)+"":je(e)?ke?ke.call(e):"":"0"==(t=e+"")&&1/e==-1/0?"-0":t};var Le=t,Ge=Y,We=d,$e=function(e){return null==e?"":Me(e)};var Fe=r;var Ue=function(e,t){return Le(e)?e:Ge(e,t)?[e]:We($e(e))},qe=function(e){var t;return"string"==typeof e||Fe(e)?e:"0"==(t=e+"")&&1/e==-1/0?"-0":t};var Be=function(e,t){for(var n=0,i=(t=Ue(t,e)).length;null!=e&&n<i;)e=e[qe(t[n++])];return n&&n==i?e:undefined};var Qe=M(function(e,t,n){return(e=null==e?undefined:Be(e,t))===undefined?n:e});class Ke{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(e,t={}){this.app=e,this.router=e.router,this.config=t,this.events=e.PluginAPI.getEventable()}getConfig(e,t){return Qe(this.config,e,t)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var f={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},v=2147483647,b={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:m,MIN_WIDTH:y,WINDOW_MARGIN:w}=b;function Je(t,n,i,r,o){let s=0,a=0,d=0,u=0;function c(e){e.preventDefault(),n.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",l),o()}function l(e){-1!==e.button||0===e.buttons?c(e):(e.preventDefault(),d=s-e.clientX,u=a-e.clientY,s=e.clientX,a=e.clientY,r(d,u))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),n.css({visibility:"visible"}),s=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",l),i())}),t.addEventListener("pointerup",c),t.addEventListener("pointerout",c)}function Xe(e,t){const n=e.handle[0],i=e.container[0];Je(n,e.blockout,function(){n.style.cursor="grabbing"},function(e,t){i.style.left=_(i,e)+"px",i.style.top=T(i,t)+"px"},function(){n.style.cursor="grab",t()})}function _(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-w;return t<w||e<w?w:e<t?e:t}function T(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-w;return t<w||e<w?w:e<t?e:t}function Ye(e,t){var n=e.resizeHandle[0];const i=e.container[0];Je(n,e.blockout,()=>{},function(e,t){i.style.width=Ve(i,e)+"px",i.style.height=Ze(i,t)+"px"},t)}function Ve(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-w;return e<t?e:t<y?y:t}function Ze(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-w;return e<t?e:t<m?m:t}class et extends Ke{type="frame";destination=window.parent||window.top;origin=window.location.origin;constructor(i,e){super(i,e);const{pendo:r,PluginAPI:o}=i;e=this.getConfig("containerId","pendo-client-app");this.container=r.dom(`<div id="${e}" class="pendo-ignore">`).css({...f,height:i.state.height,width:i.state.width,"z-index":v-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=r.dom('<div id="pendo-app-draggable-handle">').css({...f,"z-index":v,height:b.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{i.state.minimized||(this.container.css({height:b.HEIGHT,width:b.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=r.dom('<div id="pendo-app-resize-handle">').css({...f,"z-index":v,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=r.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...f,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const n=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=n(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=r)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.getAssetUrl(i.assetName)),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=r.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":v-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(r.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:n,height:i}=e,{minimized:e,width:r}=e,t=t||b.LEFT,n=n||b.TOP,i=e?b.HEADER_HEIGHT:i;t=_({offsetLeft:t,offsetWidth:r},0),n=T({offsetTop:n,offsetHeight:i},0),this.container.css({left:t,top:n,height:i}),this.savePosition()},this.saveSize=()=>{var{offsetHeight:e,offsetWidth:t}=this.container[0];e&&t&&this.app.setProperties({height:e,width:t})},this.savePosition=()=>{var{offsetLeft:e,offsetTop:t}=this.container[0];e&&t&&this.app.setProperties({left:e,top:t})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),Xe(this,this.savePosition),Ye(this,this.saveSize),window.addEventListener("resize",s),this.listeners=[["resize",s]];const t=r._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+w-window.innerWidth)&&(e.style.left=_(e,t)+"px",e.offsetWidth>y)&&(e.style.width=Ve(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+w-window.innerHeight)&&(e.style.top=T(e,t)+"px",e.offsetHeight>m)&&(e.style.height=Ze(e,t)+"px"));var e,t},10),n=r._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function s(){t(),n()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach(([e,t])=>window.removeEventListener(e,t)),this.elements.forEach(e=>e.remove()),this.triggerClosed()}}const P=(...e)=>r=>{return[].concat(e).reduce((e,t,n,i)=>{e=t(e,r);return e||i.splice(n,i.length-n),e},r)};let tt=0;const nt=(e,t,n)=>{if(!e||"string"!=typeof t)return n;let i=e;for(const r of t.split(".")){if(null==i)return n;i=i[r]}return i===undefined?n:i};const it=(t,n)=>{if(t&&n)if(Array.isArray(t))for(let e=0;e<t.length;e++)n(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&n(t[e],e,t);return t},rt=e=>"function"==typeof e,ot=e=>!(null==e),st="promise";function C(e,t,n){this.name=e,this.type=t,this.data=n}C.prototype.toString=function(){return`Message.${this.type} - `+this.name};const at=(e,t,n)=>{e=new C(e,t,n);return t===st&&(e.requestId=""+(tt+=1)),e},dt=e=>{try{var{name:t,type:n,isResponse:i,data:r,requestId:o,sender:s}=e.data||{},a=new C(t,n,ot(r)?JSON.parse(r):undefined);return a.requestId=o,a.sender=s,a.destination=e.source,a.isResponse=i,a}catch(d){return!1}},ut=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var n=Array.isArray(t)?t:[t],i={};for(const r in e)e.hasOwnProperty(r)&&!n.includes(r)&&(i[r]=e[r]);return i})(e,["destination","toString","data"]);return t.data=JSON.stringify(e.data,(e,t)=>"function"==typeof t||t instanceof RegExp?t.toString?t.toString():undefined:t),t},ct=e=>(e.isResponse=!0,e),I="disconnected",E={lastMessageReceivedAt:0,currentConnectionQuality:I,changeCallbacks:{},evalCallbacks:{}},R=e=>{e!==E.currentConnectionQuality&&(E.currentConnectionQuality=e,it(E.changeCallbacks,e=>{e(E.currentConnectionQuality)}))},lt=()=>{var e;0===E.lastMessageReceivedAt?R(I):((e=Date.now()-E.lastMessageReceivedAt)<1e4?R("connected"):1e4<e&&(3e4<e?R("dead_connection"):R(I)),it(E.evalCallbacks,e=>{e(E.currentConnectionQuality)}))};let S;let pt=0;const ht=()=>{E.currentConnectionQuality=I,E.lastMessageReceivedAt=0},z={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,destinationProvider:undefined},gt=()=>""+z.appName+z.connectionName+`(${z.frameId})`,O=e=>{e.sender||(e.sender=gt());var t=e.destination||z.destinationProvider(),n=ut(e),i=vt(e.sender),r=bt(e.sender);i||r?i?i.postMessage(n):t.postMessage(n,z.originProvider()):(r=new MessageChannel,It(r.port1,e.sender),t.postMessage(n,z.originProvider(),[r.port2]))},ft=(r,o,s=1e3)=>new Promise((e,t)=>{const n=at(r,st,o),i=setTimeout(()=>{t(r+" timeout"),yt(n),Rt(n)},s);mt(n,()=>clearTimeout(i),e,t),O(n)}),N=e=>{var t;return z.senderIds[e]||(t=e,z.senderIds[t])||(z.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),z.senderIds[e]},vt=e=>N(e).port,bt=e=>N(e).hasTriedToUpgradeToMessageChannel,mt=(e,t,n,i)=>{z.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:n,reject:i}};const yt=e=>{var t=e["requestId"];return z.pendingRequests[t].clearTimeoutfn(),delete z.pendingRequests[t],e};const wt="message::ping";var _t;const Tt=P(e=>{var t=z.pendingRequests[e.requestId];return t&&(t.resolve(e.data),yt(e)),e},t=>{var e=z.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===wt?O(ct(t)):(e=z.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,O(ct(t))}):console.log(gt(),"No route handler for "+t.name,t)),t},(_t=()=>{var e;e=Date.now(),E.lastMessageReceivedAt=e},(e,...t)=>(_t(e,...t),e))),Pt=e=>("*"===z.originProvider()||e.origin===z.originProvider())&&e,Ct=e=>{var t=nt(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(z.appName))&&e},It=(e,t)=>{t=N(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=P(dt,Tt)},Et=(e,t)=>{return!N(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&It(t.ports[0],e.sender),e},Rt=e=>{e=e.sender;(e=N(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let A=()=>{};const St=()=>{A(),A=()=>{},S&&S(),ht()},zt=((i,r)=>{let o,s=0,a;return function(...e){var t=Date.now(),n=r-(t-s);return n<=0||r<n?(o&&(clearTimeout(o),o=null),s=t,a=i.apply(this,e)):!o&&0<r&&(o=setTimeout(()=>{s=Date.now(),o=null,a=i.apply(this,e)},n)),a}})(e=>{"connected"!==e&&z.usePingAutoReconnect&&ft(wt)["catch"](()=>{console.log("message::ping timedout")})},1e3),Ot=(e,t,n,i,r,o=!1,s)=>{if(window.addEventListener){z.appName=e,z.frameId=t,z.routeHandlerLookup=n,z.usePingAutoReconnect=o,z.connectionName=s||"",z.originProvider=i||(()=>window.location.origin||"*"),z.destinationProvider=r||(()=>window.parent||window.top);{const d=setInterval(lt,100);S=()=>clearInterval(d)}e=zt;if(rt(e)){const u=pt++;E.evalCallbacks[u]=e}const a=P(Pt,Ct,dt,Et,Tt);window.addEventListener("message",a),A=()=>window.removeEventListener("message",a)}},Nt=e=>{if(rt(e)){const t=pt++;E.changeCallbacks[t]=e}};function At(){return(new Date).getTime()}class Ht extends Ke{type="window";testUrl="";realUrl=undefined;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()}),this.testConnection().then(()=>{this.triggerOpened()})["catch"](()=>{return this.createWindow(),r=this.app,o=1e3,new Promise((e,t)=>{const n=At(),i=()=>{r.getConnectionStatus()?e():At()-n>o?t():setTimeout(i,50)};i()});var r,o})}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),ft("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));var e=document.createElement("script");e.src=this.app.PluginAPI.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(e),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const Dt=()=>({});class xt{defaultState={containerType:"frame",minimized:!1,height:500,width:500,left:100,top:100};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,n,i,r,o=Dt,s=Dt){this.appName=e,this.assetName=t,this.assetStorageKey=n,this.connectionName=i,this.frameConfigProvider=o,this.windowConfigProvider=s,r&&Object.assign(this.defaultState,r),this.router=new k}init(e,t){this.pendo=e,this.PluginAPI=t,this.events=t.getEventable(),this.router.addRoute("app::ping",(e,t)=>{t()}),this.router.addRoute("app::setProperties",({data:e})=>{this.setProperties(e)}),this.router.addRoute("app::toggleContainer",()=>{this.setProperties({minimized:!1}),this.toggleContainerType()}),this.router.addRoute("app::windowClosed",()=>{}),this.loadState(),this.prepContainer()}prepContainer(){this.container="window"===this.state.containerType?new Ht(this,this.windowConfigProvider()):new et(this,this.frameConfigProvider())}setConnectionStatus(e){this.isConnected="connected"===e}getConnectionStatus(){return this.isConnected}setProperties(e){Object.assign(this.state,e),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{var e=JSON.parse(this.PluginAPI.agentStorage.read(this.assetStorageKey,!0));this.state=Object.assign({},this.getDefaultState(),this.state,e)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,JSON.stringify(this.state),null,!0)}toggleContainerType(){var e="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:e}),this.stop(),this.start()}start(){this.container||this.prepContainer();var e=this.PluginAPI.EventTracer.addTracerIds({})["frameId"];Ot(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),Nt(e=>{this.setConnectionStatus(e)}),this.container.open().then(()=>{this.events.trigger("mounted")})["catch"](()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())})}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),St()}}const H=function(){var e={height:b.HEIGHT,width:b.WIDTH};let r,o;const s=new xt("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",e,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}));return{app:s,init(e,t){r=e,(o=t).restartDebugger=this.start,s.init(r,o),s.router.addRoute("debugger::connect",(e,t)=>{var n;t({config:o.ConfigReader.audit(),env:{apiKey:(n=r).apiKey,environment:n.debugging.isStagingServer()?"staging":"production",device:n.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:n.areGuidesDisabled()?"disabled":n.debugging.areGuidesDelayed()?"delayed":"enabled"},container:s.state,events:o.store.state["debugger"].eventsCaptured})}),s.router.addRoute("debugger::stop",()=>{r.disableDebugging()}),s.router.addRoute("debugger::showGuideById",(e,t)=>{t(r.showGuideById(e.data))}),s.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?r.startGuides():r.stopGuides()}),s.router.addRoute("debugger::tombstoneGuide",e=>{e=r.findGuideById(e.data);o.Tombstone.addGuide(e)}),s.router.addRoute("debugger::openGuidePage",e=>{e=e.data,i=r,t=o.hosts.SERVER;var t,n,i=(n=i.findGuideById(e))&&i._.get(n,"attributes.resourceCenter")?n.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${n.id}/draft`:(i=i.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&i.id?`${t}/resource-center/${i.id}/module/`+n.id:"":t+"/guides/"+e;i&&window.open(i,"_blank")}),s.router.addRoute("debugger::restore",({data:e})=>{if(e&&e.length){const t=document.createElement("iframe");t.sandbox="allow-same-origin",t.src="about:blank",t.hidden=!0,document.body.appendChild(t),t.contentWindow.ignoreIframeMonitor=!0,e.forEach(e=>{e.id.split(".").reduce((e,t,n,i)=>n===i.length-1?(e.destination[t]=e.source[t],e.destination[t]):(e.destination=e.destination[t],e.source=e.source[t],e),{destination:window,source:t.contentWindow})}),document.body.removeChild(t)}}),s.router.addRoute("debugger::findShadowRoot",(e,t)=>{t((()=>{let e=!1,t=0;var n,i=document.createNodeIterator(document.body,NodeFilter.SHOW_ELEMENT);if(!i||!i.nextNode)return!0;for(;t<1e4&&!e;)t++,(n=i.nextNode())&&n.shadowRoot&&(e=!0);return e})())}),s.router.addRoute("debugger::sync",(e,n)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&n({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),i=setInterval(()=>{n({action:"agent/sync",data:o.store.state}),n({action:"environment/validateEnvironment",data:r.validateEnvironment(!0)})},500);s.events.on("unmounted",()=>{clearInterval(i),t()})}),s.router.addRoute("debugger::enableEventLogging",({data:e})=>{s.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),s.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),s.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})})},start(){s.start()},stop(){s.stop(),s.setProperties({enabled:!1,containerType:"frame"})}}}();a={initialize:function(e,t){H.init(e,t),H.start();const n=e.disableDebugging;e.disableDebugging=()=>{H.stop(),n()}},teardown:function(){H.stop()}},l=document.getElementById("pendo-debugger-plugin");let D="pendo";l&&(D=l.getAttribute("data-pendo-global-key")||"pendo"),window[D].addExtension&&window[D].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:a})}();
|
package/dist/dom.esm.js
CHANGED
|
@@ -6058,15 +6058,6 @@ var _pendoConfig = {};
|
|
|
6058
6058
|
function getPendoConfig() {
|
|
6059
6059
|
return _pendoConfig;
|
|
6060
6060
|
}
|
|
6061
|
-
function getPendoConfigFromEnclosingScope() {
|
|
6062
|
-
if (typeof PendoConfig === 'undefined')
|
|
6063
|
-
return {};
|
|
6064
|
-
return PendoConfig;
|
|
6065
|
-
}
|
|
6066
|
-
function getPendoConfigValue(key) {
|
|
6067
|
-
var config = getPendoConfig();
|
|
6068
|
-
return config[key];
|
|
6069
|
-
}
|
|
6070
6061
|
|
|
6071
6062
|
function deepCopy(obj) {
|
|
6072
6063
|
if (_.isFunction(obj) || _.isRegExp(obj)) {
|
|
@@ -7024,6 +7015,9 @@ function getInstallType() {
|
|
|
7024
7015
|
var installType = ConfigReader.get('installType');
|
|
7025
7016
|
return installType || NATIVE_INSTALL_TYPE;
|
|
7026
7017
|
}
|
|
7018
|
+
function isExtensionAgent() {
|
|
7019
|
+
return getInstallType() === EXTENSION_INSTALL_TYPE;
|
|
7020
|
+
}
|
|
7027
7021
|
|
|
7028
7022
|
function isNativeCode(fn) { return /native/.test(fn); }
|
|
7029
7023
|
|
|
@@ -7101,6 +7095,7 @@ if (bodyStyle) {
|
|
|
7101
7095
|
animations = _.isString(pdocument.body.style.webkitAnimation);
|
|
7102
7096
|
}
|
|
7103
7097
|
}
|
|
7098
|
+
var isChromeExtension = window.chrome && window.chrome.runtime && window.chrome.runtime.id;
|
|
7104
7099
|
// Android has history.pushState, but it does not update location correctly
|
|
7105
7100
|
// so let's not use the history API at all.
|
|
7106
7101
|
// http://code.google.com/p/android/issues/detail?id=17471
|
|
@@ -7114,15 +7109,13 @@ var shouldWrapNativeHistory = _.memoize(function shouldWrapNativeHistory() {
|
|
|
7114
7109
|
var historyDescriptors = window.history && _.isFunction(Object.getOwnPropertyDescriptors) && Object.getOwnPropertyDescriptors(window.history);
|
|
7115
7110
|
var isHistoryWriteable = historyDescriptors && _.get(historyDescriptors, 'pushState.writable', true) && _.get(historyDescriptors, 'replaceState.writable', true);
|
|
7116
7111
|
var hasAndroidSupport = !(android < 4);
|
|
7117
|
-
|
|
7118
|
-
return !!(hasNativeHistory && !isHistoryFrozen && isHistoryWriteable && hasAndroidSupport && !boxee && !isExtension);
|
|
7112
|
+
return !!(hasNativeHistory && !isHistoryFrozen && isHistoryWriteable && hasAndroidSupport && !boxee && !isExtensionAgent());
|
|
7119
7113
|
});
|
|
7120
7114
|
function shouldWrapHashChange() {
|
|
7121
7115
|
var hasNativeHashChange = 'onhashchange' in window;
|
|
7122
7116
|
// IE8 compatible mode lies
|
|
7123
7117
|
var hasSupportedDocMode = (!documentMode || documentMode > 7);
|
|
7124
|
-
|
|
7125
|
-
return !!(hasNativeHashChange && hasSupportedDocMode && !isExtension);
|
|
7118
|
+
return !!(hasNativeHashChange && hasSupportedDocMode && !isExtensionAgent());
|
|
7126
7119
|
}
|
|
7127
7120
|
function isMobileUserAgent() {
|
|
7128
7121
|
return (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i).test(getUA());
|
|
@@ -7156,7 +7149,8 @@ var sniffer = {
|
|
|
7156
7149
|
addEventListener: _.isFunction(window.addEventListener),
|
|
7157
7150
|
MutationObserver: isNativeCode(window.MutationObserver),
|
|
7158
7151
|
isMinimumIEVersion: isMinimumIEVersion,
|
|
7159
|
-
isMobileUserAgent: _.memoize(isMobileUserAgent)
|
|
7152
|
+
isMobileUserAgent: _.memoize(isMobileUserAgent),
|
|
7153
|
+
isChromeExtension: isChromeExtension
|
|
7160
7154
|
};
|
|
7161
7155
|
|
|
7162
7156
|
// other node types can be read about here:
|
|
@@ -7295,11 +7289,7 @@ function getScreenPosition(element) {
|
|
|
7295
7289
|
};
|
|
7296
7290
|
}
|
|
7297
7291
|
|
|
7298
|
-
var VERSION = '2.
|
|
7299
|
-
function isExtensionAgent() {
|
|
7300
|
-
var installType = getPendoConfigValue('installType') || getPendoConfigFromEnclosingScope().installType;
|
|
7301
|
-
return installType === EXTENSION_INSTALL_TYPE;
|
|
7302
|
-
}
|
|
7292
|
+
var VERSION = '2.285.0_';
|
|
7303
7293
|
|
|
7304
7294
|
var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
|
|
7305
7295
|
|