{"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","style","background","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","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,U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GAAQC,IAEhB2rC,U,6BCtCAkB,gBAA6B,CAC1C7wC,QAAS8wC,GACT9xC,eAAgB+xC,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,GACT5/B,YAAa6/B,GACbtiC,SAAUuiC,GACV/C,YAAagD,GACbpiB,eAAgBqiB,KCjCZC,GAA+C5tC,OAAe6tC,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,ICGPzkC,GAAmC0gC,GAAnC1gC,IAAKzK,GAA8BmrC,GAA9BnrC,YAAaQ,GAAiB2qC,GAAjB3qC,aAE1BmG,iBACE,cAAC,IAAD,CAAUqnC,MAAOA,GAAjB,SACE,cAAC,IAAD,CAAemB,SAAUtkB,IAAzB,SACE,cAACrqB,GAAD,UACE,cAACR,GAAD,UACE,cAAC,GAAD,YAKR1C,SAAS8xC,eAAe,U,2FCpBnB,SAAShvC,EAA8BhG,GAC5C,OAAO,SAACE,GAKN,OAJAI,qBAAU,WACRJ,EAAM0vB,wBACL,IAEI,cAAC5vB,EAAD,eAAsBE,Q","file":"static/js/main.00922bf8.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

Edited twelve times!

\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":""}