@magicbell/magicbell-react
Advanced tools
Comparing version 7.2.0 to 7.3.0
@@ -16,2 +16,3 @@ import React from 'react'; | ||
NotificationItem?: NotificationListItem; | ||
layout?: string[]; | ||
} | ||
@@ -18,0 +19,0 @@ /** |
@@ -11,4 +11,2 @@ /// <reference types="react" /> | ||
*/ | ||
declare function StyledFooter({ children }: StyledFooterProps): JSX.Element; | ||
declare const _default: typeof StyledFooter; | ||
export default _default; | ||
export default function StyledFooter({ children }: StyledFooterProps): JSX.Element; |
@@ -14,4 +14,2 @@ /// <reference types="react" /> | ||
*/ | ||
declare function StyledHeader({ children }: StyledHeaderProps): JSX.Element; | ||
declare const _default: typeof StyledHeader; | ||
export default _default; | ||
export default function StyledHeader({ children }: StyledHeaderProps): JSX.Element; |
@@ -10,2 +10,3 @@ /// <reference types="react" /> | ||
NotificationItem?: NotificationListItem; | ||
layout?: string[]; | ||
} | ||
@@ -21,4 +22,4 @@ /** | ||
*/ | ||
declare function NotificationInbox({ height, onAllRead, onNotificationClick, NotificationItem, storeId, }: NotificationInboxProps): JSX.Element | null; | ||
declare function NotificationInbox({ height, layout, onAllRead, onNotificationClick, NotificationItem, storeId, }: NotificationInboxProps): JSX.Element | null; | ||
declare const _default: typeof NotificationInbox; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("mobx"),n=require("react"),r=e(n),o=e(require("react-use/lib/useToggle")),i=require("@emotion/core"),a=require("mobx-react"),c=e(require("tinycolor2")),l=require("@magicbell/core"),s=e(require("lodash/merge")),u=e(require("react-use/lib/useEffectOnce")),d=e(require("dayjs"));require("dayjs/locale/es"),require("dayjs/locale/pt-br");var f=e(require("lodash/defaultsDeep")),p=require("timeago.js"),m=require("liquidjs"),h=e(require("lodash/get")),x=e(require("@tippyjs/react/headless")),C=e(require("react-use/lib/useInterval")),g=e(require("dayjs/plugin/localizedFormat")),v=e(require("dayjs/plugin/relativeTime")),b=e(require("dayjs/plugin/updateLocale")),y=e(require("axios")),k=require("react-use"),w=e(require("resize-observer-polyfill")),E=e(require("react-infinite-scroll-component"));function j(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,c,"next",e)}function c(e){j(i,r,o,a,c,"throw",e)}a(void 0)}))}}function O(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function H(e,t){return t||(t=e.slice(0)),e.raw=t,e}var L,N,S="#3498F4",A='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',R={icon:{borderColor:S,width:"24px"},header:{backgroundColor:S,backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"white",textTransform:"none"},footer:{backgroundColor:S,backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"white",textTransform:"none"},unseenBadge:{backgroundColor:"#DF4759",backgroundOpacity:1,borderRadius:"2px",fontFamily:A,fontSize:"10px",textAlign:"center",textColor:"white",textTransform:"none"},container:{backgroundColor:"#FFFFFF",backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},notification:{default:{backgroundColor:S,backgroundOpacity:.1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},unread:{backgroundColor:S,backgroundOpacity:.1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},unseen:{backgroundColor:S,backgroundOpacity:.05,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"}}},V=n.createContext(R),I=V.Provider,Z=function(){return n.useContext(V)},F=i.css(L||(L=H(["\n backface-visibility: visible;\n background-clip: border-box;\n background-color: transparent;\n background-origin: padding-box;\n background-position: 0 0;\n background-size: auto;\n border-radius: 0;\n border: 0;\n box-shadow: none;\n box-sizing: content-box;\n clear: none;\n clip: auto;\n color: inherit;\n cursor: auto;\n direction: inherit;\n display: block;\n left: auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue',\n sans-serif;\n font-size: 14px;\n font-weight: normal;\n height: auto;\n hyphens: manual;\n letter-spacing: normal;\n line-height: 1;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n outline: invert none medium;\n padding: 0;\n perspective: none;\n position: static;\n right: auto;\n top: auto;\n transform: none;\n text-align: left;\n text-decoration: none;\n vertical-align: baseline;\n visibility: inherit;\n white-space: normal;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n\n div,\n span,\n p,\n a,\n strong,\n b,\n u,\n i,\n ol,\n ul,\n li,\n form,\n label,\n table,\n tr,\n th,\n td,\n article,\n aside,\n footer,\n header,\n nav,\n section {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n }\n\n a {\n cursor: pointer !important;\n color: inherit !important;\n }\n\n button {\n background: transparent;\n border: none;\n font-size: inherit !important;\n color: inherit;\n padding: 0;\n cursor: pointer !important;\n }\n"])));function T(e,t){var n=c(e);return n.setAlpha(t),n.toRgbString()}function z(e,t){return c.mix(e,"black",t||50).toRgbString()}function P(e){var t=e.count,n=Z().unseenBadge,r=i.css(N||(N=H(["\n align-items: center;\n background: "," !important;\n border-radius: "," !important;\n color: "," !important;\n display: flex;\n font-family: "," !important;\n font-size: "," !important;\n height: 18px !important;\n min-width: 10px !important;\n padding: 0 2px !important;\n text-align: "," !important;\n text-transform: "," !important;\n\n div {\n width: 100%;\n }\n "])),T(n.backgroundColor,n.backgroundOpacity),n.borderRadius,n.textColor,n.fontFamily,n.fontSize,n.textAlign,n.textTransform);return i.jsx("span",{css:[F,r]},i.jsx("div",null,t))}var _,q=a.observer(P);function B(e){var t=e.counter,n=Z().icon;return 0===t?null:i.jsx("div",{css:i.css(_||(_=H(["\n position: absolute !important;\n transform: translate(-50%, -50%) scale(",");\n top: 10%;\n left: 80%;\n "])),Math.max(1,parseInt(n.width)/24))},i.jsx(q,{count:t}))}var U=a.observer(B);function D(){var e=Z();return r.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:e.icon.borderColor},r.createElement("path",{d:"M15.9997 4.70663C14.3971 4.71182 12.8617 5.34576 11.7284 6.47013C10.5951 7.59449 9.95592 9.11801 9.95038 10.7082V15.0907C9.95038 16.4805 9.85234 17.3932 9.62941 18.1738C9.39598 18.9845 9.04584 19.5809 8.55447 20.3349C8.38874 20.5862 8.23117 20.8144 8.08761 21.0217C7.66277 21.6158 8.58949 21.7583 9.06218 21.8324C10.8129 22.115 13.2639 22.2957 16.0102 22.2957C18.7565 22.2957 21.2052 22.1196 22.9582 21.8324C24.1791 21.6344 24.0822 21.3031 23.5897 20.5584C23.0819 19.7929 22.7038 19.1791 22.44 18.3718C22.1762 17.5646 22.0467 16.6496 22.0467 15.3119V10.7082C22.0442 9.11807 21.4069 7.59366 20.2742 6.4688C19.1414 5.34394 17.6057 4.71031 16.0032 4.70663H15.9997ZM16.0032 2C18.3263 2.01068 20.551 2.93195 22.1926 4.56308C23.8342 6.19422 24.7596 8.40302 24.7673 10.7082V15.3166C24.7673 16.3589 24.8502 17.0214 25.0217 17.5414C25.1933 18.0614 25.4711 18.5085 25.8528 19.0829C26.1294 19.501 26.4048 19.8647 26.6289 20.1623C27.1588 20.8642 27.5136 21.3344 27.4996 21.976V22.0061C27.4996 23.2234 25.9263 24.0908 23.3854 24.4985C21.4713 24.8089 18.858 25 16.0009 25C13.1437 25 10.5304 24.8089 8.61516 24.4985C6.07428 24.0874 4.50214 23.2245 4.50214 22.0061V21.9957C4.46829 21.3286 4.83944 20.8306 5.40434 20.0766C5.64944 19.7489 5.95057 19.3447 6.26686 18.8629C6.61701 18.3267 6.86094 17.9201 7.001 17.4325C7.15039 16.9091 7.21575 16.2153 7.21575 15.0884V10.7082C7.22192 8.40035 8.14864 6.18875 9.79334 4.55693C11.438 2.92511 13.6669 2.00581 15.9927 2H16.0032Z"}),r.createElement("path",{d:"M20.4988 26C20.4489 27.0446 19.9795 28.0338 19.1834 28.7721C18.7655 29.1614 18.2692 29.4702 17.7228 29.6809C17.1765 29.8916 16.5909 30 15.9994 30C15.408 30 14.8223 29.8916 14.276 29.6809C13.7296 29.4702 13.2333 29.1614 12.8154 28.7721C12.0193 28.0338 11.5499 27.0446 11.5 26C12.3651 26.0703 13.3047 26.1198 14.2916 26.1473C14.3561 26.4337 14.5025 26.6985 14.7154 26.9139C14.9283 27.1293 15.1998 27.2872 15.5013 27.371C15.8027 27.4548 16.1228 27.4613 16.4279 27.3898C16.733 27.3184 17.0116 27.1716 17.2345 26.9651C17.4739 26.7413 17.6382 26.4575 17.7072 26.1484C18.6941 26.1209 19.6337 26.0714 20.5 26.0011"}))}var G,K,W=a.observer(D),Y=n.createContext(null),J=Y.Provider,Q=function(){return n.useContext(Y)},X=n.createContext({}),$=function(){return n.useContext(X)};function ee(e){var t=void 0===e?{}:e,n=t.counter,r=void 0===n?"unseen":n,o=te(t.storeId),i=0;return o&&(i="unread"===r?o.unreadCount:o.unseenCount),{store:o,badgeCounter:i,markAllAsSeen:function(){return o&&o.unseenCount>0?o.markAllAsSeen({updateItems:!1}):Promise.resolve()}}}function te(e){void 0===e&&(e="default");var t=Q(),r="fulfilled"===(null==t?void 0:t.xhrFetchState),o=$().rootStore.get(e),i="initial"===(null==o?void 0:o.xhrFetchState);return n.useEffect((function(){i&&r&&(null==o||o.fetch({page:1}))}),[e,i,r]),o}function ne(e){var t=e.Icon,n=void 0===t?i.jsx(W,null):t,r=e.onClick,o=ee({storeId:e.storeId,counter:e.counter}),a=o.badgeCounter,c=o.markAllAsSeen,l=Z().icon,s=i.css(G||(G=H(["\n display: block;\n cursor: pointer;\n position: relative !important;\n width: "," !important;\n "])),l.width),u=i.css(K||(K=H(["\n position: relative !important;\n\n & > * {\n height: 100%;\n width: 100%;\n }\n "])));return i.jsx("a",{onClick:function(){c(),r()},css:[F,s],"data-testid":"bell"},i.jsx("div",{css:u},n),i.jsx(U,{counter:a}))}var re=a.observer(ne);function oe(e,t){n.useEffect((function(){return l.pushEventAggregator.on(e,t),function(){l.pushEventAggregator.off(e,t)}}),[])}function ie(e){var t=e.onNewNotification;return oe("notifications.new",(function(e){t&&t(e)})),null}var ae=n.createContext({}),ce=ae.Provider,le={header:{title:"NOTIFICACIONES","mark-all-read":"Marcar todo como leído"},notification:{"mark-as-read":"Marcar como leído","mark-as-unread":"Marcar como no leído",delete:"Eliminar"},messages:{"empty-inbox":"¡No tiene notificaciones!<br>Le haremos saber cuando llegue una."}},se={header:{title:"NOTIFICAÇÕES","mark-all-read":"Marcar tudo como lido"},notification:{"mark-as-read":"Marcar como lido","mark-as-unread":"Marcar como não lido",delete:"Apagar"},messages:{"empty-inbox":"Nenhuma notificação disponível!","server-error":"Não conseguimos recuperar suas notificações.<br>Por favor, volte em breve.","no-internet-connection":"Não conseguimos nos conectar à Internet.<br>Por favor, verifique sua conexão."}};function ue(e){var t=e.config,r=e.authServerUrl,o=$().rootStore.stores,i=function(){return o.forEach((function(e){return e.fetch({page:1})}))};return function(e,t){n.useEffect((function(){var n=l.connectToAbly(e,t),r=function(){return l.pushEventAggregator.emit("wakeup")};n.connection.on("disconnected",r),n.connection.on("suspended",r);var o=n.channels.get(e.ws.channel);return o.subscribe(l.handleAblyEvent),function(){n.connection.off("disconnected"),n.connection.off("suspended"),o.unsubscribe(l.handleAblyEvent),o.detach(),n.close()}}),[e.ws.channel])}(t,r),oe("wakeup",i),oe("notifications.new",(function(){return o.forEach((function(e){return e.fetch({page:1},{reset:!1})}))})),oe("notifications.seen.all",(function(){return o.forEach((function(e){return e.markAllAsSeen({localOnly:!0})}))})),oe("notifications.read.all",(function(){return o.forEach((function(e){return e.markAllAsRead({localOnly:!0})}))})),oe("notifications.read",i),oe("notifications.delete",(function(e){return o.forEach((function(t){var n=t.get(e.id);n&&t.remove(n)}))})),null}var de=a.observer(ue);function fe(e){var t=e.apiKey,o=e.userEmail,i=e.userExternalId,c=e.userKey,p=e._baseURL,m=e.children,h=e.theme,x=e.stores,C=e.images,g=e.locale,v=void 0===g?"en":g,b=n.useMemo((function(){return l.setupAjax({apiKey:t,userEmail:o,userExternalId:i,userKey:c,baseURL:p}),new l.Config({apiKey:t,userEmail:o,userExternalId:i,userKey:c})}),[t,o,i,c,p]),y=n.useMemo((function(){return new l.NotificationStoresMap(x||[{id:"default",context:{}}])}),[x]),k=function(e){var t="string"==typeof e?e:e.name;!function(e){var t=e.toLowerCase().replace("_","-");d.locale(t)}(t);var n={es:le,pt_BR:se};if("string"==typeof e)return n[e];var r,o={};return f(o,((r={})[t]=e.translations,r),n),o[t]}(v);return n.useEffect((function(){b.fetch()}),[t,o,i,c,p]),u((function(){return function(){y.dispose()}})),r.createElement(ce,{value:k},r.createElement(I,{value:s({},R,h)},r.createElement(J,{value:b},r.createElement(X.Provider,{value:{rootStore:y,images:C}},r.createElement(a.Observer,null,(function(){return"fulfilled"===b.xhrFetchState?r.createElement(de,{config:b,authServerUrl:p}):null})),m))))}var pe,me,he=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=Object.create((t&&t.prototype instanceof d?t:d).prototype),i=new w(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,i),o}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function p(){}var m={};m[o]=function(){return this};var h=Object.getPrototypeOf,x=h&&h(h(E([])));x&&x!==t&&n.call(x,o)&&(m=x);var C=p.prototype=d.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,c){var l=s(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(l.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return f.prototype=C.constructor=p,p.constructor=f,f.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(C),e},e.awrap=function(e){return{__await:e}},g(v.prototype),v.prototype[i]=function(){return this},e.AsyncIterator=v,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new v(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(C),c(C,a,"Generator"),C[o]=function(){return this},C.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=E,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(me={exports:{}}),me.exports);function xe(e,t){return Ce.apply(this,arguments)}function Ce(){return(Ce=M(he.mark((function e(t,n){var r;return he.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new m.Liquid,e.next=3,r.parseAndRender(t,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(e){var t=e.notification,r=t.sanitizedContent,o=n.useState(""),a=o[0],c=o[1];return n.useEffect((function(){!function(){var e=M(he.mark((function e(){return he.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=5;break}return e.next=3,xe(r,t);case 3:c(e.sent);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}),[r]),n.useEffect((function(){var e=document.querySelectorAll("time[datetime]");return e.length>0&&p.render(e),function(){p.cancel()}}),[a]),""===a.replace(/(\n|\s|\r)/gi,"")?null:i.jsx("article",{css:i.css(pe||(pe=H(["\n color: inherit !important;\n cursor: inherit;\n margin: 0;\n line-height: 1.2;\n font-size: 0.865em !important;\n margin-top: 1em !important;\n word-break: break-word !important;\n "]))),dangerouslySetInnerHTML:{__html:a}})}var ve,be=a.observer(ge);function ye(e){var t=e.id,o=e.defaultMessage,i=e.html,a=void 0!==i&&i,c=n.useContext(ae),l=h(c,t,o);return a?r.createElement("span",{dangerouslySetInnerHTML:{__html:l}}):r.createElement(r.Fragment,null,l)}function ke(e){var t=e.notification,n=Z(),r=n.container,o=n.notification;return i.jsx("div",{css:i.css(ve||(ve=H(["\n background: "," !important;\n border-radius: "," !important;\n box-shadow: 2px 2px 3px ",";\n color: "," !important;\n font-family: "," !important;\n font-size: "," !important;\n text-transform: "," !important;\n min-width: 10em;\n\n a {\n display: block;\n padding: 0.75em 1.25em !important;\n\n &:hover {\n text-decoration: underline !important;\n }\n }\n "])),r.backgroundColor,o.default.borderRadius,z(T(r.backgroundColor,.5),10),o.default.textColor,o.default.fontFamily,o.default.fontSize,o.default.textTransform)},i.jsx("a",{onClick:function(){return t.isRead?t.markAsUnread():t.markAsRead()},"data-testid":"toggle-read"},i.jsx(ye,t.isRead?{id:"notification.mark-as-unread",defaultMessage:"Mark as unread"}:{id:"notification.mark-as-read",defaultMessage:"Mark as read"})),i.jsx("a",{onClick:function(){return t.delete()},"data-testid":"delete"},i.jsx(ye,{id:"notification.delete",defaultMessage:"Delete"})))}var we,Ee=a.observer(ke);function je(e){var t=e.closeOnClick,n=e.offset,o=void 0===n?{skidding:0,distance:10}:n,i=e.onClickOutside,a=e.placement,c=e.zIndex;return r.createElement(x,{render:e.children,offset:[o.skidding,o.distance],onClickOutside:function(){null==i||i()},placement:void 0===a?"bottom-end":a,popperOptions:e.popperOptions,reference:e.launcherRef,visible:e.isOpen,zIndex:void 0===c?9999:c,interactive:!(void 0!==t&&t)},e.launcher)}function Me(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("circle",{cx:"256",cy:"256",r:"64"}))}function Oe(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("circle",{cx:"256",cy:"64",r:"64"}),r.createElement("circle",{cx:"256",cy:"256",r:"64"}),r.createElement("circle",{cx:"256",cy:"448",r:"64"}))}function He(e){var t=e.notification,r=e.menuPlacement,o=void 0===r?"bottom-end":r,a=Z(),c=a.header,l=a.notification,s=n.useState(!1),u=s[0],d=s[1],f=i.jsx("div",{css:i.css(we||(we=H(["\n display: flex !important;\n align-items: center !important;\n padding: 0.5em 0 0.5em 0.25em !important;\n color: "," !important;\n\n svg {\n height: 1.5em;\n fill: currentColor;\n }\n "])),t.isRead?T(l.default.textColor,.5):c.backgroundColor),onMouseOver:function(){return d(!0)},onMouseLeave:function(){return d(!1)},"data-testid":"icon"},i.jsx(t.isRead||u?Oe:Me,null));return i.jsx(je,{launcher:f,offset:{skidding:-4,distance:2},placement:o,zIndex:0},(function(){return i.jsx(Ee,{notification:t})}))}var Le,Ne=a.observer(He);function Se(e){var t=e.date,n=Z(),r=n.container,o=n.notification;return i.jsx("span",{css:i.css(Le||(Le=H(["\n background: "," !important;\n border-radius: "," !important;\n box-shadow: 2px 2px 3px ",";\n color: "," !important;\n font-size: 0.8em !important;\n padding: 0.5em !important;\n text-transform: ",";\n "])),r.backgroundColor,o.default.borderRadius,z(T(r.backgroundColor,.5),10),o.default.textColor,o.default.textTransform)},t.format("LL LT"))}function Ae(e){var t=e.date,o=e.tooltipPlacement,i=void 0===o?"bottom-end":o,a=n.useMemo((function(){return function(e){return d(e)}(t)}),[t]),c=n.useState(a.fromNow(!0)),l=c[0],s=c[1];return C((function(){return s(a.fromNow(!0))}),6e4),r.createElement(je,{launcher:r.createElement("div",null,l),placement:i},(function(){return r.createElement(Se,{date:a})}))}d.extend(g),d.extend(v),d.extend(b),d.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%ds",m:"1m",mm:"%dm",h:"1h",hh:"%dh",d:"1d",dd:"%dd",M:"1mo",MM:"%dmo",y:"1y",yy:"%dy"}});var Re,Ve=a.observer(Ae);function Ie(e,t){void 0===t&&(t={}),function(e,t){u((function(){return function(){t?t(e):e.isSeen=!0}}))}(e,t.onUnmount)}function Ze(e){var t=e.notification.title;return i.jsx("p",{title:t,css:i.css(Re||(Re=H(["\n cursor: inherit;\n font-weight: 500 !important;\n line-height: 1.2 !important;\n word-break: break-word !important;\n "])))},t)}var Fe,Te=a.observer(Ze);function ze(e){var t=e.notification,n=e.children,r=Z().notification,o=r.default;t.isSeen?t.isRead||(o=r.unread):o=r.unseen;var a=i.css(Fe||(Fe=H(["\n background-color: "," !important;\n border-radius: ",";\n color: "," !important;\n cursor: pointer;\n display: flex;\n align-items: center;\n font-family: "," !important;\n font-size: ",";\n margin: 4px !important;\n overflow: hidden;\n text-align: "," !important;\n text-transform: ",";\n transition: background-color 300ms ease-out;\n padding: 16px 20px !important;\n min-height: 32px;\n\n &:hover {\n background-color: "," !important;\n }\n\n & > button {\n flex: 1;\n display: inline-flex;\n align-items: center;\n margin: 0 0 0 -16px;\n text-align: inherit !important;\n\n & > div {\n margin: 0 0 0 16px;\n }\n\n & > div:first-of-type {\n flex: 1;\n }\n }\n "])),t.isSeen?"transparent":T(o.backgroundColor,o.backgroundOpacity),o.borderRadius,o.textColor,o.fontFamily,o.fontSize,o.textAlign,o.textTransform,z(T(o.backgroundColor,o.backgroundOpacity),5));return i.jsx("div",{css:[F,a]},n)}var Pe,_e=a.observer(ze);function qe(e){var t=e.notification,n=e.onClick;return Ie(t),i.jsx(_e,{notification:t},i.jsx("button",{onClick:function(){t.markAsRead(),n?n(t):t.actionUrl&&window.open(t.actionUrl,"_self")},"data-testid":"clickable-notification"},i.jsx("div",null,i.jsx(Te,{notification:t}),i.jsx(be,{notification:t})),i.jsx("div",{css:i.css(Pe||(Pe=H(["\n padding: 0.5em 0 0.5em 0.25em !important;\n "])))},t.sentAtDate?i.jsx(Ve,{date:t.sentAtDate}):null)),i.jsx(Ne,{notification:t}))}var Be,Ue,De=a.observer(qe);function Ge(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))}function Ke(e){var t=e.onClick;return i.jsx("button",{onClick:function(){t()},css:i.css(Be||(Be=H(["\n display: flex;\n align-items: center;\n\n svg {\n height: 24px;\n }\n "])))},i.jsx(Ge,null))}function We(e){var t=e.onClick,n=Z();return i.jsx("button",{css:i.css(Ue||(Ue=H(["\n padding: 10px !important;\n border-radius: 4px !important;\n background: "," !important;\n color: "," !important;\n "])),n.footer.backgroundColor,n.footer.textColor),onClick:function(){t()}},"Enable Now")}var Ye,Je=a.observer(We);function Qe(){var e=Q(),t=Z(),n=t.footer,r=t.notification,o=k.useLocalStorage("magicbell:web-push-requested-at",null),a=o[1];return o[0]?null:i.jsx("div",{css:i.css(Ye||(Ye=H(["\n padding: 14px 24px !important;\n display: flex;\n text-align: left;\n align-items: center;\n background: ",";\n\n color: "," !important;\n font-family: "," !important;\n text-align: "," !important;\n font-size: "," !important;\n\n & > * {\n margin-left: 1rem;\n }\n "])),T(r.unseen.backgroundColor,.1),r.unseen.textColor,n.fontFamily,n.textAlign,n.fontSize)},i.jsx("p",{style:{flex:1}},"By enabling browser notifications, you’ll stay up to date even better."),i.jsx(Je,{onClick:function(){var n=h(e,"webPushNotifications.subscribeUrl"),r=y.getUri({url:n,params:{user_email:null==e?void 0:e.userEmail,user_external_id:null==e?void 0:e.userExternalId,background_color:t.header.backgroundColor,text_color:t.header.textColor}});a(Date.now()),function(e){var t=(screen.height-400)/4,n=(screen.width-600)/2;window.open(e,"","width=600,height=400,scrollbars=no,top="+t+",left="+n)}(r)}}),i.jsx(Ke,{onClick:function(){a(Date.now())}}))}var Xe=a.observer(Qe);function $e(){return r.createElement("svg",{width:"64",height:"16",viewBox:"0 0 128 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M13.2378 4.66791C11.6702 4.67293 10.1682 5.29789 9.05974 6.40637C7.95126 7.51485 7.3263 9.01682 7.32128 10.5844V14.904C7.32128 16.2701 7.22608 17.1721 7.00713 17.9432C6.77392 18.7047 6.41866 19.4233 5.95519 20.0709C5.79336 20.3089 5.63866 20.5469 5.49587 20.7492C5.08176 21.3346 5.98613 21.475 6.44784 21.5488C8.69788 21.8729 10.9694 22.024 13.2426 22.001C15.5165 22.0241 17.7889 21.8729 20.0397 21.5488C21.2297 21.3537 21.1392 21.0276 20.6561 20.297C20.1816 19.6349 19.8034 18.909 19.5328 18.1408C19.2418 17.1631 19.1116 16.1447 19.1472 15.1254V10.5844C19.1453 9.01709 18.5223 7.51438 17.4147 6.40542C16.3071 5.29647 14.8052 4.67169 13.2378 4.66791ZM13.2378 2C15.5097 2.01067 17.6853 2.91905 19.2902 4.52711C20.8952 6.13517 21.7993 8.31251 21.8056 10.5844V15.1254C21.7707 15.8647 21.851 16.605 22.0436 17.3197C22.2453 17.8601 22.5191 18.3709 22.8575 18.8381C23.1288 19.2498 23.3978 19.6092 23.6167 19.9019C24.1356 20.5921 24.483 21.0562 24.4688 21.6892V21.713C24.4688 22.903 22.9289 23.7622 20.4443 24.1691C18.0527 24.5177 15.6379 24.6824 13.2212 24.6618C10.8141 24.6833 8.40892 24.521 6.02659 24.1763C3.54193 23.7693 2.00211 22.9197 2.00211 21.7202C1.96879 21.0633 2.33292 20.573 2.88507 19.8281C3.12306 19.5068 3.41818 19.1141 3.72757 18.6382C4.03691 18.2073 4.27775 17.7313 4.44155 17.2269C4.58673 16.7128 4.65099 16.0369 4.65099 14.9183V10.5844C4.65664 8.30944 5.56289 6.12924 7.17156 4.52057C8.78023 2.9119 10.9604 2.00566 13.2354 2H13.2378Z"}),r.createElement("path",{d:"M10.8769 9.68955C10.8668 10.1473 10.9882 10.5983 11.2268 10.989C11.4417 11.326 11.7457 11.5969 12.105 11.772C12.4608 11.9412 12.8498 12.029 13.2438 12.029C13.6378 12.029 14.0268 11.9412 14.3826 11.772C14.7419 11.5969 15.0458 11.326 15.2608 10.989C15.49 10.5934 15.6107 10.1444 15.6107 9.68717C15.6107 9.22999 15.49 8.78091 15.2608 8.38534C15.0442 8.05094 14.7406 7.78189 14.3826 7.6071C14.0275 7.43555 13.6382 7.34644 13.2438 7.34644C12.8494 7.34644 12.4601 7.43555 12.105 7.6071C11.747 7.78189 11.4433 8.05094 11.2268 8.38534C10.9886 8.77798 10.8672 9.2304 10.8769 9.68955Z"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.6468 9.68483L23.0836 8.3711L20.5204 7.05737V9.68483V12.3147L23.0836 11.0009L25.6468 9.68483Z"}),r.createElement("path",{d:"M17.5907 25.8422C17.5423 26.9273 17.0888 27.9548 16.3198 28.722C15.9164 29.1264 15.4371 29.4472 14.9095 29.6661C14.3818 29.8851 13.8162 29.9977 13.2449 29.9977C12.6737 29.9977 12.1081 29.8851 11.5804 29.6661C11.0528 29.4472 10.5735 29.1264 10.1701 28.722C9.40107 27.9548 8.94761 26.9273 8.89917 25.8422C9.73453 25.916 10.6437 25.9684 11.5956 25.9969C11.6721 26.3773 11.879 26.7191 12.1805 26.9633C12.482 27.2075 12.8593 27.3387 13.2473 27.3344C13.4683 27.3346 13.6872 27.2912 13.8914 27.2067C14.0956 27.1221 14.2811 26.9981 14.4373 26.8418C14.669 26.61 14.8278 26.3155 14.8942 25.9945C15.8462 25.966 16.7554 25.9136 17.5907 25.8398"}),r.createElement("path",{d:"M44.688 7.22H41.806L36.834 18.418H36.68L31.686 7.22H28.782V22.62H31.048V11.356H31.224L35.536 20.86H37.978L42.268 11.356H42.422V22.62H44.688V7.22Z"}),r.createElement("path",{d:"M57.2448 20.926C56.6948 20.926 56.4088 20.64 56.4088 20.024V15.514C56.4088 12.764 54.5168 11.4 52.0088 11.4C49.3688 11.4 47.7408 12.984 47.5428 15.162H49.7648C49.9628 14.018 50.6228 13.226 52.0088 13.226C53.3728 13.226 54.1648 14.018 54.1648 15.426V15.976L50.7988 16.306C48.6868 16.504 47.1028 17.582 47.1028 19.672C47.1028 21.828 48.7088 22.84 50.8428 22.84C52.4928 22.84 53.7028 22.202 54.4508 21.256C54.7588 22.29 55.4848 22.62 56.5188 22.62H57.5308V20.926H57.2448ZM54.1648 18.396C54.1648 20.376 52.5368 21.08 51.1728 21.08C50.1828 21.08 49.3468 20.684 49.3468 19.584C49.3468 18.528 50.2488 17.956 51.5468 17.846L54.1648 17.582V18.396Z"}),r.createElement("path",{d:"M69.3697 11.774L68.1817 10.498C67.7417 11.07 67.0377 11.686 66.3557 12.038C65.6517 11.62 64.7937 11.4 63.8257 11.4C61.2077 11.4 59.5357 13.028 59.5357 15.184C59.5357 16.306 59.9757 17.23 60.7237 17.868C59.9537 18.286 59.2937 18.968 59.2937 19.958C59.2937 20.904 59.8217 21.63 60.6577 21.982L58.8977 23.5C59.0957 25.524 60.6577 27.24 64.0017 27.24C66.9277 27.24 68.9297 25.92 68.9297 23.588C68.9297 21.652 67.5437 20.442 65.0357 20.442H62.8577C61.9557 20.442 61.3177 20.134 61.3177 19.496C61.3177 19.1 61.5377 18.814 61.9557 18.594C62.5277 18.814 63.1877 18.924 63.9137 18.924C66.3557 18.924 68.2477 17.516 68.2477 15.184C68.2477 14.392 68.0057 13.666 67.5437 13.072C68.3137 12.698 69.0177 12.192 69.3697 11.774ZM63.9137 17.23C62.5497 17.23 61.6697 16.35 61.6697 15.184C61.6697 13.93 62.5497 13.072 63.9137 13.072C65.2557 13.072 66.0917 13.93 66.0917 15.184C66.0917 16.35 65.2557 17.23 63.9137 17.23ZM66.7737 23.698C66.7737 24.952 65.4757 25.524 64.0017 25.524C62.1537 25.524 61.3397 24.6 61.0757 23.654L62.7697 22.224H64.7717C65.6737 22.224 66.7737 22.554 66.7737 23.698Z"}),r.createElement("path",{d:"M72.1185 9.992C72.8885 9.992 73.5265 9.332 73.5265 8.562C73.5265 7.77 72.8885 7.154 72.1185 7.154C71.3265 7.154 70.6665 7.77 70.6665 8.562C70.6665 9.332 71.3265 9.992 72.1185 9.992ZM70.9965 22.62H73.2405V11.62H70.9965V22.62Z"}),r.createElement("path",{d:"M81.0823 22.84C83.8103 22.84 85.8123 21.322 86.2083 18.946H83.9643C83.5463 20.134 82.6003 20.882 81.0823 20.882C79.0143 20.882 77.7383 19.298 77.7383 17.186C77.7383 14.986 79.1243 13.358 81.0603 13.358C82.6003 13.358 83.6563 14.304 83.9203 15.448H86.1643C85.7903 12.786 83.5463 11.4 81.0603 11.4C77.8703 11.4 75.5163 13.798 75.5163 17.186C75.5163 20.42 77.6943 22.84 81.0823 22.84Z"}),r.createElement("path",{d:"M96.7512 14.546V14.436C97.8732 13.908 98.9072 12.984 98.9072 11.048C98.9072 8.782 97.4772 7.22 94.5072 7.22H88.6332V22.62H94.5292C97.5212 22.62 99.3252 21.08 99.3252 18.396C99.3252 16.064 97.9392 14.986 96.7512 14.546ZM90.8992 9.112H94.2652C95.6732 9.112 96.5972 9.948 96.5972 11.378C96.5972 12.808 95.7612 13.754 94.1992 13.754H90.8992V9.112ZM94.3312 20.728H90.8992V15.646H94.3312C95.9592 15.646 96.9712 16.746 96.9712 18.242C96.9712 19.716 96.0032 20.728 94.3312 20.728Z"}),r.createElement("path",{d:"M111.65 16.966C111.65 13.182 109.296 11.4 106.612 11.4C103.62 11.4 101.266 13.644 101.266 17.23C101.266 20.618 103.532 22.84 106.7 22.84C109.296 22.84 111.144 21.52 111.606 19.32H109.45C109.098 20.442 108.086 21.014 106.7 21.014C104.764 21.014 103.576 19.65 103.466 17.692H111.606C111.628 17.406 111.65 17.186 111.65 16.966ZM106.612 13.226C108.306 13.226 109.45 14.414 109.472 16.108H103.488C103.708 14.502 104.874 13.226 106.612 13.226Z"}),r.createElement("path",{d:"M113.966 22.62H116.21V7H113.966V22.62Z"}),r.createElement("path",{d:"M118.838 22.62H121.082V7H118.838V22.62Z"}))}function et(){var e=Q();return h(null==e?void 0:e.inbox,"features.noMagicbellBranding.enabled",!1)?r.createElement("p",{style:{height:"16px"}}):r.createElement("a",{href:"https://magicbell.io/?utm_source=widget",target:"_blank",rel:"noopener noreferrer"},r.createElement($e,null))}var tt,nt=a.observer(et);function rt(e){var t=e.children,n=Z().footer,r=i.css(tt||(tt=H(["\n background: ",";\n border-radius: 0 0 "," "," !important;\n color: "," !important;\n font-family: "," !important;\n text-align: "," !important;\n font-size: "," !important;\n padding: 14px 24px !important;\n flex-shrink: 0 !important;\n\n span {\n color: "," !important;\n\n a {\n color: ",";\n margin-right: 16px !important;\n opacity: 0.75;\n display: block;\n }\n }\n "])),T(n.backgroundColor,n.backgroundOpacity),n.borderRadius,n.borderRadius,T(n.textColor,.75),n.fontFamily,n.textAlign,n.fontSize,n.textColor,n.textColor);return i.jsx("div",{css:[F,r]},t)}var ot,it=a.observer(rt);function at(e){var t=e.children,n=Z().header,r=i.css(ot||(ot=H(["\n align-items: center;\n background: "," !important;\n border-radius: "," "," 0 0 !important;\n color: ",";\n display: flex;\n font-family: "," !important;\n font-size: "," !important;\n justify-content: space-between;\n text-align: "," !important;\n text-transform: "," !important;\n padding: 16px 24px !important;\n flex-shrink: 0 !important;\n "])),T(n.backgroundColor,n.backgroundOpacity),n.borderRadius,n.borderRadius,n.textColor,n.fontFamily,n.fontSize,n.textAlign,n.textTransform);return i.jsx("div",{css:[F,r]},t)}var ct,lt,st=a.observer(at);function ut(e){var t=e.onClose;return i.jsx("div",{css:i.css(ct||(ct=H(["\n position: absolute;\n bottom: 0;\n top: 0;\n background: white;\n right: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n\n .uppercase {\n text-transform: uppercase;\n }\n\n button.close svg {\n height: 18px;\n }\n\n .content {\n flex: 1;\n margin: 4px;\n padding: 16px 20px !important;\n }\n "])))},i.jsx(st,null,i.jsx("p",{className:"uppercase"},"Preferences"),i.jsx("button",{onClick:function(){t()},className:"close"},i.jsx(Ge,null))),i.jsx("div",{className:"content"},"Comming soon"),i.jsx(it,null,i.jsx(nt,null)))}function dt(){var e=Z().footer,t=o(!1),r=t[0],a=t[1],c=i.css(lt||(lt=H(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: "," !important;\n\n a,\n button {\n color: ",";\n display: block;\n }\n\n a {\n opacity: 0.85;\n }\n "])),e.textColor,e.textColor);return r?i.jsx(ut,{onClose:a}):i.jsx(n.Fragment,null,i.jsx(Xe,null),i.jsx(it,null,i.jsx("div",{css:c},i.jsx(nt,null),i.jsx("button",{onClick:a}))))}var ft,pt,mt=a.observer(dt);function ht(){return i.jsx("p",{css:i.css(ft||(ft=H(["\n margin-right: 16px !important;\n "])))},i.jsx(ye,{id:"header.title",defaultMessage:"NOTIFICATIONS"}))}function xt(e){var t=e.onAllRead;return r.createElement(st,null,r.createElement(ht,null),r.createElement("button",{onClick:function(){return t()},"data-testid":"mark-all-as-read"},r.createElement(ye,{id:"header.mark-all-read",defaultMessage:"Mark All Read"})))}function Ct(){return i.jsx("div",{css:i.css(pt||(pt=H(["\n color: inherit !important;\n font-size: 0.85em !important;\n padding: 0.5em !important;\n text-align: center !important;\n "])))},"Loading...")}function gt(e){var t=e.notifications,n=e.onItemClick,o=e.height,i=e.queryParams,a=e.scrollableTarget,c=e.ListItem,l=void 0===c?De:c;return r.createElement(E,{dataLength:t.length,hasMore:t.hasNextPage,next:function(){return t.fetchNextPage(i)},loader:r.createElement(Ct,null),height:o,scrollableTarget:a},t.map((function(e){return r.createElement(l,{key:e.id,notification:e,onClick:n})})))}var vt,bt,yt,kt=a.observer(gt);function wt(){var e=Z(),t=$().images,n=e.notification;return i.jsx("div",{css:i.css(vt||(vt=H(["\n padding: 3em !important;\n text-align: center;\n color: ",";\n\n img {\n margin: 2em auto;\n height: 200px;\n }\n "])),n.default.textColor)},i.jsx("p",null,i.jsx(ye,{id:"messages.empty-inbox",defaultMessage:"All clear!<br>We'll let you know when there's more.",html:!0})),i.jsx("img",{src:(null==t?void 0:t.emptyInboxUrl)||"https://assets.magicbell.io/images/empty_inbox.png",alt:"No notifications"}))}function Et(){return r.createElement("div",null,r.createElement("p",null,r.createElement(ye,{id:"messages.no-internet-connection",defaultMessage:"Hmm, we’re unable to connect to the internet.<br>Please check your connection.",html:!0})),r.createElement("svg",{width:"120",height:"93",viewBox:"0 0 120 93",fill:"currentColor"},r.createElement("path",{d:"M13.5135 93H106.486C113.919 93 120 86.9871 120 79.6379V27.5259V13.3621C120 6.01293 113.919 0 106.486 0H13.5135C6.08108 0 0 6.01293 0 13.3621V27.3922V79.5043C0 86.9871 6.08108 93 13.5135 93ZM2.7027 13.3621C2.7027 7.48276 7.56757 2.67241 13.5135 2.67241H106.486C112.432 2.67241 117.297 7.48276 117.297 13.3621V24.7198H2.7027V13.3621ZM2.7027 27.3922H117.297V79.5043C117.297 85.3836 112.432 90.194 106.486 90.194H13.5135C7.56757 90.194 2.7027 85.3836 2.7027 79.5043V27.3922Z"}),r.createElement("path",{d:"M13.6485 5.87933C9.05392 5.87933 5.40527 9.48709 5.40527 14.0302C5.40527 18.5733 9.05392 22.1811 13.6485 22.1811C18.2431 22.1811 21.8918 18.5733 21.8918 14.0302C21.8918 9.48709 18.108 5.87933 13.6485 5.87933ZM13.6485 19.375C10.5404 19.375 8.10798 16.9698 8.10798 13.8966C8.10798 10.8233 10.5404 8.41813 13.6485 8.41813C16.7566 8.41813 19.1891 10.8233 19.1891 13.8966C19.1891 16.9698 16.6215 19.375 13.6485 19.375Z"}),r.createElement("path",{d:"M32.4322 5.87933C27.8376 5.87933 24.189 9.48709 24.189 14.0302C24.189 18.5733 27.8376 22.1811 32.4322 22.1811C37.0268 22.1811 40.6755 18.5733 40.6755 14.0302C40.6755 9.48709 36.8917 5.87933 32.4322 5.87933ZM32.4322 19.375C29.3241 19.375 26.8917 16.9698 26.8917 13.8966C26.8917 10.8233 29.3241 8.41813 32.4322 8.41813C35.5403 8.41813 37.9727 10.8233 37.9727 13.8966C37.9727 16.9698 35.4052 19.375 32.4322 19.375Z"}),r.createElement("path",{d:"M51.2164 5.87933C46.6218 5.87933 42.9731 9.48709 42.9731 14.0302C42.9731 18.5733 46.6218 22.1811 51.2164 22.1811C55.811 22.1811 59.4596 18.5733 59.4596 14.0302C59.4596 9.48709 55.6758 5.87933 51.2164 5.87933ZM51.2164 19.375C48.1083 19.375 45.6758 16.9698 45.6758 13.8966C45.6758 10.8233 48.1083 8.41813 51.2164 8.41813C54.3245 8.41813 56.7569 10.8233 56.7569 13.8966C56.7569 16.9698 54.1894 19.375 51.2164 19.375Z"}),r.createElement("path",{d:"M42.4924 57.2198C43.2979 62.379 47.594 66.3 52.8299 66.3H56.5219C57.4617 66.3 58.2001 65.5433 58.2001 64.5803V46.4198C58.2001 45.4567 57.4617 44.7 56.5219 44.7H52.8971C47.6611 44.7 43.2979 48.621 42.5595 53.7803H38.2783C37.3385 53.7803 36.6001 54.537 36.6001 55.5C36.6001 56.4631 37.3385 57.2198 38.2783 57.2198H42.4924ZM52.9642 48.1395H54.978V62.9293H52.9642C49.0037 62.8605 45.7816 59.5586 45.7816 55.5C45.6473 51.4414 49.0037 48.1395 52.9642 48.1395Z"}),r.createElement("path",{d:"M60.8833 58.3204C60.0527 58.3204 59.4001 59.0771 59.4001 60.0401C59.4001 61.0032 60.0527 61.7599 60.8833 61.7599H64.3242V64.5803C64.3242 65.5433 64.9768 66.3 65.8073 66.3H69.0109C73.6384 66.3 77.4945 62.379 78.1471 57.2198H81.917C82.7476 57.2198 83.4001 56.4631 83.4001 55.5C83.4001 54.537 82.7476 53.7803 81.917 53.7803H78.2064C77.4945 48.621 73.6977 44.7 69.0703 44.7H65.8073C64.9768 44.7 64.3242 45.4567 64.3242 46.4198V49.2401H60.8833C60.0527 49.2401 59.4001 49.9968 59.4001 50.9599C59.4001 51.9229 60.0527 52.6796 60.8833 52.6796H64.3242V58.3204H60.8833ZM67.1718 48.0707H68.9516C72.4518 48.0707 75.2995 51.3726 75.2995 55.4312C75.2995 59.4898 72.4518 62.7917 68.9516 62.7917H67.1718V48.0707Z"})))}function jt(){return r.createElement("div",null,r.createElement("p",null,r.createElement(ye,{id:"messages.server-error",defaultMessage:"We can’t seem to retrieve your notifications.<br>Please check back soon.",html:!0})),r.createElement("svg",{width:"120",height:"94",viewBox:"0 0 120 94",fill:"currentColor"},r.createElement("path",{d:"M13.5135 94H106.486C113.919 94 120 87.9224 120 80.4942V27.8218V13.5057C120 6.07759 113.919 0 106.486 0H13.5135C6.08108 0 0 6.07759 0 13.5057V27.6868V80.3592C0 87.9224 6.08108 94 13.5135 94ZM2.7027 13.5057C2.7027 7.56322 7.56757 2.70115 13.5135 2.70115H106.486C112.432 2.70115 117.297 7.56322 117.297 13.5057V24.9856H2.7027V13.5057ZM2.7027 27.6868H117.297V80.3592C117.297 86.3017 112.432 91.1638 106.486 91.1638H13.5135C7.56757 91.1638 2.7027 86.3017 2.7027 80.3592V27.6868Z"}),r.createElement("path",{d:"M13.6486 5.9425C9.05404 5.9425 5.4054 9.58906 5.4054 14.181C5.4054 18.773 9.05404 22.4195 13.6486 22.4195C18.2432 22.4195 21.8919 18.773 21.8919 14.181C21.8919 9.58906 18.1081 5.9425 13.6486 5.9425ZM13.6486 19.5833C10.5405 19.5833 8.1081 17.1523 8.1081 14.046C8.1081 10.9396 10.5405 8.5086 13.6486 8.5086C16.7567 8.5086 19.1892 10.9396 19.1892 14.046C19.1892 17.1523 16.6216 19.5833 13.6486 19.5833Z"}),r.createElement("path",{d:"M32.4325 5.9425C27.8379 5.9425 24.1892 9.58906 24.1892 14.181C24.1892 18.773 27.8379 22.4195 32.4325 22.4195C37.027 22.4195 40.6757 18.773 40.6757 14.181C40.6757 9.58906 36.8919 5.9425 32.4325 5.9425ZM32.4325 19.5833C29.3243 19.5833 26.8919 17.1523 26.8919 14.046C26.8919 10.9396 29.3243 8.5086 32.4325 8.5086C35.5406 8.5086 37.973 10.9396 37.973 14.046C37.973 17.1523 35.4054 19.5833 32.4325 19.5833Z"}),r.createElement("path",{d:"M51.2163 5.9425C46.6217 5.9425 42.973 9.58906 42.973 14.181C42.973 18.773 46.6217 22.4195 51.2163 22.4195C55.8109 22.4195 59.4595 18.773 59.4595 14.181C59.3244 9.58906 55.6757 5.9425 51.2163 5.9425ZM51.2163 19.5833C48.1082 19.5833 45.6757 17.1523 45.6757 14.046C45.6757 10.9396 48.1082 8.5086 51.2163 8.5086C54.3244 8.5086 56.7568 10.9396 56.7568 14.046C56.6217 17.1523 54.1892 19.5833 51.2163 19.5833Z"}),r.createElement("path",{d:"M18.9188 75.6321C19.1891 75.9022 19.5945 76.0373 19.8648 76.0373C20.135 76.0373 20.5405 75.9022 20.8107 75.6321L36.4864 59.9655C37.0269 59.4252 37.0269 58.6149 36.4864 58.0746L20.8107 42.408C20.2702 41.8678 19.4594 41.8678 18.9188 42.408C18.3783 42.9482 18.3783 43.7586 18.9188 44.2988L33.6486 59.0201L18.9188 73.7413C18.3783 74.2815 18.3783 75.0919 18.9188 75.6321Z"}),r.createElement("path",{d:"M47.5675 60.3707H72.2973C73.1081 60.3707 73.6486 59.8305 73.6486 59.0201C73.6486 58.2098 73.1081 57.6696 72.2973 57.6696H47.5675C46.7567 57.6696 46.2162 58.2098 46.2162 59.0201C46.2162 59.8305 46.8919 60.3707 47.5675 60.3707Z"})))}function Mt(){var e=Z().notification;return i.jsx("div",{css:i.css(bt||(bt=H(["\n padding: 3em !important;\n text-align: center;\n color: ",";\n\n svg {\n margin: 2em auto;\n height: 200px;\n }\n "])),e.default.textColor)},navigator.onLine?i.jsx(jt,null):i.jsx(Et,null))}function Ot(e){var t=e.height,r=e.onAllRead,o=e.onNotificationClick,a=e.store,c=e.NotificationItem,l=n.useRef(),s=function(e,t){var r=n.useState(t),o=r[0],i=r[1],a=n.useRef();return n.useEffect((function(){return a.current=new w((function(e){void 0===e&&(e=[]),e.forEach((function(e){i(e.contentRect.height)}))})),e.current&&a.current.observe(e.current),function(){a.current&&a.current.disconnect()}}),[e]),o}(l,t),u=n.useState(t),d=u[0],f=u[1];return n.useEffect((function(){f(s)}),[s]),i.jsx("div",{css:[F,i.css(yt||(yt=H(["\n display: flex;\n flex-direction: column;\n height: ","px;\n "])),t)]},i.jsx(xt,{onAllRead:function(){null==a||a.markAllAsRead(),r&&r()}}),i.jsx("div",{ref:l,css:{flex:1,overflowY:"hidden"}},"rejected"===a.xhrFetchState&&i.jsx(Mt,null),"fulfilled"===a.xhrFetchState&&a.isEmpty&&i.jsx(wt,null),"fulfilled"===a.xhrFetchState&&!a.isEmpty&&i.jsx(kt,{height:d,notifications:a,onItemClick:o,queryParams:a.context,ListItem:c})),i.jsx(mt,null))}var Ht=a.observer(Ot);function Lt(e){var t=e.height,n=e.onAllRead,r=e.onNotificationClick,o=e.NotificationItem,a=e.storeId,c=te(void 0===a?"default":a);return c?i.jsx(Ht,{store:c,onNotificationClick:r,height:t,onAllRead:n,NotificationItem:o}):null}var Nt,St=a.observer(Lt);function At(e){var t=e.placement,n=Z(),r=n.header,o=n.footer;return i.jsx("div",{"data-popper-arrow":!0,"data-popper-placement":t,css:i.css(Nt||(Nt=H(["\n &,\n &:before {\n position: absolute;\n width: 18px !important;\n height: 18px !important;\n z-index: -1;\n border-radius: 2px !important;\n }\n\n &:before {\n content: '';\n transform: rotate(45deg);\n left: 0;\n }\n\n &[data-popper-placement^='top'] {\n bottom: -4px;\n\n &:before {\n background: ",";\n }\n }\n\n &[data-popper-placement^='bottom'] {\n top: -4px;\n\n &:before {\n background: ",";\n }\n }\n\n &[data-popper-placement^='left'] {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] {\n left: -4px;\n }\n "])),r.backgroundColor,o.backgroundColor)})}var Rt,Vt=a.observer(At);function It(e){var t=e.width,n=void 0===t?400:t,r=e.children,o=e.attrs,a=Z(),c=a.header,l=a.footer,s=a.container;return i.jsx("div",Object.assign({css:i.css(Rt||(Rt=H(["\n font-family: "," !important;\n background-color: ",";\n color: ",";\n border-radius: "," ",";\n box-shadow: 0px 20px 25px rgba(84, 95, 111, 0.1), 0px 10px 10px rgba(84, 95, 111, 0.04);\n width: ","px;\n max-width: calc(100vw - 10px);\n "])),s.fontFamily,s.backgroundColor,s.textColor,c.borderRadius,l.borderRadius,n)},o),r)}t.configure({isolateGlobalState:!0,enforceActions:"never"}),Object.defineProperty(exports,"Observer",{enumerable:!0,get:function(){return a.Observer}}),Object.defineProperty(exports,"observer",{enumerable:!0,get:function(){return a.observer}}),Object.defineProperty(exports,"Notification",{enumerable:!0,get:function(){return l.Notification}}),Object.defineProperty(exports,"NotificationStore",{enumerable:!0,get:function(){return l.NotificationStore}}),Object.defineProperty(exports,"NotificationStoreWithContext",{enumerable:!0,get:function(){return l.NotificationStoreWithContext}}),exports.Bell=re,exports.ClickableNotification=De,exports.EnablePushNotificationsButton=Je,exports.FloatingNotificationInbox=function(e){var t=e.launcherRef,n=e.isOpen,o=e.toggle,i=e.placement,a=void 0===i?"auto":i,c=e.width,l=void 0===c?500:c,s=e.onNotificationClick,u=e.closeOnClickOutside,d=void 0===u||u,f=e.closeOnNotificationClick,p=void 0===f||f,m=e.popperOptions,h=e.hideArrow,x=void 0!==h&&h,C=O(e,["launcherRef","isOpen","toggle","placement","width","onNotificationClick","closeOnClickOutside","closeOnNotificationClick","popperOptions","hideArrow"]),g=function(e){null==s||s(e),p&&(null==o||o())};return r.createElement(je,{isOpen:n,launcherRef:t,onClickOutside:function(){d&&(null==o||o())},placement:a,popperOptions:m},(function(e){return r.createElement(It,{width:l,attrs:e},r.createElement(St,Object.assign({onNotificationClick:g},C)),x?null:r.createElement(Vt,{placement:e["data-placement"]}))}))},exports.FloatingNotificationInboxArrow=Vt,exports.Footer=mt,exports.Header=xt,exports.MagicBellContext=X,exports.MagicBellProvider=fe,exports.MagicBellThemeContext=V,exports.NotificationContent=be,exports.NotificationInbox=St,exports.NotificationList=kt,exports.NotificationState=Ne,exports.Popover=je,exports.StyledNotificationContainer=_e,exports.Timestamp=Ve,exports.UnseenBadge=q,exports.darken=z,exports.default=function(e){var t=e.children,i=e.BellIcon,a=e.defaultIsOpen,c=void 0!==a&&a,l=e.onNewNotification,s=e.onToggle,u=e.bellCounter,d=void 0===u?"unseen":u,f=O(e,["children","BellIcon","defaultIsOpen","onNewNotification","onToggle","bellCounter"]),p=n.useRef(null),m=o(c),h=m[0],x=m[1];return r.createElement(fe,Object.assign({},f),r.createElement("div",null,r.createElement("div",{ref:p,"aria-expanded":h},r.createElement(re,{onClick:function(){x(),null==s||s(h)},Icon:i,counter:d})),r.createElement(ie,{onNewNotification:l}),h&&t({isOpen:h,toggle:x,launcherRef:p})))},exports.defaultMagicBellTheme=R,exports.toRGBA=T,exports.useBell=ee,exports.useConfig=Q,exports.useMagicBellContext=$,exports.useMagicBellEvent=oe,exports.useNotificationWorkflow=Ie,exports.useNotifications=te,exports.useTheme=Z; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("mobx"),t=require("react"),r=e(t),o=e(require("react-use/lib/useToggle")),i=require("@emotion/core"),a=require("mobx-react"),c=e(require("tinycolor2")),l=require("@magicbell/core"),s=e(require("lodash/merge")),u=e(require("react-use/lib/useEffectOnce")),d=e(require("dayjs"));require("dayjs/locale/es"),require("dayjs/locale/pt-br");var f=e(require("lodash/defaultsDeep")),p=require("timeago.js"),m=require("liquidjs"),h=e(require("lodash/get")),x=e(require("@tippyjs/react/headless")),C=e(require("react-use/lib/useInterval")),g=e(require("dayjs/plugin/localizedFormat")),v=e(require("dayjs/plugin/relativeTime")),b=e(require("dayjs/plugin/updateLocale")),y=e(require("axios")),k=require("react-use"),w=e(require("resize-observer-polyfill")),E=e(require("react-infinite-scroll-component"));function j(e,n,t,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void t(e)}c.done?n(l):Promise.resolve(l).then(r,o)}function M(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){j(i,r,o,a,c,"next",e)}function c(e){j(i,r,o,a,c,"throw",e)}a(void 0)}))}}function O(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}function H(e,n){return n||(n=e.slice(0)),e.raw=n,e}var L,N,S="#3498F4",A='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',R={icon:{borderColor:S,width:"24px"},header:{backgroundColor:S,backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"white",textTransform:"none"},footer:{backgroundColor:S,backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"white",textTransform:"none"},unseenBadge:{backgroundColor:"#DF4759",backgroundOpacity:1,borderRadius:"2px",fontFamily:A,fontSize:"10px",textAlign:"center",textColor:"white",textTransform:"none"},container:{backgroundColor:"#FFFFFF",backgroundOpacity:1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},notification:{default:{backgroundColor:S,backgroundOpacity:.1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},unread:{backgroundColor:S,backgroundOpacity:.1,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"},unseen:{backgroundColor:S,backgroundOpacity:.05,borderRadius:"8px",fontFamily:A,fontSize:"14px",textAlign:"left",textColor:"#3A424D",textTransform:"none"}}},V=t.createContext(R),I=V.Provider,Z=function(){return t.useContext(V)},F=i.css(L||(L=H(["\n backface-visibility: visible;\n background-clip: border-box;\n background-color: transparent;\n background-origin: padding-box;\n background-position: 0 0;\n background-size: auto;\n border-radius: 0;\n border: 0;\n box-shadow: none;\n box-sizing: content-box;\n clear: none;\n clip: auto;\n color: inherit;\n cursor: auto;\n direction: inherit;\n display: block;\n left: auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue',\n sans-serif;\n font-size: 14px;\n font-weight: normal;\n height: auto;\n hyphens: manual;\n letter-spacing: normal;\n line-height: 1;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n outline: invert none medium;\n padding: 0;\n perspective: none;\n position: static;\n right: auto;\n top: auto;\n transform: none;\n text-align: left;\n text-decoration: none;\n vertical-align: baseline;\n visibility: inherit;\n white-space: normal;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n\n div,\n span,\n p,\n a,\n strong,\n b,\n u,\n i,\n ol,\n ul,\n li,\n form,\n label,\n table,\n tr,\n th,\n td,\n article,\n aside,\n footer,\n header,\n nav,\n section {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n }\n\n a {\n cursor: pointer !important;\n color: inherit !important;\n }\n\n button {\n background: transparent;\n border: none;\n font-size: inherit !important;\n color: inherit;\n padding: 0;\n cursor: pointer !important;\n }\n"])));function T(e,n){var t=c(e);return t.setAlpha(n),t.toRgbString()}function z(e,n){return c.mix(e,"black",n||50).toRgbString()}function P(e){var n=e.count,t=Z().unseenBadge,r=i.css(N||(N=H(["\n align-items: center;\n background: "," !important;\n border-radius: "," !important;\n color: "," !important;\n display: flex;\n font-family: "," !important;\n font-size: "," !important;\n height: 18px !important;\n min-width: 10px !important;\n padding: 0 2px !important;\n text-align: "," !important;\n text-transform: "," !important;\n\n div {\n width: 100%;\n }\n "])),T(t.backgroundColor,t.backgroundOpacity),t.borderRadius,t.textColor,t.fontFamily,t.fontSize,t.textAlign,t.textTransform);return i.jsx("span",{css:[F,r]},i.jsx("div",null,n))}var _,q=a.observer(P);function B(e){var n=e.counter,t=Z().icon;return 0===n?null:i.jsx("div",{css:i.css(_||(_=H(["\n position: absolute !important;\n transform: translate(-50%, -50%) scale(",");\n top: 10%;\n left: 80%;\n "])),Math.max(1,parseInt(t.width)/24))},i.jsx(q,{count:n}))}var U=a.observer(B);function D(){var e=Z();return r.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:e.icon.borderColor},r.createElement("path",{d:"M15.9997 4.70663C14.3971 4.71182 12.8617 5.34576 11.7284 6.47013C10.5951 7.59449 9.95592 9.11801 9.95038 10.7082V15.0907C9.95038 16.4805 9.85234 17.3932 9.62941 18.1738C9.39598 18.9845 9.04584 19.5809 8.55447 20.3349C8.38874 20.5862 8.23117 20.8144 8.08761 21.0217C7.66277 21.6158 8.58949 21.7583 9.06218 21.8324C10.8129 22.115 13.2639 22.2957 16.0102 22.2957C18.7565 22.2957 21.2052 22.1196 22.9582 21.8324C24.1791 21.6344 24.0822 21.3031 23.5897 20.5584C23.0819 19.7929 22.7038 19.1791 22.44 18.3718C22.1762 17.5646 22.0467 16.6496 22.0467 15.3119V10.7082C22.0442 9.11807 21.4069 7.59366 20.2742 6.4688C19.1414 5.34394 17.6057 4.71031 16.0032 4.70663H15.9997ZM16.0032 2C18.3263 2.01068 20.551 2.93195 22.1926 4.56308C23.8342 6.19422 24.7596 8.40302 24.7673 10.7082V15.3166C24.7673 16.3589 24.8502 17.0214 25.0217 17.5414C25.1933 18.0614 25.4711 18.5085 25.8528 19.0829C26.1294 19.501 26.4048 19.8647 26.6289 20.1623C27.1588 20.8642 27.5136 21.3344 27.4996 21.976V22.0061C27.4996 23.2234 25.9263 24.0908 23.3854 24.4985C21.4713 24.8089 18.858 25 16.0009 25C13.1437 25 10.5304 24.8089 8.61516 24.4985C6.07428 24.0874 4.50214 23.2245 4.50214 22.0061V21.9957C4.46829 21.3286 4.83944 20.8306 5.40434 20.0766C5.64944 19.7489 5.95057 19.3447 6.26686 18.8629C6.61701 18.3267 6.86094 17.9201 7.001 17.4325C7.15039 16.9091 7.21575 16.2153 7.21575 15.0884V10.7082C7.22192 8.40035 8.14864 6.18875 9.79334 4.55693C11.438 2.92511 13.6669 2.00581 15.9927 2H16.0032Z"}),r.createElement("path",{d:"M20.4988 26C20.4489 27.0446 19.9795 28.0338 19.1834 28.7721C18.7655 29.1614 18.2692 29.4702 17.7228 29.6809C17.1765 29.8916 16.5909 30 15.9994 30C15.408 30 14.8223 29.8916 14.276 29.6809C13.7296 29.4702 13.2333 29.1614 12.8154 28.7721C12.0193 28.0338 11.5499 27.0446 11.5 26C12.3651 26.0703 13.3047 26.1198 14.2916 26.1473C14.3561 26.4337 14.5025 26.6985 14.7154 26.9139C14.9283 27.1293 15.1998 27.2872 15.5013 27.371C15.8027 27.4548 16.1228 27.4613 16.4279 27.3898C16.733 27.3184 17.0116 27.1716 17.2345 26.9651C17.4739 26.7413 17.6382 26.4575 17.7072 26.1484C18.6941 26.1209 19.6337 26.0714 20.5 26.0011"}))}var G,K,W=a.observer(D),Y=t.createContext(null),J=Y.Provider,Q=function(){return t.useContext(Y)},X=t.createContext({}),$=function(){return t.useContext(X)};function ee(e){var n=void 0===e?{}:e,t=n.counter,r=void 0===t?"unseen":t,o=ne(n.storeId),i=0;return o&&(i="unread"===r?o.unreadCount:o.unseenCount),{store:o,badgeCounter:i,markAllAsSeen:function(){return o&&o.unseenCount>0?o.markAllAsSeen({updateItems:!1}):Promise.resolve()}}}function ne(e){void 0===e&&(e="default");var n=Q(),r="fulfilled"===(null==n?void 0:n.xhrFetchState),o=$().rootStore.get(e),i="initial"===(null==o?void 0:o.xhrFetchState);return t.useEffect((function(){i&&r&&(null==o||o.fetch({page:1}))}),[e,i,r]),o}function te(e){var n=e.Icon,t=void 0===n?i.jsx(W,null):n,r=e.onClick,o=ee({storeId:e.storeId,counter:e.counter}),a=o.badgeCounter,c=o.markAllAsSeen,l=Z().icon,s=i.css(G||(G=H(["\n display: block;\n cursor: pointer;\n position: relative !important;\n width: "," !important;\n "])),l.width),u=i.css(K||(K=H(["\n position: relative !important;\n\n & > * {\n height: 100%;\n width: 100%;\n }\n "])));return i.jsx("a",{onClick:function(){c(),r()},css:[F,s],"data-testid":"bell"},i.jsx("div",{css:u},t),i.jsx(U,{counter:a}))}var re=a.observer(te);function oe(e,n){t.useEffect((function(){return l.pushEventAggregator.on(e,n),function(){l.pushEventAggregator.off(e,n)}}),[])}function ie(e){var n=e.onNewNotification;return oe("notifications.new",(function(e){n&&n(e)})),null}var ae=t.createContext({}),ce=ae.Provider,le={header:{title:"NOTIFICACIONES","mark-all-read":"Marcar todo como leído"},notification:{"mark-as-read":"Marcar como leído","mark-as-unread":"Marcar como no leído",delete:"Eliminar"},messages:{"empty-inbox":"¡No tiene notificaciones!<br>Le haremos saber cuando llegue una."}},se={header:{title:"NOTIFICAÇÕES","mark-all-read":"Marcar tudo como lido"},notification:{"mark-as-read":"Marcar como lido","mark-as-unread":"Marcar como não lido",delete:"Apagar"},messages:{"empty-inbox":"Nenhuma notificação disponível!","server-error":"Não conseguimos recuperar suas notificações.<br>Por favor, volte em breve.","no-internet-connection":"Não conseguimos nos conectar à Internet.<br>Por favor, verifique sua conexão."}};function ue(e){var n=e.config,r=e.authServerUrl,o=$().rootStore.stores,i=function(){return o.forEach((function(e){return e.fetch({page:1})}))};return function(e,n){t.useEffect((function(){var t=l.connectToAbly(e,n),r=function(){return l.pushEventAggregator.emit("wakeup")};t.connection.on("disconnected",r),t.connection.on("suspended",r);var o=t.channels.get(e.ws.channel);return o.subscribe(l.handleAblyEvent),function(){t.connection.off("disconnected"),t.connection.off("suspended"),o.unsubscribe(l.handleAblyEvent),o.detach(),t.close()}}),[e.ws.channel])}(n,r),oe("wakeup",i),oe("notifications.new",(function(){return o.forEach((function(e){return e.fetch({page:1},{reset:!1})}))})),oe("notifications.seen.all",(function(){return o.forEach((function(e){return e.markAllAsSeen({localOnly:!0})}))})),oe("notifications.read.all",(function(){return o.forEach((function(e){return e.markAllAsRead({localOnly:!0})}))})),oe("notifications.read",i),oe("notifications.delete",(function(e){return o.forEach((function(n){var t=n.get(e.id);t&&n.remove(t)}))})),null}var de=a.observer(ue);function fe(e){var n=e.apiKey,o=e.userEmail,i=e.userExternalId,c=e.userKey,p=e._baseURL,m=e.children,h=e.theme,x=e.stores,C=e.images,g=e.locale,v=void 0===g?"en":g,b=t.useMemo((function(){return l.setupAjax({apiKey:n,userEmail:o,userExternalId:i,userKey:c,baseURL:p}),new l.Config({apiKey:n,userEmail:o,userExternalId:i,userKey:c})}),[n,o,i,c,p]),y=t.useMemo((function(){return new l.NotificationStoresMap(x||[{id:"default",context:{}}])}),[x]),k=function(e){var n="string"==typeof e?e:e.name;!function(e){var n=e.toLowerCase().replace("_","-");d.locale(n)}(n);var t={es:le,pt_BR:se};if("string"==typeof e)return t[e];var r,o={};return f(o,((r={})[n]=e.translations,r),t),o[n]}(v);return t.useEffect((function(){b.fetch()}),[n,o,i,c,p]),u((function(){return function(){y.dispose()}})),r.createElement(ce,{value:k},r.createElement(I,{value:s({},R,h)},r.createElement(J,{value:b},r.createElement(X.Provider,{value:{rootStore:y,images:C}},r.createElement(a.Observer,null,(function(){return"fulfilled"===b.xhrFetchState?r.createElement(de,{config:b,authServerUrl:p}):null})),m))))}var pe,me,he=(function(e){var n=function(e){var n=Object.prototype,t=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{c({},"")}catch(e){c=function(e,n,t){return e[n]=t}}function l(e,n,t,r){var o=Object.create((n&&n.prototype instanceof d?n:d).prototype),i=new w(r||[]);return o._invoke=function(e,n,t){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(t.method=o,t.arg=i;;){var a=t.delegate;if(a){var c=b(a,t);if(c){if(c===u)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===r)throw r="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r="executing";var l=s(e,n,t);if("normal"===l.type){if(r=t.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:t.done}}"throw"===l.type&&(r="completed",t.method="throw",t.arg=l.arg)}}}(e,t,i),o}function s(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function p(){}var m={};m[o]=function(){return this};var h=Object.getPrototypeOf,x=h&&h(h(E([])));x&&x!==n&&t.call(x,o)&&(m=x);var C=p.prototype=d.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(n){c(e,n,(function(e){return this._invoke(n,e)}))}))}function v(e,n){var r;this._invoke=function(o,i){function a(){return new n((function(r,a){!function r(o,i,a,c){var l=s(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&t.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):n.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(l.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function b(e,n){var t=e.iterator[n.method];if(void 0===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=void 0,b(e,n),"throw"===n.method))return u;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(t,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,u;var o=r.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,u):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,u)}function y(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function k(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}function E(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(t.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=void 0,n.done=!0,n};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return f.prototype=C.constructor=p,p.constructor=f,f.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===f||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(C),e},e.awrap=function(e){return{__await:e}},g(v.prototype),v.prototype[i]=function(){return this},e.AsyncIterator=v,e.async=function(n,t,r,o,i){void 0===i&&(i=Promise);var a=new v(l(n,t,r,o),i);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(C),c(C,a,"Generator"),C[o]=function(){return this},C.toString=function(){return"[object Generator]"},e.keys=function(e){var n=[];for(var t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&t.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t,r){return a.type="throw",a.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=t.call(i,"catchLoc"),l=t.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=n,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),u},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),k(t),u}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;k(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:E(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}}(me={exports:{}}),me.exports);function xe(e,n){return Ce.apply(this,arguments)}function Ce(){return(Ce=M(he.mark((function e(n,t){var r;return he.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new m.Liquid,e.next=3,r.parseAndRender(n,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(e){var n=e.notification,r=n.sanitizedContent,o=t.useState(""),a=o[0],c=o[1];return t.useEffect((function(){!function(){var e=M(he.mark((function e(){return he.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=5;break}return e.next=3,xe(r,n);case 3:c(e.sent);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}),[r]),t.useEffect((function(){var e=document.querySelectorAll("time[datetime]");return e.length>0&&p.render(e),function(){p.cancel()}}),[a]),""===a.replace(/(\n|\s|\r)/gi,"")?null:i.jsx("article",{css:i.css(pe||(pe=H(["\n color: inherit !important;\n cursor: inherit;\n margin: 0;\n line-height: 1.2;\n font-size: 0.865em !important;\n margin-top: 1em !important;\n word-break: break-word !important;\n "]))),dangerouslySetInnerHTML:{__html:a}})}var ve,be=a.observer(ge);function ye(e){var n=e.id,o=e.defaultMessage,i=e.html,a=void 0!==i&&i,c=t.useContext(ae),l=h(c,n,o);return a?r.createElement("span",{dangerouslySetInnerHTML:{__html:l}}):r.createElement(r.Fragment,null,l)}function ke(e){var n=e.notification,t=Z(),r=t.container,o=t.notification;return i.jsx("div",{css:i.css(ve||(ve=H(["\n background: "," !important;\n border-radius: "," !important;\n box-shadow: 2px 2px 3px ",";\n color: "," !important;\n font-family: "," !important;\n font-size: "," !important;\n text-transform: "," !important;\n min-width: 10em;\n\n a {\n display: block;\n padding: 0.75em 1.25em !important;\n\n &:hover {\n text-decoration: underline !important;\n }\n }\n "])),r.backgroundColor,o.default.borderRadius,z(T(r.backgroundColor,.5),10),o.default.textColor,o.default.fontFamily,o.default.fontSize,o.default.textTransform)},i.jsx("a",{onClick:function(){return n.isRead?n.markAsUnread():n.markAsRead()},"data-testid":"toggle-read"},i.jsx(ye,n.isRead?{id:"notification.mark-as-unread",defaultMessage:"Mark as unread"}:{id:"notification.mark-as-read",defaultMessage:"Mark as read"})),i.jsx("a",{onClick:function(){return n.delete()},"data-testid":"delete"},i.jsx(ye,{id:"notification.delete",defaultMessage:"Delete"})))}var we,Ee=a.observer(ke);function je(e){var n=e.closeOnClick,t=e.offset,o=void 0===t?{skidding:0,distance:10}:t,i=e.onClickOutside,a=e.placement,c=e.zIndex;return r.createElement(x,{render:e.children,offset:[o.skidding,o.distance],onClickOutside:function(){null==i||i()},placement:void 0===a?"bottom-end":a,popperOptions:e.popperOptions,reference:e.launcherRef,visible:e.isOpen,zIndex:void 0===c?9999:c,interactive:!(void 0!==n&&n)},e.launcher)}function Me(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("circle",{cx:"256",cy:"256",r:"64"}))}function Oe(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("circle",{cx:"256",cy:"64",r:"64"}),r.createElement("circle",{cx:"256",cy:"256",r:"64"}),r.createElement("circle",{cx:"256",cy:"448",r:"64"}))}function He(e){var n=e.notification,r=e.menuPlacement,o=void 0===r?"bottom-end":r,a=Z(),c=a.header,l=a.notification,s=t.useState(!1),u=s[0],d=s[1],f=i.jsx("div",{css:i.css(we||(we=H(["\n display: flex !important;\n align-items: center !important;\n padding: 0.5em 0 0.5em 0.25em !important;\n color: "," !important;\n\n svg {\n height: 1.5em;\n fill: currentColor;\n }\n "])),n.isRead?T(l.default.textColor,.5):c.backgroundColor),onMouseOver:function(){return d(!0)},onMouseLeave:function(){return d(!1)},"data-testid":"icon"},i.jsx(n.isRead||u?Oe:Me,null));return i.jsx(je,{launcher:f,offset:{skidding:-4,distance:2},placement:o,zIndex:0},(function(){return i.jsx(Ee,{notification:n})}))}var Le,Ne=a.observer(He);function Se(e){var n=e.date,t=Z(),r=t.container,o=t.notification;return i.jsx("span",{css:i.css(Le||(Le=H(["\n background: "," !important;\n border-radius: "," !important;\n box-shadow: 2px 2px 3px ",";\n color: "," !important;\n font-size: 0.8em !important;\n padding: 0.5em !important;\n text-transform: ",";\n "])),r.backgroundColor,o.default.borderRadius,z(T(r.backgroundColor,.5),10),o.default.textColor,o.default.textTransform)},n.format("LL LT"))}function Ae(e){var n=e.date,o=e.tooltipPlacement,i=void 0===o?"bottom-end":o,a=t.useMemo((function(){return function(e){return d(e)}(n)}),[n]),c=t.useState(a.fromNow(!0)),l=c[0],s=c[1];return C((function(){return s(a.fromNow(!0))}),6e4),r.createElement(je,{launcher:r.createElement("div",null,l),placement:i},(function(){return r.createElement(Se,{date:a})}))}d.extend(g),d.extend(v),d.extend(b),d.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%ds",m:"1m",mm:"%dm",h:"1h",hh:"%dh",d:"1d",dd:"%dd",M:"1mo",MM:"%dmo",y:"1y",yy:"%dy"}});var Re,Ve=a.observer(Ae);function Ie(e,n){void 0===n&&(n={}),function(e,n){u((function(){return function(){n?n(e):e.isSeen=!0}}))}(e,n.onUnmount)}function Ze(e){var n=e.notification.title;return i.jsx("p",{title:n,css:i.css(Re||(Re=H(["\n cursor: inherit;\n font-weight: 500 !important;\n line-height: 1.2 !important;\n word-break: break-word !important;\n "])))},n)}var Fe,Te=a.observer(Ze);function ze(e){var n=e.notification,t=e.children,r=Z().notification,o=r.default;n.isSeen?n.isRead||(o=r.unread):o=r.unseen;var a=i.css(Fe||(Fe=H(["\n background-color: "," !important;\n border-radius: ",";\n color: "," !important;\n cursor: pointer;\n display: flex;\n align-items: center;\n font-family: "," !important;\n font-size: ",";\n margin: 4px !important;\n overflow: hidden;\n text-align: "," !important;\n text-transform: ",";\n transition: background-color 300ms ease-out;\n padding: 16px 20px !important;\n min-height: 32px;\n\n &:hover {\n background-color: "," !important;\n }\n\n & > button {\n flex: 1;\n display: inline-flex;\n align-items: center;\n margin: 0 0 0 -16px;\n text-align: inherit !important;\n\n & > div {\n margin: 0 0 0 16px;\n }\n\n & > div:first-of-type {\n flex: 1;\n }\n }\n "])),n.isSeen?"transparent":T(o.backgroundColor,o.backgroundOpacity),o.borderRadius,o.textColor,o.fontFamily,o.fontSize,o.textAlign,o.textTransform,z(T(o.backgroundColor,o.backgroundOpacity),5));return i.jsx("div",{css:[F,a]},t)}var Pe,_e=a.observer(ze);function qe(e){var n=e.notification,t=e.onClick;return Ie(n),i.jsx(_e,{notification:n},i.jsx("button",{onClick:function(){n.markAsRead(),t?t(n):n.actionUrl&&window.open(n.actionUrl,"_self")},"data-testid":"clickable-notification"},i.jsx("div",null,i.jsx(Te,{notification:n}),i.jsx(be,{notification:n})),i.jsx("div",{css:i.css(Pe||(Pe=H(["\n padding: 0.5em 0 0.5em 0.25em !important;\n "])))},n.sentAtDate?i.jsx(Ve,{date:n.sentAtDate}):null)),i.jsx(Ne,{notification:n}))}var Be,Ue,De=a.observer(qe);function Ge(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))}function Ke(e){var n=e.onClick;return i.jsx("button",{onClick:function(){n()},css:i.css(Be||(Be=H(["\n display: flex;\n align-items: center;\n\n svg {\n height: 24px;\n }\n "])))},i.jsx(Ge,null))}function We(e){var n=e.onClick,t=Z();return i.jsx("button",{css:i.css(Ue||(Ue=H(["\n padding: 10px !important;\n border-radius: 4px !important;\n background: "," !important;\n color: "," !important;\n "])),t.footer.backgroundColor,t.footer.textColor),onClick:function(){n()}},"Enable Now")}var Ye,Je=a.observer(We);function Qe(){var e=Q(),n=Z(),t=n.footer,r=n.notification,o=k.useLocalStorage("magicbell:web-push-requested-at",null),a=o[1];return o[0]?null:i.jsx("div",{css:i.css(Ye||(Ye=H(["\n padding: 14px 24px !important;\n display: flex;\n text-align: left;\n align-items: center;\n background: ",";\n\n color: "," !important;\n font-family: "," !important;\n text-align: "," !important;\n font-size: "," !important;\n\n & > * {\n margin-left: 1rem;\n }\n "])),T(r.unseen.backgroundColor,.1),r.unseen.textColor,t.fontFamily,t.textAlign,t.fontSize)},i.jsx("p",{style:{flex:1}},"By enabling browser notifications, you’ll stay up to date even better."),i.jsx(Je,{onClick:function(){var t=h(e,"webPushNotifications.subscribeUrl"),r=y.getUri({url:t,params:{user_email:null==e?void 0:e.userEmail,user_external_id:null==e?void 0:e.userExternalId,background_color:n.header.backgroundColor,text_color:n.header.textColor}});a(Date.now()),function(e){var n=(screen.height-400)/4,t=(screen.width-600)/2;window.open(e,"","width=600,height=400,scrollbars=no,top="+n+",left="+t)}(r)}}),i.jsx(Ke,{onClick:function(){a(Date.now())}}))}var Xe=a.observer(Qe);function $e(){return r.createElement("svg",{width:"64",height:"16",viewBox:"0 0 128 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M13.2378 4.66791C11.6702 4.67293 10.1682 5.29789 9.05974 6.40637C7.95126 7.51485 7.3263 9.01682 7.32128 10.5844V14.904C7.32128 16.2701 7.22608 17.1721 7.00713 17.9432C6.77392 18.7047 6.41866 19.4233 5.95519 20.0709C5.79336 20.3089 5.63866 20.5469 5.49587 20.7492C5.08176 21.3346 5.98613 21.475 6.44784 21.5488C8.69788 21.8729 10.9694 22.024 13.2426 22.001C15.5165 22.0241 17.7889 21.8729 20.0397 21.5488C21.2297 21.3537 21.1392 21.0276 20.6561 20.297C20.1816 19.6349 19.8034 18.909 19.5328 18.1408C19.2418 17.1631 19.1116 16.1447 19.1472 15.1254V10.5844C19.1453 9.01709 18.5223 7.51438 17.4147 6.40542C16.3071 5.29647 14.8052 4.67169 13.2378 4.66791ZM13.2378 2C15.5097 2.01067 17.6853 2.91905 19.2902 4.52711C20.8952 6.13517 21.7993 8.31251 21.8056 10.5844V15.1254C21.7707 15.8647 21.851 16.605 22.0436 17.3197C22.2453 17.8601 22.5191 18.3709 22.8575 18.8381C23.1288 19.2498 23.3978 19.6092 23.6167 19.9019C24.1356 20.5921 24.483 21.0562 24.4688 21.6892V21.713C24.4688 22.903 22.9289 23.7622 20.4443 24.1691C18.0527 24.5177 15.6379 24.6824 13.2212 24.6618C10.8141 24.6833 8.40892 24.521 6.02659 24.1763C3.54193 23.7693 2.00211 22.9197 2.00211 21.7202C1.96879 21.0633 2.33292 20.573 2.88507 19.8281C3.12306 19.5068 3.41818 19.1141 3.72757 18.6382C4.03691 18.2073 4.27775 17.7313 4.44155 17.2269C4.58673 16.7128 4.65099 16.0369 4.65099 14.9183V10.5844C4.65664 8.30944 5.56289 6.12924 7.17156 4.52057C8.78023 2.9119 10.9604 2.00566 13.2354 2H13.2378Z"}),r.createElement("path",{d:"M10.8769 9.68955C10.8668 10.1473 10.9882 10.5983 11.2268 10.989C11.4417 11.326 11.7457 11.5969 12.105 11.772C12.4608 11.9412 12.8498 12.029 13.2438 12.029C13.6378 12.029 14.0268 11.9412 14.3826 11.772C14.7419 11.5969 15.0458 11.326 15.2608 10.989C15.49 10.5934 15.6107 10.1444 15.6107 9.68717C15.6107 9.22999 15.49 8.78091 15.2608 8.38534C15.0442 8.05094 14.7406 7.78189 14.3826 7.6071C14.0275 7.43555 13.6382 7.34644 13.2438 7.34644C12.8494 7.34644 12.4601 7.43555 12.105 7.6071C11.747 7.78189 11.4433 8.05094 11.2268 8.38534C10.9886 8.77798 10.8672 9.2304 10.8769 9.68955Z"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.6468 9.68483L23.0836 8.3711L20.5204 7.05737V9.68483V12.3147L23.0836 11.0009L25.6468 9.68483Z"}),r.createElement("path",{d:"M17.5907 25.8422C17.5423 26.9273 17.0888 27.9548 16.3198 28.722C15.9164 29.1264 15.4371 29.4472 14.9095 29.6661C14.3818 29.8851 13.8162 29.9977 13.2449 29.9977C12.6737 29.9977 12.1081 29.8851 11.5804 29.6661C11.0528 29.4472 10.5735 29.1264 10.1701 28.722C9.40107 27.9548 8.94761 26.9273 8.89917 25.8422C9.73453 25.916 10.6437 25.9684 11.5956 25.9969C11.6721 26.3773 11.879 26.7191 12.1805 26.9633C12.482 27.2075 12.8593 27.3387 13.2473 27.3344C13.4683 27.3346 13.6872 27.2912 13.8914 27.2067C14.0956 27.1221 14.2811 26.9981 14.4373 26.8418C14.669 26.61 14.8278 26.3155 14.8942 25.9945C15.8462 25.966 16.7554 25.9136 17.5907 25.8398"}),r.createElement("path",{d:"M44.688 7.22H41.806L36.834 18.418H36.68L31.686 7.22H28.782V22.62H31.048V11.356H31.224L35.536 20.86H37.978L42.268 11.356H42.422V22.62H44.688V7.22Z"}),r.createElement("path",{d:"M57.2448 20.926C56.6948 20.926 56.4088 20.64 56.4088 20.024V15.514C56.4088 12.764 54.5168 11.4 52.0088 11.4C49.3688 11.4 47.7408 12.984 47.5428 15.162H49.7648C49.9628 14.018 50.6228 13.226 52.0088 13.226C53.3728 13.226 54.1648 14.018 54.1648 15.426V15.976L50.7988 16.306C48.6868 16.504 47.1028 17.582 47.1028 19.672C47.1028 21.828 48.7088 22.84 50.8428 22.84C52.4928 22.84 53.7028 22.202 54.4508 21.256C54.7588 22.29 55.4848 22.62 56.5188 22.62H57.5308V20.926H57.2448ZM54.1648 18.396C54.1648 20.376 52.5368 21.08 51.1728 21.08C50.1828 21.08 49.3468 20.684 49.3468 19.584C49.3468 18.528 50.2488 17.956 51.5468 17.846L54.1648 17.582V18.396Z"}),r.createElement("path",{d:"M69.3697 11.774L68.1817 10.498C67.7417 11.07 67.0377 11.686 66.3557 12.038C65.6517 11.62 64.7937 11.4 63.8257 11.4C61.2077 11.4 59.5357 13.028 59.5357 15.184C59.5357 16.306 59.9757 17.23 60.7237 17.868C59.9537 18.286 59.2937 18.968 59.2937 19.958C59.2937 20.904 59.8217 21.63 60.6577 21.982L58.8977 23.5C59.0957 25.524 60.6577 27.24 64.0017 27.24C66.9277 27.24 68.9297 25.92 68.9297 23.588C68.9297 21.652 67.5437 20.442 65.0357 20.442H62.8577C61.9557 20.442 61.3177 20.134 61.3177 19.496C61.3177 19.1 61.5377 18.814 61.9557 18.594C62.5277 18.814 63.1877 18.924 63.9137 18.924C66.3557 18.924 68.2477 17.516 68.2477 15.184C68.2477 14.392 68.0057 13.666 67.5437 13.072C68.3137 12.698 69.0177 12.192 69.3697 11.774ZM63.9137 17.23C62.5497 17.23 61.6697 16.35 61.6697 15.184C61.6697 13.93 62.5497 13.072 63.9137 13.072C65.2557 13.072 66.0917 13.93 66.0917 15.184C66.0917 16.35 65.2557 17.23 63.9137 17.23ZM66.7737 23.698C66.7737 24.952 65.4757 25.524 64.0017 25.524C62.1537 25.524 61.3397 24.6 61.0757 23.654L62.7697 22.224H64.7717C65.6737 22.224 66.7737 22.554 66.7737 23.698Z"}),r.createElement("path",{d:"M72.1185 9.992C72.8885 9.992 73.5265 9.332 73.5265 8.562C73.5265 7.77 72.8885 7.154 72.1185 7.154C71.3265 7.154 70.6665 7.77 70.6665 8.562C70.6665 9.332 71.3265 9.992 72.1185 9.992ZM70.9965 22.62H73.2405V11.62H70.9965V22.62Z"}),r.createElement("path",{d:"M81.0823 22.84C83.8103 22.84 85.8123 21.322 86.2083 18.946H83.9643C83.5463 20.134 82.6003 20.882 81.0823 20.882C79.0143 20.882 77.7383 19.298 77.7383 17.186C77.7383 14.986 79.1243 13.358 81.0603 13.358C82.6003 13.358 83.6563 14.304 83.9203 15.448H86.1643C85.7903 12.786 83.5463 11.4 81.0603 11.4C77.8703 11.4 75.5163 13.798 75.5163 17.186C75.5163 20.42 77.6943 22.84 81.0823 22.84Z"}),r.createElement("path",{d:"M96.7512 14.546V14.436C97.8732 13.908 98.9072 12.984 98.9072 11.048C98.9072 8.782 97.4772 7.22 94.5072 7.22H88.6332V22.62H94.5292C97.5212 22.62 99.3252 21.08 99.3252 18.396C99.3252 16.064 97.9392 14.986 96.7512 14.546ZM90.8992 9.112H94.2652C95.6732 9.112 96.5972 9.948 96.5972 11.378C96.5972 12.808 95.7612 13.754 94.1992 13.754H90.8992V9.112ZM94.3312 20.728H90.8992V15.646H94.3312C95.9592 15.646 96.9712 16.746 96.9712 18.242C96.9712 19.716 96.0032 20.728 94.3312 20.728Z"}),r.createElement("path",{d:"M111.65 16.966C111.65 13.182 109.296 11.4 106.612 11.4C103.62 11.4 101.266 13.644 101.266 17.23C101.266 20.618 103.532 22.84 106.7 22.84C109.296 22.84 111.144 21.52 111.606 19.32H109.45C109.098 20.442 108.086 21.014 106.7 21.014C104.764 21.014 103.576 19.65 103.466 17.692H111.606C111.628 17.406 111.65 17.186 111.65 16.966ZM106.612 13.226C108.306 13.226 109.45 14.414 109.472 16.108H103.488C103.708 14.502 104.874 13.226 106.612 13.226Z"}),r.createElement("path",{d:"M113.966 22.62H116.21V7H113.966V22.62Z"}),r.createElement("path",{d:"M118.838 22.62H121.082V7H118.838V22.62Z"}))}function en(){var e=Q();return h(null==e?void 0:e.inbox,"features.noMagicbellBranding.enabled",!1)?r.createElement("p",{style:{height:"16px"}}):r.createElement("a",{href:"https://magicbell.io/?utm_source=widget",target:"_blank",rel:"noopener noreferrer"},r.createElement($e,null))}var nn,tn,rn,on,an=a.observer(en);function cn(e){var n=e.children,t=Z().footer,r=i.css(nn||(nn=H(["\n background: ",";\n color: "," !important;\n font-family: "," !important;\n text-align: "," !important;\n font-size: "," !important;\n padding: 14px 24px !important;\n flex-shrink: 0 !important;\n\n &:first-of-type {\n border-radius: "," "," 0 0 !important;\n }\n\n &:last-of-type {\n border-radius: 0 0 "," ","!important;\n }\n\n span {\n color: "," !important;\n\n a {\n color: ",";\n margin-right: 16px !important;\n opacity: 0.75;\n display: block;\n }\n }\n "])),T(t.backgroundColor,t.backgroundOpacity),T(t.textColor,.75),t.fontFamily,t.textAlign,t.fontSize,t.borderRadius,t.borderRadius,t.borderRadius,t.borderRadius,t.textColor,t.textColor);return i.jsx("div",{css:[F,r]},n)}function ln(e){var n=e.children,t=Z().header,r=i.css(tn||(tn=H(["\n align-items: center;\n background: "," !important;\n color: ",";\n display: flex;\n font-family: "," !important;\n font-size: "," !important;\n justify-content: space-between;\n text-align: "," !important;\n text-transform: "," !important;\n padding: 16px 24px !important;\n flex-shrink: 0 !important;\n\n &:first-of-type {\n border-radius: "," "," 0 0 !important;\n }\n\n &:last-of-type {\n border-radius: 0 0 "," ","!important;\n }\n "])),T(t.backgroundColor,t.backgroundOpacity),t.textColor,t.fontFamily,t.fontSize,t.textAlign,t.textTransform,t.borderRadius,t.borderRadius,t.borderRadius,t.borderRadius);return i.jsx("div",{css:[F,r]},n)}function sn(e){var n=e.onClose;return i.jsx("div",{css:i.css(rn||(rn=H(["\n position: absolute;\n bottom: 0;\n top: 0;\n background: white;\n right: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n\n .uppercase {\n text-transform: uppercase;\n }\n\n button.close svg {\n height: 18px;\n }\n\n .content {\n flex: 1;\n margin: 4px;\n padding: 16px 20px !important;\n }\n "])))},i.jsx(ln,null,i.jsx("p",{className:"uppercase"},"Preferences"),i.jsx("button",{onClick:function(){n()},className:"close"},i.jsx(Ge,null))),i.jsx("div",{className:"content"},"Comming soon"),i.jsx(cn,null,i.jsx(an,null)))}function un(){var e=Z().footer,n=o(!1),t=n[0],r=n[1],a=i.css(on||(on=H(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: "," !important;\n\n a,\n button {\n color: ",";\n display: block;\n }\n\n a {\n opacity: 0.85;\n }\n "])),e.textColor,e.textColor);return t?i.jsx(sn,{onClose:r}):i.jsx(cn,null,i.jsx("div",{css:a},i.jsx(an,null),i.jsx("button",{onClick:r})))}var dn,fn,pn=a.observer(un);function mn(){return i.jsx("p",{css:i.css(dn||(dn=H(["\n margin-right: 16px !important;\n "])))},i.jsx(ye,{id:"header.title",defaultMessage:"NOTIFICATIONS"}))}function hn(e){var n=e.onAllRead;return r.createElement(ln,null,r.createElement(mn,null),r.createElement("button",{onClick:function(){return n()},"data-testid":"mark-all-as-read"},r.createElement(ye,{id:"header.mark-all-read",defaultMessage:"Mark All Read"})))}function xn(e){var n=e.children;return r.createElement(r.Fragment,null,e.order.map((function(e){return n.find((function(n){return n.key===e}))})))}function Cn(){return i.jsx("div",{css:i.css(fn||(fn=H(["\n color: inherit !important;\n font-size: 0.85em !important;\n padding: 0.5em !important;\n text-align: center !important;\n "])))},"Loading...")}function gn(e){var n=e.notifications,t=e.onItemClick,o=e.height,i=e.queryParams,a=e.scrollableTarget,c=e.ListItem,l=void 0===c?De:c;return r.createElement(E,{dataLength:n.length,hasMore:n.hasNextPage,next:function(){return n.fetchNextPage(i)},loader:r.createElement(Cn,null),height:o,scrollableTarget:a},n.map((function(e){return r.createElement(l,{key:e.id,notification:e,onClick:t})})))}var vn,bn,yn=a.observer(gn);function kn(){var e=Z(),n=$().images,t=e.notification;return i.jsx("div",{css:i.css(vn||(vn=H(["\n padding: 3em !important;\n text-align: center;\n color: ",";\n\n img {\n margin: 2em auto;\n height: 200px;\n }\n "])),t.default.textColor)},i.jsx("p",null,i.jsx(ye,{id:"messages.empty-inbox",defaultMessage:"All clear!<br>We'll let you know when there's more.",html:!0})),i.jsx("img",{src:(null==n?void 0:n.emptyInboxUrl)||"https://assets.magicbell.io/images/empty_inbox.png",alt:"No notifications"}))}function wn(){return r.createElement("div",null,r.createElement("p",null,r.createElement(ye,{id:"messages.no-internet-connection",defaultMessage:"Hmm, we’re unable to connect to the internet.<br>Please check your connection.",html:!0})),r.createElement("svg",{width:"120",height:"93",viewBox:"0 0 120 93",fill:"currentColor"},r.createElement("path",{d:"M13.5135 93H106.486C113.919 93 120 86.9871 120 79.6379V27.5259V13.3621C120 6.01293 113.919 0 106.486 0H13.5135C6.08108 0 0 6.01293 0 13.3621V27.3922V79.5043C0 86.9871 6.08108 93 13.5135 93ZM2.7027 13.3621C2.7027 7.48276 7.56757 2.67241 13.5135 2.67241H106.486C112.432 2.67241 117.297 7.48276 117.297 13.3621V24.7198H2.7027V13.3621ZM2.7027 27.3922H117.297V79.5043C117.297 85.3836 112.432 90.194 106.486 90.194H13.5135C7.56757 90.194 2.7027 85.3836 2.7027 79.5043V27.3922Z"}),r.createElement("path",{d:"M13.6485 5.87933C9.05392 5.87933 5.40527 9.48709 5.40527 14.0302C5.40527 18.5733 9.05392 22.1811 13.6485 22.1811C18.2431 22.1811 21.8918 18.5733 21.8918 14.0302C21.8918 9.48709 18.108 5.87933 13.6485 5.87933ZM13.6485 19.375C10.5404 19.375 8.10798 16.9698 8.10798 13.8966C8.10798 10.8233 10.5404 8.41813 13.6485 8.41813C16.7566 8.41813 19.1891 10.8233 19.1891 13.8966C19.1891 16.9698 16.6215 19.375 13.6485 19.375Z"}),r.createElement("path",{d:"M32.4322 5.87933C27.8376 5.87933 24.189 9.48709 24.189 14.0302C24.189 18.5733 27.8376 22.1811 32.4322 22.1811C37.0268 22.1811 40.6755 18.5733 40.6755 14.0302C40.6755 9.48709 36.8917 5.87933 32.4322 5.87933ZM32.4322 19.375C29.3241 19.375 26.8917 16.9698 26.8917 13.8966C26.8917 10.8233 29.3241 8.41813 32.4322 8.41813C35.5403 8.41813 37.9727 10.8233 37.9727 13.8966C37.9727 16.9698 35.4052 19.375 32.4322 19.375Z"}),r.createElement("path",{d:"M51.2164 5.87933C46.6218 5.87933 42.9731 9.48709 42.9731 14.0302C42.9731 18.5733 46.6218 22.1811 51.2164 22.1811C55.811 22.1811 59.4596 18.5733 59.4596 14.0302C59.4596 9.48709 55.6758 5.87933 51.2164 5.87933ZM51.2164 19.375C48.1083 19.375 45.6758 16.9698 45.6758 13.8966C45.6758 10.8233 48.1083 8.41813 51.2164 8.41813C54.3245 8.41813 56.7569 10.8233 56.7569 13.8966C56.7569 16.9698 54.1894 19.375 51.2164 19.375Z"}),r.createElement("path",{d:"M42.4924 57.2198C43.2979 62.379 47.594 66.3 52.8299 66.3H56.5219C57.4617 66.3 58.2001 65.5433 58.2001 64.5803V46.4198C58.2001 45.4567 57.4617 44.7 56.5219 44.7H52.8971C47.6611 44.7 43.2979 48.621 42.5595 53.7803H38.2783C37.3385 53.7803 36.6001 54.537 36.6001 55.5C36.6001 56.4631 37.3385 57.2198 38.2783 57.2198H42.4924ZM52.9642 48.1395H54.978V62.9293H52.9642C49.0037 62.8605 45.7816 59.5586 45.7816 55.5C45.6473 51.4414 49.0037 48.1395 52.9642 48.1395Z"}),r.createElement("path",{d:"M60.8833 58.3204C60.0527 58.3204 59.4001 59.0771 59.4001 60.0401C59.4001 61.0032 60.0527 61.7599 60.8833 61.7599H64.3242V64.5803C64.3242 65.5433 64.9768 66.3 65.8073 66.3H69.0109C73.6384 66.3 77.4945 62.379 78.1471 57.2198H81.917C82.7476 57.2198 83.4001 56.4631 83.4001 55.5C83.4001 54.537 82.7476 53.7803 81.917 53.7803H78.2064C77.4945 48.621 73.6977 44.7 69.0703 44.7H65.8073C64.9768 44.7 64.3242 45.4567 64.3242 46.4198V49.2401H60.8833C60.0527 49.2401 59.4001 49.9968 59.4001 50.9599C59.4001 51.9229 60.0527 52.6796 60.8833 52.6796H64.3242V58.3204H60.8833ZM67.1718 48.0707H68.9516C72.4518 48.0707 75.2995 51.3726 75.2995 55.4312C75.2995 59.4898 72.4518 62.7917 68.9516 62.7917H67.1718V48.0707Z"})))}function En(){return r.createElement("div",null,r.createElement("p",null,r.createElement(ye,{id:"messages.server-error",defaultMessage:"We can’t seem to retrieve your notifications.<br>Please check back soon.",html:!0})),r.createElement("svg",{width:"120",height:"94",viewBox:"0 0 120 94",fill:"currentColor"},r.createElement("path",{d:"M13.5135 94H106.486C113.919 94 120 87.9224 120 80.4942V27.8218V13.5057C120 6.07759 113.919 0 106.486 0H13.5135C6.08108 0 0 6.07759 0 13.5057V27.6868V80.3592C0 87.9224 6.08108 94 13.5135 94ZM2.7027 13.5057C2.7027 7.56322 7.56757 2.70115 13.5135 2.70115H106.486C112.432 2.70115 117.297 7.56322 117.297 13.5057V24.9856H2.7027V13.5057ZM2.7027 27.6868H117.297V80.3592C117.297 86.3017 112.432 91.1638 106.486 91.1638H13.5135C7.56757 91.1638 2.7027 86.3017 2.7027 80.3592V27.6868Z"}),r.createElement("path",{d:"M13.6486 5.9425C9.05404 5.9425 5.4054 9.58906 5.4054 14.181C5.4054 18.773 9.05404 22.4195 13.6486 22.4195C18.2432 22.4195 21.8919 18.773 21.8919 14.181C21.8919 9.58906 18.1081 5.9425 13.6486 5.9425ZM13.6486 19.5833C10.5405 19.5833 8.1081 17.1523 8.1081 14.046C8.1081 10.9396 10.5405 8.5086 13.6486 8.5086C16.7567 8.5086 19.1892 10.9396 19.1892 14.046C19.1892 17.1523 16.6216 19.5833 13.6486 19.5833Z"}),r.createElement("path",{d:"M32.4325 5.9425C27.8379 5.9425 24.1892 9.58906 24.1892 14.181C24.1892 18.773 27.8379 22.4195 32.4325 22.4195C37.027 22.4195 40.6757 18.773 40.6757 14.181C40.6757 9.58906 36.8919 5.9425 32.4325 5.9425ZM32.4325 19.5833C29.3243 19.5833 26.8919 17.1523 26.8919 14.046C26.8919 10.9396 29.3243 8.5086 32.4325 8.5086C35.5406 8.5086 37.973 10.9396 37.973 14.046C37.973 17.1523 35.4054 19.5833 32.4325 19.5833Z"}),r.createElement("path",{d:"M51.2163 5.9425C46.6217 5.9425 42.973 9.58906 42.973 14.181C42.973 18.773 46.6217 22.4195 51.2163 22.4195C55.8109 22.4195 59.4595 18.773 59.4595 14.181C59.3244 9.58906 55.6757 5.9425 51.2163 5.9425ZM51.2163 19.5833C48.1082 19.5833 45.6757 17.1523 45.6757 14.046C45.6757 10.9396 48.1082 8.5086 51.2163 8.5086C54.3244 8.5086 56.7568 10.9396 56.7568 14.046C56.6217 17.1523 54.1892 19.5833 51.2163 19.5833Z"}),r.createElement("path",{d:"M18.9188 75.6321C19.1891 75.9022 19.5945 76.0373 19.8648 76.0373C20.135 76.0373 20.5405 75.9022 20.8107 75.6321L36.4864 59.9655C37.0269 59.4252 37.0269 58.6149 36.4864 58.0746L20.8107 42.408C20.2702 41.8678 19.4594 41.8678 18.9188 42.408C18.3783 42.9482 18.3783 43.7586 18.9188 44.2988L33.6486 59.0201L18.9188 73.7413C18.3783 74.2815 18.3783 75.0919 18.9188 75.6321Z"}),r.createElement("path",{d:"M47.5675 60.3707H72.2973C73.1081 60.3707 73.6486 59.8305 73.6486 59.0201C73.6486 58.2098 73.1081 57.6696 72.2973 57.6696H47.5675C46.7567 57.6696 46.2162 58.2098 46.2162 59.0201C46.2162 59.8305 46.8919 60.3707 47.5675 60.3707Z"})))}function jn(){var e=Z().notification;return i.jsx("div",{css:i.css(bn||(bn=H(["\n padding: 3em !important;\n text-align: center;\n color: ",";\n\n svg {\n margin: 2em auto;\n height: 200px;\n }\n "])),e.default.textColor)},navigator.onLine?i.jsx(En,null):i.jsx(wn,null))}function Mn(e){var n=e.height,r=e.onNotificationClick,o=e.store,a=e.NotificationItem,c=t.useRef(),l=function(e,n){var r=t.useState(n),o=r[0],i=r[1],a=t.useRef();return t.useEffect((function(){return a.current=new w((function(e){void 0===e&&(e=[]),e.forEach((function(e){i(e.contentRect.height)}))})),e.current&&a.current.observe(e.current),function(){a.current&&a.current.disconnect()}}),[e]),o}(c,n),s=t.useState(n),u=s[0],d=s[1];return t.useEffect((function(){d(l)}),[l]),i.jsx("div",{ref:c,css:{flex:1,overflowY:"hidden"}},"rejected"===o.xhrFetchState&&i.jsx(jn,null),"fulfilled"===o.xhrFetchState&&o.isEmpty&&i.jsx(kn,null),"fulfilled"===o.xhrFetchState&&!o.isEmpty&&i.jsx(yn,{height:u,notifications:o,onItemClick:r,queryParams:o.context,ListItem:a}))}var On,Hn=a.observer(Mn);function Ln(e){var n=e.height,t=e.children,r=e.layout,o=Z().container,a=function(e){var n=Z(),t=n.container,r=n.header,o=n.footer,i=r;"footer"===e[0]?i=o:"container"===e[0]&&(i=t);var a=o;return"header"===e[e.length-1]?a=r:"container"===e[e.length-1]&&(a=t),[i.borderRadius,i.borderRadius,a.borderRadius,a.borderRadius]}(r),c=a[0],l=a[1],s=a[2],u=a[3];return i.jsx("div",{css:[F,i.css(On||(On=H(["\n background-color: ",";\n border-radius: "," "," "," ",";\n color: ",";\n display: flex;\n flex-direction: column;\n font-family: "," !important;\n height: ",";\n overflow: hidden;\n "])),o.backgroundColor,c,l,s,u,o.textColor,o.fontFamily,n?n+"px":"auto")]},t)}function Nn(e){var n=e.height,t=e.layout,r=void 0===t?["header","content","push-notifications-banner","footer"]:t,o=e.onAllRead,a=e.onNotificationClick,c=e.NotificationItem,l=e.storeId,s=ne(void 0===l?"default":l);return s?i.jsx(Ln,{height:n,layout:r},i.jsx(xn,{order:r},i.jsx(hn,{key:"header",onAllRead:function(){null==s||s.markAllAsRead(),o&&o()}}),i.jsx(Hn,{key:"content",store:s,onNotificationClick:a,height:n,NotificationItem:c}),i.jsx(Xe,{key:"push-notifications-banner"}),i.jsx(pn,{key:"footer"}))):null}var Sn,An=a.observer(Nn);function Rn(e){var n=e.placement,t=Z(),r=t.header,o=t.footer;return i.jsx("div",{"data-popper-arrow":!0,"data-popper-placement":n,css:i.css(Sn||(Sn=H(["\n &,\n &:before {\n position: absolute;\n width: 18px !important;\n height: 18px !important;\n z-index: -1;\n border-radius: 2px !important;\n }\n\n &:before {\n content: '';\n transform: rotate(45deg);\n left: 0;\n }\n\n &[data-popper-placement^='top'] {\n bottom: -4px;\n\n &:before {\n background: ",";\n }\n }\n\n &[data-popper-placement^='bottom'] {\n top: -4px;\n\n &:before {\n background: ",";\n }\n }\n\n &[data-popper-placement^='left'] {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] {\n left: -4px;\n }\n "])),r.backgroundColor,o.backgroundColor)})}var Vn,In=a.observer(Rn);function Zn(e){var n=e.width,t=void 0===n?400:n,r=e.children,o=e.attrs;return i.jsx("div",Object.assign({css:i.css(Vn||(Vn=H(["\n box-shadow: 0px 20px 25px rgba(84, 95, 111, 0.1), 0px 10px 10px rgba(84, 95, 111, 0.04);\n width: ","px;\n max-width: calc(100vw - 10px);\n overflow: hidden;\n "])),t)},o),r)}n.configure({isolateGlobalState:!0,enforceActions:"never"}),Object.defineProperty(exports,"Observer",{enumerable:!0,get:function(){return a.Observer}}),Object.defineProperty(exports,"observer",{enumerable:!0,get:function(){return a.observer}}),Object.defineProperty(exports,"Notification",{enumerable:!0,get:function(){return l.Notification}}),Object.defineProperty(exports,"NotificationStore",{enumerable:!0,get:function(){return l.NotificationStore}}),Object.defineProperty(exports,"NotificationStoreWithContext",{enumerable:!0,get:function(){return l.NotificationStoreWithContext}}),exports.Bell=re,exports.ClickableNotification=De,exports.EnablePushNotificationsButton=Je,exports.FloatingNotificationInbox=function(e){var n=e.launcherRef,t=e.isOpen,o=e.toggle,i=e.placement,a=void 0===i?"auto":i,c=e.width,l=void 0===c?500:c,s=e.onNotificationClick,u=e.closeOnClickOutside,d=void 0===u||u,f=e.closeOnNotificationClick,p=void 0===f||f,m=e.popperOptions,h=e.hideArrow,x=void 0!==h&&h,C=O(e,["launcherRef","isOpen","toggle","placement","width","onNotificationClick","closeOnClickOutside","closeOnNotificationClick","popperOptions","hideArrow"]),g=function(e){null==s||s(e),p&&(null==o||o())};return r.createElement(je,{isOpen:t,launcherRef:n,onClickOutside:function(){d&&(null==o||o())},placement:a,popperOptions:m},(function(e){return r.createElement(Zn,{width:l,attrs:e},r.createElement(An,Object.assign({onNotificationClick:g},C)),x?null:r.createElement(In,{placement:e["data-placement"]}))}))},exports.FloatingNotificationInboxArrow=In,exports.Footer=pn,exports.Header=hn,exports.MagicBellContext=X,exports.MagicBellProvider=fe,exports.MagicBellThemeContext=V,exports.NotificationContent=be,exports.NotificationInbox=An,exports.NotificationList=yn,exports.NotificationState=Ne,exports.Popover=je,exports.StyledNotificationContainer=_e,exports.Timestamp=Ve,exports.UnseenBadge=q,exports.darken=z,exports.default=function(e){var n=e.children,i=e.BellIcon,a=e.defaultIsOpen,c=void 0!==a&&a,l=e.onNewNotification,s=e.onToggle,u=e.bellCounter,d=void 0===u?"unseen":u,f=O(e,["children","BellIcon","defaultIsOpen","onNewNotification","onToggle","bellCounter"]),p=t.useRef(null),m=o(c),h=m[0],x=m[1];return r.createElement(fe,Object.assign({},f),r.createElement("div",null,r.createElement("div",{ref:p,"aria-expanded":h},r.createElement(re,{onClick:function(){x(),null==s||s(h)},Icon:i,counter:d})),r.createElement(ie,{onNewNotification:l}),h&&n({isOpen:h,toggle:x,launcherRef:p})))},exports.defaultMagicBellTheme=R,exports.toRGBA=T,exports.useBell=ee,exports.useConfig=Q,exports.useMagicBellContext=$,exports.useMagicBellEvent=oe,exports.useNotificationWorkflow=Ie,exports.useNotifications=ne,exports.useTheme=Z; | ||
//# sourceMappingURL=magicbell-react.cjs.production.min.js.map |
{ | ||
"name": "@magicbell/magicbell-react", | ||
"version": "7.2.0", | ||
"version": "7.3.0", | ||
"description": "A set of React components to build a notification inbox", | ||
@@ -5,0 +5,0 @@ "author": "MagicBell <bot@magicbell.io> (https://magicbell.io/)", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
474810
97
6295