@leancodepl/force-update 9.7.4 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(T,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],q):(T=typeof globalThis<"u"?globalThis:T||self,q(T["@leancodepl/force-update"]={},T.react))})(this,(function(T,q){"use strict";var M=function(e,n){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},M(e,n)};function k(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");M(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var C=function(){return C=Object.assign||function(n){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},C.apply(this,arguments)};function Ne(e,n,t,r){function o(i){return i instanceof t?i:new t(function(u){u(i)})}return new(t||(t=Promise))(function(i,u){function s(f){try{c(r.next(f))}catch(h){u(h)}}function a(f){try{c(r.throw(f))}catch(h){u(h)}}function c(f){f.done?i(f.value):o(f.value).then(s,a)}c((r=r.apply(e,n||[])).next())})}function ne(e,n){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(c){return function(f){return a([c,f])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(t=0)),t;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,o=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=n.call(e,t)}catch(f){c=[6,f],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function _(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),o,i=[],u;try{for(;(n===void 0||n-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){u={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(u)throw u.error}}return i}function V(e,n,t){if(t||arguments.length===2)for(var r=0,o=n.length,i;r<o;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}function D(e){return this instanceof D?(this.v=e,this):new D(e)}function Ge(e,n,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(e,n||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),o[Symbol.asyncIterator]=function(){return this},o;function u(l){return function(x){return Promise.resolve(x).then(l,h)}}function s(l,x){r[l]&&(o[l]=function(d){return new Promise(function(R,P){i.push([l,d,R,P])>1||a(l,d)})},x&&(o[l]=x(o[l])))}function a(l,x){try{c(r[l](x))}catch(d){p(i[0][3],d)}}function c(l){l.value instanceof D?Promise.resolve(l.value.v).then(f,h):p(i[0][2],l)}function f(l){a("next",l)}function h(l){a("throw",l)}function p(l,x){l(x),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Me(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],t;return n?n.call(e):(e=typeof _=="function"?_(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(u){return new Promise(function(s,a){u=e[i](u),o(s,a,u.done,u.value)})}}function o(i,u,s,a){Promise.resolve(a).then(function(c){i({value:c,done:s})},u)}}typeof SuppressedError=="function"&&SuppressedError;function b(e){return typeof e=="function"}function X(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Y=X(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(r,o){return o+1+") "+r.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function J(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var B=(function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,r,o,i;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var s=_(u),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(n)throw n.error}}else u.remove(this);var f=this.initialTeardown;if(b(f))try{f()}catch(d){i=d instanceof Y?d.errors:[d]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=_(h),l=p.next();!l.done;l=p.next()){var x=l.value;try{oe(x)}catch(d){i=i??[],d instanceof Y?i=V(V([],H(i)),H(d.errors)):i.push(d)}}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}if(i)throw new Y(i)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)oe(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&J(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&J(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=(function(){var n=new e;return n.closed=!0,n})(),e})();B.EMPTY;function re(e){return e instanceof B||e&&"closed"in e&&b(e.remove)&&b(e.add)&&b(e.unsubscribe)}function oe(e){b(e)?e():e.unsubscribe()}var Xe={Promise:void 0},Ye={setTimeout:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setTimeout.apply(void 0,V([e,n],H(t)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function ie(e){Ye.setTimeout(function(){throw e})}function ue(){}function Je(e){e()}var $=(function(e){k(n,e);function n(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,re(t)&&t.add(r)):r.destination=We,r}return n.create=function(t,r,o){return new z(t,r,o)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n})(B),$e=(function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var t=this.partialObserver;if(t.next)try{t.next(n)}catch(r){N(r)}},e.prototype.error=function(n){var t=this.partialObserver;if(t.error)try{t.error(n)}catch(r){N(r)}else N(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(t){N(t)}},e})(),z=(function(e){k(n,e);function n(t,r,o){var i=e.call(this)||this,u;return b(t)||!t?u={next:t??void 0,error:r??void 0,complete:o??void 0}:u=t,i.destination=new $e(u),i}return n})($);function N(e){ie(e)}function ze(e){throw e}var We={closed:!0,next:ue,error:ze,complete:ue},W=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ae(e){return e}function Ke(e){return e.length===0?ae:e.length===1?e[0]:function(t){return e.reduce(function(r,o){return o(r)},t)}}var S=(function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(n,t,r){var o=this,i=Ze(n)?n:new z(n,t,r);return Je(function(){var u=o,s=u.operator,a=u.source;i.add(s?s.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(t){n.error(t)}},e.prototype.forEach=function(n,t){var r=this;return t=ce(t),new t(function(o,i){var u=new z({next:function(s){try{n(s)}catch(a){i(a),u.unsubscribe()}},error:i,complete:o});r.subscribe(u)})},e.prototype._subscribe=function(n){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(n)},e.prototype[W]=function(){return this},e.prototype.pipe=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Ke(n)(this)},e.prototype.toPromise=function(n){var t=this;return n=ce(n),new n(function(r,o){var i;t.subscribe(function(u){return i=u},function(u){return o(u)},function(){return r(i)})})},e.create=function(n){return new e(n)},e})();function ce(e){var n;return(n=e??Xe.Promise)!==null&&n!==void 0?n:Promise}function Qe(e){return e&&b(e.next)&&b(e.error)&&b(e.complete)}function Ze(e){return e&&e instanceof $||Qe(e)&&re(e)}function et(e){return b(e?.lift)}function A(e){return function(n){if(et(n))return n.lift(function(t){try{return e(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function E(e,n,t,r,o){return new tt(e,n,t,r,o)}var tt=(function(e){k(n,e);function n(t,r,o,i,u,s){var a=e.call(this,t)||this;return a.onFinalize=u,a.shouldUnsubscribe=s,a._next=r?function(c){try{r(c)}catch(f){t.error(f)}}:e.prototype._next,a._error=i?function(c){try{i(c)}catch(f){t.error(f)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},n})($),nt={now:function(){return Date.now()}},rt=(function(e){k(n,e);function n(t,r){return e.call(this)||this}return n.prototype.schedule=function(t,r){return this},n})(B),se={setInterval:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setInterval.apply(void 0,V([e,n],H(t)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},ot=(function(e){k(n,e);function n(t,r){var o=e.call(this,t,r)||this;return o.scheduler=t,o.work=r,o.pending=!1,o}return n.prototype.schedule=function(t,r){var o;if(r===void 0&&(r=0),this.closed)return this;this.state=t;var i=this.id,u=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(u,i,r)),this.pending=!0,this.delay=r,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(u,this.id,r),this},n.prototype.requestAsyncId=function(t,r,o){return o===void 0&&(o=0),se.setInterval(t.flush.bind(t,this),o)},n.prototype.recycleAsyncId=function(t,r,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return r;r!=null&&se.clearInterval(r)},n.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,r);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,r){var o=!1,i;try{this.work(t)}catch(u){o=!0,i=u||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,J(i,this),r!=null&&(this.id=this.recycleAsyncId(o,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n})(rt),fe=(function(){function e(n,t){t===void 0&&(t=e.now),this.schedulerActionCtor=n,this.now=t}return e.prototype.schedule=function(n,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,n).schedule(r,t)},e.now=nt.now,e})(),it=(function(e){k(n,e);function n(t,r){r===void 0&&(r=fe.now);var o=e.call(this,t,r)||this;return o.actions=[],o._active=!1,o}return n.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,o){for(;t=r.shift();)t.unsubscribe();throw o}},n})(fe),le=new it(ot),ut=le,at=new S(function(e){return e.complete()});function he(e){return e&&b(e.schedule)}function ct(e){return e[e.length-1]}function st(e){return he(ct(e))?e.pop():void 0}var de=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function ve(e){return b(e?.then)}function pe(e){return b(e[W])}function ye(e){return Symbol.asyncIterator&&b(e?.[Symbol.asyncIterator])}function me(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ft(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var we=ft();function be(e){return b(e?.[we])}function xe(e){return Ge(this,arguments,function(){var t,r,o,i;return ne(this,function(u){switch(u.label){case 0:t=e.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,D(t.read())];case 3:return r=u.sent(),o=r.value,i=r.done,i?[4,D(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,D(o)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ge(e){return b(e?.getReader)}function F(e){if(e instanceof S)return e;if(e!=null){if(pe(e))return lt(e);if(de(e))return ht(e);if(ve(e))return dt(e);if(ye(e))return Se(e);if(be(e))return vt(e);if(ge(e))return pt(e)}throw me(e)}function lt(e){return new S(function(n){var t=e[W]();if(b(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ht(e){return new S(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function dt(e){return new S(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,ie)})}function vt(e){return new S(function(n){var t,r;try{for(var o=_(e),i=o.next();!i.done;i=o.next()){var u=i.value;if(n.next(u),n.closed)return}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}n.complete()})}function Se(e){return new S(function(n){yt(e,n).catch(function(t){return n.error(t)})})}function pt(e){return Se(xe(e))}function yt(e,n){var t,r,o,i;return Ne(this,void 0,void 0,function(){var u,s;return ne(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=Me(e),a.label=1;case 1:return[4,t.next()];case 2:if(r=a.sent(),!!r.done)return[3,4];if(u=r.value,n.next(u),n.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),o={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),r&&!r.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function O(e,n,t,r,o){r===void 0&&(r=0),o===void 0&&(o=!1);var i=n.schedule(function(){t(),o?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(i),!o)return i}function Ae(e,n){return n===void 0&&(n=0),A(function(t,r){t.subscribe(E(r,function(o){return O(r,e,function(){return r.next(o)},n)},function(){return O(r,e,function(){return r.complete()},n)},function(o){return O(r,e,function(){return r.error(o)},n)}))})}function Ee(e,n){return n===void 0&&(n=0),A(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}function mt(e,n){return F(e).pipe(Ee(n),Ae(n))}function wt(e,n){return F(e).pipe(Ee(n),Ae(n))}function bt(e,n){return new S(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}function xt(e,n){return new S(function(t){var r;return O(t,n,function(){r=e[we](),O(t,n,function(){var o,i,u;try{o=r.next(),i=o.value,u=o.done}catch(s){t.error(s);return}u?t.complete():t.next(i)},0,!0)}),function(){return b(r?.return)&&r.return()}})}function Ie(e,n){if(!e)throw new Error("Iterable cannot be null");return new S(function(t){O(t,n,function(){var r=e[Symbol.asyncIterator]();O(t,n,function(){r.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}function gt(e,n){return Ie(xe(e),n)}function St(e,n){if(e!=null){if(pe(e))return mt(e,n);if(de(e))return bt(e,n);if(ve(e))return wt(e,n);if(ye(e))return Ie(e,n);if(be(e))return xt(e,n);if(ge(e))return gt(e,n)}throw me(e)}function At(e,n){return n?St(e,n):F(e)}function Et(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=st(e);return At(e,t)}var Te=X(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function It(e){return e instanceof Date&&!isNaN(e)}function K(e,n){return A(function(t,r){var o=0;t.subscribe(E(r,function(i){r.next(e.call(n,i,o++))}))})}function Tt(e,n,t,r,o,i,u,s){var a=[],c=0,f=0,h=!1,p=function(){h&&!a.length&&!c&&n.complete()},l=function(d){return c<r?x(d):a.push(d)},x=function(d){c++;var R=!1;F(t(d,f++)).subscribe(E(n,function(P){n.next(P)},function(){R=!0},void 0,function(){if(R)try{c--;for(var P=function(){var L=a.shift();u||x(L)};a.length&&c<r;)P();p()}catch(L){n.error(L)}}))};return e.subscribe(E(n,l,function(){h=!0,p()})),function(){}}function Pe(e,n,t){return t===void 0&&(t=1/0),b(n)?Pe(function(r,o){return K(function(i,u){return n(r,i,o,u)})(F(e(r,o)))},t):(typeof n=="number"&&(t=n),A(function(r,o){return Tt(r,o,e,t)}))}function Pt(e,n,t){e===void 0&&(e=0),t===void 0&&(t=ut);var r=-1;return n!=null&&(he(n)?t=n:r=n),new S(function(o){var i=It(e)?+e-t.now():e;i<0&&(i=0);var u=0;return t.schedule(function(){o.closed||(o.next(u++),0<=r?this.schedule(void 0,r):o.complete())},i)})}function Ot(e,n){return e===void 0&&(e=0),n===void 0&&(n=le),e<0&&(e=0),Pt(e,e,n)}function jt(e,n){return A(function(t,r){var o=0;t.subscribe(E(r,function(i){return e.call(n,i,o++)&&r.next(i)}))})}function Oe(e){return A(function(n,t){var r=null,o=!1,i;r=n.subscribe(E(t,void 0,void 0,function(u){i=F(e(u,Oe(e)(n))),r?(r.unsubscribe(),r=null,i.subscribe(t)):o=!0})),o&&(r.unsubscribe(),r=null,i.subscribe(t))})}function Rt(e,n,t,r,o){return function(i,u){var s=t,a=n,c=0;i.subscribe(E(u,function(f){var h=c++;a=s?e(a,f,h):(s=!0,f),u.next(a)},o))}}function Lt(e){return A(function(n,t){var r=!1;n.subscribe(E(t,function(o){r=!0,t.next(o)},function(){r||t.next(e),t.complete()}))})}function Ut(e){return e<=0?function(){return at}:A(function(n,t){var r=0;n.subscribe(E(t,function(o){++r<=e&&(t.next(o),e<=r&&t.complete())}))})}function kt(e){return e===void 0&&(e=Dt),A(function(n,t){var r=!1;n.subscribe(E(t,function(o){r=!0,t.next(o)},function(){return r?t.complete():t.error(e())}))})}function Dt(){return new Te}function Ft(e,n){var t=arguments.length>=2;return function(r){return r.pipe(e?jt(function(o,i){return e(o,i,r)}):ae,Ut(1),t?Lt(n):kt(function(){return new Te}))}}function qt(){return A(function(e,n){var t,r=!1;e.subscribe(E(n,function(o){var i=t;t=o,r&&n.next([i,o]),r=!0}))})}function Ct(e,n){return A(Rt(e,n,arguments.length>=2,!0))}function je(e){switch(e.responseType){case"json":{if("response"in e)return e.response;var n=e;return JSON.parse(n.responseText)}case"document":return e.responseXML;default:{if("response"in e)return e.response;var n=e;return n.responseText}}}var _t=(function(){function e(n,t,r,o){o===void 0&&(o="download_load"),this.originalEvent=n,this.xhr=t,this.request=r,this.type=o;var i=t.status,u=t.responseType;this.status=i??0,this.responseType=u??"";var s=t.getAllResponseHeaders();this.responseHeaders=s?s.split(`
4
- `).reduce(function(f,h){var p=h.indexOf(": ");return f[h.slice(0,p)]=h.slice(p+2),f},{}):{},this.response=je(t);var a=n.loaded,c=n.total;this.loaded=a,this.total=c}return e})(),G=X(function(e){return function(t,r,o){this.message=t,this.name="AjaxError",this.xhr=r,this.request=o,this.status=r.status,this.responseType=r.responseType;var i;try{i=je(r)}catch{i=r.responseText}this.response=i}}),Ht=(function(){function e(n,t){return G.call(this,"ajax timeout",n,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(G.prototype),e})();function Vt(e,n){return j({method:"GET",url:e,headers:n})}function Bt(e,n,t){return j({method:"POST",url:e,body:n,headers:t})}function Nt(e,n){return j({method:"DELETE",url:e,headers:n})}function Gt(e,n,t){return j({method:"PUT",url:e,body:n,headers:t})}function Mt(e,n,t){return j({method:"PATCH",url:e,body:n,headers:t})}var Xt=K(function(e){return e.response});function Yt(e,n){return Xt(j({method:"GET",url:e,headers:n}))}var j=(function(){var e=function(n){var t=typeof n=="string"?{url:n}:n;return $t(t)};return e.get=Vt,e.post=Bt,e.delete=Nt,e.put=Gt,e.patch=Mt,e.getJSON=Yt,e})(),Jt="upload",Re="download",Q="loadstart",Z="progress",Le="load";function $t(e){return new S(function(n){var t,r,o=C({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},e),i=o.queryParams,u=o.body,s=o.headers,a=o.url;if(!a)throw new TypeError("url is required");if(i){var c;if(a.includes("?")){var f=a.split("?");if(2<f.length)throw new TypeError("invalid url");c=new URLSearchParams(f[1]),new URLSearchParams(i).forEach(function(m,w){return c.set(w,m)}),a=f[0]+"?"+c}else c=new URLSearchParams(i),a=a+"?"+c}var h={};if(s)for(var p in s)s.hasOwnProperty(p)&&(h[p.toLowerCase()]=s[p]);var l=o.crossDomain;!l&&!("x-requested-with"in h)&&(h["x-requested-with"]="XMLHttpRequest");var x=o.withCredentials,d=o.xsrfCookieName,R=o.xsrfHeaderName;if((x||!l)&&d&&R){var P=(r=(t=document?.cookie.match(new RegExp("(^|;\\s*)("+d+")=([^;]*)")))===null||t===void 0?void 0:t.pop())!==null&&r!==void 0?r:"";P&&(h[R]=P)}var L=zt(u,h),I=C(C({},o),{url:a,headers:h,body:L}),v;v=e.createXHR?e.createXHR():new XMLHttpRequest;{var y=e.progressSubscriber,ke=e.includeDownloadProgress,cn=ke===void 0?!1:ke,De=e.includeUploadProgress,sn=De===void 0?!1:De,Fe=function(m,w){v.addEventListener(m,function(){var g,U=w();(g=y?.error)===null||g===void 0||g.call(y,U),n.error(U)})};Fe("timeout",function(){return new Ht(v,I)}),Fe("abort",function(){return new G("aborted",v,I)});var qe=function(m,w){return new _t(w,v,I,m+"_"+w.type)},Ce=function(m,w,g){m.addEventListener(w,function(U){n.next(qe(g,U))})};sn&&[Q,Z,Le].forEach(function(m){return Ce(v.upload,m,Jt)}),y&&[Q,Z].forEach(function(m){return v.upload.addEventListener(m,function(w){var g;return(g=y?.next)===null||g===void 0?void 0:g.call(y,w)})}),cn&&[Q,Z].forEach(function(m){return Ce(v,m,Re)});var _e=function(m){var w="ajax error"+(m?" "+m:"");n.error(new G(w,v,I))};v.addEventListener("error",function(m){var w;(w=y?.error)===null||w===void 0||w.call(y,m),_e()}),v.addEventListener(Le,function(m){var w,g,U=v.status;if(U<400){(w=y?.complete)===null||w===void 0||w.call(y);var Be=void 0;try{Be=qe(Re,m)}catch(fn){n.error(fn);return}n.next(Be),n.complete()}else(g=y?.error)===null||g===void 0||g.call(y,m),_e(U)})}var He=I.user,Ve=I.method,te=I.async;He?v.open(Ve,a,te,He,I.password):v.open(Ve,a,te),te&&(v.timeout=I.timeout,v.responseType=I.responseType),"withCredentials"in v&&(v.withCredentials=I.withCredentials);for(var p in h)h.hasOwnProperty(p)&&v.setRequestHeader(p,h[p]);return L?v.send(L):v.send(),function(){v&&v.readyState!==4&&v.abort()}})}function zt(e,n){var t;if(!e||typeof e=="string"||tn(e)||nn(e)||Kt(e)||Qt(e)||Zt(e)||rn(e))return e;if(en(e))return e.buffer;if(typeof e=="object")return n["content-type"]=(t=n["content-type"])!==null&&t!==void 0?t:"application/json;charset=utf-8",JSON.stringify(e);throw new TypeError("Unknown body type")}var Wt=Object.prototype.toString;function ee(e,n){return Wt.call(e)==="[object "+n+"]"}function Kt(e){return ee(e,"ArrayBuffer")}function Qt(e){return ee(e,"File")}function Zt(e){return ee(e,"Blob")}function en(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)}function tn(e){return typeof FormData<"u"&&e instanceof FormData}function nn(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function rn(e){return typeof ReadableStream<"u"&&e instanceof ReadableStream}const on=180*1e3,Ue=({versionCheckIntervalPeriod:e=on,onNewVersionAvailable:n})=>{const t=()=>j({url:"/version",responseType:"text",headers:{"Cache-Control":"no-store"}}).pipe(K(o=>{const i=o.response;return typeof i=="string"?i.trim():null}),Oe(()=>Et(null))),r=Ot(e).pipe(Pe(t),Ct((o,i)=>i??o),qt(),Ft(([o,i])=>!!o&&o!==i)).subscribe(()=>{n(),r.unsubscribe()});return()=>r.unsubscribe()};function un({message:e="A new version of the app is available. Please reload the page to access latest features."}){return q.useEffect(()=>Ue({onNewVersionAvailable:()=>{globalThis.confirm(e)&&globalThis.location.reload()}}),[e]),null}function an(e={}){const{envVarName:n="APP_VERSION"}=e;return{name:"vite-plugin-force-update",generateBundle(){const t=process.env[n];if(!t){console.warn(`Environment variable ${n} is not set.`);return}this.emitFile({type:"asset",fileName:"version",source:t.trim()})}}}T.ForceUpdateNotification=un,T.listenOnForceUpdate=Ue,T.vitePluginForceUpdate=an,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(T,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","react","rxjs"],k):(T=typeof globalThis<"u"?globalThis:T||self,k(T["@leancodepl/force-update"]={},T.react,T.rxjs))})(this,(function(T,k,ee){"use strict";var C=function(e,r){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},C(e,r)};function _(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");C(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var F=function(){return F=Object.assign||function(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}return r},F.apply(this,arguments)};function Pe(e,r,t,n){function i(o){return o instanceof t?o:new t(function(u){u(o)})}return new(t||(t=Promise))(function(o,u){function s(f){try{c(n.next(f))}catch(d){u(d)}}function a(f){try{c(n.throw(f))}catch(d){u(d)}}function c(f){f.done?o(f.value):i(f.value).then(s,a)}c((n=n.apply(e,r||[])).next())})}function te(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(c){return function(f){return a([c,f])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(t=0)),t;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1],o=c;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(c);break}o[2]&&t.ops.pop(),t.trys.pop();continue}c=r.call(e,t)}catch(f){c=[6,f],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function q(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),i,o=[],u;try{for(;(r===void 0||r-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){u={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(u)throw u.error}}return o}function V(e,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,o;n<i;n++)(o||!(n in r))&&(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return e.concat(o||Array.prototype.slice.call(r))}function U(e){return this instanceof U?(this.v=e,this):new U(e)}function Ae(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(e,r||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(l){return function(x){return Promise.resolve(x).then(l,d)}}function s(l,x){n[l]&&(i[l]=function(h){return new Promise(function(I,A){o.push([l,h,I,A])>1||a(l,h)})},x&&(i[l]=x(i[l])))}function a(l,x){try{c(n[l](x))}catch(h){p(o[0][3],h)}}function c(l){l.value instanceof U?Promise.resolve(l.value.v).then(f,d):p(o[0][2],l)}function f(l){a("next",l)}function d(l){a("throw",l)}function p(l,x){l(x),o.shift(),o.length&&a(o[0][0],o[0][1])}}function je(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof q=="function"?q(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(o){t[o]=e[o]&&function(u){return new Promise(function(s,a){u=e[o](u),i(s,a,u.done,u.value)})}}function i(o,u,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},u)}}typeof SuppressedError=="function"&&SuppressedError;function w(e){return typeof e=="function"}function Ie(e){return w(e?.lift)}function O(e){return function(r){if(Ie(r))return r.lift(function(t){try{return e(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function G(e){var r=function(n){Error.call(n),n.stack=new Error().stack},t=e(r);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var M=G(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function re(e,r){if(e){var t=e.indexOf(r);0<=t&&e.splice(t,1)}}var N=(function(){function e(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var r,t,n,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var s=q(u),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(r)throw r.error}}else u.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(h){o=h instanceof M?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=q(d),l=p.next();!l.done;l=p.next()){var x=l.value;try{oe(x)}catch(h){o=o??[],h instanceof M?o=V(V([],B(o)),B(h.errors)):o.push(h)}}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}if(o)throw new M(o)}},e.prototype.add=function(r){var t;if(r&&r!==this)if(this.closed)oe(r);else{if(r instanceof e){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(r)}},e.prototype._hasParent=function(r){var t=this._parentage;return t===r||Array.isArray(t)&&t.includes(r)},e.prototype._addParent=function(r){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(r),t):t?[t,r]:r},e.prototype._removeParent=function(r){var t=this._parentage;t===r?this._parentage=null:Array.isArray(t)&&re(t,r)},e.prototype.remove=function(r){var t=this._finalizers;t&&re(t,r),r instanceof e&&r._removeParent(this)},e.EMPTY=(function(){var r=new e;return r.closed=!0,r})(),e})();N.EMPTY;function ne(e){return e instanceof N||e&&"closed"in e&&w(e.remove)&&w(e.add)&&w(e.unsubscribe)}function oe(e){w(e)?e():e.unsubscribe()}var Re={Promise:void 0},Le={setTimeout:function(e,r){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,V([e,r],B(t)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function ie(e){Le.setTimeout(function(){throw e})}function ue(){}function Ue(e){e()}var X=(function(e){_(r,e);function r(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ne(t)&&t.add(n)):n.destination=qe,n}return r.create=function(t,n,i){return new Y(t,n,i)},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r})(N),ke=(function(){function e(r){this.partialObserver=r}return e.prototype.next=function(r){var t=this.partialObserver;if(t.next)try{t.next(r)}catch(n){D(n)}},e.prototype.error=function(r){var t=this.partialObserver;if(t.error)try{t.error(r)}catch(n){D(n)}else D(r)},e.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(t){D(t)}},e})(),Y=(function(e){_(r,e);function r(t,n,i){var o=e.call(this)||this,u;return w(t)||!t?u={next:t??void 0,error:n??void 0,complete:i??void 0}:u=t,o.destination=new ke(u),o}return r})(X);function D(e){ie(e)}function Fe(e){throw e}var qe={closed:!0,next:ue,error:Fe,complete:ue};function g(e,r,t,n,i){return new De(e,r,t,n,i)}var De=(function(e){_(r,e);function r(t,n,i,o,u,s){var a=e.call(this,t)||this;return a.onFinalize=u,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(f){t.error(f)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(f){t.error(f)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return r.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},r})(X);function J(e,r){return O(function(t,n){var i=0;t.subscribe(g(n,function(o){n.next(e.call(r,o,i++))}))})}var $=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ae(e){return e}function He(e){return e.length===0?ae:e.length===1?e[0]:function(t){return e.reduce(function(n,i){return i(n)},t)}}var P=(function(){function e(r){r&&(this._subscribe=r)}return e.prototype.lift=function(r){var t=new e;return t.source=this,t.operator=r,t},e.prototype.subscribe=function(r,t,n){var i=this,o=_e(r)?r:new Y(r,t,n);return Ue(function(){var u=i,s=u.operator,a=u.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(t){r.error(t)}},e.prototype.forEach=function(r,t){var n=this;return t=ce(t),new t(function(i,o){var u=new Y({next:function(s){try{r(s)}catch(a){o(a),u.unsubscribe()}},error:o,complete:i});n.subscribe(u)})},e.prototype._subscribe=function(r){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(r)},e.prototype[$]=function(){return this},e.prototype.pipe=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return He(r)(this)},e.prototype.toPromise=function(r){var t=this;return r=ce(r),new r(function(n,i){var o;t.subscribe(function(u){return o=u},function(u){return i(u)},function(){return n(o)})})},e.create=function(r){return new e(r)},e})();function ce(e){var r;return(r=e??Re.Promise)!==null&&r!==void 0?r:Promise}function Ce(e){return e&&w(e.next)&&w(e.error)&&w(e.complete)}function _e(e){return e&&e instanceof X||Ce(e)&&ne(e)}function se(e){switch(e.responseType){case"json":{if("response"in e)return e.response;var r=e;return JSON.parse(r.responseText)}case"document":return e.responseXML;default:{if("response"in e)return e.response;var r=e;return r.responseText}}}var Be=(function(){function e(r,t,n,i){i===void 0&&(i="download_load"),this.originalEvent=r,this.xhr=t,this.request=n,this.type=i;var o=t.status,u=t.responseType;this.status=o??0,this.responseType=u??"";var s=t.getAllResponseHeaders();this.responseHeaders=s?s.split(`
4
+ `).reduce(function(f,d){var p=d.indexOf(": ");return f[d.slice(0,p)]=d.slice(p+2),f},{}):{},this.response=se(t);var a=r.loaded,c=r.total;this.loaded=a,this.total=c}return e})(),H=G(function(e){return function(t,n,i){this.message=t,this.name="AjaxError",this.xhr=n,this.request=i,this.status=n.status,this.responseType=n.responseType;var o;try{o=se(n)}catch{o=n.responseText}this.response=o}}),Ve=(function(){function e(r,t){return H.call(this,"ajax timeout",r,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(H.prototype),e})();function Ge(e,r){return j({method:"GET",url:e,headers:r})}function Me(e,r,t){return j({method:"POST",url:e,body:r,headers:t})}function Ne(e,r){return j({method:"DELETE",url:e,headers:r})}function Xe(e,r,t){return j({method:"PUT",url:e,body:r,headers:t})}function Ye(e,r,t){return j({method:"PATCH",url:e,body:r,headers:t})}var Je=J(function(e){return e.response});function $e(e,r){return Je(j({method:"GET",url:e,headers:r}))}var j=(function(){var e=function(r){var t=typeof r=="string"?{url:r}:r;return We(t)};return e.get=Ge,e.post=Me,e.delete=Ne,e.put=Xe,e.patch=Ye,e.getJSON=$e,e})(),ze="upload",fe="download",z="loadstart",W="progress",le="load";function We(e){return new P(function(r){var t,n,i=F({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},e),o=i.queryParams,u=i.body,s=i.headers,a=i.url;if(!a)throw new TypeError("url is required");if(o){var c;if(a.includes("?")){var f=a.split("?");if(2<f.length)throw new TypeError("invalid url");c=new URLSearchParams(f[1]),new URLSearchParams(o).forEach(function(m,b){return c.set(b,m)}),a=f[0]+"?"+c}else c=new URLSearchParams(o),a=a+"?"+c}var d={};if(s)for(var p in s)s.hasOwnProperty(p)&&(d[p.toLowerCase()]=s[p]);var l=i.crossDomain;!l&&!("x-requested-with"in d)&&(d["x-requested-with"]="XMLHttpRequest");var x=i.withCredentials,h=i.xsrfCookieName,I=i.xsrfHeaderName;if((x||!l)&&h&&I){var A=(n=(t=document?.cookie.match(new RegExp("(^|;\\s*)("+h+")=([^;]*)")))===null||t===void 0?void 0:t.pop())!==null&&n!==void 0?n:"";A&&(d[I]=A)}var R=Ke(u,d),E=F(F({},i),{url:a,headers:d,body:R}),v;v=e.createXHR?e.createXHR():new XMLHttpRequest;{var y=e.progressSubscriber,me=e.includeDownloadProgress,Dt=me===void 0?!1:me,be=e.includeUploadProgress,Ht=be===void 0?!1:be,we=function(m,b){v.addEventListener(m,function(){var S,L=b();(S=y?.error)===null||S===void 0||S.call(y,L),r.error(L)})};we("timeout",function(){return new Ve(v,E)}),we("abort",function(){return new H("aborted",v,E)});var xe=function(m,b){return new Be(b,v,E,m+"_"+b.type)},Se=function(m,b,S){m.addEventListener(b,function(L){r.next(xe(S,L))})};Ht&&[z,W,le].forEach(function(m){return Se(v.upload,m,ze)}),y&&[z,W].forEach(function(m){return v.upload.addEventListener(m,function(b){var S;return(S=y?.next)===null||S===void 0?void 0:S.call(y,b)})}),Dt&&[z,W].forEach(function(m){return Se(v,m,fe)});var Ee=function(m){var b="ajax error"+(m?" "+m:"");r.error(new H(b,v,E))};v.addEventListener("error",function(m){var b;(b=y?.error)===null||b===void 0||b.call(y,m),Ee()}),v.addEventListener(le,function(m){var b,S,L=v.status;if(L<400){(b=y?.complete)===null||b===void 0||b.call(y);var Oe=void 0;try{Oe=xe(fe,m)}catch(Ct){r.error(Ct);return}r.next(Oe),r.complete()}else(S=y?.error)===null||S===void 0||S.call(y,m),Ee(L)})}var Te=E.user,ge=E.method,Z=E.async;Te?v.open(ge,a,Z,Te,E.password):v.open(ge,a,Z),Z&&(v.timeout=E.timeout,v.responseType=E.responseType),"withCredentials"in v&&(v.withCredentials=E.withCredentials);for(var p in d)d.hasOwnProperty(p)&&v.setRequestHeader(p,d[p]);return R?v.send(R):v.send(),function(){v&&v.readyState!==4&&v.abort()}})}function Ke(e,r){var t;if(!e||typeof e=="string"||nt(e)||ot(e)||Ze(e)||et(e)||tt(e)||it(e))return e;if(rt(e))return e.buffer;if(typeof e=="object")return r["content-type"]=(t=r["content-type"])!==null&&t!==void 0?t:"application/json;charset=utf-8",JSON.stringify(e);throw new TypeError("Unknown body type")}var Qe=Object.prototype.toString;function K(e,r){return Qe.call(e)==="[object "+r+"]"}function Ze(e){return K(e,"ArrayBuffer")}function et(e){return K(e,"File")}function tt(e){return K(e,"Blob")}function rt(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)}function nt(e){return typeof FormData<"u"&&e instanceof FormData}function ot(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function it(e){return typeof ReadableStream<"u"&&e instanceof ReadableStream}var ut=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function at(e){return w(e?.then)}function ct(e){return w(e[$])}function st(e){return Symbol.asyncIterator&&w(e?.[Symbol.asyncIterator])}function ft(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function lt(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dt=lt();function ht(e){return w(e?.[dt])}function vt(e){return Ae(this,arguments,function(){var t,n,i,o;return te(this,function(u){switch(u.label){case 0:t=e.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,U(t.read())];case 3:return n=u.sent(),i=n.value,o=n.done,o?[4,U(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,U(i)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function pt(e){return w(e?.getReader)}function Q(e){if(e instanceof P)return e;if(e!=null){if(ct(e))return yt(e);if(ut(e))return mt(e);if(at(e))return bt(e);if(st(e))return de(e);if(ht(e))return wt(e);if(pt(e))return xt(e)}throw ft(e)}function yt(e){return new P(function(r){var t=e[$]();if(w(t.subscribe))return t.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function mt(e){return new P(function(r){for(var t=0;t<e.length&&!r.closed;t++)r.next(e[t]);r.complete()})}function bt(e){return new P(function(r){e.then(function(t){r.closed||(r.next(t),r.complete())},function(t){return r.error(t)}).then(null,ie)})}function wt(e){return new P(function(r){var t,n;try{for(var i=q(e),o=i.next();!o.done;o=i.next()){var u=o.value;if(r.next(u),r.closed)return}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}r.complete()})}function de(e){return new P(function(r){St(e,r).catch(function(t){return r.error(t)})})}function xt(e){return de(vt(e))}function St(e,r){var t,n,i,o;return Pe(this,void 0,void 0,function(){var u,s;return te(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=je(e),a.label=1;case 1:return[4,t.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(u=n.value,r.next(u),r.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=t.return)?[4,o.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}function _t(e,r,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=r.schedule(function(){t(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}function he(e){return O(function(r,t){var n=null,i=!1,o;n=r.subscribe(g(t,void 0,void 0,function(u){o=Q(e(u,he(e)(r))),n?(n.unsubscribe(),n=null,o.subscribe(t)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(t))})}function Et(e,r,t,n,i,o,u,s){var a=[],c=0,f=0,d=!1,p=function(){d&&!a.length&&!c&&r.complete()},l=function(h){return c<n?x(h):a.push(h)},x=function(h){c++;var I=!1;Q(t(h,f++)).subscribe(g(r,function(A){r.next(A)},function(){I=!0},void 0,function(){if(I)try{c--;for(var A=function(){var R=a.shift();u||x(R)};a.length&&c<n;)A();p()}catch(R){r.error(R)}}))};return e.subscribe(g(r,l,function(){d=!0,p()})),function(){}}function ve(e,r,t){return t===void 0&&(t=1/0),w(r)?ve(function(n,i){return J(function(o,u){return r(n,o,i,u)})(Q(e(n,i)))},t):(typeof r=="number"&&(t=r),O(function(n,i){return Et(n,i,e,t)}))}function Tt(e,r,t,n,i){return function(o,u){var s=t,a=r,c=0;o.subscribe(g(u,function(f){var d=c++;a=s?e(a,f,d):(s=!0,f),u.next(a)},i))}}function gt(e){return O(function(r,t){var n=!1;r.subscribe(g(t,function(i){n=!0,t.next(i)},function(){n||t.next(e),t.complete()}))})}var Ot=new P(function(e){return e.complete()});function Pt(e){return e<=0?function(){return Ot}:O(function(r,t){var n=0;r.subscribe(g(t,function(i){++n<=e&&(t.next(i),e<=n&&t.complete())}))})}function At(e,r){return O(function(t,n){var i=0;t.subscribe(g(n,function(o){return e.call(r,o,i++)&&n.next(o)}))})}var pe=G(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function jt(e){return e===void 0&&(e=It),O(function(r,t){var n=!1;r.subscribe(g(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(e())}))})}function It(){return new pe}function Rt(e,r){var t=arguments.length>=2;return function(n){return n.pipe(e?At(function(i,o){return e(i,o,n)}):ae,Pt(1),t?gt(r):jt(function(){return new pe}))}}function Lt(){return O(function(e,r){var t,n=!1;e.subscribe(g(r,function(i){var o=t;t=i,n&&r.next([o,i]),n=!0}))})}function Ut(e,r){return O(Tt(e,r,arguments.length>=2,!0))}const kt=180*1e3,ye=({versionCheckIntervalPeriod:e=kt,onNewVersionAvailable:r})=>{const t=()=>j({url:"/version",responseType:"text",headers:{"Cache-Control":"no-store"}}).pipe(J(i=>{const o=i.response;return typeof o=="string"?o.trim():null}),he(()=>ee.of(null))),n=ee.interval(e).pipe(ve(t),Ut((i,o)=>o??i),Lt(),Rt(([i,o])=>!!i&&i!==o)).subscribe(()=>{r(),n.unsubscribe()});return()=>n.unsubscribe()};function Ft({message:e="A new version of the app is available. Please reload the page to access latest features."}){return k.useEffect(()=>ye({onNewVersionAvailable:()=>{globalThis.confirm(e)&&globalThis.location.reload()}}),[e]),null}function qt(e={}){const{envVarName:r="APP_VERSION"}=e;return{name:"vite-plugin-force-update",generateBundle(){const t=process.env[r];if(!t){console.warn(`Environment variable ${r} is not set.`);return}this.emitFile({type:"asset",fileName:"version",source:t.trim()})}}}T.ForceUpdateNotification=Ft,T.listenOnForceUpdate=ye,T.vitePluginForceUpdate=qt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leancodepl/force-update",
3
- "version": "9.7.4",
3
+ "version": "10.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",