@userlike/messenger
Advanced tools
+8
-0
@@ -6,2 +6,10 @@ # Change Log | ||
| ## [1.2.1](https://github.com/userlike/messenger/compare/@userlike/messenger@1.2.0...@userlike/messenger@1.2.1) (2021-10-01) | ||
| **Note:** Version bump only for package @userlike/messenger | ||
| # [1.2.0](https://github.com/userlike/messenger/compare/@userlike/messenger@1.1.1...@userlike/messenger@1.2.0) (2021-07-06) | ||
@@ -8,0 +16,0 @@ |
@@ -1,1 +0,1 @@ | ||
| !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("userlike-messenger",[],n):"object"==typeof exports?exports.messenger=n():e.UserlikeMessenger=n()}("undefined"!=typeof window?window:this,(function(){return(()=>{"use strict";var e={d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{VersionStatus:()=>f,createMessenger:()=>g,err:()=>p,isPureLoader:()=>m,loadAssetsManifest:()=>s,loadScripts:()=>u,loadWidgetConfig:()=>l,notifyScriptLoad:()=>b,success:()=>d,v0:()=>t,v1:()=>r});var t={};e.r(t);var r={};function o(e){return e?(Number(e)^16*Math.random()>>Number(e)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o)}e.r(r),e.d(r,{EnableRegistration:()=>v,MessengerState:()=>h,getUnreadMessageCount:()=>w});var i=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))},a=function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function u(e,n,t){return(l=navigator.userAgent).indexOf("MSIE")>0||l.indexOf("Trident")>0?Promise.reject(new Error("Browser is not suported by Userlike messenger.")):Promise.all([s(t),(r=void 0,i=void 0,a=void 0,u=function(){var e;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){return(e=document.createElement("iframe")).id="userlike-frame-"+o(),e.setAttribute("style","\n position: absolute !important;\n opacity: 0 !important;\n height : 1px !important;\n top : 0 !important;\n left : 0 !important;\n border : none !important;\n display : block !important;\n z-index : -1 !important;\n "),[2,new Promise((function(n){e.addEventListener("load",(function(){return n(e)})),document.body.appendChild(e)}))]}))},new(a||(a=Promise))((function(e,n){function t(e){try{c(u.next(e))}catch(e){n(e)}}function o(e){try{c(u.throw(e))}catch(e){n(e)}}function c(n){var r;n.done?e(n.value):(r=n.value,r instanceof a?r:new a((function(e){e(r)}))).then(t,o)}c((u=u.apply(r,i||[])).next())})))]).then((function(t){var r=t[0],o=t[1];return new Promise((function(t,i){var a=o.contentWindow,u=o.contentDocument;if(!a||!u)return Promise.reject(new Error("iframe did not initialize"));var s=r.length-1;r.slice(0,s).forEach((function(e){c(u,e)})),c(u,r[s],(function(){(0,a.run)({widget_key:n},e).then((function(e){return t(e)})).catch(i)}))}))}));var r,i,a,u,l}function c(e,n,t){var r=e.createElement("script");r.async=!1,r.src=n,t&&(r.onload=t),e.head.appendChild(r)}function s(e){return i(this,void 0,void 0,(function(){var n,t;return a(this,(function(r){switch(r.label){case 0:return n=function(e){return void 0===e&&(e="https://userlike-cdn-widgets.s3-eu-west-1.amazonaws.com"),e+"/umm-manifest.json"}(e),[4,fetch(n,{mode:"cors"})];case 1:return(t=r.sent()).ok?[2,t.json()]:[2,Promise.reject(new Error(t.statusText))]}}))}))}function l(e,n){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(o){switch(o.label){case 0:return t=function(e,n){return void 0===n&&(n="https://userlike-cdn-widgets.s3-eu-west-1.amazonaws.com"),n+"/"+e+".json"}(e,n),[4,fetch(t,{mode:"cors"})];case 1:return(r=o.sent()).ok?[2,r.json()]:[2,Promise.reject(new Error(r.statusText))]}}))}))}var f,d=function(e){return{kind:"success",value:e}},p=function(e){return{kind:"error",error:e}};!function(e){e.Supported="supported",e.Deprecated="deprecated",e.EndOfLife="end-of-life"}(f||(f={}));var h,v,y=function(){return(y=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},b=function(e,n){void 0===n&&(n=window),n.dispatchEvent(new CustomEvent("userlike:messenger:script",{detail:e}))};function m(e,n){return void 0===n&&(n=window),!0===function(e){var n=e;return n.__USERLIKE_PURE__=y({},n.__USERLIKE_PURE__),n}(n).__USERLIKE_PURE__[e]}!function(e){e.Hidden="hidden",e.Minimized="minimized",e.Maximized="maximized"}(h||(h={})),function(e){e[e.Normal=0]="Normal",e[e.Registration=1]="Registration",e[e.Proactive=2]="Proactive"}(v||(v={}));var w=function(e){return e.conversations.reduce((function(e,n){return e+n.unread.length}),0)};function g(e){return n=this,t=void 0,o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,u(window,e.widgetKey,e.baseUrl)];case 1:return[2,(0,n.sent().createMessenger)(e.version)({widget_key:e.widgetKey})]}}))},new((r=void 0)||(r=Promise))((function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function u(e){try{c(o.throw(e))}catch(e){i(e)}}function c(n){var t;n.done?e(n.value):(t=n.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}c((o=o.apply(n,t||[])).next())}));var n,t,r,o}return n})()})); | ||
| !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("userlike-messenger",[],n):"object"==typeof exports?exports.messenger=n():e.UserlikeMessenger=n()}("undefined"!=typeof window?window:this,(function(){return(()=>{"use strict";var e={d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{VersionStatus:()=>f,createMessenger:()=>g,err:()=>p,isPureLoader:()=>m,loadAssetsManifest:()=>s,loadScripts:()=>u,loadWidgetConfig:()=>l,notifyScriptLoad:()=>v,success:()=>d,v0:()=>t,v1:()=>r});var t={};e.r(t);var r={};function o(e){return e?(Number(e)^16*Math.random()>>Number(e)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o)}e.r(r),e.d(r,{EnableRegistration:()=>y,MessengerState:()=>h,getUnreadMessageCount:()=>w});var i=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))},a=function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function u(e,n,t){return(l=navigator.userAgent).indexOf("MSIE")>0||l.indexOf("Trident")>0?Promise.reject(new Error("Browser is not suported by Userlike messenger.")):Promise.all([s(t),(r=void 0,i=void 0,a=void 0,u=function(){var e;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){return(e=document.createElement("iframe")).id="userlike-frame-"+o(),e.title="Empty frame",e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.setAttribute("style","\n position: absolute !important;\n opacity: 0 !important;\n height : 1px !important;\n top : 0 !important;\n left : 0 !important;\n border : none !important;\n display : block !important;\n z-index : -1 !important;\n "),[2,new Promise((function(n){e.addEventListener("load",(function(){return n(e)})),document.title="Empty frame",document.body.appendChild(e)}))]}))},new(a||(a=Promise))((function(e,n){function t(e){try{c(u.next(e))}catch(e){n(e)}}function o(e){try{c(u.throw(e))}catch(e){n(e)}}function c(n){var r;n.done?e(n.value):(r=n.value,r instanceof a?r:new a((function(e){e(r)}))).then(t,o)}c((u=u.apply(r,i||[])).next())})))]).then((function(t){var r=t[0],o=t[1];return new Promise((function(t,i){var a=o.contentWindow,u=o.contentDocument;if(!a||!u)return Promise.reject(new Error("iframe did not initialize"));var s=r.length-1;r.slice(0,s).forEach((function(e){c(u,e)})),c(u,r[s],(function(){(0,a.run)({widget_key:n},e).then((function(e){return t(e)})).catch(i)}))}))}));var r,i,a,u,l}function c(e,n,t){var r=e.createElement("script");r.async=!1,r.src=n,t&&(r.onload=t),e.head.appendChild(r)}function s(e){return i(this,void 0,void 0,(function(){var n,t;return a(this,(function(r){switch(r.label){case 0:return n=function(e){return void 0===e&&(e="https://userlike-cdn-widgets.s3-eu-west-1.amazonaws.com"),e+"/umm-manifest.json"}(e),[4,fetch(n,{mode:"cors"})];case 1:return(t=r.sent()).ok?[2,t.json()]:[2,Promise.reject(new Error(t.statusText))]}}))}))}function l(e,n){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(o){switch(o.label){case 0:return t=function(e,n){return void 0===n&&(n="https://userlike-cdn-widgets.s3-eu-west-1.amazonaws.com"),n+"/"+e+".json"}(e,n),[4,fetch(t,{mode:"cors"})];case 1:return(r=o.sent()).ok?[2,r.json()]:[2,Promise.reject(new Error(r.statusText))]}}))}))}var f,d=function(e){return{kind:"success",value:e}},p=function(e){return{kind:"error",error:e}};!function(e){e.Supported="supported",e.Deprecated="deprecated",e.EndOfLife="end-of-life"}(f||(f={}));var h,y,b=function(){return(b=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},v=function(e,n){void 0===n&&(n=window),n.dispatchEvent(new CustomEvent("userlike:messenger:script",{detail:e}))};function m(e,n){return void 0===n&&(n=window),!0===function(e){var n=e;return n.__USERLIKE_PURE__=b({},n.__USERLIKE_PURE__),n}(n).__USERLIKE_PURE__[e]}!function(e){e.Hidden="hidden",e.Minimized="minimized",e.Maximized="maximized"}(h||(h={})),function(e){e[e.Normal=0]="Normal",e[e.Registration=1]="Registration",e[e.Proactive=2]="Proactive"}(y||(y={}));var w=function(e){return e.conversations.reduce((function(e,n){return e+n.unread.length}),0)};function g(e){return n=this,t=void 0,o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,u(window,e.widgetKey,e.baseUrl)];case 1:return[2,(0,n.sent().createMessenger)(e.version)({widget_key:e.widgetKey})]}}))},new((r=void 0)||(r=Promise))((function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function u(e){try{c(o.throw(e))}catch(e){i(e)}}function c(n){var t;n.done?e(n.value):(t=n.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}c((o=o.apply(n,t||[])).next())}));var n,t,r,o}return n})()})); |
+3
-3
| { | ||
| "name": "@userlike/messenger", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1", | ||
| "main": "dist/cjs/index.js", | ||
@@ -34,5 +34,5 @@ "module": "dist/es/index.js", | ||
| "dependencies": { | ||
| "@userlike/messenger-internal": "^2.0.2" | ||
| "@userlike/messenger-internal": "^2.1.0" | ||
| }, | ||
| "gitHead": "d9875f624b6bcd5bb915ddec8ecd12b1dbf58a9b" | ||
| "gitHead": "077fa12125809d50ce201388cfd47f3dfe979336" | ||
| } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
28130
1.05%