Socket
Socket
Sign inDemoInstall

cliengo-sdk

Package Overview
Dependencies
530
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.10.0 to 0.11.0

4

dist/cliengo-sdk.js

@@ -583,3 +583,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var finntechHost = 'https://fintech.cliengo.com';
var finntechHost = 'https://fintech.leadaki.com';
var validationServiceEndpointUrl = '/mocks/veraz/AR/simpleValidation';

@@ -1030,3 +1030,3 @@ var creditAcceptanceUYEndpointUrl = '/process/lead/UY';

// import 'polyfills.browser';
var coreHost = 'https://stage.cliengo.com';
var coreHost = 'https://api.cliengo.com';
var createLeadEndpoint = '/2.0/public/leads';

@@ -1033,0 +1033,0 @@ var getChatConfigUrl = 'https://s.cliengo.com/weboptimizer/';

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cliengo=t():e.Cliengo=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,n){"use strict";function o(e,t){"GA"===e&&a(t)}function r(e){window.hasOwnProperty("GoogleAnalyticsObject")||function(e,t,n,o,i,r,a){e.GoogleAnalyticsObject=i,e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date,r=t.createElement(n),a=t.getElementsByTagName(n)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",a.parentNode.insertBefore(r,a)}(window,document,"script",0,"ga"),e.googleAnalyticsId&&window.ga("create",e.googleAnalyticsId,"auto"),window.ga("create","UA-28791515-1","auto",{name:"leadakiTracker"}),window.ga("leadakiTracker.set",{dimension1:"Pilar_1.0",dimension2:"Web_2.0",dimension3:e.chatbotName,dimension4:e.chatWindowTitle,dimension5:e.chatSaluteTimeInSeconds,dimension6:e.chatWindowColor});var t="/cliente/"+e.companyId+"\n /siteless/"+e.websiteId+"/"+encodeURIComponent(window.location.href);if(window.ga("send","pageview"),window.ga("leadakiTracker.send","pageview",t),e.googleAdWordsConversionId&&e.automaticRemarketingEnabled){var n="//googleads.g.doubleclick.net/pagead/viewthroughconversion/\n "+e.googleAdWordsConversionId+"/?value=0&amp;guid=ON&amp;script=0",o=document.createElement("img");o.src=n,o.height=1,o.width=1,o.style.borderStyle="none",o.style.display="none",document.body.appendChild(o)}d=!0}function a(e){d||r(e.chatConfig);var t=e.category,n=e.action,o=e.label,a=e.value;window.hasOwnProperty("gaq")&&window.gaq.push(["_trackEvent",t,n,o,a]),window.ga("leadakiTracker.send","event",t,n,o,a,{nonInteraction:!0}),window.ga("send","event",t,n,o,a,{nonInteraction:!0}),(window.ga.getAll?window.ga.getAll():[]).forEach(function(e){console.log(e.get("name"));var r=gaTrackers[i].get("name");r.startsWith("gtm")&&window.ga(r+".send","event",t,n,o,a)}),window.hasOwnProperty("dataLayer")&&window.dataLayer.push({event:t,action:n,label:o,value:a})}var d=!1;e.exports={trackEvent:o}},function(e,t,n){"use strict";function o(e){var t=document.write,n=document.createElement("div");n.innerHTML=e,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(n),setTimeout(function(){document.write=t},5e3)}function i(e,t){var n=document.write,o=document.createElement("div");o.classList.add("fireAdwPixel");var i=new Image(1,1);i.src="//www.googleadservices.com/pagead/conversion/"+e+"/?label="+t+"&script=1",o.innerHTML=i,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(o),setTimeout(function(){document.write=n},5e3)}function r(e,t,n,o,i){var r=document.write,a=document.createElement("div");a.classList.add("fireFbPixelLead");var d=new Image(1,1);d.src="https://www.facebook.com/tr?id="+e+"&ev=Lead&cd[content_name]="+t+"&cd[content_category]="+n+"&cd[value]="+o+"&cd[currency]="+i+"&noscript=1",a.innerHTML=d,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(a),setTimeout(function(){document.write=r},5e3)}e.exports={fireNewLeadPixels:o,fireAdwPixel:i,fireFbPixelLead:r}},function(e,t,n){"use strict";function o(e){this.accountId=e.companyId,this.sourceId=e.websiteId,this.whiteLabelId=e.whiteLabelId,this.googleAdWordsConversionId=e.googleAdWordsConversionId,this.googleAnalyticsId=e.googleAnalyticsId,this.chatbotName=e.chatbotName,this.phone=e.phone,this.conversionPixels=e.conversionPixels,this.chatWindowColor=e.chatWindowColor,this.chatWindowTitle=e.chatWindowTitle,this.chatWindowInputPlaceholder=e.chatWindowInputPlaceholder,this.chatInitialMessage=e.chatInitialMessage,this.chatIsWritingMessage=e.chatIsWritingMessage,this.chatSaluteTime=e.chatSaluteTimeInSeconds,this.formHooksEnabled=e.formHooksEnabled,this.contactBarEnabled=e.contactBarEnabled,this.automaticRemarketingEnabled=e.automaticRemarketingEnabled,this.poweredBy=e.poweredBy||{},this.hasConvertedLead=e.hasConvertedLead,this.WS_CHATBOT_URL=e.WS_CHATBOT_URL,this.sessionPath=e.sessionPath,this.debug=e.debug,this.lang=e.lang,this.widgetVersion=e.widgetVersion,this.customSettings=e.customSettings,this.url=e.url}o.prototype.getConvertionPixels=function(){return this.conversionPixels},e.exports={ChatConfig:o}},function(e,t,n){"use strict";function o(e){this.email=e.email,this.phone=e.phone,this.name=e.name,this.nationalIdentityNumber=e.nationalIdentityNumber,this.sourceId=e.sourceId,this.accountId=e.accountId,this.customFields=e.customFields||{},this.gender=e.gender,this.age=e.age,this.lastName=e.lastName,this.address=e.address||{country:null,zipCode:null,city:null,state:null},this.nationality=e.nationality,this.landingUrl=e.landingUrl,this.convertionUrl=e.convertionUrl,this.utmSource=null,this.utmMedium=null,this.utmCampaign=null,this.utmContent=null,this.utmTerm=null,this.utmAdgroup=null,this.gclid=null}o.prototype.addCustomField=function(e,t){this.customFields[e]=t},o.prototype.getCustomField=function(e){return this.customFields[e]},o.prototype.getEmail=function(){return this.email},o.prototype.getPhone=function(){return this.phone},o.prototype.getName=function(){return this.name},o.prototype.getSourceId=function(){return this.sourceId},o.prototype.getAccountId=function(){return this.accountId},o.prototype.getNationalIdentityNumber=function(){return this.nationalIdentityNumber};var i=Object.freeze({UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content",UTM_CAMPAIGN:"utm_campaign",UTM_ADGROUP:"utm_adgroup",GCLID:"gclid"});e.exports={Lead:o,UTMs:i}},function(e,t,n){"use strict";function o(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function i(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+60*n*1e3),o="; expires="+i.toGMTString()}return document.cookie=e+"="+t+o+NaN,e+"="+t+o+NaN}function r(e){var t=a(e);return t?"&"+e+"="+t:""}function a(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(window.location.search)||[,""])[1].replace(/\+/g,"%20"))||null}function d(e,t){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(t)||[,""])[1].replace(/\+/g,"%20"))||null}function s(){var e="";return e+=r("utm_source"),e+=r("utm_medium"),e+=r("utm_term"),e+=r("utm_content"),e+=r("utm_campaign"),e+=r("utm_adgroup"),e+=r("gclid"),i("ldkUtms",e,240),e}e.exports={readCookie:o,createCookie:i,addIfParameterExists:r,getURLParameter:a,getParamFromQueryString:d,setUtmCookies:s}},function(e,t,n){"use strict";function o(e,t){var n=d+s,o=JSON.stringify({leadId:e,sourceId:t}),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(n,r).then(function(e){return e.json()}).catch(function(e){return e})}function i(e,t,n){var o=d+c,i=JSON.stringify({leadId:e,sourceId:t,accountId:n}),r=new window.Headers,a={method:"POST",headers:r,mode:"cors",body:i,cache:"default"};return window.fetch(o,a).then(function(e){return e.json()})}function r(){var e=new window.Headers,t={method:"POST",headers:e,mode:"cors",cache:"default"};return window.fetch(d+u,t).then(function(e){return e.json()})}function a(e){var t=JSON.stringify({response:e}),n=new window.Headers,o={method:"POST",headers:n,mode:"cors",body:t,cache:"default"};return window.fetch(d+l,o).then(function(e){return e.json()}).catch(function(e){return e})}var d="https://fintech.cliengo.com",s="/mocks/veraz/AR/simpleValidation",c="/process/lead/UY",u="/mocks/veraz/AR/step1",l="/mocks/veraz/AR/step2";e.exports={validateIdentity:o,creditAcceptance:i,getSecurityQuestion:r,answerSecurityQuestion:a}},function(e,t,n){"use strict";function o(e,t){function n(e){e.stopPropagation()}var o=document.querySelector('script[id="mainclgo"]'),r=o.getAttribute("src"),a=r.split("/",3).join("/").length,d=r.substring(0,a),s=document.querySelector('div[id="clgo"]');s&&console.warn('Cuidado! ya existe un div con id "clgo", probablemente el script del chat este duplicado en ese sitio!');var c=s||document.createElement("div");c.innerHTML="",c.id="clgo",c.style.zIndex="9999999",c.style.position="fixed",c.style.bottom="0",c.style.display="none",c.style.height="1px",c.style.width="1px";var u=document.createElement("style");u.innerHTML=".collapsed-height {\n height: 86px !important;\n right: 15px !important;\n display: block !important;\n }\n\n .expanded-height {\n max-width: 100% !important;\n width: 100% !important;\n height: 100% !important;\n right: 0 !important;\n }\n\n @media (max-width: 767px) {\n .clgo-chat-window-active {\n overflow: hidden;\n height: 100%;\n width: 100%;\n position: fixed\n }\n }\n\n @media (min-width: 768px) {\n .expanded-height {\n max-width: 320px !important;\n height: 80% !important; \n right: 15px !important;\n border-radius: 7px 7px 0 0;\n }\n }\n\n @media (min-width: 992px) {\n .expanded-height {\n max-width: 320px !important;\n height: 70% !important;\n right: 15px !important;\n border-radius: 7px 7px 0 0;\n }\n }",document.head.appendChild(u);var l=document.createElement("iframe");l.id="popupIframe",l.src=d+"/s/"+e+"/"+t+"/popup-iframe",l.style.zIndex="1999998",l.style.backgroundColor="transparent",l.style.border="none",l.style.width="1px",l.style.height="1px",l.style.position="fixed",l.style.right="0",l.style.bottom="85px",l.ALLOWTRANSPARENCY=!0,l.allowtransparency=!0,l.allowFullScreen=!0,l.allowFullscreen=!0,"function"==typeof l.mozRequestFullScreen&&l.mozRequestFullScreen(),"function"==typeof l.webkitRequestFullScreen&&l.webkitRequestFullScreen(),c.appendChild(l);var h=document.createElement("iframe");return h.id="chatIframe",h.src=d+"/s/"+e+"/"+t,h.className="collapsed-height",h.style.zIndex="1999999",h.style.backgroundColor="transparent",h.style.border="none",h.style.width="1px",h.style.height="1px",h.style.maxWidth="360px",h.style.position="fixed",h.style.right="15px",h.style.bottom="0",h.ALLOWTRANSPARENCY=!0,h.allowtransparency=!0,h.allowFullScreen=!0,h.allowFullscreen=!0,"function"==typeof h.mozRequestFullScreen&&h.mozRequestFullScreen(),"function"==typeof h.webkitRequestFullScreen&&h.webkitRequestFullScreen(),c.appendChild(h),h.addEventListener("scroll",n),h.addEventListener("resize",n),h.addEventListener("touchstart",n),h.addEventListener("touchmove",n),h.addEventListener("touchend",n),h.addEventListener("touchcancel",n),h.addEventListener("touchforcechange",n),h.addEventListener("gesturestart",n),h.addEventListener("gesturechange",n),h.addEventListener("gestureend",n),i={clgoDiv:c,chatIframe:h,popupIframe:l}}var i=void 0;e.exports={buildChatLayout:o}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){w=t,v=e.clgoDiv,E=e.chatIframe,I=e.popupIframe,window.addEventListener("message",function(e){r(e[e.message?"message":"data"])},!1)}function r(e){if(e.type===p.default.LAYOUT.WIDGET_OPEN&&(y=f,s.default.controlParentPage(),(0,l.removeClass)(E,"collapsed-height"),(0,l.addClass)(E,"expanded-height"),(0,l.addClass)(document.body,"clgo-chat-window-active"),I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.WIDGET_CLOSE&&(y=g,s.default.returnControlToParentPage(),E.style.width="93px",(0,l.removeClass)(E,"expanded-height"),(0,l.removeClass)(document.body,"clgo-chat-window-active"),(0,l.addClass)(E,"collapsed-height"),I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.POPUP_CLOSE&&(I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.POPUP_SHOW&&(E.style.width="93px",E.style.height="86px",I.contentWindow.postMessage(e,"*")),e.type===p.default.LAYOUT.POPUP_HIDE&&(E.style.width="93px",E.style.height="86px",I.style.height="1px",I.style.width="1px",I.contentWindow.postMessage(e,"*")),e.type===p.default.APP_INITIALIZED&&(v.style.display="block",E.style.height="86px",E.style.width="93px"),e.type===p.default.CHAT_IFRAME.READY){var t={type:"CHAT_CONFIG",data:JSON.stringify(w)};E.contentWindow.postMessage(t,"*")}e.type===p.default.POPUP_IFRAME.RESIZE&&y===g&&(I.style.width="237px",I.style.height=e.height),e.type===p.default.POPUP_IFRAME.CLICK&&E.contentWindow.postMessage(e,"*"),e.type===p.default.TRACK_EVENT&&(0,h.trackEvent)("GA",e.data),e.type===p.default.FIRE_NEW_LEAD_PIXELS&&u.default.fireNewLeadPixels(e.data)}function a(){return y}var d=n(11),s=o(d),c=n(1),u=o(c),l=n(10),h=n(0),m=n(8),p=o(m),g="widget_closed",f="widget_open",w=void 0,y=g,v=void 0,E=void 0,I=void 0;e.exports={subscribeToWidgetEvents:i,processMessage:r,getWidgetStatus:a}},function(e,t,n){"use strict";var o={LAYOUT:{WIDGET_OPEN:"WIDGET_OPEN",WIDGET_CLOSE:"WIDGET_CLOSE",POPUP_CLOSE:"POPUP_CLOSE",POPUP_SHOW:"WIDGET_SHOW_POPUP",POPUP_HIDE:"WIDGET_HIDE_POPUP",POPUP_RESIZE:"RESIZE_POPUP_FRAME"},APP_INITIALIZED:"WIDGET_READY",TRACK_EVENT:"GA_TRACK_EVENT",FIRE_NEW_LEAD_PIXELS:"WIDGET_FIRE_PIXELS",CHAT_IFRAME:{READY:"IFRAME_READY"},POPUP_IFRAME:{RESIZE:"RESIZE_POPUP_FRAME",CLICK:"POPUP_CLICKED"}};e.exports=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return window.fetch(A+e+"/"+t+".js?configOnly=true").then(function(e){return e.json()}).then(function(e){if(window.leadakiSettings){var t={category:"clgo_stats",action:"custom_settings"};(0,T.trackEvent)("GA",t),e.customSettings=window.leadakiSettings}if(e.url=document.URL,U=new _.ChatConfig(e),L=U.sourceId,O=U.accountId,r(),U.chatEnabled){var n=v.default.buildChatLayout(O,L);document.body.appendChild(n.clgoDiv),I.default.subscribeToWidgetEvents(n,U)}return e})}function r(){return null===w.default.readCookie("ldkRefererTracking")&&w.default.createCookie("ldkRefererTracking",document.referrer?document.referrer:"direct",240),w.default.setUtmCookies(),R=w.default.readCookie("ldkRefererTracking"),M=w.default.readCookie("ldkUtms"),!0}function a(e){var t=new x.Lead(e),n=w.default.readCookie("ldkUtms");t.accountId=O,t.sourceId=L,t.utmSource=w.default.getParamFromQueryString(x.UTMs.UTM_SOURCE,n)||"",t.utmMedium=w.default.getParamFromQueryString(x.UTMs.UTM_MEDIUM,n)||"",t.utmTerm=w.default.getParamFromQueryString(x.UTMs.UTM_TERM,n)||"",t.utmContent=w.default.getParamFromQueryString(x.UTMs.UTM_CONTENT,n)||"",t.utmCampaign=w.default.getParamFromQueryString(x.UTMs.UTM_CAMPAIGN,n)||"",t.utmAdgroup=w.default.getParamFromQueryString(x.UTMs.UTM_ADGROUP,n)||"",t.gclid=w.default.getParamFromQueryString(x.UTMs.GCLID,n)||"";var o=JSON.stringify(t),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(b+S,r).then(function(e){return e.json()})}function d(e){return g.default.validateIdentity(e,u())}function s(e,t,n){return g.default.creditAcceptance(e,t,n)}function c(e){return Promise.resolve()}function u(){return L}function l(){return O}function h(){C.default.fireNewLeadPixels(U.conversionPixels)}function m(e,t){t.chatConfig=U,(0,T.trackEvent)(e,t)}var p=n(5),g=o(p),f=n(4),w=o(f),y=n(6),v=o(y),E=n(7),I=o(E),P=n(1),C=o(P),T=n(0),x=n(3),_=n(2),b="https://stage.cliengo.com",S="/2.0/public/leads",A="https://s.cliengo.com/weboptimizer/",L="",O="",U="",R=void 0,M=void 0;e.exports={createLead:a,validateIdentity:d,creditAcceptance:s,addFinnProfile:c,getSourceId:u,readAndSetCookies:r,getAccountId:l,trackEvent:m,init:i,fireNewLeadPixels:h}},function(e,t,n){"use strict";function o(e,t){return e.classList.contains(t)}function i(e,t){e.classList.add(t)}function r(e,t){e.classList.remove(t)}e.exports={hasClass:o,addClass:i,removeClass:r}},function(e,t,n){"use strict";function o(){if(r()){d();s(l)}else a()}function i(){u?s(u):c()}function r(){return document.querySelector("head").querySelector("[name=viewport]")}function a(){var e=document.createElement("meta");e.id="viewport",e.name="viewport",e.content=l,document.getElementsByTagName("head")[0].appendChild(e)}function d(){var e=document.querySelector("head").querySelector("[name=viewport]");Array.isArray(e)&&e.length>1&&(console.warn("Cuidado! esta pagina tiene mas de un tag meta viewport!"),e=e[0]),u=e.content}function s(e){document.querySelector("head").querySelector("[name=viewport]").content=e}function c(){var e=document.getElementsByTagName("head")[0],t=e.querySelector("[name=viewport]");e.removeChild(t)}var u=void 0,l="width=device-width, initial-scale=1";e.exports={controlParentPage:o,returnControlToParentPage:i,pageHasMetaViewport:r}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cliengo=t():e.Cliengo=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,n){"use strict";function o(e,t){"GA"===e&&a(t)}function r(e){window.hasOwnProperty("GoogleAnalyticsObject")||function(e,t,n,o,i,r,a){e.GoogleAnalyticsObject=i,e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date,r=t.createElement(n),a=t.getElementsByTagName(n)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",a.parentNode.insertBefore(r,a)}(window,document,"script",0,"ga"),e.googleAnalyticsId&&window.ga("create",e.googleAnalyticsId,"auto"),window.ga("create","UA-28791515-1","auto",{name:"leadakiTracker"}),window.ga("leadakiTracker.set",{dimension1:"Pilar_1.0",dimension2:"Web_2.0",dimension3:e.chatbotName,dimension4:e.chatWindowTitle,dimension5:e.chatSaluteTimeInSeconds,dimension6:e.chatWindowColor});var t="/cliente/"+e.companyId+"\n /siteless/"+e.websiteId+"/"+encodeURIComponent(window.location.href);if(window.ga("send","pageview"),window.ga("leadakiTracker.send","pageview",t),e.googleAdWordsConversionId&&e.automaticRemarketingEnabled){var n="//googleads.g.doubleclick.net/pagead/viewthroughconversion/\n "+e.googleAdWordsConversionId+"/?value=0&amp;guid=ON&amp;script=0",o=document.createElement("img");o.src=n,o.height=1,o.width=1,o.style.borderStyle="none",o.style.display="none",document.body.appendChild(o)}d=!0}function a(e){d||r(e.chatConfig);var t=e.category,n=e.action,o=e.label,a=e.value;window.hasOwnProperty("gaq")&&window.gaq.push(["_trackEvent",t,n,o,a]),window.ga("leadakiTracker.send","event",t,n,o,a,{nonInteraction:!0}),window.ga("send","event",t,n,o,a,{nonInteraction:!0}),(window.ga.getAll?window.ga.getAll():[]).forEach(function(e){console.log(e.get("name"));var r=gaTrackers[i].get("name");r.startsWith("gtm")&&window.ga(r+".send","event",t,n,o,a)}),window.hasOwnProperty("dataLayer")&&window.dataLayer.push({event:t,action:n,label:o,value:a})}var d=!1;e.exports={trackEvent:o}},function(e,t,n){"use strict";function o(e){var t=document.write,n=document.createElement("div");n.innerHTML=e,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(n),setTimeout(function(){document.write=t},5e3)}function i(e,t){var n=document.write,o=document.createElement("div");o.classList.add("fireAdwPixel");var i=new Image(1,1);i.src="//www.googleadservices.com/pagead/conversion/"+e+"/?label="+t+"&script=1",o.innerHTML=i,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(o),setTimeout(function(){document.write=n},5e3)}function r(e,t,n,o,i){var r=document.write,a=document.createElement("div");a.classList.add("fireFbPixelLead");var d=new Image(1,1);d.src="https://www.facebook.com/tr?id="+e+"&ev=Lead&cd[content_name]="+t+"&cd[content_category]="+n+"&cd[value]="+o+"&cd[currency]="+i+"&noscript=1",a.innerHTML=d,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(a),setTimeout(function(){document.write=r},5e3)}e.exports={fireNewLeadPixels:o,fireAdwPixel:i,fireFbPixelLead:r}},function(e,t,n){"use strict";function o(e){this.accountId=e.companyId,this.sourceId=e.websiteId,this.whiteLabelId=e.whiteLabelId,this.googleAdWordsConversionId=e.googleAdWordsConversionId,this.googleAnalyticsId=e.googleAnalyticsId,this.chatbotName=e.chatbotName,this.phone=e.phone,this.conversionPixels=e.conversionPixels,this.chatWindowColor=e.chatWindowColor,this.chatWindowTitle=e.chatWindowTitle,this.chatWindowInputPlaceholder=e.chatWindowInputPlaceholder,this.chatInitialMessage=e.chatInitialMessage,this.chatIsWritingMessage=e.chatIsWritingMessage,this.chatSaluteTime=e.chatSaluteTimeInSeconds,this.formHooksEnabled=e.formHooksEnabled,this.contactBarEnabled=e.contactBarEnabled,this.automaticRemarketingEnabled=e.automaticRemarketingEnabled,this.poweredBy=e.poweredBy||{},this.hasConvertedLead=e.hasConvertedLead,this.WS_CHATBOT_URL=e.WS_CHATBOT_URL,this.sessionPath=e.sessionPath,this.debug=e.debug,this.lang=e.lang,this.widgetVersion=e.widgetVersion,this.customSettings=e.customSettings,this.url=e.url}o.prototype.getConvertionPixels=function(){return this.conversionPixels},e.exports={ChatConfig:o}},function(e,t,n){"use strict";function o(e){this.email=e.email,this.phone=e.phone,this.name=e.name,this.nationalIdentityNumber=e.nationalIdentityNumber,this.sourceId=e.sourceId,this.accountId=e.accountId,this.customFields=e.customFields||{},this.gender=e.gender,this.age=e.age,this.lastName=e.lastName,this.address=e.address||{country:null,zipCode:null,city:null,state:null},this.nationality=e.nationality,this.landingUrl=e.landingUrl,this.convertionUrl=e.convertionUrl,this.utmSource=null,this.utmMedium=null,this.utmCampaign=null,this.utmContent=null,this.utmTerm=null,this.utmAdgroup=null,this.gclid=null}o.prototype.addCustomField=function(e,t){this.customFields[e]=t},o.prototype.getCustomField=function(e){return this.customFields[e]},o.prototype.getEmail=function(){return this.email},o.prototype.getPhone=function(){return this.phone},o.prototype.getName=function(){return this.name},o.prototype.getSourceId=function(){return this.sourceId},o.prototype.getAccountId=function(){return this.accountId},o.prototype.getNationalIdentityNumber=function(){return this.nationalIdentityNumber};var i=Object.freeze({UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content",UTM_CAMPAIGN:"utm_campaign",UTM_ADGROUP:"utm_adgroup",GCLID:"gclid"});e.exports={Lead:o,UTMs:i}},function(e,t,n){"use strict";function o(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function i(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+60*n*1e3),o="; expires="+i.toGMTString()}return document.cookie=e+"="+t+o+NaN,e+"="+t+o+NaN}function r(e){var t=a(e);return t?"&"+e+"="+t:""}function a(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(window.location.search)||[,""])[1].replace(/\+/g,"%20"))||null}function d(e,t){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(t)||[,""])[1].replace(/\+/g,"%20"))||null}function s(){var e="";return e+=r("utm_source"),e+=r("utm_medium"),e+=r("utm_term"),e+=r("utm_content"),e+=r("utm_campaign"),e+=r("utm_adgroup"),e+=r("gclid"),i("ldkUtms",e,240),e}e.exports={readCookie:o,createCookie:i,addIfParameterExists:r,getURLParameter:a,getParamFromQueryString:d,setUtmCookies:s}},function(e,t,n){"use strict";function o(e,t){var n=d+s,o=JSON.stringify({leadId:e,sourceId:t}),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(n,r).then(function(e){return e.json()}).catch(function(e){return e})}function i(e,t,n){var o=d+c,i=JSON.stringify({leadId:e,sourceId:t,accountId:n}),r=new window.Headers,a={method:"POST",headers:r,mode:"cors",body:i,cache:"default"};return window.fetch(o,a).then(function(e){return e.json()})}function r(){var e=new window.Headers,t={method:"POST",headers:e,mode:"cors",cache:"default"};return window.fetch(d+u,t).then(function(e){return e.json()})}function a(e){var t=JSON.stringify({response:e}),n=new window.Headers,o={method:"POST",headers:n,mode:"cors",body:t,cache:"default"};return window.fetch(d+l,o).then(function(e){return e.json()}).catch(function(e){return e})}var d="https://fintech.leadaki.com",s="/mocks/veraz/AR/simpleValidation",c="/process/lead/UY",u="/mocks/veraz/AR/step1",l="/mocks/veraz/AR/step2";e.exports={validateIdentity:o,creditAcceptance:i,getSecurityQuestion:r,answerSecurityQuestion:a}},function(e,t,n){"use strict";function o(e,t){function n(e){e.stopPropagation()}var o=document.querySelector('script[id="mainclgo"]'),r=o.getAttribute("src"),a=r.split("/",3).join("/").length,d=r.substring(0,a),s=document.querySelector('div[id="clgo"]');s&&console.warn('Cuidado! ya existe un div con id "clgo", probablemente el script del chat este duplicado en ese sitio!');var c=s||document.createElement("div");c.innerHTML="",c.id="clgo",c.style.zIndex="9999999",c.style.position="fixed",c.style.bottom="0",c.style.display="none",c.style.height="1px",c.style.width="1px";var u=document.createElement("style");u.innerHTML=".collapsed-height {\n height: 86px !important;\n right: 15px !important;\n display: block !important;\n }\n\n .expanded-height {\n max-width: 100% !important;\n width: 100% !important;\n height: 100% !important;\n right: 0 !important;\n }\n\n @media (max-width: 767px) {\n .clgo-chat-window-active {\n overflow: hidden;\n height: 100%;\n width: 100%;\n position: fixed\n }\n }\n\n @media (min-width: 768px) {\n .expanded-height {\n max-width: 320px !important;\n height: 80% !important; \n right: 15px !important;\n border-radius: 7px 7px 0 0;\n }\n }\n\n @media (min-width: 992px) {\n .expanded-height {\n max-width: 320px !important;\n height: 70% !important;\n right: 15px !important;\n border-radius: 7px 7px 0 0;\n }\n }",document.head.appendChild(u);var l=document.createElement("iframe");l.id="popupIframe",l.src=d+"/s/"+e+"/"+t+"/popup-iframe",l.style.zIndex="1999998",l.style.backgroundColor="transparent",l.style.border="none",l.style.width="1px",l.style.height="1px",l.style.position="fixed",l.style.right="0",l.style.bottom="85px",l.ALLOWTRANSPARENCY=!0,l.allowtransparency=!0,l.allowFullScreen=!0,l.allowFullscreen=!0,"function"==typeof l.mozRequestFullScreen&&l.mozRequestFullScreen(),"function"==typeof l.webkitRequestFullScreen&&l.webkitRequestFullScreen(),c.appendChild(l);var h=document.createElement("iframe");return h.id="chatIframe",h.src=d+"/s/"+e+"/"+t,h.className="collapsed-height",h.style.zIndex="1999999",h.style.backgroundColor="transparent",h.style.border="none",h.style.width="1px",h.style.height="1px",h.style.maxWidth="360px",h.style.position="fixed",h.style.right="15px",h.style.bottom="0",h.ALLOWTRANSPARENCY=!0,h.allowtransparency=!0,h.allowFullScreen=!0,h.allowFullscreen=!0,"function"==typeof h.mozRequestFullScreen&&h.mozRequestFullScreen(),"function"==typeof h.webkitRequestFullScreen&&h.webkitRequestFullScreen(),c.appendChild(h),h.addEventListener("scroll",n),h.addEventListener("resize",n),h.addEventListener("touchstart",n),h.addEventListener("touchmove",n),h.addEventListener("touchend",n),h.addEventListener("touchcancel",n),h.addEventListener("touchforcechange",n),h.addEventListener("gesturestart",n),h.addEventListener("gesturechange",n),h.addEventListener("gestureend",n),i={clgoDiv:c,chatIframe:h,popupIframe:l}}var i=void 0;e.exports={buildChatLayout:o}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){w=t,v=e.clgoDiv,E=e.chatIframe,I=e.popupIframe,window.addEventListener("message",function(e){r(e[e.message?"message":"data"])},!1)}function r(e){if(e.type===p.default.LAYOUT.WIDGET_OPEN&&(y=f,s.default.controlParentPage(),(0,l.removeClass)(E,"collapsed-height"),(0,l.addClass)(E,"expanded-height"),(0,l.addClass)(document.body,"clgo-chat-window-active"),I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.WIDGET_CLOSE&&(y=g,s.default.returnControlToParentPage(),E.style.width="93px",(0,l.removeClass)(E,"expanded-height"),(0,l.removeClass)(document.body,"clgo-chat-window-active"),(0,l.addClass)(E,"collapsed-height"),I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.POPUP_CLOSE&&(I.style.height="1px",I.style.width="1px"),e.type===p.default.LAYOUT.POPUP_SHOW&&(E.style.width="93px",E.style.height="86px",I.contentWindow.postMessage(e,"*")),e.type===p.default.LAYOUT.POPUP_HIDE&&(E.style.width="93px",E.style.height="86px",I.style.height="1px",I.style.width="1px",I.contentWindow.postMessage(e,"*")),e.type===p.default.APP_INITIALIZED&&(v.style.display="block",E.style.height="86px",E.style.width="93px"),e.type===p.default.CHAT_IFRAME.READY){var t={type:"CHAT_CONFIG",data:JSON.stringify(w)};E.contentWindow.postMessage(t,"*")}e.type===p.default.POPUP_IFRAME.RESIZE&&y===g&&(I.style.width="237px",I.style.height=e.height),e.type===p.default.POPUP_IFRAME.CLICK&&E.contentWindow.postMessage(e,"*"),e.type===p.default.TRACK_EVENT&&(0,h.trackEvent)("GA",e.data),e.type===p.default.FIRE_NEW_LEAD_PIXELS&&u.default.fireNewLeadPixels(e.data)}function a(){return y}var d=n(11),s=o(d),c=n(1),u=o(c),l=n(10),h=n(0),m=n(8),p=o(m),g="widget_closed",f="widget_open",w=void 0,y=g,v=void 0,E=void 0,I=void 0;e.exports={subscribeToWidgetEvents:i,processMessage:r,getWidgetStatus:a}},function(e,t,n){"use strict";var o={LAYOUT:{WIDGET_OPEN:"WIDGET_OPEN",WIDGET_CLOSE:"WIDGET_CLOSE",POPUP_CLOSE:"POPUP_CLOSE",POPUP_SHOW:"WIDGET_SHOW_POPUP",POPUP_HIDE:"WIDGET_HIDE_POPUP",POPUP_RESIZE:"RESIZE_POPUP_FRAME"},APP_INITIALIZED:"WIDGET_READY",TRACK_EVENT:"GA_TRACK_EVENT",FIRE_NEW_LEAD_PIXELS:"WIDGET_FIRE_PIXELS",CHAT_IFRAME:{READY:"IFRAME_READY"},POPUP_IFRAME:{RESIZE:"RESIZE_POPUP_FRAME",CLICK:"POPUP_CLICKED"}};e.exports=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return window.fetch(A+e+"/"+t+".js?configOnly=true").then(function(e){return e.json()}).then(function(e){if(window.leadakiSettings){var t={category:"clgo_stats",action:"custom_settings"};(0,T.trackEvent)("GA",t),e.customSettings=window.leadakiSettings}if(e.url=document.URL,U=new _.ChatConfig(e),L=U.sourceId,O=U.accountId,r(),U.chatEnabled){var n=v.default.buildChatLayout(O,L);document.body.appendChild(n.clgoDiv),I.default.subscribeToWidgetEvents(n,U)}return e})}function r(){return null===w.default.readCookie("ldkRefererTracking")&&w.default.createCookie("ldkRefererTracking",document.referrer?document.referrer:"direct",240),w.default.setUtmCookies(),R=w.default.readCookie("ldkRefererTracking"),k=w.default.readCookie("ldkUtms"),!0}function a(e){var t=new x.Lead(e),n=w.default.readCookie("ldkUtms");t.accountId=O,t.sourceId=L,t.utmSource=w.default.getParamFromQueryString(x.UTMs.UTM_SOURCE,n)||"",t.utmMedium=w.default.getParamFromQueryString(x.UTMs.UTM_MEDIUM,n)||"",t.utmTerm=w.default.getParamFromQueryString(x.UTMs.UTM_TERM,n)||"",t.utmContent=w.default.getParamFromQueryString(x.UTMs.UTM_CONTENT,n)||"",t.utmCampaign=w.default.getParamFromQueryString(x.UTMs.UTM_CAMPAIGN,n)||"",t.utmAdgroup=w.default.getParamFromQueryString(x.UTMs.UTM_ADGROUP,n)||"",t.gclid=w.default.getParamFromQueryString(x.UTMs.GCLID,n)||"";var o=JSON.stringify(t),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(b+S,r).then(function(e){return e.json()})}function d(e){return g.default.validateIdentity(e,u())}function s(e,t,n){return g.default.creditAcceptance(e,t,n)}function c(e){return Promise.resolve()}function u(){return L}function l(){return O}function h(){C.default.fireNewLeadPixels(U.conversionPixels)}function m(e,t){t.chatConfig=U,(0,T.trackEvent)(e,t)}var p=n(5),g=o(p),f=n(4),w=o(f),y=n(6),v=o(y),E=n(7),I=o(E),P=n(1),C=o(P),T=n(0),x=n(3),_=n(2),b="https://api.cliengo.com",S="/2.0/public/leads",A="https://s.cliengo.com/weboptimizer/",L="",O="",U="",R=void 0,k=void 0;e.exports={createLead:a,validateIdentity:d,creditAcceptance:s,addFinnProfile:c,getSourceId:u,readAndSetCookies:r,getAccountId:l,trackEvent:m,init:i,fireNewLeadPixels:h}},function(e,t,n){"use strict";function o(e,t){return e.classList.contains(t)}function i(e,t){e.classList.add(t)}function r(e,t){e.classList.remove(t)}e.exports={hasClass:o,addClass:i,removeClass:r}},function(e,t,n){"use strict";function o(){if(r()){d();s(l)}else a()}function i(){u?s(u):c()}function r(){return document.querySelector("head").querySelector("[name=viewport]")}function a(){var e=document.createElement("meta");e.id="viewport",e.name="viewport",e.content=l,document.getElementsByTagName("head")[0].appendChild(e)}function d(){var e=document.querySelector("head").querySelector("[name=viewport]");Array.isArray(e)&&e.length>1&&(console.warn("Cuidado! esta pagina tiene mas de un tag meta viewport!"),e=e[0]),u=e.content}function s(e){document.querySelector("head").querySelector("[name=viewport]").content=e}function c(){var e=document.getElementsByTagName("head")[0],t=e.querySelector("[name=viewport]");e.removeChild(t)}var u=void 0,l="width=device-width, initial-scale=1";e.exports={controlParentPage:o,returnControlToParentPage:i,pageHasMetaViewport:r}}])});
//# sourceMappingURL=cliengo-sdk.min.js.map

@@ -32,3 +32,3 @@ 'use strict';

// import 'polyfills.browser';
var coreHost = 'https://stage.cliengo.com';
var coreHost = 'https://api.cliengo.com';
var createLeadEndpoint = '/2.0/public/leads';

@@ -35,0 +35,0 @@ var getChatConfigUrl = 'https://s.cliengo.com/weboptimizer/';

'use strict';
var finntechHost = 'https://fintech.cliengo.com';
var finntechHost = 'https://fintech.leadaki.com';
var validationServiceEndpointUrl = '/mocks/veraz/AR/simpleValidation';

@@ -5,0 +5,0 @@ var creditAcceptanceUYEndpointUrl = '/process/lead/UY';

{
"name": "cliengo-sdk",
"version": "0.10.0",
"version": "0.11.0",
"description": "We offer a powerful Javascript API that gives you flexibility and config, control and track over the behavior of the Cliengo Platform. You can decide, how, when and where to display the chat box on your site, as well as view and update visitor information. You can also track informations and events in web platforms out of the box, including Google Analytics, Google Adwords, Facebook Ads and Google Tag Manager.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc