(()=>{var e={417:()=>{},130:(e,t,s)=>{var r=s(417);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.id,r,""]]),r.locals&&(e.exports=r.locals),(0,s(346).Z)("548a6fb0",r,!1,{})},346:(e,t,s)=>{"use strict";function r(e,t){for(var s=[],r={},n=0;nm});var n="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!n)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},i=n&&(document.head||document.getElementsByTagName("head")[0]),a=null,c=0,d=!1,h=function(){},u=null,l="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(e,t,s,n){d=s,u=n||{};var i=r(e,t);return g(i),function(t){for(var s=[],n=0;ns.parts.length&&(r.parts.length=s.parts.length)}else{var i=[];for(n=0;n{"use strict";s(894);const r=e=>{const t=e.split(".");let s=appKitSettings;for(let e=0;et.code===e.code))||this.errors.push(e)}},i=async(e,t,s,i)=>{const a=((e,t)=>{let s;return s="http"!==e.substring(0,4)?new URL(r("paths.baseAppKit")+e):new URL(e),t&&Object.keys(t).forEach((e=>{Array.isArray(t[e])?t[e].forEach((t=>s.searchParams.append(`${e}[]`,t))):"object"==typeof t[e]?Object.keys(t[e]).forEach((r=>s.searchParams.append(`${e}[ ${r} ]`,t[e][r]))):s.searchParams.append(e,t[e])})),s.toString()})(e,t);return(async(e,t,s)=>{try{let r=(new Date).getTime();const n=await fetch(e,t);if(!n.ok)throw{code:n.status,message:n.statusText};const o=await n.json();return s&&(s.milliseconds=(new Date).getTime()-r),o}catch(e){o.handleError(e)}})(a,{method:"GET",headers:n,params:t,signal:s},i)};class a{constructor(){this.user=null}isAuthenticated(){return null!==this.user}getAuthUser(){return this.user}setUser(e){this.user=e}async getIsAuthenticated(){let e=await i(r("paths.baseAuth")+"/user/get-authenticated");return e&&e.success?this.user=e.user:this.user=null,this.isAuthenticated()}}const c={install:e=>{e.prototype.$authService=new a}};class d{constructor(){this.getWorkspace=this.getWorkspace.bind(this),this.setWorkspace=this.setWorkspace.bind(this)}getWorkspace(){return this.workspace}setWorkspace(e){this.workspace=e}}const h={install:e=>{e.prototype.$workspaceHandler=new d}};class u{constructor(){this.getUserInterface=this.getUserInterface.bind(this),this.setUserInterface=this.setUserInterface.bind(this),this.switchWorkspace=this.switchWorkspace.bind(this),this.updateUserInterface=this.updateUserInterface.bind(this)}getUserInterface(){return this.userInterface||this.updateUserInterface(),this.userInterface}setUserInterface(e){this.userInterface=e,this.userInterface.workspace.accentColor&&document.querySelector("body").style.setProperty("--header-border-bottom-color",this.userInterface.workspace.accentColor.hexCode)}async updateUserInterface(){this.vue=window.AppKit.getApp();const e=await this.vue.$get(this.vue.$getSetting("paths.baseCms")+"/user-interface");return this.setUserInterface(e),this.userInterface}async switchWorkspace(e){let t=this.vue.$getSetting("paths.baseCms")+"/workspace/switch";e&&(t+="/"+e);const s=await this.vue.$get(t);this.vue.$actionHandler.handle(s)}}const l={install:e=>{e.prototype.$userInterfaceHandler=new u}};s(307),s(110),s(113),s(276),s(574),s(776),s(118),s(777),s(856),s(921),s(111),s(649),s(303),s(889),s(166),s(437),Vue.use(c),Vue.use(h),Vue.use(l)},118:()=>{Vue.asyncComponent("cms-account-menu",{data(){return{show:!1,user:this.$userInterfaceHandler.getUserInterface()?.user,avatar:this.$userInterfaceHandler.getUserInterface()?.avatar,menu:this.$userInterfaceHandler.getUserInterface()?.menuUser}},methods:{closeMenu(){this.show=!1}}},"cms/account/cms-account-menu.html")},777:()=>{Vue.asyncComponent("cms-profile",{data:()=>({})},"cms/account/cms-profile.html")},856:()=>{Vue.asyncComponent("cms-set-homepage",{data:()=>({currentIsHome:!1}),methods:{async setHomepage(){const e=window.location.pathname+window.location.search+window.location.hash,t=new URL(window.location.href);t.pathname="user/set-homepage",t.hash="";const s=await this.$post(t.toString(),{url:e});s.success&&(this.$actionHandler.handle(s.todos,this),this.currentIsHome=!0,this.$emit("set"))}},watch:{$route:{async handler(e,t){const s=new URL(window.location.href);s.pathname="user/get-homepage",s.hash="";const r=await this.$get(s.toString());if(r.success){const e=r.currentHome,t=window.location.protocol+"//"+window.location.host+e,s=-1!==window.location.href.indexOf("?t=")?window.location.href.substring(0,window.location.href.indexOf("?t=")):window.location.href;this.currentIsHome=t===s}},deep:!0}},async mounted(){const e=new URL(window.location.href);e.pathname="user/get-homepage",e.hash="";const t=await this.$get(e.toString());if(t.success){const e=t.currentHome,s=window.location.protocol+"//"+window.location.host+e,r=-1!==window.location.href.indexOf("?t=")?window.location.href.substring(0,window.location.href.indexOf("?t=")):window.location.href;this.currentIsHome=s===r}}},"cms/account/cms-set-homepage.html")},307:()=>{Vue.asyncComponent("cms-login-form",{data:()=>({loading:!1,steps:["email","password"],errorMessage:null,step:"email",values:{email:null,password:null,authenticationCode:null}}),methods:{async nextStep(){if(this.loading)return;if(!await this.validate(this.step))return;let e=this.steps.indexOf(this.step);this.step=this.steps[e+1]},focusField(){this.$nextTick((()=>{this.$el.querySelector("#"+this.step)?.focus()}))},goToStep(e){this.step=e},async validate(e){this.errorMessage=null,this.loading=!0;let t=await this.$post(this.$getSetting("paths.baseAuth")+"/user/validate-"+e,this.values);return this.loading=!1,t.authenticated?(this.authenticated(t),t.success):t.success?t.requireAuthenticationCode?(this.steps.push("tfa"),t.success):t.success:(this.errorMessage=t.errorMessage,t.success)},authenticated(e){this.$authService.setUser({name:e.user.name}),this.loading=!0,this.$actionHandler.handle(e.todos,this)},passwordRecovery(){this.$router.push({name:"password-recovery"})}},mounted(){this.focusField()}},"cms/form/cms-login-form.html")},110:()=>{Vue.asyncComponent("cms-password-recovery-form",{data:()=>({showSuccess:!1,loading:!1,error:null,email:null}),methods:{async submit(){this.loading=!0,this.error=null;const e={email:this.email};let t=await this.$post(this.$getSetting("paths.baseAuth")+"/user/password-recovery/",e);t={success:!0,error:"We konden geen account vinden met dit email adress"},this.loading=!1,t.success?this.showSuccess=!0:this.error=t.error},toLogin(){this.$router.push({name:"login"})}}},"cms/form/cms-password-recovery-form.html")},113:()=>{Vue.asyncComponent("cms-password-reset-form",{data:()=>({loading:!1,showSuccess:!1,showExpired:!1,showForm:!1,errors:{password:null,passwordConfirm:null},password:null,passwordConfirm:null}),methods:{async submit(){this.loading=!0,this.error=null;const e={token:this.token,password:this.password,passwordConfirm:this.passwordConfirm};let t=await this.$post(this.$getSetting("paths.baseAuth")+"/user/password-reset/",e);t={success:!0,errors:{password:"We konden geen account vinden met dit email adress",passwordConfirm:"We konden geen account vinden met dit email adress"}},this.loading=!1,t.success?this.showSuccess=!0:this.errors=t.errors},toLogin(){this.$router.push({name:"login"})},async checkToken(){this.loading=!0;const e={token:this.$route.query.token};let t=await this.$get(this.$getSetting("paths.baseAuth")+"/user/password-reset-token/",e);t={success:!0},this.loading=!1,t.success?this.showForm=!0:this.showExpired=!0}},created(){this.checkToken()}},"cms/form/cms-password-reset-form.html")},921:()=>{Vue.asyncComponent("cms-active-workspace",{data(){return{workspace:this.$userInterfaceHandler.getUserInterface()?.workspace,workspaceAllRedirectPath:this.$userInterfaceHandler.getUserInterface()?.workspaceAllRedirectPath,workspaceAllAccess:this.$userInterfaceHandler.getUserInterface()?.workspaceAllAccess}},methods:{switchWorkspace(e){this.$userInterfaceHandler.switchWorkspace(e)}}},"cms/layout/cms-active-workspace.html")},111:()=>{Vue.asyncComponent("cms-settings-menu",{data(){return{menu:this.$userInterfaceHandler.getUserInterface()?.menuSettings}}},"cms/layout/cms-settings-menu.html")},303:()=>{Vue.asyncComponent("cms-form",{computed:{bundle(){return this.$route.params.bundle},definition(){return this.$route.params.definition},objectId(){return this.$route.params.objectId},relationString(){return this.$route.params.relationString}},methods:{goToGrid(e){if("new"!==this.objectId?this.$emit("dataObjectChanged",this.objectId):this.$emit("changed",e),"blueprint-form"===this.$route.name)return this.$router.push({name:"blueprint"}),void this.$emit("save",e);this.$router.push({name:"grid",params:{bundle:e.bundleId,gridDefinition:e.definitionId}})},close(){this.$router.back()}}},"cms/pages/cms-form.html")},889:()=>{Vue.asyncComponent("cms-grid",{computed:{bundle(){return this.$route.params.bundle},gridDefinition(){return this.$route.params.gridDefinition},query(){return this.$route.query}},methods:{updateQuery(e){this.$router.push({...this.$route,query:e})},goToForm(e){this.$router.push({name:"form",params:{bundle:e.bundleId,definition:e.definitionId,objectId:e.objectId}})},goToGrid(e){this.$router.push({name:"grid",params:{bundle:e.bundleId,gridDefinition:e.definitionId}})}}},"cms/pages/cms-grid.html")},166:()=>{Vue.asyncComponent("cms-list",{computed:{bundle(){return this.$route.params.bundle},listDefinition(){return this.$route.params.listDefinition}},methods:{goToForm(e){this.$router.push({name:"form",params:{bundle:e.bundleId,definition:e.definitionId,objectId:e.objectId}})},goToGrid(e){this.$router.push({name:"grid",params:{bundle:e.bundleId,gridDefinition:e.definitionId}})}}},"cms/pages/cms-list.html")},437:()=>{Vue.asyncComponent("cms-page-not-found",{computed:{bundle(){return this.$route.params.bundle},gridDefinition(){return this.$route.params.gridDefinition}},methods:{goToForm(e){this.$router.push({name:"form",params:{bundle:e.bundleId,definition:e.definitionId,objectId:e.objectId}})},goToGrid(e){this.$router.push({name:"grid",params:{bundle:e.bundleId,gridDefinition:e.definitionId}})}}},"cms/pages/cms-page-not-found.html")},776:()=>{Vue.asyncComponent("cms-published-toggle",{props:{published:{default:!1},publishedStart:{type:String,required:!1,default:null},publishedEnd:{type:String,required:!1,default:null}},methods:{openPublishedStep(){this.$emit("doEdit")},togglePublished(){this.$emit("toggle",this.published)}}},"cms/published/cms-published-toggle.html")},649:()=>{Vue.asyncComponent("cms-seo-preview",{props:{id:{type:String,default:"",required:!0},previewType:{type:String,required:!0},url:{type:String},title:{type:String},description:{type:String},image:{type:String}},computed:{hostAndProtocol(){const e=new URL(this.url);return e.protocol+"://"+e.host},host(){return new URL(this.url).host},path(){return new URL(this.url).pathname.replace("/"," › ")}}},"cms/seo/cms-seo-preview.html")},276:()=>{Vue.asyncComponent("cms-share-menu-item",{data:()=>({openModal:!1}),props:{title:{type:String,required:!1},active:{type:Boolean,required:!1},showArrow:{type:Boolean,required:!1,default:!0},colorMode:{type:String,required:!1},icon:{type:String,required:!1},image:{type:String,required:!1},description:{type:String,required:!1},disabled:{type:Boolean,required:!1},verticalId:{type:String,required:!0},blueprintId:{type:String,required:!1}}},"cms/share/cms-share-menu-item.html")},574:()=>{Vue.asyncComponent("cms-share-modal",{data:()=>({passwordProtected:!1,password:null,expirationDate:null,loading:!1,shareLink:null,errors:{}}),props:{open:{type:Boolean,required:!0},verticalId:{type:String,required:!0},blueprintId:{type:String}},model:{prop:"open",event:"change"},methods:{async generateShareLink(){this.loading=!0;const e=this.$getSetting("paths.baseCms")+"/public-share-link/create",t={verticalId:this.verticalId};this.blueprintId&&(t.blueprintId=this.blueprintId);const s={passwordProtected:this.passwordProtected,password:this.password,expirationDate:this.expirationDate};let r=await this.$post(e,s,t);this.loading=!1,r.success?(this.shareLink=r.link,this.$copyToClipboard(this.shareLink)):(this.errors=r.errors,console.log(this.errors))},goToGrid(){const e=this.$router.resolve({name:"grid",params:{gridDefinition:"gird",bundle:"public-share-link"}});console.log("hier"),window.open(e.href,"_blank")}}},"cms/share/cms-share-modal.html")},894:()=>{Vue.cmsRouter=new class{constructor(){this.getRoutesPrepend=this.getRoutesPrepend.bind(this),this.getRoutesAppend=this.getRoutesAppend.bind(this),this.setRoutes=this.setRoutes.bind(this),this.beforeEachAuthChecks=this.beforeEachAuthChecks.bind(this),this.setActiveRouter=this.setActiveRouter.bind(this)}getRoutesPrepend(){return[{path:"/login",name:"login",component:{template:""},meta:{title:"Login"}},{path:"/password-recovery",name:"password-recovery",component:{template:""},meta:{title:"Recovery"}},{path:"/password-reset",name:"password-reset",component:{template:""},meta:{title:"Reset"}},{path:"/profile",name:"profile",component:{template:""},meta:{title:"Profile"}}]}getRoutesAppend(){return[...Vue.blueprintRoutes,{path:"/list/:listDefinition/:bundle",name:"list",component:{template:""},meta:{title:"List"},children:[{path:":definition/:objectId/:relationString?",name:"list-form",components:{childview:{template:''}}}]},{path:"/:gridDefinition/:bundle",name:"grid",component:{template:""},meta:{title:"Grid"},children:[{path:":definition/:objectId/:relationString?",name:"form",components:{childview:{template:''}}}]},{path:"/*",component:{template:""}}]}setRoutes(e){return[...this.getRoutesPrepend(),...e,...this.getRoutesAppend()]}async beforeEachAuthChecks(e,t,s){const r=["login","password-reset","password-recovery"],n=await this.router.app.$authService.getIsAuthenticated();r.includes(e.name)||n||s({name:"login"}),r.includes(e.name)&&n&&s({path:"/"}),s()}setActiveRouter(e){this.router=e,this.router.beforeEach(this.beforeEachAuthChecks)}}}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s(948),s(130)})(); //# sourceMappingURL=cms.js.map