New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mathieustan/vue-intercom

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathieustan/vue-intercom - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

dist/vue-intercom.esm.js
/*!
* Vue-intercom v0.0.3
* Vue-intercom v0.0.4
* (c) 2019-2020 Mathieu Stanowski
*/
import t from"vue";var e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var n=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r};var r=function(t){if(Array.isArray(t))return n(t)};var o=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var i=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}};var c=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var a=function(t){return r(t)||o(t)||i(t)||c()};function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var n=arguments,r=1;r<arguments.length;r++){var o=null!=n[r]?n[r]:{};r%2?u(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function s(t,e){return e instanceof t||null!=e&&e.constructor===t}function p(){var t;if(window.Intercom)return(t=window).Intercom.apply(t,arguments)}function d(t,e){t.isBooted=!0,p("boot",e)}function l(t,n){var r=n.appId,o=new t({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:p,_init:function(){return function(t){t.ready=!0,p("onHide",(function(){return t.visible=!1})),p("onShow",(function(){return t.visible=!0})),p("onUnreadCountChange",(function(e){return t.unreadCount=e}))}(o)},boot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return d(o,Object.assign({},i,t))},shutdown:function(){return p("shutdown")},update:function(){for(var t=arguments,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=t[r];return p.apply(void 0,["update"].concat(n))},show:function(){return p("show")},hide:function(){return p("hide")},showMessages:function(){return p("showMessages")},showNewMessage:function(t){return p.apply(void 0,["showNewMessage"].concat(a(s(String,t)?[t]:[])))},trackEvent:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["trackEvent"].concat([t].concat(r)))},startTour:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["startTour"].concat([t].concat(r)))},getVisitorId:function(){return p("getVisitorId")}};return Object.defineProperties(c,function(t,n){return n.reduce((function(n,r){return f(f({},n),{},e({},r,{get:function(){return t[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(t,e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(t);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=e}function y(t,e){if(window&&document){var n=function(){return v(t,e)};"complete"===document.readyState?v(t,e):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var w=!1;var b={version:"0.0.3",install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t!==e&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(s(String,r)){var o=l(e,{appId:r});Object.defineProperty(e.prototype,"$intercom",{get:function(){return o}}),e.mixin({beforeCreate:function(){var t=this;if(!w){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var e=function t(){for(var e=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=e[o];return t.c(r)};e.q=[],e.c=function(t){return e.q.push(t)},window.Intercom=e,y(r,(function(){return t.$intercom._init()}))}w=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var h=b.install;b.install=function(t,n){h.call(b,t,function(t){for(var n=arguments,r=1;r<arguments.length;r++){var o=null!=n[r]?n[r]:{};r%2?g(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},n))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(b);export default b;
import t from"vue";var e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var n=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r};var r=function(t){if(Array.isArray(t))return n(t)};var o=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var i=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}};var c=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var a=function(t){return r(t)||o(t)||i(t)||c()};function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var n=arguments,r=1;r<arguments.length;r++){var o=null!=n[r]?n[r]:{};r%2?u(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function s(t,e){return e instanceof t||null!=e&&e.constructor===t}function d(){var t;if(window.Intercom)return(t=window).Intercom.apply(t,arguments)}function p(t,e){t.isBooted=!0,d("boot",e)}function l(t,n){var r=n.appId,o=new t({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:d,_init:function(){return function(t){t.ready=!0,d("onHide",(function(){return t.visible=!1})),d("onShow",(function(){return t.visible=!0})),d("onUnreadCountChange",(function(e){return t.unreadCount=e}))}(o)},boot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return p(o,Object.assign({},i,t))},shutdown:function(){return function(t){t.isBooted=!1,d("shutdown")}(o)},update:function(){for(var t=arguments,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=t[r];return d.apply(void 0,["update"].concat(n))},show:function(){return d("show")},hide:function(){return d("hide")},showMessages:function(){return d("showMessages")},showNewMessage:function(t){return d.apply(void 0,["showNewMessage"].concat(a(s(String,t)?[t]:[])))},trackEvent:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return d.apply(void 0,["trackEvent"].concat([t].concat(r)))},startTour:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return d.apply(void 0,["startTour"].concat([t].concat(r)))},getVisitorId:function(){return d("getVisitorId")}};return Object.defineProperties(c,function(t,n){return n.reduce((function(n,r){return f(f({},n),{},e({},r,{get:function(){return t[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(t,e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(t);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=e}function y(t,e){if(window&&document){var n=function(){return v(t,e)};"complete"===document.readyState?v(t,e):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var w=!1;var b={version:"0.0.4",install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t!==e&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(s(String,r)){var o=l(e,{appId:r});Object.defineProperty(e.prototype,"$intercom",{get:function(){return o}}),e.mixin({beforeCreate:function(){var t=this;if(!w){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var e=function t(){for(var e=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=e[o];return t.c(r)};e.q=[],e.c=function(t){return e.q.push(t)},window.Intercom=e,y(r,(function(){return t.$intercom._init()}))}w=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var h=b.install;b.install=function(t,n){h.call(b,t,function(t){for(var n=arguments,r=1;r<arguments.length;r++){var o=null!=n[r]?n[r]:{};r%2?g(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},n))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(b);export default b;
/*!
* Vue-intercom v0.0.3
* Vue-intercom v0.0.4
* (c) 2019-2020 Mathieu Stanowski
*/
var VueIntercom=function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r};var o=function(t){if(Array.isArray(t))return r(t)};var i=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var c=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}};var a=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var u=function(t){return o(t)||i(t)||c(t)||a()};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?f(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function d(t,e){return e instanceof t||null!=e&&e.constructor===t}function p(){var t;if(window.Intercom)return(t=window).Intercom.apply(t,arguments)}function l(t,e){t.isBooted=!0,p("boot",e)}function y(t,e){var r=e.appId,o=new t({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:p,_init:function(){return function(t){t.ready=!0,p("onHide",(function(){return t.visible=!1})),p("onShow",(function(){return t.visible=!0})),p("onUnreadCountChange",(function(e){return t.unreadCount=e}))}(o)},boot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return l(o,Object.assign({},i,t))},shutdown:function(){return p("shutdown")},update:function(){for(var t=arguments,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=t[r];return p.apply(void 0,["update"].concat(n))},show:function(){return p("show")},hide:function(){return p("hide")},showMessages:function(){return p("showMessages")},showNewMessage:function(t){return p.apply(void 0,["showNewMessage"].concat(u(d(String,t)?[t]:[])))},trackEvent:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["trackEvent"].concat([t].concat(r)))},startTour:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["startTour"].concat([t].concat(r)))},getVisitorId:function(){return p("getVisitorId")}};return Object.defineProperties(c,function(t,e){return e.reduce((function(e,r){return s(s({},e),{},n({},r,{get:function(){return t[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(t,e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(t);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=e}function w(t,e){if(window&&document){var n=function(){return v(t,e)};"complete"===document.readyState?v(t,e):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var b=!1;var g={version:"0.0.3",install:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==t&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(d(String,r)){var o=y(t,{appId:r});Object.defineProperty(t.prototype,"$intercom",{get:function(){return o}}),t.mixin({beforeCreate:function(){var t=this;if(!b){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var e=function t(){for(var e=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=e[o];return t.c(r)};e.q=[],e.c=function(t){return e.q.push(t)},window.Intercom=e,w(r,(function(){return t.$intercom._init()}))}b=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var h=g.install;return g.install=function(t,e){h.call(g,t,function(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?O(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):O(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},e))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(g),t.default=g,t}({},Vue);
var VueIntercom=function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r};var o=function(t){if(Array.isArray(t))return r(t)};var i=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var c=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}};var a=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var u=function(t){return o(t)||i(t)||c(t)||a()};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?f(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function d(t,e){return e instanceof t||null!=e&&e.constructor===t}function p(){var t;if(window.Intercom)return(t=window).Intercom.apply(t,arguments)}function l(t,e){t.isBooted=!0,p("boot",e)}function y(t,e){var r=e.appId,o=new t({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:p,_init:function(){return function(t){t.ready=!0,p("onHide",(function(){return t.visible=!1})),p("onShow",(function(){return t.visible=!0})),p("onUnreadCountChange",(function(e){return t.unreadCount=e}))}(o)},boot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return l(o,Object.assign({},i,t))},shutdown:function(){return function(t){t.isBooted=!1,p("shutdown")}(o)},update:function(){for(var t=arguments,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=t[r];return p.apply(void 0,["update"].concat(n))},show:function(){return p("show")},hide:function(){return p("hide")},showMessages:function(){return p("showMessages")},showNewMessage:function(t){return p.apply(void 0,["showNewMessage"].concat(u(d(String,t)?[t]:[])))},trackEvent:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["trackEvent"].concat([t].concat(r)))},startTour:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["startTour"].concat([t].concat(r)))},getVisitorId:function(){return p("getVisitorId")}};return Object.defineProperties(c,function(t,e){return e.reduce((function(e,r){return s(s({},e),{},n({},r,{get:function(){return t[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(t,e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(t);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=e}function w(t,e){if(window&&document){var n=function(){return v(t,e)};"complete"===document.readyState?v(t,e):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var b=!1;var g={version:"0.0.4",install:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==t&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(d(String,r)){var o=y(t,{appId:r});Object.defineProperty(t.prototype,"$intercom",{get:function(){return o}}),t.mixin({beforeCreate:function(){var t=this;if(!b){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var e=function t(){for(var e=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=e[o];return t.c(r)};e.q=[],e.c=function(t){return e.q.push(t)},window.Intercom=e,w(r,(function(){return t.$intercom._init()}))}b=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var h=g.install;return g.install=function(t,e){h.call(g,t,function(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?O(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):O(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},e))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(g),t.default=g,t}({},Vue);
/*!
* Vue-intercom v0.0.3
* Vue-intercom v0.0.4
* (c) 2019-2020 Mathieu Stanowski
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).VueIntercom={},e.Vue)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};var r=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var o=function(e){if(Array.isArray(e))return r(e)};var i=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var c=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}};var a=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var u=function(e){return o(e)||i(e)||c(e)||a()};function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=arguments,r=1;r<arguments.length;r++){var o=null!=t[r]?t[r]:{};r%2?f(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t){return t instanceof e||null!=t&&t.constructor===e}function p(){var e;if(window.Intercom)return(e=window).Intercom.apply(e,arguments)}function l(e,t){e.isBooted=!0,p("boot",t)}function y(e,t){var r=t.appId,o=new e({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:p,_init:function(){return function(e){e.ready=!0,p("onHide",(function(){return e.visible=!1})),p("onShow",(function(){return e.visible=!0})),p("onUnreadCountChange",(function(t){return e.unreadCount=t}))}(o)},boot:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return l(o,Object.assign({},i,e))},shutdown:function(){return p("shutdown")},update:function(){for(var e=arguments,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=e[r];return p.apply(void 0,["update"].concat(n))},show:function(){return p("show")},hide:function(){return p("hide")},showMessages:function(){return p("showMessages")},showNewMessage:function(e){return p.apply(void 0,["showNewMessage"].concat(u(d(String,e)?[e]:[])))},trackEvent:function(e){for(var t=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=t[o];return p.apply(void 0,["trackEvent"].concat([e].concat(r)))},startTour:function(e){for(var t=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=t[o];return p.apply(void 0,["startTour"].concat([e].concat(r)))},getVisitorId:function(){return p("getVisitorId")}};return Object.defineProperties(c,function(e,t){return t.reduce((function(t,r){return s(s({},t),{},n({},r,{get:function(){return e[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(e,t){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(e);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=t}function w(e,t){if(window&&document){var n=function(){return v(e,t)};"complete"===document.readyState?v(e,t):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var b=!1;var O={version:"0.0.3",install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t!==e&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(d(String,r)){var o=y(e,{appId:r});Object.defineProperty(e.prototype,"$intercom",{get:function(){return o}}),e.mixin({beforeCreate:function(){var e=this;if(!b){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var t=function e(){for(var t=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=t[o];return e.c(r)};t.q=[],t.c=function(e){return t.q.push(e)},window.Intercom=t,w(r,(function(){return e.$intercom._init()}))}b=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var h=O.install;O.install=function(e,t){h.call(O,e,function(e){for(var t=arguments,r=1;r<arguments.length;r++){var o=null!=t[r]?t[r]:{};r%2?g(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},t))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(O),e.default=O,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e((t=t||self).VueIntercom={},t.Vue)}(this,(function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r};var o=function(t){if(Array.isArray(t))return r(t)};var i=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var c=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}};var u=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var a=function(t){return o(t)||i(t)||c(t)||u()};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?f(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function d(t,e){return e instanceof t||null!=e&&e.constructor===t}function p(){var t;if(window.Intercom)return(t=window).Intercom.apply(t,arguments)}function l(t,e){t.isBooted=!0,p("boot",e)}function y(t,e){var r=e.appId,o=new t({data:function(){return{ready:!1,isBooted:!1,visible:!1,unreadCount:0}}}),i={app_id:r},c={_vm:o,_call:p,_init:function(){return function(t){t.ready=!0,p("onHide",(function(){return t.visible=!1})),p("onShow",(function(){return t.visible=!0})),p("onUnreadCountChange",(function(e){return t.unreadCount=e}))}(o)},boot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return l(o,Object.assign({},i,t))},shutdown:function(){return function(t){t.isBooted=!1,p("shutdown")}(o)},update:function(){for(var t=arguments,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=t[r];return p.apply(void 0,["update"].concat(n))},show:function(){return p("show")},hide:function(){return p("hide")},showMessages:function(){return p("showMessages")},showNewMessage:function(t){return p.apply(void 0,["showNewMessage"].concat(a(d(String,t)?[t]:[])))},trackEvent:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["trackEvent"].concat([t].concat(r)))},startTour:function(t){for(var e=arguments,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=e[o];return p.apply(void 0,["startTour"].concat([t].concat(r)))},getVisitorId:function(){return p("getVisitorId")}};return Object.defineProperties(c,function(t,e){return e.reduce((function(e,r){return s(s({},e),{},n({},r,{get:function(){return t[r]}}))}),{})}(o,["ready","isBooted","visible","unreadCount"])),c}function v(t,e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.intercom.io/widget/".concat(t);var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),n.onload=e}function w(t,e){if(window&&document){var n=function(){return v(t,e)};"complete"===document.readyState?v(t,e):window.attachEvent?window.attachEvent("onload",n):window.addEventListener("load",n,!1)}}var b=!1;var O={version:"0.0.4",install:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==t&&console.error("Multiple instances of Vue detected.");var r=n.appId;if(d(String,r)){var o=y(t,{appId:r});Object.defineProperty(t.prototype,"$intercom",{get:function(){return o}}),t.mixin({beforeCreate:function(){var t=this;if(!b){if("function"==typeof window.Intercom)this.$intercom._init(),this.$intercom._call("reattach_activator"),this.$intercom.update();else{var e=function t(){for(var e=arguments,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=e[o];return t.c(r)};e.q=[],e.c=function(t){return e.q.push(t)},window.Intercom=e,w(r,(function(){return t.$intercom._init()}))}b=!0}}})}else console.warn("You didn't specified Intercom appId. Please check your configuration.")}};function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var h=O.install;O.install=function(t,e){h.call(O,t,function(t){for(var e=arguments,r=1;r<arguments.length;r++){var o=null!=e[r]?e[r]:{};r%2?g(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},e))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(O),t.default=O,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "@mathieustan/vue-intercom",
"description": "A wrapper for Intercom",
"version": "0.0.3",
"version": "0.0.4",
"author": "Mathieu Stanowski <mathieu.stan@gmail.com>",

@@ -6,0 +6,0 @@ "keywords": [

@@ -5,2 +5,4 @@ # vue-intercom

This package is to replace [vue-intercom](https://github.com/johnnynotsolucky/vue-intercom) which is not maintained anymore.
- [Demo](#demo)

@@ -70,2 +72,6 @@ - [Install](#install)

#### `$intercom.isBooted`
Set to `true` once the Intercom boot method has been called.
#### `$intercom.visible`

@@ -72,0 +78,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc