{"version":3,"sources":["common/NotFound.tsx","common/img/ShlinkLogo.tsx","servers/helpers/withSelectedServer.tsx","servers/ServersListGroup.tsx","utils/helpers/hooks.ts","utils/utils.ts","servers/data/index.ts","common/services/provideServices.ts","common/ScrollToTop.tsx","common/ErrorHandler.tsx","utils/services/provideServices.ts","utils/services/LocalStorage.ts","utils/services/ColorGenerator.ts","common/ShlinkVersions.tsx","common/ShlinkVersionsContainer.tsx","common/MainHeader.tsx","common/Home.tsx","common/MenuLayout.tsx","common/AsideMenu.tsx","utils/SimpleCard.tsx","utils/theme/index.ts","utils/helpers/features.ts","utils/Message.tsx","common/NoMenuLayout.tsx","utils/helpers/version.ts","utils/SearchField.tsx","App.tsx","api/services/ShlinkApiClient.ts","api/services/ShlinkApiClientBuilder.ts","api/services/provideServices.ts","short-urls/ShortUrls.tsx","tags/helpers/Tag.tsx","utils/DropdownBtn.tsx","utils/helpers/date.ts","utils/dates/types/index.ts","utils/DateInput.tsx","utils/dates/DateRangeRow.tsx","utils/dates/DateIntervalDropdownItems.tsx","utils/dates/DateRangeSelector.tsx","short-urls/SearchBar.tsx","utils/SortingDropdown.tsx","mercure/helpers/boundToMercureHub.tsx","mercure/helpers/index.ts","utils/helpers/query.ts","mercure/helpers/Topics.ts","utils/helpers/redux.ts","visits/VisitsStats.tsx","short-urls/helpers/index.ts","visits/reducers/visitCreation.ts","api/utils/index.ts","short-urls/reducers/shortUrlDeletion.ts","short-urls/reducers/shortUrlCreation.ts","short-urls/reducers/shortUrlEdition.ts","short-urls/reducers/shortUrlsList.ts","short-urls/reducers/shortUrlsListParams.ts","utils/helpers/numbers.ts","utils/helpers/pagination.ts","short-urls/Paginator.tsx","short-urls/ShortUrlsList.tsx","utils/CopyToClipboardIcon.tsx","short-urls/helpers/ShortUrlDetailLink.tsx","short-urls/helpers/ShortUrlVisitsCount.tsx","short-urls/helpers/ShortUrlsRow.tsx","short-urls/helpers/ShortUrlsRowMenu.tsx","short-urls/CreateShortUrl.tsx","utils/Result.tsx","api/ShlinkApiError.tsx","short-urls/helpers/DeleteShortUrlModal.tsx","short-urls/helpers/CreateShortUrlResult.tsx","short-urls/ShortUrlsTable.tsx","utils/helpers/qrCodes.ts","short-urls/helpers/QrCodeModal.tsx","utils/BooleanControl.tsx","utils/Checkbox.tsx","short-urls/UseExistingIfFoundInfoIcon.tsx","short-urls/ShortUrlForm.tsx","short-urls/EditShortUrl.tsx","short-urls/reducers/shortUrlDetail.ts","short-urls/services/provideServices.ts","utils/FormGroupContainer.tsx","servers/helpers/ServerForm.tsx","servers/CreateServer.tsx","servers/ServersDropdown.tsx","servers/DeleteServerModal.tsx","servers/DeleteServerButton.tsx","servers/EditServer.tsx","servers/helpers/ImportServersBtn.tsx","servers/reducers/selectedServer.ts","servers/reducers/servers.ts","servers/reducers/remoteServers.ts","servers/helpers/ForServerVersion.tsx","servers/helpers/ServerError.tsx","servers/Overview.tsx","servers/services/ServersImporter.ts","utils/helpers/csv.ts","servers/services/ServersExporter.ts","servers/services/provideServices.ts","visits/VisitsHeader.tsx","visits/ShortUrlVisitsHeader.tsx","utils/PaginationDropdown.tsx","common/SimplePaginator.tsx","utils/helpers/visits.ts","utils/helpers/charts.ts","visits/helpers/DefaultChart.tsx","visits/helpers/GraphCard.tsx","visits/helpers/SortableBarGraph.tsx","utils/ToggleSwitch.tsx","visits/helpers/LineChartCard.tsx","visits/VisitsTable.tsx","visits/helpers/MapModal.tsx","visits/helpers/OpenMapModalBtn.tsx","visits/types/helpers.ts","visits/services/VisitsParser.ts","visits/helpers/OrphanVisitTypeDropdown.tsx","visits/ShortUrlVisits.tsx","visits/reducers/common.ts","visits/reducers/shortUrlVisits.ts","visits/TagVisitsHeader.tsx","visits/TagVisits.tsx","visits/reducers/tagVisits.ts","visits/OrphanVisitsHeader.tsx","visits/OrphanVisits.tsx","visits/reducers/orphanVisits.ts","visits/reducers/visitsOverview.ts","visits/services/VisitsExporter.ts","visits/services/provideServices.ts","tags/helpers/TagBullet.tsx","tags/helpers/TagsSelector.tsx","tags/TagCard.tsx","tags/helpers/DeleteTagConfirmModal.tsx","tags/helpers/EditTagModal.tsx","tags/TagsList.tsx","tags/reducers/tagDelete.ts","tags/reducers/tagEdit.ts","tags/reducers/tagsList.ts","tags/services/provideServices.ts","mercure/reducers/mercureInfo.ts","mercure/services/provideServices.ts","settings/RealTimeUpdates.tsx","settings/Settings.tsx","settings/reducers/settings.ts","settings/ShortUrlCreation.tsx","settings/UserInterface.tsx","utils/dates/DateIntervalSelector.tsx","settings/Visits.tsx","settings/services/provideServices.ts","domains/reducers/domainsList.ts","domains/DomainSelector.tsx","domains/services/provideServices.ts","container/index.ts","reducers/index.ts","container/store.ts","utils/helpers/leaflet.ts","index.tsx","servers/helpers/withoutSelectedServer.tsx"],"names":["NotFound","to","children","className","ShlinkLogo","color","MAIN_COLOR","viewBox","version","xmlns","fill","d","withSelectedServer","WrappedComponent","ServerError","props","selectServer","selectedServer","match","useEffect","params","serverId","isNotFoundServer","loading","ServerListItem","id","name","ListGroupItem","tag","Link","icon","chevronIcon","ServersListGroup","servers","embedded","length","ListGroup","classNames","map","useStateFlagTimeout","setTimeout","clearTimeout","initialValue","delay","useState","flag","setFlag","timeout","useRef","undefined","callback","current","useToggle","useSwipeable","showSidebar","hideSidebar","swipeMenuIfNoModalExists","e","event","composedPath","some","classList","contains","document","querySelector","useReactSwipeable","delta","onSwipedLeft","onSwipedRight","determineOrderDir","currentField","newField","currentOrderDir","ASC","DESC","rangeOf","size","mappingFn","startAt","range","hasValue","value","isNil","isEmpty","handleEventPreventingDefault","handler","pipe","preventDefault","hasServerData","server","url","apiKey","isServerWithId","hasOwnProperty","isReachableServer","provideServices","bottle","connect","withRouter","constant","global","window","console","axios","serviceFactory","ScrollToTop","decorator","MainHeader","Home","withoutSelectedServer","MenuLayout","AsideMenu","ShlinkVersionsContainer","ErrorHandler","location","scrollTo","error","state","hasError","this","outline","onClick","reload","Component","localStorage","service","LocalStorage","ColorGenerator","buildPath","path","get","key","item","getItem","JSON","parse","set","setItem","stringify","floor","Math","random","letters","normalizeKey","toLowerCase","trim","storage","colors","getColorForKey","normalizedKey","setColorForKey","join","normalizeVersion","versionToSemVer","versionToPrintable","VersionLink","project","href","ShlinkVersions","clientVersion","normalizedClientVersion","printableVersion","classes","ServersDropdown","isOpen","toggleOpen","close","pathname","toggleClass","Navbar","dark","fixed","expand","NavbarBrand","NavbarToggler","arrowIcon","Collapse","navbar","Nav","NavItem","NavLink","active","cogsIcon","serversList","values","hasServers","Card","Row","noGutters","TagsList","ShortUrls","CreateShortUrl","ShortUrlVisits","TagVisits","OrphanVisits","Overview","EditShortUrl","sidebarVisible","toggleSidebar","addTagsVisitsRoute","supportsTagVisits","addOrphanVisitsRoute","supportsOrphanVisits","burgerClasses","swipeableProps","burgerIcon","showOnMobile","exact","from","component","render","AsideMenuItem","rest","activeClassName","DeleteServerButton","asideClass","suffix","overviewIcon","isActive","_","listIcon","createIcon","flip","tagsIcon","editIcon","textClassName","SimpleCard","title","bodyClassName","MAIN_COLOR_ALPHA","HIGHLIGHTED_COLOR","HIGHLIGHTED_COLOR_ALPHA","PRIMARY_LIGHT_COLOR","PRIMARY_DARK_COLOR","changeThemeInMarkup","theme","html","getElementsByTagName","setAttribute","isDarkThemeEnabled","getAttribute","serverMatchesVersions","versions","versionMatch","supportsSettingShortCodeLength","minVersion","supportsListingDomains","supportsQrCodeSvgFormat","supportsValidateUrl","supportsQrCodeSizeInQuery","supportsShortUrlTitle","supportsQrCodeMargin","supportsTagsInPatch","getClassForType","type","default","getTextClassForType","Message","fullWidth","body","preloader","spin","NoMenuLayout","versionToMatch","maxVersion","matchesMinVersion","compare","versionIsValidSemVer","memoizeWith","identity","defaultValue","timer","App","CreateServer","EditServer","Settings","fetchServers","settings","Object","keys","ui","buildShlinkBaseUrl","apiVersion","rejectNilProps","reject","ShlinkApiClient","baseUrl","listShortUrls","a","performRequest","then","data","shortUrls","createShortUrl","options","filteredOptions","resp","getShortUrlVisits","shortCode","query","visits","getTagVisits","getOrphanVisits","getVisitsOverview","getShortUrl","domain","deleteShortUrl","updateShortUrlTags","tags","updateShortUrl","listTags","withStats","stats","deleteTags","editTag","oldName","newName","health","mercureInfo","listDomains","domains","method","headers","paramsSerializer","qs","arrayFormat","response","apiClients","buildShlinkApiClient","getStateOrSelectedServer","getState","isGetState","prop","Error","clientKey","SearchBar","ShortUrlsList","page","urlsListKey","setUrlsListKey","SearchField","onChange","placeholder","large","noBorder","searchTerm","setSearchTerm","resetTimer","searchTermChanged","newSearchTerm","target","searchIcon","hidden","Tag","text","clearable","colorGenerator","onClose","style","backgroundColor","cursor","DropdownBtn","disabled","dropdownClassName","right","toggle","toggleClasses","Dropdown","DropdownToggle","caret","DropdownMenu","formatDateFromFormat","date","format","isMomentObject","formatIsoDate","formatInternational","formatDate","dateRangeIsEmpty","dateRange","filter","Boolean","rangeIsInterval","INTERVAL_TO_STRING_MAP","today","yesterday","last7Days","last30Days","last90Days","last180days","last365Days","DATE_INTERVALS","rangeOrIntervalToString","startDate","endDate","dateRangeToString","intervalToDateRange","dateInterval","moment","startOf","subtract","endOf","transformProps","dissoc","toDate","maxDate","minDate","selected","DateInput","isClearable","showCalendarIcon","ref","dateFormat","calendarIcon","input","focus","DateRangeRow","onStartDateChange","onEndDateChange","placeholderText","DateIntervalDropdownItems","interval","DropdownItem","DateRangeSelector","onDatesChange","initialDateRange","defaultText","activeInterval","setActiveInterval","activeDateRange","setActiveDateRange","updateDateRange","updateInterval","divider","header","dateOrNull","shortUrlsListParams","selectedTags","setDates","dates","selectedTag","SortingDropdown","items","orderField","orderDir","isButton","handleItemClick","fieldKey","newOrderDir","UncontrolledDropdown","toPairs","fieldValue","sortAscIcon","sortDescIcon","boundToMercureHub","getTopicsForProps","pendingUpdates","Set","createNewVisits","loadMercureInfo","closeEventSource","topics","onMessage","onTokenExpired","mercureHubUrl","token","onEventSourceMessage","onEventSourceError","status","subscriptions","topic","hubUrl","URL","searchParams","append","es","EventSource","Authorization","onmessage","onerror","forEach","bindToMercureTopic","visit","add","setInterval","clear","clearInterval","parseQuery","search","ignoreQueryPrefix","Topics","shortUrlVisits","orphanVisits","selectedBar","buildReducer","initialState","action","actionHandler","currentState","buildActionCreator","shortUrlMatches","shortUrl","CREATE_VISITS","createdVisits","parseApiError","isInvalidDeletionError","DELETE_SHORT_URL_START","DELETE_SHORT_URL_ERROR","SHORT_URL_DELETED","RESET_DELETE_SHORT_URL","errorData","dispatch","resetDeleteShortUrl","CREATE_SHORT_URL_START","CREATE_SHORT_URL_ERROR","CREATE_SHORT_URL","RESET_CREATE_SHORT_URL","result","saving","resetCreateShortUrl","EDIT_SHORT_URL_START","EDIT_SHORT_URL_ERROR","SHORT_URL_EDITED","editShortUrl","sendTagsSeparately","Promise","all","LIST_SHORT_URLS_START","LIST_SHORT_URLS_ERROR","LIST_SHORT_URLS","assocPath","pagination","totalItems","currentShortUrl","lastVisit","last","assoc","visitsCount","init","editedShortUrl","RESET_SHORT_URL_PARAMS","SORTABLE_FIELDS","dateCreated","longUrl","orderBy","resetShortUrlParams","ceil","formatter","Intl","NumberFormat","prettify","number","ELLIPSIS","progressivePagination","currentPage","pageCount","pages","max","min","unshift","push","pageIsEllipsis","pageNumber","prettifyPageNumber","keyForPage","index","Paginator","paginator","pagesCount","Pagination","listClassName","PaginationItem","PaginationLink","previous","next","ShortUrlsTable","shortUrlsList","head","order","setOrder","refreshList","extraParams","handleOrderBy","itemsPerPage","orderByColumn","field","renderOrderIcon","caretUpIcon","caretDownIcon","onTagClick","CopyToClipboardIcon","onCopy","copyIcon","buildUrl","ShortUrlDetailLink","ShortUrlVisitsCount","maxVisits","meta","visitsLink","prettifiedMaxVisits","tooltipRef","el","infoIcon","UncontrolledTooltip","placement","ShortUrlsRow","ShortUrlsRowMenu","copiedToClipboard","setCopiedToClipboard","setActive","isFirstRun","data-th","DeleteShortUrlModal","QrCodeModal","isQrModalOpen","toggleQrCode","isDeleteModalOpen","toggleDelete","ButtonDropdown","menuIcon","pieChartIcon","fixedWidth","qrIcon","deleteIcon","ShortUrlForm","CreateShortUrlResult","shortUrlCreationResult","basicMode","shortUrlCreationSettings","shortUrlCreation","useMemo","customSlug","shortCodeLength","validSince","validUntil","findIfExists","validateUrl","validateUrls","getInitialState","mode","onSave","canBeClosed","Result","small","ShlinkApiError","fallbackMessage","detail","invalidElements","shortUrlDeletion","inputValue","setInputValue","handleDeleteUrl","catch","Modal","centered","onSubmit","ModalHeader","ModalBody","ModalFooter","showCopyTooltip","setShowCopyTooltip","closeIcon","Tooltip","actionableFieldClasses","orderableColumnsClasses","tableClasses","supportsTitle","colSpan","buildQrCodeUrl","margin","useSizeInPath","svgIsSupported","marginIsSupported","stringifyQuery","setSize","setMargin","setFormat","capabilities","qrCodeUrl","totalSize","modalSize","FormGroup","step","Number","src","alt","BooleanControl","checked","inline","uuid","typeClasses","display","htmlFor","Checkbox","InfoModal","UseExistingIfFoundInfoIcon","isModalOpen","toggleModal","normalizeTag","replace","TagsSelector","DomainSelector","shortUrlData","setShortUrlData","isEdit","submit","renderOptionalInput","Input","renderDateInput","m","basicComponents","bsSize","required","showDomainSelector","disableShortCodeLength","showCustomizeCard","limitAccessCardClasses","showValidateUrl","showExtraValidationsCard","Button","goBack","history","shortUrlDetail","getShortUrlDetail","shortUrlEdition","savingError","savingErrorData","savingSucceeded","isSuccessful","isNotSuccessful","faArrowLeft","GET_SHORT_URL_DETAIL_START","GET_SHORT_URL_DETAIL_ERROR","GET_SHORT_URL_DETAIL","find","FormGroupContainer","ServerForm","initialValues","setName","setUrl","setApiKey","handleSubmit","ImportResult","ImportServersBtn","createServer","serversImported","setServersImported","errorImporting","setErrorImporting","serverData","onImport","onImportError","serversExporter","createServerItem","plusIcon","nav","inNavbar","serverIcon","exportServers","exportIcon","DeleteServerModal","deleteServer","showModal","hideModal","editServer","importServersFromFile","createServers","fileRef","files","click","accept","SELECT_SERVER","RESET_SELECTED_SERVER","toSemVer","getServerVersion","_serverId","resetSelectedServer","serverNotFound","serverNotReachable","EDIT_SERVER","DELETE_SERVER","CREATE_SERVERS","newServers","serversListToMap","reduce","acc","responseToServersList","Array","isArray","homepage","remoteList","ForServerVersion","tagsList","loadVisitsOverview","visitsOverview","loadingTags","loadingVisits","orphanVisitsCount","useHistory","CardTitle","CardText","CardHeader","CardBody","CSV_MIME_TYPES","isCsv","file","includes","ServersImporter","csvjson","fileReaderFactory","reader","resolve","addEventListener","content","toString","toObject","readAsText","saveCsv","csv","filename","link","createElement","blob","Blob","createObjectURL","visibility","appendChild","removeChild","ServersExporter","toCSV","FileReader","VisitsHeader","ShortUrlVisitsHeader","shortLink","longLink","visitsStatsTitle","fromNow","PaginationDropdown","toggleClassName","ranges","setValue","Infinity","SimplePaginator","setCurrentPage","DEFAULT","BROWSERS_WHITELIST","extractDomain","split","fillTheGaps","labels","zipObj","pointerOnHover","chartElement","renderNonDoughnutChartLabel","labelToPick","datasets","datasetIndex","datasetLabel","label","renderDoughnutChartLabel","dropLabelIfHidden","startsWith","renderPieChartLegend","config","defaultColor","chartElementAtEvent","chart","_index","_chart","statsAreDefined","DefaultChart","isBarChart","highlightedStats","highlightedLabel","HorizontalBar","Doughnut","highlightedKey","highlightedData","chartRef","setChartRef","legend","legendCallback","scales","xAxes","ticks","beginAtZero","precision","stacked","yAxes","tooltips","intersect","yLabel","callbacks","onHover","graphData","borderColor","borderWidth","generateGraphData","height","determineHeight","element","getElementAtEvent","chartInstance","generateLegend","GraphCard","footer","CardFooter","toLowerIfString","toLower","pickKeyFromPair","pickValueFromPair","SortableBarGraph","sortingItems","extraHeaderContent","withPagination","setItemsPerPage","determineCurrentPagePairs","firstPageLength","i","sortedPairs","pairs","sortBy","reverse","getSortedPairsForStats","sortedKeys","sortedHighlightedPairs","currentPageStats","fromPairs","currentPageHighlightedStats","splitEvery","highlightedPages","determineStats","activeCities","ToggleSwitch","STEPS_MAP","monthly","weekly","daily","hourly","STEP_TO_DATE_UNIT_MAP","STEP_TO_DATE_FORMAT","firstWeekDay","isoWeekday","lastWeekDay","groupVisitsByStep","countBy","generateLabelsAndGroupedVisits","groupedVisitsWithGaps","skipNoElements","unit","newerDate","oldestDate","diff","generateLabels","generateDataset","lineTension","selectedLabel","datasetsByPoint","setSelectedVisits","LineChartCard","highlightedVisits","oldestVisitDate","now","cond","always","matcher","determineInitialStep","setStep","skipNoVisits","toggleSkipNoVisits","visitsToDatasetGroups","groupedVisits","groupedHighlighted","maintainAspectRatio","scaleLabel","labelString","axis","entries","menuText","searchVisits","browser","os","referer","country","city","visitedUrl","visitMatchesSearch","VisitsTable","selectedVisits","matchMedia","isOrphanVisits","headerCellsClass","matchMobile","matches","isMobileDevice","setIsMobileDevice","dir","resultSet","allVisits","sortedVisits","sort","b","greaterThan","smallerThan","sortVisits","total","visitsGroups","calculateVisits","isFirstLoad","setPage","end","start","listener","removeEventListener","flat","checkIcon","isSelected","v","OpenStreetMapTile","TileLayer","attribution","calculateMapProps","locations","bounds","zoom","center","latLong","MapModal","contentClassName","MapContainer","cityName","count","Marker","position","Popup","OpenMapModalBtn","modalTitle","mapIsOpened","openMap","closeMap","dropdownIsOpened","toggleDropdown","openDropdown","locationsToShow","setLocationsToShow","buttonRef","openMapWithLocations","filtered","mapIcon","isOrphanVisit","groupNewVisitsByType","groupBy","newVisit","regularVisits","highlightedVisitsToStats","property","visitHasProperty","propertyName","optionalNumericToNumber","numeric","parseFloat","updateLocationsStatsForVisit","updateCountriesStatsForVisit","updateCitiesStatsForVisit","processStatsFromVisits","osStats","updateOsStatsForVisit","browsersStats","updateBrowsersStatsForVisit","browsers","referrersStats","updateReferrersStatsForVisit","referrers","countries","cities","citiesForMapStats","latitude","longitude","currentCity","updateCitiesForMapForVisit","citiesForMap","visitedUrlsStats","isNormalizedOrphanVisit","updateVisitedUrlsForVisit","visitedUrls","normalizeVisits","userAgent","visitLocation","common","bowser","parseUserAgent","countryName","OrphanVisitTypeDropdown","sections","byTime","subPath","faCalendarAlt","byContext","faChartPie","byLocation","faMapMarkedAlt","list","faList","VisitsNavLink","RouterNavLink","endsWith","VisitsStats","visitsInfo","getVisits","cancelGetVisits","exportCsv","initialInterval","defaultInterval","setDateRange","setHighlightedVisits","setHighlightedLabel","orphanVisitType","setOrphanVisitType","buildSectionUrl","loadingLarge","progress","normalizedVisits","normalizedVisit","normalizeAndFilterVisits","mapLocations","highlightVisitsForProp","newSelectedBar","propEq","faFileDownload","Progress","striped","pills","section","amount","exportVisits","cancelGetShortUrlVisits","ITEMS_PER_PAGE","isLastPage","calcProgress","getVisitsWithLoader","visitsLoader","extraFinishActionData","actionMap","shouldCancel","loadVisitsInParallel","flatten","loadPagesBlocks","pagesBlocks","concat","loadVisits","pagesRange","finish","GET_SHORT_URL_VISITS_START","GET_SHORT_URL_VISITS_ERROR","GET_SHORT_URL_VISITS","GET_SHORT_URL_VISITS_LARGE","GET_SHORT_URL_VISITS_CANCEL","GET_SHORT_URL_VISITS_PROGRESS_CHANGED","cancelLoad","newVisits","TagVisitsHeader","tagVisits","cancelGetTagVisits","GET_TAG_VISITS_START","GET_TAG_VISITS_ERROR","GET_TAG_VISITS","GET_TAG_VISITS_LARGE","GET_TAG_VISITS_CANCEL","GET_TAG_VISITS_PROGRESS_CHANGED","OrphanVisitsHeader","cancelGetOrphanVisits","GET_ORPHAN_VISITS_START","GET_ORPHAN_VISITS_ERROR","GET_ORPHAN_VISITS","GET_ORPHAN_VISITS_LARGE","GET_ORPHAN_VISITS_CANCEL","GET_ORPHAN_VISITS_PROGRESS_CHANGED","GET_OVERVIEW_START","GET_OVERVIEW_ERROR","GET_OVERVIEW","VisitsExporter","visitsParser","TagBullet","noop","inputProps","onlyUnique","renderTag","onRemove","classNameRemove","getTagDisplayValue","other","renderInput","addTag","otherProps","suggestions","highlightFirstSuggestion","shouldRenderSuggestions","getSuggestionValue","suggestion","renderSuggestion","onSuggestionsFetchRequested","onSuggestionsClearRequested","onSuggestionSelected","addOnBlur","TagCard","DeleteTagConfirmModal","EditTagModal","tagStats","displayed","isEditModalOpen","toggleEdit","shortUrlsLink","faLink","shortUrlsCount","faEye","deleteTag","tagDelete","tagDeleted","deleting","doDelete","tagEdited","tagEdit","newTagName","setNewTagName","setColor","showColorPicker","toggleColorPicker","hideColorPicker","editing","saveTag","onClosed","colorIcon","Popover","disableAlpha","hex","filterTags","forceListTags","displayedTag","setDisplayedTag","tagsCount","filteredTags","tagsGroups","group","renderContent","DELETE_TAG_START","DELETE_TAG_ERROR","DELETE_TAG","TAG_DELETED","EDIT_TAG_START","EDIT_TAG_ERROR","EDIT_TAG","TAG_EDITED","pick","LIST_TAGS_START","LIST_TAGS_ERROR","LIST_TAGS","FILTER_TAGS","renameTag","rejectTag","tagToReject","calculateVisitsPerTag","increase","listTagsActionFactory","force","processedStats","factory","GET_MERCURE_INFO_START","GET_MERCURE_INFO_ERROR","GET_MERCURE_INFO","realTimeUpdates","enabled","info","RealTimeUpdates","toggleRealTimeUpdates","setRealTimeUpdatesInterval","SettingsSections","child","subChild","subIndex","ShortUrlCreation","UserInterface","Visits","SET_SETTINGS","mergeDeepRight","setShortUrlCreationSettings","setUiSettings","setVisitsSettings","faMoon","faSun","useDarkTheme","DateIntervalSelector","LIST_DOMAINS_START","LIST_DOMAINS_ERROR","LIST_DOMAINS","domainsList","inputDisplayed","showInput","hideInput","valueIsEmpty","unselectDomain","InputGroup","InputGroupAddon","addonType","faUndo","trigger","isDefault","Bottle","container","lazyService","serviceName","mapActionService","actionName","propsFromState","actionServiceNames","reduxConnect","provideCommonServices","provideApiServices","provideShortUrlsServices","provideServersServices","provideTagsServices","provideVisitsServices","provideUtilsServices","provideMercureServices","provideSettingsServices","provideDomainsServices","combineReducers","serversReducer","selectedServerReducer","shortUrlsListReducer","shortUrlsListParamsReducer","shortUrlCreationReducer","shortUrlDeletionReducer","shortUrlEditionReducer","shortUrlVisitsReducer","tagVisitsReducer","orphanVisitsReducer","shortUrlDetailReducer","tagsListReducer","tagDeleteReducer","tagEditReducer","mercureInfoReducer","settingsReducer","domainsListReducer","visitsOverviewReducer","composeEnhancers","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","localStorageConfig","states","namespace","namespaceSeparator","debounce","store","createStore","reducers","load","applyMiddleware","save","ReduxThunk","L","Icon","Default","prototype","_getIconUrl","mergeOptions","iconRetinaUrl","marker2x","iconUrl","marker","shadowUrl","markerShadow","basename","getElementById"],"mappings":"iNAsBeA,IAdqB,SAAC,GAAD,QAAGC,UAAH,MAAQ,IAAR,MAAaC,gBAAb,MAAwB,OAAxB,SAClC,qBAAKC,UAAU,OAAf,SACE,eAAC,IAAD,CAAYA,UAAU,MAAtB,UACE,0EACA,iJAIA,uBACA,cAAC,IAAD,CAAMF,GAAIA,EAAIE,UAAU,iCAAxB,SAA0DD,W,sFCVnDE,EAAa,SAAC,GAAD,QAAGC,aAAH,MAAWC,IAAX,EAAuBH,EAAvB,EAAuBA,UAAvB,OACxB,qBAAKA,UAAWA,EAAWI,QAAQ,cAAcC,QAAQ,MAAMC,MAAM,6BAArE,SACE,oBAAGC,KAAML,EAAT,UACE,sBACEM,EAAE,6lBAEJ,sBACEA,EAAE,uiBAEJ,sBACEA,EAAE,uiBAEJ,sBACEA,EAAE,8X,oHCTH,SAASC,EAA2BC,EAAmDC,GAC5F,OAAO,SAACC,GAAwC,IACtCC,EAAwCD,EAAxCC,aAAcC,EAA0BF,EAA1BE,eAAgBC,EAAUH,EAAVG,MAMtC,OAJAC,qBAAU,WACRH,EAAaE,EAAME,OAAOC,YACzB,CAAEH,EAAME,OAAOC,WAEbJ,EAQDK,YAAiBL,GACZ,cAACH,EAAD,IAGF,cAACD,EAAD,eAAsBE,IAVzB,cAAC,IAAD,UACE,cAAC,IAAD,CAASQ,SAAO,S,sGCRpBC,EAAiB,SAAC,GAAD,IAAGC,EAAH,EAAGA,GAAIC,EAAP,EAAOA,KAAP,OACrB,eAACC,EAAA,EAAD,CAAeC,IAAKC,IAAM5B,GAAE,kBAAawB,GAAMtB,UAAU,4BAAzD,UACGuB,EACD,cAAC,IAAD,CAAiBI,KAAMC,IAAa5B,UAA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B,gBAA6B,CAC1C5wC,QAAS6wC,GACT7xC,eAAgB8xC,GAChB/uB,cAAegvB,GACf53B,oBAAqB63B,GACrB/rB,uBAAwBgsB,GACxB1qB,iBAAkB2qB,GAClB/lB,gBAAiBgmB,GACjBz0B,eAAgB00B,GAChB5K,UAAW6K,GACX10B,aAAc20B,GACdrmB,eAAgBsmB,GAChBhiB,SAAUiiB,GACVzH,UAAW0H,GACXrH,QAASsH,GACT7/B,YAAa8/B,GACbviC,SAAUwiC,GACV/C,YAAagD,GACbpiB,eAAgBqiB,KCjCZC,GAA+C3tC,OAAe4tC,sCAAwCC,KAEtGC,GAAiC,CACrCC,OAAQ,CAAE,WAAY,WACtBC,UAAW,SACXC,mBAAoB,IACpBC,SAAU,KAOGC,GAJDC,aAAYC,GAAUC,gBAAKR,IAAqBH,GAC5DY,aAAgBC,gBAAKV,IAAqBW,Q,uECVlCC,KAAEC,KAAKC,QAAQC,UAAkBC,YAEzCJ,KAAEC,KAAKC,QAAQG,aAAa,CAC1BC,cAAeC,KACfC,QAASC,KACTC,UAAWC,O,ICGP1kC,GAAmC2gC,GAAnC3gC,IAAKvK,GAA8BkrC,GAA9BlrC,YAAaQ,GAAiB0qC,GAAjB1qC,aAE1BiG,iBACE,cAAC,IAAD,CAAUsnC,MAAOA,GAAjB,SACE,cAAC,IAAD,CAAemB,SAAUtkB,IAAzB,SACE,cAACpqB,GAAD,UACE,cAACR,GAAD,UACE,cAAC,GAAD,YAKR1C,SAAS6xC,eAAe,U,2FCpBnB,SAAS/uC,EAA8BhG,GAC5C,OAAO,SAACE,GAKN,OAJAI,qBAAU,WACRJ,EAAMyvB,wBACL,IAEI,cAAC3vB,EAAD,eAAsBE,Q","file":"static/js/main.faf0a2a6.chunk.js","sourcesContent":["import { FC } from 'react';\nimport { Link } from 'react-router-dom';\nimport { SimpleCard } from '../utils/SimpleCard';\n\ninterface NotFoundProps {\n to?: string;\n}\n\nconst NotFound: FC = ({ to = '/', children = 'Home' }) => (\n
\n \n

Oops! We could not find requested route.

\n

\n Use your browser's back button to navigate to the page you have previously come from, or just press this\n button.\n

\n
\n {children}\n
\n
\n);\n\nexport default NotFound;\n","import { MAIN_COLOR } from '../../utils/theme';\n\nexport interface ShlinkLogoProps {\n color?: string;\n className?: string;\n}\n\nexport const ShlinkLogo = ({ color = MAIN_COLOR, className }: ShlinkLogoProps) => (\n \n \n \n \n \n \n \n \n);\n","import { FC, useEffect } from 'react';\nimport { RouteComponentProps } from 'react-router';\nimport Message from '../../utils/Message';\nimport { isNotFoundServer, SelectedServer } from '../data';\nimport NoMenuLayout from '../../common/NoMenuLayout';\n\ninterface WithSelectedServerProps extends RouteComponentProps<{ serverId: string }> {\n selectServer: (serverId: string) => void;\n selectedServer: SelectedServer;\n}\n\nexport function withSelectedServer(WrappedComponent: FC, ServerError: FC) {\n return (props: WithSelectedServerProps & T) => {\n const { selectServer, selectedServer, match } = props;\n\n useEffect(() => {\n selectServer(match.params.serverId);\n }, [ match.params.serverId ]);\n\n if (!selectedServer) {\n return (\n \n \n \n );\n }\n\n if (isNotFoundServer(selectedServer)) {\n return ;\n }\n\n return ;\n };\n}\n","import { FC } from 'react';\nimport { ListGroup, ListGroupItem } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronRight as chevronIcon } from '@fortawesome/free-solid-svg-icons';\nimport { ServerWithId } from './data';\nimport './ServersListGroup.scss';\n\ninterface ServersListGroupProps {\n servers: ServerWithId[];\n embedded?: boolean;\n}\n\nconst ServerListItem = ({ id, name }: { id: string; name: string }) => (\n \n {name}\n \n \n);\n\nconst ServersListGroup: FC = ({ servers, children, embedded = false }) => (\n <>\n {children &&
{children}
}\n {servers.length > 0 && (\n \n {servers.map(({ id, name }) => )}\n \n )}\n \n);\n\nexport default ServersListGroup;\n","import { useState, useRef } from 'react';\nimport { useSwipeable as useReactSwipeable } from 'react-swipeable';\n\nconst DEFAULT_DELAY = 2000;\n\nexport type StateFlagTimeout = (initialValue?: boolean, delay?: number) => [ boolean, () => void ];\n\nexport const useStateFlagTimeout = (\n setTimeout: (callback: Function, timeout: number) => number,\n clearTimeout: (timer: number) => void,\n): StateFlagTimeout => (initialValue = false, delay = DEFAULT_DELAY) => {\n const [ flag, setFlag ] = useState(initialValue);\n const timeout = useRef(undefined);\n const callback = () => {\n setFlag(!initialValue);\n\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n\n timeout.current = setTimeout(() => setFlag(initialValue), delay);\n };\n\n return [ flag, callback ];\n};\n\ntype ToggleResult = [ boolean, () => void, () => void, () => void ];\n\nexport const useToggle = (initialValue = false): ToggleResult => {\n const [ flag, setFlag ] = useState(initialValue);\n\n return [ flag, () => setFlag(!flag), () => setFlag(true), () => setFlag(false) ];\n};\n\nexport const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => {\n const swipeMenuIfNoModalExists = (callback: () => void) => (e: any) => {\n const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some( // eslint-disable-line @typescript-eslint/no-unsafe-call\n ({ classList }) => classList?.contains('visits-table'),\n );\n\n if (swippedOnVisitsTable || document.querySelector('.modal')) {\n return;\n }\n\n callback();\n };\n\n return useReactSwipeable({\n delta: 40,\n onSwipedLeft: swipeMenuIfNoModalExists(hideSidebar),\n onSwipedRight: swipeMenuIfNoModalExists(showSidebar),\n });\n};\n","import { isEmpty, isNil, pipe, range } from 'ramda';\nimport { SyntheticEvent } from 'react';\n\nexport type OrderDir = 'ASC' | 'DESC' | undefined;\n\nexport const determineOrderDir = (\n currentField: T,\n newField?: T,\n currentOrderDir?: OrderDir,\n): OrderDir => {\n if (currentField !== newField) {\n return 'ASC';\n }\n\n const newOrderMap: Record<'ASC' | 'DESC', OrderDir> = {\n ASC: 'DESC',\n DESC: undefined,\n };\n\n return currentOrderDir ? newOrderMap[currentOrderDir] : 'ASC';\n};\n\nexport const rangeOf = (size: number, mappingFn: (value: number) => T, startAt = 1): T[] =>\n range(startAt, size + 1).map(mappingFn);\n\nexport type Empty = null | undefined | '' | never[];\n\nexport const hasValue = (value: T | Empty): value is T => !isNil(value) && !isEmpty(value);\n\nexport const handleEventPreventingDefault = (handler: () => T) => pipe(\n (e: SyntheticEvent) => e.preventDefault(),\n handler,\n);\n\nexport type Nullable = {\n [P in keyof T]: T[P] | null\n};\n\ntype Optional = T | null | undefined;\n\nexport type OptionalString = Optional;\n\nexport type RecursivePartial = {\n [P in keyof T]?: RecursivePartial;\n};\n","import { SemVer } from '../../utils/helpers/version';\n\nexport interface ServerData {\n name: string;\n url: string;\n apiKey: string;\n}\n\nexport interface ServerWithId extends ServerData {\n id: string;\n}\n\nexport interface ReachableServer extends ServerWithId {\n version: SemVer;\n printableVersion: string;\n}\n\nexport interface NonReachableServer extends ServerWithId {\n serverNotReachable: true;\n}\n\nexport interface NotFoundServer {\n serverNotFound: true;\n}\n\nexport type RegularServer = ReachableServer | NonReachableServer;\n\nexport type SelectedServer = RegularServer | NotFoundServer | null;\n\nexport type ServersMap = Record;\n\nexport const hasServerData = (server: SelectedServer | ServerData): server is ServerData =>\n !!(server as ServerData)?.url && !!(server as ServerData)?.apiKey;\n\nexport const isServerWithId = (server: SelectedServer | ServerWithId): server is ServerWithId =>\n !!server?.hasOwnProperty('id');\n\nexport const isReachableServer = (server: SelectedServer): server is ReachableServer =>\n !!server?.hasOwnProperty('version');\n\nexport const isNotFoundServer = (server: SelectedServer): server is NotFoundServer =>\n !!server?.hasOwnProperty('serverNotFound');\n","import axios from 'axios';\nimport Bottle, { Decorator } from 'bottlejs';\nimport ScrollToTop from '../ScrollToTop';\nimport MainHeader from '../MainHeader';\nimport Home from '../Home';\nimport MenuLayout from '../MenuLayout';\nimport AsideMenu from '../AsideMenu';\nimport ErrorHandler from '../ErrorHandler';\nimport ShlinkVersionsContainer from '../ShlinkVersionsContainer';\nimport { ConnectDecorator } from '../../container/types';\nimport { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator, withRouter: Decorator) => {\n bottle.constant('window', (global as any).window);\n bottle.constant('console', global.console);\n bottle.constant('axios', axios);\n\n bottle.serviceFactory('ScrollToTop', ScrollToTop);\n bottle.decorator('ScrollToTop', withRouter);\n\n bottle.serviceFactory('MainHeader', MainHeader, 'ServersDropdown');\n bottle.decorator('MainHeader', withRouter);\n\n bottle.serviceFactory('Home', () => Home);\n bottle.decorator('Home', withoutSelectedServer);\n bottle.decorator('Home', connect([ 'servers' ], [ 'resetSelectedServer' ]));\n\n bottle.serviceFactory(\n 'MenuLayout',\n MenuLayout,\n 'TagsList',\n 'ShortUrls',\n 'AsideMenu',\n 'CreateShortUrl',\n 'ShortUrlVisits',\n 'TagVisits',\n 'OrphanVisits',\n 'ServerError',\n 'Overview',\n 'EditShortUrl',\n );\n bottle.decorator('MenuLayout', connect([ 'selectedServer', 'shortUrlsListParams' ], [ 'selectServer' ]));\n bottle.decorator('MenuLayout', withRouter);\n\n bottle.serviceFactory('AsideMenu', AsideMenu, 'DeleteServerButton');\n\n bottle.serviceFactory('ShlinkVersionsContainer', () => ShlinkVersionsContainer);\n bottle.decorator('ShlinkVersionsContainer', connect([ 'selectedServer' ]));\n\n bottle.serviceFactory('ErrorHandler', ErrorHandler, 'window', 'console');\n};\n\nexport default provideServices;\n","import { PropsWithChildren, useEffect } from 'react';\nimport { RouteComponentProps } from 'react-router';\n\nconst ScrollToTop = () => ({ location, children }: PropsWithChildren) => {\n useEffect(() => {\n scrollTo(0, 0);\n }, [ location ]);\n\n return <>{children};\n};\n\nexport default ScrollToTop;\n","import { Component, ReactNode } from 'react';\nimport { Button } from 'reactstrap';\nimport { SimpleCard } from '../utils/SimpleCard';\n\ninterface ErrorHandlerState {\n hasError: boolean;\n}\n\nconst ErrorHandler = (\n { location }: Window,\n { error }: Console,\n) => class ErrorHandler extends Component {\n public constructor(props: object) {\n super(props);\n this.state = { hasError: false };\n }\n\n public static getDerivedStateFromError(): ErrorHandlerState {\n return { hasError: true };\n }\n\n public componentDidCatch(e: Error): void {\n if (process.env.NODE_ENV !== 'development') {\n error(e);\n }\n }\n\n public render(): ReactNode {\n if (this.state.hasError) {\n return (\n
\n \n

Oops! This is awkward :S

\n

It seems that something went wrong. Try refreshing the page or just click this button.

\n
\n \n
\n
\n );\n }\n\n return this.props.children;\n }\n};\n\nexport default ErrorHandler;\n","import Bottle from 'bottlejs';\nimport { useStateFlagTimeout } from '../helpers/hooks';\nimport LocalStorage from './LocalStorage';\nimport ColorGenerator from './ColorGenerator';\n\nconst provideServices = (bottle: Bottle) => {\n bottle.constant('localStorage', (global as any).localStorage);\n bottle.service('Storage', LocalStorage, 'localStorage');\n bottle.service('ColorGenerator', ColorGenerator, 'Storage');\n\n bottle.constant('setTimeout', global.setTimeout);\n bottle.constant('clearTimeout', global.clearTimeout);\n bottle.serviceFactory('useStateFlagTimeout', useStateFlagTimeout, 'setTimeout', 'clearTimeout');\n};\n\nexport default provideServices;\n","const PREFIX = 'shlink';\nconst buildPath = (path: string) => `${PREFIX}.${path}`;\n\nexport default class LocalStorage {\n public constructor(private readonly localStorage: Storage) {}\n\n public readonly get = (key: string): T | undefined => {\n const item = this.localStorage.getItem(buildPath(key));\n\n return item ? JSON.parse(item) as T : undefined;\n };\n\n public readonly set = (key: string, value: any) => this.localStorage.setItem(buildPath(key), JSON.stringify(value));\n}\n","import { rangeOf } from '../utils';\nimport LocalStorage from './LocalStorage';\n\nconst HEX_COLOR_LENGTH = 6;\nconst { floor, random } = Math;\nconst letters = '0123456789ABCDEF';\nconst buildRandomColor = () => `#${rangeOf(HEX_COLOR_LENGTH, () => letters[floor(random() * letters.length)]).join('')}`;\nconst normalizeKey = (key: string) => key.toLowerCase().trim();\n\nexport default class ColorGenerator {\n private readonly colors: Record;\n\n public constructor(private readonly storage: LocalStorage) {\n this.colors = this.storage.get>('colors') ?? {};\n }\n\n public readonly getColorForKey = (key: string) => {\n const normalizedKey = normalizeKey(key);\n const color = this.colors[normalizedKey];\n\n // If a color has not been set yet, generate a random one and save it\n if (!color) {\n return this.setColorForKey(normalizedKey, buildRandomColor());\n }\n\n return color;\n };\n\n public readonly setColorForKey = (key: string, color: string) => {\n const normalizedKey = normalizeKey(key);\n\n this.colors[normalizedKey] = color;\n this.storage.set('colors', this.colors);\n\n return color;\n };\n}\n","import { pipe } from 'ramda';\nimport { ExternalLink } from 'react-external-link';\nimport { versionToPrintable, versionToSemVer } from '../utils/helpers/version';\nimport { isReachableServer } from '../servers/data';\nimport { ShlinkVersionsContainerProps } from './ShlinkVersionsContainer';\n\nconst SHLINK_WEB_CLIENT_VERSION = '%_VERSION_%';\nconst normalizeVersion = pipe(versionToSemVer(), versionToPrintable);\n\nexport interface ShlinkVersionsProps extends ShlinkVersionsContainerProps {\n clientVersion?: string;\n}\n\nconst VersionLink = ({ project, version }: { project: 'shlink' | 'shlink-web-client'; version: string }) => (\n \n {version}\n \n);\n\nconst ShlinkVersions = ({ selectedServer, clientVersion = SHLINK_WEB_CLIENT_VERSION }: ShlinkVersionsProps) => {\n const normalizedClientVersion = normalizeVersion(clientVersion);\n\n return (\n \n {isReachableServer(selectedServer) &&\n <>Server: - \n }\n Client: \n \n );\n};\n\nexport default ShlinkVersions;\n","import classNames from 'classnames';\nimport { isReachableServer, SelectedServer } from '../servers/data';\nimport ShlinkVersions from './ShlinkVersions';\nimport './ShlinkVersionsContainer.scss';\n\nexport interface ShlinkVersionsContainerProps {\n selectedServer: SelectedServer;\n}\n\nconst ShlinkVersionsContainer = ({ selectedServer }: ShlinkVersionsContainerProps) => {\n const classes = classNames('text-center', {\n 'shlink-versions-container--with-server': isReachableServer(selectedServer),\n });\n\n return (\n
\n \n
\n );\n};\n\nexport default ShlinkVersionsContainer;\n","import { faChevronDown as arrowIcon, faCogs as cogsIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { FC, useEffect } from 'react';\nimport { Link } from 'react-router-dom';\nimport { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';\nimport classNames from 'classnames';\nimport { RouteComponentProps } from 'react-router';\nimport { useToggle } from '../utils/helpers/hooks';\nimport { ShlinkLogo } from './img/ShlinkLogo';\nimport './MainHeader.scss';\n\nconst MainHeader = (ServersDropdown: FC) => ({ location }: RouteComponentProps) => {\n const [ isOpen, toggleOpen, , close ] = useToggle();\n const { pathname } = location;\n\n useEffect(close, [ location ]);\n\n const settingsPath = '/settings';\n const toggleClass = classNames('main-header__toggle-icon', { 'main-header__toggle-icon--opened': isOpen });\n\n return (\n \n \n Shlink\n \n\n \n \n \n\n \n \n \n \n );\n};\n\nexport default MainHeader;\n","import { isEmpty, values } from 'ramda';\nimport { Link } from 'react-router-dom';\nimport { Card, Row } from 'reactstrap';\nimport { ExternalLink } from 'react-external-link';\nimport ServersListGroup from '../servers/ServersListGroup';\nimport './Home.scss';\nimport { ServersMap } from '../servers/data';\nimport { ShlinkLogo } from './img/ShlinkLogo';\n\nexport interface HomeProps {\n servers: ServersMap;\n}\n\nconst Home = ({ servers }: HomeProps) => {\n const serversList = values(servers);\n const hasServers = !isEmpty(serversList);\n\n return (\n
\n \n \n
\n
\n \n
\n
\n
\n
\n

Welcome!

\n
\n \n {!hasServers && (\n
\n

This application will help you to manage your Shlink servers.

\n

To start, please, add your first server.

\n

\n You still don‘t have a Shlink server?\n Learn how to get started.\n

\n
\n )}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Home;\n","import { FC, useEffect } from 'react';\nimport { Redirect, Route, Switch } from 'react-router-dom';\nimport { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport { withSelectedServer } from '../servers/helpers/withSelectedServer';\nimport { useSwipeable, useToggle } from '../utils/helpers/hooks';\nimport { supportsOrphanVisits, supportsTagVisits } from '../utils/helpers/features';\nimport { isReachableServer } from '../servers/data';\nimport NotFound from './NotFound';\nimport { AsideMenuProps } from './AsideMenu';\nimport './MenuLayout.scss';\n\nconst MenuLayout = (\n TagsList: FC,\n ShortUrls: FC,\n AsideMenu: FC,\n CreateShortUrl: FC,\n ShortUrlVisits: FC,\n TagVisits: FC,\n OrphanVisits: FC,\n ServerError: FC,\n Overview: FC,\n EditShortUrl: FC,\n) => withSelectedServer(({ location, selectedServer }) => {\n const [ sidebarVisible, toggleSidebar, showSidebar, hideSidebar ] = useToggle();\n\n useEffect(() => hideSidebar(), [ location ]);\n\n if (!isReachableServer(selectedServer)) {\n return ;\n }\n\n const addTagsVisitsRoute = supportsTagVisits(selectedServer);\n const addOrphanVisitsRoute = supportsOrphanVisits(selectedServer);\n const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible });\n const swipeableProps = useSwipeable(showSidebar, hideSidebar);\n\n return (\n <>\n \n\n
\n
\n \n
hideSidebar()}>\n
\n \n \n \n \n \n \n \n {addTagsVisitsRoute && }\n {addOrphanVisitsRoute && }\n \n List short URLs}\n />\n \n
\n
\n
\n
\n \n );\n}, ServerError);\n\nexport default MenuLayout;\n","import {\n faList as listIcon,\n faLink as createIcon,\n faTags as tagsIcon,\n faPen as editIcon,\n faHome as overviewIcon,\n} from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { FC } from 'react';\nimport { NavLink, NavLinkProps } from 'react-router-dom';\nimport classNames from 'classnames';\nimport { Location } from 'history';\nimport { DeleteServerButtonProps } from '../servers/DeleteServerButton';\nimport { ServerWithId } from '../servers/data';\nimport './AsideMenu.scss';\n\nexport interface AsideMenuProps {\n selectedServer: ServerWithId;\n className?: string;\n showOnMobile?: boolean;\n}\n\ninterface AsideMenuItemProps extends NavLinkProps {\n to: string;\n}\n\nconst AsideMenuItem: FC = ({ children, to, className, ...rest }) => (\n \n {children}\n \n);\n\nconst AsideMenu = (DeleteServerButton: FC) => (\n { selectedServer, showOnMobile = false }: AsideMenuProps,\n) => {\n const serverId = selectedServer ? selectedServer.id : '';\n const asideClass = classNames('aside-menu', {\n 'aside-menu--hidden': !showOnMobile,\n });\n const shortUrlsIsActive = (_: null, location: Location) => location.pathname.match('/list-short-urls') !== null;\n const buildPath = (suffix: string) => `/server/${serverId}${suffix}`;\n\n return (\n \n );\n};\n\nexport default AsideMenu;\n","import { CardProps } from 'reactstrap/lib/Card';\nimport { Card, CardBody, CardHeader } from 'reactstrap';\nimport { ReactNode } from 'react';\n\ninterface SimpleCardProps extends Omit {\n title?: ReactNode;\n bodyClassName?: string;\n}\n\nexport const SimpleCard = ({ title, children, bodyClassName, ...rest }: SimpleCardProps) => (\n \n {title && {title}}\n {children}\n \n);\n","export const MAIN_COLOR = '#4696e5';\n\nexport const MAIN_COLOR_ALPHA = 'rgba(70, 150, 229, 0.4)';\n\nexport const HIGHLIGHTED_COLOR = '#f77f28';\n\nexport const HIGHLIGHTED_COLOR_ALPHA = 'rgba(247, 127, 40, 0.4)';\n\nexport const PRIMARY_LIGHT_COLOR = 'white';\n\nexport const PRIMARY_DARK_COLOR = '#161b22';\n\nexport type Theme = 'dark' | 'light';\n\nexport const changeThemeInMarkup = (theme: Theme) => {\n const html = document.getElementsByTagName('html');\n\n html?.[0]?.setAttribute('data-theme', theme);\n};\n\nexport const isDarkThemeEnabled = (): boolean => {\n const html = document.getElementsByTagName('html');\n\n return html?.[0]?.getAttribute('data-theme') === 'dark';\n};\n","import { isReachableServer, SelectedServer } from '../../servers/data';\nimport { versionMatch, Versions } from './version';\n\nconst serverMatchesVersions = (versions: Versions) => (selectedServer: SelectedServer): boolean =>\n isReachableServer(selectedServer) && versionMatch(selectedServer.version, versions);\n\nexport const supportsSettingShortCodeLength = serverMatchesVersions({ minVersion: '2.1.0' });\n\nexport const supportsTagVisits = serverMatchesVersions({ minVersion: '2.2.0' });\n\nexport const supportsListingDomains = serverMatchesVersions({ minVersion: '2.4.0' });\n\nexport const supportsQrCodeSvgFormat = supportsListingDomains;\n\nexport const supportsValidateUrl = supportsListingDomains;\n\nexport const supportsQrCodeSizeInQuery = serverMatchesVersions({ minVersion: '2.5.0' });\n\nexport const supportsShortUrlTitle = serverMatchesVersions({ minVersion: '2.6.0' });\n\nexport const supportsOrphanVisits = supportsShortUrlTitle;\n\nexport const supportsQrCodeMargin = supportsShortUrlTitle;\n\nexport const supportsTagsInPatch = supportsShortUrlTitle;\n","import { FC } from 'react';\nimport { Card, Row } from 'reactstrap';\nimport classNames from 'classnames';\nimport { faCircleNotch as preloader } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\ntype MessageType = 'default' | 'error';\n\nconst getClassForType = (type: MessageType) => {\n const map: Record = {\n error: 'border-danger',\n default: '',\n };\n\n return map[type];\n};\nconst getTextClassForType = (type: MessageType) => {\n const map: Record = {\n error: 'text-danger',\n default: 'text-muted',\n };\n\n return map[type];\n};\n\nexport interface MessageProps {\n className?: string;\n loading?: boolean;\n fullWidth?: boolean;\n type?: MessageType;\n}\n\nconst Message: FC = ({ className, children, loading = false, type = 'default', fullWidth = false }) => {\n const classes = classNames({\n 'col-md-12': fullWidth,\n 'col-md-10 offset-md-1': !fullWidth,\n });\n\n return (\n \n
\n \n

\n {loading && }\n {loading && {children ?? 'Loading...'}}\n {!loading && children}\n

\n
\n
\n
\n );\n};\n\nexport default Message;\n","import { FC } from 'react';\nimport './NoMenuLayout.scss';\n\nconst NoMenuLayout: FC = ({ children }) =>
{children}
;\n\nexport default NoMenuLayout;\n","import { compare } from 'compare-versions';\nimport { identity, memoizeWith } from 'ramda';\nimport { Empty, hasValue } from '../utils';\n\ntype SemVerPatternFragment = `${bigint | '*'}`;\n\nexport type SemVerPattern = SemVerPatternFragment\n| `${SemVerPatternFragment}.${SemVerPatternFragment}`\n| `${SemVerPatternFragment}.${SemVerPatternFragment}.${SemVerPatternFragment}`;\n\nexport interface Versions {\n maxVersion?: SemVerPattern;\n minVersion?: SemVerPattern;\n}\n\nexport type SemVer = `${bigint}.${bigint}.${bigint}` | 'latest';\n\nexport const versionMatch = (versionToMatch: SemVer | Empty, { maxVersion, minVersion }: Versions): boolean => {\n if (!hasValue(versionToMatch)) {\n return false;\n }\n\n const matchesMinVersion = !minVersion || compare(versionToMatch, minVersion, '>=');\n const matchesMaxVersion = !maxVersion || compare(versionToMatch, maxVersion, '<=');\n\n return matchesMaxVersion && matchesMinVersion;\n};\n\nconst versionIsValidSemVer = memoizeWith(identity, (version: string): version is SemVer => {\n try {\n return compare(version, version, '=');\n } catch (e) {\n return false;\n }\n});\n\nexport const versionToPrintable = (version: string) => !versionIsValidSemVer(version) ? version : `v${version}`;\n\nexport const versionToSemVer = (defaultValue: SemVer = 'latest') =>\n (version: string): SemVer => versionIsValidSemVer(version) ? version : defaultValue;\n","import { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSearch as searchIcon } from '@fortawesome/free-solid-svg-icons';\nimport classNames from 'classnames';\nimport './SearchField.scss';\n\nconst DEFAULT_SEARCH_INTERVAL = 500;\nlet timer: NodeJS.Timeout | null;\n\ninterface SearchFieldProps {\n onChange: (value: string) => void;\n className?: string;\n placeholder?: string;\n large?: boolean;\n noBorder?: boolean;\n}\n\nconst SearchField = (\n { onChange, className, placeholder = 'Search...', large = true, noBorder = false }: SearchFieldProps,\n) => {\n const [ searchTerm, setSearchTerm ] = useState('');\n\n const resetTimer = () => {\n timer && clearTimeout(timer);\n timer = null;\n };\n const searchTermChanged = (newSearchTerm: string, timeout = DEFAULT_SEARCH_INTERVAL) => {\n setSearchTerm(newSearchTerm);\n\n resetTimer();\n\n timer = setTimeout(() => {\n onChange(newSearchTerm);\n resetTimer();\n }, timeout);\n };\n\n return (\n
\n searchTermChanged(e.target.value)}\n />\n \n
\n \n );\n};\n\nexport default SearchField;\n","import { useEffect, FC } from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport NotFound from './common/NotFound';\nimport { ServersMap } from './servers/data';\nimport { Settings } from './settings/reducers/settings';\nimport { changeThemeInMarkup } from './utils/theme';\nimport './App.scss';\n\ninterface AppProps {\n fetchServers: Function;\n servers: ServersMap;\n settings: Settings;\n}\n\nconst App = (\n MainHeader: FC,\n Home: FC,\n MenuLayout: FC,\n CreateServer: FC,\n EditServer: FC,\n Settings: FC,\n ShlinkVersionsContainer: FC,\n) => ({ fetchServers, servers, settings }: AppProps) => {\n useEffect(() => {\n // On first load, try to fetch the remote servers if the list is empty\n if (Object.keys(servers).length === 0) {\n fetchServers();\n }\n\n changeThemeInMarkup(settings.ui?.theme ?? 'light');\n }, []);\n\n return (\n
\n \n\n
\n
\n \n \n \n \n \n \n \n \n
\n\n
\n \n
\n
\n
\n );\n};\n\nexport default App;\n","import qs from 'qs';\nimport { isEmpty, isNil, reject } from 'ramda';\nimport { AxiosInstance, AxiosResponse, Method } from 'axios';\nimport { ShortUrlsListParams } from '../../short-urls/reducers/shortUrlsListParams';\nimport { ShortUrl, ShortUrlData } from '../../short-urls/data';\nimport { OptionalString } from '../../utils/utils';\nimport {\n ShlinkHealth,\n ShlinkMercureInfo,\n ShlinkShortUrlsResponse,\n ShlinkTags,\n ShlinkTagsResponse,\n ShlinkVisits,\n ShlinkVisitsParams,\n ShlinkShortUrlData,\n ShlinkDomain,\n ShlinkDomainsResponse,\n ShlinkVisitsOverview,\n} from '../types';\n\nconst buildShlinkBaseUrl = (url: string, apiVersion: number) => url ? `${url}/rest/v${apiVersion}` : '';\nconst rejectNilProps = reject(isNil);\n\nexport default class ShlinkApiClient {\n private apiVersion: number;\n\n public constructor(\n private readonly axios: AxiosInstance,\n private readonly baseUrl: string,\n private readonly apiKey: string,\n ) {\n this.apiVersion = 2;\n }\n\n public readonly listShortUrls = async (params: ShortUrlsListParams = {}): Promise =>\n this.performRequest<{ shortUrls: ShlinkShortUrlsResponse }>('/short-urls', 'GET', params)\n .then(({ data }) => data.shortUrls);\n\n public readonly createShortUrl = async (options: ShortUrlData): Promise => {\n const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options as any);\n\n return this.performRequest('/short-urls', 'POST', {}, filteredOptions)\n .then((resp) => resp.data);\n };\n\n public readonly getShortUrlVisits = async (shortCode: string, query?: ShlinkVisitsParams): Promise =>\n this.performRequest<{ visits: ShlinkVisits }>(`/short-urls/${shortCode}/visits`, 'GET', query)\n .then(({ data }) => data.visits);\n\n public readonly getTagVisits = async (tag: string, query?: Omit): Promise =>\n this.performRequest<{ visits: ShlinkVisits }>(`/tags/${tag}/visits`, 'GET', query)\n .then(({ data }) => data.visits);\n\n public readonly getOrphanVisits = async (query?: Omit): Promise =>\n this.performRequest<{ visits: ShlinkVisits }>('/visits/orphan', 'GET', query)\n .then(({ data }) => data.visits);\n\n public readonly getVisitsOverview = async (): Promise =>\n this.performRequest<{ visits: ShlinkVisitsOverview }>('/visits', 'GET')\n .then(({ data }) => data.visits);\n\n public readonly getShortUrl = async (shortCode: string, domain?: OptionalString): Promise =>\n this.performRequest(`/short-urls/${shortCode}`, 'GET', { domain })\n .then(({ data }) => data);\n\n public readonly deleteShortUrl = async (shortCode: string, domain?: OptionalString): Promise =>\n this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain })\n .then(() => {});\n\n /* @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrl instead */\n public readonly updateShortUrlTags = async (\n shortCode: string,\n domain: OptionalString,\n tags: string[],\n ): Promise =>\n this.performRequest<{ tags: string[] }>(`/short-urls/${shortCode}/tags`, 'PUT', { domain }, { tags })\n .then(({ data }) => data.tags);\n\n public readonly updateShortUrl = async (\n shortCode: string,\n domain: OptionalString,\n data: ShlinkShortUrlData,\n ): Promise =>\n this.performRequest(`/short-urls/${shortCode}`, 'PATCH', { domain }, data)\n .then(({ data }) => data);\n\n public readonly listTags = async (): Promise =>\n this.performRequest<{ tags: ShlinkTagsResponse }>('/tags', 'GET', { withStats: 'true' })\n .then((resp) => resp.data.tags)\n .then(({ data, stats }) => ({ tags: data, stats }));\n\n public readonly deleteTags = async (tags: string[]): Promise<{ tags: string[] }> =>\n this.performRequest('/tags', 'DELETE', { tags })\n .then(() => ({ tags }));\n\n public readonly editTag = async (oldName: string, newName: string): Promise<{ oldName: string; newName: string }> =>\n this.performRequest('/tags', 'PUT', {}, { oldName, newName })\n .then(() => ({ oldName, newName }));\n\n public readonly health = async (): Promise =>\n this.performRequest('/health', 'GET')\n .then((resp) => resp.data);\n\n public readonly mercureInfo = async (): Promise =>\n this.performRequest('/mercure-info', 'GET')\n .then((resp) => resp.data);\n\n public readonly listDomains = async (): Promise =>\n this.performRequest<{ domains: ShlinkDomainsResponse }>('/domains', 'GET').then(({ data }) => data.domains.data);\n\n private readonly performRequest = async (url: string, method: Method = 'GET', query = {}, body = {}): Promise> => {\n try {\n return await this.axios({\n method,\n url: `${buildShlinkBaseUrl(this.baseUrl, this.apiVersion)}${url}`,\n headers: { 'X-Api-Key': this.apiKey },\n params: rejectNilProps(query),\n data: body,\n paramsSerializer: (params) => qs.stringify(params, { arrayFormat: 'brackets' }),\n });\n } catch (e) {\n const { response } = e;\n\n // Due to a bug on all previous Shlink versions, requests to non-matching URLs will always result on a CORS error\n // when performed from the browser (due to the preflight request not returning a 2xx status.\n // See https://github.com/shlinkio/shlink/issues/614), which will make the \"response\" prop not to be set here.\n // The bug will be fixed on upcoming Shlink patches, but for other versions, we can consider this situation as\n // if a request has been performed to a not supported API version.\n const apiVersionIsNotSupported = !response;\n\n // When the request is not invalid or we have already tried both API versions, throw the error and let the\n // caller handle it\n if (!apiVersionIsNotSupported || this.apiVersion === 2) {\n throw e;\n }\n\n this.apiVersion = this.apiVersion - 1;\n\n return await this.performRequest(url, method, query, body);\n }\n };\n}\n","import { AxiosInstance } from 'axios';\nimport { prop } from 'ramda';\nimport { hasServerData, SelectedServer, ServerWithId } from '../../servers/data';\nimport { GetState } from '../../container/types';\nimport ShlinkApiClient from './ShlinkApiClient';\n\nconst apiClients: Record = {};\n\nconst isGetState = (getStateOrSelectedServer: GetState | ServerWithId): getStateOrSelectedServer is GetState =>\n typeof getStateOrSelectedServer === 'function';\nconst getSelectedServerFromState = (getState: GetState): SelectedServer => prop('selectedServer', getState());\n\nexport type ShlinkApiClientBuilder = (getStateOrSelectedServer: GetState | ServerWithId) => ShlinkApiClient;\n\nconst buildShlinkApiClient = (axios: AxiosInstance): ShlinkApiClientBuilder => (\n getStateOrSelectedServer: GetState | ServerWithId,\n) => {\n const server = isGetState(getStateOrSelectedServer)\n ? getSelectedServerFromState(getStateOrSelectedServer)\n : getStateOrSelectedServer;\n\n if (!hasServerData(server)) {\n throw new Error('There\\'s no selected server or it is not found');\n }\n\n const { url, apiKey } = server;\n const clientKey = `${url}_${apiKey}`;\n\n if (!apiClients[clientKey]) {\n apiClients[clientKey] = new ShlinkApiClient(axios, url, apiKey);\n }\n\n return apiClients[clientKey];\n};\n\nexport default buildShlinkApiClient;\n","import Bottle from 'bottlejs';\nimport buildShlinkApiClient from './ShlinkApiClientBuilder';\n\nconst provideServices = (bottle: Bottle) => {\n bottle.serviceFactory('buildShlinkApiClient', buildShlinkApiClient, 'axios');\n};\n\nexport default provideServices;\n","import { FC, useEffect, useState } from 'react';\nimport { ShortUrlsListProps } from './ShortUrlsList';\n\nconst ShortUrls = (SearchBar: FC, ShortUrlsList: FC) => (props: ShortUrlsListProps) => {\n const { match } = props;\n const { page = '1', serverId = '' } = match?.params ?? {};\n const [ urlsListKey, setUrlsListKey ] = useState(`${serverId}_${page}`);\n\n // Using a key on a component makes react to create a new instance every time the key changes\n // Without it, pagination on the URL will not make the component to be refreshed\n useEffect(() => {\n setUrlsListKey(`${serverId}_${page}`);\n }, [ serverId, page ]);\n\n return (\n <>\n
\n \n \n );\n};\n\nexport default ShortUrls;\n","import { FC } from 'react';\nimport ColorGenerator from '../../utils/services/ColorGenerator';\nimport './Tag.scss';\n\ninterface TagProps {\n colorGenerator: ColorGenerator;\n text: string;\n clearable?: boolean;\n onClick?: () => void;\n onClose?: () => void;\n}\n\nconst Tag: FC = ({ text, children, clearable, colorGenerator, onClick, onClose }) => (\n \n {children ?? text}\n {clearable && ×}\n \n);\n\nexport default Tag;\n","import { FC } from 'react';\nimport { Dropdown, DropdownMenu, DropdownToggle } from 'reactstrap';\nimport { useToggle } from './helpers/hooks';\nimport './DropdownBtn.scss';\n\nexport interface DropdownBtnProps {\n text: string;\n disabled?: boolean;\n className?: string;\n dropdownClassName?: string;\n right?: boolean;\n}\n\nexport const DropdownBtn: FC = (\n { text, disabled = false, className = '', children, dropdownClassName, right = false },\n) => {\n const [ isOpen, toggle ] = useToggle();\n const toggleClasses = `dropdown-btn__toggle btn-block ${className}`;\n\n return (\n \n {text}\n {children}\n \n );\n};\n","import * as moment from 'moment';\nimport { OptionalString } from '../utils';\n\ntype MomentOrString = moment.Moment | string;\ntype NullableDate = MomentOrString | null;\n\nconst isMomentObject = (date: MomentOrString): date is moment.Moment => typeof (date as moment.Moment).format === 'function';\n\nconst formatDateFromFormat = (date?: NullableDate, format?: string): OptionalString =>\n !date || !isMomentObject(date) ? date : date.format(format);\n\nexport const formatDate = (format = 'YYYY-MM-DD') => (date?: NullableDate) => formatDateFromFormat(date, format);\n\nexport const formatIsoDate = (date?: NullableDate) => formatDateFromFormat(date, undefined);\n\nexport const formatInternational = formatDate();\n","import moment from 'moment';\nimport { filter, isEmpty } from 'ramda';\nimport { formatInternational } from '../../helpers/date';\n\nexport interface DateRange {\n startDate?: moment.Moment | null;\n endDate?: moment.Moment | null;\n}\n\nexport type DateInterval = 'today' | 'yesterday' | 'last7Days' | 'last30Days' | 'last90Days' | 'last180days' | 'last365Days';\n\nexport const dateRangeIsEmpty = (dateRange?: DateRange): boolean => dateRange === undefined\n || isEmpty(filter(Boolean, dateRange as any));\n\nexport const rangeIsInterval = (range?: DateRange | DateInterval): range is DateInterval => typeof range === 'string';\n\nconst INTERVAL_TO_STRING_MAP: Record = {\n today: 'Today',\n yesterday: 'Yesterday',\n last7Days: 'Last 7 days',\n last30Days: 'Last 30 days',\n last90Days: 'Last 90 days',\n last180days: 'Last 180 days',\n last365Days: 'Last 365 days',\n};\n\nexport const DATE_INTERVALS: DateInterval[] = Object.keys(INTERVAL_TO_STRING_MAP) as DateInterval[];\n\nconst dateRangeToString = (range?: DateRange): string | undefined => {\n if (!range || dateRangeIsEmpty(range)) {\n return undefined;\n }\n\n if (range.startDate && !range.endDate) {\n return `Since ${formatInternational(range.startDate)}`;\n }\n\n if (!range.startDate && range.endDate) {\n return `Until ${formatInternational(range.endDate)}`;\n }\n\n return `${formatInternational(range.startDate)} - ${formatInternational(range.endDate)}`;\n};\n\nexport const rangeOrIntervalToString = (range?: DateRange | DateInterval): string | undefined => {\n if (!range) {\n return undefined;\n }\n\n if (!rangeIsInterval(range)) {\n return dateRangeToString(range);\n }\n\n return INTERVAL_TO_STRING_MAP[range];\n};\n\nexport const intervalToDateRange = (dateInterval?: DateInterval): DateRange => {\n if (!dateInterval) {\n return {};\n }\n\n switch (dateInterval) {\n case 'today':\n return { startDate: moment().startOf('day'), endDate: moment() };\n case 'yesterday':\n const yesterday = moment().subtract(1, 'day'); // eslint-disable-line no-case-declarations\n\n return { startDate: yesterday.startOf('day'), endDate: yesterday.endOf('day') };\n case 'last7Days':\n return { startDate: moment().subtract(7, 'days').startOf('day'), endDate: moment() };\n case 'last30Days':\n return { startDate: moment().subtract(30, 'days').startOf('day'), endDate: moment() };\n case 'last90Days':\n return { startDate: moment().subtract(90, 'days').startOf('day'), endDate: moment() };\n case 'last180days':\n return { startDate: moment().subtract(180, 'days').startOf('day'), endDate: moment() };\n case 'last365Days':\n return { startDate: moment().subtract(365, 'days').startOf('day'), endDate: moment() };\n }\n\n return {};\n};\n","import { useRef } from 'react';\nimport { isNil, dissoc } from 'ramda';\nimport DatePicker, { ReactDatePickerProps } from 'react-datepicker';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCalendarAlt as calendarIcon } from '@fortawesome/free-regular-svg-icons';\nimport classNames from 'classnames';\nimport moment from 'moment';\nimport './DateInput.scss';\n\ninterface DatePropsInterface {\n endDate?: moment.Moment | null;\n maxDate?: moment.Moment | null;\n minDate?: moment.Moment | null;\n selected?: moment.Moment | null;\n startDate?: moment.Moment | null;\n onChange?: (date: moment.Moment | null) => void;\n}\n\nexport type DateInputProps = DatePropsInterface & Omit;\n\nconst transformProps = (props: DateInputProps): ReactDatePickerProps => ({\n // @ts-expect-error The DatePicker type definition is wrong. It has a ref prop\n ...dissoc('ref', props),\n endDate: props.endDate?.toDate(),\n maxDate: props.maxDate?.toDate(),\n minDate: props.minDate?.toDate(),\n selected: props.selected?.toDate(),\n startDate: props.startDate?.toDate(),\n onChange: (date: Date | null) => props.onChange?.(date && moment(date)),\n});\n\nconst DateInput = (props: DateInputProps) => {\n const { className, isClearable, selected } = props;\n const showCalendarIcon = !isClearable || isNil(selected);\n const ref = useRef<{ input: HTMLInputElement }>();\n\n return (\n
\n \n {showCalendarIcon && (\n ref.current?.input.focus()}\n />\n )}\n
\n );\n};\n\nexport default DateInput;\n","import moment from 'moment';\nimport DateInput from '../DateInput';\nimport { DateRange } from './types';\n\ninterface DateRangeRowProps extends DateRange {\n onStartDateChange: (date: moment.Moment | null) => void;\n onEndDateChange: (date: moment.Moment | null) => void;\n disabled?: boolean;\n}\n\nconst DateRangeRow = (\n { startDate = null, endDate = null, disabled = false, onStartDateChange, onEndDateChange }: DateRangeRowProps,\n) => (\n
\n
\n \n
\n
\n \n
\n
\n);\n\nexport default DateRangeRow;\n","import { DropdownItem } from 'reactstrap';\nimport { FC } from 'react';\nimport { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from './types';\n\nexport interface DateIntervalDropdownProps {\n active?: DateInterval;\n onChange: (interval: DateInterval) => void;\n}\n\nexport const DateIntervalDropdownItems: FC = ({ active, onChange }) => (\n <>\n {DATE_INTERVALS.map(\n (interval) => (\n onChange(interval)}>\n {rangeOrIntervalToString(interval)}\n \n ),\n )}\n \n);\n","import { useState } from 'react';\nimport { DropdownItem } from 'reactstrap';\nimport { DropdownBtn } from '../DropdownBtn';\nimport {\n DateInterval,\n DateRange,\n dateRangeIsEmpty,\n rangeOrIntervalToString,\n intervalToDateRange,\n rangeIsInterval,\n} from './types';\nimport DateRangeRow from './DateRangeRow';\nimport { DateIntervalDropdownItems } from './DateIntervalDropdownItems';\n\nexport interface DateRangeSelectorProps {\n initialDateRange?: DateInterval | DateRange;\n disabled?: boolean;\n onDatesChange: (dateRange: DateRange) => void;\n defaultText: string;\n}\n\nexport const DateRangeSelector = (\n { onDatesChange, initialDateRange, defaultText, disabled }: DateRangeSelectorProps,\n) => {\n const [ activeInterval, setActiveInterval ] = useState(\n rangeIsInterval(initialDateRange) ? initialDateRange : undefined,\n );\n const [ activeDateRange, setActiveDateRange ] = useState(\n !rangeIsInterval(initialDateRange) ? initialDateRange : undefined,\n );\n const updateDateRange = (dateRange: DateRange) => {\n setActiveInterval(undefined);\n setActiveDateRange(dateRange);\n onDatesChange(dateRange);\n };\n const updateInterval = (dateInterval?: DateInterval) => () => {\n setActiveInterval(dateInterval);\n setActiveDateRange(undefined);\n onDatesChange(intervalToDateRange(dateInterval));\n };\n\n return (\n \n \n {defaultText}\n \n \n updateInterval(interval)()} />\n \n Custom:\n \n updateDateRange({ ...activeDateRange, startDate })}\n onEndDateChange={(endDate) => updateDateRange({ ...activeDateRange, endDate })}\n />\n \n \n );\n};\n","import { faTags as tagsIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { isEmpty, pipe } from 'ramda';\nimport moment from 'moment';\nimport SearchField from '../utils/SearchField';\nimport Tag from '../tags/helpers/Tag';\nimport { DateRangeSelector } from '../utils/dates/DateRangeSelector';\nimport { formatIsoDate } from '../utils/helpers/date';\nimport ColorGenerator from '../utils/services/ColorGenerator';\nimport { DateRange } from '../utils/dates/types';\nimport { ShortUrlsListParams } from './reducers/shortUrlsListParams';\nimport './SearchBar.scss';\n\ninterface SearchBarProps {\n listShortUrls: (params: ShortUrlsListParams) => void;\n shortUrlsListParams: ShortUrlsListParams;\n}\n\nconst dateOrNull = (date?: string) => date ? moment(date) : null;\n\nconst SearchBar = (colorGenerator: ColorGenerator) => ({ listShortUrls, shortUrlsListParams }: SearchBarProps) => {\n const selectedTags = shortUrlsListParams.tags ?? [];\n const setDates = pipe(\n ({ startDate, endDate }: DateRange) => ({\n startDate: formatIsoDate(startDate) ?? undefined,\n endDate: formatIsoDate(endDate) ?? undefined,\n }),\n (dates) => listShortUrls({ ...shortUrlsListParams, ...dates }),\n );\n\n return (\n
\n listShortUrls({ ...shortUrlsListParams, searchTerm })\n }\n />\n\n
\n
\n
\n \n
\n
\n
\n\n {!isEmpty(selectedTags) && (\n

\n \n  \n {selectedTags.map((tag) => (\n listShortUrls(\n {\n ...shortUrlsListParams,\n tags: selectedTags.filter((selectedTag) => selectedTag !== tag),\n },\n )}\n />\n ))}\n

\n )}\n
\n );\n};\n\nexport default SearchBar;\n","import { UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';\nimport { toPairs } from 'ramda';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSortAmountUp as sortAscIcon, faSortAmountDown as sortDescIcon } from '@fortawesome/free-solid-svg-icons';\nimport classNames from 'classnames';\nimport { determineOrderDir, OrderDir } from './utils';\nimport './SortingDropdown.scss';\n\nexport interface SortingDropdownProps {\n items: Record;\n orderField?: T;\n orderDir?: OrderDir;\n onChange: (orderField?: T, orderDir?: OrderDir) => void;\n isButton?: boolean;\n right?: boolean;\n}\n\nexport default function SortingDropdown(\n { items, orderField, orderDir, onChange, isButton = true, right = false }: SortingDropdownProps,\n) {\n const handleItemClick = (fieldKey: T) => () => {\n const newOrderDir = determineOrderDir(fieldKey, orderField, orderDir);\n\n onChange(newOrderDir ? fieldKey : undefined, newOrderDir);\n };\n\n return (\n \n \n {!isButton && <>Order by}\n {isButton && !orderField && <>Order by...}\n {isButton && orderField && `Order by: \"${items[orderField]}\" - \"${orderDir ?? 'DESC'}\"`}\n \n \n {toPairs(items).map(([ fieldKey, fieldValue ]) => (\n \n {fieldValue}\n {orderField === fieldKey && (\n \n )}\n \n ))}\n \n onChange()}>\n Clear selection\n \n \n \n );\n}\n","import { FC, useEffect } from 'react';\nimport { pipe } from 'ramda';\nimport { CreateVisit } from '../../visits/types';\nimport { MercureInfo } from '../reducers/mercureInfo';\nimport { bindToMercureTopic } from './index';\n\nexport interface MercureBoundProps {\n createNewVisits: (createdVisits: CreateVisit[]) => void;\n loadMercureInfo: () => void;\n mercureInfo: MercureInfo;\n}\n\nexport function boundToMercureHub(\n WrappedComponent: FC,\n getTopicsForProps: (props: T) => string[],\n) {\n const pendingUpdates = new Set();\n\n return (props: MercureBoundProps & T) => {\n const { createNewVisits, loadMercureInfo, mercureInfo } = props;\n const { interval } = mercureInfo;\n\n useEffect(() => {\n const onMessage = (visit: CreateVisit) => interval ? pendingUpdates.add(visit) : createNewVisits([ visit ]);\n const closeEventSource = bindToMercureTopic(mercureInfo, getTopicsForProps(props), onMessage, loadMercureInfo);\n\n if (!interval) {\n return closeEventSource;\n }\n\n const timer = setInterval(() => {\n createNewVisits([ ...pendingUpdates ]);\n pendingUpdates.clear();\n }, interval * 1000 * 60);\n\n return pipe(() => clearInterval(timer), () => closeEventSource?.());\n }, [ mercureInfo ]);\n\n return ;\n };\n}\n","import { EventSourcePolyfill as EventSource } from 'event-source-polyfill';\nimport { MercureInfo } from '../reducers/mercureInfo';\n\nexport const bindToMercureTopic = (mercureInfo: MercureInfo, topics: string[], onMessage: (message: T) => void, onTokenExpired: () => void) => { // eslint-disable-line max-len\n const { mercureHubUrl, token, loading, error } = mercureInfo;\n\n if (loading || error || !mercureHubUrl) {\n return undefined;\n }\n\n const onEventSourceMessage = ({ data }: { data: string }) => onMessage(JSON.parse(data) as T);\n const onEventSourceError = ({ status }: { status: number }) => status === 401 && onTokenExpired();\n\n const subscriptions = topics.map((topic) => {\n const hubUrl = new URL(mercureHubUrl);\n\n hubUrl.searchParams.append('topic', topic);\n const es = new EventSource(hubUrl, {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n });\n\n es.onmessage = onEventSourceMessage;\n es.onerror = onEventSourceError;\n\n return es;\n });\n\n return () => subscriptions.forEach((es) => es.close());\n};\n","import qs from 'qs';\n\nexport const parseQuery = (search: string) => qs.parse(search, { ignoreQueryPrefix: true }) as unknown as T;\n\nexport const stringifyQuery = (query: any): string => qs.stringify(query, { arrayFormat: 'brackets' });\n","export class Topics {\n public static visits = () => 'https://shlink.io/new-visit';\n\n public static shortUrlVisits = (shortCode: string) => `https://shlink.io/new-visit/${shortCode}`;\n\n public static orphanVisits = () => 'https://shlink.io/new-orphan-visit';\n}\n","import { Action } from 'redux';\n\ntype ActionHandler = (currentState: State, action: AT) => State;\ntype ActionHandlerMap = Record>;\n\nexport const buildReducer = (map: ActionHandlerMap, initialState: State) => (\n state: State | undefined,\n action: AT,\n): State => {\n const { type } = action;\n const actionHandler = map[type];\n const currentState = state ?? initialState;\n\n return actionHandler ? actionHandler(currentState, action) : currentState;\n};\n\nexport const buildActionCreator = (type: T) => (): Action => ({ type });\n","import { isEmpty, propEq, values } from 'ramda';\nimport { useState, useEffect, useMemo, FC } from 'react';\nimport { Button, Card, Nav, NavLink, Progress, Row } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCalendarAlt, faMapMarkedAlt, faList, faChartPie, faFileDownload } from '@fortawesome/free-solid-svg-icons';\nimport { IconDefinition } from '@fortawesome/fontawesome-common-types';\nimport { Route, Switch, NavLink as RouterNavLink, Redirect } from 'react-router-dom';\nimport { Location } from 'history';\nimport classNames from 'classnames';\nimport { DateRangeSelector } from '../utils/dates/DateRangeSelector';\nimport Message from '../utils/Message';\nimport { formatIsoDate } from '../utils/helpers/date';\nimport { ShlinkVisitsParams } from '../api/types';\nimport { DateInterval, DateRange, intervalToDateRange } from '../utils/dates/types';\nimport { Result } from '../utils/Result';\nimport { ShlinkApiError } from '../api/ShlinkApiError';\nimport { Settings } from '../settings/reducers/settings';\nimport SortableBarGraph from './helpers/SortableBarGraph';\nimport GraphCard from './helpers/GraphCard';\nimport LineChartCard from './helpers/LineChartCard';\nimport VisitsTable from './VisitsTable';\nimport { NormalizedOrphanVisit, NormalizedVisit, OrphanVisitType, VisitsInfo } from './types';\nimport OpenMapModalBtn from './helpers/OpenMapModalBtn';\nimport { processStatsFromVisits } from './services/VisitsParser';\nimport { OrphanVisitTypeDropdown } from './helpers/OrphanVisitTypeDropdown';\nimport './VisitsStats.scss';\nimport { HighlightableProps, highlightedVisitsToStats, normalizeAndFilterVisits } from './types/helpers';\n\nexport interface VisitsStatsProps {\n getVisits: (params: Partial) => void;\n visitsInfo: VisitsInfo;\n settings: Settings;\n cancelGetVisits: () => void;\n baseUrl: string;\n domain?: string;\n exportCsv: (visits: NormalizedVisit[]) => void;\n isOrphanVisits?: boolean;\n}\n\ninterface VisitsNavLinkProps {\n title: string;\n subPath: string;\n icon: IconDefinition;\n}\n\ntype Section = 'byTime' | 'byContext' | 'byLocation' | 'list';\n\nconst sections: Record = {\n byTime: { title: 'By time', subPath: '', icon: faCalendarAlt },\n byContext: { title: 'By context', subPath: '/by-context', icon: faChartPie },\n byLocation: { title: 'By location', subPath: '/by-location', icon: faMapMarkedAlt },\n list: { title: 'List', subPath: '/list', icon: faList },\n};\n\nlet selectedBar: string | undefined;\n\nconst VisitsNavLink: FC = ({ subPath, title, icon, to }) => (\n pathname.endsWith(`visits${subPath}`)}\n replace\n >\n \n {title}\n \n);\n\nconst VisitsStats: FC = (\n { children, visitsInfo, getVisits, cancelGetVisits, baseUrl, domain, settings, exportCsv, isOrphanVisits = false },\n) => {\n const initialInterval: DateInterval = settings.visits?.defaultInterval ?? 'last30Days';\n const [ dateRange, setDateRange ] = useState(intervalToDateRange(initialInterval));\n const [ highlightedVisits, setHighlightedVisits ] = useState([]);\n const [ highlightedLabel, setHighlightedLabel ] = useState();\n const [ orphanVisitType, setOrphanVisitType ] = useState();\n\n const buildSectionUrl = (subPath?: string) => {\n const query = domain ? `?domain=${domain}` : '';\n\n return !subPath ? `${baseUrl}${query}` : `${baseUrl}${subPath}${query}`;\n };\n const { visits, loading, loadingLarge, error, errorData, progress } = visitsInfo;\n const normalizedVisits = useMemo(\n () => normalizeAndFilterVisits(visits, orphanVisitType),\n [ visits, orphanVisitType ],\n );\n const { os, browsers, referrers, countries, cities, citiesForMap, visitedUrls } = useMemo(\n () => processStatsFromVisits(normalizedVisits),\n [ normalizedVisits ],\n );\n const mapLocations = values(citiesForMap);\n\n const setSelectedVisits = (selectedVisits: NormalizedVisit[]) => {\n selectedBar = undefined;\n setHighlightedVisits(selectedVisits);\n };\n const highlightVisitsForProp = (prop: HighlightableProps) => (value: string) => {\n const newSelectedBar = `${prop}_${value}`;\n\n if (selectedBar === newSelectedBar) {\n setHighlightedVisits([]);\n setHighlightedLabel(undefined);\n selectedBar = undefined;\n } else {\n setHighlightedVisits((normalizedVisits as NormalizedOrphanVisit[]).filter(propEq(prop, value)));\n setHighlightedLabel(value);\n selectedBar = newSelectedBar;\n }\n };\n\n useEffect(() => cancelGetVisits, []);\n useEffect(() => {\n const { startDate, endDate } = dateRange;\n\n getVisits({ startDate: formatIsoDate(startDate) ?? undefined, endDate: formatIsoDate(endDate) ?? undefined });\n }, [ dateRange ]);\n\n const renderVisitsContent = () => {\n if (loadingLarge) {\n return (\n \n This is going to take a while... :S\n \n \n );\n }\n\n if (loading) {\n return ;\n }\n\n if (error) {\n return (\n \n \n \n );\n }\n\n if (isEmpty(visits)) {\n return There are no visits matching current filter :(;\n }\n\n return (\n <>\n \n \n \n \n \n \n
\n \n
\n
\n\n \n
\n \n
\n
\n \n
\n
\n \n
\n {isOrphanVisits && (\n
\n \n
\n )}\n
\n\n \n
\n \n
\n
\n \n mapLocations.length > 0 &&\n \n }\n sortingItems={{\n name: 'City name',\n amount: 'Visits amount',\n }}\n onClick={highlightVisitsForProp('city')}\n />\n
\n
\n\n \n
\n \n
\n
\n\n \n
\n
\n \n );\n };\n\n return (\n <>\n {children}\n\n
\n
\n
\n
\n
\n \n
\n {isOrphanVisits && (\n \n )}\n
\n
\n {visits.length > 0 && (\n
\n
\n setSelectedVisits([])}\n >\n Clear selection {highlightedVisits.length > 0 && <>({highlightedVisits.length})}\n \n exportCsv(normalizedVisits)}\n >\n Export ({normalizedVisits.length})\n \n
\n
\n )}\n
\n
\n\n
\n {renderVisitsContent()}\n
\n \n );\n};\n\nexport default VisitsStats;\n","import { isNil } from 'ramda';\nimport { ShortUrl } from '../data';\nimport { OptionalString } from '../../utils/utils';\n\nexport const shortUrlMatches = (shortUrl: ShortUrl, shortCode: string, domain: OptionalString): boolean => {\n if (isNil(domain)) {\n return shortUrl.shortCode === shortCode && !shortUrl.domain;\n }\n\n return shortUrl.shortCode === shortCode && shortUrl.domain === domain;\n};\n","import { Action } from 'redux';\nimport { CreateVisit } from '../types';\n\nexport const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS';\n\nexport interface CreateVisitsAction extends Action {\n createdVisits: CreateVisit[];\n}\n\nexport const createNewVisits = (createdVisits: CreateVisit[]): CreateVisitsAction => ({\n type: CREATE_VISITS,\n createdVisits,\n});\n","import { AxiosError } from 'axios';\nimport { InvalidArgumentError, InvalidShortUrlDeletion, ProblemDetailsError } from '../types';\n\nexport const parseApiError = (e: AxiosError) => e.response?.data;\n\nexport const isInvalidArgumentError = (error?: ProblemDetailsError): error is InvalidArgumentError =>\n error?.type === 'INVALID_ARGUMENT';\n\nexport const isInvalidDeletionError = (error?: ProblemDetailsError): error is InvalidShortUrlDeletion =>\n error?.type === 'INVALID_SHORTCODE_DELETION';\n","import { Action, Dispatch } from 'redux';\nimport { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { ProblemDetailsError } from '../../api/types';\nimport { GetState } from '../../container/types';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { parseApiError } from '../../api/utils';\n\n/* eslint-disable padding-line-between-statements */\nexport const DELETE_SHORT_URL_START = 'shlink/deleteShortUrl/DELETE_SHORT_URL_START';\nexport const DELETE_SHORT_URL_ERROR = 'shlink/deleteShortUrl/DELETE_SHORT_URL_ERROR';\nexport const SHORT_URL_DELETED = 'shlink/deleteShortUrl/SHORT_URL_DELETED';\nexport const RESET_DELETE_SHORT_URL = 'shlink/deleteShortUrl/RESET_DELETE_SHORT_URL';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlDeletion {\n shortCode: string;\n loading: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface DeleteShortUrlAction extends Action {\n shortCode: string;\n domain?: string | null;\n}\n\ninterface DeleteShortUrlErrorAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: ShortUrlDeletion = {\n shortCode: '',\n loading: false,\n error: false,\n};\n\nexport default buildReducer({\n [DELETE_SHORT_URL_START]: (state) => ({ ...state, loading: true, error: false }),\n [DELETE_SHORT_URL_ERROR]: (state, { errorData }) => ({ ...state, errorData, loading: false, error: true }),\n [SHORT_URL_DELETED]: (state, { shortCode }) => ({ ...state, shortCode, loading: false, error: false }),\n [RESET_DELETE_SHORT_URL]: () => initialState,\n}, initialState);\n\nexport const deleteShortUrl = (buildShlinkApiClient: ShlinkApiClientBuilder) => (\n shortCode: string,\n domain?: string | null,\n) => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: DELETE_SHORT_URL_START });\n const { deleteShortUrl } = buildShlinkApiClient(getState);\n\n try {\n await deleteShortUrl(shortCode, domain);\n dispatch({ type: SHORT_URL_DELETED, shortCode, domain });\n } catch (e) {\n dispatch({ type: DELETE_SHORT_URL_ERROR, errorData: parseApiError(e) });\n\n throw e;\n }\n};\n\nexport const resetDeleteShortUrl = buildActionCreator(RESET_DELETE_SHORT_URL);\n","import { Action, Dispatch } from 'redux';\nimport { GetState } from '../../container/types';\nimport { ShortUrl, ShortUrlData } from '../data';\nimport { buildReducer, buildActionCreator } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { ProblemDetailsError } from '../../api/types';\nimport { parseApiError } from '../../api/utils';\n\n/* eslint-disable padding-line-between-statements */\nexport const CREATE_SHORT_URL_START = 'shlink/createShortUrl/CREATE_SHORT_URL_START';\nexport const CREATE_SHORT_URL_ERROR = 'shlink/createShortUrl/CREATE_SHORT_URL_ERROR';\nexport const CREATE_SHORT_URL = 'shlink/createShortUrl/CREATE_SHORT_URL';\nexport const RESET_CREATE_SHORT_URL = 'shlink/createShortUrl/RESET_CREATE_SHORT_URL';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlCreation {\n result: ShortUrl | null;\n saving: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface CreateShortUrlAction extends Action {\n result: ShortUrl;\n}\n\nexport interface CreateShortUrlFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: ShortUrlCreation = {\n result: null,\n saving: false,\n error: false,\n};\n\nexport default buildReducer({\n [CREATE_SHORT_URL_START]: (state) => ({ ...state, saving: true, error: false }),\n [CREATE_SHORT_URL_ERROR]: (state, { errorData }) => ({ ...state, saving: false, error: true, errorData }),\n [CREATE_SHORT_URL]: (_, { result }) => ({ result, saving: false, error: false }),\n [RESET_CREATE_SHORT_URL]: () => initialState,\n}, initialState);\n\nexport const createShortUrl = (buildShlinkApiClient: ShlinkApiClientBuilder) => (data: ShortUrlData) => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n dispatch({ type: CREATE_SHORT_URL_START });\n const { createShortUrl } = buildShlinkApiClient(getState);\n\n try {\n const result = await createShortUrl(data);\n\n dispatch({ type: CREATE_SHORT_URL, result });\n } catch (e) {\n dispatch({ type: CREATE_SHORT_URL_ERROR, errorData: parseApiError(e) });\n\n throw e;\n }\n};\n\nexport const resetCreateShortUrl = buildActionCreator(RESET_CREATE_SHORT_URL);\n","import { Action, Dispatch } from 'redux';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { GetState } from '../../container/types';\nimport { OptionalString } from '../../utils/utils';\nimport { EditShortUrlData, ShortUrl } from '../data';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { ProblemDetailsError } from '../../api/types';\nimport { parseApiError } from '../../api/utils';\nimport { supportsTagsInPatch } from '../../utils/helpers/features';\n\n/* eslint-disable padding-line-between-statements */\nexport const EDIT_SHORT_URL_START = 'shlink/shortUrlEdition/EDIT_SHORT_URL_START';\nexport const EDIT_SHORT_URL_ERROR = 'shlink/shortUrlEdition/EDIT_SHORT_URL_ERROR';\nexport const SHORT_URL_EDITED = 'shlink/shortUrlEdition/SHORT_URL_EDITED';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlEdition {\n shortUrl?: ShortUrl;\n saving: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface ShortUrlEditedAction extends Action {\n shortUrl: ShortUrl;\n}\n\nexport interface ShortUrlEditionFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: ShortUrlEdition = {\n saving: false,\n error: false,\n};\n\nexport default buildReducer({\n [EDIT_SHORT_URL_START]: (state) => ({ ...state, saving: true, error: false }),\n [EDIT_SHORT_URL_ERROR]: (state, { errorData }) => ({ ...state, saving: false, error: true, errorData }),\n [SHORT_URL_EDITED]: (_, { shortUrl }) => ({ shortUrl, saving: false, error: false }),\n}, initialState);\n\nexport const editShortUrl = (buildShlinkApiClient: ShlinkApiClientBuilder) => (\n shortCode: string,\n domain: OptionalString,\n data: EditShortUrlData,\n) => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: EDIT_SHORT_URL_START });\n\n const { selectedServer } = getState();\n const sendTagsSeparately = !supportsTagsInPatch(selectedServer);\n const { updateShortUrl, updateShortUrlTags } = buildShlinkApiClient(getState);\n\n try {\n const [ shortUrl ] = await Promise.all([\n updateShortUrl(shortCode, domain, data as any), // FIXME Parse dates\n sendTagsSeparately && data.tags ? updateShortUrlTags(shortCode, domain, data.tags) : undefined,\n ]);\n\n dispatch({ shortUrl, type: SHORT_URL_EDITED });\n } catch (e) {\n dispatch({ type: EDIT_SHORT_URL_ERROR, errorData: parseApiError(e) });\n\n throw e;\n }\n};\n","import { assoc, assocPath, init, last, pipe, reject } from 'ramda';\nimport { Action, Dispatch } from 'redux';\nimport { shortUrlMatches } from '../helpers';\nimport { CREATE_VISITS, CreateVisitsAction } from '../../visits/reducers/visitCreation';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { GetState } from '../../container/types';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { ShlinkShortUrlsResponse } from '../../api/types';\nimport { DeleteShortUrlAction, SHORT_URL_DELETED } from './shortUrlDeletion';\nimport { ShortUrlsListParams } from './shortUrlsListParams';\nimport { CREATE_SHORT_URL, CreateShortUrlAction } from './shortUrlCreation';\nimport { SHORT_URL_EDITED, ShortUrlEditedAction } from './shortUrlEdition';\n\n/* eslint-disable padding-line-between-statements */\nexport const LIST_SHORT_URLS_START = 'shlink/shortUrlsList/LIST_SHORT_URLS_START';\nexport const LIST_SHORT_URLS_ERROR = 'shlink/shortUrlsList/LIST_SHORT_URLS_ERROR';\nexport const LIST_SHORT_URLS = 'shlink/shortUrlsList/LIST_SHORT_URLS';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlsList {\n shortUrls?: ShlinkShortUrlsResponse;\n loading: boolean;\n error: boolean;\n}\n\nexport interface ListShortUrlsAction extends Action {\n shortUrls: ShlinkShortUrlsResponse;\n params: ShortUrlsListParams;\n}\n\nexport type ListShortUrlsCombinedAction = (\n ListShortUrlsAction\n & CreateVisitsAction\n & CreateShortUrlAction\n & DeleteShortUrlAction\n & ShortUrlEditedAction\n);\n\nconst initialState: ShortUrlsList = {\n loading: true,\n error: false,\n};\n\nexport default buildReducer({\n [LIST_SHORT_URLS_START]: (state) => ({ ...state, loading: true, error: false }),\n [LIST_SHORT_URLS_ERROR]: () => ({ loading: false, error: true }),\n [LIST_SHORT_URLS]: (_, { shortUrls }) => ({ loading: false, error: false, shortUrls }),\n [SHORT_URL_DELETED]: pipe(\n (state: ShortUrlsList, { shortCode, domain }: DeleteShortUrlAction) => !state.shortUrls ? state : assocPath(\n [ 'shortUrls', 'data' ],\n reject((shortUrl) => shortUrlMatches(shortUrl, shortCode, domain), state.shortUrls.data),\n state,\n ),\n (state) => !state.shortUrls ? state : assocPath(\n [ 'shortUrls', 'pagination', 'totalItems' ],\n state.shortUrls.pagination.totalItems - 1,\n state,\n ),\n ),\n [CREATE_VISITS]: (state, { createdVisits }) => assocPath(\n [ 'shortUrls', 'data' ],\n state.shortUrls?.data?.map(\n (currentShortUrl) => {\n // Find the last of the new visit for this short URL, and pick the amount of visits from it\n const lastVisit = last(\n createdVisits.filter(\n ({ shortUrl }) => shortUrl && shortUrlMatches(currentShortUrl, shortUrl.shortCode, shortUrl.domain),\n ),\n );\n\n return lastVisit?.shortUrl\n ? assoc('visitsCount', lastVisit.shortUrl.visitsCount, currentShortUrl)\n : currentShortUrl;\n },\n ),\n state,\n ),\n [CREATE_SHORT_URL]: pipe(\n // The only place where the list and the creation form coexist is the overview page.\n // There we can assume we are displaying page 1, and therefore, we can safely prepend the new short URL and remove the last one.\n (state: ShortUrlsList, { result }: CreateShortUrlAction) => !state.shortUrls ? state : assocPath(\n [ 'shortUrls', 'data' ],\n [ result, ...init(state.shortUrls.data) ],\n state,\n ),\n (state: ShortUrlsList) => !state.shortUrls ? state : assocPath(\n [ 'shortUrls', 'pagination', 'totalItems' ],\n state.shortUrls.pagination.totalItems + 1,\n state,\n ),\n ),\n [SHORT_URL_EDITED]: (state, { shortUrl: editedShortUrl }) => !state.shortUrls ? state : assocPath(\n [ 'shortUrls', 'data' ],\n state.shortUrls.data.map((shortUrl) => {\n const { shortCode, domain } = editedShortUrl;\n\n return shortUrlMatches(shortUrl, shortCode, domain) ? editedShortUrl : shortUrl;\n }),\n state,\n ),\n}, initialState);\n\nexport const listShortUrls = (buildShlinkApiClient: ShlinkApiClientBuilder) => (\n params: ShortUrlsListParams = {},\n) => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: LIST_SHORT_URLS_START });\n const { listShortUrls } = buildShlinkApiClient(getState);\n\n try {\n const shortUrls = await listShortUrls(params);\n\n dispatch({ type: LIST_SHORT_URLS, shortUrls, params });\n } catch (e) {\n dispatch({ type: LIST_SHORT_URLS_ERROR, params });\n }\n};\n","import { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { OrderDir } from '../../utils/utils';\nimport { LIST_SHORT_URLS, ListShortUrlsAction } from './shortUrlsList';\n\nexport const RESET_SHORT_URL_PARAMS = 'shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS';\n\nexport const SORTABLE_FIELDS = {\n dateCreated: 'Created at',\n shortCode: 'Short URL',\n longUrl: 'Long URL',\n title: 'Title',\n visits: 'Visits',\n};\n\nexport type OrderableFields = keyof typeof SORTABLE_FIELDS;\n\nexport interface ShortUrlsListParams {\n page?: string;\n itemsPerPage?: number;\n tags?: string[];\n searchTerm?: string;\n startDate?: string;\n endDate?: string;\n orderBy?: Partial>;\n}\n\nconst initialState: ShortUrlsListParams = {\n page: '1',\n orderBy: { dateCreated: 'DESC' },\n};\n\nexport default buildReducer({\n [LIST_SHORT_URLS]: (state, { params }) => ({ ...state, ...params }),\n [RESET_SHORT_URL_PARAMS]: () => initialState,\n}, initialState);\n\nexport const resetShortUrlParams = buildActionCreator(RESET_SHORT_URL_PARAMS);\n","const TEN_ROUNDING_NUMBER = 10;\nconst { ceil } = Math;\nconst formatter = new Intl.NumberFormat('en-US');\n\nexport const prettify = (number: number) => formatter.format(number);\n\nexport const roundTen = (number: number) => ceil(number / TEN_ROUNDING_NUMBER) * TEN_ROUNDING_NUMBER;\n","import { max, min, range } from 'ramda';\nimport { prettify } from './numbers';\n\nconst DELTA = 2;\n\nexport const ELLIPSIS = '...';\n\ntype Ellipsis = typeof ELLIPSIS;\n\nexport type NumberOrEllipsis = number | Ellipsis;\n\nexport const progressivePagination = (currentPage: number, pageCount: number): NumberOrEllipsis[] => {\n const pages: NumberOrEllipsis[] = range(\n max(DELTA, currentPage - DELTA),\n min(pageCount - 1, currentPage + DELTA) + 1,\n );\n\n if (currentPage - DELTA > DELTA) {\n pages.unshift(ELLIPSIS);\n }\n if (currentPage + DELTA < pageCount - 1) {\n pages.push(ELLIPSIS);\n }\n\n pages.unshift(1);\n pages.push(pageCount);\n\n return pages;\n};\n\nexport const pageIsEllipsis = (pageNumber: NumberOrEllipsis): pageNumber is Ellipsis => pageNumber === ELLIPSIS;\n\nexport const prettifyPageNumber = (pageNumber: NumberOrEllipsis): string =>\n pageIsEllipsis(pageNumber) ? pageNumber : prettify(pageNumber);\n\nexport const keyForPage = (pageNumber: NumberOrEllipsis, index: number) => !pageIsEllipsis(pageNumber) ? `${pageNumber}` : `${pageNumber}_${index}`;\n","import { Link } from 'react-router-dom';\nimport { Pagination, PaginationItem, PaginationLink } from 'reactstrap';\nimport { pageIsEllipsis, keyForPage, progressivePagination, prettifyPageNumber } from '../utils/helpers/pagination';\nimport { ShlinkPaginator } from '../api/types';\nimport './Paginator.scss';\n\ninterface PaginatorProps {\n paginator?: ShlinkPaginator;\n serverId: string;\n}\n\nconst Paginator = ({ paginator, serverId }: PaginatorProps) => {\n const { currentPage = 0, pagesCount = 0 } = paginator ?? {};\n\n if (pagesCount <= 1) {\n return null;\n }\n\n const renderPages = () =>\n progressivePagination(currentPage, pagesCount).map((pageNumber, index) => (\n \n \n {prettifyPageNumber(pageNumber)}\n \n \n ));\n\n return (\n \n \n \n \n {renderPages()}\n = pagesCount}>\n \n \n \n );\n};\n\nexport default Paginator;\n","import { faCaretDown as caretDownIcon, faCaretUp as caretUpIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { head, keys, values } from 'ramda';\nimport { FC, useEffect, useState } from 'react';\nimport { RouteComponentProps } from 'react-router';\nimport { Card } from 'reactstrap';\nimport SortingDropdown from '../utils/SortingDropdown';\nimport { determineOrderDir, OrderDir } from '../utils/utils';\nimport { isReachableServer, SelectedServer } from '../servers/data';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport { parseQuery } from '../utils/helpers/query';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList';\nimport { OrderableFields, ShortUrlsListParams, SORTABLE_FIELDS } from './reducers/shortUrlsListParams';\nimport { ShortUrlsTableProps } from './ShortUrlsTable';\nimport Paginator from './Paginator';\nimport './ShortUrlsList.scss';\n\ninterface RouteParams {\n page: string;\n serverId: string;\n}\n\nexport interface ShortUrlsListProps extends RouteComponentProps {\n selectedServer: SelectedServer;\n shortUrlsList: ShortUrlsListState;\n listShortUrls: (params: ShortUrlsListParams) => void;\n shortUrlsListParams: ShortUrlsListParams;\n resetShortUrlParams: () => void;\n}\n\nconst ShortUrlsList = (ShortUrlsTable: FC) => boundToMercureHub(({\n listShortUrls,\n resetShortUrlParams,\n shortUrlsListParams,\n match,\n location,\n shortUrlsList,\n selectedServer,\n}: ShortUrlsListProps) => {\n const { orderBy } = shortUrlsListParams;\n const [ order, setOrder ] = useState<{ orderField?: OrderableFields; orderDir?: OrderDir }>({\n orderField: orderBy && (head(keys(orderBy)) as OrderableFields),\n orderDir: orderBy && head(values(orderBy)),\n });\n const { pagination } = shortUrlsList?.shortUrls ?? {};\n const refreshList = (extraParams: ShortUrlsListParams) => listShortUrls({ ...shortUrlsListParams, ...extraParams });\n const handleOrderBy = (orderField?: OrderableFields, orderDir?: OrderDir) => {\n setOrder({ orderField, orderDir });\n refreshList({ orderBy: orderField ? { [orderField]: orderDir } : undefined });\n };\n const orderByColumn = (field: OrderableFields) => () =>\n handleOrderBy(field, determineOrderDir(field, order.orderField, order.orderDir));\n const renderOrderIcon = (field: OrderableFields) => {\n if (order.orderField !== field) {\n return null;\n }\n\n if (!order.orderDir) {\n return null;\n }\n\n return (\n \n );\n };\n\n useEffect(() => {\n const { tag } = parseQuery<{ tag?: string }>(location.search);\n const tags = tag ? [ tag ] : shortUrlsListParams.tags;\n\n refreshList({ page: match.params.page, tags, itemsPerPage: undefined });\n\n return resetShortUrlParams;\n }, []);\n\n return (\n <>\n
\n \n
\n \n refreshList({ tags: [ ...shortUrlsListParams.tags ?? [], tag ] })}\n />\n \n \n \n );\n}, () => [ Topics.visits() ]);\n\nexport default ShortUrlsList;\n","import { FC } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCopy as copyIcon } from '@fortawesome/free-regular-svg-icons';\nimport CopyToClipboard from 'react-copy-to-clipboard';\nimport './CopyToClipboardIcon.scss';\n\ninterface CopyToClipboardIconProps {\n text: string;\n onCopy?: (text: string, result: boolean) => void;\n}\n\nexport const CopyToClipboardIcon: FC = ({ text, onCopy }) => (\n \n \n \n);\n","import { FC } from 'react';\nimport { Link } from 'react-router-dom';\nimport { isServerWithId, SelectedServer, ServerWithId } from '../../servers/data';\nimport { ShortUrl } from '../data';\n\nexport type LinkSuffix = 'visits' | 'edit';\n\nexport interface ShortUrlDetailLinkProps {\n shortUrl?: ShortUrl | null;\n selectedServer?: SelectedServer;\n suffix: LinkSuffix;\n}\n\nconst buildUrl = ({ id }: ServerWithId, { shortCode, domain }: ShortUrl, suffix: LinkSuffix) => {\n const query = domain ? `?domain=${domain}` : '';\n\n return `/server/${id}/short-code/${shortCode}/${suffix}${query}`;\n};\n\nconst ShortUrlDetailLink: FC> = (\n { selectedServer, shortUrl, suffix, children, ...rest },\n) => {\n if (!selectedServer || !isServerWithId(selectedServer) || !shortUrl) {\n return {children};\n }\n\n return {children};\n};\n\nexport default ShortUrlDetailLink;\n","import { useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';\nimport { UncontrolledTooltip } from 'reactstrap';\nimport classNames from 'classnames';\nimport { prettify } from '../../utils/helpers/numbers';\nimport { ShortUrl } from '../data';\nimport { SelectedServer } from '../../servers/data';\nimport ShortUrlDetailLink from './ShortUrlDetailLink';\nimport './ShortUrlVisitsCount.scss';\n\ninterface ShortUrlVisitsCountProps {\n shortUrl?: ShortUrl | null;\n selectedServer?: SelectedServer;\n visitsCount: number;\n active?: boolean;\n}\n\nconst ShortUrlVisitsCount = ({ visitsCount, shortUrl, selectedServer, active = false }: ShortUrlVisitsCountProps) => {\n const maxVisits = shortUrl?.meta?.maxVisits;\n const visitsLink = (\n \n \n {prettify(visitsCount)}\n \n \n );\n\n if (!maxVisits) {\n return visitsLink;\n }\n\n const prettifiedMaxVisits = prettify(maxVisits);\n const tooltipRef = useRef();\n\n return (\n <>\n \n {visitsLink}\n {\n tooltipRef.current = el;\n }}\n >\n {' '}/ {prettifiedMaxVisits}{' '}\n \n \n \n \n \n tooltipRef.current) as any} placement=\"bottom\">\n This short URL will not accept more than {prettifiedMaxVisits} visits.\n \n \n );\n};\n\nexport default ShortUrlVisitsCount;\n","import { isEmpty } from 'ramda';\nimport { FC, useEffect, useRef } from 'react';\nimport Moment from 'react-moment';\nimport { ExternalLink } from 'react-external-link';\nimport ColorGenerator from '../../utils/services/ColorGenerator';\nimport { StateFlagTimeout } from '../../utils/helpers/hooks';\nimport Tag from '../../tags/helpers/Tag';\nimport { SelectedServer } from '../../servers/data';\nimport { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon';\nimport { ShortUrl } from '../data';\nimport ShortUrlVisitsCount from './ShortUrlVisitsCount';\nimport { ShortUrlsRowMenuProps } from './ShortUrlsRowMenu';\nimport './ShortUrlsRow.scss';\n\nexport interface ShortUrlsRowProps {\n onTagClick?: (tag: string) => void;\n selectedServer: SelectedServer;\n shortUrl: ShortUrl;\n}\n\nconst ShortUrlsRow = (\n ShortUrlsRowMenu: FC,\n colorGenerator: ColorGenerator,\n useStateFlagTimeout: StateFlagTimeout,\n) => ({ shortUrl, selectedServer, onTagClick }: ShortUrlsRowProps) => {\n const [ copiedToClipboard, setCopiedToClipboard ] = useStateFlagTimeout();\n const [ active, setActive ] = useStateFlagTimeout(false, 500);\n const isFirstRun = useRef(true);\n\n const renderTags = (tags: string[]) => {\n if (isEmpty(tags)) {\n return No tags;\n }\n\n return tags.map((tag) => (\n onTagClick?.(tag)}\n />\n ));\n };\n\n useEffect(() => {\n if (isFirstRun.current) {\n isFirstRun.current = false;\n } else {\n setActive();\n }\n }, [ shortUrl.visitsCount ]);\n\n return (\n \n \n {shortUrl.dateCreated}\n \n \n \n \n \n \n \n \n \n {shortUrl.title ?? shortUrl.longUrl}\n \n {shortUrl.title && (\n \n \n \n )}\n {renderTags(shortUrl.tags)}\n \n \n \n \n \n \n \n );\n};\n\nexport default ShortUrlsRow;\n","import {\n faChartPie as pieChartIcon,\n faEllipsisV as menuIcon,\n faQrcode as qrIcon,\n faMinusCircle as deleteIcon,\n faEdit as editIcon,\n} from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { FC } from 'react';\nimport { ButtonDropdown, DropdownItem, DropdownMenu, DropdownToggle } from 'reactstrap';\nimport { useToggle } from '../../utils/helpers/hooks';\nimport { ShortUrl, ShortUrlModalProps } from '../data';\nimport { SelectedServer } from '../../servers/data';\nimport ShortUrlDetailLink from './ShortUrlDetailLink';\nimport './ShortUrlsRowMenu.scss';\n\nexport interface ShortUrlsRowMenuProps {\n selectedServer: SelectedServer;\n shortUrl: ShortUrl;\n}\ntype ShortUrlModal = FC;\n\nconst ShortUrlsRowMenu = (\n DeleteShortUrlModal: ShortUrlModal,\n QrCodeModal: ShortUrlModal,\n) => ({ shortUrl, selectedServer }: ShortUrlsRowMenuProps) => {\n const [ isOpen, toggle ] = useToggle();\n const [ isQrModalOpen, toggleQrCode ] = useToggle();\n const [ isDeleteModalOpen, toggleDelete ] = useToggle();\n\n return (\n \n \n   \n \n \n \n Visit stats\n \n\n \n Edit short URL\n \n\n \n QR code\n \n \n\n \n\n \n Delete short URL\n \n \n \n \n );\n};\n\nexport default ShortUrlsRowMenu;\n","import { FC, useMemo } from 'react';\nimport { SelectedServer } from '../servers/data';\nimport { Settings, ShortUrlCreationSettings } from '../settings/reducers/settings';\nimport { ShortUrlData } from './data';\nimport { ShortUrlCreation } from './reducers/shortUrlCreation';\nimport { CreateShortUrlResultProps } from './helpers/CreateShortUrlResult';\nimport { ShortUrlFormProps } from './ShortUrlForm';\n\nexport interface CreateShortUrlProps {\n basicMode?: boolean;\n}\n\ninterface CreateShortUrlConnectProps extends CreateShortUrlProps {\n settings: Settings;\n shortUrlCreationResult: ShortUrlCreation;\n selectedServer: SelectedServer;\n createShortUrl: (data: ShortUrlData) => Promise;\n resetCreateShortUrl: () => void;\n}\n\nconst getInitialState = (settings?: ShortUrlCreationSettings): ShortUrlData => ({\n longUrl: '',\n tags: [],\n customSlug: '',\n title: undefined,\n shortCodeLength: undefined,\n domain: '',\n validSince: undefined,\n validUntil: undefined,\n maxVisits: undefined,\n findIfExists: false,\n validateUrl: settings?.validateUrls ?? false,\n});\n\nconst CreateShortUrl = (ShortUrlForm: FC, CreateShortUrlResult: FC) => ({\n createShortUrl,\n shortUrlCreationResult,\n resetCreateShortUrl,\n selectedServer,\n basicMode = false,\n settings: { shortUrlCreation: shortUrlCreationSettings },\n}: CreateShortUrlConnectProps) => {\n const initialState = useMemo(() => getInitialState(shortUrlCreationSettings), [ shortUrlCreationSettings ]);\n\n return (\n <>\n {\n resetCreateShortUrl();\n\n return createShortUrl(data);\n }}\n />\n \n \n );\n};\n\nexport default CreateShortUrl;\n","import { FC } from 'react';\nimport { Row } from 'reactstrap';\nimport classNames from 'classnames';\nimport { SimpleCard } from './SimpleCard';\n\nexport type ResultType = 'success' | 'error' | 'warning';\n\nexport interface ResultProps {\n type: ResultType;\n className?: string;\n small?: boolean;\n}\n\nexport const Result: FC = ({ children, type, className, small = false }) => (\n \n
\n \n {children}\n \n
\n
\n);\n","import { ProblemDetailsError } from './types';\nimport { isInvalidArgumentError } from './utils';\n\nexport interface ShlinkApiErrorProps {\n errorData?: ProblemDetailsError;\n fallbackMessage?: string;\n}\n\nexport const ShlinkApiError = ({ errorData, fallbackMessage }: ShlinkApiErrorProps) => (\n <>\n {errorData?.detail ?? fallbackMessage}\n {isInvalidArgumentError(errorData) &&\n

Invalid elements: [{errorData.invalidElements.join(', ')}]

\n }\n \n);\n","import { useEffect, useState } from 'react';\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\nimport { identity, pipe } from 'ramda';\nimport { ShortUrlDeletion } from '../reducers/shortUrlDeletion';\nimport { ShortUrlModalProps } from '../data';\nimport { handleEventPreventingDefault, OptionalString } from '../../utils/utils';\nimport { Result } from '../../utils/Result';\nimport { isInvalidDeletionError } from '../../api/utils';\nimport { ShlinkApiError } from '../../api/ShlinkApiError';\n\ninterface DeleteShortUrlModalConnectProps extends ShortUrlModalProps {\n shortUrlDeletion: ShortUrlDeletion;\n deleteShortUrl: (shortCode: string, domain: OptionalString) => Promise;\n resetDeleteShortUrl: () => void;\n}\n\nconst DeleteShortUrlModal = (\n { shortUrl, toggle, isOpen, shortUrlDeletion, resetDeleteShortUrl, deleteShortUrl }: DeleteShortUrlModalConnectProps,\n) => {\n const [ inputValue, setInputValue ] = useState('');\n\n useEffect(() => resetDeleteShortUrl, []);\n\n const { error, errorData } = shortUrlDeletion;\n const close = pipe(resetDeleteShortUrl, toggle);\n const handleDeleteUrl = handleEventPreventingDefault(() => {\n const { shortCode, domain } = shortUrl;\n\n deleteShortUrl(shortCode, domain)\n .then(toggle)\n .catch(identity);\n });\n\n return (\n \n
\n \n Delete short URL\n \n \n

Caution! You are about to delete a short URL.

\n

This action cannot be undone. Once you have deleted it, all the visits stats will be lost.

\n

Write {shortUrl.shortCode} to confirm deletion.

\n\n setInputValue(e.target.value)}\n />\n\n {error && (\n \n \n \n )}\n
\n \n \n \n {shortUrlDeletion.loading ? 'Deleting...' : 'Delete'}\n \n \n
\n
\n );\n};\n\nexport default DeleteShortUrlModal;\n","import { faCopy as copyIcon } from '@fortawesome/free-regular-svg-icons';\nimport { faTimes as closeIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { isNil } from 'ramda';\nimport { useEffect } from 'react';\nimport CopyToClipboard from 'react-copy-to-clipboard';\nimport { Tooltip } from 'reactstrap';\nimport { ShortUrlCreation } from '../reducers/shortUrlCreation';\nimport { StateFlagTimeout } from '../../utils/helpers/hooks';\nimport { Result } from '../../utils/Result';\nimport './CreateShortUrlResult.scss';\nimport { ShlinkApiError } from '../../api/ShlinkApiError';\n\nexport interface CreateShortUrlResultProps extends ShortUrlCreation {\n resetCreateShortUrl: () => void;\n canBeClosed?: boolean;\n}\n\nconst CreateShortUrlResult = (useStateFlagTimeout: StateFlagTimeout) => (\n { error, errorData, result, resetCreateShortUrl, canBeClosed = false }: CreateShortUrlResultProps,\n) => {\n const [ showCopyTooltip, setShowCopyTooltip ] = useStateFlagTimeout();\n\n useEffect(() => {\n resetCreateShortUrl();\n }, []);\n\n if (error) {\n return (\n \n {canBeClosed && }\n \n \n );\n }\n\n if (isNil(result)) {\n return null;\n }\n\n const { shortUrl } = result;\n\n return (\n \n {canBeClosed && }\n Great! The short URL is {shortUrl}\n\n \n \n Copy\n \n \n\n \n Copied!\n \n \n );\n};\n\nexport default CreateShortUrlResult;\n","import { FC, ReactNode } from 'react';\nimport { isEmpty } from 'ramda';\nimport classNames from 'classnames';\nimport { SelectedServer } from '../servers/data';\nimport { supportsShortUrlTitle } from '../utils/helpers/features';\nimport { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList';\nimport { ShortUrlsRowProps } from './helpers/ShortUrlsRow';\nimport { OrderableFields } from './reducers/shortUrlsListParams';\nimport './ShortUrlsTable.scss';\n\nexport interface ShortUrlsTableProps {\n orderByColumn?: (column: OrderableFields) => () => void;\n renderOrderIcon?: (column: OrderableFields) => ReactNode;\n shortUrlsList: ShortUrlsListState;\n selectedServer: SelectedServer;\n onTagClick?: (tag: string) => void;\n className?: string;\n}\n\nexport const ShortUrlsTable = (ShortUrlsRow: FC) => ({\n orderByColumn,\n renderOrderIcon,\n shortUrlsList,\n onTagClick,\n selectedServer,\n className,\n}: ShortUrlsTableProps) => {\n const { error, loading, shortUrls } = shortUrlsList;\n const actionableFieldClasses = classNames({ 'short-urls-table__header-cell--with-action': !!orderByColumn });\n const orderableColumnsClasses = classNames('short-urls-table__header-cell', actionableFieldClasses);\n const tableClasses = classNames('table table-hover', className);\n const supportsTitle = supportsShortUrlTitle(selectedServer);\n\n const renderShortUrls = () => {\n if (error) {\n return (\n \n Something went wrong while loading short URLs :(\n \n );\n }\n\n if (loading) {\n return Loading...;\n }\n\n if (!loading && isEmpty(shortUrls?.data)) {\n return No results found;\n }\n\n return shortUrls?.data.map((shortUrl) => (\n \n ));\n };\n\n return (\n \n \n \n \n \n {!supportsTitle && (\n \n ) || (\n \n )}\n \n \n \n \n \n \n {renderShortUrls()}\n \n
\n Created at\n {renderOrderIcon?.('dateCreated')}\n \n Short URL\n {renderOrderIcon?.('shortCode')}\n \n Long URL\n {renderOrderIcon?.('longUrl')}\n \n \n Title\n {renderOrderIcon?.('title')}\n \n   /  \n \n Long URL\n {renderOrderIcon?.('longUrl')}\n \n Tags\n Visits{renderOrderIcon?.('visits')}\n  
\n );\n};\n","import { isEmpty } from 'ramda';\nimport { stringifyQuery } from './query';\n\nexport interface QrCodeCapabilities {\n useSizeInPath: boolean;\n svgIsSupported: boolean;\n marginIsSupported: boolean;\n}\n\nexport type QrCodeFormat = 'svg' | 'png';\n\nexport interface QrCodeOptions {\n size: number;\n format: QrCodeFormat;\n margin: number;\n}\n\nexport const buildQrCodeUrl = (\n shortUrl: string,\n { size, format, margin }: QrCodeOptions,\n { useSizeInPath, svgIsSupported, marginIsSupported }: QrCodeCapabilities,\n): string => {\n const baseUrl = `${shortUrl}/qr-code${useSizeInPath ? `/${size}` : ''}`;\n const query = stringifyQuery({\n size: useSizeInPath ? undefined : size,\n format: svgIsSupported ? format : undefined,\n margin: marginIsSupported && margin > 0 ? margin : undefined,\n });\n\n return `${baseUrl}${isEmpty(query) ? '' : `?${query}`}`;\n};\n","import { useMemo, useState } from 'react';\nimport { Modal, DropdownItem, FormGroup, ModalBody, ModalHeader, Row } from 'reactstrap';\nimport { ExternalLink } from 'react-external-link';\nimport classNames from 'classnames';\nimport { ShortUrlModalProps } from '../data';\nimport { SelectedServer } from '../../servers/data';\nimport { DropdownBtn } from '../../utils/DropdownBtn';\nimport { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon';\nimport { buildQrCodeUrl, QrCodeCapabilities, QrCodeFormat } from '../../utils/helpers/qrCodes';\nimport { supportsQrCodeSizeInQuery, supportsQrCodeSvgFormat, supportsQrCodeMargin } from '../../utils/helpers/features';\nimport './QrCodeModal.scss';\n\ninterface QrCodeModalConnectProps extends ShortUrlModalProps {\n selectedServer: SelectedServer;\n}\n\nconst QrCodeModal = ({ shortUrl: { shortUrl }, toggle, isOpen, selectedServer }: QrCodeModalConnectProps) => {\n const [ size, setSize ] = useState(300);\n const [ margin, setMargin ] = useState(0);\n const [ format, setFormat ] = useState('png');\n const capabilities: QrCodeCapabilities = useMemo(() => ({\n useSizeInPath: !supportsQrCodeSizeInQuery(selectedServer),\n svgIsSupported: supportsQrCodeSvgFormat(selectedServer),\n marginIsSupported: supportsQrCodeMargin(selectedServer),\n }), [ selectedServer ]);\n const qrCodeUrl = useMemo(\n () => buildQrCodeUrl(shortUrl, { size, format, margin }, capabilities),\n [ shortUrl, size, format, margin, capabilities ],\n );\n const totalSize = useMemo(() => size + margin, [ size, margin ]);\n const modalSize = useMemo(() => {\n if (totalSize < 500) {\n return undefined;\n }\n\n return totalSize < 800 ? 'lg' : 'xl';\n }, [ totalSize ]);\n\n return (\n \n \n QR code for {shortUrl}\n \n \n \n \n \n \n setSize(Number(e.target.value))}\n />\n \n \n {capabilities.marginIsSupported && (\n
\n \n \n setMargin(Number(e.target.value))}\n />\n \n
\n )}\n {capabilities.svgIsSupported && (\n
\n \n setFormat('png')}>PNG\n setFormat('svg')}>SVG\n \n
\n )}\n
\n
\n
\n
QR code URL:
\n \n \n
\n \"QR\n
{size}x{size}
\n
\n
\n
\n );\n};\n\nexport default QrCodeModal;\n","import { ChangeEvent, FC, useRef } from 'react';\nimport classNames from 'classnames';\nimport { v4 as uuid } from 'uuid';\nimport { identity } from 'ramda';\n\nexport interface BooleanControlProps {\n checked?: boolean;\n onChange?: (checked: boolean, e: ChangeEvent) => void;\n className?: string;\n inline?: boolean;\n}\n\ninterface BooleanControlWithTypeProps extends BooleanControlProps {\n type: 'switch' | 'checkbox';\n}\n\nconst BooleanControl: FC = (\n { checked = false, onChange = identity, className, children, type, inline = false },\n) => {\n const { current: id } = useRef(uuid());\n const onChecked = (e: ChangeEvent) => onChange(e.target.checked, e);\n const typeClasses = {\n 'custom-switch': type === 'switch',\n 'custom-checkbox': type === 'checkbox',\n };\n const style = inline ? { display: 'inline-block' } : {};\n\n return (\n \n \n \n \n );\n};\n\nexport default BooleanControl;\n","import { FC } from 'react';\nimport BooleanControl, { BooleanControlProps } from './BooleanControl';\n\nconst Checkbox: FC = (props) => ;\n\nexport default Checkbox;\n","import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';\nimport { Modal, ModalBody, ModalHeader } from 'reactstrap';\nimport { useToggle } from '../utils/helpers/hooks';\nimport './UseExistingIfFoundInfoIcon.scss';\n\nconst InfoModal = ({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) => (\n \n Info\n \n

\n When the \n "Use existing URL if found"\n  checkbox is checked, the server will return an existing short URL if it matches provided params.\n

\n

\n These are the checks performed by Shlink in order to determine if an existing short URL should be returned:\n

\n
    \n
  • \n When only the long URL is provided: The most recent match will be returned, or a new short URL will be created\n if none is found.\n
  • \n
  • \n When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match\n the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.\n
    \n If the slug is being used by another long URL, an error will be returned.\n
  • \n
  • \n When other params are provided: Same as in previous cases, but it will try to match existing short URLs with\n all provided data. If any of them does not match, a new short URL will be created\n
  • \n
\n
\n
\n);\n\nconst UseExistingIfFoundInfoIcon = () => {\n const [ isModalOpen, toggleModal ] = useToggle();\n\n return (\n <>\n \n \n \n \n \n );\n};\n\nexport default UseExistingIfFoundInfoIcon;\n","import { FC, useEffect, useState } from 'react';\nimport { InputType } from 'reactstrap/lib/Input';\nimport { Button, FormGroup, Input, Row } from 'reactstrap';\nimport { isEmpty, pipe, replace, trim } from 'ramda';\nimport m from 'moment';\nimport classNames from 'classnames';\nimport DateInput, { DateInputProps } from '../utils/DateInput';\nimport {\n supportsListingDomains,\n supportsSettingShortCodeLength,\n supportsShortUrlTitle,\n supportsValidateUrl,\n} from '../utils/helpers/features';\nimport { SimpleCard } from '../utils/SimpleCard';\nimport { handleEventPreventingDefault, hasValue } from '../utils/utils';\nimport Checkbox from '../utils/Checkbox';\nimport { SelectedServer } from '../servers/data';\nimport { TagsSelectorProps } from '../tags/helpers/TagsSelector';\nimport { DomainSelectorProps } from '../domains/DomainSelector';\nimport { formatIsoDate } from '../utils/helpers/date';\nimport UseExistingIfFoundInfoIcon from './UseExistingIfFoundInfoIcon';\nimport { ShortUrlData } from './data';\nimport './ShortUrlForm.scss';\n\nexport type Mode = 'create' | 'create-basic' | 'edit';\n\ntype DateFields = 'validSince' | 'validUntil';\ntype NonDateFields = 'longUrl' | 'customSlug' | 'shortCodeLength' | 'domain' | 'maxVisits' | 'title';\n\nexport interface ShortUrlFormProps {\n mode: Mode;\n saving: boolean;\n initialState: ShortUrlData;\n onSave: (shortUrlData: ShortUrlData) => Promise;\n selectedServer: SelectedServer;\n}\n\nconst normalizeTag = pipe(trim, replace(/ /g, '-'));\n\nexport const ShortUrlForm = (\n TagsSelector: FC,\n DomainSelector: FC,\n): FC => ({ mode, saving, onSave, initialState, selectedServer }) => { // eslint-disable-line complexity\n const [ shortUrlData, setShortUrlData ] = useState(initialState);\n const isEdit = mode === 'edit';\n const changeTags = (tags: string[]) => setShortUrlData({ ...shortUrlData, tags: tags.map(normalizeTag) });\n const reset = () => setShortUrlData(initialState);\n const submit = handleEventPreventingDefault(async () => onSave({\n ...shortUrlData,\n validSince: formatIsoDate(shortUrlData.validSince) ?? null,\n validUntil: formatIsoDate(shortUrlData.validUntil) ?? null,\n maxVisits: !hasValue(shortUrlData.maxVisits) ? null : Number(shortUrlData.maxVisits),\n title: !hasValue(shortUrlData.title) ? undefined : shortUrlData.title,\n }).then(() => !isEdit && reset()).catch(() => {}));\n\n useEffect(() => {\n setShortUrlData(initialState);\n }, [ initialState ]);\n\n const renderOptionalInput = (id: NonDateFields, placeholder: string, type: InputType = 'text', props = {}) => (\n \n setShortUrlData({ ...shortUrlData, [id]: e.target.value })}\n {...props}\n />\n \n );\n const renderDateInput = (id: DateFields, placeholder: string, props: Partial = {}) => (\n
\n setShortUrlData({ ...shortUrlData, [id]: date })}\n {...props}\n />\n
\n );\n const basicComponents = (\n <>\n \n setShortUrlData({ ...shortUrlData, longUrl: e.target.value })}\n />\n \n\n \n \n \n \n );\n\n const showDomainSelector = supportsListingDomains(selectedServer);\n const disableShortCodeLength = !supportsSettingShortCodeLength(selectedServer);\n const supportsTitle = supportsShortUrlTitle(selectedServer);\n const showCustomizeCard = supportsTitle || !isEdit;\n const limitAccessCardClasses = classNames('mb-3', {\n 'col-sm-6': showCustomizeCard,\n 'col-sm-12': !showCustomizeCard,\n });\n const showValidateUrl = supportsValidateUrl(selectedServer);\n const showExtraValidationsCard = showValidateUrl || !isEdit;\n\n return (\n
\n {mode === 'create-basic' && basicComponents}\n {mode !== 'create-basic' && (\n <>\n \n {basicComponents}\n \n\n \n {showCustomizeCard && (\n
\n \n {supportsTitle && renderOptionalInput('title', 'Title')}\n {!isEdit && (\n <>\n \n
\n {renderOptionalInput('customSlug', 'Custom slug', 'text', {\n disabled: hasValue(shortUrlData.shortCodeLength),\n })}\n
\n
\n {renderOptionalInput('shortCodeLength', 'Short code length', 'number', {\n min: 4,\n disabled: disableShortCodeLength || hasValue(shortUrlData.customSlug),\n ...disableShortCodeLength && {\n title: 'Shlink 2.1.0 or higher is required to be able to provide the short code length',\n },\n })}\n
\n
\n {!showDomainSelector && renderOptionalInput('domain', 'Domain', 'text')}\n {showDomainSelector && (\n \n setShortUrlData({ ...shortUrlData, domain })}\n />\n \n )}\n \n )}\n
\n
\n )}\n\n
\n \n {renderOptionalInput('maxVisits', 'Maximum number of visits allowed', 'number', { min: 1 })}\n {renderDateInput('validSince', 'Enabled since...', { maxDate: shortUrlData.validUntil ? m(shortUrlData.validUntil) : undefined })}\n {renderDateInput('validUntil', 'Enabled until...', { minDate: shortUrlData.validSince ? m(shortUrlData.validSince) : undefined })}\n \n
\n
\n\n {showExtraValidationsCard && (\n \n {!isEdit && (\n

\n Make sure the long URL is valid, or ensure an existing short URL is returned if it matches all\n provided data.\n

\n )}\n {showValidateUrl && (\n

\n setShortUrlData({ ...shortUrlData, validateUrl })}\n >\n Validate URL\n \n

\n )}\n {!isEdit && (\n

\n setShortUrlData({ ...shortUrlData, findIfExists })}\n >\n Use existing URL if found\n \n \n

\n )}\n
\n )}\n \n )}\n\n
\n \n {saving ? 'Saving...' : 'Save'}\n \n
\n
\n );\n};\n","import { FC, useEffect, useMemo } from 'react';\nimport { RouteComponentProps } from 'react-router';\nimport { Button, Card } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faArrowLeft } from '@fortawesome/free-solid-svg-icons';\nimport { ExternalLink } from 'react-external-link';\nimport { SelectedServer } from '../servers/data';\nimport { Settings, ShortUrlCreationSettings } from '../settings/reducers/settings';\nimport { OptionalString } from '../utils/utils';\nimport { parseQuery } from '../utils/helpers/query';\nimport Message from '../utils/Message';\nimport { Result } from '../utils/Result';\nimport { ShlinkApiError } from '../api/ShlinkApiError';\nimport { useToggle } from '../utils/helpers/hooks';\nimport { ShortUrlFormProps } from './ShortUrlForm';\nimport { ShortUrlDetail } from './reducers/shortUrlDetail';\nimport { EditShortUrlData, ShortUrl, ShortUrlData } from './data';\nimport { ShortUrlEdition } from './reducers/shortUrlEdition';\n\ninterface EditShortUrlConnectProps extends RouteComponentProps<{ shortCode: string }> {\n settings: Settings;\n selectedServer: SelectedServer;\n shortUrlDetail: ShortUrlDetail;\n shortUrlEdition: ShortUrlEdition;\n getShortUrlDetail: (shortCode: string, domain: OptionalString) => void;\n editShortUrl: (shortUrl: string, domain: OptionalString, data: EditShortUrlData) => Promise;\n}\n\nconst getInitialState = (shortUrl?: ShortUrl, settings?: ShortUrlCreationSettings): ShortUrlData => {\n const validateUrl = settings?.validateUrls ?? false;\n\n if (!shortUrl) {\n return { longUrl: '', validateUrl };\n }\n\n return {\n longUrl: shortUrl.longUrl,\n tags: shortUrl.tags,\n title: shortUrl.title ?? undefined,\n domain: shortUrl.domain ?? undefined,\n validSince: shortUrl.meta.validSince ?? undefined,\n validUntil: shortUrl.meta.validUntil ?? undefined,\n maxVisits: shortUrl.meta.maxVisits ?? undefined,\n validateUrl,\n };\n};\n\nexport const EditShortUrl = (ShortUrlForm: FC) => ({\n history: { goBack },\n match: { params },\n location: { search },\n settings: { shortUrlCreation: shortUrlCreationSettings },\n selectedServer,\n shortUrlDetail,\n getShortUrlDetail,\n shortUrlEdition,\n editShortUrl,\n}: EditShortUrlConnectProps) => {\n const { loading, error, errorData, shortUrl } = shortUrlDetail;\n const { saving, error: savingError, errorData: savingErrorData } = shortUrlEdition;\n const { domain } = parseQuery<{ domain?: string }>(search);\n const initialState = useMemo(\n () => getInitialState(shortUrl, shortUrlCreationSettings),\n [ shortUrl, shortUrlCreationSettings ],\n );\n const [ savingSucceeded,, isSuccessful, isNotSuccessful ] = useToggle();\n\n useEffect(() => {\n getShortUrlDetail(params.shortCode, domain);\n }, []);\n\n if (loading) {\n return ;\n }\n\n if (error) {\n return (\n \n \n \n );\n }\n\n return (\n <>\n
\n \n

\n \n \n Edit \n \n \n

\n
\n
\n {\n if (!shortUrl) {\n return;\n }\n\n isNotSuccessful();\n editShortUrl(shortUrl.shortCode, shortUrl.domain, shortUrlData)\n .then(isSuccessful)\n .catch(isNotSuccessful);\n }}\n />\n {savingError && (\n \n \n \n )}\n {savingSucceeded && Short URL properly edited.}\n \n );\n};\n","import { Action, Dispatch } from 'redux';\nimport { ShortUrl } from '../data';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { OptionalString } from '../../utils/utils';\nimport { GetState } from '../../container/types';\nimport { shortUrlMatches } from '../helpers';\nimport { ProblemDetailsError } from '../../api/types';\nimport { parseApiError } from '../../api/utils';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_SHORT_URL_DETAIL_START = 'shlink/shortUrlDetail/GET_SHORT_URL_DETAIL_START';\nexport const GET_SHORT_URL_DETAIL_ERROR = 'shlink/shortUrlDetail/GET_SHORT_URL_DETAIL_ERROR';\nexport const GET_SHORT_URL_DETAIL = 'shlink/shortUrlDetail/GET_SHORT_URL_DETAIL';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlDetail {\n shortUrl?: ShortUrl;\n loading: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface ShortUrlDetailAction extends Action {\n shortUrl: ShortUrl;\n}\n\nexport interface ShortUrlDetailFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: ShortUrlDetail = {\n loading: false,\n error: false,\n};\n\nexport default buildReducer({\n [GET_SHORT_URL_DETAIL_START]: () => ({ loading: true, error: false }),\n [GET_SHORT_URL_DETAIL_ERROR]: (_, { errorData }) => ({ loading: false, error: true, errorData }),\n [GET_SHORT_URL_DETAIL]: (_, { shortUrl }) => ({ shortUrl, ...initialState }),\n}, initialState);\n\nexport const getShortUrlDetail = (buildShlinkApiClient: ShlinkApiClientBuilder) => (\n shortCode: string,\n domain: OptionalString,\n) => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: GET_SHORT_URL_DETAIL_START });\n\n try {\n const { shortUrlsList } = getState();\n const shortUrl = shortUrlsList?.shortUrls?.data.find(\n (shortUrl) => shortUrlMatches(shortUrl, shortCode, domain),\n ) ?? await buildShlinkApiClient(getState).getShortUrl(shortCode, domain);\n\n dispatch({ shortUrl, type: GET_SHORT_URL_DETAIL });\n } catch (e) {\n dispatch({ type: GET_SHORT_URL_DETAIL_ERROR, errorData: parseApiError(e) });\n }\n};\n","import Bottle from 'bottlejs';\nimport ShortUrls from '../ShortUrls';\nimport SearchBar from '../SearchBar';\nimport ShortUrlsList from '../ShortUrlsList';\nimport ShortUrlsRow from '../helpers/ShortUrlsRow';\nimport ShortUrlsRowMenu from '../helpers/ShortUrlsRowMenu';\nimport CreateShortUrl from '../CreateShortUrl';\nimport DeleteShortUrlModal from '../helpers/DeleteShortUrlModal';\nimport CreateShortUrlResult from '../helpers/CreateShortUrlResult';\nimport { listShortUrls } from '../reducers/shortUrlsList';\nimport { createShortUrl, resetCreateShortUrl } from '../reducers/shortUrlCreation';\nimport { deleteShortUrl, resetDeleteShortUrl } from '../reducers/shortUrlDeletion';\nimport { resetShortUrlParams } from '../reducers/shortUrlsListParams';\nimport { editShortUrl } from '../reducers/shortUrlEdition';\nimport { ConnectDecorator } from '../../container/types';\nimport { ShortUrlsTable } from '../ShortUrlsTable';\nimport QrCodeModal from '../helpers/QrCodeModal';\nimport { ShortUrlForm } from '../ShortUrlForm';\nimport { EditShortUrl } from '../EditShortUrl';\nimport { getShortUrlDetail } from '../reducers/shortUrlDetail';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator) => {\n // Components\n bottle.serviceFactory('ShortUrls', ShortUrls, 'SearchBar', 'ShortUrlsList');\n bottle.decorator('ShortUrls', connect([ 'shortUrlsList' ]));\n\n bottle.serviceFactory('ShortUrlsList', ShortUrlsList, 'ShortUrlsTable');\n bottle.decorator('ShortUrlsList', connect(\n [ 'selectedServer', 'shortUrlsListParams', 'mercureInfo' ],\n [ 'listShortUrls', 'resetShortUrlParams', 'createNewVisits', 'loadMercureInfo' ],\n ));\n\n bottle.serviceFactory('ShortUrlsTable', ShortUrlsTable, 'ShortUrlsRow');\n bottle.serviceFactory('ShortUrlsRow', ShortUrlsRow, 'ShortUrlsRowMenu', 'ColorGenerator', 'useStateFlagTimeout');\n bottle.serviceFactory('ShortUrlsRowMenu', ShortUrlsRowMenu, 'DeleteShortUrlModal', 'QrCodeModal');\n bottle.serviceFactory('CreateShortUrlResult', CreateShortUrlResult, 'useStateFlagTimeout');\n bottle.serviceFactory('ShortUrlForm', ShortUrlForm, 'TagsSelector', 'DomainSelector');\n\n bottle.serviceFactory('CreateShortUrl', CreateShortUrl, 'ShortUrlForm', 'CreateShortUrlResult');\n bottle.decorator(\n 'CreateShortUrl',\n connect([ 'shortUrlCreationResult', 'selectedServer', 'settings' ], [ 'createShortUrl', 'resetCreateShortUrl' ]),\n );\n\n bottle.serviceFactory('EditShortUrl', EditShortUrl, 'ShortUrlForm');\n bottle.decorator('EditShortUrl', connect(\n [ 'shortUrlDetail', 'shortUrlEdition', 'selectedServer', 'settings' ],\n [ 'getShortUrlDetail', 'editShortUrl' ],\n ));\n\n bottle.serviceFactory('DeleteShortUrlModal', () => DeleteShortUrlModal);\n bottle.decorator('DeleteShortUrlModal', connect([ 'shortUrlDeletion' ], [ 'deleteShortUrl', 'resetDeleteShortUrl' ]));\n\n bottle.serviceFactory('QrCodeModal', () => QrCodeModal);\n bottle.decorator('QrCodeModal', connect([ 'selectedServer' ]));\n\n // Services\n bottle.serviceFactory('SearchBar', SearchBar, 'ColorGenerator');\n bottle.decorator('SearchBar', connect([ 'shortUrlsListParams' ], [ 'listShortUrls' ]));\n\n // Actions\n bottle.serviceFactory('listShortUrls', listShortUrls, 'buildShlinkApiClient');\n bottle.serviceFactory('resetShortUrlParams', () => resetShortUrlParams);\n\n bottle.serviceFactory('createShortUrl', createShortUrl, 'buildShlinkApiClient');\n bottle.serviceFactory('resetCreateShortUrl', () => resetCreateShortUrl);\n\n bottle.serviceFactory('deleteShortUrl', deleteShortUrl, 'buildShlinkApiClient');\n bottle.serviceFactory('resetDeleteShortUrl', () => resetDeleteShortUrl);\n\n bottle.serviceFactory('getShortUrlDetail', getShortUrlDetail, 'buildShlinkApiClient');\n\n bottle.serviceFactory('editShortUrl', editShortUrl, 'buildShlinkApiClient');\n};\n\nexport default provideServices;\n","import { FC } from 'react';\nimport { v4 as uuid } from 'uuid';\nimport { InputType } from 'reactstrap/lib/Input';\n\ninterface FormGroupContainerProps {\n value: string;\n onChange: (newValue: string) => void;\n id?: string;\n type?: InputType;\n required?: boolean;\n}\n\nexport const FormGroupContainer: FC = (\n { children, value, onChange, id = uuid(), type = 'text', required = true },\n) => (\n
\n \n onChange(e.target.value)}\n />\n
\n);\n","import { FC, ReactNode, useEffect, useState } from 'react';\nimport { FormGroupContainer } from '../../utils/FormGroupContainer';\nimport { handleEventPreventingDefault } from '../../utils/utils';\nimport { ServerData } from '../data';\nimport { SimpleCard } from '../../utils/SimpleCard';\nimport './ServerForm.scss';\n\ninterface ServerFormProps {\n onSubmit: (server: ServerData) => void;\n initialValues?: ServerData;\n title?: ReactNode;\n}\n\nexport const ServerForm: FC = ({ onSubmit, initialValues, children, title }) => {\n const [ name, setName ] = useState('');\n const [ url, setUrl ] = useState('');\n const [ apiKey, setApiKey ] = useState('');\n const handleSubmit = handleEventPreventingDefault(() => onSubmit({ name, url, apiKey }));\n\n useEffect(() => {\n initialValues && setName(initialValues.name);\n initialValues && setUrl(initialValues.url);\n initialValues && setApiKey(initialValues.apiKey);\n }, [ initialValues ]);\n\n return (\n
\n \n Name\n URL\n API key\n \n\n
{children}
\n
\n );\n};\n","import { FC } from 'react';\nimport { v4 as uuid } from 'uuid';\nimport { RouterProps } from 'react-router';\nimport { Result } from '../utils/Result';\nimport NoMenuLayout from '../common/NoMenuLayout';\nimport { StateFlagTimeout } from '../utils/helpers/hooks';\nimport { ServerForm } from './helpers/ServerForm';\nimport { ImportServersBtnProps } from './helpers/ImportServersBtn';\nimport { ServerData, ServerWithId } from './data';\nimport './CreateServer.scss';\n\nconst SHOW_IMPORT_MSG_TIME = 4000;\n\ninterface CreateServerProps extends RouterProps {\n createServer: (server: ServerWithId) => void;\n}\n\nconst ImportResult = ({ type }: { type: 'error' | 'success' }) => (\n \n {type === 'success' && 'Servers properly imported. You can now select one from the list :)'}\n {type === 'error' && 'The servers could not be imported. Make sure the format is correct.'}\n \n);\n\nconst CreateServer = (ImportServersBtn: FC, useStateFlagTimeout: StateFlagTimeout) => (\n { createServer, history: { push } }: CreateServerProps,\n) => {\n const [ serversImported, setServersImported ] = useStateFlagTimeout(false, SHOW_IMPORT_MSG_TIME);\n const [ errorImporting, setErrorImporting ] = useStateFlagTimeout(false, SHOW_IMPORT_MSG_TIME);\n const handleSubmit = (serverData: ServerData) => {\n const id = uuid();\n\n createServer({ ...serverData, id });\n push(`/server/${id}`);\n };\n\n return (\n \n Add new server} onSubmit={handleSubmit}>\n \n \n \n\n {(serversImported || errorImporting) && (\n
\n {serversImported && }\n {errorImporting && }\n
\n )}\n
\n );\n};\n\nexport default CreateServer;\n","import { isEmpty, values } from 'ramda';\nimport { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport { faPlus as plusIcon, faFileDownload as exportIcon, faServer as serverIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport ServersExporter from './services/ServersExporter';\nimport { isServerWithId, SelectedServer, ServersMap } from './data';\n\nexport interface ServersDropdownProps {\n servers: ServersMap;\n selectedServer: SelectedServer;\n}\n\nconst ServersDropdown = (serversExporter: ServersExporter) => ({ servers, selectedServer }: ServersDropdownProps) => {\n const serversList = values(servers);\n const createServerItem = (\n \n Add server\n \n );\n\n const renderServers = () => {\n if (isEmpty(serversList)) {\n return createServerItem;\n }\n\n return (\n <>\n {serversList.map(({ name, id }) => (\n \n {name}\n \n ))}\n \n {createServerItem}\n serversExporter.exportServers()}>\n Export servers\n \n \n );\n };\n\n return (\n \n \n Servers\n \n {renderServers()}\n \n );\n};\n\nexport default ServersDropdown;\n","import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\nimport { RouterProps } from 'react-router';\nimport { ServerWithId } from './data';\n\nexport interface DeleteServerModalProps {\n server: ServerWithId;\n toggle: () => void;\n isOpen: boolean;\n}\n\ninterface DeleteServerModalConnectProps extends DeleteServerModalProps, RouterProps {\n deleteServer: (server: ServerWithId) => void;\n}\n\nconst DeleteServerModal = ({ server, toggle, isOpen, deleteServer, history }: DeleteServerModalConnectProps) => {\n const closeModal = () => {\n deleteServer(server);\n toggle();\n history.push('/');\n };\n\n return (\n \n Remove server\n \n

Are you sure you want to remove {server ? server.name : ''}?

\n

\n \n No data will be deleted, only the access to this server will be removed from this device.\n You can create it again at any moment.\n \n

\n
\n \n \n \n \n
\n );\n};\n\nexport default DeleteServerModal;\n","import { FC } from 'react';\nimport { faMinusCircle as deleteIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useToggle } from '../utils/helpers/hooks';\nimport { DeleteServerModalProps } from './DeleteServerModal';\nimport { ServerWithId } from './data';\n\nexport interface DeleteServerButtonProps {\n server: ServerWithId;\n className?: string;\n textClassName?: string;\n}\n\nconst DeleteServerButton = (DeleteServerModal: FC): FC => (\n { server, className, children, textClassName },\n) => {\n const [ isModalOpen, , showModal, hideModal ] = useToggle();\n\n return (\n <>\n \n {!children && }\n {children ?? 'Remove this server'}\n \n\n \n \n );\n};\n\nexport default DeleteServerButton;\n","import { FC } from 'react';\nimport { Button } from 'reactstrap';\nimport NoMenuLayout from '../common/NoMenuLayout';\nimport { ServerForm } from './helpers/ServerForm';\nimport { withSelectedServer } from './helpers/withSelectedServer';\nimport { isServerWithId, ServerData } from './data';\n\ninterface EditServerProps {\n editServer: (serverId: string, serverData: ServerData) => void;\n}\n\nexport const EditServer = (ServerError: FC) => withSelectedServer((\n { editServer, selectedServer, history: { push, goBack } },\n) => {\n if (!isServerWithId(selectedServer)) {\n return null;\n }\n\n const handleSubmit = (serverData: ServerData) => {\n editServer(selectedServer.id, serverData);\n push(`/server/${selectedServer.id}`);\n };\n\n return (\n \n Edit "{selectedServer.name}"}\n initialValues={selectedServer}\n onSubmit={handleSubmit}\n >\n \n \n \n \n );\n}, ServerError);\n","import { useRef, RefObject, ChangeEvent, MutableRefObject } from 'react';\nimport { UncontrolledTooltip } from 'reactstrap';\nimport ServersImporter from '../services/ServersImporter';\nimport { ServerData } from '../data';\n\ntype Ref = RefObject | MutableRefObject;\n\nexport interface ImportServersBtnProps {\n onImport?: () => void;\n onImportError?: () => void;\n}\n\ninterface ImportServersBtnConnectProps extends ImportServersBtnProps {\n createServers: (servers: ServerData[]) => void;\n fileRef: Ref;\n}\n\nconst ImportServersBtn = ({ importServersFromFile }: ServersImporter) => ({\n createServers,\n fileRef,\n onImport = () => {},\n onImportError = () => {},\n}: ImportServersBtnConnectProps) => {\n const ref = fileRef ?? useRef();\n const onChange = async ({ target }: ChangeEvent) =>\n importServersFromFile(target.files?.[0])\n .then(createServers)\n .then(onImport)\n .then(() => {\n // Reset input after processing file\n (target as { value: string | null }).value = null;\n })\n .catch(onImportError);\n\n return (\n <>\n ref.current?.click()}\n >\n Import from file\n \n \n You can create servers by importing a CSV file with columns name, apiKey and url.\n \n\n \n \n );\n};\n\nexport default ImportServersBtn;\n","import { identity, memoizeWith, pipe } from 'ramda';\nimport { Action, Dispatch } from 'redux';\nimport { resetShortUrlParams } from '../../short-urls/reducers/shortUrlsListParams';\nimport { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version';\nimport { SelectedServer } from '../data';\nimport { GetState } from '../../container/types';\nimport { ShlinkHealth } from '../../api/types';\nimport { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\n\n/* eslint-disable padding-line-between-statements */\nexport const SELECT_SERVER = 'shlink/selectedServer/SELECT_SERVER';\nexport const RESET_SELECTED_SERVER = 'shlink/selectedServer/RESET_SELECTED_SERVER';\n\nexport const MIN_FALLBACK_VERSION = '1.0.0';\nexport const MAX_FALLBACK_VERSION = '999.999.999';\nexport const LATEST_VERSION_CONSTRAINT = 'latest';\n/* eslint-enable padding-line-between-statements */\n\nexport interface SelectServerAction extends Action {\n selectedServer: SelectedServer;\n}\n\nconst versionToSemVer = pipe(\n (version: string) => version === LATEST_VERSION_CONSTRAINT ? MAX_FALLBACK_VERSION : version,\n toSemVer(MIN_FALLBACK_VERSION),\n);\n\nconst getServerVersion = memoizeWith(\n identity,\n async (_serverId: string, health: () => Promise) => health().then(({ version }) => ({\n version: versionToSemVer(version),\n printableVersion: versionToPrintable(version),\n })),\n);\n\nconst initialState: SelectedServer = null;\n\nexport default buildReducer({\n [RESET_SELECTED_SERVER]: () => initialState,\n [SELECT_SERVER]: (_, { selectedServer }) => selectedServer,\n}, initialState);\n\nexport const resetSelectedServer = buildActionCreator(RESET_SELECTED_SERVER);\n\nexport const selectServer = (\n buildShlinkApiClient: ShlinkApiClientBuilder,\n loadMercureInfo: () => Action,\n) => (\n serverId: string,\n) => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n dispatch(resetSelectedServer());\n dispatch(resetShortUrlParams());\n\n const { servers } = getState();\n const selectedServer = servers[serverId];\n\n if (!selectedServer) {\n dispatch({\n type: SELECT_SERVER,\n selectedServer: { serverNotFound: true },\n });\n\n return;\n }\n\n try {\n const { health } = buildShlinkApiClient(selectedServer);\n const { version, printableVersion } = await getServerVersion(serverId, health);\n\n dispatch({\n type: SELECT_SERVER,\n selectedServer: {\n ...selectedServer,\n version,\n printableVersion,\n },\n });\n dispatch(loadMercureInfo());\n } catch (e) {\n dispatch({\n type: SELECT_SERVER,\n selectedServer: { ...selectedServer, serverNotReachable: true },\n });\n }\n};\n","import { assoc, dissoc, map, pipe, reduce } from 'ramda';\nimport { v4 as uuid } from 'uuid';\nimport { Action } from 'redux';\nimport { ServerData, ServersMap, ServerWithId } from '../data';\nimport { buildReducer } from '../../utils/helpers/redux';\n\n/* eslint-disable padding-line-between-statements */\nexport const EDIT_SERVER = 'shlink/servers/EDIT_SERVER';\nexport const DELETE_SERVER = 'shlink/servers/DELETE_SERVER';\nexport const CREATE_SERVERS = 'shlink/servers/CREATE_SERVERS';\n/* eslint-enable padding-line-between-statements */\n\nexport interface CreateServersAction extends Action {\n newServers: ServersMap;\n}\n\nconst initialState: ServersMap = {};\n\nconst serverWithId = (server: ServerWithId | ServerData): ServerWithId => {\n if ((server as ServerWithId).id) {\n return server as ServerWithId;\n }\n\n return assoc('id', uuid(), server);\n};\n\nexport default buildReducer({\n [CREATE_SERVERS]: (state, { newServers }) => ({ ...state, ...newServers }),\n [DELETE_SERVER]: (state, { serverId }: any) => dissoc(serverId, state),\n [EDIT_SERVER]: (state, { serverId, serverData }: any) => !state[serverId]\n ? state\n : assoc(serverId, { ...state[serverId], ...serverData }, state),\n}, initialState);\n\nconst serversListToMap = reduce((acc, server) => assoc(server.id, server, acc), {});\n\nexport const createServers = pipe(\n map(serverWithId),\n serversListToMap,\n (newServers: ServersMap) => ({ type: CREATE_SERVERS, newServers }),\n);\n\nexport const createServer = (server: ServerWithId) => createServers([ server ]);\n\nexport const editServer = (serverId: string, serverData: Partial) => ({\n type: EDIT_SERVER,\n serverId,\n serverData,\n});\n\nexport const deleteServer = ({ id }: ServerWithId) => ({ type: DELETE_SERVER, serverId: id });\n","import { pipe, prop } from 'ramda';\nimport { AxiosInstance } from 'axios';\nimport { Dispatch } from 'redux';\nimport { homepage } from '../../../package.json';\nimport { ServerData } from '../data';\nimport { createServers } from './servers';\n\nconst responseToServersList = pipe(\n prop('data'),\n (data: any): ServerData[] => {\n if (!Array.isArray(data)) {\n throw new Error('Value is not an array');\n }\n\n return data as ServerData[];\n },\n);\n\nexport const fetchServers = ({ get }: AxiosInstance) => () => async (dispatch: Dispatch) => {\n const remoteList = await get(`${homepage}/servers.json`)\n .then(responseToServersList)\n .catch(() => []);\n\n dispatch(createServers(remoteList));\n};\n","import { FC } from 'react';\nimport { versionMatch, Versions } from '../../utils/helpers/version';\nimport { isReachableServer, SelectedServer } from '../data';\n\ninterface ForServerVersionProps extends Versions {\n selectedServer: SelectedServer;\n}\n\nconst ForServerVersion: FC = ({ minVersion, maxVersion, selectedServer, children }) => {\n if (!isReachableServer(selectedServer)) {\n return null;\n }\n\n const { version } = selectedServer;\n const matchesVersion = versionMatch(version, { maxVersion, minVersion });\n\n if (!matchesVersion) {\n return null;\n }\n\n return <>{children};\n};\n\nexport default ForServerVersion;\n","import { FC } from 'react';\nimport { Link } from 'react-router-dom';\nimport Message from '../../utils/Message';\nimport ServersListGroup from '../ServersListGroup';\nimport { DeleteServerButtonProps } from '../DeleteServerButton';\nimport { isServerWithId, SelectedServer, ServersMap } from '../data';\nimport NoMenuLayout from '../../common/NoMenuLayout';\nimport './ServerError.scss';\n\ninterface ServerErrorProps {\n servers: ServersMap;\n selectedServer: SelectedServer;\n}\n\nexport const ServerError = (DeleteServerButton: FC): FC => (\n { servers, selectedServer },\n) => (\n \n
\n \n {!isServerWithId(selectedServer) && 'Could not find this Shlink server.'}\n {isServerWithId(selectedServer) && (\n <>\n

Oops! Could not connect to this Shlink server.

\n Make sure you have internet connection, and the server is properly configured and on-line.\n \n )}\n
\n\n \n These are the Shlink servers currently configured. Choose one of\n them or add a new one.\n \n\n {isServerWithId(selectedServer) && (\n
\n
\n Alternatively, if you think you may have miss-configured this server, you\n can remove it or \n edit it.\n
\n
\n )}\n
\n
\n);\n","import { FC, useEffect } from 'react';\nimport { Card, CardBody, CardHeader, CardText, CardTitle, Row } from 'reactstrap';\nimport { Link, useHistory } from 'react-router-dom';\nimport { ShortUrlsListParams } from '../short-urls/reducers/shortUrlsListParams';\nimport { ShortUrlsList as ShortUrlsListState } from '../short-urls/reducers/shortUrlsList';\nimport { prettify } from '../utils/helpers/numbers';\nimport { TagsList } from '../tags/reducers/tagsList';\nimport { ShortUrlsTableProps } from '../short-urls/ShortUrlsTable';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport { CreateShortUrlProps } from '../short-urls/CreateShortUrl';\nimport { VisitsOverview } from '../visits/reducers/visitsOverview';\nimport { Versions } from '../utils/helpers/version';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { isServerWithId, SelectedServer } from './data';\nimport './Overview.scss';\n\ninterface OverviewConnectProps {\n shortUrlsList: ShortUrlsListState;\n listShortUrls: (params: ShortUrlsListParams) => void;\n listTags: Function;\n tagsList: TagsList;\n selectedServer: SelectedServer;\n visitsOverview: VisitsOverview;\n loadVisitsOverview: Function;\n}\n\nexport const Overview = (\n ShortUrlsTable: FC,\n CreateShortUrl: FC,\n ForServerVersion: FC,\n) => boundToMercureHub(({\n shortUrlsList,\n listShortUrls,\n listTags,\n tagsList,\n selectedServer,\n loadVisitsOverview,\n visitsOverview,\n}: OverviewConnectProps) => {\n const { loading, shortUrls } = shortUrlsList;\n const { loading: loadingTags } = tagsList;\n const { loading: loadingVisits, visitsCount, orphanVisitsCount } = visitsOverview;\n const serverId = isServerWithId(selectedServer) ? selectedServer.id : '';\n const history = useHistory();\n\n useEffect(() => {\n listShortUrls({ itemsPerPage: 5, orderBy: { dateCreated: 'DESC' } });\n listTags();\n loadVisitsOverview();\n }, []);\n\n return (\n <>\n \n
\n \n Visits\n \n \n {loadingVisits ? 'Loading...' : prettify(visitsCount)}\n \n \n Shlink 2.2 is needed\n \n \n \n
\n
\n \n Orphan visits\n \n \n {loadingVisits ? 'Loading...' : prettify(orphanVisitsCount ?? 0)}\n \n \n Shlink 2.6 is needed\n \n \n \n
\n
\n \n Short URLs\n \n {loading ? 'Loading...' : prettify(shortUrls?.pagination.totalItems ?? 0)}\n \n \n
\n
\n \n Tags\n {loadingTags ? 'Loading...' : prettify(tagsList.tags.length)}\n \n
\n
\n \n \n Create a short URL\n
Create a short URL
\n Advanced options »\n
\n \n \n \n
\n \n \n Recently created URLs\n
Recently created URLs
\n See all »\n
\n \n history.push(`/server/${serverId}/list-short-urls/1?tag=${tag}`)}\n />\n \n
\n \n );\n}, () => [ Topics.visits(), Topics.orphanVisits() ]);\n","import { CsvJson } from 'csvjson';\nimport { ServerData } from '../data';\n\ninterface CsvFile extends File {\n type: 'text/csv' | 'text/comma-separated-values' | 'application/csv';\n}\n\nconst CSV_MIME_TYPES = [ 'text/csv', 'text/comma-separated-values', 'application/csv' ];\nconst isCsv = (file?: File | null): file is CsvFile => !!file && CSV_MIME_TYPES.includes(file.type);\n\nexport default class ServersImporter {\n public constructor(private readonly csvjson: CsvJson, private readonly fileReaderFactory: () => FileReader) {}\n\n public readonly importServersFromFile = async (file?: File | null): Promise => {\n if (!isCsv(file)) {\n throw new Error('No file provided or file is not a CSV');\n }\n\n const reader = this.fileReaderFactory();\n\n return new Promise((resolve) => {\n reader.addEventListener('loadend', (e: ProgressEvent) => {\n const content = e.target?.result?.toString() ?? '';\n const servers = this.csvjson.toObject(content);\n\n resolve(servers);\n });\n reader.readAsText(file);\n });\n };\n}\n","export const saveCsv = ({ document }: Window, csv: string, filename: string) => {\n const link = document.createElement('a');\n const blob = new Blob([ csv ], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n\n link.setAttribute('href', url);\n link.setAttribute('download', filename);\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n};\n","import { dissoc, values } from 'ramda';\nimport { CsvJson } from 'csvjson';\nimport LocalStorage from '../../utils/services/LocalStorage';\nimport { ServersMap } from '../data';\nimport { saveCsv } from '../../utils/helpers/csv';\n\nconst SERVERS_FILENAME = 'shlink-servers.csv';\n\nexport default class ServersExporter {\n public constructor(\n private readonly storage: LocalStorage,\n private readonly window: Window,\n private readonly csvjson: CsvJson,\n ) {}\n\n public readonly exportServers = async () => {\n const servers = values(this.storage.get('servers') ?? {}).map(dissoc('id'));\n\n try {\n const csv = this.csvjson.toCSV(servers, { headers: 'key' });\n\n saveCsv(this.window, csv, SERVERS_FILENAME);\n } catch (e) {\n // FIXME Handle error\n console.error(e); // eslint-disable-line no-console\n }\n };\n}\n","import csvjson from 'csvjson';\nimport Bottle, { Decorator } from 'bottlejs';\nimport CreateServer from '../CreateServer';\nimport ServersDropdown from '../ServersDropdown';\nimport DeleteServerModal from '../DeleteServerModal';\nimport DeleteServerButton from '../DeleteServerButton';\nimport { EditServer } from '../EditServer';\nimport ImportServersBtn from '../helpers/ImportServersBtn';\nimport { resetSelectedServer, selectServer } from '../reducers/selectedServer';\nimport { createServer, createServers, deleteServer, editServer } from '../reducers/servers';\nimport { fetchServers } from '../reducers/remoteServers';\nimport ForServerVersion from '../helpers/ForServerVersion';\nimport { ServerError } from '../helpers/ServerError';\nimport { ConnectDecorator } from '../../container/types';\nimport { withoutSelectedServer } from '../helpers/withoutSelectedServer';\nimport { Overview } from '../Overview';\nimport ServersImporter from './ServersImporter';\nimport ServersExporter from './ServersExporter';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator, withRouter: Decorator) => {\n // Components\n bottle.serviceFactory('CreateServer', CreateServer, 'ImportServersBtn', 'useStateFlagTimeout');\n bottle.decorator('CreateServer', withoutSelectedServer);\n bottle.decorator('CreateServer', connect([ 'selectedServer' ], [ 'createServer', 'resetSelectedServer' ]));\n\n bottle.serviceFactory('EditServer', EditServer, 'ServerError');\n bottle.decorator('EditServer', connect([ 'selectedServer' ], [ 'editServer', 'selectServer' ]));\n\n bottle.serviceFactory('ServersDropdown', ServersDropdown, 'ServersExporter');\n bottle.decorator('ServersDropdown', connect([ 'servers', 'selectedServer' ]));\n\n bottle.serviceFactory('DeleteServerModal', () => DeleteServerModal);\n bottle.decorator('DeleteServerModal', withRouter);\n bottle.decorator('DeleteServerModal', connect(null, [ 'deleteServer' ]));\n\n bottle.serviceFactory('DeleteServerButton', DeleteServerButton, 'DeleteServerModal');\n\n bottle.serviceFactory('ImportServersBtn', ImportServersBtn, 'ServersImporter');\n bottle.decorator('ImportServersBtn', connect(null, [ 'createServers' ]));\n\n bottle.serviceFactory('ForServerVersion', () => ForServerVersion);\n bottle.decorator('ForServerVersion', connect([ 'selectedServer' ]));\n\n bottle.serviceFactory('ServerError', ServerError, 'DeleteServerButton');\n bottle.decorator('ServerError', connect([ 'servers', 'selectedServer' ]));\n\n bottle.serviceFactory('Overview', Overview, 'ShortUrlsTable', 'CreateShortUrl', 'ForServerVersion');\n bottle.decorator('Overview', connect(\n [ 'shortUrlsList', 'tagsList', 'selectedServer', 'mercureInfo', 'visitsOverview' ],\n [ 'listShortUrls', 'listTags', 'createNewVisits', 'loadMercureInfo', 'loadVisitsOverview' ],\n ));\n\n // Services\n bottle.constant('csvjson', csvjson);\n bottle.constant('fileReaderFactory', () => new FileReader());\n bottle.service('ServersImporter', ServersImporter, 'csvjson', 'fileReaderFactory');\n bottle.service('ServersExporter', ServersExporter, 'Storage', 'window', 'csvjson');\n\n // Actions\n bottle.serviceFactory('selectServer', selectServer, 'buildShlinkApiClient', 'loadMercureInfo');\n bottle.serviceFactory('createServer', () => createServer);\n bottle.serviceFactory('createServers', () => createServers);\n bottle.serviceFactory('deleteServer', () => deleteServer);\n bottle.serviceFactory('editServer', () => editServer);\n bottle.serviceFactory('fetchServers', fetchServers, 'axios');\n\n bottle.serviceFactory('resetSelectedServer', () => resetSelectedServer);\n};\n\nexport default provideServices;\n","import { Button, Card } from 'reactstrap';\nimport { FC, ReactNode } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faArrowLeft } from '@fortawesome/free-solid-svg-icons';\nimport ShortUrlVisitsCount from '../short-urls/helpers/ShortUrlVisitsCount';\nimport { ShortUrl } from '../short-urls/data';\nimport { Visit } from './types';\n\ninterface VisitsHeaderProps {\n visits: Visit[];\n goBack: () => void;\n title: ReactNode;\n shortUrl?: ShortUrl;\n}\n\nconst VisitsHeader: FC = ({ visits, goBack, shortUrl, children, title }) => (\n
\n \n

\n \n \n {title}\n \n \n Visits:{' '}\n \n \n

\n

\n {title}\n

\n\n {children &&
{children}
}\n
\n
\n);\n\nexport default VisitsHeader;\n","import { UncontrolledTooltip } from 'reactstrap';\nimport Moment from 'react-moment';\nimport { ExternalLink } from 'react-external-link';\nimport { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail';\nimport { ShortUrlVisits } from './reducers/shortUrlVisits';\nimport VisitsHeader from './VisitsHeader';\nimport './ShortUrlVisitsHeader.scss';\n\ninterface ShortUrlVisitsHeaderProps {\n shortUrlDetail: ShortUrlDetail;\n shortUrlVisits: ShortUrlVisits;\n goBack: () => void;\n}\n\nconst ShortUrlVisitsHeader = ({ shortUrlDetail, shortUrlVisits, goBack }: ShortUrlVisitsHeaderProps) => {\n const { shortUrl, loading } = shortUrlDetail;\n const { visits } = shortUrlVisits;\n const shortLink = shortUrl?.shortUrl ?? '';\n const longLink = shortUrl?.longUrl ?? '';\n const title = shortUrl?.title;\n\n const renderDate = () => !shortUrl ? Loading... : (\n \n \n {shortUrl.dateCreated}\n \n \n {shortUrl.dateCreated}\n \n \n );\n const visitsStatsTitle = (\n <>\n Visits for \n \n );\n\n return (\n \n
\n
Created: {renderDate()}
\n
\n {`${title ? 'Title' : 'Long URL'}: `}\n {loading && Loading...}\n {!loading && {title ?? longLink}}\n
\n
\n );\n};\n\nexport default ShortUrlVisitsHeader;\n","import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap';\n\ninterface PaginationDropdownProps {\n ranges: number[];\n value: number;\n setValue: (newValue: number) => void;\n toggleClassName?: string;\n}\n\nconst PaginationDropdown = ({ toggleClassName, ranges, value, setValue }: PaginationDropdownProps) => (\n \n \n Paginate\n \n \n {ranges.map((itemsPerPage) => (\n setValue(itemsPerPage)}>\n {itemsPerPage} items per page\n \n ))}\n \n setValue(Infinity)}>\n Clear pagination\n \n \n \n);\n\nexport default PaginationDropdown;\n","import { FC } from 'react';\nimport classNames from 'classnames';\nimport { Pagination, PaginationItem, PaginationLink } from 'reactstrap';\nimport {\n pageIsEllipsis,\n keyForPage,\n NumberOrEllipsis,\n progressivePagination,\n prettifyPageNumber,\n} from '../utils/helpers/pagination';\nimport './SimplePaginator.scss';\n\ninterface SimplePaginatorProps {\n pagesCount: number;\n currentPage: number;\n setCurrentPage: (currentPage: number) => void;\n centered?: boolean;\n}\n\nconst SimplePaginator: FC = ({ pagesCount, currentPage, setCurrentPage, centered = true }) => {\n if (pagesCount < 2) {\n return null;\n }\n\n const onClick = (page: NumberOrEllipsis) => () => !pageIsEllipsis(page) && setCurrentPage(page);\n\n return (\n \n \n \n \n {progressivePagination(currentPage, pagesCount).map((pageNumber, index) => (\n \n {prettifyPageNumber(pageNumber)}\n \n ))}\n = pagesCount}>\n \n \n \n );\n};\n\nexport default SimplePaginator;\n","import bowser from 'bowser';\nimport { zipObj } from 'ramda';\nimport { Empty, hasValue } from '../utils';\nimport { Stats, UserAgent } from '../../visits/types';\n\nconst DEFAULT = 'Others';\nconst BROWSERS_WHITELIST = [\n 'Android Browser',\n 'Chrome',\n 'Chromium',\n 'Firefox',\n 'Internet Explorer',\n 'Microsoft Edge',\n 'Opera',\n 'Safari',\n 'Samsung Internet for Android',\n 'Vivaldi',\n 'WeChat',\n];\n\nexport const parseUserAgent = (userAgent: string | Empty): UserAgent => {\n if (!hasValue(userAgent)) {\n return { browser: DEFAULT, os: DEFAULT };\n }\n\n const { browser: { name: browser }, os: { name: os } } = bowser.parse(userAgent);\n\n return { os: os ?? DEFAULT, browser: browser && BROWSERS_WHITELIST.includes(browser) ? browser : DEFAULT };\n};\n\nexport const extractDomain = (url: string | Empty): string => {\n if (!hasValue(url)) {\n return 'Direct';\n }\n\n return url.split('/')[url.includes('://') ? 2 : 0]?.split(':')[0] ?? '';\n};\n\nexport const fillTheGaps = (stats: Stats, labels: string[]): number[] =>\n Object.values({ ...zipObj(labels, labels.map(() => 0)), ...stats });\n","import { ChangeEvent, FC } from 'react';\nimport { ChartData, ChartTooltipItem } from 'chart.js';\nimport { prettify } from './numbers';\n\nexport const pointerOnHover = ({ target }: ChangeEvent, chartElement: FC[]) => {\n target.style.cursor = chartElement[0] ? 'pointer' : 'default';\n};\n\nexport const renderNonDoughnutChartLabel = (labelToPick: 'yLabel' | 'xLabel') => (\n item: ChartTooltipItem,\n { datasets }: ChartData,\n) => {\n const { datasetIndex } = item;\n const value = item[labelToPick];\n const datasetLabel = datasetIndex !== undefined && datasets?.[datasetIndex]?.label || '';\n\n return `${datasetLabel}: ${prettify(Number(value))}`;\n};\n\nexport const renderDoughnutChartLabel = (\n { datasetIndex, index }: ChartTooltipItem,\n { labels, datasets }: ChartData,\n) => {\n const datasetLabel = index !== undefined && labels?.[index] || '';\n const value = datasetIndex !== undefined && index !== undefined\n && datasets?.[datasetIndex]?.data?.[index]\n || '';\n\n return `${datasetLabel}: ${prettify(Number(value))}`; // eslint-disable-line @typescript-eslint/no-base-to-string\n};\n","import { useState } from 'react';\nimport { Doughnut, HorizontalBar } from 'react-chartjs-2';\nimport { keys, values } from 'ramda';\nimport classNames from 'classnames';\nimport Chart, { ChartData, ChartDataSets, ChartOptions } from 'chart.js';\nimport { fillTheGaps } from '../../utils/helpers/visits';\nimport { Stats } from '../types';\nimport { prettify } from '../../utils/helpers/numbers';\nimport { pointerOnHover, renderDoughnutChartLabel, renderNonDoughnutChartLabel } from '../../utils/helpers/charts';\nimport {\n HIGHLIGHTED_COLOR,\n HIGHLIGHTED_COLOR_ALPHA,\n isDarkThemeEnabled,\n MAIN_COLOR,\n MAIN_COLOR_ALPHA,\n PRIMARY_DARK_COLOR,\n PRIMARY_LIGHT_COLOR,\n} from '../../utils/theme';\nimport './DefaultChart.scss';\n\nexport interface DefaultChartProps {\n title: Function | string;\n stats: Stats;\n isBarChart?: boolean;\n max?: number;\n highlightedStats?: Stats;\n highlightedLabel?: string;\n onClick?: (label: string) => void;\n}\n\nconst generateGraphData = (\n title: Function | string,\n isBarChart: boolean,\n labels: string[],\n data: number[],\n highlightedData?: number[],\n highlightedLabel?: string,\n): ChartData => ({\n labels,\n datasets: [\n {\n title,\n label: highlightedData ? 'Non-selected' : 'Visits',\n data,\n backgroundColor: isBarChart ? MAIN_COLOR_ALPHA : [\n '#97BBCD',\n '#F7464A',\n '#46BFBD',\n '#FDB45C',\n '#949FB1',\n '#57A773',\n '#414066',\n '#08B2E3',\n '#B6C454',\n '#DCDCDC',\n '#463730',\n ],\n borderColor: isBarChart ? MAIN_COLOR : isDarkThemeEnabled() ? PRIMARY_DARK_COLOR : PRIMARY_LIGHT_COLOR,\n borderWidth: 2,\n },\n highlightedData && {\n title,\n label: highlightedLabel ?? 'Selected',\n data: highlightedData,\n backgroundColor: HIGHLIGHTED_COLOR_ALPHA,\n borderColor: HIGHLIGHTED_COLOR,\n borderWidth: 2,\n },\n ].filter(Boolean) as ChartDataSets[],\n});\n\nconst dropLabelIfHidden = (label: string) => label.startsWith('hidden') ? '' : label;\n\nconst determineHeight = (isBarChart: boolean, labels: string[]): number | undefined => {\n if (!isBarChart) {\n return 300;\n }\n\n return isBarChart && labels.length > 20 ? labels.length * 8 : undefined;\n};\n\nconst renderPieChartLegend = ({ config }: Chart) => {\n const { labels = [], datasets = [] } = config.data ?? {};\n const { defaultColor } = config.options ?? {} as any;\n const [{ backgroundColor: colors }] = datasets;\n\n return (\n
    \n {labels.map((label, index) => (\n
  • \n \n {label}\n
  • \n ))}\n
\n );\n};\n\nconst chartElementAtEvent = (onClick?: (label: string) => void) => ([ chart ]: [{ _index: number; _chart: Chart }]) => {\n if (!onClick || !chart) {\n return;\n }\n\n const { _index, _chart: { data } } = chart;\n const { labels } = data;\n\n onClick(labels?.[_index] as string);\n};\n\nconst statsAreDefined = (stats: Stats | undefined): stats is Stats => !!stats && Object.keys(stats).length > 0;\n\nconst DefaultChart = (\n { title, isBarChart = false, stats, max, highlightedStats, highlightedLabel, onClick }: DefaultChartProps,\n) => {\n const Component = isBarChart ? HorizontalBar : Doughnut;\n const labels = keys(stats).map(dropLabelIfHidden);\n const data = values(\n !statsAreDefined(highlightedStats) ? stats : keys(highlightedStats).reduce((acc, highlightedKey) => {\n if (acc[highlightedKey]) {\n acc[highlightedKey] -= highlightedStats[highlightedKey];\n }\n\n return acc;\n }, { ...stats }),\n );\n const highlightedData = statsAreDefined(highlightedStats) ? fillTheGaps(highlightedStats, labels) : undefined;\n const [ chartRef, setChartRef ] = useState();\n\n const options: ChartOptions = {\n legend: { display: false },\n legendCallback: !isBarChart && renderPieChartLegend as any,\n scales: !isBarChart ? undefined : {\n xAxes: [\n {\n ticks: {\n beginAtZero: true,\n precision: 0,\n callback: prettify,\n max,\n },\n stacked: true,\n },\n ],\n yAxes: [{ stacked: true }],\n },\n tooltips: {\n intersect: !isBarChart,\n // Do not show tooltip on items with empty label when in a bar chart\n filter: ({ yLabel }) => !isBarChart || yLabel !== '',\n callbacks: {\n label: isBarChart ? renderNonDoughnutChartLabel('xLabel') : renderDoughnutChartLabel,\n },\n },\n onHover: !isBarChart ? undefined : (pointerOnHover) as any, // TODO Types seem to be incorrectly defined in @types/chart.js\n };\n const graphData = generateGraphData(title, isBarChart, labels, data, highlightedData, highlightedLabel);\n const height = determineHeight(isBarChart, labels);\n\n // Provide a key based on the height, so that every time the dataset changes, a new graph is rendered\n return (\n
\n
\n setChartRef(element ?? undefined)}\n key={height}\n data={graphData}\n options={options}\n height={height}\n getElementAtEvent={chartElementAtEvent(onClick)}\n />\n
\n {!isBarChart && (\n
\n {chartRef?.chartInstance.generateLegend()}\n
\n )}\n
\n );\n};\n\nexport default DefaultChart;\n","import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap';\nimport { ReactNode } from 'react';\nimport DefaultChart, { DefaultChartProps } from './DefaultChart';\nimport './GraphCard.scss';\n\ninterface GraphCardProps extends DefaultChartProps {\n footer?: ReactNode;\n}\n\nconst GraphCard = ({ title, footer, ...rest }: GraphCardProps) => (\n \n {typeof title === 'function' ? title() : title}\n \n \n \n {footer && {footer}}\n \n);\n\nexport default GraphCard;\n","import { useState } from 'react';\nimport { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda';\nimport SortingDropdown from '../../utils/SortingDropdown';\nimport PaginationDropdown from '../../utils/PaginationDropdown';\nimport { OrderDir, rangeOf } from '../../utils/utils';\nimport { roundTen } from '../../utils/helpers/numbers';\nimport SimplePaginator from '../../common/SimplePaginator';\nimport { Stats, StatsRow } from '../types';\nimport GraphCard from './GraphCard';\nimport { DefaultChartProps } from './DefaultChart';\n\nconst toLowerIfString = (value: any) => type(value) === 'String' ? toLower(value) : value; // eslint-disable-line @typescript-eslint/no-unsafe-return\nconst pickKeyFromPair = ([ key ]: StatsRow) => key;\nconst pickValueFromPair = ([ , value ]: StatsRow) => value;\n\ninterface SortableBarGraphProps extends DefaultChartProps {\n sortingItems: Record;\n withPagination?: boolean;\n extraHeaderContent?: Function;\n}\n\nconst SortableBarGraph = ({\n stats,\n highlightedStats,\n title,\n sortingItems,\n extraHeaderContent,\n withPagination = true,\n ...rest\n}: SortableBarGraphProps) => {\n const [ order, setOrder ] = useState<{ orderField?: string; orderDir?: OrderDir }>({\n orderField: undefined,\n orderDir: undefined,\n });\n const [ currentPage, setCurrentPage ] = useState(1);\n const [ itemsPerPage, setItemsPerPage ] = useState(50);\n\n const getSortedPairsForStats = (stats: Stats, sortingItems: Record) => {\n const pairs = toPairs(stats);\n const sortedPairs = !order.orderField ? pairs : sortBy(\n pipe(\n order.orderField === Object.keys(sortingItems)[0] ? pickKeyFromPair : pickValueFromPair,\n toLowerIfString,\n ),\n pairs,\n );\n\n return !order.orderDir || order.orderDir === 'ASC' ? sortedPairs : reverse(sortedPairs);\n };\n const determineCurrentPagePairs = (pages: StatsRow[][]): StatsRow[] => {\n const page = pages[currentPage - 1];\n\n if (currentPage < pages.length) {\n return page;\n }\n\n const firstPageLength = pages[0].length;\n\n // Using the \"hidden\" key, the chart will just replace the label by an empty string\n return [ ...page, ...rangeOf(firstPageLength - page.length, (i): StatsRow => [ `hidden_${i}`, 0 ]) ];\n };\n const renderPagination = (pagesCount: number) =>\n ;\n const determineStats = (stats: Stats, highlightedStats: Stats | undefined, sortingItems: Record) => {\n const sortedPairs = getSortedPairsForStats(stats, sortingItems);\n const sortedKeys = sortedPairs.map(pickKeyFromPair);\n // The highlighted stats have to be ordered based on the regular stats, not on its own values\n const sortedHighlightedPairs = highlightedStats && toPairs(\n { ...zipObj(sortedKeys, sortedKeys.map(() => 0)), ...highlightedStats },\n );\n\n if (sortedPairs.length <= itemsPerPage) {\n return {\n currentPageStats: fromPairs(sortedPairs),\n currentPageHighlightedStats: sortedHighlightedPairs && fromPairs(sortedHighlightedPairs),\n };\n }\n\n const pages = splitEvery(itemsPerPage, sortedPairs);\n const highlightedPages = sortedHighlightedPairs && splitEvery(itemsPerPage, sortedHighlightedPairs);\n\n return {\n currentPageStats: fromPairs(determineCurrentPagePairs(pages)),\n currentPageHighlightedStats: highlightedPages && fromPairs(determineCurrentPagePairs(highlightedPages)),\n pagination: renderPagination(pages.length),\n max: roundTen(Math.max(...sortedPairs.map(pickValueFromPair))),\n };\n };\n\n const { currentPageStats, currentPageHighlightedStats, pagination, max } = determineStats(\n stats,\n highlightedStats && Object.keys(highlightedStats).length > 0 ? highlightedStats : undefined,\n sortingItems,\n );\n const activeCities = Object.keys(currentPageStats);\n const computeTitle = () => (\n <>\n {title}\n
\n {\n setOrder({ orderField, orderDir });\n setCurrentPage(1);\n }}\n />\n
\n {withPagination && Object.keys(stats).length > 50 && (\n
\n {\n setItemsPerPage(itemsPerPage);\n setCurrentPage(1);\n }}\n />\n
\n )}\n {extraHeaderContent && (\n
\n {extraHeaderContent(pagination ? activeCities : undefined)}\n
\n )}\n \n );\n\n return (\n \n );\n};\n\nexport default SortableBarGraph;\n","import { FC } from 'react';\nimport BooleanControl, { BooleanControlProps } from './BooleanControl';\n\nconst ToggleSwitch: FC = (props) => ;\n\nexport default ToggleSwitch;\n","import { useState, useMemo } from 'react';\nimport {\n Card,\n CardHeader,\n CardBody,\n UncontrolledDropdown,\n DropdownToggle,\n DropdownMenu,\n DropdownItem,\n} from 'reactstrap';\nimport { Line } from 'react-chartjs-2';\nimport { always, cond, countBy, reverse } from 'ramda';\nimport moment from 'moment';\nimport Chart, { ChartData, ChartDataSets, ChartOptions } from 'chart.js';\nimport { NormalizedVisit, Stats } from '../types';\nimport { fillTheGaps } from '../../utils/helpers/visits';\nimport { useToggle } from '../../utils/helpers/hooks';\nimport { rangeOf } from '../../utils/utils';\nimport ToggleSwitch from '../../utils/ToggleSwitch';\nimport { prettify } from '../../utils/helpers/numbers';\nimport { pointerOnHover, renderNonDoughnutChartLabel } from '../../utils/helpers/charts';\nimport { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../utils/theme';\nimport './LineChartCard.scss';\n\ninterface LineChartCardProps {\n title: string;\n highlightedLabel?: string;\n visits: NormalizedVisit[];\n highlightedVisits: NormalizedVisit[];\n setSelectedVisits?: (visits: NormalizedVisit[]) => void;\n}\n\ntype Step = 'monthly' | 'weekly' | 'daily' | 'hourly';\n\nconst STEPS_MAP: Record = {\n monthly: 'Month',\n weekly: 'Week',\n daily: 'Day',\n hourly: 'Hour',\n};\n\nconst STEP_TO_DATE_UNIT_MAP: Record = {\n hourly: 'hour',\n daily: 'day',\n weekly: 'week',\n monthly: 'month',\n};\n\nconst STEP_TO_DATE_FORMAT: Record string> = {\n hourly: (date) => moment(date).format('YYYY-MM-DD HH:00'),\n daily: (date) => moment(date).format('YYYY-MM-DD'),\n weekly(date) {\n const firstWeekDay = moment(date).isoWeekday(1).format('YYYY-MM-DD');\n const lastWeekDay = moment(date).isoWeekday(7).format('YYYY-MM-DD');\n\n return `${firstWeekDay} - ${lastWeekDay}`;\n },\n monthly: (date) => moment(date).format('YYYY-MM'),\n};\n\nconst determineInitialStep = (oldestVisitDate: string): Step => {\n const now = moment();\n const oldestDate = moment(oldestVisitDate);\n const matcher = cond([\n [ () => now.diff(oldestDate, 'day') <= 2, always('hourly') ], // Less than 2 days\n [ () => now.diff(oldestDate, 'month') <= 1, always('daily') ], // Between 2 days and 1 month\n [ () => now.diff(oldestDate, 'month') <= 6, always('weekly') ], // Between 1 and 6 months\n ]);\n\n return matcher() ?? 'monthly';\n};\n\nconst groupVisitsByStep = (step: Step, visits: NormalizedVisit[]): Stats => countBy(\n (visit) => STEP_TO_DATE_FORMAT[step](visit.date),\n visits,\n);\n\nconst visitsToDatasetGroups = (step: Step, visits: NormalizedVisit[]) =>\n visits.reduce>(\n (acc, visit) => {\n const key = STEP_TO_DATE_FORMAT[step](visit.date);\n\n acc[key] = acc[key] ?? [];\n acc[key].push(visit);\n\n return acc;\n },\n {},\n );\n\nconst generateLabels = (step: Step, visits: NormalizedVisit[]): string[] => {\n const unit = STEP_TO_DATE_UNIT_MAP[step];\n const formatter = STEP_TO_DATE_FORMAT[step];\n const newerDate = moment(visits[0].date);\n const oldestDate = moment(visits[visits.length - 1].date);\n const size = newerDate.diff(oldestDate, unit);\n\n return [\n formatter(oldestDate),\n ...rangeOf(size, () => formatter(oldestDate.add(1, unit))),\n ];\n};\n\nconst generateLabelsAndGroupedVisits = (\n visits: NormalizedVisit[],\n groupedVisitsWithGaps: Stats,\n step: Step,\n skipNoElements: boolean,\n): [string[], number[]] => {\n if (skipNoElements) {\n return [ Object.keys(groupedVisitsWithGaps), Object.values(groupedVisitsWithGaps) ];\n }\n\n const labels = generateLabels(step, visits);\n\n return [ labels, fillTheGaps(groupedVisitsWithGaps, labels) ];\n};\n\nconst generateDataset = (data: number[], label: string, color: string): ChartDataSets => ({\n label,\n data,\n fill: false,\n lineTension: 0.2,\n borderColor: color,\n backgroundColor: color,\n});\n\nlet selectedLabel: string | null = null;\n\nconst chartElementAtEvent = (\n datasetsByPoint: Record,\n setSelectedVisits?: (visits: NormalizedVisit[]) => void,\n) => ([ chart ]: [{ _index: number; _chart: Chart }]) => {\n if (!setSelectedVisits || !chart) {\n return;\n }\n\n const { _index: index, _chart: { data } } = chart;\n const { labels } = data as { labels: string[] };\n\n if (selectedLabel === labels[index]) {\n setSelectedVisits([]);\n selectedLabel = null;\n } else {\n setSelectedVisits(labels[index] && datasetsByPoint[labels[index]] || []);\n selectedLabel = labels[index] ?? null;\n }\n};\n\nconst LineChartCard = (\n { title, visits, highlightedVisits, highlightedLabel = 'Selected', setSelectedVisits }: LineChartCardProps,\n) => {\n const [ step, setStep ] = useState(\n visits.length > 0 ? determineInitialStep(visits[visits.length - 1].date) : 'monthly',\n );\n const [ skipNoVisits, toggleSkipNoVisits ] = useToggle(true);\n\n const datasetsByPoint = useMemo(() => visitsToDatasetGroups(step, visits), [ step, visits ]);\n const groupedVisitsWithGaps = useMemo(() => groupVisitsByStep(step, reverse(visits)), [ step, visits ]);\n const [ labels, groupedVisits ] = useMemo(\n () => generateLabelsAndGroupedVisits(visits, groupedVisitsWithGaps, step, skipNoVisits),\n [ visits, step, skipNoVisits ],\n );\n const groupedHighlighted = useMemo(\n () => fillTheGaps(groupVisitsByStep(step, reverse(highlightedVisits)), labels),\n [ highlightedVisits, step, labels ],\n );\n\n const data: ChartData = {\n labels,\n datasets: [\n generateDataset(groupedVisits, 'Visits', MAIN_COLOR),\n highlightedVisits.length > 0 && generateDataset(groupedHighlighted, highlightedLabel, HIGHLIGHTED_COLOR),\n ].filter(Boolean) as ChartDataSets[],\n };\n const options: ChartOptions = {\n maintainAspectRatio: false,\n legend: { display: false },\n scales: {\n yAxes: [\n {\n ticks: {\n beginAtZero: true,\n precision: 0,\n callback: prettify,\n },\n },\n ],\n xAxes: [\n {\n scaleLabel: { display: true, labelString: STEPS_MAP[step] },\n },\n ],\n },\n tooltips: {\n intersect: false,\n axis: 'x',\n callbacks: {\n label: renderNonDoughnutChartLabel('yLabel'),\n },\n },\n onHover: (pointerOnHover) as any, // TODO Types seem to be incorrectly defined in @types/chart.js\n };\n\n return (\n \n \n {title}\n
\n \n \n Group by\n \n \n {Object.entries(STEPS_MAP).map(([ value, menuText ]) => (\n setStep(value as Step)}>\n {menuText}\n \n ))}\n \n \n
\n
\n \n Skip dates with no visits\n \n
\n
\n \n \n \n
\n );\n};\n\nexport default LineChartCard;\n","import { useEffect, useMemo, useState, useRef } from 'react';\nimport Moment from 'react-moment';\nimport classNames from 'classnames';\nimport { min, splitEvery } from 'ramda';\nimport {\n faCaretDown as caretDownIcon,\n faCaretUp as caretUpIcon,\n faCheck as checkIcon,\n} from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport SimplePaginator from '../common/SimplePaginator';\nimport SearchField from '../utils/SearchField';\nimport { determineOrderDir, OrderDir } from '../utils/utils';\nimport { prettify } from '../utils/helpers/numbers';\nimport { NormalizedOrphanVisit, NormalizedVisit } from './types';\nimport './VisitsTable.scss';\n\ninterface VisitsTableProps {\n visits: NormalizedVisit[];\n selectedVisits?: NormalizedVisit[];\n setSelectedVisits: (visits: NormalizedVisit[]) => void;\n matchMedia?: (query: string) => MediaQueryList;\n isOrphanVisits?: boolean;\n}\n\ntype OrderableFields = 'date' | 'country' | 'city' | 'browser' | 'os' | 'referer' | 'visitedUrl';\n\ninterface Order {\n field?: OrderableFields;\n dir?: OrderDir;\n}\n\nconst PAGE_SIZE = 20;\nconst visitMatchesSearch = ({ browser, os, referer, country, city, ...rest }: NormalizedVisit, searchTerm: string) =>\n `${browser} ${os} ${referer} ${country} ${city} ${(rest as NormalizedOrphanVisit).visitedUrl}`.toLowerCase().includes(\n searchTerm.toLowerCase(),\n );\nconst searchVisits = (searchTerm: string, visits: NormalizedVisit[]) =>\n visits.filter((visit) => visitMatchesSearch(visit, searchTerm));\nconst sortVisits = ({ field, dir }: Order, visits: NormalizedVisit[]) => !field || !dir ? visits : visits.sort(\n (a, b) => {\n const greaterThan = dir === 'ASC' ? 1 : -1;\n const smallerThan = dir === 'ASC' ? -1 : 1;\n\n return (a as NormalizedOrphanVisit)[field] > (b as NormalizedOrphanVisit)[field] ? greaterThan : smallerThan;\n },\n);\nconst calculateVisits = (allVisits: NormalizedVisit[], searchTerm: string | undefined, order: Order) => {\n const filteredVisits = searchTerm ? searchVisits(searchTerm, allVisits) : [ ...allVisits ];\n const sortedVisits = sortVisits(order, filteredVisits);\n const total = sortedVisits.length;\n const visitsGroups = splitEvery(PAGE_SIZE, sortedVisits);\n\n return { visitsGroups, total };\n};\n\nconst VisitsTable = ({\n visits,\n selectedVisits = [],\n setSelectedVisits,\n matchMedia = window.matchMedia,\n isOrphanVisits = false,\n}: VisitsTableProps) => {\n const headerCellsClass = 'visits-table__header-cell visits-table__sticky';\n const matchMobile = () => matchMedia('(max-width: 767px)').matches;\n\n const [ isMobileDevice, setIsMobileDevice ] = useState(matchMobile());\n const [ searchTerm, setSearchTerm ] = useState(undefined);\n const [ order, setOrder ] = useState({ field: undefined, dir: undefined });\n const resultSet = useMemo(() => calculateVisits(visits, searchTerm, order), [ searchTerm, order ]);\n const isFirstLoad = useRef(true);\n\n const [ page, setPage ] = useState(1);\n const end = page * PAGE_SIZE;\n const start = end - PAGE_SIZE;\n\n const orderByColumn = (field: OrderableFields) =>\n () => setOrder({ field, dir: determineOrderDir(field, order.field, order.dir) });\n const renderOrderIcon = (field: OrderableFields) => order.dir && order.field === field && (\n \n );\n\n useEffect(() => {\n const listener = () => setIsMobileDevice(matchMobile());\n\n window.addEventListener('resize', listener);\n\n return () => window.removeEventListener('resize', listener);\n }, []);\n useEffect(() => {\n setPage(1);\n\n !isFirstLoad.current && setSelectedVisits([]);\n isFirstLoad.current = false;\n }, [ searchTerm ]);\n\n return (\n \n \n \n setSelectedVisits(\n selectedVisits.length < resultSet.total ? resultSet.visitsGroups.flat() : [],\n )}\n >\n 0 })} />\n \n \n \n \n \n \n \n {isOrphanVisits && (\n \n )}\n \n \n \n \n \n \n {!resultSet.visitsGroups[page - 1]?.length && (\n \n \n \n )}\n {resultSet.visitsGroups[page - 1]?.map((visit, index) => {\n const isSelected = selectedVisits.includes(visit);\n\n return (\n setSelectedVisits(\n isSelected ? selectedVisits.filter((v) => v !== visit) : [ ...selectedVisits, visit ],\n )}\n >\n \n \n \n \n \n \n \n {isOrphanVisits && }\n \n );\n })}\n \n {resultSet.total > PAGE_SIZE && (\n \n \n \n \n \n )}\n
\n Date\n {renderOrderIcon('date')}\n \n Country\n {renderOrderIcon('country')}\n \n City\n {renderOrderIcon('city')}\n \n Browser\n {renderOrderIcon('browser')}\n \n OS\n {renderOrderIcon('os')}\n \n Referrer\n {renderOrderIcon('referer')}\n \n Visited URL\n {renderOrderIcon('visitedUrl')}\n
\n \n
\n No visits found with current filtering\n
\n {isSelected && }\n \n {visit.date}\n {visit.country}{visit.city}{visit.browser}{visit.os}{visit.referer}{(visit as NormalizedOrphanVisit).visitedUrl}
\n
\n
\n \n
\n \n
\n Visits {prettify(start + 1)} to{' '}\n {prettify(min(end, resultSet.total))} of{' '}\n {prettify(resultSet.total)}\n
\n
\n \n
\n );\n};\n\nexport default VisitsTable;\n","import { FC } from 'react';\nimport { Modal, ModalBody } from 'reactstrap';\nimport { MapContainer, TileLayer, Marker, Popup, MapContainerProps } from 'react-leaflet';\nimport { prop } from 'ramda';\nimport { CityStats } from '../types';\nimport './MapModal.scss';\n\ninterface MapModalProps {\n toggle: () => void;\n isOpen: boolean;\n title: string;\n locations?: CityStats[];\n}\n\nconst OpenStreetMapTile: FC = () => (\n \n);\n\nconst calculateMapProps = (locations: CityStats[]): MapContainerProps => {\n if (locations.length === 0) {\n return {};\n }\n\n if (locations.length > 1) {\n return { bounds: locations.map(prop('latLong')) };\n }\n\n // When there's only one location, an error is thrown if trying to calculate the bounds.\n // When that happens, we use zoom and center as a workaround\n const [{ latLong: center }] = locations;\n\n return { zoom: 10, center };\n};\n\nconst MapModal = ({ toggle, isOpen, title, locations = [] }: MapModalProps) => (\n \n \n

\n {title}\n \n

\n \n \n {locations.map(({ cityName, latLong, count }, index) => (\n \n {count} visit{count > 1 ? 's' : ''} from {cityName}\n \n ))}\n \n
\n
\n);\n\nexport default MapModal;\n","import { useRef, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faMapMarkedAlt as mapIcon } from '@fortawesome/free-solid-svg-icons';\nimport { Dropdown, DropdownItem, DropdownMenu, UncontrolledTooltip } from 'reactstrap';\nimport { useToggle } from '../../utils/helpers/hooks';\nimport { CityStats } from '../types';\nimport MapModal from './MapModal';\nimport './OpenMapModalBtn.scss';\n\ninterface OpenMapModalBtnProps {\n modalTitle: string;\n activeCities: string[];\n locations?: CityStats[];\n}\n\nconst OpenMapModalBtn = ({ modalTitle, activeCities, locations = [] }: OpenMapModalBtnProps) => {\n const [ mapIsOpened, , openMap, closeMap ] = useToggle();\n const [ dropdownIsOpened, toggleDropdown, openDropdown ] = useToggle();\n const [ locationsToShow, setLocationsToShow ] = useState([]);\n const buttonRef = useRef();\n\n const filterLocations = (cities: CityStats[]) => cities.filter(({ cityName }) => activeCities.includes(cityName));\n const onClick = () => {\n if (!activeCities) {\n setLocationsToShow(locations);\n openMap();\n\n return;\n }\n\n openDropdown();\n };\n const openMapWithLocations = (filtered: boolean) => () => {\n setLocationsToShow(filtered ? filterLocations(locations) : locations);\n openMap();\n };\n\n return (\n <>\n \n buttonRef.current) as any}>Show in map\n \n \n Show all locations\n Show locations in current page\n \n \n \n \n );\n};\n\nexport default OpenMapModalBtn;\n","import { countBy, filter, groupBy, pipe, prop } from 'ramda';\nimport { normalizeVisits } from '../services/VisitsParser';\nimport {\n Visit,\n OrphanVisit,\n CreateVisit,\n NormalizedVisit,\n NormalizedOrphanVisit,\n Stats,\n OrphanVisitType,\n} from './index';\n\nexport const isOrphanVisit = (visit: Visit): visit is OrphanVisit => visit.hasOwnProperty('visitedUrl');\n\nexport const isNormalizedOrphanVisit = (visit: NormalizedVisit): visit is NormalizedOrphanVisit =>\n visit.hasOwnProperty('visitedUrl');\n\nexport interface GroupedNewVisits {\n orphanVisits: CreateVisit[];\n regularVisits: CreateVisit[];\n}\n\nexport const groupNewVisitsByType = pipe(\n groupBy((newVisit: CreateVisit) => isOrphanVisit(newVisit.visit) ? 'orphanVisits' : 'regularVisits'),\n // @ts-expect-error Type declaration on groupBy is not correct. It can return undefined props\n (result): GroupedNewVisits => ({ orphanVisits: [], regularVisits: [], ...result }),\n);\n\nexport type HighlightableProps = T extends NormalizedOrphanVisit\n ? ('referer' | 'country' | 'city' | 'visitedUrl')\n : ('referer' | 'country' | 'city');\n\nexport const highlightedVisitsToStats = (\n highlightedVisits: T[],\n property: HighlightableProps,\n): Stats => countBy(prop(property) as any, highlightedVisits);\n\nexport const normalizeAndFilterVisits = (visits: Visit[], type: OrphanVisitType | undefined) => pipe(\n normalizeVisits,\n filter((normalizedVisit) => type === undefined || (normalizedVisit as NormalizedOrphanVisit).type === type),\n)(visits);\n","import { isNil, map } from 'ramda';\nimport { extractDomain, parseUserAgent } from '../../utils/helpers/visits';\nimport { hasValue } from '../../utils/utils';\nimport { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types';\nimport { isNormalizedOrphanVisit, isOrphanVisit } from '../types/helpers';\n\nconst visitHasProperty = (visit: NormalizedVisit, propertyName: keyof NormalizedVisit) =>\n !isNil(visit) && hasValue(visit[propertyName]);\n\nconst optionalNumericToNumber = (numeric: string | number | null | undefined): number => {\n if (typeof numeric === 'number') {\n return numeric;\n }\n\n return numeric ? parseFloat(numeric) : 0;\n};\n\nconst updateOsStatsForVisit = (osStats: Stats, { os }: NormalizedVisit) => {\n osStats[os] = (osStats[os] || 0) + 1;\n};\n\nconst updateBrowsersStatsForVisit = (browsersStats: Stats, { browser }: NormalizedVisit) => {\n browsersStats[browser] = (browsersStats[browser] || 0) + 1;\n};\n\nconst updateReferrersStatsForVisit = (referrersStats: Stats, { referer: domain }: NormalizedVisit) => {\n referrersStats[domain] = (referrersStats[domain] || 0) + 1;\n};\n\nconst updateLocationsStatsForVisit = (propertyName: 'country' | 'city') => (stats: Stats, visit: NormalizedVisit) => {\n const hasLocationProperty = visitHasProperty(visit, propertyName);\n const value = hasLocationProperty ? visit[propertyName] : 'Unknown';\n\n stats[value] = (stats[value] || 0) + 1;\n};\n\nconst updateCountriesStatsForVisit = updateLocationsStatsForVisit('country');\nconst updateCitiesStatsForVisit = updateLocationsStatsForVisit('city');\n\nconst updateCitiesForMapForVisit = (citiesForMapStats: Record, visit: NormalizedVisit) => {\n if (!visitHasProperty(visit, 'city') || visit.city === 'Unknown') {\n return;\n }\n\n const { city, latitude, longitude } = visit;\n const currentCity = citiesForMapStats[city] || {\n cityName: city,\n count: 0,\n latLong: [ optionalNumericToNumber(latitude), optionalNumericToNumber(longitude) ],\n };\n\n currentCity.count++;\n\n citiesForMapStats[city] = currentCity;\n};\n\nconst updateVisitedUrlsForVisit = (visitedUrlsStats: Stats, visit: NormalizedVisit) => {\n if (!isNormalizedOrphanVisit(visit)) {\n return;\n }\n\n const { visitedUrl } = visit;\n\n visitedUrlsStats[visitedUrl] = (visitedUrlsStats[visitedUrl] || 0) + 1;\n};\n\nexport const processStatsFromVisits = (visits: NormalizedVisit[]) => visits.reduce(\n (stats: VisitsStats, visit: NormalizedVisit) => {\n // We mutate the original object because it has a big performance impact when large data sets are processed\n updateOsStatsForVisit(stats.os, visit);\n updateBrowsersStatsForVisit(stats.browsers, visit);\n updateReferrersStatsForVisit(stats.referrers, visit);\n updateCountriesStatsForVisit(stats.countries, visit);\n updateCitiesStatsForVisit(stats.cities, visit);\n updateCitiesForMapForVisit(stats.citiesForMap, visit);\n updateVisitedUrlsForVisit(stats.visitedUrls, visit);\n\n return stats;\n },\n { os: {}, browsers: {}, referrers: {}, countries: {}, cities: {}, citiesForMap: {}, visitedUrls: {} },\n);\n\nexport const normalizeVisits = map((visit: Visit): NormalizedVisit => {\n const { userAgent, date, referer, visitLocation } = visit;\n const common = {\n date,\n ...parseUserAgent(userAgent),\n referer: extractDomain(referer),\n country: visitLocation?.countryName || 'Unknown', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n city: visitLocation?.cityName || 'Unknown', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n latitude: visitLocation?.latitude,\n longitude: visitLocation?.longitude,\n };\n\n if (!isOrphanVisit(visit)) {\n return common;\n }\n\n return { ...common, type: visit.type, visitedUrl: visit.visitedUrl };\n});\n\nexport interface VisitsParser {\n processStatsFromVisits: (normalizedVisits: NormalizedVisit[]) => VisitsStats;\n normalizeVisits: (visits: Visit[]) => NormalizedVisit[];\n}\n","import { DropdownItem } from 'reactstrap';\nimport { OrphanVisitType } from '../types';\nimport { DropdownBtn } from '../../utils/DropdownBtn';\n\ninterface OrphanVisitTypeDropdownProps {\n onChange: (type: OrphanVisitType | undefined) => void;\n selected?: OrphanVisitType | undefined;\n className?: string;\n text: string;\n}\n\nexport const OrphanVisitTypeDropdown = ({ onChange, selected, text, className }: OrphanVisitTypeDropdownProps) => (\n \n onChange('base_url')}>\n Base URL\n \n onChange('invalid_short_url')}>\n Invalid short URL\n \n onChange('regular_404')}>\n Regular 404\n \n \n onChange(undefined)}>Clear selection\n \n);\n","import { useEffect } from 'react';\nimport { RouteComponentProps } from 'react-router';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport { ShlinkVisitsParams } from '../api/types';\nimport { parseQuery } from '../utils/helpers/query';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail';\nimport { Settings } from '../settings/reducers/settings';\nimport { ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits';\nimport ShortUrlVisitsHeader from './ShortUrlVisitsHeader';\nimport VisitsStats from './VisitsStats';\nimport { VisitsExporter } from './services/VisitsExporter';\nimport { NormalizedVisit } from './types';\n\nexport interface ShortUrlVisitsProps extends RouteComponentProps<{ shortCode: string }> {\n getShortUrlVisits: (shortCode: string, query?: ShlinkVisitsParams) => void;\n shortUrlVisits: ShortUrlVisitsState;\n getShortUrlDetail: Function;\n shortUrlDetail: ShortUrlDetail;\n cancelGetShortUrlVisits: () => void;\n settings: Settings;\n}\n\nconst ShortUrlVisits = ({ exportVisits }: VisitsExporter) => boundToMercureHub(({\n history: { goBack },\n match: { params, url },\n location: { search },\n shortUrlVisits,\n shortUrlDetail,\n getShortUrlVisits,\n getShortUrlDetail,\n cancelGetShortUrlVisits,\n settings,\n}: ShortUrlVisitsProps) => {\n const { shortCode } = params;\n const { domain } = parseQuery<{ domain?: string }>(search);\n const loadVisits = (params: Partial) => getShortUrlVisits(shortCode, { ...params, domain });\n const exportCsv = (visits: NormalizedVisit[]) => exportVisits(\n `short-url_${shortUrlDetail.shortUrl?.shortUrl.replace(/https?:\\/\\//g, '')}_visits.csv`,\n visits,\n );\n\n useEffect(() => {\n getShortUrlDetail(shortCode, domain);\n }, []);\n\n return (\n \n \n \n );\n}, ({ match }) => [ Topics.shortUrlVisits(match.params.shortCode) ]);\n\nexport default ShortUrlVisits;\n","import { flatten, prop, range, splitEvery } from 'ramda';\nimport { Action, Dispatch } from 'redux';\nimport { ShlinkPaginator, ShlinkVisits } from '../../api/types';\nimport { Visit, VisitsLoadFailedAction } from '../types';\nimport { parseApiError } from '../../api/utils';\n\nconst ITEMS_PER_PAGE = 5000;\nconst PARALLEL_REQUESTS_COUNT = 4;\nconst PARALLEL_STARTING_PAGE = 2;\n\nconst isLastPage = ({ currentPage, pagesCount }: ShlinkPaginator): boolean => currentPage >= pagesCount;\nconst calcProgress = (total: number, current: number): number => current * 100 / total;\n\ntype VisitsLoader = (page: number, itemsPerPage: number) => Promise;\ninterface ActionMap {\n start: string;\n large: string;\n finish: string;\n error: string;\n progress: string;\n}\n\nexport const getVisitsWithLoader = async & { visits: Visit[] }>(\n visitsLoader: VisitsLoader,\n extraFinishActionData: Partial,\n actionMap: ActionMap,\n dispatch: Dispatch,\n shouldCancel: () => boolean,\n) => {\n dispatch({ type: actionMap.start });\n\n const loadVisitsInParallel = async (pages: number[]): Promise =>\n Promise.all(pages.map(async (page) => visitsLoader(page, ITEMS_PER_PAGE).then(prop('data')))).then(flatten);\n\n const loadPagesBlocks = async (pagesBlocks: number[][], index = 0): Promise => {\n if (shouldCancel()) {\n return [];\n }\n\n const data = await loadVisitsInParallel(pagesBlocks[index]);\n\n dispatch({ type: actionMap.progress, progress: calcProgress(pagesBlocks.length, index + PARALLEL_STARTING_PAGE) });\n\n if (index < pagesBlocks.length - 1) {\n return data.concat(await loadPagesBlocks(pagesBlocks, index + 1));\n }\n\n return data;\n };\n\n const loadVisits = async (page = 1) => {\n const { pagination, data } = await visitsLoader(page, ITEMS_PER_PAGE);\n\n // If pagination was not returned, then this is an old shlink version. Just return data\n if (!pagination || isLastPage(pagination)) {\n return data;\n }\n\n // If there are more pages, make requests in blocks of 4\n const pagesRange = range(PARALLEL_STARTING_PAGE, pagination.pagesCount + 1);\n const pagesBlocks = splitEvery(PARALLEL_REQUESTS_COUNT, pagesRange);\n\n if (pagination.pagesCount - 1 > PARALLEL_REQUESTS_COUNT) {\n dispatch({ type: actionMap.large });\n }\n\n return data.concat(await loadPagesBlocks(pagesBlocks));\n };\n\n try {\n const visits = await loadVisits();\n\n dispatch({ ...extraFinishActionData, visits, type: actionMap.finish });\n } catch (e) {\n dispatch({ type: actionMap.error, errorData: parseApiError(e) });\n }\n};\n","import { Action, Dispatch } from 'redux';\nimport { shortUrlMatches } from '../../short-urls/helpers';\nimport { Visit, VisitsInfo, VisitsLoadFailedAction, VisitsLoadProgressChangedAction } from '../types';\nimport { ShortUrlIdentifier } from '../../short-urls/data';\nimport { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { GetState } from '../../container/types';\nimport { OptionalString } from '../../utils/utils';\nimport { getVisitsWithLoader } from './common';\nimport { CREATE_VISITS, CreateVisitsAction } from './visitCreation';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_SHORT_URL_VISITS_START = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_START';\nexport const GET_SHORT_URL_VISITS_ERROR = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_ERROR';\nexport const GET_SHORT_URL_VISITS = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS';\nexport const GET_SHORT_URL_VISITS_LARGE = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_LARGE';\nexport const GET_SHORT_URL_VISITS_CANCEL = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_CANCEL';\nexport const GET_SHORT_URL_VISITS_PROGRESS_CHANGED = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_PROGRESS_CHANGED';\n/* eslint-enable padding-line-between-statements */\n\nexport interface ShortUrlVisits extends VisitsInfo, ShortUrlIdentifier {}\n\ninterface ShortUrlVisitsAction extends Action, ShortUrlIdentifier {\n visits: Visit[];\n}\n\ntype ShortUrlVisitsCombinedAction = ShortUrlVisitsAction\n& VisitsLoadProgressChangedAction\n& CreateVisitsAction\n& VisitsLoadFailedAction;\n\nconst initialState: ShortUrlVisits = {\n visits: [],\n shortCode: '',\n domain: undefined,\n loading: false,\n loadingLarge: false,\n error: false,\n cancelLoad: false,\n progress: 0,\n};\n\nexport default buildReducer({\n [GET_SHORT_URL_VISITS_START]: () => ({ ...initialState, loading: true }),\n [GET_SHORT_URL_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }),\n [GET_SHORT_URL_VISITS]: (_, { visits, shortCode, domain }) => ({\n ...initialState,\n visits,\n shortCode,\n domain,\n }),\n [GET_SHORT_URL_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }),\n [GET_SHORT_URL_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }),\n [GET_SHORT_URL_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }),\n [CREATE_VISITS]: (state, { createdVisits }) => {\n const { shortCode, domain, visits } = state;\n const newVisits = createdVisits\n .filter(({ shortUrl }) => shortUrl && shortUrlMatches(shortUrl, shortCode, domain))\n .map(({ visit }) => visit);\n\n return { ...state, visits: [ ...newVisits, ...visits ] };\n },\n}, initialState);\n\nexport const getShortUrlVisits = (buildShlinkApiClient: ShlinkApiClientBuilder) => (\n shortCode: string,\n query: { domain?: OptionalString } = {},\n) => async (dispatch: Dispatch, getState: GetState) => {\n const { getShortUrlVisits } = buildShlinkApiClient(getState);\n const visitsLoader = async (page: number, itemsPerPage: number) => getShortUrlVisits(\n shortCode,\n { ...query, page, itemsPerPage },\n );\n const shouldCancel = () => getState().shortUrlVisits.cancelLoad;\n const extraFinishActionData: Partial = { shortCode, domain: query.domain };\n const actionMap = {\n start: GET_SHORT_URL_VISITS_START,\n large: GET_SHORT_URL_VISITS_LARGE,\n finish: GET_SHORT_URL_VISITS,\n error: GET_SHORT_URL_VISITS_ERROR,\n progress: GET_SHORT_URL_VISITS_PROGRESS_CHANGED,\n };\n\n return getVisitsWithLoader(visitsLoader, extraFinishActionData, actionMap, dispatch, shouldCancel);\n};\n\nexport const cancelGetShortUrlVisits = buildActionCreator(GET_SHORT_URL_VISITS_CANCEL);\n","import Tag from '../tags/helpers/Tag';\nimport ColorGenerator from '../utils/services/ColorGenerator';\nimport VisitsHeader from './VisitsHeader';\nimport { TagVisits } from './reducers/tagVisits';\nimport './ShortUrlVisitsHeader.scss';\n\ninterface TagVisitsHeaderProps {\n tagVisits: TagVisits;\n goBack: () => void;\n colorGenerator: ColorGenerator;\n}\n\nconst TagVisitsHeader = ({ tagVisits, goBack, colorGenerator }: TagVisitsHeaderProps) => {\n const { visits, tag } = tagVisits;\n\n const visitsStatsTitle = (\n \n Visits for\n \n \n );\n\n return ;\n};\n\nexport default TagVisitsHeader;\n","import { RouteComponentProps } from 'react-router';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport ColorGenerator from '../utils/services/ColorGenerator';\nimport { ShlinkVisitsParams } from '../api/types';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { Settings } from '../settings/reducers/settings';\nimport { TagVisits as TagVisitsState } from './reducers/tagVisits';\nimport TagVisitsHeader from './TagVisitsHeader';\nimport VisitsStats from './VisitsStats';\nimport { VisitsExporter } from './services/VisitsExporter';\nimport { NormalizedVisit } from './types';\n\nexport interface TagVisitsProps extends RouteComponentProps<{ tag: string }> {\n getTagVisits: (tag: string, query: any) => void;\n tagVisits: TagVisitsState;\n cancelGetTagVisits: () => void;\n settings: Settings;\n}\n\nconst TagVisits = (colorGenerator: ColorGenerator, { exportVisits }: VisitsExporter) => boundToMercureHub(({\n history: { goBack },\n match: { params, url },\n getTagVisits,\n tagVisits,\n cancelGetTagVisits,\n settings,\n}: TagVisitsProps) => {\n const { tag } = params;\n const loadVisits = (params: ShlinkVisitsParams) => getTagVisits(tag, params);\n const exportCsv = (visits: NormalizedVisit[]) => exportVisits(`tag_${tag}_visits.csv`, visits);\n\n return (\n \n \n \n );\n}, () => [ Topics.visits() ]);\n\nexport default TagVisits;\n","import { Action, Dispatch } from 'redux';\nimport { Visit, VisitsInfo, VisitsLoadFailedAction, VisitsLoadProgressChangedAction } from '../types';\nimport { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { GetState } from '../../container/types';\nimport { getVisitsWithLoader } from './common';\nimport { CREATE_VISITS, CreateVisitsAction } from './visitCreation';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_TAG_VISITS_START = 'shlink/tagVisits/GET_TAG_VISITS_START';\nexport const GET_TAG_VISITS_ERROR = 'shlink/tagVisits/GET_TAG_VISITS_ERROR';\nexport const GET_TAG_VISITS = 'shlink/tagVisits/GET_TAG_VISITS';\nexport const GET_TAG_VISITS_LARGE = 'shlink/tagVisits/GET_TAG_VISITS_LARGE';\nexport const GET_TAG_VISITS_CANCEL = 'shlink/tagVisits/GET_TAG_VISITS_CANCEL';\nexport const GET_TAG_VISITS_PROGRESS_CHANGED = 'shlink/tagVisits/GET_TAG_VISITS_PROGRESS_CHANGED';\n/* eslint-enable padding-line-between-statements */\n\nexport interface TagVisits extends VisitsInfo {\n tag: string;\n}\n\nexport interface TagVisitsAction extends Action {\n visits: Visit[];\n tag: string;\n}\n\ntype TagsVisitsCombinedAction = TagVisitsAction\n& VisitsLoadProgressChangedAction\n& CreateVisitsAction\n& VisitsLoadFailedAction;\n\nconst initialState: TagVisits = {\n visits: [],\n tag: '',\n loading: false,\n loadingLarge: false,\n error: false,\n cancelLoad: false,\n progress: 0,\n};\n\nexport default buildReducer({\n [GET_TAG_VISITS_START]: () => ({ ...initialState, loading: true }),\n [GET_TAG_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }),\n [GET_TAG_VISITS]: (_, { visits, tag }) => ({ ...initialState, visits, tag }),\n [GET_TAG_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }),\n [GET_TAG_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }),\n [GET_TAG_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }),\n [CREATE_VISITS]: (state, { createdVisits }) => {\n const { tag, visits } = state;\n const newVisits = createdVisits\n .filter(({ shortUrl }) => shortUrl?.tags.includes(tag))\n .map(({ visit }) => visit);\n\n return { ...state, visits: [ ...newVisits, ...visits ] };\n },\n}, initialState);\n\nexport const getTagVisits = (buildShlinkApiClient: ShlinkApiClientBuilder) => (tag: string, query = {}) => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n const { getTagVisits } = buildShlinkApiClient(getState);\n const visitsLoader = async (page: number, itemsPerPage: number) => getTagVisits(\n tag,\n { ...query, page, itemsPerPage },\n );\n const shouldCancel = () => getState().tagVisits.cancelLoad;\n const extraFinishActionData: Partial = { tag };\n const actionMap = {\n start: GET_TAG_VISITS_START,\n large: GET_TAG_VISITS_LARGE,\n finish: GET_TAG_VISITS,\n error: GET_TAG_VISITS_ERROR,\n progress: GET_TAG_VISITS_PROGRESS_CHANGED,\n };\n\n return getVisitsWithLoader(visitsLoader, extraFinishActionData, actionMap, dispatch, shouldCancel);\n};\n\nexport const cancelGetTagVisits = buildActionCreator(GET_TAG_VISITS_CANCEL);\n","import VisitsHeader from './VisitsHeader';\nimport { VisitsInfo } from './types';\nimport './ShortUrlVisitsHeader.scss';\n\ninterface OrphanVisitsHeaderProps {\n orphanVisits: VisitsInfo;\n goBack: () => void;\n}\n\nexport const OrphanVisitsHeader = ({ orphanVisits, goBack }: OrphanVisitsHeaderProps) => {\n const { visits } = orphanVisits;\n\n return ;\n};\n","import { RouteComponentProps } from 'react-router';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport { ShlinkVisitsParams } from '../api/types';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { Settings } from '../settings/reducers/settings';\nimport VisitsStats from './VisitsStats';\nimport { OrphanVisitsHeader } from './OrphanVisitsHeader';\nimport { NormalizedVisit, VisitsInfo } from './types';\nimport { VisitsExporter } from './services/VisitsExporter';\n\nexport interface OrphanVisitsProps extends RouteComponentProps {\n getOrphanVisits: (params: ShlinkVisitsParams) => void;\n orphanVisits: VisitsInfo;\n cancelGetOrphanVisits: () => void;\n settings: Settings;\n}\n\nexport const OrphanVisits = ({ exportVisits }: VisitsExporter) => boundToMercureHub(({\n history: { goBack },\n match: { url },\n getOrphanVisits,\n orphanVisits,\n cancelGetOrphanVisits,\n settings,\n}: OrphanVisitsProps) => {\n const exportCsv = (visits: NormalizedVisit[]) => exportVisits('orphan_visits.csv', visits);\n\n return (\n \n \n \n );\n}, () => [ Topics.orphanVisits() ]);\n","import { Action, Dispatch } from 'redux';\nimport { Visit, VisitsInfo, VisitsLoadFailedAction, VisitsLoadProgressChangedAction } from '../types';\nimport { buildActionCreator, buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { GetState } from '../../container/types';\nimport { getVisitsWithLoader } from './common';\nimport { CREATE_VISITS, CreateVisitsAction } from './visitCreation';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_ORPHAN_VISITS_START = 'shlink/orphanVisits/GET_ORPHAN_VISITS_START';\nexport const GET_ORPHAN_VISITS_ERROR = 'shlink/orphanVisits/GET_ORPHAN_VISITS_ERROR';\nexport const GET_ORPHAN_VISITS = 'shlink/orphanVisits/GET_ORPHAN_VISITS';\nexport const GET_ORPHAN_VISITS_LARGE = 'shlink/orphanVisits/GET_ORPHAN_VISITS_LARGE';\nexport const GET_ORPHAN_VISITS_CANCEL = 'shlink/orphanVisits/GET_ORPHAN_VISITS_CANCEL';\nexport const GET_ORPHAN_VISITS_PROGRESS_CHANGED = 'shlink/orphanVisits/GET_ORPHAN_VISITS_PROGRESS_CHANGED';\n/* eslint-enable padding-line-between-statements */\n\nexport interface OrphanVisitsAction extends Action {\n visits: Visit[];\n}\n\ntype OrphanVisitsCombinedAction = OrphanVisitsAction\n& VisitsLoadProgressChangedAction\n& CreateVisitsAction\n& VisitsLoadFailedAction;\n\nconst initialState: VisitsInfo = {\n visits: [],\n loading: false,\n loadingLarge: false,\n error: false,\n cancelLoad: false,\n progress: 0,\n};\n\nexport default buildReducer({\n [GET_ORPHAN_VISITS_START]: () => ({ ...initialState, loading: true }),\n [GET_ORPHAN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }),\n [GET_ORPHAN_VISITS]: (_, { visits }) => ({ ...initialState, visits }),\n [GET_ORPHAN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }),\n [GET_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }),\n [GET_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }),\n [CREATE_VISITS]: (state, { createdVisits }) => {\n const { visits } = state;\n const newVisits = createdVisits.map(({ visit }) => visit);\n\n return { ...state, visits: [ ...newVisits, ...visits ] };\n },\n}, initialState);\n\nexport const getOrphanVisits = (buildShlinkApiClient: ShlinkApiClientBuilder) => (query = {}) => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n const { getOrphanVisits } = buildShlinkApiClient(getState);\n const visitsLoader = async (page: number, itemsPerPage: number) => getOrphanVisits({ ...query, page, itemsPerPage });\n const shouldCancel = () => getState().orphanVisits.cancelLoad;\n const actionMap = {\n start: GET_ORPHAN_VISITS_START,\n large: GET_ORPHAN_VISITS_LARGE,\n finish: GET_ORPHAN_VISITS,\n error: GET_ORPHAN_VISITS_ERROR,\n progress: GET_ORPHAN_VISITS_PROGRESS_CHANGED,\n };\n\n return getVisitsWithLoader(visitsLoader, {}, actionMap, dispatch, shouldCancel);\n};\n\nexport const cancelGetOrphanVisits = buildActionCreator(GET_ORPHAN_VISITS_CANCEL);\n","import { Action, Dispatch } from 'redux';\nimport { ShlinkVisitsOverview } from '../../api/types';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { GetState } from '../../container/types';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { groupNewVisitsByType } from '../types/helpers';\nimport { CREATE_VISITS, CreateVisitsAction } from './visitCreation';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_OVERVIEW_START = 'shlink/visitsOverview/GET_OVERVIEW_START';\nexport const GET_OVERVIEW_ERROR = 'shlink/visitsOverview/GET_OVERVIEW_ERROR';\nexport const GET_OVERVIEW = 'shlink/visitsOverview/GET_OVERVIEW';\n/* eslint-enable padding-line-between-statements */\n\nexport interface VisitsOverview {\n visitsCount: number;\n orphanVisitsCount?: number;\n loading: boolean;\n error: boolean;\n}\n\nexport type GetVisitsOverviewAction = ShlinkVisitsOverview & Action;\n\nconst initialState: VisitsOverview = {\n visitsCount: 0,\n orphanVisitsCount: 0,\n loading: false,\n error: false,\n};\n\nexport default buildReducer({\n [GET_OVERVIEW_START]: () => ({ ...initialState, loading: true }),\n [GET_OVERVIEW_ERROR]: () => ({ ...initialState, error: true }),\n [GET_OVERVIEW]: (_, { visitsCount, orphanVisitsCount }) => ({ ...initialState, visitsCount, orphanVisitsCount }),\n [CREATE_VISITS]: ({ visitsCount, orphanVisitsCount = 0, ...rest }, { createdVisits }) => {\n const { regularVisits, orphanVisits } = groupNewVisitsByType(createdVisits);\n\n return {\n ...rest,\n visitsCount: visitsCount + regularVisits.length,\n orphanVisitsCount: orphanVisitsCount + orphanVisits.length,\n };\n },\n}, initialState);\n\nexport const loadVisitsOverview = (buildShlinkApiClient: ShlinkApiClientBuilder) => () => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n dispatch({ type: GET_OVERVIEW_START });\n\n try {\n const { getVisitsOverview } = buildShlinkApiClient(getState);\n const result = await getVisitsOverview();\n\n dispatch({ type: GET_OVERVIEW, ...result });\n } catch (e) {\n dispatch({ type: GET_OVERVIEW_ERROR });\n }\n};\n","import { CsvJson } from 'csvjson';\nimport { NormalizedVisit } from '../types';\nimport { saveCsv } from '../../utils/helpers/csv';\n\nexport class VisitsExporter {\n public constructor(\n private readonly window: Window,\n private readonly csvjson: CsvJson,\n ) {}\n\n public readonly exportVisits = (filename: string, visits: NormalizedVisit[]) => {\n if (!visits.length) {\n return;\n }\n\n const csv = this.csvjson.toCSV(visits, { headers: 'key' });\n\n saveCsv(this.window, csv, filename);\n };\n}\n","import Bottle from 'bottlejs';\nimport ShortUrlVisits from '../ShortUrlVisits';\nimport { cancelGetShortUrlVisits, getShortUrlVisits } from '../reducers/shortUrlVisits';\nimport MapModal from '../helpers/MapModal';\nimport { createNewVisits } from '../reducers/visitCreation';\nimport TagVisits from '../TagVisits';\nimport { cancelGetTagVisits, getTagVisits } from '../reducers/tagVisits';\nimport { OrphanVisits } from '../OrphanVisits';\nimport { cancelGetOrphanVisits, getOrphanVisits } from '../reducers/orphanVisits';\nimport { ConnectDecorator } from '../../container/types';\nimport { loadVisitsOverview } from '../reducers/visitsOverview';\nimport * as visitsParser from './VisitsParser';\nimport { VisitsExporter } from './VisitsExporter';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator) => {\n // Components\n bottle.serviceFactory('MapModal', () => MapModal);\n\n bottle.serviceFactory('ShortUrlVisits', ShortUrlVisits, 'VisitsExporter');\n bottle.decorator('ShortUrlVisits', connect(\n [ 'shortUrlVisits', 'shortUrlDetail', 'mercureInfo', 'settings' ],\n [ 'getShortUrlVisits', 'getShortUrlDetail', 'cancelGetShortUrlVisits', 'createNewVisits', 'loadMercureInfo' ],\n ));\n\n bottle.serviceFactory('TagVisits', TagVisits, 'ColorGenerator', 'VisitsExporter');\n bottle.decorator('TagVisits', connect(\n [ 'tagVisits', 'mercureInfo', 'settings' ],\n [ 'getTagVisits', 'cancelGetTagVisits', 'createNewVisits', 'loadMercureInfo' ],\n ));\n\n bottle.serviceFactory('OrphanVisits', OrphanVisits, 'VisitsExporter');\n bottle.decorator('OrphanVisits', connect(\n [ 'orphanVisits', 'mercureInfo', 'settings' ],\n [ 'getOrphanVisits', 'cancelGetOrphanVisits', 'createNewVisits', 'loadMercureInfo' ],\n ));\n\n // Services\n bottle.serviceFactory('VisitsParser', () => visitsParser);\n bottle.service('VisitsExporter', VisitsExporter, 'window', 'csvjson');\n\n // Actions\n bottle.serviceFactory('getShortUrlVisits', getShortUrlVisits, 'buildShlinkApiClient');\n bottle.serviceFactory('cancelGetShortUrlVisits', () => cancelGetShortUrlVisits);\n\n bottle.serviceFactory('getTagVisits', getTagVisits, 'buildShlinkApiClient');\n bottle.serviceFactory('cancelGetTagVisits', () => cancelGetTagVisits);\n\n bottle.serviceFactory('getOrphanVisits', getOrphanVisits, 'buildShlinkApiClient');\n bottle.serviceFactory('cancelGetOrphanVisits', () => cancelGetOrphanVisits);\n\n bottle.serviceFactory('createNewVisits', () => createNewVisits);\n bottle.serviceFactory('loadVisitsOverview', loadVisitsOverview, 'buildShlinkApiClient');\n};\n\nexport default provideServices;\n","import ColorGenerator from '../../utils/services/ColorGenerator';\nimport './TagBullet.scss';\n\ninterface TagBulletProps {\n tag: string;\n colorGenerator: ColorGenerator;\n}\n\nconst TagBullet = ({ tag, colorGenerator }: TagBulletProps) => (\n \n);\n\nexport default TagBullet;\n","import { ChangeEvent, useEffect } from 'react';\nimport TagsInput, { RenderInputProps, RenderTagProps } from 'react-tagsinput';\nimport Autosuggest, { ChangeEvent as AutoChangeEvent, SuggestionSelectedEventData } from 'react-autosuggest';\nimport ColorGenerator from '../../utils/services/ColorGenerator';\nimport { TagsList } from '../reducers/tagsList';\nimport TagBullet from './TagBullet';\nimport './TagsSelector.scss';\n\nexport interface TagsSelectorProps {\n tags: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n}\n\ninterface TagsSelectorConnectProps extends TagsSelectorProps {\n listTags: Function;\n tagsList: TagsList;\n}\n\nconst noop = () => {};\n\nconst TagsSelector = (colorGenerator: ColorGenerator) => (\n { tags, onChange, listTags, tagsList, placeholder = 'Add tags to the URL' }: TagsSelectorConnectProps,\n) => {\n useEffect(() => {\n listTags();\n }, []);\n\n const renderTag = (\n { tag, key, disabled, onRemove, classNameRemove, getTagDisplayValue, ...other }: RenderTagProps,\n ) => (\n \n {getTagDisplayValue(tag)}\n {!disabled && onRemove(key)} />}\n \n );\n const renderAutocompleteInput = (data: RenderInputProps) => {\n const { addTag, ...otherProps } = data;\n const handleOnChange = (e: ChangeEvent, { method }: AutoChangeEvent) => {\n method === 'enter' ? e.preventDefault() : otherProps.onChange(e);\n };\n\n const inputValue = otherProps.value?.trim().toLowerCase() ?? '';\n const suggestions = tagsList.tags.filter((tag) => tag.startsWith(inputValue));\n\n return (\n value.trim().length > 0}\n getSuggestionValue={(suggestion) => suggestion}\n renderSuggestion={(suggestion) => (\n <>\n \n {suggestion}\n \n )}\n onSuggestionsFetchRequested={noop}\n onSuggestionsClearRequested={noop}\n onSuggestionSelected={(_, { suggestion }: SuggestionSelectedEventData) => {\n addTag(suggestion);\n }}\n />\n );\n };\n\n return (\n \n );\n};\n\nexport default TagsSelector;\n","import { Card, CardHeader, CardBody, Button, Collapse } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faTrash as deleteIcon, faPencilAlt as editIcon, faLink, faEye } from '@fortawesome/free-solid-svg-icons';\nimport { FC } from 'react';\nimport { Link } from 'react-router-dom';\nimport { prettify } from '../utils/helpers/numbers';\nimport { useToggle } from '../utils/helpers/hooks';\nimport { Versions } from '../utils/helpers/version';\nimport ColorGenerator from '../utils/services/ColorGenerator';\nimport { isServerWithId, SelectedServer } from '../servers/data';\nimport TagBullet from './helpers/TagBullet';\nimport { TagModalProps, TagStats } from './data';\nimport './TagCard.scss';\n\nexport interface TagCardProps {\n tag: string;\n tagStats?: TagStats;\n selectedServer: SelectedServer;\n displayed: boolean;\n toggle: () => void;\n}\n\nconst TagCard = (\n DeleteTagConfirmModal: FC,\n EditTagModal: FC,\n ForServerVersion: FC,\n colorGenerator: ColorGenerator,\n) => ({ tag, tagStats, selectedServer, displayed, toggle }: TagCardProps) => {\n const [ isDeleteModalOpen, toggleDelete ] = useToggle();\n const [ isEditModalOpen, toggleEdit ] = useToggle();\n\n const serverId = isServerWithId(selectedServer) ? selectedServer.id : '';\n const shortUrlsLink = `/server/${serverId}/list-short-urls/1?tag=${tag}`;\n\n return (\n \n \n \n \n
\n \n \n {tag}\n \n \n {tag}\n \n
\n
\n\n {tagStats && (\n \n \n \n Short URLs\n {prettify(tagStats.shortUrlsCount)}\n \n \n Visits\n {prettify(tagStats.visitsCount)}\n \n \n \n )}\n\n \n \n
\n );\n};\n\nexport default TagCard;\n","import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\nimport { TagDeletion } from '../reducers/tagDelete';\nimport { TagModalProps } from '../data';\nimport { Result } from '../../utils/Result';\nimport { ShlinkApiError } from '../../api/ShlinkApiError';\n\ninterface DeleteTagConfirmModalProps extends TagModalProps {\n deleteTag: (tag: string) => Promise;\n tagDeleted: (tag: string) => void;\n tagDelete: TagDeletion;\n}\n\nconst DeleteTagConfirmModal = (\n { tag, toggle, isOpen, deleteTag, tagDelete, tagDeleted }: DeleteTagConfirmModalProps,\n) => {\n const { deleting, error, errorData } = tagDelete;\n const doDelete = async () => {\n await deleteTag(tag);\n tagDeleted(tag);\n toggle();\n };\n\n return (\n \n \n Delete tag\n \n \n Are you sure you want to delete tag {tag}?\n {error && (\n \n \n \n )}\n \n \n \n \n \n \n );\n};\n\nexport default DeleteTagConfirmModal;\n","import { useState } from 'react';\nimport { Modal, ModalBody, ModalFooter, ModalHeader, Popover } from 'reactstrap';\nimport { ChromePicker } from 'react-color';\nimport { faPalette as colorIcon } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useToggle } from '../../utils/helpers/hooks';\nimport { handleEventPreventingDefault } from '../../utils/utils';\nimport ColorGenerator from '../../utils/services/ColorGenerator';\nimport { TagModalProps } from '../data';\nimport { TagEdition } from '../reducers/tagEdit';\nimport { Result } from '../../utils/Result';\nimport { ShlinkApiError } from '../../api/ShlinkApiError';\nimport './EditTagModal.scss';\n\ninterface EditTagModalProps extends TagModalProps {\n tagEdit: TagEdition;\n editTag: (oldName: string, newName: string, color: string) => Promise;\n tagEdited: (oldName: string, newName: string, color: string) => void;\n}\n\nconst EditTagModal = ({ getColorForKey }: ColorGenerator) => (\n { tag, editTag, toggle, tagEdited, isOpen, tagEdit }: EditTagModalProps,\n) => {\n const [ newTagName, setNewTagName ] = useState(tag);\n const [ color, setColor ] = useState(getColorForKey(tag));\n const [ showColorPicker, toggleColorPicker, , hideColorPicker ] = useToggle();\n const { editing, error, errorData } = tagEdit;\n const saveTag = handleEventPreventingDefault(async () => editTag(tag, newTagName, color)\n .then(() => tagEdited(tag, newTagName, color))\n .then(toggle)\n .catch(() => {}));\n\n return (\n \n
\n Edit tag\n \n
\n
\n \n \n
\n
\n \n setColor(hex)} />\n \n setNewTagName(e.target.value)}\n />\n \n\n {error && (\n \n \n \n )}\n
\n \n \n \n \n
\n
\n );\n};\n\nexport default EditTagModal;\n","import { FC, useEffect, useState } from 'react';\nimport { splitEvery } from 'ramda';\nimport Message from '../utils/Message';\nimport SearchField from '../utils/SearchField';\nimport { SelectedServer } from '../servers/data';\nimport { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';\nimport { Result } from '../utils/Result';\nimport { ShlinkApiError } from '../api/ShlinkApiError';\nimport { Topics } from '../mercure/helpers/Topics';\nimport { TagsList as TagsListState } from './reducers/tagsList';\nimport { TagCardProps } from './TagCard';\n\nconst { ceil } = Math;\nconst TAGS_GROUPS_AMOUNT = 4;\n\nexport interface TagsListProps {\n filterTags: (searchTerm: string) => void;\n forceListTags: Function;\n tagsList: TagsListState;\n selectedServer: SelectedServer;\n}\n\nconst TagsList = (TagCard: FC) => boundToMercureHub((\n { filterTags, forceListTags, tagsList, selectedServer }: TagsListProps,\n) => {\n const [ displayedTag, setDisplayedTag ] = useState();\n\n useEffect(() => {\n forceListTags();\n }, []);\n\n const renderContent = () => {\n if (tagsList.loading) {\n return ;\n }\n\n if (tagsList.error) {\n return (\n \n \n \n );\n }\n\n const tagsCount = tagsList.filteredTags.length;\n\n if (tagsCount < 1) {\n return No tags found;\n }\n\n const tagsGroups = splitEvery(ceil(tagsCount / TAGS_GROUPS_AMOUNT), tagsList.filteredTags);\n\n return (\n
\n {tagsGroups.map((group, index) => (\n
\n {group.map((tag) => (\n setDisplayedTag(displayedTag !== tag ? tag : undefined)}\n />\n ))}\n
\n ))}\n
\n );\n };\n\n return (\n <>\n {!tagsList.loading && }\n {renderContent()}\n \n );\n}, () => [ Topics.visits() ]);\n\nexport default TagsList;\n","import { Action, Dispatch } from 'redux';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { GetState } from '../../container/types';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { ProblemDetailsError } from '../../api/types';\nimport { parseApiError } from '../../api/utils';\n\n/* eslint-disable padding-line-between-statements */\nexport const DELETE_TAG_START = 'shlink/deleteTag/DELETE_TAG_START';\nexport const DELETE_TAG_ERROR = 'shlink/deleteTag/DELETE_TAG_ERROR';\nexport const DELETE_TAG = 'shlink/deleteTag/DELETE_TAG';\nexport const TAG_DELETED = 'shlink/deleteTag/TAG_DELETED';\n/* eslint-enable padding-line-between-statements */\n\nexport interface TagDeletion {\n deleting: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface DeleteTagAction extends Action {\n tag: string;\n}\n\nexport interface DeleteTagFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: TagDeletion = {\n deleting: false,\n error: false,\n};\n\nexport default buildReducer({\n [DELETE_TAG_START]: () => ({ deleting: true, error: false }),\n [DELETE_TAG_ERROR]: (_, { errorData }) => ({ deleting: false, error: true, errorData }),\n [DELETE_TAG]: () => ({ deleting: false, error: false }),\n}, initialState);\n\nexport const deleteTag = (buildShlinkApiClient: ShlinkApiClientBuilder) => (tag: string) => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n dispatch({ type: DELETE_TAG_START });\n const { deleteTags } = buildShlinkApiClient(getState);\n\n try {\n await deleteTags([ tag ]);\n dispatch({ type: DELETE_TAG });\n } catch (e) {\n dispatch({ type: DELETE_TAG_ERROR, errorData: parseApiError(e) });\n\n throw e;\n }\n};\n\nexport const tagDeleted = (tag: string): DeleteTagAction => ({ type: TAG_DELETED, tag });\n","import { pick } from 'ramda';\nimport { Action, Dispatch } from 'redux';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { GetState } from '../../container/types';\nimport ColorGenerator from '../../utils/services/ColorGenerator';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { ProblemDetailsError } from '../../api/types';\nimport { parseApiError } from '../../api/utils';\n\n/* eslint-disable padding-line-between-statements */\nexport const EDIT_TAG_START = 'shlink/editTag/EDIT_TAG_START';\nexport const EDIT_TAG_ERROR = 'shlink/editTag/EDIT_TAG_ERROR';\nexport const EDIT_TAG = 'shlink/editTag/EDIT_TAG';\n/* eslint-enable padding-line-between-statements */\n\nexport const TAG_EDITED = 'shlink/editTag/TAG_EDITED';\n\nexport interface TagEdition {\n oldName: string;\n newName: string;\n editing: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\nexport interface EditTagAction extends Action {\n oldName: string;\n newName: string;\n color: string;\n}\n\nexport interface EditTagFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\nconst initialState: TagEdition = {\n oldName: '',\n newName: '',\n editing: false,\n error: false,\n};\n\nexport default buildReducer({\n [EDIT_TAG_START]: (state) => ({ ...state, editing: true, error: false }),\n [EDIT_TAG_ERROR]: (state, { errorData }) => ({ ...state, editing: false, error: true, errorData }),\n [EDIT_TAG]: (_, action) => ({\n ...pick([ 'oldName', 'newName' ], action),\n editing: false,\n error: false,\n }),\n}, initialState);\n\nexport const editTag = (buildShlinkApiClient: ShlinkApiClientBuilder, colorGenerator: ColorGenerator) => (\n oldName: string,\n newName: string,\n color: string,\n) => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: EDIT_TAG_START });\n const { editTag } = buildShlinkApiClient(getState);\n\n try {\n await editTag(oldName, newName);\n colorGenerator.setColorForKey(newName, color);\n dispatch({ type: EDIT_TAG, oldName, newName });\n } catch (e) {\n dispatch({ type: EDIT_TAG_ERROR, errorData: parseApiError(e) });\n\n throw e;\n }\n};\n\nexport const tagEdited = (oldName: string, newName: string, color: string): EditTagAction => ({\n type: TAG_EDITED,\n oldName,\n newName,\n color,\n});\n","import { isEmpty, reject } from 'ramda';\nimport { Action, Dispatch } from 'redux';\nimport { CREATE_VISITS, CreateVisitsAction } from '../../visits/reducers/visitCreation';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { ProblemDetailsError, ShlinkTags } from '../../api/types';\nimport { GetState } from '../../container/types';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { CreateVisit, Stats } from '../../visits/types';\nimport { parseApiError } from '../../api/utils';\nimport { TagStats } from '../data';\nimport { DeleteTagAction, TAG_DELETED } from './tagDelete';\nimport { EditTagAction, TAG_EDITED } from './tagEdit';\n\n/* eslint-disable padding-line-between-statements */\nexport const LIST_TAGS_START = 'shlink/tagsList/LIST_TAGS_START';\nexport const LIST_TAGS_ERROR = 'shlink/tagsList/LIST_TAGS_ERROR';\nexport const LIST_TAGS = 'shlink/tagsList/LIST_TAGS';\nexport const FILTER_TAGS = 'shlink/tagsList/FILTER_TAGS';\n/* eslint-enable padding-line-between-statements */\n\ntype TagsStatsMap = Record;\n\nexport interface TagsList {\n tags: string[];\n filteredTags: string[];\n stats: TagsStatsMap;\n loading: boolean;\n error: boolean;\n errorData?: ProblemDetailsError;\n}\n\ninterface ListTagsAction extends Action {\n tags: string[];\n stats: TagsStatsMap;\n}\n\ninterface ListTagsFailedAction extends Action {\n errorData?: ProblemDetailsError;\n}\n\ninterface FilterTagsAction extends Action {\n searchTerm: string;\n}\n\ntype ListTagsCombinedAction = ListTagsAction\n& DeleteTagAction\n& CreateVisitsAction\n& EditTagAction\n& FilterTagsAction\n& ListTagsFailedAction;\n\nconst initialState = {\n tags: [],\n filteredTags: [],\n stats: {},\n loading: false,\n error: false,\n};\n\ntype TagIncrease = [string, number];\n\nconst renameTag = (oldName: string, newName: string) => (tag: string) => tag === oldName ? newName : tag;\nconst rejectTag = (tags: string[], tagToReject: string) => reject((tag) => tag === tagToReject, tags);\nconst increaseVisitsForTags = (tags: TagIncrease[], stats: TagsStatsMap) => tags.reduce((stats, [ tag, increase ]) => {\n if (!stats[tag]) {\n return stats;\n }\n\n const tagStats = stats[tag];\n\n tagStats.visitsCount = tagStats.visitsCount + increase;\n stats[tag] = tagStats;\n\n return stats;\n}, { ...stats });\nconst calculateVisitsPerTag = (createdVisits: CreateVisit[]): TagIncrease[] => Object.entries(\n createdVisits.reduce((acc, { shortUrl }) => {\n shortUrl?.tags.forEach((tag) => {\n acc[tag] = (acc[tag] || 0) + 1;\n });\n\n return acc;\n }, {}),\n);\n\nexport default buildReducer({\n [LIST_TAGS_START]: () => ({ ...initialState, loading: true }),\n [LIST_TAGS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }),\n [LIST_TAGS]: (_, { tags, stats }) => ({ ...initialState, stats, tags, filteredTags: tags }),\n [TAG_DELETED]: (state, { tag }) => ({\n ...state,\n tags: rejectTag(state.tags, tag),\n filteredTags: rejectTag(state.filteredTags, tag),\n }),\n [TAG_EDITED]: (state, { oldName, newName }) => ({\n ...state,\n tags: state.tags.map(renameTag(oldName, newName)).sort(),\n filteredTags: state.filteredTags.map(renameTag(oldName, newName)).sort(),\n }),\n [FILTER_TAGS]: (state, { searchTerm }) => ({\n ...state,\n filteredTags: state.tags.filter((tag) => tag.toLowerCase().match(searchTerm)),\n }),\n [CREATE_VISITS]: (state, { createdVisits }) => ({\n ...state,\n stats: increaseVisitsForTags(calculateVisitsPerTag(createdVisits), state.stats),\n }),\n}, initialState);\n\nexport const listTags = (buildShlinkApiClient: ShlinkApiClientBuilder, force = true) => () => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n const { tagsList } = getState();\n\n if (!force && (tagsList.loading || !isEmpty(tagsList.tags))) {\n return;\n }\n\n dispatch({ type: LIST_TAGS_START });\n\n try {\n const { listTags } = buildShlinkApiClient(getState);\n const { tags, stats = [] }: ShlinkTags = await listTags();\n const processedStats = stats.reduce((acc, { tag, shortUrlsCount, visitsCount }) => {\n acc[tag] = { shortUrlsCount, visitsCount };\n\n return acc;\n }, {});\n\n dispatch({ tags, stats: processedStats, type: LIST_TAGS });\n } catch (e) {\n dispatch({ type: LIST_TAGS_ERROR, errorData: parseApiError(e) });\n }\n};\n\nexport const filterTags = (searchTerm: string): FilterTagsAction => ({ type: FILTER_TAGS, searchTerm });\n","import Bottle, { IContainer } from 'bottlejs';\nimport TagsSelector from '../helpers/TagsSelector';\nimport TagCard from '../TagCard';\nimport DeleteTagConfirmModal from '../helpers/DeleteTagConfirmModal';\nimport EditTagModal from '../helpers/EditTagModal';\nimport TagsList from '../TagsList';\nimport { filterTags, listTags } from '../reducers/tagsList';\nimport { deleteTag, tagDeleted } from '../reducers/tagDelete';\nimport { editTag, tagEdited } from '../reducers/tagEdit';\nimport { ConnectDecorator } from '../../container/types';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator) => {\n // Components\n bottle.serviceFactory('TagsSelector', TagsSelector, 'ColorGenerator');\n bottle.decorator('TagsSelector', connect([ 'tagsList' ], [ 'listTags' ]));\n\n bottle.serviceFactory(\n 'TagCard',\n TagCard,\n 'DeleteTagConfirmModal',\n 'EditTagModal',\n 'ForServerVersion',\n 'ColorGenerator',\n );\n\n bottle.serviceFactory('DeleteTagConfirmModal', () => DeleteTagConfirmModal);\n bottle.decorator('DeleteTagConfirmModal', connect([ 'tagDelete' ], [ 'deleteTag', 'tagDeleted' ]));\n\n bottle.serviceFactory('EditTagModal', EditTagModal, 'ColorGenerator');\n bottle.decorator('EditTagModal', connect([ 'tagEdit' ], [ 'editTag', 'tagEdited' ]));\n\n bottle.serviceFactory('TagsList', TagsList, 'TagCard');\n bottle.decorator('TagsList', connect(\n [ 'tagsList', 'selectedServer', 'mercureInfo' ],\n [ 'forceListTags', 'filterTags', 'createNewVisits', 'loadMercureInfo' ],\n ));\n\n // Actions\n const listTagsActionFactory = (force: boolean) =>\n ({ buildShlinkApiClient }: IContainer) => listTags(buildShlinkApiClient, force);\n\n bottle.factory('listTags', listTagsActionFactory(false));\n bottle.factory('forceListTags', listTagsActionFactory(true));\n bottle.serviceFactory('filterTags', () => filterTags);\n bottle.serviceFactory('tagDeleted', () => tagDeleted);\n bottle.serviceFactory('tagEdited', () => tagEdited);\n\n bottle.serviceFactory('deleteTag', deleteTag, 'buildShlinkApiClient');\n bottle.serviceFactory('editTag', editTag, 'buildShlinkApiClient', 'ColorGenerator');\n};\n\nexport default provideServices;\n","import { Action, Dispatch } from 'redux';\nimport { ShlinkMercureInfo } from '../../api/types';\nimport { GetState } from '../../container/types';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\n\n/* eslint-disable padding-line-between-statements */\nexport const GET_MERCURE_INFO_START = 'shlink/mercure/GET_MERCURE_INFO_START';\nexport const GET_MERCURE_INFO_ERROR = 'shlink/mercure/GET_MERCURE_INFO_ERROR';\nexport const GET_MERCURE_INFO = 'shlink/mercure/GET_MERCURE_INFO';\n/* eslint-enable padding-line-between-statements */\n\nexport interface MercureInfo {\n token?: string;\n mercureHubUrl?: string;\n interval?: number;\n loading: boolean;\n error: boolean;\n}\n\nexport type GetMercureInfoAction = Action & ShlinkMercureInfo & { interval?: number };\n\nconst initialState: MercureInfo = {\n loading: true,\n error: false,\n};\n\nexport default buildReducer({\n [GET_MERCURE_INFO_START]: (state) => ({ ...state, loading: true, error: false }),\n [GET_MERCURE_INFO_ERROR]: (state) => ({ ...state, loading: false, error: true }),\n [GET_MERCURE_INFO]: (_, action) => ({ ...action, loading: false, error: false }),\n}, initialState);\n\nexport const loadMercureInfo = (buildShlinkApiClient: ShlinkApiClientBuilder) =>\n () => async (dispatch: Dispatch, getState: GetState) => {\n dispatch({ type: GET_MERCURE_INFO_START });\n\n const { settings } = getState();\n const { mercureInfo } = buildShlinkApiClient(getState);\n\n if (!settings.realTimeUpdates.enabled) {\n dispatch({ type: GET_MERCURE_INFO_ERROR });\n\n return;\n }\n\n try {\n const info = await mercureInfo();\n\n dispatch({ type: GET_MERCURE_INFO, interval: settings.realTimeUpdates.interval, ...info });\n } catch (e) {\n dispatch({ type: GET_MERCURE_INFO_ERROR });\n }\n };\n","import Bottle from 'bottlejs';\nimport { loadMercureInfo } from '../reducers/mercureInfo';\n\nconst provideServices = (bottle: Bottle) => {\n // Actions\n bottle.serviceFactory('loadMercureInfo', loadMercureInfo, 'buildShlinkApiClient');\n};\n\nexport default provideServices;\n","import { FormGroup, Input } from 'reactstrap';\nimport classNames from 'classnames';\nimport ToggleSwitch from '../utils/ToggleSwitch';\nimport { SimpleCard } from '../utils/SimpleCard';\nimport { Settings } from './reducers/settings';\n\ninterface RealTimeUpdatesProps {\n settings: Settings;\n toggleRealTimeUpdates: (enabled: boolean) => void;\n setRealTimeUpdatesInterval: (interval: number) => void;\n}\n\nconst intervalValue = (interval?: number) => !interval ? '' : `${interval}`;\n\nconst RealTimeUpdates = (\n { settings: { realTimeUpdates }, toggleRealTimeUpdates, setRealTimeUpdatesInterval }: RealTimeUpdatesProps,\n) => (\n \n \n \n Enable or disable real-time updates, when using Shlink v2.2.0 or newer.\n \n Real-time updates are currently being {realTimeUpdates.enabled ? 'processed' : 'ignored'}.\n \n \n \n \n \n setRealTimeUpdatesInterval(Number(e.target.value))}\n />\n {realTimeUpdates.enabled && (\n \n {realTimeUpdates.interval !== undefined && realTimeUpdates.interval > 0 && (\n \n Updates will be reflected in the UI every {realTimeUpdates.interval} minute{realTimeUpdates.interval > 1 && 's'}.\n \n )}\n {!realTimeUpdates.interval && 'Updates will be reflected in the UI as soon as they happen.'}\n \n )}\n \n \n);\n\nexport default RealTimeUpdates;\n","import { FC, ReactNode } from 'react';\nimport { Row } from 'reactstrap';\nimport NoMenuLayout from '../common/NoMenuLayout';\n\nconst SettingsSections: FC<{ items: ReactNode[][] }> = ({ items }) => (\n <>\n {items.map((child, index) => (\n \n {child.map((subChild, subIndex) => (\n
\n {subChild}\n
\n ))}\n
\n ))}\n \n);\n\nconst Settings = (RealTimeUpdates: FC, ShortUrlCreation: FC, UserInterface: FC, Visits: FC) => () => (\n \n , ], // eslint-disable-line react/jsx-key\n [ , ], // eslint-disable-line react/jsx-key\n ]}\n />\n \n);\n\nexport default Settings;\n","import { Action } from 'redux';\nimport { dissoc, mergeDeepRight } from 'ramda';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { RecursivePartial } from '../../utils/utils';\nimport { Theme } from '../../utils/theme';\nimport { DateInterval } from '../../utils/dates/types';\n\nexport const SET_SETTINGS = 'shlink/realTimeUpdates/SET_SETTINGS';\n\n/**\n * Important! When adding new props in the main Settings interface or any of the nested props, they have to be set as\n * optional, as old instances of the app will load partial objects from local storage until it is saved again.\n */\n\ninterface RealTimeUpdatesSettings {\n enabled: boolean;\n interval?: number;\n}\n\nexport interface ShortUrlCreationSettings {\n validateUrls: boolean;\n}\n\nexport interface UiSettings {\n theme: Theme;\n}\n\nexport interface VisitsSettings {\n defaultInterval: DateInterval;\n}\n\nexport interface Settings {\n realTimeUpdates: RealTimeUpdatesSettings;\n shortUrlCreation?: ShortUrlCreationSettings;\n ui?: UiSettings;\n visits?: VisitsSettings;\n}\n\nconst initialState: Settings = {\n realTimeUpdates: {\n enabled: true,\n },\n shortUrlCreation: {\n validateUrls: false,\n },\n ui: {\n theme: 'light',\n },\n visits: {\n defaultInterval: 'last30Days',\n },\n};\n\ntype SettingsAction = Action & Settings;\n\ntype PartialSettingsAction = Action & RecursivePartial;\n\nexport default buildReducer({\n [SET_SETTINGS]: (state, action) => mergeDeepRight(state, dissoc('type', action)),\n}, initialState);\n\nexport const toggleRealTimeUpdates = (enabled: boolean): PartialSettingsAction => ({\n type: SET_SETTINGS,\n realTimeUpdates: { enabled },\n});\n\nexport const setRealTimeUpdatesInterval = (interval: number): PartialSettingsAction => ({\n type: SET_SETTINGS,\n realTimeUpdates: { interval },\n});\n\nexport const setShortUrlCreationSettings = (settings: ShortUrlCreationSettings): PartialSettingsAction => ({\n type: SET_SETTINGS,\n shortUrlCreation: settings,\n});\n\nexport const setUiSettings = (settings: UiSettings): PartialSettingsAction => ({\n type: SET_SETTINGS,\n ui: settings,\n});\n\nexport const setVisitsSettings = (settings: VisitsSettings): PartialSettingsAction => ({\n type: SET_SETTINGS,\n visits: settings,\n});\n","import { FC } from 'react';\nimport { FormGroup } from 'reactstrap';\nimport { SimpleCard } from '../utils/SimpleCard';\nimport ToggleSwitch from '../utils/ToggleSwitch';\nimport { Settings, ShortUrlCreationSettings } from './reducers/settings';\n\ninterface ShortUrlCreationProps {\n settings: Settings;\n setShortUrlCreationSettings: (settings: ShortUrlCreationSettings) => void;\n}\n\nexport const ShortUrlCreation: FC = (\n { settings: { shortUrlCreation }, setShortUrlCreationSettings },\n) => (\n \n \n setShortUrlCreationSettings({ validateUrls })}\n >\n By default, request validation on long URLs when creating new short URLs.\n \n The initial state of the Validate URL checkbox will\n be {shortUrlCreation?.validateUrls ? 'checked' : 'unchecked'}.\n \n \n \n \n);\n","import { FC } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSun, faMoon } from '@fortawesome/free-solid-svg-icons';\nimport { SimpleCard } from '../utils/SimpleCard';\nimport ToggleSwitch from '../utils/ToggleSwitch';\nimport { changeThemeInMarkup, Theme } from '../utils/theme';\nimport { Settings, UiSettings } from './reducers/settings';\nimport './UserInterface.scss';\n\ninterface UserInterfaceProps {\n settings: Settings;\n setUiSettings: (settings: UiSettings) => void;\n}\n\nexport const UserInterface: FC = ({ settings: { ui }, setUiSettings }) => (\n \n \n {\n const theme: Theme = useDarkTheme ? 'dark' : 'light';\n\n setUiSettings({ theme });\n changeThemeInMarkup(theme);\n }}\n >\n Use dark theme.\n \n \n);\n","import { FC } from 'react';\nimport { DropdownBtn } from '../DropdownBtn';\nimport { rangeOrIntervalToString } from './types';\nimport { DateIntervalDropdownItems, DateIntervalDropdownProps } from './DateIntervalDropdownItems';\n\nexport const DateIntervalSelector: FC = ({ onChange, active }) => (\n \n \n \n);\n","import { FormGroup } from 'reactstrap';\nimport { FC } from 'react';\nimport { SimpleCard } from '../utils/SimpleCard';\nimport { DateIntervalSelector } from '../utils/dates/DateIntervalSelector';\nimport { Settings, VisitsSettings } from './reducers/settings';\n\ninterface VisitsProps {\n settings: Settings;\n setVisitsSettings: (settings: VisitsSettings) => void;\n}\n\nexport const Visits: FC = ({ settings, setVisitsSettings }) => (\n \n \n \n setVisitsSettings({ defaultInterval })}\n />\n \n \n);\n","import Bottle from 'bottlejs';\nimport RealTimeUpdates from '../RealTimeUpdates';\nimport Settings from '../Settings';\nimport {\n setRealTimeUpdatesInterval,\n setShortUrlCreationSettings,\n setUiSettings,\n setVisitsSettings,\n toggleRealTimeUpdates,\n} from '../reducers/settings';\nimport { ConnectDecorator } from '../../container/types';\nimport { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer';\nimport { ShortUrlCreation } from '../ShortUrlCreation';\nimport { UserInterface } from '../UserInterface';\nimport { Visits } from '../Visits';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator) => {\n // Components\n bottle.serviceFactory('Settings', Settings, 'RealTimeUpdates', 'ShortUrlCreation', 'UserInterface', 'Visits');\n bottle.decorator('Settings', withoutSelectedServer);\n bottle.decorator('Settings', connect(null, [ 'resetSelectedServer' ]));\n\n bottle.serviceFactory('RealTimeUpdates', () => RealTimeUpdates);\n bottle.decorator(\n 'RealTimeUpdates',\n connect([ 'settings' ], [ 'toggleRealTimeUpdates', 'setRealTimeUpdatesInterval' ]),\n );\n\n bottle.serviceFactory('ShortUrlCreation', () => ShortUrlCreation);\n bottle.decorator('ShortUrlCreation', connect([ 'settings' ], [ 'setShortUrlCreationSettings' ]));\n\n bottle.serviceFactory('UserInterface', () => UserInterface);\n bottle.decorator('UserInterface', connect([ 'settings' ], [ 'setUiSettings' ]));\n\n bottle.serviceFactory('Visits', () => Visits);\n bottle.decorator('Visits', connect([ 'settings' ], [ 'setVisitsSettings' ]));\n\n // Actions\n bottle.serviceFactory('toggleRealTimeUpdates', () => toggleRealTimeUpdates);\n bottle.serviceFactory('setRealTimeUpdatesInterval', () => setRealTimeUpdatesInterval);\n bottle.serviceFactory('setShortUrlCreationSettings', () => setShortUrlCreationSettings);\n bottle.serviceFactory('setUiSettings', () => setUiSettings);\n bottle.serviceFactory('setVisitsSettings', () => setVisitsSettings);\n};\n\nexport default provideServices;\n","import { Action, Dispatch } from 'redux';\nimport { ShlinkDomain } from '../../api/types';\nimport { buildReducer } from '../../utils/helpers/redux';\nimport { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';\nimport { GetState } from '../../container/types';\n\n/* eslint-disable padding-line-between-statements */\nexport const LIST_DOMAINS_START = 'shlink/domainsList/LIST_DOMAINS_START';\nexport const LIST_DOMAINS_ERROR = 'shlink/domainsList/LIST_DOMAINS_ERROR';\nexport const LIST_DOMAINS = 'shlink/domainsList/LIST_DOMAINS';\n/* eslint-enable padding-line-between-statements */\n\nexport interface DomainsList {\n domains: ShlinkDomain[];\n loading: boolean;\n error: boolean;\n}\n\nexport interface ListDomainsAction extends Action {\n domains: ShlinkDomain[];\n}\n\nconst initialState: DomainsList = {\n domains: [],\n loading: false,\n error: false,\n};\n\nexport default buildReducer({\n [LIST_DOMAINS_START]: () => ({ ...initialState, loading: true }),\n [LIST_DOMAINS_ERROR]: () => ({ ...initialState, error: true }),\n [LIST_DOMAINS]: (_, { domains }) => ({ ...initialState, domains }),\n}, initialState);\n\nexport const listDomains = (buildShlinkApiClient: ShlinkApiClientBuilder) => () => async (\n dispatch: Dispatch,\n getState: GetState,\n) => {\n dispatch({ type: LIST_DOMAINS_START });\n const { listDomains } = buildShlinkApiClient(getState);\n\n try {\n const domains = await listDomains();\n\n dispatch({ type: LIST_DOMAINS, domains });\n } catch (e) {\n dispatch({ type: LIST_DOMAINS_ERROR });\n }\n};\n","import { useEffect } from 'react';\nimport { Button, DropdownItem, Input, InputGroup, InputGroupAddon, UncontrolledTooltip } from 'reactstrap';\nimport { InputProps } from 'reactstrap/lib/Input';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faUndo } from '@fortawesome/free-solid-svg-icons';\nimport { isEmpty, pipe } from 'ramda';\nimport { DropdownBtn } from '../utils/DropdownBtn';\nimport { useToggle } from '../utils/helpers/hooks';\nimport { DomainsList } from './reducers/domainsList';\nimport './DomainSelector.scss';\n\nexport interface DomainSelectorProps extends Omit {\n value?: string;\n onChange: (domain: string) => void;\n}\n\ninterface DomainSelectorConnectProps extends DomainSelectorProps {\n listDomains: Function;\n domainsList: DomainsList;\n}\n\nexport const DomainSelector = ({ listDomains, value, domainsList, onChange }: DomainSelectorConnectProps) => {\n const [ inputDisplayed,, showInput, hideInput ] = useToggle();\n const { domains } = domainsList;\n const valueIsEmpty = isEmpty(value);\n const unselectDomain = () => onChange('');\n\n useEffect(() => {\n listDomains();\n }, []);\n\n return inputDisplayed ? (\n \n onChange(e.target.value)}\n />\n \n \n \n \n \n Existing domains\n \n \n \n ) : (\n \n {domains.map(({ domain, isDefault }) => (\n onChange(domain)}\n >\n {domain}\n {isDefault && default}\n
\n ))}\n \n \n New domain\n \n \n );\n};\n","import Bottle from 'bottlejs';\nimport { ConnectDecorator } from '../../container/types';\nimport { listDomains } from '../reducers/domainsList';\nimport { DomainSelector } from '../DomainSelector';\n\nconst provideServices = (bottle: Bottle, connect: ConnectDecorator) => {\n // Components\n bottle.serviceFactory('DomainSelector', () => DomainSelector);\n bottle.decorator('DomainSelector', connect([ 'domainsList' ], [ 'listDomains' ]));\n\n // Actions\n bottle.serviceFactory('listDomains', listDomains, 'buildShlinkApiClient');\n};\n\nexport default provideServices;\n","import Bottle, { IContainer } from 'bottlejs';\nimport { withRouter } from 'react-router-dom';\nimport { connect as reduxConnect } from 'react-redux';\nimport { pick } from 'ramda';\nimport App from '../App';\nimport provideApiServices from '../api/services/provideServices';\nimport provideCommonServices from '../common/services/provideServices';\nimport provideShortUrlsServices from '../short-urls/services/provideServices';\nimport provideServersServices from '../servers/services/provideServices';\nimport provideVisitsServices from '../visits/services/provideServices';\nimport provideTagsServices from '../tags/services/provideServices';\nimport provideUtilsServices from '../utils/services/provideServices';\nimport provideMercureServices from '../mercure/services/provideServices';\nimport provideSettingsServices from '../settings/services/provideServices';\nimport provideDomainsServices from '../domains/services/provideServices';\nimport { ConnectDecorator } from './types';\n\ntype LazyActionMap = Record;\n\nconst bottle = new Bottle();\nconst { container } = bottle;\n\nconst lazyService = (container: IContainer, serviceName: string) =>\n (...args: any[]) => (container[serviceName] as T)(...args) as K;\nconst mapActionService = (map: LazyActionMap, actionName: string): LazyActionMap => ({\n ...map,\n // Wrap actual action service in a function so that it is lazily created the first time it is called\n [actionName]: lazyService(container, actionName),\n});\nconst connect: ConnectDecorator = (propsFromState: string[] | null, actionServiceNames: string[] = []) =>\n reduxConnect(\n propsFromState ? pick(propsFromState) : null,\n actionServiceNames.reduce(mapActionService, {}),\n );\n\nbottle.serviceFactory(\n 'App',\n App,\n 'MainHeader',\n 'Home',\n 'MenuLayout',\n 'CreateServer',\n 'EditServer',\n 'Settings',\n 'ShlinkVersionsContainer',\n);\nbottle.decorator('App', connect([ 'servers', 'settings' ], [ 'fetchServers' ]));\n\nprovideCommonServices(bottle, connect, withRouter);\nprovideApiServices(bottle);\nprovideShortUrlsServices(bottle, connect);\nprovideServersServices(bottle, connect, withRouter);\nprovideTagsServices(bottle, connect);\nprovideVisitsServices(bottle, connect);\nprovideUtilsServices(bottle);\nprovideMercureServices(bottle);\nprovideSettingsServices(bottle, connect);\nprovideDomainsServices(bottle, connect);\n\nexport default container;\n","import { combineReducers } from 'redux';\nimport serversReducer from '../servers/reducers/servers';\nimport selectedServerReducer from '../servers/reducers/selectedServer';\nimport shortUrlsListReducer from '../short-urls/reducers/shortUrlsList';\nimport shortUrlsListParamsReducer from '../short-urls/reducers/shortUrlsListParams';\nimport shortUrlCreationReducer from '../short-urls/reducers/shortUrlCreation';\nimport shortUrlDeletionReducer from '../short-urls/reducers/shortUrlDeletion';\nimport shortUrlEditionReducer from '../short-urls/reducers/shortUrlEdition';\nimport shortUrlVisitsReducer from '../visits/reducers/shortUrlVisits';\nimport tagVisitsReducer from '../visits/reducers/tagVisits';\nimport orphanVisitsReducer from '../visits/reducers/orphanVisits';\nimport shortUrlDetailReducer from '../short-urls/reducers/shortUrlDetail';\nimport tagsListReducer from '../tags/reducers/tagsList';\nimport tagDeleteReducer from '../tags/reducers/tagDelete';\nimport tagEditReducer from '../tags/reducers/tagEdit';\nimport mercureInfoReducer from '../mercure/reducers/mercureInfo';\nimport settingsReducer from '../settings/reducers/settings';\nimport domainsListReducer from '../domains/reducers/domainsList';\nimport visitsOverviewReducer from '../visits/reducers/visitsOverview';\nimport { ShlinkState } from '../container/types';\n\nexport default combineReducers({\n servers: serversReducer,\n selectedServer: selectedServerReducer,\n shortUrlsList: shortUrlsListReducer,\n shortUrlsListParams: shortUrlsListParamsReducer,\n shortUrlCreationResult: shortUrlCreationReducer,\n shortUrlDeletion: shortUrlDeletionReducer,\n shortUrlEdition: shortUrlEditionReducer,\n shortUrlVisits: shortUrlVisitsReducer,\n tagVisits: tagVisitsReducer,\n orphanVisits: orphanVisitsReducer,\n shortUrlDetail: shortUrlDetailReducer,\n tagsList: tagsListReducer,\n tagDelete: tagDeleteReducer,\n tagEdit: tagEditReducer,\n mercureInfo: mercureInfoReducer,\n settings: settingsReducer,\n domainsList: domainsListReducer,\n visitsOverview: visitsOverviewReducer,\n});\n","import ReduxThunk from 'redux-thunk';\nimport { applyMiddleware, compose, createStore } from 'redux';\nimport { save, load, RLSOptions } from 'redux-localstorage-simple';\nimport reducers from '../reducers';\n\nconst isProduction = process.env.NODE_ENV !== 'production';\nconst composeEnhancers: Function = !isProduction && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n\nconst localStorageConfig: RLSOptions = {\n states: [ 'settings', 'servers' ],\n namespace: 'shlink',\n namespaceSeparator: '.',\n debounce: 300,\n};\n\nconst store = createStore(reducers, load(localStorageConfig), composeEnhancers(\n applyMiddleware(save(localStorageConfig), ReduxThunk),\n));\n\nexport default store;\n","import L from 'leaflet';\nimport marker2x from 'leaflet/dist/images/marker-icon-2x.png';\nimport marker from 'leaflet/dist/images/marker-icon.png';\nimport markerShadow from 'leaflet/dist/images/marker-shadow.png';\n\nexport const fixLeafletIcons = () => {\n delete (L.Icon.Default.prototype as any)._getIconUrl;\n\n L.Icon.Default.mergeOptions({\n iconRetinaUrl: marker2x,\n iconUrl: marker,\n shadowUrl: markerShadow,\n });\n};\n","import { render } from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { BrowserRouter } from 'react-router-dom';\nimport { homepage } from '../package.json';\nimport container from './container';\nimport store from './container/store';\nimport { fixLeafletIcons } from './utils/helpers/leaflet';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport 'leaflet/dist/leaflet.css';\nimport './index.scss';\n\n// This overwrites icons used for leaflet maps, fixing some issues caused by webpack while processing the CSS\nfixLeafletIcons();\n\nconst { App, ScrollToTop, ErrorHandler } = container;\n\nrender(\n \n \n \n \n \n \n \n \n ,\n document.getElementById('root'),\n);\n","import { FC, useEffect } from 'react';\n\ninterface WithoutSelectedServerProps {\n resetSelectedServer: Function;\n}\n\nexport function withoutSelectedServer(WrappedComponent: FC) {\n return (props: WithoutSelectedServerProps & T) => {\n useEffect(() => {\n props.resetSelectedServer();\n }, []);\n\n return ;\n };\n}\n"],"sourceRoot":""}