@pendo/agent 2.292.0 → 2.293.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.
@@ -1,4 +1,4 @@
1
1
  /*
2
2
  @license https://agent.pendo.io/licenses
3
3
  */
4
- !function(){"use strict";class x{constructor(e,t){this.path=e,this.handler=t}}class N{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new x(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,G=i.hasOwnProperty,L=i.toString,s=n?n.toStringTag:undefined;var W=Object.prototype.toString;var $=function(e){var t=G.call(e,s),n=e[s];try{e[s]=undefined;var i=!0}catch(o){}var r=L.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,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/;var J=function(e,t){var n;return!Q(e)&&(!("number"!=(n=typeof e)&&"symbol"!=n&&"boolean"!=n&&null!=e&&!K(e))||Y.test(e)||!X.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 pe=a,le=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 pe?"__lodash_hash_undefined__"===(t=n[e])?undefined:t:le.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},me=a,ye=Array.prototype.splice;var be=a;var we=a;var _e=a;var d=function(e){var t=this.__data__;return!((e=me(t,e))<0||(e==t.length-1?t.pop():ye.call(t,e,1),--this.size,0))},u=function(e){var t=this.__data__;return(e=be(t,e))<0?undefined:t[e][1]},a=function(e){return-1<we(this.__data__,e)},p=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 l(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])}}l.prototype.clear=function(){this.__data__=[],this.size=0},l.prototype["delete"]=d,l.prototype.get=u,l.prototype.has=a,l.prototype.set=p;var d=l,u=i(e,"Map"),Pe=o,Te=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;p=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 Pe,map:new(Ce||Te),string:new Pe}},h.prototype["delete"]=p,h.prototype.get=e,h.prototype.has=i,h.prototype.set=o;var Ae=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||Ae),o}g.Cache=Ae;var He=g;var Oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,De=/\\(\\)?/g,d=function(e){var t=(e=He(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(Oe,function(e,t,n,i){r.push(n?i.replace(De,"$1"):t||e)}),r});var je=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},ke=t,xe=r,u=n?n.prototype:undefined,Ne=u?u.toString:undefined;var Me=function k(e){var t;return"string"==typeof e?e:ke(e)?je(e,k)+"":xe(e)?Ne?Ne.call(e):"":"0"==(t=e+"")&&1/e==-1/0?"-0":t};var Ge=t,Le=J,We=d,$e=function(e){return null==e?"":Me(e)};var Fe=r;var Ue=function(e,t){return Ge(e)?e:Le(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,m={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:y,MIN_WIDTH:b,WINDOW_MARGIN:w}=m;function Xe(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",p),o()}function p(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",p),i())}),t.addEventListener("pointerup",c),t.addEventListener("pointerout",c)}function Ye(e,t){const n=e.handle[0],i=e.container[0];Xe(n,e.blockout,function(){n.style.cursor="grabbing"},function(e,t){i.style.left=_(i,e)+"px",i.style.top=P(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 P(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-w;return t<w||e<w?w:e<t?e:t}function Je(e,t){var n=e.resizeHandle[0];const i=e.container[0];Xe(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<b?b:t}function Ze(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-w;return e<t?e:t<y?y: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:m.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{i.state.minimized||(this.container.css({height:m.HEIGHT,width:m.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||m.LEFT,n=n||m.TOP,i=e?m.HEADER_HEIGHT:i;t=_({offsetLeft:t,offsetWidth:r},0),n=P({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),Ye(this,this.savePosition),Je(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>b)&&(e.style.width=Ve(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+w-window.innerHeight)&&(e.style.top=P(e,t)+"px",e.offsetHeight>y)&&(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 T=(...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)}))},pt=()=>{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 lt=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})`,A=e=>{e.sender||(e.sender=gt());var t=e.destination||z.destinationProvider(),n=ut(e),i=vt(e.sender),r=mt(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"),bt(n),Rt(n)},s);yt(n,()=>clearTimeout(i),e,t),A(n)}),H=e=>{var t;return z.senderIds[e]||(t=e,z.senderIds[t])||(z.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),z.senderIds[e]},vt=e=>H(e).port,mt=e=>H(e).hasTriedToUpgradeToMessageChannel,yt=(e,t,n,i)=>{z.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:n,reject:i}};const bt=e=>{var t=e["requestId"];return z.pendingRequests[t].clearTimeoutfn(),delete z.pendingRequests[t],e};const wt="message::ping";var _t;const Pt=T(e=>{var t=z.pendingRequests[e.requestId];return t&&(t.resolve(e.data),bt(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?A(ct(t)):(e=z.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,A(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))),Tt=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=H(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=T(dt,Pt)},Et=(e,t)=>{return!H(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&It(t.ports[0],e.sender),e},Rt=e=>{e=e.sender;(e=H(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let O=()=>{};const St=()=>{O(),O=()=>{},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),At=(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(pt,100);S=()=>clearInterval(d)}e=zt;if(rt(e)){const u=lt++;E.evalCallbacks[u]=e}const a=T(Tt,Ct,dt,Et,Pt);window.addEventListener("message",a),O=()=>window.removeEventListener("message",a)}},Ht=e=>{if(rt(e)){const t=lt++;E.changeCallbacks[t]=e}};function Ot(){return(new Date).getTime()}class Dt 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=Ot(),i=()=>{r.getConnectionStatus()?e():Ot()-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 jt=()=>({});class kt{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=jt,s=jt){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 N}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 Dt(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=this.PluginAPI.agentStorage.read(this.assetStorageKey);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,this.state)}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"];At(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),Ht(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 xt=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}},D=function(){var e={height:m.HEIGHT,width:m.WIDTH};let r,o;const s=new kt("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()?"off":n.debugging.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(n=n.debugging.observer.shadowDom).foundShadowRoots||(n.findShadowRoots(document,Infinity,()=>{}),n.foundShadowRoots)},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::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)}),n({action:"performance/sync",data:xt()})},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){D.init(e,t),D.start();const n=e.disableDebugging;e.disableDebugging=()=>{D.stop(),n()}},teardown:function(){D.stop()}},p=document.getElementById("pendo-debugger-plugin");let j="pendo";p&&(j=p.getAttribute("data-pendo-global-key")||"pendo"),window[j].addExtension&&window[j].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:a})}();
4
+ !function(){"use strict";class L{constructor(e,t){this.path=e,this.handler=t}}class G{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new L(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}const c=(...e)=>s=>{return[].concat(e).reduce((e,t,i,n)=>{e=t(e,s);return e||n.splice(i,n.length-i),e},s)};let W=0;const i=(e,t,i)=>{if(!e||"string"!=typeof t)return i;let n=e;for(const s of t.split(".")){if(null==n)return i;n=n[s]}return n===undefined?i:n};const t=(t,i)=>{if(t&&i)if(Array.isArray(t))for(let e=0;e<t.length;e++)i(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&i(t[e],e,t);return t},h=e=>"function"==typeof e,O=e=>!(null==e),d=()=>Date.now();class e{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 i(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 a={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},u=2147483647,g={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:p,MIN_WIDTH:l,WINDOW_MARGIN:f}=g;function s(t,i,n,s,o){let r=0,a=0,d=0,u=0;function c(e){e.preventDefault(),i.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",h),o()}function h(e){-1!==e.button||0===e.buttons?c(e):(e.preventDefault(),d=r-e.clientX,u=a-e.clientY,r=e.clientX,a=e.clientY,s(d,u))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),i.css({visibility:"visible"}),r=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",h),n())}),t.addEventListener("pointerup",c),t.addEventListener("pointerout",c)}function U(e,t){const i=e.handle[0],n=e.container[0];s(i,e.blockout,function(){i.style.cursor="grabbing"},function(e,t){n.style.left=m(n,e)+"px",n.style.top=v(n,t)+"px"},function(){i.style.cursor="grab",t()})}function m(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-f;return t<f||e<f?f:e<t?e:t}function v(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-f;return t<f||e<f?f:e<t?e:t}function _(e,t){var i=e.resizeHandle[0];const n=e.container[0];s(i,e.blockout,()=>{},function(e,t){n.style.width=b(n,e)+"px",n.style.height=w(n,t)+"px"},t)}function b(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-f;return e<t?e:t<l?l:t}function w(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-f;return e<t?e:t<p?p:t}class F extends e{type="frame";destination=window.parent||window.top;origin=window.location.origin;constructor(n,e){super(n,e);const{pendo:s,PluginAPI:o}=n;e=this.getConfig("containerId","pendo-client-app");this.container=s.dom(`<div id="${e}" class="pendo-ignore">`).css({...a,height:n.state.height,width:n.state.width,"z-index":u-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=s.dom('<div id="pendo-app-draggable-handle">').css({...a,"z-index":u,height:g.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{n.state.minimized||(this.container.css({height:g.HEIGHT,width:g.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=s.dom('<div id="pendo-app-resize-handle">').css({...a,"z-index":u,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=s.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...a,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const i=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=i(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=s)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.getAssetUrl(n.assetName)),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=s.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":u-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(s.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:i,height:n}=e,{minimized:e,width:s}=e,t=t||g.LEFT,i=i||g.TOP,n=e?g.HEADER_HEIGHT:n;t=m({offsetLeft:t,offsetWidth:s},0),i=v({offsetTop:i,offsetHeight:n},0),this.container.css({left:t,top:i,height:n}),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),U(this,this.savePosition),_(this,this.saveSize),window.addEventListener("resize",r),this.listeners=[["resize",r]];const t=s._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+f-window.innerWidth)&&(e.style.left=m(e,t)+"px",e.offsetWidth>l)&&(e.style.width=b(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+f-window.innerHeight)&&(e.style.top=v(e,t)+"px",e.offsetHeight>p)&&(e.style.height=w(e,t)+"px"));var e,t},10),i=s._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function r(){t(),i()}}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 y="promise";function T(e,t,i){this.name=e,this.type=t,this.data=i}T.prototype.toString=function(){return`Message.${this.type} - `+this.name};const $=(e,t,i)=>{e=new T(e,t,i);return t===y&&(e.requestId=""+(W+=1)),e},C=e=>{try{var{name:t,type:i,isResponse:n,data:s,requestId:o,sender:r}=e.data||{},a=new T(t,i,O(s)?JSON.parse(s):undefined);return a.requestId=o,a.sender=r,a.destination=e.source,a.isResponse=n,a}catch(d){return!1}},q=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var i=Array.isArray(t)?t:[t],n={};for(const s in e)e.hasOwnProperty(s)&&!i.includes(s)&&(n[s]=e[s]);return n})(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},n=e=>(e.isResponse=!0,e),o="disconnected",P={lastMessageReceivedAt:0,currentConnectionQuality:o,changeCallbacks:{},evalCallbacks:{}},r=e=>{e!==P.currentConnectionQuality&&(P.currentConnectionQuality=e,t(P.changeCallbacks,e=>{e(P.currentConnectionQuality)}))},B=()=>{var e;0===P.lastMessageReceivedAt?r(o):((e=d()-P.lastMessageReceivedAt)<1e4?r("connected"):1e4<e&&(3e4<e?r("dead_connection"):r(o)),t(P.evalCallbacks,e=>{e(P.currentConnectionQuality)}))};let I;let R=0;const j=()=>{P.currentConnectionQuality=o,P.lastMessageReceivedAt=0},E={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,destinationProvider:undefined},S=()=>""+E.appName+E.connectionName+`(${E.frameId})`,H=e=>{e.sender||(e.sender=S());var t=e.destination||E.destinationProvider(),i=q(e),n=Q(e.sender),s=K(e.sender);n||s?n?n.postMessage(i):t.postMessage(i,E.originProvider()):(s=new MessageChannel,ee(s.port1,e.sender),t.postMessage(i,E.originProvider(),[s.port2]))},D=(s,o,r=1e3)=>new Promise((e,t)=>{const i=$(s,y,o),n=setTimeout(()=>{t(s+" timeout"),A(i),ie(i)},r);X(i,()=>clearTimeout(n),e,t),H(i)}),z=e=>{var t;return E.senderIds[e]||(t=e,E.senderIds[t])||(E.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),E.senderIds[e]},Q=e=>z(e).port,K=e=>z(e).hasTriedToUpgradeToMessageChannel,X=(e,t,i,n)=>{E.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:i,reject:n}};const A=e=>{var t=e["requestId"];return E.pendingRequests[t].clearTimeoutfn(),delete E.pendingRequests[t],e};const k="message::ping";var Y;const J=c(e=>{var t=E.pendingRequests[e.requestId];return t&&(t.resolve(e.data),A(e)),e},t=>{var e=E.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===k?H(n(t)):(e=E.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,H(n(t))}):console.log(S(),"No route handler for "+t.name,t)),t},(Y=()=>{var e;e=d(),P.lastMessageReceivedAt=e},(e,...t)=>(Y(e,...t),e))),V=e=>("*"===E.originProvider()||e.origin===E.originProvider())&&e,Z=e=>{var t=i(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(E.appName))&&e},ee=(e,t)=>{t=z(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=c(C,J)},te=(e,t)=>{return!z(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&ee(t.ports[0],e.sender),e},ie=e=>{e=e.sender;(e=z(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let N=()=>{};const ne=()=>{N(),N=()=>{},I&&I(),j()},se=((n,s)=>{let o,r=0,a;return function(...e){var t=d(),i=s-(t-r);return i<=0||s<i?(o&&(clearTimeout(o),o=null),r=t,a=n.apply(this,e)):!o&&0<s&&(o=setTimeout(()=>{r=d(),o=null,a=n.apply(this,e)},i)),a}})(e=>{"connected"!==e&&E.usePingAutoReconnect&&D(k)["catch"](()=>{console.log("message::ping timedout")})},1e3),oe=(e,t,i,n,s,o=!1,r)=>{if(window.addEventListener){E.appName=e,E.frameId=t,E.routeHandlerLookup=i,E.usePingAutoReconnect=o,E.connectionName=r||"",E.originProvider=n||(()=>window.location.origin||"*"),E.destinationProvider=s||(()=>window.parent||window.top);{const d=setInterval(B,100);I=()=>clearInterval(d)}e=se;if(h(e)){const u=R++;P.evalCallbacks[u]=e}const a=c(V,Z,C,te,J);window.addEventListener("message",a),N=()=>window.removeEventListener("message",a)}},re=e=>{if(h(e)){const t=R++;P.changeCallbacks[t]=e}};class ae extends e{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(),s=this.app,o=1e3,new Promise((e,t)=>{const i=d(),n=()=>{s.getConnectionStatus()?e():d()-i>o?t():setTimeout(n,50)};n()});var s,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`),D("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 de=()=>({});class ue{defaultState={containerType:"frame",minimized:!1,height:g.HEIGHT,width:g.WIDTH,left:g.LEFT,top:g.TOP};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,i,n,s,o=de,r=de){this.appName=e,this.assetName=t,this.assetStorageKey=i,this.connectionName=n,this.frameConfigProvider=o,this.windowConfigProvider=r,s&&Object.assign(this.defaultState,s),this.router=new G}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(),this.start()}prepContainer(){this.container="window"===this.state.containerType?new ae(this,this.windowConfigProvider()):new F(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=this.PluginAPI.agentStorage.read(this.assetStorageKey);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,this.state)}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"];oe(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),re(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"),ne()}}const ce=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}};class he extends ue{constructor(){super("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",null,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}))}initialize(s,o){o.restartDebugger=this.start.bind(this),super.init(s,o),this.router.addRoute("debugger::connect",(e,t)=>{var i;t({config:o.ConfigReader.audit(),env:{apiKey:(i=s).apiKey,environment:i.debugging.isStagingServer()?"staging":"production",device:i.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:i.areGuidesDisabled()?"off":i.debugging.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(i=i.debugging.observer.shadowDom).foundShadowRoots||(i.findShadowRoots(document,Infinity,()=>{}),i.foundShadowRoots)},container:this.state,events:o.store.state["debugger"].eventsCaptured})}),this.router.addRoute("debugger::stop",()=>{s.disableDebugging()}),this.router.addRoute("debugger::showGuideById",(e,t)=>{t(s.showGuideById(e.data))}),this.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?s.startGuides():s.stopGuides()}),this.router.addRoute("debugger::tombstoneGuide",e=>{e=s.findGuideById(e.data);o.Tombstone.addGuide(e)}),this.router.addRoute("debugger::openGuidePage",e=>{e=e.data,n=s,t=o.hosts.SERVER;var t,i,n=(i=n.findGuideById(e))&&n._.get(i,"attributes.resourceCenter")?i.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${i.id}/draft`:(n=n.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&n.id?`${t}/resource-center/${n.id}/module/`+i.id:"":t+"/guides/"+e;n&&window.open(n,"_blank")}),this.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,i,n)=>i===n.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)}}),this.router.addRoute("debugger::sync",(e,i)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&i({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),n=setInterval(()=>{i({action:"agent/sync",data:o.store.state}),i({action:"environment/validateEnvironment",data:s.validateEnvironment(!0)}),i({action:"performance/sync",data:ce()})},500);this.events.on("unmounted",()=>{clearInterval(n),t()})}),this.router.addRoute("debugger::enableEventLogging",({data:e})=>{this.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),this.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),this.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})})}teardown(){super.stop(),this.setProperties({enabled:!1,containerType:"frame"})}}var x=new he,ge={initialize(e,t){x.initialize(e,t);const i=e.disableDebugging;e.disableDebugging=()=>{x.teardown(),i(),e.disableDebugging=i}},teardown(){x.teardown()}},pe=document.getElementById("pendo-debugger-plugin");let M="pendo";pe&&(M=pe.getAttribute("data-pendo-global-key")||"pendo"),window[M].addExtension&&window[M].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:ge})}();
package/dist/dom.esm.js CHANGED
@@ -7312,7 +7312,7 @@ function getScreenPosition(element) {
7312
7312
  };
7313
7313
  }
7314
7314
 
7315
- var VERSION = '2.292.0_';
7315
+ var VERSION = '2.293.0_';
7316
7316
 
7317
7317
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7318
7318
 
@@ -8805,17 +8805,6 @@ var removeNode = function (domNode) {
8805
8805
  domNode.parentNode.removeChild(domNode);
8806
8806
  }
8807
8807
  };
8808
- var getElements = _.compose(function (arrLike) {
8809
- return Array.prototype.slice.call(arrLike);
8810
- }, function (tag, document) {
8811
- try {
8812
- return SizzleProxy(tag, document);
8813
- }
8814
- catch (e) {
8815
- writeMessage('error using sizzle: ' + e);
8816
- return document.getElementsByTagName(tag);
8817
- }
8818
- });
8819
8808
  var pickBestBODY = function (b1, b2) {
8820
8809
  try {
8821
8810
  // check children.length, check Height, check Width?
@@ -8830,9 +8819,9 @@ var pickBestBODY = function (b1, b2) {
8830
8819
  }
8831
8820
  };
8832
8821
  var getBody = function (_document) {
8833
- _document = _document || document;
8822
+ if (_document === void 0) { _document = document; }
8834
8823
  try {
8835
- var bds = getElements('body', _document);
8824
+ var bds = Array.prototype.slice.call(_document.getElementsByTagName('body'));
8836
8825
  if (bds && bds.length > 1) {
8837
8826
  bds.sort(pickBestBODY);
8838
8827
  return bds[0] || _document.body;