posthog-js 1.17.3 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/array.js +2 -2
- package/dist/es.js +8 -2
- package/dist/module.js +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/array.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"zdbk":[function(require,module,exports) {
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LZString=void 0;var o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function t(o,r){if(!n[o]){n[o]={};for(var e=0;e<o.length;e++)n[o][o.charAt(e)]=e}return n[o][r]}var s={compressToBase64:function(o){if(null==o)return"";var e=s._compress(o,6,function(o){return r.charAt(o)});switch(e.length%4){default:case 0:return e;case 1:return e+"===";case 2:return e+"==";case 3:return e+"="}},decompressFromBase64:function(o){return null==o?"":""==o?null:s._decompress(o.length,32,function(e){return t(r,o.charAt(e))})},compressToUTF16:function(r){return null==r?"":s._compress(r,15,function(r){return o(r+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:s._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=s.compress(o),e=new Uint8Array(2*r.length),n=0,t=r.length;n<t;n++){var i=r.charCodeAt(n);e[2*n]=i>>>8,e[2*n+1]=i%256}return e},decompressFromUint8Array:function(r){if(null==r)return s.decompress(r);for(var e=new Array(r.length/2),n=0,t=e.length;n<t;n++)e[n]=256*r[2*n]+r[2*n+1];var i=[];return e.forEach(function(r){i.push(o(r))}),s.decompress(i.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":s._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(o){return null==o?"":""==o?null:(o=o.replace(/ /g,"+"),s._decompress(o.length,32,function(r){return t(e,o.charAt(r))}))},compress:function(r){return s._compress(r,16,function(r){return o(r)})},_compress:function(o,r,e){if(null==o)return"";var n,t,s,i={},p={},c="",a="",u="",l=2,f=3,h=2,d=[],m=0,v=0;for(s=0;s<o.length;s+=1)if(c=o.charAt(s),Object.prototype.hasOwnProperty.call(i,c)||(i[c]=f++,p[c]=!0),a=u+c,Object.prototype.hasOwnProperty.call(i,a))u=a;else{if(Object.prototype.hasOwnProperty.call(p,u)){if(u.charCodeAt(0)<256){for(n=0;n<h;n++)m<<=1,v==r-1?(v=0,d.push(e(m)),m=0):v++;for(t=u.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}else{for(t=1,n=0;n<h;n++)m=m<<1|t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t=0;for(t=u.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete p[u]}else for(t=i[u],n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++),i[a]=f++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(p,u)){if(u.charCodeAt(0)<256){for(n=0;n<h;n++)m<<=1,v==r-1?(v=0,d.push(e(m)),m=0):v++;for(t=u.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}else{for(t=1,n=0;n<h;n++)m=m<<1|t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t=0;for(t=u.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete p[u]}else for(t=i[u],n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,n=0;n<h;n++)m=m<<1|1&t,v==r-1?(v=0,d.push(e(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(e(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:s._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(r,e,n){var t,s,i,p,c,a,u,l=[],f=4,h=4,d=3,m="",v=[],w={val:n(0),position:e,index:1};for(t=0;t<3;t+=1)l[t]=t;for(i=0,c=Math.pow(2,2),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;switch(i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 2:return""}for(l[3]=u,s=u,v.push(u);;){if(w.index>r)return"";for(i=0,c=Math.pow(2,d),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;switch(u=i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;l[h++]=o(i),u=h-1,f--;break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=w.val&w.position,w.position>>=1,0==w.position&&(w.position=e,w.val=n(w.index++)),i|=(p>0?1:0)*a,a<<=1;l[h++]=o(i),u=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[u])m=l[u];else{if(u!==h)return null;m=s+s.charAt(0)}v.push(m),l[h++]=s+m.charAt(0),s=m,0==--f&&(f=Math.pow(2,d),d++)}}};exports.LZString=s;
|
|
3
3
|
},{}],"EHrm":[function(require,module,exports) {
|
|
4
|
-
module.exports={name:"posthog-js",version:"1.17.
|
|
4
|
+
module.exports={name:"posthog-js",version:"1.17.4",description:"Posthog-js allows you to automatically capture usage and send events to PostHog.",repository:"https://github.com/PostHog/posthog-js",author:"hey@posthog.com",license:"MIT",scripts:{start:"parcel watch src/loader-globals.js --out-file dist/array.js",serve:"parcel serve src/loader-globals.js --port 3001 --out-file dist/array.js",build:"yarn build-array && yarn build-module && yarn build-es-module && yarn process-types && yarn build-react","build-array":"parcel build src/loader-globals.js --out-file dist/array.js --no-source-maps","build-module":"rollup -i src/loader-module.js -f cjs -o dist/module.js -c rollup.config.js","build-es-module":"rollup -i src/loader-module.js -f es -o dist/es.js -c rollup.config.js","build-react":"cd react; yarn; yarn build;","process-types":"mkdir -p dist; eslint src --ext .ts -c .eslintrc.ts.js --fix && tsc && cp -f src/*.d.ts dist/",lint:"eslint src --fix",prepublishOnly:"yarn lint && yarn test && yarn build && yarn test-react",test:"jest src","test-react":"cd react; yarn test","test-watch":"jest --watch src",cypress:"cypress open"},main:"dist/module.js",module:"dist/es.js",files:["dist/*","react/dist/*"],dependencies:{"@sentry/types":"^6.11.0",fflate:"^0.4.1","rrweb-snapshot":"^1.1.7"},devDependencies:{"@babel/core":"7.12.10","@babel/preset-env":"7.12.11","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^8.1.0","@typescript-eslint/eslint-plugin":"^3.5.0","@typescript-eslint/parser":"^3.5.0","babel-eslint":"10.1.0","babel-jest":"^26.6.3",cypress:"^9.2.0",eslint:"7.3.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","fast-check":"^2.17.0",given2:"^2.1.7",husky:"^4.2.5",jest:"^26.1.0",jsdom:"16.2.2","jsdom-global":"3.0.2","lint-staged":"^10.2.11",localStorage:"1.0.4","node-fetch":"^2.6.1",parcel:"^1.12.4","posthog-js":"link:.",prettier:"^2.0.5",rollup:"^2.18.2",rrweb:"^1.0.6",sinon:"9.0.2",testcafe:"^1.17.1","testcafe-browser-provider-browserstack":"^1.13.2-alpha.1",typescript:"^3.9.6"},husky:{hooks:{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js,json}":"prettier --write","*.{ts,tsx}":["eslint -c .eslintrc.ts.js --fix","tsc --noEmit --esModuleInterop --jsx react"]},jest:{testPathIgnorePatterns:["/node_modules/","/cypress/","/react/","/test_data/"],moduleFileExtensions:["js","json"],setupFilesAfterEnv:["given2/setup"],clearMocks:!0}};
|
|
5
5
|
},{}],"itQ5":[function(require,module,exports) {
|
|
6
6
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../package.json"),r={DEBUG:!1,LIB_VERSION:e.version},t=r;exports.default=t;
|
|
7
7
|
},{"../package.json":"EHrm"}],"FOZT":[function(require,module,exports) {
|
|
@@ -29,7 +29,7 @@ module.exports={name:"posthog-js",version:"1.17.3",description:"Posthog-js allow
|
|
|
29
29
|
},{}],"Z2N4":[function(require,module,exports) {
|
|
30
30
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionRecording=exports.MUTATION_SOURCE_TYPE=exports.INCREMENTAL_SNAPSHOT_EVENT_TYPE=exports.META_EVENT_TYPE=exports.FULL_SNAPSHOT_EVENT_TYPE=void 0;var e=require("../autocapture-utils"),t=require("../utils"),n=require("../posthog-persistence"),r=s(require("../config")),i=require("./sessionrecording-utils");function s(e){return e&&e.__esModule?e:{default:e}}function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t){return h(e)||l(e,t)||p(e,t)||u()}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"==typeof e)return d(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)?d(e,t):void 0}}function d(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}function l(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){i=!0,s=c}finally{try{r||null==a.return||a.return()}finally{if(i)throw s}}return n}}function h(e){if(Array.isArray(e))return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),e}var w="/e/",y=2;exports.FULL_SNAPSHOT_EVENT_TYPE=y;var v=4;exports.META_EVENT_TYPE=v;var S=3;exports.INCREMENTAL_SNAPSHOT_EVENT_TYPE=S;var E=3;exports.MUTATION_SOURCE_TYPE=E;var O=function(){function s(e){_(this,s),this.instance=e,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=w,this.stopRrweb=null,this.windowId=null,this.sessionId=null}return g(s,[{key:"startRecordingIfEnabled",value:function(){this.instance.get_property(n.SESSION_RECORDING_ENABLED)&&!this.instance.get_config("disable_session_recording")&&this._startCapture()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=null,this.captureStarted=!1)}},{key:"afterDecideResponse",value:function(e){var t=!this.instance.get_config("disable_session_recording")&&!!e.sessionRecording;this.instance.persistence&&this.instance.persistence.register(f({},n.SESSION_RECORDING_ENABLED,t)),t&&(e.sessionRecording.endpoint&&(this.endpoint=e.sessionRecording.endpoint),this.submitRecordings())}},{key:"submitRecordings",value:function(){var e=this;this.emit=!0,this._startCapture(),this.snapshots.forEach(function(t){return e._captureSnapshot(t)})}},{key:"_startCapture",value:function(){void 0!==Object.assign&&(this.captureStarted||this.instance.get_config("disable_session_recording")||(this.captureStarted=!0,(0,e.loadScript)(this.instance.get_config("api_host")+"/static/recorder.js?v="+r.default.LIB_VERSION,t._.bind(this._onScriptLoaded,this))))}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.instance.sessionManager.getSessionAndWindowId(e.timestamp||(new Date).getTime(),e),n=t.windowId,r=t.sessionId;this.windowId===n&&this.sessionId===r||-1!==[y,v].indexOf(e.type)||window.rrweb.record.takeFullSnapshot(),this.windowId=n,this.sessionId=r}},{key:"_onScriptLoaded",value:function(){for(var e=this,t={blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!1,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1},n=this.instance.get_config("session_recording"),r=0,s=Object.entries(n||{});r<s.length;r++){var o=c(s[r],2),u=o[0],p=o[1];u in t&&(t[u]=p)}this.stopRrweb=window.rrweb.record(a({emit:function(t){t=(0,i.filterDataURLsFromLargeDataObjects)(t),e._updateWindowAndSessionIds(t);var n={$snapshot_data:t,$session_id:e.sessionId,$window_id:e.windowId};e.instance._captureMetrics.incr("rrweb-record"),e.instance._captureMetrics.incr("rrweb-record-".concat(t.type)),e.emit?e._captureSnapshot(n):e.snapshots.push(n)}},t)),this.instance._addCaptureHook(function(e){"$pageview"===e&&window.rrweb.record.addCustomEvent("$pageview",{href:window.location.href})})}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_forceCompression:!0,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===y}})}}]),s}();exports.SessionRecording=O;
|
|
31
31
|
},{"../autocapture-utils":"RYfg","../utils":"FOZT","../posthog-persistence":"MAdm","../config":"itQ5","./sessionrecording-utils":"vmk3"}],"auG7":[function(require,module,exports) {
|
|
32
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Decide=void 0;var e=require("./autocapture"),t=require("./utils"),n=require("./posthog-featureflags");function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=
|
|
32
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Decide=void 0;var e=require("./autocapture"),t=require("./utils"),n=require("./posthog-featureflags");function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function o(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function i(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}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}var u=function(){function o(e){s(this,o),this.instance=e}return c(o,[{key:"call",value:function(){var e=this,n=JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}),r=t._.base64Encode(n);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=2"),{data:r,verbose:!0},{method:"POST"},function(t){return e.parseDecideResponse(t)})}},{key:"parseDecideResponse",value:function(t){var o=this;if(0!==(null==t?void 0:t.status)){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){o.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),this.instance.sessionRecording.afterDecideResponse(t),e.autocapture.afterDecideResponse(t,this.instance),(0,n.parseFeatureFlagDecideResponse)(t,this.instance.persistence),t.supportedCompression){var i,s={},a=r(t.supportedCompression);try{for(a.s();!(i=a.n()).done;){s[i.value]=!0}}catch(c){a.e(c)}finally{a.f()}this.instance.compression=s}else this.instance.compression={}}else console.error("Failed to fetch feature flags from PostHog.")}}]),o}();exports.Decide=u;
|
|
33
33
|
},{"./autocapture":"gR3r","./utils":"FOZT","./posthog-featureflags":"aVqC"}],"ZEpJ":[function(require,module,exports) {
|
|
34
34
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Toolbar=void 0;var t=require("../autocapture-utils"),e=require("../utils");function o(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)}return o}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function n(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,o){return e&&a(t.prototype,e),o&&a(t,o),t}var c=function(){function o(t){i(this,o),this.instance=t}return s(o,[{key:"afterDecideResponse",value:function(t){var e=t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&e.toolbarVersion&&0===e.toolbarVersion.indexOf("toolbar")&&this._loadEditor(r(r({},e),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,o=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!o){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(s){return!1}o=window.localStorage}var n,i=e._.getHashParam(t.hash,"__posthog")||e._.getHashParam(t.hash,"state"),a=i?JSON.parse(decodeURIComponent(i)):null;return a&&("mpeditor"===a.action||"ph_authorize"===a.action)?(n=a)&&Object.keys(n).length>0&&(o.setItem("_postHogEditorParams",JSON.stringify(n)),a.desiredHash?t.hash=a.desiredHash:r?r.replaceState("",document.title,t.pathname+t.search):t.hash=""):delete(n=JSON.parse(o.getItem("_postHogEditorParams")||"{}")).userIntent,n.apiURL=this.instance.get_config("api_host"),!(!n.token||this.instance.get_config("token")!==n.token)&&(this._loadEditor(n),!0)}catch(c){return!1}}},{key:"_loadEditor",value:function(o){var n=this;if(!window._postHogToolbarLoaded){window._postHogToolbarLoaded=!0;var i=o.jsURL||o.apiURL||this.instance.get_config("api_host"),a=i+(i.endsWith("/")?"":"/")+"static/toolbar.js?_ts="+(new Date).getTime(),s="https://app.posthog.com"!==this.instance.get_config("api_host")&&this.instance.get_config("advanced_disable_toolbar_metrics");return o=r(r({},o),s?{instrument:!1}:{}),(0,t.loadScript)(a,function(){window.ph_load_editor(o,n.instance)}),e._.register_event(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,n._loadEditor(o)}),!0}return!1}}]),o}();exports.Toolbar=c;
|
|
35
35
|
},{"../autocapture-utils":"RYfg","../utils":"FOZT"}],"ae0g":[function(require,module,exports) {
|
package/dist/es.js
CHANGED
|
@@ -863,7 +863,7 @@ var LZString = {
|
|
|
863
863
|
}
|
|
864
864
|
};
|
|
865
865
|
|
|
866
|
-
var version = "1.17.
|
|
866
|
+
var version = "1.17.4";
|
|
867
867
|
|
|
868
868
|
var Config$1 = {
|
|
869
869
|
DEBUG: false,
|
|
@@ -3908,7 +3908,8 @@ var Decide = /*#__PURE__*/function () {
|
|
|
3908
3908
|
var encoded_data = _.base64Encode(json_data);
|
|
3909
3909
|
|
|
3910
3910
|
this.instance._send_request("".concat(this.instance.get_config('api_host'), "/decide/?v=2"), {
|
|
3911
|
-
data: encoded_data
|
|
3911
|
+
data: encoded_data,
|
|
3912
|
+
verbose: true
|
|
3912
3913
|
}, {
|
|
3913
3914
|
method: 'POST'
|
|
3914
3915
|
}, function (response) {
|
|
@@ -3920,6 +3921,11 @@ var Decide = /*#__PURE__*/function () {
|
|
|
3920
3921
|
value: function parseDecideResponse(response) {
|
|
3921
3922
|
var _this2 = this;
|
|
3922
3923
|
|
|
3924
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 0) {
|
|
3925
|
+
console.error('Failed to fetch feature flags from PostHog.');
|
|
3926
|
+
return;
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3923
3929
|
if (!(document && document.body)) {
|
|
3924
3930
|
console.log('document not ready yet, trying again in 500 milliseconds...');
|
|
3925
3931
|
setTimeout(function () {
|
package/dist/module.js
CHANGED
|
@@ -865,7 +865,7 @@ var LZString = {
|
|
|
865
865
|
}
|
|
866
866
|
};
|
|
867
867
|
|
|
868
|
-
var version = "1.17.
|
|
868
|
+
var version = "1.17.4";
|
|
869
869
|
|
|
870
870
|
var Config$1 = {
|
|
871
871
|
DEBUG: false,
|
|
@@ -3910,7 +3910,8 @@ var Decide = /*#__PURE__*/function () {
|
|
|
3910
3910
|
var encoded_data = _.base64Encode(json_data);
|
|
3911
3911
|
|
|
3912
3912
|
this.instance._send_request("".concat(this.instance.get_config('api_host'), "/decide/?v=2"), {
|
|
3913
|
-
data: encoded_data
|
|
3913
|
+
data: encoded_data,
|
|
3914
|
+
verbose: true
|
|
3914
3915
|
}, {
|
|
3915
3916
|
method: 'POST'
|
|
3916
3917
|
}, function (response) {
|
|
@@ -3922,6 +3923,11 @@ var Decide = /*#__PURE__*/function () {
|
|
|
3922
3923
|
value: function parseDecideResponse(response) {
|
|
3923
3924
|
var _this2 = this;
|
|
3924
3925
|
|
|
3926
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 0) {
|
|
3927
|
+
console.error('Failed to fetch feature flags from PostHog.');
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3925
3931
|
if (!(document && document.body)) {
|
|
3926
3932
|
console.log('document not ready yet, trying again in 500 milliseconds...');
|
|
3927
3933
|
setTimeout(function () {
|
package/package.json
CHANGED