{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./public/partials/child/tabs/planning.html","webpack:///./src/FortyTwoFramework.ts","webpack:///./src/00.ft.app.js","webpack:///./src/01.ft.app.definitions.js","webpack:///./src/02.ft.app.models.js","webpack:///./src/template.js","webpack:///./src/dashboard.js","webpack:///./src/ft.app.loading-bar.js","webpack:///./src/component/avatar/template.html","webpack:///./src/component/child-label/template.html","webpack:///./src/component/group-switcher/template.html","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/component/notifications/template.html","webpack:///./src/directives/lightbox.js","webpack:///external \"angular\"","webpack:///./src/filters/trust.js","webpack:///./src/filters/urlencode.js","webpack:///./src/providers/app.js","webpack:///./src/services/app.js","webpack:///./src/controllers/conversation.modal.js","webpack:///./src/controllers/presence.detail.modal.js","webpack:///./src/controllers/login.js","webpack:///./src/environment.ts","webpack:///./src/network-utils.ts","webpack:///./src/update.ts","webpack:///./src/03.ft.app.module.js","webpack:///./src/definitions.ts","webpack:///./src/component/avatar/avatar.ts","webpack:///./src/HelperClasses.ts","webpack:///./src/component/child-label/child-label.ts","webpack:///./src/role-checker.ts","webpack:///./src/component/group-switcher/group-switcher.ts","webpack:///./src/component/notifications/notifications.ts","webpack:///./src/directives/checkbox.ts","webpack:///./src/directives/dropzone.ts","webpack:///./src/directives/filechange.ts","webpack:///./src/stories/types.ts","webpack:///./src/services/http-error.ts","webpack:///./src/services/feature-service.ts","webpack:///./src/services/app-data-service.ts","webpack:///./src/services/application-insights-service.ts","webpack:///./src/controllers/childDetailActions/AbsentModalController.ts","webpack:///./src/controllers/childDetailActions/IncidentalModalController.ts","webpack:///./src/controllers/childDetailActions/MoveModalController.js","webpack:///./src/controllers/childDetailActions/SickModalController.ts","webpack:///./src/controllers/childDetailActions/StudydayModalController.ts","webpack:///./src/controllers/childDetailActions/SwapModalController.js","webpack:///./src/controllers/childDetailActions/BeforeContractModalController.ts","webpack:///./src/urlHelper.ts","webpack:///./src/controllers/albums.ts","webpack:///./src/controllers/app.ts","webpack:///./src/controllers/app.content.ts","webpack:///./src/controllers/app.initialize.ts","webpack:///./src/enums.ts","webpack:///./src/controllers/calendar.overview.ts","webpack:///./src/child-factory.ts","webpack:///./src/controllers/child.detail.ts","webpack:///./src/controllers/child.documents.ts","webpack:///./src/controllers/child.planning.ts","webpack:///./src/controllers/diary.modal.ts","webpack:///./src/controllers/diary.overview.ts","webpack:///./src/controllers/externallogin.ts","webpack:///./src/controllers/group.media.ts","webpack:///./src/controllers/group.list.ts","webpack:///./src/controllers/media.album.overview.ts","webpack:///./src/models.ts","webpack:///./src/controllers/media.modal.ts","webpack:///./src/controllers/messages.ts","webpack:///./src/controllers/presence.child.modal.ts","webpack:///./src/controllers/presence.unexpected-child.modal.ts","webpack:///./src/controllers/presence.overview.ts","webpack:///./src/controllers/requests.ts","webpack:///./src/controllers/requests.modal.ts","webpack:///./src/controllers/emergency.list.ts","webpack:///./src/controllers/parent.modal.ts","webpack:///./src/dictionary.ts","webpack:///./src/travel-planner/get-child-status.ts","webpack:///./src/travel-planner/rides-view-model.ts","webpack:///./src/controllers/travel-planner.ts","webpack:///./src/controllers/travel-planner.edit-ride.ts","webpack:///./src/controllers/travel-planner.child-picker.ts","webpack:///./src/controllers/activity.planner.ts","webpack:///./src/controllers/activity.planner.select-activity.ts","webpack:///./src/controllers/activity.planner.edit-activity.ts","webpack:///./src/controllers/avatar-upload.ts","webpack:///./src/controllers/locationmanager.albums.ts","webpack:///./src/controllers/locationmanager.albums.modal.ts","webpack:///./src/controllers/locationmanager.conversation.ts","webpack:///./src/controllers/locationmanager.conversation.modal.ts","webpack:///./src/stories/stories.ts","webpack:///./src/resize-image.ts","webpack:///./src/stories/story-details.ts","webpack:///./src/stories/story-new-modal.ts","webpack:///./src/app.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","ft","FortyTwo","ng","angular","defineNamespace","app","planning","days","normal","closed","holiday","states","approved","requested","requestable","rejected","types","absent","vacation","study","incidental","swap","registration","presence","present","sick","other","traded","frameworkModule","framework","frameworkEvents","events","frameworkSettings","settings","frameworkSortingDirections","sorting","directions","frameworkLevels","levels","frameworkNavigationType","navigation","type","componentsModule","components","componentsModels","models","componentsEvents","layoutModule","layout","layoutModels","layoutEvents","layoutSettings","layoutBladeSizes","blade","size","group","selected","dashboard","conversations","fetchRange","mediaAlbums","media","video","image","conversation","parent","list","new","back","appModels","appModule","run","$templateCache","put","$","document","ready","on","event","this","animate","height","trigger","factory","show","controller","$scope","LoadingBar","$watch","newVal","oldVal","map","webpackContext","req","id","webpackContextResolve","e","Error","code","keys","resolve","directive","$timeout","_scope","element","lightGallery","enableTouch","selector","videojs","restrict","link","closest","addClass","find","val","hasClass","removeClass","_element","_attrs","placeholder","customClass","scope","date","dialog","momentFormat","renderAs","defaultDialog","init","moment","ok","cancel","future","add","past","subtract","assign","format","html","replace","mdDateTimePicker","default","unbind","time","$apply","click","filter","$sce","url","trustAsResourceUrl","input","charAt","toUpperCase","substr","toLowerCase","encodeURIComponent","text","split","provider","$get","ftLoginService","service","initializeAppContent","isLoggedInAsync","$rootScope","$uibModalInstance","audiences","childId","DataService","selectedAudiences","forEach","audienceGroup","groupIndex","audienceItem","index","audienceType","checked","selectedAudience","valid","message","title","content","reminderDate","audienceIds","dismiss","toggleSelectionAudiences","allAudiencesSelected","item","toggleSelectAudience","audience","x","isAllAudience","hasAudiencesSelected","selectAudience","allAudience","console","log","checkedAudiencesInType","saveConversation","isLoading","hasValue","hasAllAudience","otherAudiences","expectedAudienceIds","hasAllAudienceTypes","includes","prm","saveConversationAsync","then","handleSaveConversation","handleSaveConversationError","finally","$emit","swal","timer","$translate","instant","formatToDate","close","EnvironmentMode","getTenantFromUrl","match","exec","createBackOfficeApiUrl","tenant","getQueryParam","param","regex","search","location","href","queryParam","queryValue","decodeURIComponent","environments","development","environment","buildnumber","commit","apiUrl","production","NetworkUtils","host","getEnvironment","addEventListener","navigator","serviceWorker","register","setInterval","reload","baseUrl","baseTemplateUrl","baseApiUrl","customer","hubs","messages","getTemplateUrl","urlPart","randomNumber","config","$compileProvider","$stateProvider","$sceDelegateProvider","$translateProvider","ftConfigurationProvider","DEBUG","debugInfoEnabled","commentDirectivesEnabled","cssClassDirectivesEnabled","setBaseApiUrl","setTokenUrl","setRefreshTokenUrl","setCurrentUserUrl","setSplashViewUrl","setLoginViewUrl","configure","appTitle","passwordExpression","connection","checkOnload","checkUrl","notifications","resourceUrlWhitelist","useStaticFilesLoader","prefix","suffix","useSanitizeValueStrategy","preferredLanguage","initializeApp","views","templateUrl","home","groupList","params","previous","pageStyle","fullWidth","groupMedia","activities","childDetail","presenceOverview","reloadOnSearch","diaryOverview","calendarOverview","requestOverview","emergencyList","travelPlanner","activityPlanner","locationManager","stories","storyDetails","state","appEvents","appSettings","appTypes","appHubTypes","appHubMessages","$onInit","initials","getAvatarInitials","$onChanges","changes","currentValue","matches","join","$inject","bindings","AvatarController","template","component","AvatarComponent","Mode","formNullCheck","form","skipProperties","prop","Array","isArray","indexOf","hexToRgba","hex","transparency","bigint","parseInt","contrast","rgb","C","substring","Math","pow","none","onClick","label","backgroundColor","colorCode","Color","foregroundColor","ChildLabelComponent","loginService","$state","$q","settingsService","navigateToRoleStartPage","allowGroupSwitching","switchGroup","checkLogin","getCurrentUserAsync","user","selectedGroup","RoleChecker","groupSwitchingAllowed","go","current","hasGroupRole","hasGroup","hasPlannerRole","hasLocationManager","doLogout","set","undefined","error","logout","currentLocation","allowLogin","reject","roles","hasAdminRole","allowPlannerEditing","some","groups","serviceName","appDataService","ftSettingService","loadingBar","roleCheckerService","navigateToGroups","getGroupsAsync","GroupSwitcherComponent","$interval","ftSettingsService","$http","toaster","timeInSeconds","refresh","fetchNewMessagesAsync","newMessages","pop","body","from","bodyOutputType","showCloseButton","clickHandler","toast","isCloseButton","clear","navigateTo","postId","token","getTokenData","options","headers","transformResponse","appendTransform","defaults","deserialize","groupId","query","since","toISOString","warn","response","status","transform","a","concat","MessageType","NotificationsComponent","$parse","$compile","contains","arr","comparator","postLinkFn","elem","attrs","checklistModel","$set","setter","checklistChange","checklistBeforeChange","checklistValue","$parent","equals","checklistComparator","comparatorExpression","b","setValueInChecklistModel","isFunction","remove","setChecked","newArr","oldArr","ngModel","newValue","oldValue","$watchCollection","priority","terminal","compile","tElement","tAttrs","tagName","btnCheckbox","dropzone","handler","eventHandlers","require","fileChanged","ctrl","onChange","newFileName","files","$setViewValue","$on","off","FileChangeDirective","StoryBlockType","isReadable","Feature","isCardLeftBlock","block","blockType","isCardRightBlock","isImagesBlock","isCardContentBlock","CardLeft","isImagesContentBlock","story","publishOn","storyTemplate","startDate","endDate","ftRequest","applicationInsights","doLoggedInRequest","request","doRequest","loggedIn","requestAsync","handleErrorResponse","HttpError","exceptionMessage","getActivity","activityId","method","path","setActivityToPeriodic","activityPlanningId","repeatUntil","copyAssignedEmployees","setActivityToSeries","addEmployeeToActivity","command","removeEmployeeFromActivity","employeeId","getEmployeesForActivityPlanning","addGroupToActivity","removeGroupFromActivity","getGroupsForActivityPlanning","getActivityChildrenForGroups","groupIds","start","end","stringify","getEmployeesForLocation","locationId","getUser","saveProfileImage","getActivitiesByDates","to","getExistingActivityTypes","saveActivity","deleteActivity","saveTransportRides","getTransportChildren","getTransportRides","getTransportVehicles","getLocations","getTransportLocations","updateParentDetails","updateRequest","birthDate","getParentDetails","parentId","getConfigurationAsync","getGroupsByLocation","reportChildAbsentAsync","reportChildSickAsync","getPossibleIncidentalDays","requestIncidentalDay","remarks","useCreditHours","selectedTimes","getPossibleBeforeContractDays","requestBeforeContractDay","getPossibleSwapDays","fromDate","toDate","requestSwapDay","selectedFromTimes","selectedToTimes","getRequestStudyDays","requestStudyDays","studyDay","planningId","studydayId","getPossibleTransferGroups","requestTransferGroup","getCalendarTimeline","getRequestList","getRequestDetails","registrationId","typeOfRegistration","sendRequestAction","action","getGroupTimelineAsync","startIndex","pageSize","qs","obj","getAudiencesAsync","getMediaForAlbumAsync","albumId","getMediaAlbumsAsync","showAll","addAlbumAsync","description","getAlbumsUntilAsync","dateTime","utc","getAlbumsSinceAsync","getMessagesAsync","getMessagesSinceAsync","getReminderFor","getPost","getDiaryPresence","getDiaryEntryTypes","saveDiaryEntry","childIds","diaryEntryTypeId","diaryScheduleId","tasks","entryText","entryMoment","all","deleteDiaryEntry","diaryEntryId","getDocumentsForChild","getGroupActivitiesAsync","items","createdOn","icon","developmentArea","activityArea","minimalAge","maximumAge","dfd","defer","promise","answerToPostAsync","replyComment","answer","commentId","getAudiences","locations","careTypes","setPasswordAsync","accessKey","password","resetPasswordAsync","userName","oauthLoginAsync","Authorization","changePasswordAsync","originalPassword","newPassword","setLanguageAsync","languageId","getEmergencyList","getChildInfo","getPresenceOverviewData","fetchAllChildren","getPlanning","month","year","savePresence","trackEvent","saveChildInfo","saveMedicalInfo","getAvailableTimes","timesRequest","httpRequest","getChildLabels","getAllChildLabels","addChildLabel","labelId","removeChildLabel","getWriteLocations","saveLocationConversation","caretypes","getStories","getStoryTemplatesForGroup","storyTemplates","createStory","storyTemplateId","updateStory","getStory","storyId","getStoryPdf","saveContentBlock","storyBlockId","getFeatures","lastFetch","diff","features","enabledFeature","catch","isEnabled","feature","instanceId","$location","setup","ApplicationInsightsService","insights","isLoggedIn","authentication","login","properties","exception","getInstrumentationKey","connectionString","enableAutoRouteTracking","autoTrackPageVisitTime","loadAppInsights","trackPageView","telemetryInitializer","tags","Tenant","tenantName","addTelemetryInitializer","senatize","setAuthenticatedUserContext","telemetryInstrumentationKey","formatTime","duration","as","dataService","dateTimeDialog","startTime","endTime","reason","displayDialog","save","canSave","isValid","field","validation","currentDate","minuteSteps","autoOk","disableParentScroll","validate","startOf","validateDate","converted","tillDate","fromTime","tillTime","isAfter","clone","till","isSameOrAfter","timesEditable","availableTimes","firstForm","secondForm","times","Form","windowStartTime","windowEndTime","areTimesEditable","res","availableTimesErrorMsg","currentGroup","errorMsg","ends","endOf","studyDays","selectedStudyDays","promises","selectStudyDay","currentIndex","StudyDay","availableFromTimes","availableToTimes","showDate","validateTimes","collection","fromTimes","toTimes","fromErrorMessage","fromHasRegistrationRuleError","toErrorMessage","toHasRegistrationRuleError","hasValidDate","reset","modalInstance","initializeScope","loadData","isLoadingChanged","next","formIndex","timeSelectionForm","groupAndDateForm","isSaving","selectedDateChanged","newDate","TimeSelectionForm","isUrlAbsolute","RegExp","test","getTenant","hostname","createAbsoluteMediaUrl","mediaServiceUrl","relativeUrl","tenantPart","lastIndexOf","$uibModal","$localStorage","fetchingAlbums","mediaAlbumLimit","albums","openUploadMediaModal","openAlbumModal","showMoreAlbums","createUrl","handleGetAlbums","initialize","intervalHandle","refreshMediaAlbums","getAlbumsAsync","results","album","encodedToken","refreshToken","absoluteUrl","posterUrl","UrlHelper","configuration","services","open","animation","backdrop","keyboard","copy","loadMore","lastFetchDateMedia","lastAlbum","modifiedOn","returnValue","findIndex","$stateParams","$urlRouter","ftConfiguration","$sessionStorage","mdcDefaultParams","ftConnection","lang","cancelText","todayText","okText","offDestroy","offLogin","offStateChangeSuccess","initialized","refreshLoginAsync","startRefreshTokenInterval","getTokenRefreshSpeed","tokenRefreshSpeed","expireDate","Date","expires","setSeconds","getSeconds","now","toUTCString","refreshSpeed","showSplash","handleOnLogin","evt","redirect","handleStateChangeSuccess","currentState","handleOnDestroy","initializeEventHandlers","initializeRoute","navigateToLastState","lastState","sync","hideSplash","getTime","$filter","featureService","offNavigationBack","offAssistentOpen","offAssistentClose","previousState","currentUser","showCurrentUser","hasScroll","page","sidebarToggle","left","right","menuItems","assistent","raiseStateRefresh","$broadcast","sidebarStat","target","initializeEvents","handleNavigationBack","handleAppAssistentOpen","handleAppAssistentClose","handleDestroy","initializeMenu","MenuItem","ref","calendar","requests","travelPlanning","childrenList","TravelPlanner","ActivityPlanner","LocationMessages","Stories","_evt","_toState","_toStateParams","fromState","fromStateParams","setLayoutProperties","PresencesStatus","PresencesAction","Gender","SettingService","eventClicked","eventClickInfo","extendedProps","renderEvent","info","titleElement","el","querySelector","innerHTML","innerText","style","color","createId","timelineType","toEvent","stringStart","stringEnd","childName","classNames","getBackgroundColor","itemType","fetchEvents","fetchInfo","successCallback","failureCallback","prms","selectedGroupId","sort","localeCompare","onSelect","calEvent","jsEvent","view","locale","calenderElement","getElementById","locales","plugins","timeZone","userLanguage","language","defaultView","header","center","displayEventTime","eventClick","eventRender","render","ChildType","gender","toString","GenderLabel","getName","getIcon","Unknown","Male","Female","school","googleApiKey","street","postalCode","city","getFullAddress","getGoogleMapsLink","member","firstName","lastNamePrefix","lastName","profilePicture","phoneNumber","isResponsible","FamilyMember","fullName","presenceType","formatLabel","asMilliseconds","getCssClass","trim","diaryEntryType","quantity","EditMode","Action","child","childType","diaryEvents","presences","expectedTimes","labels","diaries","picture","Child","isExtendedChild","isFromChildInfo","mentor","isFromGroupChild","groupNames","isFromApprovalChild","isFromPresencesChild","medical","hasReminder","setFullName","PresencesChildInfoChild","GroupChildOnLocation","GroupRequestsApprovalChild","PresencesChild","addDiary","diary","diaryType","DiaryType","Diary","addLabel","Label","addEvent","addDiaryEvent","DiaryEvent","getCssClassForGender","cssClassForStatus","isBirthday","hasMedical","hasMedicalInfo","medicalInfo","setMentor","setRemarks","setSchool","ageString","years","months","existing","added","removed","currentLabels","addableLabels","setAll","update","setExisting","removeFrom","every","y","accept","mentors","schools","genders","labelsState","editMode","deleteLabel","fetchData","childInfoTask","canRequestBeforeContract","familyMembers","family","responsible","responsibleParent","emergencyNumber","allSchools","School","allMentors","isInactive","childLabelsTask","allLabelsTask","isEmpty","isMentorActive","avatarUpload","alert","isPersonEditMode","personal","isMedicalEditMode","enterEditMode","medicalInformation","doctorName","doctorPhone","copyChildToMedical","personalInformation","mentorId","schoolId","leaveEditMode","openParentModal","task","addLabelTasks","removeLabelTasks","saveChildInfoTask","copyPersonalToChild","savePersonalInformation","openActionModal","capitalizedAction","studyday","download","tokenData","createElement","setAttribute","display","appendChild","removeChild","documents","$element","startDay","firstMonth","monthToFetch","weeks","day","toBackgroundEvent","toDayEvent","blocks","rendering","createTitle","isAllDay","presenceTypes","root","contentElement","eventTimeFormat","displayEventEnd","isDiary","otherTypes","pickedDate","selectedChildren","mdcDateTimeDialog","childrenIds","milliseconds","saveDiaries","typeId","pickedTime","displayDatePicker","model","removeMode","allChildren","children","diaryEntry","pickedDateWatch","handleGetDiaries","isChecked","diaryEntries","toggleChild","isToday","today","nextDay","previousDay","otherDiaryTypes","openModal","openDiaryModal","isSelected","api","localStorage","doExternalLogin","decodedToken","refreshConfiguration","AppDataService","setCurrentGroup","port","linkToRemove","redirectLink","redirectUri","protocol","handleResponse","videoUrl","createVideoUrl","mediaId","thumbUrl","poster","caption","playVideo","mediaItem","AlbumType","audienceGroups","queuecomplete","canUpload","selectedAudienceGroup","uploadMedia","albumTypeOrId","newAlbumName","newAlbumDescription","showAllAlbums","dropzoneConfig","createDropzoneConfig","startsWith","parallelUploads","timeout","acceptedFiles","addRemoveLinks","autoProcessQueue","success","getQueuedFiles","processQueue","uploadSucceeded","addedfile","addedfiles","removedfile","hasSelectedAudiences","hasFiles","hasSelectedAlbum","lastFetchDate","additionalReminderCount","allConversations","fetchingMessages","messageLimit","messageListView","selectedConversation","getReplyedAs","comment","comments","filters","internalOnly","applyFilters","isInternal","refreshConversations","handleGetMessages","showMoreMessages","addConversationsToList","posts","getData","handleGetAudiences","handleGetReminders","lastConvo","lastUpdatedUTC","post","existingPost","sendNotification","loadPost","postExists","read","markAsRead","answerComment","backToListView","sendMessage","handleSaveAnswerToPost","openNewConversationModal","newPostInterval","$$listeners","bulk","isPresent","Present","pickedStatus","PickedUp","statuses","getAvailableStatussen","Expected","Sick","NotExpected","Absent","showStatusChoices","formatStatusText","setArrivedAt","arrivedAt","validatePickedTime","kid","hasDate","showTime","abs","isMoment","isSuccess","hookScope","toLocaleString","entityType","finalOnly","Definitions","Registration","TimesRequestType","All","forInternal","handleGetAvailableTimes","timeSlots","availableTimeslots","tradableTimeslots","isTradeAble","startOfDay","initializeScreen","loadScopeWatches","updateRedLineInterval","updateRedLine","computeBlockWidth","computeBlockOffset","setFilter","isFilterSelected","shouldDisplayCheckbox","openDetailModal","openChildModal","openPresenceModal","updateBlockHeight","gotoToday","gotoNextDay","gotoPreviousDay","createOrDeleteDiaryEntry","getTickIconClass","updatePresenceOverview","showMassButton","showDiarySchedules","showLabels","firstChildStatusIsPresent","toggledBulkChildren","statusExpectedAmount","statusPresentAmount","statusSickAmount","statusAbsentAmount","statusNotExpectedAmount","timetable","hourStart","hourEnd","timeLabels","childrenCounts","diaryChildrenCounts","diaryTimeLabels","updateStatusCount","computeDurationInHours","asHours","getDurationHours","startHour","endHour","offset","computeBlockOffsetAsNumber","scopeStartHours","eventStartHours","arraysEqual","statusArray","addOrRemove","array","childModalUser","timeOfDay","hours","minutes","timeIndicator","presenceScrollableSection","css","width","linePosition","position","scroll","scrollLeft","handlePresenceData","openingTimes","prettyFormatHour","diaryEvent","count","diaryScheduleHeader","dates","aside","hour","$event","opened","preventDefault","stopPropagation","startMoment","originalDate","registrationType","registrationTypeTranslation","originalTimes","ngTableParams","allRequests","possibleTypes","selectedTypes","tableSorting","total","$defer","orderedData","orderBy","filterByType","refreshTable","showRequestModal","registrations","saving","submitRequest","details","requestDetails","otherChildren","groupCanApprove","parentRemarks","numberOfEmployeesCurrent","numberOfEmployeesRequested","firstLetter","resetSelectedGroup","goToChildDetail","getBirthDate","address","streetNumber","$modalInstance","isEditing","values","setEditMode","cancelEditMode","initializeEditMode","Address","countries","emailAddress","mobileNumber","phoneWork","countryId","containsKey","getOrAdd","existingValue","set2","lastValue","firstValue","at","filterAction","kvp","toDictionary","keySelector","Dictionary","toDictionary2","valueSelector","CapacityMode","isTransportChild","childTimes","childTime","loadScopeFunctions","load","clearSelection","applyFilter","currentLocationId","fetchLocation","filteredTableData","allTableData","isDropOff","onCapacity","toggledRows","isCluster","clusterId","ridesTask","employeesTask","childrenTask","responses","rides","employees","createTableData","tableData","fromLocation","timeSchool","availableChildren","rideId","ride","numberOfChildren","row","userTask","locationsTask","groupsTask","vehiclesTask","vehicles","isReadOnly","toggleRow","toggled","getVehicleColor","vehicleId","getContrastColor","bgColor","editRide","sourceRows","capacityMode","createNewRides","initializeSelectedVehicle","initializeSelectedEmployee","initializeRemarks","selectVehicle","selectEmployee","selectChild","selectChildren","numberOfSelectedChildren","getSelectedEmployee","getSelectedVehicle","getSelectedChildren","getAllChildren","setCapacityMode","generateNewId","isNewId","selectAllChildren","containsExisting","addChild","getMoments","clearChildSelection","ignoreCapacityMode","capacity","getVehicleCapacity","selectedVehicle","selectedPerRide","findRowsForChild","rows","manual","existingRow","vehicle","employee","selectedEmployee","reduce","prev","cur","hasChanges","newSelection","newChildren","removedChildren","errors","getRides","ridesToSave","vm","selectedEmployeeId","onSelectChildrenClicked","moments","onSave","onCancel","selectChildrenClicked","showStatus","getStatus","selectToday","selectPreviousDay","selectNextDay","getActivitiesForDate","activitySelected","onActivitySelected","dateSelected","onDateSelected","generateClassesForDate","loadActivities","setIsLoading","currentRange","dateRange","locationHasKiosk","hasActivityKiosk","activityPlannings","editActivity","activity","distance","min","max","startOfWeek","todayDate","CustomActivityId","onSelectionChanged","getActivitiesForLevel","getAreaName","select","currentActivities","selectedActivities","initializeData","createActivityLevels","parents","currentLevel","nextParents","parentActivityId","activitiesPerLevel","areaTypes","activityAreaTypeId","areaTypeId","resetToHierarchicalState","currentKeys","previousKeys","level","selectionCompleted","otherLevel","previousLevel","nextLevel","lastActivityId","currentLevelActivities","getActivitiy","parentActivity","createCustomActivity","templateActivity","groupSize","getArea","area","selectedActivityId","findActivity","acc","filteredGroups","delete","isNew","selectedGroupTypes","allGroupsTask","activityGroupsTask","activityEmployeesTask","groupsResponse","employeesResponse","activityGroupsResponse","activityEmployeesResponse","availableGroups","availableGroupTypes","groupTypes","createForm","selectedGroups","selectedEmployees","availableEmployees","maximumGroupSize","place","isIntern","periodicOrSeries","enrolledChildren","createCommand","employeeIds","newPlanningId","readFile","reader","FileReader","onload","imageContent","readAsDataURL","file","AvatarUploadModalController","selectedLocations","selectedCareTypes","isAllSelected","toggleAll","isLocationSelected","toggleLocation","isCareTypeSelected","toggleCareType","nextState","careType","showNoAudiences","albumName","albumDescription","hideInternalFilter","unsubscribeOnNewPostMade","_event","toggleSelectAllAudiences","toggleSelectCareType","hasValidTitle","hasValidMessage","isAudienceSelected","initializeForm","caretype","toggleItem","isEqual","selectedAudienceIds","selectedCareTypeNames","$document","previewMode","previewUrl","previewStory","endPreview","selectedText","searchText","openStory","newStoryModal","toBase64","dataUrl","emptyGuid","changed","upload","removeImage","addImage","hasImage","hasImageX","hasImageIndex","hasImageAt","hasImageXAt","getImagesClass","blockChanged","doPublish","doUnpublish","getFormattedDateString","getChanged","blockIsChanged","cancelBlock","saveBlock","goOverview","savePublishOnExt","cancelPublishOn","hasPublishChange","loadStory","checkDirty","sc","currentScope","ch","onRouteChangeOff","onbeforeunload","$onDestroy","setMilliseconds","imageUrl","imageUrls","blockId","endsWith","thisBlock","images","canAddImages","DateValue","publishOnOrg","initializeContentBlocks","orgBlocks","JSON","parse","blobToDataURL","Promise","canvas","ctx","getContext","img","Image","drawImage","ratioX","ratioY","ratio","newWidth","newHeight","toDataURL","src","orgBlock","orgContent","optionalVisible","saveTextBlock","saveImagesBlock","saveCardBlock","savePublishOn","isTextContentBlock","hasNewImage","blob","_e","onerror","onabort","createEmptyContentBlock","copyBlockToContent","updateImagesBlock","onSelected","newStory","pickedStoryTemplate"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK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WAAM,iBCviB1C,EAAUhB,WAAW,4BACjB,CAAC,SAAU,KAAM,oBAAqB,iBAAkB,WAAY,mBAAoB,SACxF,SAAUC,EAAqBiR,EAAenM,EAA0CuiB,EACpFrmB,EAA2BkQ,EAAoCF,GADnE,WAGIvR,KAAK4nB,YAAcA,EACnB5nB,KAAKyR,gBAAkBA,EACvBzR,KAAKO,OAASA,EACdP,KAAKO,OAAO2hC,MAAQ,GACpBliC,KAAKO,OAAOgH,WAAY,EACxBvH,KAAKuR,OAASA,EAEdhR,EAAO4C,OAAS,WACZkC,EAAkBmB,WAWtBjG,EAAOmmD,SAAW,0D,yEAGd,OADMjxC,EAAUzV,KAAKyR,gBAAgB5X,IAAIiB,OAAO2T,YAAYjQ,MAAMC,UAClE,GAAMuB,KAAK4nB,YAAY3C,YAAYjlB,KAAKO,OAAO2hC,MAAMykB,oBAAoB5lD,GAAI0U,GACxEzN,MAAK,SAACqd,GACHhgB,EAAkBqD,MAAM,SACxB,EAAK6I,OAAOY,GAAG,oBAAqB,CAAEpR,GAAIskB,Q,cAHlD,S,YAOJ9jB,GAAS,WAAM,OAlBF,wC,yEAET,OADMkU,EAAUzV,KAAKyR,gBAAgB5X,IAAIiB,OAAO2T,YAAYjQ,MAAMC,UAClE,GAAMuB,KAAK4nB,YAAY7C,0BAA0BtP,GAASzN,MAAK,SAAClB,GAC5D,EAAKvG,OAAOykB,eAAiBle,EAC7B,EAAKvG,OAAOgH,WAAY,M,cAF5B,S,iBCnCZJ,QAAQC,IAAI,gHAqCZ,IAAOkvB,OAAO","file":"main.591ecb396ac13ec653ec.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([281,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","module.exports = \"
\\n\";","import { IModule, IHttpPromise, IRootScopeService, IPromise } from 'angular';\nimport { ChildCare } from '@/data-models';\n\nimport AppConfigurationModel = ChildCare.Definitions.Configuration.AppConfigurationModel;\ntype UserModel = ChildCare.Definitions.Account.UserModel;\n\nwindow.ft = window.FortyTwo;\nwindow.ng = window.angular;\n\nexport interface FTGrouping {\n title: string;\n original: string;\n items: T[];\n}\n\nexport interface FTGroup {\n items: T[];\n count: number;\n checked: boolean;\n partialChecked: boolean;\n}\n\nexport interface AppModule extends IModule {\n getTemplateUrl: (urlPart: string) => string;\n models: any;\n baseUrl: string;\n baseTemplateUrl: string;\n baseApiUrl: string;\n customer: string;\n}\n\nexport interface FortyTwoStatic {\n randomNumber: number;\n layout: any;\n components: any;\n DEBUG: boolean;\n isMobile: boolean;\n app: any;\n models: FortyTwoModels;\n framework: FortyTwoFramework;\n\n log: (level: string, ...args: Array) => void;\n createDelegate: (ctx: any, fnc: any) => Function;\n defineNamespace: (namespace: string) => any;\n defineBindableProperty: (obj: any, prop: any, getter: any, setter?: any) => void;\n dontPropagate: (evt: any) => void;\n getRandom: (min: number, max: number) => number;\n getInterval: (min: number, max: number) => number;\n getQueryParam: (name: string) => string;\n removeQueryParam: (name: string, href: string) => string;\n hasValue: (val: any) => boolean;\n}\n\nexport interface FortyTwoRootScopeService extends IRootScopeService {\n showSplash: boolean;\n configuration: AppConfigurationModel;\n}\n\nexport interface FortyTwoFramework {\n module: IModule;\n}\n\nexport interface FortyTwoFrameworkSettings {\n datetime: any;\n keys: any;\n sorting: any;\n}\n\nexport interface TokenData {\n refreshToken: string;\n token: {\n expires: string;\n value: string;\n };\n}\n\nexport interface FortyTwoLoginService {\n doLogout(): void;\n getCurrentUserAsync(): IPromise;\n isLoggedInAsync(): IPromise;\n getStoredUsername(): string;\n wantsToStayLoggedIn(): boolean;\n hasValidTokenAsync(): IPromise;\n hasRefreshTokenAsync(): IPromise;\n doLoginAsync(username: string, password: string, stayLoggedIn: boolean): IPromise;\n refreshLoginAsync(): IPromise;\n getTokenData(): TokenData;\n}\n\nexport interface FortyTwoModels {\n User: FortyTwoUser;\n Group: (options: any) => FortyTwoGroup;\n}\n\nexport interface FortyTwoUser {\n hasRole: (role: string) => boolean;\n obj: (options: any) => any;\n}\n\nexport interface FortyTwoGroup {\n getCount: () => number;\n}\n\nexport interface FortyTwoRequestService {\n config: any;\n requestAsync: (\n request: FortyTwoRequest,\n useAuthorization?: boolean,\n ignoreContentType?: boolean,\n triggerEvents?: boolean\n ) => IHttpPromise;\n}\n\nexport interface FortyTwoRequest {\n url?: string;\n path: string;\n headers?: any;\n method?: 'POST' | 'GET' | 'PUT' | 'DELETE';\n data?: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/class-name-casing\nexport interface ftSettingsService {\n get(key: string);\n set(key: string, object: any);\n}\n","ft.defineNamespace('FortyTwo.app');\nwindow.app = ft.app;\n\napp.planning = {\n days: {\n normal: 'normal',\n closed: 'closed',\n holiday: 'holiday'\n },\n states: {\n approved: 'approved',\n requested: 'requested',\n requestable: 'requestable',\n rejected: 'rejected'\n },\n types: {\n planning: 'chiPlanning',\n absent: 'chiAfwezig',\n vacation: 'chiVakantieperiode',\n study: 'chiStudiedag',\n incidental: 'chiIncidenteleOpvang',\n swap: 'chiRuildag',\n registration: 'chiRegistration'\n },\n presence: {\n absent: 'absent',\n present: 'present',\n sick: 'sick',\n holiday: 'holiday',\n other: 'other',\n traded: 'traded'\n }\n};\n","window.frameworkModule = ft.framework.module;\nwindow.frameworkEvents = frameworkModule.events;\nwindow.frameworkSettings = frameworkModule.settings;\nwindow.frameworkSortingDirections = frameworkSettings.sorting.directions;\nwindow.frameworkLevels = frameworkModule.levels;\nwindow.frameworkNavigationType = frameworkModule.navigation.type;\n\nwindow.componentsModule = ft.components.module;\nwindow.componentsModels = componentsModule.models;\nwindow.componentsEvents = componentsModule.events;\n\nwindow.layoutModule = ft.layout.module;\nwindow.layoutModels = layoutModule.models;\nwindow.layoutEvents = layoutModule.events;\nwindow.layoutSettings = layoutModule.settings;\nwindow.layoutBladeSizes = layoutSettings.blade.size;\n\nwindow.app.settings = {\n group: {\n selected: 'group-selected',\n dashboard: 'group-dashboard'\n },\n conversations: {\n fetchRange: 10\n },\n mediaAlbums: {\n fetchRange: 6\n }\n};\n\nwindow.app.types = {\n media: {\n video: 'video',\n image: 'image'\n },\n conversation: {\n group: 'conversation-group',\n parent: 'conversation-parent',\n list: 'conversation-list',\n new: 'conversation-new'\n }\n};\n\nwindow.app.navigation = {\n back: 'navigation-back'\n};\n","window.models = ft.models;\nwindow.appModels = ft.defineNamespace('FortyTwo.app.models');\nft.app.module = ng.module('childcare', [\n 'ftComponents',\n 'ftLayout',\n 'luegg.directives',\n 'ngTouch',\n 'ui.bootstrap',\n 'ngSanitize',\n 'ngTable',\n 'infinite-scroll',\n 'ngMaterial',\n 'ngAria',\n 'ngMaterialDatePicker',\n 'toaster',\n 'ngAnimate'\n]);\nwindow.appModule = ft.app.module;\n","appModule.run([\n '$templateCache',\n function($templateCache) {\n 'use strict';\n\n $templateCache.put(\n 'template/chat.html',\n '
'\n );\n\n $templateCache.put(\n 'template/footer.html',\n 'Copyright © 2015 Material Admin'\n );\n\n $templateCache.put(\n 'template/header-image-logo.html',\n '
'\n );\n\n $templateCache.put(\n 'template/header-textual-menu.html',\n '
'\n );\n\n $templateCache.put(\n 'template/header-top-menu.html',\n '
'\n );\n\n $templateCache.put(\n 'template/header.html',\n '
'\n );\n\n $templateCache.put(\n 'template/profile-menu.html',\n '
  • About
  • Timeline
  • Photos
  • Connections
  • '\n );\n\n $templateCache.put(\n 'template/sidebar-left.html',\n ''\n );\n\n $templateCache.put(\n 'template/carousel/carousel.html',\n ''\n );\n\n $templateCache.put(\n 'template/datepicker/day.html',\n '
    {{::label.abbr}}
    {{ weekNumbers[$index] }}
    '\n );\n\n $templateCache.put(\n 'template/datepicker/month.html',\n '
    '\n );\n\n $templateCache.put(\n 'template/datepicker/popup.html',\n '
    '\n );\n\n $templateCache.put(\n 'template/datepicker/year.html',\n '
    '\n );\n\n $templateCache.put(\n 'template/pagination/pager.html',\n ''\n );\n\n $templateCache.put(\n 'template/pagination/pagination.html',\n ''\n );\n\n // $templateCache.put('template/tabs/tabset.html',\n // \"
      \"\n // );\n }\n]);\n","$(document).ready(function($) {\n $(document).on('minimizeListView', '.chat-listview', function(event) {\n $(this).animate({ height: '283px' });\n });\n\n $(document).on('maximizeListView', '.chat-listview', function(event) {\n $(this).animate({ height: '423px' });\n });\n\n $(document).on('focus', '.ms-reply textarea', function(event) {\n $(this).animate({ height: '200px' });\n $('.chat-listview').trigger('minimizeListView');\n });\n\n $(document).on('blur', '.ms-reply textarea', function(event) {\n $(this).animate({ height: '60px' });\n $('.chat-listview').trigger('maximizeListView');\n });\n});\n","appModule.factory('LoadingBar', function() {\n return {\n show: false\n };\n});\n\nappModule.controller('kpLoadingController', [\n '$scope',\n 'LoadingBar',\n function($scope, LoadingBar) {\n $scope.show = false;\n\n $scope.$watch(\n function() {\n return LoadingBar.show;\n },\n function(newVal, oldVal) {\n $scope.show = newVal;\n }\n );\n }\n]);\n","module.exports = \"
      \\n \\n
      \\n {{initials}}\\n
      \\n
      \";","module.exports = \"
      \\n {{$ctrl.label.name}}\\n\\n \\n \\n
      \";","module.exports = \"
      \\n
      \\n \\n \\n
      \\n
      \";","var map = {\n\t\"./af\": 141,\n\t\"./af.js\": 141,\n\t\"./ar\": 142,\n\t\"./ar-dz\": 143,\n\t\"./ar-dz.js\": 143,\n\t\"./ar-kw\": 144,\n\t\"./ar-kw.js\": 144,\n\t\"./ar-ly\": 145,\n\t\"./ar-ly.js\": 145,\n\t\"./ar-ma\": 146,\n\t\"./ar-ma.js\": 146,\n\t\"./ar-sa\": 147,\n\t\"./ar-sa.js\": 147,\n\t\"./ar-tn\": 148,\n\t\"./ar-tn.js\": 148,\n\t\"./ar.js\": 142,\n\t\"./az\": 149,\n\t\"./az.js\": 149,\n\t\"./be\": 150,\n\t\"./be.js\": 150,\n\t\"./bg\": 151,\n\t\"./bg.js\": 151,\n\t\"./bm\": 152,\n\t\"./bm.js\": 152,\n\t\"./bn\": 153,\n\t\"./bn-bd\": 154,\n\t\"./bn-bd.js\": 154,\n\t\"./bn.js\": 153,\n\t\"./bo\": 155,\n\t\"./bo.js\": 155,\n\t\"./br\": 156,\n\t\"./br.js\": 156,\n\t\"./bs\": 157,\n\t\"./bs.js\": 157,\n\t\"./ca\": 158,\n\t\"./ca.js\": 158,\n\t\"./cs\": 159,\n\t\"./cs.js\": 159,\n\t\"./cv\": 160,\n\t\"./cv.js\": 160,\n\t\"./cy\": 161,\n\t\"./cy.js\": 161,\n\t\"./da\": 162,\n\t\"./da.js\": 162,\n\t\"./de\": 163,\n\t\"./de-at\": 164,\n\t\"./de-at.js\": 164,\n\t\"./de-ch\": 165,\n\t\"./de-ch.js\": 165,\n\t\"./de.js\": 163,\n\t\"./dv\": 166,\n\t\"./dv.js\": 166,\n\t\"./el\": 167,\n\t\"./el.js\": 167,\n\t\"./en-au\": 168,\n\t\"./en-au.js\": 168,\n\t\"./en-ca\": 169,\n\t\"./en-ca.js\": 169,\n\t\"./en-gb\": 170,\n\t\"./en-gb.js\": 170,\n\t\"./en-ie\": 171,\n\t\"./en-ie.js\": 171,\n\t\"./en-il\": 172,\n\t\"./en-il.js\": 172,\n\t\"./en-in\": 173,\n\t\"./en-in.js\": 173,\n\t\"./en-nz\": 174,\n\t\"./en-nz.js\": 174,\n\t\"./en-sg\": 175,\n\t\"./en-sg.js\": 175,\n\t\"./eo\": 176,\n\t\"./eo.js\": 176,\n\t\"./es\": 177,\n\t\"./es-do\": 178,\n\t\"./es-do.js\": 178,\n\t\"./es-mx\": 179,\n\t\"./es-mx.js\": 179,\n\t\"./es-us\": 180,\n\t\"./es-us.js\": 180,\n\t\"./es.js\": 177,\n\t\"./et\": 181,\n\t\"./et.js\": 181,\n\t\"./eu\": 182,\n\t\"./eu.js\": 182,\n\t\"./fa\": 183,\n\t\"./fa.js\": 183,\n\t\"./fi\": 184,\n\t\"./fi.js\": 184,\n\t\"./fil\": 185,\n\t\"./fil.js\": 185,\n\t\"./fo\": 186,\n\t\"./fo.js\": 186,\n\t\"./fr\": 187,\n\t\"./fr-ca\": 188,\n\t\"./fr-ca.js\": 188,\n\t\"./fr-ch\": 189,\n\t\"./fr-ch.js\": 189,\n\t\"./fr.js\": 187,\n\t\"./fy\": 190,\n\t\"./fy.js\": 190,\n\t\"./ga\": 191,\n\t\"./ga.js\": 191,\n\t\"./gd\": 192,\n\t\"./gd.js\": 192,\n\t\"./gl\": 193,\n\t\"./gl.js\": 193,\n\t\"./gom-deva\": 194,\n\t\"./gom-deva.js\": 194,\n\t\"./gom-latn\": 195,\n\t\"./gom-latn.js\": 195,\n\t\"./gu\": 196,\n\t\"./gu.js\": 196,\n\t\"./he\": 197,\n\t\"./he.js\": 197,\n\t\"./hi\": 198,\n\t\"./hi.js\": 198,\n\t\"./hr\": 199,\n\t\"./hr.js\": 199,\n\t\"./hu\": 200,\n\t\"./hu.js\": 200,\n\t\"./hy-am\": 201,\n\t\"./hy-am.js\": 201,\n\t\"./id\": 202,\n\t\"./id.js\": 202,\n\t\"./is\": 203,\n\t\"./is.js\": 203,\n\t\"./it\": 204,\n\t\"./it-ch\": 205,\n\t\"./it-ch.js\": 205,\n\t\"./it.js\": 204,\n\t\"./ja\": 206,\n\t\"./ja.js\": 206,\n\t\"./jv\": 207,\n\t\"./jv.js\": 207,\n\t\"./ka\": 208,\n\t\"./ka.js\": 208,\n\t\"./kk\": 209,\n\t\"./kk.js\": 209,\n\t\"./km\": 210,\n\t\"./km.js\": 210,\n\t\"./kn\": 211,\n\t\"./kn.js\": 211,\n\t\"./ko\": 212,\n\t\"./ko.js\": 212,\n\t\"./ku\": 213,\n\t\"./ku.js\": 213,\n\t\"./ky\": 214,\n\t\"./ky.js\": 214,\n\t\"./lb\": 215,\n\t\"./lb.js\": 215,\n\t\"./lo\": 216,\n\t\"./lo.js\": 216,\n\t\"./lt\": 217,\n\t\"./lt.js\": 217,\n\t\"./lv\": 218,\n\t\"./lv.js\": 218,\n\t\"./me\": 219,\n\t\"./me.js\": 219,\n\t\"./mi\": 220,\n\t\"./mi.js\": 220,\n\t\"./mk\": 221,\n\t\"./mk.js\": 221,\n\t\"./ml\": 222,\n\t\"./ml.js\": 222,\n\t\"./mn\": 223,\n\t\"./mn.js\": 223,\n\t\"./mr\": 224,\n\t\"./mr.js\": 224,\n\t\"./ms\": 225,\n\t\"./ms-my\": 226,\n\t\"./ms-my.js\": 226,\n\t\"./ms.js\": 225,\n\t\"./mt\": 227,\n\t\"./mt.js\": 227,\n\t\"./my\": 228,\n\t\"./my.js\": 228,\n\t\"./nb\": 229,\n\t\"./nb.js\": 229,\n\t\"./ne\": 230,\n\t\"./ne.js\": 230,\n\t\"./nl\": 231,\n\t\"./nl-be\": 232,\n\t\"./nl-be.js\": 232,\n\t\"./nl.js\": 231,\n\t\"./nn\": 233,\n\t\"./nn.js\": 233,\n\t\"./oc-lnc\": 234,\n\t\"./oc-lnc.js\": 234,\n\t\"./pa-in\": 235,\n\t\"./pa-in.js\": 235,\n\t\"./pl\": 236,\n\t\"./pl.js\": 236,\n\t\"./pt\": 237,\n\t\"./pt-br\": 238,\n\t\"./pt-br.js\": 238,\n\t\"./pt.js\": 237,\n\t\"./ro\": 239,\n\t\"./ro.js\": 239,\n\t\"./ru\": 240,\n\t\"./ru.js\": 240,\n\t\"./sd\": 241,\n\t\"./sd.js\": 241,\n\t\"./se\": 242,\n\t\"./se.js\": 242,\n\t\"./si\": 243,\n\t\"./si.js\": 243,\n\t\"./sk\": 244,\n\t\"./sk.js\": 244,\n\t\"./sl\": 245,\n\t\"./sl.js\": 245,\n\t\"./sq\": 246,\n\t\"./sq.js\": 246,\n\t\"./sr\": 247,\n\t\"./sr-cyrl\": 248,\n\t\"./sr-cyrl.js\": 248,\n\t\"./sr.js\": 247,\n\t\"./ss\": 249,\n\t\"./ss.js\": 249,\n\t\"./sv\": 250,\n\t\"./sv.js\": 250,\n\t\"./sw\": 251,\n\t\"./sw.js\": 251,\n\t\"./ta\": 252,\n\t\"./ta.js\": 252,\n\t\"./te\": 253,\n\t\"./te.js\": 253,\n\t\"./tet\": 254,\n\t\"./tet.js\": 254,\n\t\"./tg\": 255,\n\t\"./tg.js\": 255,\n\t\"./th\": 256,\n\t\"./th.js\": 256,\n\t\"./tk\": 257,\n\t\"./tk.js\": 257,\n\t\"./tl-ph\": 258,\n\t\"./tl-ph.js\": 258,\n\t\"./tlh\": 259,\n\t\"./tlh.js\": 259,\n\t\"./tr\": 260,\n\t\"./tr.js\": 260,\n\t\"./tzl\": 261,\n\t\"./tzl.js\": 261,\n\t\"./tzm\": 262,\n\t\"./tzm-latn\": 263,\n\t\"./tzm-latn.js\": 263,\n\t\"./tzm.js\": 262,\n\t\"./ug-cn\": 264,\n\t\"./ug-cn.js\": 264,\n\t\"./uk\": 265,\n\t\"./uk.js\": 265,\n\t\"./ur\": 266,\n\t\"./ur.js\": 266,\n\t\"./uz\": 267,\n\t\"./uz-latn\": 268,\n\t\"./uz-latn.js\": 268,\n\t\"./uz.js\": 267,\n\t\"./vi\": 269,\n\t\"./vi.js\": 269,\n\t\"./x-pseudo\": 270,\n\t\"./x-pseudo.js\": 270,\n\t\"./yo\": 271,\n\t\"./yo.js\": 271,\n\t\"./zh-cn\": 272,\n\t\"./zh-cn.js\": 272,\n\t\"./zh-hk\": 273,\n\t\"./zh-hk.js\": 273,\n\t\"./zh-mo\": 274,\n\t\"./zh-mo.js\": 274,\n\t\"./zh-tw\": 275,\n\t\"./zh-tw.js\": 275\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 497;","module.exports = \"\\n\\n\\n\\n\\n\";","appModule.directive('lightbox', ['$timeout', function ($timeout) {\n return function (_scope, element) {\n $timeout(function () {\n element.lightGallery({\n enableTouch: true,\n selector: '.lightbox-image',\n videojs: true\n });\n });\n };\n}]);\n\nappModule.directive('fgLine', function () {\n return {\n restrict: 'C',\n link: function () {\n if ($('.fg-line')[0]) {\n $('body').on('focus', '.form-control', function () {\n $(this).closest('.fg-line').addClass('fg-toggled');\n });\n\n $('body').on('blur', '.form-control', function () {\n var p = $(this).closest('.form-group');\n var i = p.find('.form-control').val();\n\n if (p.hasClass('fg-float')) {\n if (i.length == 0) {\n $(this).closest('.fg-line').removeClass('fg-toggled');\n }\n }\n else {\n $(this).closest('.fg-line').removeClass('fg-toggled');\n }\n });\n }\n\n }\n };\n\n})\n\n // =========================================================================\n // PLACEHOLDER FOR IE 9 (on .form-control class)\n // =========================================================================\n\n .directive('formControl', function () {\n return {\n restrict: 'C',\n link: function (_scope, _element, _attrs) {\n if (angular.element('html').hasClass('ie9')) {\n $('input, textarea').placeholder({\n customClass: 'ie9-placeholder'\n });\n }\n }\n\n };\n })\n\n .directive('dateTimePicker', function () {\n return {\n restrict: 'A',\n scope: {\n date: '=',\n dialog: '=',\n momentFormat: '@',\n renderAs: '@'\n },\n link: function (scope, element, _attrs) {\n scope.$watch('date', function () {\n var defaultDialog = {\n type: 'date',\n mode: true,\n init: moment(scope.date),\n trigger: element[0],\n ok: 'Kies',\n cancel: 'Annuleren',\n future: moment().add(200, 'year'),\n past: moment().subtract(200, 'year')\n };\n\n if (!scope.renderAs)\n {scope.renderAs = '%date%';}\n\n var dialog = Object.assign(defaultDialog, scope.dialog);\n var format = scope.momentFormat ? scope.momentFormat : (dialog.type === 'date' ? 'DD-MM-YYYY' : 'HH:mm');\n element.html(scope.renderAs.replace('%date%', moment(scope.date).format(format)));\n element.val(moment(scope.date).format(format));\n\n dialog = new mdDateTimePicker.default(dialog);\n\n element.unbind('onOk');\n element.unbind('focusin');\n element.bind('onOk', function () {\n scope.date = dialog.time;\n element.val(dialog.time.format(format));\n element.html(scope.renderAs.replace('%date%', moment(scope.date).format(format)));\n scope.$apply();\n });\n\n element.bind('focusin', function () {\n dialog.show();\n });\n\n element.click('click', function () {\n dialog.show();\n });\n }, true);\n }\n };\n });\n","module.exports = angular;","appModule.filter('trusted', ['$sce', function ($sce) {\n return function (url) {\n return $sce.trustAsResourceUrl(url);\n };\n}]);\n\nappModule.filter('capitalize', function () {\n return function (input) {\n return (input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : '';\n };\n});","appModule.filter('urlencode', function() {\n return function(input) {\n return window.encodeURIComponent(input);\n };\n});\n\nappModule.filter('newlines', function() {\n return function(text) {\n if (!text) {\n return;\n }\n\n return text.split(/\\n/g);\n };\n});\n","appModule.provider('ftApp', [\n function() {\n this.$get = ['ftLoginService', function(ftLoginService) {\n return new service(ftLoginService);\n }];\n\n const service = function(ftLoginService) {\n this.initializeAppContent = function() {\n return ftLoginService.isLoggedInAsync();\n };\n };\n }\n]);\n","appModule.service('ftAppService', function() { });","appModule.controller('kpConversationModalController',\n ['$rootScope', '$scope', '$uibModalInstance', 'audiences', 'childId', 'AppDataService',\n function ($rootScope, $scope, $uibModalInstance, audiences, childId, DataService) {\n\n const selectedAudiences = [];\n audiences.forEach((audienceGroup, groupIndex) => {\n audienceGroup.audiences.forEach((audienceItem, index) => {\n audienceItem.type = audienceGroup.audienceType;\n audienceItem.checked = false;\n audiences[groupIndex].audiences[index] = audienceItem;\n\n selectedAudiences.push(audienceItem);\n });\n });\n $scope.audiences = audiences;\n $scope.selectedAudience = childId ? null : audiences[0];\n $scope.selectedAudiences = selectedAudiences;\n\n $scope.childId = childId;\n\n $scope.valid = true;\n $scope.message = {\n title: null,\n content: null,\n reminderDate: null\n };\n $scope.audienceIds = [];\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n };\n\n $scope.toggleSelectionAudiences = function (type) {\n $scope.allAudiencesSelected = !$scope.allAudiencesSelected;\n $scope.selectedAudiences.forEach(function (item) {\n if (item.type == type) {\n item.checked = $scope.allAudiencesSelected;\n }\n });\n };\n\n $scope.toggleSelectAudience = function (audience) {\n audience.checked = !audience.checked;\n\n if (!audience.checked) {\n $scope.allAudiencesSelected = false;\n const allAudience = $scope.selectedAudiences.find(x => x.type == audience.type && x.isAllAudience);\n allAudience.checked = false;\n }\n\n var amountOfAudiences = $scope.selectedAudiences.filter(\n x => x.isAllAudience == false && x.type == audience.type\n ).length;\n\n var checkedAmount = $scope.selectedAudiences.filter(\n x => x.checked == true && x.type == audience.type\n ).length;\n\n if (amountOfAudiences === checkedAmount) {\n $scope.allAudiencesSelected = true;\n const allAudience = $scope.selectedAudiences.find(x => x.type == audience.type && x.isAllAudience);\n allAudience.checked = true;\n }\n };\n\n $scope.hasAudiencesSelected = function () {\n if ($scope.selectedAudiences) {\n return $scope.selectedAudiences.filter(x => x.checked == true).length > 0;\n }\n };\n\n $scope.selectAudience = function (index) {\n $scope.selectedAudience = audiences[index];\n const allAudience = $scope.selectedAudiences.find(\n x => x.isAllAudience && x.type === audiences[index].audienceType\n );\n\n console.log(allAudience);\n\n if (allAudience) {\n console.log('test');\n $scope.allAudiencesSelected = allAudience.checked;\n return;\n }\n\n const checkedAudiencesInType = $scope.selectedAudiences.filter(\n x => x.type === audiences[index].audienceType && x.checked\n ).length;\n\n $scope.allAudiencesSelected = checkedAudiencesInType === audiences[index].audiences.length;\n };\n\n $scope.saveConversation = function () {\n if ($scope.isLoading) {\n return;\n }\n\n $scope.isLoading = true;\n\n $scope.valid = true;\n var audiences = $scope.selectedAudiences.filter(x => x.checked == true);\n\n if (!ft.hasValue($scope.message.content)) {\n $scope.valid = false;\n }\n\n if (!ft.hasValue($scope.message.title)) {\n $scope.valid = false;\n }\n\n if (ft.hasValue($scope.message.reminderDate)) {\n $scope.message.reminderDate = moment($scope.message.reminderDate, 'DD/MM/YYYY').format('YYYY/MM/DD');\n }\n\n if (!audiences || !audiences.length) {\n $scope.valid = false;\n }\n\n if (!$scope.valid) {\n return;\n }\n\n var hasAllAudience = audiences.filter(x => x.isAllAudience == true);\n var otherAudiences = audiences.filter(x => x.isAllAudience == false);\n var expectedAudienceIds = [];\n\n var hasAllAudienceTypes = [];\n hasAllAudience.forEach(function (allAudience) {\n hasAllAudienceTypes.push(allAudience.type);\n expectedAudienceIds.push({id: allAudience.id});\n });\n\n otherAudiences.forEach(function (audience) {\n if (!hasAllAudienceTypes.includes(audience.type)) {\n expectedAudienceIds.push({id: audience.id});\n }\n });\n\n const prm = DataService.saveConversationAsync($scope.message, expectedAudienceIds, childId);\n prm.then(handleSaveConversation, handleSaveConversationError);\n prm.finally(function () {\n $scope.isLoading = false;\n });\n };\n\n var handleSaveConversation = function () {\n $scope.toggleSelectionAudiences();\n $scope.message.content = '';\n $scope.message.title = '';\n\n $rootScope.$emit('newPostMade', false);\n $uibModalInstance.dismiss();\n swal({\n title: 'Verzonden!',\n text: 'Het bericht is verzonden!',\n timer: 2000,\n type: 'success'\n });\n };\n\n var handleSaveConversationError = function () {\n $uibModalInstance.dismiss();\n swal({\n title: $translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: 'Er ging iets mis bij het verzenden!',\n timer: 2500,\n type: 'error'\n });\n };\n\n }\n ]\n);\n","appModule.controller('kpPresenceDetailModalController',\n ['$scope', '$uibModalInstance', 'group', 'event',\n function ($scope, $uibModalInstance, group, event) {\n $scope.group = group;\n $scope.event = event;\n\n $scope.formatToDate = function (date) {\n return moment(date).format('DD-MM-YYYY');\n };\n\n $scope.close = function () {\n $uibModalInstance.dismiss();\n };\n }\n ]);\n","appModule.controller('kpLoginController', ['$scope', '$rootScope', '$timeout', function ($scope, $rootScope, $timeout) {\n\n}]);\n","import {NetworkUtils} from '@/network-utils';\n\nexport enum EnvironmentMode {\n development = 'development',\n production = 'production'\n}\n\nexport interface Environment {\n environment: EnvironmentMode;\n buildnumber: string;\n commit: string;\n apiUrl: string;\n tenant?: string;\n}\n\nconst environments: { [key: string]: Environment } = {\n development: {\n environment: EnvironmentMode.development,\n buildnumber: env.buildnumber,\n commit: env.commit,\n apiUrl: 'http://localhost:5000/api/'\n },\n production: {\n environment: EnvironmentMode.production,\n buildnumber: env.buildnumber,\n commit: env.commit,\n apiUrl: `https://backoffice-${NetworkUtils.getTenantFromUrl(window.location.host)}.kindplanner.nl/api/`\n }\n};\n\nexport function getEnvironment(): Environment {\n const tenant = NetworkUtils.getTenantFromUrl(window.location.host);\n\n if (env.mode === EnvironmentMode.development) {\n return { ...environments.development, tenant };\n }\n\n return { ...environments.production, tenant };\n}","export class NetworkUtils {\n public static getTenantFromUrl(url: string): string | null {\n const tenantRegex = /(?:(?:groep|backoffice|ouder|vervoer)-)?([a-z-0-9]+)\\.kindplanner.nl/i;\n const match = tenantRegex.exec(url);\n if (match != null) {\n return match[1];\n }\n\n return null;\n }\n\n public static createBackOfficeApiUrl(tenant: string): string {\n return `https://backoffice-${tenant}.kindplanner.nl/api/`;\n }\n\n public static getQueryParam(param: string): string {\n const regex = /([a-z]+)=([a-z0-9:/%.-]+)/ig;\n const search = window.location.href;\n param = param.toLowerCase();\n\n let match: RegExpExecArray;\n\n do {\n match = regex.exec(search);\n if (match != null) {\n const queryParam = match[1]?.toLowerCase();\n const queryValue = match[2];\n if (queryParam == param) {\n return decodeURIComponent(queryValue);\n }\n }\n } while (match != null);\n\n return null;\n }\n}\n","import {EnvironmentMode} from '@/environment';\n\nif (env.mode !== EnvironmentMode.development) {\n window.addEventListener('load', async () => {\n if ('serviceWorker' in navigator) {\n const registration = await navigator.serviceWorker.register('/service-worker.js');\n\n // Check every hour\n setInterval(() => registration.update(), 60 * 60 * 1000);\n\n let refreshing = false;\n navigator.serviceWorker.addEventListener('controllerchange', function () {\n if (refreshing) {\n return;\n }\n\n window.location.reload();\n refreshing = true;\n });\n }\n });\n}","import {getEnvironment} from '@/environment';\n\nconst environment = getEnvironment();\n\nappModule.baseUrl = '';\nappModule.baseTemplateUrl = 'partials/';\nappModule.baseApiUrl = environment.apiUrl;\nappModule.customer = environment.tenant;\n\nappModule.hubs = {\n types: {\n event: 'eventHub'\n },\n messages: {}\n};\n\nappModule.getTemplateUrl = function(urlPart) {\n return appModule.baseTemplateUrl + urlPart + '.html?v=' + ft.randomNumber;\n};\n\nappModule.config([\n '$compileProvider',\n '$stateProvider',\n '$sceDelegateProvider',\n '$translateProvider',\n 'ftConfigurationProvider',\n function($compileProvider, $stateProvider, $sceDelegateProvider, $translateProvider, ftConfigurationProvider) {\n if (!ft.DEBUG) {\n $compileProvider.debugInfoEnabled(false);\n $compileProvider.commentDirectivesEnabled(false);\n $compileProvider.cssClassDirectivesEnabled(true);\n }\n\n // default settable stuff\n ftConfigurationProvider.setBaseApiUrl(appModule.baseApiUrl);\n ftConfigurationProvider.setTokenUrl('account/token');\n ftConfigurationProvider.setRefreshTokenUrl('account/token');\n ftConfigurationProvider.setCurrentUserUrl('account/validate');\n\n ftConfigurationProvider.setSplashViewUrl(appModule.getTemplateUrl('app/splash'));\n ftConfigurationProvider.setLoginViewUrl(appModule.getTemplateUrl('login/login'));\n\n // everything else that comes in handy\n ftConfigurationProvider.configure({\n appTitle: 'Kindplanner',\n passwordExpression: /(?=.*?[\\W_]{1,}).{8,}/gi,\n connection: {\n checkOnload: false,\n checkUrl: appModule.baseApiUrl + 'configuration'\n },\n notifications: {\n //\turl: appModule.baseNotificationsUrl + 'events/signalr',\n //\thubs: appModule.hubs.types\n }\n });\n\n $sceDelegateProvider.resourceUrlWhitelist([\n // Allow same origin resource loads.\n 'self',\n // Allow loading from our assets domain. Notice the difference between * and **.\n 'http://*.local/**',\n 'http://ft.components.local/**',\n 'http://ft.layout.local/**',\n 'https://*.local/**',\n 'http://*.42windmills.com/**',\n 'https://*.42windmills.com/**',\n 'https://*.kindplanner.nl/**',\n 'https://*.azurewebsites.net/**',\n 'https://www.google.com/**',\n 'https://localhost:6001/**'\n ]);\n\n $translateProvider\n .useStaticFilesLoader({\n prefix: '/translations/local-',\n suffix: '.json'\n })\n .useSanitizeValueStrategy(null)\n .preferredLanguage('nl');\n\n const initializeApp = {\n name: 'app.initialize',\n url: '/initialize',\n views: {\n content: {\n controller: 'kpAppInitializeController',\n templateUrl: appModule.getTemplateUrl('app/initialize')\n }\n }\n };\n\n const externalLogin = {\n name: 'oauthLogin',\n url: '/oauth/login?api&token&group',\n controller: 'kpExternalLoginController'\n };\n\n const home = {\n name: 'app.home',\n url: '/home',\n views: {\n content: {\n controller: 'kpHomeController',\n templateUrl: appModule.getTemplateUrl('home/main')\n }\n }\n };\n\n const groupList = {\n name: 'app.groups',\n url: '/group/list?action',\n params: { previous: null },\n pageStyle: 'small-top-bar',\n layout: layoutSettings.layout.fullWidth,\n views: {\n content: {\n controller: 'kpGroupListController',\n templateUrl: appModule.getTemplateUrl('group/list')\n }\n }\n };\n\n const groupMedia = {\n name: 'app.groupmedia',\n url: '/group/media/:albumId?postId',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n views: {\n content: {\n controller: 'kpGroupMediaController',\n templateUrl: appModule.getTemplateUrl('group/media')\n }\n }\n };\n\n const activities = {\n name: 'app.activities',\n url: '/activities',\n pageStyle: 'small-top-bar group-app',\n views: {\n content: {\n controller: 'kpActivitiesController',\n templateUrl: appModule.getTemplateUrl('activity/list')\n }\n }\n };\n\n const childDetail = {\n name: 'app.child',\n url: '/child/:id',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n views: {\n content: {\n controller: 'kpChildDetailController',\n templateUrl: appModule.getTemplateUrl('child/detail')\n }\n }\n };\n\n const presenceOverview = {\n name: 'app.presence',\n url: '/presence?date',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpPresenceOverviewController',\n templateUrl: appModule.getTemplateUrl('presence/overview')\n }\n }\n };\n\n const diaryOverview = {\n name: 'app.diary',\n url: '/diary?date',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpDiaryOverviewController',\n templateUrl: appModule.getTemplateUrl('diary/overview')\n }\n }\n };\n\n const calendarOverview = {\n name: 'app.calendar',\n url: '/calendar?date',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpCalendarOverviewController',\n templateUrl: appModule.getTemplateUrl('calendar/overview')\n }\n }\n };\n\n const requestOverview = {\n name: 'app.requests',\n url: '/requests',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpRequestsController',\n templateUrl: appModule.getTemplateUrl('requests/overview')\n }\n }\n };\n\n const emergencyList = {\n name: 'app.emergency',\n url: '/emergency-list',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpEmergencyListController',\n templateUrl: appModule.getTemplateUrl('emergency/list')\n }\n }\n };\n\n const travelPlanner = {\n name: 'app.planner',\n url: '/travel-planner?date',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpTravelPlannerController',\n templateUrl: appModule.getTemplateUrl('travel/planner')\n }\n }\n };\n\n const activityPlanner = {\n name: 'app.activity',\n url: '/activity-planner?date',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'kpActivityPlannerController',\n templateUrl: appModule.getTemplateUrl('activity/planner')\n }\n }\n };\n\n const locationManager = {\n name: 'app.locationmanager',\n url: '/locationmanager',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n 'content': {\n templateUrl: appModule.getTemplateUrl('locationmanager/main')\n }\n }\n };\n\n const stories = {\n name: 'app.stories',\n url: '/stories',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'StoriesListController',\n templateUrl: appModule.getTemplateUrl('stories/list')\n }\n }\n };\n\n const storyDetails = {\n name: 'app.story-details',\n url: '/story/:id',\n pageStyle: 'small-top-bar group-app',\n layout: layoutSettings.layout.fullWidth,\n reloadOnSearch: false,\n views: {\n content: {\n controller: 'StoryDetailsController',\n templateUrl: appModule.getTemplateUrl('stories/details')\n }\n }\n };\n\n $stateProvider.state(initializeApp);\n $stateProvider.state(externalLogin);\n $stateProvider.state(home);\n $stateProvider.state(groupList);\n $stateProvider.state(groupMedia);\n $stateProvider.state(activities);\n $stateProvider.state(childDetail);\n $stateProvider.state(presenceOverview);\n $stateProvider.state(calendarOverview);\n $stateProvider.state(requestOverview);\n $stateProvider.state(diaryOverview);\n $stateProvider.state(emergencyList);\n $stateProvider.state(travelPlanner);\n $stateProvider.state(activityPlanner);\n $stateProvider.state(locationManager);\n $stateProvider.state(stories);\n $stateProvider.state(storyDetails);\n }\n]);\n\nappModule.run();\n\nwindow.appEvents = app.events;\nwindow.appSettings = app.settings;\nwindow.appTypes = app.types;\nwindow.appHubTypes = appModule.hubs.types;\nwindow.appHubMessages = appModule.hubs.messages;\n","import { AppModule } from '@/FortyTwoFramework';\n\nexport const ft = window.ft;\nexport const ng = window.ng;\n\nexport const app = window.ft.app;\nexport const appModule = window.ft.app.module as AppModule;\n\nexport const frameworkModule = ft.framework.module;\nexport const frameworkEvents = frameworkModule.events;\nexport const frameworkSettings = frameworkModule.settings;\nexport const frameworkSortingDirections = frameworkSettings.sorting.directions;\nexport const frameworkLevels = frameworkModule.levels;\nexport const frameworkNavigationType = frameworkModule.navigation.type;\n\nexport const componentsModule = ft.components.module;\nexport const componentsModels = componentsModule.models;\nexport const componentsEvents = componentsModule.events;\n\nexport const layoutModule = ft.layout.module;\nexport const layoutModels = layoutModule.models;\nexport const layoutEvents = layoutModule.events;\nexport const layoutSettings = layoutModule.settings;\nexport const layoutBladeSizes = layoutSettings.blade.size;\n","import { IComponentOptions, IScope, IController, IOnChanges, IOnChangesObject } from 'angular';\nimport { appModule } from '@/definitions';\n\ninterface Scope extends IScope {\n image: string;\n initials: string;\n selected: boolean;\n}\n\nclass AvatarController implements IController, IOnChanges {\n public static $inject = ['$scope'];\n\n public image: string;\n public name: string;\n public selected: boolean;\n\n private readonly $scope: Scope;\n\n public constructor($scope: Scope) {\n this.$scope = $scope;\n }\n\n public $onInit() {\n this.$scope.initials = this.getAvatarInitials(this.name);\n this.$scope.image = this.image;\n this.$scope.selected = this.selected;\n }\n\n public $onChanges(changes: IOnChangesObject) {\n if (changes['name'] != null && changes['name'].currentValue != null) {\n this.$scope.initials = this.getAvatarInitials(changes['name'].currentValue);\n }\n\n if (changes['image'] != null && changes['image'].currentValue != null) {\n this.$scope.image = changes['image'].currentValue;\n }\n\n if (changes['selected'] != null && changes['selected'].currentValue != null) {\n this.$scope.selected = changes['selected'].currentValue;\n }\n }\n\n private getAvatarInitials(name: string): string {\n if (name == null) {\n return 'NB';\n }\n\n let matches = name.match(/\\b(\\w)/g);\n if (matches.length < 2) {\n return name.slice(0, 2).toUpperCase();\n }\n\n matches = matches.slice(0, 2);\n return matches.join('').toUpperCase();\n }\n}\n\nclass AvatarComponent implements IComponentOptions {\n public controller: any;\n public template: string;\n public bindings: any;\n\n constructor() {\n this.bindings = {\n image: '@?',\n name: '@',\n selected: '<'\n };\n\n this.controller = AvatarController;\n this.template = require('./template.html');\n }\n}\n\nappModule.component('avatar', new AvatarComponent());\n","export class Form {\n static formNullCheck(form, skipProperties) {\n if (!skipProperties || !Array.isArray(skipProperties)) {\n skipProperties = [];\n }\n\n for (let prop in form) {\n if (!form.hasOwnProperty(prop)) {\n continue;\n }\n\n if ((form[prop] == null || form[prop] === '' || form[prop].length === 0) && !(skipProperties.indexOf(prop) > -1)) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport class Color {\n static hexToRgba(hex, transparency = 1) {\n hex = hex.replace(/[^0-9A-F]/gi, '');\n\n let bigint = parseInt(hex, 16);\n let r = (bigint >> 16) & 255;\n let g = (bigint >> 8) & 255;\n let b = bigint & 255;\n\n return 'rgb(' + r + ',' + g + ',' + b + ', ' + transparency + ')';\n }\n\n static contrast(rgb) {\n let R, G, B, C, L;\n rgb = rgb\n .substring(rgb.indexOf('(') + 1, rgb.length - 1)\n .replace(/ /g, '')\n .split(',');\n\n R = parseInt(rgb[0]);\n G = parseInt(rgb[1]);\n B = parseInt(rgb[2]);\n\n C = [R / 255, G / 255, B / 255];\n for (let i = 0; i < C.length; ++i) {\n if (C[i] <= 0.03928) {\n C[i] = C[i] / 12.92;\n } else {\n C[i] = Math.pow((C[i] + 0.055) / 1.055, 2.4);\n }\n }\n\n L = 0.2126 * C[0] + 0.7152 * C[1] + 0.0722 * C[2];\n return L > 0.25 ? 'black' : 'white';\n }\n}\n","import { IComponentOptions, IOnChanges, IOnChangesObject } from 'angular';\nimport { ChildCare } from '@/data-models';\nimport { Color } from '@/HelperClasses';\nimport './styles.less';\n\ntype Label = ChildCare.Definitions.GroupApp.ChildLabel | ChildCare.Definitions.GroupApp.ChildLabelType;\n\nenum Mode {\n none = 'none',\n add = 'add',\n remove = 'remove'\n}\n\ninterface ChildLabelBindings {\n label: Label;\n mode: keyof typeof Mode;\n click: () => void;\n}\n\nclass ChildLabelController implements ChildLabelBindings, IOnChanges {\n public static $inject = [];\n\n public label: ChildCare.Definitions.GroupApp.ChildLabel | ChildCare.Definitions.GroupApp.ChildLabelType;\n public mode: keyof typeof Mode;\n public click: () => void;\n\n public backgroundColor: string;\n public foregroundColor: string;\n\n public constructor() {\n this.mode = Mode.none;\n }\n\n public onClick() {\n if (this.mode !== Mode.none) {\n this.click();\n }\n }\n\n public $onChanges(changes: IOnChangesObject): void {\n if (changes['label'] != null && changes['label'].currentValue != null) {\n const label = changes['label'].currentValue as Label;\n\n this.backgroundColor = label.colorCode == null ? 'transparent' : Color.hexToRgba(label.colorCode, this.mode === Mode.add ? 0.5 : 1);\n this.foregroundColor = label.colorCode == null ? 'black' : Color.contrast(label.colorCode);\n }\n }\n}\n\nclass ChildLabelComponent implements IComponentOptions {\n public controller: any;\n public template: string;\n public bindings: any;\n\n constructor() {\n this.bindings = {\n label: '<',\n mode: '@?',\n\n click: '&',\n };\n\n this.controller = ChildLabelController;\n this.template = require('./template.html');\n }\n\n\n}\n\nwindow.appModule.component('childLabel', new ChildLabelComponent());\n","import { ChildCare } from '@/data-models';\nimport { FortyTwoLoginService, ftSettingsService } from '@/FortyTwoFramework';\nimport { IStateService } from 'angular-ui-router';\nimport { IPromise, IQService } from 'angular';\n\ntype UserModel = ChildCare.Definitions.Account.UserModel;\n\nexport class RoleChecker {\n public static serviceName = 'RoleCheckerService';\n public static $inject = ['ftLoginService', '$state', '$q', 'ftSettingService'];\n\n private loginService: FortyTwoLoginService;\n private $state: IStateService;\n private $q: IQService;\n private settingsService: ftSettingsService;\n\n constructor(loginService: FortyTwoLoginService, $state: IStateService, $q: IQService, settingsService: ftSettingsService) {\n this.loginService = loginService;\n this.$state = $state;\n this.$q = $q;\n this.settingsService = settingsService;\n\n this.navigateToRoleStartPage = this.navigateToRoleStartPage.bind(this);\n this.allowGroupSwitching = this.allowGroupSwitching.bind(this);\n this.switchGroup = this.switchGroup.bind(this);\n this.checkLogin = this.checkLogin.bind(this);\n }\n\n public navigateToRoleStartPage(): IPromise {\n return this.loginService.getCurrentUserAsync().then(\n user => {\n const selectedGroup = this.settingsService.get(window.appSettings.group.selected);\n\n if (RoleChecker.groupSwitchingAllowed(user) && selectedGroup == null) {\n this.$state.go('app.groups', { previous: this.$state.current.name });\n } else if (RoleChecker.hasGroupRole(user) || RoleChecker.hasGroup(user)) {\n this.$state.go('app.presence');\n } else if (RoleChecker.hasPlannerRole(user)) {\n this.$state.go('app.planner');\n } else if (RoleChecker.hasLocationManager(user)) {\n this.$state.go('app.locationmanager');\n } else {\n this.loginService.doLogout();\n this.settingsService.set(window.appSettings.group.selected, undefined);\n this.$state.go('outside-app.login');\n }\n },\n error => {\n console.log(`Received error while checking identity: ${error}`);\n return this.logout();\n }\n );\n }\n\n public allowGroupSwitching(): IPromise {\n return this.loginService.getCurrentUserAsync().then(x => RoleChecker.groupSwitchingAllowed(x));\n }\n\n public switchGroup(): IPromise {\n const currentLocation = this.$state.current.name;\n return this.allowGroupSwitching().then(result => {\n if (result) {\n this.$state.go('app.groups', { previous: currentLocation });\n }\n });\n }\n\n public checkLogin(): IPromise {\n return this.loginService.getCurrentUserAsync().then(user => {\n if (!RoleChecker.allowLogin(user)) {\n console.log('Role check failed, logging out now');\n return this.logout();\n } else {\n return this.$q.resolve();\n }\n },\n error => {\n console.log(`Received error while checking identity: ${error}`);\n return this.logout();\n }\n );\n }\n\n private logout(): IPromise {\n this.loginService.doLogout();\n this.settingsService.set(window.appSettings.group.selected, undefined);\n this.$state.go('outside-app.login');\n\n return this.$q.reject('Role check failed, logging out now');\n }\n\n public static allowLogin(user: UserModel): boolean {\n if (user == null || user.roles == null || user.roles.length == 0) {\n return false;\n }\n\n return RoleChecker.hasGroupRole(user) || RoleChecker.hasAdminRole(user) || RoleChecker.hasPlannerRole(user);\n }\n\n public static allowGroupSwitching(user: UserModel): boolean {\n if (user == null || user.roles == null || user.roles.length == 0) {\n return false;\n }\n\n return RoleChecker.hasGroupRole(user) || RoleChecker.hasAdminRole(user);\n }\n\n public static allowPlannerEditing(user: UserModel): boolean {\n return RoleChecker.hasAdminRole(user) || RoleChecker.hasPlannerRole(user);\n }\n\n public static hasGroupRole(user: UserModel): boolean {\n return user.roles.some(r => r.toLowerCase() === 'group');\n }\n\n public static hasGroup(user: UserModel): boolean {\n return user.groups?.length > 0;\n }\n\n public static hasAdminRole(user: UserModel): boolean {\n return user.roles.some(r => r.toLowerCase() === 'admin');\n }\n\n public static hasPlannerRole(user: UserModel): boolean {\n return user.roles.some(r => r.toLowerCase() === 'planning');\n }\n\n public static hasLocationManager(user: UserModel): boolean {\n return user.roles.some(r => r.toLowerCase() == 'locatiemanager');\n }\n\n public static groupSwitchingAllowed(user: UserModel): boolean {\n return RoleChecker.hasAdminRole(user) || RoleChecker.hasGroupRole(user);\n }\n}\n\nwindow.appModule.service(RoleChecker.serviceName, RoleChecker);\n","import { IComponentOptions, IScope, IController, IPromise } from 'angular';\nimport { IStateService } from 'angular-ui-router';\nimport { ftSettingsService, FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ILoadingBar } from '@/models';\nimport { RoleChecker } from '@/role-checker';\nimport { ChildCare } from '@/data-models';\nimport { appModule } from '@/definitions';\n\nenum Mode {\n group = 'group',\n user = 'user'\n}\n\ninterface Scope extends IScope {\n mode: keyof typeof Mode;\n title: string;\n user: ChildCare.Definitions.Account.UserModel;\n group: ChildCare.Definitions.Account.GroupModel;\n name: string;\n navigateToGroups: () => IPromise;\n}\n\nclass GroupSwitcherController implements IController {\n public static $inject = ['$scope', '$state', 'AppDataService', 'ftSettingService', 'LoadingBar', 'ftLoginService', RoleChecker.serviceName];\n\n public mode: keyof typeof Mode;\n public title: string;\n\n private readonly $scope: Scope;\n private readonly $state: IStateService;\n private readonly appDataService: AppDataService;\n private readonly ftSettingService: ftSettingsService;\n private readonly loadingBar: ILoadingBar;\n private readonly ftLoginService: FortyTwoLoginService;\n\n public constructor($scope: Scope, $state: IStateService, appDataService: AppDataService, ftSettingService: ftSettingsService, loadingBar: ILoadingBar, ftLoginService: FortyTwoLoginService, roleCheckerService: RoleChecker) {\n this.$scope = $scope;\n this.$state = $state;\n this.appDataService = appDataService;\n this.ftSettingService = ftSettingService;\n this.loadingBar = loadingBar;\n this.ftLoginService = ftLoginService;\n\n this.mode = Mode.group;\n\n this.$scope.navigateToGroups = roleCheckerService.switchGroup;\n }\n\n public async $onInit() {\n this.$scope.mode = this.mode;\n this.$scope.title = this.title;\n this.loadingBar.show = true;\n\n try {\n this.$scope.user = await this.ftLoginService.getCurrentUserAsync();\n\n if (this.mode !== Mode.user) {\n const selectedGroupId = this.ftSettingService.get(window.appSettings.group.selected);\n if (!selectedGroupId) {\n this.$state.go('app.groups', { previous: this.$state.current.name });\n }\n\n const { groups } = await this.appDataService.getGroupsAsync();\n\n if (this.$scope.user.groups?.length === 1) {\n this.ftSettingService.set(window.appSettings.group.selected, this.$scope.user.groups[0].id);\n this.$scope.group = groups.find(x => x.id === this.$scope.user.groups[0].id);\n this.$scope.name = this.$scope.group.name;\n } else {\n this.$state.go('app.groups', { previous: this.$state.current.name });\n }\n } else {\n this.$scope.name = this.$scope.user.name;\n }\n } finally {\n this.loadingBar.show = false;\n }\n }\n}\n\nclass GroupSwitcherComponent implements IComponentOptions {\n public controller: any;\n public template: string;\n public bindings: any;\n\n constructor() {\n this.bindings = {\n mode: '@?',\n title: '@',\n };\n\n this.controller = GroupSwitcherController;\n this.template = require('./template.html');\n }\n}\n\nappModule.component('groupSwitcher', new GroupSwitcherComponent());\n","import { IComponentOptions, IController, IIntervalService, IHttpService, IRequestShortcutConfig, IRootScopeService } from 'angular';\nimport { stringify } from 'qs';\nimport './styles.less';\nimport { FortyTwoLoginService, ftSettingsService } from '@/FortyTwoFramework';\nimport angular from 'angular';\nimport moment from 'moment';\nimport { IStateService } from 'angular-ui-router';\n\ninterface NotificationsBindings {\n time: number;\n}\n\ninterface Toast {\n type: 'wait' | 'success' | 'warning' | 'error' | 'note';\n title?: string;\n body?: string;\n timeout?: number;\n bodyOutputType?: undefined | 'html' | 'trustedHtml' | 'template' | 'templateWithData' | 'directive';\n clickHandler?: (toast: Toast, isCloseButton: boolean) => void;\n toasterId?: string;\n showCloseButton?: boolean;\n toastId?: string;\n onHideCallback?: (toast: Toast, isCloseButton: boolean) => void;\n}\n\ninterface Toaster {\n clear(toast: Toast): void;\n pop(toast: Toast): { toasterId: string; toastId: string };\n pop(\n type: Toast['type'], title: Toast['title'], body: Toast['body'], timeout: Toast['timeout'],\n bodyOutputType: Toast['bodyOutputType'], clickHandler: Toast['clickHandler'], toasterId: Toast['toasterId'], showCloseButton: Toast['showCloseButton'],\n toastId: Toast['toastId'], onHideCallback: Toast['onHideCallback']): { toasterId: string; toastId: string };\n}\n\nclass NotificationsController implements IController, NotificationsBindings {\n public time: number;\n private timeInSeconds: number;\n\n public messages: NewMessage[];\n\n public static $inject = ['$interval', 'ftLoginService', 'ftSettingService', '$http', '$rootScope', 'toaster', '$state'];\n constructor(private $interval: IIntervalService,\n private ftLoginService: FortyTwoLoginService,\n private ftSettingsService: ftSettingsService,\n private $http: IHttpService,\n private $rootScope: IRootScopeService,\n private toaster: Toaster,\n private $state: IStateService) {\n this.messages = [];\n }\n\n public $onInit() {\n this.timeInSeconds = this.time ?? 5 * 60;\n this.$interval(this.refresh.bind(this), this.timeInSeconds * 1000);\n }\n\n private async refresh(): Promise {\n const newMessages = await this.fetchNewMessagesAsync();\n\n if (newMessages.length > 0) {\n this.messages = newMessages;\n for (const message of newMessages) {\n //this.$rootScope.$broadcast(window.ft.framework.module.events.notifications.add, { title: `${message.from}: ${message.title}`, message: message.message });\n this.toaster.pop({\n type: 'success',\n body: `{ template: 'comment-template', data: { from: '${message.from}', title: '${message.title}', on: '${message.on.format('LT')}' } }`,\n bodyOutputType: 'templateWithData',\n showCloseButton: true,\n clickHandler: (toast, isCloseButton) => {\n this.toaster.clear(toast);\n if (isCloseButton == null) {\n this.navigateTo(message);\n }\n }\n });\n }\n this.$rootScope.$apply();\n }\n }\n\n private navigateTo(message: NewMessage): void {\n this.$state.go('app.groupmedia', { postId: message.postId });\n }\n\n private async fetchNewMessagesAsync(): Promise {\n const isLoggedIn = await this.ftLoginService.isLoggedInAsync();\n if (!isLoggedIn) {\n console.warn('unable to fetch messages when not logged in');\n return [];\n }\n\n const { token } = this.ftLoginService.getTokenData();\n const options: IRequestShortcutConfig = {\n headers: {\n 'Authorization': `Bearer ${token.value}`\n },\n transformResponse: appendTransform(this.$http.defaults.transformResponse, deserialize)\n };\n\n const groupId = this.ftSettingsService.get(window.appSettings.group.selected);\n const query = stringify({ groupId, since: moment().subtract(this.timeInSeconds + 5, 'seconds').toISOString(true) });\n const response = await this.$http.get(`${window.appModule.baseApiUrl}/groups/messages?${query}`, options);\n if (response.status !== 200) {\n return [];\n }\n\n return response.data.messages;\n }\n}\n\nfunction appendTransform(defaults: string | any[] | angular.IHttpResponseTransformer, transform: (value: Response) => void) {\n\n // We can't guarantee that the default transformation is an array\n defaults = angular.isArray(defaults) ? defaults : [defaults];\n\n // Append the new transformation to the defaults\n return defaults.concat(transform);\n}\n\nfunction deserialize(response: Response) {\n if (response.messages == null) {\n return;\n }\n\n for (const message of response.messages) {\n message.on = moment(message.on);\n }\n\n return response;\n}\n\nclass NotificationsComponent implements IComponentOptions {\n public controller: any;\n public template: string;\n public bindings: any;\n\n constructor() {\n this.bindings = {\n time: '<'\n };\n\n this.controller = NotificationsController;\n this.template = require('./template.html');\n }\n}\n\ninterface Response {\n messages: NewMessage[];\n}\n\ninterface NewMessage {\n postId: string;\n type: MessageType;\n id: string;\n title: string;\n from: string;\n on: moment.Moment;\n message: string;\n}\n\nenum MessageType {\n post = 'post',\n comment = 'comment'\n}\n\nwindow.appModule.component('notifications', new NotificationsComponent());\n","import { appModule } from '@/definitions';\nimport angular from 'angular';\n\n/**\n * Checklist-model\n * AngularJS directive for list of checkboxes\n * https://github.com/vitalets/checklist-model\n * License: MIT http://opensource.org/licenses/MIT\n */\n\nappModule.directive('checklistModel', [\n '$parse',\n '$compile',\n function($parse, $compile) {\n // contains\n function contains(arr: unknown[], item: unknown, comparator: (a: unknown, b: unknown) => boolean) {\n if (angular.isArray(arr)) {\n for (var i = arr.length; i--; ) {\n if (comparator(arr[i], item)) {\n return true;\n }\n }\n }\n return false;\n }\n\n // add\n function add(arr: unknown[], item: unknown, comparator: (a: unknown, b: unknown) => boolean) {\n arr = angular.isArray(arr) ? arr : [];\n if (!contains(arr, item, comparator)) {\n arr.push(item);\n }\n return arr;\n }\n\n // remove\n function remove(arr: unknown[], item: unknown, comparator: (a: unknown, b: unknown) => boolean) {\n if (angular.isArray(arr)) {\n for (var i = arr.length; i--; ) {\n if (comparator(arr[i], item)) {\n arr.splice(i, 1);\n break;\n }\n }\n }\n return arr;\n }\n\n // http://stackoverflow.com/a/19228302/1458162\n function postLinkFn(scope, elem, attrs) {\n // exclude recursion, but still keep the model\n var checklistModel = attrs.checklistModel;\n attrs.$set('checklistModel', null);\n // compile with `ng-model` pointing to `checked`\n $compile(elem)(scope);\n attrs.$set('checklistModel', checklistModel);\n\n // getter / setter for original model\n var getter = $parse(checklistModel);\n var setter = getter.assign;\n var checklistChange = $parse(attrs.checklistChange);\n var checklistBeforeChange = $parse(attrs.checklistBeforeChange);\n\n // value added to list\n var value = attrs.checklistValue ? $parse(attrs.checklistValue)(scope.$parent) : attrs.value;\n\n var comparator = angular.equals;\n\n if (Object.prototype.hasOwnProperty.call(attrs, 'checklistComparator')) {\n if (attrs.checklistComparator[0] == '.') {\n var comparatorExpression = attrs.checklistComparator.substring(1);\n comparator = function(a, b) {\n return a[comparatorExpression] === b[comparatorExpression];\n };\n } else {\n comparator = $parse(attrs.checklistComparator)(scope.$parent);\n }\n }\n\n // watch UI checked change\n scope.$watch(attrs.ngModel, function(newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n\n if (checklistBeforeChange && checklistBeforeChange(scope) === false) {\n scope[attrs.ngModel] = contains(getter(scope.$parent), value, comparator);\n return;\n }\n\n setValueInChecklistModel(value, newValue);\n\n if (checklistChange) {\n checklistChange(scope);\n }\n });\n\n function setValueInChecklistModel(value, checked) {\n var current = getter(scope.$parent);\n if (angular.isFunction(setter)) {\n if (checked === true) {\n setter(scope.$parent, add(current, value, comparator));\n } else {\n setter(scope.$parent, remove(current, value, comparator));\n }\n }\n }\n\n // declare one function to be used for both $watch functions\n function setChecked(newArr, oldArr) {\n if (checklistBeforeChange && checklistBeforeChange(scope) === false) {\n setValueInChecklistModel(value, scope[attrs.ngModel]);\n return;\n }\n scope[attrs.ngModel] = contains(newArr, value, comparator);\n }\n\n // watch original model change\n // use the faster $watchCollection method if it's available\n if (angular.isFunction(scope.$parent.$watchCollection)) {\n scope.$parent.$watchCollection(checklistModel, setChecked);\n } else {\n scope.$parent.$watch(checklistModel, setChecked, true);\n }\n }\n\n return {\n restrict: 'A',\n priority: 1000,\n terminal: true,\n scope: true,\n compile: function(tElement, tAttrs) {\n if (\n (tElement[0].tagName !== 'INPUT' || tAttrs.type !== 'checkbox') &&\n tElement[0].tagName !== 'MD-CHECKBOX' &&\n !tAttrs.btnCheckbox\n ) {\n throw 'checklist-model should be applied to `input[type=\"checkbox\"]` or `md-checkbox`.';\n }\n\n if (!tAttrs.checklistValue && !tAttrs.value) {\n throw 'You should provide `value` or `checklist-value`.';\n }\n\n // by default ngModel is 'checked', so we set it if not specified\n if (!tAttrs.ngModel) {\n // local scope var storing individual checkbox model\n tAttrs.$set('ngModel', 'checked');\n }\n\n return postLinkFn;\n }\n };\n }\n]);\n","import { appModule } from '@/definitions';\nimport Dropzone from 'dropzone';\nimport { FortyTwoRootScopeService } from '@/FortyTwoFramework';\n\nexport interface IFortyTwoDropzoneRootScopeService extends FortyTwoRootScopeService {\n dropzone: Dropzone;\n}\n\nappModule.directive('dropzone', ['$rootScope', function($rootScope: IFortyTwoDropzoneRootScopeService) {\n return function(scope, element, attrs) {\n const config = scope[attrs.dropzone];\n\n // create a Dropzone for the element with the given options\n $rootScope.dropzone = new Dropzone(element[0], config.options);\n\n for (const handler in config.eventHandlers) {\n $rootScope.dropzone.on(handler, config.eventHandlers[handler]);\n }\n };\n }\n]);\n","import { appModule } from '@/definitions';\nimport { IScope, IDirectiveFactory, IAugmentedJQuery, IDirective, IAttributes } from 'angular';\n\nexport interface IFileChangeScope extends IScope {\n fileChanged: () => void;\n}\n\nexport class FileChangeDirective implements IDirective {\n restrict = 'A';\n require = 'ngModel';\n scope = {\n fileChanged: '&onFileChanged'\n };\n\n link = (scope: IFileChangeScope, element: IAugmentedJQuery, attrs: IAttributes, ctrl: any) => {\n element.on('change', onChange);\n\n scope.$on('destroy', function() {\n element.off('change', onChange);\n });\n\n function onChange() {\n const newFileName = (element[0] as HTMLInputElement).files[0];\n ctrl.$setViewValue(newFileName);\n\n scope.$apply(() => {\n scope.fileChanged();\n });\n }\n };\n\n static factory(): IDirectiveFactory {\n return () => new FileChangeDirective();\n }\n}\n\nappModule.directive('fileChange', FileChangeDirective.factory());\n","import moment from 'moment';\n\nexport interface Story {\n id: string;\n name: string;\n date: moment.Moment;\n isDaily: boolean;\n publishOn: moment.Moment;\n blocks: StoryBlock[];\n storyTemplateId: string;\n}\n\nexport enum StoryBlockType {\n CardLeft = 'cardLeft',\n CardRight = 'cardRight',\n Images = 'images',\n Text = 'text',\n Presences = 'presences'\n}\n\nexport interface StoryTemplate {\n id: string;\n name: string;\n startDate: moment.Moment;\n endDate: moment.Moment;\n location: string;\n}\n\nexport interface StoryBlock {\n id: string;\n name: string;\n optional: boolean;\n blockType: StoryBlockType;\n content: StoryBlockContent;\n}\n\nexport interface TextBlock extends StoryBlock {\n title: string;\n text: string;\n}\n\nexport interface CardLeftBlock extends StoryBlock {\n title: string;\n text: string;\n imageUrl: string;\n}\n\nexport interface CardRightBlock extends StoryBlock {\n title: string;\n text: string;\n imageUrl: string;\n}\n\nexport interface ImagesBlock extends StoryBlock {\n imageUrls: string[];\n}\n\nexport const isTextBlock = (block: StoryBlock): block is TextBlock => block.blockType === StoryBlockType.Text;\nexport const isCardLeftBlock = (block: StoryBlock): block is CardLeftBlock => block.blockType === StoryBlockType.CardLeft;\nexport const isCardRightBlock = (block: StoryBlock): block is CardRightBlock => block.blockType === StoryBlockType.CardRight;\nexport const isImagesBlock = (block: StoryBlock): block is ImagesBlock => block.blockType === StoryBlockType.Images;\n\nexport interface StoryBlockContent {\n id: string;\n name: string;\n blockType: StoryBlockType;\n optionalVisible: boolean;\n}\n\nexport interface TextContentBlock extends StoryBlockContent {\n title: string;\n text: string;\n}\n\nexport interface CardContentBlock extends StoryBlockContent {\n title: string;\n text: string;\n imageUrl: string;\n image?: Image;\n}\n\nexport interface ImagesContentBlock extends StoryBlockContent {\n imageUrls: string[];\n images?: Image[];\n}\n\nexport interface Image {\n url?: string;\n content?: string;\n}\n\nexport const isTextContentBlock = (block: StoryBlockContent): block is TextContentBlock => block.blockType === StoryBlockType.Text;\nexport const isCardContentBlock = (block: StoryBlockContent): block is CardContentBlock => block.blockType === StoryBlockType.CardLeft || block.blockType === StoryBlockType.CardRight;\nexport const isImagesContentBlock = (block: StoryBlockContent): block is ImagesContentBlock => block.blockType === StoryBlockType.Images;\n\n\nexport const OnStoryDeserialized = (story: Story) => {\n story.date = moment(story.date);\n story.publishOn = moment(story.publishOn);\n};\n\nexport const OnStoryTemplateDeserialized = (storyTemplate: StoryTemplate) => {\n storyTemplate.startDate = moment(storyTemplate.startDate);\n storyTemplate.endDate = moment(storyTemplate.endDate);\n};","export class HttpError {\n constructor(public isReadable: boolean, public message: string, public status: number) {\n\n }\n}","import { IHttpService, IPromise, IQService } from 'angular';\nimport { ChildCare } from '@/data-models';\n\nimport AppConfigurationModel = ChildCare.Definitions.Configuration.AppConfigurationModel;\nimport FeatureModel = ChildCare.Definitions.Configuration.FeatureModel;\nimport moment from 'moment';\nimport {EnvironmentMode} from '@/environment';\n\n\nexport enum Feature {\n TravelPlanner = 'travelplanner',\n ActivityPlanner = 'activityplanner',\n LocationMessages = 'locationmessages',\n Stories = 'stories'\n}\n\nexport class FeatureService {\n public static $inject: string[] = ['$http', '$q'];\n\n private $http: IHttpService;\n private $q: IQService;\n\n private lastFetch?: moment.Moment;\n private features: FeatureModel[];\n\n constructor($http: IHttpService, $q: IQService) {\n this.$http = $http;\n this.$q = $q;\n }\n\n private getFeatures(): IPromise {\n if (this.lastFetch != null && this.lastFetch.diff(moment(), 'minutes') < 10) {\n return this.$q.resolve(this.features);\n }\n\n console.log('cache expired, refetching features');\n\n return this.$http\n .get(`${window.appModule.baseApiUrl}/configuration`)\n .then(response => {\n if (response.status !== 200) {\n return [];\n }\n\n this.features = response.data.features;\n\n console.log('enabled features for this instance');\n for (const enabledFeature of this.features) {\n console.log(`feature: ${enabledFeature.name} code: ${enabledFeature.code}`);\n }\n\n this.lastFetch = moment();\n return this.features;\n })\n .catch(() => []);\n }\n\n public isEnabled(feature: Feature): IPromise {\n if (env.mode === EnvironmentMode.development) {\n return this.$q.resolve(true);\n }\n\n return this.getFeatures().then(features => features.some(x => x.code === feature));\n }\n}\n\nwindow.appModule.service('FeatureService', FeatureService);\n","import { app, appModule, ft } from '@/definitions';\nimport { IPromise, IQService } from 'angular';\nimport { FortyTwoLoginService, FortyTwoRequest, FortyTwoRequestService } from '@/FortyTwoFramework';\nimport { ChildCare } from '@/data-models';\nimport moment from 'moment';\nimport { ApplicationInsightsService } from './application-insights-service';\nimport { HttpError } from './http-error';\nimport qs from 'qs';\nimport {OnStoryDeserialized, OnStoryTemplateDeserialized, Story, StoryBlockContent, StoryTemplate} from '@/stories/types';\n\ntype TimesRequest = ChildCare.Definitions.Registration.TimesRequest;\ntype Gender = ChildCare.Definitions.Common.Gender;\ntype RequestBeforeContractCommandTimes = ChildCare.Definitions.GroupApp.RequestBeforeContractCommandTimes;\ntype RequestBeforeContractDayCommand = ChildCare.Definitions.GroupApp.RequestBeforeContractDayCommand;\ntype CreateStudyDayRegistrationCommand = ChildCare.Definitions.Planning.CreateStudyDayRegistrationCommand;\ntype CreateOrUpdateActivityPlanningCommand = ChildCare.Definitions.Activity.CreateOrUpdateActivityPlanningCommand;\ntype LocationEmployeesResponse = ChildCare.Definitions.Locations.Responses.LocationEmployeesResponse;\ntype LocationsResponse = ChildCare.Definitions.Locations.Responses.LocationsResponse;\ntype TransportRidesResponse = ChildCare.Definitions.Transport.Responses.TransportRidesResponse;\ntype TransportChildrenResponse = ChildCare.Definitions.Transport.Responses.TransportChildrenResponse;\ntype TransportVehicleResponse = ChildCare.Definitions.Transport.Responses.TransportVehicleResponse;\ntype GroupsResponse = ChildCare.Definitions.GroupApp.GroupsResponse;\ntype CreateOrUpdateRidesCommand = ChildCare.Definitions.Transport.Commands.CreateOrUpdateRidesCommand;\ntype PresencesCommand = ChildCare.Definitions.GroupApp.PresencesCommand;\ntype PresencesResponse = ChildCare.Definitions.GroupApp.PresencesResponse;\ntype ActivityAddEmployeeCommand = ChildCare.Definitions.Activity.ActivityAddEmployeeCommand;\ntype ActivityAddGroupCommand = ChildCare.Definitions.Activity.ActivityAddGroupCommand;\ntype CreateOrUpdateAlbumCommand = ChildCare.Definitions.Media.CreateOrUpdateAlbumCommand;\ntype WriteLocationsResponse = ChildCare.Definitions.GroupApp.WriteLocationsResponse;\ntype WriteAudienceResponse = ChildCare.Definitions.GroupApp.WriteAudienceResponse;\ntype GroupRequestsApprovalResponse = ChildCare.Definitions.GroupApp.GroupRequestsApprovalResponse;\n\ninterface SetProfileImageCommand {\n type: string;\n id: string;\n content: string;\n}\n\nexport interface IParent {\n parentId: string;\n lastName: string;\n firstName: string;\n lastNamePrefix: string;\n initials: string;\n birthDate: moment.Moment;\n gender: Gender;\n emailAddress: string;\n phoneNumber: string;\n mobileNumber: string;\n phoneWork: string;\n}\n\nexport interface IAddress {\n street: string;\n streetNumber: string;\n postalCode: string;\n city: string;\n countryId: string;\n}\n\nexport interface ICountry {\n countryId: string;\n code: string;\n name: string;\n}\n\nexport interface IParentDetailResponse {\n parent: IParent;\n address: IAddress;\n countries: ICountry[];\n}\n\nexport interface IParentDetailUpdateRequest {\n parentId: string;\n lastName: string;\n firstName: string;\n lastNamePrefix: string;\n initials: string;\n birthDate: moment.Moment | string;\n gender: Gender;\n emailAddress: string;\n phoneNumber: string;\n mobileNumber: string;\n phoneWork: string;\n street: string;\n streetNumber: string;\n postalCode: string;\n city: string;\n countryId: string;\n}\n\nexport class AppDataService {\n public static $inject = ['$q', 'ftLoginService', 'ftRequest', 'ApplicationInsightsService'];\n\n private $q: IQService;\n private ftLoginService: FortyTwoLoginService;\n private ftRequest: FortyTwoRequestService;\n private applicationInsights: ApplicationInsightsService;\n\n constructor($q: IQService, ftLoginService: FortyTwoLoginService, ftRequest: FortyTwoRequestService, applicationInsights: ApplicationInsightsService) {\n this.$q = $q;\n this.ftLoginService = ftLoginService;\n this.ftRequest = ftRequest;\n this.applicationInsights = applicationInsights;\n }\n\n public doLoggedInRequest(request: FortyTwoRequest) {\n return this.ftLoginService.isLoggedInAsync()\n .then(() => this.doRequest(request, true));\n }\n\n public doRequest(request: FortyTwoRequest, loggedIn = false): IPromise {\n return this.ftRequest.requestAsync(request, loggedIn).then(\n response => response.data,\n response => this.handleErrorResponse(response)\n );\n }\n\n private handleErrorResponse(response: any): IPromise {\n const data = response?.data;\n if (data == null) {\n return this.$q.reject(new HttpError(false, undefined, response.status));\n }\n\n const message = data.message ?? data.exceptionMessage;\n const isReadable = message != null;\n\n return this.$q.reject(new HttpError(isReadable, message, response.status));\n }\n\n public getActivity(activityId: string) {\n return this.doLoggedInRequest({\n method: 'GET',\n path: `activities/${activityId}/library`\n });\n }\n\n public setActivityToPeriodic(activityPlanningId: string, repeatUntil: string) {\n return this.doLoggedInRequest({\n method: 'POST',\n path: `activities/${activityPlanningId}/periodic`,\n data: {\n activityPlanningId,\n repeatUntil: repeatUntil,\n copyAssignedEmployees: true\n }\n });\n }\n\n public setActivityToSeries(activityPlanningId: string, repeatUntil: string) {\n return this.doLoggedInRequest({\n method: 'POST',\n path: `activities/${activityPlanningId}/series`,\n data: {\n activityPlanningId,\n repeatUntil: repeatUntil,\n copyAssignedEmployees: true\n }\n });\n }\n\n public addEmployeeToActivity(activityPlanningId: string, command: ActivityAddEmployeeCommand) {\n return this.doLoggedInRequest({\n method: 'POST',\n path: `activities/${activityPlanningId}/employees`,\n data: command\n });\n }\n\n public removeEmployeeFromActivity(activityPlanningId: string, employeeId: string) {\n return this.doLoggedInRequest({\n method: 'DELETE',\n path: `activities/${activityPlanningId}/employees/${employeeId}`\n });\n }\n\n public getEmployeesForActivityPlanning(activityPlanningId: string) {\n return this.doLoggedInRequest({\n method: 'GET',\n path: `activities/${activityPlanningId}/employees`\n });\n }\n\n public addGroupToActivity(activityPlanningId: string, command: ActivityAddGroupCommand) {\n return this.doLoggedInRequest({\n method: 'POST',\n path: 'activities/' + activityPlanningId + '/groups',\n data: command\n });\n }\n\n public removeGroupFromActivity(activityPlanningId: string, groupId: string) {\n return this.doLoggedInRequest({\n method: 'DELETE',\n path: `activities/${activityPlanningId}/groups/${groupId}`\n });\n }\n\n public getGroupsForActivityPlanning(activityPlanningId: string) {\n return this.doLoggedInRequest({\n method: 'GET',\n path: `activities/${activityPlanningId}/groups`\n });\n }\n\n public getActivityChildrenForGroups(groupIds: string[], date: moment.Moment, start: moment.Duration, end: moment.Duration): IPromise<{ children: ChildCare.Definitions.Child[] }> {\n const query = qs.stringify({\n groupIds,\n date: date.toISOString(true),\n start: start.toISOString(),\n end: end.toISOString()\n });\n\n return this.doLoggedInRequest({\n method: 'GET',\n path: `activities/children?${query}`\n });\n }\n\n public getEmployeesForLocation(locationId: string, date: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: `transport/${locationId}/employees?date=${date.format('YYYY-MM-DD')}`\n });\n }\n\n public getUser() {\n return this.doLoggedInRequest({\n path: 'account/validate',\n method: 'GET'\n });\n }\n\n public saveProfileImage(request: SetProfileImageCommand) {\n request.content = request.content.replace(/^data:image\\/(png|jpg|jpeg);base64,/gi, '');\n return this.doLoggedInRequest({\n path: 'parent/profileimage',\n method: 'POST',\n data: request\n });\n }\n\n public getActivitiesByDates(locationId: string, from: moment.Moment, to: moment.Moment) {\n return this.doLoggedInRequest({\n path: `locations/${locationId}/activities/${from.format('YYYY-MM-DD')}/to/${to.format('YYYY-MM-DD')}`\n });\n }\n\n public getExistingActivityTypes(locationId: string) {\n return this.doLoggedInRequest({\n path: `locations/${locationId}/activities/library`\n });\n }\n\n public saveActivity(command: CreateOrUpdateActivityPlanningCommand, activityPlanningId: string | undefined) {\n return this.doLoggedInRequest({\n path: !activityPlanningId ? 'activities' : `activities/${activityPlanningId}`,\n method: !activityPlanningId ? 'POST' : 'PUT',\n data: command\n });\n }\n\n public deleteActivity(activityPlanningId: string) {\n return this.doLoggedInRequest({\n path: `activities/${activityPlanningId}`,\n method: 'DELETE'\n });\n }\n\n public saveTransportRides(command: CreateOrUpdateRidesCommand): IPromise {\n return this.doLoggedInRequest({\n path: `transport/rides/${command.employeeId}`,\n method: 'POST',\n data: command\n });\n }\n\n public getTransportChildren(locationId: string, moment: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: `transport/${locationId}/children/${moment.format('YYYY-MM-DD')}`\n });\n }\n\n public getTransportRides(locationId: string, moment: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: `transport/${locationId}/rides/${moment.format('YYYY-MM-DD')}`\n });\n }\n\n public getTransportVehicles(moment: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: `transport/vehicles/${moment.format('YYYY-MM-DD')}`\n });\n }\n\n public getLocations(): IPromise {\n return this.doLoggedInRequest({\n path: 'locations'\n });\n }\n\n public getTransportLocations(moment: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: `transport/locations/${moment.format('YYYY-MM-DD')}`\n });\n }\n\n public updateParentDetails(updateRequest: IParentDetailUpdateRequest) {\n if (typeof updateRequest.birthDate !== 'string') {\n updateRequest.birthDate = updateRequest.birthDate.format('DD/MM/YYYY');\n }\n\n return this.doLoggedInRequest({\n path: 'groups/parentdetail',\n method: 'POST',\n data: updateRequest\n });\n }\n\n public getParentDetails(parentId: string) {\n return this.doLoggedInRequest({\n path: 'groups/parentdetail?parentId=' + parentId,\n method: 'GET'\n });\n }\n\n public getConfigurationAsync() {\n return this.doRequest({\n path: 'account/configuration'\n });\n }\n\n public getGroupsAsync(): IPromise {\n return this.doLoggedInRequest({ path: 'groups/groups' });\n }\n\n public getGroupsByLocation(locationId: string) {\n return this.doLoggedInRequest({\n path: `locations/${locationId}/groups`,\n method: 'GET'\n });\n }\n\n public reportChildAbsentAsync(command: ChildCare.Planning.Commands.ReportAbsent.Command) {\n return this.doLoggedInRequest({\n path: 'groups/reportchildabsent',\n method: 'POST',\n data: command\n });\n }\n\n public reportChildSickAsync(command: ChildCare.Planning.Commands.ReportAbsent.Command) {\n return this.doLoggedInRequest({\n path: 'groups/reportchildsick',\n method: 'POST',\n data: command\n });\n }\n\n public getPossibleIncidentalDays(childId: string, date: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/requestincidentalday?date=' + date,\n method: 'GET'\n });\n }\n\n public requestIncidentalDay(childId: string, remarks, date: string, groupId: string, useCreditHours, selectedTimes) {\n return this.doLoggedInRequest({\n path: 'groups/requestincidentalday',\n method: 'POST',\n data: {\n childId: childId,\n remarks: remarks,\n date: date,\n groupId: groupId,\n useCreditHours: useCreditHours,\n selectedTimes: selectedTimes\n }\n });\n }\n\n public getPossibleBeforeContractDays(childId: string, date: moment.Moment) {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/requestbeforecontractday?date=' + date.format('YYYY-MM-DD'),\n method: 'GET'\n });\n }\n\n public requestBeforeContractDay(\n childId: string,\n remarks: string,\n date: moment.Moment,\n groupId: string,\n selectedTimes: RequestBeforeContractCommandTimes[]\n ) {\n const command: RequestBeforeContractDayCommand = {\n childId: childId,\n remarks: remarks,\n date: date.format('YYYY-MM-DD'),\n groupId: groupId,\n selectedTimes: selectedTimes\n };\n\n return this.doLoggedInRequest({\n path: 'groups/requestbeforecontractday',\n method: 'POST',\n data: command\n });\n }\n\n public getPossibleSwapDays(childId: string, fromDate: string, toDate) {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/requestswapday?fromdate=' + fromDate + '&todate=' + toDate,\n method: 'GET'\n });\n }\n\n public requestSwapDay(childId: string, remarks, fromDate: string, toDate, groupId: string, selectedFromTimes, selectedToTimes) {\n return this.doLoggedInRequest({\n path: 'groups/requestswapday',\n method: 'POST',\n data: {\n childId: childId,\n remarks: remarks,\n fromDate: fromDate,\n toDate: toDate,\n groupId: groupId,\n selectedFromTimes: selectedFromTimes,\n selectedToTimes: selectedToTimes\n }\n });\n }\n\n public getRequestStudyDays(childId: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/requeststudyday',\n method: 'GET'\n });\n }\n\n public requestStudyDays(studyDay, childId: string, groupId: string, useCreditHours) {\n const command: CreateStudyDayRegistrationCommand = {\n childId: childId,\n date: studyDay.date,\n planningId: studyDay.planningId,\n studydayId: studyDay.id,\n groupId: groupId,\n useCreditHours: useCreditHours\n };\n\n return this.doLoggedInRequest({\n path: 'groups/requeststudyday',\n method: 'POST',\n data: command\n });\n }\n\n public getPossibleTransferGroups(childId: string, date: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/transfertogroup?date=' + date,\n method: 'GET'\n });\n }\n\n public requestTransferGroup(childId: string, date: string, groupId: string, selectedTimes) {\n return this.doLoggedInRequest({\n path: 'groups/transfertogroup',\n method: 'POST',\n data: {\n childId: childId,\n date: date,\n groupId: groupId,\n selectedTimes: selectedTimes\n }\n });\n }\n\n public getCalendarTimeline(groupId: string, date: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + groupId + '/timeline?date=' + date,\n method: 'GET'\n });\n }\n\n public getRequestList(groupId: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + groupId + '/requests/list',\n method: 'GET'\n });\n }\n\n public getRequestDetails(groupId: string, registrationId: string, typeOfRegistration): IPromise {\n return this.doLoggedInRequest({\n path:\n 'groups/' +\n groupId +\n '/requests/approval?registrationId=' +\n registrationId +\n '&typeOfRegistration=' +\n typeOfRegistration,\n method: 'GET'\n });\n }\n\n public sendRequestAction(groupId: string, registrationId: string, typeOfRegistration, action, remarks) {\n return this.doLoggedInRequest({\n path: 'groups/' + groupId + '/requests/approve',\n method: 'POST',\n data: {\n registrationId: registrationId,\n typeOfRegistration: typeOfRegistration,\n action: action,\n remarks: remarks\n }\n });\n }\n\n public getGroupTimelineAsync(groupId: string, startIndex?: string | number, pageSize?: string | number) {\n pageSize = pageSize || 50;\n startIndex = startIndex || 0;\n\n let path = 'groups/' + groupId + '/mediatimeline';\n const qs: string[] = [];\n\n if (ft.hasValue(startIndex)) {\n qs.push('startindex=' + startIndex);\n }\n\n if (ft.hasValue(pageSize)) {\n qs.push('pagesize=' + pageSize);\n }\n\n if (qs.length) {\n path += '?' + qs.join('&');\n }\n\n const obj = {\n path: path\n };\n\n return this.doLoggedInRequest(obj);\n }\n\n public getAudiencesAsync(childId: string): IPromise {\n const path = childId ? `posts/audiences?childId=${childId}` : 'posts/audiences';\n return this.doLoggedInRequest({\n path: path,\n method: 'GET'\n });\n }\n\n public getMediaForAlbumAsync(albumId: string): IPromise {\n return this.doLoggedInRequest({\n path: `media/album/${albumId}`,\n method: 'GET'\n });\n }\n\n public getMediaAlbumsAsync(showAll: boolean): IPromise {\n return this.doLoggedInRequest({\n path: `media/albums?showAllAlbums=${showAll}`,\n method: 'GET'\n });\n }\n\n public addAlbumAsync(title: string, description: string): IPromise {\n return this.doLoggedInRequest({\n path: 'media/albums',\n method: 'POST',\n data: { title, description } as CreateOrUpdateAlbumCommand\n });\n }\n\n public getAlbumsUntilAsync(dateTime: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: 'albums/until/' + dateTime.utc().format('YYYY-MM-DDTHH-mm-ss') + '/' + app.settings.mediaAlbums.fetchRange,\n method: 'GET'\n });\n }\n\n public getAlbumsSinceAsync(dateTime: moment.Moment): IPromise {\n return this.doLoggedInRequest({\n path: 'albums/since/' + dateTime.utc().format('YYYY-MM-DDTHH-mm-ss'),\n method: 'GET'\n });\n }\n\n public getMessagesAsync(dateTime: string, childId: string): IPromise {\n return this.doLoggedInRequest({\n path:\n 'posts/until/' +\n (childId ? childId + '/' : '') +\n dateTime +\n '/' +\n app.settings.conversations.fetchRange,\n method: 'GET'\n });\n }\n\n public getMessagesSinceAsync(dateTime: string, childId: string): IPromise {\n return this.doLoggedInRequest({\n path: 'posts/since/' + (childId ? childId + '/' : '') + dateTime,\n method: 'GET'\n });\n }\n\n public getReminderFor(childId: string, date: string): IPromise {\n return this.doLoggedInRequest({\n path: 'posts/reminders/' + childId + '/' + date,\n method: 'GET'\n });\n }\n\n public getPost(message): IPromise {\n return this.doLoggedInRequest({\n path: 'posts/post/' + message.postId,\n method: 'GET'\n });\n }\n\n public getDiaryPresence(groupId: string, date: string): IPromise {\n return this.doLoggedInRequest({\n path: `diary/presences/${groupId}?date=${date}`,\n method: 'GET'\n });\n }\n\n public getDiaryEntryTypes(): IPromise {\n return this.doLoggedInRequest({\n path: 'diary/types',\n method: 'GET'\n });\n }\n\n public saveDiaryEntry(childIds: string[], diaryEntryTypeId: string, text: string, time: moment.Moment, diaryScheduleId: string): IPromise {\n\n const tasks = [];\n\n for (const childId of childIds) {\n tasks.push(this.doLoggedInRequest({\n path: `children/${childId}/diaries`,\n method: 'POST',\n data: {\n diaryEntryTypeId: diaryEntryTypeId,\n entryText: text,\n entryMoment: time != null ? time.format('YYYY/MM/DD HH:mm:SS') : null,\n diaryScheduleId: diaryScheduleId\n }\n }));\n }\n\n return this.$q.all(tasks);\n }\n\n public deleteDiaryEntry(childId: string, diaryEntryId: string): IPromise {\n return this.doLoggedInRequest({\n path: `children/${childId}/diaries/${diaryEntryId}`,\n method: 'DELETE'\n });\n }\n\n public getDocumentsForChild(childId: string) {\n return this.doLoggedInRequest({\n method: 'GET',\n path: 'child/' + childId + '/documents?externalSystem=groupapp'\n });\n }\n\n public getGroupActivitiesAsync(groupId: string) {\n let item;\n const items = [];\n let i = 0;\n const max = 50;\n\n while (i < max) {\n item = {\n id: 'id-' + i,\n createdOn: '2017-08-16 11:32',\n icon: 'zwemmen',\n title: 'Activiteit ' + i,\n description:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras et ipsum risus. Aliquam eu dignissim lorem. Pellentesque tincidunt, ipsum nec rhoncus feugiat, dolor tellus euismod magna, id ullamcorper eros felis eget leo.',\n developmentArea: 'Creatieve ontwikkeling',\n activityArea: 'Sport',\n minimalAge: 2,\n maximumAge: 4\n };\n\n items.push(item);\n i += 1;\n }\n\n const dfd = this.$q.defer();\n dfd.resolve(items);\n return dfd.promise;\n }\n\n public saveConversationAsync(message, audiences, childId: string) {\n const path = 'posts/post';\n\n return this.doLoggedInRequest({\n path: path,\n method: 'POST',\n data: {\n title: message.title,\n content: message.content,\n reminderDate: message.reminderDate,\n audiences: audiences,\n childId: childId\n }\n });\n }\n\n public answerToPostAsync(conversation: ChildCare.Definitions.GroupApp.PostResponse | ChildCare.Definitions.GroupApp.PostsResponseItem, replyComment: ChildCare.Definitions.GroupApp.PostComment, answer: string): IPromise {\n return this.doLoggedInRequest({\n path: 'posts/post',\n method: 'POST',\n data: {\n postId: conversation.postId,\n content: answer,\n commentId: replyComment ? replyComment.commentId : null\n }\n });\n }\n\n public getAudiences(locations: ChildCare.Definitions.GroupApp.WriteLocation[], careTypes: ChildCare.Definitions.GroupApp.WriteLocationCareType[]): IPromise {\n return this.doLoggedInRequest({\n path: 'groups/audiences',\n method: 'POST',\n data: {\n locations: locations.map(x => x.id),\n careTypes: careTypes.map(x => x.careType),\n date: undefined\n } as ChildCare.Definitions.GroupApp.LocationsToAudiencesRequest\n });\n }\n\n public setPasswordAsync(accessKey, password) {\n return this.doRequest({\n path: 'account/setpassword' + (!password ? '?accessKey=' + accessKey : ''),\n method: !password ? 'GET' : 'POST',\n data: !password ? null : { accessKey: accessKey, password: password }\n });\n }\n\n public resetPasswordAsync(userName) {\n return this.doRequest({\n path: 'account/resetpassword',\n method: 'POST',\n data: { userName: userName }\n });\n }\n\n public oauthLoginAsync(token: string) {\n const request: FortyTwoRequest = {\n path: 'account/token',\n method: 'GET',\n headers: {\n Authorization: `Bearer ${token}`\n }\n };\n\n return this.doRequest(request);\n }\n\n public changePasswordAsync(originalPassword, newPassword) {\n return this.doLoggedInRequest({\n path: 'account/changepassword',\n method: 'POST',\n data: {\n originalPassword: originalPassword,\n newPassword: newPassword\n }\n });\n }\n\n public setLanguageAsync(languageId: string) {\n return this.doLoggedInRequest({\n path: 'account/setlanguage',\n method: 'POST',\n data: {\n languageId: languageId\n }\n });\n }\n\n public getEmergencyList(groupId: string = null) {\n return this.doLoggedInRequest({\n path: 'groups/childrenonlocation' + (groupId === null ? '' : '?groupId=' + groupId),\n method: 'GET'\n });\n }\n\n public getChildInfo(childId: string): IPromise {\n return this.doLoggedInRequest({\n path: 'groups/' + childId + '/presenceschildinfo',\n method: 'GET'\n });\n }\n\n public getPresenceOverviewData(groupId: string, date: moment.Moment, fetchAllChildren?: boolean): IPromise {\n return this.doLoggedInRequest({\n path:\n 'groups/' +\n groupId +\n '/presences?date=' +\n date.format('YYYY-MM-DD') +\n '&fetchallchildren=' +\n fetchAllChildren,\n method: 'GET'\n });\n }\n\n public getPlanning(childId: string, month, year) {\n return this.doLoggedInRequest({\n path: 'child/' + childId + '/planning',\n method: 'POST',\n data: {\n childId: childId,\n month: month,\n year: year\n }\n });\n }\n\n public savePresence(command: PresencesCommand): IPromise {\n this.applicationInsights.trackEvent('Creating presences', command);\n\n return this.doLoggedInRequest({\n path: 'groups/presences',\n method: 'POST',\n data: command\n });\n }\n\n public saveChildInfo(command: ChildCare.Definitions.GroupApp.PresencesUpdateChildInfoCommand): IPromise {\n return this.doLoggedInRequest({\n path: 'groups/presencesupdatechildinfo',\n method: 'POST',\n data: command\n });\n }\n\n public saveMedicalInfo(command: ChildCare.Definitions.GroupApp.PresencesUpdateMedicalInfoCommand): IPromise {\n return this.doLoggedInRequest({\n path: 'groups/presencesupdatemedicalinfo',\n method: 'POST',\n data: command\n });\n }\n\n public switchGroup(groupId: string) {\n return this.doLoggedInRequest({\n path: 'groups/' + groupId + '/switch',\n method: 'GET'\n });\n }\n\n public getAvailableTimes(childId: string, timesRequest: TimesRequest) {\n const httpRequest: FortyTwoRequest = {\n path: `child/${childId}/times`,\n method: 'POST',\n data: timesRequest\n };\n\n return this.doLoggedInRequest(httpRequest);\n }\n\n public getChildLabels(childId: string): IPromise {\n return this.doLoggedInRequest({\n path: `child/${childId}/labels`,\n method: 'GET'\n });\n }\n\n public getAllChildLabels(): IPromise {\n return this.doLoggedInRequest({\n path: 'child/labels',\n method: 'GET'\n });\n }\n\n public addChildLabel(childId: string, labelId: string, description: string = null): IPromise {\n const command: ChildCare.Definitions.GroupApp.AddChildLabelCommand = {\n childId,\n labelId,\n description\n };\n\n return this.doLoggedInRequest({\n path: `child/${childId}/labels`,\n method: 'POST',\n data: command\n });\n }\n\n public removeChildLabel(childId: string, labelId: string): IPromise {\n return this.doLoggedInRequest({\n path: `child/${childId}/labels/${labelId}`,\n method: 'DELETE'\n });\n }\n\n public getWriteLocations(): IPromise {\n return this.doLoggedInRequest({\n path: 'groups/writelocations',\n method: 'GET'\n });\n }\n\n public saveLocationConversation(message, audiences: string[], caretypes: string[]) {\n const command = {\n title: message.title,\n content: message.content,\n audiences: audiences,\n caretypes: caretypes\n };\n\n return this.doLoggedInRequest({\n path: 'groups/locationpost',\n method: 'POST',\n data: command\n });\n }\n\n public getStories(groupId: string): IPromise {\n return this.doLoggedInRequest({\n path: `stories/${groupId}`,\n method: 'GET'\n }).then(stories => {\n for (const story of stories) {\n OnStoryDeserialized(story);\n }\n\n return stories;\n });\n }\n\n public getStoryTemplatesForGroup(groupId: string): IPromise {\n return this.doLoggedInRequest({\n path: `storytemplates/${groupId}`,\n method: 'GET'\n }).then(storyTemplates => {\n for (const storyTemplate of storyTemplates) {\n OnStoryTemplateDeserialized(storyTemplate);\n }\n return storyTemplates;\n });\n }\n\n public createStory(storyTemplateId: string, groupId: string): IPromise {\n const story = {\n storyTemplateId: storyTemplateId,\n groupId: groupId\n };\n return this.doLoggedInRequest({\n path: 'story',\n method: 'POST',\n data: story\n });\n }\n\n public updateStory(story: Story): IPromise {\n return this.doLoggedInRequest({\n path: `story/${story.id}`,\n method: 'PUT',\n data: story\n });\n }\n\n public getStory(storyId: string): IPromise {\n return this.doLoggedInRequest({\n path: `story/${storyId}`,\n method: 'GET'\n }).then(story => {\n OnStoryDeserialized(story);\n return story;\n });\n }\n\n public getStoryPdf(storyId: string): IPromise {\n return this.doLoggedInRequest({\n path: `storypreview/${storyId}?childId=00000000-0000-0000-0000-000000000000`,\n method: 'GET'\n }).then(story => {\n return story;\n });\n }\n\n public saveContentBlock(storyId: string, storyBlockId: string, content: StoryBlockContent): IPromise {\n return this.doLoggedInRequest({\n path: `story/${storyId}/${storyBlockId}`,\n method: 'POST',\n data: content\n });\n }\n}\n\nappModule.service('AppDataService', AppDataService);\n","import { ApplicationInsights, ITelemetryItem, DistributedTracingModes } from '@microsoft/applicationinsights-web';\nimport { FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { IHttpService, IQService, IRootScopeService, ILocationService, IRequestConfig } from 'angular';\nimport { ChildCare } from '@/data-models';\nimport uuidv1 from 'uuid/v1';\nimport { ft, appModule } from '@/definitions';\n\nconst instanceId = uuidv1();\n\ntype AppConfigurationModel = ChildCare.Definitions.Configuration.AppConfigurationModel;\n\nexport class ApplicationInsightsService {\n public static $inject = ['$rootScope', '$http', '$q', '$location', 'ftLoginService'];\n\n private $http: IHttpService;\n private $q: IQService;\n private loginService: FortyTwoLoginService;\n public static insights: ApplicationInsights;\n\n constructor($rootScope: IRootScopeService, $http: IHttpService, $q: IQService, $location: ILocationService, loginService: FortyTwoLoginService) {\n this.$http = $http;\n this.$q = $q;\n this.loginService = loginService;\n\n this.setup = this.setup.bind(this);\n this.trackEvent = this.trackEvent.bind(this);\n\n if (ApplicationInsightsService.insights == null) {\n this.loginService.isLoggedInAsync().then(async isLoggedIn => {\n if (isLoggedIn) {\n await this.setup();\n this.trackEvent('User authenticated');\n } else {\n $rootScope.$on(ft.framework.module.events.authentication.login, async () => {\n await this.setup();\n this.trackEvent('User authenticated');\n });\n }\n });\n }\n }\n\n public trackEvent(name: string, properties?: any): void {\n if (ApplicationInsightsService.insights == null) {\n return;\n }\n\n try {\n ApplicationInsightsService.insights.trackEvent({ name: name, properties });\n } catch (e) {\n console.log(`Failed logging event ${name} to application insights`);\n console.exception(e);\n }\n }\n\n public async setup(): Promise {\n const [key, user] = await this.$q.all([\n this.getInstrumentationKey(),\n this.loginService.getCurrentUserAsync()\n ]);\n\n if (key == null || user == null) {\n return;\n }\n\n try {\n ApplicationInsightsService.insights = new ApplicationInsights({\n config: {\n connectionString: `InstrumentationKey=${key}`,\n enableAutoRouteTracking: true,\n autoTrackPageVisitTime: true\n }\n });\n\n ApplicationInsightsService.insights.loadAppInsights();\n ApplicationInsightsService.insights.trackPageView();\n\n const telemetryInitializer = (item: ITelemetryItem): void | boolean => {\n item.tags['ai.cloud.role'] = 'GroupApp';\n item.tags['ai.cloud.roleInstance'] = instanceId;\n item.data.Tenant = user.tenantName;\n };\n\n ApplicationInsightsService.insights.addTelemetryInitializer(telemetryInitializer);\n\n const senatize = (value: string) => {\n return value?.replace(',', '-').replace(';', '-').replace('=', '-').replace(' ', '-').replace('|', '-');\n };\n\n ApplicationInsightsService.insights.setAuthenticatedUserContext(senatize(user.name), senatize(user.tenantName), true);\n } catch (e) {\n console.log('Failed initializing Application Insights');\n console.exception(e);\n }\n }\n\n private async getInstrumentationKey(): Promise {\n try {\n const response = await this.$http.get(`${window.appModule.baseApiUrl}/configuration`);\n if (response.status !== 200) {\n return null;\n }\n\n return response.data.settings.telemetryInstrumentationKey;\n }\n catch (e) {\n console.log('Failed obtaining Application Insights instrumentation key from configuration call');\n console.exception(e);\n return null;\n }\n }\n}\n\nconst insightsInterceptor = function () {\n return {\n request: function (config: IRequestConfig) {\n if (config.method != 'OPTIONS' && ApplicationInsightsService.insights != null) {\n config.headers['request-id'] = ApplicationInsightsService.insights.context.telemetryTrace.traceID;\n }\n\n return config;\n }\n };\n};\n\n/*appModule.config(['$httpProvider', function ($httpProvider: IHttpProvider) {\n $httpProvider.interceptors.push(insightsInterceptor);\n}]);*/\n\nappModule.service('ApplicationInsightsService', ApplicationInsightsService);","import { appModule } from '@/definitions';\nimport moment, { Moment, Duration } from 'moment';\nimport { IScope } from 'angular';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ILoadingBar } from '@/models';\nimport { ChildCare } from '@/data-models';\n\ntype Command = ChildCare.Planning.Commands.ReportAbsent.Command;\n\n\nfunction formatTime(duration: moment.Duration): string {\n if (duration == null) {\n return null;\n }\n\n return moment.utc(duration.as('milliseconds')).format('HH:mm');\n}\n\ninterface Scope extends IScope {\n isLoading: boolean;\n valid: boolean;\n save: () => void;\n canSave: () => boolean;\n displayDialog: (field: 'startTime' | 'endTime') => void;\n formatTime: (duration: Duration) => string;\n close: () => void;\n form: {\n startDate: Date;\n startTime: Duration;\n endDate: Date;\n endTime: Duration;\n reason: string;\n };\n validation: { [key: string]: boolean };\n isValid: (field: string) => boolean;\n}\n\nclass AbsentModalController {\n public static $inject = ['$scope', '$uibModalInstance', 'AppDataService', 'childId', 'LoadingBar', 'mdcDateTimeDialog'];\n\n private $scope: Scope;\n private $uibModalInstance: IModalInstanceService;\n private dataService: AppDataService;\n private childId: string;\n private dateTimeDialog: any;\n\n public constructor($scope: Scope, $uibModalInstance: IModalInstanceService, dataService: AppDataService, childId: string, loadingBar: ILoadingBar, dateTimeDialog: any) {\n this.$scope = $scope;\n this.$uibModalInstance = $uibModalInstance;\n this.dataService = dataService;\n this.childId = childId;\n this.dateTimeDialog = dateTimeDialog;\n\n $scope.$watch('isLoading', (isLoading: boolean) => loadingBar.show = isLoading);\n\n this.$scope.form = {\n startDate: moment().toDate(),\n startTime: moment.duration(moment().format('HH:mm')),\n endDate: moment().toDate(),\n endTime: moment.duration('23:59'),\n reason: null\n };\n\n this.$scope.formatTime = formatTime;\n this.$scope.close = this.close.bind(this);\n this.$scope.displayDialog = this.displayDialog.bind(this);\n this.$scope.save = this.save.bind(this);\n this.$scope.canSave = this.canSave.bind(this);\n this.$scope.isValid = this.isValid.bind(this);\n }\n\n\n private isValid(field: string): boolean {\n if (this.$scope.validation == null) {\n return true;\n }\n\n return this.$scope.validation[field] ?? true;\n }\n\n\n private close(): void {\n this.$uibModalInstance.dismiss();\n }\n\n private displayDialog(field: 'startTime' | 'endTime') {\n this.dateTimeDialog.show({\n date: false,\n currentDate: this.$scope.form[field],\n minuteSteps: 1,\n autoOk: true,\n disableParentScroll: true\n }).then((date: Date) => {\n this.$scope.form[field] = moment.duration(moment(date).format('HH:mm'));\n });\n }\n\n private async save() {\n this.$scope.validation = this.validate(this.$scope.form);\n if (Object.keys(this.$scope.validation).length > 0) {\n return;\n }\n\n const { startDate, startTime, endDate, endTime, reason } = this.$scope.form;\n\n this.$scope.isLoading = true;\n\n const start = moment(startDate).startOf('day').add(moment.duration(startTime));\n let end: moment.Moment = undefined;\n if (endDate != null) {\n end = moment(endDate).startOf('day');\n if (endTime != null) {\n end.add(moment.duration(endTime));\n }\n }\n\n const command: Command = {\n childIds: [this.childId],\n start: start.format('YYYY-MM-DDTHH:mm:ss'),\n end: end?.format('YYYY-MM-DDTHH:mm:ss'),\n type: 'afwezig' as ChildCare.Afwezigtype,\n remarks: reason\n };\n\n try {\n await this.dataService.reportChildAbsentAsync(command);\n } finally {\n this.$scope.isLoading = false;\n this.$uibModalInstance.dismiss();\n this.$scope.$apply();\n }\n }\n\n private validateDate(date?: Date): Moment {\n if (date == null) {\n return null;\n }\n\n const converted = moment(date);\n if (!converted.isValid()) {\n return null;\n }\n\n return converted;\n }\n\n private canSave(): boolean {\n this.$scope.validation = this.validate(this.$scope.form);\n return Object.keys(this.$scope.validation).length === 0;\n }\n\n private validate(data: Scope['form']): { [key: string]: boolean } {\n const result = { };\n\n const fromDate = this.validateDate(data.startDate);\n if (fromDate == null) {\n result['startDate'] = false;\n }\n\n const tillDate = this.validateDate(data.endDate);\n if (tillDate == null) {\n result['endDate'] = false;\n }\n\n const fromTime = data.startTime;\n if (fromTime == null) {\n result['startTime'] = false;\n }\n\n const tillTime = data.endTime;\n if (tillTime == null) {\n result['endTime'] = false;\n }\n\n if (fromDate == null || tillDate == null) {\n return result;\n }\n\n if (fromDate.isAfter(tillDate)) {\n result['endDate'] = false;\n }\n\n if (fromTime == null || tillTime == null) {\n return result;\n }\n\n const from = fromDate.clone().add(fromTime);\n const till = tillDate.clone().add(tillTime);\n\n if (from.isSameOrAfter(till)) {\n result['endTime'] = false;\n }\n\n return result;\n }\n}\n\nappModule.controller('kpActionAbsentModalController', AbsentModalController);\n","import { Form } from '@/HelperClasses';\nimport { appModule } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IScope, ITimeoutService } from 'angular';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport moment from 'moment';\nimport { ChildCare } from '@/data-models';\n\nimport GroupModel = ChildCare.Definitions.Account.GroupModel;\nimport RequestIncidentalDayTimes = ChildCare.Definitions.GroupApp.RequestIncidentalDayTimes;\n\ndeclare module '@/data-models' { \n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace ChildCare.Definitions.GroupApp {\n interface RequestIncidentalDayTimes {\n valid: boolean;\n }\n }\n}\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n groups: GroupModel[];\n timesEditable: boolean;\n availableTimes: RequestIncidentalDayTimes[];\n firstForm: {\n date: Date;\n group: string;\n remarks: string;\n valid: boolean;\n };\n secondForm: {\n times: RequestIncidentalDayTimes[];\n valid: boolean;\n useCreditHours: boolean;\n };\n close: () => void;\n previous: () => void;\n save: () => void;\n}\n\nappModule.controller('kpActionIncidentalModalController',\n ['$scope', '$uibModalInstance', 'AppDataService', 'childId', 'LoadingBar', '$timeout', 'ftSettingService',\n function ($scope: ILocalScope, $uibModalInstance: IModalInstanceService, DataService: AppDataService, childId: string, LoadingBar, $timeout: ITimeoutService, ftSettingService: ftSettingsService) {\n var initialized = false;\n $scope.isLoading = false;\n\n $scope.groups = [];\n\n $scope.timesEditable = false;\n $scope.availableTimes = null;\n\n $scope.firstForm = {\n date: null,\n group: null,\n remarks: null,\n valid: null\n };\n\n $scope.secondForm = {\n times: null,\n valid: null,\n useCreditHours: false\n };\n\n $scope.$watch('isLoading', function(newVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function() {\n if (initialized) {\n return;\n }\n\n $scope.isLoading = true;\n DataService.getGroupsAsync()\n .then(function(res) {\n $scope.groups = res.groups;\n $scope.firstForm.group = ftSettingService.get(window.appSettings.group.selected);\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n };\n\n $scope.close = function() {\n $uibModalInstance.dismiss();\n };\n\n $scope.previous = function() {\n $scope.firstForm.valid = null;\n $scope.secondForm.valid = null;\n $scope.secondForm.times = null;\n };\n\n $scope.save = function() {\n if ($scope.firstForm.valid) {\n $scope.secondForm.valid = Form.formNullCheck($scope.secondForm, ['valid']);\n }\n\n $scope.firstForm.valid = Form.formNullCheck($scope.firstForm, ['valid', 'remarks']);\n\n if ($scope.firstForm.valid && $scope.secondForm.valid) {\n for (const item of $scope.secondForm.times) {\n if (item.startTime.length === 5) {\n item.startTime += ':00';\n }\n\n if (item.endTime.length === 5) {\n item.endTime += ':00';\n }\n\n if (\n item.startTime > item.endTime ||\n item.startTime < item.windowStartTime ||\n item.endTime > item.windowEndTime\n ) {\n item.startTime = item.startTime.substring(0, 5);\n item.endTime = item.endTime.substring(0, 5);\n\n item.valid = false;\n $scope.secondForm.valid = false;\n }\n }\n\n $scope.isLoading = true;\n DataService.requestIncidentalDay(\n childId,\n $scope.firstForm.remarks,\n moment($scope.firstForm.date).format('YYYY-MM-DD'),\n $scope.firstForm.group,\n $scope.secondForm.useCreditHours,\n $scope.secondForm.times\n ).finally(function() {\n $scope.isLoading = false;\n $uibModalInstance.dismiss();\n });\n }\n\n if ($scope.firstForm.valid && !$scope.isLoading && $scope.secondForm.valid === null) {\n $scope.isLoading = true;\n\n DataService.getPossibleIncidentalDays(childId, moment($scope.firstForm.date).format('YYYY-MM-DD')).then(\n function(result) {\n $scope.timesEditable = result.areTimesEditable;\n $scope.availableTimes = result.times;\n\n if ($scope.availableTimes.length === 0) {\n $scope.firstForm.valid = false;\n }\n\n $scope.isLoading = false;\n }\n );\n }\n };\n\n $timeout(() => initialize());\n }\n]);\n","import { Form } from '@/HelperClasses';\n\nappModule.controller('kpActionMoveModalController',\n ['$scope', '$uibModalInstance', 'AppDataService', 'childId', 'LoadingBar', '$timeout', 'ftSettingService',\n function ($scope, $uibModalInstance, DataService, childId, LoadingBar, $timeout, ftSettingService) {\n var initialized = false;\n $scope.isLoading = false;\n $scope.groups = [];\n $scope.availableTimes = [];\n $scope.availableTimesErrorMsg = '';\n\n $scope.moment = moment;\n\n $scope.firstForm = {\n date: null,\n groupId: null,\n valid: null\n };\n\n $scope.secondForm = {\n times: null,\n valid: null\n };\n\n $scope.$watch('isLoading', function(newVal, oldVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function() {\n if (initialized) {\n return;\n }\n\n $scope.isLoading = true;\n DataService.getGroupsAsync()\n .then(function(res) {\n $scope.groups = res.groups;\n $scope.firstForm.groupId = ftSettingService.get(appSettings.group.selected);\n })\n .finally(function() {\n $scope.firstForm.date = moment().toDate();\n $scope.isLoading = false;\n });\n };\n\n $scope.close = function() {\n $uibModalInstance.dismiss();\n };\n\n $scope.previous = function() {\n $scope.firstForm.valid = null;\n $scope.secondForm.valid = null;\n };\n\n $scope.currentGroup = function() {\n return $scope.groups.find(x => x.id == $scope.firstForm.groupId);\n };\n\n $scope.save = function() {\n if ($scope.firstForm.valid) {\n $scope.secondForm.valid = Form.formNullCheck($scope.secondForm, ['valid']);\n }\n\n $scope.firstForm.valid = Form.formNullCheck($scope.firstForm, ['valid']);\n\n if ($scope.firstForm.valid && !$scope.secondForm.valid) {\n DataService.getPossibleTransferGroups(childId, moment($scope.firstForm.date).format('YYYY-MM-DD')).then(\n function(result) {\n $scope.availableTimes = result.times;\n if (result.errorMsg) {\n $scope.availableTimesErrorMsg = result.errorMsg;\n }\n else {\n $scope.availableTimesErrorMsg = '';\n }\n }\n );\n } else if ($scope.firstForm.valid && $scope.secondForm.valid) {\n $scope.isLoading = true;\n DataService.requestTransferGroup(\n childId,\n moment($scope.firstForm.date).format('YYYY-MM-DD'),\n $scope.firstForm.groupId,\n $scope.secondForm.times\n )\n .then(function(result) {\n $uibModalInstance.dismiss();\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n }\n };\n\n $timeout(initialize());\n }\n]);\n","import { appModule } from '@/definitions';\nimport moment from 'moment';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport { IScope } from 'angular';\n\ntype Command = ChildCare.Planning.Commands.ReportAbsent.Command;\n\ninterface Scope extends IScope {\n valid: boolean;\n isLoading: boolean;\n ends: 'today' | 'tomorrow' | 'unknown';\n reason: string;\n close: () => any;\n save: () => void;\n\n}\n\nappModule.controller('kpActionSickModalController',\n ['$scope', '$uibModalInstance', 'AppDataService', 'childId', 'LoadingBar',\n function ($scope: Scope, $uibModalInstance, dataService: AppDataService, childId, LoadingBar) {\n $scope.valid = true;\n $scope.isLoading = false;\n $scope.ends = 'today';\n\n $scope.$watch('isLoading', (newVal: Boolean) => LoadingBar.show = newVal);\n $scope.close = () => $uibModalInstance.dismiss();\n\n $scope.save = () => {\n let end: moment.Moment;\n\n switch ($scope.ends) {\n case 'today':\n end = moment().endOf('day');\n break;\n case 'tomorrow':\n end = moment().add(1, 'day').endOf('day');\n break;\n case 'unknown':\n end = undefined;\n break;\n }\n\n const command: Command = {\n childIds: [childId],\n start: moment().format('YYYY-MM-DDTHH:mm:ss'),\n end: end?.format('YYYY-MM-DDTHH:mm:ss'),\n type: 'ziek' as ChildCare.Afwezigtype,\n remarks: $scope.reason\n };\n\n if ($scope.valid) {\n $scope.isLoading = true;\n dataService.reportChildSickAsync(command)\n .then()\n .finally(function () {\n $scope.isLoading = false;\n $uibModalInstance.dismiss();\n });\n }\n };\n }\n ]);\n","import { appModule } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { IModalServiceInstance } from 'angular-ui-bootstrap';\nimport { IScope, IQService } from 'angular';\nimport moment from 'moment';\nimport { ChildCare } from '@/data-models';\n\nimport GroupModel = ChildCare.Definitions.Account.GroupModel;\n\nclass StudyDay {\n constructor(public id: string, public name: string, public date: moment.Moment, public planningId: string) {}\n}\n\ninterface ILocalScope extends IScope {\n studyDays: StudyDay[];\n isLoading: boolean;\n useCreditHours: boolean;\n data: {\n selectedStudyDays: StudyDay[];\n groupId: string;\n };\n groups: GroupModel[];\n close: () => void;\n save: () => void;\n selectStudyDay: (studyDay: StudyDay) => void;\n}\n\nappModule.controller('kpActionStudydayModalController',\n ['$scope', '$q', '$uibModalInstance', 'AppDataService', 'childId', '$timeout', 'ftSettingService', 'LoadingBar',\n function ($scope: ILocalScope, $q: IQService, $uibModalInstance: IModalServiceInstance, DataService: AppDataService, childId: string, $timeout, ftSettingService: ftSettingsService, LoadingBar) {\n $scope.studyDays = [];\n $scope.isLoading = false;\n $scope.useCreditHours = false;\n\n $scope.data = {\n selectedStudyDays: [],\n groupId: null\n };\n\n $scope.$watch('isLoading', function(newVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function() {\n $scope.isLoading = true;\n\n DataService.getGroupsAsync()\n .then(function(res) {\n $scope.groups = res.groups;\n $scope.data.groupId = ftSettingService.get(window.appSettings.group.selected);\n })\n .finally(() => ($scope.isLoading = false));\n\n DataService.getRequestStudyDays(childId)\n .then(function(result) {\n $scope.studyDays = result.studyDays.map(\n x => new StudyDay(x.studydayId, x.name, moment(x.date), x.planningId)\n );\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n };\n\n $scope.close = function() {\n $uibModalInstance.dismiss();\n };\n\n $scope.save = function() {\n $scope.isLoading = true;\n\n let groupId = $scope.data.groupId;\n\n if ($scope.data.groupId == ftSettingService.get(window.appSettings.group.selected)) {\n groupId = undefined;\n }\n\n const promises = $scope.data.selectedStudyDays.map(x =>\n DataService.requestStudyDays(x, childId, groupId, $scope.useCreditHours)\n );\n\n $q.all(promises)\n .then(() => {\n $uibModalInstance.dismiss();\n })\n .finally(() => ($scope.isLoading = false));\n };\n\n $scope.selectStudyDay = (studyDay: StudyDay) => {\n if ($scope.data.selectedStudyDays.includes(studyDay)) {\n const currentIndex = $scope.data.selectedStudyDays.indexOf(studyDay);\n $scope.data.selectedStudyDays.splice(currentIndex, 1);\n } else {\n $scope.data.selectedStudyDays.push(studyDay);\n }\n };\n\n $timeout(initialize());\n }\n]);\n","import { Form } from '@/HelperClasses';\n\nappModule.controller('kpActionSwapModalController',\n ['$scope', '$uibModalInstance', 'AppDataService', 'childId', '$timeout', 'LoadingBar',\n function ($scope, $uibModalInstance, DataService, childId, $timeout, LoadingBar) {\n var initialized = false;\n $scope.isLoading = false;\n $scope.timesEditable = false;\n\n $scope.availableFromTimes = [];\n $scope.availableToTimes = [];\n\n $scope.groups = [];\n\n $scope.firstForm = {\n fromDate: null,\n toDate: null,\n group: null,\n remarks: null,\n valid: null\n };\n\n $scope.secondForm = {\n selectedFromTimes: null,\n selectedToTimes: null,\n valid: null\n };\n\n $scope.showDate = function(date) {\n return moment(date).format('DD-MM-YYYY');\n };\n\n $scope.$watch('isLoading', function(newVal, oldVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function() {\n if (initialized) {\n return;\n }\n\n $scope.isLoading = true;\n DataService.getGroupsAsync()\n .then(function(res) {\n $scope.groups = res.groups;\n $scope.firstForm.group = $scope.groups[0].id;\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n };\n\n $scope.close = function() {\n $uibModalInstance.dismiss();\n };\n\n $scope.previous = function() {\n $scope.firstForm.valid = null;\n $scope.secondForm.valid = null;\n $scope.secondForm.selectedFromTimes = null;\n $scope.secondForm.selectedToTimes = null;\n };\n\n var validateTimes = function(collection) {\n collection.forEach(function(item) {\n if (item.startTime.length === 5) {\n item.startTime += ':00';\n }\n\n if (item.endTime.length === 5) {\n item.endTime += ':00';\n }\n\n if (\n item.startTime > item.endTime ||\n item.startTime < item.windowStartTime ||\n item.endTime > item.windowEndTime\n ) {\n item.startTime = item.startTime.substring(0, 5);\n item.endTime = item.endTime.substring(0, 5);\n\n item.valid = false;\n $scope.secondForm.valid = false;\n }\n });\n };\n\n $scope.save = function() {\n if ($scope.firstForm.valid) {\n $scope.secondForm.valid = Form.formNullCheck($scope.secondForm, ['valid']);\n }\n\n $scope.firstForm.valid = Form.formNullCheck($scope.firstForm, ['valid', 'remarks']);\n\n if ($scope.firstForm.valid && $scope.secondForm.valid) {\n validateTimes($scope.secondForm.selectedFromTimes);\n validateTimes($scope.secondForm.selectedToTimes);\n\n if ($scope.secondForm.valid === false) {\n return;\n }\n\n const from = moment($scope.firstForm.fromDate).format('DD/MM/YYYY');\n const to = moment($scope.firstForm.toDate).format('DD/MM/YYYY');\n\n $scope.isLoading = true;\n DataService.requestSwapDay(\n childId,\n $scope.firstForm.remarks,\n from,\n to,\n $scope.firstForm.group,\n $scope.secondForm.selectedFromTimes,\n $scope.secondForm.selectedToTimes\n )\n .then()\n .finally(function() {\n $scope.isLoading = false;\n $uibModalInstance.dismiss();\n });\n }\n\n if ($scope.firstForm.valid && !$scope.isLoading && $scope.secondForm.valid === null) {\n $scope.isLoading = true;\n\n const from = moment($scope.firstForm.fromDate).format('YYYY-MM-DD');\n const to = moment($scope.firstForm.toDate).format('YYYY-MM-DD');\n\n DataService.getPossibleSwapDays(childId, from, to).then(function(result) {\n $scope.timesEditable = result.areTimesEditable;\n $scope.availableFromTimes = result.fromTimes;\n $scope.availableToTimes = result.toTimes;\n\n if (result.fromErrorMessage) {\n $scope.firstForm.valid = false;\n $scope.fromErrorMessage = result.fromErrorMessage;\n }\n $scope.fromHasRegistrationRuleError = result.fromHasRegistrationRuleError;\n\n if (result.toErrorMessage) {\n $scope.firstForm.valid = false;\n $scope.toErrorMessage = result.toErrorMessage;\n }\n $scope.toHasRegistrationRuleError = result.toHasRegistrationRuleError;\n\n if ($scope.availableFromTimes.length === 0 || $scope.availableToTimes.length === 0) {\n $scope.firstForm.valid = false;\n }\n\n $scope.isLoading = false;\n });\n }\n };\n\n $timeout(initialize());\n }\n]);\n","import { app, appModule } from '@/definitions';\nimport { IController, IScope } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IModalServiceInstance } from 'angular-ui-bootstrap';\nimport { ILoadingBar } from '@/models';\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport moment from 'moment';\nimport { ChildCare } from '@/data-models';\n\nimport RequestBeforeContractCommandTimes = ChildCare.Definitions.GroupApp.RequestBeforeContractCommandTimes;\n\nclass GroupAndDateSelection {\n public date: Date;\n public groupId: string;\n public remarks: string;\n\n constructor(date: moment.Moment, groupId: string) {\n this.date = date.toDate();\n this.groupId = groupId;\n }\n\n public isValid(): boolean {\n if (!this.hasValidDate()) {\n return false;\n }\n\n if (this.groupId == null) {\n return false;\n }\n\n return true;\n }\n\n public hasValidDate(): boolean {\n return moment(this.date).isSameOrAfter(moment(), 'day');\n }\n}\n\nclass TimeSelectionForm {\n times: RequestBeforeContractCommandTimes[];\n\n constructor() {\n this.times = [];\n }\n\n public reset() {\n this.times = [];\n }\n\n public isValid(): boolean {\n return true;\n }\n}\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n isSaving: boolean;\n timesEditable: boolean;\n groups: ChildCare.Definitions.Account.GroupModel[];\n availableTimes: any[];\n groupAndDateForm: GroupAndDateSelection;\n timeSelectionForm: TimeSelectionForm;\n\n formIndex: number;\n\n close(): void;\n previous(): void;\n next(): void;\n save(): void;\n}\n\nclass BeforeContractModalController implements IController {\n static $inject = ['$scope', 'AppDataService', '$uibModalInstance', 'LoadingBar', 'ftSettingService', 'childId'];\n\n constructor(\n private $scope: ILocalScope,\n private dataService: AppDataService,\n private modalInstance: IModalServiceInstance,\n private loadingBar: ILoadingBar,\n private settingsService: ftSettingsService,\n private childId: string\n ) {\n this.initializeScope();\n this.loadData();\n }\n\n private loadData() {\n this.$scope.isLoading = true;\n\n return this.dataService\n .getGroupsAsync()\n .then(response => {\n this.$scope.groups = response.groups;\n })\n .finally(() => (this.$scope.isLoading = false));\n }\n\n private isLoadingChanged(newVal: boolean) {\n this.loadingBar.show = newVal;\n }\n\n private next() {\n this.$scope.formIndex = 1;\n }\n\n private previous() {\n this.$scope.formIndex = 0;\n this.$scope.timeSelectionForm.reset();\n }\n\n private close() {\n this.modalInstance.dismiss();\n }\n\n private save() {\n if (!this.$scope.groupAndDateForm.isValid() || !this.$scope.timeSelectionForm.isValid()) {\n return;\n }\n\n this.$scope.isSaving = true;\n\n this.dataService\n .requestBeforeContractDay(\n this.childId,\n this.$scope.groupAndDateForm.remarks,\n moment(this.$scope.groupAndDateForm.date),\n this.$scope.groupAndDateForm.groupId,\n this.$scope.timeSelectionForm.times\n )\n .finally(() => {\n this.$scope.isSaving = false;\n this.close();\n });\n }\n\n private selectedDateChanged(newDate: Date) {\n if (newDate == null) {\n this.$scope.availableTimes = [];\n this.$scope.timeSelectionForm.reset();\n }\n\n this.$scope.isLoading = true;\n\n this.dataService\n .getPossibleBeforeContractDays(this.childId, moment(newDate))\n .then(result => {\n this.$scope.timesEditable = result.areTimesEditable;\n this.$scope.availableTimes = result.times;\n })\n .finally(() => (this.$scope.isLoading = false));\n }\n\n private initializeScope() {\n const groupId = this.settingsService.get(app.settings.group.selected);\n\n this.$scope.groupAndDateForm = new GroupAndDateSelection(moment(), groupId);\n this.$scope.timeSelectionForm = new TimeSelectionForm();\n\n this.$scope.$watch('isLoading', this.isLoadingChanged.bind(this));\n this.$scope.$watch('groupAndDateForm.date', this.selectedDateChanged.bind(this));\n\n this.$scope.close = this.close.bind(this);\n this.$scope.next = this.next.bind(this);\n this.$scope.previous = this.previous.bind(this);\n this.$scope.save = this.save.bind(this);\n\n this.$scope.formIndex = 0;\n }\n}\n\nappModule.controller('kpActionBeforeContractModalController', BeforeContractModalController);\n","export class UrlHelper {\n public static isUrlAbsolute(url: string): boolean {\n return new RegExp('^(?:[a-z]+:)?//', 'i').test(url);\n }\n\n public static getTenant(): string {\n const tenantRegex = /(?:(?:groep|backoffice|ouder|vervoer)-)?([a-z-0-9]+)\\.kindplanner.nl/i;\n const match = tenantRegex.exec(location.hostname);\n if (match != null) {\n return match[1];\n }\n\n return null;\n }\n\n public static createAbsoluteMediaUrl(mediaServiceUrl: string, relativeUrl: string): string {\n const tenantPart = mediaServiceUrl.lastIndexOf('/');\n\n mediaServiceUrl = mediaServiceUrl.substring(0, tenantPart);\n\n return `${mediaServiceUrl}/${relativeUrl}`;\n }\n}\n","import { app, appModule, ft, ng } from '@/definitions';\nimport moment from 'moment';\nimport { IPromise, IQService, IScope, IIntervalService, IController } from 'angular';\nimport { ILoadingBar } from '@/models';\nimport { UrlHelper } from '@/urlHelper';\nimport { IFortyTwoDropzoneRootScopeService } from '@/directives/dropzone';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\n\ntype AlbumsListResponse = ChildCare.Definitions.Media.AlbumsListResponse;\ntype AlbumsListResponseItem = ChildCare.Definitions.Media.AlbumsListResponseItem;\ntype WriteAudienceGroup = ChildCare.Definitions.GroupApp.WriteAudienceGroup;\n\ninterface Scope extends IScope {\n albums: AlbumsListResponseItem[];\n audiences: WriteAudienceGroup[];\n mediaAlbumLimit: number;\n isLoading: boolean;\n fetchingAlbums: boolean;\n\n openUploadMediaModal: () => void;\n openAlbumModal: (album: AlbumsListResponseItem) => void;\n showMoreAlbums: () => void;\n createUrl: (album: AlbumsListResponseItem) => string;\n}\n\nexport class AlbumsController implements IController {\n public static readonly $inject = ['$rootScope', '$scope', '$q', 'AppDataService', '$uibModal', '$localStorage', '$interval', 'LoadingBar'];\n\n private readonly $rootScope: IFortyTwoDropzoneRootScopeService;\n protected readonly $scope: Scope;\n private readonly $q: IQService;\n protected readonly dataService: AppDataService;\n protected readonly $uibModal: IModalService;\n private readonly $interval: IIntervalService;\n private readonly LoadingBar: ILoadingBar;\n private readonly $localStorage: any;\n\n private lastFetchDateMedia: moment.Moment;\n\n constructor($rootScope: IFortyTwoDropzoneRootScopeService, $scope: Scope, $q: IQService, dataService: AppDataService, $uibModal: IModalService, $localStorage, $interval: IIntervalService, LoadingBar: ILoadingBar) {\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$q = $q;\n this.dataService = dataService;\n this.$uibModal = $uibModal;\n this.$interval = $interval;\n this.LoadingBar = LoadingBar;\n this.$localStorage = $localStorage;\n\n this.$scope.fetchingAlbums = false;\n this.$scope.isLoading = false;\n this.$scope.mediaAlbumLimit = app.settings.mediaAlbums.fetchRange;\n this.$scope.audiences = null;\n\n this.$scope.albums = [];\n\n this.$scope.$watch('isLoading', (newVal: boolean) => this.LoadingBar.show = newVal);\n\n this.$scope.openUploadMediaModal = this.openUploadMediaModal.bind(this);\n this.$scope.openAlbumModal = this.openAlbumModal.bind(this);\n this.$scope.showMoreAlbums = this.showMoreAlbums.bind(this);\n this.$scope.createUrl = this.createUrl.bind(this);\n\n this.handleGetAlbums = this.handleGetAlbums.bind(this);\n\n this.initialize();\n }\n\n private initialize() {\n const intervalHandle = this.$interval(() => {\n this.refreshMediaAlbums();\n }, 1000 * 30);\n\n this.$scope.$on('$destroy', () => {\n this.$interval.cancel(intervalHandle);\n });\n\n this.$scope.isLoading = true;\n\n const tasks = [\n this.getAlbumsAsync(false),\n this.dataService.getAudiencesAsync(null)\n ];\n\n this.$q.all(tasks).then((results) => {\n this.handleGetAlbums(results[0] as ChildCare.Definitions.Media.AlbumsListResponse);\n this.$scope.audiences = (results[1] as ChildCare.Definitions.GroupApp.WriteAudienceResponse).groups;\n }).finally(() => this.$scope.isLoading = false);\n }\n\n private createUrl(album: AlbumsListResponseItem) {\n\n const encodedToken = encodeURIComponent(this.$localStorage.refreshToken);\n\n let absoluteUrl = album.posterUrl;\n\n if (!UrlHelper.isUrlAbsolute(absoluteUrl)) {\n absoluteUrl = UrlHelper.createAbsoluteMediaUrl(this.$rootScope.configuration.services.media, album.posterUrl);\n }\n\n return `${absoluteUrl}?access_token=${encodedToken}`;\n }\n\n private showMoreAlbums() {\n // Don't do the call if it's already fetching, or there could not possibly be a new message because it didn't\n // fetch the settings amount of items from the last call\n if (this.$scope.fetchingAlbums || this.$scope.mediaAlbumLimit >= (this.$scope.albums.length + app.settings.mediaAlbums.fetchRange)) {\n return;\n }\n\n this.$scope.isLoading = true;\n this.$scope.fetchingAlbums = true;\n this.getAlbumsAsync(true)\n .then(this.handleGetAlbums)\n .finally(() => {\n this.$scope.mediaAlbumLimit += app.settings.mediaAlbums.fetchRange;\n this.$scope.isLoading = false;\n this.$scope.fetchingAlbums = false;\n });\n }\n\n private openAlbumModal(album: AlbumsListResponseItem) {\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/media/albumOverview.html?v=' + ft.randomNumber,\n controller: 'kpAlbumOverviewModalController',\n backdrop: true,\n keyboard: true,\n resolve: {\n album: () => ng.copy(album)\n }\n });\n }\n\n protected openUploadMediaModal() {\n const instance = this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/media/modal.html?v=' + ft.randomNumber,\n controller: 'kpMediaModalController',\n size: 'lg',\n backdrop: true,\n keyboard: true,\n resolve: {\n audiences: () => ng.copy(this.$scope.audiences)\n }\n });\n\n instance.result.then(() => {\n this.refreshMediaAlbums();\n });\n }\n\n protected refreshMediaAlbums(): void {\n this.$scope.isLoading = true;\n\n this.getAlbumsAsync(false)\n .then(response => this.handleGetAlbums(response))\n .finally(() => this.$scope.isLoading = false);\n }\n\n private getAlbumsAsync(loadMore: boolean): IPromise {\n const dateTime = moment();\n if (!this.lastFetchDateMedia) {\n this.lastFetchDateMedia = dateTime;\n return this.dataService.getAlbumsUntilAsync(this.lastFetchDateMedia);\n }\n\n if (loadMore) {\n const lastAlbum = this.$scope.albums[this.$scope.albums.length - 1];\n const date = moment(lastAlbum.modifiedOn);\n return this.dataService.getAlbumsUntilAsync(date);\n }\n\n const returnValue = this.dataService.getAlbumsSinceAsync(this.lastFetchDateMedia);\n this.lastFetchDateMedia = dateTime;\n return returnValue;\n }\n\n private handleGetAlbums(results: AlbumsListResponse) {\n this.$scope.albums = this.$scope.albums.concat(results.items).filter(\n (item, i, arr) => arr.findIndex(t => t.id === item.id) === i\n );\n }\n}\n\nappModule.controller('kpAlbumsController', AlbumsController);\n","import { appModule, frameworkSettings, frameworkEvents } from '@/definitions';\nimport { IStateService } from 'angular-ui-router';\nimport { ApplicationInsightsService } from '@/services/application-insights-service';\n\nappModule.controller('ftAppController', ['$rootScope','$scope', '$state', '$stateParams', '$timeout', '$urlRouter', 'ftConfiguration', 'ftLoginService', 'ftSettingService', 'AppDataService', '$localStorage', '$sessionStorage', 'RoleCheckerService', 'mdcDefaultParams', 'ftConnection',\n function($rootScope, $scope, $state: IStateService, $stateParams, $timeout, $urlRouter, ftConfiguration, ftLoginService, ftSettingService, DataService, $localStorage, $sessionStorage, roleCheckerService, mdcDefaultParams, ftConnection) {\n mdcDefaultParams({ lang: 'nl', cancelText: 'Sluiten', todayText: 'Nu', okText: 'Ok' });\n var initialized = false;\n var splashTime = 1000;\n var time;\n var offDestroy, offLogin, offStateChangeSuccess;\n\n // Refresh the token upon startup and set an interval that runs the expire time - 10 seconds.\n // This is to fix an issue where calls could be done with invalid tokens\n ftLoginService.refreshLoginAsync().then(function() {\n startRefreshTokenInterval();\n });\n\n var startRefreshTokenInterval = function() {\n setInterval(function() {\n ftLoginService.refreshLoginAsync();\n }, getTokenRefreshSpeed());\n };\n\n var getTokenRefreshSpeed = function() {\n if ($localStorage.tokenRefreshSpeed) {\n return $localStorage.tokenRefreshSpeed;\n }\n\n // Get the expire date and subtract 10 seconds from it\n var expireDate = new Date($sessionStorage.token.expires);\n expireDate.setSeconds(expireDate.getSeconds() - 10);\n\n var now = new Date().toUTCString();\n\n // Get time difference in milliseconds\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var refreshSpeed = new Date(expireDate.toUTCString()) - new Date(now);\n $localStorage.tokenRefreshSpeed = refreshSpeed;\n\n return refreshSpeed;\n };\n\n $scope.isLoading = false;\n $rootScope.showSplash = true;\n $scope.pageStyle = null;\n\n $scope.logout = function() {\n // remove everyone from station call\n ftLoginService.doLogout();\n $localStorage[window.appSettings.group.selected] = undefined;\n\n $state.go('outside-app.login');\n };\n\n var getData = function() {\n time = new Date().getTime();\n\n DataService.getConfigurationAsync()\n .then(results => {\n $rootScope.configuration = results;\n ftConfiguration.configure(results);\n\n var interval = new Date().getTime() - time;\n\n if (interval < 1000) {\n $timeout(hideSplash, splashTime);\n } else {\n hideSplash();\n }\n\n initializeRoute();\n })\n .catch(() => {\n hideSplash();\n $timeout(() => ftConnection.check(), 500);\n })\n .finally(function() {\n $scope.isLoading = true;\n });\n };\n\n var handleOnLogin = function(evt, obj) {\n roleCheckerService.checkLogin().then(() => {\n if (obj && obj.redirect) {\n window.location.replace(obj.redirect);\n } else {\n $state.go('app.initialize');\n }\n });\n };\n\n var handleStateChangeSuccess = function() {\n var current = $state.current;\n\n // only save current state after login (when in-app)\n if (current.name.indexOf('app') == 0) {\n ftSettingService.set(frameworkSettings.keys.currentState, [current.name, $stateParams]);\n }\n\n $scope.pageStyle = (current as any).pageStyle || null;\n };\n\n var handleOnDestroy = function() {\n if (offDestroy) {\n offDestroy();\n }\n if (offLogin) {\n offLogin();\n }\n if (offStateChangeSuccess) {\n offStateChangeSuccess();\n }\n };\n\n var initialize = function() {\n if (initialized) {\n return;\n }\n\n initializeEventHandlers();\n getData();\n\n initialized = true;\n };\n\n var initializeEventHandlers = function() {\n offStateChangeSuccess = $rootScope.$on('$stateChangeSuccess', handleStateChangeSuccess);\n offLogin = $rootScope.$on(frameworkEvents.authentication.login, handleOnLogin);\n offDestroy = $scope.$on('$destroy', handleOnDestroy);\n };\n\n var initializeRoute = function() {\n ftLoginService.isLoggedInAsync().then(\n () => {\n navigateToLastState();\n },\n () => {\n console.log('User is not logged in');\n $localStorage[window.appSettings.group.selected] = undefined;\n\n $state.go('outside-app.login');\n }\n );\n };\n\n var navigateToLastState = function() {\n var lastState = ftSettingService.get(frameworkSettings.keys.currentState);\n\n if (lastState) {\n try {\n $state.go(lastState[0], lastState[1]);\n } catch (error) {\n console.log(error);\n console.log(lastState);\n console.log('Failed to restore last state');\n $state.go('app.presence');\n }\n } else if (window.location.href.indexOf('/app/') < 0) {\n $state.go('app.presence');\n } else {\n $urlRouter.sync();\n }\n };\n\n var hideSplash = function() {\n $rootScope.showSplash = false;\n };\n\n $timeout(initialize);\n }\n]);\n\nappModule.controller('kpHomeController', function() {});\n","import { layoutSettings, appModule, frameworkEvents, app, layoutEvents, componentsModels } from '@/definitions';\nimport { RoleChecker } from '@/role-checker';\nimport { FeatureService, Feature } from '@/services/feature-service';\nimport { FortyTwoLoginService, FortyTwoRootScopeService } from '@/FortyTwoFramework';\nimport { IStateService } from 'angular-ui-router';\nimport { IScope, ITimeoutService, element } from 'angular';\n\ninterface LocalScope extends IScope {\n currentUser: any; showCurrentUser: boolean;\n isLoading: boolean;\n hasScroll: boolean;\n layout: any;\n layoutSettings: any;\n sidebarToggle: { left: boolean; right: boolean };\n menuItems: any[];\n assistent: any;\n raiseStateRefresh: () => void;\n sidebarStat: (event: any) => void;\n}\n\nappModule.controller('ftAppContentController', ['$rootScope', '$scope', '$timeout', '$state', 'ftLoginService', '$filter', 'FeatureService',\n function ($rootScope: FortyTwoRootScopeService, $scope: LocalScope, $timeout: ITimeoutService, $state: IStateService, ftLoginService: FortyTwoLoginService, $filter, featureService: FeatureService) {\n\n var initialized = false;\n var offNavigationBack, offAssistentOpen, offAssistentClose, offStateChangeSuccess, offDestroy;\n\n var previousState = {};\n\n /////////////////////////////////\n ////// Framework voodoo ///////\n /////////////////////////////////\n\n $scope.currentUser = null; // This is the user shown in the side menu top left corner, the framework retrieves this value\n $scope.showCurrentUser = true; // This is the flag to indicate if the user must be shown in the side menu top left corner, the framework retrieves this value\n\n /////////////////////////////////\n /// End of framework voodoo ///\n /////////////////////////////////\n\n $scope.isLoading = false;\n $scope.hasScroll = true;\n $scope.layout = layoutSettings.layout.page;\n $scope.layoutSettings = layoutSettings.layout;\n $scope.sidebarToggle = { left: false, right: false };\n $scope.menuItems = [];\n $scope.assistent;\n\n $scope.raiseStateRefresh = function () {\n $rootScope.$broadcast(frameworkEvents.state.refresh);\n };\n\n $scope.sidebarStat = function (event) {\n if (!element(event.target).parent().hasClass('active')) {\n $scope.sidebarToggle.left = false;\n }\n };\n\n const initialize = function () {\n if (initialized) {\n return;\n }\n\n $scope.isLoading = true;\n\n setLayoutProperties();\n initializeEvents();\n initializeMenu().finally(() => {\n $scope.isLoading = false;\n });\n\n initialized = true;\n };\n\n const initializeEvents = function () {\n offNavigationBack = $rootScope.$on(app.navigation.back, handleNavigationBack);\n offAssistentOpen = $rootScope.$on(layoutEvents.assistent.open, handleAppAssistentOpen);\n offAssistentClose = $rootScope.$on(layoutEvents.assistent.close, handleAppAssistentClose);\n offStateChangeSuccess = $rootScope.$on('$stateChangeSuccess', handleStateChangeSuccess);\n offDestroy = $scope.$on('$destroy', handleDestroy);\n };\n\n const initializeMenu = (): ng.IPromise => {\n\n // add menu items based on role of the user\n const items = [];\n\n const groupMedia = new componentsModels.MenuItem({\n icon: 'zmdi-collection-image',\n text: $filter('translate')('NAVIGATION.MESSAGING-AND-MEDIA'),\n ref: 'app.groupmedia'\n });\n\n const presenceOverview = new componentsModels.MenuItem({\n icon: 'zmdi-accounts-list',\n text: $filter('translate')('NAVIGATION.PRESENCE'),\n ref: 'app.presence'\n });\n\n const calendar = new componentsModels.MenuItem({\n icon: 'zmdi-calendar',\n text: $filter('translate')('NAVIGATION.CALENDAR'),\n ref: 'app.calendar'\n });\n\n const requests = new componentsModels.MenuItem({\n icon: 'zmdi-receipt',\n text: $filter('translate')('NAVIGATION.REQUESTS'),\n ref: 'app.requests'\n });\n\n const diaryOverview = new componentsModels.MenuItem({\n icon: 'zmdi-book',\n text: $filter('translate')('NAVIGATION.DIARY'),\n ref: 'app.diary'\n });\n\n const travelPlanning = new componentsModels.MenuItem({\n icon: 'zmdi-car-taxi',\n text: $filter('translate')('NAVIGATION.TRAVEL-PLANNING'),\n ref: 'app.planner'\n });\n\n const activityPlanner = new componentsModels.MenuItem({\n icon: 'zmdi-run',\n text: $filter('translate')('NAVIGATION.ACTIVITY-PLANNING'),\n ref: 'app.activity'\n });\n\n const locationManager = new componentsModels.MenuItem({\n icon: 'zmdi-local-store',\n text: $filter('translate')('NAVIGATION.LOCATIONMANAGER'),\n ref: 'app.locationmanager'\n });\n\n const stories = new componentsModels.MenuItem({\n icon: 'zmdi-collection-bookmark',\n text: $filter('translate')('NAVIGATION.STORIES'),\n ref: 'app.stories'\n });\n\n const childrenList = new componentsModels.MenuItem({\n icon: 'zmdi-accounts',\n text: $filter('translate')('NAVIGATION.CHILDREN'),\n ref: 'app.emergency'\n });\n\n return ftLoginService.getCurrentUserAsync().then(user => {\n\n // This is the user shown in the side menu top left corner\n $scope.currentUser = user;\n\n if (RoleChecker.hasGroupRole(user) || RoleChecker.hasAdminRole(user)) {\n items.push(presenceOverview);\n items.push(groupMedia);\n items.push(calendar);\n items.push(diaryOverview);\n items.push(requests);\n items.push(childrenList);\n }\n\n if (RoleChecker.hasPlannerRole(user) || RoleChecker.hasAdminRole(user)) {\n featureService.isEnabled(Feature.TravelPlanner).then(isEnabled => {\n if (isEnabled) {\n items.push(travelPlanning);\n }\n });\n\n featureService.isEnabled(Feature.ActivityPlanner).then(isEnabled => {\n if (isEnabled) {\n items.push(activityPlanner);\n }\n });\n }\n\n if (RoleChecker.hasLocationManager(user) || RoleChecker.hasAdminRole(user)) {\n featureService.isEnabled(Feature.LocationMessages).then(isEnabled => {\n if (isEnabled) {\n items.push(locationManager);\n }\n });\n }\n\n featureService.isEnabled(Feature.Stories).then(isEnabled => {\n if (isEnabled) {\n items.push(stories);\n }\n });\n\n $scope.menuItems = items;\n });\n };\n\n const handleNavigationBack = function () {\n\n if (!previousState || !(previousState as any).state) {\n return;\n }\n\n $state.go((previousState as any).state, (previousState as any).params);\n };\n\n const handleAppAssistentOpen = function (_evt: any, obj: any) {\n if (!obj) {\n return;\n }\n\n $scope.assistent = obj;\n\n $timeout(function () {\n $scope.sidebarToggle.right = true;\n }, 50);\n };\n\n const handleAppAssistentClose = function () {\n $scope.sidebarToggle.right = false;\n\n $timeout(function () {\n $scope.assistent = null;\n }, 50);\n };\n\n const handleStateChangeSuccess = function (_evt, _toState, _toStateParams, fromState, fromStateParams) {\n $scope.sidebarToggle.left = false;\n setLayoutProperties();\n\n previousState = {\n state: fromState,\n params: fromStateParams\n };\n };\n\n const handleDestroy = function () {\n if (offNavigationBack) {\n offNavigationBack();\n }\n\n if (offAssistentOpen) {\n offAssistentOpen();\n }\n if (offAssistentClose) {\n offAssistentClose();\n }\n if (offStateChangeSuccess) {\n offStateChangeSuccess();\n }\n if (offDestroy) {\n offDestroy();\n }\n };\n\n const setLayoutProperties = function () {\n const current = $state.current as any;\n $scope.layout = current && current.layout || layoutSettings.layout.page;\n $scope.hasScroll = current && current.hasScroll;\n };\n\n $timeout(initialize);\n }\n ]);\n","import { appModule } from '@/definitions';\nimport { RoleChecker } from '@/role-checker';\nimport { FortyTwoLoginService, ftSettingsService } from '@/FortyTwoFramework';\nimport { IScope, ITimeoutService } from 'angular';\n\ninterface Scope extends IScope {\n isLoading: boolean;\n}\n\nappModule.controller('kpAppInitializeController', ['$scope', '$timeout', 'ftSettingService', 'ftLoginService', 'RoleCheckerService',\n function($scope: Scope, $timeout: ITimeoutService, ftSettingService: ftSettingsService, ftLoginService: FortyTwoLoginService, roleCheckerService: RoleChecker) {\n let initialized = false;\n\n $scope.isLoading = false;\n\n const initialize = function() {\n if (initialized) {\n return;\n }\n\n ftLoginService.getCurrentUserAsync().then(user => {\n if (user.groups && user.groups.length === 1) {\n ftSettingService.set(window.appSettings.group.selected, user.groups[0].id);\n } else {\n ftSettingService.set(window.appSettings.group.selected, null);\n }\n\n return roleCheckerService.navigateToRoleStartPage();\n });\n\n initialized = true;\n };\n\n $timeout(initialize);\n }\n]);\n","export enum PresencesStatus {\n NotExpected = 'notExpected',\n Expected = 'expected',\n Present = 'present',\n Sick = 'sick',\n PickedUp = 'pickedUp',\n Absent = 'absent'\n}\n\nexport enum PresencesAction {\n Unknown = 'unknown',\n Present = 'present',\n Sick = 'sick',\n NotExpected = 'notExpected',\n PickedUp = 'pickedUp'\n}\n\nexport enum Gender {\n Male = 'male',\n Unknown = 'unknown',\n Female = 'female'\n}\n","import { appModule } from '@/definitions';\nimport { Calendar, EventApi, EventInput, View } from '@fullcalendar/core';\nimport dayGridPlugin from '@fullcalendar/daygrid';\nimport momentPlugin from '@fullcalendar/moment';\n\nimport '@fullcalendar/core/main.css';\nimport '@fullcalendar/daygrid/main.css';\n\nimport enLocale from '@fullcalendar/core/locales/en-gb';\nimport nlLocale from '@fullcalendar/core/locales/nl';\n\nimport { ITimeoutService, IScope, IQService, ICompileService } from 'angular';\n\nimport { AppDataService } from '@/services/app-data-service';\nimport moment from 'moment';\n\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { ChildCare } from '@/data-models';\n\nimport GroupModel = ChildCare.Definitions.Account.GroupModel;\nimport GroupTimelineItem = ChildCare.Definitions.GroupApp.GroupTimelineItem;\nimport { Color } from '@/HelperClasses';\nimport { RoleChecker } from '@/role-checker';\nimport { IStateService } from 'angular-ui-router';\n\ninterface ICalendarScope extends IScope {\n group: GroupModel;\n selectedGroupId: string;\n onSelect: (calEvent: any, jsEvent: any, view: any) => void;\n navigateToGroups: () => void;\n isLoading: boolean;\n}\n\nappModule.controller('kpCalendarOverviewController',\n ['$scope', '$timeout', 'AppDataService', 'ftSettingService', '$q', '$compile', '$state', 'LoadingBar', RoleChecker.serviceName,\n function ($scope: ICalendarScope, $timeout: ITimeoutService, DataService: AppDataService, SettingService: ftSettingsService, $q: IQService, $compile: ICompileService, $state: IStateService, LoadingBar, roleCheckerService: RoleChecker) {\n let calendar: Calendar;\n\n $scope.isLoading = false;\n $scope.$watch('isLoading', newVal => LoadingBar.show = newVal);\n\n const eventClicked = (eventClickInfo: { el: HTMLElement; event: EventApi; jsEvent: MouseEvent; view: View }) => {\n $state.go('app.child', {id: eventClickInfo.event.extendedProps.childId});\n };\n\n const renderEvent = (info: { event: EventApi; el: HTMLElement; view: View }) => {\n const titleElement = info.el.querySelector('.fc-title') as HTMLDivElement;\n titleElement.innerHTML = titleElement.innerText;\n\n info.el.style.color = Color.contrast(info.el.style.backgroundColor);\n };\n\n const getLocale = () => {\n let locale = (window.navigator as any).userLanguage || window.navigator.language;\n if (locale.toLowerCase() === 'nl-nl') {\n locale = 'nl';\n }\n\n return locale;\n };\n\n const createId = (item: GroupTimelineItem): string => {\n return `${item.childId}/${item.start}/${item.on}/${item.end}/${item.timelineType}`;\n };\n\n const toEvent = (item: GroupTimelineItem): EventInput | any => {\n\n const stringStart = item.on ? item.on : item.start;\n const stringEnd = item.on ? item.on : item.end;\n\n const start = moment.utc(stringStart);\n const end = moment.utc(stringEnd);\n\n const event = {\n id: createId(item),\n title: '' + item.childName + '
      ' + item.description,\n classNames: ['mutation-item', item.timelineType],\n start: start.toISOString(),\n end: end.toISOString(),\n extendedProps: {\n childId: item.childId\n },\n backgroundColor: getBackgroundColor(item.timelineType)\n };\n\n return event;\n };\n\n const getBackgroundColor = (itemType: ChildCare.Definitions.GroupApp.TimelineType): string => {\n switch (itemType) {\n case 'birthday': return '#4BAEEA';\n case 'absent': return '#E7E6E6';\n case 'holiday': return '#E7E6E6';\n case 'sick': return '#F44336';\n case 'startPlanning': return '#008000';\n case 'startPlanningHasPrevious': return '#7DAA55';\n case 'endPlanning': return '#ED7D31';\n case 'incidental': return '#7DAA55';\n case 'swapdayFrom': return '#E7E6E6';\n case 'swapdayTo': return '#7DAA55';\n case 'beforeContract': return '#F6C142';\n case 'studyDay': return '#7DAA55';\n }\n };\n\n const fetchEvents = (fetchInfo, successCallback, failureCallback) => {\n const startDate = moment(fetchInfo.start);\n const endDate = moment(fetchInfo.end);\n\n $scope.isLoading = true;\n\n const prms = [];\n while (endDate > startDate || startDate.format('M') === endDate.format('M')) {\n prms.push(DataService.getCalendarTimeline($scope.selectedGroupId, startDate.format('YYYY/MM/01')));\n startDate.add(1, 'month');\n }\n\n const request = $q.all(prms);\n request.then(function (results: ChildCare.Definitions.GroupApp.GroupTimelineResponse[]) {\n\n const events = [];\n for (const result of results) {\n for (const item of result.items.sort((a, b) => a.childName.localeCompare(b.childName))) {\n const event = toEvent(item);\n if (!events.some(x => x.id === event.id)) {\n events.push(event);\n }\n }\n }\n successCallback(events);\n\n }).finally(() => $scope.isLoading = false);\n };\n\n const initialize = function () {\n $scope.isLoading = true;\n\n $scope.selectedGroupId = SettingService.get(window.appSettings.group.selected);\n if (!$scope.selectedGroupId) {\n $state.go('app.groups',{previous:$state.current.name});\n }\n\n DataService.getGroupsAsync().then(function (result) {\n $scope.group = result.groups.find(x => x.id == $scope.selectedGroupId);\n });\n\n const calenderElement = document.getElementById('calendar-control');\n\n calendar = new Calendar(calenderElement, {\n locales: [enLocale, nlLocale],\n plugins: [dayGridPlugin, momentPlugin],\n timeZone: 'UTC',\n locale: getLocale(),\n defaultView: 'dayGridMonth',\n height: 600,\n header: {\n left: 'dayGridMonth,dayGridWeek',\n center: 'title',\n right: 'today prev,next'\n },\n events: fetchEvents,\n displayEventTime: false,\n eventClick: eventClicked,\n eventRender: renderEvent\n });\n\n calendar.render();\n };\n\n $scope.onSelect = function (calEvent, jsEvent, view) {\n console.log(calEvent);\n $state.go('app.child', { id: calEvent.childId });\n };\n\n $scope.navigateToGroups = roleCheckerService.switchGroup;\n\n $timeout(initialize);\n }\n ]);\n\n","import { ChildCare } from '@/data-models';\nimport moment from 'moment';\n\nimport { Gender } from '@/enums';\n\nimport PresencesStatus = ChildCare.Definitions.GroupApp.PresencesStatus;\nimport PresenceType = ChildCare.Definitions.GroupApp.PresenceType;\nimport PresencesEventPlanning = ChildCare.Definitions.GroupApp.PresencesEventPlanning;\nimport PresencesMedical = ChildCare.Definitions.GroupApp.PresencesMedical;\nimport PresencesChildInfoSchoolSelection = ChildCare.Definitions.GroupApp.PresencesChildInfoSchoolSelection;\nimport PresencesChild = ChildCare.Definitions.GroupApp.PresencesChild;\nimport PresencesLabel = ChildCare.Definitions.GroupApp.PresencesLabel;\nimport PresencesEvent = ChildCare.Definitions.GroupApp.PresencesEvent;\nimport PresencesDiaryEvent = ChildCare.Definitions.GroupApp.PresencesDiaryEvent;\nimport PresencesTimeInterval = ChildCare.Definitions.GroupApp.PresencesTimeInterval;\n\nimport DiaryEntry = ChildCare.Definitions.Family.DiaryEntry;\n\nimport PresencesChildInfoChild = ChildCare.Definitions.GroupApp.PresencesChildInfoChild;\nimport PresencesChildInfoMedical = ChildCare.Definitions.GroupApp.PresencesChildInfoMedical;\nimport PresencesChildInfoFamilyMember = ChildCare.Definitions.GroupApp.PresencesChildInfoFamilyMember;\n\nimport GroupChildOnLocation = ChildCare.Definitions.GroupApp.GroupChildOnLocation;\nimport GroupRequestsApprovalChild = ChildCare.Definitions.GroupApp.GroupRequestsApprovalChild;\n\nexport class GenderLabel {\n public key: string;\n public name: string;\n\n constructor(private gender: Gender) {\n this.key = gender.toString();\n this.name = GenderLabel.getName(gender);\n }\n\n public getIcon(): string {\n switch (this.gender) {\n case Gender.Unknown:\n return 'genderless';\n case Gender.Male:\n return 'mars';\n case Gender.Female:\n return 'venus';\n }\n }\n\n public static getName(gender: Gender): string {\n switch (gender) {\n case Gender.Unknown:\n return 'Onbekend';\n case Gender.Male:\n return 'Man';\n case Gender.Female:\n return 'Vrouw';\n }\n }\n}\n\nexport class DiaryType {\n constructor(public id: string, public name: string, public color: string, public icon: string) {}\n}\n\nexport class Diary {\n constructor(public id: string, public type: DiaryType, public text: string, public time: string) {}\n}\n\nexport class Label {\n constructor(public title: string, public text: string, public color: string) {}\n}\n\nexport class School {\n public googleApiKey = 'AIzaSyB1KCqC2iOubGbKy3kJadFHqtg_ffLcF-M';\n public id: string;\n public name: string;\n public street: string;\n public postalCode: string;\n public city: string;\n\n constructor(school: PresencesChildInfoSchoolSelection) {\n this.id = school.id;\n this.name = school.name;\n this.street = school.street;\n this.postalCode = school.postalCode;\n this.city = school.city;\n }\n\n public getFullAddress(): string {\n return `${this.street}, ${this.postalCode} ${this.city}`;\n }\n\n public getGoogleMapsLink(): string {\n return `https://www.google.com/maps/embed/v1/place?key=${this.googleApiKey}&q=${this.getFullAddress().replace(\n ' ',\n '+'\n )}`;\n }\n}\n\nexport class FamilyMember {\n public id: string;\n public firstName: string;\n public lastNamePrefix: string;\n public lastName: string;\n public profilePicture: string;\n public phoneNumber: string;\n public isResponsible: boolean;\n public birthDate: moment.Moment;\n\n private member: PresencesChildInfoFamilyMember;\n\n constructor(member: PresencesChildInfoFamilyMember) {\n this.member = member;\n\n this.id = member.parentId;\n this.firstName = member.firstName;\n this.lastNamePrefix = member.lastNamePrefix;\n this.lastName = member.lastName;\n this.profilePicture = member.profilePicture;\n this.phoneNumber = member.phoneNumber;\n this.isResponsible = member.isResponsible;\n this.birthDate = moment(member.birthDate);\n }\n\n public clone(): FamilyMember {\n return new FamilyMember(this.member);\n }\n\n public getAvatarInitials() {\n let matches = this.fullName().match(/\\b(\\w)/g);\n if (matches.length < 2) {\n return this.fullName()\n .slice(0, 2)\n .toUpperCase();\n }\n\n matches = matches.slice(0, 2);\n return matches.join('').toUpperCase();\n }\n\n public fullName() {\n let fullName = this.firstName;\n\n if (this.lastNamePrefix != null && this.lastNamePrefix !== '') {\n fullName += ' ' + this.lastNamePrefix;\n }\n\n if (this.lastName != null && this.lastName !== '') {\n fullName += ' ' + this.lastName;\n }\n\n return fullName;\n }\n}\n\nexport class Event {\n constructor(\n public presenceType: PresenceType,\n public startTime: moment.Duration,\n public endTime: moment.Duration,\n public remarks: string,\n public planning: PresencesEventPlanning\n ) {}\n\n public formatLabel(): string {\n const startLabel = moment.utc(this.startTime.asMilliseconds()).format('HH:mm');\n const endLabel = moment.utc(this.endTime.asMilliseconds()).format('HH:mm');\n\n const label = `${startLabel} - ${endLabel}`;\n let status = null;\n if (this.presenceType === 'absent') {\n status = 'Afwezig';\n } else if (this.presenceType === 'beforeContract') {\n status = 'Wendag';\n } else if (this.presenceType === 'sick') {\n status = 'Ziek';\n } else if (this.presenceType === 'swapDayTraded' || this.presenceType === 'swapDay') {\n status = 'Geruild';\n } else if (this.presenceType === 'incidental') {\n status = this.remarks;\n }\n\n return status == null ? label : label + ' | ' + status;\n }\n\n public getCssClass(): string {\n return (\n 'type-' +\n this.presenceType\n .replace(/([A-Z])/g, '-$1')\n .trim()\n .toLowerCase()\n );\n }\n}\n\nexport class DiaryEvent {\n constructor(\n public childId: string,\n public diaryEntryType: string,\n public startTime: moment.Duration,\n public endTime: moment.Duration,\n public colorCode: string,\n public quantity: number,\n public diaryEntryId: string,\n public diaryEntryTypeId: string,\n public diaryScheduleId: string\n ) {}\n\n public formatLabel(): string {\n const label = `${this.diaryEntryType} (${this.quantity})`;\n return label;\n }\n\n public getCssClass(): string {\n return (\n '.diary-schedule'\n );\n }\n}\n\ntype ChildTypes =\n ChildCare.Definitions.Child\n | ChildCare.Definitions.ExtendedChild\n | PresencesChild\n | PresencesChildInfoChild\n | GroupChildOnLocation\n | GroupRequestsApprovalChild;\n\nexport enum ChildType {\n PresencesChild,\n PresencesChildInfoChild,\n GroupChildOnLocation,\n GroupRequestsApprovalChild\n}\n\nexport class Child {\n public id: string;\n\n public firstName: string;\n public lastNamePrefix?: string;\n public lastName?: string;\n\n public fullName: string;\n\n public profilePicture: string;\n public birthDate?: moment.Moment;\n public events: Event[] = [];\n public diaryEvents: DiaryEvent[] = [];\n public presences: PresencesTimeInterval[] = [];\n public expectedTimes: PresencesTimeInterval[] = [];\n public labels: Label[] = [];\n public status?: PresencesStatus;\n public arrivedAt?: moment.Moment;\n public gender: GenderLabel;\n public medical?: PresencesMedical;\n public medicalInfo?: PresencesChildInfoMedical;\n public remarks?: string;\n public mentor?: ChildCare.Definitions.SelectionModel;\n public school?: School;\n public hasReminder?: boolean;\n public groupNames?: string;\n public diaries: Diary[] = [];\n public times: string;\n\n public childType?: ChildType;\n\n constructor(child: ChildTypes, childType?: ChildType) {\n this.childType = childType;\n\n this.id = child.childId;\n this.firstName = child.childName;\n this.gender = new GenderLabel(child.gender);\n if (child.picture != null && child.picture.url != null) {\n this.profilePicture = child.picture.url;\n }\n\n if (Child.isExtendedChild(child)) {\n this.firstName = child.firstName;\n this.lastNamePrefix = child.lastNamePrefix;\n this.lastName = child.lastName;\n this.birthDate = moment(child.birthDate);\n }\n\n if (Child.isFromChildInfo(child, childType)) {\n this.status = child.status;\n this.mentor = child.mentor;\n this.remarks = child.remarks;\n } else if (Child.isFromGroupChild(child, childType)) {\n this.groupNames = child.groupNames;\n } else if (Child.isFromApprovalChild(child, childType)) {\n this.times = child.times;\n } else if (Child.isFromPresencesChild(child, childType)) {\n this.status = child.status;\n this.medical = child.medical;\n this.hasReminder = child.hasReminder;\n this.presences = child.presences;\n this.expectedTimes = child.expectedTimes;\n }\n\n this.setFullName();\n }\n\n private static isExtendedChild(child: ChildTypes): child is ChildCare.Definitions.ExtendedChild {\n return child['firstName'] != null;\n }\n\n private static isFromChildInfo(child: ChildTypes, childType?: ChildType): child is PresencesChildInfoChild {\n return childType != null && childType === ChildType.PresencesChildInfoChild;\n }\n\n private static isFromGroupChild(child: ChildTypes, childType?: ChildType): child is GroupChildOnLocation {\n return childType != null && childType === ChildType.GroupChildOnLocation;\n }\n\n private static isFromApprovalChild(child: ChildTypes, childType?: ChildType): child is GroupRequestsApprovalChild {\n return childType != null && childType === ChildType.GroupRequestsApprovalChild;\n }\n\n private static isFromPresencesChild(child: ChildTypes, childType?: ChildType): child is PresencesChild {\n return childType != null && childType === ChildType.PresencesChild;\n }\n\n public addDiary(diary: DiaryEntry) {\n let diaryType: DiaryType;\n if (diary.diaryEntryType != null) {\n diaryType = new DiaryType(\n diary.diaryEntryType.diaryEntryTypeId,\n diary.diaryEntryType.name,\n diary.diaryEntryType.color,\n diary.diaryEntryType.icon\n );\n }\n\n this.diaries.push(new Diary(diary.diaryEntryId, diaryType, diary.text, diary.time));\n }\n\n public addLabel(label: PresencesLabel) {\n this.labels.push(new Label(label.name, label.description, label.colorCode));\n }\n\n public addEvent(event: PresencesEvent) {\n const startTime = moment.duration(event.startTime);\n const endTime = moment.duration(event.endTime);\n\n this.events.push(new Event(event.presenceType, startTime, endTime, event.remarks, event.planning));\n }\n\n public addDiaryEvent(event: PresencesDiaryEvent) {\n const startTime = moment.duration(event.startTime);\n const endTime = moment.duration(event.endTime);\n\n this.diaryEvents.push(new DiaryEvent(this.id,\n event.diaryEntryType,\n startTime,\n endTime,\n event.colorCode,\n event.quantity,\n event.diaryEntryId,\n event.diaryEntryTypeId,\n event.diaryScheduleId)\n );\n }\n\n public getCssClassForGender() {\n if (this.gender) {\n return (\n 'gender-' +\n this.gender\n .getIcon()\n .replace(' ', '-')\n .toLowerCase()\n );\n }\n }\n\n public cssClassForStatus() {\n if (this.status) {\n return (\n 'status-' +\n this.status\n .replace(/([A-Z])/g, '-$1')\n .trim()\n .toLowerCase()\n );\n }\n }\n\n public isBirthday() {\n if (this.birthDate) {\n return this.birthDate.format('MM/DD') === moment().format('MM/DD');\n }\n }\n\n public hasMedical() {\n return this.medical != null;\n }\n\n public hasMedicalInfo() {\n return this.medicalInfo != null && this.medicalInfo.remarks != null && this.medicalInfo.remarks != '';\n }\n\n public getAvatarInitials() {\n if (this.fullName == null) {\n return '';\n }\n\n let matches = this.fullName.match(/\\b(\\w)/g);\n if (matches.length < 2) {\n return this.fullName.slice(0, 2).toUpperCase();\n }\n\n matches = matches.slice(0, 2);\n return matches.join('').toUpperCase();\n }\n\n private setFullName(): void {\n this.fullName = this.firstName;\n if (this.lastNamePrefix && this.lastNamePrefix !== '') {\n this.fullName += ' ' + this.lastNamePrefix;\n }\n\n if (this.lastName && this.lastName !== '') {\n this.fullName += ' ' + this.lastName;\n }\n }\n\n public setMentor(mentor: ChildCare.Definitions.SelectionModel) {\n this.mentor = mentor;\n }\n\n public setRemarks(remarks: string) {\n this.remarks = remarks;\n }\n\n public setSchool(school: School) {\n this.school = school;\n }\n\n public ageString(): string {\n if (this.birthDate == null) {\n return 'Onbekend';\n }\n\n const now = moment();\n const years = now.diff(this.birthDate, 'years');\n const months = now.diff(this.birthDate, 'months') % 12;\n\n let ageString = '';\n if (years > 0) {\n ageString += `${years} jaar`;\n }\n\n if (years > 0 && months > 0) {\n ageString += ', ';\n }\n\n if (months == 1) {\n ageString += '1 maand';\n } else if (months > 1) {\n ageString += `${months} maanden`;\n }\n\n return ageString;\n }\n}\n","import { appModule, ft } from '@/definitions';\nimport { IScope, IPromise } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IStateParamsService } from 'angular-ui-router';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { RoleChecker } from '@/role-checker';\nimport { Child, School, FamilyMember, GenderLabel, ChildType } from '@/child-factory';\nimport moment from 'moment';\nimport * as ng from 'angular';\nimport { ChildCare } from '@/data-models';\nimport { Gender } from '@/enums';\n\nimport ChildLabel = ChildCare.Definitions.GroupApp.ChildLabel;\nimport ChildLabelType = ChildCare.Definitions.GroupApp.ChildLabelType;\ntype Label = ChildLabel | ChildLabelType;\n\ntype PresencesChildInfoMedical = ChildCare.Definitions.GroupApp.PresencesChildInfoMedical;\nimport PresencesUpdateChildInfoCommand = ChildCare.Definitions.GroupApp.PresencesUpdateChildInfoCommand;\nimport PresencesUpdateMedicalInfoCommand = ChildCare.Definitions.GroupApp.PresencesUpdateMedicalInfoCommand;\n\nenum EditMode {\n none = 'none',\n medical = 'medical',\n personal = 'personal'\n}\n\ninterface Form {\n personalInformation?: PresencesUpdateChildInfoCommand;\n medicalInformation?: PresencesUpdateMedicalInfoCommand;\n}\n\nenum Action {\n absent = 'absent',\n sick = 'sick',\n incidental = 'incidental',\n swap = 'swap',\n move = 'move',\n studyday = 'studyday',\n}\n\ntype Mentor = ChildCare.Definitions.SelectionModel & { isInactive: boolean };\n\ninterface Scope extends IScope {\n index: number;\n randomNumber: number;\n isLoading: boolean;\n canRequestBeforeContract: boolean;\n form: Form;\n mentors: Mentor[];\n schools: School[];\n genders: GenderLabel[];\n child: Child;\n familyMembers: FamilyMember[];\n responsibleParent: FamilyMember;\n\n editMode: EditMode;\n enterEditMode(editMode: EditMode): void;\n isPersonEditMode: () => boolean;\n isMedicalEditMode: () => boolean;\n leaveEditMode: () => void;\n save: () => void;\n\n openParentModal: (parent: any) => void;\n avatarUpload: (type: string, user: any) => void;\n openActionModal: (action: Action) => void;\n\n labelsState: LabelChanges;\n deleteLabel: (label: Label) => void;\n addLabel: (label: Label) => void;\n\n isEmpty: (id: string) => boolean;\n isMentorActive: (id: string) => boolean;\n}\n\nclass LabelChanges {\n public all: Label[] = [];\n public existing: Label[] = [];\n\n public added: string[] = [];\n public removed: string[] = [];\n\n public currentLabels: Label[] = [];\n public addableLabels: Label[] = [];\n\n public setAll(all: Label[]) {\n this.all = all;\n this.update();\n }\n\n public setExisting(existing: Label[]) {\n this.existing = existing;\n this.update();\n }\n\n public add(labelId: string): void {\n this.removeFrom(this.removed, labelId);\n if (this.existing.every(x => x.labelId !== labelId)) {\n this.added.push(labelId);\n }\n\n this.update();\n }\n\n public remove(labelId: string): void {\n this.removeFrom(this.added, labelId);\n\n if (this.existing.some(x => x.labelId === labelId)) {\n this.removed.push(labelId);\n }\n\n this.update();\n }\n\n private removeFrom(items: string[], item: string): void {\n const index = items.indexOf(item);\n\n if (index >= 0) {\n items.splice(index);\n }\n }\n\n private update() {\n this.currentLabels = [\n ...this.existing.filter(x => !this.removed.includes(x.labelId)),\n ...this.added.map(x => this.all.find(y => y.labelId === x))\n ];\n\n this.addableLabels = this.all.filter(x => this.currentLabels.every(y => y.labelId !== x.labelId));\n }\n\n public accept() {\n this.existing = [...this.currentLabels];\n this.clear();\n this.update();\n }\n\n public clear(): void {\n this.added = [];\n this.removed = [];\n this.currentLabels = [];\n this.addableLabels = [];\n }\n}\n\nappModule.controller('kpChildDetailController',\n ['$scope', '$q', 'AppDataService', '$stateParams', '$uibModal', 'LoadingBar', 'RoleCheckerService',\n function ($scope: Scope, $q: ng.IQService, appDataService: AppDataService, $stateParams: IStateParamsService, $uibModal: IModalService, LoadingBar, roleCheckerService: RoleChecker) {\n const childId: string = $stateParams.id;\n let initialized = false;\n $scope.randomNumber = ft.randomNumber;\n\n\n $scope.$watch('isLoading', function (newVal) {\n LoadingBar.show = newVal;\n });\n\n $scope.index = 0;\n $scope.isLoading = false;\n\n $scope.form = {};\n\n $scope.mentors = [];\n $scope.schools = [];\n $scope.genders = [new GenderLabel(Gender.Female), new GenderLabel(Gender.Male), new GenderLabel(Gender.Unknown)];\n $scope.labelsState = new LabelChanges();\n $scope.editMode = EditMode.none;\n\n const initialize = (): void => {\n if (initialized) {\n return;\n }\n\n fetchData();\n initialized = true;\n };\n\n $scope.deleteLabel = label => $scope.labelsState.remove(label.labelId);\n $scope.addLabel = label => $scope.labelsState.add(label.labelId);\n\n const fetchData = (): void => {\n $scope.isLoading = true;\n\n const childInfoTask = appDataService.getChildInfo(childId).then((result) => {\n\n $scope.canRequestBeforeContract = result.canRequestBeforeContract;\n $scope.child = new Child(result.child, ChildType.PresencesChildInfoChild);\n $scope.child.medicalInfo = result.medical;\n\n $scope.familyMembers = result.family.map(x => new FamilyMember(x));\n const responsible = $scope.familyMembers.find(x => x.isResponsible);\n\n if (responsible != null) {\n $scope.responsibleParent = responsible.clone();\n $scope.responsibleParent.phoneNumber = result.child.emergencyNumber;\n }\n\n $scope.schools = result.school.allSchools.map(x => new School(x));\n $scope.mentors = result.child.allMentors.map(x => ({ ...x, isInactive: false }) as Mentor);\n if (result.child.mentor != null && $scope.mentors.every(x => x.id !== result.child.mentor.id)) {\n $scope.mentors.push({...result.child.mentor, isInactive: true });\n }\n\n $scope.child.setSchool($scope.schools.find(x => x.id == result.school.schoolId));\n });\n\n const childLabelsTask = appDataService.getChildLabels(childId).then(x => $scope.labelsState.setExisting(x.labels));\n const allLabelsTask = appDataService.getAllChildLabels().then(x => $scope.labelsState.setAll(x.labels));\n\n $q.all([childInfoTask, childLabelsTask, allLabelsTask]).finally(() => $scope.isLoading = false);\n };\n\n $scope.isEmpty = (id) => id == null || id === '00000000-0000-0000-0000-000000000000';\n $scope.isMentorActive = (id) => !($scope.mentors.find(x => x.id === id)?.isInactive ?? true);\n\n $scope.avatarUpload = (type, user) => {\n const instance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/avatar/upload.html',\n controller: 'kpAvatarUploadModalController',\n size: 'sm',\n backdrop: true,\n keyboard: true,\n resolve: {\n type: () => ng.copy(type),\n name: () => ng.copy(typeof user.fullName === 'function' ? user.fullName() : user.fullName),\n id: () => ng.copy(user.id),\n }\n });\n\n instance.result.then((result) => {\n if (result === 'saved') {\n fetchData();\n } else {\n alert('Something went wrong!?');\n }\n });\n };\n\n $scope.isPersonEditMode = () => $scope.editMode === EditMode.personal && !$scope.isLoading;\n $scope.isMedicalEditMode = () => $scope.editMode === EditMode.medical && !$scope.isLoading;\n\n $scope.enterEditMode = function (editMode: EditMode): void {\n switch (editMode) {\n case EditMode.medical:\n $scope.form.medicalInformation = {} as PresencesUpdateMedicalInfoCommand;\n copyChildToMedical($scope.child, $scope.form.medicalInformation);\n break;\n case EditMode.personal:\n $scope.form.personalInformation = {} as PresencesUpdateChildInfoCommand;\n copyChildToPersonal($scope.child, $scope.form.personalInformation);\n break;\n }\n\n $scope.editMode = editMode;\n };\n\n $scope.leaveEditMode = () => {\n $scope.editMode = EditMode.none;\n };\n\n $scope.openParentModal = function (parent) {\n $uibModal.open({\n animation: true,\n templateUrl: 'partials/parent/modal.html?v=' + ft.randomNumber,\n controller: 'kpParentModalController',\n size: 'lg',\n backdrop: true,\n keyboard: true,\n resolve: {\n parentId: function () {\n return parent.id;\n }\n }\n });\n };\n\n $scope.save = () => {\n $scope.isLoading = true;\n let task: IPromise;\n\n switch ($scope.editMode) {\n case EditMode.medical:\n task = saveMedicalInfo();\n break;\n case EditMode.personal:\n task = savePersonalInformation();\n break;\n }\n\n task.finally(() => {\n $scope.isLoading = false;\n $scope.leaveEditMode();\n });\n };\n\n function saveMedicalInfo(): IPromise {\n const command = $scope.form.medicalInformation;\n\n return appDataService\n .saveMedicalInfo({ ...command, childId })\n .then(() => copyMedicalToChild(command, $scope.child));\n }\n\n function savePersonalInformation(): IPromise {\n const command = $scope.form.personalInformation;\n\n const addLabelTasks = $scope.labelsState.added.map(x => appDataService.addChildLabel(childId, x));\n const removeLabelTasks = $scope.labelsState.removed.map(x => appDataService.removeChildLabel(childId, x));\n\n // Convert javascript Date (with timezone info) to absolute string\n command.birthDate = moment(command.birthDate).format('DD-MM-YYYY');\n const saveChildInfoTask = appDataService.saveChildInfo(command);\n\n return $q\n .all([saveChildInfoTask, ...addLabelTasks, ...removeLabelTasks])\n .then(() => {\n $scope.labelsState.accept();\n copyPersonalToChild(command, $scope.child);\n });\n }\n\n function copyPersonalToChild(command: PresencesUpdateChildInfoCommand, child: Child): void {\n const { firstName, lastNamePrefix, lastName, birthDate, gender, mentorId, schoolId, remarks } = command;\n\n child.firstName = firstName;\n child.lastNamePrefix = lastNamePrefix;\n child.lastName = lastName;\n child.birthDate = moment(birthDate, 'DD-MM-YYYY');\n child.gender = new GenderLabel(gender);\n child.mentor = $scope.mentors.find(x => x.id == mentorId);\n child.school = $scope.schools.find(x => x.id == schoolId);\n child.remarks = remarks;\n }\n\n function copyChildToPersonal(child: Child, command: PresencesUpdateChildInfoCommand): void {\n const { id, firstName, lastNamePrefix, lastName, birthDate, gender, mentor, school, remarks } = child;\n\n command.childId = id;\n command.firstName = firstName;\n command.lastNamePrefix = lastNamePrefix;\n command.lastName = lastName;\n command.birthDate = birthDate.format('DD-MM-YYYY');\n command.gender = gender.key as Gender;\n command.mentorId = mentor != null ? mentor.id : '00000000-0000-0000-0000-000000000000';\n command.schoolId = school != null ? school.id : '00000000-0000-0000-0000-000000000000';\n command.remarks = remarks;\n }\n\n function copyChildToMedical(child: Child, command: PresencesUpdateMedicalInfoCommand): void {\n if (child.medicalInfo == null) {\n return;\n }\n const { doctorName, doctorPhone, remarks } = child.medicalInfo as PresencesChildInfoMedical;\n\n command.doctorName = doctorName;\n command.doctorPhone = doctorPhone;\n command.remarks = remarks;\n }\n\n function copyMedicalToChild(form: PresencesUpdateMedicalInfoCommand, child: Child): void {\n\n child.medicalInfo = { ...form } as PresencesChildInfoMedical;\n }\n\n $scope.openActionModal = function (action) {\n const capitalizedAction = action.charAt(0).toUpperCase() + action.slice(1);\n\n let size = 'medium';\n if (action === Action.studyday || action === Action.incidental || action === Action.sick) {\n size = 'large';\n }\n\n $uibModal.open({\n animation: true,\n templateUrl: 'partials/child/actions/' + action + 'Modal.html?v=' + ft.randomNumber,\n controller: 'kpAction' + capitalizedAction + 'ModalController',\n size: size,\n backdrop: true,\n keyboard: true,\n resolve: {\n child: function () {\n return $scope.child;\n },\n childId: function () {\n return childId;\n }\n }\n });\n };\n\n roleCheckerService.checkLogin().then(initialize);\n }\n ]\n);\n","import { appModule } from '@/definitions';\nimport { IScope, ITimeoutService } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IStateParamsService } from 'angular-ui-router';\nimport { ChildCare } from '@/data-models';\n\nimport DocumentsResponse = ChildCare.Definitions.Family.DocumentsResponse;\nimport { FortyTwoLoginService } from '@/FortyTwoFramework';\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n documents: DocumentsResponse[];\n download: (document: DocumentsResponse) => void;\n}\n\nappModule.controller('kpChildDocumentController',\n ['$scope', 'AppDataService', '$stateParams', 'LoadingBar', '$timeout', 'ftLoginService',\n function ($scope: ILocalScope, DataService: AppDataService, $stateParams: IStateParamsService, LoadingBar, $timeout: ITimeoutService, ftLoginService: FortyTwoLoginService) {\n $scope.isLoading = false;\n\n $scope.$watch('isLoading', function (newVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function () {\n $scope.isLoading = true;\n\n DataService.getDocumentsForChild($stateParams.id).then(documents => {\n $scope.documents = documents;\n }).finally(() => $scope.isLoading = false);\n };\n\n $scope.download = (document) => {\n const tokenData = ftLoginService.getTokenData();\n\n var token = encodeURIComponent(tokenData.token.value);\n\n var element = window.document.createElement('a');\n element.setAttribute('href', `${document.url}?accessToken=${token}`);\n element.setAttribute('download', document.title);\n element.setAttribute('target', '_blank');\n\n element.style.display = 'none';\n window.document.body.appendChild(element);\n\n element.click();\n\n window.document.body.removeChild(element);\n };\n\n $timeout(initialize);\n }\n ]\n);","import { appModule } from '@/definitions';\nimport { Calendar, EventApi, EventInput } from '@fullcalendar/core';\nimport dayGridPlugin from '@fullcalendar/daygrid';\nimport momentPlugin, { toMoment } from '@fullcalendar/moment';\n\nimport '@fullcalendar/core/main.css';\nimport '@fullcalendar/daygrid/main.css';\n\nimport enLocale from '@fullcalendar/core/locales/en-gb';\nimport nlLocale from '@fullcalendar/core/locales/nl';\n\nimport { ITimeoutService, IScope, ICompileService, IAugmentedJQuery } from 'angular';\n\nimport template from '@public/partials/child/tabs/planning.html';\nimport { AppDataService } from '@/services/app-data-service';\nimport moment from 'moment';\nimport { IStateParamsService } from 'angular-ui-router';\nimport { EventNonDateInput, EventRenderingChoice } from '@fullcalendar/core/structs/event';\n\nimport '@public/css/calendar-child.less';\n\ninterface ICalendarScope extends IScope {\n showMonth: boolean;\n gotoPreviousMonth: () => void;\n gotoNextMonth: () => void;\n gotoToday: () => void;\n}\n\nappModule.controller('kpChildPlanningController',\n ['$element', '$scope', '$stateParams', '$compile', '$timeout', 'AppDataService', 'LoadingBar', '$translate',\n function ($element: IAugmentedJQuery, $scope: ICalendarScope, $stateParams: IStateParamsService, $compile: ICompileService, $timeout: ITimeoutService, dataService: AppDataService, loadingBar, $translate) {\n\n const childId: string = $stateParams.id;\n let calendar: Calendar;\n\n const getLocale = () => {\n var locale = (window.navigator as any).userLanguage || window.navigator.language;\n if (locale.toLowerCase() === 'nl-nl') {\n locale = 'nl';\n }\n\n return locale;\n };\n\n const fetchEvents = (fetchInfo, successCallback, failureCallback) => {\n const startDate: moment.Moment = moment(fetchInfo.start);\n\n const startDay = startDate.date();\n const firstMonth = startDate.month();\n let year: number = startDate.year();\n\n let monthToFetch = firstMonth;\n // The first day in the calendar can be the previous month, in that case take the next month\n if (startDay !== 1) {\n monthToFetch = (monthToFetch + 1) % 12;\n if (monthToFetch < firstMonth) {\n year = year + 1;\n }\n }\n\n console.log(`Fetching month ${monthToFetch + 1}`);\n\n loadingBar.show = true;\n dataService.getPlanning(childId, monthToFetch + 1, year).then(function (result) {\n\n const events: EventInput[] = [];\n for (const week of result.weeks) {\n for (const day of week.days) {\n\n if (day.type === 'closed' || day.type === 'holiday') {\n events.push(toBackgroundEvent(day));\n events.push(toDayEvent(day));\n }\n\n for (const block of day.blocks) {\n events.push(toEvent(block));\n }\n }\n }\n\n successCallback(events);\n\n }).finally(function () {\n loadingBar.show = false;\n });\n };\n\n const toBackgroundEvent = (day): EventNonDateInput => {\n const start = moment.utc(day.date);\n\n const event = {\n classNames: ['planning-day-backgound', day.type],\n start: start.format('YYYY-MM-DD'),\n end: start.format('YYYY-MM-DD'),\n rendering: 'background' as EventRenderingChoice,\n extendedProps: {\n description: day.description,\n date: start\n }\n };\n\n return event;\n };\n\n const toDayEvent = (day): EventInput => {\n const start = moment.utc(day.date);\n\n const event = {\n classNames: ['planning-day', day.type],\n start: start.format('YYYY-MM-DD'),\n end: start.format('YYYY-MM-DD'),\n title: day.description\n };\n\n return event;\n };\n\n const toEvent = (block): EventInput => {\n\n const start = moment.utc(block.date).add(moment.duration(block.start));\n const end = moment.utc(block.date).add(moment.duration(block.end));\n\n const event = {\n id: block.id,\n title: createTitle(block),\n classNames: ['planning-block', block.status, block.presence],\n start: start.toISOString(),\n end: end.toISOString(),\n isAllDay: false\n };\n\n return event;\n };\n\n var createTitle = function (block) {\n const types = window.app.planning.types;\n const presenceTypes = window.app.planning.presence;\n\n if (block.type === types.absent) {\n if (block.presence == presenceTypes.absent) {\n return $translate.instant('PLANNING.ABSENT');\n }\n if (block.presence == presenceTypes.sick) {\n return $translate.instant('PLANNING.SICK');\n }\n if (block.presence == presenceTypes.holiday) {\n return $translate.instant('PLANNING.HOLIDAY');\n }\n }\n\n if (block.type === types.registration) {\n return block.description;\n }\n\n if (block.type === types.study) {\n return $translate.instant('PLANNING.STUDY');\n }\n\n if (block.type === types.swap) {\n return $translate.instant('PLANNING.SWAPPED');\n }\n\n if (block.type === types.incidental) {\n return $translate.instant('PLANNING.INCIDENTAL');\n }\n };\n\n const initialize = () => {\n\n const root = $element.get(0);\n for (const element of $compile(template)($scope).get()) {\n root.appendChild(element);\n }\n\n const contentElement = document.getElementById('calendar-content');\n const calenderElement = document.createElement('div');\n calenderElement.setAttribute('id', 'calendar-control');\n\n contentElement.appendChild(calenderElement);\n\n calendar = new Calendar(calenderElement, {\n locales: [enLocale, nlLocale],\n plugins: [dayGridPlugin, momentPlugin],\n timeZone: 'UTC',\n locale: getLocale(),\n defaultView: 'dayGridMonth',\n height: 600,\n header: {\n left: 'dayGridMonth,dayGridWeek',\n center: 'title',\n right: 'today prev,next'\n },\n events: fetchEvents,\n eventTimeFormat: 'HH:mm',\n displayEventEnd: true\n });\n\n calendar.render();\n };\n\n $timeout(() => initialize());\n }]);\n","import { appModule } from '@/definitions';\nimport moment from 'moment';\nimport { IQService, IScope, IPromise } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { Child } from '@/child-factory';\nimport { ChildCare } from '@/data-models';\n\nimport DiaryEntryType = ChildCare.Definitions.Family.DiaryEntryType;\n\ninterface IDiary {\n type: DiaryEntryType;\n text?: string;\n pickedTime: moment.Moment;\n}\n\ninterface ILocalScope extends IScope {\n displayDatePicker: (index: any) => void;\n isDiary: boolean;\n diaryType: DiaryEntryType;\n otherTypes: DiaryEntryType[];\n types: DiaryEntryType[];\n diaries: IDiary[];\n isLoading: boolean;\n saveDiaries: () => void;\n cancel: () => void;\n}\n\nappModule.controller('kpDiaryModalController',\n ['$scope', '$q', '$uibModalInstance', 'isDiary', 'diaryType', 'otherTypes', 'pickedDate', 'selectedChildren', 'AppDataService', 'mdcDateTimeDialog',\n function ($scope: ILocalScope, $q: IQService, $uibModalInstance: IModalInstanceService, isDiary: boolean, diaryType: DiaryEntryType, otherTypes: DiaryEntryType[], pickedDate: moment.Moment, selectedChildren: Child[], DataService: AppDataService, mdcDateTimeDialog) {\n $scope.isDiary = isDiary;\n $scope.diaryType = diaryType;\n $scope.otherTypes = otherTypes;\n\n $scope.types = isDiary ? [diaryType] : otherTypes;\n\n var childrenIds: string[] = [];\n $scope.diaries = [];\n\n $scope.isLoading = false;\n\n const now = pickedDate.milliseconds() !== 0 ? pickedDate : moment();\n\n const initialize = () => {\n\n for (const type of $scope.types) {\n $scope.diaries.push({\n type: type,\n pickedTime: now\n });\n }\n\n for (const child of selectedChildren) {\n childrenIds.push(child.id);\n }\n };\n\n $scope.saveDiaries = function () {\n var requests: IPromise[] = [];\n for (const diary of $scope.diaries) {\n if (diary.text == null) {\n continue;\n }\n\n const typeId = diary.type && diary.type.diaryEntryTypeId;\n\n requests.push(\n DataService.saveDiaryEntry(childrenIds, typeId, diary.text, diary.pickedTime, null)\n );\n }\n\n $scope.isLoading = true;\n $q.all(requests).finally(() => {\n $scope.isLoading = false;\n $uibModalInstance.close('Refetch');\n });\n };\n\n $scope.displayDatePicker = (index) => {\n mdcDateTimeDialog.show({\n currentDate: $scope.diaries[index].pickedTime,\n date: false,\n minuteSteps: 1,\n autoOk: true,\n disableParentScroll: true\n }).then((date) => {\n $scope.diaries[index].pickedTime = moment(date);\n });\n };\n\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n };\n\n initialize();\n }\n ]\n);\n","import { appModule, ft } from '@/definitions';\nimport moment from 'moment';\nimport { IScope, copy } from 'angular';\n\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { AppDataService } from '@/services/app-data-service';\n\nimport { Child, Diary } from '@/child-factory';\nimport { PresencesStatus } from '@/enums';\nimport { ChildCare } from '@/data-models';\n\nimport DiaryPresencesResponse = ChildCare.Definitions.Family.DiaryPresencesResponse;\nimport DiaryEntryType = ChildCare.Definitions.Family.DiaryEntryType;\nimport { RoleChecker } from '@/role-checker';\n\ninterface ILocalScope extends IScope {\n displayDatePicker: () => void;\n isLoading: boolean;\n initialized: boolean;\n group: any;\n PresencesStatus: typeof PresencesStatus;\n model: { showAll: boolean; removeMode: boolean };\n pickedDate: moment.Moment;\n selectedChildren: Child[];\n allChildren: Child[];\n children: Child[];\n navigateToGroups: () => void;\n toggleChild: (child: Child) => void;\n isToday: () => boolean;\n today: () => void;\n nextDay: () => void;\n previousDay: () => void;\n openModal: (isDiary: boolean) => void;\n isSelected: (child: Child) => boolean;\n onClick: (childId: string, diaryEntry: Diary) => void;\n}\n\nappModule.controller('kpDiaryOverviewController',\n ['$scope', '$timeout', 'AppDataService', 'ftSettingService', '$q', '$uibModal', '$location', '$state', 'LoadingBar', 'mdcDateTimeDialog', RoleChecker.serviceName,\n function ($scope: ILocalScope, $timeout, DataService: AppDataService, SettingService: ftSettingsService, $q: ng.IQService, $uibModal, $location, $state, LoadingBar, mdcDateTimeDialog, roleCheckerService: RoleChecker) {\n let selectedGroupId = null;\n\n $scope.isLoading = false;\n $scope.initialized = false;\n $scope.group = null;\n $scope.PresencesStatus = PresencesStatus;\n\n $scope.model = {\n showAll: false,\n removeMode: false\n };\n\n $scope.pickedDate = $location.search().date ?\n moment($location.search().date, 'DD/MM/YYYY') :\n moment();\n\n $scope.selectedChildren = [];\n $scope.allChildren = [];\n $scope.children = [];\n\n $scope.navigateToGroups = roleCheckerService.switchGroup;\n\n $scope.$watch('isLoading', function (newVal, oldVal) {\n LoadingBar.show = newVal;\n });\n\n const initialize = function () {\n if ($scope.initialized) {\n return;\n }\n\n selectedGroupId = SettingService.get(window.appSettings.group.selected);\n if (!selectedGroupId) {\n $state.go('app.groups',{previous:$state.current.name});\n }\n\n const promises: ng.IPromise[] = [];\n promises.push(DataService.getGroupsAsync());\n promises.push(DataService.getDiaryPresence(selectedGroupId, $scope.pickedDate.format('YYYY-MM-DD')));\n const request = $q.all(promises);\n\n $scope.isLoading = true;\n request.then(function (results) {\n $scope.group = results[0].groups.find(x => x.id === selectedGroupId);\n handleGetDiaries(results[1]);\n }).finally(function () {\n $scope.isLoading = false;\n });\n\n $scope.initialized = true;\n };\n\n $scope.onClick = (childId: string, diaryEntry: Diary) => {\n if (!$scope.model.removeMode) {\n return;\n }\n\n DataService.deleteDiaryEntry(childId, diaryEntry.id).then(() => {\n pickedDateWatch();\n });\n };\n\n $scope.$watch('pickedDate', function () {\n pickedDateWatch();\n $location.path('/app/diary').search({date: $scope.pickedDate.format('DD-MM-YYYY')});\n }, true);\n\n const pickedDateWatch = function () {\n if (!$scope.initialized) {\n return;\n }\n\n $scope.isLoading = true;\n DataService.getDiaryPresence(selectedGroupId, $scope.pickedDate.format('YYYY-MM-DD'))\n .then(handleGetDiaries)\n .finally(function () {\n $scope.selectedChildren = [];\n $scope.isLoading = false;\n });\n };\n\n const handleGetDiaries = function (result: DiaryPresencesResponse) {\n $scope.children = [];\n\n for (const presence of result.presences) {\n const child = new Child(presence.child);\n child.status = presence.status as unknown as PresencesStatus;\n (child as any).isChecked = false;\n\n for (const diary of presence.diaryEntries) {\n child.addDiary(diary);\n }\n\n $scope.children.push(child);\n }\n\n $scope.allChildren = copy($scope.children);\n };\n\n $scope.toggleChild = function (child) {\n if ($scope.selectedChildren.includes(child)) {\n const currentIndex = $scope.selectedChildren.indexOf(child);\n $scope.selectedChildren.splice(currentIndex, 1);\n } else {\n $scope.selectedChildren.push(child);\n }\n };\n\n $scope.isToday = function () {\n return moment().startOf('day')\n .diff($scope.pickedDate.startOf('day'), 'day') === 0;\n };\n\n $scope.displayDatePicker = () => {\n mdcDateTimeDialog.show({\n currentDate: $scope.pickedDate,\n time: false,\n autoOk: true,\n disableParentScroll: true\n }).then((date) => {\n $scope.pickedDate = moment(date);\n });\n };\n\n $scope.today = function () {\n $scope.pickedDate = moment();\n };\n\n $scope.nextDay = function () {\n $scope.pickedDate = $scope.pickedDate.add(1, 'day');\n };\n\n $scope.previousDay = function () {\n $scope.pickedDate = $scope.pickedDate.subtract(1, 'day');\n };\n\n let diaryEntryType: DiaryEntryType | null = null;\n const otherDiaryTypes: DiaryEntryType[] = [];\n $scope.openModal = function (isDiary: boolean) {\n if (diaryEntryType && isDiary || otherDiaryTypes.length > 0 && !isDiary) {\n return openDiaryModal(isDiary);\n }\n\n $scope.isLoading = true;\n DataService.getDiaryEntryTypes().then((result) => {\n result.types.forEach(function (type) {\n if (type.isDiary) {\n diaryEntryType = type;\n } else {\n otherDiaryTypes.push(type);\n }\n });\n\n openDiaryModal(isDiary);\n }).finally(function () {\n $scope.isLoading = false;\n });\n };\n\n $scope.isSelected = (child: Child): boolean => {\n return $scope.selectedChildren.includes(child);\n };\n\n const openDiaryModal = function (isDiary: boolean) {\n const instance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/diary/diaryModal.html?v=' + ft.randomNumber,\n controller: 'kpDiaryModalController',\n size: 'large',\n backdrop: true,\n keyboard: true,\n resolve: {\n isDiary: () => isDiary,\n diaryType: () => copy(diaryEntryType),\n otherTypes: () => copy(otherDiaryTypes),\n selectedChildren: () => copy($scope.selectedChildren),\n pickedDate: () => copy($scope.pickedDate)\n }\n });\n\n instance.result.then(function () {\n pickedDateWatch();\n });\n };\n\n $timeout(initialize);\n }\n ]);\n\n","import { appModule } from '@/definitions';\nimport { FortyTwoRootScopeService, FortyTwoLoginService, ftSettingsService } from '@/FortyTwoFramework';\nimport { IStateParamsService, IStateService } from 'angular-ui-router';\nimport { AppDataService } from '@/services/app-data-service';\nimport { RoleChecker } from '@/role-checker';\nimport { NetworkUtils } from '@/network-utils';\n\nclass ExternalLoginController {\n public static $inject = ['$rootScope', '$stateParams', 'ftLoginService', '$localStorage', 'AppDataService', 'ftConfiguration', 'ftSettingService', '$state', 'RoleCheckerService'];\n\n public constructor(\n private $rootScope: FortyTwoRootScopeService,\n private $stateParams: IStateParamsService,\n ftLoginService: FortyTwoLoginService,\n private $localStorage,\n private dataService: AppDataService,\n private ftConfiguration,\n private ftSettingService: ftSettingsService,\n private $state: IStateService,\n private roleCheckerService: RoleChecker) {\n\n if (!$stateParams.api) {\n return;\n }\n\n ftLoginService.doLogout();\n localStorage.clear();\n\n ftConfiguration.config.baseApiUrl = $stateParams.api;\n appModule.baseApiUrl = $stateParams.api;\n $localStorage.apiUrl = appModule.baseApiUrl;\n\n this.doExternalLogin();\n }\n\n private doExternalLogin() {\n const { token, group } = this.$stateParams;\n\n if (token == null) {\n return;\n }\n\n const decodedToken = decodeURIComponent(token);\n\n this.dataService.oauthLoginAsync(decodedToken).then(() => {\n this.$localStorage.refreshToken = decodedToken;\n this.refreshConfiguration();\n\n this.ftSettingService.set('app.presence', {});\n this.$rootScope.showSplash = false;\n\n return this.dataService.getUser().then(user => {\n\n if (group != null) {\n this.ftSettingService.set(window.appSettings.group.selected, group);\n } else if (user.groups && user.groups.length === 1) {\n this.ftSettingService.set(window.appSettings.group.selected, user.groups[0].id);\n } else {\n this.ftSettingService.set(window.appSettings.group.selected, null);\n }\n\n const previous = NetworkUtils.getQueryParam('previous');\n if (previous != null) {\n this.$state.go(previous);\n } else {\n return this.roleCheckerService.navigateToRoleStartPage();\n }\n });\n\n });\n }\n\n private refreshConfiguration() {\n return this.dataService.getConfigurationAsync().then((results) => {\n this.$rootScope.configuration = results;\n this.ftConfiguration.configure(results);\n });\n }\n}\n\nappModule.controller('kpExternalLoginController', ExternalLoginController);","import { appModule, ft } from '@/definitions';\nimport { RoleChecker } from '@/role-checker';\nimport { ftSettingsService, FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ITimeoutService, IScope } from 'angular';\nimport { IStateService } from 'angular-ui-router';\nimport { ILoadingBar } from '@/models';\nimport { ChildCare } from '@/data-models';\n\ntype GroupModel = ChildCare.Definitions.Account.GroupModel;\n\ninterface LocalScope extends IScope {\n randomNumber: number;\n isLoading: boolean;\n group: any;\n navigateToGroups: any;\n}\n\nappModule.controller('kpGroupMediaController',\n ['$scope', '$state', '$timeout', 'AppDataService', 'ftSettingService', 'LoadingBar', 'ftLoginService', RoleChecker.serviceName,\n function ($scope: LocalScope, $state: IStateService, $timeout: ITimeoutService, AppDataService: AppDataService, ftSettingService: ftSettingsService, LoadingBar: ILoadingBar, ftLoginService: FortyTwoLoginService, roleCheckerService: RoleChecker) {\n var initialized = false;\n var selectedGroupId: string;\n\n $scope.randomNumber = ft.randomNumber;\n $scope.isLoading = false;\n $scope.group = null;\n\n $scope.$watch('isLoading', (newVal: boolean) => {\n LoadingBar.show = newVal;\n });\n\n const initialize = function () {\n if (initialized) {\n return;\n }\n\n selectedGroupId = ftSettingService.get(window.appSettings.group.selected);\n if (!selectedGroupId) {\n $state.go('app.groups', { previous:$state.current.name });\n }\n\n $scope.isLoading = true;\n AppDataService.getGroupsAsync().then((results) => {\n setCurrentGroup(results.groups, selectedGroupId);\n });\n\n initialized = true;\n };\n\n //#region screen handlers\n $scope.navigateToGroups = roleCheckerService.switchGroup;\n\n const setCurrentGroup = (groups: GroupModel[], selectedGroupId: string) => {\n $scope.group = groups.find(x => x.id === selectedGroupId);\n if (!$scope.group) {\n ftLoginService.getCurrentUserAsync().then(user => {\n if (user.groups?.length === 1) {\n ftSettingService.set(window.appSettings.group.selected, user.groups[0].id);\n $scope.group = groups.find(x => x.id === user.groups[0].id);\n } else {\n $state.go('app.groups', { previous:$state.current.name });\n }\n });\n }\n };\n\n //#endregion\n $timeout(initialize);\n }\n ]);\n","import { RoleChecker } from '@/role-checker';\nimport { appModule } from '@/definitions';\nimport { FortyTwoLoginService, ftSettingsService, FortyTwoRootScopeService } from '@/FortyTwoFramework';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IScope, IPromise } from 'angular';\nimport { IStateParamsService, IStateService } from 'angular-ui-router';\nimport { ChildCare } from '@/data-models';\n\ntype GroupModel = ChildCare.Definitions.Account.GroupModel;\n\ninterface LocalScope extends IScope {\n isLoading: boolean;\n groups: GroupModel[];\n switchGroup(groupId: string): void;\n}\n\nclass GroupListController {\n public static $inject = ['$rootScope', '$scope', '$state', '$stateParams', 'ftSettingService', 'AppDataService', 'ftLoginService', RoleChecker.serviceName];\n\n constructor(\n private $rootScope: FortyTwoRootScopeService,\n $scope: LocalScope,\n $state: IStateService,\n private $stateParams: IStateParamsService,\n private settingsService: ftSettingsService,\n private dataService: AppDataService,\n ftLoginService: FortyTwoLoginService,\n roleCheckerService: RoleChecker) {\n\n $scope.isLoading = true;\n $scope.groups = [];\n $scope.switchGroup = this.switchGroup.bind(this);\n\n roleCheckerService.allowGroupSwitching().then(result => {\n if (!result) {\n ftLoginService.doLogout();\n settingsService.set(window.appSettings.group.selected, undefined);\n $state.go('outside-app.login');\n }\n });\n\n dataService.getGroupsAsync().then(results => {\n $scope.groups = results.groups;\n $scope.isLoading = false;\n });\n }\n\n public switchGroup(groupId: string): IPromise {\n return this.dataService.switchGroup(groupId).then(response => {\n\n this.settingsService.set(window.appSettings.group.selected, groupId);\n\n const { location: { hostname, port } } = window;\n const linkToRemove = this.$rootScope.configuration.services.groups;\n\n let redirectLink = response.redirectUri;\n if (response.redirectUri.includes(linkToRemove)) {\n redirectLink = `${location.protocol}//${hostname}:${port}${response.redirectUri.substr(linkToRemove.length)}`;\n }\n\n if (this.$stateParams.previous != null) {\n redirectLink += `&previous=${this.$stateParams.previous}`;\n }\n\n location.href = redirectLink;\n });\n }\n}\n\nappModule.controller('kpGroupListController', GroupListController);","import { appModule } from '@/definitions';\nimport { ILocationService, IScope } from 'angular';\nimport { IStateService } from 'angular-ui-router';\nimport { UrlHelper } from '@/urlHelper';\nimport { IFortyTwoDropzoneRootScopeService } from '@/directives/dropzone';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\n\ntype MediaListResponse = ChildCare.Definitions.Media.MediaListResponse;\n\ninterface ILocalScope extends IScope {\n media: MediaItem[];\n close: () => void;\n playVideo: (mediaItem: MediaItem) => void;\n baseUrl: string;\n}\n\ninterface MediaItem {\n url: string;\n videoUrl: string;\n albumId: string;\n mediaId: string;\n thumbUrl: string;\n caption: string;\n type: ChildCare.Definitions.Common.MediaType;\n}\n\nappModule.controller('kpAlbumOverviewModalController',\n ['$rootScope', '$scope', '$state', '$uibModalInstance', 'album', '$localStorage', 'AppDataService', '$location',\n function ($rootScope: IFortyTwoDropzoneRootScopeService, $scope: ILocalScope, $state: IStateService, $uibModalInstance: IModalInstanceService, album: ChildCare.Definitions.Media.AlbumsListResponseItem, $localStorage, DataService: AppDataService, $location: ILocationService) {\n const token = $localStorage.refreshToken;\n\n function initialize() {\n DataService.getMediaForAlbumAsync(album.id)\n .then(handleResponse);\n\n $scope.baseUrl = $location.protocol() + '://' + $location.host() + ':' + $location.port();\n }\n\n function handleResponse(response: MediaListResponse) {\n $scope.media = response.media.map(m => ({\n url: createUrl(m.media.url),\n videoUrl: createVideoUrl(m.media.url),\n albumId: m.albumId,\n mediaId: m.mediaId,\n thumbUrl: createUrl(m.media.poster),\n caption: m.media.title,\n type: m.media.type\n }) as MediaItem);\n }\n\n function createUrl(url: string): string {\n\n const encodedToken = encodeURIComponent(token);\n\n let absoluteUrl = url;\n\n if (!UrlHelper.isUrlAbsolute(absoluteUrl)) {\n absoluteUrl = UrlHelper.createAbsoluteMediaUrl($rootScope.configuration.services.media, url);\n }\n\n return `${absoluteUrl}?access_token=${encodedToken}`;\n }\n\n function createVideoUrl(url: string): string {\n if (!UrlHelper.isUrlAbsolute(url)) {\n url = UrlHelper.createAbsoluteMediaUrl($rootScope.configuration.services.media, url);\n }\n\n return `${$scope.baseUrl}/component/video-player.html?src=${encodeURIComponent(url)}&access_token=${encodeURIComponent(token)}`;\n }\n\n $scope.close = function () {\n $uibModalInstance.dismiss();\n };\n\n $scope.playVideo = (mediaItem) => {\n $state.go('app.video', { mediaId: mediaItem.mediaId });\n $uibModalInstance.close();\n };\n\n initialize();\n }\n ]\n);\n","export enum AlbumType {\n none = 'none',\n new = 'new'\n}\n\nexport interface ILoadingBar {\n show: boolean;\n}\n","import swal from 'bootstrap-sweetalert';\nimport { appModule } from '@/definitions';\nimport { IScope, IController } from 'angular';\nimport Dropzone, { DropzoneFile } from 'dropzone';\nimport { IFortyTwoDropzoneRootScopeService } from '@/directives/dropzone';\nimport { AlbumType } from '@/models';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\n\ntype CreateOrUpdateAlbumCommand = ChildCare.Definitions.Media.CreateOrUpdateAlbumCommand;\ntype WriteAudienceGroup = ChildCare.Definitions.GroupApp.WriteAudienceGroup;\ntype WriteAudience = ChildCare.Definitions.GroupApp.WriteAudience;\n\ndeclare module '@/data-models' {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace ChildCare.Definitions.GroupApp {\n interface WriteAudience {\n type: ChildCare.Definitions.GroupApp.TypeOfAudience;\n checked: boolean;\n }\n }\n}\n\n\ninterface Scope extends IScope {\n numberOfSelectedAudiences: () => number;\n hasAudiencesSelected: () => boolean;\n selectedAudienceGroup: WriteAudienceGroup;\n audienceGroups: WriteAudienceGroup[];\n selectedAudiences: WriteAudience[];\n uploadMedia: () => void;\n selectAudience: (index: number) => void;\n toggleSelectionAudiences: (type: string) => void;\n form: {\n albumTypeOrId: AlbumType | string;\n newAlbumName: string;\n newAlbumDescription: string;\n };\n isLoading: boolean;\n allAudiencesSelected: boolean;\n mediaAlbums: Array;\n cancel: () => void;\n valid: boolean;\n showAllAlbums: boolean;\n canUpload: () => boolean;\n dropzoneConfig: {\n options: Dropzone.DropzoneOptions;\n eventHandlers: any;\n };\n toggleSelectAudience(audience: WriteAudience): void;\n}\n\nclass MediaUploadController implements IController {\n public static readonly $inject = ['$rootScope', '$scope', '$uibModalInstance', 'audiences', 'AppDataService', '$translate', '$localStorage'];\n\n private readonly $rootScope: IFortyTwoDropzoneRootScopeService;\n private readonly $scope: Scope;\n private readonly $uibModalInstance: any;\n private audienceGroups: WriteAudienceGroup[];\n private readonly dataService: AppDataService;\n private readonly $translate: any;\n private readonly $localStorage: any;\n\n private uploadSucceeded: boolean;\n\n constructor($rootScope: IFortyTwoDropzoneRootScopeService, $scope: Scope, $uibModalInstance: IModalInstanceService, audiences: WriteAudienceGroup[], dataService: AppDataService, $translate, $localStorage) {\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$uibModalInstance = $uibModalInstance;\n this.audienceGroups = audiences;\n this.dataService = dataService;\n this.$translate = $translate;\n this.$localStorage = $localStorage;\n\n this.queuecomplete = this.queuecomplete.bind(this);\n this.error = this.error.bind(this);\n\n this.$scope.cancel = this.cancel.bind(this);\n this.$scope.toggleSelectionAudiences = this.toggleSelectionAudiences.bind(this);\n this.$scope.toggleSelectAudience = this.toggleSelectAudience.bind(this);\n this.$scope.hasAudiencesSelected = this.hasAudiencesSelected.bind(this);\n this.$scope.selectAudience = this.selectAudience.bind(this);\n this.$scope.canUpload = this.canUpload.bind(this);\n\n this.initialize();\n }\n\n private initialize(): void {\n this.$scope.mediaAlbums = [];\n\n this.audienceGroups = this.audienceGroups.filter(a => a.audienceType !== 'group');\n\n const selectedAudiences = [];\n this.audienceGroups.forEach((audienceGroup, groupIndex) => {\n audienceGroup.audiences.forEach((audienceItem, index) => {\n audienceItem.type = audienceGroup.audienceType;\n audienceItem.checked = false;\n this.audienceGroups[groupIndex].audiences[index] = audienceItem;\n\n selectedAudiences.push(audienceItem);\n });\n });\n\n this.$scope.audienceGroups = this.audienceGroups;\n this.$scope.selectedAudienceGroup = this.audienceGroups[0];\n this.$scope.selectedAudiences = selectedAudiences;\n\n this.$scope.uploadMedia = this.uploadMedia.bind(this);\n\n this.$scope.valid = true;\n this.$scope.form = {\n albumTypeOrId: AlbumType.none,\n newAlbumName: null,\n newAlbumDescription: null\n };\n\n this.$scope.isLoading = true;\n this.$scope.$watch('showAllAlbums', (showAllAlbums: boolean) => {\n this.dataService.getMediaAlbumsAsync(showAllAlbums)\n .then(response => this.$scope.mediaAlbums = response.items)\n .finally(() => this.$scope.isLoading = false);\n });\n\n this.$scope.dropzoneConfig = this.createDropzoneConfig();\n }\n\n private createDropzoneConfig(): Scope['dropzoneConfig'] {\n\n let acceptedFiles = this.$rootScope.configuration.features.find(prop => prop.code === 'media-shows-image-and-video') ? 'image/*,video/mp4,video/quicktime,video/x-msvideo,video/x-ms-wmv' : 'image/*';\n return {\n options: {\n url: (files: ReadonlyArray) => {\n const mimeType = files[0].type;\n if (mimeType.startsWith('video')) {\n return this.$rootScope.configuration.services.media + '/videos';\n } else {\n return this.$rootScope.configuration.services.media + '/images';\n }\n },\n parallelUploads: 4,\n timeout: 1000 * 60 * 20,\n acceptedFiles: acceptedFiles,\n addRemoveLinks: true,\n autoProcessQueue: false,\n headers: {\n 'Authorization': `Bearer ${this.$localStorage.refreshToken}`\n }\n },\n eventHandlers: {\n queuecomplete: this.queuecomplete,\n success: () => {\n if (this.$rootScope.dropzone.getQueuedFiles().length > 0) {\n this.$rootScope.dropzone.processQueue();\n }\n this.uploadSucceeded = this.$rootScope.dropzone.getQueuedFiles().length === 0;\n },\n error: this.error,\n addedfile: () => this.$scope.$apply(),\n addedfiles: () => this.$scope.$apply(),\n removedfile: () => this.$scope.$apply()\n }\n };\n }\n\n private queuecomplete(): void {\n if (this.uploadSucceeded) {\n this.$uibModalInstance.dismiss();\n\n swal({\n title: 'Opgeslagen!',\n text: 'Alle media is succesvol opgeslagen!',\n timer: 2000,\n type: 'success'\n });\n }\n }\n\n private error(): void {\n this.$uibModalInstance.dismiss();\n\n swal({\n title: this.$translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: this.$translate.instant('MEDIA.ERROR.UPLOAD-FAILED'),\n timer: 2500,\n type: 'error'\n });\n }\n\n private canUpload(): boolean {\n if (this.$scope.isLoading || this.$scope.selectedAudiences == null || this.$scope.form.albumTypeOrId === AlbumType.none) {\n return false;\n }\n\n const audiences = this.$scope.selectedAudiences;\n\n const hasSelectedAudiences = audiences.filter(a => a.checked).length > 0;\n const hasFiles = this.$rootScope.dropzone.files.length > 0;\n let hasSelectedAlbum = true;\n\n if (this.$scope.form.albumTypeOrId === AlbumType.new) {\n hasSelectedAlbum = this.$scope.form.newAlbumName != '' && this.$scope.form.newAlbumName != null;\n }\n\n return hasFiles && hasSelectedAudiences && hasSelectedAlbum;\n }\n\n private isValid(): boolean {\n const audiences = this.$scope.selectedAudiences.filter(a => a.checked);\n\n if (audiences.length === 0) {\n return false;\n }\n\n if (this.$scope.form.albumTypeOrId === AlbumType.none) {\n return false;\n }\n\n if (this.$scope.form.albumTypeOrId === AlbumType.new && !this.$scope.form.newAlbumName) {\n return false;\n }\n\n return true;\n }\n\n private async uploadMedia(): Promise {\n this.$scope.valid = this.isValid();\n const audiences = this.$scope.selectedAudiences.filter(a => a.checked);\n\n this.$scope.isLoading = true;\n\n const hasAllAudience = audiences.filter(x => x.isAllAudience == true);\n const otherAudiences = audiences.filter(x => x.isAllAudience == false);\n\n const expectedAudienceIds: string[] = [];\n const hasAllAudienceTypes = [];\n hasAllAudience.forEach((allAudience) => {\n hasAllAudienceTypes.push(allAudience.type);\n expectedAudienceIds.push(allAudience.id);\n });\n\n otherAudiences.forEach((audience) => {\n if (!hasAllAudienceTypes.includes(audience.type)) {\n expectedAudienceIds.push(audience.id);\n }\n });\n\n const { albumTypeOrId, newAlbumName, newAlbumDescription } = this.$scope.form;\n\n const data = {\n audiences: expectedAudienceIds,\n albumId: albumTypeOrId\n };\n\n if (albumTypeOrId === AlbumType.new) {\n const result = await this.dataService.addAlbumAsync(newAlbumName, newAlbumDescription);\n data.albumId = result.id;\n }\n\n (this.$rootScope.dropzone as any).options.params = data;\n\n this.$rootScope.dropzone.processQueue();\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n\n private toggleSelectionAudiences(type: string) {\n this.$scope.allAudiencesSelected = !this.$scope.allAudiencesSelected;\n this.$scope.selectedAudiences.forEach(audience => {\n if (audience.type === type) {\n audience.checked = this.$scope.allAudiencesSelected;\n }\n });\n }\n\n private toggleSelectAudience(audience: WriteAudience): void {\n audience.checked = !audience.checked;\n\n if (!audience.checked) {\n this.$scope.allAudiencesSelected = false;\n const allAudience = this.$scope.selectedAudiences.find(x => x.type == audience.type && x.isAllAudience);\n allAudience.checked = false;\n }\n\n const amountOfAudiences = this.$scope.selectedAudiences.filter(x => x.isAllAudience == false && x.type == audience.type).length;\n\n const checkedAmount = this.$scope.selectedAudiences.filter(x => x.checked == true && x.type == audience.type)\n .length;\n\n if (amountOfAudiences === checkedAmount) {\n this.$scope.allAudiencesSelected = true;\n const allAudience = this.$scope.selectedAudiences.find(x => x.type == audience.type && x.isAllAudience);\n allAudience.checked = true;\n }\n }\n\n private hasAudiencesSelected(): boolean {\n if (this.$scope.selectedAudiences) {\n return this.$scope.selectedAudiences.filter(x => x.checked == true).length > 0;\n }\n }\n\n private selectAudience(index: number): void {\n this.$scope.selectedAudienceGroup = this.audienceGroups[index];\n const allAudience = this.$scope.selectedAudiences.find(\n x => x.isAllAudience && x.type === this.audienceGroups[index].audienceType\n );\n\n if (allAudience) {\n this.$scope.allAudiencesSelected = allAudience.checked;\n return;\n }\n\n const checkedAudiencesInType = this.$scope.selectedAudiences.filter(\n x => x.type === this.audienceGroups[index].audienceType && x.checked\n ).length;\n\n this.$scope.allAudiencesSelected = checkedAudiencesInType === this.audienceGroups[index].audiences.length;\n }\n}\n\nappModule.controller('kpMediaModalController', MediaUploadController);\n","import { appModule, app, ft } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IScope, ITimeoutService, IQService, IIntervalService, IPromise } from 'angular';\nimport ng from 'angular';\nimport moment from 'moment';\nimport { ChildCare } from '@/data-models';\n\ninterface ReadablePostsResponseItem extends ChildCare.Definitions.GroupApp.PostsResponseItem {\n read?: boolean;\n}\n\ninterface Scope extends IScope {\n sendMessage: (event: { message: string }, message: string) => void;\n message: string;\n backToListView: () => void;\n showMoreMessages: () => void;\n filters: { internalOnly: boolean };\n getReplyedAs: (comment: ChildCare.Definitions.GroupApp.PostComment) => ChildCare.Definitions.GroupApp.PostComment;\n openNewConversationModal: () => void;\n answerComment: (comment: ChildCare.Definitions.GroupApp.PostComment) => void;\n replyComment: ChildCare.Definitions.GroupApp.PostComment;\n messageListView: boolean;\n loadPost: (selectedConversation: ChildCare.Definitions.GroupApp.PostResponse | ChildCare.Definitions.GroupApp.PostsResponseItem) => void;\n sendNotification: boolean;\n audiences: ChildCare.Definitions.GroupApp.WriteAudienceGroup[];\n selectedConversation: ChildCare.Definitions.GroupApp.PostResponse | ChildCare.Definitions.GroupApp.PostsResponseItem;\n messageLimit: number;\n fetchingMessages: boolean;\n isLoading: boolean;\n conversations: ChildCare.Definitions.GroupApp.PostsResponseItem[];\n}\n\nfunction isPostResponse(item: ChildCare.Definitions.GroupApp.PostResponse | ChildCare.Definitions.GroupApp.PostsResponseItem): item is ChildCare.Definitions.GroupApp.PostResponse {\n return (item as ChildCare.Definitions.GroupApp.PostResponse).comments != null;\n}\n\nappModule.controller('kpMessagesController',\n ['$rootScope', '$scope', '$timeout', '$q', 'AppDataService', '$uibModal', '$stateParams', '$interval', 'LoadingBar',\n function ($rootScope, $scope: Scope, $timeout: ITimeoutService, $q: IQService, DataService: AppDataService, $uibModal, $stateParams, $interval: IIntervalService, LoadingBar) {\n var initialized = false;\n var lastFetchDate = null;\n var childId = $stateParams.id;\n var additionalReminderCount = 0;\n var allConversations = [];\n\n $scope.fetchingMessages = false;\n $scope.isLoading = false;\n $scope.conversations = [];\n $scope.messageLimit = app.settings.conversations.fetchRange;\n $scope.messageListView = true;\n $scope.selectedConversation = null;\n $scope.replyComment = null;\n $scope.audiences = null;\n\n $scope.getReplyedAs = (comment: ChildCare.Definitions.GroupApp.PostComment) => {\n if (isPostResponse($scope.selectedConversation)) {\n return $scope.selectedConversation.comments.find(x => x.commentId == comment.replyToCommentId);\n }\n };\n\n $scope.filters = {\n internalOnly: false\n };\n\n $scope.message = '';\n\n $scope.$watch('isLoading', function (newVal, oldVal) {\n LoadingBar.show = newVal;\n });\n\n var initialize = function () {\n if (initialized)\n {return;}\n\n $rootScope.$on('newPostMade', function (event, sendNotification) {\n $scope.sendNotification = sendNotification;\n refreshConversations();\n });\n\n var newPostInterval = $interval(function () {\n $rootScope.$broadcast('newPostMade', true);\n }, 1000 * 30);\n\n\n $scope.$on('$destroy', function () {\n $interval.cancel(newPostInterval);\n\n $rootScope.$$listeners['newPostMade'] = [];\n });\n\n getData().then(() => {\n if ($stateParams.postId != null) {\n $scope.selectedConversation = $scope.conversations.find(x => x.postId === $stateParams.postId);\n if ($scope.selectedConversation != null) {\n $scope.loadPost($scope.selectedConversation);\n }\n }\n });\n\n initialized = true;\n };\n\n var applyFilters = function () {\n if ($scope.conversations.length === 0 && allConversations.length === 0)\n {return;}\n\n if ($scope.filters.internalOnly === false) {\n if (allConversations.length === 0)\n {allConversations = ng.copy($scope.conversations);}\n\n $scope.conversations = ng.copy(allConversations);\n return;\n }\n\n allConversations = ng.copy($scope.conversations);\n $scope.conversations = allConversations.filter(x => x.isInternal == $scope.filters.internalOnly);\n };\n\n $scope.$watch('filters.internalOnly', applyFilters, true);\n\n var refreshConversations = function () {\n ft.log('Im refreshing the posts...');\n\n $scope.isLoading = true;\n getMessagesAsync(false).then(handleGetMessages).finally(function () { $scope.isLoading = false; });\n };\n\n $rootScope.getAvatarInitials = function (fullName) {\n var matches = fullName.match(/\\b(\\w)/g);\n if (matches.length < 2) {\n return fullName.slice(0, 2).toUpperCase();\n }\n\n matches = matches.slice(0, 2);\n return matches.join('').toUpperCase();\n };\n\n $scope.showMoreMessages = function () {\n // Don't do the call if it's already fetching, or there could not possibly be a new message because it didn't\n // fetch the settings amount of items from the last call\n if ($scope.fetchingMessages || $scope.messageLimit >= ($scope.conversations.length + app.settings.conversations.fetchRange + additionalReminderCount))\n {return;}\n\n $scope.isLoading = true;\n $scope.fetchingMessages = true;\n\n getMessagesAsync(true)\n .then(addConversationsToList)\n .finally(() => {\n $scope.messageLimit += app.settings.conversations.fetchRange;\n $scope.isLoading = false;\n $scope.fetchingMessages = false;\n });\n };\n\n var addConversationsToList = function (results) {\n for (const conversation of results.posts) {\n $scope.conversations.push(conversation);\n }\n };\n\n var getData = function (): IPromise {\n $scope.isLoading = true;\n\n var prms = [\n DataService.getAudiencesAsync(childId),\n getMessagesAsync(false)\n ];\n\n if (childId) {\n prms.push(DataService.getReminderFor(childId, moment().utc().format('YYYY-MM-DD')));\n }\n\n return $q.all(prms).then(function (results) {\n handleGetAudiences(results[0] as ChildCare.Definitions.GroupApp.WriteAudienceResponse);\n handleGetMessages(results[1] as ChildCare.Definitions.GroupApp.PostsResponse);\n\n if (results[2]) {\n handleGetReminders((results[2] as ChildCare.Definitions.GroupApp.PostsResponse).posts);\n }\n }).finally(function () {\n $scope.isLoading = false;\n });\n };\n\n var getMessagesAsync = function (loadMore: boolean) {\n var dateTime = moment().utc().format('YYYY-MM-DDTHH-mm-ss');\n if (!lastFetchDate) {\n lastFetchDate = dateTime;\n return DataService.getMessagesAsync(lastFetchDate, childId);\n }\n\n if (loadMore) {\n var lastConvo = $scope.conversations[$scope.conversations.length - 1];\n return DataService.getMessagesAsync(lastConvo.lastUpdatedUTC, childId);\n }\n\n var returnValue = DataService.getMessagesSinceAsync(lastFetchDate, childId);\n lastFetchDate = dateTime;\n return returnValue;\n };\n\n var handleGetReminders = function (posts: ChildCare.Definitions.GroupApp.PostsResponseItem[]) {\n posts.forEach(function (post) {\n var existingPost = $scope.conversations.find(x => x.postId == post.postId);\n\n if (existingPost)\n {$scope.conversations.splice($scope.conversations.indexOf(existingPost), 1);}\n\n $scope.conversations.push(post);\n });\n\n additionalReminderCount = $scope.conversations.length - app.settings.conversations.fetchRange;\n };\n\n var handleGetMessages = function (results: ChildCare.Definitions.GroupApp.PostsResponse) {\n if (!results.posts) {\n results = results[0];\n }\n\n const posts = results.posts as ReadablePostsResponseItem[];\n if (posts.length === 0) {\n return;\n }\n\n if ($scope.conversations.length === 0) {\n $scope.conversations = posts;\n } else {\n if ($scope.selectedConversation) {\n $scope.sendNotification = false;\n $scope.loadPost($scope.selectedConversation);\n }\n\n // Send a notification that there are new messages\n if ($scope.sendNotification) {\n $rootScope.$broadcast(\n 'ft-notifications-add',\n {\n title: 'Nieuwe berichten!',\n message: 'Er zijn ' + posts.length + ' nieuwe berichten!'\n }\n );\n }\n\n posts.forEach(function (post) {\n var postExists = $scope.conversations.find(x => x.postId == post.postId);\n\n if ($scope.sendNotification) {\n post.read = false;\n }\n\n if (postExists) {\n var index = $scope.conversations.indexOf(postExists);\n $scope.conversations[index] = post;\n } else {\n $scope.conversations.push(post);\n }\n });\n }\n\n applyFilters();\n };\n\n var handleGetAudiences = function (results: ChildCare.Definitions.GroupApp.WriteAudienceResponse) {\n $scope.audiences = results.groups;\n };\n\n $scope.loadPost = function (conversation: ChildCare.Definitions.GroupApp.PostResponse | ChildCare.Definitions.GroupApp.PostsResponseItem): void {\n $scope.messageListView = false;\n $scope.selectedConversation = conversation;\n\n $scope.isLoading = true;\n DataService.getPost(conversation).then(function (post) {\n $scope.selectedConversation = post;\n $scope.selectedConversation.createdOn = conversation.createdOn;\n }).finally(function () {\n $scope.isLoading = false;\n markAsRead(conversation);\n });\n };\n\n var markAsRead = function (conversation) {\n var index = $scope.conversations.indexOf(conversation);\n conversation.read = true;\n\n $scope.conversations[index] = conversation;\n };\n\n $scope.answerComment = function (comment: ChildCare.Definitions.GroupApp.PostComment) {\n $scope.replyComment = comment;\n };\n\n $scope.backToListView = function () {\n $scope.messageListView = true;\n $scope.replyComment = null;\n $scope.selectedConversation = null;\n $scope.message = '';\n };\n\n $scope.sendMessage = function (event: { message: string }, message: string) {\n $scope.message = message;\n\n if (!$scope.message || $scope.message === '' || $scope.isLoading)\n {return;}\n\n $scope.isLoading = true;\n\n var prm = DataService.answerToPostAsync($scope.selectedConversation, $scope.replyComment, message);\n prm.then(handleSaveAnswerToPost);\n prm.finally(function () {\n $scope.isLoading = false;\n $scope.replyComment = null;\n event.message = '';\n\n $rootScope.$emit('newPostMade', false);\n });\n };\n\n\n var handleSaveAnswerToPost = function (result) {\n $scope.loadPost($scope.selectedConversation);\n };\n\n $scope.openNewConversationModal = function () {\n $uibModal.open({\n animation: true,\n templateUrl: 'partials/conversation/modal.html?v=' + ft.randomNumber,\n controller: 'kpConversationModalController',\n size: 'lg',\n backdrop: true,\n keyboard: true,\n resolve: {\n audiences: function () {\n return ng.copy($scope.audiences);\n },\n childId: function () {\n return ng.copy(childId);\n }\n }\n });\n };\n\n //#endregion\n $timeout(initialize);\n }\n ]);\n","import { appModule } from '@/definitions';\nimport swal from 'bootstrap-sweetalert';\n\nimport { Child } from '@/child-factory';\nimport { PresencesStatus } from '@/enums';\nimport moment from 'moment';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\n\ntype PresencesCommand = ChildCare.Definitions.GroupApp.PresencesCommand;\n\nappModule.controller('kpPresenceChildModalController',\n ['$scope', '$timeout', 'AppDataService', '$uibModalInstance', 'child', 'bulk', 'selectedGroup', 'date', '$translate', 'mdcDateTimeDialog',\n function ($scope, $timeout, DataService: AppDataService, $uibModalInstance, child: Child | Child[], bulk, selectedGroup, date, $translate, mdcDateTimeDialog) {\n var initialized = false;\n\n $scope.bulk = bulk;\n $scope.child = bulk ? child[0] : child;\n\n $scope.isLoading = false;\n $scope.isPresent = $scope.child.status === PresencesStatus.Present;\n\n $scope.PresencesStatus = PresencesStatus;\n\n $scope.model = {};\n $scope.model.isValid = true;\n $scope.model.pickedTime = moment();\n $scope.model.pickedStatus = $scope.child.status === PresencesStatus.Present\n ? PresencesStatus.PickedUp : PresencesStatus.Present;\n\n $scope.model.comments = null;\n $scope.statuses = [];\n $scope.isLoading = false;\n\n var initialize = function () {\n if (initialized) {\n return;\n }\n\n $scope.statuses = getAvailableStatussen();\n\n if (Array.isArray(child)) {\n child.forEach(function (kid) {\n setArrivedAt(kid);\n });\n } else {\n setArrivedAt(child);\n }\n\n $scope.isLoading = false;\n initialized = true;\n };\n\n const getAvailableStatussen = () => {\n switch ($scope.child.status) {\n case PresencesStatus.Expected:\n return [PresencesStatus.Present, PresencesStatus.Sick, PresencesStatus.NotExpected];\n\n case PresencesStatus.Present:\n return [PresencesStatus.Sick, PresencesStatus.PickedUp];\n\n case PresencesStatus.Absent:\n case PresencesStatus.PickedUp:\n return [PresencesStatus.Present];\n\n case PresencesStatus.NotExpected:\n case PresencesStatus.Sick:\n return [PresencesStatus.Present];\n }\n };\n\n $scope.isToday = function () {\n return moment().startOf('day').diff(date.startOf('day'), 'day') === 0;\n };\n\n $scope.showStatusChoices = () => $scope.statuses.length > 0;\n\n $scope.formatStatusText = function (status) {\n switch (status) {\n case PresencesStatus.Present:\n return 'Aanwezig';\n case PresencesStatus.Sick:\n return 'Ziek';\n case PresencesStatus.PickedUp:\n return 'Opgehaald';\n case PresencesStatus.Absent:\n case PresencesStatus.NotExpected:\n return 'Afwezig';\n case PresencesStatus.Expected:\n return 'Verwacht';\n }\n };\n\n var setArrivedAt = function (child: Child) {\n\n for (const presence of child.presences) {\n if (presence.startTime && !presence.endTime) {\n child.arrivedAt = moment(presence.startTime);\n }\n }\n };\n\n var validatePickedTime = function (kid: Child) {\n if (kid.arrivedAt && $scope.model.pickedTime.format('HH:mm:SS') < kid.arrivedAt.format('HH:mm:SS')) {\n console.log('the picked time was under the start time of this event, impossible!');\n return false;\n }\n\n return true;\n };\n\n $scope.hasDate = (time: moment.Duration | string) => {\n return time != null && $scope.showTime(time) !== '00:00';\n };\n\n function isMoment(time: moment.Duration | string): time is moment.Duration {\n return (time as moment.Duration).abs !== undefined;\n }\n\n $scope.showTime = function (time: moment.Duration | string): string {\n if (isMoment(time)) {\n return moment.utc(time.asMilliseconds()).format('HH:mm');\n } else {\n return moment.utc(moment.duration(time).asMilliseconds()).format('HH:mm');\n }\n };\n\n $scope.displayDialog = () => {\n mdcDateTimeDialog.show({\n date: false,\n currentDate: $scope.model.pickedTime,\n minuteSteps: 1,\n autoOk: true,\n disableParentScroll: true\n }).then((date) => {\n $scope.model.pickedTime = moment(date);\n });\n };\n\n $scope.save = function () {\n const childIds = new Array();\n\n $scope.model.isValid = true;\n\n // TODO: UI Error maken als tijd < dan picked tijd\n if (Array.isArray(child)) {\n child.forEach(function (kid) {\n if (!validatePickedTime(kid)) {\n $scope.model.isValid = false;\n }\n });\n } else {\n if (!validatePickedTime(child)) {\n $scope.model.isValid = false;\n }\n }\n\n if ($scope.model.pickedStatus == null || !$scope.model.isValid) {\n return;\n }\n\n $scope.child.arrivedAt = $scope.model.pickedTime;\n\n if (Array.isArray(child)) {\n child.forEach(function (kid) {\n kid.status = $scope.model.pickedStatus;\n childIds.push(kid.id);\n });\n } else {\n childIds.push(child.id);\n }\n\n const command = {\n groupId: selectedGroup,\n childIds: childIds,\n action: $scope.model.pickedStatus,\n date: date.format('YYYY-MM-DD'),\n time: $scope.model.pickedTime.format('HH:mm'),\n remarks: $scope.model.comments\n } as PresencesCommand;\n\n $scope.isLoading = true;\n DataService.savePresence(command)\n .then((result) => {\n\n if (!result.isSuccess) {\n swal({\n title: $translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: $translate.instant('PRESENCE.SAVE.FAILED'),\n timer: 2500,\n type: 'error'\n });\n }\n\n $scope.isLoading = false;\n $uibModalInstance.close('saved');\n });\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n };\n\n $timeout(initialize);\n }\n ]);\n","import { appModule } from '@/definitions';\n\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IScope, IController } from 'angular';\n\nimport { ChildCare } from '@/data-models';\nimport moment from 'moment';\n\nimport TimesRequest = ChildCare.Definitions.Registration.TimesRequest;\nimport PresencesCommand = ChildCare.Definitions.GroupApp.PresencesCommand;\nimport TimesModel = ChildCare.Definitions.Registration.TimesModel;\nimport Timeslot = ChildCare.Definitions.Registration.Timeslot;\n\nimport { Child } from '@/child-factory';\nimport { PresencesAction, PresencesStatus } from '@/enums';\n\nconst chiIncidenteleOpvang = 3458;\n\ninterface CheckableTimeSlot extends Timeslot {\n checked: boolean;\n}\n\ninterface Model {\n isValid: boolean;\n pickedTime: moment.Moment;\n comments: string;\n}\n\ninterface CustomScope extends IScope {\n child: Child;\n isLoading: boolean;\n model: Model;\n timeSlots: CheckableTimeSlot[];\n isTradeAble: boolean;\n isToday: () => boolean;\n save: () => void;\n cancel: () => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/class-name-casing\nclass kpPresenceUnexpectedChildModalController implements IController {\n static $inject = ['$scope', 'AppDataService', '$uibModalInstance', 'child', 'selectedGroup', 'date'];\n\n constructor(\n private $scope: CustomScope,\n private AppDataService: AppDataService,\n private $uibModalInstance: IModalInstanceService,\n private child: Child,\n private selectedGroup: string,\n private date: moment.Moment\n ) {\n $scope.child = child;\n\n $scope.isLoading = false;\n\n $scope.model = {\n isValid: true,\n pickedTime: moment(),\n comments: null\n };\n\n this.initialize();\n }\n\n private initialize() {\n this.hookScope();\n\n this.setArrivedAt(this.child);\n\n const request: TimesRequest = {\n date: this.date.toLocaleString(),\n entityType: chiIncidenteleOpvang,\n finalOnly: true,\n childId: this.child.id,\n type: ChildCare.Definitions.Registration.TimesRequestType.All,\n forInternal: undefined\n };\n\n this.AppDataService\n .getAvailableTimes(this.child.id, request)\n .then(this.handleGetAvailableTimes.bind(this))\n .finally(() => {\n this.$scope.isLoading = false;\n });\n }\n\n private hookScope() {\n this.$scope.isToday = this.isToday.bind(this);\n this.$scope.save = this.save.bind(this);\n this.$scope.cancel = this.cancel.bind(this);\n }\n\n private handleGetAvailableTimes(response: TimesModel) {\n let timeSlots: CheckableTimeSlot[];\n\n if (response.availableTimeslots.length > 0) {\n timeSlots = response.availableTimeslots.map(x => x as CheckableTimeSlot);\n } else if (response.tradableTimeslots.length > 0) {\n this.$scope.isTradeAble = true;\n timeSlots = response.tradableTimeslots.map(x => x as CheckableTimeSlot);\n }\n\n this.$scope.timeSlots = timeSlots.map(t => {\n t.checked = true;\n return t;\n });\n }\n\n private setArrivedAt(child: Child) {\n for (const presence of child.presences) {\n if (presence.startTime && !presence.endTime) {\n child.arrivedAt = moment(presence.startTime);\n }\n }\n }\n\n private isToday() {\n const now = moment().startOf('day');\n const startOfDay = this.date.startOf('day');\n\n return now.diff(startOfDay, 'day') === 0;\n }\n\n private save() {\n const model = this.$scope.model;\n\n model.isValid = true;\n\n // TODO: UI Error maken als tijd < dan picked tijd\n if (!this.validatePickedTime(this.child)) {\n model.isValid = false;\n return;\n }\n\n this.child.arrivedAt = model.pickedTime;\n\n this.$scope.isLoading = true;\n\n const command: PresencesCommand = {\n groupId: this.selectedGroup,\n childIds: [this.child.id],\n action: PresencesAction.Present,\n date: this.date.toLocaleString(),\n time: model.pickedTime.format('HH:mm'),\n remarks: model.comments,\n result: undefined\n };\n\n this.AppDataService.savePresence(command).then(() => {\n this.child.status = PresencesStatus.Present;\n this.$scope.isLoading = false;\n this.$uibModalInstance.close('saved');\n });\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n\n private validatePickedTime(kid: Child) {\n if (kid.arrivedAt && this.$scope.model.pickedTime.format('HH:mm:SS') < kid.arrivedAt.format('HH:mm:SS')) {\n console.log('the picked time was under the start time of this event, impossible!');\n return false;\n }\n\n return true;\n }\n}\n\nappModule.controller('kpPresenceUnexpectedChildModalController', kpPresenceUnexpectedChildModalController);\n","import { appModule, ft } from '@/definitions';\nimport moment from 'moment';\nimport { swal } from 'bootstrap-sweetalert';\n\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { IController, ILocationService, IIntervalService, ITimeoutService, IScope, IPromise } from 'angular';\nimport { IStateService } from 'angular-ui-router';\n\nimport { ChildCare } from '@/data-models';\n\nimport PresencesResponse = ChildCare.Definitions.GroupApp.PresencesResponse;\nimport PresencesGroup = ChildCare.Definitions.GroupApp.PresencesGroup;\nimport { Child, Event, ChildType, DiaryEvent } from '@/child-factory';\nimport { PresencesStatus } from '@/enums';\nimport { ILoadingBar } from '@/models';\nimport { RoleChecker } from '@/role-checker';\n\ninterface IModel {\n showAll: boolean;\n bulk: boolean;\n showDiarySchedules: boolean;\n labels: boolean;\n firstChildStatusIsPresent: boolean | null;\n toggledBulkChildren: Child[];\n statusExpectedAmount: number;\n statusPresentAmount: number;\n statusSickAmount: number;\n statusAbsentAmount: number;\n statusNotExpectedAmount: number;\n}\n\nclass TimeLineHeader {\n constructor(\n public startTime: moment.Duration,\n public endTime: moment.Duration,\n public label: string\n ) {\n\n }\n\n public formatLabel() {\n if (this.label != null) {\n return this.label;\n }\n const startLabel = moment.utc(this.startTime.asMilliseconds()).format('HH:mm');\n const endLabel = moment.utc(this.endTime.asMilliseconds()).format('HH:mm');\n\n return `${startLabel} - ${endLabel}`;\n }\n}\n\ninterface ITimeTable {\n hourStart: number;\n hourEnd: number;\n timeLabels: string[];\n childrenCounts: TimeLineHeader[];\n diaryTimeLabels: string[];\n diaryChildrenCounts: TimeLineHeader[];\n}\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n initialized: boolean;\n group: PresencesGroup | null;\n PresencesStatus: typeof PresencesStatus;\n showMassButton: boolean;\n filter: PresencesStatus[];\n model: IModel;\n timetable: ITimeTable;\n pickedDate: moment.Moment;\n allChildren: Child[];\n children: Child[];\n nextDay: string;\n previousDay: string;\n today: string;\n\n displayDatePicker(): void;\n navigateToGroups(): void;\n updateBlockHeight(): void;\n computeBlockWidth(startTime: moment.Duration, endTime: moment.Duration): number;\n computeBlockOffset(startTime: moment.Duration): number;\n setFilter(status: PresencesStatus | PresencesStatus[]): void;\n isFilterSelected(status: PresencesStatus | PresencesStatus[]): boolean;\n shouldDisplayCheckbox(child: Child): boolean;\n toggleChild(child: Child): void;\n openDetailModal(event: Event): void;\n openChildModal(child: Child): void;\n openModal(): void;\n openPresenceModal(child: Child | Child[], bulk: boolean): void;\n gotoToday(): void;\n refresh(): void;\n gotoNextDay(): void;\n gotoPreviousDay(): void;\n open($event: any, opened: any): void;\n createOrDeleteDiaryEntry(diaryEvent: DiaryEvent): void;\n getTickIconClass(diaryEvent: DiaryEvent): string;\n}\n\nclass PresenceOverviewController implements IController {\n static $inject = [\n '$scope',\n '$timeout',\n 'AppDataService',\n 'ftSettingService',\n '$uibModal',\n '$location',\n '$localStorage',\n '$state',\n '$interval',\n 'LoadingBar',\n 'mdcDateTimeDialog',\n '$translate',\n RoleChecker.serviceName];\n\n private selectedGroupId: string | null;\n private updateRedLineInterval: IPromise;\n\n constructor(\n private $scope: ILocalScope,\n private $timeout: ITimeoutService,\n private DataService: AppDataService,\n private SettingService: ftSettingsService,\n private $uibModal: IModalService,\n private $location: ILocationService,\n private $localStorage: any,\n private $state: IStateService,\n private $interval: IIntervalService,\n private LoadingBar: ILoadingBar,\n private mdcDateTimeDialog: any,\n private $translate: any,\n private roleCheckerService: RoleChecker\n ) {\n this.initializeScreen();\n this.loadScopeWatches();\n\n this.updateRedLineInterval = this.$interval(() => {\n this.updateRedLine();\n }, 1000 * 60);\n\n this.$scope.$on('$destroy', () => {\n this.$interval.cancel(this.updateRedLineInterval);\n });\n\n this.$scope.computeBlockWidth = this.computeBlockWidth.bind(this);\n this.$scope.computeBlockOffset = this.computeBlockOffset.bind(this);\n this.$scope.setFilter = this.setFilter.bind(this);\n this.$scope.isFilterSelected = this.isFilterSelected.bind(this);\n this.$scope.shouldDisplayCheckbox = this.shouldDisplayCheckbox.bind(this);\n this.$scope.toggleChild = this.toggleChild.bind(this);\n this.$scope.openDetailModal = this.openDetailModal.bind(this);\n this.$scope.openChildModal = this.openChildModal.bind(this);\n this.$scope.openModal = this.openModal.bind(this);\n this.$scope.openPresenceModal = this.openPresenceModal.bind(this);\n this.$scope.displayDatePicker = this.displayDatePicker.bind(this);\n this.$scope.updateBlockHeight = this.updateBlockHeight.bind(this);\n this.$scope.refresh = this.refresh.bind(this);\n this.$scope.gotoToday = this.gotoToday.bind(this);\n this.$scope.gotoNextDay = this.gotoNextDay.bind(this);\n this.$scope.gotoPreviousDay = this.gotoPreviousDay.bind(this);\n this.$scope.open = this.open.bind(this);\n this.$scope.navigateToGroups = this.roleCheckerService.switchGroup;\n this.$scope.createOrDeleteDiaryEntry = this.createOrDeleteDiaryEntry.bind(this);\n this.$scope.getTickIconClass = this.getTickIconClass.bind(this);\n\n this.$timeout(() => {\n if (this.$scope.initialized) { return; }\n\n this.selectedGroupId = this.SettingService.get(window.appSettings.group.selected);\n if (!this.selectedGroupId) {\n this.$state.go('app.groups',{previous:this.$state.current.name});\n }\n\n this.updatePresenceOverview();\n this.$scope.initialized = true;\n });\n }\n\n private initializeScreen() {\n this.selectedGroupId = null;\n\n this.$scope.isLoading = false;\n this.$scope.initialized = false;\n this.$scope.group = null;\n this.$scope.PresencesStatus = PresencesStatus;\n this.$scope.showMassButton = true;\n this.$scope.filter = [];\n\n this.$scope.model = {\n showAll: false,\n bulk: false,\n showDiarySchedules: false,\n labels: this.$localStorage.showLabels ?? false,\n firstChildStatusIsPresent: null,\n toggledBulkChildren: [],\n statusExpectedAmount: 0,\n statusPresentAmount: 0,\n statusSickAmount: 0,\n statusAbsentAmount: 0,\n statusNotExpectedAmount: 0\n };\n\n this.$scope.timetable = {\n hourStart: 6,\n hourEnd: 20,\n timeLabels: [],\n childrenCounts: [],\n diaryChildrenCounts: [],\n diaryTimeLabels: []\n };\n\n this.$scope.pickedDate = this.$location.search().date ?\n moment(this.$location.search().date, 'DD/MM/YYYY') :\n moment();\n\n this.$scope.allChildren = [];\n this.$scope.children = [];\n }\n\n private loadScopeWatches() {\n this.$scope.$watch('model.showAll', () => {\n this.updateBlockHeight();\n });\n\n this.$scope.$watch('model.bulk', (oldVal: boolean, newVal: boolean) => {\n if (newVal) {\n this.$scope.model.toggledBulkChildren = [];\n this.$scope.model.firstChildStatusIsPresent = null;\n }\n });\n\n this.$scope.$watch('isLoading', (newVal: boolean, oldVal: boolean) => {\n this.LoadingBar.show = newVal;\n });\n\n this.$scope.$watch('children', () => {\n this.updateStatusCount();\n }, true);\n\n this.$scope.$watch('pickedDate', () => {\n this.$scope.showMassButton = !!this.isToday();\n if (!this.isToday()) {\n this.$scope.model.bulk = false;\n }\n\n this.$location.path('/app/presence').search({ date: this.$scope.pickedDate.format('DD-MM-YYYY') });\n this.updatePresenceOverview();\n }, true);\n\n this.$scope.$watch('model.labels', (value: boolean) => this.$localStorage.showLabels = value);\n }\n\n private computeDurationInHours(start: moment.Duration, end: moment.Duration): number {\n return end.clone().subtract(start).asHours();\n }\n\n private getDurationHours(startHour: number, endHour: number): number {\n return endHour >= startHour ? endHour - startHour : 24 + endHour - startHour;\n }\n\n private computeBlockWidth(startTime: moment.Duration, endTime: moment.Duration) {\n const eventDurationInHours = this.computeDurationInHours(startTime, endTime);\n const totalHoursToDisplay = this.getDurationHours(this.$scope.timetable.hourStart, this.$scope.timetable.hourEnd);\n let result = eventDurationInHours / totalHoursToDisplay * 100;\n\n const offset = this.computeBlockOffsetAsNumber(startTime);\n if (offset + result > 100) {\n result = 100 - offset;\n }\n return result + '%';\n }\n\n private computeBlockOffset(startTime: moment.Duration) {\n return this.computeBlockOffsetAsNumber(startTime) + '%';\n }\n\n private computeBlockOffsetAsNumber(startTime: moment.Duration) {\n var scopeStartHours = this.$scope.timetable.hourStart;\n var eventStartHours = startTime.asHours();\n var hoursBeforeEvent = this.getDurationHours(scopeStartHours, eventStartHours);\n return hoursBeforeEvent / this.getDurationHours(this.$scope.timetable.hourStart, this.$scope.timetable.hourEnd) * 100;\n }\n\n private arraysEqual(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n if (a.length != b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) { return false; }\n }\n\n return true;\n }\n\n private setFilter(status: PresencesStatus | PresencesStatus[]) {\n\n let statusArray: PresencesStatus[];\n if (!Array.isArray(status)) {\n statusArray = [status];\n } else {\n statusArray = status;\n }\n\n this.$scope.filter = this.arraysEqual(this.$scope.filter, statusArray) ? [] : statusArray;\n this.$scope.children = this.$scope.filter.length === 0 ?\n this.$scope.allChildren :\n this.$scope.allChildren.filter(x => statusArray.some(s => s == x.status));\n\n this.updateBlockHeight();\n }\n\n private isFilterSelected(status: PresencesStatus | PresencesStatus[]): boolean {\n let statusArray: PresencesStatus[];\n if (!Array.isArray(status)) {\n statusArray = [status];\n } else {\n statusArray = status;\n }\n\n const areEqual = this.arraysEqual(this.$scope.filter, statusArray);\n\n return areEqual;\n }\n\n private addOrRemove(array: any, value: any): boolean {\n var index = array.indexOf(value);\n\n if (index === -1) {\n array.push(value);\n return true;\n }\n\n array.splice(index, 1);\n return false;\n }\n\n private shouldDisplayCheckbox(child: Child): boolean {\n return this.$scope.model.bulk &&\n this.$scope.model.firstChildStatusIsPresent == null ||\n (this.$scope.model.firstChildStatusIsPresent === true && child.status === PresencesStatus.Present) ||\n (this.$scope.model.firstChildStatusIsPresent === false && child.status !== PresencesStatus.Present);\n }\n\n private toggleChild(child: Child): void {\n var added = this.addOrRemove(this.$scope.model.toggledBulkChildren, child);\n\n if (this.$scope.model.firstChildStatusIsPresent === null && added) {\n this.$scope.model.firstChildStatusIsPresent = child.status === PresencesStatus.Present;\n }\n\n if (this.$scope.model.firstChildStatusIsPresent !== null && !added && this.$scope.model.toggledBulkChildren.length === 0) { this.$scope.model.firstChildStatusIsPresent = null; }\n }\n\n private openDetailModal(event: Event) {\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/presence/detailModal.html?v=' + ft.randomNumber,\n controller: 'kpPresenceDetailModalController',\n size: 'sm',\n backdrop: true,\n keyboard: true,\n resolve: {\n event: () => event,\n group: () => this.$scope.group\n }\n });\n }\n\n private openChildModal(child: Child) {\n this.$localStorage.childModalUser = child;\n this.$location.path('/app/child/' + child.id);\n }\n\n private openModal() {\n this.openPresenceModal(this.$scope.model.toggledBulkChildren, true);\n }\n\n private openPresenceModal(child: Child | Child[], bulk: boolean): void {\n if (this.$scope.model.bulk && !bulk) {\n this.toggleChild(child as Child);\n return;\n }\n\n const modal = this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/presence/childModal.html?v=' + ft.randomNumber,\n controller: 'kpPresenceChildModalController',\n size: 'custom',\n backdrop: true,\n keyboard: true,\n resolve: {\n child: () => child,\n bulk: () => bulk,\n selectedGroup: () => this.selectedGroupId,\n date: () => this.$scope.pickedDate\n }\n });\n\n modal.result.then(result => {\n if (result !== 'saved') {\n return;\n }\n\n this.$scope.model.bulk = false;\n this.$scope.model.toggledBulkChildren = [];\n this.$scope.model.firstChildStatusIsPresent = null;\n\n this.updatePresenceOverview();\n }, () => {\n this.$scope.model.bulk = false;\n this.$scope.model.toggledBulkChildren = [];\n this.$scope.model.firstChildStatusIsPresent = null;\n });\n }\n\n private updateRedLine(): void {\n try {\n const now = moment();\n const timeOfDay = moment.duration({\n hours: now.hours(),\n minutes: now.minutes()\n });\n\n var offset = this.computeBlockOffset(timeOfDay);\n var timeIndicator = $('.time-indicator');\n var presenceScrollableSection = $('.presence .timetable section');\n\n timeIndicator.css('left', offset);\n\n var width = presenceScrollableSection.width();\n var linePosition = timeIndicator.position() ? timeIndicator.position().left : null;\n if (linePosition == null || width == null) {\n return;\n }\n\n var scroll = linePosition - (width / 2);\n presenceScrollableSection.scrollLeft(scroll);\n } catch (error) {\n console.log(error);\n }\n }\n\n private updatePresenceOverview(): void {\n this.$scope.isLoading = true;\n\n if (!this.selectedGroupId) {\n return;\n }\n\n this.DataService.getPresenceOverviewData(this.selectedGroupId, this.$scope.pickedDate, true)\n .then(response => { this.handlePresenceData(response); })\n .finally(() => {\n this.$scope.isLoading = false;\n });\n }\n\n private handlePresenceData(result: PresencesResponse): void {\n this.$scope.children = [];\n this.$scope.allChildren = [];\n this.$scope.timetable.childrenCounts = [];\n this.$scope.timetable.diaryChildrenCounts = [];\n\n if (!result.children) {\n this.$scope.isLoading = false;\n return;\n }\n\n this.$scope.group = result.group;\n this.$scope.timetable.hourStart = parseInt(result.group.openingTimes.start.substring(0, 2));\n\n const endHour = parseInt(result.group.openingTimes.end.substring(0, 2));\n this.$scope.timetable.hourEnd = parseInt(result.group.openingTimes.end.substring(3, 5)) > 0 ? endHour + 1 : endHour;\n this.$scope.timetable.hourEnd = this.$scope.timetable.hourEnd === 0 ? 24 : this.$scope.timetable.hourEnd;\n\n this.$scope.timetable.timeLabels = [];\n for (let j = this.$scope.timetable.hourStart; j <= this.$scope.timetable.hourEnd; j++) {\n this.$scope.timetable.timeLabels.push(this.prettyFormatHour(j));\n }\n\n this.$scope.timetable.diaryTimeLabels = [];\n for (let j = this.$scope.timetable.hourStart; j <= this.$scope.timetable.hourEnd; j++) {\n this.$scope.timetable.diaryTimeLabels.push(this.prettyFormatHour(j));\n }\n\n for (const child of result.children) {\n const kid = new Child(child, ChildType.PresencesChild);\n\n if (child.labels) {\n for (const label of child.labels) {\n kid.addLabel(label);\n }\n }\n\n for (const event of child.events) {\n kid.addEvent(event);\n }\n\n for (const diaryEvent of child.diaryEvents)\n {\n kid.addDiaryEvent(diaryEvent);\n }\n\n this.$scope.allChildren.push(kid);\n }\n\n this.$scope.children = this.$scope.allChildren;\n\n if (result.header) {\n for (const item of result.header.items) {\n const startTime = moment.duration(item.startTime);\n const endTime = moment.duration(item.endTime);\n\n this.$scope.timetable.childrenCounts.push(new TimeLineHeader(startTime, endTime, item.count.toString()));\n }\n }\n\n if (result.diaryScheduleHeader) {\n for (const item of result.diaryScheduleHeader.items) {\n const startTime = moment.duration(item.startTime);\n const endTime = moment.duration(item.endTime);\n\n this.$scope.timetable.diaryChildrenCounts.push(new TimeLineHeader(startTime, endTime, item.count.toString()));\n }\n }\n\n this.$scope.nextDay = result.dates.nextDay;\n this.$scope.previousDay = result.dates.previousDay;\n this.$scope.today = result.dates.today;\n\n this.updateBlockHeight();\n }\n\n private updateBlockHeight(): void {\n this.$timeout(() => {\n var aside = $('.timetable aside li');\n\n var items = $('.room-timeline li');\n for (let i = 0; i < items.length; i++) {\n var height = $(aside[i + 1]).css('height');\n\n $(items[i]).css('height', height);\n $(items[i]).find('a').css('height', (parseInt(height.substring(0, height.length - 2)) - 8) + 'px');\n }\n\n this.updateRedLine();\n });\n }\n\n private prettyFormatHour(hour: number) {\n var prefix = hour < 10 ? '0' : '';\n return prefix + hour + ':00';\n }\n\n private updateStatusCount(): void {\n\n this.$scope.model.statusExpectedAmount = 0;\n this.$scope.model.statusPresentAmount = 0;\n this.$scope.model.statusNotExpectedAmount = 0;\n this.$scope.model.statusAbsentAmount = 0;\n this.$scope.model.statusSickAmount = 0;\n\n for (const child of this.$scope.allChildren) {\n const status = child.status as any;\n\n if (status == PresencesStatus.Expected) {\n this.$scope.model.statusExpectedAmount++;\n } else if (status == PresencesStatus.Present) {\n this.$scope.model.statusPresentAmount++;\n } else if (status == PresencesStatus.NotExpected) {\n this.$scope.model.statusNotExpectedAmount++;\n } else if (status == PresencesStatus.PickedUp || child.status == PresencesStatus.Absent) {\n this.$scope.model.statusAbsentAmount++;\n } else if (status == PresencesStatus.Sick) {\n this.$scope.model.statusSickAmount++;\n }\n }\n\n this.$scope.model.showAll = this.$scope.model.statusNotExpectedAmount === this.$scope.allChildren.length;\n this.$scope.model.showAll = this.$scope.model.statusNotExpectedAmount === this.$scope.allChildren.length ||\n this.$scope.filter.some(x => x == PresencesStatus.NotExpected);\n }\n\n private displayDatePicker(): void {\n this.mdcDateTimeDialog.show({\n currentDate: this.$scope.pickedDate,\n time: false,\n autoOk: true,\n disableParentScroll: true\n }).then((date) => {\n this.$scope.pickedDate = moment(date);\n });\n }\n\n private isToday(): boolean {\n return moment().startOf('day')\n .diff(this.$scope.pickedDate.startOf('day'), 'day') === 0;\n }\n\n private refresh(): void {\n window.location.reload();\n }\n\n private gotoToday(): void {\n if (this.$scope.today) {\n this.$scope.pickedDate = moment(this.$scope.today);\n }\n }\n\n private gotoNextDay(): void {\n if (this.$scope.nextDay) {\n this.$scope.pickedDate = moment(this.$scope.nextDay);\n }\n }\n\n private gotoPreviousDay(): void {\n if (this.$scope.previousDay) {\n this.$scope.pickedDate = moment(this.$scope.previousDay);\n }\n }\n\n private open($event, opened) {\n $event.preventDefault();\n $event.stopPropagation();\n\n this.$scope[opened] = true;\n }\n\n private createOrDeleteDiaryEntry(diaryEvent: DiaryEvent): void {\n this.$scope.isLoading = true;\n\n if (!this.isToday()) {\n this.$scope.isLoading = false;\n return;\n }\n\n let task: IPromise;\n\n if (diaryEvent.diaryEntryId == null) {\n let startMoment: moment.Moment = moment().startOf('day');\n startMoment = startMoment.add(diaryEvent.startTime);\n\n var children: string[] = [ diaryEvent.childId];\n task = this.DataService.saveDiaryEntry(children, diaryEvent.diaryEntryTypeId, diaryEvent.diaryEntryType, startMoment, diaryEvent.diaryScheduleId);\n } else {\n task = this.DataService.deleteDiaryEntry(diaryEvent.childId, diaryEvent.diaryEntryId);\n }\n\n task\n .then(() => this.updatePresenceOverview())\n .catch(error =>{\n console.error(error);\n swal({\n title: this.$translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: this.$translate.instant('PRESENCE.SAVE.FAILED'),\n timer: 2500,\n type: 'error'\n });\n })\n .finally(() => this.$scope.isLoading = false);\n }\n\n private getTickIconClass(diaryEvent: DiaryEvent): string {\n if (diaryEvent.diaryEntryId != null) {\n return 'fas fa-check';\n }\n\n return '';\n }\n}\n\nappModule.controller('kpPresenceOverviewController', PresenceOverviewController);\n","import { appModule, ft } from '@/definitions';\nimport moment from 'moment';\nimport { IScope, IQService, IFilterService, copy } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { IStateService } from 'angular-ui-router';\nimport swal from 'bootstrap-sweetalert';\nimport { ChildCare } from '@/data-models';\n\nimport GroupRequestsResponse = ChildCare.Definitions.GroupApp.GroupRequestsResponse;\nimport GroupsResponse = ChildCare.Definitions.GroupApp.GroupsResponse;\nimport GroupRequestsRegistration = ChildCare.Definitions.GroupApp.GroupRequestsRegistration;\nimport TypeOfRegistration = ChildCare.Definitions.Common.TypeOfRegistration;\nimport { RoleChecker } from '@/role-checker';\nimport { ILoadingBar } from '@/models';\n\nexport class RequestItem {\n createdOn: moment.Moment;\n date: moment.Moment;\n originalDate: moment.Moment;\n description: string;\n registrationId: string;\n registrationType: ChildCare.Definitions.Common.TypeOfRegistration;\n registrationTypeTranslation: string;\n times: string;\n originalTimes: string;\n child: ChildCare.Definitions.Child;\n\n constructor(registration: GroupRequestsRegistration) {\n this.createdOn = moment(registration.createdOn);\n this.date = moment(registration.date);\n this.originalDate = moment(registration.originalDate);\n this.description = registration.description;\n this.registrationId = registration.registrationId;\n this.registrationType = registration.registrationType;\n this.registrationTypeTranslation = `DATA.${registration.registrationType.toUpperCase()}`;\n this.times = registration.times;\n this.originalTimes = registration.originalTimes;\n this.child = registration.child;\n }\n}\n\ninterface ILocalScope extends IScope {\n group: any;\n requests: RequestItem[];\n moment: typeof moment;\n possibleTypes: TypeOfRegistration[];\n selectedTypes: TypeOfRegistration[];\n isLoading: boolean;\n tableSorting: any;\n filterByType: (type: any) => void;\n showRequestModal: (request: RequestItem) => void;\n navigateToGroups: () => void;\n}\n\nappModule.controller('kpRequestsController',\n ['$scope', '$timeout', 'AppDataService', 'ftSettingService', '$q',\n '$uibModal', '$state', 'LoadingBar', 'ngTableParams', '$filter', RoleChecker.serviceName,\n function ($scope: ILocalScope, $timeout, DataService: AppDataService, SettingService: ftSettingsService, $q: IQService,\n $uibModal: IModalService, $state: IStateService, LoadingBar: ILoadingBar, ngTableParams, $filter: IFilterService, roleCheckerService: RoleChecker) {\n\n var selectedGroupId = null;\n\n $scope.group = null;\n\n var allRequests = [];\n $scope.requests = [];\n $scope.moment = moment;\n\n $scope.possibleTypes = [];\n $scope.selectedTypes = [];\n\n $scope.isLoading = false;\n $scope.$watch('isLoading', (newVal: boolean) => {\n LoadingBar.show = newVal;\n });\n\n var initialize = function () {\n $scope.isLoading = true;\n\n selectedGroupId = SettingService.get(window.appSettings.group.selected);\n if (!selectedGroupId) {\n $state.go('app.groups',{ previous:$state.current.name });\n }\n\n var promises = [];\n promises.push(DataService.getGroupsAsync());\n promises.push(DataService.getRequestList(selectedGroupId));\n var request = $q.all(promises);\n\n request.then(function (results) {\n $scope.group = (results[0] as GroupsResponse).groups.find(x => x.id == selectedGroupId);\n\n var requests: RequestItem[] = [];\n var possibleTypes: TypeOfRegistration[] = [];\n for (const registration of (results[1] as GroupRequestsResponse).registrations) {\n requests.push(new RequestItem(registration));\n\n if (possibleTypes.indexOf(registration.registrationType) === -1) {\n possibleTypes.push(registration.registrationType);\n }\n }\n\n $scope.possibleTypes = copy(possibleTypes);\n $scope.selectedTypes = copy(possibleTypes);\n\n $scope.requests = copy(requests);\n allRequests = copy(requests);\n\n }).finally(function () {\n $scope.isLoading = false;\n });\n };\n\n $scope.tableSorting = new ngTableParams({\n count: 10\n }, {\n total: $scope.requests.length,\n getData: function ($defer, params) {\n // use build-in angular filter\n var orderedData = params.sorting() ? $filter('orderBy')($scope.requests, params.orderBy()) : $scope.requests;\n $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));\n\n // set total for recalc pagination\n params.total($scope.requests.length);\n }\n });\n\n $scope.filterByType = function (type) {\n $scope.selectedTypes.indexOf(type) === -1 ?\n $scope.selectedTypes.push(type) :\n $scope.selectedTypes.splice($scope.selectedTypes.indexOf(type), 1);\n\n var requests = [];\n\n for (const request of allRequests) {\n for (const type of $scope.selectedTypes) {\n if (request.registrationType === type) {\n requests.push(request);\n }\n }\n }\n\n $scope.requests = requests;\n refreshTable();\n };\n\n var refreshTable = function () {\n $scope.tableSorting.reload();\n $scope.tableSorting.page(1);\n };\n\n $scope.showRequestModal = function (request) {\n var instance = $uibModal.open({\n animation: true,\n templateUrl: 'partials/requests/modal.html?v=' + ft.randomNumber,\n controller: 'kpRequestModalController',\n backdrop: true,\n keyboard: true,\n resolve: {\n request: function () {\n return copy(request);\n },\n groupId: function () {\n return copy(selectedGroupId);\n }\n }\n });\n\n instance.result.then(function (request) {\n swal({\n title: 'Opgeslagen',\n text: 'De aanvraag is verwerkt!',\n timer: 3000,\n type: 'success'\n });\n\n allRequests.splice(\n allRequests.indexOf(allRequests.find(x => x.registrationId == request.registrationId)\n ), 1);\n\n $scope.requests.splice(\n $scope.requests.indexOf($scope.requests.find(x => x.registrationId == request.registrationId)\n ), 1);\n refreshTable();\n });\n };\n\n $scope.navigateToGroups = roleCheckerService.switchGroup;\n\n $timeout(initialize);\n }\n ]);\n\n","import { appModule } from '@/definitions';\nimport moment from 'moment';\nimport { Child, ChildType } from '@/child-factory';\nimport { AppDataService } from '@/services/app-data-service';\nimport { RequestItem } from '@/controllers/requests';\nimport { IModalServiceInstance } from 'angular-ui-bootstrap';\nimport { IScope } from 'angular';\nimport swal from 'bootstrap-sweetalert';\n\nimport TypeOfRegistration = ChildCare.Definitions.Common.TypeOfRegistration;\nimport { ChildCare } from '@/data-models';\n\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n saving: boolean;\n data:\n {\n remarks: any;\n };\n requestDetails:\n {\n child: Child;\n otherChildren: Child[];\n date: moment.Moment;\n description: string;\n groupCanApprove: boolean;\n parentRemarks: string;\n registrationId: string;\n typeOfRegistration: TypeOfRegistration;\n numberOfEmployeesCurrent: number;\n numberOfEmployeesRequested: number;\n };\n submitRequest: (action: any) => void;\n close: () => void;\n}\n\nappModule.controller('kpRequestModalController',\n ['$scope', '$uibModalInstance', 'request', 'groupId', 'AppDataService', '$timeout', '$translate',\n function ($scope: ILocalScope, $uibModalInstance: IModalServiceInstance, request: RequestItem, groupId: string, DataService: AppDataService, $timeout, $translate) {\n\n $scope.isLoading = false;\n $scope.saving = false;\n\n $scope.data = {\n remarks: null\n };\n\n var initialize = function () {\n $scope.isLoading = true;\n DataService.getRequestDetails(groupId, request.registrationId, request.registrationType)\n .then(function (response) {\n $scope.requestDetails = {\n child: new Child(response.child, ChildType.GroupRequestsApprovalChild),\n otherChildren: response.otherChildren.map(x => new Child(x, ChildType.GroupRequestsApprovalChild)),\n date: moment(response.date),\n description: response.description,\n groupCanApprove: response.groupCanApprove,\n parentRemarks: response.parentRemarks,\n registrationId: response.registrationId,\n typeOfRegistration: response.typeOfRegistration,\n numberOfEmployeesCurrent: response.numberOfEmployeesCurrent,\n numberOfEmployeesRequested: response.numberOfEmployeesRequested\n };\n }).finally(function () {\n $scope.isLoading = false;\n });\n };\n\n $scope.submitRequest = function (action) {\n $scope.isLoading = true;\n $scope.saving = true;\n\n var details = $scope.requestDetails;\n DataService.sendRequestAction(\n groupId, details.registrationId, details.typeOfRegistration,\n action ? 'approved' : 'rejected', $scope.data.remarks\n ).then(function () {\n $uibModalInstance.close(request);\n }).catch(function () {\n swal({\n title: $translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: $translate.instant('ERRORS.SAVE-FAILED.MESSAGE'),\n timer: 3000,\n type: 'error'\n });\n }).finally(function () {\n $scope.saving = false;\n $scope.isLoading = false;\n $uibModalInstance.dismiss();\n });\n };\n\n $scope.close = function () {\n $uibModalInstance.dismiss();\n };\n\n $timeout(initialize());\n }\n ]\n);\n","import {appModule, ng} from '@/definitions';\nimport { Child, ChildType } from '@/child-factory';\nimport {ChildCare} from '@/data-models';\n\nimport GroupChildrenOnLocationResponse = ChildCare.Definitions.GroupApp.GroupChildrenOnLocationResponse;\nimport { AppDataService } from '@/services/app-data-service';\nimport { ftSettingsService } from '@/FortyTwoFramework';\nimport { IScope } from 'angular';\nimport { RoleChecker } from '@/role-checker';\n\ninterface ILocalScope extends IScope {\n allChildren: {}; group: any;\n selectedGroup: any;\n groups: any[];\n isLoading: boolean;\n resetSelectedGroup: () => void;\n goToChildDetail: (child: any) => void;\n navigateToGroups: () => void;\n}\n\nappModule.controller('kpEmergencyListController',\n ['$scope', '$timeout', 'AppDataService', '$state', 'LoadingBar', 'ftSettingService', RoleChecker.serviceName,\n function ($scope: ILocalScope, $timeout, DataService: AppDataService, $state, LoadingBar, SettingService: ftSettingsService, roleCheckerService: RoleChecker) {\n $scope.allChildren = {};\n $scope.group = null;\n $scope.selectedGroup = null;\n $scope.groups = [];\n $scope.isLoading = false;\n\n let initialized = false;\n\n $scope.$watch('isLoading', (isLoading) => {\n LoadingBar.show = isLoading;\n });\n\n $scope.$watch('selectedGroup', (selectedGroup) => {\n let promise;\n if (selectedGroup) {\n promise = DataService.getEmergencyList($scope.selectedGroup);\n } else {\n promise = DataService.getEmergencyList(null);\n }\n\n $scope.isLoading = true;\n promise.then((result: GroupChildrenOnLocationResponse) => {\n $scope.allChildren = {};\n\n for (const child of result.children) {\n const firstLetter = child.childName.charAt(0);\n\n if (!Array.isArray($scope.allChildren[firstLetter])) {\n $scope.allChildren[firstLetter] = [];\n }\n\n $scope.allChildren[firstLetter].push(new Child(child, ChildType.GroupChildOnLocation));\n }\n }).finally(() => {\n $scope.isLoading = false;\n });\n });\n\n const initialize = function () {\n if (initialized) {\n return;\n }\n\n $scope.isLoading = true;\n DataService.getGroupsAsync().then((result) => {\n $scope.groups = ng.copy(result.groups);\n $scope.group = result.groups.find(x => x.id === SettingService.get(window.appSettings.group.selected));\n $scope.selectedGroup = SettingService.get(window.appSettings.group.selected);\n }).finally(() => {\n $scope.isLoading = false;\n });\n\n initialized = true;\n };\n\n $scope.resetSelectedGroup = () => {\n $scope.selectedGroup = SettingService.get(window.appSettings.group.selected);\n };\n\n $scope.goToChildDetail = function (child) {\n $state.go('app.child', {id: child.id});\n };\n\n $scope.navigateToGroups = roleCheckerService.switchGroup;\n\n $timeout(initialize);\n\n }\n ]);\n","import { appModule, ng } from '@/definitions';\nimport { IController, IQService, IScope } from 'angular';\nimport {\n IAddress,\n ICountry,\n AppDataService,\n IParent,\n IParentDetailUpdateRequest\n} from '@/services/app-data-service';\nimport { IModalServiceInstance } from 'angular-ui-bootstrap';\nimport moment from 'moment';\nimport { Gender } from '@/enums';\n\nclass Parent implements IParent {\n birthDate: moment.Moment;\n emailAddress: string;\n firstName: string;\n gender: Gender;\n initials: string;\n lastName: string;\n lastNamePrefix: string;\n mobileNumber: string;\n parentId: string;\n phoneNumber: string;\n phoneWork: string;\n\n constructor(parent: IParent) {\n Object.assign(this, parent);\n }\n\n getBirthDate(): moment.Moment {\n return moment(this.birthDate);\n }\n\n fullName(): string {\n let fullName = this.firstName;\n if (this.lastNamePrefix && this.lastNamePrefix !== '') {\n fullName += ' ' + this.lastNamePrefix;\n }\n\n if (this.lastName && this.lastName !== '') {\n fullName += ' ' + this.lastName;\n }\n return fullName;\n }\n}\n\nclass Address implements IAddress {\n city: string;\n countryId: string;\n postalCode: string;\n street: string;\n streetNumber: string;\n googleApiKey = 'AIzaSyB1KCqC2iOubGbKy3kJadFHqtg_ffLcF-M';\n\n constructor(address: IAddress) {\n Object.assign(this, address);\n }\n\n getFullAddress() {\n return `${this.street} ${this.streetNumber}, ${this.postalCode} ${this.city}`;\n }\n\n getGoogleMapsLink() {\n return (\n 'https://www.google.com/maps/embed/v1/place?' +\n 'key=' +\n this.googleApiKey +\n '&q=' +\n this.getFullAddress().replace(' ', '+')\n );\n }\n}\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n isEditing: boolean;\n parent: Parent;\n address: Address;\n genders: string[];\n countries: ICountry[];\n form: IParentDetailUpdateRequest;\n cancelEditMode: () => void;\n setEditMode: () => void;\n cancel: () => void;\n save: () => void;\n}\n\nclass ParentModalController implements IController {\n static $inject = ['$scope', 'AppDataService', '$modalInstance', 'parentId'];\n\n constructor(private $scope: ILocalScope,\n private dataService: AppDataService,\n $modalInstance: IModalServiceInstance,\n private parentId: string) {\n\n $scope.isLoading = true;\n $scope.isEditing = false;\n\n $scope.genders = Object.values(Gender);\n this.fetchData();\n\n $scope.cancel = () => {\n $modalInstance.dismiss();\n };\n\n $scope.setEditMode = () => {\n $scope.isEditing = true;\n };\n\n $scope.cancelEditMode = () => {\n $scope.isEditing = false;\n this.initializeEditMode();\n };\n\n $scope.save = () => {\n $scope.isLoading = true;\n dataService.updateParentDetails(ng.copy($scope.form)).finally(() => {\n $scope.isLoading = false;\n $scope.cancelEditMode();\n this.fetchData();\n });\n };\n }\n\n private fetchData() {\n this.dataService\n .getParentDetails(this.parentId)\n .then(result => {\n this.$scope.parent = new Parent(result.parent);\n this.$scope.address = new Address(result.address);\n this.$scope.countries = result.countries;\n\n this.initializeEditMode();\n })\n .finally(() => {\n this.$scope.isLoading = false;\n });\n }\n\n public initializeEditMode() {\n this.$scope.form = {\n birthDate: this.$scope.parent.getBirthDate(),\n emailAddress: this.$scope.parent.emailAddress,\n firstName: this.$scope.parent.firstName,\n gender: this.$scope.parent.gender,\n initials: this.$scope.parent.initials,\n lastName: this.$scope.parent.lastName,\n lastNamePrefix: this.$scope.parent.lastNamePrefix,\n mobileNumber: this.$scope.parent.mobileNumber,\n parentId: this.$scope.parent.parentId,\n phoneNumber: this.$scope.parent.phoneNumber,\n phoneWork: this.$scope.parent.phoneWork,\n\n city: this.$scope.address.city,\n countryId: this.$scope.address.countryId,\n postalCode: this.$scope.address.postalCode,\n street: this.$scope.address.street,\n streetNumber: this.$scope.address.streetNumber\n };\n }\n}\n\nappModule.controller('kpParentModalController', ParentModalController);\n","export interface KeyValuePair {\n key: TKey;\n value: TValue;\n}\n\nexport class Dictionary {\n\n public containsKey(key: string | number): boolean {\n return Object.prototype.hasOwnProperty.call(this, key);\n }\n\n public get(key: string | number): TValue {\n return this[key];\n }\n\n public getOrAdd(key: string | number, value: TValue): TValue {\n const existingValue = this[key];\n if (existingValue == null) {\n this[key] = value;\n return value;\n }\n\n return existingValue;\n }\n\n public set(key: string | number, value: TValue): TValue {\n return this[key] = value;\n }\n\n public set2(key: string | number, setter: (old: TValue) => TValue): TValue {\n return this[key] = setter(this[key]);\n }\n\n public add(key: string | number, value: TValue): TValue {\n this[key] = value;\n\n return value;\n }\n\n public remove(key: string | number): void {\n delete this[key];\n }\n\n public clear() {\n for (const key of this.keys()) {\n this.remove(key);\n }\n }\n\n public length(): number {\n return this.keys().length;\n }\n\n public keys(): string[] {\n return Object.keys(this);\n }\n\n public values(): TValue[] {\n const result = [];\n\n for (const key of this.keys()) {\n result.push(this.get(key));\n }\n\n return result;\n }\n\n public lastValue(): TValue {\n const keys = Object.keys(this);\n return this.get(keys[keys.length - 1]);\n }\n\n public firstValue(): TValue {\n const keys = Object.keys(this);\n return this.get(keys[0]);\n }\n\n public at(index: number): KeyValuePair {\n const keys = this.keys();\n const key = keys[index];\n\n return { key, value: this.get(key) };\n }\n\n public filter(filterAction: (kvp: KeyValuePair) => boolean): KeyValuePair[] {\n const results: KeyValuePair[] = [];\n\n for (const key of this.keys()) {\n const kvp = { key, value:this.get(key) };\n\n if (filterAction(kvp)) {\n results.push(kvp);\n }\n }\n\n return results;\n }\n\n static toDictionary(values: TValue[], keySelector: (value: TValue, index: number) => string | number): Dictionary {\n const result = new Dictionary();\n\n let index = 0;\n for (const value of values) {\n result[keySelector(value, index)] = value;\n index++;\n }\n\n return result;\n }\n\n static toDictionary2(items: TItem[], keySelector: (item: TItem, index: number) => string | number, valueSelector: (item: TItem, index: number) => TValue): Dictionary {\n const result = new Dictionary();\n\n let index = 0;\n for (const item of items) {\n result[keySelector(item, index)] = valueSelector(item, index);\n index++;\n }\n\n return result;\n }\n}","import { PresencesStatus } from '@/enums';\nimport { ChildCare } from '@/data-models';\nimport * as moment from 'moment';\n\nimport TransportChild = ChildCare.Definitions.Transport.Models.TransportChild;\nimport Child = ChildCare.Definitions.Child;\n\nfunction isTransportChild(child: Child): child is TransportChild {\n if (child == null) {\n return false;\n }\n\n return child['statuses'] != null;\n}\n\nexport const getChildStatus = (fromTimes: string[], child: TransportChild | Child): PresencesStatus => {\n if (!isTransportChild(child)) {\n return PresencesStatus.Expected;\n }\n\n for (const timeOfDay of fromTimes.map(x => moment.duration(x))) {\n let childTimes = Object.keys(child.statuses).map(x => ({ key: x, time: moment.duration(x) }));\n childTimes = childTimes.sort((a, b) => b.time.asMilliseconds() - a.time.asMilliseconds());\n\n for (const childTime of childTimes) {\n if (timeOfDay >= childTime.time) {\n return child.statuses[childTime.key];\n }\n }\n }\n\n return PresencesStatus.NotExpected;\n};","import { ChildCare } from '@/data-models';\nimport { Dictionary } from '@/dictionary';\nimport { AppDataService } from '@/services/app-data-service';\nimport * as moment from 'moment';\nimport { HttpError } from '@/services/http-error';\nimport { PresencesStatus } from '@/enums';\nimport { TransportTableRow } from './transport-table-row';\nimport { getChildStatus } from './get-child-status';\n\n\nimport TransportVehicle = ChildCare.Definitions.Transport.Models.TransportVehicle;\nimport Employee = ChildCare.Definitions.Locations.Models.Employee;\nimport TransportRide = ChildCare.Definitions.Transport.Models.TransportRide;\nimport TransportChild = ChildCare.Definitions.Transport.Models.TransportChild;\n\ntype ChildRow = { row: TransportTableRow; child: TransportChild };\n\nexport enum CapacityMode {\n none,\n restrict,\n manual\n}\n\nexport class RidesViewModel {\n private dataService: AppDataService;\n\n public date: moment.Moment;\n\n public sourceRows: TransportTableRow[];\n public vehicles: TransportVehicle[];\n public employees: Employee[];\n\n private selectedChildren: Dictionary;\n private selectedEmployee: Employee;\n private selectedVehicle: TransportVehicle;\n public remarks: string;\n\n private capacityMode: CapacityMode;\n\n public constructor(dataService: AppDataService, date: moment.Moment, sourceRows: TransportTableRow[], vehicles: TransportVehicle[], employees: Employee[]) {\n this.dataService = dataService;\n\n this.date = date;\n\n this.sourceRows = sourceRows;\n this.vehicles = vehicles;\n this.employees = employees;\n\n this.selectedChildren = new Dictionary();\n\n this.capacityMode = CapacityMode.restrict;\n\n this.createNewRides();\n\n this.initializeSelectedVehicle();\n this.initializeSelectedEmployee();\n this.initializeRemarks();\n\n this.selectVehicle = this.selectVehicle.bind(this);\n this.selectEmployee = this.selectEmployee.bind(this);\n this.selectChild = this.selectChild.bind(this);\n this.selectChildren = this.selectChildren.bind(this);\n this.numberOfSelectedChildren = this.numberOfSelectedChildren.bind(this);\n this.getSelectedEmployee = this.getSelectedEmployee.bind(this);\n this.getSelectedVehicle = this.getSelectedVehicle.bind(this);\n this.getSelectedChildren = this.getSelectedChildren.bind(this);\n this.getAllChildren = this.getAllChildren.bind(this);\n this.validate = this.validate.bind(this);\n this.save = this.save.bind(this);\n this.setCapacityMode = this.setCapacityMode.bind(this);\n }\n\n private createNewRides(): void {\n for (let i = 0; i < this.sourceRows.length; i++) {\n const row = this.sourceRows[i];\n\n if (row.ride?.rideId == null) {\n row.ride = {\n ...row.ride,\n rideId: this.generateNewId(i),\n locationId: row.time.locationId,\n schoolId: row.school?.schoolId,\n moment: this.date.clone().startOf('day').add(moment.duration(row.time.time)).toISOString(true)\n } as TransportRide;\n }\n }\n }\n\n private generateNewId(index: number) {\n return `new-${index}`;\n }\n\n private isNewId(id: string) {\n if (id == null) {\n return false;\n }\n return id.startsWith('new');\n }\n\n private initializeSelectedVehicle(): void {\n let vehicleId = this.sourceRows.find(x => x.ride?.vehicleId != null)?.ride?.vehicleId;\n if (vehicleId == null) {\n vehicleId = this.vehicles[0]?.vehicleId;\n }\n\n this.selectVehicle(vehicleId);\n }\n\n private initializeSelectedEmployee(): void {\n let employeeId = this.sourceRows.find(x => x.ride?.employeeId != null)?.ride?.employeeId;\n if (employeeId == null) {\n employeeId = this.employees[0]?.employeeId;\n }\n\n this.selectEmployee(employeeId);\n }\n\n private initializeRemarks(): void {\n const comment = this.sourceRows.find(x => x.ride?.comment != null)?.ride?.comment;\n if (comment != null) {\n this.remarks = comment;\n }\n }\n\n private selectAllChildren(): void {\n const containsExisting = this.sourceRows.some(x => !this.isNewId(x.ride.rideId));\n\n for (const row of this.sourceRows) {\n if (row.selectedChildren != null) {\n for (const child of row.selectedChildren) {\n this.addChild(row.ride.rideId, child, true);\n }\n }\n\n if (!containsExisting && row.availableChildren != null) {\n for (const child of row.availableChildren.sort((a, b) => a.childName.localeCompare(b.childName))) {\n if (getChildStatus(this.getMoments(), child) === PresencesStatus.Expected && !this.addChild(row.ride.rideId, child)) {\n if (this.capacityMode === CapacityMode.restrict) {\n break;\n }\n }\n }\n }\n }\n }\n\n private clearChildSelection(): void {\n this.selectedChildren.clear();\n }\n\n private addChild(rideId: string, child: TransportChild, ignoreCapacityMode = false): boolean {\n if (ignoreCapacityMode === false && this.capacityMode === CapacityMode.restrict) {\n const capacity = this.getVehicleCapacity();\n if (this.numberOfSelectedChildren() >= capacity) {\n return false;\n }\n }\n\n const children = this.selectedChildren.getOrAdd(rideId, []);\n if (children.some(x => x.childId === child.childId)) {\n return true;\n }\n\n children.push(child);\n\n return true;\n }\n\n private getVehicleCapacity(): number {\n const capacity = (this.selectedVehicle?.capacity ?? 0);\n\n return capacity === 0 ? 9999 : capacity;\n }\n\n public getSelectedChildren(): TransportChild[] {\n const children = [];\n\n for (const selectedPerRide of this.selectedChildren.values()) {\n children.push(...selectedPerRide);\n }\n\n return children;\n }\n\n private findRowsForChild(childId: string): ChildRow[] {\n const rows = new Array();\n for (const row of this.sourceRows) {\n if (row.selectedChildren != null) {\n for (const child of row.selectedChildren) {\n if (child.childId === childId) {\n rows.push({\n row,\n child\n });\n }\n }\n }\n\n if (row.availableChildren != null) {\n for (const child of row.availableChildren) {\n if (child.childId === childId) {\n rows.push({\n row,\n child\n });\n }\n }\n }\n }\n\n return rows;\n }\n\n public getAllChildren(): TransportChild[] {\n const children = new Array();\n\n for (const row of this.sourceRows) {\n if (row.selectedChildren != null) {\n for (const child of row.selectedChildren) {\n if (children.every(x => x.childId !== child.childId)) {\n children.push(child);\n }\n }\n }\n\n if (row.availableChildren != null) {\n for (const child of row.availableChildren) {\n if (children.every(x => x.childId !== child.childId)) {\n children.push(child);\n }\n }\n }\n }\n\n return children;\n }\n\n public selectChild(childId: string): boolean {\n const rows = this.findRowsForChild(childId);\n if (rows.length === 0) {\n return false;\n }\n\n this.capacityMode = CapacityMode.manual;\n\n const existingRow = rows.find(x => !this.isNewId(x.row.ride.rideId));\n if (existingRow != null) {\n return this.addChild(existingRow.row.ride.rideId, existingRow.child, true);\n } else {\n return this.addChild(rows[0].row.ride.rideId, rows[0].child, true);\n }\n }\n\n public selectChildren(childIds: string[]): boolean {\n if (childIds == null) {\n return false;\n }\n\n this.clearChildSelection();\n for (const childId of childIds) {\n if (!this.selectChild(childId)) {\n return false;\n }\n }\n\n return true;\n }\n\n public selectVehicle(vehicleId: string): void {\n const vehicle = this.vehicles.find(x => x.vehicleId === vehicleId);\n if (vehicle == null) {\n return;\n }\n\n this.selectedVehicle = vehicle;\n if (this.capacityMode === CapacityMode.manual) {\n return;\n }\n\n this.clearChildSelection();\n this.selectAllChildren();\n }\n\n public selectEmployee(employeeId: string): void {\n const employee = this.employees.find(x => x.employeeId === employeeId);\n if (employee == null) {\n return;\n }\n\n this.selectedEmployee = employee;\n }\n\n public setCapacityMode(mode: CapacityMode): void {\n this.capacityMode = mode;\n this.selectAllChildren();\n }\n\n public getSelectedEmployee(): Employee {\n return this.selectedEmployee;\n }\n\n public getSelectedVehicle(): TransportVehicle {\n return this.selectedVehicle;\n }\n\n public numberOfSelectedChildren(): number {\n return this.selectedChildren.values().reduce((prev, cur) => prev + cur.length, 0);\n }\n\n private hasChanges(ride: TransportRide): boolean {\n if (this.isNewId(ride.rideId)) {\n return true;\n }\n\n if (this.selectedEmployee?.employeeId !== ride.employeeId) {\n return true;\n }\n\n if (this.selectedVehicle?.vehicleId !== ride.vehicleId) {\n return true;\n }\n\n if (this.remarks !== ride.comment) {\n return true;\n }\n\n const newSelection = this.selectedChildren.get(ride.rideId) ?? [];\n const newChildren = new Array();\n const removedChildren = new Array();\n\n for (const selected of ride.children ?? []) {\n const index = newSelection.findIndex(x => x.childId === selected);\n if (index === -1) {\n removedChildren.push(selected);\n }\n }\n\n for (const selected of newSelection) {\n if (!ride.children.includes(selected.childId)) {\n newChildren.push(selected.childId);\n }\n }\n\n if (newChildren.length > 0 || removedChildren.length > 0) {\n return true;\n }\n\n return false;\n }\n\n public validate(): string[] {\n const errors = [];\n if (this.selectedVehicle == null) {\n errors.push('selectedVehicle');\n }\n\n if (this.selectedEmployee == null) {\n errors.push('selectedEmployee');\n }\n\n if (this.sourceRows.every(x => this.isNewId(x.ride.rideId)) && this.selectedChildren.length() === 0) {\n errors.push('selectedChildren');\n } else {\n if (this.sourceRows.every(x => !this.hasChanges(x.ride))) {\n errors.push('unchanged');\n }\n }\n\n return errors;\n }\n\n public getMoments(): string[] {\n return this.sourceRows.reduce((prev, cur) => {\n prev.push(cur.time.time);\n return prev;\n }, new Array());\n }\n\n private getRides(): TransportRide[] {\n const rides = new Array();\n\n for (const row of this.sourceRows) {\n const selectedChildren = this.selectedChildren.get(row.ride.rideId)?.map(x => x.childId) ?? [];\n\n if (selectedChildren.length === 0 && this.isNewId(row.ride.rideId)) {\n continue;\n }\n\n const ride = {\n ...row.ride,\n children: selectedChildren\n };\n\n if (this.isNewId(ride.rideId)) {\n ride.rideId = undefined;\n }\n\n rides.push(ride);\n }\n\n return rides;\n }\n\n public async save(): Promise {\n const errors = this.validate();\n if (errors.length > 0) {\n return 'validation failed for the following fields ' + errors.join(', ');\n }\n\n const ridesToSave = this.getRides();\n\n try {\n await this.dataService.saveTransportRides({\n vehicleId: this.selectedVehicle?.vehicleId,\n employeeId: this.selectedEmployee.employeeId,\n rides: ridesToSave,\n comment: this.remarks\n });\n } catch (reason) {\n if (reason instanceof HttpError) {\n return reason.message;\n }\n }\n\n return null;\n }\n}","import { IController, IFilterService, ILocationService, IScope, IQService, IPromise } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ILoadingBar } from '@/models';\nimport { ftSettingsService, FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { app, appModule, ng, ft } from '@/definitions';\nimport moment from 'moment';\nimport { ChildCare } from '@/data-models';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { Color } from '@/HelperClasses';\nimport swal from 'bootstrap-sweetalert';\nimport { RoleChecker } from '@/role-checker';\nimport { Dictionary } from '@/dictionary';\nimport { PresencesStatus } from '@/enums';\n\nimport TransportChildrenResponse = ChildCare.Definitions.Transport.Responses.TransportChildrenResponse;\nimport TransportRide = ChildCare.Definitions.Transport.Models.TransportRide;\nimport GroupModel = ChildCare.Definitions.Account.GroupModel;\nimport UserModel = ChildCare.Definitions.Account.UserModel;\nimport TransportVehicle = ChildCare.Definitions.Transport.Models.TransportVehicle;\nimport Employee = ChildCare.Definitions.Locations.Models.Employee;\nimport TransportChild = ChildCare.Definitions.Transport.Models.TransportChild;\nimport { TransportTableRow } from '@/travel-planner/transport-table-row';\nimport { getChildStatus } from '@/travel-planner/get-child-status';\n\ninterface Scope extends IScope {\n isLoading: boolean;\n groups: GroupModel[];\n group: GroupModel;\n locations: ChildCare.Definitions.Transport.Responses.TransportLocation[];\n currentLocationId: string;\n isCluster: Boolean;\n user: UserModel;\n isReadOnly: boolean;\n filteredTableData: TransportTableRow[];\n allTableData: TransportTableRow[];\n tableSorting: any;\n model: {\n isDropOff: boolean;\n pickedDate: moment.Moment;\n toggledRows: TransportTableRow[];\n onCapacity: boolean;\n };\n\n navigateToGroups(): void;\n today(): void;\n displayDatePicker(): void;\n previousDay(): void;\n hexToRgba: (hex, transparency) => string;\n nextDay(): void;\n toggled(row: TransportTableRow): boolean;\n toggleRow(row: TransportTableRow): void;\n getRide(schoolId: string): boolean;\n getVehicleColor(ride: TransportRide): string;\n getContrastColor(bgColor: string): void;\n openModal(): void;\n}\n\nclass TravelPlannerController implements IController {\n private vehicles: TransportVehicle[];\n private rides: Dictionary;\n private employees: Employee[];\n private children: Dictionary;\n private locations: ChildCare.Definitions.Transport.Responses.TransportLocation[];\n\n private $scope: Scope;\n private $q: IQService;\n private dataService: AppDataService;\n private loadingBar: ILoadingBar;\n private settingsService: ftSettingsService;\n private $location: ILocationService;\n private ngTableParams: any;\n private $filter: IFilterService;\n private $uibModal: IModalService;\n private loginService: FortyTwoLoginService;\n private dateTimeDialog: any;\n private roleCheckerService: RoleChecker;\n private $translate;\n\n static $inject = ['$scope', '$q', 'AppDataService', 'LoadingBar', 'ftSettingService', '$location', 'ngTableParams', '$filter', '$uibModal', 'ftLoginService', 'mdcDateTimeDialog', RoleChecker.serviceName, '$translate'];\n\n constructor($scope: Scope, $q: IQService, dataService: AppDataService, loadingBar: ILoadingBar, settingsService: ftSettingsService, $location: ILocationService, ngTableParams: any, $filter: IFilterService, $uibModal: IModalService, loginService: FortyTwoLoginService, dateTimeDialog: any, roleCheckerService: RoleChecker, $translate: any) {\n this.$scope = $scope;\n this.$q = $q;\n this.dataService = dataService;\n this.loadingBar = loadingBar;\n this.settingsService = settingsService;\n this.$location = $location;\n this.ngTableParams = ngTableParams;\n this.$filter = $filter;\n this.$uibModal = $uibModal;\n this.loginService = loginService;\n this.dateTimeDialog = dateTimeDialog;\n this.roleCheckerService = roleCheckerService;\n this.$translate = $translate;\n\n this.loadScopeWatches();\n this.initializeScreen();\n this.loadScopeFunctions();\n }\n\n private loadScopeWatches() {\n this.$scope.$watch('isLoading', (load: boolean) => {\n this.loadingBar.show = load;\n });\n\n this.$scope.$watch('model.pickedDate', () => {\n this.loadData();\n this.$location.path('/app/travel-planner').search({\n date: this.$scope.model.pickedDate.format('DD-MM-YYYY')\n });\n },\n true\n );\n\n this.$scope.$watch('model.isDropOff', () => {\n this.clearSelection();\n this.applyFilter();\n this.refreshTable();\n });\n\n this.$scope.$watch('currentLocationId', () => {\n if (this.$scope.currentLocationId) {\n return this.fetchLocation(this.$scope.currentLocationId);\n }\n });\n }\n\n private applyFilter() {\n this.$scope.filteredTableData = this.$scope.allTableData.filter(x => x.isDropOff === this.$scope.model.isDropOff);\n }\n\n private initializeScreen() {\n this.$scope.allTableData = [];\n this.$scope.filteredTableData = [];\n this.$scope.group = null;\n this.$scope.groups = [];\n this.$scope.model = {\n isDropOff: true,\n onCapacity: true,\n pickedDate: this.$location.search().date ? moment(this.$location.search().date, 'DD-MM-YYYY') : moment(),\n toggledRows: []\n };\n\n this.$scope.tableSorting = new this.ngTableParams({ count: 10 }, {\n total: this.$scope.filteredTableData.length,\n getData: ($defer, params) => {\n const orderedData = params.sorting() ? this.$filter('orderBy')(this.$scope.filteredTableData, params.orderBy()) : this.$scope.filteredTableData;\n $defer.resolve(orderedData);\n }\n });\n }\n\n private refreshTable() {\n this.$scope.tableSorting.reload();\n }\n\n private fetchLocation(locationId: string): IPromise {\n this.$scope.isLoading = true;\n this.$scope.currentLocationId = locationId;\n this.$scope.isCluster = this.locations.some(x => x.clusterId === locationId);\n\n const ridesTask = this.dataService.getTransportRides(locationId, this.$scope.model.pickedDate);\n const employeesTask = this.dataService.getEmployeesForLocation(locationId, this.$scope.model.pickedDate);\n const childrenTask = this.dataService.getTransportChildren(locationId, this.$scope.model.pickedDate);\n\n return this.$q.all([ridesTask, employeesTask, childrenTask]).then(responses => {\n this.rides = Dictionary.toDictionary(responses[0].rides, x => x.rideId);\n this.employees = responses[1].employees;\n this.children = Dictionary.toDictionary(responses[2].children, x => x.childId);\n\n this.clearSelection();\n this.$scope.allTableData = this.createTableData(responses[2]);\n this.applyFilter();\n this.refreshTable();\n })\n .catch(error => console.log(error))\n .finally(() => this.$scope.isLoading = false);\n }\n\n private createTableData(response: TransportChildrenResponse): TransportTableRow[] {\n const tableData: TransportTableRow[] = [];\n\n const schools = Dictionary.toDictionary(response.schools, x => x.schoolId);\n\n for (const time of response.times) {\n const fromLocation = this.locations.find(x => x.id === time.locationId);\n\n for (const timeSchool of time.schools) {\n\n const school = schools.get(timeSchool.schoolId);\n const availableChildren = timeSchool.childIds.map(x => this.children.get(x));\n\n for (const rideId of timeSchool.rides) {\n const ride = this.rides.get(rideId);\n\n const selectedChildren = ride.children.map(x => this.children.get(x)).filter(x => x != null);\n\n tableData.push({\n ride: ride,\n time: time,\n location: fromLocation,\n school: school,\n isDropOff: time.isDropOff,\n selectedChildren: selectedChildren,\n numberOfChildren: selectedChildren.filter(x => getChildStatus([time.time], x) === PresencesStatus.Expected).length,\n availableChildren: [...availableChildren]\n });\n }\n\n if (timeSchool.childIds && timeSchool.childIds.length > 0) {\n const row = {\n time: time,\n school: school,\n location: fromLocation,\n isDropOff: time.isDropOff,\n numberOfChildren: availableChildren.filter(x => getChildStatus([time.time], x) === PresencesStatus.Expected).length,\n availableChildren: [...availableChildren],\n } as TransportTableRow;\n\n if (row.numberOfChildren > 0) {\n tableData.push(row);\n }\n }\n }\n }\n\n return tableData;\n }\n\n private loadData() {\n this.$scope.isLoading = true;\n\n const userTask = this.loginService.getCurrentUserAsync();\n const locationsTask = this.dataService.getTransportLocations(this.$scope.model.pickedDate);\n const groupsTask = this.dataService.getGroupsAsync();\n const vehiclesTask = this.dataService.getTransportVehicles(this.$scope.model.pickedDate);\n\n return this.$q.all([userTask, locationsTask, groupsTask, vehiclesTask]).then(responses => {\n this.$scope.user = responses[0];\n this.locations = responses[1].locations;\n this.$scope.locations = this.locations.filter(x => x.clusterId == null || x.id == null); // These are selectable\n this.$scope.groups = responses[2].groups;\n this.vehicles = responses[3].vehicles;\n\n this.$scope.group = this.$scope.groups.find(x => x.id === this.settingsService.get(app.settings.group.selected));\n\n let locationId = this.$scope.currentLocationId;\n if (!locationId) {\n locationId = this.$scope.locations[0].clusterId ?? this.$scope.locations[0].id;\n }\n\n this.$scope.isReadOnly = !RoleChecker.hasPlannerRole(this.$scope.user);\n\n return this.fetchLocation(locationId);\n }).finally(() => this.$scope.isLoading = false);\n }\n\n private today() {\n this.$scope.model.pickedDate = moment();\n }\n\n private previousDay() {\n this.$scope.model.pickedDate.subtract(1, 'day');\n }\n\n private nextDay() {\n this.$scope.model.pickedDate.add(1, 'day');\n }\n\n private displayDatePicker() {\n this.dateTimeDialog\n .show({\n currentDate: this.$scope.model.pickedDate,\n time: false,\n autoOk: true,\n disableParentScroll: true\n })\n .then(date => {\n this.$scope.model.pickedDate = moment(date);\n });\n }\n\n private toggleRow(row: TransportTableRow) {\n const index = this.$scope.model.toggledRows.findIndex(x => x === row);\n if (index >= 0) {\n this.$scope.model.toggledRows.splice(index, 1);\n } else {\n this.$scope.model.toggledRows.push(row);\n }\n }\n\n private toggled(row: TransportTableRow) {\n return this.$scope.model.toggledRows.find(x => x === row) !== undefined;\n }\n\n private getVehicleColor(ride: TransportRide) {\n if (ride === undefined) {\n return;\n }\n\n return this.vehicles.find(x => x.vehicleId === ride.vehicleId).color;\n }\n\n private hexToRgba(hex, transparency) {\n return Color.hexToRgba(hex, transparency);\n }\n\n private getContrastColor(bgColor: string) {\n return Color.contrast(Color.hexToRgba(bgColor));\n }\n\n private editRide() {\n if (this.vehicles.length === 0) {\n swal({\n title: this.$translate.instant('MESSAGES.ERROR-TITLE'),\n text: this.$translate.instant('TRANSPORT.ERRORS.NO-VEHICLES'),\n timer: 3000,\n type: 'error'\n });\n return;\n }\n\n if (this.employees.length === 0) {\n swal({\n title: this.$translate.instant('MESSAGES.ERROR-TITLE'),\n text: this.$translate.instant('TRANSPORT.ERRORS.NO-EMPLOYEES'),\n timer: 3000,\n type: 'error'\n });\n return;\n }\n\n const date = this.$scope.model.pickedDate.clone().startOf('day');\n\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/travel/edit-ride.html?v=' + ft.randomNumber,\n controller: 'EditRideController',\n backdrop: true,\n size: 'md',\n keyboard: true,\n resolve: {\n sourceRows: () => ng.copy(this.$scope.model.toggledRows),\n date: () => date.clone(),\n vehicles: () => ng.copy(this.vehicles),\n employees: () => ng.copy(this.employees),\n onCapacity: () => ng.copy(this.$scope.model.onCapacity),\n }\n }).result.then(async () => {\n swal({\n title: 'Opgeslagen',\n text: 'Rit is opgeslagen',\n timer: 3000,\n type: 'success'\n });\n\n // Probably refresh table & data here\n this.loadData().then(() => {\n this.clearSelection();\n this.refreshTable();\n });\n });\n }\n\n private clearSelection(): void {\n this.$scope.model.toggledRows = [];\n }\n\n private loadScopeFunctions() {\n this.$scope.navigateToGroups = this.roleCheckerService.switchGroup;\n this.$scope.today = this.today.bind(this);\n this.$scope.previousDay = this.previousDay.bind(this);\n this.$scope.nextDay = this.nextDay.bind(this);\n this.$scope.displayDatePicker = this.displayDatePicker.bind(this);\n this.$scope.toggleRow = this.toggleRow.bind(this);\n this.$scope.toggled = this.toggled.bind(this);\n this.$scope.getVehicleColor = this.getVehicleColor.bind(this);\n this.$scope.hexToRgba = this.hexToRgba.bind(this);\n this.$scope.getContrastColor = this.getContrastColor.bind(this);\n\n this.$scope.openModal = this.editRide.bind(this);\n }\n}\n\nappModule.controller('kpTravelPlannerController', TravelPlannerController);\n","import { IController, IScope } from 'angular';\nimport { IModalInstanceService, IModalService } from 'angular-ui-bootstrap';\nimport { appModule, ft } from '@/definitions';\nimport { ChildCare } from '@/data-models';\nimport { Moment } from 'moment';\nimport { AppDataService } from '@/services/app-data-service';\nimport swal from 'bootstrap-sweetalert';\nimport { RidesViewModel, CapacityMode } from '@/travel-planner/rides-view-model';\n\nimport TransportVehicle = ChildCare.Definitions.Transport.Models.TransportVehicle;\nimport Employee = ChildCare.Definitions.Locations.Models.Employee;\nimport TransportChild = ChildCare.Definitions.Transport.Models.TransportChild;\nimport { TransportTableRow } from '@/travel-planner/transport-table-row';\n\ninterface Scope extends IScope {\n vm: RidesViewModel;\n\n isLoading: boolean;\n errors: { [key: string]: string };\n\n selectedEmployeeId: string;\n\n selectVehicle(vehicle: TransportVehicle): void;\n selectChildrenClicked(): void;\n save(): void;\n cancel(): void;\n}\n\nclass EditRideController implements IController {\n\n private $scope: Scope;\n\n private $uibModal: IModalService;\n private $uibModalInstance: IModalInstanceService;\n\n private $translate;\n\n static $inject = ['$scope', '$translate', '$uibModal', '$uibModalInstance', 'AppDataService', 'sourceRows', 'date', 'vehicles', 'employees', 'onCapacity'];\n\n constructor($scope: Scope, $translate: any, $uibModal: IModalService, $uibModalInstance: IModalInstanceService, dataService: AppDataService, sourceRows: TransportTableRow[], date: Moment, vehicles: TransportVehicle[], employees: Employee[], onCapacity: boolean) {\n this.$scope = $scope;\n this.$translate = $translate;\n this.$uibModal = $uibModal;\n this.$uibModalInstance = $uibModalInstance;\n\n this.$scope.vm = new RidesViewModel(dataService, date, sourceRows, vehicles, employees);\n this.$scope.vm.setCapacityMode(onCapacity ? CapacityMode.restrict : CapacityMode.none);\n\n this.$scope.selectedEmployeeId = this.$scope.vm.getSelectedEmployee()?.employeeId;\n\n this.$scope.$watch('selectedEmployeeId', (value: string) => this.$scope.vm.selectEmployee(value));\n\n this.loadScopeFunctions();\n }\n\n private onSelectChildrenClicked() {\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/travel/child-picker.html?v=' + ft.randomNumber,\n controller: 'ChildPickerController',\n backdrop: true,\n size: 'sm',\n keyboard: true,\n resolve: {\n children: () => this.$scope.vm.getAllChildren(),\n selectedChildren: () => this.$scope.vm.getSelectedChildren(),\n moments: () => this.$scope.vm.getMoments()\n }\n }).result.then((result: TransportChild[]) => {\n this.$scope.vm.selectChildren(result.map(x => x.childId));\n });\n }\n\n private async onSave(): Promise {\n const errors = this.$scope.vm.validate();\n if (errors.length > 0) {\n this.$scope.errors = {};\n for (const error of errors) {\n switch (error) {\n case 'selectedVehicle': this.$scope.errors['selectedVehicle'] = this.$translate.instant('TRANSPORT.ERRORS.VEHICLE'); break;\n case 'selectedEmployee': this.$scope.errors['selectedEmployee'] = this.$translate.instant('TRANSPORT.ERRORS.EMPLOYEE'); break;\n case 'selectedChildren': this.$scope.errors['selectedChildren'] = this.$translate.instant('TRANSPORT.ERRORS.SELECTED-CHILDREN'); break;\n case 'unchanged': this.$uibModalInstance.close(); break;\n }\n }\n\n return;\n }\n\n this.$scope.isLoading = true;\n\n try {\n const error = await this.$scope.vm.save();\n if (error) {\n swal({\n title: this.$translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: this.$translate.instant('ERRORS.SAVE-FAILED.MESSAGE') + '\\n' + error,\n timer: 3000,\n type: 'error'\n });\n } else {\n this.$uibModalInstance.close();\n }\n } finally {\n this.$scope.isLoading = false;\n this.$scope.$apply();\n }\n\n }\n\n private onCancel() {\n this.$uibModalInstance.dismiss();\n }\n\n private loadScopeFunctions() {\n this.$scope.selectChildrenClicked = this.onSelectChildrenClicked.bind(this);\n this.$scope.save = this.onSave.bind(this);\n this.$scope.cancel = this.onCancel.bind(this);\n }\n}\n\nappModule.controller('EditRideController', EditRideController);\n","import { IController, IScope, IAngularEvent } from 'angular';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { appModule } from '@/definitions';\nimport { ChildCare } from '@/data-models';\nimport { Dictionary } from '@/dictionary';\nimport { PresencesStatus } from '@/enums';\nimport { getChildStatus } from '@/travel-planner/get-child-status';\n\ntype Child = ChildCare.Definitions.Child;\n\ninterface ILocalScope extends IScope {\n toggled: (child: Child) => void;\n toggleChild: (child: Child) => void;\n showStatus: (child: Child) => boolean;\n getStatus: (child: Child) => void;\n children: Child[];\n selected: Dictionary;\n\n save(): void;\n cancel(): void;\n}\n\nclass ChildPickerController implements IController {\n static $inject = ['$uibModalInstance', '$scope', 'moments','children', 'selectedChildren'];\n\n private $scope: ILocalScope;\n private $uibModalInstance: IModalInstanceService;\n\n private moments: string[];\n\n constructor($uibModalInstance: IModalInstanceService, $scope: ILocalScope, moments: string[], children: Child[], selectedChildren: Child[]) {\n this.$uibModalInstance = $uibModalInstance;\n this.$scope = $scope;\n\n this.moments = moments;\n\n this.$scope.selected = Dictionary.toDictionary2(selectedChildren, child => child.childId, () => true);\n $scope.children = children.sort((a, b) => a.childName.localeCompare(b.childName));\n\n $scope.toggleChild = this.toggleChild.bind(this);\n $scope.toggled = this.toggled.bind(this);\n $scope.save = this.save.bind(this);\n $scope.cancel = this.cancel.bind(this);\n $scope.showStatus = this.showStatus.bind(this);\n\n $scope.getStatus = (child: Child) => getChildStatus(this.moments, child);\n }\n\n private toggleChild(event: IAngularEvent, child: Child) {\n event.preventDefault();\n\n const isSelected = this.$scope.selected.get(child.childId) == true; // coercing value to true or false\n const newValue = this.$scope.selected.set(child.childId, !isSelected);\n console.log(`toggled ${child.childName}: ${isSelected} -> ${newValue}`);\n }\n\n private toggled(child: Child) {\n const returnValue = this.$scope.selected.get(child.childId) == true; // coercing value to true or false\n console.log(`isSelected: ${returnValue} child=${child.childName}`);\n\n return returnValue;\n }\n\n private showStatus(child: Child) {\n const status = getChildStatus(this.moments, child);\n return status !== PresencesStatus.Expected;\n }\n\n private save() {\n const selectedChildren = this.$scope.children.filter(x => this.$scope.selected.get(x.childId) == true);\n this.$uibModalInstance.close(selectedChildren);\n }\n\n private cancel = () => {\n this.$uibModalInstance.dismiss();\n };\n}\n\nappModule.controller('ChildPickerController', ChildPickerController);\n","import { IController, ILocationService, IScope, IAngularEvent, IPromise } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ILoadingBar } from '@/models';\nimport { appModule, ng } from '@/definitions';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport { ChildCare } from '@/data-models';\nimport moment from 'moment';\nimport swal from 'bootstrap-sweetalert';\nimport { RoleChecker } from '@/role-checker';\n\ntype Location = ChildCare.Definitions.Locations.Models.Location;\ntype ActivityPlanning = ChildCare.Definitions.Activity.ActivityPlanning;\ntype Activity = ChildCare.Definitions.Activity.Activity;\n\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n activities: ChildCare.Definitions.Activity.ActivityPlanning[];\n locations: Location[];\n locationId: string;\n todayDate: moment.Moment;\n pickedDate: moment.Moment;\n currentRange: moment.Moment[];\n\n displayDatePicker(): void;\n getActivitiesForDate(date: moment.Moment): ActivityPlanning[];\n formatTime(date: string): string;\n today(): void;\n previousDay(): void;\n nextDay(): void;\n dateSelected(date: moment.Moment): void;\n activitySelected: ($event: IAngularEvent, activity: ActivityPlanning) => void;\n navigateToGroups(): void;\n generateClassesForDate(date: moment.Moment): string;\n}\n\nclass ActivityPlannerController implements IController {\n static $inject = [\n '$scope',\n 'AppDataService',\n 'LoadingBar',\n '$location',\n '$uibModal',\n 'mdcDateTimeDialog',\n RoleChecker.serviceName\n ];\n\n private locationHasKiosk: boolean;\n\n constructor(\n private $scope: ILocalScope,\n private dataService: AppDataService,\n private loadingBar: ILoadingBar,\n private $location: ILocationService,\n private $uibModal: IModalService,\n private dateTimeDialog: any,\n private roleCheckerService: RoleChecker\n ) {\n this.initializeScope();\n this.loadScopeWatches();\n this.loadData();\n\n this.$scope.today = this.selectToday.bind(this);\n this.$scope.previousDay = this.selectPreviousDay.bind(this);\n this.$scope.nextDay = this.selectNextDay.bind(this);\n this.$scope.navigateToGroups = this.roleCheckerService.switchGroup;\n this.$scope.formatTime = this.formatTime.bind(this);\n this.$scope.getActivitiesForDate = this.getActivitiesForDate.bind(this);\n this.$scope.displayDatePicker = this.displayDatePicker.bind(this);\n this.$scope.activitySelected = this.onActivitySelected.bind(this);\n this.$scope.dateSelected = this.onDateSelected.bind(this);\n this.$scope.generateClassesForDate = this.generateClassesForDate.bind(this);\n }\n\n private loadScopeWatches() {\n this.$scope.$watch('locationId', () => {\n if (this.$scope.isLoading === false && this.$scope.locationId) {\n return this.loadActivities(this.$scope.locationId);\n }\n });\n\n this.$scope.$watch('pickedDate', (newDate: moment.Moment) => {\n this.loadData();\n this.$location.path('/app/activity-planner').search({\n date: newDate.format('DD-MM-YYYY')\n });\n }, true);\n }\n\n private loadData(): IPromise {\n this.setIsLoading(true);\n\n this.$scope.currentRange = this.dateRange(0, 6);\n\n return this.dataService.getLocations().then(response => {\n this.$scope.locations = response.locations;\n if (this.$scope.locationId == null) {\n this.$scope.locationId = this.$scope.locations[0].locationId;\n }\n\n this.locationHasKiosk = this.$scope.locations[0].hasActivityKiosk;\n\n return this.loadActivities(this.$scope.locationId);\n }).finally(() => this.setIsLoading(false));\n }\n\n private setIsLoading(isLoading: boolean) {\n this.$scope.isLoading = isLoading;\n this.loadingBar.show = isLoading;\n }\n\n private loadActivities(locationId: string): IPromise {\n this.setIsLoading(true);\n\n const from = this.$scope.pickedDate.clone().startOf('week');\n const to = this.$scope.pickedDate.clone().endOf('week');\n\n return this.dataService.getActivitiesByDates(locationId, from, to).then(response => {\n this.$scope.activities = response.activityPlannings;\n }).finally(() => this.setIsLoading(false));\n }\n\n private selectToday() {\n this.$scope.pickedDate = moment();\n }\n\n private selectPreviousDay() {\n this.$scope.pickedDate.subtract(7, 'day');\n }\n\n private selectNextDay() {\n this.$scope.pickedDate.add(7, 'day');\n }\n\n private formatTime(date: string) {\n const momentDate = moment(date);\n return momentDate.format('HH:mm');\n }\n\n private getActivitiesForDate(date: moment.Moment) {\n return this.$scope.activities.filter(\n x => moment(x.start).format('DD-MM-YYYY') === date.format('DD-MM-YYYY')\n );\n }\n\n private onActivitySelected($event: IAngularEvent, planning: ChildCare.Definitions.Activity.ActivityPlanning) {\n $event.stopPropagation();\n this.editActivity(moment(planning.start), planning.activity, planning);\n }\n\n private displayDatePicker() {\n this.dateTimeDialog\n .show({\n currentDate: this.$scope.pickedDate,\n time: false,\n autoOk: true,\n disableParentScroll: true\n })\n .then(date => {\n this.$scope.pickedDate = moment(date);\n });\n }\n\n private onDateSelected(date: moment.Moment) {\n const differenceInDays = date.diff(moment(), 'days');\n if (differenceInDays < 0) {\n swal({\n title: 'U kunt niet in het verleden plannen!',\n timer: 2000,\n type: 'warning'\n });\n return;\n }\n\n const instance = this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/activity/activity-selector.html',\n controller: 'kpSelectActivityController',\n backdrop: true,\n size: 'lg',\n keyboard: true,\n resolve: {\n locationId: () => ng.copy(this.$scope.locationId)\n }\n });\n\n return instance.result.then((activity: Activity) => {\n return this.editActivity(date, activity);\n });\n }\n\n private generateClassesForDate(date: moment.Moment) {\n\n const distance = date.clone().diff(moment().startOf('day'), 'days');\n\n if (distance === 0) {\n return 'day selected-day';\n } else if (distance > 0) {\n return 'day future';\n } else {\n return 'day past';\n }\n }\n\n private dateRange(min: number, max: number) {\n const input = [];\n\n const startOfWeek = this.$scope.pickedDate.clone().startOf('week');\n\n for (let i = min; i <= max; i += 1) {\n input.push(startOfWeek.clone().add(i, 'day'));\n }\n\n return input;\n }\n\n private editActivity(date: moment.Moment, activity: Activity, planning: ActivityPlanning = undefined) {\n const instance = this.\n $uibModal.open({\n animation: true,\n templateUrl: 'partials/activity/activity-edit.html',\n controller: 'kpEditActivityController',\n backdrop: true,\n size: 'lg',\n keyboard: true,\n resolve: {\n locationId: () => ng.copy(this.$scope.locationId),\n locationHasKiosk: () => this.locationHasKiosk,\n date: () => ng.copy(date),\n planning: () => ng.copy(planning),\n activity: () => activity\n }\n });\n\n return instance.result.then(() => {\n swal({\n title: 'Opgeslagen',\n text: 'De aanvraag is verwerkt!',\n timer: 3000,\n type: 'success'\n });\n\n // Probably refresh table & data here\n this.loadData();\n });\n }\n\n initializeScope() {\n this.setIsLoading(false);\n\n this.$scope.todayDate = moment();\n this.$scope.activities = [];\n this.$scope.pickedDate = this.$location.search().date ? moment(this.$location.search().date, 'DD-MM-YYYY') : moment();\n }\n}\n\nappModule.controller('kpActivityPlannerController', ActivityPlannerController);\n","import { IController, IScope, IPromise } from 'angular';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { appModule } from '@/definitions';\nimport { ChildCare } from '@/data-models';\nimport { Dictionary } from '@/dictionary';\nimport { AppDataService } from '@/services/app-data-service';\n\ntype AreaType = ChildCare.Definitions.Activity.AreaType;\ntype Activity = ChildCare.Definitions.Activity.Activity;\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n selectionCompleted: boolean;\n currentActivities: Dictionary;\n selectedActivities: Dictionary;\n cancel: () => void;\n select: () => void;\n getActivitiesForLevel: (parentActivityId: string, level: number) => Activity[];\n getAreaName: (activities: Activity[]) => string;\n}\n\nexport const CustomActivityId = 'ad338a88-11a2-408f-ad1f-aa48ded37419';\n\nclass SelectActivityController implements IController {\n static $inject = ['$uibModalInstance', '$scope', '$translate', 'AppDataService', 'locationId'];\n\n private activitiesPerLevel: Dictionary;\n private areaTypes: Dictionary;\n private activityAreaTypeId: string;\n private $uibModalInstance: IModalInstanceService;\n private $scope: ILocalScope;\n private dataService: AppDataService;\n private locationId: string;\n private $translate;\n\n constructor($uibModalInstance: IModalInstanceService, $scope: ILocalScope, $translate, dataService: AppDataService, locationId: string) {\n\n this.$uibModalInstance = $uibModalInstance;\n this.$scope = $scope;\n this.$translate = $translate;\n this.dataService = dataService;\n this.locationId = locationId;\n\n this.$scope.$watch('selectedActivities', this.onSelectionChanged.bind(this), true);\n\n this.$scope.getActivitiesForLevel = this.getActivitiesForLevel.bind(this);\n this.$scope.getAreaName = this.getAreaName.bind(this);\n this.$scope.select = this.select.bind(this);\n this.$scope.cancel = this.cancel.bind(this);\n\n this.$scope.currentActivities = new Dictionary();\n this.$scope.selectedActivities = new Dictionary();\n\n this.initializeData();\n }\n\n private createActivityLevels(activities: Activity[]): Dictionary {\n const levels = new Dictionary();\n\n let parents: string[] = [];\n let current = -1;\n\n do {\n current++;\n const currentLevel = levels.add(current.toString(), []);\n const nextParents: string[] = [];\n\n for (const activity of activities.filter(x => current === 0 && x.parentActivityId == null || parents.includes(x.parentActivityId))) {\n currentLevel.push(activity);\n nextParents.push(activity.activityId);\n }\n\n parents = nextParents;\n } while (levels.get(current.toString()).length > 0);\n\n return levels;\n }\n\n private initializeData(): IPromise {\n this.$scope.isLoading = true;\n\n return this.dataService.getExistingActivityTypes(this.locationId).then(response => {\n this.activitiesPerLevel = this.createActivityLevels(response.activities);\n this.areaTypes = Dictionary.toDictionary(response.areaTypes, x => x.areaTypeId);\n this.activityAreaTypeId = response.areaTypes.find(x => x.name === 'Activiteit')?.areaTypeId;\n }).finally(() => {\n this.$scope.isLoading = false;\n }).then(() => {\n this.onSelectionChanged(new Dictionary(), new Dictionary());\n });\n }\n\n private resetToHierarchicalState(current: Dictionary, previous: Dictionary) {\n const currentKeys = current.keys();\n const previousKeys = previous.keys();\n\n // If the length are not equal then something is added or removed\n // no need the check if some of the previous selections has changed\n if (currentKeys.length !== previousKeys.length) {\n return;\n }\n\n for (const level of currentKeys) {\n if (current[level] === previous[level]) {\n continue;\n }\n\n this.$scope.selectionCompleted = false;\n\n for (let otherLevel = parseInt(level) + 1; otherLevel <= currentKeys.length; otherLevel++) {\n current.remove(otherLevel);\n this.$scope.currentActivities.remove(otherLevel);\n }\n }\n }\n\n private onSelectionChanged(current: Dictionary, previous: Dictionary) {\n\n if (this.$scope.isLoading) {\n return;\n }\n\n const currentActivities = this.$scope.currentActivities;\n\n this.resetToHierarchicalState(current, previous);\n\n const currentLevel = current.length();\n const previousLevel = currentLevel - 1;\n const nextLevel = currentLevel + 1;\n const lastActivityId = current.get(previousLevel);\n\n const currentLevelActivities = this.getActivitiesForLevel(lastActivityId, currentLevel);\n\n currentActivities[currentLevel] = currentLevelActivities;\n\n const selectionCompleted = this.getActivitiy(this.$scope.selectedActivities[previousLevel])?.areaTypeId === this.activityAreaTypeId;\n\n const shouldAddCustomActivity = !selectionCompleted && (\n currentLevelActivities.length === 0 ||\n currentLevelActivities.every(x => this.getActivitiesForLevel(x.activityId, nextLevel).length === 0)\n );\n\n if (shouldAddCustomActivity && lastActivityId !== CustomActivityId) {\n\n const parentActivity = this.activitiesPerLevel.get(previousLevel)?.find(x => x.activityId === lastActivityId);\n\n currentLevelActivities.push(this.createCustomActivity(parentActivity));\n if (currentLevelActivities.length === 1) {\n this.$scope.selectedActivities[currentLevel] = CustomActivityId;\n }\n }\n\n this.$scope.selectionCompleted = selectionCompleted;\n }\n\n private createCustomActivity(templateActivity: Activity): Activity {\n return {\n activityId: CustomActivityId,\n groupSize: templateActivity?.groupSize,\n name: this.$translate.instant('ACTIVITY.CUSTOM-ACTIVITY'),\n poster: undefined,\n color: templateActivity?.color,\n areaTypeId: this.activityAreaTypeId,\n parentActivityId: undefined,\n description: templateActivity?.description\n };\n }\n\n private getActivitiesForLevel(parentActivityId: string, level: number): Activity[] {\n return this.activitiesPerLevel.get(level).filter(x => x.parentActivityId === parentActivityId);\n }\n\n private getActivitiy(activityId: string): Activity {\n if (activityId === CustomActivityId) {\n return this.createCustomActivity({} as Activity);\n }\n\n for (const activities of this.activitiesPerLevel.values()) {\n const activity = activities.find(x => x.activityId === activityId);\n if (activity != null) {\n return activity;\n }\n }\n\n return null;\n }\n\n private getArea(activities: Activity[]) {\n if (activities == null || activities.length === 0) {\n return null;\n }\n\n const activity = activities[0];\n return this.areaTypes.get(activity.areaTypeId);\n }\n\n private getAreaName(activities: Activity[]) {\n const area = this.getArea(activities);\n\n if (area) {\n return area.name;\n }\n\n return '';\n }\n\n private select() {\n let activity: Activity;\n\n const selectedActivityId = this.$scope.selectedActivities.lastValue();\n\n if (selectedActivityId === CustomActivityId) {\n const parentActivityId = this.$scope.selectedActivities.at(this.$scope.selectedActivities.length() - 2).value;\n activity = this.findActivity(parentActivityId);\n\n } else {\n activity = this.findActivity(selectedActivityId);\n }\n\n this.$uibModalInstance.close(activity);\n }\n\n private findActivity(activityId: string) {\n return this.activitiesPerLevel\n .values()\n .reduce((acc, val) => acc.concat(val), [])\n .find(x => x.activityId === activityId);\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n}\n\nappModule.controller('kpSelectActivityController', SelectActivityController);\n","import { IController, IScope, IQService, IPromise } from 'angular';\nimport { IModalInstanceService, IModalService } from 'angular-ui-bootstrap';\nimport { appModule, ng, ft } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport moment, { duration } from 'moment';\nimport { Dictionary } from '@/dictionary';\n\ntype ActivityPlanning = ChildCare.Definitions.Activity.ActivityPlanning;\ntype ActivityGroupTypeModel = ChildCare.Definitions.Activity.ActivityGroupTypeModel;\ntype ActivityGroupListResponse = ChildCare.Definitions.Activity.ActivityGroupListResponse;\ntype ActivityEmployeeListResponse = ChildCare.Definitions.Activity.ActivityEmployeeListResponse;\ntype ActivityGroupModel = ChildCare.Definitions.Activity.ActivityGroupModel;\ntype Activity = ChildCare.Definitions.Activity.Activity;\ntype Employee = ChildCare.Definitions.Locations.Models.Employee;\ntype CreateOrUpdateActivityPlanningCommand = ChildCare.Definitions.Activity.CreateOrUpdateActivityPlanningCommand;\ntype Child = ChildCare.Definitions.Child;\n\ninterface IForm {\n name: string;\n description: string;\n isIntern: boolean;\n selectedGroups: Dictionary;\n selectedEmployees: Dictionary;\n startTime: string;\n endTime: string;\n maximumGroupSize: number;\n periodicOrSeries: string;\n place: string;\n repeatUntil?: string;\n}\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n isNew: boolean;\n date: moment.Moment;\n availableEmployees: Employee[];\n availableGroups: ActivityGroupModel[];\n availableGroupTypes: ActivityGroupTypeModel[];\n selectedGroupTypes: Dictionary;\n form: IForm;\n errors: Dictionary;\n\n filteredGroups: () => ActivityGroupModel[];\n cancel: () => void;\n save: () => void;\n delete: () => void;\n\n selectChildrenClicked();\n numberOfSelectedChildren(): number;\n}\n\nclass EditActivityController implements IController {\n private $q: IQService;\n private $uibModal: IModalService;\n private $uibModalInstance: IModalInstanceService;\n private $scope: ILocalScope;\n private $translate;\n private dataService: AppDataService;\n private locationId: string;\n private planning: ActivityPlanning;\n private activity: Activity;\n private locationHasKiosk: boolean;\n private selectedChildren: Child[];\n\n static $inject = ['$q', '$uibModal', '$uibModalInstance', '$scope', '$translate', 'AppDataService', 'date', 'locationId', 'locationHasKiosk', 'planning', 'activity'];\n\n constructor($q: IQService, $uibModal: IModalService, $uibModalInstance: IModalInstanceService, $scope: ILocalScope, $translate, dataService: AppDataService, date: moment.Moment, locationId: string, locationHasKiosk: boolean, planning: ActivityPlanning, activity: Activity) {\n this.$q = $q;\n this.$uibModal = $uibModal;\n this.$uibModalInstance = $uibModalInstance;\n this.$scope = $scope;\n this.dataService = dataService;\n this.$scope.date = date;\n this.locationId = locationId;\n this.planning = planning;\n this.activity = activity;\n this.$translate = $translate;\n this.locationHasKiosk = locationHasKiosk;\n\n this.selectedChildren = [];\n\n this.$scope.filteredGroups = this.filteredGroups.bind(this);\n this.$scope.save = this.save.bind(this);\n this.$scope.delete = this.delete.bind(this);\n this.$scope.cancel = this.cancel.bind(this);\n this.$scope.selectChildrenClicked = this.onSelectChildrenClicked.bind(this);\n this.$scope.numberOfSelectedChildren = () => this.selectedChildren.length;\n this.$scope.isNew = this.planning?.activityPlanningId == null;\n\n this.initializeData();\n }\n\n private initializeData(): IPromise {\n this.$scope.isLoading = true;\n\n this.$scope.selectedGroupTypes = new Dictionary();\n\n const allGroupsTask = this.dataService.getGroupsByLocation(this.locationId);\n const employeesTask = this.dataService.getEmployeesForLocation(this.locationId, this.$scope.date);\n\n const planningId = this.planning ? this.planning.activityPlanningId : undefined;\n const activityGroupsTask = planningId ? this.dataService.getGroupsForActivityPlanning(planningId) : this.$q.resolve(null);\n const activityEmployeesTask = planningId ? this.dataService.getEmployeesForActivityPlanning(planningId) : this.$q.resolve(null);\n\n return this.$q.all([allGroupsTask, employeesTask, activityGroupsTask, activityEmployeesTask])\n .then(responses => {\n const groupsResponse = responses[0];\n const employeesResponse = responses[1];\n const activityGroupsResponse = responses[2] as ActivityGroupListResponse;\n const activityEmployeesResponse = responses[3] as ActivityEmployeeListResponse;\n\n this.$scope.availableGroups = groupsResponse.groups;\n this.$scope.availableGroupTypes = groupsResponse.groupTypes;\n\n this.$scope.form = this.createForm(this.planning, this.activity);\n\n if (activityGroupsResponse) {\n this.$scope.form.selectedGroups = Dictionary.toDictionary2(activityGroupsResponse.groups, x => x.groupId, x => true);\n this.$scope.selectedGroupTypes = Dictionary.toDictionary2(activityGroupsResponse.groups, x => x.groupTypeId, x => true);\n }\n\n if (activityEmployeesResponse) {\n this.$scope.form.selectedEmployees = Dictionary.toDictionary2(activityEmployeesResponse.employees, x => x.employeeId, x => true);\n }\n\n this.$scope.availableEmployees = employeesResponse.employees;\n }).finally(() => this.$scope.isLoading = false);\n }\n\n private createForm(planning: ActivityPlanning, activity: Activity): IForm {\n\n let name = activity?.name;\n let description = activity?.description;\n let maximumGroupSize = activity?.groupSize;\n let startTime = moment().format('HH:00');\n let endTime = moment().add(1, 'hour').format('HH:00');\n let place = '';\n\n if (planning) {\n name = planning.name;\n startTime = moment(planning.start).format('HH:mm');\n endTime = moment(planning.end).format('HH:mm');\n place = planning.place;\n maximumGroupSize = planning.maximumGroupSize;\n description = planning.description;\n }\n\n return {\n name,\n description,\n maximumGroupSize,\n startTime: startTime,\n endTime: endTime,\n place,\n isIntern: true,\n periodicOrSeries: 'periodic',\n selectedGroups: new Dictionary(),\n selectedEmployees: new Dictionary(),\n };\n }\n\n private async onSelectChildrenClicked(): Promise {\n const date = this.$scope.date;\n const selectedGroups = this.$scope.form.selectedGroups.filter(kvp => kvp.value).map(x => x.key);\n const startTime = moment.duration(moment(this.$scope.form.startTime).format('HH:mm'));\n const endTime = moment.duration(moment(this.$scope.form.endTime).format('HH:mm'));\n\n const { children } = await this.dataService.getActivityChildrenForGroups(selectedGroups, date, startTime, endTime);\n if (this.planning?.enrolledChildren != null) {\n this.selectedChildren = children.filter(x => this.planning.enrolledChildren.includes(x.childId));\n }\n\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/travel/child-picker.html?v=' + ft.randomNumber,\n controller: 'ChildPickerController',\n backdrop: true,\n size: 'sm',\n keyboard: true,\n resolve: {\n children: () => children,\n selectedChildren: () => this.selectedChildren,\n moments: () => []\n }\n }).result.then((selected: Child[]) => {\n this.selectedChildren = selected;\n });\n }\n\n private validate(form: IForm): Dictionary {\n const errors = new Dictionary();\n\n if (!form.name) {\n errors.add('name', this.$translate.instant('ACTIVITY.ERRORS.NAME'));\n }\n if (this.locationHasKiosk && (!form.selectedGroups || form.selectedGroups.length() === 0)) {\n errors.add('selectedGroups', this.$translate.instant('ACTIVITY.ERRORS.GROUPS'));\n }\n if (!form.selectedEmployees || form.selectedEmployees.length() === 0) {\n errors.add('selectedEmployees', this.$translate.instant('ACTIVITY.ERRORS.EMPLOYEES'));\n }\n if (!form.startTime || moment(form.startTime).diff(moment(), 'day') < 0) {\n errors.add('startTime', this.$translate.instant('ACTIVITY.ERRORS.STARTTIME'));\n }\n if (!form.endTime || moment(form.endTime).diff(moment(form.startTime), 'day') < 0) {\n errors.add('endTime', this.$translate.instant('ACTIVITY.ERRORS.ENDTIME'));\n }\n if (!form.maximumGroupSize || form.maximumGroupSize <= 0) {\n errors.add('maximumGroupSize', this.$translate.instant('ACTIVITY.ERRORS.GROUPSIZE'));\n }\n if (form.repeatUntil && moment(form.repeatUntil).diff(moment(), 'day') < 0) {\n errors.add('repeatUntil', this.$translate.instant('ACTIVITY.ERRORS.REPEATUNTIL'));\n }\n\n return errors;\n }\n\n private createCommand(): CreateOrUpdateActivityPlanningCommand {\n\n const selectedGroups = this.$scope.form.selectedGroups.filter(kvp => kvp.value).map(x => x.key);\n const selectedEmployees = this.$scope.form.selectedEmployees.filter(kvp => kvp.value).map(x => x.key);\n\n return {\n activityPlanningId: this.planning ? this.planning.activityPlanningId : undefined,\n activityId: this.activity?.activityId,\n groupIds: selectedGroups,\n employeeIds: selectedEmployees,\n childIds: this.selectedChildren?.map(x => x.childId),\n name: this.$scope.form.name,\n description: this.$scope.form.description,\n date: this.$scope.date.format('DD/MM/YYYY'),\n isIntern: this.$scope.form.isIntern,\n locationId: this.locationId,\n maximumGroupSize: this.$scope.form.maximumGroupSize,\n place: this.$scope.form.place,\n from: moment(this.$scope.form.startTime).format('HH:mm'),\n till: moment(this.$scope.form.endTime).format('HH:mm')\n };\n }\n\n private async delete() {\n if (this.planning?.activityPlanningId == null) {\n return;\n }\n\n this.$scope.isLoading = true;\n await this.dataService.deleteActivity(this.planning.activityPlanningId);\n\n this.$uibModalInstance.close();\n }\n\n private async save() {\n\n this.$scope.errors = this.validate(this.$scope.form);\n if (this.$scope.errors.length() > 0) {\n return;\n }\n\n this.$scope.isLoading = true;\n const command = this.createCommand();\n const newPlanningId = (await this.dataService.saveActivity(command, command.activityPlanningId)) || command.activityPlanningId;\n\n if (this.$scope.form.repeatUntil) {\n if (this.$scope.form.periodicOrSeries === 'periodic') {\n await this.dataService.setActivityToPeriodic(newPlanningId, this.$scope.form.repeatUntil);\n } else if (this.$scope.form.periodicOrSeries === 'serie') {\n await this.dataService.setActivityToSeries(newPlanningId, this.$scope.form.repeatUntil);\n }\n }\n\n this.$uibModalInstance.close();\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n\n private filteredGroups() {\n\n const selectedGroupTypes = this.$scope.selectedGroupTypes;\n const selected = Object.keys(selectedGroupTypes);\n\n if (!selected.some(x => selectedGroupTypes[x])) {\n return this.$scope.availableGroups;\n }\n\n return this.$scope.availableGroups.filter(x => selectedGroupTypes[x.groupTypeId]);\n }\n}\n\nappModule.controller('kpEditActivityController', EditActivityController);\n","import { IController, IScope } from 'angular';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { appModule } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\n\ninterface ILocalScope extends IScope {\n isLoading: boolean;\n type: string;\n id: string;\n name: string;\n file: File;\n imageContent: string;\n\n save(): void;\n cancel(): void;\n readFile(): void;\n}\n\nclass AvatarUploadModalController implements IController {\n static $inject = ['$uibModalInstance', '$scope', 'AppDataService', 'type', 'id', 'name'];\n\n constructor(private $uibModalInstance: IModalInstanceService,\n private $scope: ILocalScope,\n private dataService: AppDataService,\n type: string,\n id: string,\n name: string) {\n\n $scope.isLoading = false;\n $scope.type = type;\n $scope.id = id;\n $scope.name = name;\n\n this.loadScopeFunctions();\n }\n\n loadScopeFunctions() {\n const $scope = this.$scope;\n\n $scope.readFile = () => {\n var reader = new FileReader();\n reader.onload = () => {\n $scope.$apply(() => {\n $scope.imageContent = reader.result as string;\n });\n };\n reader.readAsDataURL($scope.file);\n };\n\n $scope.save = () => {\n $scope.isLoading = true;\n this.dataService\n .saveProfileImage({ type: $scope.type, id: $scope.id, content: $scope.imageContent })\n .then(() => {\n this.$uibModalInstance.close('saved');\n })\n .finally(() => {\n this.$uibModalInstance.close('failed');\n });\n };\n\n $scope.cancel = () => {\n this.$uibModalInstance.dismiss();\n };\n }\n}\n\nappModule.controller('kpAvatarUploadModalController', AvatarUploadModalController);\n","import { AlbumsController } from './albums';\nimport { appModule, ft } from '@/definitions';\nimport ng, { IController } from 'angular';\nimport { ChildCare } from '@/data-models';\n\nclass LocationManagerAlbumsController extends AlbumsController implements IController {\n private locations: ChildCare.Definitions.GroupApp.WriteLocation[];\n private caretypes: ChildCare.Definitions.GroupApp.WriteLocationCareType[];\n\n public async $onInit() {\n const response = await this.dataService.getWriteLocations();\n\n this.locations = response.locations;\n this.caretypes = response.careTypes;\n }\n\n protected openUploadMediaModal() {\n const instance = this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/locationmanager/album-model.html?v=' + ft.randomNumber,\n size: 'lg',\n backdrop: true,\n keyboard: true,\n controller: 'kpLocationManagerAlbumsModalController',\n resolve: {\n locations: () => ng.copy(this.locations),\n caretypes: () => ng.copy(this.caretypes)\n },\n });\n\n instance.result.then(() => {\n this.refreshMediaAlbums();\n });\n }\n}\n\nappModule.controller('kpLocationManagerAlbumsController', LocationManagerAlbumsController);","import swal from 'bootstrap-sweetalert';\nimport { appModule } from '@/definitions';\nimport { IScope, IController } from 'angular';\nimport Dropzone, { DropzoneFile } from 'dropzone';\nimport { IFortyTwoDropzoneRootScopeService } from '@/directives/dropzone';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\n\ntype WriteLocation = ChildCare.Definitions.GroupApp.WriteLocation;\ntype WriteLocationCareType = ChildCare.Definitions.GroupApp.WriteLocationCareType;\n\ninterface Scope extends IScope {\n validation: { [field: string]: string };\n isLoading: boolean;\n locations: WriteLocation[];\n caretypes: WriteLocationCareType[];\n albumName: string;\n albumDescription: string;\n dropzoneConfig: {\n options: Dropzone.DropzoneOptions;\n eventHandlers: any;\n };\n\n uploadMedia: () => void;\n cancel: () => void;\n canUpload: () => boolean;\n\n isAllSelected: () => boolean;\n toggleAll: () => void;\n\n isLocationSelected: (location: WriteLocation) => boolean;\n toggleLocation: (location: WriteLocation) => void;\n\n isCareTypeSelected: (careType: WriteLocationCareType) => boolean;\n toggleCareType: (careType: WriteLocationCareType) => void;\n}\n\nclass LocationManagerAlbumsModalController implements IController {\n public static readonly $inject = ['$rootScope', '$scope', '$uibModalInstance', 'locations', 'caretypes', 'AppDataService', '$translate', '$localStorage'];\n\n private readonly $rootScope: IFortyTwoDropzoneRootScopeService;\n private readonly $scope: Scope;\n private readonly $uibModalInstance: IModalInstanceService;\n private readonly dataService: AppDataService;\n private readonly $translate: any;\n private readonly $localStorage: any;\n\n private readonly selectedLocations = new Array();\n private readonly selectedCareTypes = new Array();\n private uploadSucceeded: boolean;\n\n constructor($rootScope: IFortyTwoDropzoneRootScopeService, $scope: Scope, $uibModalInstance: IModalInstanceService, locations: ChildCare.Definitions.GroupApp.WriteLocation[], caretypes: ChildCare.Definitions.GroupApp.WriteLocationCareType[], dataService: AppDataService, $translate, $localStorage) {\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$uibModalInstance = $uibModalInstance;\n this.dataService = dataService;\n this.$translate = $translate;\n this.$localStorage = $localStorage;\n\n this.$scope.locations = locations;\n this.$scope.caretypes = caretypes;\n\n this.selectedLocations.push(...locations);\n this.selectedCareTypes.push(...caretypes);\n\n this.queuecomplete = this.queuecomplete.bind(this);\n this.error = this.error.bind(this);\n\n this.$scope.cancel = this.cancel.bind(this);\n this.$scope.canUpload = this.canUpload.bind(this);\n\n this.$scope.isAllSelected = this.isAllSelected.bind(this);\n this.$scope.toggleAll = this.toggleAll.bind(this);\n this.$scope.isLocationSelected = this.isLocationSelected.bind(this);\n this.$scope.toggleLocation = this.toggleLocation.bind(this);\n this.$scope.isCareTypeSelected = this.isCareTypeSelected.bind(this);\n this.$scope.toggleCareType = this.toggleCareType.bind(this);\n\n this.$scope.uploadMedia = this.uploadMedia.bind(this);\n\n this.$scope.validation = {};\n\n this.$scope.dropzoneConfig = this.createDropzoneConfig();\n }\n\n private createDropzoneConfig(): Scope['dropzoneConfig'] {\n return {\n options: {\n url: (files: ReadonlyArray) => {\n const mimeType = files[0].type;\n if (mimeType.startsWith('video')) {\n return this.$rootScope.configuration.services.media + '/videos';\n } else {\n return this.$rootScope.configuration.services.media + '/images';\n }\n },\n parallelUploads: 4,\n timeout: 1000 * 60 * 20,\n acceptedFiles: 'image/*,video/mp4,video/quicktime,video/x-msvideo,video/x-ms-wmv',\n addRemoveLinks: true,\n autoProcessQueue: false,\n headers: {\n 'Authorization': `Bearer ${this.$localStorage.refreshToken}`\n }\n },\n eventHandlers: {\n queuecomplete: this.queuecomplete,\n success: () => {\n if (this.$rootScope.dropzone.getQueuedFiles().length > 0) {\n this.$rootScope.dropzone.processQueue();\n }\n this.uploadSucceeded = this.$rootScope.dropzone.getQueuedFiles().length === 0;\n },\n error: this.error,\n addedfile: () => this.$scope.$apply(),\n addedfiles: () => this.$scope.$apply(),\n removedfile: () => this.$scope.$apply()\n }\n };\n }\n\n private isAllSelected(): boolean {\n return this.$scope.locations.every(location => this.selectedLocations.includes(location));\n }\n\n private toggleAll(): void {\n const nextState = !this.isAllSelected();\n\n this.selectedLocations.length = 0;\n if (nextState) {\n this.selectedLocations.push(...this.$scope.locations);\n }\n }\n\n private isLocationSelected(location: WriteLocation): boolean {\n return this.selectedLocations.includes(location);\n }\n\n private toggleLocation(location: WriteLocation): void {\n const index = this.selectedLocations.indexOf(location);\n if (index >= 0) {\n this.selectedLocations.splice(index, 1);\n } else {\n this.selectedLocations.push(location);\n }\n }\n\n private isCareTypeSelected(careType: WriteLocationCareType): boolean {\n return this.selectedCareTypes.includes(careType);\n }\n\n private toggleCareType(careType: WriteLocationCareType): void {\n const index = this.selectedCareTypes.indexOf(careType);\n if (index >= 0) {\n this.selectedCareTypes.splice(index, 1);\n } else {\n this.selectedCareTypes.push(careType);\n }\n }\n\n private queuecomplete(): void {\n if (this.uploadSucceeded) {\n this.$uibModalInstance.dismiss();\n\n swal({\n title: 'Opgeslagen!',\n text: 'Alle media is succesvol opgeslagen!',\n timer: 2000,\n type: 'success'\n });\n }\n }\n\n private error(): void {\n this.$uibModalInstance.dismiss();\n\n swal({\n title: this.$translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: this.$translate.instant('MEDIA.ERROR.UPLOAD-FAILED'),\n timer: 2500,\n type: 'error'\n });\n }\n\n private showNoAudiences(): void {\n swal({\n title: this.$translate.instant('ERRORS.SAVE-FAILED.TITLE'),\n text: this.$translate.instant('MEDIA.ERROR.NO-AUDIENCES'),\n timer: 2500,\n type: 'error'\n });\n }\n\n private canUpload(): boolean {\n if (this.$scope.isLoading) {\n return false;\n }\n\n return true;\n }\n\n private validate(): boolean {\n this.$scope.validation = {};\n\n if (this.$rootScope.dropzone.files.length === 0) {\n this.$scope.validation['filesSelection'] = 'MEDIA.ERROR.NO-FILES-SELECTED';\n }\n\n if (this.selectedCareTypes.length === 0) {\n this.$scope.validation['careTypesSelection'] = 'MEDIA.ERROR.NO-CARETYPES-SELECTED';\n }\n\n if (this.selectedLocations.length === 0) {\n this.$scope.validation['locationsSelection'] = 'MEDIA.ERROR.NO-LOCATIONS-SELECTED';\n }\n\n if (this.$scope.albumName == null || this.$scope.albumName.trim() === '') {\n this.$scope.validation['albumName'] = 'MEDIA.ERROR.ALBUM-NAME-EMPTY';\n }\n\n return Object.keys(this.$scope.validation).length === 0;\n }\n\n private async uploadMedia(): Promise {\n if (!this.validate() || !this.canUpload()) {\n return;\n }\n\n this.$scope.isLoading = true;\n\n const response = await this.dataService.getAudiences(this.selectedLocations, this.selectedCareTypes);\n if (response.audiences.length === 0) {\n this.showNoAudiences();\n this.$scope.isLoading = false;\n return;\n }\n\n const result = await this.dataService.addAlbumAsync(this.$scope.albumName, this.$scope.albumDescription);\n\n (this.$rootScope.dropzone as any).options.params = {\n audiences: response.audiences.map(x => x.id),\n albumId: result.id\n };\n\n this.$rootScope.dropzone.processQueue();\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n}\n\nappModule.controller('kpLocationManagerAlbumsModalController', LocationManagerAlbumsModalController);\n","import { appModule, app, ft } from '@/definitions';\nimport { IController, IScope, IPromise } from 'angular';\nimport { ILoadingBar } from '@/models';\nimport { IModalService } from 'angular-ui-bootstrap';\nimport moment from 'moment';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport { FortyTwoLoginService, FortyTwoRootScopeService } from '@/FortyTwoFramework';\nimport ng from 'angular';\nimport { IStateParamsService } from 'angular-ui-router';\n\ntype WriteLocationsResponse = ChildCare.Definitions.GroupApp.WriteLocationsResponse;\ntype WriteLocation = ChildCare.Definitions.GroupApp.WriteLocation;\ntype WriteLocationCareType = ChildCare.Definitions.GroupApp.WriteLocationCareType;\ntype PostComment = ChildCare.Definitions.GroupApp.PostComment;\ntype PostResponse = ChildCare.Definitions.GroupApp.PostResponse;\ntype PostsResponseItem = ChildCare.Definitions.GroupApp.PostsResponseItem;\ntype PostsResponse = ChildCare.Definitions.GroupApp.PostsResponse;\n\ninterface Scope extends IScope {\n fetchingMessages: boolean;\n isLoading: boolean;\n conversations: PostsResponseItem[];\n messageLimit: number;\n messageListView: boolean;\n selectedConversation: PostResponse;\n replyComment: PostComment;\n message: string;\n sendNotification: boolean;\n hideInternalFilter: boolean;\n\n audiences: WriteLocation[];\n caretypes: WriteLocationCareType[];\n\n getReplyedAs(comment: any): any;\n showMoreMessages(): void;\n loadPost(selectedConversation: any);\n answerComment(comment: ChildCare.Definitions.GroupApp.PostComment): void;\n backToListView(): void;\n sendMessage(event: any, message: any): void;\n openNewConversationModal(): void;\n getAvatarInitials(fullName: string): string;\n}\n\nclass LocationManagerConversationController implements IController {\n\n private lastFetchDate: string;\n private childId: string;\n private $rootScope: FortyTwoRootScopeService;\n private $scope: Scope;\n private $q: ng.IQService;\n private dataService: AppDataService;\n private $uibModal: IModalService;\n private $stateParams;\n private $interval: ng.IIntervalService;\n private loadingBar: ILoadingBar;\n private $translate;\n\n private unsubscribeOnNewPostMade: () => void;\n\n public static $inject = ['$rootScope', '$scope', '$q', 'AppDataService', '$uibModal', '$stateParams', '$interval', 'LoadingBar', '$translate'];\n constructor($rootScope: FortyTwoRootScopeService, $scope: Scope, $q: ng.IQService, dataService: AppDataService, $uibModal: IModalService, $stateParams: IStateParamsService, $interval: ng.IIntervalService, loadingBar: ILoadingBar, $translate) {\n\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$q = $q;\n this.dataService = dataService;\n this.$uibModal = $uibModal;\n this.$stateParams = $stateParams;\n this.$interval = $interval;\n this.loadingBar = loadingBar;\n this.$translate = $translate;\n\n this.handleGetMessages = this.handleGetMessages.bind(this);\n\n this.lastFetchDate = null;\n this.childId = this.$stateParams.id;\n\n this.initializeScope();\n\n this.getData();\n }\n\n private initializeScope() {\n this.$scope.getAvatarInitials = this.getAvatarInitials.bind(this);\n this.$scope.showMoreMessages = this.showMoreMessages.bind(this);\n this.$scope.loadPost = this.loadPost.bind(this);\n this.$scope.answerComment = this.answerComment.bind(this);\n this.$scope.backToListView = this.backToListView.bind(this);\n this.$scope.sendMessage = this.sendMessage.bind(this);\n this.$scope.openNewConversationModal = this.openNewConversationModal.bind(this);\n this.$scope.getReplyedAs = this.getReplyedAs.bind(this);\n\n this.$scope.fetchingMessages = false;\n this.$scope.isLoading = false;\n this.$scope.conversations = [];\n this.$scope.messageLimit = app.settings.conversations.fetchRange;\n this.$scope.messageListView = true;\n this.$scope.message = '';\n\n this.$scope.audiences = [];\n this.$scope.caretypes = [];\n\n this.$scope.hideInternalFilter = true;\n\n this.$scope.$watch('isLoading', (newVal: boolean) => this.loadingBar.show = newVal);\n\n this.unsubscribeOnNewPostMade = this.$rootScope.$on('newPostMade', (_event, sendNotification: boolean) => {\n this.$scope.sendNotification = sendNotification;\n this.refreshConversations();\n });\n\n const newPostInterval = this.$interval(() => {\n this.$rootScope.$broadcast('newPostMade', true);\n }, 1000 * 30);\n\n this.$scope.$on('$destroy', () => {\n this.$interval.cancel(newPostInterval);\n\n if (this.unsubscribeOnNewPostMade != null) {\n this.unsubscribeOnNewPostMade();\n this.unsubscribeOnNewPostMade = null;\n }\n });\n }\n\n private getReplyedAs(comment: PostComment): PostComment {\n return this.$scope.selectedConversation.comments.find(x => x.commentId == comment.replyToCommentId);\n }\n\n private refreshConversations(): void {\n this.$scope.isLoading = true;\n this.getMessagesAsync(false)\n .then(results => this.handleGetMessages(results))\n .finally(() => this.$scope.isLoading = false);\n }\n\n private showMoreMessages(): void {\n // Don't do the call if it's already fetching, or there could not possibly be a new message because it didn't\n // fetch the settings amount of items from the last call\n if (this.$scope.fetchingMessages || this.$scope.messageLimit >= (this.$scope.conversations.length + app.settings.conversations.fetchRange)) {\n return;\n }\n\n this.$scope.isLoading = true;\n this.$scope.fetchingMessages = true;\n\n this.getMessagesAsync(true)\n .then(response => this.addConversationsToList(response))\n .finally(() => {\n this.$scope.messageLimit += app.settings.conversations.fetchRange;\n this.$scope.isLoading = false;\n this.$scope.fetchingMessages = false;\n });\n }\n\n private loadPost(conversation: PostResponse): void {\n this.$scope.messageListView = false;\n this.$scope.selectedConversation = conversation;\n\n this.$scope.isLoading = true;\n this.dataService.getPost(conversation).then((post) => {\n this.$scope.selectedConversation = post;\n this.$scope.selectedConversation.createdOn = conversation.createdOn;\n }).finally(() => {\n this.$scope.isLoading = false;\n //this.markAsRead(conversation);\n });\n }\n\n private getAvatarInitials(fullName: string): string {\n let matches = fullName.match(/\\b(\\w)/g);\n if (matches.length < 2) {\n return fullName.slice(0, 2).toUpperCase();\n }\n\n matches = matches.slice(0, 2);\n return matches.join('').toUpperCase();\n }\n\n private answerComment(comment: PostComment) {\n this.$scope.replyComment = comment;\n }\n\n private sendMessage(event, message: string) {\n if (message == null || message === '' || this.$scope.isLoading) {\n return;\n }\n\n this.$scope.message = message;\n\n this.$scope.isLoading = true;\n\n this.dataService.answerToPostAsync(this.$scope.selectedConversation, this.$scope.replyComment, message)\n .then(() => this.handleSaveAnswerToPost())\n .finally(() => {\n this.$scope.isLoading = false;\n this.$scope.replyComment = null;\n event.message = '';\n\n this.$rootScope.$emit('newPostMade', false);\n });\n }\n\n private openNewConversationModal(): void {\n this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/locationmanager/conversation-modal.html?v=' + ft.randomNumber,\n controller: 'kpLocationConversationModalController',\n size: 'lg',\n backdrop: true,\n keyboard: true,\n resolve: {\n audiences: () => ng.copy(this.$scope.audiences),\n caretypes: () => ng.copy(this.$scope.caretypes),\n getAvatarInitials: () => this.getAvatarInitials.bind(this)\n }\n });\n }\n\n private backToListView(): void {\n this.$scope.messageListView = true;\n this.$scope.replyComment = null;\n this.$scope.selectedConversation = null;\n }\n\n private addConversationsToList(results: PostsResponse): void {\n for (const conversation of results.posts) {\n this.$scope.conversations.push(conversation);\n }\n }\n\n private async getData(): Promise {\n this.$scope.isLoading = true;\n\n this.$q.all([\n this.dataService.getWriteLocations(),\n this.getMessagesAsync(false)\n ]).then((results) => {\n this.handleGetAudiences(results[0]);\n this.handleGetMessages(results[1]);\n }).finally(() => {\n this.$scope.isLoading = false;\n });\n }\n\n private getMessagesAsync(loadMore: boolean): IPromise {\n const dateTime = moment().utc().format('YYYY-MM-DDTHH-mm-ss');\n if (!this.lastFetchDate) {\n this.lastFetchDate = dateTime;\n return this.dataService.getMessagesAsync(this.lastFetchDate, this.childId);\n }\n\n if (loadMore) {\n const lastConvo = this.$scope.conversations[this.$scope.conversations.length - 1];\n return this.dataService.getMessagesAsync(lastConvo.lastUpdatedUTC, this.childId);\n }\n\n const returnValue = this.dataService.getMessagesSinceAsync(this.lastFetchDate, this.childId);\n this.lastFetchDate = dateTime;\n return returnValue;\n }\n\n private handleGetMessages(results: PostsResponse): void {\n if (!results.posts) {\n results = results[0];\n }\n\n if (this.$scope.conversations.length === 0) {\n this.$scope.conversations = results.posts;\n } else {\n const posts = results.posts;\n\n if (posts.length === 0) {\n return;\n }\n\n if (this.$scope.selectedConversation != null) {\n this.$scope.sendNotification = false;\n this.$scope.loadPost(this.$scope.selectedConversation);\n }\n\n // Send a notification that there are new messages\n if (this.$scope.sendNotification) {\n this.$rootScope.$broadcast('ft-notifications-add', {\n title: this.$translate.instant('MESSAGES.NEW-MESSAGES'),\n message: this.$translate.instant('MESSAGES.NEW-MESSAGES-MESSAGE', { count: posts.length })\n });\n }\n\n for (const post of posts) {\n const postExists = this.$scope.conversations.find(x => x.postId == post.postId);\n\n if (this.$scope.sendNotification) {\n (post as any).read = false;\n }\n\n if (postExists) {\n const index = this.$scope.conversations.indexOf(postExists);\n this.$scope.conversations[index] = post;\n } else {\n this.$scope.conversations.push(post);\n }\n }\n }\n }\n\n private handleGetAudiences(results: WriteLocationsResponse): void {\n this.$scope.audiences = results.locations;\n this.$scope.caretypes = results.careTypes;\n }\n\n private markAsRead(conversation: PostsResponseItem) {\n const index = this.$scope.conversations.indexOf(conversation);\n (conversation as any).read = true;\n\n this.$scope.conversations[index] = conversation;\n }\n\n private handleSaveAnswerToPost(): void {\n this.$scope.loadPost(this.$scope.selectedConversation);\n }\n}\n\nappModule.controller('kpLocationManagerConversationController', LocationManagerConversationController);","import swal from 'bootstrap-sweetalert';\nimport { appModule } from '@/definitions';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { IController, IScope } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ChildCare } from '@/data-models';\nimport { FortyTwoRootScopeService } from '@/FortyTwoFramework';\n\nimport WriteLocation = ChildCare.Definitions.GroupApp.WriteLocation;\nimport WriteLocationCareType = ChildCare.Definitions.GroupApp.WriteLocationCareType;\n\ninterface Message {\n title?: string;\n content?: string;\n}\n\ninterface ILocalScope extends IScope {\n audiences: WriteLocation[];\n caretypes: WriteLocationCareType[];\n selectedAudiences: WriteLocation[];\n selectedCareTypes: WriteLocationCareType[];\n message: Message;\n isLoading: boolean;\n\n cancel(): void;\n hasValidTitle(): boolean;\n hasValidMessage(): boolean;\n isValid(): boolean;\n isAllSelected(): boolean;\n isAudienceSelected(audience: WriteLocation): boolean;\n isCareTypeSelected(caretype: WriteLocationCareType): boolean;\n toggleSelectAllAudiences(): void;\n toggleSelectAudience(audience: WriteLocation): void;\n toggleSelectCareType(caretype: WriteLocationCareType): void;\n selectAudience(index: number): void;\n saveConversation(): void;\n getAvatarInitials(fullName: string): string;\n}\n\nclass LocationConversationModalController implements IController {\n\n private $rootScope: FortyTwoRootScopeService;\n private $scope: ILocalScope;\n private $uibModalInstance: IModalInstanceService;\n private dataService: AppDataService;\n private $translate;\n\n public static $inject = ['$rootScope', '$scope', '$uibModalInstance', 'audiences', 'caretypes', 'AppDataService', '$translate', 'getAvatarInitials'];\n\n public constructor($rootScope: FortyTwoRootScopeService, $scope: ILocalScope, $uibModalInstance: IModalInstanceService, audiences: WriteLocation[], caretypes: WriteLocationCareType[], dataService: AppDataService, $translate, getAvatarInitials: (fullName: string) => string) {\n\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$uibModalInstance = $uibModalInstance;\n this.dataService = dataService;\n this.$translate = $translate;\n\n this.$scope.audiences = audiences;\n this.$scope.caretypes = caretypes;\n\n this.$scope.getAvatarInitials = getAvatarInitials;\n this.$scope.cancel = this.cancel.bind(this);\n this.$scope.toggleSelectAllAudiences = this.toggleSelectAllAudiences.bind(this);\n this.$scope.toggleSelectAudience = this.toggleSelectAudience.bind(this);\n this.$scope.toggleSelectCareType = this.toggleSelectCareType.bind(this);\n this.$scope.saveConversation = this.saveConversation.bind(this);\n this.$scope.hasValidTitle = this.hasValidTitle.bind(this);\n this.$scope.hasValidMessage = this.hasValidMessage.bind(this);\n this.$scope.isValid = this.isValid.bind(this);\n this.$scope.isAllSelected = this.isAllSelected.bind(this);\n this.$scope.isAudienceSelected = this.isAudienceSelected.bind(this);\n this.$scope.isCareTypeSelected = this.isCareTypeSelected.bind(this);\n\n this.initializeForm();\n }\n\n private initializeForm() {\n this.$scope.selectedAudiences = [...this.$scope.audiences];\n this.$scope.selectedCareTypes = [...this.$scope.caretypes];\n this.$scope.message = {\n title: '',\n content: ''\n };\n this.$scope.isLoading = false;\n }\n\n private cancel() {\n this.$uibModalInstance.dismiss();\n }\n\n private toggleSelectAllAudiences() {\n if (this.isAllSelected()) {\n this.$scope.selectedAudiences = [];\n } else {\n this.$scope.selectedAudiences = [...this.$scope.audiences];\n }\n }\n\n private isAllSelected(): boolean {\n return this.$scope.selectedAudiences.length === this.$scope.audiences.length;\n }\n\n private isAudienceSelected(audience: WriteLocation): boolean {\n return this.$scope.selectedAudiences.some(x => x.id === audience.id);\n }\n\n private isCareTypeSelected(caretype: WriteLocationCareType): boolean {\n return this.$scope.selectedCareTypes.some(x => x.careType === caretype.careType);\n }\n\n private toggleSelectAudience(audience: WriteLocation) {\n this.toggleItem(audience, this.$scope.selectedAudiences, (x, y) => x.id === y.id);\n }\n\n private toggleSelectCareType(caretype: WriteLocationCareType): void {\n this.toggleItem(caretype, this.$scope.selectedCareTypes, (x, y) => x.careType === y.careType);\n }\n\n private toggleItem(target: T, collection: T[], isEqual: (item1: T, item2: T) => boolean): void {\n const index = collection.findIndex(x => isEqual(x, target));\n if (index > -1) {\n collection.splice(index, 1);\n } else {\n collection.push(target);\n }\n }\n\n private hasValidTitle(): boolean {\n return this.$scope.message.title != null && this.$scope.message.title.length > 0;\n }\n\n private hasValidMessage(): boolean {\n return this.$scope.message.content != null && this.$scope.message.content.length > 0;\n\n }\n\n private isValid(): boolean {\n if (!this.hasValidTitle() || !this.hasValidMessage()) {\n return false;\n }\n\n if (this.$scope.selectedCareTypes.length === 0) {\n return false;\n }\n\n if (this.$scope.selectedAudiences.length === 0) {\n return false;\n }\n\n return true;\n }\n\n private dismiss() {\n this.initializeForm();\n this.$uibModalInstance.dismiss();\n }\n\n private saveConversation() {\n if (this.$scope.isLoading || !this.isValid()) {\n return;\n }\n\n this.$scope.isLoading = true;\n\n const selectedAudienceIds = this.$scope.selectedAudiences.map(x => x.id);\n const selectedCareTypeNames = this.$scope.selectedCareTypes.map(x => x.careType);\n\n this.dataService.saveLocationConversation(this.$scope.message, selectedAudienceIds, selectedCareTypeNames)\n .then(() => this.handleSaveConversation(), () => this.handleSaveConversationError())\n .finally(() => this.$scope.isLoading = false);\n }\n\n private handleSaveConversation() {\n this.$rootScope.$emit('newPostMade', false);\n this.dismiss();\n\n swal({\n title: this.$translate.instant('MESSAGES.CONVERSATION-SAVE-OK-TITLE'),\n text: this.$translate.instant('MESSAGES.CONVERSATION-SAVE-OK-MESSAGE'),\n timer: 2000,\n type: 'success'\n });\n }\n\n private handleSaveConversationError() {\n this.dismiss();\n\n swal({\n title: this.$translate.instant('MESSAGES.CONVERSATION-SAVE-ERROR-TITLE'),\n text: this.$translate.instant('MESSAGES.CONVERSATION-SAVE-ERROR-MESSAGE'),\n timer: 2500,\n type: 'error'\n });\n }\n}\n\nappModule.controller('kpLocationConversationModalController', LocationConversationModalController);","import { IController, IScope, ITimeoutService, IFilterService } from 'angular';\nimport { appModule, ft } from '@/definitions';\nimport { AppDataService } from '@/services/app-data-service';\nimport { ftSettingsService, FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { ILoadingBar } from '@/models';\nimport { RoleChecker } from '@/role-checker';\nimport {IStateService} from 'angular-ui-router';\nimport {Story} from '@/stories/types';\nimport { loadOptions } from '@babel/core';\n\ninterface Scope extends IScope {\n navigateToGroups: any;\n group: string;\n stories: Story[];\n tableSorting: any;\n\n openStory(story: Story);\n previewStory(story: Story);\n newStoryModal();\n cancel: () => void;\n\n previewMode: boolean;\n previewUrl: string;\n\n endPreview: () => void;\n selectedText: string;\n searchText: any;\n}\n\nclass StoriesListController implements IController {\n private $scope: Scope;\n private dataService: AppDataService;\n private settingsService: ftSettingsService;\n private loadingBar: ILoadingBar;\n private $state: IStateService;\n private ngTableParams: any;\n private $filter: IFilterService;\n private $uibModal: any;\n\n public static $inject = ['$scope', '$timeout', '$state', 'AppDataService', '$uibModal', 'ftSettingService', 'LoadingBar', 'ngTableParams', '$filter', RoleChecker.serviceName, 'ftLoginService', '$document'];\n constructor($scope: Scope, $timeout: ITimeoutService, $state: IStateService, dataService: AppDataService, $uibModal, settingsService: ftSettingsService, loadingBar: ILoadingBar, ngTableParams: any, $filter: IFilterService, roleCheckerService: RoleChecker, loginService: FortyTwoLoginService, $document) {\n this.$scope = $scope;\n this.dataService = dataService;\n this.settingsService = settingsService;\n this.loadingBar = loadingBar;\n this.$state = $state;\n this.ngTableParams = ngTableParams;\n this.$filter = $filter;\n this.$uibModal = $uibModal;\n this.$scope.previewMode = false;\n this.$scope.previewUrl = '';\n this.$scope.previewStory = this.previewStory.bind(this);\n this.$scope.endPreview = this.endPreview.bind(this);\n this.$scope.selectedText = '';\n this.$scope.searchText = {};\n\n loginService.getCurrentUserAsync().then(user => {\n this.$scope.group = user.name;\n });\n\n this.$scope.navigateToGroups = roleCheckerService.switchGroup;\n this.$scope.openStory = this.openStory.bind(this);\n this.$scope.newStoryModal = this.newStoryModal.bind(this);\n\n $timeout(this.load.bind(this), 200);\n }\n\n private async load(): Promise {\n const groupId = this.settingsService.get(window.appSettings.group.selected);\n this.loadingBar.show = true;\n\n try {\n this.$scope.stories = await this.dataService.getStories(groupId);\n } catch (error) {\n console.error('fetching stories failed');\n console.error(error);\n } finally {\n this.loadingBar.show = false;\n }\n\n this.$scope.tableSorting = new this.ngTableParams({ count: 10 }, {\n total: this.$scope.stories.length,\n getData: ($defer, params) => {\n const orderedData = params.sorting() ? this.$filter('orderBy')(this.$scope.stories, params.orderBy()) : this.$scope.stories;\n $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));\n\n // set total for recalc pagination\n params.total(this.$scope.stories.length);\n }\n });\n }\n\n private async openStory(story: Story) {\n this.$state.go('app.story-details', { id: story.id });\n }\n\n private async newStoryModal() {\n const instance = this.$uibModal.open({\n animation: true,\n templateUrl: 'partials/stories/storyNewModal.html?v=' + ft.randomNumber,\n controller: 'kpStoryNewModalController',\n size: 'large',\n backdrop: true,\n keyboard: true,\n resolve: {\n group: () => this.$scope.group\n }\n });\n instance.result.then(async () => {\n await this.load();\n });\n\n \n }\n\n private endPreview(): void {\n this.$scope.previewMode = false;\n }\n\n private async previewStory(story: Story) {\n this.dataService.getStoryPdf(story.id).then(url => {\n this.$scope.previewUrl = url;\n this.$scope.previewMode = true;\n this.$scope.selectedText = story.name; \n });\n }\n}\n\nappModule.controller('StoriesListController', StoriesListController);","export function resizeImage(dataUrl: string, max: number): Promise {\n return new Promise(resolve => {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n const img = new Image();\n img.onload = () => {\n ctx.drawImage(img, 0, 0);\n\n // To preserve the aspect ratio\n const ratioX = max / img.width;\n const ratioY = max / img.height;\n const ratio = Math.min(ratioX, ratioY);\n\n // New width and height based on aspect ratio\n const newWidth = img.width * ratio;\n const newHeight = img.height * ratio;\n\n canvas.width = newWidth;\n canvas.height = newHeight;\n ctx.drawImage(img, 0, 0, newWidth, newHeight);\n\n const dataUrl = canvas.toDataURL('image/jpeg');\n resolve(dataUrl);\n };\n img.src = dataUrl;\n });\n}\n\nexport function toBase64(dataUrl: string): string {\n return dataUrl.replace(/^data:.*?;base64,/, '');\n}","import { AppDataService } from '@/services/app-data-service';\nimport { IStateParamsService, IStateService } from 'angular-ui-router';\nimport { IAugmentedJQuery, IDirective, IPromise, IQService, IScope, ITimeoutService } from 'angular';\nimport { appModule } from '@/definitions';\nimport { isTextContentBlock, isCardContentBlock, isCardLeftBlock, isCardRightBlock, isImagesBlock, isImagesContentBlock, Story, StoryBlock, StoryBlockContent, TextBlock, TextContentBlock, ImagesContentBlock, CardContentBlock } from '@/stories/types';\nimport uuidv1 from 'uuid/v1';\nimport { getEnvironment } from '@/environment';\nimport { resizeImage, toBase64 } from '@/resize-image';\nimport moment from 'moment';\n\nconst emptyGuid = '00000000-0000-0000-0000-000000000000';\n\nclass DateValue {\n value: Date;\n}\ninterface Scope extends IScope {\n emptyGuid;\n\n story: Story;\n\n date: moment.Moment;\n publishOn: DateValue;\n publishOnOrg: Date;\n\n upload(blockId: string, index?: number): void;\n removeImage(block: StoryBlock, index?: number): void;\n\n addImage(block: StoryBlock, index: number, files: FileList): Promise;\n hasImage(block: StoryBlock): boolean;\n hasImageX(block: StoryBlock): boolean;\n hasImageIndex(url: string): boolean;\n hasImageAt(block: StoryBlock, index: number): boolean;\n hasImageXAt(block: StoryBlock, index: number): boolean;\n getImagesClass(block: StoryBlock): string;\n blockChanged(block: StoryBlock): void;\n\n isLoading: boolean;\n save();\n cancel();\n doPublish();\n doUnpublish();\n getFormattedDateString(d: Date): string;\n getChanged(): StoryBlock[];\n blockIsChanged(): boolean;\n orgBlocks: StoryBlock[];\n cancelBlock();\n saveBlock();\n goOverview();\n cancelPublishOn();\n savePublishOnExt();\n hasPublishChange();\n}\n\nclass StoryDetailsController {\n private $scope: Scope;\n private dataService: AppDataService;\n private $state: IStateService;\n private $q: IQService;\n private onRouteChangeOff: any;\n private $timeout: any;\n\n private uibModal: any;\n\n private changed: StoryBlock[] = [];\n\n public static $inject = ['$scope', '$timeout', '$state', '$q', 'AppDataService', '$stateParams', '$uibModal'];\n constructor($scope: Scope, $timeout: ITimeoutService, $state: IStateService, $q: IQService,\n dataService: AppDataService, $stateParams: IStateParamsService) {\n this.$scope = $scope;\n this.dataService = dataService;\n this.$state = $state;\n this.$q = $q;\n this.$timeout = $timeout;\n\n\n this.$scope.upload = this.upload.bind(this);\n this.$scope.removeImage = this.removeImage.bind(this);\n this.$scope.addImage = this.addImage.bind(this);\n this.$scope.hasImage = this.hasImage.bind(this);\n this.$scope.hasImageX = this.hasImageX.bind(this);\n this.$scope.hasImageIndex = this.hasImageIndex.bind(this);\n this.$scope.hasImageAt = this.hasImageAt.bind(this);\n this.$scope.hasImageXAt = this.hasImageXAt.bind(this);\n this.$scope.save = this.save.bind(this);\n this.$scope.cancel = this.cancel.bind(this);\n this.$scope.getImagesClass = this.getImagesClass.bind(this);\n this.$scope.blockChanged = this.blockChanged.bind(this);\n this.$scope.doPublish = this.doPublish.bind(this);\n this.$scope.doUnpublish = this.doUnpublish.bind(this);\n this.$scope.getFormattedDateString = this.getFormattedDateString.bind(this);\n this.$scope.getChanged = this.getChanged.bind(this);\n this.$scope.blockIsChanged = this.blockIsChanged.bind(this);\n this.$scope.cancelBlock = this.cancelBlock.bind(this);\n this.$scope.saveBlock = this.saveBlock.bind(this);\n this.$scope.goOverview = this.goOverview.bind(this);\n this.$scope.savePublishOnExt = this.savePublishOnExt.bind(this);\n this.$scope.cancelPublishOn = this.cancelPublishOn.bind(this);\n this.$scope.hasPublishChange = this.hasPublishChange.bind(this);\n\n $timeout(() => this.loadStory($stateParams.id));\n }\n\n public async $onInit() {\n const checkDirty = function (event: any) {\n\n var sc = event.currentScope as Scope;\n var ch = sc.getChanged();\n if (!sc.hasPublishChange()) {\n if (!ch) {\n return;\n }\n if (ch.length === 0) {\n return;\n }\n }\n\n alert('Er zijn niet opgeslagen veranderingen\\nKies voor \\'Annuleren\\' of \\'Opslaan\\'');\n\n event.preventDefault();\n event.returnValue = '';\n return;\n };\n\n this.onRouteChangeOff = this.$scope.$on('$stateChangeStart', checkDirty);\n\n window.onbeforeunload = (event) => {\n var ch = this.$scope.getChanged();\n\n if (!this.$scope.hasPublishChange()) {\n if (!ch) {\n return;\n }\n if (ch.length === 0) {\n return;\n }\n }\n\n event.preventDefault();\n event.returnValue = '';\n return '';\n };\n }\n\n public async $onDestroy() {\n this.onRouteChangeOff();\n delete window.onbeforeunload;\n }\n\n private getFormattedDateString(d: Date) {\n return moment(d).format('DD-MM-YYYY');\n }\n\n public getChanged(): StoryBlock[] {\n return this.changed;\n }\n\n private doPublish() {\n const d = new Date();\n d.setMilliseconds(0);\n d.setSeconds(0);\n this.$scope.publishOn.value = d;\n }\n\n private doUnpublish() {\n this.$scope.publishOn.value = moment('0001-01-01').toDate();\n }\n\n private removeImage(block: StoryBlock, index?: number) {\n if (isCardContentBlock(block.content)) {\n block.content.imageUrl = getEnvironment().apiUrl.replace('api/', `getPicture.aspx?id=${emptyGuid}`);\n this.blockChanged(block);\n } else if (isImagesContentBlock(block.content)) {\n block.content.imageUrls[index] = getEnvironment().apiUrl.replace('api/', `getPicture.aspx?id=${emptyGuid}`);\n this.blockChanged(block);\n }\n }\n\n private upload(blockId: string, index?: number) {\n\n let selector = `.imageUpload[data-block-id='${blockId}']`;\n if (index != null) {\n selector += `[data-image-index='${index}']`;\n }\n ($(selector).get(0) as HTMLInputElement).value = '';\n $(selector).trigger('click');\n }\n\n private hasImageIndex(url) {\n return url.startsWith('data') || !url.endsWith(emptyGuid);\n }\n\n private hasImage(block: StoryBlock) {\n if (isCardLeftBlock(block) || isCardRightBlock(block)) {\n return block.imageUrl && !block.imageUrl.endsWith(emptyGuid);\n }\n\n return false;\n }\n\n private hasImageX(block: StoryBlock) {\n if (isCardLeftBlock(block) || isCardRightBlock(block)) {\n if (block.imageUrl && block.imageUrl.endsWith(emptyGuid)) {\n return false;\n }\n const thisBlock = (block as unknown) as CardContentBlock;\n return (block.imageUrl && !block.imageUrl.endsWith(emptyGuid)) ||\n (thisBlock.image && thisBlock.image.content);\n }\n\n return false;\n }\n\n private hasImageXAt(block: StoryBlock, index: number): boolean {\n if (isImagesBlock(block)) {\n\n if (block.imageUrls && block.imageUrls.length > 0 && block.imageUrls[index].endsWith(emptyGuid)) {\n return false;\n }\n const thisBlock = (block as unknown) as ImagesContentBlock;\n return (block.imageUrls && block.imageUrls.length > 0 && !block.imageUrls[index].endsWith(emptyGuid)) ||\n (thisBlock.images && thisBlock.images.length > 0 && thisBlock.images[index].content && thisBlock.images[index].content.length > 0);\n }\n\n return false;\n }\n\n private hasImageAt(block: StoryBlock, index: number): boolean {\n if (isImagesBlock(block)) {\n var result = block.imageUrls && block.imageUrls.length > 0 && !block.imageUrls[index].endsWith(emptyGuid);\n if (result) {\n if (block.imageUrls[index].startsWith('data')) {\n return false;\n }\n }\n return result;\n }\n\n return false;\n }\n\n private blockChanged(block: StoryBlock): void {\n if (!this.changed.includes(block)) {\n this.changed.push(block);\n }\n\n }\n\n private canAddImages(block: StoryBlock): boolean {\n return true;\n }\n\n private getImagesClass(block: StoryBlock): string {\n if (isImagesBlock(block)) {\n // if (this.hasImages(block)) {\n // return `images-block-${block.imageUrls.length}`;\n // } else {\n // return `images-block-${block.content['imageUrls']?.length ?? 0}`;\n // }\n return 'images-block-4';\n }\n\n return '';\n }\n\n private async loadStory(storyId: string) {\n this.$scope.isLoading = true;\n\n try {\n this.$scope.story = await this.dataService.getStory(storyId);\n this.$scope.date = this.$scope.story.date;\n\n this.$scope.publishOn = new DateValue();\n this.$scope.publishOn.value = this.$scope.story.publishOn.toDate();\n this.$scope.publishOnOrg = this.$scope.publishOn.value;\n\n for (const block of this.$scope.story.blocks) {\n this.initializeContentBlocks(block);\n }\n this.$scope.orgBlocks = JSON.parse(JSON.stringify(this.$scope.story.blocks));\n\n } catch (error) {\n console.error('fetching story failed');\n console.error(error);\n } finally {\n this.$scope.isLoading = false;\n }\n\n this.$scope.$apply();\n }\n\n private async addImage(block: StoryBlock, index: number, files: FileList): Promise {\n //if (files.length === 0 || this.hasImage(block) || this.hasImages(block)) {\n if (files.length === 0) {\n return;\n }\n\n const file = files[0];\n let content = await this.blobToDataURL(file);\n content = await resizeImage(content, 1024);\n\n if (isCardContentBlock(block.content)) {\n block.content.imageUrl = content;\n this.blockChanged(block);\n } else if (isImagesContentBlock(block.content)) {\n\n block.content.imageUrls[index] = content;\n\n //this.updateImagesBlock(block, index);\n this.blockChanged(block);\n }\n\n this.$scope.$apply();\n }\n\n public blockIsChanged(id: string): boolean {\n if (!this.changed) {\n return false;\n }\n if (this.changed.length === 0) {\n return false;\n }\n return this.changed.some(x => id === x.id);\n }\n\n public cancelBlock(block) {\n const orgBlock = this.$scope.orgBlocks.filter(x => x.id === block.id)[0];\n if (block.blockType === 'text') {\n const orgContent = orgBlock.content as TextContentBlock;\n block.content.title = orgContent.title;\n block.content.text = orgContent.text;\n block.content.optionalVisible = orgContent.optionalVisible;\n\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n } else if (block.blockType === 'images') {\n const orgContent = orgBlock.content as ImagesContentBlock;\n block.content.optionalVisible = orgContent.optionalVisible;\n if (orgContent.images) {\n block.content.images = JSON.parse(JSON.stringify(orgContent.images));\n } else {\n block.content.images = undefined;\n }\n \n block.content.imageUrls = orgContent.imageUrls.slice();\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n } else if (block.blockType === 'cardLeft' || block.blockType === 'cardRight') {\n const orgContent = orgBlock.content as CardContentBlock;\n\n block.content.optionalVisible = orgContent.optionalVisible;\n block.content.title = orgContent.title;\n block.content.text = orgContent.text;\n if (orgContent.image) {\n block.content.image = JSON.parse(JSON.stringify(orgContent.image));\n } else {\n block.content.image = undefined;\n }\n block.content.imageUrl = orgContent.imageUrl;\n\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n } else if (block.blockType === 'presences') {\n const orgContent = orgBlock.content as StoryBlockContent;\n block.content.optionalVisible = orgContent.optionalVisible;\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n }\n }\n\n public saveBlock(block) {\n if (block.blockType === 'text') {\n this.saveTextBlock(block).then(() => {\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n });\n\n } else if (block.blockType === 'images') {\n this.saveImagesBlock(block).then(() => {\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n \n });\n } else if (block.blockType === 'cardLeft' || block.blockType === 'cardRight') {\n this.saveCardBlock(block).then(() => {\n this.changed = this.changed.filter(function( obj ) {\n return obj.id !== block.id;\n });\n });\n }\n }\n\n private savePublishOnExt() {\n if (this.hasPublishChange()) {\n this.$scope.story.publishOn = moment(this.$scope.publishOn.value);\n if (this.$scope.getFormattedDateString(this.$scope.publishOn.value) === '01-01-0001') {\n this.$scope.story.publishOn = moment('0001-01-01 00:19:32');\n }\n this.savePublishOn(this.$scope.story);\n this.$scope.publishOnOrg = this.$scope.publishOn.value;\n }\n }\n\n private hasPublishChange() {\n if (!this.$scope.publishOn) {\n return false;\n }\n return this.$scope.publishOn.value !== this.$scope.publishOnOrg;\n }\n\n private cancelPublishOn() {\n this.$scope.publishOn.value = this.$scope.publishOnOrg;\n }\n\n private save() {\n const tasks = new Array>();\n for (const block of this.changed) {\n tasks.push(this.saveCardBlock(block));\n tasks.push(this.saveImagesBlock(block));\n tasks.push(this.saveTextBlock(block));\n }\n\n if (this.$scope.publishOn.value !== this.$scope.publishOnOrg) {\n this.$scope.story.publishOn = moment(this.$scope.publishOn.value);\n if (this.$scope.getFormattedDateString(this.$scope.publishOn.value) === '01-01-0001') {\n this.$scope.story.publishOn = moment('0001-01-01 00:19:32');\n }\n tasks.push(this.savePublishOn(this.$scope.story));\n }\n\n this.$q.all(tasks).then(() => {\n this.changed = [];\n this.$state.go('app.stories');\n });\n }\n\n private goOverview() {\n this.$state.go('app.stories');\n }\n\n private savePublishOn(story: Story): IPromise {\n return this.dataService.updateStory(story);\n }\n\n private saveTextBlock(block: StoryBlock): IPromise {\n if (!isTextContentBlock(block.content)) {\n return this.$q.resolve();\n }\n return this.dataService.saveContentBlock(this.$scope.story.id, block.id, block.content);\n }\n\n private saveCardBlock(block: StoryBlock): IPromise {\n if (!isCardContentBlock(block.content)) {\n return this.$q.resolve();\n }\n\n const hasNewImage = block.content.imageUrl.startsWith('data');\n block.content.image = {\n url: hasNewImage ? undefined : block.content.imageUrl,\n content: hasNewImage ? toBase64(block.content.imageUrl) : undefined\n };\n //block.content.imageUrl = undefined;\n\n return this.dataService.saveContentBlock(this.$scope.story.id, block.id, block.content);\n }\n\n private saveImagesBlock(block: StoryBlock): IPromise {\n if (!isImagesContentBlock(block.content)) {\n return this.$q.resolve();\n }\n\n block.content.images = [];\n for (const url of block.content.imageUrls) {\n if (url.startsWith('data')) {\n block.content.images.push({\n content: toBase64(url)\n });\n } else {\n block.content.images.push({\n url: url\n });\n }\n }\n\n return this.dataService.saveContentBlock(this.$scope.story.id, block.id, block.content);\n }\n\n private cancel() {\n this.changed = [];\n this.$state.go('app.stories');\n }\n\n private blobToDataURL(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = _e => resolve(reader.result as string);\n reader.onerror = _e => reject(reader.error);\n reader.onabort = _e => reject(new Error('Read aborted'));\n reader.readAsDataURL(blob);\n });\n }\n\n private initializeContentBlocks(block: StoryBlock): void {\n this.createEmptyContentBlock(block);\n this.copyBlockToContent(block);\n this.updateImagesBlock(block, 0);\n this.updateImagesBlock(block, 1);\n this.updateImagesBlock(block, 2);\n this.updateImagesBlock(block, 3);\n }\n\n private updateImagesBlock(block: StoryBlock, index: number) {\n if (isImagesBlock(block) && isImagesContentBlock(block.content) && this.hasImageAt(block, index) && this.canAddImages(block)) {\n const url = getEnvironment().apiUrl.replace('api/', `getPicture.aspx?id=${emptyGuid}`);\n block.content.imageUrls[index] = url;\n }\n }\n\n private copyBlockToContent(block: StoryBlock) {\n for (const key in block) {\n if (key === 'content') {\n continue;\n }\n\n const contentValue = block.content[key];\n if (contentValue == null) {\n block.content[key] = block[key];\n }\n }\n }\n\n private createEmptyContentBlock(block: StoryBlock) {\n if (block.content == null) {\n block.content = {\n id: uuidv1(),\n name: undefined,\n blockType: block.blockType,\n optionalVisible: true\n };\n }\n }\n}\n\nappModule.controller('StoryDetailsController', StoryDetailsController);\n\nexport class FileSelectedDirective implements IDirective {\n restrict = 'A';\n scope = {\n onSelected: '&onSelected'\n };\n\n link = ($scope: IScope & { onSelected: Function }, element: IAugmentedJQuery) => {\n element.bind('change', event => {\n $scope.$apply(() => {\n const files = (event.target as unknown as HTMLInputElement).files;\n $scope.onSelected({ files });\n });\n });\n };\n}\n\n\n\nappModule.directive('fileSelected', () => new FileSelectedDirective());\n","import { appModule } from '@/definitions';\nimport moment from 'moment';\nimport { IQService, IScope, IPromise, ITimeoutService } from 'angular';\nimport { AppDataService } from '@/services/app-data-service';\nimport { IModalInstanceService } from 'angular-ui-bootstrap';\nimport { ftSettingsService, FortyTwoLoginService } from '@/FortyTwoFramework';\nimport { StoryTemplate } from './types';\nimport { IStateService } from 'angular-ui-router';\n\ninterface ILocalScope extends IScope {\n selectStoryTemplate: () => void;\n newStory: () => void;\n cancel: () => void;\n\n storyTemplates: StoryTemplate[];\n}\n\nappModule.controller('kpStoryNewModalController',\n ['$scope', '$q', '$uibModalInstance', 'AppDataService', '$timeout', 'ftSettingService', '$state',\n function ($scope: ILocalScope, $q: IQService, $uibModalInstance: IModalInstanceService, dataService: AppDataService,\n $timeout: ITimeoutService, settingsService: ftSettingsService, $state: IStateService) {\n\n this.dataService = dataService;\n this.settingsService = settingsService;\n this.$scope = $scope;\n this.$scope.model = {};\n this.$scope.isLoading = true;\n this.$state = $state;\n \n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n };\n\n const load = async () => {\n const groupId = this.settingsService.get(window.appSettings.group.selected);\n await this.dataService.getStoryTemplatesForGroup(groupId).then((x: StoryTemplate[]) => {\n this.$scope.storyTemplates = x;\n this.$scope.isLoading = false;\n });\n };\n\n $scope.newStory = async () => {\n //console.log(this.$scope.model.pickedStoryTemplate);\n const groupId = this.settingsService.get(window.appSettings.group.selected);\n await this.dataService.createStory(this.$scope.model.pickedStoryTemplate.id, groupId)\n .then((storyId: string) => {\n $uibModalInstance.close('saved');\n this.$state.go('app.story-details', { id: storyId });\n });\n };\n\n $timeout(() => load());\n }\n]\n);","console.log(`🚀 Version ${env.buildnumber || ''} build from ${env.commit || ''} and currently running in ${env.mode} mode`);\n\nimport '@/update';\n\nimport '@public/css/app.less';\n\nimport '@/FortyTwoFramework';\n\nimport 'angularjs-toaster';\nimport 'angularjs-toaster/toaster.min.css';\nimport 'angular-animate';\n\nimport '@/00.ft.app';\nimport '@/01.ft.app.definitions';\nimport '@/02.ft.app.models';\nimport '@/03.ft.app.module';\n\nimport '@/template';\n\nimport '@/dashboard';\nimport '@/ft.app.loading-bar';\n\nimport '@/component/avatar';\nimport '@/component/child-label';\nimport '@/component/group-switcher';\nimport '@/component/notifications';\n\nimport '@/directives/index';\nimport '@/filters/index';\nimport '@/providers/index';\nimport '@/services/index';\nimport '@/controllers/index';\nimport '@/stories/index';\n\n// Other code commented out because we do not wanna base localization based on user agent and it wasn't working properly\nimport moment from 'moment';\n\nmoment.locale('nl');\n"],"sourceRoot":""}