(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{139:function(e){e.exports=JSON.parse('{"a":"/shlink-web-client/patch-1"}')},140:function(e,t,r){"use strict";var n=r(0),a=r(23),c=r(36);t.a=function(e){var t=e.to,r=void 0===t?"/":t,s=e.children,i=void 0===s?"Home":s;return Object(n.jsx)("div",{className:"home",children:Object(n.jsxs)(c.a,{className:"p-4",children:[Object(n.jsx)("h2",{children:"Oops! We could not find requested route."}),Object(n.jsx)("p",{children:"Use your browser's back button to navigate to the page you have previously come from, or just press this button."}),Object(n.jsx)("br",{}),Object(n.jsx)(a.b,{to:r,className:"btn btn-outline-primary btn-lg",children:i})]})})}},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),a=r(40),c=function(e){var t=e.color,r=void 0===t?a.c:t,c=e.className;return Object(n.jsx)("svg",{className:c,viewBox:"0 0 512 512",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsxs)("g",{fill:r,children:[Object(n.jsx)("path",{d:" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z"}),Object(n.jsx)("path",{d:" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z"}),Object(n.jsx)("path",{d:" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z"}),Object(n.jsx)("path",{d:" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z"})]})})}},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(3),a=r(0),c=r(1),s=r(47),i=r(27),o=r(59);function l(e,t){return function(r){var l=r.selectServer,u=r.selectedServer,d=r.match;return Object(c.useEffect)((function(){l(d.params.serverId)}),[d.params.serverId]),u?Object(i.b)(u)?Object(a.jsx)(t,{}):Object(a.jsx)(e,Object(n.a)({},r)):Object(a.jsx)(o.a,{children:Object(a.jsx)(s.a,{loading:!0})})}}},157:function(e,t,r){"use strict";var n=r(0),a=r(654),c=r(655),s=r(23),i=r(6),o=r.n(i),l=r(15),u=r(14),d=function(e){var t=e.id,r=e.name;return Object(n.jsxs)(a.a,{tag:s.b,to:"/server/".concat(t),className:"servers-list__server-item",children:[r,Object(n.jsx)(l.a,{icon:u.i,className:"servers-list__server-item-icon"})]})};t.a=function(e){var t=e.servers,r=e.children,a=e.embedded,s=void 0!==a&&a;return Object(n.jsxs)(n.Fragment,{children:[r&&Object(n.jsx)("h5",{className:"mb-md-3",children:r}),t.length>0&&Object(n.jsx)(c.a,{className:o()("servers-list__list-group",{"servers-list__list-group--embedded":s}),children:t.map((function(e){var t=e.id,r=e.name;return Object(n.jsx)(d,{id:t,name:r},t)}))})]})}},25:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(9),a=r(1),c=r(283),s=function(e,t){return function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,s=Object(a.useState)(r),i=Object(n.a)(s,2),o=i[0],l=i[1],u=Object(a.useRef)(void 0),d=function(){l(!r),u.current&&t(u.current),u.current=e((function(){return l(r)}),c)};return[o,d]}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(a.useState)(e),r=Object(n.a)(t,2),c=r[0],s=r[1];return[c,function(){return s(!c)},function(){return s(!0)},function(){return s(!1)}]},o=function(e,t){var r=function(e){return function(t){t.event.composedPath().some((function(e){var t=e.classList;return null===t||void 0===t?void 0:t.contains("visits-table")}))||document.querySelector(".modal")||e()}};return Object(c.useSwipeable)({delta:40,onSwipedLeft:r(t),onSwipedRight:r(e)})}},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return l})),r.d(t,"b",(function(){return u}));var n=r(643),a=r(207),c=r(642),s=r(641),i=function(e,t,r){return e!==t?"ASC":r?{ASC:"DESC",DESC:void 0}[r]:"ASC"},o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Object(n.a)(r,e+1).map(t)},l=function(e){return!Object(a.a)(e)&&!Object(c.a)(e)},u=function(e){return Object(s.a)((function(e){return e.preventDefault()}),e)}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return s}));var n=function(e){return!(null===e||void 0===e||!e.url)&&!(null===e||void 0===e||!e.apiKey)},a=function(e){return!(null===e||void 0===e||!e.hasOwnProperty("id"))},c=function(e){return!(null===e||void 0===e||!e.hasOwnProperty("version"))},s=function(e){return!(null===e||void 0===e||!e.hasOwnProperty("serverNotFound"))}},280:function(e,t,r){"use strict";(function(e){var n=r(281),a=r.n(n),c=r(282),s=r(312),i=r(313),o=r(314),l=r(315),u=r(284),d=r(310),j=r(93);t.a=function(t,r,n){t.constant("window",e.window),t.constant("console",e.console),t.constant("axios",a.a),t.serviceFactory("ScrollToTop",c.a),t.decorator("ScrollToTop",n),t.serviceFactory("MainHeader",s.a,"ServersDropdown"),t.decorator("MainHeader",n),t.serviceFactory("Home",(function(){return i.a})),t.decorator("Home",j.a),t.decorator("Home",r(["servers"],["resetSelectedServer"])),t.serviceFactory("MenuLayout",o.a,"TagsList","ShortUrls","AsideMenu","CreateShortUrl","ShortUrlVisits","TagVisits","OrphanVisits","ServerError","Overview","EditShortUrl"),t.decorator("MenuLayout",r(["selectedServer","shortUrlsListParams"],["selectServer"])),t.decorator("MenuLayout",n),t.serviceFactory("AsideMenu",l.a,"DeleteServerButton"),t.serviceFactory("ShlinkVersionsContainer",(function(){return d.a})),t.decorator("ShlinkVersionsContainer",r(["selectedServer"])),t.serviceFactory("ErrorHandler",u.a,"window","console")}}).call(this,r(38))},282:function(e,t,r){"use strict";var n=r(0),a=r(1);t.a=function(){return function(e){var t=e.location,r=e.children;return Object(a.useEffect)((function(){scrollTo(0,0)}),[t]),Object(n.jsx)(n.Fragment,{children:r})}}},284:function(e,t,r){"use strict";var n=r(41),a=r(285),c=r(317),s=r(308),i=r(0),o=r(1),l=r(208),u=r(36);t.a=function(e,t){var r=e.location,d=t.error;return function(e){Object(c.a)(o,e);var t=Object(s.a)(o);function o(e){var r;return Object(n.a)(this,o),(r=t.call(this,e)).state={hasError:!1},r}return Object(a.a)(o,[{key:"componentDidCatch",value:function(e){d(e)}},{key:"render",value:function(){return this.state.hasError?Object(i.jsx)("div",{className:"home",children:Object(i.jsxs)(u.a,{className:"p-4",children:[Object(i.jsx)("h1",{children:"Oops! This is awkward :S"}),Object(i.jsx)("p",{children:"It seems that something went wrong. Try refreshing the page or just click this button."}),Object(i.jsx)("br",{}),Object(i.jsx)(l.a,{outline:!0,color:"primary",onClick:function(){return r.reload()},children:"Take me back"})]})}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),o}(o.Component)}},300:function(e,t,r){"use strict";(function(e){var n=r(25),a=r(301),c=r(302);t.a=function(t){t.constant("localStorage",e.localStorage),t.service("Storage",a.a,"localStorage"),t.service("ColorGenerator",c.a,"Storage"),t.constant("setTimeout",e.setTimeout),t.constant("clearTimeout",e.clearTimeout),t.serviceFactory("useStateFlagTimeout",n.a,"setTimeout","clearTimeout")}}).call(this,r(38))},301:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(41),a=function(e){return"".concat("shlink",".").concat(e)},c=function e(t){var r=this;Object(n.a)(this,e),this.localStorage=t,this.get=function(e){var t=r.localStorage.getItem(a(e));return t?JSON.parse(t):void 0},this.set=function(e,t){return r.localStorage.setItem(a(e),JSON.stringify(t))}}},302:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(41),a=r(26),c=Math.floor,s=Math.random,i="0123456789ABCDEF",o=function(e){return e.toLowerCase().trim()},l=function e(t){var r,l=this;Object(n.a)(this,e),this.storage=t,this.colors=void 0,this.getColorForKey=function(e){var t=o(e),r=l.colors[t];return r||l.setColorForKey(t,"#".concat(Object(a.d)(6,(function(){return i[c(s()*i.length)]})).join("")))},this.setColorForKey=function(e,t){var r=o(e);return l.colors[r]=t,l.storage.set("colors",l.colors),t},this.colors=null!==(r=this.storage.get("colors"))&&void 0!==r?r:{}}},310:function(e,t,r){"use strict";var n=r(0),a=r(6),c=r.n(a),s=r(27),i=r(641),o=r(44),l=r(60),u=Object(i.a)(Object(l.c)(),l.b),d=function(e){var t=e.project,r=e.version;return Object(n.jsx)(o.a,{href:"https://github.com/shlinkio/".concat(t,"/releases/").concat(r),className:"text-muted",children:Object(n.jsx)("b",{children:r})})},j=function(e){var t=e.selectedServer,r=e.clientVersion,a=u(void 0===r?"%_VERSION_%":r);return Object(n.jsxs)("small",{className:"text-muted",children:[Object(s.c)(t)&&Object(n.jsxs)(n.Fragment,{children:["Server: ",Object(n.jsx)(d,{project:"shlink",version:t.printableVersion})," - "]}),"Client: ",Object(n.jsx)(d,{project:"shlink-web-client",version:a})]})};t.a=function(e){var t=e.selectedServer,r=c()("text-center",{"shlink-versions-container--with-server":Object(s.c)(t)});return Object(n.jsx)("div",{className:r,children:Object(n.jsx)(j,{selectedServer:t})})}},312:function(e,t,r){"use strict";var n=r(9),a=r(0),c=r(14),s=r(15),i=r(1),o=r(23),l=r(647),u=r(648),d=r(649),j=r(650),b=r(651),h=r(652),v=r(653),O=r(6),f=r.n(O),m=r(25),g=r(144);t.a=function(e){return function(t){var r=t.location,O=Object(m.c)(),p=Object(n.a)(O,4),x=p[0],S=p[1],y=p[3],C=r.pathname;Object(i.useEffect)(y,[r]);var N=f()("main-header__toggle-icon",{"main-header__toggle-icon--opened":x});return Object(a.jsxs)(l.a,{color:"primary",dark:!0,fixed:"top",className:"main-header",expand:"md",children:[Object(a.jsxs)(u.a,{tag:o.b,to:"/",children:[Object(a.jsx)(g.a,{className:"main-header__brand-logo",color:"white"})," Shlink"]}),Object(a.jsx)(d.a,{onClick:S,children:Object(a.jsx)(s.a,{icon:c.h,className:N})}),Object(a.jsx)(j.a,{navbar:!0,isOpen:x,children:Object(a.jsxs)(b.a,{navbar:!0,className:"ml-auto",children:[Object(a.jsx)(h.a,{children:Object(a.jsxs)(v.a,{tag:o.b,to:"/settings",active:"/settings"===C,children:[Object(a.jsx)(s.a,{icon:c.k}),"\xa0 Settings"]})}),Object(a.jsx)(e,{})]})})]})}}},313:function(e,t,r){"use strict";var n=r(0),a=r(656),c=r(642),s=r(23),i=r(318),o=r(639),l=r(44),u=r(157),d=r(144);t.a=function(e){var t=e.servers,r=Object(a.a)(t),j=!Object(c.a)(r);return Object(n.jsx)("div",{className:"home",children:Object(n.jsx)(i.a,{className:"home__main-card",children:Object(n.jsxs)(o.a,{noGutters:!0,children:[Object(n.jsx)("div",{className:"col-md-5 d-none d-md-block",children:Object(n.jsx)("div",{className:"p-4",children:Object(n.jsx)(d.a,{})})}),Object(n.jsxs)("div",{className:"col-md-7 home__servers-container",children:[Object(n.jsx)("div",{className:"p-4",children:Object(n.jsx)("h1",{className:"home__title",children:"Welcome!"})}),Object(n.jsx)(u.a,{embedded:!0,servers:r,children:!j&&Object(n.jsxs)("div",{className:"p-4",children:[Object(n.jsx)("p",{children:"This application will help you to manage your Shlink servers."}),Object(n.jsxs)("p",{children:["To start, please, ",Object(n.jsx)(s.b,{to:"/server/create",children:"add your first server"}),"."]}),Object(n.jsxs)("p",{className:"m-0",children:["You still don\u2018t have a Shlink server? Learn how to ",Object(n.jsx)(l.a,{href:"https://shlink.io/documentation",children:"get started"}),"."]})]})})]})]})})})}},314:function(e,t,r){"use strict";var n=r(3),a=r(9),c=r(0),s=r(1),i=r(35),o=r(14),l=r(15),u=r(6),d=r.n(u),j=r(145),b=r(25),h=r(45),v=r(27),O=r(140);t.a=function(e,t,r,u,f,m,g,p,x,S){return Object(j.a)((function(j){var y=j.location,C=j.selectedServer,N=Object(b.c)(),U=Object(a.a)(N,4),_=U[0],k=U[1],w=U[2],T=U[3];if(Object(s.useEffect)((function(){return T()}),[y]),!Object(v.c)(C))return Object(c.jsx)(p,{});var R=Object(h.h)(C),D=Object(h.b)(C),E=d()("menu-layout__burger-icon",{"menu-layout__burger-icon--active":_}),V=Object(b.b)(w,T);return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(l.a,{icon:o.b,className:E,onClick:k}),Object(c.jsx)("div",Object(n.a)(Object(n.a)({},V),{},{className:"menu-layout__swipeable",children:Object(c.jsxs)("div",{className:"menu-layout__swipeable-inner",children:[Object(c.jsx)(r,{selectedServer:C,showOnMobile:_}),Object(c.jsx)("div",{className:"menu-layout__container",onClick:function(){return T()},children:Object(c.jsx)("div",{className:"container-xl",children:Object(c.jsxs)(i.d,{children:[Object(c.jsx)(i.a,{exact:!0,from:"/server/:serverId",to:"/server/:serverId/overview"}),Object(c.jsx)(i.b,{exact:!0,path:"/server/:serverId/overview",component:x}),Object(c.jsx)(i.b,{exact:!0,path:"/server/:serverId/list-short-urls/:page",component:t}),Object(c.jsx)(i.b,{exact:!0,path:"/server/:serverId/create-short-url",component:u}),Object(c.jsx)(i.b,{path:"/server/:serverId/short-code/:shortCode/visits",component:f}),Object(c.jsx)(i.b,{path:"/server/:serverId/short-code/:shortCode/edit",component:S}),R&&Object(c.jsx)(i.b,{path:"/server/:serverId/tag/:tag/visits",component:m}),D&&Object(c.jsx)(i.b,{path:"/server/:serverId/orphan-visits",component:g}),Object(c.jsx)(i.b,{exact:!0,path:"/server/:serverId/manage-tags",component:e}),Object(c.jsx)(i.b,{render:function(){return Object(c.jsx)(O.a,{to:"/server/".concat(C.id,"/list-short-urls/1"),children:"List short URLs"})}})]})})})]})}))]})}),p)}},315:function(e,t,r){"use strict";var n=r(3),a=r(31),c=r(0),s=r(14),i=r(15),o=r(23),l=r(6),u=r.n(l),d=function(e){var t=e.children,r=e.to,s=e.className,i=Object(a.a)(e,["children","to","className"]);return Object(c.jsx)(o.c,Object(n.a)(Object(n.a)({className:u()("aside-menu__item",s),activeClassName:"aside-menu__item--selected",to:r},i),{},{children:t}))};t.a=function(e){return function(t){var r=t.selectedServer,n=t.showOnMobile,a=void 0!==n&&n,o=r?r.id:"",l=u()("aside-menu",{"aside-menu--hidden":!a}),j=function(e){return"/server/".concat(o).concat(e)};return Object(c.jsx)("aside",{className:l,children:Object(c.jsxs)("nav",{className:"nav flex-column aside-menu__nav",children:[Object(c.jsxs)(d,{to:j("/overview"),children:[Object(c.jsx)(i.a,{icon:s.p}),Object(c.jsx)("span",{className:"aside-menu__item-text",children:"Overview"})]}),Object(c.jsxs)(d,{to:j("/list-short-urls/1"),isActive:function(e,t){return null!==t.pathname.match("/list-short-urls")},children:[Object(c.jsx)(i.a,{icon:s.s}),Object(c.jsx)("span",{className:"aside-menu__item-text",children:"List short URLs"})]}),Object(c.jsxs)(d,{to:j("/create-short-url"),children:[Object(c.jsx)(i.a,{icon:s.r,flip:"horizontal"}),Object(c.jsx)("span",{className:"aside-menu__item-text",children:"Create short URL"})]}),Object(c.jsxs)(d,{to:j("/manage-tags"),children:[Object(c.jsx)(i.a,{icon:s.G}),Object(c.jsx)("span",{className:"aside-menu__item-text",children:"Manage tags"})]}),Object(c.jsxs)(d,{to:j("/edit"),className:"aside-menu__item--push",children:[Object(c.jsx)(i.a,{icon:s.x}),Object(c.jsx)("span",{className:"aside-menu__item-text",children:"Edit this server"})]}),Object(c.jsx)(e,{className:"aside-menu__item aside-menu__item--danger",textClassName:"aside-menu__item-text",server:r})]})})}}},320:function(e,t,r){e.exports=r(633)},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(3),a=r(31),c=r(0),s=r(318),i=r(637),o=r(638),l=function(e){var t=e.title,r=e.children,l=e.bodyClassName,u=Object(a.a)(e,["title","children","bodyClassName"]);return Object(c.jsxs)(s.a,Object(n.a)(Object(n.a)({},u),{},{children:[t&&Object(c.jsx)(i.a,{children:t}),Object(c.jsx)(o.a,{className:l,children:r})]}))}},40:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s})),r.d(t,"f",(function(){return i})),r.d(t,"e",(function(){return o})),r.d(t,"g",(function(){return l})),r.d(t,"h",(function(){return u}));var n="#4696e5",a="rgba(70, 150, 229, 0.4)",c="#f77f28",s="rgba(247, 127, 40, 0.4)",i="white",o="#161b22",l=function(e){var t,r=document.getElementsByTagName("html");null===r||void 0===r||null===(t=r[0])||void 0===t||t.setAttribute("data-theme",e)},u=function(){var e,t=document.getElementsByTagName("html");return"dark"===(null===t||void 0===t||null===(e=t[0])||void 0===e?void 0:e.getAttribute("data-theme"))}},411:function(e,t){},413:function(e,t){},45:function(e,t,r){"use strict";r.d(t,"f",(function(){return s})),r.d(t,"h",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"e",(function(){return l})),r.d(t,"j",(function(){return u})),r.d(t,"d",(function(){return d})),r.d(t,"g",(function(){return j})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return h})),r.d(t,"i",(function(){return v}));var n=r(27),a=r(60),c=function(e){return function(t){return Object(n.c)(t)&&Object(a.a)(t.version,e)}},s=c({minVersion:"2.1.0"}),i=c({minVersion:"2.2.0"}),o=c({minVersion:"2.4.0"}),l=o,u=o,d=c({minVersion:"2.5.0"}),j=c({minVersion:"2.6.0"}),b=j,h=j,v=j},47:function(e,t,r){"use strict";var n=r(0),a=r(639),c=r(318),s=r(6),i=r.n(s),o=r(14),l=r(15),u=function(e){return{error:"border-danger",default:""}[e]},d=function(e){return{error:"text-danger",default:"text-muted"}[e]};t.a=function(e){var t=e.className,r=e.children,s=e.loading,j=void 0!==s&&s,b=e.type,h=void 0===b?"default":b,v=e.fullWidth,O=void 0!==v&&v,f=i()({"col-md-12":O,"col-md-10 offset-md-1":!O});return Object(n.jsx)(a.a,{noGutters:!0,className:t,children:Object(n.jsx)("div",{className:f,children:Object(n.jsx)(c.a,{className:u(h),body:!0,children:Object(n.jsxs)("h3",{className:i()("text-center mb-0",d(h)),children:[j&&Object(n.jsx)(l.a,{icon:o.j,spin:!0}),j&&Object(n.jsx)("span",{className:"ml-2",children:null!==r&&void 0!==r?r:"Loading..."}),!j&&r]})})})})}},59:function(e,t,r){"use strict";var n=r(0);t.a=function(e){var t=e.children;return Object(n.jsx)("div",{className:"no-menu-wrapper container-xl",children:t})}},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return u}));var n=r(160),a=r(640),c=r(644),s=r(26),i=function(e,t){var r=t.maxVersion,a=t.minVersion;if(!Object(s.c)(e))return!1;var c=!a||Object(n.compare)(e,a,">=");return(!r||Object(n.compare)(e,r,"<="))&&c},o=Object(a.a)(c.a,(function(e){try{return Object(n.compare)(e,e,"=")}catch(t){return!1}})),l=function(e){return o(e)?"v".concat(e):e},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"latest";return function(t){return o(t)?t:e}}},633:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"processStatsFromVisits",(function(){return za})),r.d(n,"normalizeVisits",(function(){return Ka}));var a,c=r(0),s=r(39),i=r(154),o=r(23),l=r(139),u=r(3),d=r(279),j=r(35),b=r(698),h=r(1),v=r(140),O=r(40),f=function(e,t,r,n,a,s,i){return function(o){var l=o.fetchServers,u=o.servers,d=o.settings;return Object(h.useEffect)((function(){var e,t;0===Object.keys(u).length&&l(),Object(O.g)(null!==(e=null===(t=d.ui)||void 0===t?void 0:t.theme)&&void 0!==e?e:"light")}),[]),Object(c.jsxs)("div",{className:"container-fluid app-container",children:[Object(c.jsx)(e,{}),Object(c.jsxs)("div",{className:"app",children:[Object(c.jsx)("div",{className:"shlink-wrapper",children:Object(c.jsxs)(j.d,{children:[Object(c.jsx)(j.b,{exact:!0,path:"/",component:t}),Object(c.jsx)(j.b,{exact:!0,path:"/settings",component:s}),Object(c.jsx)(j.b,{exact:!0,path:"/server/create",component:n}),Object(c.jsx)(j.b,{exact:!0,path:"/server/:serverId/edit",component:a}),Object(c.jsx)(j.b,{path:"/server/:serverId",component:r}),Object(c.jsx)(j.b,{component:v.a})]})}),Object(c.jsx)("div",{className:"shlink-footer",children:Object(c.jsx)(i,{})})]})]})}},m=r(702),g=r(27),p=r(7),x=r.n(p),S=r(12),y=r(41),C=r(114),N=r.n(C),U=r(311),_=r(207),k=r(642),w=function(e,t){return e?"".concat(e,"/rest/v").concat(t):""},T=Object(U.a)(_.a),R=function e(t,r,n){var a=this;Object(y.a)(this,e),this.axios=t,this.baseUrl=r,this.apiKey=n,this.apiVersion=void 0,this.listShortUrls=Object(S.a)(x.a.mark((function e(){var t,r=arguments;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.abrupt("return",a.performRequest("/short-urls","GET",t).then((function(e){return e.data.shortUrls})));case 2:case"end":return e.stop()}}),e)}))),this.createShortUrl=function(){var e=Object(S.a)(x.a.mark((function e(t){var r;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(U.a)((function(e){return Object(k.a)(e)||Object(_.a)(e)}),t),e.abrupt("return",a.performRequest("/short-urls","POST",{},r).then((function(e){return e.data})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.getShortUrlVisits=function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/short-urls/".concat(t,"/visits"),"GET",r).then((function(e){return e.data.visits})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.getTagVisits=function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/tags/".concat(t,"/visits"),"GET",r).then((function(e){return e.data.visits})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.getOrphanVisits=function(){var e=Object(S.a)(x.a.mark((function e(t){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/visits/orphan","GET",t).then((function(e){return e.data.visits})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.getVisitsOverview=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/visits","GET").then((function(e){return e.data.visits})));case 1:case"end":return e.stop()}}),e)}))),this.getShortUrl=function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/short-urls/".concat(t),"GET",{domain:r}).then((function(e){return e.data})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.deleteShortUrl=function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/short-urls/".concat(t),"DELETE",{domain:r}).then((function(){})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.updateShortUrlTags=function(){var e=Object(S.a)(x.a.mark((function e(t,r,n){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/short-urls/".concat(t,"/tags"),"PUT",{domain:r},{tags:n}).then((function(e){return e.data.tags})));case 1:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),this.updateShortUrl=function(){var e=Object(S.a)(x.a.mark((function e(t,r,n){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/short-urls/".concat(t),"PATCH",{domain:r},n).then((function(e){return e.data})));case 1:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),this.listTags=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/tags","GET",{withStats:"true"}).then((function(e){return e.data.tags})).then((function(e){return{tags:e.data,stats:e.stats}})));case 1:case"end":return e.stop()}}),e)}))),this.deleteTags=function(){var e=Object(S.a)(x.a.mark((function e(t){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/tags","DELETE",{tags:t}).then((function(){return{tags:t}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.editTag=function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/tags","PUT",{},{oldName:t,newName:r}).then((function(){return{oldName:t,newName:r}})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),this.health=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/health","GET").then((function(e){return e.data})));case 1:case"end":return e.stop()}}),e)}))),this.mercureInfo=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/mercure-info","GET").then((function(e){return e.data})));case 1:case"end":return e.stop()}}),e)}))),this.listDomains=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.performRequest("/domains","GET").then((function(e){return e.data.domains.data})));case 1:case"end":return e.stop()}}),e)}))),this.performRequest=function(){var e=Object(S.a)(x.a.mark((function e(t){var r,n,c,s,i=arguments;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:"GET",n=i.length>2&&void 0!==i[2]?i[2]:{},c=i.length>3&&void 0!==i[3]?i[3]:{},e.prev=3,e.next=6,a.axios({method:r,url:"".concat(w(a.baseUrl,a.apiVersion)).concat(t),headers:{"X-Api-Key":a.apiKey},params:T(n),data:c,paramsSerializer:function(e){return N.a.stringify(e,{arrayFormat:"brackets"})}});case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(3),s=e.t0.response,!s&&2!==a.apiVersion){e.next=15;break}throw e.t0;case 15:return a.apiVersion=a.apiVersion-1,e.next=18,a.performRequest(t,r,n,c);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}(),this.apiVersion=2},D={},E=function(e){return function(t){var r,n=function(e){return"function"===typeof e}(t)?(r=t,Object(m.a)("selectedServer",r())):t;if(!Object(g.a)(n))throw new Error("There's no selected server or it is not found");var a=n.url,c=n.apiKey,s="".concat(a,"_").concat(c);return D[s]||(D[s]=new R(e,a,c)),D[s]}},V=function(e){e.serviceFactory("buildShlinkApiClient",E,"axios")},L=r(280),I=r(9),F=function(e,t){return function(r){var n,a=r.match,s=null!==(n=null===a||void 0===a?void 0:a.params)&&void 0!==n?n:{},i=s.page,o=void 0===i?"1":i,l=s.serverId,d=void 0===l?"":l,j=Object(h.useState)("".concat(d,"_").concat(o)),b=Object(I.a)(j,2),v=b[0],O=b[1];return Object(h.useEffect)((function(){O("".concat(d,"_").concat(o))}),[d,o]),Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("div",{className:"form-group",children:Object(c.jsx)(e,{})}),Object(h.createElement)(t,Object(u.a)(Object(u.a)({},r),{},{key:v}))]})}},A=r(14),M=r(15),G=r(641),P=r(24),B=r.n(P),H=r(6),Y=r.n(H),q=function(e){var t=e.onChange,r=e.className,n=e.placeholder,s=void 0===n?"Search...":n,i=e.large,o=void 0===i||i,l=e.noBorder,u=void 0!==l&&l,d=Object(h.useState)(""),j=Object(I.a)(d,2),b=j[0],v=j[1],O=function(){a&&clearTimeout(a),a=null},f=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;v(e),O(),a=setTimeout((function(){t(e),O()}),r)};return Object(c.jsxs)("div",{className:Y()("search-field",r),children:[Object(c.jsx)("input",{type:"text",className:Y()("form-control search-field__input",{"form-control-lg":o,"search-field__input--no-border":u}),placeholder:s,value:b,onChange:function(e){return f(e.target.value)}}),Object(c.jsx)(M.a,{icon:A.B,className:"search-field__icon"}),Object(c.jsx)("div",{className:"close search-field__close",hidden:""===b,id:"search-field__close",onClick:function(){return f("",0)},children:"\xd7"})]})},W=function(e){var t=e.text,r=e.children,n=e.clearable,a=e.colorGenerator,s=e.onClick,i=e.onClose;return Object(c.jsxs)("span",{className:"badge tag",style:{backgroundColor:a.getColorForKey(t),cursor:n||!s?"auto":"pointer"},onClick:s,children:[null!==r&&void 0!==r?r:t,n&&Object(c.jsx)("span",{className:"close tag__close-selected-tag",onClick:i,children:"\xd7"})]})},z=r(660),K=r(118),Q=r(657),J=r(658),Z=r(25),X=function(e){var t=e.text,r=e.disabled,n=void 0!==r&&r,a=e.className,s=void 0===a?"":a,i=e.children,o=e.dropdownClassName,l=e.right,u=void 0!==l&&l,d=Object(Z.c)(),j=Object(I.a)(d,2),b=j[0],h=j[1],v="dropdown-btn__toggle btn-block ".concat(s);return Object(c.jsxs)(K.a,{isOpen:b,toggle:h,disabled:n,className:o,children:[Object(c.jsx)(Q.a,{caret:!0,className:v,color:"primary",children:t}),Object(c.jsx)(J.a,{className:"w-100",right:u,children:i})]})},$=r(309),ee=function(e,t){return e&&function(e){return"function"===typeof e.format}(e)?e.format(t):e},te=function(e){return ee(e,void 0)},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"YYYY-MM-DD";return function(t){return ee(t,e)}}(),ne=function(e){return void 0===e||Object(k.a)(Object($.a)(Boolean,e))},ae=function(e){return"string"===typeof e},ce={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180days:"Last 180 days",last365Days:"Last 365 days"},se=Object.keys(ce),ie=function(e){if(e)return ae(e)?ce[e]:function(e){if(e&&!ne(e))return e.startDate&&!e.endDate?"Since ".concat(re(e.startDate)):!e.startDate&&e.endDate?"Until ".concat(re(e.endDate)):"".concat(re(e.startDate)," - ").concat(re(e.endDate))}(e)},oe=function(e){if(!e)return{};switch(e){case"today":return{startDate:B()().startOf("day"),endDate:B()()};case"yesterday":var t=B()().subtract(1,"day");return{startDate:t.startOf("day"),endDate:t.endOf("day")};case"last7Days":return{startDate:B()().subtract(7,"days").startOf("day"),endDate:B()()};case"last30Days":return{startDate:B()().subtract(30,"days").startOf("day"),endDate:B()()};case"last90Days":return{startDate:B()().subtract(90,"days").startOf("day"),endDate:B()()};case"last180days":return{startDate:B()().subtract(180,"days").startOf("day"),endDate:B()()};case"last365Days":return{startDate:B()().subtract(365,"days").startOf("day"),endDate:B()()}}return{}},le=r(659),ue=r(288),de=r.n(ue),je=r(98),be=function(e){var t,r,n,a,c;return Object(u.a)(Object(u.a)({},Object(le.a)("ref",e)),{},{endDate:null===(t=e.endDate)||void 0===t?void 0:t.toDate(),maxDate:null===(r=e.maxDate)||void 0===r?void 0:r.toDate(),minDate:null===(n=e.minDate)||void 0===n?void 0:n.toDate(),selected:null===(a=e.selected)||void 0===a?void 0:a.toDate(),startDate:null===(c=e.startDate)||void 0===c?void 0:c.toDate(),onChange:function(t){var r;return null===(r=e.onChange)||void 0===r?void 0:r.call(e,t&&B()(t))}})},he=function(e){var t=e.className,r=e.isClearable,n=e.selected,a=!r||Object(_.a)(n),s=Object(h.useRef)();return Object(c.jsxs)("div",{className:"date-input-container",children:[Object(c.jsx)(de.a,Object(u.a)(Object(u.a)({},be(e)),{},{dateFormat:"yyyy-MM-dd",className:Y()("date-input-container__input form-control",t),ref:s})),a&&Object(c.jsx)(M.a,{icon:je.a,className:"date-input-container__icon",onClick:function(){var e;return null===(e=s.current)||void 0===e?void 0:e.input.focus()}})]})},ve=function(e){var t=e.startDate,r=void 0===t?null:t,n=e.endDate,a=void 0===n?null:n,s=e.disabled,i=void 0!==s&&s,o=e.onStartDateChange,l=e.onEndDateChange;return Object(c.jsxs)("div",{className:"row",children:[Object(c.jsx)("div",{className:"col-md-6",children:Object(c.jsx)(he,{selected:r,placeholderText:"Since...",isClearable:!0,maxDate:null!==a&&void 0!==a?a:void 0,disabled:i,onChange:o})}),Object(c.jsx)("div",{className:"col-md-6",children:Object(c.jsx)(he,{className:"mt-2 mt-md-0",selected:a,placeholderText:"Until...",isClearable:!0,minDate:null!==r&&void 0!==r?r:void 0,disabled:i,onChange:l})})]})},Oe=function(e){var t=e.active,r=e.onChange;return Object(c.jsx)(c.Fragment,{children:se.map((function(e){return Object(c.jsx)(z.a,{active:t===e,onClick:function(){return r(e)},children:ie(e)},e)}))})},fe=function(e){var t,r=e.onDatesChange,n=e.initialDateRange,a=e.defaultText,s=e.disabled,i=Object(h.useState)(ae(n)?n:void 0),o=Object(I.a)(i,2),l=o[0],d=o[1],j=Object(h.useState)(ae(n)?void 0:n),b=Object(I.a)(j,2),v=b[0],O=b[1],f=function(e){d(void 0),O(e),r(e)},m=function(e){return function(){d(e),O(void 0),r(oe(e))}};return Object(c.jsxs)(X,{disabled:s,text:null!==(t=ie(null!==l&&void 0!==l?l:v))&&void 0!==t?t:a,children:[Object(c.jsx)(z.a,{active:void 0===l&&ne(v),onClick:m(void 0),children:a}),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(Oe,{active:l,onChange:function(e){return m(e)()}}),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(z.a,{header:!0,children:"Custom:"}),Object(c.jsx)(z.a,{text:!0,children:Object(c.jsx)(ve,Object(u.a)(Object(u.a)({},v),{},{onStartDateChange:function(e){return f(Object(u.a)(Object(u.a)({},v),{},{startDate:e}))},onEndDateChange:function(e){return f(Object(u.a)(Object(u.a)({},v),{},{endDate:e}))}}))})]})},me=function(e){return e?B()(e):null},ge=function(e){return function(t){var r,n=t.listShortUrls,a=t.shortUrlsListParams,s=null!==(r=a.tags)&&void 0!==r?r:[],i=Object(G.a)((function(e){var t,r,n=e.startDate,a=e.endDate;return{startDate:null!==(t=te(n))&&void 0!==t?t:void 0,endDate:null!==(r=te(a))&&void 0!==r?r:void 0}}),(function(e){return n(Object(u.a)(Object(u.a)({},a),e))}));return Object(c.jsxs)("div",{className:"search-bar-container",children:[Object(c.jsx)(q,{onChange:function(e){return n(Object(u.a)(Object(u.a)({},a),{},{searchTerm:e}))}}),Object(c.jsx)("div",{className:"mt-3",children:Object(c.jsx)("div",{className:"row",children:Object(c.jsx)("div",{className:"col-lg-8 offset-lg-4 col-xl-6 offset-xl-6",children:Object(c.jsx)(fe,{defaultText:"All short URLs",initialDateRange:{startDate:me(a.startDate),endDate:me(a.endDate)},onDatesChange:i})})})}),!Object(k.a)(s)&&Object(c.jsxs)("h4",{className:"search-bar__selected-tag mt-3",children:[Object(c.jsx)(M.a,{icon:A.G,className:"search-bar__tags-icon"}),"\xa0",s.map((function(t){return Object(c.jsx)(W,{colorGenerator:e,text:t,clearable:!0,onClose:function(){return n(Object(u.a)(Object(u.a)({},a),{},{tags:s.filter((function(e){return e!==t}))}))}},t)}))]})]})}},pe=r(30),xe=r(670),Se=r(50),ye=r(656),Ce=r(318),Ne=r(661),Ue=r(662),_e=r(26);function ke(e){var t=e.items,r=e.orderField,n=e.orderDir,a=e.onChange,s=e.isButton,i=void 0===s||s,o=e.right,l=void 0!==o&&o,u=function(e){return function(){var t=Object(_e.a)(e,r,n);a(t?e:void 0,t)}};return Object(c.jsxs)(Ne.a,{children:[Object(c.jsxs)(Q.a,{caret:!0,color:i?"primary":"link",className:Y()({"dropdown-btn__toggle btn-block":i,"btn-sm p-0":!i}),children:[!i&&Object(c.jsx)(c.Fragment,{children:"Order by"}),i&&!r&&Object(c.jsx)(c.Fragment,{children:"Order by..."}),i&&r&&'Order by: "'.concat(t[r],'" - "').concat(null!==n&&void 0!==n?n:"DESC",'"')]}),Object(c.jsxs)(J.a,{right:l,className:Y()("w-100",{"sorting-dropdown__menu--link":!i}),children:[Object(Ue.a)(t).map((function(e){var t=Object(I.a)(e,2),a=t[0],s=t[1];return Object(c.jsxs)(z.a,{active:r===a,onClick:u(a),children:[s,r===a&&Object(c.jsx)(M.a,{icon:"ASC"===n?A.E:A.D,className:"sorting-dropdown__sort-icon"})]},a)})),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(z.a,{disabled:!r,onClick:function(){return a()},children:Object(c.jsx)("i",{children:"Clear selection"})})]})]})}var we=r(289);function Te(e,t){var r=new Set;return function(n){var a=n.createNewVisits,s=n.loadMercureInfo,i=n.mercureInfo,o=i.interval;return Object(h.useEffect)((function(){var e=function(e,t,r,n){var a=e.mercureHubUrl,c=e.token,s=e.loading,i=e.error;if(!s&&!i&&a){var o=function(e){var t=e.data;return r(JSON.parse(t))},l=function(e){return 401===e.status&&n()},u=t.map((function(e){var t=new URL(a);t.searchParams.append("topic",e);var r=new we.EventSourcePolyfill(t,{headers:{Authorization:"Bearer ".concat(c)}});return r.onmessage=o,r.onerror=l,r}));return function(){return u.forEach((function(e){return e.close()}))}}}(i,t(n),(function(e){return o?r.add(e):a([e])}),s);if(!o)return e;var c=setInterval((function(){a(Object(pe.a)(r)),r.clear()}),1e3*o*60);return Object(G.a)((function(){return clearInterval(c)}),(function(){return null===e||void 0===e?void 0:e()}))}),[i]),Object(c.jsx)(e,Object(u.a)({},n))}}var Re=function(e){return N.a.parse(e,{ignoreQueryPrefix:!0})},De=function e(){Object(y.a)(this,e)};De.visits=function(){return"https://shlink.io/new-visit"},De.shortUrlVisits=function(e){return"https://shlink.io/new-visit/".concat(e)},De.orphanVisits=function(){return"https://shlink.io/new-orphan-visit"};var Ee,Ve=function(e,t){return function(r,n){var a=n.type,c=e[a],s=null!==r&&void 0!==r?r:t;return c?c(s,n):s}},Le=function(e){return function(){return{type:e}}},Ie=r(663),Fe=r(664),Ae=r(290),Me=r(665),Ge=function(e,t,r){return Object(_.a)(r)?e.shortCode===t&&!e.domain:e.shortCode===t&&e.domain===r},Pe="shlink/visitCreation/CREATE_VISITS",Be=function(e){return{type:Pe,createdVisits:e}},He=function(e){var t;return null===(t=e.response)||void 0===t?void 0:t.data},Ye=function(e){return"INVALID_SHORTCODE_DELETION"===(null===e||void 0===e?void 0:e.type)},qe="shlink/deleteShortUrl/DELETE_SHORT_URL_START",We="shlink/deleteShortUrl/DELETE_SHORT_URL_ERROR",ze="shlink/deleteShortUrl/SHORT_URL_DELETED",Ke="shlink/deleteShortUrl/RESET_DELETE_SHORT_URL",Qe={shortCode:"",loading:!1,error:!1},Je=Ve({[qe]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loading:!0,error:!1})},[We]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},e),{},{errorData:r,loading:!1,error:!0})},[ze]:function(e,t){var r=t.shortCode;return Object(u.a)(Object(u.a)({},e),{},{shortCode:r,loading:!1,error:!1})},[Ke]:function(){return Qe}},Qe),Ze=function(e){return function(t,r){return function(){var n=Object(S.a)(x.a.mark((function n(a,c){var s,i;return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a({type:qe}),s=e(c),i=s.deleteShortUrl,n.prev=2,n.next=5,i(t,r);case 5:a({type:ze,shortCode:t,domain:r}),n.next=12;break;case 8:throw n.prev=8,n.t0=n.catch(2),a({type:We,errorData:He(n.t0)}),n.t0;case 12:case"end":return n.stop()}}),n,null,[[2,8]])})));return function(e,t){return n.apply(this,arguments)}}()}},Xe=Le(Ke),$e="shlink/createShortUrl/CREATE_SHORT_URL_START",et="shlink/createShortUrl/CREATE_SHORT_URL_ERROR",tt="shlink/createShortUrl/CREATE_SHORT_URL",rt="shlink/createShortUrl/RESET_CREATE_SHORT_URL",nt={result:null,saving:!1,error:!1},at=Ve({[$e]:function(e){return Object(u.a)(Object(u.a)({},e),{},{saving:!0,error:!1})},[et]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},e),{},{saving:!1,error:!0,errorData:r})},[tt]:function(e,t){return{result:t.result,saving:!1,error:!1}},[rt]:function(){return nt}},nt),ct=function(e){return function(t){return function(){var r=Object(S.a)(x.a.mark((function r(n,a){var c,s,i;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n({type:$e}),c=e(a),s=c.createShortUrl,r.prev=2,r.next=5,s(t);case 5:i=r.sent,n({type:tt,result:i}),r.next=13;break;case 9:throw r.prev=9,r.t0=r.catch(2),n({type:et,errorData:He(r.t0)}),r.t0;case 13:case"end":return r.stop()}}),r,null,[[2,9]])})));return function(e,t){return r.apply(this,arguments)}}()}},st=Le(rt),it=r(45),ot="shlink/shortUrlEdition/EDIT_SHORT_URL_START",lt="shlink/shortUrlEdition/EDIT_SHORT_URL_ERROR",ut="shlink/shortUrlEdition/SHORT_URL_EDITED",dt=Ve({[ot]:function(e){return Object(u.a)(Object(u.a)({},e),{},{saving:!0,error:!1})},[lt]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},e),{},{saving:!1,error:!0,errorData:r})},[ut]:function(e,t){return{shortUrl:t.shortUrl,saving:!1,error:!1}}},{saving:!1,error:!1}),jt=function(e){return function(t,r,n){return function(){var a=Object(S.a)(x.a.mark((function a(c,s){var i,o,l,u,d,j,b,h,v;return x.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return c({type:ot}),i=s(),o=i.selectedServer,l=!Object(it.i)(o),u=e(s),d=u.updateShortUrl,j=u.updateShortUrlTags,a.prev=4,a.next=7,Promise.all([d(t,r,n),l&&n.tags?j(t,r,n.tags):void 0]);case 7:b=a.sent,h=Object(I.a)(b,1),v=h[0],c({shortUrl:v,type:ut}),a.next=17;break;case 13:throw a.prev=13,a.t0=a.catch(4),c({type:lt,errorData:He(a.t0)}),a.t0;case 17:case"end":return a.stop()}}),a,null,[[4,13]])})));return function(e,t){return a.apply(this,arguments)}}()}},bt="shlink/shortUrlsList/LIST_SHORT_URLS_START",ht="shlink/shortUrlsList/LIST_SHORT_URLS_ERROR",vt="shlink/shortUrlsList/LIST_SHORT_URLS",Ot=Ve({[bt]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loading:!0,error:!1})},[ht]:function(){return{loading:!1,error:!0}},[vt]:function(e,t){return{loading:!1,error:!1,shortUrls:t.shortUrls}},[ze]:Object(G.a)((function(e,t){var r=t.shortCode,n=t.domain;return e.shortUrls?Object(Ie.a)(["shortUrls","data"],Object(U.a)((function(e){return Ge(e,r,n)}),e.shortUrls.data),e):e}),(function(e){return e.shortUrls?Object(Ie.a)(["shortUrls","pagination","totalItems"],e.shortUrls.pagination.totalItems-1,e):e})),[Pe]:function(e,t){var r,n,a=t.createdVisits;return Object(Ie.a)(["shortUrls","data"],null===(r=e.shortUrls)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.map((function(e){var t=Object(Fe.a)(a.filter((function(t){var r=t.shortUrl;return r&&Ge(e,r.shortCode,r.domain)})));return null!==t&&void 0!==t&&t.shortUrl?Object(Ae.a)("visitsCount",t.shortUrl.visitsCount,e):e})),e)},[tt]:Object(G.a)((function(e,t){var r=t.result;return e.shortUrls?Object(Ie.a)(["shortUrls","data"],[r].concat(Object(pe.a)(Object(Me.a)(e.shortUrls.data))),e):e}),(function(e){return e.shortUrls?Object(Ie.a)(["shortUrls","pagination","totalItems"],e.shortUrls.pagination.totalItems+1,e):e})),[ut]:function(e,t){var r=t.shortUrl;return e.shortUrls?Object(Ie.a)(["shortUrls","data"],e.shortUrls.data.map((function(e){var t=r.shortCode,n=r.domain;return Ge(e,t,n)?r:e})),e):e}},{loading:!0,error:!1}),ft=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var r=Object(S.a)(x.a.mark((function r(n,a){var c,s,i;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n({type:bt}),c=e(a),s=c.listShortUrls,r.prev=2,r.next=5,s(t);case 5:i=r.sent,n({type:vt,shortUrls:i,params:t}),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(2),n({type:ht,params:t});case 12:case"end":return r.stop()}}),r,null,[[2,9]])})));return function(e,t){return r.apply(this,arguments)}}()}},mt="shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS",gt={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},pt={page:"1",orderBy:{dateCreated:"DESC"}},xt=Ve({[vt]:function(e,t){var r=t.params;return Object(u.a)(Object(u.a)({},e),r)},[mt]:function(){return pt}},pt),St=Le(mt),yt=r(667),Ct=r(668),Nt=r(669),Ut=r(643),_t=r(291),kt=r(666),wt=Math.ceil,Tt=new Intl.NumberFormat("en-US"),Rt=function(e){return Tt.format(e)},Dt="...",Et=function(e,t){var r=Object(Ut.a)(Object(_t.a)(2,e-2),Object(kt.a)(t-1,e+2)+1);return e-2>2&&r.unshift(Dt),e+2=l,children:Object(c.jsx)(Ct.a,{next:!0,tag:o.b,to:"/server/".concat(r,"/list-short-urls/").concat(s+1)})})]})},At=function(e){return Te((function(t){var r,n=t.listShortUrls,a=t.resetShortUrlParams,s=t.shortUrlsListParams,i=t.match,o=t.location,l=t.shortUrlsList,d=t.selectedServer,j=s.orderBy,b=Object(h.useState)({orderField:j&&Object(xe.a)(Object(Se.a)(j)),orderDir:j&&Object(xe.a)(Object(ye.a)(j))}),v=Object(I.a)(b,2),O=v[0],f=v[1],m=(null!==(r=null===l||void 0===l?void 0:l.shortUrls)&&void 0!==r?r:{}).pagination,p=function(e){return n(Object(u.a)(Object(u.a)({},s),e))},x=function(e,t){f({orderField:e,orderDir:t}),p({orderBy:e?{[e]:t}:void 0})};return Object(h.useEffect)((function(){var e=Re(o.search).tag,t=e?[e]:s.tags;return p({page:i.params.page,tags:t,itemsPerPage:void 0}),a}),[]),Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("div",{className:"d-block d-lg-none mb-3",children:Object(c.jsx)(ke,{items:gt,orderField:O.orderField,orderDir:O.orderDir,onChange:x})}),Object(c.jsxs)(Ce.a,{body:!0,className:"pb-1",children:[Object(c.jsx)(e,{orderByColumn:function(e){return function(){return x(e,Object(_e.a)(e,O.orderField,O.orderDir))}},renderOrderIcon:function(e){return O.orderField!==e?null:O.orderDir?Object(c.jsx)(M.a,{icon:"ASC"===O.orderDir?A.e:A.d,className:"short-urls-list__header-icon"}):null},selectedServer:d,shortUrlsList:l,onTagClick:function(e){var t;return p({tags:[].concat(Object(pe.a)(null!==(t=s.tags)&&void 0!==t?t:[]),[e])})}}),Object(c.jsx)(Ft,{paginator:m,serverId:Object(g.c)(d)?d.id:""})]})]})}),(function(){return[De.visits()]}))},Mt=r(82),Gt=r.n(Mt),Pt=r(44),Bt=r(151),Ht=r.n(Bt),Yt=function(e){var t=e.text,r=e.onCopy;return Object(c.jsx)(Ht.a,{text:t,onCopy:r,children:Object(c.jsx)(M.a,{icon:je.b,className:"ml-2 copy-to-clipboard-icon"})})},qt=r(671),Wt=r(31),zt=function(e,t,r){var n=e.id,a=t.shortCode,c=t.domain,s=c?"?domain=".concat(c):"";return"/server/".concat(n,"/short-code/").concat(a,"/").concat(r).concat(s)},Kt=function(e){var t=e.selectedServer,r=e.shortUrl,n=e.suffix,a=e.children,s=Object(Wt.a)(e,["selectedServer","shortUrl","suffix","children"]);return t&&Object(g.d)(t)&&r?Object(c.jsx)(o.b,Object(u.a)(Object(u.a)({to:zt(t,r,n)},s),{},{children:a})):Object(c.jsx)("span",Object(u.a)(Object(u.a)({},s),{},{children:a}))},Qt=function(e){var t,r=e.visitsCount,n=e.shortUrl,a=e.selectedServer,s=e.active,i=void 0!==s&&s,o=null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.maxVisits,l=Object(c.jsx)(Kt,{selectedServer:a,shortUrl:n,suffix:"visits",children:Object(c.jsx)("strong",{className:Y()("short-url-visits-count__amount",{"short-url-visits-count__amount--big":i}),children:Rt(r)})});if(!o)return l;var u=Rt(o),d=Object(h.useRef)();return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsxs)("span",{className:"indivisible",children:[l,Object(c.jsxs)("small",{className:"short-urls-visits-count__max-visits-control",ref:function(e){d.current=e},children:[" ","/ ",u," ",Object(c.jsx)("sup",{children:Object(c.jsx)(M.a,{icon:A.q})})]})]}),Object(c.jsxs)(qt.a,{target:function(){return d.current},placement:"bottom",children:["This short URL will not accept more than ",Object(c.jsx)("b",{children:u})," visits."]})]})},Jt=function(e,t,r){return function(n){var a,s,i=n.shortUrl,o=n.selectedServer,l=n.onTagClick,u=r(),d=Object(I.a)(u,2),j=d[0],b=d[1],v=r(!1,500),O=Object(I.a)(v,2),f=O[0],m=O[1],g=Object(h.useRef)(!0);return Object(h.useEffect)((function(){g.current?g.current=!1:m()}),[i.visitsCount]),Object(c.jsxs)("tr",{className:"short-urls-row",children:[Object(c.jsx)("td",{className:"indivisible short-urls-row__cell","data-th":"Created at: ",children:Object(c.jsx)(Gt.a,{format:"YYYY-MM-DD HH:mm",children:i.dateCreated})}),Object(c.jsx)("td",{className:"short-urls-row__cell","data-th":"Short URL: ",children:Object(c.jsxs)("span",{className:"indivisible short-urls-row__cell--relative",children:[Object(c.jsx)(Pt.a,{href:i.shortUrl}),Object(c.jsx)(Yt,{text:i.shortUrl,onCopy:b}),Object(c.jsx)("span",{className:"badge badge-warning short-urls-row__copy-hint",hidden:!j,children:"Copied short URL!"})]})}),Object(c.jsx)("td",{className:"short-urls-row__cell short-urls-row__cell--break","data-th":"".concat(i.title?"Title":"Long URL",": "),children:Object(c.jsx)(Pt.a,{href:i.longUrl,children:null!==(a=i.title)&&void 0!==a?a:i.longUrl})}),i.title&&Object(c.jsx)("td",{className:"short-urls-row__cell d-lg-none","data-th":"Long URL: ",children:Object(c.jsx)(Pt.a,{href:i.longUrl})}),Object(c.jsx)("td",{className:"short-urls-row__cell","data-th":"Tags: ",children:(s=i.tags,Object(k.a)(s)?Object(c.jsx)("i",{className:"indivisible",children:Object(c.jsx)("small",{children:"No tags"})}):s.map((function(e){return Object(c.jsx)(W,{colorGenerator:t,text:e,onClick:function(){return null===l||void 0===l?void 0:l(e)}},e)})))}),Object(c.jsx)("td",{className:"short-urls-row__cell text-md-right","data-th":"Visits: ",children:Object(c.jsx)(Qt,{visitsCount:i.visitsCount,shortUrl:i,selectedServer:o,active:f})}),Object(c.jsx)("td",{className:"short-urls-row__cell",children:Object(c.jsx)(e,{selectedServer:o,shortUrl:i})})]})}},Zt=r(672),Xt=function(e,t){return function(r){var n=r.shortUrl,a=r.selectedServer,s=Object(Z.c)(),i=Object(I.a)(s,2),o=i[0],l=i[1],u=Object(Z.c)(),d=Object(I.a)(u,2),j=d[0],b=d[1],h=Object(Z.c)(),v=Object(I.a)(h,2),O=v[0],f=v[1];return Object(c.jsxs)(Zt.a,{toggle:l,isOpen:o,children:[Object(c.jsxs)(Q.a,{size:"sm",caret:!0,outline:!0,className:"short-urls-row-menu__dropdown-toggle",children:["\xa0",Object(c.jsx)(M.a,{icon:A.m}),"\xa0"]}),Object(c.jsxs)(J.a,{right:!0,children:[Object(c.jsxs)(z.a,{tag:Kt,selectedServer:a,shortUrl:n,suffix:"visits",children:[Object(c.jsx)(M.a,{icon:A.f,fixedWidth:!0})," Visit stats"]}),Object(c.jsxs)(z.a,{tag:Kt,selectedServer:a,shortUrl:n,suffix:"edit",children:[Object(c.jsx)(M.a,{icon:A.l,fixedWidth:!0})," Edit short URL"]}),Object(c.jsxs)(z.a,{onClick:b,children:[Object(c.jsx)(M.a,{icon:A.A,fixedWidth:!0})," QR code"]}),Object(c.jsx)(t,{shortUrl:n,isOpen:j,toggle:b}),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsxs)(z.a,{className:"short-urls-row-menu__dropdown-item--danger",onClick:f,children:[Object(c.jsx)(M.a,{icon:A.u,fixedWidth:!0})," Delete short URL"]}),Object(c.jsx)(e,{shortUrl:n,isOpen:O,toggle:f})]})]})}},$t=function(e,t){return function(r){var n=r.createShortUrl,a=r.shortUrlCreationResult,s=r.resetCreateShortUrl,i=r.selectedServer,o=r.basicMode,l=void 0!==o&&o,d=r.settings.shortUrlCreation,j=Object(h.useMemo)((function(){return function(e){var t;return{longUrl:"",tags:[],customSlug:"",title:void 0,shortCodeLength:void 0,domain:"",validSince:void 0,validUntil:void 0,maxVisits:void 0,findIfExists:!1,validateUrl:null!==(t=null===e||void 0===e?void 0:e.validateUrls)&&void 0!==t&&t}}(d)}),[d]);return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(e,{initialState:j,saving:a.saving,selectedServer:i,mode:l?"create-basic":"create",onSave:function(){var e=Object(S.a)(x.a.mark((function e(t){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(),e.abrupt("return",n(t));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),Object(c.jsx)(t,Object(u.a)(Object(u.a)({},a),{},{resetCreateShortUrl:s,canBeClosed:l}))]})}},er=r(705),tr=r(673),rr=r(674),nr=r(675),ar=r(644),cr=r(639),sr=r(36),ir=function(e){var t=e.children,r=e.type,n=e.className,a=e.small,s=void 0!==a&&a;return Object(c.jsx)(cr.a,{className:n,children:Object(c.jsx)("div",{className:Y()({"col-md-10 offset-md-1":!s,"col-12":s}),children:Object(c.jsx)(sr.a,{className:Y()("text-center",{"bg-main":"success"===r,"bg-danger":"error"===r,"bg-warning":"warning"===r,"text-white":"warning"!==r}),bodyClassName:Y()({"p-2":s}),children:t})})})},or=function(e){var t,r,n=e.errorData,a=e.fallbackMessage;return Object(c.jsxs)(c.Fragment,{children:[null!==(t=null===n||void 0===n?void 0:n.detail)&&void 0!==t?t:a,(r=n,"INVALID_ARGUMENT"===(null===r||void 0===r?void 0:r.type)&&Object(c.jsxs)("p",{className:"mb-0",children:["Invalid elements: [",n.invalidElements.join(", "),"]"]}))]})},lr=function(e){var t=e.shortUrl,r=e.toggle,n=e.isOpen,a=e.shortUrlDeletion,s=e.resetDeleteShortUrl,i=e.deleteShortUrl,o=Object(h.useState)(""),l=Object(I.a)(o,2),u=l[0],d=l[1];Object(h.useEffect)((function(){return s}),[]);var j=a.error,b=a.errorData,v=Object(G.a)(s,r),O=Object(_e.b)((function(){var e=t.shortCode,n=t.domain;i(e,n).then(r).catch(ar.a)}));return Object(c.jsx)(er.a,{isOpen:n,toggle:v,centered:!0,children:Object(c.jsxs)("form",{onSubmit:O,children:[Object(c.jsx)(tr.a,{toggle:v,children:Object(c.jsx)("span",{className:"text-danger",children:"Delete short URL"})}),Object(c.jsxs)(rr.a,{children:[Object(c.jsxs)("p",{children:[Object(c.jsx)("b",{className:"text-danger",children:"Caution!"})," You are about to delete a short URL."]}),Object(c.jsx)("p",{children:"This action cannot be undone. Once you have deleted it, all the visits stats will be lost."}),Object(c.jsxs)("p",{children:["Write ",Object(c.jsx)("b",{children:t.shortCode})," to confirm deletion."]}),Object(c.jsx)("input",{type:"text",className:"form-control",placeholder:"Insert the short code (".concat(t.shortCode,")"),value:u,onChange:function(e){return d(e.target.value)}}),j&&Object(c.jsx)(ir,{type:Ye(b)?"warning":"error",small:!0,className:"mt-2",children:Object(c.jsx)(or,{errorData:b,fallbackMessage:"Something went wrong while deleting the URL :("})})]}),Object(c.jsxs)(nr.a,{children:[Object(c.jsx)("button",{type:"button",className:"btn btn-link",onClick:v,children:"Cancel"}),Object(c.jsx)("button",{type:"submit",className:"btn btn-danger",disabled:u!==t.shortCode||a.loading,children:a.loading?"Deleting...":"Delete"})]})]})})},ur=r(211),dr=function(e){return function(t){var r=t.error,n=t.errorData,a=t.result,s=t.resetCreateShortUrl,i=t.canBeClosed,o=void 0!==i&&i,l=e(),u=Object(I.a)(l,2),d=u[0],j=u[1];if(Object(h.useEffect)((function(){s()}),[]),r)return Object(c.jsxs)(ir,{type:"error",className:"mt-3",children:[o&&Object(c.jsx)(M.a,{icon:A.H,className:"float-right pointer",onClick:s}),Object(c.jsx)(or,{errorData:n,fallbackMessage:"An error occurred while creating the URL :("})]});if(Object(_.a)(a))return null;var b=a.shortUrl;return Object(c.jsxs)(ir,{type:"success",className:"mt-3",children:[o&&Object(c.jsx)(M.a,{icon:A.H,className:"float-right pointer",onClick:s}),Object(c.jsx)("b",{children:"Great!"})," The short URL is ",Object(c.jsx)("b",{children:b}),Object(c.jsx)(Ht.a,{text:b,onCopy:j,children:Object(c.jsxs)("button",{className:"btn btn-light btn-sm create-short-url-result__copy-btn",id:"copyBtn",type:"button",children:[Object(c.jsx)(M.a,{icon:je.b})," Copy"]})}),Object(c.jsx)(ur.a,{placement:"left",isOpen:d,target:"copyBtn",children:"Copied!"})]})}},jr=function(e){return function(t){var r=t.orderByColumn,n=t.renderOrderIcon,a=t.shortUrlsList,s=t.onTagClick,i=t.selectedServer,o=t.className,l=a.error,u=a.loading,d=a.shortUrls,j=Y()({"short-urls-table__header-cell--with-action":!!r}),b=Y()("short-urls-table__header-cell",j),h=Y()("table table-hover",o),v=Object(it.g)(i);return Object(c.jsxs)("table",{className:h,children:[Object(c.jsx)("thead",{className:"short-urls-table__header",children:Object(c.jsxs)("tr",{children:[Object(c.jsxs)("th",{className:b,onClick:null===r||void 0===r?void 0:r("dateCreated"),children:["Created at",null===n||void 0===n?void 0:n("dateCreated")]}),Object(c.jsxs)("th",{className:b,onClick:null===r||void 0===r?void 0:r("shortCode"),children:["Short URL",null===n||void 0===n?void 0:n("shortCode")]}),!v&&Object(c.jsxs)("th",{className:b,onClick:null===r||void 0===r?void 0:r("longUrl"),children:["Long URL",null===n||void 0===n?void 0:n("longUrl")]})||Object(c.jsxs)("th",{className:"short-urls-table__header-cell",children:[Object(c.jsxs)("span",{className:j,onClick:null===r||void 0===r?void 0:r("title"),children:["Title",null===n||void 0===n?void 0:n("title")]}),"\xa0\xa0/\xa0\xa0",Object(c.jsxs)("span",{className:j,onClick:null===r||void 0===r?void 0:r("longUrl"),children:[Object(c.jsx)("span",{className:"indivisible",children:"Long URL"}),null===n||void 0===n?void 0:n("longUrl")]})]}),Object(c.jsx)("th",{className:"short-urls-table__header-cell",children:"Tags"}),Object(c.jsx)("th",{className:b,onClick:null===r||void 0===r?void 0:r("visits"),children:Object(c.jsxs)("span",{className:"indivisible",children:["Visits",null===n||void 0===n?void 0:n("visits")]})}),Object(c.jsx)("th",{className:"short-urls-table__header-cell",children:"\xa0"})]})}),Object(c.jsx)("tbody",{children:l?Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:6,className:"text-center table-danger",children:"Something went wrong while loading short URLs :("})}):u?Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!u&&Object(k.a)(null===d||void 0===d?void 0:d.data)?Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:6,className:"text-center",children:"No results found"})}):null===d||void 0===d?void 0:d.data.map((function(t){return Object(c.jsx)(e,{shortUrl:t,selectedServer:i,onTagClick:s},t.shortUrl)}))})]})}},br=r(676),hr=function(e,t,r){var n=t.size,a=t.format,c=t.margin,s=r.useSizeInPath,i=r.svgIsSupported,o=r.marginIsSupported,l="".concat(e,"/qr-code").concat(s?"/".concat(n):""),u=function(e){return N.a.stringify(e,{arrayFormat:"brackets"})}({size:s?void 0:n,format:i?a:void 0,margin:o&&c>0?c:void 0});return"".concat(l).concat(Object(k.a)(u)?"":"?".concat(u))},vr=function(e){var t=e.shortUrl.shortUrl,r=e.toggle,n=e.isOpen,a=e.selectedServer,s=Object(h.useState)(300),i=Object(I.a)(s,2),o=i[0],l=i[1],u=Object(h.useState)(0),d=Object(I.a)(u,2),j=d[0],b=d[1],v=Object(h.useState)("png"),O=Object(I.a)(v,2),f=O[0],m=O[1],g=Object(h.useMemo)((function(){return{useSizeInPath:!Object(it.d)(a),svgIsSupported:Object(it.e)(a),marginIsSupported:Object(it.c)(a)}}),[a]),p=Object(h.useMemo)((function(){return hr(t,{size:o,format:f,margin:j},g)}),[t,o,f,j,g]),x=Object(h.useMemo)((function(){return o+j}),[o,j]),S=Object(h.useMemo)((function(){if(!(x<500))return x<800?"lg":"xl"}),[x]);return Object(c.jsxs)(er.a,{isOpen:n,toggle:r,centered:!0,size:S,children:[Object(c.jsxs)(tr.a,{toggle:r,children:["QR code for ",Object(c.jsx)(Pt.a,{href:t,children:t})]}),Object(c.jsxs)(rr.a,{children:[Object(c.jsxs)(cr.a,{className:"mb-2",children:[Object(c.jsx)("div",{className:Y()({"col-md-4":g.marginIsSupported&&g.svgIsSupported,"col-md-6":!g.marginIsSupported&&g.svgIsSupported||g.marginIsSupported&&!g.svgIsSupported,"col-12":!g.marginIsSupported&&!g.svgIsSupported}),children:Object(c.jsxs)(br.a,{children:[Object(c.jsxs)("label",{className:"mb-0",children:["Size: ",o,"px"]}),Object(c.jsx)("input",{type:"range",className:"form-control-range",value:o,step:10,min:50,max:1e3,onChange:function(e){return l(Number(e.target.value))}})]})}),g.marginIsSupported&&Object(c.jsx)("div",{className:g.svgIsSupported?"col-md-4":"col-md-6",children:Object(c.jsxs)(br.a,{children:[Object(c.jsxs)("label",{className:"mb-0",children:["Margin: ",j,"px"]}),Object(c.jsx)("input",{type:"range",className:"form-control-range",value:j,step:1,min:0,max:100,onChange:function(e){return b(Number(e.target.value))}})]})}),g.svgIsSupported&&Object(c.jsx)("div",{className:g.marginIsSupported?"col-md-4":"col-md-6",children:Object(c.jsxs)(X,{text:"Format (".concat(f,")"),children:[Object(c.jsx)(z.a,{active:"png"===f,onClick:function(){return m("png")},children:"PNG"}),Object(c.jsx)(z.a,{active:"svg"===f,onClick:function(){return m("svg")},children:"SVG"})]})})]}),Object(c.jsxs)("div",{className:"text-center",children:[Object(c.jsxs)("div",{className:"mb-3",children:[Object(c.jsx)("div",{children:"QR code URL:"}),Object(c.jsx)(Pt.a,{href:p}),Object(c.jsx)(Yt,{text:p})]}),Object(c.jsx)("img",{src:p,className:"qr-code-modal__img",alt:"QR code"}),Object(c.jsxs)("div",{className:"mt-2",children:[o,"x",o]})]})]})]})},Or=r(679),fr=r(208),mr=r(677),gr=r(678),pr=r(701),xr=function(e){var t=e.checked,r=void 0!==t&&t,n=e.onChange,a=void 0===n?ar.a:n,s=e.className,i=e.children,o=e.type,l=e.inline,u=void 0!==l&&l,d=Object(h.useRef)(Object(pr.a)()).current,j={"custom-switch":"switch"===o,"custom-checkbox":"checkbox"===o},b=u?{display:"inline-block"}:{};return Object(c.jsxs)("span",{className:Y()("custom-control",j,s),style:b,children:[Object(c.jsx)("input",{type:"checkbox",className:"custom-control-input",id:d,checked:r,onChange:function(e){return a(e.target.checked,e)}}),Object(c.jsx)("label",{className:"custom-control-label",htmlFor:d,children:i})]})},Sr=function(e){return Object(c.jsx)(xr,Object(u.a)({type:"checkbox"},e))},yr=function(e){var t=e.isOpen,r=e.toggle;return Object(c.jsxs)(er.a,{isOpen:t,toggle:r,centered:!0,size:"lg",children:[Object(c.jsx)(tr.a,{toggle:r,children:"Info"}),Object(c.jsxs)(rr.a,{children:[Object(c.jsxs)("p",{children:["When the\xa0",Object(c.jsx)("b",{children:Object(c.jsx)("i",{children:'"Use existing URL if found"'})}),"\xa0checkbox is checked, the server will return an existing short URL if it matches provided params."]}),Object(c.jsx)("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),Object(c.jsxs)("ul",{children:[Object(c.jsx)("li",{children:"When only the long URL is provided: The most recent match will be returned, or a new short URL will be created if none is found."}),Object(c.jsxs)("li",{children:["When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.",Object(c.jsx)("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),Object(c.jsx)("li",{children:"When other params are provided: Same as in previous cases, but it will try to match existing short URLs with all provided data. If any of them does not match, a new short URL will be created"})]})]})]})},Cr=function(){var e=Object(Z.c)(),t=Object(I.a)(e,2),r=t[0],n=t[1];return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("span",{title:"What does this mean?",children:Object(c.jsx)(M.a,{icon:A.q,style:{cursor:"pointer"},onClick:n})}),Object(c.jsx)(yr,{isOpen:r,toggle:n})]})},Nr=Object(G.a)(mr.a,Object(gr.a)(/ /g,"-")),Ur=function(e,t){return function(r){var n,a=r.mode,s=r.saving,i=r.onSave,o=r.initialState,l=r.selectedServer,d=Object(h.useState)(o),j=Object(I.a)(d,2),b=j[0],v=j[1],O="edit"===a,f=Object(_e.b)(Object(S.a)(x.a.mark((function e(){var t,r;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i(Object(u.a)(Object(u.a)({},b),{},{validSince:null!==(t=te(b.validSince))&&void 0!==t?t:null,validUntil:null!==(r=te(b.validUntil))&&void 0!==r?r:null,maxVisits:Object(_e.c)(b.maxVisits)?Number(b.maxVisits):null,title:Object(_e.c)(b.title)?b.title:void 0})).then((function(){return!O&&v(o)})).catch((function(){})));case 1:case"end":return e.stop()}}),e)}))));Object(h.useEffect)((function(){v(o)}),[o]);var m=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"text",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Object(c.jsx)(br.a,{children:Object(c.jsx)(Or.a,Object(u.a)({id:e,type:n,placeholder:t,value:null!==(r=b[e])&&void 0!==r?r:"",onChange:function(t){return v(Object(u.a)(Object(u.a)({},b),{},{[e]:t.target.value}))}},a))})},g=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(c.jsx)("div",{className:"form-group",children:Object(c.jsx)(he,Object(u.a)({selected:b[e]?B()(b[e]):null,placeholderText:t,isClearable:!0,onChange:function(t){return v(Object(u.a)(Object(u.a)({},b),{},{[e]:t}))}},r))})},p=Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(br.a,{children:Object(c.jsx)(Or.a,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:b.longUrl,onChange:function(e){return v(Object(u.a)(Object(u.a)({},b),{},{longUrl:e.target.value}))}})}),Object(c.jsx)(br.a,{children:Object(c.jsx)(e,{tags:null!==(n=b.tags)&&void 0!==n?n:[],onChange:function(e){return v(Object(u.a)(Object(u.a)({},b),{},{tags:e.map(Nr)}))}})})]}),y=Object(it.a)(l),C=!Object(it.f)(l),N=Object(it.g)(l),U=N||!O,_=Y()("mb-3",{"col-sm-6":U,"col-sm-12":!U}),w=Object(it.j)(l),T=w||!O;return Object(c.jsxs)("form",{className:"short-url-form",onSubmit:f,children:["create-basic"===a&&p,"create-basic"!==a&&Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(sr.a,{title:"Basic options",className:"mb-3",children:p}),Object(c.jsxs)(cr.a,{children:[U&&Object(c.jsx)("div",{className:"col-sm-6 mb-3",children:Object(c.jsxs)(sr.a,{title:"Customize the short URL",children:[N&&m("title","Title"),!O&&Object(c.jsxs)(c.Fragment,{children:[Object(c.jsxs)(cr.a,{children:[Object(c.jsx)("div",{className:"col-lg-6",children:m("customSlug","Custom slug","text",{disabled:Object(_e.c)(b.shortCodeLength)})}),Object(c.jsx)("div",{className:"col-lg-6",children:m("shortCodeLength","Short code length","number",Object(u.a)({min:4,disabled:C||Object(_e.c)(b.customSlug)},C&&{title:"Shlink 2.1.0 or higher is required to be able to provide the short code length"}))})]}),!y&&m("domain","Domain","text"),y&&Object(c.jsx)(br.a,{children:Object(c.jsx)(t,{value:b.domain,onChange:function(e){return v(Object(u.a)(Object(u.a)({},b),{},{domain:e}))}})})]})]})}),Object(c.jsx)("div",{className:_,children:Object(c.jsxs)(sr.a,{title:"Limit access to the short URL",children:[m("maxVisits","Maximum number of visits allowed","number",{min:1}),g("validSince","Enabled since...",{maxDate:b.validUntil?B()(b.validUntil):void 0}),g("validUntil","Enabled until...",{minDate:b.validSince?B()(b.validSince):void 0})]})})]}),T&&Object(c.jsxs)(sr.a,{title:"Extra validations",className:"mb-3",children:[!O&&Object(c.jsx)("p",{children:"Make sure the long URL is valid, or ensure an existing short URL is returned if it matches all provided data."}),w&&Object(c.jsx)("p",{children:Object(c.jsx)(Sr,{inline:!0,checked:b.validateUrl,onChange:function(e){return v(Object(u.a)(Object(u.a)({},b),{},{validateUrl:e}))},children:"Validate URL"})}),!O&&Object(c.jsxs)("p",{children:[Object(c.jsx)(Sr,{inline:!0,className:"mr-2",checked:b.findIfExists,onChange:function(e){return v(Object(u.a)(Object(u.a)({},b),{},{findIfExists:e}))},children:"Use existing URL if found"}),Object(c.jsx)(Cr,{})]})]})]}),Object(c.jsx)("div",{className:"text-center",children:Object(c.jsx)(fr.a,{outline:!0,color:"primary",disabled:s||Object(k.a)(b.longUrl),className:"btn-xs-block",children:s?"Saving...":"Save"})})]})}},_r=r(47),kr=function(e){return function(t){var r,n=t.history.goBack,a=t.match.params,s=t.location.search,i=t.settings.shortUrlCreation,o=t.selectedServer,l=t.shortUrlDetail,u=t.getShortUrlDetail,d=t.shortUrlEdition,j=t.editShortUrl,b=l.loading,v=l.error,O=l.errorData,f=l.shortUrl,m=d.saving,g=d.error,p=d.errorData,y=Re(s).domain,C=Object(h.useMemo)((function(){return function(e,t){var r,n,a,c,s,i,o=null!==(r=null===t||void 0===t?void 0:t.validateUrls)&&void 0!==r&&r;return e?{longUrl:e.longUrl,tags:e.tags,title:null!==(n=e.title)&&void 0!==n?n:void 0,domain:null!==(a=e.domain)&&void 0!==a?a:void 0,validSince:null!==(c=e.meta.validSince)&&void 0!==c?c:void 0,validUntil:null!==(s=e.meta.validUntil)&&void 0!==s?s:void 0,maxVisits:null!==(i=e.meta.maxVisits)&&void 0!==i?i:void 0,validateUrl:o}:{longUrl:"",validateUrl:o}}(f,i)}),[f,i]),N=Object(Z.c)(),U=Object(I.a)(N,4),_=U[0],k=U[2],w=U[3];return Object(h.useEffect)((function(){u(a.shortCode,y)}),[]),b?Object(c.jsx)(_r.a,{loading:!0}):v?Object(c.jsx)(ir,{type:"error",children:Object(c.jsx)(or,{errorData:O,fallbackMessage:"An error occurred while loading short URL detail :("})}):Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("header",{className:"mb-3",children:Object(c.jsx)(Ce.a,{body:!0,children:Object(c.jsxs)("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[Object(c.jsx)(fr.a,{color:"link",size:"lg",className:"p-0 mr-3",onClick:n,children:Object(c.jsx)(M.a,{icon:A.a})}),Object(c.jsx)("span",{className:"text-center",children:Object(c.jsxs)("small",{children:["Edit ",Object(c.jsx)(Pt.a,{href:null!==(r=null===f||void 0===f?void 0:f.shortUrl)&&void 0!==r?r:""})]})}),Object(c.jsx)("span",{})]})})}),Object(c.jsx)(e,{initialState:C,saving:m,selectedServer:o,mode:"edit",onSave:function(){var e=Object(S.a)(x.a.mark((function e(t){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=2;break}return e.abrupt("return");case 2:w(),j(f.shortCode,f.domain,t).then(k).catch(w);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),g&&Object(c.jsx)(ir,{type:"error",className:"mt-3",children:Object(c.jsx)(or,{errorData:p,fallbackMessage:"An error occurred while updating short URL :("})}),_&&Object(c.jsx)(ir,{type:"success",className:"mt-3",children:"Short URL properly edited."})]})}},wr="shlink/shortUrlDetail/GET_SHORT_URL_DETAIL_START",Tr="shlink/shortUrlDetail/GET_SHORT_URL_DETAIL_ERROR",Rr="shlink/shortUrlDetail/GET_SHORT_URL_DETAIL",Dr={loading:!1,error:!1},Er=Ve({[wr]:function(){return{loading:!0,error:!1}},[Tr]:function(e,t){return{loading:!1,error:!0,errorData:t.errorData}},[Rr]:function(e,t){var r=t.shortUrl;return Object(u.a)({shortUrl:r},Dr)}},Dr),Vr=function(e){return function(t,r){return function(){var n=Object(S.a)(x.a.mark((function n(a,c){var s,i,o,l,u;return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a({type:wr}),n.prev=1,o=c(),l=o.shortUrlsList,null===(s=null===l||void 0===l||null===(i=l.shortUrls)||void 0===i?void 0:i.data.find((function(e){return Ge(e,t,r)})))||void 0===s){n.next=7;break}n.t0=s,n.next=10;break;case 7:return n.next=9,e(c).getShortUrl(t,r);case 9:n.t0=n.sent;case 10:u=n.t0,a({shortUrl:u,type:Rr}),n.next=17;break;case 14:n.prev=14,n.t1=n.catch(1),a({type:Tr,errorData:He(n.t1)});case 17:case"end":return n.stop()}}),n,null,[[1,14]])})));return function(e,t){return n.apply(this,arguments)}}()}},Lr=function(e,t){e.serviceFactory("ShortUrls",F,"SearchBar","ShortUrlsList"),e.decorator("ShortUrls",t(["shortUrlsList"])),e.serviceFactory("ShortUrlsList",At,"ShortUrlsTable"),e.decorator("ShortUrlsList",t(["selectedServer","shortUrlsListParams","mercureInfo"],["listShortUrls","resetShortUrlParams","createNewVisits","loadMercureInfo"])),e.serviceFactory("ShortUrlsTable",jr,"ShortUrlsRow"),e.serviceFactory("ShortUrlsRow",Jt,"ShortUrlsRowMenu","ColorGenerator","useStateFlagTimeout"),e.serviceFactory("ShortUrlsRowMenu",Xt,"DeleteShortUrlModal","QrCodeModal"),e.serviceFactory("CreateShortUrlResult",dr,"useStateFlagTimeout"),e.serviceFactory("ShortUrlForm",Ur,"TagsSelector","DomainSelector"),e.serviceFactory("CreateShortUrl",$t,"ShortUrlForm","CreateShortUrlResult"),e.decorator("CreateShortUrl",t(["shortUrlCreationResult","selectedServer","settings"],["createShortUrl","resetCreateShortUrl"])),e.serviceFactory("EditShortUrl",kr,"ShortUrlForm"),e.decorator("EditShortUrl",t(["shortUrlDetail","shortUrlEdition","selectedServer","settings"],["getShortUrlDetail","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",(function(){return lr})),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["deleteShortUrl","resetDeleteShortUrl"])),e.serviceFactory("QrCodeModal",(function(){return vr})),e.decorator("QrCodeModal",t(["selectedServer"])),e.serviceFactory("SearchBar",ge,"ColorGenerator"),e.decorator("SearchBar",t(["shortUrlsListParams"],["listShortUrls"])),e.serviceFactory("listShortUrls",ft,"buildShlinkApiClient"),e.serviceFactory("resetShortUrlParams",(function(){return St})),e.serviceFactory("createShortUrl",ct,"buildShlinkApiClient"),e.serviceFactory("resetCreateShortUrl",(function(){return st})),e.serviceFactory("deleteShortUrl",Ze,"buildShlinkApiClient"),e.serviceFactory("resetDeleteShortUrl",(function(){return Xe})),e.serviceFactory("getShortUrlDetail",Vr,"buildShlinkApiClient"),e.serviceFactory("editShortUrl",jt,"buildShlinkApiClient")},Ir=r(292),Fr=r.n(Ir),Ar=r(59),Mr=function(e){var t=e.children,r=e.value,n=e.onChange,a=e.id,s=void 0===a?Object(pr.a)():a,i=e.type,o=void 0===i?"text":i,l=e.required,u=void 0===l||l;return Object(c.jsxs)("div",{className:"form-group",children:[Object(c.jsxs)("label",{htmlFor:s,className:"create-server__label",children:[t,":"]}),Object(c.jsx)("input",{className:"form-control",type:o,id:s,value:r,required:u,onChange:function(e){return n(e.target.value)}})]})},Gr=function(e){var t=e.onSubmit,r=e.initialValues,n=e.children,a=e.title,s=Object(h.useState)(""),i=Object(I.a)(s,2),o=i[0],l=i[1],u=Object(h.useState)(""),d=Object(I.a)(u,2),j=d[0],b=d[1],v=Object(h.useState)(""),O=Object(I.a)(v,2),f=O[0],m=O[1],g=Object(_e.b)((function(){return t({name:o,url:j,apiKey:f})}));return Object(h.useEffect)((function(){r&&l(r.name),r&&b(r.url),r&&m(r.apiKey)}),[r]),Object(c.jsxs)("form",{className:"server-form",onSubmit:g,children:[Object(c.jsxs)(sr.a,{className:"mb-3",title:a,children:[Object(c.jsx)(Mr,{value:o,onChange:l,children:"Name"}),Object(c.jsx)(Mr,{type:"url",value:j,onChange:b,children:"URL"}),Object(c.jsx)(Mr,{value:f,onChange:m,children:"API key"})]}),Object(c.jsx)("div",{className:"text-right",children:n})]})},Pr=function(e){var t=e.type;return Object(c.jsxs)(ir,{type:t,children:["success"===t&&"Servers properly imported. You can now select one from the list :)","error"===t&&"The servers could not be imported. Make sure the format is correct."]})},Br=function(e,t){return function(r){var n=r.createServer,a=r.history.push,s=t(!1,4e3),i=Object(I.a)(s,2),o=i[0],l=i[1],d=t(!1,4e3),j=Object(I.a)(d,2),b=j[0],h=j[1];return Object(c.jsxs)(Ar.a,{children:[Object(c.jsxs)(Gr,{title:Object(c.jsx)("h5",{className:"mb-0",children:"Add new server"}),onSubmit:function(e){var t=Object(pr.a)();n(Object(u.a)(Object(u.a)({},e),{},{id:t})),a("/server/".concat(t))},children:[Object(c.jsx)(e,{onImport:l,onImportError:h}),Object(c.jsx)("button",{className:"btn btn-outline-primary",children:"Create server"})]}),(o||b)&&Object(c.jsxs)("div",{className:"mt-3",children:[o&&Object(c.jsx)(Pr,{type:"success"}),b&&Object(c.jsx)(Pr,{type:"error"})]})]})}},Hr=function(e){return function(t){var r=t.servers,n=t.selectedServer,a=Object(ye.a)(r),s=Object(c.jsxs)(z.a,{tag:o.b,to:"/server/create",children:[Object(c.jsx)(M.a,{icon:A.z})," ",Object(c.jsx)("span",{className:"ml-1",children:"Add server"})]});return Object(c.jsxs)(Ne.a,{nav:!0,inNavbar:!0,children:[Object(c.jsxs)(Q.a,{nav:!0,caret:!0,children:[Object(c.jsx)(M.a,{icon:A.C})," ",Object(c.jsx)("span",{className:"ml-1",children:"Servers"})]}),Object(c.jsx)(J.a,{right:!0,children:Object(k.a)(a)?s:Object(c.jsxs)(c.Fragment,{children:[a.map((function(e){var t=e.name,r=e.id;return Object(c.jsx)(z.a,{tag:o.b,to:"/server/".concat(r),active:Object(g.d)(n)&&n.id===r,children:t},r)})),Object(c.jsx)(z.a,{divider:!0}),s,Object(c.jsxs)(z.a,{className:"servers-dropdown__export-item",onClick:Object(S.a)(x.a.mark((function t(){return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.exportServers());case 1:case"end":return t.stop()}}),t)}))),children:[Object(c.jsx)(M.a,{icon:A.o})," ",Object(c.jsx)("span",{className:"ml-1",children:"Export servers"})]})]})})]})}},Yr=function(e){var t=e.server,r=e.toggle,n=e.isOpen,a=e.deleteServer,s=e.history;return Object(c.jsxs)(er.a,{isOpen:n,toggle:r,centered:!0,children:[Object(c.jsx)(tr.a,{toggle:r,children:Object(c.jsx)("span",{className:"text-danger",children:"Remove server"})}),Object(c.jsxs)(rr.a,{children:[Object(c.jsxs)("p",{children:["Are you sure you want to remove ",Object(c.jsx)("b",{children:t?t.name:""}),"?"]}),Object(c.jsx)("p",{children:Object(c.jsx)("i",{children:"No data will be deleted, only the access to this server will be removed from this device. You can create it again at any moment."})})]}),Object(c.jsxs)(nr.a,{children:[Object(c.jsx)("button",{className:"btn btn-link",onClick:r,children:"Cancel"}),Object(c.jsx)("button",{className:"btn btn-danger",onClick:function(){return a(t),r(),void s.push("/")},children:"Delete"})]})]})},qr=function(e){return function(t){var r=t.server,n=t.className,a=t.children,s=t.textClassName,i=Object(Z.c)(),o=Object(I.a)(i,4),l=o[0],u=o[2],d=o[3];return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsxs)("span",{className:n,onClick:u,children:[!a&&Object(c.jsx)(M.a,{icon:A.u}),Object(c.jsx)("span",{className:s,children:null!==a&&void 0!==a?a:"Remove this server"})]}),Object(c.jsx)(e,{server:r,isOpen:l,toggle:d})]})}},Wr=r(145),zr=function(e){return Object(Wr.a)((function(e){var t=e.editServer,r=e.selectedServer,n=e.history,a=n.push,s=n.goBack;if(!Object(g.d)(r))return null;return Object(c.jsx)(Ar.a,{children:Object(c.jsxs)(Gr,{title:Object(c.jsxs)("h5",{className:"mb-0",children:['Edit "',r.name,'"']}),initialValues:r,onSubmit:function(e){t(r.id,e),a("/server/".concat(r.id))},children:[Object(c.jsx)(fr.a,{outline:!0,className:"mr-2",onClick:s,children:"Cancel"}),Object(c.jsx)(fr.a,{outline:!0,color:"primary",children:"Save"})]})})}),e)},Kr=function(e){var t=e.importServersFromFile;return function(e){var r=e.createServers,n=e.fileRef,a=e.onImport,s=void 0===a?function(){}:a,i=e.onImportError,o=void 0===i?function(){}:i,l=null!==n&&void 0!==n?n:Object(h.useRef)(),u=function(){var e=Object(S.a)(x.a.mark((function e(n){var a,c;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=n.target,e.abrupt("return",t(null===(a=c.files)||void 0===a?void 0:a[0]).then(r).then(s).then((function(){c.value=null})).catch(o));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("button",{type:"button",className:"btn btn-outline-secondary mr-2",id:"importBtn",onClick:function(){var e;return null===(e=l.current)||void 0===e?void 0:e.click()},children:"Import from file"}),Object(c.jsxs)(qt.a,{placement:"top",target:"importBtn",children:["You can create servers by importing a CSV file with columns ",Object(c.jsx)("b",{children:"name"}),", ",Object(c.jsx)("b",{children:"apiKey"})," and ",Object(c.jsx)("b",{children:"url"}),"."]}),Object(c.jsx)("input",{type:"file",accept:"text/csv",className:"create-server__csv-select",ref:l,onChange:u})]})}},Qr=r(640),Jr=r(60),Zr="shlink/selectedServer/SELECT_SERVER",Xr="shlink/selectedServer/RESET_SELECTED_SERVER",$r=Object(G.a)((function(e){return"latest"===e?"999.999.999":e}),Object(Jr.c)("1.0.0")),en=Object(Qr.a)(ar.a,function(){var e=Object(S.a)(x.a.mark((function e(t,r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r().then((function(e){var t=e.version;return{version:$r(t),printableVersion:Object(Jr.b)(t)}})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),tn=Ve({[Xr]:function(){return null},[Zr]:function(e,t){return t.selectedServer}},null),rn=Le(Xr),nn=function(e,t){return function(r){return function(){var n=Object(S.a)(x.a.mark((function n(a,c){var s,i,o,l,d,j,b,h;return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a(rn()),a(St()),s=c(),i=s.servers,o=i[r]){n.next=7;break}return a({type:Zr,selectedServer:{serverNotFound:!0}}),n.abrupt("return");case 7:return n.prev=7,l=e(o),d=l.health,n.next=11,en(r,d);case 11:j=n.sent,b=j.version,h=j.printableVersion,a({type:Zr,selectedServer:Object(u.a)(Object(u.a)({},o),{},{version:b,printableVersion:h})}),a(t()),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(7),a({type:Zr,selectedServer:Object(u.a)(Object(u.a)({},o),{},{serverNotReachable:!0})});case 21:case"end":return n.stop()}}),n,null,[[7,18]])})));return function(e,t){return n.apply(this,arguments)}}()}},an=r(146),cn=r(316),sn="shlink/servers/EDIT_SERVER",on="shlink/servers/DELETE_SERVER",ln="shlink/servers/CREATE_SERVERS",un=Ve({[ln]:function(e,t){var r=t.newServers;return Object(u.a)(Object(u.a)({},e),r)},[on]:function(e,t){var r=t.serverId;return Object(le.a)(r,e)},[sn]:function(e,t){var r=t.serverId,n=t.serverData;return e[r]?Object(Ae.a)(r,Object(u.a)(Object(u.a)({},e[r]),n),e):e}},{}),dn=Object(an.a)((function(e,t){return Object(Ae.a)(t.id,t,e)}),{}),jn=Object(G.a)(Object(cn.a)((function(e){return e.id?e:Object(Ae.a)("id",Object(pr.a)(),e)})),dn,(function(e){return{type:ln,newServers:e}})),bn=function(e){return jn([e])},hn=function(e,t){return{type:sn,serverId:e,serverData:t}},vn=function(e){var t=e.id;return{type:on,serverId:t}},On=Object(G.a)(Object(m.a)("data"),(function(e){if(!Array.isArray(e))throw new Error("Value is not an array");return e})),fn=function(e){var t=e.get;return function(){return function(){var e=Object(S.a)(x.a.mark((function e(r){var n;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t("".concat(l.a,"/servers.json")).then(On).catch((function(){return[]}));case 2:n=e.sent,r(jn(n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}},mn=function(e){var t=e.minVersion,r=e.maxVersion,n=e.selectedServer,a=e.children;if(!Object(g.c)(n))return null;var s=n.version;return Object(Jr.a)(s,{maxVersion:r,minVersion:t})?Object(c.jsx)(c.Fragment,{children:a}):null},gn=r(157),pn=function(e){return function(t){var r=t.servers,n=t.selectedServer;return Object(c.jsx)(Ar.a,{children:Object(c.jsxs)("div",{className:"server-error__container flex-column",children:[Object(c.jsxs)(_r.a,{className:"w-100 mb-3 mb-md-5",type:"error",fullWidth:!0,children:[!Object(g.d)(n)&&"Could not find this Shlink server.",Object(g.d)(n)&&Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("p",{children:"Oops! Could not connect to this Shlink server."}),"Make sure you have internet connection, and the server is properly configured and on-line."]})]}),Object(c.jsxs)(gn.a,{servers:Object.values(r),children:["These are the Shlink servers currently configured. Choose one of them or ",Object(c.jsx)(o.b,{to:"/server/create",children:"add a new one"}),"."]}),Object(g.d)(n)&&Object(c.jsx)("div",{className:"container mt-3 mt-md-5",children:Object(c.jsxs)("h5",{children:["Alternatively, if you think you may have miss-configured this server, you can ",Object(c.jsx)(e,{server:n,className:"server-error__delete-btn",children:"remove it"})," or\xa0",Object(c.jsx)(o.b,{to:"/server/".concat(n.id,"/edit"),children:"edit it"}),"."]})})]})})}},xn=r(93),Sn=r(680),yn=r(681),Cn=r(637),Nn=r(638),Un=function(e,t,r){return Te((function(n){var a,s=n.shortUrlsList,i=n.listShortUrls,l=n.listTags,u=n.tagsList,d=n.selectedServer,b=n.loadVisitsOverview,v=n.visitsOverview,O=s.loading,f=s.shortUrls,m=u.loading,p=v.loading,x=v.visitsCount,S=v.orphanVisitsCount,y=Object(g.d)(d)?d.id:"",C=Object(j.g)();return Object(h.useEffect)((function(){i({itemsPerPage:5,orderBy:{dateCreated:"DESC"}}),l(),b()}),[]),Object(c.jsxs)(c.Fragment,{children:[Object(c.jsxs)(cr.a,{children:[Object(c.jsx)("div",{className:"col-md-6 col-xl-3",children:Object(c.jsxs)(Ce.a,{className:"overview__card mb-3",body:!0,children:[Object(c.jsx)(Sn.a,{tag:"h5",className:"overview__card-title",children:"Visits"}),Object(c.jsxs)(yn.a,{tag:"h2",children:[Object(c.jsx)(r,{minVersion:"2.2.0",children:p?"Loading...":Rt(x)}),Object(c.jsx)(r,{maxVersion:"2.1.*",children:Object(c.jsx)("small",{className:"text-muted",children:Object(c.jsx)("i",{children:"Shlink 2.2 is needed"})})})]})]})}),Object(c.jsx)("div",{className:"col-md-6 col-xl-3",children:Object(c.jsxs)(Ce.a,{className:"overview__card mb-3",body:!0,tag:o.b,to:"/server/".concat(y,"/orphan-visits"),children:[Object(c.jsx)(Sn.a,{tag:"h5",className:"overview__card-title",children:"Orphan visits"}),Object(c.jsxs)(yn.a,{tag:"h2",children:[Object(c.jsx)(r,{minVersion:"2.6.0",children:p?"Loading...":Rt(null!==S&&void 0!==S?S:0)}),Object(c.jsx)(r,{maxVersion:"2.5.*",children:Object(c.jsx)("small",{className:"text-muted",children:Object(c.jsx)("i",{children:"Shlink 2.6 is needed"})})})]})]})}),Object(c.jsx)("div",{className:"col-md-6 col-xl-3",children:Object(c.jsxs)(Ce.a,{className:"overview__card mb-3",body:!0,tag:o.b,to:"/server/".concat(y,"/list-short-urls/1"),children:[Object(c.jsx)(Sn.a,{tag:"h5",className:"overview__card-title",children:"Short URLs"}),Object(c.jsx)(yn.a,{tag:"h2",children:O?"Loading...":Rt(null!==(a=null===f||void 0===f?void 0:f.pagination.totalItems)&&void 0!==a?a:0)})]})}),Object(c.jsx)("div",{className:"col-md-6 col-xl-3",children:Object(c.jsxs)(Ce.a,{className:"overview__card mb-3",body:!0,tag:o.b,to:"/server/".concat(y,"/manage-tags"),children:[Object(c.jsx)(Sn.a,{tag:"h5",className:"overview__card-title",children:"Tags"}),Object(c.jsx)(yn.a,{tag:"h2",children:m?"Loading...":Rt(u.tags.length)})]})})]}),Object(c.jsxs)(Ce.a,{className:"mb-3",children:[Object(c.jsxs)(Cn.a,{children:[Object(c.jsx)("span",{className:"d-sm-none",children:"Create a short URL"}),Object(c.jsx)("h5",{className:"d-none d-sm-inline",children:"Create a short URL"}),Object(c.jsx)(o.b,{className:"float-right",to:"/server/".concat(y,"/create-short-url"),children:"Advanced options \xbb"})]}),Object(c.jsx)(Nn.a,{children:Object(c.jsx)(t,{basicMode:!0})})]}),Object(c.jsxs)(Ce.a,{children:[Object(c.jsxs)(Cn.a,{children:[Object(c.jsx)("span",{className:"d-sm-none",children:"Recently created URLs"}),Object(c.jsx)("h5",{className:"d-none d-sm-inline",children:"Recently created URLs"}),Object(c.jsx)(o.b,{className:"float-right",to:"/server/".concat(y,"/list-short-urls/1"),children:"See all \xbb"})]}),Object(c.jsx)(Nn.a,{children:Object(c.jsx)(e,{shortUrlsList:s,selectedServer:d,className:"mb-0",onTagClick:function(e){return C.push("/server/".concat(y,"/list-short-urls/1?tag=").concat(e))}})})]})]})}),(function(){return[De.visits(),De.orphanVisits()]}))},_n=["text/csv","text/comma-separated-values","application/csv"],kn=function(e){return!!e&&_n.includes(e.type)},wn=function e(t,r){var n=this;Object(y.a)(this,e),this.csvjson=t,this.fileReaderFactory=r,this.importServersFromFile=function(){var e=Object(S.a)(x.a.mark((function e(t){var r;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(kn(t)){e.next=2;break}throw new Error("No file provided or file is not a CSV");case 2:return r=n.fileReaderFactory(),e.abrupt("return",new Promise((function(e){r.addEventListener("loadend",(function(t){var r,a,c,s=null!==(r=null===(a=t.target)||void 0===a||null===(c=a.result)||void 0===c?void 0:c.toString())&&void 0!==r?r:"",i=n.csvjson.toObject(s);e(i)})),r.readAsText(t)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},Tn=function(e,t,r){var n=e.document,a=n.createElement("a"),c=new Blob([t],{type:"text/csv;charset=utf-8;"}),s=URL.createObjectURL(c);a.setAttribute("href",s),a.setAttribute("download",r),a.style.visibility="hidden",n.body.appendChild(a),a.click(),n.body.removeChild(a)},Rn=function e(t,r,n){var a=this;Object(y.a)(this,e),this.storage=t,this.window=r,this.csvjson=n,this.exportServers=Object(S.a)(x.a.mark((function e(){var t,r,n;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object(ye.a)(null!==(t=a.storage.get("servers"))&&void 0!==t?t:{}).map(Object(le.a)("id"));try{n=a.csvjson.toCSV(r,{headers:"key"}),Tn(a.window,n,"shlink-servers.csv")}catch(c){console.error(c)}case 2:case"end":return e.stop()}}),e)})))},Dn=function(e,t,r){e.serviceFactory("CreateServer",Br,"ImportServersBtn","useStateFlagTimeout"),e.decorator("CreateServer",xn.a),e.decorator("CreateServer",t(["selectedServer"],["createServer","resetSelectedServer"])),e.serviceFactory("EditServer",zr,"ServerError"),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer"])),e.serviceFactory("ServersDropdown",Hr,"ServersExporter"),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",(function(){return Yr})),e.decorator("DeleteServerModal",r),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.serviceFactory("DeleteServerButton",qr,"DeleteServerModal"),e.serviceFactory("ImportServersBtn",Kr,"ServersImporter"),e.decorator("ImportServersBtn",t(null,["createServers"])),e.serviceFactory("ForServerVersion",(function(){return mn})),e.decorator("ForServerVersion",t(["selectedServer"])),e.serviceFactory("ServerError",pn,"DeleteServerButton"),e.decorator("ServerError",t(["servers","selectedServer"])),e.serviceFactory("Overview",Un,"ShortUrlsTable","CreateShortUrl","ForServerVersion"),e.decorator("Overview",t(["shortUrlsList","tagsList","selectedServer","mercureInfo","visitsOverview"],["listShortUrls","listTags","createNewVisits","loadMercureInfo","loadVisitsOverview"])),e.constant("csvjson",Fr.a),e.constant("fileReaderFactory",(function(){return new FileReader})),e.service("ServersImporter",wn,"csvjson","fileReaderFactory"),e.service("ServersExporter",Rn,"Storage","window","csvjson"),e.serviceFactory("selectServer",nn,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServer",(function(){return bn})),e.serviceFactory("createServers",(function(){return jn})),e.serviceFactory("deleteServer",(function(){return vn})),e.serviceFactory("editServer",(function(){return hn})),e.serviceFactory("fetchServers",fn,"axios"),e.serviceFactory("resetSelectedServer",(function(){return rn}))},En=function(e){var t=e.visits,r=e.goBack,n=e.shortUrl,a=e.children,s=e.title;return Object(c.jsx)("header",{children:Object(c.jsxs)(Ce.a,{body:!0,children:[Object(c.jsxs)("h2",{className:"d-flex justify-content-between align-items-center mb-0",children:[Object(c.jsx)(fr.a,{color:"link",size:"lg",className:"p-0 mr-3",onClick:r,children:Object(c.jsx)(M.a,{icon:A.a})}),Object(c.jsx)("span",{className:"text-center d-none d-sm-block",children:Object(c.jsx)("small",{children:s})}),Object(c.jsxs)("span",{className:"badge badge-main ml-3",children:["Visits:"," ",Object(c.jsx)(Qt,{visitsCount:t.length,shortUrl:n})]})]}),Object(c.jsx)("h3",{className:"text-center d-block d-sm-none mb-0 mt-3",children:Object(c.jsx)("small",{children:s})}),a&&Object(c.jsx)("div",{className:"mt-md-2",children:a})]})})},Vn=function(e){var t,r,n=e.shortUrlDetail,a=e.shortUrlVisits,s=e.goBack,i=n.shortUrl,o=n.loading,l=a.visits,u=null!==(t=null===i||void 0===i?void 0:i.shortUrl)&&void 0!==t?t:"",d=null!==(r=null===i||void 0===i?void 0:i.longUrl)&&void 0!==r?r:"",j=null===i||void 0===i?void 0:i.title,b=Object(c.jsxs)(c.Fragment,{children:["Visits for ",Object(c.jsx)(Pt.a,{href:u})]});return Object(c.jsxs)(En,{title:b,goBack:s,visits:l,shortUrl:i,children:[Object(c.jsx)("hr",{}),Object(c.jsxs)("div",{children:["Created: ",i?Object(c.jsxs)("span",{children:[Object(c.jsx)("b",{id:"created",className:"short-url-visits-header__created-at",children:Object(c.jsx)(Gt.a,{fromNow:!0,children:i.dateCreated})}),Object(c.jsx)(qt.a,{placement:"bottom",target:"created",children:Object(c.jsx)(Gt.a,{format:"YYYY-MM-DD HH:mm",children:i.dateCreated})})]}):Object(c.jsx)("small",{children:"Loading..."})]}),Object(c.jsxs)("div",{children:["".concat(j?"Title":"Long URL",": "),o&&Object(c.jsx)("small",{children:"Loading..."}),!o&&Object(c.jsx)(Pt.a,{href:d,children:null!==j&&void 0!==j?j:d})]})]})},Ln=r(695),In=r(653),Fn=r(696),An=r(651),Mn=r(115),Gn=r(700),Pn=r(684),Bn=r(685),Hn=r(682),Yn=r(686),qn=r(687),Wn=function(e){var t=e.toggleClassName,r=e.ranges,n=e.value,a=e.setValue;return Object(c.jsxs)(Ne.a,{children:[Object(c.jsx)(Q.a,{caret:!0,color:"link",className:t,children:"Paginate"}),Object(c.jsxs)(J.a,{right:!0,children:[r.map((function(e){return Object(c.jsxs)(z.a,{active:e===n,onClick:function(){return a(e)},children:[Object(c.jsx)("b",{children:e})," items per page"]},e)})),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(z.a,{disabled:n===1/0,onClick:function(){return a(1/0)},children:Object(c.jsx)("i",{children:"Clear pagination"})})]})]})},zn=function(e){var t=e.pagesCount,r=e.currentPage,n=e.setCurrentPage,a=e.centered,s=void 0===a||a;if(t<2)return null;var i=function(e){return function(){return!Vt(e)&&n(e)}};return Object(c.jsxs)(Nt.a,{listClassName:Y()("flex-wrap mb-0 simple-paginator",{"justify-content-center":s}),children:[Object(c.jsx)(yt.a,{disabled:r<=1,children:Object(c.jsx)(Ct.a,{previous:!0,tag:"span",onClick:i(r-1)})}),Et(r,t).map((function(e,t){return Object(c.jsx)(yt.a,{disabled:Vt(e),active:r===e,children:Object(c.jsx)(Ct.a,{tag:"span",onClick:i(e),children:Lt(e)})},It(e,t))})),Object(c.jsx)(yt.a,{disabled:r>=t,children:Object(c.jsx)(Ct.a,{next:!0,tag:"span",onClick:i(r+1)})})]})},Kn=r(683),Qn=r(119),Jn=r(293),Zn=r.n(Jn),Xn="Others",$n=["Android Browser","Chrome","Chromium","Firefox","Internet Explorer","Microsoft Edge","Opera","Safari","Samsung Internet for Android","Vivaldi","WeChat"],ea=function(e){var t,r;return Object(_e.c)(e)?null!==(t=null===(r=e.split("/")[e.includes("://")?2:0])||void 0===r?void 0:r.split(":")[0])&&void 0!==t?t:"":"Direct"},ta=function(e,t){return Object.values(Object(u.a)(Object(u.a)({},Object(Hn.a)(t,t.map((function(){return 0})))),e))},ra=function(e,t){e.target.style.cursor=t[0]?"pointer":"default"},na=function(e){return function(t,r){var n,a=r.datasets,c=t.datasetIndex,s=t[e],i=void 0!==c&&(null===a||void 0===a||null===(n=a[c])||void 0===n?void 0:n.label)||"";return"".concat(i,": ").concat(Rt(Number(s)))}},aa=function(e,t){var r,n,a=e.datasetIndex,c=e.index,s=t.labels,i=t.datasets,o=void 0!==c&&(null===s||void 0===s?void 0:s[c])||"",l=void 0!==a&&void 0!==c&&(null===i||void 0===i||null===(r=i[a])||void 0===r||null===(n=r.data)||void 0===n?void 0:n[c])||"";return"".concat(o,": ").concat(Rt(Number(l)))},ca=function(e){return e.startsWith("hidden")?"":e},sa=function(e){var t,r,n=e.config,a=null!==(t=n.data)&&void 0!==t?t:{},s=a.labels,i=void 0===s?[]:s,o=a.datasets,l=void 0===o?[]:o,u=(null!==(r=n.options)&&void 0!==r?r:{}).defaultColor,d=Object(I.a)(l,1)[0].backgroundColor;return Object(c.jsx)("ul",{className:"default-chart__pie-chart-legend",children:i.map((function(e,t){return Object(c.jsxs)("li",{className:"default-chart__pie-chart-legend-item d-flex",children:[Object(c.jsx)("div",{className:"default-chart__pie-chart-legend-item-color",style:{backgroundColor:d[t]||u}}),Object(c.jsx)("small",{className:"default-chart__pie-chart-legend-item-text flex-fill",children:e})]},e)}))})},ia=function(e){return function(t){var r=Object(I.a)(t,1)[0];if(e&&r){var n=r._index,a=r._chart.data.labels;e(null===a||void 0===a?void 0:a[n])}}},oa=function(e){return!!e&&Object.keys(e).length>0},la=function(e){var t=e.title,r=e.isBarChart,n=void 0!==r&&r,a=e.stats,s=e.max,i=e.highlightedStats,o=e.highlightedLabel,l=e.onClick,d=n?Qn.HorizontalBar:Qn.Doughnut,j=Object(Se.a)(a).map(ca),b=Object(ye.a)(oa(i)?Object(Se.a)(i).reduce((function(e,t){return e[t]&&(e[t]-=i[t]),e}),Object(u.a)({},a)):a),v=oa(i)?ta(i,j):void 0,f=Object(h.useState)(),m=Object(I.a)(f,2),g=m[0],p=m[1],x={legend:{display:!1},legendCallback:!n&&sa,scales:n?{xAxes:[{ticks:{beginAtZero:!0,precision:0,callback:Rt,max:s},stacked:!0}],yAxes:[{stacked:!0}]}:void 0,tooltips:{intersect:!n,filter:function(e){var t=e.yLabel;return!n||""!==t},callbacks:{label:n?na("xLabel"):aa}},onHover:n?ra:void 0},S=function(e,t,r,n,a,c){return{labels:r,datasets:[{title:e,label:a?"Non-selected":"Visits",data:n,backgroundColor:t?O.d:["#97BBCD","#F7464A","#46BFBD","#FDB45C","#949FB1","#57A773","#414066","#08B2E3","#B6C454","#DCDCDC","#463730"],borderColor:t?O.c:Object(O.h)()?O.e:O.f,borderWidth:2},a&&{title:e,label:null!==c&&void 0!==c?c:"Selected",data:a,backgroundColor:O.b,borderColor:O.a,borderWidth:2}].filter(Boolean)}}(t,n,j,b,v,o),y=function(e,t){return e?e&&t.length>20?8*t.length:void 0:300}(n,j);return Object(c.jsxs)("div",{className:"row",children:[Object(c.jsx)("div",{className:Y()("col-sm-12",{"col-md-7":!n}),children:Object(c.jsx)(d,{ref:function(e){return p(null!==e&&void 0!==e?e:void 0)},data:S,options:x,height:y,getElementAtEvent:ia(l)},y)}),!n&&Object(c.jsx)("div",{className:"col-sm-12 col-md-5",children:null===g||void 0===g?void 0:g.chartInstance.generateLegend()})]})},ua=function(e){var t=e.title,r=e.footer,n=Object(Wt.a)(e,["title","footer"]);return Object(c.jsxs)(Ce.a,{children:[Object(c.jsx)(Cn.a,{className:"graph-card__header",children:"function"===typeof t?t():t}),Object(c.jsx)(Nn.a,{children:Object(c.jsx)(la,Object(u.a)({title:t},n))}),r&&Object(c.jsx)(Kn.a,{className:"graph-card__footer--sticky",children:r})]})},da=function(e){return"String"===Object(Mn.a)(e)?Object(Gn.a)(e):e},ja=function(e){return Object(I.a)(e,1)[0]},ba=function(e){return Object(I.a)(e,2)[1]},ha=function(e){var t=e.stats,r=e.highlightedStats,n=e.title,a=e.sortingItems,s=e.extraHeaderContent,i=e.withPagination,o=void 0===i||i,l=Object(Wt.a)(e,["stats","highlightedStats","title","sortingItems","extraHeaderContent","withPagination"]),d=Object(h.useState)({orderField:void 0,orderDir:void 0}),j=Object(I.a)(d,2),b=j[0],v=j[1],O=Object(h.useState)(1),f=Object(I.a)(O,2),m=f[0],g=f[1],p=Object(h.useState)(50),x=Object(I.a)(p,2),S=x[0],y=x[1],C=function(e){var t=e[m-1];if(m0?r:void 0,a),U=N.currentPageStats,_=N.currentPageHighlightedStats,k=N.pagination,w=N.max,T=Object.keys(U);return Object(c.jsx)(ua,Object(u.a)({isBarChart:!0,title:function(){return Object(c.jsxs)(c.Fragment,{children:[n,Object(c.jsx)("div",{className:"float-right",children:Object(c.jsx)(ke,{isButton:!1,right:!0,items:a,orderField:b.orderField,orderDir:b.orderDir,onChange:function(e,t){v({orderField:e,orderDir:t}),g(1)}})}),o&&Object.keys(t).length>50&&Object(c.jsx)("div",{className:"float-right",children:Object(c.jsx)(Wn,{toggleClassName:"btn-sm p-0 mr-3",ranges:[50,100,200,500],value:S,setValue:function(e){y(e),g(1)}})}),s&&Object(c.jsx)("div",{className:"float-right",children:s(k?T:void 0)})]})},stats:U,highlightedStats:_,footer:k,max:w},l))},va=r(688),Oa=r(689),fa=r(690),ma=function(e){return Object(c.jsx)(xr,Object(u.a)({type:"switch"},e))},ga={monthly:"Month",weekly:"Week",daily:"Day",hourly:"Hour"},pa={hourly:"hour",daily:"day",weekly:"week",monthly:"month"},xa={hourly:function(e){return B()(e).format("YYYY-MM-DD HH:00")},daily:function(e){return B()(e).format("YYYY-MM-DD")},weekly(e){var t=B()(e).isoWeekday(1).format("YYYY-MM-DD"),r=B()(e).isoWeekday(7).format("YYYY-MM-DD");return"".concat(t," - ").concat(r)},monthly:function(e){return B()(e).format("YYYY-MM")}},Sa=function(e,t){return Object(fa.a)((function(t){return xa[e](t.date)}),t)},ya=function(e,t,r,n){if(n)return[Object.keys(t),Object.values(t)];var a=function(e,t){var r=pa[e],n=xa[e],a=B()(t[0].date),c=B()(t[t.length-1].date),s=a.diff(c,r);return[n(c)].concat(Object(pe.a)(Object(_e.d)(s,(function(){return n(c.add(1,r))}))))}(r,e);return[a,ta(t,a)]},Ca=function(e,t,r){return{label:t,data:e,fill:!1,lineTension:.2,borderColor:r,backgroundColor:r}},Na=null,Ua=function(e,t){return function(r){var n=Object(I.a)(r,1)[0];if(t&&n){var a,c=n._index,s=n._chart.data.labels;if(Na===s[c])t([]),Na=null;else t(s[c]&&e[s[c]]||[]),Na=null!==(a=s[c])&&void 0!==a?a:null}}},_a=function(e){var t=e.title,r=e.visits,n=e.highlightedVisits,a=e.highlightedLabel,s=void 0===a?"Selected":a,i=e.setSelectedVisits,o=Object(h.useState)(r.length>0?function(e){var t,r=B()(),n=B()(e);return null!==(t=Object(va.a)([[function(){return r.diff(n,"day")<=2},Object(Oa.a)("hourly")],[function(){return r.diff(n,"month")<=1},Object(Oa.a)("daily")],[function(){return r.diff(n,"month")<=6},Object(Oa.a)("weekly")]])())&&void 0!==t?t:"monthly"}(r[r.length-1].date):"monthly"),l=Object(I.a)(o,2),u=l[0],d=l[1],j=Object(Z.c)(!0),b=Object(I.a)(j,2),v=b[0],f=b[1],m=Object(h.useMemo)((function(){return function(e,t){return t.reduce((function(t,r){var n,a=xa[e](r.date);return t[a]=null!==(n=t[a])&&void 0!==n?n:[],t[a].push(r),t}),{})}(u,r)}),[u,r]),g=Object(h.useMemo)((function(){return Sa(u,Object(Bn.a)(r))}),[u,r]),p=Object(h.useMemo)((function(){return ya(r,g,u,v)}),[r,u,v]),x=Object(I.a)(p,2),S=x[0],y=x[1],C=Object(h.useMemo)((function(){return ta(Sa(u,Object(Bn.a)(n)),S)}),[n,u,S]),N={labels:S,datasets:[Ca(y,"Visits",O.c),n.length>0&&Ca(C,s,O.a)].filter(Boolean)},U={maintainAspectRatio:!1,legend:{display:!1},scales:{yAxes:[{ticks:{beginAtZero:!0,precision:0,callback:Rt}}],xAxes:[{scaleLabel:{display:!0,labelString:ga[u]}}]},tooltips:{intersect:!1,axis:"x",callbacks:{label:na("yLabel")}},onHover:ra};return Object(c.jsxs)(Ce.a,{children:[Object(c.jsxs)(Cn.a,{children:[t,Object(c.jsx)("div",{className:"float-right",children:Object(c.jsxs)(Ne.a,{children:[Object(c.jsx)(Q.a,{caret:!0,color:"link",className:"btn-sm p-0",children:"Group by"}),Object(c.jsx)(J.a,{right:!0,children:Object.entries(ga).map((function(e){var t=Object(I.a)(e,2),r=t[0],n=t[1];return Object(c.jsx)(z.a,{active:u===r,onClick:function(){return d(r)},children:n},r)}))})]})}),Object(c.jsx)("div",{className:"float-right mr-2",children:Object(c.jsx)(ma,{checked:v,onChange:f,children:Object(c.jsx)("small",{children:"Skip dates with no visits"})})})]}),Object(c.jsx)(Nn.a,{className:"line-chart-card__body",children:Object(c.jsx)(Qn.Line,{data:N,options:U,getElementAtEvent:Ua(m,i)})})]})},ka=function(e,t){return t.filter((function(t){return function(e,t){var r=e.browser,n=e.os,a=e.referer,c=e.country,s=e.city,i=Object(Wt.a)(e,["browser","os","referer","country","city"]);return"".concat(r," ").concat(n," ").concat(a," ").concat(c," ").concat(s," ").concat(i.visitedUrl).toLowerCase().includes(t.toLowerCase())}(t,e)}))},wa=function(e){var t,r,n=e.visits,a=e.selectedVisits,s=void 0===a?[]:a,i=e.setSelectedVisits,o=e.matchMedia,l=void 0===o?window.matchMedia:o,u=e.isOrphanVisits,d=void 0!==u&&u,j="visits-table__header-cell visits-table__sticky",b=function(){return l("(max-width: 767px)").matches},v=Object(h.useState)(b()),O=Object(I.a)(v,2),f=O[0],m=O[1],g=Object(h.useState)(void 0),p=Object(I.a)(g,2),x=p[0],S=p[1],y=Object(h.useState)({field:void 0,dir:void 0}),C=Object(I.a)(y,2),N=C[0],U=C[1],_=Object(h.useMemo)((function(){return function(e,t,r){var n=function(e,t){var r=e.field,n=e.dir;return r&&n?t.sort((function(e,t){var a="ASC"===n?1:-1,c="ASC"===n?-1:1;return e[r]>t[r]?a:c})):t}(r,t?ka(t,e):Object(pe.a)(e)),a=n.length;return{visitsGroups:Object(qn.a)(20,n),total:a}}(n,x,N)}),[x,N]),k=Object(h.useRef)(!0),w=Object(h.useState)(1),T=Object(I.a)(w,2),R=T[0],D=T[1],E=20*R,V=E-20,L=function(e){return function(){return U({field:e,dir:Object(_e.a)(e,N.field,N.dir)})}},F=function(e){return N.dir&&N.field===e&&Object(c.jsx)(M.a,{icon:"ASC"===N.dir?A.e:A.d,className:"visits-table__header-icon"})};return Object(h.useEffect)((function(){var e=function(){return m(b())};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),Object(h.useEffect)((function(){D(1),!k.current&&i([]),k.current=!1}),[x]),Object(c.jsxs)("table",{className:"table table-bordered table-hover table-sm table-responsive-sm visits-table",children:[Object(c.jsxs)("thead",{className:"visits-table__header",children:[Object(c.jsxs)("tr",{children:[Object(c.jsx)("th",{className:"visits-table__header-cell visits-table__sticky text-center",onClick:function(){return i(s.length<_.total?_.visitsGroups.flat():[])},children:Object(c.jsx)(M.a,{icon:A.g,className:Y()({"text-primary":s.length>0})})}),Object(c.jsxs)("th",{className:j,onClick:L("date"),children:["Date",F("date")]}),Object(c.jsxs)("th",{className:j,onClick:L("country"),children:["Country",F("country")]}),Object(c.jsxs)("th",{className:j,onClick:L("city"),children:["City",F("city")]}),Object(c.jsxs)("th",{className:j,onClick:L("browser"),children:["Browser",F("browser")]}),Object(c.jsxs)("th",{className:j,onClick:L("os"),children:["OS",F("os")]}),Object(c.jsxs)("th",{className:j,onClick:L("referer"),children:["Referrer",F("referer")]}),d&&Object(c.jsxs)("th",{className:j,onClick:L("visitedUrl"),children:["Visited URL",F("visitedUrl")]})]}),Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:d?8:7,className:"p-0",children:Object(c.jsx)(q,{noBorder:!0,large:!1,onChange:S})})})]}),Object(c.jsxs)("tbody",{children:[!(null!==(t=_.visitsGroups[R-1])&&void 0!==t&&t.length)&&Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:d?8:7,className:"text-center",children:"No visits found with current filtering"})}),null===(r=_.visitsGroups[R-1])||void 0===r?void 0:r.map((function(e,t){var r=s.includes(e);return Object(c.jsxs)("tr",{style:{cursor:"pointer"},className:Y()({"table-active":r}),onClick:function(){return i(r?s.filter((function(t){return t!==e})):[].concat(Object(pe.a)(s),[e]))},children:[Object(c.jsx)("td",{className:"text-center",children:r&&Object(c.jsx)(M.a,{icon:A.g,className:"text-primary"})}),Object(c.jsx)("td",{children:Object(c.jsx)(Gt.a,{format:"YYYY-MM-DD HH:mm",children:e.date})}),Object(c.jsx)("td",{children:e.country}),Object(c.jsx)("td",{children:e.city}),Object(c.jsx)("td",{children:e.browser}),Object(c.jsx)("td",{children:e.os}),Object(c.jsx)("td",{children:e.referer}),d&&Object(c.jsx)("td",{children:e.visitedUrl})]},t)}))]}),_.total>20&&Object(c.jsx)("tfoot",{children:Object(c.jsx)("tr",{children:Object(c.jsx)("td",{colSpan:d?8:7,className:"visits-table__footer-cell visits-table__sticky",children:Object(c.jsxs)("div",{className:"row",children:[Object(c.jsx)("div",{className:"col-md-6",children:Object(c.jsx)(zn,{pagesCount:Math.ceil(_.total/20),currentPage:R,setCurrentPage:D,centered:f})}),Object(c.jsx)("div",{className:Y()("col-md-6",{"d-flex align-items-center flex-row-reverse":!f,"text-center mt-3":f}),children:Object(c.jsxs)("div",{children:["Visits ",Object(c.jsx)("b",{children:Rt(V+1)})," to"," ",Object(c.jsx)("b",{children:Rt(Object(kt.a)(E,_.total))})," of"," ",Object(c.jsx)("b",{children:Rt(_.total)})]})})]})})})})]})},Ta=r(706),Ra=r(691),Da=r(692),Ea=r(693),Va=function(){return Object(c.jsx)(Ta.a,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"})},La=function(e){return 0===e.length?{}:e.length>1?{bounds:e.map(Object(m.a)("latLong"))}:{zoom:10,center:Object(I.a)(e,1)[0].latLong}},Ia=function(e){var t=e.toggle,r=e.isOpen,n=e.title,a=e.locations,s=void 0===a?[]:a;return Object(c.jsx)(er.a,{toggle:t,isOpen:r,className:"map-modal__modal",contentClassName:"map-modal__modal-content",children:Object(c.jsxs)(rr.a,{className:"map-modal__modal-body",children:[Object(c.jsxs)("h3",{className:"map-modal__modal-title",children:[n,Object(c.jsx)("button",{type:"button",className:"close",onClick:t,children:"\xd7"})]}),Object(c.jsxs)(Ra.a,Object(u.a)(Object(u.a)({},La(s)),{},{children:[Object(c.jsx)(Va,{}),s.map((function(e,t){var r=e.cityName,n=e.latLong,a=e.count;return Object(c.jsx)(Da.a,{position:n,children:Object(c.jsxs)(Ea.a,{children:[Object(c.jsx)("b",{children:a})," visit",a>1?"s":""," from ",Object(c.jsx)("b",{children:r})]})},t)}))]}))]})})},Fa=function(e){var t=e.modalTitle,r=e.activeCities,n=e.locations,a=void 0===n?[]:n,s=Object(Z.c)(),i=Object(I.a)(s,4),o=i[0],l=i[2],u=i[3],d=Object(Z.c)(),j=Object(I.a)(d,3),b=j[0],v=j[1],O=j[2],f=Object(h.useState)([]),m=Object(I.a)(f,2),g=m[0],p=m[1],x=Object(h.useRef)(),S=function(e){return function(){p(e?a.filter((function(e){var t=e.cityName;return r.includes(t)})):a),l()}};return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)("button",{className:"btn btn-link open-map-modal-btn__btn",ref:x,onClick:function(){if(!r)return p(a),void l();O()},children:Object(c.jsx)(M.a,{icon:A.t})}),Object(c.jsx)(qt.a,{placement:"left",target:function(){return x.current},children:"Show in map"}),Object(c.jsx)(K.a,{isOpen:b,toggle:v,inNavbar:!0,children:Object(c.jsxs)(J.a,{right:!0,children:[Object(c.jsx)(z.a,{onClick:S(!1),children:"Show all locations"}),Object(c.jsx)(z.a,{onClick:S(!0),children:"Show locations in current page"})]})}),Object(c.jsx)(Ia,{toggle:u,isOpen:o,title:t,locations:g})]})},Aa=r(694),Ma=function(e){return e.hasOwnProperty("visitedUrl")},Ga=Object(G.a)(Object(Aa.a)((function(e){return Ma(e.visit)?"orphanVisits":"regularVisits"})),(function(e){return Object(u.a)({orphanVisits:[],regularVisits:[]},e)})),Pa=function(e,t){return Object(fa.a)(Object(m.a)(t),e)},Ba=function(e,t){return!Object(_.a)(e)&&Object(_e.c)(e[t])},Ha=function(e){return"number"===typeof e?e:e?parseFloat(e):0},Ya=function(e){return function(t,r){var n=Ba(r,e)?r[e]:"Unknown";t[n]=(t[n]||0)+1}},qa=Ya("country"),Wa=Ya("city"),za=function(e){return e.reduce((function(e,t){return function(e,t){var r=t.os;e[r]=(e[r]||0)+1}(e.os,t),function(e,t){var r=t.browser;e[r]=(e[r]||0)+1}(e.browsers,t),function(e,t){var r=t.referer;e[r]=(e[r]||0)+1}(e.referrers,t),qa(e.countries,t),Wa(e.cities,t),function(e,t){if(Ba(t,"city")&&"Unknown"!==t.city){var r=t.city,n=t.latitude,a=t.longitude,c=e[r]||{cityName:r,count:0,latLong:[Ha(n),Ha(a)]};c.count++,e[r]=c}}(e.citiesForMap,t),function(e,t){if(function(e){return e.hasOwnProperty("visitedUrl")}(t)){var r=t.visitedUrl;e[r]=(e[r]||0)+1}}(e.visitedUrls,t),e}),{os:{},browsers:{},referrers:{},countries:{},cities:{},citiesForMap:{},visitedUrls:{}})},Ka=Object(cn.a)((function(e){var t=e.userAgent,r=e.date,n=e.referer,a=e.visitLocation,c=Object(u.a)(Object(u.a)({date:r},function(e){if(!Object(_e.c)(e))return{browser:Xn,os:Xn};var t=Zn.a.parse(e),r=t.browser.name,n=t.os.name;return{os:null!==n&&void 0!==n?n:Xn,browser:r&&$n.includes(r)?r:Xn}}(t)),{},{referer:ea(n),country:(null===a||void 0===a?void 0:a.countryName)||"Unknown",city:(null===a||void 0===a?void 0:a.cityName)||"Unknown",latitude:null===a||void 0===a?void 0:a.latitude,longitude:null===a||void 0===a?void 0:a.longitude});return Ma(e)?Object(u.a)(Object(u.a)({},c),{},{type:e.type,visitedUrl:e.visitedUrl}):c})),Qa=function(e){var t=e.onChange,r=e.selected,n=e.text,a=e.className;return Object(c.jsxs)(X,{text:n,dropdownClassName:a,className:"mr-3",right:!0,children:[Object(c.jsx)(z.a,{active:"base_url"===r,onClick:function(){return t("base_url")},children:"Base URL"}),Object(c.jsx)(z.a,{active:"invalid_short_url"===r,onClick:function(){return t("invalid_short_url")},children:"Invalid short URL"}),Object(c.jsx)(z.a,{active:"regular_404"===r,onClick:function(){return t("regular_404")},children:"Regular 404"}),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(z.a,{onClick:function(){return t(void 0)},children:Object(c.jsx)("i",{children:"Clear selection"})})]})},Ja={byTime:{title:"By time",subPath:"",icon:A.c},byContext:{title:"By context",subPath:"/by-context",icon:A.f},byLocation:{title:"By location",subPath:"/by-location",icon:A.t},list:{title:"List",subPath:"/list",icon:A.s}},Za=function(e){var t=e.subPath,r=e.title,n=e.icon,a=e.to;return Object(c.jsxs)(In.a,{tag:o.c,className:"visits-stats__nav-link",to:a,isActive:function(e,r){return r.pathname.endsWith("visits".concat(t))},replace:!0,children:[Object(c.jsx)(M.a,{icon:n}),Object(c.jsx)("span",{className:"ml-2 d-none d-sm-inline",children:r})]})},Xa=function(e){var t,r,n=e.children,a=e.visitsInfo,s=e.getVisits,i=e.cancelGetVisits,o=e.baseUrl,l=e.domain,d=e.settings,b=e.exportCsv,v=e.isOrphanVisits,O=void 0!==v&&v,f=null!==(t=null===(r=d.visits)||void 0===r?void 0:r.defaultInterval)&&void 0!==t?t:"last30Days",m=Object(h.useState)(oe(f)),g=Object(I.a)(m,2),p=g[0],x=g[1],S=Object(h.useState)([]),y=Object(I.a)(S,2),C=y[0],N=y[1],U=Object(h.useState)(),_=Object(I.a)(U,2),w=_[0],T=_[1],R=Object(h.useState)(),D=Object(I.a)(R,2),E=D[0],V=D[1],L=function(e){var t=l?"?domain=".concat(l):"";return e?"".concat(o).concat(e).concat(t):"".concat(o).concat(t)},F=a.visits,P=a.loading,B=a.loadingLarge,H=a.error,q=a.errorData,W=a.progress,z=Object(h.useMemo)((function(){return function(e,t){return Object(G.a)(Ka,Object($.a)((function(e){return void 0===t||e.type===t})))(e)}(F,E)}),[F,E]),K=Object(h.useMemo)((function(){return za(z)}),[z]),Q=K.os,J=K.browsers,Z=K.referrers,X=K.countries,ee=K.cities,re=K.citiesForMap,ne=K.visitedUrls,ae=Object(ye.a)(re),ce=function(e){Ee=void 0,N(e)},se=function(e){return function(t){var r="".concat(e,"_").concat(t);Ee===r?(N([]),T(void 0),Ee=void 0):(N(z.filter(Object(Ln.a)(e,t))),T(t),Ee=r)}};Object(h.useEffect)((function(){return i}),[]),Object(h.useEffect)((function(){var e,t,r=p.startDate,n=p.endDate;s({startDate:null!==(e=te(r))&&void 0!==e?e:void 0,endDate:null!==(t=te(n))&&void 0!==t?t:void 0})}),[p]);return Object(c.jsxs)(c.Fragment,{children:[n,Object(c.jsx)("section",{className:"mt-3",children:Object(c.jsxs)("div",{className:"row flex-md-row-reverse",children:[Object(c.jsx)("div",{className:"col-lg-7 col-xl-6",children:Object(c.jsxs)("div",{className:"d-md-flex",children:[Object(c.jsx)("div",{className:"flex-fill",children:Object(c.jsx)(fe,{disabled:P,initialDateRange:f,defaultText:"All visits",onDatesChange:x})}),O&&Object(c.jsx)(Qa,{text:"Filter by type",className:"ml-0 ml-md-2 mt-3 mt-md-0",selected:E,onChange:V})]})}),F.length>0&&Object(c.jsx)("div",{className:"col-lg-5 col-xl-6 mt-3 mt-lg-0",children:Object(c.jsxs)("div",{className:"d-flex",children:[Object(c.jsxs)(fr.a,{outline:!0,disabled:0===C.length,className:"btn-md-block mr-2",onClick:function(){return ce([])},children:["Clear selection ",C.length>0&&Object(c.jsxs)(c.Fragment,{children:["(",C.length,")"]})]}),Object(c.jsxs)(fr.a,{outline:!0,color:"primary",className:"btn-md-block",onClick:function(){return b(z)},children:[Object(c.jsx)(M.a,{icon:A.o})," Export (",z.length,")"]})]})})]})}),Object(c.jsx)("section",{className:"mt-3",children:B?Object(c.jsxs)(_r.a,{loading:!0,children:["This is going to take a while... :S",Object(c.jsx)(Fn.a,{value:W,striped:100===W,className:"mt-3"})]}):P?Object(c.jsx)(_r.a,{loading:!0}):H?Object(c.jsx)(ir,{type:"error",children:Object(c.jsx)(or,{errorData:q,fallbackMessage:"An error occurred while loading visits :("})}):Object(k.a)(F)?Object(c.jsx)(_r.a,{children:"There are no visits matching current filter :("}):Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(Ce.a,{className:"visits-stats__nav p-0 overflow-hidden",body:!0,children:Object(c.jsx)(An.a,{pills:!0,fill:!0,children:Object.entries(Ja).map((function(e){var t=Object(I.a)(e,2),r=t[0],n=t[1];return Object(c.jsx)(Za,Object(u.a)(Object(u.a)({},n),{},{to:L(n.subPath)}),r)}))})}),Object(c.jsx)(cr.a,{children:Object(c.jsxs)(j.d,{children:[Object(c.jsx)(j.b,{exact:!0,path:o,children:Object(c.jsx)("div",{className:"col-12 mt-3",children:Object(c.jsx)(_a,{title:"Visits during time",visits:z,highlightedVisits:C,highlightedLabel:w,setSelectedVisits:ce})})}),Object(c.jsxs)(j.b,{exact:!0,path:"".concat(o).concat(Ja.byContext.subPath),children:[Object(c.jsx)("div",{className:Y()("mt-3 col-lg-6",{"col-xl-4":!O}),children:Object(c.jsx)(ua,{title:"Operating systems",stats:Q})}),Object(c.jsx)("div",{className:Y()("mt-3 col-lg-6",{"col-xl-4":!O}),children:Object(c.jsx)(ua,{title:"Browsers",stats:J})}),Object(c.jsx)("div",{className:Y()("mt-3",{"col-xl-4":!O,"col-lg-6":O}),children:Object(c.jsx)(ha,{title:"Referrers",stats:Z,withPagination:!1,highlightedStats:Pa(C,"referer"),highlightedLabel:w,sortingItems:{name:"Referrer name",amount:"Visits amount"},onClick:se("referer")})}),O&&Object(c.jsx)("div",{className:"mt-3 col-lg-6",children:Object(c.jsx)(ha,{title:"Visited URLs",stats:ne,highlightedLabel:w,highlightedStats:Pa(C,"visitedUrl"),sortingItems:{visitedUrl:"Visited URL",amount:"Visits amount"},onClick:se("visitedUrl")})})]}),Object(c.jsxs)(j.b,{exact:!0,path:"".concat(o).concat(Ja.byLocation.subPath),children:[Object(c.jsx)("div",{className:"col-lg-6 mt-3",children:Object(c.jsx)(ha,{title:"Countries",stats:X,highlightedStats:Pa(C,"country"),highlightedLabel:w,sortingItems:{name:"Country name",amount:"Visits amount"},onClick:se("country")})}),Object(c.jsx)("div",{className:"col-lg-6 mt-3",children:Object(c.jsx)(ha,{title:"Cities",stats:ee,highlightedStats:Pa(C,"city"),highlightedLabel:w,extraHeaderContent:function(e){return ae.length>0&&Object(c.jsx)(Fa,{modalTitle:"Cities",locations:ae,activeCities:e})},sortingItems:{name:"City name",amount:"Visits amount"},onClick:se("city")})})]}),Object(c.jsx)(j.b,{exact:!0,path:"".concat(o).concat(Ja.list.subPath),children:Object(c.jsx)("div",{className:"col-12",children:Object(c.jsx)(wa,{visits:z,selectedVisits:C,setSelectedVisits:ce,isOrphanVisits:O})})}),Object(c.jsx)(j.a,{to:o})]})})]})})]})},$a=function(e){var t=e.exportVisits;return Te((function(e){var r=e.history.goBack,n=e.match,a=n.params,s=n.url,i=e.location.search,o=e.shortUrlVisits,l=e.shortUrlDetail,d=e.getShortUrlVisits,j=e.getShortUrlDetail,b=e.cancelGetShortUrlVisits,v=e.settings,O=a.shortCode,f=Re(i).domain;return Object(h.useEffect)((function(){j(O,f)}),[]),Object(c.jsx)(Xa,{getVisits:function(e){return d(O,Object(u.a)(Object(u.a)({},e),{},{domain:f}))},cancelGetVisits:b,visitsInfo:o,baseUrl:s,domain:f,settings:v,exportCsv:function(e){var r;return t("short-url_".concat(null===(r=l.shortUrl)||void 0===r?void 0:r.shortUrl.replace(/https?:\/\//g,""),"_visits.csv"),e)},children:Object(c.jsx)(Vn,{shortUrlDetail:l,shortUrlVisits:o,goBack:r})})}),(function(e){var t=e.match;return[De.shortUrlVisits(t.params.shortCode)]}))},ec=r(704),tc=5e3,rc=function(e){return e.currentPage>=e.pagesCount},nc=function(e,t){return 100*t/e},ac=function(){var e=Object(S.a)(x.a.mark((function e(t,r,n,a,c){var s,i,o,l;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a({type:n.start}),s=function(){var e=Object(S.a)(x.a.mark((function e(r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(r.map(function(){var e=Object(S.a)(x.a.mark((function e(r){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(r,tc).then(Object(m.a)("data")));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then(ec.a));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i=function(){var e=Object(S.a)(x.a.mark((function e(t){var r,o,l=arguments;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.length>1&&void 0!==l[1]?l[1]:0,!c()){e.next=3;break}return e.abrupt("return",[]);case 3:return e.next=5,s(t[r]);case 5:if(o=e.sent,a({type:n.progress,progress:nc(t.length,r+2)}),!(r0&&void 0!==d[0]?d[0]:1,e.next=3,t(r,tc);case 3:if(c=e.sent,s=c.pagination,o=c.data,s&&!rc(s)){e.next=8;break}return e.abrupt("return",o);case 8:return l=Object(Ut.a)(2,s.pagesCount+1),u=Object(qn.a)(4,l),s.pagesCount-1>4&&a({type:n.large}),e.t0=o,e.next=14,i(u);case 14:return e.t1=e.sent,e.abrupt("return",e.t0.concat.call(e.t0,e.t1));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,o();case 7:l=e.sent,a(Object(u.a)(Object(u.a)({},r),{},{visits:l,type:n.finish})),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),a({type:n.error,errorData:He(e.t0)});case 14:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t,r,n,a,c){return e.apply(this,arguments)}}(),cc="shlink/shortUrlVisits/GET_SHORT_URL_VISITS_START",sc="shlink/shortUrlVisits/GET_SHORT_URL_VISITS_ERROR",ic="shlink/shortUrlVisits/GET_SHORT_URL_VISITS",oc="shlink/shortUrlVisits/GET_SHORT_URL_VISITS_LARGE",lc="shlink/shortUrlVisits/GET_SHORT_URL_VISITS_CANCEL",uc="shlink/shortUrlVisits/GET_SHORT_URL_VISITS_PROGRESS_CHANGED",dc={visits:[],shortCode:"",domain:void 0,loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},jc=Ve({[cc]:function(){return Object(u.a)(Object(u.a)({},dc),{},{loading:!0})},[sc]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},dc),{},{error:!0,errorData:r})},[ic]:function(e,t){var r=t.visits,n=t.shortCode,a=t.domain;return Object(u.a)(Object(u.a)({},dc),{},{visits:r,shortCode:n,domain:a})},[oc]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loadingLarge:!0})},[lc]:function(e){return Object(u.a)(Object(u.a)({},e),{},{cancelLoad:!0})},[uc]:function(e,t){var r=t.progress;return Object(u.a)(Object(u.a)({},e),{},{progress:r})},[Pe]:function(e,t){var r=t.createdVisits,n=e.shortCode,a=e.domain,c=e.visits,s=r.filter((function(e){var t=e.shortUrl;return t&&Ge(t,n,a)})).map((function(e){return e.visit}));return Object(u.a)(Object(u.a)({},e),{},{visits:[].concat(Object(pe.a)(s),Object(pe.a)(c))})}},dc),bc=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){var n=Object(S.a)(x.a.mark((function n(a,c){var s,i,o,l,d,j;return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=e(c),i=s.getShortUrlVisits,o=function(){var e=Object(S.a)(x.a.mark((function e(n,a){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i(t,Object(u.a)(Object(u.a)({},r),{},{page:n,itemsPerPage:a})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),l=function(){return c().shortUrlVisits.cancelLoad},d={shortCode:t,domain:r.domain},j={start:cc,large:oc,finish:ic,error:sc,progress:uc},n.abrupt("return",ac(o,d,j,a,l));case 6:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()}},hc=Le(lc),vc=function(e){var t=e.tagVisits,r=e.goBack,n=e.colorGenerator,a=t.visits,s=t.tag,i=Object(c.jsxs)("span",{className:"d-flex align-items-center justify-content-center",children:[Object(c.jsx)("span",{className:"mr-2",children:"Visits for"}),Object(c.jsx)(W,{text:s,colorGenerator:n})]});return Object(c.jsx)(En,{title:i,goBack:r,visits:a})},Oc=function(e,t){var r=t.exportVisits;return Te((function(t){var n=t.history.goBack,a=t.match,s=a.params,i=a.url,o=t.getTagVisits,l=t.tagVisits,u=t.cancelGetTagVisits,d=t.settings,j=s.tag;return Object(c.jsx)(Xa,{getVisits:function(e){return o(j,e)},cancelGetVisits:u,visitsInfo:l,baseUrl:i,settings:d,exportCsv:function(e){return r("tag_".concat(j,"_visits.csv"),e)},children:Object(c.jsx)(vc,{tagVisits:l,goBack:n,colorGenerator:e})})}),(function(){return[De.visits()]}))},fc="shlink/tagVisits/GET_TAG_VISITS_START",mc="shlink/tagVisits/GET_TAG_VISITS_ERROR",gc="shlink/tagVisits/GET_TAG_VISITS",pc="shlink/tagVisits/GET_TAG_VISITS_LARGE",xc="shlink/tagVisits/GET_TAG_VISITS_CANCEL",Sc="shlink/tagVisits/GET_TAG_VISITS_PROGRESS_CHANGED",yc={visits:[],tag:"",loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},Cc=Ve({[fc]:function(){return Object(u.a)(Object(u.a)({},yc),{},{loading:!0})},[mc]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},yc),{},{error:!0,errorData:r})},[gc]:function(e,t){var r=t.visits,n=t.tag;return Object(u.a)(Object(u.a)({},yc),{},{visits:r,tag:n})},[pc]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loadingLarge:!0})},[xc]:function(e){return Object(u.a)(Object(u.a)({},e),{},{cancelLoad:!0})},[Sc]:function(e,t){var r=t.progress;return Object(u.a)(Object(u.a)({},e),{},{progress:r})},[Pe]:function(e,t){var r=t.createdVisits,n=e.tag,a=e.visits,c=r.filter((function(e){var t=e.shortUrl;return null===t||void 0===t?void 0:t.tags.includes(n)})).map((function(e){return e.visit}));return Object(u.a)(Object(u.a)({},e),{},{visits:[].concat(Object(pe.a)(c),Object(pe.a)(a))})}},yc),Nc=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){var n=Object(S.a)(x.a.mark((function n(a,c){var s,i,o,l,d,j;return x.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=e(c),i=s.getTagVisits,o=function(){var e=Object(S.a)(x.a.mark((function e(n,a){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i(t,Object(u.a)(Object(u.a)({},r),{},{page:n,itemsPerPage:a})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),l=function(){return c().tagVisits.cancelLoad},d={tag:t},j={start:fc,large:pc,finish:gc,error:mc,progress:Sc},n.abrupt("return",ac(o,d,j,a,l));case 6:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()}},Uc=Le(xc),_c=function(e){var t=e.orphanVisits,r=e.goBack,n=t.visits;return Object(c.jsx)(En,{title:"Orphan visits",goBack:r,visits:n})},kc=function(e){var t=e.exportVisits;return Te((function(e){var r=e.history.goBack,n=e.match.url,a=e.getOrphanVisits,s=e.orphanVisits,i=e.cancelGetOrphanVisits,o=e.settings;return Object(c.jsx)(Xa,{getVisits:a,cancelGetVisits:i,visitsInfo:s,baseUrl:n,settings:o,exportCsv:function(e){return t("orphan_visits.csv",e)},isOrphanVisits:!0,children:Object(c.jsx)(_c,{orphanVisits:s,goBack:r})})}),(function(){return[De.orphanVisits()]}))},wc="shlink/orphanVisits/GET_ORPHAN_VISITS_START",Tc="shlink/orphanVisits/GET_ORPHAN_VISITS_ERROR",Rc="shlink/orphanVisits/GET_ORPHAN_VISITS",Dc="shlink/orphanVisits/GET_ORPHAN_VISITS_LARGE",Ec="shlink/orphanVisits/GET_ORPHAN_VISITS_CANCEL",Vc="shlink/orphanVisits/GET_ORPHAN_VISITS_PROGRESS_CHANGED",Lc={visits:[],loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},Ic=Ve({[wc]:function(){return Object(u.a)(Object(u.a)({},Lc),{},{loading:!0})},[Tc]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},Lc),{},{error:!0,errorData:r})},[Rc]:function(e,t){var r=t.visits;return Object(u.a)(Object(u.a)({},Lc),{},{visits:r})},[Dc]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loadingLarge:!0})},[Ec]:function(e){return Object(u.a)(Object(u.a)({},e),{},{cancelLoad:!0})},[Vc]:function(e,t){var r=t.progress;return Object(u.a)(Object(u.a)({},e),{},{progress:r})},[Pe]:function(e,t){var r=t.createdVisits,n=e.visits,a=r.map((function(e){return e.visit}));return Object(u.a)(Object(u.a)({},e),{},{visits:[].concat(Object(pe.a)(a),Object(pe.a)(n))})}},Lc),Fc=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var r=Object(S.a)(x.a.mark((function r(n,a){var c,s,i,o,l;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=e(a),s=c.getOrphanVisits,i=function(){var e=Object(S.a)(x.a.mark((function e(r,n){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s(Object(u.a)(Object(u.a)({},t),{},{page:r,itemsPerPage:n})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),o=function(){return a().orphanVisits.cancelLoad},l={start:wc,large:Dc,finish:Rc,error:Tc,progress:Vc},r.abrupt("return",ac(i,{},l,n,o));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}()}},Ac=Le(Ec),Mc="shlink/visitsOverview/GET_OVERVIEW_START",Gc="shlink/visitsOverview/GET_OVERVIEW_ERROR",Pc="shlink/visitsOverview/GET_OVERVIEW",Bc={visitsCount:0,orphanVisitsCount:0,loading:!1,error:!1},Hc=Ve({[Mc]:function(){return Object(u.a)(Object(u.a)({},Bc),{},{loading:!0})},[Gc]:function(){return Object(u.a)(Object(u.a)({},Bc),{},{error:!0})},[Pc]:function(e,t){var r=t.visitsCount,n=t.orphanVisitsCount;return Object(u.a)(Object(u.a)({},Bc),{},{visitsCount:r,orphanVisitsCount:n})},[Pe]:function(e,t){var r=e.visitsCount,n=e.orphanVisitsCount,a=void 0===n?0:n,c=Object(Wt.a)(e,["visitsCount","orphanVisitsCount"]),s=t.createdVisits,i=Ga(s),o=i.regularVisits,l=i.orphanVisits;return Object(u.a)(Object(u.a)({},c),{},{visitsCount:r+o.length,orphanVisitsCount:a+l.length})}},Bc),Yc=function(e){return function(){return function(){var t=Object(S.a)(x.a.mark((function t(r,n){var a,c,s;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r({type:Mc}),t.prev=1,a=e(n),c=a.getVisitsOverview,t.next=5,c();case 5:s=t.sent,r(Object(u.a)({type:Pc},s)),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),r({type:Gc});case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,r){return t.apply(this,arguments)}}()}},qc=function e(t,r){var n=this;Object(y.a)(this,e),this.window=t,this.csvjson=r,this.exportVisits=function(e,t){if(t.length){var r=n.csvjson.toCSV(t,{headers:"key"});Tn(n.window,r,e)}}},Wc=function(e,t){e.serviceFactory("MapModal",(function(){return Ia})),e.serviceFactory("ShortUrlVisits",$a,"VisitsExporter"),e.decorator("ShortUrlVisits",t(["shortUrlVisits","shortUrlDetail","mercureInfo","settings"],["getShortUrlVisits","getShortUrlDetail","cancelGetShortUrlVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("TagVisits",Oc,"ColorGenerator","VisitsExporter"),e.decorator("TagVisits",t(["tagVisits","mercureInfo","settings"],["getTagVisits","cancelGetTagVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("OrphanVisits",kc,"VisitsExporter"),e.decorator("OrphanVisits",t(["orphanVisits","mercureInfo","settings"],["getOrphanVisits","cancelGetOrphanVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("VisitsParser",(function(){return n})),e.service("VisitsExporter",qc,"window","csvjson"),e.serviceFactory("getShortUrlVisits",bc,"buildShlinkApiClient"),e.serviceFactory("cancelGetShortUrlVisits",(function(){return hc})),e.serviceFactory("getTagVisits",Nc,"buildShlinkApiClient"),e.serviceFactory("cancelGetTagVisits",(function(){return Uc})),e.serviceFactory("getOrphanVisits",Fc,"buildShlinkApiClient"),e.serviceFactory("cancelGetOrphanVisits",(function(){return Ac})),e.serviceFactory("createNewVisits",(function(){return Be})),e.serviceFactory("loadVisitsOverview",Yc,"buildShlinkApiClient")},zc=r(294),Kc=r.n(zc),Qc=r(295),Jc=r.n(Qc),Zc=function(e){var t=e.tag,r=e.colorGenerator;return Object(c.jsx)("div",{style:{backgroundColor:r.getColorForKey(t)},className:"tag-bullet"})},Xc=function(){},$c=function(e){return function(t){var r=t.tags,n=t.onChange,a=t.listTags,s=t.tagsList,i=t.placeholder,o=void 0===i?"Add tags to the URL":i;Object(h.useEffect)((function(){a()}),[]);return Object(c.jsx)(Kc.a,{value:r,inputProps:{placeholder:o},onlyUnique:!0,renderTag:function(t){var r=t.tag,n=t.key,a=t.disabled,s=t.onRemove,i=t.classNameRemove,o=t.getTagDisplayValue,l=Object(Wt.a)(t,["tag","key","disabled","onRemove","classNameRemove","getTagDisplayValue"]);return Object(c.jsxs)("span",Object(u.a)(Object(u.a)({style:{backgroundColor:e.getColorForKey(r)}},l),{},{children:[o(r),!a&&Object(c.jsx)("span",{className:i,onClick:function(){return s(n)}})]}),n)},renderInput:function(t){var r,n,a=t.addTag,i=Object(Wt.a)(t,["addTag"]),o=null!==(r=null===(n=i.value)||void 0===n?void 0:n.trim().toLowerCase())&&void 0!==r?r:"",l=s.tags.filter((function(e){return e.startsWith(o)}));return Object(c.jsx)(Jc.a,{ref:i.ref,suggestions:l,inputProps:Object(u.a)(Object(u.a)({},i),{},{onChange:function(e,t){"enter"===t.method?e.preventDefault():i.onChange(e)}}),highlightFirstSuggestion:!0,shouldRenderSuggestions:function(e){return e.trim().length>0},getSuggestionValue:function(e){return e},renderSuggestion:function(t){return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(Zc,{tag:t,colorGenerator:e}),t]})},onSuggestionsFetchRequested:Xc,onSuggestionsClearRequested:Xc,onSuggestionSelected:function(e,t){var r=t.suggestion;a(r)}})},addOnBlur:!0,onChange:n})}},es=r(650),ts=function(e,t,r,n){return function(a){var s=a.tag,i=a.tagStats,l=a.selectedServer,u=a.displayed,d=a.toggle,j=Object(Z.c)(),b=Object(I.a)(j,2),h=b[0],v=b[1],O=Object(Z.c)(),f=Object(I.a)(O,2),m=f[0],p=f[1],x=Object(g.d)(l)?l.id:"",S="/server/".concat(x,"/list-short-urls/1?tag=").concat(s);return Object(c.jsxs)(Ce.a,{className:"tag-card",children:[Object(c.jsxs)(Cn.a,{className:"tag-card__header",children:[Object(c.jsx)(fr.a,{color:"link",size:"sm",className:"tag-card__btn tag-card__btn--last",onClick:v,children:Object(c.jsx)(M.a,{icon:A.I})}),Object(c.jsx)(fr.a,{color:"link",size:"sm",className:"tag-card__btn",onClick:p,children:Object(c.jsx)(M.a,{icon:A.y})}),Object(c.jsxs)("h5",{className:"tag-card__tag-title text-ellipsis",children:[Object(c.jsx)(Zc,{tag:s,colorGenerator:n}),Object(c.jsx)(r,{minVersion:"2.2.0",children:Object(c.jsx)("span",{className:"tag-card__tag-name",onClick:d,children:s})}),Object(c.jsx)(r,{maxVersion:"2.1.*",children:Object(c.jsx)(o.b,{to:S,children:s})})]})]}),i&&Object(c.jsx)(es.a,{isOpen:u,children:Object(c.jsxs)(Nn.a,{className:"tag-card__body",children:[Object(c.jsxs)(o.b,{to:S,className:"btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center mb-1",children:[Object(c.jsxs)("span",{className:"text-ellipsis",children:[Object(c.jsx)(M.a,{icon:A.r,className:"mr-2"}),"Short URLs"]}),Object(c.jsx)("b",{children:Rt(i.shortUrlsCount)})]}),Object(c.jsxs)(o.b,{to:"/server/".concat(x,"/tag/").concat(s,"/visits"),className:"btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center",children:[Object(c.jsxs)("span",{className:"text-ellipsis",children:[Object(c.jsx)(M.a,{icon:A.n,className:"mr-2"}),"Visits"]}),Object(c.jsx)("b",{children:Rt(i.visitsCount)})]})]})}),Object(c.jsx)(e,{tag:s,toggle:v,isOpen:h}),Object(c.jsx)(t,{tag:s,toggle:p,isOpen:m})]})}},rs=function(e){var t=e.tag,r=e.toggle,n=e.isOpen,a=e.deleteTag,s=e.tagDelete,i=e.tagDeleted,o=s.deleting,l=s.error,u=s.errorData,d=function(){var e=Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a(t);case 2:i(t),r();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(c.jsxs)(er.a,{toggle:r,isOpen:n,centered:!0,children:[Object(c.jsx)(tr.a,{toggle:r,children:Object(c.jsx)("span",{className:"text-danger",children:"Delete tag"})}),Object(c.jsxs)(rr.a,{children:["Are you sure you want to delete tag ",Object(c.jsx)("b",{children:t}),"?",l&&Object(c.jsx)(ir,{type:"error",small:!0,className:"mt-2",children:Object(c.jsx)(or,{errorData:u,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),Object(c.jsxs)(nr.a,{children:[Object(c.jsx)("button",{className:"btn btn-link",onClick:r,children:"Cancel"}),Object(c.jsx)("button",{className:"btn btn-danger",disabled:o,onClick:d,children:o?"Deleting tag...":"Delete tag"})]})]})},ns=r(697),as=r(307),cs=function(e){var t=e.getColorForKey;return function(e){var r=e.tag,n=e.editTag,a=e.toggle,s=e.tagEdited,i=e.isOpen,o=e.tagEdit,l=Object(h.useState)(r),u=Object(I.a)(l,2),d=u[0],j=u[1],b=Object(h.useState)(t(r)),v=Object(I.a)(b,2),O=v[0],f=v[1],m=Object(Z.c)(),g=Object(I.a)(m,4),p=g[0],y=g[1],C=g[3],N=o.editing,U=o.error,_=o.errorData,k=Object(_e.b)(Object(S.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n(r,d,O).then((function(){return s(r,d,O)})).then(a).catch((function(){})));case 1:case"end":return e.stop()}}),e)}))));return Object(c.jsx)(er.a,{isOpen:i,toggle:a,centered:!0,onClosed:C,children:Object(c.jsxs)("form",{onSubmit:k,children:[Object(c.jsx)(tr.a,{toggle:a,children:"Edit tag"}),Object(c.jsxs)(rr.a,{children:[Object(c.jsxs)("div",{className:"input-group",children:[Object(c.jsx)("div",{className:"input-group-prepend",id:"colorPickerBtn",onClick:y,children:Object(c.jsx)("div",{className:"input-group-text edit-tag-modal__color-picker-toggle",style:{backgroundColor:O,borderColor:O},children:Object(c.jsx)(M.a,{icon:A.w,className:"edit-tag-modal__color-icon"})})}),Object(c.jsx)(ns.a,{isOpen:p,toggle:y,target:"colorPickerBtn",placement:"right",children:Object(c.jsx)(as.a,{color:O,disableAlpha:!0,onChange:function(e){var t=e.hex;return f(t)}})}),Object(c.jsx)("input",{type:"text",value:d,placeholder:"Tag",required:!0,className:"form-control",onChange:function(e){return j(e.target.value)}})]}),U&&Object(c.jsx)(ir,{type:"error",small:!0,className:"mt-2",children:Object(c.jsx)(or,{errorData:_,fallbackMessage:"Something went wrong while editing the tag :("})})]}),Object(c.jsxs)(nr.a,{children:[Object(c.jsx)("button",{type:"button",className:"btn btn-link",onClick:a,children:"Cancel"}),Object(c.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:N,children:N?"Saving...":"Save"})]})]})})}},ss=Math.ceil,is=function(e){return Te((function(t){var r=t.filterTags,n=t.forceListTags,a=t.tagsList,s=t.selectedServer,i=Object(h.useState)(),o=Object(I.a)(i,2),l=o[0],u=o[1];Object(h.useEffect)((function(){n()}),[]);return Object(c.jsxs)(c.Fragment,{children:[!a.loading&&Object(c.jsx)(q,{className:"mb-3",placeholder:"Search tags...",onChange:r}),function(){if(a.loading)return Object(c.jsx)(_r.a,{loading:!0});if(a.error)return Object(c.jsx)(ir,{type:"error",children:Object(c.jsx)(or,{errorData:a.errorData,fallbackMessage:"Error loading tags :("})});var t=a.filteredTags.length;if(t<1)return Object(c.jsx)(_r.a,{children:"No tags found"});var r=Object(qn.a)(ss(t/4),a.filteredTags);return Object(c.jsx)("div",{className:"row",children:r.map((function(t,r){return Object(c.jsx)("div",{className:"col-md-6 col-xl-3",children:t.map((function(t){return Object(c.jsx)(e,{tag:t,tagStats:a.stats[t],selectedServer:s,displayed:l===t,toggle:function(){return u(l!==t?t:void 0)}},t)}))},r)}))})}()]})}),(function(){return[De.visits()]}))},os="shlink/deleteTag/DELETE_TAG_START",ls="shlink/deleteTag/DELETE_TAG_ERROR",us="shlink/deleteTag/DELETE_TAG",ds="shlink/deleteTag/TAG_DELETED",js=Ve({[os]:function(){return{deleting:!0,error:!1}},[ls]:function(e,t){return{deleting:!1,error:!0,errorData:t.errorData}},[us]:function(){return{deleting:!1,error:!1}}},{deleting:!1,error:!1}),bs=function(e){return function(t){return function(){var r=Object(S.a)(x.a.mark((function r(n,a){var c,s;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n({type:os}),c=e(a),s=c.deleteTags,r.prev=2,r.next=5,s([t]);case 5:n({type:us}),r.next=12;break;case 8:throw r.prev=8,r.t0=r.catch(2),n({type:ls,errorData:He(r.t0)}),r.t0;case 12:case"end":return r.stop()}}),r,null,[[2,8]])})));return function(e,t){return r.apply(this,arguments)}}()}},hs=function(e){return{type:ds,tag:e}},vs="shlink/editTag/EDIT_TAG_START",Os="shlink/editTag/EDIT_TAG_ERROR",fs="shlink/editTag/EDIT_TAG",ms="shlink/editTag/TAG_EDITED",gs=Ve({[vs]:function(e){return Object(u.a)(Object(u.a)({},e),{},{editing:!0,error:!1})},[Os]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},e),{},{editing:!1,error:!0,errorData:r})},[fs]:function(e,t){return Object(u.a)(Object(u.a)({},Object(b.a)(["oldName","newName"],t)),{},{editing:!1,error:!1})}},{oldName:"",newName:"",editing:!1,error:!1}),ps=function(e,t){return function(r,n,a){return function(){var c=Object(S.a)(x.a.mark((function c(s,i){var o,l;return x.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return s({type:vs}),o=e(i),l=o.editTag,c.prev=2,c.next=5,l(r,n);case 5:t.setColorForKey(n,a),s({type:fs,oldName:r,newName:n}),c.next=13;break;case 9:throw c.prev=9,c.t0=c.catch(2),s({type:Os,errorData:He(c.t0)}),c.t0;case 13:case"end":return c.stop()}}),c,null,[[2,9]])})));return function(e,t){return c.apply(this,arguments)}}()}},xs=function(e,t,r){return{type:ms,oldName:e,newName:t,color:r}},Ss="shlink/tagsList/LIST_TAGS_START",ys="shlink/tagsList/LIST_TAGS_ERROR",Cs="shlink/tagsList/LIST_TAGS",Ns="shlink/tagsList/FILTER_TAGS",Us={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},_s=function(e,t){return function(r){return r===e?t:r}},ks=function(e,t){return Object(U.a)((function(e){return e===t}),e)},ws=function(e){return Object.entries(e.reduce((function(e,t){var r=t.shortUrl;return null===r||void 0===r||r.tags.forEach((function(t){e[t]=(e[t]||0)+1})),e}),{}))},Ts=Ve({[Ss]:function(){return Object(u.a)(Object(u.a)({},Us),{},{loading:!0})},[ys]:function(e,t){var r=t.errorData;return Object(u.a)(Object(u.a)({},Us),{},{error:!0,errorData:r})},[Cs]:function(e,t){var r=t.tags,n=t.stats;return Object(u.a)(Object(u.a)({},Us),{},{stats:n,tags:r,filteredTags:r})},[ds]:function(e,t){var r=t.tag;return Object(u.a)(Object(u.a)({},e),{},{tags:ks(e.tags,r),filteredTags:ks(e.filteredTags,r)})},[ms]:function(e,t){var r=t.oldName,n=t.newName;return Object(u.a)(Object(u.a)({},e),{},{tags:e.tags.map(_s(r,n)).sort(),filteredTags:e.filteredTags.map(_s(r,n)).sort()})},[Ns]:function(e,t){var r=t.searchTerm;return Object(u.a)(Object(u.a)({},e),{},{filteredTags:e.tags.filter((function(e){return e.toLowerCase().match(r)}))})},[Pe]:function(e,t){var r,n,a=t.createdVisits;return Object(u.a)(Object(u.a)({},e),{},{stats:(r=ws(a),n=e.stats,r.reduce((function(e,t){var r=Object(I.a)(t,2),n=r[0],a=r[1];if(!e[n])return e;var c=e[n];return c.visitsCount=c.visitsCount+a,e[n]=c,e}),Object(u.a)({},n)))})}},Us),Rs=function(e){return{type:Ns,searchTerm:e}},Ds=function(e,t){e.serviceFactory("TagsSelector",$c,"ColorGenerator"),e.decorator("TagsSelector",t(["tagsList"],["listTags"])),e.serviceFactory("TagCard",ts,"DeleteTagConfirmModal","EditTagModal","ForServerVersion","ColorGenerator"),e.serviceFactory("DeleteTagConfirmModal",(function(){return rs})),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.serviceFactory("EditTagModal",cs,"ColorGenerator"),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.serviceFactory("TagsList",is,"TagCard"),e.decorator("TagsList",t(["tagsList","selectedServer","mercureInfo"],["forceListTags","filterTags","createNewVisits","loadMercureInfo"]));var r=function(e){return function(t){return function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(){return function(){var r=Object(S.a)(x.a.mark((function r(n,a){var c,s,i,o,l,u,d,j;return x.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(c=a(),s=c.tagsList,t||!s.loading&&Object(k.a)(s.tags)){r.next=3;break}return r.abrupt("return");case 3:return n({type:Ss}),r.prev=4,i=e(a),o=i.listTags,r.next=8,o();case 8:l=r.sent,u=l.tags,d=l.stats,j=(void 0===d?[]:d).reduce((function(e,t){var r=t.tag,n=t.shortUrlsCount,a=t.visitsCount;return e[r]={shortUrlsCount:n,visitsCount:a},e}),{}),n({tags:u,stats:j,type:Cs}),r.next=19;break;case 16:r.prev=16,r.t0=r.catch(4),n({type:ys,errorData:He(r.t0)});case 19:case"end":return r.stop()}}),r,null,[[4,16]])})));return function(e,t){return r.apply(this,arguments)}}()}}(t.buildShlinkApiClient,e)}};e.factory("listTags",r(!1)),e.factory("forceListTags",r(!0)),e.serviceFactory("filterTags",(function(){return Rs})),e.serviceFactory("tagDeleted",(function(){return hs})),e.serviceFactory("tagEdited",(function(){return xs})),e.serviceFactory("deleteTag",bs,"buildShlinkApiClient"),e.serviceFactory("editTag",ps,"buildShlinkApiClient","ColorGenerator")},Es=r(300),Vs="shlink/mercure/GET_MERCURE_INFO_START",Ls="shlink/mercure/GET_MERCURE_INFO_ERROR",Is="shlink/mercure/GET_MERCURE_INFO",Fs=Ve({[Vs]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loading:!0,error:!1})},[Ls]:function(e){return Object(u.a)(Object(u.a)({},e),{},{loading:!1,error:!0})},[Is]:function(e,t){return Object(u.a)(Object(u.a)({},t),{},{loading:!1,error:!1})}},{loading:!0,error:!1}),As=function(e){return function(){return function(){var t=Object(S.a)(x.a.mark((function t(r,n){var a,c,s,i,o;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r({type:Vs}),a=n(),c=a.settings,s=e(n),i=s.mercureInfo,c.realTimeUpdates.enabled){t.next=6;break}return r({type:Ls}),t.abrupt("return");case 6:return t.prev=6,t.next=9,i();case 9:o=t.sent,r(Object(u.a)({type:Is,interval:c.realTimeUpdates.interval},o)),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),r({type:Ls});case 16:case"end":return t.stop()}}),t,null,[[6,13]])})));return function(e,r){return t.apply(this,arguments)}}()}},Ms=function(e){e.serviceFactory("loadMercureInfo",As,"buildShlinkApiClient")},Gs=function(e){var t,r=e.settings.realTimeUpdates,n=e.toggleRealTimeUpdates,a=e.setRealTimeUpdatesInterval;return Object(c.jsxs)(sr.a,{title:"Real-time updates",className:"h-100",children:[Object(c.jsx)(br.a,{children:Object(c.jsxs)(ma,{checked:r.enabled,onChange:n,children:["Enable or disable real-time updates, when using Shlink v2.2.0 or newer.",Object(c.jsxs)("small",{className:"form-text text-muted",children:["Real-time updates are currently being ",Object(c.jsx)("b",{children:r.enabled?"processed":"ignored"}),"."]})]})}),Object(c.jsxs)(br.a,{className:"mb-0",children:[Object(c.jsx)("label",{className:Y()({"text-muted":!r.enabled}),children:"Real-time updates frequency (in minutes):"}),Object(c.jsx)(Or.a,{type:"number",min:0,placeholder:"Immediate",disabled:!r.enabled,value:(t=r.interval,t?"".concat(t):""),onChange:function(e){return a(Number(e.target.value))}}),r.enabled&&Object(c.jsxs)("small",{className:"form-text text-muted",children:[void 0!==r.interval&&r.interval>0&&Object(c.jsxs)("span",{children:["Updates will be reflected in the UI every ",Object(c.jsx)("b",{children:r.interval})," minute",r.interval>1&&"s","."]}),!r.interval&&"Updates will be reflected in the UI as soon as they happen."]})]})]})},Ps=function(e){var t=e.items;return Object(c.jsx)(c.Fragment,{children:t.map((function(e,t){return Object(c.jsx)(cr.a,{children:e.map((function(e,t){return Object(c.jsx)("div",{className:"col-lg-6 mb-3",children:e},t)}))},t)}))})},Bs=function(e,t,r,n){return function(){return Object(c.jsx)(Ar.a,{children:Object(c.jsx)(Ps,{items:[[Object(c.jsx)(r,{}),Object(c.jsx)(t,{})],[Object(c.jsx)(n,{}),Object(c.jsx)(e,{})]]})})}},Hs=r(703),Ys="shlink/realTimeUpdates/SET_SETTINGS",qs=Ve({[Ys]:function(e,t){return Object(Hs.a)(e,Object(le.a)("type",t))}},{realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:"light"},visits:{defaultInterval:"last30Days"}}),Ws=function(e){return{type:Ys,realTimeUpdates:{enabled:e}}},zs=function(e){return{type:Ys,realTimeUpdates:{interval:e}}},Ks=function(e){return{type:Ys,shortUrlCreation:e}},Qs=function(e){return{type:Ys,ui:e}},Js=function(e){return{type:Ys,visits:e}},Zs=function(e){var t,r=e.settings.shortUrlCreation,n=e.setShortUrlCreationSettings;return Object(c.jsx)(sr.a,{title:"Short URLs creation",className:"h-100",children:Object(c.jsx)(br.a,{className:"mb-0",children:Object(c.jsxs)(ma,{checked:null!==(t=null===r||void 0===r?void 0:r.validateUrls)&&void 0!==t&&t,onChange:function(e){return n({validateUrls:e})},children:["By default, request validation on long URLs when creating new short URLs.",Object(c.jsxs)("small",{className:"form-text text-muted",children:["The initial state of the ",Object(c.jsx)("b",{children:"Validate URL"})," checkbox will be ",Object(c.jsx)("b",{children:null!==r&&void 0!==r&&r.validateUrls?"checked":"unchecked"}),"."]})]})})})},Xs=function(e){var t=e.settings.ui,r=e.setUiSettings;return Object(c.jsxs)(sr.a,{title:"User interface",className:"h-100",children:[Object(c.jsx)(M.a,{icon:"dark"===(null===t||void 0===t?void 0:t.theme)?A.v:A.F,className:"user-interface__theme-icon"}),Object(c.jsx)(ma,{checked:"dark"===(null===t||void 0===t?void 0:t.theme),onChange:function(e){var t=e?"dark":"light";r({theme:t}),Object(O.g)(t)},children:"Use dark theme."})]})},$s=function(e){var t,r=e.onChange,n=e.active;return Object(c.jsx)(X,{text:null!==(t=ie(n))&&void 0!==t?t:"",children:Object(c.jsx)(Oe,{active:n,onChange:r})})},ei=function(e){var t,r,n=e.settings,a=e.setVisitsSettings;return Object(c.jsx)(sr.a,{title:"Visits",className:"h-100",children:Object(c.jsxs)(br.a,{className:"mb-0",children:[Object(c.jsx)("label",{children:"Default interval to load on visits sections:"}),Object(c.jsx)($s,{active:null!==(t=null===(r=n.visits)||void 0===r?void 0:r.defaultInterval)&&void 0!==t?t:"last30Days",onChange:function(e){return a({defaultInterval:e})}})]})})},ti=function(e,t){e.serviceFactory("Settings",Bs,"RealTimeUpdates","ShortUrlCreation","UserInterface","Visits"),e.decorator("Settings",xn.a),e.decorator("Settings",t(null,["resetSelectedServer"])),e.serviceFactory("RealTimeUpdates",(function(){return Gs})),e.decorator("RealTimeUpdates",t(["settings"],["toggleRealTimeUpdates","setRealTimeUpdatesInterval"])),e.serviceFactory("ShortUrlCreation",(function(){return Zs})),e.decorator("ShortUrlCreation",t(["settings"],["setShortUrlCreationSettings"])),e.serviceFactory("UserInterface",(function(){return Xs})),e.decorator("UserInterface",t(["settings"],["setUiSettings"])),e.serviceFactory("Visits",(function(){return ei})),e.decorator("Visits",t(["settings"],["setVisitsSettings"])),e.serviceFactory("toggleRealTimeUpdates",(function(){return Ws})),e.serviceFactory("setRealTimeUpdatesInterval",(function(){return zs})),e.serviceFactory("setShortUrlCreationSettings",(function(){return Ks})),e.serviceFactory("setUiSettings",(function(){return Qs})),e.serviceFactory("setVisitsSettings",(function(){return Js}))},ri="shlink/domainsList/LIST_DOMAINS_START",ni="shlink/domainsList/LIST_DOMAINS_ERROR",ai="shlink/domainsList/LIST_DOMAINS",ci={domains:[],loading:!1,error:!1},si=Ve({[ri]:function(){return Object(u.a)(Object(u.a)({},ci),{},{loading:!0})},[ni]:function(){return Object(u.a)(Object(u.a)({},ci),{},{error:!0})},[ai]:function(e,t){var r=t.domains;return Object(u.a)(Object(u.a)({},ci),{},{domains:r})}},ci),ii=function(e){return function(){return function(){var t=Object(S.a)(x.a.mark((function t(r,n){var a,c,s;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r({type:ri}),a=e(n),c=a.listDomains,t.prev=2,t.next=5,c();case 5:s=t.sent,r({type:ai,domains:s}),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),r({type:ni});case 12:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,r){return t.apply(this,arguments)}}()}},oi=r(699),li=r(707),ui=function(e){var t=e.listDomains,r=e.value,n=e.domainsList,a=e.onChange,s=Object(Z.c)(),i=Object(I.a)(s,4),o=i[0],l=i[2],u=i[3],d=n.domains,j=Object(k.a)(r),b=function(){return a("")};return Object(h.useEffect)((function(){t()}),[]),o?Object(c.jsxs)(oi.a,{children:[Object(c.jsx)(Or.a,{value:r,placeholder:"Domain",onChange:function(e){return a(e.target.value)}}),Object(c.jsxs)(li.a,{addonType:"append",children:[Object(c.jsx)(fr.a,{id:"backToDropdown",outline:!0,type:"button",className:"domains-dropdown__back-btn",onClick:Object(G.a)(b,u),children:Object(c.jsx)(M.a,{icon:A.J})}),Object(c.jsx)(qt.a,{target:"backToDropdown",placement:"left",trigger:"hover",children:"Existing domains"})]})]}):Object(c.jsxs)(X,{text:j?"Domain":"Domain: ".concat(r),className:j?"domains-dropdown__toggle-btn":"domains-dropdown__toggle-btn--active",children:[d.map((function(e){var t=e.domain,n=e.isDefault;return Object(c.jsxs)(z.a,{active:r===t||n&&j,onClick:function(){return a(t)},children:[t,n&&Object(c.jsx)("span",{className:"float-right text-muted",children:"default"})]},t)})),Object(c.jsx)(z.a,{divider:!0}),Object(c.jsx)(z.a,{onClick:Object(G.a)(b,l),children:Object(c.jsx)("i",{children:"New domain"})})]})},di=function(e,t){e.serviceFactory("DomainSelector",(function(){return ui})),e.decorator("DomainSelector",t(["domainsList"],["listDomains"])),e.serviceFactory("listDomains",ii,"buildShlinkApiClient")},ji=new d.a,bi=ji.container,hi=function(e,t){return function(){return e[t].apply(e,arguments)}},vi=function(e,t){return Object(u.a)(Object(u.a)({},e),{},{[t]:hi(bi,t)})},Oi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(i.b)(e?Object(b.a)(e):null,t.reduce(vi,{}))};ji.serviceFactory("App",f,"MainHeader","Home","MenuLayout","CreateServer","EditServer","Settings","ShlinkVersionsContainer"),ji.decorator("App",Oi(["servers","settings"],["fetchServers"])),Object(L.a)(ji,Oi,j.h),V(ji),Lr(ji,Oi),Dn(ji,Oi,j.h),Ds(ji,Oi),Wc(ji,Oi),Object(Es.a)(ji),Ms(ji),ti(ji,Oi),di(ji,Oi);var fi=bi,mi=r(303),gi=r(72),pi=r(213),xi=Object(gi.c)({servers:un,selectedServer:tn,shortUrlsList:Ot,shortUrlsListParams:xt,shortUrlCreationResult:at,shortUrlDeletion:Je,shortUrlEdition:dt,shortUrlVisits:jc,tagVisits:Cc,orphanVisits:Ic,shortUrlDetail:Er,tagsList:Ts,tagDelete:js,tagEdit:gs,mercureInfo:Fs,settings:qs,domainsList:si,visitsOverview:Hc}),Si=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||gi.d,yi={states:["settings","servers"],namespace:"shlink",namespaceSeparator:".",debounce:300},Ci=Object(gi.e)(xi,Object(pi.load)(yi),Si(Object(gi.a)(Object(pi.save)(yi),mi.a))),Ni=r(54),Ui=r.n(Ni),_i=r(304),ki=r(305),wi=r(306);r(631),r(632);delete Ui.a.Icon.Default.prototype._getIconUrl,Ui.a.Icon.Default.mergeOptions({iconRetinaUrl:_i.a,iconUrl:ki.a,shadowUrl:wi.a});var Ti=fi.App,Ri=fi.ScrollToTop,Di=fi.ErrorHandler;Object(s.render)(Object(c.jsx)(i.a,{store:Ci,children:Object(c.jsx)(o.a,{basename:l.a,children:Object(c.jsx)(Di,{children:Object(c.jsx)(Ri,{children:Object(c.jsx)(Ti,{})})})})}),document.getElementById("root"))},93:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(3),a=r(0),c=r(1);function s(e){return function(t){return Object(c.useEffect)((function(){t.resetSelectedServer()}),[]),Object(a.jsx)(e,Object(n.a)({},t))}}}},[[320,1,2]]]); //# sourceMappingURL=main.51efe96b.chunk.js.map