@ancon/wildcat-utils 1.51.0-check-optimizations.1 → 1.51.0-check-optimizations.3

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.
Files changed (81) hide show
  1. package/{_baseIsEqual-5e6adb07.mjs → _baseIsEqual-4ee44a4c.mjs} +1 -1
  2. package/{_baseIsEqual-ad544573.js → _baseIsEqual-7e335f42.js} +1 -1
  3. package/_baseIteratee-374c60ca.js +1 -0
  4. package/{_baseIteratee-db1f278d.mjs → _baseIteratee-5fbe491c.mjs} +21 -20
  5. package/_getTag-3d3032da.js +1 -0
  6. package/{_getTag-fcc5160b.mjs → _getTag-ebc0f90e.mjs} +20 -24
  7. package/api/getMediaImageClosestSize.d.ts +2 -0
  8. package/api/getMediaImageClosestSize.js +1 -0
  9. package/api/getMediaImageClosestSize.mjs +31 -0
  10. package/api/index.d.ts +2 -1
  11. package/api/index.js +1 -1
  12. package/api/index.mjs +8 -6
  13. package/card/getPrepaidWalletScanReadingInfo.d.ts +7 -0
  14. package/card/getPrepaidWalletScanReadingInfo.js +1 -0
  15. package/card/getPrepaidWalletScanReadingInfo.mjs +32 -0
  16. package/card/getScannedWalletReadingInfo.d.ts +1 -0
  17. package/card/index.d.ts +2 -0
  18. package/card/index.js +1 -1
  19. package/card/index.mjs +7 -4
  20. package/check/getOrganizedCheckItemModifications.js +1 -1
  21. package/check/getOrganizedCheckItemModifications.mjs +65 -64
  22. package/check/index.js +1 -1
  23. package/check/index.mjs +9 -8
  24. package/checkout/getCheckoutOrderStatusTexts.js +1 -1
  25. package/checkout/getCheckoutOrderStatusTexts.mjs +7 -6
  26. package/checkout/index.js +1 -1
  27. package/checkout/index.mjs +61 -60
  28. package/checkout/isCheckoutItemsAreEqual.js +1 -1
  29. package/checkout/isCheckoutItemsAreEqual.mjs +8 -7
  30. package/hangfire/createHangfirePoller.d.ts +13 -2
  31. package/hangfire/createHangfirePoller.js +1 -1
  32. package/hangfire/createHangfirePoller.mjs +153 -87
  33. package/hangfire/createMakeHangfireRequest.d.ts +2 -0
  34. package/hangfire/createMakeHangfireRequest.js +1 -1
  35. package/hangfire/createMakeHangfireRequest.mjs +18 -17
  36. package/{identity-cf449299.mjs → identity-41198897.mjs} +1 -1
  37. package/{identity-2a048185.js → identity-58f9497d.js} +1 -1
  38. package/index.d.ts +1 -0
  39. package/index.js +1 -1
  40. package/index.mjs +372 -365
  41. package/isObject-361bd834.js +1 -0
  42. package/isObject-b8638513.mjs +7 -0
  43. package/multilingual/createLocalizedCheckDetails.d.ts +16 -0
  44. package/multilingual/createLocalizedCheckDetails.js +1 -0
  45. package/multilingual/createLocalizedCheckDetails.mjs +53 -0
  46. package/multilingual/index.d.ts +2 -0
  47. package/multilingual/index.js +1 -0
  48. package/multilingual/index.mjs +5 -0
  49. package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
  50. package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +7 -6
  51. package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
  52. package/order/getCheckOrderMinimumStatusTicketItem.mjs +20 -19
  53. package/order/index.js +1 -1
  54. package/order/index.mjs +11 -10
  55. package/outlet/getOutletCurrentClosingTimeText.js +1 -1
  56. package/outlet/getOutletCurrentClosingTimeText.mjs +10 -9
  57. package/outlet/getOutletTodayOpeningTimes.js +1 -1
  58. package/outlet/getOutletTodayOpeningTimes.mjs +7 -6
  59. package/outlet/index.d.ts +2 -1
  60. package/outlet/index.js +1 -1
  61. package/outlet/index.mjs +71 -68
  62. package/outlet/isOutletAcceptingPreOrdersWhenClosed.d.ts +2 -0
  63. package/outlet/isOutletAcceptingPreOrdersWhenClosed.js +1 -0
  64. package/outlet/isOutletAcceptingPreOrdersWhenClosed.mjs +14 -0
  65. package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
  66. package/outlet/serviceDateTimesFromOpeningHours.mjs +29 -28
  67. package/package.json +26 -1
  68. package/preOrder/isGroupPreOrder.d.ts +6 -4
  69. package/preOrder/isGroupPreOrder.js +1 -1
  70. package/preOrder/isGroupPreOrder.mjs +4 -4
  71. package/preOrder/isPreOrderLink.d.ts +6 -4
  72. package/preOrder/isPreOrderLink.js +1 -1
  73. package/preOrder/isPreOrderLink.mjs +4 -4
  74. package/preOrder/isPreOrderSharable.d.ts +6 -4
  75. package/preOrder/isPreOrderSharable.js +1 -1
  76. package/preOrder/isPreOrderSharable.mjs +1 -1
  77. package/signalr/SignalR.js +1 -1
  78. package/signalr/SignalR.mjs +62 -62
  79. package/signalr/types.d.ts +2 -0
  80. package/_baseIteratee-ae97e42e.js +0 -1
  81. package/_getTag-d4cd1660.js +0 -1
@@ -1 +1 @@
1
- "use strict";const Q=require("../toString-b771abdf.js"),o=require("../_getTag-d4cd1660.js"),f=require("../isObjectLike-963267e9.js"),T=require("../identity-2a048185.js"),X=require("../_baseSlice-e1b41ceb.js");function Z(e,n){for(var r=-1,t=e==null?0:e.length;++r<t&&n(e[r],r,e)!==!1;);return e}var V=function(){try{var e=o.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}}();const v=V;function M(e,n,r){n=="__proto__"&&v?v(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var z=Object.prototype,k=z.hasOwnProperty;function N(e,n,r){var t=e[n];(!(k.call(e,n)&&o.eq(t,r))||r===void 0&&!(n in e))&&M(e,n,r)}function d(e,n,r,t){var a=!r;r||(r={});for(var c=-1,u=n.length;++c<u;){var s=n[c],l=t?t(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),a?M(r,s,l):N(r,s,l)}return r}function ee(e,n){return e&&d(n,o.keys(n),e)}function ne(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var re=Object.prototype,te=re.hasOwnProperty;function oe(e){if(!o.isObject(e))return ne(e);var n=o.isPrototype(e),r=[];for(var t in e)t=="constructor"&&(n||!te.call(e,t))||r.push(t);return r}function O(e){return o.isArrayLike(e)?o.arrayLikeKeys(e,!0):oe(e)}function ae(e,n){return e&&d(n,O(n),e)}var B=typeof exports=="object"&&exports&&!exports.nodeType&&exports,w=B&&typeof module=="object"&&module&&!module.nodeType&&module,ie=w&&w.exports===B,P=ie?f.root.Buffer:void 0,F=P?P.allocUnsafe:void 0;function ce(e,n){if(n)return e.slice();var r=e.length,t=F?F(r):new e.constructor(r);return e.copy(t),t}function ue(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function se(e,n){return d(e,o.getSymbols(e),n)}var fe=o.overArg(Object.getPrototypeOf,Object);const A=fe;var le=Object.getOwnPropertySymbols,ge=le?function(e){for(var n=[];e;)o.arrayPush(n,o.getSymbols(e)),e=A(e);return n}:o.stubArray;const D=ge;function be(e,n){return d(e,D(e),n)}function G(e){return o.baseGetAllKeys(e,O,D)}var ye=Object.prototype,Te=ye.hasOwnProperty;function de(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Te.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function h(e){var n=new e.constructor(e.byteLength);return new o.Uint8Array(n).set(new o.Uint8Array(e)),n}function pe(e,n){var r=n?h(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ve=/\w*$/;function Oe(e){var n=new e.constructor(e.source,ve.exec(e));return n.lastIndex=e.lastIndex,n}var C=f.Symbol?f.Symbol.prototype:void 0,L=C?C.valueOf:void 0;function Ae(e){return L?Object(L.call(e)):{}}function he(e,n){var r=n?h(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Se="[object Boolean]",je="[object Date]",$e="[object Map]",me="[object Number]",we="[object RegExp]",Pe="[object Set]",Fe="[object String]",Ce="[object Symbol]",Le="[object ArrayBuffer]",Ie="[object DataView]",Ue="[object Float32Array]",_e="[object Float64Array]",xe="[object Int8Array]",Ee="[object Int16Array]",Me="[object Int32Array]",Ne="[object Uint8Array]",Be="[object Uint8ClampedArray]",De="[object Uint16Array]",Ge="[object Uint32Array]";function Ke(e,n,r){var t=e.constructor;switch(n){case Le:return h(e);case Se:case je:return new t(+e);case Ie:return pe(e,r);case Ue:case _e:case xe:case Ee:case Me:case Ne:case Be:case De:case Ge:return he(e,r);case $e:return new t;case me:case Fe:return new t(e);case we:return Oe(e);case Pe:return new t;case Ce:return Ae(e)}}var I=Object.create,qe=function(){function e(){}return function(n){if(!o.isObject(n))return{};if(I)return I(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();const Re=qe;function He(e){return typeof e.constructor=="function"&&!o.isPrototype(e)?Re(A(e)):{}}var Ye="[object Map]";function We(e){return f.isObjectLike(e)&&o.getTag(e)==Ye}var U=o.nodeUtil&&o.nodeUtil.isMap,Je=U?o.baseUnary(U):We;const Qe=Je;var Xe="[object Set]";function Ze(e){return f.isObjectLike(e)&&o.getTag(e)==Xe}var _=o.nodeUtil&&o.nodeUtil.isSet,Ve=_?o.baseUnary(_):Ze;const ze=Ve;var ke=1,en=2,nn=4,K="[object Arguments]",rn="[object Array]",tn="[object Boolean]",on="[object Date]",an="[object Error]",q="[object Function]",cn="[object GeneratorFunction]",un="[object Map]",sn="[object Number]",R="[object Object]",fn="[object RegExp]",ln="[object Set]",gn="[object String]",bn="[object Symbol]",yn="[object WeakMap]",Tn="[object ArrayBuffer]",dn="[object DataView]",pn="[object Float32Array]",vn="[object Float64Array]",On="[object Int8Array]",An="[object Int16Array]",hn="[object Int32Array]",Sn="[object Uint8Array]",jn="[object Uint8ClampedArray]",$n="[object Uint16Array]",mn="[object Uint32Array]",i={};i[K]=i[rn]=i[Tn]=i[dn]=i[tn]=i[on]=i[pn]=i[vn]=i[On]=i[An]=i[hn]=i[un]=i[sn]=i[R]=i[fn]=i[ln]=i[gn]=i[bn]=i[Sn]=i[jn]=i[$n]=i[mn]=!0;i[an]=i[q]=i[yn]=!1;function p(e,n,r,t,a,c){var u,s=n&ke,l=n&en,W=n&nn;if(r&&(u=a?r(e,t,a,c):r(e)),u!==void 0)return u;if(!o.isObject(e))return e;var S=f.isArray(e);if(S){if(u=de(e),!s)return ue(e,u)}else{var y=o.getTag(e),j=y==q||y==cn;if(o.isBuffer(e))return ce(e,s);if(y==R||y==K||j&&!a){if(u=l||j?{}:He(e),!s)return l?be(e,ae(u,e)):se(e,ee(u,e))}else{if(!i[y])return a?e:{};u=Ke(e,y,s)}}c||(c=new o.Stack);var $=c.get(e);if($)return $;c.set(e,u),ze(e)?e.forEach(function(g){u.add(p(g,n,r,g,e,c))}):Qe(e)&&e.forEach(function(g,b){u.set(b,p(g,n,r,b,e,c))});var J=W?l?G:o.getAllKeys:l?O:o.keys,m=S?void 0:J(e);return Z(m||e,function(g,b){m&&(b=g,g=e[b]),N(u,b,p(g,n,r,b,e,c))}),u}function wn(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function Pn(e,n){return n.length<2?e:T.baseGet(e,X.baseSlice(n,0,-1))}function Fn(e,n){return n=T.castPath(n,e),e=Pn(e,n),e==null||delete e[T.toKey(wn(n))]}var Cn="[object Object]",Ln=Function.prototype,In=Object.prototype,H=Ln.toString,Un=In.hasOwnProperty,_n=H.call(Object);function xn(e){if(!f.isObjectLike(e)||f.baseGetTag(e)!=Cn)return!1;var n=A(e);if(n===null)return!0;var r=Un.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&H.call(r)==_n}function En(e){return xn(e)?void 0:e}var x=f.Symbol?f.Symbol.isConcatSpreadable:void 0;function Mn(e){return f.isArray(e)||o.isArguments(e)||!!(x&&e&&e[x])}function Y(e,n,r,t,a){var c=-1,u=e.length;for(r||(r=Mn),a||(a=[]);++c<u;){var s=e[c];n>0&&r(s)?n>1?Y(s,n-1,r,t,a):o.arrayPush(a,s):t||(a[a.length]=s)}return a}function Nn(e){var n=e==null?0:e.length;return n?Y(e,1):[]}function Bn(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}var E=Math.max;function Dn(e,n,r){return n=E(n===void 0?e.length-1:n,0),function(){for(var t=arguments,a=-1,c=E(t.length-n,0),u=Array(c);++a<c;)u[a]=t[n+a];a=-1;for(var s=Array(n+1);++a<n;)s[a]=t[a];return s[n]=r(u),Bn(e,this,s)}}function Gn(e){return function(){return e}}var Kn=v?function(e,n){return v(e,"toString",{configurable:!0,enumerable:!1,value:Gn(n),writable:!0})}:T.identity;const qn=Kn;var Rn=800,Hn=16,Yn=Date.now;function Wn(e){var n=0,r=0;return function(){var t=Yn(),a=Hn-(t-r);if(r=t,a>0){if(++n>=Rn)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var Jn=Wn(qn);const Qn=Jn;function Xn(e){return Qn(Dn(e,void 0,Nn),e+"")}var Zn=1,Vn=2,zn=4,kn=Xn(function(e,n){var r={};if(e==null)return r;var t=!1;n=Q.arrayMap(n,function(c){return c=T.castPath(c,e),t||(t=c.length>1),c}),d(e,G(e),r),t&&(r=p(r,Zn|Vn|zn,En));for(var a=n.length;a--;)Fn(r,n[a]);return r});const er=kn;function nr({openingHours:e}){const n=e.reduce((r,t)=>(r[t.orderFormat]||(r[t.orderFormat]={orderFormats:t.orderFormat,intervals:[],isDefault:t.isDefault}),r[t.orderFormat].intervals.push(er(t,"orderFormat")),r),{});return Object.values(n)}module.exports=nr;
1
+ "use strict";const X=require("../toString-b771abdf.js"),o=require("../_getTag-3d3032da.js"),O=require("../isObject-361bd834.js"),f=require("../isObjectLike-963267e9.js"),T=require("../identity-58f9497d.js"),Z=require("../_baseSlice-e1b41ceb.js");function V(e,n){for(var r=-1,t=e==null?0:e.length;++r<t&&n(e[r],r,e)!==!1;);return e}var z=function(){try{var e=o.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}}();const v=z;function N(e,n,r){n=="__proto__"&&v?v(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var k=Object.prototype,ee=k.hasOwnProperty;function B(e,n,r){var t=e[n];(!(ee.call(e,n)&&o.eq(t,r))||r===void 0&&!(n in e))&&N(e,n,r)}function d(e,n,r,t){var a=!r;r||(r={});for(var c=-1,u=n.length;++c<u;){var s=n[c],l=t?t(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),a?N(r,s,l):B(r,s,l)}return r}function ne(e,n){return e&&d(n,o.keys(n),e)}function re(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var te=Object.prototype,oe=te.hasOwnProperty;function ae(e){if(!O.isObject(e))return re(e);var n=o.isPrototype(e),r=[];for(var t in e)t=="constructor"&&(n||!oe.call(e,t))||r.push(t);return r}function A(e){return o.isArrayLike(e)?o.arrayLikeKeys(e,!0):ae(e)}function ie(e,n){return e&&d(n,A(n),e)}var D=typeof exports=="object"&&exports&&!exports.nodeType&&exports,P=D&&typeof module=="object"&&module&&!module.nodeType&&module,ce=P&&P.exports===D,F=ce?f.root.Buffer:void 0,C=F?F.allocUnsafe:void 0;function ue(e,n){if(n)return e.slice();var r=e.length,t=C?C(r):new e.constructor(r);return e.copy(t),t}function se(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function fe(e,n){return d(e,o.getSymbols(e),n)}var le=o.overArg(Object.getPrototypeOf,Object);const h=le;var ge=Object.getOwnPropertySymbols,be=ge?function(e){for(var n=[];e;)o.arrayPush(n,o.getSymbols(e)),e=h(e);return n}:o.stubArray;const G=be;function ye(e,n){return d(e,G(e),n)}function q(e){return o.baseGetAllKeys(e,A,G)}var Te=Object.prototype,de=Te.hasOwnProperty;function pe(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&de.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function S(e){var n=new e.constructor(e.byteLength);return new o.Uint8Array(n).set(new o.Uint8Array(e)),n}function ve(e,n){var r=n?S(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Oe=/\w*$/;function Ae(e){var n=new e.constructor(e.source,Oe.exec(e));return n.lastIndex=e.lastIndex,n}var L=f.Symbol?f.Symbol.prototype:void 0,I=L?L.valueOf:void 0;function he(e){return I?Object(I.call(e)):{}}function Se(e,n){var r=n?S(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var je="[object Boolean]",$e="[object Date]",me="[object Map]",we="[object Number]",Pe="[object RegExp]",Fe="[object Set]",Ce="[object String]",Le="[object Symbol]",Ie="[object ArrayBuffer]",Ue="[object DataView]",_e="[object Float32Array]",xe="[object Float64Array]",Ee="[object Int8Array]",Me="[object Int16Array]",Ne="[object Int32Array]",Be="[object Uint8Array]",De="[object Uint8ClampedArray]",Ge="[object Uint16Array]",qe="[object Uint32Array]";function Ke(e,n,r){var t=e.constructor;switch(n){case Ie:return S(e);case je:case $e:return new t(+e);case Ue:return ve(e,r);case _e:case xe:case Ee:case Me:case Ne:case Be:case De:case Ge:case qe:return Se(e,r);case me:return new t;case we:case Ce:return new t(e);case Pe:return Ae(e);case Fe:return new t;case Le:return he(e)}}var U=Object.create,Re=function(){function e(){}return function(n){if(!O.isObject(n))return{};if(U)return U(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();const He=Re;function Ye(e){return typeof e.constructor=="function"&&!o.isPrototype(e)?He(h(e)):{}}var We="[object Map]";function Je(e){return f.isObjectLike(e)&&o.getTag(e)==We}var _=o.nodeUtil&&o.nodeUtil.isMap,Qe=_?o.baseUnary(_):Je;const Xe=Qe;var Ze="[object Set]";function Ve(e){return f.isObjectLike(e)&&o.getTag(e)==Ze}var x=o.nodeUtil&&o.nodeUtil.isSet,ze=x?o.baseUnary(x):Ve;const ke=ze;var en=1,nn=2,rn=4,K="[object Arguments]",tn="[object Array]",on="[object Boolean]",an="[object Date]",cn="[object Error]",R="[object Function]",un="[object GeneratorFunction]",sn="[object Map]",fn="[object Number]",H="[object Object]",ln="[object RegExp]",gn="[object Set]",bn="[object String]",yn="[object Symbol]",Tn="[object WeakMap]",dn="[object ArrayBuffer]",pn="[object DataView]",vn="[object Float32Array]",On="[object Float64Array]",An="[object Int8Array]",hn="[object Int16Array]",Sn="[object Int32Array]",jn="[object Uint8Array]",$n="[object Uint8ClampedArray]",mn="[object Uint16Array]",wn="[object Uint32Array]",i={};i[K]=i[tn]=i[dn]=i[pn]=i[on]=i[an]=i[vn]=i[On]=i[An]=i[hn]=i[Sn]=i[sn]=i[fn]=i[H]=i[ln]=i[gn]=i[bn]=i[yn]=i[jn]=i[$n]=i[mn]=i[wn]=!0;i[cn]=i[R]=i[Tn]=!1;function p(e,n,r,t,a,c){var u,s=n&en,l=n&nn,J=n&rn;if(r&&(u=a?r(e,t,a,c):r(e)),u!==void 0)return u;if(!O.isObject(e))return e;var j=f.isArray(e);if(j){if(u=pe(e),!s)return se(e,u)}else{var y=o.getTag(e),$=y==R||y==un;if(o.isBuffer(e))return ue(e,s);if(y==H||y==K||$&&!a){if(u=l||$?{}:Ye(e),!s)return l?ye(e,ie(u,e)):fe(e,ne(u,e))}else{if(!i[y])return a?e:{};u=Ke(e,y,s)}}c||(c=new o.Stack);var m=c.get(e);if(m)return m;c.set(e,u),ke(e)?e.forEach(function(g){u.add(p(g,n,r,g,e,c))}):Xe(e)&&e.forEach(function(g,b){u.set(b,p(g,n,r,b,e,c))});var Q=J?l?q:o.getAllKeys:l?A:o.keys,w=j?void 0:Q(e);return V(w||e,function(g,b){w&&(b=g,g=e[b]),B(u,b,p(g,n,r,b,e,c))}),u}function Pn(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function Fn(e,n){return n.length<2?e:T.baseGet(e,Z.baseSlice(n,0,-1))}function Cn(e,n){return n=T.castPath(n,e),e=Fn(e,n),e==null||delete e[T.toKey(Pn(n))]}var Ln="[object Object]",In=Function.prototype,Un=Object.prototype,Y=In.toString,_n=Un.hasOwnProperty,xn=Y.call(Object);function En(e){if(!f.isObjectLike(e)||f.baseGetTag(e)!=Ln)return!1;var n=h(e);if(n===null)return!0;var r=_n.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&Y.call(r)==xn}function Mn(e){return En(e)?void 0:e}var E=f.Symbol?f.Symbol.isConcatSpreadable:void 0;function Nn(e){return f.isArray(e)||o.isArguments(e)||!!(E&&e&&e[E])}function W(e,n,r,t,a){var c=-1,u=e.length;for(r||(r=Nn),a||(a=[]);++c<u;){var s=e[c];n>0&&r(s)?n>1?W(s,n-1,r,t,a):o.arrayPush(a,s):t||(a[a.length]=s)}return a}function Bn(e){var n=e==null?0:e.length;return n?W(e,1):[]}function Dn(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}var M=Math.max;function Gn(e,n,r){return n=M(n===void 0?e.length-1:n,0),function(){for(var t=arguments,a=-1,c=M(t.length-n,0),u=Array(c);++a<c;)u[a]=t[n+a];a=-1;for(var s=Array(n+1);++a<n;)s[a]=t[a];return s[n]=r(u),Dn(e,this,s)}}function qn(e){return function(){return e}}var Kn=v?function(e,n){return v(e,"toString",{configurable:!0,enumerable:!1,value:qn(n),writable:!0})}:T.identity;const Rn=Kn;var Hn=800,Yn=16,Wn=Date.now;function Jn(e){var n=0,r=0;return function(){var t=Wn(),a=Yn-(t-r);if(r=t,a>0){if(++n>=Hn)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var Qn=Jn(Rn);const Xn=Qn;function Zn(e){return Xn(Gn(e,void 0,Bn),e+"")}var Vn=1,zn=2,kn=4,er=Zn(function(e,n){var r={};if(e==null)return r;var t=!1;n=X.arrayMap(n,function(c){return c=T.castPath(c,e),t||(t=c.length>1),c}),d(e,q(e),r),t&&(r=p(r,Vn|zn|kn,Mn));for(var a=n.length;a--;)Cn(r,n[a]);return r});const nr=er;function rr({openingHours:e}){const n=e.reduce((r,t)=>(r[t.orderFormat]||(r[t.orderFormat]={orderFormats:t.orderFormat,intervals:[],isDefault:t.isDefault}),r[t.orderFormat].intervals.push(nr(t,"orderFormat")),r),{});return Object.values(n)}module.exports=rr;
@@ -1,9 +1,10 @@
1
1
  import { a as or } from "../toString-ce418705.mjs";
2
- import { l as ar, e as ir, k as D, d as v, m as G, n as sr, o as ur, p as K, q as fr, s as cr, r as R, t as lr, U as F, a as m, u as y, v as H, i as gr, b as br, g as pr, j as yr } from "../_getTag-fcc5160b.mjs";
2
+ import { j as ar, e as ir, k as D, l as G, m as sr, n as ur, o as K, p as fr, s as cr, q as R, r as lr, U as F, a as v, t as y, u as H, i as gr, b as br, g as pr, h as yr } from "../_getTag-ebc0f90e.mjs";
3
+ import { i as m } from "../isObject-b8638513.mjs";
3
4
  import { r as dr, S as d, i as O, a as q, b as Tr } from "../isObjectLike-54341556.mjs";
4
- import { b as vr, c as Y, t as mr, i as Or } from "../identity-cf449299.mjs";
5
- import { b as Ar } from "../_baseSlice-4d543985.mjs";
6
- function hr(r, e) {
5
+ import { b as vr, c as Y, t as mr, i as Or } from "../identity-41198897.mjs";
6
+ import { b as hr } from "../_baseSlice-4d543985.mjs";
7
+ function Ar(r, e) {
7
8
  for (var n = -1, t = r == null ? 0 : r.length; ++n < t && e(r[n], n, r) !== !1; )
8
9
  ;
9
10
  return r;
@@ -50,18 +51,18 @@ function Pr(r) {
50
51
  }
51
52
  var Fr = Object.prototype, Cr = Fr.hasOwnProperty;
52
53
  function xr(r) {
53
- if (!v(r))
54
+ if (!m(r))
54
55
  return Pr(r);
55
56
  var e = G(r), n = [];
56
57
  for (var t in r)
57
58
  t == "constructor" && (e || !Cr.call(r, t)) || n.push(t);
58
59
  return n;
59
60
  }
60
- function A(r) {
61
+ function h(r) {
61
62
  return sr(r) ? ur(r, !0) : xr(r);
62
63
  }
63
64
  function Lr(r, e) {
64
- return r && b(e, A(e), r);
65
+ return r && b(e, h(e), r);
65
66
  }
66
67
  var Q = typeof exports == "object" && exports && !exports.nodeType && exports, C = Q && typeof module == "object" && module && !module.nodeType && module, Ir = C && C.exports === Q, x = Ir ? dr.Buffer : void 0, L = x ? x.allocUnsafe : void 0;
67
68
  function Er(r, e) {
@@ -80,10 +81,10 @@ function Mr(r, e) {
80
81
  return b(r, K(r), e);
81
82
  }
82
83
  var Ur = fr(Object.getPrototypeOf, Object);
83
- const h = Ur;
84
+ const A = Ur;
84
85
  var Nr = Object.getOwnPropertySymbols, Br = Nr ? function(r) {
85
86
  for (var e = []; r; )
86
- R(e, K(r)), r = h(r);
87
+ R(e, K(r)), r = A(r);
87
88
  return e;
88
89
  } : cr;
89
90
  const X = Br;
@@ -91,7 +92,7 @@ function Dr(r, e) {
91
92
  return b(r, X(r), e);
92
93
  }
93
94
  function Z(r) {
94
- return lr(r, A, X);
95
+ return lr(r, h, X);
95
96
  }
96
97
  var Gr = Object.prototype, Kr = Gr.hasOwnProperty;
97
98
  function Rr(r) {
@@ -157,7 +158,7 @@ var _ = Object.create, pe = function() {
157
158
  function r() {
158
159
  }
159
160
  return function(e) {
160
- if (!v(e))
161
+ if (!m(e))
161
162
  return {};
162
163
  if (_)
163
164
  return _(e);
@@ -168,19 +169,19 @@ var _ = Object.create, pe = function() {
168
169
  }();
169
170
  const ye = pe;
170
171
  function de(r) {
171
- return typeof r.constructor == "function" && !G(r) ? ye(h(r)) : {};
172
+ return typeof r.constructor == "function" && !G(r) ? ye(A(r)) : {};
172
173
  }
173
174
  var Te = "[object Map]";
174
175
  function ve(r) {
175
- return O(r) && m(r) == Te;
176
+ return O(r) && v(r) == Te;
176
177
  }
177
178
  var M = y && y.isMap, me = M ? H(M) : ve;
178
179
  const Oe = me;
179
- var Ae = "[object Set]";
180
- function he(r) {
181
- return O(r) && m(r) == Ae;
180
+ var he = "[object Set]";
181
+ function Ae(r) {
182
+ return O(r) && v(r) == he;
182
183
  }
183
- var U = y && y.isSet, $e = U ? H(U) : he;
184
+ var U = y && y.isSet, $e = U ? H(U) : Ae;
184
185
  const Se = $e;
185
186
  var je = 1, we = 2, Pe = 4, V = "[object Arguments]", Fe = "[object Array]", Ce = "[object Boolean]", xe = "[object Date]", Le = "[object Error]", z = "[object Function]", Ie = "[object GeneratorFunction]", Ee = "[object Map]", _e = "[object Number]", k = "[object Object]", Me = "[object RegExp]", Ue = "[object Set]", Ne = "[object String]", Be = "[object Symbol]", De = "[object WeakMap]", Ge = "[object ArrayBuffer]", Ke = "[object DataView]", Re = "[object Float32Array]", He = "[object Float64Array]", qe = "[object Int8Array]", Ye = "[object Int16Array]", We = "[object Int32Array]", Je = "[object Uint8Array]", Qe = "[object Uint8ClampedArray]", Xe = "[object Uint16Array]", Ze = "[object Uint32Array]", a = {};
186
187
  a[V] = a[Fe] = a[Ge] = a[Ke] = a[Ce] = a[xe] = a[Re] = a[He] = a[qe] = a[Ye] = a[We] = a[Ee] = a[_e] = a[k] = a[Me] = a[Ue] = a[Ne] = a[Be] = a[Je] = a[Qe] = a[Xe] = a[Ze] = !0;
@@ -189,14 +190,14 @@ function p(r, e, n, t, o, i) {
189
190
  var s, u = e & je, f = e & we, nr = e & Pe;
190
191
  if (n && (s = o ? n(r, t, o, i) : n(r)), s !== void 0)
191
192
  return s;
192
- if (!v(r))
193
+ if (!m(r))
193
194
  return r;
194
195
  var S = q(r);
195
196
  if (S) {
196
197
  if (s = Rr(r), !u)
197
198
  return _r(r, s);
198
199
  } else {
199
- var g = m(r), j = g == z || g == Ie;
200
+ var g = v(r), j = g == z || g == Ie;
200
201
  if (gr(r))
201
202
  return Er(r, u);
202
203
  if (g == k || g == V || j && !o) {
@@ -217,8 +218,8 @@ function p(r, e, n, t, o, i) {
217
218
  }) : Oe(r) && r.forEach(function(c, l) {
218
219
  s.set(l, p(c, e, n, l, r, i));
219
220
  });
220
- var tr = nr ? f ? Z : pr : f ? A : D, P = S ? void 0 : tr(r);
221
- return hr(P || r, function(c, l) {
221
+ var tr = nr ? f ? Z : pr : f ? h : D, P = S ? void 0 : tr(r);
222
+ return Ar(P || r, function(c, l) {
222
223
  P && (l = c, c = r[l]), J(s, l, p(c, e, n, l, r, i));
223
224
  }), s;
224
225
  }
@@ -227,7 +228,7 @@ function Ve(r) {
227
228
  return e ? r[e - 1] : void 0;
228
229
  }
229
230
  function ze(r, e) {
230
- return e.length < 2 ? r : vr(r, Ar(e, 0, -1));
231
+ return e.length < 2 ? r : vr(r, hr(e, 0, -1));
231
232
  }
232
233
  function ke(r, e) {
233
234
  return e = Y(e, r), r = ze(r, e), r == null || delete r[mr(Ve(e))];
@@ -236,7 +237,7 @@ var rn = "[object Object]", en = Function.prototype, nn = Object.prototype, rr =
236
237
  function an(r) {
237
238
  if (!O(r) || Tr(r) != rn)
238
239
  return !1;
239
- var e = h(r);
240
+ var e = A(r);
240
241
  if (e === null)
241
242
  return !0;
242
243
  var n = tn.call(e, "constructor") && e.constructor;
@@ -314,23 +315,23 @@ function vn(r) {
314
315
  }
315
316
  var mn = vn(pn);
316
317
  const On = mn;
317
- function An(r) {
318
+ function hn(r) {
318
319
  return On(ln(r, void 0, fn), r + "");
319
320
  }
320
- var hn = 1, $n = 2, Sn = 4, jn = An(function(r, e) {
321
+ var An = 1, $n = 2, Sn = 4, jn = hn(function(r, e) {
321
322
  var n = {};
322
323
  if (r == null)
323
324
  return n;
324
325
  var t = !1;
325
326
  e = or(e, function(i) {
326
327
  return i = Y(i, r), t || (t = i.length > 1), i;
327
- }), b(r, Z(r), n), t && (n = p(n, hn | $n | Sn, sn));
328
+ }), b(r, Z(r), n), t && (n = p(n, An | $n | Sn, sn));
328
329
  for (var o = e.length; o--; )
329
330
  ke(n, e[o]);
330
331
  return n;
331
332
  });
332
333
  const wn = jn;
333
- function In({
334
+ function En({
334
335
  openingHours: r
335
336
  }) {
336
337
  const e = r.reduce(
@@ -344,5 +345,5 @@ function In({
344
345
  return Object.values(e);
345
346
  }
346
347
  export {
347
- In as default
348
+ En as default
348
349
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.51.0-check-optimizations.1",
3
+ "version": "1.51.0-check-optimizations.3",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -26,6 +26,11 @@
26
26
  "require": "./api/getEndpointWithVersion.js",
27
27
  "types": "./api/getEndpointWithVersion.d.ts"
28
28
  },
29
+ "./api/getMediaImageClosestSize": {
30
+ "import": "./api/getMediaImageClosestSize.mjs",
31
+ "require": "./api/getMediaImageClosestSize.js",
32
+ "types": "./api/getMediaImageClosestSize.d.ts"
33
+ },
29
34
  "./api/getUrlAndParams": {
30
35
  "import": "./api/getUrlAndParams.mjs",
31
36
  "require": "./api/getUrlAndParams.js",
@@ -81,6 +86,11 @@
81
86
  "require": "./card/getGiftCardStatus.js",
82
87
  "types": "./card/getGiftCardStatus.d.ts"
83
88
  },
89
+ "./card/getPrepaidWalletScanReadingInfo": {
90
+ "import": "./card/getPrepaidWalletScanReadingInfo.mjs",
91
+ "require": "./card/getPrepaidWalletScanReadingInfo.js",
92
+ "types": "./card/getPrepaidWalletScanReadingInfo.d.ts"
93
+ },
84
94
  "./card/getScannedWalletReadingInfo": {
85
95
  "import": "./card/getScannedWalletReadingInfo.mjs",
86
96
  "require": "./card/getScannedWalletReadingInfo.js",
@@ -661,6 +671,16 @@
661
671
  "require": "./logger/types.js",
662
672
  "types": "./logger/types.d.ts"
663
673
  },
674
+ "./multilingual/createLocalizedCheckDetails": {
675
+ "import": "./multilingual/createLocalizedCheckDetails.mjs",
676
+ "require": "./multilingual/createLocalizedCheckDetails.js",
677
+ "types": "./multilingual/createLocalizedCheckDetails.d.ts"
678
+ },
679
+ "./multilingual": {
680
+ "import": "./multilingual/index.mjs",
681
+ "require": "./multilingual/index.js",
682
+ "types": "./multilingual/index.d.ts"
683
+ },
664
684
  "./number": {
665
685
  "import": "./number/index.mjs",
666
686
  "require": "./number/index.js",
@@ -916,6 +936,11 @@
916
936
  "require": "./outlet/isOutletAcceptingPreOrders.js",
917
937
  "types": "./outlet/isOutletAcceptingPreOrders.d.ts"
918
938
  },
939
+ "./outlet/isOutletAcceptingPreOrdersWhenClosed": {
940
+ "import": "./outlet/isOutletAcceptingPreOrdersWhenClosed.mjs",
941
+ "require": "./outlet/isOutletAcceptingPreOrdersWhenClosed.js",
942
+ "types": "./outlet/isOutletAcceptingPreOrdersWhenClosed.d.ts"
943
+ },
919
944
  "./outlet/searchNextOpeningMoment": {
920
945
  "import": "./outlet/searchNextOpeningMoment.mjs",
921
946
  "require": "./outlet/searchNextOpeningMoment.js",
@@ -1,4 +1,6 @@
1
- import { CheckoutOrderType } from '@ancon/wildcat-types';
2
- export default function isGroupPreOrder<T extends {
3
- orderType?: CheckoutOrderType;
4
- }>(preOrder: T): boolean;
1
+ import { OrderType } from '@ancon/wildcat-types';
2
+ declare type Order = {
3
+ orderType?: OrderType;
4
+ };
5
+ export default function isGroupPreOrder<T extends Order>(preOrder: T): boolean;
6
+ export {};
@@ -1 +1 @@
1
- "use strict";const e=require("@ancon/wildcat-types");function o(t){return(t==null?void 0:t.orderType)===e.CheckoutOrderType.GroupPreOrder}module.exports=o;
1
+ "use strict";const e=require("@ancon/wildcat-types");function o(t){return(t==null?void 0:t.orderType)===e.OrderType.GroupPreOrder}module.exports=o;
@@ -1,7 +1,7 @@
1
- import { CheckoutOrderType as t } from "@ancon/wildcat-types";
2
- function r(o) {
3
- return (o == null ? void 0 : o.orderType) === t.GroupPreOrder;
1
+ import { OrderType as r } from "@ancon/wildcat-types";
2
+ function u(o) {
3
+ return (o == null ? void 0 : o.orderType) === r.GroupPreOrder;
4
4
  }
5
5
  export {
6
- r as default
6
+ u as default
7
7
  };
@@ -1,4 +1,6 @@
1
- import { CheckoutOrderType } from '@ancon/wildcat-types';
2
- export default function isPreOrderLink<T extends {
3
- orderType?: CheckoutOrderType;
4
- }>(preOrder: T): boolean;
1
+ import { OrderType } from '@ancon/wildcat-types';
2
+ declare type Order = {
3
+ orderType?: OrderType;
4
+ };
5
+ export default function isPreOrderLink<T extends Order>(preOrder: T): boolean;
6
+ export {};
@@ -1 +1 @@
1
- "use strict";const e=require("@ancon/wildcat-types");function i(t){return(t==null?void 0:t.orderType)===e.CheckoutOrderType.PreOrderLink}module.exports=i;
1
+ "use strict";const t=require("@ancon/wildcat-types");function e(i){return(i==null?void 0:i.orderType)===t.OrderType.PreOrderLink}module.exports=e;
@@ -1,7 +1,7 @@
1
- import { CheckoutOrderType as t } from "@ancon/wildcat-types";
2
- function n(o) {
3
- return (o == null ? void 0 : o.orderType) === t.PreOrderLink;
1
+ import { OrderType as n } from "@ancon/wildcat-types";
2
+ function t(i) {
3
+ return (i == null ? void 0 : i.orderType) === n.PreOrderLink;
4
4
  }
5
5
  export {
6
- n as default
6
+ t as default
7
7
  };
@@ -1,4 +1,6 @@
1
- import { CheckoutOrderType } from '@ancon/wildcat-types';
2
- export default function isPreOrderSharable<T extends {
3
- orderType?: CheckoutOrderType;
4
- }>(preOrder: T): boolean;
1
+ import { OrderType } from '@ancon/wildcat-types';
2
+ declare type Order = {
3
+ orderType?: OrderType;
4
+ };
5
+ export default function isPreOrderSharable<T extends Order>(preOrder: T): boolean;
6
+ export {};
@@ -1 +1 @@
1
- "use strict";const t=require("@ancon/wildcat-types");function o(e){const r=e==null?void 0:e.orderType;return r===t.CheckoutOrderType.PreOrderLink||r===t.CheckoutOrderType.GroupPreOrder}module.exports=o;
1
+ "use strict";const t=require("@ancon/wildcat-types");function o(e){const r=e==null?void 0:e.orderType;return r===t.OrderType.PreOrderLink||r===t.OrderType.GroupPreOrder}module.exports=o;
@@ -1,4 +1,4 @@
1
- import { CheckoutOrderType as o } from "@ancon/wildcat-types";
1
+ import { OrderType as o } from "@ancon/wildcat-types";
2
2
  function n(r) {
3
3
  const e = r == null ? void 0 : r.orderType;
4
4
  return e === o.PreOrderLink || e === o.GroupPreOrder;
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var d=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(d(r,typeof e!="symbol"?e+"":e,t),t);const h=require("@microsoft/signalr"),a=require("@ancon/wildcat-types"),l=require("../shared/wait.js"),u=require("../api/generateBackoffWithEqualJitter.js");require("../number/randomIntFromInterval.js");class g{constructor(e){n(this,"internalEvents");n(this,"signalREvents");n(this,"hubConnection");n(this,"clientId");n(this,"logger");n(this,"backoff",[]);n(this,"reconnectAttempt",0);n(this,"shouldReconnect",!0);n(this,"groups");n(this,"info",(e,t)=>{var i;(i=this.logger)==null||i.info(e,t)});n(this,"generateBackoff",()=>{this.backoff=u(50,500,5e3),this.info("Generated new backoff")});n(this,"reconnect",async()=>{if(this.shouldReconnect)try{this.info("Attempting to reconnect...",{attempt:this.reconnectAttempt+1}),await this.connect(!0),this.info("Reconnected"),this.reconnectAttempt=0}catch{if(this.backoff[this.reconnectAttempt]!=null){const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}else{this.reconnectAttempt>0&&this.info("Ran out of backoff intervals, restarting backoff..."),this.reconnectAttempt=0,this.generateBackoff();const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}this.reconnectAttempt+=1,await this.reconnect()}});n(this,"buildInitialListeners",()=>{this.hubConnection.onclose(()=>{this.groups=[],this.info("Hub connection closed"),this.emitEvent("disconnected"),this.reconnect()}),this.hubConnection.onreconnected(()=>this.emitEvent("reconnected"))});n(this,"emitEvent",(e,...t)=>{if(this.internalEvents.has(e)){this.info(`Emitting event "${e}"`);const i=this.internalEvents.get(e);i&&i.forEach(s=>s(...t))}else this.info(`Failed to emit event "${e}". There were no listeners.`)});n(this,"skipSignal",(e,t)=>{this.info(`Skipped signal "${e}"`,t)});n(this,"enhanceListener",(e,t,i)=>s=>{const o=JSON.parse(s),c=i&&o.clientId&&o.clientId===this.clientId;return c||this.info(`Received signal "${e}"`,s),c?this.skipSignal(e,s):t(o)});n(this,"setClientId",e=>{this.clientId=e});n(this,"connect",async(e=!1)=>{try{this.info("Connecting..."),await this.hubConnection.start(),this.info("Connected"),this.emitEvent("connected")}catch(t){if(this.info("Failed to connect"),e)throw t}});n(this,"disconnect",async()=>{try{this.shouldReconnect=!1,this.info("Disconnecting..."),await this.hubConnection.stop(),this.info("Disconnected"),this.emitEvent("disconnected")}catch{this.info("Failed to disconnect")}});n(this,"addEventListener",(e,t)=>{this.internalEvents.has(e)||this.internalEvents.set(e,[]);const i=this.internalEvents.get(e);return i&&i.push(t),()=>this.removeEventListener(e,t)});n(this,"removeEventListener",(e,t)=>{var i;if(this.internalEvents.has(e)){const s=this.internalEvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(s.splice(o,1),this.info(`Removed event listener for event "${e}"`)):this.info(`Failed to remove event listener for event "${e}". Specified listener was not found.`)}else this.info(`Failed to remove event listener for event "${e}". Event doesn't have any listeners.`)});n(this,"addSignalListener",(e,t,i=!0)=>{this.signalREvents.has(e)||this.signalREvents.set(e,[]);const s=this.signalREvents.get(e),o=this.enhanceListener(e,t,i);return s&&s.push(o),this.hubConnection.on(e,o),this.info(`Added signal listener for signal "${e}"`),()=>this.removeSignalListener(e,o)});n(this,"removeSignalListener",(e,t)=>{var i;if(this.signalREvents.has(e)){const s=this.signalREvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(this.hubConnection.off(e,t),s.splice(o,1),this.info(`Removed signal listener for signal "${e}"`)):this.info(`Failed to remove signal listener for signal "${e}". Specified listener was not found.`)}else this.info(`Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`)});n(this,"joinGroup",async e=>{this.info(`Joining group "${e}"...`);const t=this.groups.push(e)-1;try{await this.hubConnection.invoke(a.SignalRMethodName.JoinGroup,e),this.info(`Joined group "${e}"`)}catch(i){this.info(`Failed to join group "${e}"`,i),t>=0&&this.groups.splice(t,1)}});n(this,"leaveGroup",async e=>{this.info(`Leaving group "${e}"...`);const t=this.groups.indexOf(e);t>=0&&this.groups.splice(t,1);try{await this.hubConnection.invoke(a.SignalRMethodName.LeaveGroup,e),this.info(`Left group "${e}"`)}catch(i){this.groups.indexOf(e)<0&&this.groups.push(e),this.info(`Failed to leave group "${e}"`,i)}});n(this,"leaveAllGroups",async()=>{this.info(`Leaving all (${this.groups.length}) groups...`);const e=[...this.groups].map(t=>this.leaveGroup(t));await Promise.all(e),this.info("Left all groups")});n(this,"getHubConnectionId",()=>this.hubConnection.connectionId);this.internalEvents=new Map,this.signalREvents=new Map,this.groups=[],e.enableLogging&&(this.logger=e.logger),this.hubConnection=new h.HubConnectionBuilder().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(h.LogLevel.None).build(),this.buildInitialListeners()}}module.exports=g;
1
+ "use strict";var f=Object.defineProperty;var d=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(d(r,typeof e!="symbol"?e+"":e,t),t);const h=require("@microsoft/signalr"),a=require("@ancon/wildcat-types"),l=require("../shared/wait.js"),u=require("../api/generateBackoffWithEqualJitter.js");require("../number/randomIntFromInterval.js");class g{constructor(e){n(this,"internalEvents");n(this,"signalREvents");n(this,"hubConnection");n(this,"clientId");n(this,"logger");n(this,"backoff",[]);n(this,"reconnectAttempt",0);n(this,"shouldReconnect",!0);n(this,"groups");n(this,"info",(e,t)=>{var i;(i=this.logger)==null||i.info(e,t)});n(this,"generateBackoff",()=>{this.backoff=u(50,500,5e3),this.info("Generated new backoff")});n(this,"reconnect",async()=>{if(this.shouldReconnect)try{this.info("Attempting to reconnect...",{attempt:this.reconnectAttempt+1}),await this.connect(!0),this.info("Reconnected"),this.reconnectAttempt=0}catch{if(this.backoff[this.reconnectAttempt]!=null){const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}else{this.reconnectAttempt>0&&this.info("Ran out of backoff intervals, restarting backoff..."),this.reconnectAttempt=0,this.generateBackoff();const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}this.reconnectAttempt+=1,await this.reconnect()}});n(this,"buildInitialListeners",()=>{this.hubConnection.onclose(()=>{this.groups=[],this.info("Hub connection closed"),this.emitEvent("disconnected"),this.reconnect()}),this.hubConnection.onreconnected(()=>this.emitEvent("reconnected"))});n(this,"emitEvent",(e,...t)=>{if(this.internalEvents.has(e)){this.info(`Emitting event "${e}"`);const i=this.internalEvents.get(e);i&&i.forEach(s=>s(...t))}else this.info(`Failed to emit event "${e}". There were no listeners.`)});n(this,"skipSignal",(e,t)=>{this.info(`Skipped signal "${e}"`,t)});n(this,"enhanceListener",(e,t,i)=>s=>{const o=JSON.parse(s),c=i&&o.clientId&&o.clientId===this.clientId;return c||this.info(`Received signal "${e}"`,s),c?this.skipSignal(e,s):t(o)});n(this,"setClientId",e=>{this.clientId=e});n(this,"connect",async(e=!1)=>{try{this.info("Connecting..."),await this.hubConnection.start(),this.info("Connected"),this.emitEvent("connected")}catch(t){if(this.info("Failed to connect"),e)throw t}});n(this,"disconnect",async()=>{try{this.shouldReconnect=!1,this.info("Disconnecting..."),await this.hubConnection.stop(),this.info("Disconnected"),this.emitEvent("disconnected")}catch{this.info("Failed to disconnect")}});n(this,"addEventListener",(e,t)=>{this.internalEvents.has(e)||this.internalEvents.set(e,[]);const i=this.internalEvents.get(e);return i&&i.push(t),()=>this.removeEventListener(e,t)});n(this,"removeEventListener",(e,t)=>{var i;if(this.internalEvents.has(e)){const s=this.internalEvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(s.splice(o,1),this.info(`Removed event listener for event "${e}"`)):this.info(`Failed to remove event listener for event "${e}". Specified listener was not found.`)}else this.info(`Failed to remove event listener for event "${e}". Event doesn't have any listeners.`)});n(this,"addSignalListener",(e,t,i=!0)=>{this.signalREvents.has(e)||this.signalREvents.set(e,[]);const s=this.signalREvents.get(e),o=this.enhanceListener(e,t,i);return s&&s.push(o),this.hubConnection.on(e,o),this.info(`Added signal listener for signal "${e}"`),()=>this.removeSignalListener(e,o)});n(this,"removeSignalListener",(e,t)=>{var i;if(this.signalREvents.has(e)){const s=this.signalREvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(this.hubConnection.off(e,t),s.splice(o,1),this.info(`Removed signal listener for signal "${e}"`)):this.info(`Failed to remove signal listener for signal "${e}". Specified listener was not found.`)}else this.info(`Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`)});n(this,"joinGroup",async e=>{this.info(`Joining group "${e}"...`);const t=this.groups.push(e)-1;try{await this.hubConnection.invoke(a.SignalRMethodName.JoinGroup,e),this.info(`Joined group "${e}"`)}catch(i){this.info(`Failed to join group "${e}"`,i),t>=0&&this.groups.splice(t,1)}});n(this,"leaveGroup",async e=>{this.info(`Leaving group "${e}"...`);const t=this.groups.indexOf(e);t>=0&&this.groups.splice(t,1);try{await this.hubConnection.invoke(a.SignalRMethodName.LeaveGroup,e),this.info(`Left group "${e}"`)}catch(i){this.groups.indexOf(e)<0&&this.groups.push(e),this.info(`Failed to leave group "${e}"`,i)}});n(this,"leaveAllGroups",async()=>{this.info(`Leaving all (${this.groups.length}) groups...`);const e=[...this.groups].map(t=>this.leaveGroup(t));await Promise.all(e),this.info("Left all groups")});n(this,"getHubConnectionId",()=>this.hubConnection.connectionId);this.internalEvents=new Map,this.signalREvents=new Map,this.groups=[],e.enableLogging&&(this.logger=e.logger),this.hubConnection=new h.HubConnectionBuilder().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(h.LogLevel.None).build(),e.serverTimeoutInMilliseconds&&(this.hubConnection.serverTimeoutInMilliseconds=e.serverTimeoutInMilliseconds),this.buildInitialListeners()}}module.exports=g;
@@ -1,13 +1,13 @@
1
1
  var f = Object.defineProperty;
2
- var l = (r, t, e) => t in r ? f(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var n = (r, t, e) => (l(r, typeof t != "symbol" ? t + "" : t, e), e);
2
+ var l = (r, e, t) => e in r ? f(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var n = (r, e, t) => (l(r, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import { HubConnectionBuilder as d, LogLevel as u } from "@microsoft/signalr";
5
5
  import { SignalRMethodName as h } from "@ancon/wildcat-types";
6
6
  import a from "../shared/wait.mjs";
7
7
  import g from "../api/generateBackoffWithEqualJitter.mjs";
8
8
  import "../number/randomIntFromInterval.mjs";
9
9
  class L {
10
- constructor(t) {
10
+ constructor(e) {
11
11
  n(this, "internalEvents");
12
12
  n(this, "signalREvents");
13
13
  n(this, "hubConnection");
@@ -17,9 +17,9 @@ class L {
17
17
  n(this, "reconnectAttempt", 0);
18
18
  n(this, "shouldReconnect", !0);
19
19
  n(this, "groups");
20
- n(this, "info", (t, e) => {
20
+ n(this, "info", (e, t) => {
21
21
  var i;
22
- (i = this.logger) == null || i.info(t, e);
22
+ (i = this.logger) == null || i.info(e, t);
23
23
  });
24
24
  n(this, "generateBackoff", () => {
25
25
  this.backoff = g(50, 500, 5e3), this.info("Generated new backoff");
@@ -32,16 +32,16 @@ class L {
32
32
  }), await this.connect(!0), this.info("Reconnected"), this.reconnectAttempt = 0;
33
33
  } catch {
34
34
  if (this.backoff[this.reconnectAttempt] != null) {
35
- const e = this.backoff[this.reconnectAttempt];
36
- if (e != null)
37
- await a(e);
35
+ const t = this.backoff[this.reconnectAttempt];
36
+ if (t != null)
37
+ await a(t);
38
38
  else
39
39
  throw new Error("Could not resolve ms from backoff");
40
40
  } else {
41
41
  this.reconnectAttempt > 0 && this.info("Ran out of backoff intervals, restarting backoff..."), this.reconnectAttempt = 0, this.generateBackoff();
42
- const e = this.backoff[this.reconnectAttempt];
43
- if (e != null)
44
- await a(e);
42
+ const t = this.backoff[this.reconnectAttempt];
43
+ if (t != null)
44
+ await a(t);
45
45
  else
46
46
  throw new Error("Could not resolve ms from backoff");
47
47
  }
@@ -58,30 +58,30 @@ class L {
58
58
  * @param event Event to emit
59
59
  * @param args Arguments to send to the listeners
60
60
  */
61
- n(this, "emitEvent", (t, ...e) => {
62
- if (this.internalEvents.has(t)) {
63
- this.info(`Emitting event "${t}"`);
64
- const i = this.internalEvents.get(t);
65
- i && i.forEach((s) => s(...e));
61
+ n(this, "emitEvent", (e, ...t) => {
62
+ if (this.internalEvents.has(e)) {
63
+ this.info(`Emitting event "${e}"`);
64
+ const i = this.internalEvents.get(e);
65
+ i && i.forEach((s) => s(...t));
66
66
  } else
67
- this.info(`Failed to emit event "${t}". There were no listeners.`);
67
+ this.info(`Failed to emit event "${e}". There were no listeners.`);
68
68
  });
69
- n(this, "skipSignal", (t, e) => {
70
- this.info(`Skipped signal "${t}"`, e);
69
+ n(this, "skipSignal", (e, t) => {
70
+ this.info(`Skipped signal "${e}"`, t);
71
71
  });
72
- n(this, "enhanceListener", (t, e, i) => (s) => {
72
+ n(this, "enhanceListener", (e, t, i) => (s) => {
73
73
  const o = JSON.parse(s), c = i && o.clientId && o.clientId === this.clientId;
74
- return c || this.info(`Received signal "${t}"`, s), c ? this.skipSignal(t, s) : e(o);
74
+ return c || this.info(`Received signal "${e}"`, s), c ? this.skipSignal(e, s) : t(o);
75
75
  });
76
- n(this, "setClientId", (t) => {
77
- this.clientId = t;
76
+ n(this, "setClientId", (e) => {
77
+ this.clientId = e;
78
78
  });
79
- n(this, "connect", async (t = !1) => {
79
+ n(this, "connect", async (e = !1) => {
80
80
  try {
81
81
  this.info("Connecting..."), await this.hubConnection.start(), this.info("Connected"), this.emitEvent("connected");
82
- } catch (e) {
83
- if (this.info("Failed to connect"), t)
84
- throw e;
82
+ } catch (t) {
83
+ if (this.info("Failed to connect"), e)
84
+ throw t;
85
85
  }
86
86
  });
87
87
  n(this, "disconnect", async () => {
@@ -96,26 +96,26 @@ class L {
96
96
  * @param event Event to listen on
97
97
  * @param listener Event listener function
98
98
  */
99
- n(this, "addEventListener", (t, e) => {
100
- this.internalEvents.has(t) || this.internalEvents.set(t, []);
101
- const i = this.internalEvents.get(t);
102
- return i && i.push(e), () => this.removeEventListener(t, e);
99
+ n(this, "addEventListener", (e, t) => {
100
+ this.internalEvents.has(e) || this.internalEvents.set(e, []);
101
+ const i = this.internalEvents.get(e);
102
+ return i && i.push(t), () => this.removeEventListener(e, t);
103
103
  });
104
104
  /**
105
105
  * Remove internal event listener
106
106
  * @param event Event to stop listening to
107
107
  * @param listener Event listener function
108
108
  */
109
- n(this, "removeEventListener", (t, e) => {
109
+ n(this, "removeEventListener", (e, t) => {
110
110
  var i;
111
- if (this.internalEvents.has(t)) {
112
- const s = this.internalEvents.get(t), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, e)) ?? -1;
113
- o >= 0 ? (s.splice(o, 1), this.info(`Removed event listener for event "${t}"`)) : this.info(
114
- `Failed to remove event listener for event "${t}". Specified listener was not found.`
111
+ if (this.internalEvents.has(e)) {
112
+ const s = this.internalEvents.get(e), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, t)) ?? -1;
113
+ o >= 0 ? (s.splice(o, 1), this.info(`Removed event listener for event "${e}"`)) : this.info(
114
+ `Failed to remove event listener for event "${e}". Specified listener was not found.`
115
115
  );
116
116
  } else
117
117
  this.info(
118
- `Failed to remove event listener for event "${t}". Event doesn't have any listeners.`
118
+ `Failed to remove event listener for event "${e}". Event doesn't have any listeners.`
119
119
  );
120
120
  });
121
121
  /**
@@ -123,58 +123,58 @@ class L {
123
123
  * @param signal Signal name
124
124
  * @param listener Signal listener function
125
125
  */
126
- n(this, "addSignalListener", (t, e, i = !0) => {
127
- this.signalREvents.has(t) || this.signalREvents.set(t, []);
128
- const s = this.signalREvents.get(t), o = this.enhanceListener(
129
- t,
126
+ n(this, "addSignalListener", (e, t, i = !0) => {
127
+ this.signalREvents.has(e) || this.signalREvents.set(e, []);
128
+ const s = this.signalREvents.get(e), o = this.enhanceListener(
130
129
  e,
130
+ t,
131
131
  i
132
132
  );
133
- return s && s.push(o), this.hubConnection.on(t, o), this.info(`Added signal listener for signal "${t}"`), () => this.removeSignalListener(t, o);
133
+ return s && s.push(o), this.hubConnection.on(e, o), this.info(`Added signal listener for signal "${e}"`), () => this.removeSignalListener(e, o);
134
134
  });
135
135
  /**
136
136
  * Remove signal listener
137
137
  * @param signal Signal name
138
138
  * @param listener Signal listener function
139
139
  */
140
- n(this, "removeSignalListener", (t, e) => {
140
+ n(this, "removeSignalListener", (e, t) => {
141
141
  var i;
142
- if (this.signalREvents.has(t)) {
143
- const s = this.signalREvents.get(t), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, e)) ?? -1;
144
- o >= 0 ? (this.hubConnection.off(t, e), s.splice(o, 1), this.info(`Removed signal listener for signal "${t}"`)) : this.info(
145
- `Failed to remove signal listener for signal "${t}". Specified listener was not found.`
142
+ if (this.signalREvents.has(e)) {
143
+ const s = this.signalREvents.get(e), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, t)) ?? -1;
144
+ o >= 0 ? (this.hubConnection.off(e, t), s.splice(o, 1), this.info(`Removed signal listener for signal "${e}"`)) : this.info(
145
+ `Failed to remove signal listener for signal "${e}". Specified listener was not found.`
146
146
  );
147
147
  } else
148
148
  this.info(
149
- `Failed to remove signal listener for signal "${t}". Signal doesn't have any listeners.`
149
+ `Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`
150
150
  );
151
151
  });
152
- n(this, "joinGroup", async (t) => {
153
- this.info(`Joining group "${t}"...`);
154
- const e = this.groups.push(t) - 1;
152
+ n(this, "joinGroup", async (e) => {
153
+ this.info(`Joining group "${e}"...`);
154
+ const t = this.groups.push(e) - 1;
155
155
  try {
156
- await this.hubConnection.invoke(h.JoinGroup, t), this.info(`Joined group "${t}"`);
156
+ await this.hubConnection.invoke(h.JoinGroup, e), this.info(`Joined group "${e}"`);
157
157
  } catch (i) {
158
- this.info(`Failed to join group "${t}"`, i), e >= 0 && this.groups.splice(e, 1);
158
+ this.info(`Failed to join group "${e}"`, i), t >= 0 && this.groups.splice(t, 1);
159
159
  }
160
160
  });
161
- n(this, "leaveGroup", async (t) => {
162
- this.info(`Leaving group "${t}"...`);
163
- const e = this.groups.indexOf(t);
164
- e >= 0 && this.groups.splice(e, 1);
161
+ n(this, "leaveGroup", async (e) => {
162
+ this.info(`Leaving group "${e}"...`);
163
+ const t = this.groups.indexOf(e);
164
+ t >= 0 && this.groups.splice(t, 1);
165
165
  try {
166
- await this.hubConnection.invoke(h.LeaveGroup, t), this.info(`Left group "${t}"`);
166
+ await this.hubConnection.invoke(h.LeaveGroup, e), this.info(`Left group "${e}"`);
167
167
  } catch (i) {
168
- this.groups.indexOf(t) < 0 && this.groups.push(t), this.info(`Failed to leave group "${t}"`, i);
168
+ this.groups.indexOf(e) < 0 && this.groups.push(e), this.info(`Failed to leave group "${e}"`, i);
169
169
  }
170
170
  });
171
171
  n(this, "leaveAllGroups", async () => {
172
172
  this.info(`Leaving all (${this.groups.length}) groups...`);
173
- const t = [...this.groups].map((e) => this.leaveGroup(e));
174
- await Promise.all(t), this.info("Left all groups");
173
+ const e = [...this.groups].map((t) => this.leaveGroup(t));
174
+ await Promise.all(e), this.info("Left all groups");
175
175
  });
176
176
  n(this, "getHubConnectionId", () => this.hubConnection.connectionId);
177
- this.internalEvents = /* @__PURE__ */ new Map(), this.signalREvents = /* @__PURE__ */ new Map(), this.groups = [], t.enableLogging && (this.logger = t.logger), this.hubConnection = new d().withUrl(`${t.signalRApiUrl}/${t.hub}`).configureLogging(u.None).build(), this.buildInitialListeners();
177
+ this.internalEvents = /* @__PURE__ */ new Map(), this.signalREvents = /* @__PURE__ */ new Map(), this.groups = [], e.enableLogging && (this.logger = e.logger), this.hubConnection = new d().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(u.None).build(), e.serverTimeoutInMilliseconds && (this.hubConnection.serverTimeoutInMilliseconds = e.serverTimeoutInMilliseconds), this.buildInitialListeners();
178
178
  }
179
179
  }
180
180
  export {
@@ -10,5 +10,7 @@ export declare type SignalRConfig = {
10
10
  logger?: Logger;
11
11
  /** @default false */
12
12
  enableLogging?: boolean;
13
+ /** @default 30000 */
14
+ serverTimeoutInMilliseconds?: number;
13
15
  };
14
16
  export declare type SignalRHookConfig = Omit<SignalRConfig, 'hub'>;