From d0edcaa918dd1d72e14f63488f1801f616184dfe Mon Sep 17 00:00:00 2001 From: vhande <78013271+vhande@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:17:31 +0100 Subject: [PATCH] Handle click --- dist/udb3-angular.js | 21 +++++++++++++-------- dist/udb3-angular.min.js | 2 +- src/search/ui/search.controller.js | 19 ++++++++++++------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dist/udb3-angular.js b/dist/udb3-angular.js index 5ab67916..db668f82 100644 --- a/dist/udb3-angular.js +++ b/dist/udb3-angular.js @@ -27447,6 +27447,7 @@ angular function SearchController( $scope, $timeout, + $document, udbApi, $window, $location, @@ -27484,6 +27485,16 @@ function SearchController( $scope.currentPage = getCurrentPage(); $scope.language = $translate.use() || 'nl'; + var handleClick = function() { + $rootScope.$emit('searchComponentReady'); + }; + + $document.on('click', handleClick); + + $scope.$on('$destroy', function() { + $document.off('click', handleClick); + }); + var additionalSpecifics = [ {id: 'accessibility', name: 'Toegankelijkheidsinformatie', permission: authorization.editFacilities} ]; @@ -27540,13 +27551,7 @@ function SearchController( if (LuceneQueryBuilder.isValid(query)) { var realQuery = LuceneQueryBuilder.unparse(query); $scope.resultViewer.queryChanged(realQuery); - findOffers(realQuery) - .then(function() { - $timeout(function() { - $rootScope.$emit('searchComponentReady'); - }); - }); - + findOffers(realQuery); if (realQuery !== query.originalQueryString) { $scope.realQuery = realQuery; } else { @@ -27764,7 +27769,7 @@ function SearchController( initListeners(); } -SearchController.$inject = ["$scope", "$timeout", "udbApi", "$window", "$location", "$uibModal", "SearchResultViewer", "offerLabeller", "offerLocator", "searchHelper", "$rootScope", "eventExporter", "$translate", "LuceneQueryBuilder", "authorization", "authorizationService"]; +SearchController.$inject = ["$scope", "$timeout", "$document", "udbApi", "$window", "$location", "$uibModal", "SearchResultViewer", "offerLabeller", "offerLocator", "searchHelper", "$rootScope", "eventExporter", "$translate", "LuceneQueryBuilder", "authorization", "authorizationService"]; })(); // Source: src/search/ui/search.directive.js diff --git a/dist/udb3-angular.min.js b/dist/udb3-angular.min.js index a9399099..c785d897 100644 --- a/dist/udb3-angular.min.js +++ b/dist/udb3-angular.min.js @@ -26,7 +26,7 @@ this.priceInfo=[],this.workflowStatus="DRAFT",this.availableFrom="",this.labels= EMAIL:"email",PHONE:"phone",URL:"url"});a.eventFormData=b,a.mainLanguage=b.getMainLanguage(),a.description=b.getDescription(a.mainLanguage),a.descriptionCssClass=a.description?"state-complete":"state-incomplete",a.savingDescription=!1,a.descriptionError=!1,a.originalDescription="",a.organizerCssClass=b.organizer.name?"state-complete":"state-incomplete",a.organizer="",a.emptyOrganizerAutocomplete=!1,a.loadingOrganizers=!1,a.organizerError=!1,a.savingOrganizer=!1,a.disablePriceInfo=_.get(g.offerEditor,"disablePriceInfo"),a.translatableLanguages=g.translatableLanguages,a.editBookingPhone=!b.bookingInfo.phone,a.editBookingEmail=!b.bookingInfo.email,a.editBookingUrl=!b.bookingInfo.url,a.bookingModel={urlRequired:!1,emailRequired:!1,phoneRequired:!1,url:b.bookingInfo.urlLabel?b.bookingInfo.url:"",urlLabel:{},urlLabelCustom:"",phone:b.bookingInfo.phone?b.bookingInfo.phone:"",email:b.bookingInfo.email?b.bookingInfo.email:""},a.newBookingModel={},a.bookingOptions=[],_.each(a.translatableLanguages,function(b){a.bookingOptions[b]=[{value:"buy_tickets",label:J("buy_tickets",b)},{value:"reserve_places",label:J("reserve_places",b)},{value:"check_availability",label:J("check_availability",b)},{value:"subscribe",label:J("subscribe",b)}]}),b.bookingInfo.urlLabel?(a.bookingModel.urlLabel=[],a.usedBookingOption=_.findWhere(a.bookingOptions[a.mainLanguage],{label:b.bookingInfo.urlLabel}),void 0===a.usedBookingOption&&(a.usedBookingOption=_.findWhere(a.bookingOptions[a.mainLanguage],{value:"reserve_places"})),"string"==typeof b.bookingInfo.urlLabel?_.each(a.translatableLanguages,function(b){a.bookingModel.urlLabel[b]=_.findWhere(a.bookingOptions[b],{value:a.usedBookingOption.value})}):_.each(a.translatableLanguages,function(b){a.bookingModel.urlLabel[b]=_.findWhere(a.bookingOptions[b],{value:a.usedBookingOption.value})})):_.each(a.translatableLanguages,function(b){a.bookingModel.urlLabel[b]=a.bookingOptions[b][1]}),a.usedBookingOption&&!_.find(a.bookingOptions[a.mainLanguage],a.usedBookingOption)&&a.bookingOptions[a.mainLanguage].unshift(a.usedBookingOption),a.viaWebsite=!b.bookingInfo.url,a.viaEmail=!b.bookingInfo.email,a.viaPhone=!b.bookingInfo.phone,a.websitePreviewEnabled=!1,a.bookingPeriodPreviewEnabled=!1,a.bookingPeriodShowValidation=!1,a.bookingInfoCssClass="state-incomplete",a.toggleBookingType=w,a.saveBookingInfo=C,a.removeDuplicateContactBooking=D,a.saveWebsitePreview=y,a.enableWebsitePreview=z,a.showBookingOption=u,a.deleteBookingInfo=A,a.removeBookingInfo=x,a.hasBookingInfo=v,a.translateBookingInfoUrlLabels=J,a.contactInfoCssClass="state-incomplete",a.savingContactInfo=!1,a.contactInfoError=!1,a.contactInfo=[],a.alterDescription=i,a.focusDescription=j,a.saveDescription=k,a.countCharacters=l,a.getOrganizers=m,a.selectOrganizer=n,a.deleteOrganizerHandler=o,a.openOrganizerModal=q,a.deleteContactInfo=s,a.saveContactInfo=t,a.addContactInfo=r,a.hasTicketSales=!1,a.hasUitpasError=!1,a.openUploadImageModal=E,a.removeImage=G,a.editImage=F,a.selectMainImage=H,I(),K.eventFormSaved=function(){f.$emit("eventFormSaved",b)},K.showAsyncOrganizerError=function(){a.organizerError=!0,a.savingOrganizer=!1},K.saveOrganizer=function(d){function e(){a.emptyOrganizerAutocomplete=!1,a.organizerError=!1,a.savingOrganizer=!0,a.organizer=""}function g(){K.eventFormSaved(),f.$emit("eventOrganizerSelected",d),a.organizerCssClass="state-complete",a.savingOrganizer=!1}b.organizer=d,e(),c.updateOrganizer(b).then(g,K.showAsyncOrganizerError)}}angular.module("udb.event-form").controller("EventFormStep5Controller",a),a.$inject=["$scope","EventFormData","eventCrud","udbOrganizers","$uibModal","$rootScope","appConfig","udbUitpasApi"]}(),function(){"use strict";function a(a,c,d){var e=function(e,f,g,h){a.call(this,e),this.type="export",this.exportUrl="",this.eventCount=f,this.format=g,this.extension=_.find(d,{type:g}).extension,this.details=h,this.messages={},this.messages[c.CREATED]=b(this,c.CREATED,c),this.messages[c.STARTED]=b(this,c.STARTED,c),this.messages[c.FINISHED]=b(this,c.FINISHED,c),this.messages[c.FAILED]=b(this,c.FAILED,c)};return e.prototype=Object.create(a.prototype),e.prototype.constructor=e,e.prototype.getTemplateName=function(){var a;switch(this.state){case c.FINISHED:a="export-job";break;case c.FAILED:a="failed-job";break;default:a="base-job"}return a},e.prototype.getDescription=function(){return b(this,this.state,c)},e.prototype.info=function(a){a.location&&(this.exportUrl=a.location)},e.prototype.getTaskCount=function(){return this.eventCount},e}function b(a,b,c){var d="";return d=b===c.FAILED?"Exporteren van items mislukt":"Document ."+a.extension+" met "+a.eventCount+" items"}angular.module("udb.entry").factory("EventExportJob",a),a.$inject=["BaseJob","JobStates","ExportFormats"]}(),function(){"use strict";function a(a,b,c,d,e){function f(a){h=0>a?0:a>g.steps.length?g.steps.length:a}var g=this;g.exportLogoUrl=e.exportLogoUrl,g.dayByDay=!1,g.eventProperties=[{name:"name",include:!0,sortable:!1,excludable:!1},{name:"description",include:!1,sortable:!1,excludable:!0},{name:"labels",include:!1,sortable:!1,excludable:!0},{name:"calendarSummary",include:!0,sortable:!1,excludable:!1},{name:"image",include:!1,sortable:!1,excludable:!0},{name:"videos",inclue:!1,sortable:!1,excludable:!0},{name:"location",include:!0,sortable:!1,excludable:!1},{name:"address",include:!0,sortable:!1,excludable:!0},{name:"organizer",include:!1,sortable:!1,excludable:!0},{name:"priceInfo",include:!1,sortable:!1,excludable:!0},{name:"kansentarief",include:!1,sortable:!1,excludable:!0,format:c.OOXML},{name:"contactPoint",include:!1,sortable:!1,excludable:!0},{name:"bookingInfo",include:!1,sortable:!1,excludable:!0},{name:"status",include:!1,sortable:!1,excludable:!0},{name:"bookingAvailability",include:!1,sortable:!1,excludable:!0},{name:"attendance",include:!1,sortable:!1,excludable:!0},{name:"creator",include:!1,sortable:!1,excludable:!0},{name:"terms.theme",include:!0,sortable:!1,excludable:!0},{name:"terms.eventtype",include:!0,sortable:!1,excludable:!0},{name:"created",include:!1,sortable:!1,excludable:!0},{name:"modified",include:!1,sortable:!1,excludable:!0},{name:"available",include:!1,sortable:!1,excludable:!0},{name:"endDate",include:!1,sortable:!1,excludable:!0},{name:"startDate",include:!1,sortable:!1,excludable:!0},{name:"calendarType",include:!1,sortable:!1,excludable:!0},{name:"sameAs",include:!1,sortable:!1,excludable:!0},{name:"typicalAgeRange",include:!1,sortable:!1,excludable:!0},{name:"language",include:!1,sortable:!1,excludable:!0},{name:"audience",include:!1,sortable:!1,excludable:!0,format:c.OOXML},{name:"completeness",include:!1,sortable:!1,excludable:!0}],g.exportFormats=_.map(c),g.brands=e.exportBrands,g.restrictedBrands=e.restrictedExportBrands,g.templateUrl=e.exportTemplateUrl,g.templates=e.exportTemplateTypes,d.getMyRoles().then(function(a){angular.forEach(a,function(b,c){g.brands=g.brands.concat(_.where(g.restrictedBrands,{role:a[c].uuid}))})}),g.customizations={brand:"",logo:g.exportLogoUrl+g.brands[0].logo,title:"",subtitle:"",footer:"",publisher:"",template:""},g.exportSteps={format:{name:"format",incomplete:function(){var a=g.format,b=!!_.find(g.exportFormats,{type:a,customizable:!0});return b?g.steps=[g.exportSteps.format,g.exportSteps.customize,g.exportSteps.confirm]:g.steps=[g.exportSteps.format,g.exportSteps.filter,g.exportSteps.confirm],!a}},customize:{name:"customize",incomplete:function(){return!g.customizations.brand||!g.customizations.title||!g.customizations.template}},filter:{name:"filter",incomplete:function(){return!_.find(g.eventProperties,function(a){return a.include===!0})}},confirm:{name:"confirm"}},g.steps=[g.exportSteps.format,g.exportSteps.confirm];var h=0;g.nextStep=function(){g.isStepCompleted()?f(h+1):g.hasErrors=!0},g.previousStep=function(){f(h-1)},g.isStepCompleted=function(){if(-1===h)return!0;var a=g.steps[h].incomplete;return"undefined"==typeof a||"function"==typeof a&&!a()},g.isOnFirstStep=function(){return 0===h},g.getActiveStepName=function(){return-1===h?"finished":g.steps[h].name},g.onLastStep=function(){return h>=g.steps.length-1},g["export"]=function(){var a,c,d=_.find(g.exportFormats,{type:g.format}),e=d&&d.customizable===!0;e?(c=g.customizations,c.logo=g.exportLogoUrl+c.brand.logo,c.brand=c.brand.name,c.template=c.template.name,a=[]):(c={},a=_.pluck(_.filter(g.eventProperties,"include"),"name")),b["export"](g.format,g.email,a,g.dayByDay,c),h=-1},g.format=g.exportFormats[0].type,g.email="",g.close=function(){a.dismiss("cancel")},g.eventCount=b.activeExport.eventCount}angular.module("udb.export").controller("EventExportController",a),a.$inject=["$uibModalInstance","eventExporter","ExportFormats","udbApi","appConfig"]}(),function(){"use strict";function a(a,b,c,d,e){var f=this;f.activeExport={query:{},eventCount:0,selection:[]},f["export"]=function(b,g,h,i,j){var k=' AND workflowStatus:("APPROVED" OR "READY_FOR_VALIDATION")',l="("+f.activeExport.query.queryString+")"+k,m=f.activeExport.selection||[],n=f.activeExport.eventCount,o=j.brand||"",p=null,q=e.getObject("user"),r=c.exportEvents(l,g,b,h,i,m,j);return p={format:b,user:q.id,brand:o,queryString:l},r.success(function(c){var e=new d(c.commandId,n,b,p);a.addJob(e),e.start()}),r}}angular.module("udb.export").service("eventExporter",a),a.$inject=["jobLogger","appConfig","udbApi","EventExportJob","$cookies"]}(),function(){"use strict";angular.module("udb.export").constant("ExportFormats",{OOXML:{type:"ooxml",extension:"xlsx",label:"Office Open XML (Excel)",description:"Het standaard formaat van Excel vanaf Microsoft Office 2007."},PDF:{type:"pdf",label:"Als PDF",extension:"pdf",description:"Druk snel en eenvoudig items uit de UiTdatabank af. Kies een Vlieg, UiT-, of UiTPAS-sjabloon.",customizable:!0},JSON:{type:"json",label:"Als json",extension:"json",description:"Exporteren naar event-ld om de informatie voor ontwikkelaars beschikbaar te maken."}})}(),function(){"use strict";function a(){return{templateUrl:"templates/export-modal-buttons.directive.html",restrict:"E"}}angular.module("udb.export").directive("udbExportModalButtons",a)}(),function(){"use strict";function a(a){function b(a){var b="undefined"!=typeof a?a:c.queryString;c.queryString=b,c.onChange({query:b})}var c=this;c.queryString="",c.find=b,c.$onInit=function(){a(c.searchLabel).then(function(a){c.searchLabel=a})}}angular.module("udb.management").component("udbQuerySearchBar",{templateUrl:"templates/query-search-bar.html",controller:a,controllerAs:"qsb",bindings:{onChange:"&",searchLabel:"@",helpLink:"@",helpLabel:"@"}}),a.$inject=["$translate"]}(),function(){"use strict";function a(){return{restrict:"A",require:"^form",link:function(a,b,c,d){var e=b[0].querySelector("[name]"),f=angular.element(e),g=f.attr("name");f.bind("blur",function(){var a=d[g].$invalid;b.toggleClass("has-error",a).toggleClass("has-success",!a)})}}}angular.module("udb.management").directive("udbFormGroup",a)}(),function(){"use strict";function a(a,b,c){function d(){function b(){c.go("split.manageLabels.list")}f.creating=!0,a.create(f.label.name,f.label.isVisible,f.label.isPrivate).then(b,e)["finally"](function(){f.creating=!1})}function e(a){b.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"sm",resolve:{errorMessage:function(){return a.title+" "+a.detail}}})}var f=this;f.creating=!1,f.create=d,f.label={name:"",isPrivate:!1,isVisible:!0}}angular.module("udb.management.labels").controller("LabelCreatorController",a),a.$inject=["LabelManager","$uibModal","$state"]}(),function(){"use strict";function a(a,b,c,d){function e(){function b(a){j(a.uuid)}p.renaming=!0,a.copy(p.label).then(b,g)["finally"](function(){p.renaming=!1,p.saving=!1})}function f(){p.saving=!0;var a=[],b=p.originalLabel.name!==p.label.name;b?e():(p.originalLabel.isVisible!==p.label.isVisible&&a.push(n()),p.originalLabel.isPrivate!==p.label.isPrivate&&a.push(o()),d.all(a)["finally"](function(){p.saving=!1})["catch"](g))}function g(a){j(p.label.uuid);b.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"sm",resolve:{errorMessage:function(){return a.title+" "+a.detail}}})}function h(){var a=c.id;j(a)}function i(a){p.label=a,k(a),l(a),p.originalLabel=_.cloneDeep(p.label)}function j(b){p.loadingError=!1,p.label=!1,a.get(b).then(i,m)}function k(a){return"visible"===a.visibility?a.isVisible=!0:a.isVisible=!1,a}function l(a){return"public"===a.privacy?a.isPrivate=!1:a.isPrivate=!0,a}function m(){p.loadingError="Label niet gevonden!"}function n(){var b=p.label.isVisible;return b?a.makeVisible(p.label):a.makeInvisible(p.label)}function o(){var b=p.label.isPrivate;return b?a.makePrivate(p.label):a.makePublic(p.label)}var p=this;p.updateVisibility=n,p.updatePrivacy=o,p.saving=!1,p.renaming=!1,p.save=f,h()}angular.module("udb.management.labels").controller("LabelEditorController",a),a.$inject=["LabelManager","$uibModal","$stateParams","$q"]}(),function(){"use strict";function a(a){var b=this;b.find=function(b,c,d){return a.findLabels(b,c,d,!1)},b.get=function(b){return a.getLabelById(b)},b.create=function(b,c,d){return a.createLabel(b,c,d)},b.copy=function(b){return a.createLabel(b.name,b.isVisible,b.isPrivate,b.uuid)},b["delete"]=function(b){return a.deleteLabel(b.uuid)},b.makeInvisible=function(b){return a.updateLabel(b.uuid,"MakeInvisible")},b.makeVisible=function(b){return a.updateLabel(b.uuid,"MakeVisible")},b.makePrivate=function(b){return a.updateLabel(b.uuid,"MakePrivate")},b.makePublic=function(b){return a.updateLabel(b.uuid,"MakePublic")}}angular.module("udb.management.labels").service("LabelManager",a),a.$inject=["udbApi"]}(),function(){"use strict";function a(a,b,c,d){function e(a){return""===i.query?!0:a.length>=k}function f(a){i.problem=a}function g(){i.problem=!1}function h(a){var b=a.error;b?(f(b),i.searchResult={}):(g(),i.searchResult=a),i.loading=!1}var i=this,j=10,k=3,l=b.createObservableFunction(i,"queryChanged"),m=l.filter(e),n=b.createObservableFunction(i,"pageChanged"),o=new a(d,m,n,j),p=o.getSearchResult$();i.loading=!1,i.query="",i.page=0,i.minQueryLength=k,l.safeApply(c,function(a){i.query=a}).subscribe(),p.safeApply(c,h).subscribe(),m.merge(n).safeApply(c,function(){i.loading=!0}).subscribe()}angular.module("udb.management.labels").controller("LabelsListController",a),a.$inject=["SearchResultGenerator","rx","$scope","LabelManager"]}(),function(){"use strict";function a(a){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a){return void 0===a||-1===a.indexOf(";")}d.$validators.semicolonLabel=e}}}angular.module("udb.management.labels").directive("udbSemicolonLabelCheck",a),a.$inject=["$q"]}(),function(){"use strict";function a(a,b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){function g(c){if(f.$isEmpty(c))return b.when();var d=b.defer();return a.get(c).then(d.reject,d.resolve),d.promise}f.$asyncValidators.uniqueLabel=g}}}angular.module("udb.management.labels").directive("udbUniqueLabel",a),a.$inject=["LabelManager","$q"]}(),function(){"use strict";function a(a){return[{name:"Valideren",permission:a.AANBOD_MODEREREN,notificationCount:0,index:1,sref:"management.moderation.list",icon:"fa fa-flag"},{name:"Gebruikers",permission:a.GEBRUIKERS_BEHEREN,notificationCount:0,index:2,sref:"management.users.list",icon:"fa fa-user"},{name:"Rollen",permission:a.GEBRUIKERS_BEHEREN,notificationCount:0,index:3,sref:"split.manageRoles.list",icon:"fa fa-users"},{name:"Labels",permission:a.LABELS_BEHEREN,notificationCount:0,index:4,sref:"split.manageLabels.list",icon:"fa fa-tag"},{name:"Organisaties",permission:a.ORGANISATIES_BEHEREN,notificationCount:0,index:5,sref:"management.organizers.search",icon:"fab fa-slideshare"}]}angular.module("udb.management").factory("managementListItemDefaults",a),a.$inject=["RolePermission"]}(),function(){"use strict";function a(a,b,c,d,e,f){function g(a){var b="";return _.forEach(a,function(a){void 0!==a.constraints&&a.constraints.v3&&(b+=(b?" OR ":"")+a.constraints.v3)}),b=b?"("+b+")":"",c.find(b,10,0).then(function(a){return a.totalItems})}function h(b){var c=_.find(e,{permission:a.AANBOD_MODEREREN}),d=angular.copy(c);return d.notificationCount=b,d}function i(b){var c=d.defer(),e=_.filter(b,function(b){return _.includes(b.permissions,a.AANBOD_MODEREREN)});return e.length>0?g(e).then(h).then(function(a){c.resolve([a])}):c.resolve([]),c.promise}function j(b){var c=_.without(b,a.AANBOD_MODEREREN),f=_.filter(e,function(a){return _.includes(c,a.permission)});return d.resolve(f)}var k=b.getPermissions().then(j),l=c.getMyRoles().then(i);return d.all([k,l]).then(_.flatten)}angular.module("udb.management").factory("managementListItems",a),a.$inject=["RolePermission","authorizationService","ModerationService","$q","managementListItemDefaults","appConfig"]}(),function(){"use strict";function a(a,b,c,d){function e(a){p(a||{title:"Dit aanbod kon niet geladen worden."})}function f(){return"true"===r["continue"]}function g(){return r.offer.workflowStatus===c.READY_FOR_VALIDATION}function h(){return r.offer.workflowStatus===c.APPROVED}function i(){return r.offer.workflowStatus===c.REJECTED}function j(){r.error=!1,a.approve(r.offer).then(function(){q(c.APPROVED)})["catch"](p)}function k(){var a=d.open({templateUrl:"templates/reject-offer-confirm-modal.html",controller:"RejectOfferConfirmModalCtrl"});a.result.then(l)}function l(a){"DUPLICATE"===a?n():"INAPPROPRIATE"===a?o():m(a)}function m(b){r.error=!1,a.reject(r.offer,b).then(function(){q(c.REJECTED)})["catch"](p)}function n(){r.error=!1,a.flagAsDuplicate(r.offer).then(function(){q(c.REJECTED)})["catch"](p)}function o(){r.error=!1,a.flagAsInappropriate(r.offer).then(function(){q(c.REJECTED)})["catch"](p)}function p(a){r.error=a.title+(a.detail?" "+a.detail:"")}function q(a){r.offer.workflowStatus=a,window.parent.postMessage({source:"UDB",type:"OFFER_MODERATED",status:a},"*")}var r=this,s="nl";r.loading=!0,r.offer={},r.error=!1,r.isReadyForValidation=g,r.isApproved=h,r.isRejected=i,r.approve=j,r.askForRejectionReasons=k,r.continueValidation=f,a.getModerationOffer(r.offerId).then(function(a){a.updateTranslationState(),r.offer=b(a,s)})["catch"](e)["finally"](function(){r.loading=!1})}angular.module("udb.management.moderation").component("udbModerationOffer",{templateUrl:"templates/moderation-offer.html",controller:a,controllerAs:"moc",bindings:{"continue":"@",offerId:"@",offerType:"@"}}),a.$inject=["ModerationService","jsonLDLangFilter","OfferWorkflowStatus","$uibModal"]}(),function(){"use strict";function a(a,b,c,d){function e(a){f(a||{title:"Dit aanbod kon niet geladen worden."})}function f(a){g.error=a.title+(a.detail?" "+a.detail:"")}var g=this,h="nl";g.loading=!0,g.offer={},g.error=!1,g.uitId=_.get(d,"uitidUrl"),c.isGodUser().then(function(a){g.isGodUser=a}),a.getModerationOffer(g.offerId).then(function(a){a.updateTranslationState(),g.offer=b(a,h),_.isEmpty(g.offer.description)&&(g.offer.description="")})["catch"](e)["finally"](function(){g.loading=!1})}angular.module("udb.management.moderation").component("udbModerationSummary",{templateUrl:"templates/moderation-summary.html",controller:a,controllerAs:"moc",bindings:{offerId:"@",offerType:"@"}}),a.$inject=["ModerationService","jsonLDLangFilter","authorizationService","appConfig"]}(),function(){"use strict";function a(a,b,c){function d(){var d;return a.error=!1,a.response.type&&("OTHER"!==a.response.type||a.response.reason&&a.response.reason.length)?(d="OTHER"===a.response.type?a.response.reason:a.response.type,void b.close(c.resolve(d))):void(a.error="Gelieve een reden op te geven.")}function e(){b.dismiss()}a.cancel=e,a.reject=d,a.response={}}angular.module("udb.management.moderation").controller("RejectOfferConfirmModalCtrl",a),a.$inject=["$scope","$uibModalInstance","$q"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i){function j(b){return o=e.createObservableFunction(s,"queryChanged"),p=e.createObservableFunction(s,"pageChanged"),q=new d(a,o,p,t,b.constraints.v3),r=q.getSearchResult$(),r.safeApply(f,m).subscribe(),o.safeApply(f,function(){s.loading=!0}).subscribe(),p.subscribe(function(){h.scrollTop(0)}),g.resolve()}function k(a){var b=_.filter(a,function(a){var b=_.filter(a.permissions,function(a){return a===c.AANBOD_MODEREREN});return b.length>0});return b.length?(s.roles=b,s.selectedRole=s.roles[0],g.resolve(s.selectedRole)):g.reject({title:"Er is huidig geen moderator rol gekoppeld aan jouw gebruiker."})}function l(a){s.queryChanged(a.constraints.v3)}function m(a){var b=a.error;b?(n(b),s.searchResult={}):s.searchResult=a,s.loading=!1}function n(a){s.errorMessage=a.title+(a.detail?" "+a.detail:"");b.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"sm",resolve:{errorMessage:function(){return s.errorMessage}}})}var o,p,q,r,s=this,t=10;s.roles=[],s.loading=!0,s.errorMessage=!1,s.selectedRole={},s.searchResult={},s.findModerationContent=l,a.getMyRoles().then(k).then(j)["catch"](n)["finally"](function(){s.loading=!1})}angular.module("udb.management.moderation").controller("ModerationListController",a),a.$inject=["ModerationService","$uibModal","RolePermission","SearchResultGenerator","rx","$scope","$q","$document","appConfig"]}(),function(){"use strict";function a(a,b,c,d,e){var f=this;f.getMyRoles=function(){return a.getMyRoles()},f.find=function(b,c,d){return a.findToModerate(b,d,c)},f.getModerationOffer=function(b){return a.getOffer(new URL(b))},f.approve=function(b){return a.patchOffer(b["@id"],"Approve")},f.reject=function(b,c){return a.patchOffer(b["@id"],"Reject",c)},f.flagAsDuplicate=function(b){return a.patchOffer(b["@id"],"FlagAsDuplicate")},f.flagAsInappropriate=function(b){return a.patchOffer(b["@id"],"FlagAsInappropriate")}}angular.module("udb.management.moderation").service("ModerationService",a),a.$inject=["udbApi","OfferWorkflowStatus","jobLogger","BaseJob","$q"]}(),function(){"use strict";angular.module("udb.management.moderation").constant("OfferWorkflowStatus",{DRAFT:"DRAFT",READY_FOR_VALIDATION:"READY_FOR_VALIDATION",APPROVED:"APPROVED",REJECTED:"REJECTED",DELETED:"DELETED"})}(),function(){"use strict";function a(a,b,c,d){function e(){function e(){g.saving=!1,g.error=!0}g.error=!1,g.saving=!0,b["delete"](c).then(function(){a.close(),d.$emit("organizationDeleted",c)})["catch"](e)}function f(){a.dismiss()}var g=this;g.organization=c,g.saving=!1,g.error=!1,g.cancelRemoval=f,g.deleteOrganization=e}angular.module("udb.management.organizers").controller("OrganizationDeleteModalController",a),a.$inject=["$uibModalInstance","OrganizerManager","organization","$rootScope"]}(),function(){"use strict";function a(a,b,c,d,e,f){function g(a){return function(b){return""===b||b.length>=a}}function h(a){k.problem=a}function i(){k.problem=!1}function j(a){var b=a.error;b?(h(b),k.searchResult={}):(i(),k.searchResult=a,f(function(){e.$emit("searchComponentReady")})),k.loading=!1}var k=this,l=10,m=3,n=b.createObservableFunction(k,"queryChanged"),o=n.filter(g(m)),p=b.createObservableFunction(k,"pageChanged"),q=new a(d,o,p,l),r=q.getSearchResult$();k.loading=!1,k.query="",k.page=0,k.minQueryLength=m,n.safeApply(c,function(a){k.query=a}).subscribe(),r.safeApply(c,j).subscribe(),o.merge(p).safeApply(c,function(){k.loading=!0}).subscribe()}angular.module("udb.management.organizers").controller("OrganizationSearchControllerNew",a),a.$inject=["SearchResultGenerator","rx","$scope","OrganizerManager","$rootScope","$timeout"]}(),function(){"use strict";function a(){return{restrict:"A",templateUrl:"templates/organization-search-item-new.html",bindToController:{organizationSearchItem:"=a}}function f(a){i.problem=a}function g(){i.problem=!1}function h(a){var b=a.error;b?(f(b),i.searchResult={}):(g(),i.searchResult=a),i.loading=!1}var i=this,j=10,k=3,l=b.createObservableFunction(i,"queryChanged"),m=l.filter(e(k)),n=b.createObservableFunction(i,"pageChanged"),o=new a(d,m,n,j),p=o.getSearchResult$();i.loading=!1,i.query="",i.page=0,i.minQueryLength=k,l.safeApply(c,function(a){i.query=a}).subscribe(),p.safeApply(c,h).subscribe(),m.merge(n).safeApply(c,function(){i.loading=!0}).subscribe()}angular.module("udb.management.organizers").controller("OrganizationSearchController",a),a.$inject=["SearchResultGenerator","rx","$scope","OrganizerManager"]}(),function(){"use strict";function a(a,b,c,d){function e(){function e(){a.saving=!1,a.error=!0}a.error=!1,a.saving=!0,c.deleteRole(d).then(b.close)["catch"](e)}function f(){b.dismiss()}a.item=d,a.saving=!1,a.error=!1,a.cancelRemoval=f,a.deleteRole=e}angular.module("udb.management.roles").controller("RoleDeleteConfirmModalCtrl",a),a.$inject=["$scope","$uibModalInstance","RoleManager","item"]}(),function(){"use strict";angular.module("udb.management.roles").constant("RolePermission",{AANBOD_BEWERKEN:"AANBOD_BEWERKEN",AANBOD_MODEREREN:"AANBOD_MODEREREN",AANBOD_VERWIJDEREN:"AANBOD_VERWIJDEREN",AANBOD_HISTORIEK:"AANBOD_HISTORIEK",ORGANISATIES_BEWERKEN:"ORGANISATIES_BEWERKEN",ORGANISATIES_BEHEREN:"ORGANISATIES_BEHEREN",GEBRUIKERS_BEHEREN:"GEBRUIKERS_BEHEREN",LABELS_BEHEREN:"LABELS_BEHEREN",VOORZIENINGEN_BEWERKEN:"VOORZIENINGEN_BEWERKEN",PRODUCTIES_AANMAKEN:"PRODUCTIES_AANMAKEN",FILMS_AANMAKEN:"FILMS_AANMAKEN"})}(),function(){"use strict";function a(a,b,c,d,e,f,g){function h(){j().then(function(a){return z.availablePermissions=a,A?i(A):e.resolve()})["catch"](y)["finally"](function(){z.loadedRole=!0,z.loadedRolePermissions=!0,z.loadedRoleUsers=!0,z.loadedRoleLabels=!0})}function i(b){return a.get(b).then(function(a){z.role=a,z.role.users=[],z.role.labels=[],z.role.permissions=_.filter(z.availablePermissions,function(b){return _.contains(a.permissions,b.key)})},function(a){return a.detail=a.title,a.title="De rol kon niet gevonden worden.",e.reject(a)}).then(function(){return k(b)}).then(function(){return l(b)})}function j(){function a(a){return _.map(a,function(a,b){return{key:b,name:a}})}var b=_.values(g);return f(b).then(a)}function k(b){return a.getRoleUsers(b).then(function(a){z.role.users=a},function(a){return a.detail=a.title,a.title="De leden van deze rol konden niet geladen worden.",e.reject(a)})}function l(b){return a.getRoleLabels(b).then(function(a){z.role.labels=a},function(a){return a.detail=a.title,a.title="De labels van deze rol konden niet geladen worden.",e.reject(a)})}function m(a){A=a.roleId,z.role.uuid=A}function n(){!z.role.uuid&&z.role.name&&a.create(z.role.name).then(m,y)["finally"](function(){z.saving=!1})}function o(){return _.has(z.role.constraints,"v3")&&null!==z.role.constraints.v3}function p(){z.saving=!0,a.createRoleConstraint(A,z.role.constraints.v3).then(function(){z.editConstraint=!1},y)["finally"](function(){z.saving=!1})}function q(){z.saving=!0,a.updateRoleConstraint(A,z.role.constraints.v3).then(function(){z.editConstraint=!1},y)["finally"](function(){z.saving=!1})}function r(){z.saving=!0,a.removeRoleConstraint(A).then(function(){z.editConstraint=!1,_.has(z.role.constraints,"v3")&&delete z.role.constraints.v3},y)["finally"](function(){z.saving=!1})}function s(){z.saving=!0,a.updateRoleName(A,z.role.name).then(function(){z.editName=!1},y)["finally"](function(){z.saving=!1})}function t(b){z.loadedRolePermissions=!1;var c=e.reject();_.find(z.role.permissions,{key:b.key})?(z.role.permissions=_.reject(z.role.permissions,{key:b.key}),c=a.removePermissionFromRole(b.key,A)):(z.role.permissions.push(b),c=a.addPermissionToRole(b.key,A)),c["catch"](y)["finally"](function(){z.loadedRolePermissions=!0})}function u(b){z.saving=!0,a.addLabelToRole(A,b.uuid).then(function(){z.role.labels.push(b)},y)["finally"](function(){z.saving=!1})}function v(b){z.saving=!0,a.removeLabelFromRole(A,b.uuid).then(function(){var a=z.role.labels.indexOf(b);z.role.labels.splice(a,1)},y)["finally"](function(){z.saving=!1})}function w(b){var c=_.pick(z.role,["uuid","name","constraint"]);z.saving=!0,a.removeUserFromRole(c,b).then(function(){var a=z.role.users.indexOf(b);z.role.users.splice(a,1)},y)["finally"](function(){z.saving=!1})}function x(){z.addingUser=!0;var c=!1;b.findUserWithEmail(z.email).then(function(a){var b=!1;return c=a,angular.forEach(z.role.users,function(c){c.uuid===a.uuid&&(b=!0)}),b?e.reject({title:"De gebruiker hangt al aan deze rol."}):a}).then(function(b){var c=_.pick(z.role,["uuid","name","constraint"]);return a.addUserToRole(b,c)}).then(function(){z.role.users.push(c),z.form.email.$setViewValue(""),z.form.email.$setPristine(!0),z.form.email.$render()})["catch"](y)["finally"](function(){z.addingUser=!1})}function y(a){z.errorMessage=a.title+(a.detail?" "+a.detail:"");c.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"sm",resolve:{errorMessage:function(){return z.errorMessage}}})}var z=this,A=d.id;z.saving=!1,z.loadedRole=!1,z.loadedRolePermissions=!1,z.loadedRoleUsers=!1,z.loadedRoleLabels=!1,z.addingUser=!1,z.role={permissions:[],users:[],labels:[]},z.availablePermissions=[],z.errorMessage=!1,z.editName=!1,z.editConstraint=!1,z.addUser=x,z.addLabel=u,z.createRole=n,z.removeLabel=v,z.removeUser=w,z.updatePermission=t,z.updateName=s,z.createConstraint=p,z.updateConstraint=q,z.removeConstraint=r,z.constraintExists=o,h()}angular.module("udb.management.roles").controller("RoleFormController",a),a.$inject=["RoleManager","UserManager","$uibModal","$stateParams","$q","$translate","RolePermission"]}(),function(){"use strict";function a(a){var b=this;b.find=function(b,c,d){return a.findRoles(b,c,d)},b.get=function(b){return a.getRoleById(b)},b.getRolePermissions=function(b){return a.getRolePermissions(b)},b.getRoleUsers=function(b){return a.getRoleUsers(b)},b.create=function(b){return a.createRole(b)},b.addPermissionToRole=function(b,c){return a.addPermissionToRole(b,c)},b.removePermissionFromRole=function(b,c){return a.removePermissionFromRole(b,c)},b.addUserToRole=function(b,c){return a.addUserToRole(b.uuid,c.uuid)},b.updateRoleName=function(b,c){return a.updateRoleName(b,c)},b.createRoleConstraint=function(b,c){return a.createRoleConstraint(b,c)},b.updateRoleConstraint=function(b,c){return a.updateRoleConstraint(b,c)},b.removeRoleConstraint=function(b){return a.removeRoleConstraint(b)},b.addLabelToRole=function(b,c){return a.addLabelToRole(b,c)},b.getRoleLabels=function(b){return a.getRoleLabels(b)},b.removeLabelFromRole=function(b,c){return a.removeLabelFromRole(b,c)},b.removeUserFromRole=function(b,c){return a.removeUserFromRole(b.uuid,c.uuid)},b.deleteRole=function(b){return a.removeRole(b.uuid)}}angular.module("udb.management.roles").service("RoleManager",a),a.$inject=["udbApi"]}(),function(){"use strict";function a(a,b,c,d,e,f,g){function h(a){return""===m.query?!0:a.length>=o; }function i(a){m.problem=a}function j(){m.problem=!1}function k(a){var b=a.error;b?(i(b),m.searchResult={}):(j(),m.searchResult=a),m.loading=!1}function l(a){var b=e.open({templateUrl:"templates/role-delete-confirm-modal.html",controller:"RoleDeleteConfirmModalCtrl",resolve:{item:function(){return a}}});b.result.then(function(){f.reload()})}var m=this,n=10,o=3,p=b.createObservableFunction(m,"queryChanged"),q=p.filter(h),r=b.createObservableFunction(m,"pageChanged"),s=new a(d,q,r,n),t=s.getSearchResult$();m.openDeleteConfirmModal=l,m.loading=!1,m.query="",m.page=0,m.minQueryLength=o,p.safeApply(c,function(a){m.query=a}).subscribe(),t.safeApply(c,k).subscribe(),q.merge(r).safeApply(c,function(){m.loading=!0}).subscribe(),r.subscribe(function(){g.scrollTop(0)})}angular.module("udb.management.roles").controller("RolesListController",a),a.$inject=["SearchResultGenerator","rx","$scope","RoleManager","$uibModal","$state","$document"]}(),function(){"use strict";function a(a){function b(b){a.find(b,6,0).then(function(a){d(a.member)})["finally"](function(){e.refreshing=!1})}function c(a){e.refreshing=!0,d([]),b(a)}function d(a){e.availableLabels=a}var e=this;e.availableLabels=[],e.suggestLabels=c,e.minimumInputLength=2,e.findDelay=300,e.label=null}angular.module("udb.management.roles").component("udbSearchLabel",{templateUrl:"templates/search-label.html",controller:a,controllerAs:"select",bindings:{labelAdded:"&",labelRemoved:"&"}}),a.$inject=["LabelManager"]}(),function(){"use strict";function a(a,b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){function g(c){if(f.$isEmpty(c))return b.when();var d=b.defer();return a.get(c).then(d.reject,d.resolve),d.promise}f.$asyncValidators.uniqueRole=g}}}angular.module("udb.management.roles").directive("udbUniqueRole",a),a.$inject=["RoleManager","$q"]}(),function(){"use strict";function a(a){function b(a,b){return{query:a,offset:b}}function c(a){return function(b){return(b-1)*a}}var d=function(d,e,f,g,h){h=h||"",this.searchService=d,this.itemsPerPage=g,this.query$=e.debounce(300).startWith(h),this.offset$=f.map(c(g)).startWith(0),this.searchParameters$=a.Observable.combineLatest(this.query$,this.offset$,b)};return d.prototype.constructor=d,d.prototype.find=function(b){var c=this;return a.Observable.fromPromise(c.searchService.find(b.query,c.itemsPerPage,b.offset))["catch"](function(b){return a.Observable.just({error:b})})},d.prototype.getSearchResult$=function(){var a=this;return a.searchParameters$.flatMap(a.find.bind(a))},d}angular.module("udb.management").factory("SearchResultGenerator",a),a.$inject=["rx"]}(),function(){"use strict";function a(a){var b=this;b.find=function(b,c,d){return a.resolve({"@context":"http://www.w3.org/ns/hydra/context.jsonld","@type":"PagedCollection",itemsPerPage:10,totalItems:0,member:[],firstPage:"http://du.de/items?page=1",lastPage:"http://du.de/items?page=1",nextPage:"http://du.de/items?page=1"})}}angular.module("udb.management").service("SearchService",a),a.$inject=["$q"]}(),function(){"use strict";function a(a,b,c,d){function e(b){a.findUserWithEmail(b).then(function(b){f(b),a.getRoles(b.uuid).then(g)})}function f(a){j.user=a}function g(a){j.roles=a}function h(a){return d.when(a.task.promise)}function i(a){return a.perform()["catch"](a.undo)}var j=this,k=c.email;e(k),j.deleteRole=function(a){var c={role:a,style:"list-group-item-danger",perform:_.once(function(){return b.removeUserFromRole(a,j.user).then(h)}),undo:function(){console.log("¯\\_(ツ)_/¯")}};j.queueAction(c)},j.queueAction=function(a){var b=j.actions?j.actions:[];j.getRoleAction(a.role)||(b.push(a),j.actions=b)},j.getRoleStyle=function(a){var b=j.getRoleAction(a);return b?b.style:null},j.getRoleAction=function(a){return _.find(j.actions,{role:{uuid:a.uuid}})},j.lookupRoles=function(a){return b.find(a,20).then(function(a){return _.reject(a.member,function(a){return _.find(j.roles,{uuid:a.uuid})})})},j.addRole=function(a){if(!_.find(j.roles,{uuid:a.uuid})){j.roles.push(a),j.roleLookupName="";var c={role:a,style:"list-group-item-success",perform:_.once(function(){return b.addUserToRole(j.user,a).then(h)}),undo:function(){j.roles=_.reject(j.roles,{uuid:a.uuid})}};j.queueAction(c)}},j.save=function(){j.saving=!0;var a=_.map(j.actions,i);d.all(a).then(function(){e(k),j.saving=!1,j.actions=[]})},j.undoAction=function(a){var b=j.getRoleAction(a);b.undo(),j.actions=_.reject(j.actions,{role:{uuid:a.uuid}})}}angular.module("udb.management.users").controller("UserEditorController",a),a.$inject=["UserManager","RoleManager","$stateParams","$q"]}(),function(){"use strict";function a(a){var b=this;b.findUserWithEmail=function(b){return a.findUserWithEmail(b)},b.getRoles=function(b){return a.getUserRoles(b)}}angular.module("udb.management.users").service("UserManager",a),a.$inject=["udbApi"]}(),function(){"use strict";function a(a,b){function c(a){e.status="problem",e.problem=a}function d(){e.status="idle",e.problem=!1}var e=this;e.status="idle",e.query="",e.problem="",e.handleChange=function(){"problem"===e.status&&d()},e.handleSubmit=function(){e.status="loading",a.findUserWithEmail(e.query).then(function(a){e.status="idle",b.path("/manage/users/"+a.email)},function(a){404===a.status?e.status="notFound":c(a.title)})}}angular.module("udb.management.users").controller("UsersListController",a),a.$inject=["UserManager","$location"]}(),function(){"use strict";function a(a,b,c,d){var e=this;e.createImage=function(a,b,f,g){function h(a){return a.split("/").pop()}function i(a){return l.indexOf(a)>=0}function j(a){e.getImage(a.data.imageId).then(k.resolve,k.reject)}var k=c.defer(),l=["png","jpeg","jpg","gif"];return i(h(a.type))?d.uploadMedia(a,b,f,g).then(j,k.reject):k.reject({data:{title:"The uploaded file is not an image."}}),k.promise},e.getImage=function(a){function b(b){var d=b;return d.id=a,c.resolve(d)}return d.getMedia(a).then(b)}}angular.module("udb.media").service("MediaManager",a),a.$inject=["jobLogger","appConfig","$q","udbApi"]}(),function(){"use strict";function a(a,b,c,d){function e(){f()&&c.go(g.destination.state,{id:a.id})}function f(){return!!_.get(a,"location.id")}var g=this;g.completeMigration=e;var h={description:d.instant("eventForm.step4.continue"),state:"split.eventEdit"};g.destination=b.destination||h,g.migrationReady=f}angular.module("udb.migration").component("udbEventMigrationFooter",{templateUrl:"templates/event-migration-footer.component.html",controller:a,controllerAs:"migration"}),a.$inject=["EventFormData","$stateParams","$state","$translate"]}(),function(){"use strict";function a(){function a(a){return!!_.get(a,"location.id")}var b=this,c={location:a};b.checkRequirements=function(a){var b=_(c).pick(function(b){return!b(a)}).keys();return b.value()}}angular.module("udb.migration").service("eventMigration",a)}(),function(){"use strict";function a(a){function b(b){a.translateAddress(c.offer,b,c.translatedAddresses[b])}var c=this;c.translatedAddresses={},c.originalAddress=_.get(c.offer.address,c.offer.mainLanguage,"")||_.get(c.offer.address,"nl","")||_.get(c.offer,"address",""),c.translatedAddresses=_.get(c.offer,"address"),_.forEach(c.activeLanguages,function(a,b){void 0===c.translatedAddresses[b]&&(c.translatedAddresses[b]={postalCode:c.originalAddress.postalCode,addressLocality:c.originalAddress.addressLocality,addressCountry:c.originalAddress.addressCountry})}),c.saveTranslatedAddress=b}angular.module("udb.offer-translate").component("offerTranslateAddress",{templateUrl:"templates/translate-address.html",controller:a,controllerAs:"tac",bindings:{offer:"<",activeLanguages:"<"}}),a.$inject=["offerTranslator"]}(),function(){"use strict";function a(a){function b(b){a.translateProperty(c.offer,"description",b,c.translatedDescriptions[b]).then(function(){})}var c=this;c.translatedDescriptions={},c.originalDescription=_.get(c.offer.description,c.offer.mainLanguage,"")||_.get(c.offer.description,"nl","")||_.get(c.offer,"description",""),c.originalDescription=_.isEmpty(c.originalDescription)?"":c.originalDescription,c.translatedDescriptions=_.get(c.offer,"description"),c.saveTranslatedDescription=b}angular.module("udb.offer-translate").component("offerTranslateDescription",{templateUrl:"templates/translate-description.html",controller:a,controllerAs:"ttd",bindings:{offer:"<",activeLanguages:"<"}}),a.$inject=["offerTranslator"]}(),function(){"use strict";function a(a,b,c,d){function e(b){d.mainLanguage=b;a.open({templateUrl:"templates/event-form-image-upload.html",controller:"EventFormImageUploadController",resolve:{EventFormData:function(){return d}}})}function f(a,b){var d=null,e=new XMLHttpRequest;e.open("GET",a.contentUrl),e.responseType="blob",e.onload=function(){d=e.response,c.createImage(d,a.description,a.copyrightHolder,b).then(i,j)},e.send()}function g(b){a.open({templateUrl:"templates/event-form-image-edit.html",controller:"EventFormImageEditController",resolve:{EventFormData:function(){return d},mediaObject:function(){return b}}})}function h(b){a.open({templateUrl:"templates/event-form-image-remove.html",controller:"EventFormImageRemoveController",resolve:{EventFormData:function(){return d},image:function(){return b}}})}function i(a){function c(){d.addImage(a)}b.addImage(d,a).then(c,j)}function j(a){var b=a.data.title,c="Er ging iets mis bij het opslaan van de afbeelding.";switch(b){case"The uploaded file is not an image.":c="Het geüpload bestand is geen geldige afbeelding. Enkel bestanden met de extenties .jpeg, .gif of .png zijn toegelaten.";break;case"The file size of the uploaded image is too big.":c="Het geüpload bestand is te groot."}k.saving=!1,k.error=c}var k=this;d.init(),k.eventFormData=d,k.offer.mediaObject&&(d.mediaObjects=k.offer.mediaObject||[]),d.name=k.offer.name,d.apiUrl=k.offer.apiUrl,d.mainLanguage=k.offer.mainLanguage,k.openUploadImageModal=e,k.removeImage=h,k.editImage=g,k.copyImage=f}angular.module("udb.offer-translate").component("offerTranslateImages",{templateUrl:"templates/translate-images.html",controller:a,controllerAs:"tic",bindings:{offer:"<",activeLanguages:"<"}}),a.$inject=["$uibModal","eventCrud","MediaManager","EventFormData"]}(),function(){"use strict";function a(a){function b(){for(var b in e.offer.priceInfo)if(b>0){var c={};c[e.offer.mainLanguage]=e.originalTariffs[b-1],e.offer.priceInfo[b].name=_.merge(c,e.translatedTariffs[b-1])}a.updatePriceInfo(e.offer)}function c(){var a=[];for(var b in e.offer.priceInfo)b>0&&a.push(e.offer.priceInfo[b].name[e.offer.mainLanguage]?e.offer.priceInfo[b].name[e.offer.mainLanguage]:e.offer.priceInfo[b].name);return a}function d(){var a=[];for(var b in e.offer.priceInfo)b>0&&a.push(e.offer.priceInfo[b].name);return a}var e=this;e.translatedTariffs=[],e.originalTariffs=c(),e.translatedTariffs=d(),e.saveTranslatedTariffs=b}angular.module("udb.offer-translate").component("offerTranslateTariffs",{templateUrl:"templates/translate-tariffs.html",controller:a,controllerAs:"ttsc",bindings:{offer:"<",activeLanguages:"<"}}),a.$inject=["eventCrud"]}(),function(){"use strict";function a(a){function b(b){a.translateProperty(c.offer,"name",b,c.translatedNames[b]).then(function(){})}var c=this;c.translatedNames={},c.originalName=_.get(c.offer.name,c.offer.mainLanguage,null)||_.get(c.offer.name,"nl",null)||_.get(c.offer,"name",""),c.translatedNames=_.get(c.offer,"name"),c.saveTranslatedName=b}angular.module("udb.offer-translate").component("offerTranslateTitle",{templateUrl:"templates/translate-title.html",controller:a,controllerAs:"ttc",bindings:{offer:"<",activeLanguages:"<"}}),a.$inject=["offerTranslator"]}(),function(){"use strict";function a(a,b,c,d,e,f,g){function h(b){a.language=f.use()||"nl",a.cachedOffer=b,a.apiUrl=b.apiUrl,a.mainLanguage=b.mainLanguage?b.mainLanguage:"nl",a.translatedOffer=d(b,a.language,!0),a.originalName=a.translatedOffer.name,a.offerType=b.url.split("/").shift(),"event"===a.offerType?(a.isEvent=!0,a.isPlace=!1):(a.isEvent=!1,a.isPlace=!0),_.forEach(a.cachedOffer.name,function(b,c){a.activeLanguages[c]&&(a.activeLanguages[c].active=!0)}),a.activeLanguages[a.mainLanguage].main=!0,a.loaded=!0}function i(){console.log("offer not found")}function j(a){a?c.getOffer(a).then(h):i()}function k(){var b=a.cachedOffer.id.toString(),c=b.split("/").pop();g.go("split.eventEdit",{id:c})}function l(){g.go("split.footer.dashboard")}a.apiUrl="",a.loaded=!1,a.mainLanguage="",a.languages=["nl","fr","en","de"],a.activeLanguages={nl:{active:!1,main:!1},fr:{active:!1,main:!1},en:{active:!1,main:!1},de:{active:!1,main:!1}},a.openEditPage=k,a.goToDashboard=l,e.when(b).then(j,i)}angular.module("udb.offer-translate").controller("OfferTranslateController",a),a.$inject=["$scope","offerId","udbApi","jsonLDLangFilter","$q","$translate","$state"]}(),function(){"use strict";function a(){return{templateUrl:"templates/offer-translate.html",restrict:"EA"}}angular.module("udb.offer-translate").directive("udbOfferTranslate",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g){function h(){s.availableCountries=e.offerEditor.countries,s.defaultCountry=_.find(s.availableCountries,function(a){return a["default"]}),s.selectedCountry=s.defaultCountry,""!==s.address.addressCountry?s.selectedCountry={code:s.address.addressCountry,"default":!0}:s.selectedCountry=s.defaultCountry,s.address.addressCountry=s.selectedCountry.code,s.cities="BE"===s.selectedCountry.code?c:d,s.selectedCity="",s.requiredAddress=!1,s.address.addressLocality&&(s.hasAddress=!0,s.selectedCity=s.address.postalCode+" "+s.address.addressLocality,s.requiredAddress=!0)}function i(){s.streetHasErrors=!1,s.cityHasErrors=!1,s.zipValidateError=!1,s.zipHasErrors=!1,s.addressHasErrors=!1,s.addressRemovedError=!1,s.addressRemovedSuccess=!1}function j(){i(),s.requiredAddress?((""===s.address.streetAddress||void 0===s.address.streetAddress)&&(s.streetHasErrors=!0),""===s.selectedCity&&(s.cityHasErrors=!0),"NL"===s.selectedCountry.code&&(""===s.address.postalCode||void 0===s.address.postalCode)&&(s.zipHasErrors=!0,s.zipValidateError=!k(s.address.postalCode))):(""!==s.selectedCity&&((""===s.address.streetAddress||void 0===s.address.streetAddress)&&(s.streetHasErrors=!0),"NL"===s.selectedCountry.code&&(""===s.address.postalCode||void 0===s.address.postalCode)&&(s.zipHasErrors=!0,s.zipValidateError=!k(s.address.postalCode))),""!==s.address.streetAddress&&(""===s.selectedCity&&(s.cityHasErrors=!0),(""===s.address.postalCode||void 0===s.address.postalCode)&&(s.zipHasErrors=!0,s.zipValidateError=!k(s.address.postalCode))),"NL"===s.selectedCountry.code&&""!==s.address.postalCode&&((""===s.address.streetAddress||void 0===s.address.streetAddress)&&(s.streetHasErrors=!0),""===s.selectedCity&&(s.cityHasErrors=!0),s.zipValidateError=!k(s.address.postalCode))),r()}function k(a){var b=new RegExp(/^[0-9]{4}[a-z]{2}$/i);return b.test(a)}function l(a){return function(b){var c=(a.length,a.match(/\w+/g)),d=c.filter(function(a){return-1!==b.label.toLowerCase().indexOf(a.toLowerCase())});return d.length>=c.length}}function m(a){return function(c){return new b(a,c.label)}}function n(a,b){"BE"===s.selectedCountry.code&&(s.address.postalCode=a.zip),s.address.addressLocality=a.name,s.cityAutocompleteTextField="",s.selectedCity=b,j()}function o(){s.address.postalCode="",s.address.addressLocality="",s.selectedCity="",s.cityAutocompleteTextField="",j()}function p(){"NL"===s.selectedCountry.code?s.cities=d:s.cities=c,s.address.addressCountry=s.selectedCountry.code,o()}function q(){s.address.streetAddress="",o(),g.removeOrganizerAddress(t).then(function(a){s.hasAddress=!1,s.addressRemovedSuccess=!0})["catch"](function(a){s.addressRemovedError=!0})}function r(){s.addressHasErrors=s.streetHasErrors||s.cityHasErrors||s.zipHasErrors||s.zipValidateError,s.onUpdate({error:s.addressHasErrors})}var s=this,t=f.id;s.streetHasErrors=!1,s.cityHasErrors=!1,s.addressHasErrors=!1,s.zipHasErrors=!1,s.zipValidateError=!1,s.validateAddress=j,s.filterCities=l,s.orderByLevenshteinDistance=m,s.selectCity=n,s.changeCitySelection=o,s.changeCountrySelection=p,s.clearAddressInfo=q,s.$onInit=h,a.$on("organizerAddressSubmit",function(){s.organizerAddressForm.$setSubmitted(),i(),j()})}angular.module("udb.organizers").component("udbOrganizerAddress",{templateUrl:"templates/organizer-address.html",controller:a,controllerAs:"oac",bindings:{address:"=",onUpdate:"&"}}),a.$inject=["$scope","Levenshtein","citiesBE","citiesNL","appConfig","$stateParams","OrganizerManager"]}(),function(){"use strict";function a(a,b){function c(){_.find(j.contact,{value:""})||_.find(j.contact,{value:void 0})||j.organizerContactWrapper.$invalid&&j.organizerContactWrapper.$dirty?j.contactHasErrors=!0:j.contactHasErrors=!1,i()}function d(){j.newContact={type:"",value:""}}function e(a){j.newContact={type:a,value:""},j.isPristine=!0,j.addingContactEntry=!0}function f(){d(),j.addingContactEntry=!1,j.isPristine=!0}function g(){c(),j.contactHasErrors||(j.contact.push(j.newContact),d(),j.addingContactEntry=!1,j.isPristine=!0,i())}function h(a){j.contact.splice(a,1),c()}function i(){j.onUpdate({error:j.contactHasErrors})}var j=this;j.newContact={},j.addingContactEntry=!1,j.isPristine=!0,j.validateContact=c,j.addOrganizerContactEntry=e,j.cancelOrganizerContactEntry=f,j.addOrganizerContactInfo=g,j.deleteOrganizerContactInfo=h,j.sendUpdate=i,j.contactUrlRegex=(new b).regex.url,a.$on("organizerContactSubmit",function(){j.organizerContactWrapper.$setSubmitted()}),a.$watch(function(){return j.newContact},function(a){a&&a.value&&""!==a.value&&(j.isPristine=!1)},!0)}angular.module("udb.organizers").component("udbOrganizerContact",{templateUrl:"templates/organizer-contact.html",controller:a,controllerAs:"occ",bindings:{contact:"=",onUpdate:"&"}}),a.$inject=["$scope","UdbOrganizer"]}(),function(){"use strict";function a(a,b,c,d,e,f){function g(b){a.get(b).then(h),f.getOrganizerPermissions(b).then(function(a){v.permissions=a.permissions})}function h(a){v.organizer=a}function i(b){v.labelSaving=!0,l(),a.addLabelToOrganizer(w,b.name)["catch"](s)["finally"](function(){v.labelSaving=!1,k()})}function j(b){v.labelSaving=!0,l(),k(),a.deleteLabelFromOrganizer(w,b.name)["catch"](r)["finally"](function(){v.labelSaving=!1})}function k(){a.removeOrganizerFromCache(w)}function l(){v.labelResponse="",v.labelsError=""}function m(){return-1!==x.indexOf("manage")}function n(){d.path("/manage/organizations")}function o(){q(v.organizer)}function p(){var a=d.search();return"true"===a.ownership}function q(a){var c=b.open({templateUrl:"templates/organization-delete.modal.html",controller:"OrganizationDeleteModalController",controllerAs:"odc",resolve:{organization:function(){return a}}});c.result.then(n)}function r(a){g(w),v.labelResponse="unlabelError",v.labelsError=a.title}function s(a){v.errorMessage=a.title+(a.detail?" "+a.detail:"");b.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"sm",resolve:{errorMessage:function(){return v.errorMessage}}})}function t(){return v.organizer&&!v.loadingError}function u(){return-1!==v.permissions.indexOf("Organisaties bewerken")}var v=this,w=c.id,x=e.current.name;v.labelSaving=!1,v.addLabel=i,v.deleteLabel=j,v.labelResponse="",v.labelsError="",v.deleteOrganization=o,v.isManageState=m,v.finishedLoading=t,v.canEdit=u,v.isOwnershipEnabled=p,v.permissions=[],g(w)}angular.module("udb.organizers").controller("OrganizerDetailController",a),a.$inject=["OrganizerManager","$uibModal","$stateParams","$location","$state","udbApi"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i){function j(){x.organizer={mainLanguage:A,website:"http://",name:"",address:{streetAddress:"",addressLocality:"",postalCode:"",addressCountry:""},contact:[]},x.showAddressComponent=!0}function k(b){a.removeOrganizerFromCache(b),a.get(b).then(l,function(){x.loadingError=!0})["finally"](function(){x.showAddressComponent=!0})}function l(a){_.isEmpty(a.address)&&(a.address={streetAddress:"",addressLocality:"",postalCode:"",addressCountry:""}),x.organizer=a,B=_.cloneDeep(a),x.originalName=B.name,null!==x.organizer.contactPoint&&(_.forEach(x.organizer.contactPoint,function(a,b){_.forEach(a,function(a){x.contact.push({type:b,value:a})})}),C=_.cloneDeep(x.contact))}function m(){return x.showWebsiteValidation=!0,x.organizerForm.website.$valid?void b.findOrganizersWebsite(x.organizer.website).then(function(a){x.urlError=!1,a.totalItems>0?a.member[0].name===x.originalName?(x.showWebsiteValidation=!1,x.organizersWebsiteFound=!1):(x.organizersWebsiteFound=!0,x.showWebsiteValidation=!1):(x.showWebsiteValidation=!1,x.organizersWebsiteFound=!1)},function(){x.websiteError=!0,x.showWebsiteValidation=!1})["finally"](function(){r()}):(x.showWebsiteValidation=!1,void(x.urlError=!0))}function n(){x.organizerForm.name.$valid?x.nameError=!1:x.nameError=!0,r()}function o(a){x.addressError=a,r()}function p(a){x.contactError=a,r()}function q(){return x.showValidation=!0,!x.organizerForm.$valid||x.organizersWebsiteFound||x.websiteError||x.urlError||x.nameError||x.addressError||x.contactError?(x.hasErrors=!0,x.disableSubmit=!0,f.$broadcast("organizerAddressSubmit"),void f.$broadcast("organizerContactSubmit")):void(x.isNew?t():s())}function r(){D=!_.isEqual(x.organizer.website,B.website),E=!_.isEqual(x.organizer.name,B.name),F=!_.isEqual(x.organizer.address,B.address)&&!_.isEmpty(x.organizer.address.streetAddress),G=!_.isEqual(x.contact,C),D||E||F||G?x.disableSubmit=!1:x.disableSubmit=!0,!x.organizerForm.$valid||x.organizersWebsiteFound||x.websiteError||x.urlError||x.nameError||x.addressError||x.contactError||(x.hasErrors=!1)}function s(){var b=[];D&&b.push(a.updateOrganizerWebsite(y,x.organizer.website)),E&&b.push(a.updateOrganizerName(y,x.organizer.name,A)),F&&b.push(a.updateOrganizerAddress(y,x.organizer.address,A)),G&&b.push(a.updateOrganizerContact(y,x.contact)),b.push(a.removeOrganizerFromCache(y)),e.all(b).then(function(){v()})["catch"](function(){x.hasErrors=!0,x.saveError=!0})}function t(){var b=_.clone(x.organizer);b.address.streetAddress||b.address.addressLocality||b.address.postalCode||delete b.address,h.createOrganizer(b).then(function(b){var c=_.get(i,"offerEditor.defaultOrganizerLabel");"undefined"!=typeof c&&""!==c&&a.addLabelToOrganizer(b.data.organizerId,c),x.organizer.id=b.data.organizerId,v()},function(){x.hasErrors=!0,x.saveError=!0})}function u(){w()?c.go("management.organizers.search",{},{reload:!0}):c.go("split.footer.dashboard",{},{reload:!0})}function v(){a.removeOrganizerFromCache(x.organizer.id),c.go("split.organizerDetail",{id:x.organizer.id},{reload:!0})}function w(){return-1!==z.indexOf("manage")}var x=this,y=d.id,z=c.current.name,A=g.use()||"nl";x.language=A,x.showAddressComponent=!1,x.isNew=!0,x.loadingError=!1,x.contact=[],x.showWebsiteValidation=!1,x.urlError=!1,x.websiteError=!1,x.nameError=!1,x.addressError=!1,x.contactError=!1,x.hasErrors=!1,x.disableSubmit=!0,x.saveError=!1,x.validateWebsite=m,x.validateName=n,x.validateAddress=o,x.validateContact=p,x.checkChanges=r,x.validateOrganizer=q,x.cancel=u,x.isManageState=w;var B={},C=[],D=!1,E=!1,F=!1,G=!1;y?(x.isNew=!1,k(y)):j()}a.$inject=["OrganizerManager","udbOrganizers","$state","$stateParams","$q","$scope","$translate","eventCrud","appConfig"],angular.module("udb.organizers").controller("OrganizerFormController",a)}(),function(){"use strict";function a(a){var b=this;b["delete"]=function(b){return a.deleteOrganization(b)},b.find=function(b,c,d){return a.findOrganisations(d,c,null,b)},b.get=function(b){return a.getOrganizerById(b)},b.addLabelToOrganizer=function(b,c){return a.addLabelToOrganizer(b,c)},b.deleteLabelFromOrganizer=function(b,c){return a.deleteLabelFromOrganizer(b,c)},b.removeOrganizerFromCache=function(b){return a.removeItemFromCache(b)},b.updateOrganizerWebsite=function(b,c){return a.updateOrganizerWebsite(b,c)},b.updateOrganizerName=function(b,c,d){return a.updateOrganizerName(b,c,d)},b.updateOrganizerAddress=function(b,c,d){return a.updateOrganizerAddress(b,c,d)},b.removeOrganizerAddress=function(b){return a.removeOrganizerAddress(b)},b.updateOrganizerContact=function(b,c,d){return a.updateOrganizerContact(b,c,d)}}angular.module("udb.organizers").service("OrganizerManager",a),a.$inject=["udbApi"]}(),function(){"use strict";function a(){return{templateUrl:"templates/place-detail.html",restrict:"EA",controller:PlaceDetail}}angular.module("udb.place-detail").directive("udbPlaceDetail",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l,m,n){function o(b){var c=b[0],d=b[1];n.getPermissions().then(function(b){a.isGodUser=_.filter(b,function(a){return a===m.GEBRUIKERS_BEHEREN}).length>0,a.isGodUser?a.permissions={editing:!0,duplication:!0}:c?a.permissions={editing:!d.isExpired(),duplication:!0}:a.permissions={editing:!1,duplication:!1},p()})}function p(){a.isGodUser?a.tabs=[{id:"data"},{id:"history"},{id:"publication"}]:a.tabs=[{id:"data"},{id:"publication"}]}function q(b){B=b,a.place=e(b,A,!0),a.placeIdIsInvalid=!1,"object"==typeof a.place.description&&(a.place.description=a.place.description[A],void 0===a.place.description&&(a.place.description="")),a.finishedLoading=!0,b.typicalAgeRange.indexOf("-")===b.typicalAgeRange.length-1?a.ageRange=b.typicalAgeRange.slice(0,-1)+"+":a.ageRange=b.typicalAgeRange}function r(b){a.placeIdIsInvalid=!0}function s(a){function b(a,b){var c=g.open({templateUrl:"templates/place-delete-confirm-modal.html",controller:"PlaceDeleteConfirmModalCtrl",resolve:{place:function(){return a},events:function(){return b}}});c.result.then(z.goToDashboard)}f.findEventsAtPlace(a.apiUrl).then(function(c){b(a,c)})}function t(b){a.placeHistory=b}function u(b){var c=_.find(B.labels,function(a){return b.name.toUpperCase()===a.toUpperCase()});c?i.alert('Het label "'+b.name+'" is reeds toegevoegd als "'+c+'".'):j.label(B,b.name).then(function(b){b.success?(a.labelResponse="success",a.addedLabel=b.name):(a.labelResponse="error",a.labelsError=b),a.place.labels=angular.copy(B.labels)})}function v(){a.labelResponse="",a.labelsError=""}function w(b){a.place.labels=angular.copy(B.labels),a.labelResponse="unlabelError",a.labelsError=b.title}function x(a){v(),j.unlabel(B,a.name)["catch"](w)}var y="data",z=this,A=l.use()||"nl";a.isOmdApp=!!_.get(k,"omdSpecific",!1),h.when(b,function(b){a.placeId=b;var d=c.getOffer(b),e=c.hasPermission(b);d.then(q,r),h.all([e,d]).then(o)}),a.placeIdIsInvalid=!1,a.labelAdded=u,a.labelRemoved=x,a.labelResponse="",a.labelsError="",a.finishedLoading=!1,a.placeHistory=void 0,a.deletePlace=function(){s(a.place)},a.language=A;var B;a.placeLocation=function(a){return a.address.addressLocality?a.address.addressLocality:""},a.isTabActive=function(a){return a===y},a.makeTabActive=function(b){if(y=b,"history"===b&&!a.placeHistory){var d=a.placeId.split("/").pop();c.getHistory(d,"place").then(t)}},a.openEditPage=function(){var b=a.placeId.toString(),c=b.split("/").pop();d.go("split.placeEdit",{id:c})},a.openTranslatePage=function(){var b=a.placeId.toString(),c=b.split("/").pop();d.go("split.placeTranslate",{id:c})},z.goToDashboard=function(){d.go("split.footer.dashboard")},a.translateType=function(a){var b=l.instant("offerTypes."+a);return _.includes(b,"offerTypes.")?a:b}}angular.module("udb.place-detail").controller("PlaceDetailController",a),a.$inject=["$scope","placeId","udbApi","$state","jsonLDLangFilter","eventCrud","$uibModal","$q","$window","offerLabeller","appConfig","$translate","RolePermission","authorizationService"]}(),function(){"use strict";function a(a,b){function c(a,b){g[a]=b}function d(a){_.each(a.member,function(a){var b=a["@id"],d=b.split("/").pop();c(d,b)})}function e(b){var c=g[b];return c?a.resolve(c):f(b)}function f(d){function e(a){if(1===a.totalItems){var b=a.member[0]["@id"];c(d,b),f.resolve(b)}else f.reject("Unable to determine the exact offer for this uuid.")}var f=a.defer(),g='id:"'+d+'"',h=0,i=!0;return b.findOffers(g,h,i).then(e)["catch"](f.reject),f.promise}var g={};this.get=e,this.add=c,this.addPagedCollection=d}angular.module("udb.router").service("offerLocator",a),a.$inject=["$q","udbApi"]}(),function(){"use strict";function a(a,b){var c=function(){b.close()},d=function(){b.dismiss("cancel")};a.cancel=d,a.confirm=c}angular.module("udb.saved-searches").controller("DeleteSearchModalController",a),a.$inject=["$scope","$uibModalInstance"]}(),function(){"use strict";function a(a,b,c,d,e){var f=function(b){var c=a.queryName,e=a.queryId;a.wasSubmitted=!0,"existing"===b&&d.close({id:e,name:c,type:b}),"new"===b&&c&&d.close({name:c,type:b})},g=function(){d.dismiss("cancel")},h=function(b){return b===a.activeTabId},i=function(){return b.getSavedSearches().then(function(a){var b=a.map(function(a){var b="search.savedSearches.items."+a.name.toString(),c=e.instant(b);return c!==b&&(a.name=c),a});return c.resolve(b)})},j=function(b){a.activeTabId=b,"existing"===b&&i().then(function(b){a.savedSearches=b})},k=function(){var b=a.savedSearches.find(function(b){return b.id===a.queryId});b&&(a.queryName=b.name)};a.savedSearches=[],a.cancel=g,a.ok=f,a.isTabActive=h,a.makeTabActive=j,a.setQueryName=k,a.queryName="",a.queryId="",a.activeTabId="new",a.wasSubmitted=!1}angular.module("udb.saved-searches").controller("SaveSearchModalController",a),a.$inject=["$scope","udbApi","$q","$uibModalInstance","$translate"]}(),function(){"use strict";function a(a,b){function c(c,e,f,g){c.saveSearch=function(){var e=b.open({templateUrl:"templates/save-search-modal.html",controller:"SaveSearchModalController"});e.result.then(function(b){"new"===b.type&&a.createSavedSearch(b.name,c.queryString)["catch"](d),"existing"===b.type&&a.editSavedSearch(b.id,b.name,c.queryString)["catch"](d)})},c.openAnnouncementModal=function(){window.parent.postMessage({source:"UDB",type:"OPEN_ANNOUNCEMENT_MODAL",id:"2833ab49-cf44-4504-89d1-f6ba3f81aa63"},"*")}}function d(){b.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"lg",resolve:{errorMessage:function(){return"Het opslaan van de zoekopdracht is mislukt. Controleer de verbinding en probeer opnieuw."}}})}var e={link:c,templateUrl:"templates/save-search.directive.html",restrict:"AE",scope:{queryString:"=udbQueryString"}};return e}angular.module("udb.saved-searches").directive("udbSaveSearch",a),a.$inject=["savedSearchesService","$uibModal"]}(),function(){"use strict";function a(a,b,c,d,e,f,g){function h(){e.$emit("savedSearchesChanged",i)}var i=[],j=this;j.createSavedSearch=function(b,c){return f.createSavedSearch(b,c).then(function(){return i.push({name:b,query:c}),h(),a.resolve()})},j.getSavedSearches=function(){return f.getSavedSearches().then(function(b){var c=b.map(function(a){var b="search.savedSearches.items."+a.name.toString(),c=g.instant(b);return c!==b&&(a.name=c),a});return i=c,a.resolve(c)})},j.deleteSavedSearch=function(b){return f.deleteSavedSearch(b).then(function(){return _.remove(i,{id:b}),h(),a.resolve()})},j.editSavedSearch=function(b,c,d){return f.editSavedSearch(b,c,d).then(function(){var c=_.find(i,{id:b});return c.query=d,h(),a.resolve()})}}angular.module("udb.saved-searches").service("savedSearchesService",a),a.$inject=["$q","$http","$cookies","appConfig","$rootScope","udbApi","$translate"]}(),function(){"use strict";function a(a,b,c,d){a.savedSearches=[],a.editorOptions={mode:"solr",lineWrapping:!0,readOnly:!0},a.codemirrorLoaded=function(a){a.on("focus",function(){a.execCommand("selectAll")}),a.on("blur",function(){a.setCursor(0,0,!0)})};var e=b.getSavedSearches();e.then(function(b){a.savedSearches=b}),d.$on("savedSearchesChanged",function(b,c){a.savedSearches=c}),this.encodeURI=function(a){return encodeURIComponent(a)},a.encodeURI=this.encodeURI,this.deleteSavedSearch=function(a){var d=c.open({templateUrl:"templates/delete-search-modal.html",controller:"DeleteSearchModalController"});d.result.then(function(){var d=b.deleteSavedSearch(a);d["catch"](function(){c.open({templateUrl:"templates/unexpected-error-modal.html",controller:"UnexpectedErrorModalController",size:"lg",resolve:{errorMessage:function(){return"Het verwijderen van de zoekopdracht is mislukt. Controleer de verbinding en probeer opnieuw."; }}})})})},a.deleteSavedSearch=this.deleteSavedSearch}angular.module("udb.saved-searches").controller("SavedSearchesListController",a),a.$inject=["$scope","savedSearchesService","$uibModal","$rootScope"]}(),function(){"use strict";function a(){var a={restrict:"AE",controller:"OfferController",controllerAs:"eventCtrl",templateUrl:"templates/event-link.directive.html"};return a}angular.module("udb.event-form").directive("udbEventLink",a)}(),function(){"use strict";function a(a,b){function c(a){m.labels=f(_.get(a,"labels.currentValue",m.labels))}function d(a){m.currentLabel="",m.labelAdded({label:a}),m.labels.push(a)}function e(a){m.currentLabel="",m.labelRemoved({label:a}),m.labels=_.without(m.labels,a)}function f(a){return _.map(m.labels,function(a){return _.isString(a)?{name:a}:a})}function g(a){return a>=m.minimumInputLength&&a<=m.maxInputLength}function h(a){return m.regex.test(a)}function i(a){if(h(a)){var b=_.find(m.labels,function(b){return b.name.toUpperCase()===a.toUpperCase()});if(!b&&m.areLengthCriteriaMet(a.length)&&m.areContentCriteriaMet(a))return{name:a}}}function j(b){return a.getSuggestions(b,6).then(function(a){return a.push({name:b}),l(a)})}function k(a){return h(a)?(l([]),j(a)):void l([])}function l(a){return m.availableLabels=_.chain(a).filter(function(a){return h(a.name)}).reject(function(a){return _.find(m.labels,{name:a.name})}).uniq(function(a){return a.name.toUpperCase()}).value(),m.availableLabels}var m=this;m.availableLabels=[],m.suggestLabels=k,m.createLabel=i,m.areLengthCriteriaMet=g,m.areContentCriteriaMet=h,m.labels=f(m.labels),m.hiddenLabels=["new-entry-form","ook voor jongeren","ook voor kinderen"],m.minimumInputLength=2,m.maxInputLength=50,m.currentLabel="",m.onSelect=d,m.onRemove=e,m.$onChanges=c,m.regex=/^([a-zA-Z0-9ŠŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]{1}[a-zA-Z0-9ŠŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ_-\s]+)$/}angular.module("udb.search").component("udbLabelSelect",{templateUrl:"templates/label-select.html",controller:a,controllerAs:"select",bindings:{labels:"<",labelAdded:"&",labelRemoved:"&"}}),a.$inject=["offerLabeller","$q"]}(),function(){"use strict";function a(a,b){var c=this;c.changeFacilities=function(){b.open({templateUrl:"templates/search-facilities-modal.html",controller:"SearchFacilitiesModalController",resolve:{offer:function(){return c.offer},facilities:function(){return"place"===c.offerType?_.pick(a,"place"):_.omit(a,"place")}}})}}angular.module("udb.search").component("udbOfferAccessibilityInfo",{templateUrl:"templates/offer-accessibility-info.component.html",controller:a,bindings:{offerType:"<",offer:"="}}),a.$inject=["facilities","$uibModal"]}(),function(){"use strict";function a(a,b){return{templateUrl:"templates/query-editor-daterangepicker.directive.html",restrict:"E",link:function(c,d,e){var f={startOpened:!1,endOpened:!1,dateFormat:"dd/MM/yyyy"};a(["datepicker.CURRENT","datepicker.CLEAR","datepicker.CLOSE"]).then(function(a){b.currentText=a["datepicker.CURRENT"],b.clearText=a["datepicker.CLEAR"],b.closeText=a["datepicker.CLOSE"]}),f.openStart=function(a){a.preventDefault(),a.stopPropagation(),f.startOpened=!0,f.endOpened=!1},f.openEnd=function(a){a.preventDefault(),a.stopPropagation(),f.startOpened=!1,f.endOpened=!0},c.drp=f}}}function b(){return{restrict:"EAC",require:"ngModel",link:function(a,b,c,d){d.$formatters.shift()}}}angular.module("udb.search").directive("udbQueryEditorDaterangepicker",a),a.$inject=["$translate","uibDatepickerPopupConfig"],angular.module("udb.search").directive("datepickerPopup",b)}(),function(){"use strict";function a(a){function b(){var b;return b=d()?a.$parent.field:a.rootGroup}function c(){var c,e=b();return c=d()&&0===a.$index?"AND":a.$index?e.operator:"FIRST"}function d(){var b=a.$parent;return"group"===b.field.type}function e(){var b=a.rootGroup;return b.nodes.length>1}a.addField=function(c){a.qe.addField(b(),c)},a.removeField=function(c){a.qe.removeField(b(),c,a.rootGroup)},a.addSubGroup=function(c){var e=a.rootGroup,f=_.uniqueId(),g=b();g.treeGroupId=f,d()&&(c=_.findIndex(e.nodes,function(a){return a.treeGroupId===f})),a.qe.addSubGroup(e,c)},a.isSubGroup=d,a.getOperatorClass=c,a.canRemoveField=e}angular.module("udb.search").controller("QueryEditorFieldController",a),a.$inject=["$scope"]}(),function(){"use strict";function a(){return{templateUrl:"templates/query-editor-field.directive.html",restrict:"E",controller:"QueryEditorFieldController"}}angular.module("udb.search").directive("udbQueryEditorField",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k){function l(a,b){return a.getDate()===b.getDate()&&a.getMonth()===b.getMonth()&&a.getFullYear()===b.getFullYear()}function m(a){return"tokenized-string"===a.fieldType?"="===a.transformer?"+":"-":"date-range"===a.fieldType?"*"===a.upperBound?">":"*"===a.lowerBound?"<":l(a.lowerBound,a.upperBound)?"=":"><":"check"===a.fieldType?"=":a.transformer}function n(a){var b=d.filter(function(b){return b.id===a}),c=b[0];return"theme"===c.domain?"category_theme_name":"facility"===c.domain?"category_facility_name":"eventtype"===c.domain?c.scope&&-1!==c.scope.indexOf("events")?"category_eventtype_name":"locationtype":void 0}var o=this,p=c;o.fieldOptions=_.filter(b,"editable");var q=_.chain(o.fieldOptions).map(function(a){return a.group}).uniq().value();_.forEach(o.fieldOptions,function(a){var b="queryFieldLabel."+a.name,c="queryFieldGroup."+a.group;h([b,c]).then(function(d){a.label=d[b],a.groupIndex=_.indexOf(q,a.group),a.groupLabel=d[c]})}),o.getDefaultQueryTree=function(){return{type:"root",nodes:[{type:"group",operator:"OR",nodes:[{name:"title",field:"name.\\*",term:"",fieldType:"tokenized-string",transformer:"+"}]}]}},o.groupedQueryTree=g.getQueryTree()||o.getDefaultQueryTree();var r=b.filter(function(a){return a.hasOwnProperty("name")&&"startdate"!==a.name&&"enddate"!==a.name}).reduce(function(a,b){return a[b.field]=b,a},{}),s=b.filter(function(a){return"startdate"!==a.name&&"enddate"!==a.name}).reduce(function(a,b){return a[b.name]=b,a},{});o.parseModalValuesFromQuery=function(b){var c=a.parse(b),d=p.groupQueryTree(c);if(d.nodes=d.nodes.map(function(a){return"field"===a.type&&(a.type="group"),a.nodes=a.nodes.map(function(a){if(a.name=r[a.field].name,a.fieldType=r[a.field].type||"unknown","date-range"===a.fieldType&&(a.lowerBound="*"===a.lowerBound?"*":new Date(a.lowerBound.replace(/\\/g,"")),a.upperBound="*"===a.upperBound?"*":new Date(a.upperBound.replace(/\\/g,"")),delete a.term),"terms.id"===a.field){var b=n(a.term),c=s[b]||{};a.name=c.name}return"permanent"===a.name&&"!"===a.transformer&&(a.term="(!permanent)"),a.transformer=m(a),a}),a}),d.nodes=d.nodes.filter(function(a){return a.nodes.length>0}),"AND"===d.nodes[0].operator&&d.nodes.length>1&&1===d.nodes[0].nodes.length){var e=d.nodes[0];d.nodes.splice(0,1),d.nodes[0].nodes.push(e)}return d};var t=new URL(window.location.href),u=t.searchParams?t.searchParams.get("query"):void 0;if(u){var v=o.parseModalValuesFromQuery(u);o.groupedQueryTree=v}o.transformers={},o.termOptions=_.groupBy(d,function(a){return"category_"+a.domain+"_name"}),o.termOptions.locationtype=k,o.termOptions.nisRegions=e,o.termOptions.category_eventtype_name=j,_.forEach(b,function(a){"choice"===a.type&&(o.termOptions[a.name]=a.options),o.transformers[a.name]=f[a.type]}),o.updateQueryString=function(){g.setQueryTree(o.groupedQueryTree),i.$emit("searchSubmitted"),o.stopEditing()},o.stopEditing=function(){i.$emit("stopEditingQuery")},o.addField=function(a,b){var c=b+1,d={field:"name.\\*",name:"title",term:"",fieldType:"tokenized-string",transformer:"+"};a.nodes.splice(c,0,d),a.nodes.length&&(a.type="group",a.operator="OR")},o.removeField=function(a,b,c){c.nodes.length>1&&a.nodes.splice(b,1),o.cleanUpGroups()},o.cleanUpGroups=function(){o.removeEmptyGroups(),o.unwrapSubGroups()},o.unwrapSubGroups=function(){var a=o.groupedQueryTree;_.forEach(a.nodes,function(a){var b=a.nodes[0];if(b.nodes){var c=b.nodes;a.nodes.splice(0,1),_.forEach(c,function(b,c){a.nodes.splice(c,0,b)})}})},o.removeEmptyGroups=function(){var a=o.groupedQueryTree;_.forEach(a.nodes,function(a){_.remove(a.nodes,function(a){return a.nodes&&0===a.nodes.length})})},o.toggleExcludeGroup=function(a){a.excluded=!a.excluded},o.canRemoveGroup=function(){return!o.hasSingleGroup()},o.removeGroup=function(a){if(o.canRemoveGroup()){var b=o.groupedQueryTree,c=b.nodes[a];o.canRemoveGroup()&&c&&b.nodes.splice(a,1)}},o.resetGroups=function(){o.groupedQueryTree=o.getDefaultQueryTree()},o.addGroup=function(){var a=o.groupedQueryTree,b={type:"group",operator:"OR",nodes:[{field:"name.\\*",name:"title",term:"",fieldType:"tokenized-string",transformer:"+"}]};a.nodes.push(b)},o.addSubGroup=function(a,b){var c={type:"group",operator:"AND",nodes:[{field:"name.\\*",name:"title",term:"",fieldType:"tokenized-string",transformer:"+"}]};a.nodes.splice(b+1,0,c)},o.fieldTypeSelected=function(a){var c=a.name,d=_.find(b,function(a){return a.name===c});d&&(a.field=d.field),a.fieldType!==d.type&&("date-range"===d.type?(a.lowerBound=moment().startOf("day").toDate(),a.upperBound=moment().endOf("day").toDate(),a.inclusive=!0):(a.term="",a.lowerBound=void 0,a.upperBound=void 0,a.inclusive=void 0),"check"===d.type&&(a.term=d.name),"number"===d.type&&(a.inclusive=!0),a.transformer&&_.contains(f[d.type],a.transformer)||(a.transformer=_.first(f[d.type])),a.fieldType=d.type)},o.hasSingleGroup=function(){return 1===o.groupedQueryTree.nodes.length}}angular.module("udb.search").controller("QueryEditorController",a),a.$inject=["LuceneQueryParser","queryFields","LuceneQueryBuilder","taxonomyTerms","sapi3CitiesBE","fieldTypeTransformers","searchHelper","$translate","$rootScope","eventTypes","placeTypes"]}(),function(){"use strict";function a(){return{templateUrl:"templates/query-editor.directive.html",restrict:"EA",controllerAs:"qe",controller:"QueryEditorController"}}angular.module("udb.search").directive("udbQueryEditor",a)}(),function(){"use strict";function a(a,b,c,d,e){return{templateUrl:"templates/search-bar.directive.html",restrict:"E",link:function(f,g,h){function i(a){return a.map(function(a){if(0===a.indexOf("Expected "))return d.instant("search.advancedQueryBuilder.syntaxError");var b=" is not a valid search field";if(-1!==a.indexOf(b)){var c=a.split(b)[0];return d.instant("search.advancedQueryBuilder.invalidField",{field:c})}return a})}function j(a){l.savedSearches=_.take(a,5)}var k,l={queryString:"",hasErrors:!1,errors:[],isEditing:!1,savedSearches:[]};l.editQuery=function(){b.$emit("startEditingQuery"),l.isEditing=!0,k=c.open({templateUrl:"templates/query-editor-modal.html",controller:"QueryEditorController",controllerAs:"qe",size:"lg"})},l.find=function(c){var d="undefined"!=typeof c?c:l.queryString;l.queryString=d,a.setQueryString(d),b.$emit("searchSubmitted")},l.queryChanged=function(){a.clearQueryTree()},f.sb=l,l.updateQuery=function(a,b){l.queryString=b.queryString,b.errors&&b.errors.length?(f.sb.hasErrors=!0,f.sb.errors=i(b.errors)):(f.sb.hasErrors=!1,f.sb.errors=[])},e.getSavedSearches().then(j);var m=b.$on("savedSearchesChanged",function(a,b){j(b)}),n=b.$on("stopEditingQuery",function(){f.sb.isEditing=!1,k&&k.dismiss()}),o=b.$on("searchQueryChanged",l.updateQuery);f.$on("$destroy",m),f.$on("$destroy",n),f.$on("$destroy",o)}}}angular.module("udb.search").directive("udbSearchBar",a),a.$inject=["searchHelper","$rootScope","$uibModal","$translate","savedSearchesService"]}(),function(){"use strict";angular.module("udb.search").value("eventTypes",[{label:"Begeleide uitstap of rondleiding",id:"0.7.0.0.0"},{label:"Beurs",id:"0.6.0.0.0"},{label:"Concert",id:"0.50.4.0.0"},{label:"Lessenreeks",id:"0.3.1.0.0"},{label:"Cursus met open sessies",id:"0.3.1.0.1"},{label:"Dansvoorstelling",id:"0.54.0.0.0"},{label:"Eet- of drankfestijn",id:"1.50.0.0.0"},{label:"Festival",id:"0.5.0.0.0"},{label:"Film",id:"0.50.6.0.0"},{label:"Kamp of vakantie",id:"0.57.0.0.0"},{label:"Festiviteit",id:"0.28.0.0.0"},{label:"Lezing of congres",id:"0.3.2.0.0"},{label:"Markt, braderie of kermis",id:"0.37.0.0.0"},{label:"Opendeurdag",id:"0.12.0.0.0"},{label:"Party of fuif",id:"0.49.0.0.0"},{label:"Fiets- of wandelroute",id:"0.17.0.0.0"},{label:"Spel of quiz",id:"0.50.21.0.0"},{label:"Sportactiviteit",id:"0.59.0.0.0"},{label:"Sportwedstrijd bekijken",id:"0.19.0.0.0"},{label:"Tentoonstelling",id:"0.0.0.0.0"},{label:"Theatervoorstelling",id:"0.55.0.0.0"}])}(),function(){"use strict";function a(){return function(a,b){var c={EUR:{symbol:"",thousand:".",decimal:",",format:"%s%v",precision:2}},d=c[b];return d||(d=c.EUR),accounting.formatMoney(a,d)}}angular.module("udb.search").filter("currency",a)}(),function(){"use strict";function a(){return function(a,b){var c=_.filter(a,function(a){return"undefined"!=typeof a?"schema:ImageObject"===a["@type"]&&(a.inLanguage===b||angular.isUndefined(a.inLanguage)):void 0});return c}}angular.module("udb.search").filter("imagesByLanguage",a)}(),function(){"use strict";function a(){return function(a,b,d){var e=_.cloneDeep(a);return e=c(e,b,d)}}function b(a){return 2===a.length}function c(a,d,e){return a=_.each(a,function(f,g){if(_.isObject(f)){var h=Object.keys(f);if(h.length>0&&h.every(b)){if(f[d])a[g]=f[d];else if(e){var i=h[0],j=f[i];a[g]=j}}else f=c(f,d,e)}})}angular.module("udb.search").filter("jsonLDLang",a)}(),function(){"use strict";angular.module("udb.search").value("placeTypes",[{label:"Archeologische site",id:"3CuHvenJ+EGkcvhXLg9Ykg"},{label:"Bibliotheek of documentatiecentrum",id:"kI7uAyn2uUu9VV6Z3uWZTA"},{label:"Bioscoop",id:"BtVNd33sR0WntjALVbyp3w"},{label:"Cultuur- of ontmoetingscentrum",id:"Yf4aZBfsUEu2NsQqsprngw"},{label:"Discotheek",id:"YVBc8KVdrU6XfTNvhMYUpg"},{label:"Horeca",id:"ekdc4ATGoUitCa0e6me6xA"},{label:"Jeugdhuis of jeugdcentrum",id:"JCjA0i5COUmdjMwcyjNAFA"},{label:"Monument",id:"0.14.0.0.0"},{label:"Museum of galerij",id:"GnPFp9uvOUyqhOckIFMKmg"},{label:"Natuur, park of tuin",id:"0.15.0.0.0"},{label:"Openbare ruimte",id:"0.8.0.0.0"},{label:"Recreatiedomein of centrum",id:"0.53.0.0.0"},{label:"School of onderwijscentrum",id:"rJRFUqmd6EiqTD4c7HS90w"},{label:"Sportcentrum",id:"eBwaUAAhw0ur0Z02i5ttnw"},{label:"Thema of pretpark",id:"0.41.0.0.0"},{label:"Winkel",id:"VRC6HX0Wa063sq98G5ciqw"},{label:"Speeltuin",id:"wwjRVmExI0w6xfQwT1KWpx"},{label:"Zaal of expohal",id:"OyaPaf64AEmEAYXHeLMAtA"}])}(),function(){"use strict";angular.module("udb.search").value("fieldTypeTransformers",{string:["=","!"],"tokenized-string":["+","-"],choice:["=","!"],term:["=","!"],termNis:["=","!"],number:["=","><","<",">"],check:["="],"date-range":["=","><","<",">"]})}(),function(){"use strict";function a(a,b,c,d,e){function f(a){"date-range"===a.fieldType&&g(a);var b=h(a);return b.field+k(b)}function g(a){"="===a.transformer&&moment(a.lowerBound).isValid()&&(a.lowerBound=moment(a.lowerBound).startOf("day").toDate(),a.upperBound=moment(a.lowerBound).endOf("day").toDate()),"><"===a.transformer&&(moment(a.lowerBound).isValid()?a.lowerBound=moment(a.lowerBound).startOf("day").toDate():a.lowerBound="*",moment(a.upperBound).isValid()?a.upperBound=moment(a.upperBound).endOf("day").toDate():a.upperBound="*"),"<"===a.transformer&&(moment(a.upperBound).isValid()?a.upperBound=moment(a.upperBound).endOf("day").toDate():a.upperBound=moment().endOf("day").toDate()),">"===a.transformer&&(moment(a.lowerBound).isValid()?a.lowerBound=moment(a.lowerBound).startOf("day").toDate():a.lowerBound=moment().startOf("day").toDate())}function h(a){var b=_.clone(a),c=b.field===j,d="";switch(b.transformer){case"!":d="!";break;case"-":d="-";break;case"<":b.lowerBound="*";break;case">":b.upperBound="*";break;case"=":"date-range"!==b.fieldType&&(b.upperBound=void 0,b.lowerBound=void 0)}return b.field=d+(c?"":b.field+":"),b}function i(a,b){var c=_.find(d,function(b){return b.name===a.field}),e={field:b||a.field,fieldType:c||"string",transformer:a.transformer||"="};return a.lowerBound||a.upperBound?(e.lowerBound=a.lowerBound||void 0,e.upperBound=a.upperBound||void 0,e.inclusive=a.inclusive||!0):e.term=a.term||void 0,e}var j="";this.translate=function(a){c.translateQueryTree(a.queryTree)},this.validate=function(a){b.validate(a.queryTree,a.errors)},this.isValid=function(a){return this.translate(a),this.validate(a),0===a.errors.length},this.parseQueryString=function(b){try{b.queryTree=a.parse(b.queryString)}catch(c){b.errors.push(c.message)}return b.queryTree},this.createQuery=function(a){var b={originalQueryString:a,queryString:a,queryTree:{},errors:[]};return this.parseQueryString(b),b};var k=function(a){var b=a.term,c=a.lowerBound||a.upperBound;if(c){var d=a.lowerBound||"*",e=a.upperBound||"*",f=a.inclusive;d instanceof Date&&(d=moment(d).format()),e instanceof Date&&(e=moment(e).format()),b=d+" TO "+e,b=f?"["+b+"]":"{"+b+"}"}else(a.quoted||-1!==b.indexOf(" "))&&(b='"'+b+'"'),a.similarity&&(b+="~"+a.similarity),a.proximity&&(b+="~"+a.proximity),a.prefix&&(b=a.prefix+b),a.boost&&(b+="^"+a.boost);return b},l=function(a,b,c){if(a.left){var d,e=a.operator===j?" ":" "+a.operator+" ";if(a.right)d=l(a.left,b+1,c),d+=e,d+=l(a.right,b+1,c),b>0&&(d="("+d+")"),a.field&&a.field!==j&&(d=a.field+":"+d);else{var f=a.field&&a.left.field===j&&a.left.prefix;d=f?a.field+":("+k(a.left)+")":l(a.left,b+1,c)}return d}var g="",h=k(a);if(a.field!==j&&null!==a.field){var i="";_.contains(["!","+","-"],a.transformer)&&(i=a.transformer),g+=i+a.field+":"}return g+=h,c+=g};this.unparse=function(a){return a.queryString=this.unparseQueryTree(a.queryTree),a.queryString},this.unparseQueryTree=function(a){var b="";return a.left&&(b=l(a,0,"")),b},this.unparseGroupedTree=function(a){var b=a,c="";return _.forEach(b.nodes,function(a,d){var e="";if("group"===a.type){var g=a;_.forEach(g.nodes,function(b,c){if("group"===b.type){var d=b,h=" ";if(1===d.nodes.length){var i=d.nodes[0];h+=d.operator+" "+f(i)}else h+=d.operator+" (",_.forEach(d.nodes,function(a,b){b&&(h+=" OR "),h+=f(a)}),h+=")";e+=h}else{c&&(e+=" "+a.operator+" "),e+=f(b);var j=c+1;c&&j1&&g.nodes.length>1&&(e="("+e+")")}else console.log("Expecting a group but found: "+a.type);if(d||a.excluded){var h=a.excluded?"NOT":"OR";c+=" "+h+" "}c+=e}),c},this.groupQueryTree=function(a){var b={type:"root",nodes:[],operator:a.operator||"OR"};if(a.left)this.groupNode(a,b),this.cleanUpGroupedFieldTree(b);else{var c={type:"field",operator:"OR",nodes:[{field:"name.\\*",name:"title",term:"",fieldType:"tokenized-string",transformer:"+"}]};b.nodes.push(c)}return b},this.cleanUpGroupedFieldTree=function(a){_.forEach(a.nodes,function(a){delete a.implicitField,a.nodes&&1===a.nodes.length&&(a.type="field"),a.operator===j&&(a.operator="OR"),_.forEach(a.nodes,function(a){var b=_.find(d,function(b){return b.name===a.field});if(b){if(a.fieldType=b.type,"term"===b.type){var c=_.find(e,function(b){return b.label.toUpperCase()===a.term.toUpperCase()});if(c){var f="category_"+c.domain+"_name";a.field=f,a.term=c.label}else a.invalid=!0}if("choice"===b.type){var g=_.find(b.options,function(b){return b===a.term.toUpperCase()});g?a.term=g:a.invalid=!0}if("check"===b.type){var h=b.name,i="(!"+b.name+")";a.term!==h&&a.term!==i&&(a.invalid=!0)}if("tokenized-string"===b.type&&(a.transformer&&"="!==a.transformer||(a.transformer="+"),"!"===a.transformer&&(a.transformer="-")),"string"===b.type&&(a.transformer&&"+"!==a.transformer||(a.transformer="="),"-"===a.transformer&&(a.transformer="!")),"number"===b.type&&(a.term?a.transformer="=":a.upperBound&&"*"===a.lowerBound?a.transformer="<":a.lowerBound&&"*"===a.upperBound?a.transformer=">":a.lowerBound&&a.upperBound?(a.transformer="><",a.lowerBound=a.lowerBound,a.upperBound=a.upperBound):(a.transformer="=",a.term=a.lowerBound||a.upperBound,a.lowerBound=void 0,a.upperBound=void 0)),"date-range"===b.type){var j=moment(a.lowerBound),k=moment(a.upperBound);j.isValid()&&k.isValid()?j.isSame(k,"day")?a.transformer="=":a.transformer="><":(!j.isValid()&&k.isValid()&&(a.transformer="<"),!k.isValid()&&j.isValid()&&(a.transformer=">"))}}})})},this.groupNode=function(a,b,c,d){if(a.operator===j&&(a.operator="OR"),!c||a.operator&&a.operator!==c.operator){var e={type:"group",operator:a.operator||"OR",nodes:[]};"NOT"===d&&(e.excluded=!0),b.nodes.push(e),c=e}if(a.field&&a.field!==j&&(c.implicitField=a.field),a.term||a.lowerBound&&a.upperBound){var f=a.field;f===j&&c.implicitField&&(f=c.implicitField),c.nodes.push(i(a,f))}if(a.left&&(this.groupNode(a.left,b,c),a.right)){var g="NOT"!==a.operator?c:void 0;this.groupNode(a.right,b,g,a.operator)}}}angular.module("udb.search").service("LuceneQueryBuilder",a),a.$inject=["LuceneQueryParser","QueryTreeValidator","QueryTreeTranslator","queryFields","taxonomyTerms"]}(),function(){"use strict";angular.module("udb.search").constant("queryFieldTranslations",{sapi2:{TYPE:"type",CDBID:"cdbid",LOCATION_ID:"location_id",ORGANISER_ID:"organiser_id",TITLE:"title",KEYWORDS:"keywords",CITY:"city",ORGANISER_KEYWORDS:"organiser_keywords",ZIPCODE:"zipcode",COUNTRY:"country",CATEGORY_NAME:"category_name",AGEFROM:"agefrom",DETAIL_LANG:"detail_lang",PRICE:"price",STARTDATE:"startdate",ENDDATE:"enddate",ORGANISER_LABEL:"organiser_label",LOCATION_NAME:"location_name",LOCATION_LABELS:"location_labels",EXTERNALID:"externalid",LASTUPDATED:"lastupdated",CREATIONDATE:"creationdate",CREATEDBY:"createdby",PERMANENT:"permanent",CATEGORY_EVENTTYPE_NAME:"category_eventtype_name",LOCATIONTYPE:"locationtype",OFFERTYPE:"offertype",CATEGORY_THEME_NAME:"category_theme_name",CATEGORY_FACILITY_NAME:"category_facility_name",CATEGORY_TARGETAUDIENCE_NAME:"category_targetaudience_name",CATEGORY_FLANDERSREGION_NAME:"category_flandersregion_name",AVAILABLEFROM:"availablefrom"},en:{TEXT:"text",KEYWORDS:"label",PHYSICAL_GIS:"geo",CATEGORY_NAME:"category",DETAIL_LANG:"translation",ORGANISER_LABEL:"organiser",LOCATION_LABEL:"location",CREATIONDATE:"created",CATEGORY_EVENTTYPE_NAME:"eventtype",LOCATIONTYPE:"locationtype",OFFERTYPE:"offertype",CATEGORY_THEME_NAME:"theme",CATEGORY_FACILITY_NAME:"facility",CATEGORY_TARGETAUDIENCE_NAME:"targetaudience",CATEGORY_FLANDERSREGION_NAME:"region",AVAILABLEFROM:"available",LOCATION_ID:"locationid",ORGANISER_ID:"organizationid",DATE:"date"},fr:{LOCATION_LABEL:"location",TITLE:"titre"},nl:{TYPE:"type",TEXT:"tekst",LOCATION_ID:"locatieid",ORGANISER_ID:"organisatieid",TITLE:"titel",KEYWORDS:"label",CITY:"stad",ORGANISER_KEYWORDS:"organisatielabel",ZIPCODE:"postcode",COUNTRY:"land",CATEGORY_NAME:"categorie",AGEFROM:"leeftijd",DETAIL_LANG:"vertaling",PRICE:"prijs",DATE:"datum",STARTDATE:"startdatum",ENDDATE:"einddatum",ORGANISER_LABEL:"organisatienaam",LOCATION_LABEL:"locatienaam",EXTERNALID:"externalid",LASTUPDATED:"laatst_aangepast",CREATIONDATE:"gecreëerd",CREATEDBY:"gecreëerd_door",PERMANENT:"permanent",CATEGORY_EVENTTYPE_NAME:"type",LOCATIONTYPE:"locatietype",OFFERTYPE:"aanbodtype",CATEGORY_THEME_NAME:"thema",CATEGORY_FACILITY_NAME:"voorzieningen",CATEGORY_TARGETAUDIENCE_NAME:"doelgroep",CATEGORY_FLANDERSREGION_NAME:"gemeente",AVAILABLEFROM:"datum_beschikbaar"}})}(),function(){"use strict";angular.module("udb.search").value("queryFields",[{name:"cdbid",field:"id",type:"string",group:"what",editable:!0},{name:"offertype",field:"_type",type:"choice",group:"what",editable:!0,options:["event","place"]},{name:"keywords",field:"labels",type:"string",group:"what",editable:!0},{name:"title",field:"name.\\*",type:"tokenized-string",group:"what",editable:!0},{name:"category_eventtype_name",field:"terms.id",type:"term",group:"what",editable:!0},{name:"locationtype",field:"terms.id",type:"term",group:"what",editable:!0},{name:"category_theme_name",field:"terms.id",type:"term",group:"what",editable:!0},{name:"text",field:"",type:"tokenized-string",group:"what",editable:!0},{name:"city",field:"address.\\*.addressLocality",type:"string",group:"where",editable:!0},{name:"zipcode",field:"address.\\*.postalCode",type:"string",group:"where",editable:!0},{name:"location_id",field:"location.id",type:"string",group:"where",editable:!0},{name:"country",field:"address.\\*.addressCountry",type:"choice",group:"where",editable:!1,options:["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM"]},{name:"location_name",field:"location.name.\\*",type:"tokenized-string",group:"where",editable:!0},{name:"location_labels",field:"location.labels",type:"string",group:"where",editable:!0},{name:"nisRegions",field:"regions",type:"termNis",group:"where",editable:!0},{name:"date",field:"dateRange",type:"date-range",group:"when",editable:!0},{name:"permanent",field:"calendarType",type:"check",group:"when",editable:!0},{name:"lastupdated",field:"modified",type:"date-range",group:"input-information",editable:!0},{name:"creationdate",field:"created",type:"date-range",group:"input-information",editable:!0},{name:"createdby",field:"creator",type:"string",group:"input-information",editable:!0},{name:"availablefrom",field:"availableRange",type:"date-range",group:"input-information",editable:!0},{name:"detail_lang",field:"languages",type:"choice",group:"translations",editable:!0,options:["nl","fr","en","de"]},{name:"organiser_keywords",field:"organizer.labels",type:"string",group:"other",editable:!0},{name:"organiser_id",field:"organizer.id",type:"string",group:"other",editable:!0},{name:"agefrom",field:"typicalAgeRange",type:"number",group:"other",editable:!0},{name:"attendance_mode",field:"attendanceMode",type:"choice",group:"other",editable:!0,options:["online","offline","mixed"]},{name:"price",field:"price",type:"number",group:"other",editable:!0},{name:"status",field:"status",type:"choice",group:"other",editable:!0,options:["Available","Unavailable","TemporarilyUnavailable"]},{name:"booking_availability",field:"bookingAvailability",type:"choice",group:"other",editable:!0,options:["available","unavailable"]},{name:"organiser_label",field:"organizer.name.\\*",type:"tokenized-string",group:"other",editable:!0},{name:"completeness",field:"completeness",type:"number",group:"other",editable:!0},{name:"category_facility_name",field:"terms.id",type:"term",group:"other",editable:!0},{name:"category_targetaudience_name",field:"audienceType",type:"choice",group:"other",editable:!0,options:["everyone","members","education"]},{field:"calendarType",type:"string"},{field:"workflowStatus",type:"choice",options:["DRAFT","READY_FOR_VALIDATION","APPROVED","REJECTED","DELETED"]},{field:"name.nl",type:"tokenized-string"},{field:"name.fr",type:"tokenized-string"},{field:"name.de",type:"tokenized-string"},{field:"name.en",type:"tokenized-string"},{field:"description.nl",type:"tokenized-string"},{field:"description.fr",type:"tokenized-string"},{field:"description.de",type:"tokenized-string"},{field:"description.en",type:"tokenized-string"},{field:"terms.label",type:"string"},{field:"mediaObjectsCount",type:"number"},{field:"videosCount",type:"number"},{field:"address.\\*.streetAddress",type:"string"},{field:"location.id",type:"string"},{field:"location.name.nl",type:"tokenized-string"},{field:"location.name.fr",type:"tokenized-string"},{field:"location.name.de",type:"tokenized-string"},{field:"location.name.en",type:"tokenized-string"},{field:"location.terms.id",type:"string"},{field:"organizer.id",type:"string"},{field:"organizer.name.nl",type:"tokenized-string"},{field:"organizer.name.fr",type:"tokenized-string"},{field:"organizer.name.de",type:"tokenized-string"},{field:"organizer.name.en",type:"tokenized-string"},{field:"allAges",type:"string"},{field:"contributors",type:"string"},{name:"startdate",field:"dateRange",type:"date-range"},{name:"enddate",field:"dateRange",type:"date-range"}])}(),function(){"use strict";function a(a,b){var c=function(c,d){var e=_.findKey(a[d],function(a){return a===c}),f=void 0===e?void 0:_.find(b,{name:e.toLowerCase()});return void 0===f?c:f.field},d=function(a,b){var e=a.left||!1,f=a.right||!1,g=[];e&&g.push(e),f&&g.push(f);for(var h=0,i=g.length;i>h;h++){var j=g[h];"object"==typeof j&&d(j,b+1)}a.field&&(a.field=c(a.field,"sapi2"),a.field=c(a.field,"en"),a.field=c(a.field,"nl"))};this.translateQueryTree=function(a){return d(a,0)}}angular.module("udb.search").service("QueryTreeTranslator",a),a.$inject=["queryFieldTranslations","queryFields"]}(),function(){"use strict";function a(a){var b=_.union(_.map(a,"field"),["_exists_"]),c="",d=_(b).filter(function(a){return a.indexOf(".")>0}).map(function(a){var b=a.split(".");return b.pop(),b.join(".")}).value(),e=function(a,f,g){var h=a.left||!1,i=a.right||!1,j=[];h&&j.push(h),i&&j.push(i);for(var k=0,l=j.length;l>k;k++){var m=j[k];"object"==typeof m&&e(m,f+1,g)}var n=a.field;if("undefined"!=typeof n){var o=_.trim(n,".\\*"),p=n!==o;if(null!==o&&o!==c){var q=p?d:b;_.contains(q,o)||g.push(n+" is not a valid search field")}}};this.validate=function(a,b){e(a,0,b)}}angular.module("udb.search").service("QueryTreeValidator",a),a.$inject=["queryFields"]}(),function(){"use strict";angular.module("udb.search").value("sapi2FieldTypeTransformers",{string:["=","!"],"tokenized-string":["+","-"],choice:["=","!"],term:["=","!"],number:["=","<",">"],check:["="],"date-range":["=","><","<",">"]})}(),function(){"use strict";function a(a,b,c,d,e){function f(a){"date-range"===a.fieldType&&g(a);var b=h(a);return b.field+":"+k(b)}function g(a){"="===a.transformer&&moment(a.lowerBound).isValid()&&(a.lowerBound=moment(a.lowerBound).startOf("day").toDate(),a.upperBound=moment(a.lowerBound).endOf("day").toDate()),"><"===a.transformer&&(moment(a.lowerBound).isValid()?a.lowerBound=moment(a.lowerBound).startOf("day").toDate():a.lowerBound="*",moment(a.upperBound).isValid()?a.upperBound=moment(a.upperBound).endOf("day").toDate():a.upperBound="*"),"<"===a.transformer&&(moment(a.upperBound).isValid()?a.upperBound=moment(a.upperBound).endOf("day").toDate():a.upperBound=moment().endOf("day").toDate()),">"===a.transformer&&(moment(a.lowerBound).isValid()?a.lowerBound=moment(a.lowerBound).startOf("day").toDate():a.lowerBound=moment().startOf("day").toDate())}function h(a){var b=_.clone(a);switch(b.transformer){case"!":b.field="!"+b.field;break;case"-":b.field="-"+b.field;break;case"<":b.lowerBound="*";break;case">":b.upperBound="*";break;case"=":"date-range"!==b.fieldType&&(b.upperBound=void 0,b.lowerBound=void 0)}return b}function i(a,b){var c=_.find(d,function(b){return b.name===a.field}),e={field:b||a.field,fieldType:c||"string",transformer:a.transformer||"="};return a.lowerBound||a.upperBound?(e.lowerBound=a.lowerBound||void 0,e.upperBound=a.upperBound||void 0,e.inclusive=a.inclusive||!0):e.term=a.term||void 0,e}var j="";this.translate=function(a){c.translateQueryTree(a.queryTree)},this.validate=function(a){b.validate(a.queryTree,a.errors)},this.isValid=function(a){return this.translate(a),this.validate(a),0===a.errors.length},this.parseQueryString=function(b){try{b.queryTree=a.parse(b.queryString); -}catch(c){b.errors.push(c.message)}return b.queryTree},this.createQuery=function(a){var b={originalQueryString:a,queryString:a,queryTree:{},errors:[]};return this.parseQueryString(b),b};var k=function(a){var b=a.term,c=a.lowerBound||a.upperBound;if(c){var d=a.lowerBound||"*",e=a.upperBound||"*",f=a.inclusive;d instanceof Date&&(d=d.toISOString()),e instanceof Date&&(e=e.toISOString()),b=d+" TO "+e,b=f?"["+b+"]":"{"+b+"}"}else(a.quoted||-1!==b.indexOf(" "))&&(b='"'+b+'"'),a.similarity&&(b+="~"+a.similarity),a.proximity&&(b+="~"+a.proximity),a.prefix&&(b=a.prefix+b),a.boost&&(b+="^"+a.boost);return b},l=function(a,b,c){if(a.left){var d,e=a.operator===j?" ":" "+a.operator+" ";return a.right?(d=l(a.left,b+1,c),d+=e,d+=l(a.right,b+1,c),b>0&&(d="("+d+")"),a.field&&a.field!==j&&(d=a.field+":"+d)):d=l(a.left,b+1,c),d}var f="",g=k(a);if(a.field!==j&&null!==a.field){var h="";_.contains(["!","+","-"],a.transformer)&&(h=a.transformer),f+=h+a.field+":"}return f+=g,c+=f};this.unparse=function(a){return a.queryString=this.unparseQueryTree(a.queryTree),a.queryString},this.unparseQueryTree=function(a){var b="";return a.left&&(b=l(a,0,"")),b},this.unparseGroupedTree=function(a){var b=a,c="";return _.forEach(b.nodes,function(a,d){var e="";if("group"===a.type){var g=a;_.forEach(g.nodes,function(b,c){if("group"===b.type){var d=b,h=" ";if(1===d.nodes.length){var i=d.nodes[0];h+=d.operator+" "+f(i)}else h+=d.operator+" (",_.forEach(d.nodes,function(a,b){b&&(h+=" OR "),h+=f(a)}),h+=")";e+=h}else{c&&(e+=" "+a.operator+" "),e+=f(b);var j=c+1;c&&j1&&g.nodes.length>1&&(e="("+e+")")}else console.log("Expecting a group but found: "+a.type);if(d||a.excluded){var h=a.excluded?"NOT":"OR";c+=" "+h+" "}c+=e}),c},this.groupQueryTree=function(a){var b={type:"root",nodes:[],operator:a.operator||"OR"};if(a.left)this.groupNode(a,b),this.cleanUpGroupedFieldTree(b);else{var c={type:"field",operator:"OR",nodes:[{field:"title",term:"",fieldType:"tokenized-string",transformer:"+"}]};b.nodes.push(c)}return b},this.cleanUpGroupedFieldTree=function(a){_.forEach(a.nodes,function(a){delete a.implicitField,a.nodes&&1===a.nodes.length&&(a.type="field"),a.operator===j&&(a.operator="OR"),_.forEach(a.nodes,function(a){var b=_.find(d,function(b){return b.name===a.field});if(b){if(a.fieldType=b.type,"term"===b.type){var c=_.find(e,function(b){return b.label.toUpperCase()===a.term.toUpperCase()});if(c){var f="category_"+c.domain+"_name";a.field=f,a.term=c.label}else a.invalid=!0}if("choice"===b.type){var g=_.find(b.options,function(b){return b===a.term.toUpperCase()});g?a.term=g:a.invalid=!0}if("check"===b.type&&(_.contains(["TRUE","FALSE"],a.term.toUpperCase())?a.term=a.term.toUpperCase():a.invalid=!0),"tokenized-string"===b.type&&(a.transformer&&"="!==a.transformer||(a.transformer="+"),"!"===a.transformer&&(a.transformer="-")),"string"===b.type&&(a.transformer&&"+"!==a.transformer||(a.transformer="="),"-"===a.transformer&&(a.transformer="!")),"number"===b.type&&(a.term?a.transformer="=":a.upperBound&&"*"===a.lowerBound?a.transformer="<":a.lowerBound&&"*"===a.upperBound?a.transformer=">":(a.transformer="=",a.term=a.lowerBound||a.upperBound,a.lowerBound=void 0,a.upperBound=void 0)),"date-range"===b.type){var h=moment(a.lowerBound),i=moment(a.upperBound);h.isValid()&&i.isValid()?h.isSame(i,"day")?a.transformer="=":a.transformer="><":(!h.isValid()&&i.isValid()&&(a.transformer="<"),!i.isValid()&&h.isValid()&&(a.transformer=">"))}}})})},this.groupNode=function(a,b,c){if(a.operator===j&&(a.operator="OR"),!c||a.operator&&a.operator!==c.operator){var d={type:"group",operator:a.operator||"OR",nodes:[]};b.nodes.push(d),c=d}if(a.field&&a.field!==j&&(c.implicitField=a.field),a.term||a.lowerBound&&a.upperBound){var e=a.field;if(e===j){if(!c.implicitField)throw"Field name is implicit and not defined elsewhere.";e=c.implicitField}c.nodes.push(i(a,e))}a.left&&(this.groupNode(a.left,b,c),a.right&&this.groupNode(a.right,b,c))}}angular.module("udb.search").service("sapi2QueryBuilder",a),a.$inject=["LuceneQueryParser","sapi2QueryTreeValidator","sapi2QueryTreeTranslator","sapi2QueryFields","taxonomyTerms"]}(),function(){"use strict";angular.module("udb.search").value("sapi2QueryFields",[{name:"cdbid",type:"string",group:"what",editable:!0},{name:"keywords",type:"string",group:"what",editable:!0},{name:"title",type:"tokenized-string",group:"what",editable:!0},{name:"category_eventtype_name",type:"term",group:"what",editable:!0},{name:"category_theme_name",type:"term",group:"what",editable:!0},{name:"city",type:"string",group:"where",editable:!0},{name:"zipcode",type:"string",group:"where",editable:!0},{name:"country",type:"choice",group:"where",editable:!1,options:["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM"]},{name:"location_name",type:"tokenized-string",group:"where",editable:!0},{name:"location_labels",type:"string",group:"where",editable:!0},{name:"category_flandersregion_name",type:"term",group:"where",editable:!0},{name:"startdate",type:"date-range",group:"when",editable:!0},{name:"enddate",type:"date-range",group:"when",editable:!0},{name:"permanent",type:"check",group:"when",editable:!0},{name:"lastupdated",type:"date-range",group:"input-information",editable:!0},{name:"lastupdatedby",type:"string",group:"input-information",editable:!0},{name:"creationdate",type:"date-range",group:"input-information",editable:!0},{name:"createdby",type:"string",group:"input-information",editable:!0},{name:"availablefrom",type:"date-range",group:"input-information",editable:!0},{name:"detail_lang",type:"choice",group:"translations",editable:!0,options:["nl","fr","en","de"]},{name:"organiser_keywords",type:"string",group:"other",editable:!0},{name:"agefrom",type:"number",group:"other",editable:!0},{name:"price",type:"number",group:"other",editable:!0},{name:"organiser_label",type:"tokenized-string",group:"other",editable:!0},{name:"category_facility_name",type:"term",group:"other",editable:!0},{name:"category_targetaudience_name",type:"term",group:"other",editable:!0},{name:"category_publicscope_name",type:"term",group:"other",editable:!0},{name:"like_count",type:"number"},{name:"recommend_count",type:"number"},{name:"attend_count",type:"number"},{name:"comment_count",type:"number"},{name:"category_name",type:"term"},{name:"externalid",type:"string"},{name:"private",type:"check"},{name:"physical_gis",type:"string"}])}(),function(){"use strict";function a(a){var b=a,c=function(a,c){var d=a,e=_.findKey(b[c],function(b){return b===a});return e&&(d=e.toLowerCase()),d},d=function(a,b){var e=a.left||!1,f=a.right||!1,g=[];e&&g.push(e),f&&g.push(f);for(var h=0,i=g.length;i>h;h++){var j=g[h];"object"==typeof j&&d(j,b+1)}a.field&&(a.field=c(a.field,"en"),a.field=c(a.field,"nl"))};this.translateQueryTree=function(a){return d(a,0)}}angular.module("udb.search").service("sapi2QueryTreeTranslator",a),a.$inject=["queryFieldTranslations"]}(),function(){"use strict";function a(a){var b=_.union(_.map(a,"name"),["_exists_"]),c="",d=_(b).filter(function(a){return a.indexOf(".")>0}).map(function(a){return a.split(".")[0]}).value(),e=function(a,f,g){var h=a.left||!1,i=a.right||!1,j=[];h&&j.push(h),i&&j.push(i);for(var k=0,l=j.length;l>k;k++){var m=j[k];"object"==typeof m&&e(m,f+1,g)}var n=a.field;if("undefined"!=typeof n){var o=_.trim(n,".\\*"),p=n!==o;if(null!==n&&n!==c){var q=p?d:b;_.contains(q,o)||g.push(n+" is not a valid search field")}}};this.validate=function(a,b){e(a,0,b)}}angular.module("udb.search").service("sapi2QueryTreeValidator",a),a.$inject=["sapi2QueryFields"]}(),function(){"use strict";function a(a,b){var c=null,d=null;this.clearQueryTree=function(){d=null},this.setQueryString=function(b,e){var f=!1;c&&c.queryString===b||(f=a.createQuery(b),a.isValid(f),this.setQuery(f),d=null),c&&!f&&e&&this.setQuery(c)},this.setQueryTree=function(b){var c=a.unparseGroupedTree(b),e=a.createQuery(c);a.isValid(e),this.setQuery(e),d=b},this.setQuery=function(a){c=a,b.$emit("searchQueryChanged",a)},this.getQuery=function(){return c},this.getQueryTree=function(){return angular.copy(d)}}angular.module("udb.search").service("searchHelper",a),a.$inject=["LuceneQueryBuilder","$rootScope"]}(),function(){"use strict";function a(a){var b={ALL:{name:"all",icon:"fas fa-check-square"},NONE:{name:"none",icon:"far fa-square"},SOME:{name:"some",icon:"fas fa-minus-square"}},c=function(c,d){this.pageSize=c||30,this.events=[],this.totalItems=0,this.currentPage=d||1,this.loading=!0,this.lastQuery=null,this.eventProperties={description:{name:a.instant("search.description"),visible:!1},labels:{name:a.instant("search.labels"),visible:!1},image:{name:a.instant("search.picture"),visible:!1}},this.eventSpecifics=[{id:"input",name:a.instant("search.inputInformation")}],this.activeSpecific=this.eventSpecifics[0],this.selectedOffers=[],this.selectionState=b.NONE,this.querySelected=!1};return c.prototype={enableSpecifics:function(a){this.eventSpecifics=_.uniq(_.union(this.eventSpecifics,a),"id")},toggleSelection:function(){var a=this.selectionState;a===b.SOME||a===b.ALL?(this.deselectPageItems(),this.querySelected&&(this.deselectAll(),this.querySelected=!1)):this.selectPageItems()},selectQuery:function(){this.querySelected=!0,this.selectPageItems()},updateSelectionState:function(){var a=this.selectedOffers,c=_.filter(this.events,function(b){return _.contains(a,b)});c.length===this.pageSize?this.selectionState=b.ALL:c.length>0?this.selectionState=b.SOME:this.selectionState=b.NONE},toggleSelect:function(a){if(!this.querySelected){var b=_.find(this.selectedOffers,function(b){return b["@id"]===a["@id"]});if(b)this.selectedOffers=_.filter(this.selectedOffers,function(b){return b["@id"]!==a["@id"]});else{var c=_.find(this.events,function(b){return b["@id"]===a["@id"]});this.selectedOffers.push(c)}this.updateSelectionState()}},deselectAll:function(){this.selectedOffers=[],this.selectionState=b.NONE},deselectPageItems:function(){var a=this.selectedOffers;_.forEach(this.events,function(b){_.remove(a,function(a){return a["@id"]===b["@id"]})}),this.selectionState=b.NONE},selectPageItems:function(){var a=this.events,c=this.selectedOffers;_.each(a,function(a){c.push(a)}),this.selectedOffers=_.uniq(c),this.selectionState=b.ALL},isOfferSelected:function(a){return!!_.find(this.selectedOffers,function(b){return b["@id"]===a["@id"]})},setResults:function(a){var b=this;b.pageSize=a.itemsPerPage||30,b.events=a.member||[],b.totalItems=a.totalItems||0,b.loading=!1,this.querySelected&&this.selectPageItems(),this.updateSelectionState()},queryChanged:function(a){this.loading=!0,this.selectedOffers=[],this.querySelected=!1,this.lastQuery&&this.lastQuery!==a&&(this.currentPage=1),this.lastQuery=a},activateSpecific:function(a){this.activeSpecific=a},isShowingProperties:function(){var a=_.find(this.eventProperties,function(a){return a.visible});return!!a}},c}angular.module("udb.search").factory("SearchResultViewer",a),a.$inject=["$translate"]}(),function(){"use strict";angular.module("udb.search").constant("EventTranslationState",{ALL:{name:"all",icon:"fa-circle"},NONE:{name:"none",icon:"fa-circle-o"},SOME:{name:"some",icon:"fa-dot-circle-o"}})}(),function(){"use strict";function a(){var a={restrict:"AE",controller:"OfferController",controllerAs:"eventCtrl",templateUrl:"templates/event.directive.html"};return a}angular.module("udb.search").directive("udbEvent",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){var b=k.instant("offerTypes."+a);return _.includes(b,"offerTypes.")?a:b}function n(a){var d=a.facilities.sort(function(a,b){return a.label.localeCompare(b.label)});return a.facilities=d,v=a,v.updateTranslationState(),b.event=c(v,x,!0),b.offerType=b.event.url.split("/").shift(),b.translatedOfferType=m(b.event.type.label),w.offerExpired="event"===b.offerType?a.isExpired():!1,w.hasFutureAvailableFrom=a.hasFutureAvailableFrom(),w.fetching=!1,p(),v}function o(a){return a&&"event"===b.event.url.split("/").shift()?h.resolve(a):h.reject()}function p(){b.$watch(function(){return v.labels},function(a){b.event.labels=angular.copy(a)})}function q(a,b,c){var d=w.activeLanguage,f=c||a;b&&b!==v[a][d]&&e.translateProperty(v,f,d,b).then(v.updateTranslationState(v))}function r(){w.labelResponse="",w.labelsError=""}function s(a){b.event.labels=angular.copy(v.labels),w.labelResponse="unlabelError",w.labelsError=a.title}function t(a){r(),f.unlabel(v,a.name)["catch"](s)}function u(a){return b.event.location&&(b.event.location=c(b.event.location,x)),h.resolve(a)}var v,w=this,x=k.use()||"nl";w.translation=!1,w.activeLanguage=x,w.languageSelector=[{lang:"fr"},{lang:"en"},{lang:"de"}],w.uitId=_.get(i,"uitidUrl"),w.labelRemoved=t,l.isGodUser().then(function(a){w.isGodUser=a}),w.init=function(){if(!b.event.title){if(w.fetching=!0,b.event.name){var c=a.formatJsonLDEntity(b.event);return void n(c)}return a.getOffer(b.event["@id"]).then(function(a){n(a)})}w.fetching=!1},h.when(w.init()).then(u).then(o)["finally"](function(){w.editable=!0}),w.hasActiveTranslation=function(){var a=v;return a&&a.translationState[w.activeLanguage]!==d.NONE},w.getLanguageTranslationIcon=function(a){var b=d.NONE.icon;return v&&a&&(b=v.translationState[a].icon),b},w.translate=function(){w.applyPropertyChanges("name"),w.applyPropertyChanges("description")},w.toggleLanguage=function(a){a===w.activeLanguage?w.stopTranslating():(w.activeLanguage=a,w.translation=c(v,w.activeLanguage))},w.hasPropertyChanged=function(a){var b=w.activeLanguage,c=w.translation;return w.translation&&v[a][b]!==c[a]},w.undoPropertyChanges=function(a){var b=w.activeLanguage,c=w.translation;c&&(c[a]=v[a][b])},w.applyPropertyChanges=function(a){var b=w.translation[a];q(a,b,a)},w.stopTranslating=function(){w.translation=void 0,w.activeLanguage=x},w.labelAdded=function(a){var c=_.find(v.labels,function(b){return a.name.toUpperCase()===b.toUpperCase()});c?(b.$apply(function(){b.event.labels=angular.copy(v.labels)}),g.alert('Het label "'+a.name+'" is reeds toegevoegd als "'+c+'".')):(w.addedLabel=a.name,f.label(v,a.name).then(function(){w.labelResponse="success",b.event.labels=angular.copy(v.labels)})["catch"](function(){w.labelResponse="error"}))},w.showConcludedButton=function(){var a=_.get(i,"concludedButton.toggle",!1);if(!a)return!1;var c=_.get(i,"calendarHighlight.date"),d=moment(c).endOf("day");return"event"===b.offerType&&d=h;if(i)m("EVENT-EXPORT.TOO-MANY-ITEMS",{limit:h}).then(function(a){d.alert(a)});else if(e&&e.queryString.length&&n.isValid(e)){f.open({templateUrl:"templates/event-export-modal.html",controller:"EventExportController",controllerAs:"exporter",size:"lg"})}else m("EVENT-EXPORT.QUERY-IS-MISSING").then(function(a){d.alert(a)})}function u(a,b){x(b)}a.resultViewer=new g(30,r()),a.realQuery=!1,a.activeQuery=!1,a.queryEditorShown=!1,a.currentPage=r(),a.language=m.use()||"nl";var v=[{id:"accessibility",name:"Toegankelijkheidsinformatie",permission:o.editFacilities}];p.getPermissions().then(function(b){var c=_.filter(v,function(a){return!_.has(a,"permission")||_.contains(b,a.permission)});a.resultViewer.enableSpecifics(c)});var w=function(d){var f=(a.resultViewer.currentPage-1)*a.resultViewer.pageSize,g="string"==typeof d?d:d.queryString,h=a.resultViewer.currentPage>1?String(a.resultViewer.currentPage):null;e.search({query:q().queryString||null,page:h}),a.resultViewer.loading=!0,c.findOffers(g,f).then(function(d){d.member&&(d=c.reformatJsonLDData(d)),i.addPagedCollection(d),a.resultViewer.setResults(d),b(function(){k.$emit("searchComponentReady")})})},x=function(c){if(a.activeQuery=c,n.isValid(c)){var d=n.unparse(c);a.resultViewer.queryChanged(d),w(d).then(function(){b(function(){k.$emit("searchComponentReady")})}),d!==c.originalQueryString?a.realQuery=d:a.realQuery=!1}},y=function(b){var d=a.resultViewer.selectedOffers;_.each(d,function(a){var d;d=c.getOffer(new URL(a["@id"])),d.then(function(a){a.label(b)})}),_.each(b,function(a){h.labelOffersById(d,a)})},z=function(){var b=a.resultViewer.selectedOffers;if(!b.length)return void d.alert("First select the events you want to label.");var c=f.open({templateUrl:"templates/offer-label-modal.html",controller:"OfferLabelModalCtrl",controllerAs:"lmc"});c.result.then(y)},A=function(){var b=a.resultViewer.querySelected;b?s():z()},B=function(){var b=a.resultViewer.selectedOffers;if(!b.length)return void d.alert("First select the events you want to label.");var c=f.open({templateUrl:"templates/offer-languages-modal.html",controller:"OfferLanguagesModalCtrl",controllerAs:"lmc"});c.result.then(y)};a.exportEvents=t,a.label=A,a.addLanguageIcons=B,a.startEditing=function(){a.queryEditorShown=!0},a.stopEditing=function(){a.queryEditorShown=!1};var C=1===a.currentPage;a.pageChanged=function(){var c=a.currentPage;C?(a.resultViewer.currentPage=c,w(a.activeQuery).then(function(){b(function(){k.$emit("searchComponentReady")})}),d.scroll(0,0)):(a.currentPage=a.resultViewer.currentPage,C=!0)};var D=_.once(function(){var b=k.$on("searchQueryChanged",u),c=k.$on("startEditingQuery",a.startEditing),d=k.$on("stopEditingQuery",a.stopEditing);a.$on("$destroy",c),a.$on("$destroy",b),a.$on("$destroy",d)});D()}angular.module("udb.search").controller("SearchController",a),a.$inject=["$scope","$timeout","udbApi","$window","$location","$uibModal","SearchResultViewer","offerLabeller","offerLocator","searchHelper","$rootScope","eventExporter","$translate","LuceneQueryBuilder","authorization","authorizationService"]}(),function(){"use strict";function a(){return{templateUrl:"templates/search.html",restrict:"EA",controller:"SearchController"}}angular.module("udb.search").directive("udbSearch",a)}(),function(){"use strict";function a(a,b,c){function d(){a.all([b.getEventCardSystems(n.id),b.findOrganisationsCardSystems(m.id)]).then(h,e)}function e(a){400===a.status&&(l.uitpasUnavailableType="already_has_ticketsales"),404===a.status&&(l.uitpasUnavailableType="not_found")}function f(){l.uitpasUnavailableType=void 0}function g(){l.availableCardSystems=void 0,f(),j(),d()}function h(a){var b=a[0],c=a[1];l.availableCardSystems=_.map(c,function(a){return _.assign(a,{assignedDistributionKey:i(b,a),active:!!_.find(b,{id:a.id})})})}function i(a,b){var c=_.find(a,{id:b.id});return _.first(!c||_.isEmpty(c.distributionKeys)?b.distributionKeys:c.distributionKeys)}function j(){l.persistingCardSystems=!1}function k(a){return a.assignedDistributionKey?l.distributionKeyAssigned(a):b.addEventCardSystem(n.id,a.id)}var l=this,m=l.organisation,n=l.offerData;l.$onInit=d,l.refresh=g,l.distributionKeyAssigned=function(d){if(!d.assignedDistributionKey)throw"card system distribution key is missing";return l.persistingCardSystems=!0,b.addEventCardSystemDistributionKey(n.id,d.id,d.assignedDistributionKey.id).then(function(){return c.$emit("uitpasDataSaved"),j(),a.resolve()})},l.activeCardSystemsChanged=function(a){function d(b){a.active=!a.active,e(b)}function f(){c.$emit("uitpasDataSaved")}l.persistingCardSystems=!0;var g=a.active?k(a):b.removeEventCardSystem(n.id,a.id);g.then(f,d)["finally"](j)}}angular.module("udb.uitpas").component("cardSystemSelector",{templateUrl:"templates/card-systems.html",controller:a,controllerAs:"cardSystemSelector",bindings:{organisation:"<",offerData:"<"}}),a.$inject=["$q","udbUitpasApi","$rootScope"]}(),function(){"use strict";function a(a,b,c){function d(b){b?(a.showUitpasInfo=_.get(g,"organizer.isUitpas",!1)&&c.isEvent,g.showCardSystems=g.price&&!!g.price.length):(g.showCardSystems=!1,a.showUitpasInfo=!1)}function e(){g.eventFormData=c,d(g.organizer),g.listeners=[b.$on("eventFormSaved",g.showCardSystemsIfPriceIsSelected),b.$on("eventOrganizerSelected",g.updateOrganizer),b.$on("eventOrganizerDeleted",g.updateOrganizer),b.$on("uitpasDataSaved",g.markUitpasDataAsCompleted)]}function f(){_.invoke(g.listeners,"call")}var g=this;a.showUitpasInfo=!1,a.uitpasCssClass="state-incomplete",g.listeners=[],g.showCardSystems=!1,g.$onInit=e,g.$onDestroy=f,g.showCardSystemsIfPriceIsSelected=function(a,b){g.showCardSystems=b.priceInfo&&!!b.priceInfo.length},g.markUitpasDataAsCompleted=function(){a.uitpasCssClass="state-complete"},g.updateOrganizer=function(a,b){g.organizer=b,d(b)}}angular.module("udb.uitpas").component("uitpasInfo",{templateUrl:"templates/uitpasInfo.html",controller:a,controllerAs:"upic",bindings:{organizer:"<",price:"<"}}),a.$inject=["$scope","$rootScope","EventFormData"]}(),function(){"use strict";angular.module("udb.uitpas").constant("DefaultUitpasLabels",{PASPARTOE:"Paspartoe",UITPAS:"UiTPAS",UITPAS_GENT:"UiTPAS Gent",UITPAS_OOSTENDE:"UiTPAS Oostende",UITPAS_REGIO_AALST:"UiTPAS Regio Aalst",UITPAS_DENDER:"UiTPAS Dender",UITPAS_ZUIDWEST:"UiTPAS Zuidwest",UITPAS_MECHELEN:"UiTPAS Mechelen",UITPAS_KEMPEN:"UiTPAS Kempen",UITPAS_MAASMECHELEN:"UiTPAS Maasmechelen",UITPAS_LEUVEN:"UiTPAS Leuven",UITPAS_LIER:"UiTPAS Lier","UITPAS_HEIST-OP-DEN-BERG":"UiTPAS Heist-op-den-Berg",UITPAS_MEETJESLAND:"UiTPAS Meetjesland",UITPAS_WESTHOEK:"UiTPAS Westhoek"})}(),function(){"use strict";function a(a){var b=this;b.organisation=a.organisation,b.query=a.query}angular.module("udb.uitpas").controller("OrganisationSuggestionController",a),a.$inject=["$scope"]}(),function(){"use strict";function a(){return{templateUrl:"templates/organisation-suggestion.directive.html",controller:"OrganisationSuggestionController",controllerAs:"os",scope:{organisation:"<",query:"<"},restrict:"A"}}angular.module("udb.uitpas").directive("uitpasOrganisationSuggestion",a)}(),function(){"use strict";function a(a,b,c,d,e,f){function g(a){return"object"==typeof a.distributionKeys&&(a.distributionKeys=_.values(a.distributionKeys)),a}function h(b){var c="object"==typeof b.data?_.values(b.data):b.data;return a.resolve(_.map(c,g))}function i(b){return a.resolve(b.data)}function j(b,c,d){function g(g){return f().add(c,"seconds").isAfter(d)?a.reject(g):e(function(){return j(b,c,d)},c)}return b()["catch"](g)}var k=_.get(c,"uitpasUrl"),l=_.get(c,"uitpasMaxDelay",8),m={headers:{"Content-Type":"application/json",Authorization:"Bearer "+d.getToken(),"X-Api-Key":_.get(c,"apiKey")},params:{}};this.getEventCardSystems=function(a){function c(){return b.get(k+"events/"+a+"/cardSystems/",m)}var d=f().add(l,"s");return j(c,2,d).then(h)},this.getTicketSales=function(c,d){function e(){return b.get(k+"events/"+c,m)}function g(a){return a.data.hasTicketSales}var h=a.defer(),i=f().add(l,"s");return d.isUitpas?h.resolve(j(e,2,i).then(g)):h.resolve(!1),h.promise},this.findOrganisationsCardSystems=function(a){return b.get(k+"organizers/"+a+"/cardSystems/",m).then(h)},this.addEventCardSystem=function(a,c){return b.put(k+"events/"+a+"/cardSystems/"+c,null,m).then(i)},this.removeEventCardSystem=function(a,c){return b["delete"](k+"events/"+a+"/cardSystems/"+c,m).then(i)},this.addEventCardSystemDistributionKey=function(a,c,d){return b.put(k+"events/"+a+"/cardSystems/"+c+"/distributionKey/"+d,null,m).then(i)}}angular.module("udb.uitpas").service("udbUitpasApi",a),a.$inject=["$q","$http","appConfig","uitidAuth","$timeout","moment"]}(),function(){"use strict";function a(){var a;this.useLabels=function(b){a=b},this.$get=["DefaultUitpasLabels",function(b){return a?a:b}]}angular.module("udb.uitpas").provider("UitpasLabels",a)}(),function(){angular.module("udb.core").run(["$templateCache",function(a){"use strict";a.put("templates/calendar-summary.directive.html",'\n\n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n'),a.put("templates/image-detail.directive.html",'\n \n \n \n \n
    \n
  • \n
    \n \n {{::translateImageDetail(\'alt_image\', {index: $index}) }}\n \n
    \n
    \n \n

    {{image.description}}

    \n

    © {{image.copyrightHolder}}

    \n
    \n
    \n
  • \n
\n \n \n\n'),a.put("templates/udb.workflow-status.directive.html",'\n \n \n \n \n {{::cm.status | translate }}\n {{cm.event.availableFrom | date: \'dd/MM/yyyy\'}}\n \n \n

 

\n \n\n\n \n \n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
\n \n\n'),a.put("templates/unexpected-error-modal.html",'\n\n\n'),a.put("templates/event-cultuurkuur.html",'
\n
\n

\n
\n
\n

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n

Bekijk je evenement op cultuurkuur.be en voeg de juiste onderwijsniveaus toe zodat leerkrachten je vinden.

\n Doorgaan\n
\n
\n
\n
\n
\n

\n
\n
\n
\n'), +}catch(c){b.errors.push(c.message)}return b.queryTree},this.createQuery=function(a){var b={originalQueryString:a,queryString:a,queryTree:{},errors:[]};return this.parseQueryString(b),b};var k=function(a){var b=a.term,c=a.lowerBound||a.upperBound;if(c){var d=a.lowerBound||"*",e=a.upperBound||"*",f=a.inclusive;d instanceof Date&&(d=d.toISOString()),e instanceof Date&&(e=e.toISOString()),b=d+" TO "+e,b=f?"["+b+"]":"{"+b+"}"}else(a.quoted||-1!==b.indexOf(" "))&&(b='"'+b+'"'),a.similarity&&(b+="~"+a.similarity),a.proximity&&(b+="~"+a.proximity),a.prefix&&(b=a.prefix+b),a.boost&&(b+="^"+a.boost);return b},l=function(a,b,c){if(a.left){var d,e=a.operator===j?" ":" "+a.operator+" ";return a.right?(d=l(a.left,b+1,c),d+=e,d+=l(a.right,b+1,c),b>0&&(d="("+d+")"),a.field&&a.field!==j&&(d=a.field+":"+d)):d=l(a.left,b+1,c),d}var f="",g=k(a);if(a.field!==j&&null!==a.field){var h="";_.contains(["!","+","-"],a.transformer)&&(h=a.transformer),f+=h+a.field+":"}return f+=g,c+=f};this.unparse=function(a){return a.queryString=this.unparseQueryTree(a.queryTree),a.queryString},this.unparseQueryTree=function(a){var b="";return a.left&&(b=l(a,0,"")),b},this.unparseGroupedTree=function(a){var b=a,c="";return _.forEach(b.nodes,function(a,d){var e="";if("group"===a.type){var g=a;_.forEach(g.nodes,function(b,c){if("group"===b.type){var d=b,h=" ";if(1===d.nodes.length){var i=d.nodes[0];h+=d.operator+" "+f(i)}else h+=d.operator+" (",_.forEach(d.nodes,function(a,b){b&&(h+=" OR "),h+=f(a)}),h+=")";e+=h}else{c&&(e+=" "+a.operator+" "),e+=f(b);var j=c+1;c&&j1&&g.nodes.length>1&&(e="("+e+")")}else console.log("Expecting a group but found: "+a.type);if(d||a.excluded){var h=a.excluded?"NOT":"OR";c+=" "+h+" "}c+=e}),c},this.groupQueryTree=function(a){var b={type:"root",nodes:[],operator:a.operator||"OR"};if(a.left)this.groupNode(a,b),this.cleanUpGroupedFieldTree(b);else{var c={type:"field",operator:"OR",nodes:[{field:"title",term:"",fieldType:"tokenized-string",transformer:"+"}]};b.nodes.push(c)}return b},this.cleanUpGroupedFieldTree=function(a){_.forEach(a.nodes,function(a){delete a.implicitField,a.nodes&&1===a.nodes.length&&(a.type="field"),a.operator===j&&(a.operator="OR"),_.forEach(a.nodes,function(a){var b=_.find(d,function(b){return b.name===a.field});if(b){if(a.fieldType=b.type,"term"===b.type){var c=_.find(e,function(b){return b.label.toUpperCase()===a.term.toUpperCase()});if(c){var f="category_"+c.domain+"_name";a.field=f,a.term=c.label}else a.invalid=!0}if("choice"===b.type){var g=_.find(b.options,function(b){return b===a.term.toUpperCase()});g?a.term=g:a.invalid=!0}if("check"===b.type&&(_.contains(["TRUE","FALSE"],a.term.toUpperCase())?a.term=a.term.toUpperCase():a.invalid=!0),"tokenized-string"===b.type&&(a.transformer&&"="!==a.transformer||(a.transformer="+"),"!"===a.transformer&&(a.transformer="-")),"string"===b.type&&(a.transformer&&"+"!==a.transformer||(a.transformer="="),"-"===a.transformer&&(a.transformer="!")),"number"===b.type&&(a.term?a.transformer="=":a.upperBound&&"*"===a.lowerBound?a.transformer="<":a.lowerBound&&"*"===a.upperBound?a.transformer=">":(a.transformer="=",a.term=a.lowerBound||a.upperBound,a.lowerBound=void 0,a.upperBound=void 0)),"date-range"===b.type){var h=moment(a.lowerBound),i=moment(a.upperBound);h.isValid()&&i.isValid()?h.isSame(i,"day")?a.transformer="=":a.transformer="><":(!h.isValid()&&i.isValid()&&(a.transformer="<"),!i.isValid()&&h.isValid()&&(a.transformer=">"))}}})})},this.groupNode=function(a,b,c){if(a.operator===j&&(a.operator="OR"),!c||a.operator&&a.operator!==c.operator){var d={type:"group",operator:a.operator||"OR",nodes:[]};b.nodes.push(d),c=d}if(a.field&&a.field!==j&&(c.implicitField=a.field),a.term||a.lowerBound&&a.upperBound){var e=a.field;if(e===j){if(!c.implicitField)throw"Field name is implicit and not defined elsewhere.";e=c.implicitField}c.nodes.push(i(a,e))}a.left&&(this.groupNode(a.left,b,c),a.right&&this.groupNode(a.right,b,c))}}angular.module("udb.search").service("sapi2QueryBuilder",a),a.$inject=["LuceneQueryParser","sapi2QueryTreeValidator","sapi2QueryTreeTranslator","sapi2QueryFields","taxonomyTerms"]}(),function(){"use strict";angular.module("udb.search").value("sapi2QueryFields",[{name:"cdbid",type:"string",group:"what",editable:!0},{name:"keywords",type:"string",group:"what",editable:!0},{name:"title",type:"tokenized-string",group:"what",editable:!0},{name:"category_eventtype_name",type:"term",group:"what",editable:!0},{name:"category_theme_name",type:"term",group:"what",editable:!0},{name:"city",type:"string",group:"where",editable:!0},{name:"zipcode",type:"string",group:"where",editable:!0},{name:"country",type:"choice",group:"where",editable:!1,options:["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM"]},{name:"location_name",type:"tokenized-string",group:"where",editable:!0},{name:"location_labels",type:"string",group:"where",editable:!0},{name:"category_flandersregion_name",type:"term",group:"where",editable:!0},{name:"startdate",type:"date-range",group:"when",editable:!0},{name:"enddate",type:"date-range",group:"when",editable:!0},{name:"permanent",type:"check",group:"when",editable:!0},{name:"lastupdated",type:"date-range",group:"input-information",editable:!0},{name:"lastupdatedby",type:"string",group:"input-information",editable:!0},{name:"creationdate",type:"date-range",group:"input-information",editable:!0},{name:"createdby",type:"string",group:"input-information",editable:!0},{name:"availablefrom",type:"date-range",group:"input-information",editable:!0},{name:"detail_lang",type:"choice",group:"translations",editable:!0,options:["nl","fr","en","de"]},{name:"organiser_keywords",type:"string",group:"other",editable:!0},{name:"agefrom",type:"number",group:"other",editable:!0},{name:"price",type:"number",group:"other",editable:!0},{name:"organiser_label",type:"tokenized-string",group:"other",editable:!0},{name:"category_facility_name",type:"term",group:"other",editable:!0},{name:"category_targetaudience_name",type:"term",group:"other",editable:!0},{name:"category_publicscope_name",type:"term",group:"other",editable:!0},{name:"like_count",type:"number"},{name:"recommend_count",type:"number"},{name:"attend_count",type:"number"},{name:"comment_count",type:"number"},{name:"category_name",type:"term"},{name:"externalid",type:"string"},{name:"private",type:"check"},{name:"physical_gis",type:"string"}])}(),function(){"use strict";function a(a){var b=a,c=function(a,c){var d=a,e=_.findKey(b[c],function(b){return b===a});return e&&(d=e.toLowerCase()),d},d=function(a,b){var e=a.left||!1,f=a.right||!1,g=[];e&&g.push(e),f&&g.push(f);for(var h=0,i=g.length;i>h;h++){var j=g[h];"object"==typeof j&&d(j,b+1)}a.field&&(a.field=c(a.field,"en"),a.field=c(a.field,"nl"))};this.translateQueryTree=function(a){return d(a,0)}}angular.module("udb.search").service("sapi2QueryTreeTranslator",a),a.$inject=["queryFieldTranslations"]}(),function(){"use strict";function a(a){var b=_.union(_.map(a,"name"),["_exists_"]),c="",d=_(b).filter(function(a){return a.indexOf(".")>0}).map(function(a){return a.split(".")[0]}).value(),e=function(a,f,g){var h=a.left||!1,i=a.right||!1,j=[];h&&j.push(h),i&&j.push(i);for(var k=0,l=j.length;l>k;k++){var m=j[k];"object"==typeof m&&e(m,f+1,g)}var n=a.field;if("undefined"!=typeof n){var o=_.trim(n,".\\*"),p=n!==o;if(null!==n&&n!==c){var q=p?d:b;_.contains(q,o)||g.push(n+" is not a valid search field")}}};this.validate=function(a,b){e(a,0,b)}}angular.module("udb.search").service("sapi2QueryTreeValidator",a),a.$inject=["sapi2QueryFields"]}(),function(){"use strict";function a(a,b){var c=null,d=null;this.clearQueryTree=function(){d=null},this.setQueryString=function(b,e){var f=!1;c&&c.queryString===b||(f=a.createQuery(b),a.isValid(f),this.setQuery(f),d=null),c&&!f&&e&&this.setQuery(c)},this.setQueryTree=function(b){var c=a.unparseGroupedTree(b),e=a.createQuery(c);a.isValid(e),this.setQuery(e),d=b},this.setQuery=function(a){c=a,b.$emit("searchQueryChanged",a)},this.getQuery=function(){return c},this.getQueryTree=function(){return angular.copy(d)}}angular.module("udb.search").service("searchHelper",a),a.$inject=["LuceneQueryBuilder","$rootScope"]}(),function(){"use strict";function a(a){var b={ALL:{name:"all",icon:"fas fa-check-square"},NONE:{name:"none",icon:"far fa-square"},SOME:{name:"some",icon:"fas fa-minus-square"}},c=function(c,d){this.pageSize=c||30,this.events=[],this.totalItems=0,this.currentPage=d||1,this.loading=!0,this.lastQuery=null,this.eventProperties={description:{name:a.instant("search.description"),visible:!1},labels:{name:a.instant("search.labels"),visible:!1},image:{name:a.instant("search.picture"),visible:!1}},this.eventSpecifics=[{id:"input",name:a.instant("search.inputInformation")}],this.activeSpecific=this.eventSpecifics[0],this.selectedOffers=[],this.selectionState=b.NONE,this.querySelected=!1};return c.prototype={enableSpecifics:function(a){this.eventSpecifics=_.uniq(_.union(this.eventSpecifics,a),"id")},toggleSelection:function(){var a=this.selectionState;a===b.SOME||a===b.ALL?(this.deselectPageItems(),this.querySelected&&(this.deselectAll(),this.querySelected=!1)):this.selectPageItems()},selectQuery:function(){this.querySelected=!0,this.selectPageItems()},updateSelectionState:function(){var a=this.selectedOffers,c=_.filter(this.events,function(b){return _.contains(a,b)});c.length===this.pageSize?this.selectionState=b.ALL:c.length>0?this.selectionState=b.SOME:this.selectionState=b.NONE},toggleSelect:function(a){if(!this.querySelected){var b=_.find(this.selectedOffers,function(b){return b["@id"]===a["@id"]});if(b)this.selectedOffers=_.filter(this.selectedOffers,function(b){return b["@id"]!==a["@id"]});else{var c=_.find(this.events,function(b){return b["@id"]===a["@id"]});this.selectedOffers.push(c)}this.updateSelectionState()}},deselectAll:function(){this.selectedOffers=[],this.selectionState=b.NONE},deselectPageItems:function(){var a=this.selectedOffers;_.forEach(this.events,function(b){_.remove(a,function(a){return a["@id"]===b["@id"]})}),this.selectionState=b.NONE},selectPageItems:function(){var a=this.events,c=this.selectedOffers;_.each(a,function(a){c.push(a)}),this.selectedOffers=_.uniq(c),this.selectionState=b.ALL},isOfferSelected:function(a){return!!_.find(this.selectedOffers,function(b){return b["@id"]===a["@id"]})},setResults:function(a){var b=this;b.pageSize=a.itemsPerPage||30,b.events=a.member||[],b.totalItems=a.totalItems||0,b.loading=!1,this.querySelected&&this.selectPageItems(),this.updateSelectionState()},queryChanged:function(a){this.loading=!0,this.selectedOffers=[],this.querySelected=!1,this.lastQuery&&this.lastQuery!==a&&(this.currentPage=1),this.lastQuery=a},activateSpecific:function(a){this.activeSpecific=a},isShowingProperties:function(){var a=_.find(this.eventProperties,function(a){return a.visible});return!!a}},c}angular.module("udb.search").factory("SearchResultViewer",a),a.$inject=["$translate"]}(),function(){"use strict";angular.module("udb.search").constant("EventTranslationState",{ALL:{name:"all",icon:"fa-circle"},NONE:{name:"none",icon:"fa-circle-o"},SOME:{name:"some",icon:"fa-dot-circle-o"}})}(),function(){"use strict";function a(){var a={restrict:"AE",controller:"OfferController",controllerAs:"eventCtrl",templateUrl:"templates/event.directive.html"};return a}angular.module("udb.search").directive("udbEvent",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){var b=k.instant("offerTypes."+a);return _.includes(b,"offerTypes.")?a:b}function n(a){var d=a.facilities.sort(function(a,b){return a.label.localeCompare(b.label)});return a.facilities=d,v=a,v.updateTranslationState(),b.event=c(v,x,!0),b.offerType=b.event.url.split("/").shift(),b.translatedOfferType=m(b.event.type.label),w.offerExpired="event"===b.offerType?a.isExpired():!1,w.hasFutureAvailableFrom=a.hasFutureAvailableFrom(),w.fetching=!1,p(),v}function o(a){return a&&"event"===b.event.url.split("/").shift()?h.resolve(a):h.reject()}function p(){b.$watch(function(){return v.labels},function(a){b.event.labels=angular.copy(a)})}function q(a,b,c){var d=w.activeLanguage,f=c||a;b&&b!==v[a][d]&&e.translateProperty(v,f,d,b).then(v.updateTranslationState(v))}function r(){w.labelResponse="",w.labelsError=""}function s(a){b.event.labels=angular.copy(v.labels),w.labelResponse="unlabelError",w.labelsError=a.title}function t(a){r(),f.unlabel(v,a.name)["catch"](s)}function u(a){return b.event.location&&(b.event.location=c(b.event.location,x)),h.resolve(a)}var v,w=this,x=k.use()||"nl";w.translation=!1,w.activeLanguage=x,w.languageSelector=[{lang:"fr"},{lang:"en"},{lang:"de"}],w.uitId=_.get(i,"uitidUrl"),w.labelRemoved=t,l.isGodUser().then(function(a){w.isGodUser=a}),w.init=function(){if(!b.event.title){if(w.fetching=!0,b.event.name){var c=a.formatJsonLDEntity(b.event);return void n(c)}return a.getOffer(b.event["@id"]).then(function(a){n(a)})}w.fetching=!1},h.when(w.init()).then(u).then(o)["finally"](function(){w.editable=!0}),w.hasActiveTranslation=function(){var a=v;return a&&a.translationState[w.activeLanguage]!==d.NONE},w.getLanguageTranslationIcon=function(a){var b=d.NONE.icon;return v&&a&&(b=v.translationState[a].icon),b},w.translate=function(){w.applyPropertyChanges("name"),w.applyPropertyChanges("description")},w.toggleLanguage=function(a){a===w.activeLanguage?w.stopTranslating():(w.activeLanguage=a,w.translation=c(v,w.activeLanguage))},w.hasPropertyChanged=function(a){var b=w.activeLanguage,c=w.translation;return w.translation&&v[a][b]!==c[a]},w.undoPropertyChanges=function(a){var b=w.activeLanguage,c=w.translation;c&&(c[a]=v[a][b])},w.applyPropertyChanges=function(a){var b=w.translation[a];q(a,b,a)},w.stopTranslating=function(){w.translation=void 0,w.activeLanguage=x},w.labelAdded=function(a){var c=_.find(v.labels,function(b){return a.name.toUpperCase()===b.toUpperCase()});c?(b.$apply(function(){b.event.labels=angular.copy(v.labels)}),g.alert('Het label "'+a.name+'" is reeds toegevoegd als "'+c+'".')):(w.addedLabel=a.name,f.label(v,a.name).then(function(){w.labelResponse="success",b.event.labels=angular.copy(v.labels)})["catch"](function(){w.labelResponse="error"}))},w.showConcludedButton=function(){var a=_.get(i,"concludedButton.toggle",!1);if(!a)return!1;var c=_.get(i,"calendarHighlight.date"),d=moment(c).endOf("day");return"event"===b.offerType&&d=h;if(i)n("EVENT-EXPORT.TOO-MANY-ITEMS",{limit:h}).then(function(a){e.alert(a)});else if(d&&d.queryString.length&&o.isValid(d)){g.open({templateUrl:"templates/event-export-modal.html",controller:"EventExportController",controllerAs:"exporter",size:"lg"})}else n("EVENT-EXPORT.QUERY-IS-MISSING").then(function(a){e.alert(a)})}function v(a,b){z(b)}a.resultViewer=new h(30,s()),a.realQuery=!1,a.activeQuery=!1,a.queryEditorShown=!1,a.currentPage=s(),a.language=n.use()||"nl";var w=function(){l.$emit("searchComponentReady")};c.on("click",w),a.$on("$destroy",function(){c.off("click",w)});var x=[{id:"accessibility",name:"Toegankelijkheidsinformatie",permission:p.editFacilities}];q.getPermissions().then(function(b){var c=_.filter(x,function(a){return!_.has(a,"permission")||_.contains(b,a.permission)});a.resultViewer.enableSpecifics(c)});var y=function(c){var e=(a.resultViewer.currentPage-1)*a.resultViewer.pageSize,g="string"==typeof c?c:c.queryString,h=a.resultViewer.currentPage>1?String(a.resultViewer.currentPage):null;f.search({query:r().queryString||null,page:h}),a.resultViewer.loading=!0,d.findOffers(g,e).then(function(c){c.member&&(c=d.reformatJsonLDData(c)),j.addPagedCollection(c),a.resultViewer.setResults(c),b(function(){l.$emit("searchComponentReady")})})},z=function(b){if(a.activeQuery=b,o.isValid(b)){var c=o.unparse(b);a.resultViewer.queryChanged(c),y(c),c!==b.originalQueryString?a.realQuery=c:a.realQuery=!1}},A=function(b){var c=a.resultViewer.selectedOffers;_.each(c,function(a){var c;c=d.getOffer(new URL(a["@id"])),c.then(function(a){a.label(b)})}),_.each(b,function(a){i.labelOffersById(c,a)})},B=function(){var b=a.resultViewer.selectedOffers;if(!b.length)return void e.alert("First select the events you want to label.");var c=g.open({templateUrl:"templates/offer-label-modal.html",controller:"OfferLabelModalCtrl",controllerAs:"lmc"});c.result.then(A)},C=function(){var b=a.resultViewer.querySelected;b?t():B()},D=function(){var b=a.resultViewer.selectedOffers;if(!b.length)return void e.alert("First select the events you want to label.");var c=g.open({templateUrl:"templates/offer-languages-modal.html",controller:"OfferLanguagesModalCtrl",controllerAs:"lmc"});c.result.then(A)};a.exportEvents=u,a.label=C,a.addLanguageIcons=D,a.startEditing=function(){a.queryEditorShown=!0},a.stopEditing=function(){a.queryEditorShown=!1};var E=1===a.currentPage;a.pageChanged=function(){var c=a.currentPage;E?(a.resultViewer.currentPage=c,y(a.activeQuery).then(function(){b(function(){l.$emit("searchComponentReady")})}),e.scroll(0,0)):(a.currentPage=a.resultViewer.currentPage,E=!0)};var F=_.once(function(){var b=l.$on("searchQueryChanged",v),c=l.$on("startEditingQuery",a.startEditing),d=l.$on("stopEditingQuery",a.stopEditing);a.$on("$destroy",c),a.$on("$destroy",b),a.$on("$destroy",d)});F()}angular.module("udb.search").controller("SearchController",a),a.$inject=["$scope","$timeout","$document","udbApi","$window","$location","$uibModal","SearchResultViewer","offerLabeller","offerLocator","searchHelper","$rootScope","eventExporter","$translate","LuceneQueryBuilder","authorization","authorizationService"]}(),function(){"use strict";function a(){return{templateUrl:"templates/search.html",restrict:"EA",controller:"SearchController"}}angular.module("udb.search").directive("udbSearch",a)}(),function(){"use strict";function a(a,b,c){function d(){a.all([b.getEventCardSystems(n.id),b.findOrganisationsCardSystems(m.id)]).then(h,e)}function e(a){400===a.status&&(l.uitpasUnavailableType="already_has_ticketsales"),404===a.status&&(l.uitpasUnavailableType="not_found")}function f(){l.uitpasUnavailableType=void 0}function g(){l.availableCardSystems=void 0,f(),j(),d()}function h(a){var b=a[0],c=a[1];l.availableCardSystems=_.map(c,function(a){return _.assign(a,{assignedDistributionKey:i(b,a),active:!!_.find(b,{id:a.id})})})}function i(a,b){var c=_.find(a,{id:b.id});return _.first(!c||_.isEmpty(c.distributionKeys)?b.distributionKeys:c.distributionKeys)}function j(){l.persistingCardSystems=!1}function k(a){return a.assignedDistributionKey?l.distributionKeyAssigned(a):b.addEventCardSystem(n.id,a.id)}var l=this,m=l.organisation,n=l.offerData;l.$onInit=d,l.refresh=g,l.distributionKeyAssigned=function(d){if(!d.assignedDistributionKey)throw"card system distribution key is missing";return l.persistingCardSystems=!0,b.addEventCardSystemDistributionKey(n.id,d.id,d.assignedDistributionKey.id).then(function(){return c.$emit("uitpasDataSaved"),j(),a.resolve()})},l.activeCardSystemsChanged=function(a){function d(b){a.active=!a.active,e(b)}function f(){c.$emit("uitpasDataSaved")}l.persistingCardSystems=!0;var g=a.active?k(a):b.removeEventCardSystem(n.id,a.id);g.then(f,d)["finally"](j)}}angular.module("udb.uitpas").component("cardSystemSelector",{templateUrl:"templates/card-systems.html",controller:a,controllerAs:"cardSystemSelector",bindings:{organisation:"<",offerData:"<"}}),a.$inject=["$q","udbUitpasApi","$rootScope"]}(),function(){"use strict";function a(a,b,c){function d(b){b?(a.showUitpasInfo=_.get(g,"organizer.isUitpas",!1)&&c.isEvent,g.showCardSystems=g.price&&!!g.price.length):(g.showCardSystems=!1,a.showUitpasInfo=!1)}function e(){g.eventFormData=c,d(g.organizer),g.listeners=[b.$on("eventFormSaved",g.showCardSystemsIfPriceIsSelected),b.$on("eventOrganizerSelected",g.updateOrganizer),b.$on("eventOrganizerDeleted",g.updateOrganizer),b.$on("uitpasDataSaved",g.markUitpasDataAsCompleted)]}function f(){_.invoke(g.listeners,"call")}var g=this;a.showUitpasInfo=!1,a.uitpasCssClass="state-incomplete",g.listeners=[],g.showCardSystems=!1,g.$onInit=e,g.$onDestroy=f,g.showCardSystemsIfPriceIsSelected=function(a,b){g.showCardSystems=b.priceInfo&&!!b.priceInfo.length},g.markUitpasDataAsCompleted=function(){a.uitpasCssClass="state-complete"},g.updateOrganizer=function(a,b){g.organizer=b,d(b)}}angular.module("udb.uitpas").component("uitpasInfo",{templateUrl:"templates/uitpasInfo.html",controller:a,controllerAs:"upic",bindings:{organizer:"<",price:"<"}}),a.$inject=["$scope","$rootScope","EventFormData"]}(),function(){"use strict";angular.module("udb.uitpas").constant("DefaultUitpasLabels",{PASPARTOE:"Paspartoe",UITPAS:"UiTPAS",UITPAS_GENT:"UiTPAS Gent",UITPAS_OOSTENDE:"UiTPAS Oostende",UITPAS_REGIO_AALST:"UiTPAS Regio Aalst",UITPAS_DENDER:"UiTPAS Dender",UITPAS_ZUIDWEST:"UiTPAS Zuidwest",UITPAS_MECHELEN:"UiTPAS Mechelen",UITPAS_KEMPEN:"UiTPAS Kempen",UITPAS_MAASMECHELEN:"UiTPAS Maasmechelen",UITPAS_LEUVEN:"UiTPAS Leuven",UITPAS_LIER:"UiTPAS Lier","UITPAS_HEIST-OP-DEN-BERG":"UiTPAS Heist-op-den-Berg",UITPAS_MEETJESLAND:"UiTPAS Meetjesland",UITPAS_WESTHOEK:"UiTPAS Westhoek"})}(),function(){"use strict";function a(a){var b=this;b.organisation=a.organisation,b.query=a.query}angular.module("udb.uitpas").controller("OrganisationSuggestionController",a),a.$inject=["$scope"]}(),function(){"use strict";function a(){return{templateUrl:"templates/organisation-suggestion.directive.html",controller:"OrganisationSuggestionController",controllerAs:"os",scope:{organisation:"<",query:"<"},restrict:"A"}}angular.module("udb.uitpas").directive("uitpasOrganisationSuggestion",a)}(),function(){"use strict";function a(a,b,c,d,e,f){function g(a){return"object"==typeof a.distributionKeys&&(a.distributionKeys=_.values(a.distributionKeys)),a}function h(b){var c="object"==typeof b.data?_.values(b.data):b.data;return a.resolve(_.map(c,g))}function i(b){return a.resolve(b.data)}function j(b,c,d){function g(g){return f().add(c,"seconds").isAfter(d)?a.reject(g):e(function(){return j(b,c,d)},c)}return b()["catch"](g)}var k=_.get(c,"uitpasUrl"),l=_.get(c,"uitpasMaxDelay",8),m={headers:{"Content-Type":"application/json",Authorization:"Bearer "+d.getToken(),"X-Api-Key":_.get(c,"apiKey")},params:{}};this.getEventCardSystems=function(a){function c(){return b.get(k+"events/"+a+"/cardSystems/",m)}var d=f().add(l,"s");return j(c,2,d).then(h)},this.getTicketSales=function(c,d){function e(){return b.get(k+"events/"+c,m)}function g(a){return a.data.hasTicketSales}var h=a.defer(),i=f().add(l,"s");return d.isUitpas?h.resolve(j(e,2,i).then(g)):h.resolve(!1),h.promise},this.findOrganisationsCardSystems=function(a){return b.get(k+"organizers/"+a+"/cardSystems/",m).then(h)},this.addEventCardSystem=function(a,c){return b.put(k+"events/"+a+"/cardSystems/"+c,null,m).then(i)},this.removeEventCardSystem=function(a,c){return b["delete"](k+"events/"+a+"/cardSystems/"+c,m).then(i)},this.addEventCardSystemDistributionKey=function(a,c,d){return b.put(k+"events/"+a+"/cardSystems/"+c+"/distributionKey/"+d,null,m).then(i)}}angular.module("udb.uitpas").service("udbUitpasApi",a),a.$inject=["$q","$http","appConfig","uitidAuth","$timeout","moment"]}(),function(){"use strict";function a(){var a;this.useLabels=function(b){a=b},this.$get=["DefaultUitpasLabels",function(b){return a?a:b}]}angular.module("udb.uitpas").provider("UitpasLabels",a)}(),function(){angular.module("udb.core").run(["$templateCache",function(a){"use strict";a.put("templates/calendar-summary.directive.html",'\n\n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n'),a.put("templates/image-detail.directive.html",'\n \n \n \n \n
    \n
  • \n
    \n \n {{::translateImageDetail(\'alt_image\', {index: $index}) }}\n \n
    \n
    \n \n

    {{image.description}}

    \n

    © {{image.copyrightHolder}}

    \n
    \n
    \n
  • \n
\n \n \n\n'),a.put("templates/udb.workflow-status.directive.html",'\n \n \n \n \n {{::cm.status | translate }}\n {{cm.event.availableFrom | date: \'dd/MM/yyyy\'}}\n \n \n

 

\n \n\n\n \n \n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
\n \n\n'),a.put("templates/unexpected-error-modal.html",'\n\n\n'),a.put("templates/event-cultuurkuur.html",'
\n
\n

\n
\n
\n

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n

Bekijk je evenement op cultuurkuur.be en voeg de juiste onderwijsniveaus toe zodat leerkrachten je vinden.

\n Doorgaan\n
\n
\n
\n
\n
\n

\n
\n
\n
\n'), a.put("templates/dashboard-item.directive.html",'\n \n \n \n \n Online op \n Publicatie afgewezen \n
\n \n \n \n - \n \n \n \n\n\n\n \n
\n \n \n
    \n
  • \n \n
  • \n
  • \n
  • \n \n
  • \n
\n
\n
\n \n
\n \n
\n \n
\n
\n\n'),a.put("templates/dashboard-organizer-item.directive.html",'\n \n \n \n
\n \n \n ,\n \n \n\n\n\n \n
\n \n
\n
\n\n'),a.put("templates/event-delete-confirm-modal.html",'\n\n'),a.put("templates/place-delete-confirm-modal.html",'\n\n'),a.put("templates/dashboard.html",'

\n \n

\n\n
\n \n
\n\n
\n \n
\n\n
\n\n
\n
\n\n
\n \n
\n\n
\n \n
\n\n
\n
\n

\n
\n

\n
\n
\n\n
\n\n
\n

\n \n \n \n

\n
\n\n
\n \n \n \n \n \n \n \n
\n \n\n
\n
\n\n
\n\n
\n

\n \n \n \n

\n
\n\n
\n \n \n \n \n \n
\n \n\n
\n
\n\n
\n
\n\n
\n'),a.put("templates/event-duplication-footer.component.html",'
\n \n \n \n
'),a.put("templates/event-duplication-step.component.html",'

\n\n\n\n\n'),a.put("templates/event-duplication.html",'
\n \n \n
\n'),a.put("templates/job-logo.directive.html",'
\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n
\n'),a.put("templates/offer-label-modal.html",'\n\n\n'),a.put("templates/offer-languages-modal.html",'\n\n\n'),a.put("templates/base-job.template.html",'

\n \n \n \n \n

\n'),a.put("templates/failed-job.template.html",'

\n \n \n \n \n \n \n \n

\n'),a.put("templates/job-log.component.html",'
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n

\n
    \n
  • \n \n
  • \n
\n
\n\n
\n

\n
    \n
  • \n \n
  • \n
\n
\n\n
\n

\n
    \n
  • \n \n
  • \n
\n
\n\n \n\n
\n
\n
\n
\n'),a.put("templates/booking-info-detail.directive.html",'\n \n \n \n \n
    \n
  • \n \n \n \n
  • \n\n
  • \n
  • {{::bookingInfo.email}}
  • \n
  • Van {{::bookingInfo.availabilityStarts | date}} tot {{::bookingInfo.availabilityEnds | date}}
  • \n
\n \n \n\n'),a.put("templates/contact-point-detail.directive.html",'\n \n \n \n \n
    \n
  • \n \n \n \n \n
  • \n
  • \n \n \n \n \n
  • \n
  • \n \n \n \n \n
  • \n
\n \n \n\n'),a.put("templates/event-detail.html",'
\n \n\n
\n
\n

\n
\n
\n
\n\n
\n

\n

\n
\n\n
\n

\n
\n
\n
\n \n \n \n \n \n \n \n \n
\n
\n
\n \n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n
{{::event.name}}
{{::translateType(event.type.label)}}
Toegang\n

\n \n \n
\n \n \n

\n \n \n

\n

\n \n

\n

\n \n

\n

\n \n \n

\n
\n
\n
{{eventLocation(event)}}\n {{eventLocation(event)}}\n
\n \n {{::event.onlineUrl}}\n \n \n
\n \n \n Probleem bij het ophalen van de kalenderinformatie\n \n
\n

\n
\n
\n

\n
\n
\n {{::event.organizer.name}}\n {{::event.organizer.name}}\n
\n \n \n \n \n \n
{{priceInfo.name}}\n \n \n {{priceInfo.price | currency}} \n \n
\n
\n {{ageRange}}\n \n \n
\n \n
\n
\n\n
\n
\n

\n \n

\n
\n
\n
\n
\n \n
\n \n
\n API: \n
\n
\n API key: \n ()\n
\n
\n Auth0 client id: \n
\n
\n Auth0 client name: \n
\n
\n
\n
\n
\n
\n\n
\n \n \n \n \n \n \n \n
\n
\n\n
\n
\n
\n'), a.put("templates/form-age.html",'
\n \n \n
\n \n \n {{ translateAgeRange(ageRange.label) }}\n {{ getAgeRangeLabel(ageRange) }}\n \n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n \n
\n
\n\n'),a.put("templates/form-audience.html",'
\n
\n
\n \n
\n
\n
\n \n
\n\n
\n \n
\n\n\n
\n \n
\n
\n \n
\n \n
\n
\n
'),a.put("templates/form-calendar-datepicker.component.html",'

\n \n \n \n \n

'),a.put("templates/form-calendar-period.component.html",'
\n \n
\n
\n \n \n \n
\n\n
\n \n \n \n
\n\n
\n
\n

\n
\n
\n
\n
\n'),a.put("templates/form-calendar-timepicker.component.html",'\n\n'),a.put("templates/form-event-calendar.component.html",'
\n
\n\n \n \n

\n \n

\n
\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n \n
\n\n
\n \n \n
\n
\n
\n
\n

\n
\n
\n
\n
\n \n \n &\n \n
\n
\n\n \n
\n
\n\n
\n \n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n'),a.put("templates/form-place-calendar.component.html",'
\n
\n
\n
\n \n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n'),a.put("templates/city-suggestion.html",'\n'),a.put("templates/event-form-image-edit.html",'\n'),a.put("templates/event-form-image-remove.html",'\n'),a.put("templates/event-form-image-upload.html",'\n'),a.put("templates/opening-hours-editor.modal.html",'\n\n\n'),a.put("templates/event-form-openinghours.html",'
\n
\n
\n

\n \n \n

\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n
\n
\n'),a.put("templates/event-form-organizer-modal.html",'\n\n\n\n'), a.put("templates/organizer-typeahead-template.html","{{match.model.name}}"),a.put("templates/event-form-place-modal.html",'\n\n\n'),a.put("templates/place-suggestion-popup.html",''),a.put("templates/place-suggestion.html",'
\n \n \n \n
\n'),a.put("templates/price-form-modal.html",'\n\n\n\n'),a.put("templates/priceInfo.html",'
\n
\n
\n \n \n
\n
\n\n
\n
\n \n \n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n \n \n
{{priceInfo.name[$ctrl.mainLanguage]}}\n \n Gratis\n \n \n {{priceInfo.price | currency:\'€\' }} \n \n
\n
\n
\n\n
\n
\n
\n'),a.put("templates/event-form-publish-modal.html",'\n\n\n'),a.put("templates/reservation-period.html",'
\n \n \n
\n
\n
\n
\n
\n

\n
\n
\n \n
\n
\n
\n
\n
\n\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
'),a.put("templates/event-preview.directive.html",'
\n\n
\n
    \n
  • \n
\n

\n
\n\n
\n\n

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n
\n \n \n
\n
\n gratis\n \n \n \n \n \n niet ingevoerd\n
\n
\n
\n
\n\n
\n \n Ingevoerd door \n op \n \n \n
\n'),a.put("templates/event-suggestion.directive.html",''),a.put("templates/place-preview.directive.html",'
\n\n
\n
    \n
  • \n
\n

\n
\n\n
\n\n

\n\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n \n
\n \n \n \n \n
\n
\n
\n\n
\n \n Ingevoerd door \n op \n \n
\n'),a.put("templates/place-suggestion.directive.html",''),a.put("templates/suggestion-preview-modal.html",'\n\n\n'),a.put("templates/event-form-publish.html",'
\n
\n\n \n
\n \n \n \n \n \n \n \n
\n
\n \n Loading...\n
\n
\n'),a.put("templates/event-form-step1.html",'
\n \n
\n
\n
\n
\n

\n 1\n \n

\n
\n
\n
\n\n
\n
\n \n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
\n
\n\n
\n

\n
\n\n
\n \n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
\n
\n
\n\n
\n
\n \n \n
\n

\n
\n
\n\n
\n \n
\n
\n
\n

\n
\n
\n
    \n
  • \n \n
  • \n
\n
\n
\n
\n
\n\n

\n \n \n

\n
\n\n
\n'),a.put("templates/event-form-step2.html",'
\n \n
\n
\n
\n
\n

\n 2\n \n \n

\n
\n
\n
\n\n \n \n
\n
\n'),a.put("templates/event-form-step3.html",'
\n\n
\n
\n
\n
\n
\n

\n 3\n \n \n

\n
\n
\n \n
\n
\n
\n\n
\n
\n \n
\n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n \n \n
\n\n\n
\n
\n
\n \n
\n \n \n
\n\n
\n \n \n
\n \n
\n\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
\n
\n \n bv. 1104CA\n \n \n \n \n \n
\n
\n
\n \n \n
\n\n
\n \n \n \n \n
\n
\n\n \n
\n\n
\n'), diff --git a/src/search/ui/search.controller.js b/src/search/ui/search.controller.js index 1d6269e2..814f780f 100644 --- a/src/search/ui/search.controller.js +++ b/src/search/ui/search.controller.js @@ -15,6 +15,7 @@ angular function SearchController( $scope, $timeout, + $document, udbApi, $window, $location, @@ -52,6 +53,16 @@ function SearchController( $scope.currentPage = getCurrentPage(); $scope.language = $translate.use() || 'nl'; + var handleClick = function() { + $rootScope.$emit('searchComponentReady'); + }; + + $document.on('click', handleClick); + + $scope.$on('$destroy', function() { + $document.off('click', handleClick); + }); + var additionalSpecifics = [ {id: 'accessibility', name: 'Toegankelijkheidsinformatie', permission: authorization.editFacilities} ]; @@ -108,13 +119,7 @@ function SearchController( if (LuceneQueryBuilder.isValid(query)) { var realQuery = LuceneQueryBuilder.unparse(query); $scope.resultViewer.queryChanged(realQuery); - findOffers(realQuery) - .then(function() { - $timeout(function() { - $rootScope.$emit('searchComponentReady'); - }); - }); - + findOffers(realQuery); if (realQuery !== query.originalQueryString) { $scope.realQuery = realQuery; } else {