From 689aeb9828ec1d5025da6c46317266410ffccbda Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Fri, 20 Sep 2024 13:56:59 +0200 Subject: [PATCH 1/2] Preflight for 4.4.1 --- composer.json | 2 +- composer.lock | 2 +- i18n/translations/ko.json | 10 +++++----- panel/dist/js/index.min.js | 2 +- vendor/composer/installed.php | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 1ccb4073a2..66e57208ff 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby core", "license": "proprietary", "type": "kirby-cms", - "version": "4.4.0", + "version": "4.4.1", "keywords": [ "kirby", "cms", diff --git a/composer.lock b/composer.lock index ea8097d53d..1149413050 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a49870b845c1d596a44c5af23c4dd685", + "content-hash": "e180b005ee9eb7164de462164b71a337", "packages": [ { "name": "christian-riesen/base32", diff --git a/i18n/translations/ko.json b/i18n/translations/ko.json index d203767169..4dae542a3e 100644 --- a/i18n/translations/ko.json +++ b/i18n/translations/ko.json @@ -126,12 +126,12 @@ "error.form.notSaved": "항목을 저장할 수 없습니다.", "error.language.code": "올바른 언어 코드를 입력하세요.", - "error.language.create.permission": "You are not allowed to create a language", - "error.language.delete.permission": "You are not allowed to delete the language", + "error.language.create.permission": "언어를 등록할 권한이 없습니다.", + "error.language.delete.permission": "언어를 삭제할 권한이 없습니다.", "error.language.duplicate": "이미 등록한 언어입니다.", "error.language.name": "올바른 언어명을 입력하세요.", "error.language.notFound": "언어를 찾을 수 없습니다.", - "error.language.update.permission": "You are not allowed to update the language", + "error.language.update.permission": "언어를 변경할 권한이 없습니다.", "error.layout.validation.block": "레이아웃({layoutIndex})의 특정 블록 유형({fieldset})을 사용하는 블록({blockIndex})의 특정 필드({field})에 오류가 있습니다.", "error.layout.validation.settings": "레이아웃({index}) 옵션을 확인하세요.", @@ -620,8 +620,8 @@ "stats.empty": "관련 기록이 없습니다.", "status": "상태", - "system.info.copy": "Copy info", - "system.info.copied": "System info copied", + "system.info.copy": "정보 복사", + "system.info.copied": "시스템 정보가 복사되었습니다.", "system.issues.content": "/content 폴더의 권한을 확인하세요.", "system.issues.eol.kirby": "설치된 Kirby 버전이 만료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.", "system.issues.eol.plugin": "설치된 플러그인({plugin}의 지원이 종료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.", diff --git a/panel/dist/js/index.min.js b/panel/dist/js/index.min.js index b4ac2b0a63..11e41c9730 100644 --- a/panel/dist/js/index.min.js +++ b/panel/dist/js/index.min.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IndexView.min.js","./vendor.min.js","./DocsView.min.js","./Docs.min.js","./PlaygroundView.min.js","./Highlight.min.js"])))=>i.map(i=>d[i]); -import{v as t,I as e,P as i,S as n,F as s,N as o,s as l,l as a,w as r,a as u,b as c,c as d,e as p,t as h,d as m,f,g,h as k,i as b,k as v,D as y,j as $,E as w,m as x,n as _,o as C,T as S,u as O,p as M,q as A,r as I,x as D,y as j,z as E,A as L,B as T,C as B,G as q,H as P,V as N,J as z}from"./vendor.min.js";const F={},Y=function(t,e,i){let n=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=(null==s?void 0:s.nonce)||(null==s?void 0:s.getAttribute("nonce"));n=Promise.all(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,i),e in F)return;F[e]=!0;const n=e.endsWith(".css"),s=n?'[rel="stylesheet"]':"";if(!!i)for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.href===e&&(!n||"stylesheet"===s.rel))return}else if(document.querySelector(`link[href="${e}"]${s}`))return;const l=document.createElement("link");return l.rel=n?"stylesheet":"modulepreload",n||(l.as="script",l.crossOrigin=""),l.href=e,o&&l.setAttribute("nonce",o),document.head.appendChild(l),n?new Promise(((t,i)=>{l.addEventListener("load",t),l.addEventListener("error",(()=>i(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}return n.then((()=>t())).catch((t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}))},R={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},U={props:{after:String}},H={props:{autocomplete:String}},V={props:{autofocus:Boolean}},K={props:{before:String}},W={props:{disabled:Boolean}},J={props:{font:String}},G={props:{help:String}},X={props:{id:{type:[Number,String],default(){return this._uid}}}},Z={props:{invalid:Boolean}},Q={props:{label:String}},tt={props:{layout:{type:String,default:"list"}}},et={props:{maxlength:Number}},it={props:{minlength:Number}},nt={props:{name:[Number,String]}},st={props:{options:{default:()=>[],type:Array}}},ot={props:{pattern:String}},lt={props:{placeholder:[Number,String]}},at={props:{required:Boolean}},rt={props:{spellcheck:{type:Boolean,default:!0}}};function ut(t,e,i,n,s,o,l,a){var r,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),l?(r=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},u._ssrRegister=r):s&&(r=a?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(t,e){return r.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,r):[r]}return{exports:t,options:u}}const ct={mixins:[tt],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const dt=ut({mixins:[ct],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,i){this.$emit("option",t,e,i)},imageOptions(t){let e=this.image,i=t.image;return!1!==e&&!1!==i&&("object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),{...i,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:i}){return[t._t("options",null,null,{item:e,index:i})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(i,n){return[t._t("default",(function(){return[e("k-item",t._b({key:i.id??n,class:{"k-draggable-item":t.sortable&&i.sortable},attrs:{image:t.imageOptions(i),layout:t.layout,link:!!t.link&&i.link,sortable:t.sortable&&i.sortable,theme:t.theme,width:i.column},on:{click:function(e){return t.$emit("item",i,n)},drag:function(e){return t.onDragStart(e,i.dragText)},option:function(e){return t.onOption(e,i,n)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,i,n)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:i,index:n})]},proxy:!0}],null,!0)},"k-item",i,!1))]}),null,{item:i,itemIndex:n})]}))],2)}),[],!1,null,null,null,null).exports;const pt=ut({mixins:[ct],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})):e("k-items",t._b({on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,index:i}){return[t._t("options",null,null,{item:e,index:i})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ht=ut({mixins:[tt],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[],!1,null,null,null,null).exports,mt={mixins:[tt],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const ft=ut({mixins:[mt],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image.src?e("k-image-frame",t._b({staticClass:"k-item-image"},"k-image-frame",t.attrs,!1)):e("k-icon-frame",t._b({staticClass:"k-item-image"},"k-icon-frame",t.attrs,!1))}),[],!1,null,null,null,null).exports;const gt=ut({mixins:[mt,tt],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(this.text)).trim()}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t,e=this,i=e._self._c;return i("div",e._b({staticClass:"k-item",class:!!e.layout&&"k-"+e.layout+"-item",attrs:{"data-has-image":e.hasFigure,"data-layout":e.layout,"data-theme":e.theme},on:{click:function(t){return e.$emit("click",t)},dragstart:function(t){return e.$emit("drag",t)}}},"div",e.data,!1),[e._t("image",(function(){return[e.hasFigure?i("k-item-image",{attrs:{image:e.image,layout:e.layout,width:e.width}}):e._e()]})),e.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):e._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:e.title}},[!1!==e.link?i("k-link",{attrs:{target:e.target,to:e.link}},[i("span",{domProps:{innerHTML:e._s(e.text??"–")}})]):i("span",{domProps:{innerHTML:e._s(e.text??"–")}})],1),e.info?i("p",{staticClass:"k-item-info",domProps:{innerHTML:e._s(e.info)}}):e._e()]),i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(t=e.buttons)?void 0:t.length)||!e.options&&!e.$slots.options}},[e._l(e.buttons,(function(t,n){return i("k-button",e._b({key:"button-"+n},"k-button",t,!1))})),e._t("options",(function(){return[e.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:e.options},on:{option:e.onOption}}):e._e()]}))],2)],2)}),[],!1,null,null,null,null).exports,kt={install(t){t.component("k-collection",pt),t.component("k-empty",ht),t.component("k-item",gt),t.component("k-item-image",ft),t.component("k-items",dt)}};const bt=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;function vt(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function yt(t){return Object.keys(t??{}).length}function $t(t){return Object.keys(t).reduce(((e,i)=>(e[i.toLowerCase()]=t[i],e)),{})}const wt={clone:function(t){if(void 0!==t)return structuredClone(t)},isEmpty:function(t){return null==t||""===t||(!(!vt(t)||0!==yt(t))||0===t.length)},isObject:vt,length:yt,merge:function t(e,i={}){for(const n in i)i[n]instanceof Object&&Object.assign(i[n],t(e[n]??{},i[n]));return Object.assign(e??{},i),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:$t},xt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const _t=ut({mixins:[xt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===vt(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Ct={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const St=ut({mixins:[Ct],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const Ot=ut({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const Mt=ut({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[],!1,null,null,null,null).exports;const At=ut({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[],!1,null,null,null,null).exports,It={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const Dt=ut({mixins:[It]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,jt={install(t){t.component("k-dialog-body",bt),t.component("k-dialog-buttons",_t),t.component("k-dialog-fields",St),t.component("k-dialog-footer",Ot),t.component("k-dialog-notification",Mt),t.component("k-dialog-search",At),t.component("k-dialog-text",Dt)}},Et={mixins:[xt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const Lt=ut({mixins:[Et]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[],!1,null,null,null,null).exports;const Tt=ut({mixins:[Et],props:{cancelButton:{default:!1},changes:{type:Array},loading:{type:Boolean},size:{default:"medium"},submitButton:{default:!1}},computed:{ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},watch:{ids:{handler(t){this.$panel.dialog.refresh({method:"POST",body:{ids:t}})},immediate:!0}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[!1===t.loading?[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),t.changes.length?e("k-items",{attrs:{items:t.changes,layout:"list"}}):e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])]:[e("k-icon",{attrs:{type:"loader"}})]],2)}),[],!1,null,null,null,null).exports;const Bt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const qt=ut({mixins:[Et],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(i,n){return[e("dt",{key:"detail-label-"+n},[t._v(" "+t._s(i.label)+" ")]),e("dd",{key:"detail-message-"+n},["object"==typeof i.message?[e("ul",t._l(i.message,(function(i,n){return e("li",{key:n},[t._v(" "+t._s(i)+" ")])})),0)]:[t._v(" "+t._s(i.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Pt=ut({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[],!1,null,null,null,null).exports,Nt=(t,e)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout((()=>t.apply(void 0,n)),e)}},zt={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Nt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},Ft={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Yt=ut({mixins:[Et,zt,Ft],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:i}){return[e("k-choice-input",{attrs:{checked:t.isSelected(i),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(i)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(i)}}}),t._t("options",null,null,{item:i})]}}],null,!0)})],2)}),[],!1,null,null,null,null).exports;const Rt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ut=ut({mixins:[Et,Ct],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[],!1,null,null,null,null).exports;const Ht=ut({extends:Ut,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),i=[e[0],e[1].toUpperCase()];this.value.locale=i.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const Vt=ut({mixins:[{mixins:[Et],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[],!1,null,null,null,null).exports;const Kt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){const t=this.values.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.values,href:t,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Wt=ut({mixins:[Ut],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[],!1,null,null,null,null).exports;const Jt=ut({mixins:[Et],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[],!1,null,null,null,null).exports;const Gt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:i}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!i.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=i.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Xt=ut({mixins:[{mixins:[Et,It]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[],!1,null,null,null,null).exports;const Zt=ut({mixins:[Xt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Qt=ut({mixins:[Et],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const i=await this.$panel.search(t,e);i&&(this.results=i.results,this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[],!1,null,null,null,null).exports;const te=ut({mixins:[{mixins:[Et,Ct]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},novalidate:!0,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const ee=ut({mixins:[Et],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[],!1,null,null,null,null).exports;const ie=ut({extends:ee,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,i,n,s=this,o=s._self._c;return o("k-dialog",s._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return s.$emit("cancel")},submit:function(t){return s.$emit("submit")}}},"k-dialog",s.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=s.original.image)?void 0:t.color,icon:null==(e=s.original.image)?void 0:e.icon,url:s.original.url,type:s.original.mime}})],1),o("li",[s._v("←")]),o("k-upload-item",s._b({attrs:{color:null==(i=s.original.image)?void 0:i.color,editable:!1,icon:null==(n=s.original.image)?void 0:n.icon,name:s.$helper.file.name(s.original.filename),removable:!1}},"k-upload-item",s.file,!1))],1)])}),[],!1,null,null,null,null).exports;const ne=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports,se={install(t){t.use(jt),t.component("k-dialog",Lt),t.component("k-changes-dialog",Tt),t.component("k-email-dialog",Bt),t.component("k-error-dialog",qt),t.component("k-fiber-dialog",Pt),t.component("k-files-dialog",Rt),t.component("k-form-dialog",Ut),t.component("k-license-dialog",Vt),t.component("k-link-dialog",Kt),t.component("k-language-dialog",Ht),t.component("k-models-dialog",Yt),t.component("k-page-create-dialog",Wt),t.component("k-page-move-dialog",Jt),t.component("k-pages-dialog",Gt),t.component("k-remove-dialog",Zt),t.component("k-search-dialog",Qt),t.component("k-text-dialog",Xt),t.component("k-totp-dialog",te),t.component("k-upload-dialog",ee),t.component("k-upload-replace-dialog",ie),t.component("k-users-dialog",ne)}};const oe=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports,le={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const ae=ut({mixins:[le],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,re={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const ue=ut({mixins:[re],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(i,n){return e("li",{key:i.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.props.icon,text:i.props.title,current:n===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",i.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[],!1,null,null,null,null).exports;const ce=ut({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[],!1,null,null,null,null).exports;const de=ut({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(i){return e("k-button",{key:i.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===i.name,text:i.label},on:{click:function(e){return t.$emit("open",i.name)}}})})),1):t._e()}),[],!1,null,null,null,null).exports,pe={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const he=ut({mixins:[pe]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,me={install(t){t.component("k-drawer-body",oe),t.component("k-drawer-fields",ae),t.component("k-drawer-header",ue),t.component("k-drawer-notification",ce),t.component("k-drawer-tabs",de),t.component("k-drawer-text",he)}},fe={mixins:[re],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const ge=ut({mixins:[fe],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(i,n){return[i.dropdown?[e("k-button",t._b({key:"btn-"+n,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+n][0].toggle()}}},"k-button",i,!1)),e("k-dropdown-content",{key:"dropdown-"+n,ref:"dropdown-"+n,refInFor:!0,attrs:{options:i.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:n,staticClass:"k-drawer-option"},"k-button",i,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[],!1,null,null,null,null).exports,ke={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const be=ut({mixins:[fe,le,ke],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const ve=ut({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(i){return e(i.component,t._g(t._b({key:i.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(i.id),visible:!0}},"component",t.isCurrent(i.id)?t.$panel.drawer.props:i.props,!1),t.isCurrent(i.id)?t.$panel.drawer.listeners():i.on))})),1)}),[],!1,null,null,null,null).exports;const ye=ut({mixins:[fe,le],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[],!1,null,null,null,null).exports;const $e=ut({mixins:[fe,le,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const we=ut({mixins:[fe,pe],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[],!1,null,null,null,null).exports,xe={install(t){t.use(me),t.component("k-drawer",ge),t.component("k-block-drawer",be),t.component("k-fiber-drawer",ve),t.component("k-form-drawer",ye),t.component("k-structure-drawer",$e),t.component("k-text-drawer",we)}};const _e=ut({mounted(){window.panel.deprecated(" will be removed in a future version. Since Kirby 4.0, you don't need it anymore as wrapper element. Use `` as standalone instead.")}},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Ce=null;const Se=ut({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=Ce=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;Ce=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,i;if(!0===this.disabled)return!1;Ce&&Ce!==this&&Ce.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(i=window.event)?void 0:i.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),i=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-i&&e.width+ie.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-i&&e.height+i!0===t.default));t.push(this.item(e)),t.push("-");const i=this.languages.filter((t=>!1===t.default));for(const n of i)t.push(this.item(n));return t}},methods:{change(t){this.$reload({query:{language:t.code}})},item(t){return{click:()=>this.change(t),current:t.code===this.language.code,text:t.name}}}},(function(){var t=this,e=t._self._c;return t.languages.length>1?e("div",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{dropdown:!0,text:t.code,icon:"translate",responsive:"text",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.languages.toggle()}}}),e("k-dropdown-content",{ref:"languages",attrs:{options:t.options}})],1):t._e()}),[],!1,null,null,null,null).exports;const Ae=ut({props:{align:{type:String,default:"right"},disabled:{type:Boolean},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,i){"function"==typeof t?t.call(this):(this.$emit("action",t,e,i),this.$emit("option",t,e,i))},toggle(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},on:{click:function(e){return t.onAction(t.options[0].option??t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports,Ie={mixins:[V,W,X,nt,at]},De={mixins:[Ie],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},je={mixins:[V,W,st,at],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Ee={mixins:[Ie,je],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Le=ut({mixins:[De,Ee],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{staticClass:"k-picklist-input",attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}}),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Te=ut({mixins:[Ee],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Be={install(t){t.component("k-dropdown",_e),t.component("k-dropdown-content",Se),t.component("k-dropdown-item",Oe),t.component("k-languages-dropdown",Me),t.component("k-options-dropdown",Ae),t.component("k-picklist-dropdown",Te)}};const qe=ut({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),mounted(){window.panel.deprecated(" will be removed in a future version.")},methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){const e=this.options.filter((t=>-1!==this.skip.indexOf(t.value)));this.matches=this.$helper.array.search(e,t,{field:"text",limit:this.limit}),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(i,n){return e("k-dropdown-item",t._b({key:n,nativeOn:{mousedown:function(e){return t.onSelect(i)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",i,!1),[e("span",{domProps:{innerHTML:t._s(t.html?i.text:t.$esc(i.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const Pe=ut({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min||t.max?e("span",{staticClass:"k-counter-rules"},[t.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[],!1,null,null,null,null).exports;const Ne=ut({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,i;null==(i=null==(e=this.$refs.fields)?void 0:e.focus)||i.call(e,t)},onFocus(t,e,i){this.$emit("focus",t,e,i)},onInput(t,e,i){this.$emit("input",t,e,i)},onInvalid(t){this.$emit("invalid",t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const ze=ut({props:{lock:[Boolean,Object]},data:()=>({isLoading:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},buttons(){return"unlock"===this.mode?[{icon:"check",text:this.$t("lock.isUnlocked"),click:()=>this.resolve()},{icon:"download",text:this.$t("download"),click:()=>this.download()}]:"lock"===this.mode?[{icon:this.lock.data.unlockable?"unlock":"loader",text:this.$t("lock.isLocked",{email:this.$esc(this.lock.data.email)}),title:this.$t("lock.unlock"),disabled:!this.lock.data.unlockable,click:()=>this.unlock()}]:"changes"===this.mode?[{icon:"undo",text:this.$t("revert"),click:()=>this.revert()},{icon:"check",text:this.$t("save"),click:()=>this.save()}]:[]},disabled(){return"unlock"!==this.mode&&("lock"===this.mode?!this.lock.data.unlockable:"changes"===this.mode&&this.isDisabled)},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"changes"===this.mode?"notice":null}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.locking(),this.isLocking=setInterval(this.locking,3e4)):e&&(clearInterval(this.isLocking),this.locking(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.emit("model.reload")}},mounted(){this.supportsLocking&&(this.isLoading=setInterval(this.check,1e4)),this.$events.on("view.save",this.save)},destroyed(){clearInterval(this.isLoading),clearInterval(this.isLocking),this.$events.off("view.save",this.save)},methods:{async check(){if(!1===this.$panel.isOffline){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)}},download(){let t="";const e=this.$store.getters["content/changes"]();for(const n in e){const i=e[n];t+=n+": \n\n","object"==typeof i&&Object.keys(i).length||Array.isArray(i)&&i.length?t+=JSON.stringify(i,null,2):t+=i,t+="\n\n----\n\n"}let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",this.$panel.view.path+".txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},async locking(t=!0){if(!0!==this.$panel.isOffline)if(!0===t)try{await this.$api.patch(...this.api)}catch{clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},async resolve(){await this.unlock(!1),this.$store.dispatch("content/revert")},revert(){this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"undo",text:this.$t("revert")},text:this.$t("revert.confirm")},on:{submit:()=>{this.$store.dispatch("content/revert"),this.$panel.dialog.close()}}})},async save(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.emit("model.update"),this.$panel.notification.success()},async unlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0!==t?(await this.$api.delete(...e),this.$reload({silent:!0})):this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"unlock",text:this.$t("lock.unlock")},text:this.$t("lock.unlock.submit",{email:this.$esc(this.lock.data.email)})},on:{submit:async()=>{await this.$api.patch(...e),this.$panel.dialog.close(),this.$reload({silent:!0})}}})}}},(function(){var t=this,e=t._self._c;return t.buttons.length>0?e("k-button-group",{staticClass:"k-form-buttons",attrs:{layout:"collapsed"}},t._l(t.buttons,(function(i){return e("k-button",t._b({key:i.icon,attrs:{size:"sm",variant:"filled",disabled:t.isDisabled,responsive:!0,theme:t.theme}},"k-button",i,!1))})),1):t._e()}),[],!1,null,null,null,null).exports,Fe={mixins:[W,G,X,Q,nt,at],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Ye=ut({mixins:[Fe],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`],attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Re=ut({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,i,n){this.errors[n]=e,this.$emit("invalid",this.errors)},onInput(t,e,i){const n=this.value;this.$set(n,i,t),this.$emit("input",n,e,i)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(i,n){return[t.$helper.field.isVisible(i,t.value)?e("k-column",{key:i.signature,attrs:{width:i.width}},[t.hasFieldType(i.type)?e("k-"+i.type+"-field",t._b({ref:n,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||i.disabled,"form-data":t.value,name:n,novalidate:t.novalidate,value:t.value[n]},on:{input:function(e){return t.onInput(e,i,n)},focus:function(e){return t.$emit("focus",e,i,n)},invalid:(e,s)=>t.onInvalid(e,s,i,n),submit:function(e){return t.$emit("submit",e,i,n)}}},"component",i,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:n,type:i.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,Ue={mixins:[U,K,W,Z],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const He=ut({mixins:[Ue],data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},watch:{invalid(){this.isInvalid=this.invalid}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var i,n,s;if("INPUT"===(null==(i=null==t?void 0:t.target)?void 0:i.tagName)&&"function"==typeof(null==(n=null==t?void 0:t.target)?void 0:n[e]))return void t.target[e]();if("function"==typeof(null==(s=this.$refs.input)?void 0:s[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-description k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const Ve=ut({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},emits:["success"],methods:{open(t){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.open()` instead."),this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t??{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.open(t,this.params(e))},upload(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}},render:()=>""},null,null,!1,null,null,null,null).exports,Ke={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const We=ut({mixins:[Ke],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports,Je={mixins:[Ke,W],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Ge=ut({mixins:[Je],inheritAttrs:!1,methods:{field(t,e=null){let i=null;for(const n of Object.values(this.fieldset.tabs??{}))n.fields[t]&&(i=n.fields[t]);return i??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Xe={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const Ze=ut({mixins:[Xe],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[],!1,null,null,null,null).exports;const Qe=ut({mixins:[Je,Xe],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){const t=this.fieldset.tabs??{};for(const[e,i]of Object.entries(t))for(const[n]of Object.entries(i.fields??{}))t[e].fields[n].section=this.name,t[e].fields[n].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,i;this.disabled||(null==(i=null==(e=this.$refs.options)?void 0:e.$el)?void 0:i.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:["k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:""],attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),{...t.listeners,split:()=>t.$refs.editor.split(),open:()=>{"function"==typeof t.$refs.editor.open?t.$refs.editor.open():t.open()}}))],1)}),[],!1,null,null,null,null).exports,ti={mixins:[V,W,X],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]};const ei=ut({mixins:[ti],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{id:this.id,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),this.$events.on("keydown",this.onKey),this.$events.on("keyup",this.onKey),this.$events.on("paste",this.onPaste)},destroyed(){this.$events.off("blur",this.onBlur),this.$events.off("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,i),this.save(),await this.$nextTick(),this.focusOrOpen(i)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const i of this.blocks)this.selected.includes(i.id)&&e.push(i);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success",{count:e.length}),icon:"template"})},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var i;const n=this.findIndex(e.id);if(-1===n)return!1;const s=t=>{let e={};for(const i of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...i.fields};return e},o=this.blocks[n],l=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),a=this.fieldsets[o.type],r=this.fieldsets[t];if(!r)return!1;let u=l.content;const c=s(r),d=s(a);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(i=null==o?void 0:o.content)?void 0:i[p])&&(u[p]=o.content[p])}this.blocks[n]={...l,id:o.id,content:u},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const i={...structuredClone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,i),this.save()},fieldset(t){return this.fieldsets[t.type]??{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,i=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(i.fieldsets).includes(e.type))return!1;if(!0===i.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const i=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==i?void 0:i.contains(t.target))?i&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const i=this.$helper.clipboard.read(t);let n=await this.$api.post(this.endpoints.field+"/paste",{html:i});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;n=n.slice(0,t)}this.blocks.splice(e,0,...n),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:n.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,i;return null==(i=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:i[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,i){if(i<0)return;let n=structuredClone(this.blocks);n.splice(e,1),n.splice(i,0,t),this.blocks=n,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,i){const n=structuredClone(t);n.content={...n.content,...i[0]};const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);s.content={...s.content,...n.content,...i[1]},this.blocks.splice(e,1,n,s),this.save(),await this.$nextTick(),this.focus(s)},update(t,e){const i=this.findIndex(t.id);if(-1!==i)for(const n in e)Vue.set(this.blocks[i].content,n,e[n]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty??t.$t("field.blocks.empty"))+" ")])]},proxy:!0}:null],null,!0)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(i,n){return e("k-block",t._b({key:i.id,ref:"block-"+i.id,refInFor:!0,on:{append:function(e){return t.add(e,n+1)},chooseToAppend:function(e){return t.choose(n+1)},chooseToConvert:function(e){return t.chooseToConvert(i)},chooseToPrepend:function(e){return t.choose(n)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(i,n)},focus:function(e){return t.onFocus(i)},hide:function(e){return t.hide(i)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,n)},remove:function(e){return t.remove(i)},removeSelected:t.removeSelected,show:function(e){return t.show(i)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(i,n,n+1)},sortUp:function(e){return t.sort(i,n,n-1)},split:function(e){return t.split(i,n,e)},update:function(e){return t.update(i,e)}},nativeOn:{click:function(e){return t.onClickBlock(i,e)}}},"k-block",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(i),isBatched:t.isSelected(i)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===i.isHidden,isLastSelected:t.isLastSelected(i),isMergable:t.isMergable,isSelected:t.isSelected(i),next:t.prevNext(n+1),prev:t.prevNext(n-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const ii=ut({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.paste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports;const ni=ut({inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const i=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const n in i){const s=i[n];s.open=!1!==s.open,s.fieldsets=s.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==s.fieldsets.length&&(t[n]=s)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-block-selector",attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(i,n){return e("details",{key:n,attrs:{open:i.open}},[e("summary",[t._v(t._s(i.label))]),e("k-navigate",{staticClass:"k-block-types"},t._l(i.fieldsets,(function(i){return e("k-button",{key:i.name,attrs:{disabled:t.disabledFieldsets.includes(i.type),icon:i.icon??"box",text:i.name,size:"lg"},on:{click:function(e){return t.$emit("submit",i.type)}},nativeOn:{focus:function(e){return t.$emit("input",i.type)}}})})),1)],1)})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const si=ut({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const oi=ut({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure",style:{"--block-figure-back":t.back},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const li=ut({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const ai=ut({extends:Ge,computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ri=ut({extends:Ge,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[],!1,null,null,null,null).exports;const ui=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(i){return e("li",{key:i,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(i){return e("li",{key:i.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:i.url,srcset:i.image.srcset,alt:i.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const ci=ut({extends:Ge,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const i=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:i[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const di=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const pi=ut({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports;const hi=ut({extends:Ge,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("
    ","")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0].replace(/(
  • <\/p><\/li><\/ul>)$/,"

")},{text:i[1].replace(/^(
  • <\/p><\/li>)/,"

      ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const mi=ut({extends:Ge,computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const fi=ut({extends:Ge,computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{disabled:t.disabled,inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{disabled:t.disabled,inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports;const gi=ut({extends:Ge,inheritAttrs:!1,computed:{columns(){return this.table.columns??this.fields},fields(){return this.table.fields??{}},rows(){return this.content.rows??[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs??{}))e.fields.rows&&(t=e.fields.rows);return t??{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports;const ki=ut({extends:Ge,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&("writer"===this.textField.type&&(i[0]=i[0].replace(/(

      <\/p>)$/,""),i[1]=i[1].replace(/^(

      <\/p>)/,"")),this.$emit("split",i.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports;const bi=ut({extends:Ge,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,vi={install(t){t.component("k-block",Qe),t.component("k-blocks",ei),t.component("k-block-options",Ze),t.component("k-block-pasteboard",ii),t.component("k-block-selector",ni),t.component("k-block-background-dropdown",si),t.component("k-block-figure",oi),t.component("k-block-figure-caption",li),t.component("k-block-title",We),t.component("k-block-type-code",ai),t.component("k-block-type-default",Ge),t.component("k-block-type-fields",ri),t.component("k-block-type-gallery",ui),t.component("k-block-type-heading",ci),t.component("k-block-type-image",di),t.component("k-block-type-line",pi),t.component("k-block-type-list",hi),t.component("k-block-type-markdown",mi),t.component("k-block-type-quote",fi),t.component("k-block-type-table",gi),t.component("k-block-type-text",ki),t.component("k-block-type-video",bi)}};const yi=ut({mixins:[Fe,ti],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-blocks",t._g(t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},"k-blocks",t.$props,!1),t.$listeners)),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[],!1,null,null,null,null).exports,$i={mixins:[Ie,st],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}};const wi=ut({mixins:[De,$i],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.selected.includes(t.value),disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value})))}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[],this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},select(){this.focus()},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.input(i.value,e)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports,xi={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const _i=ut({mixins:[Fe,Ue,$i,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-checkboxes-field",attrs:{input:e.id+"-0",counter:e.counterOptions}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-checkboxes-input",e._g(e._b({ref:"input"},"k-checkboxes-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ci={mixins:[Ie,H,J,et,it,ot,lt,rt],props:{ariaLabel:String,type:{default:"text",type:String},value:{type:String}}};const Si=ut({mixins:[De,Ci]},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-string-input",attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1))}),[],!1,null,null,null,null).exports,Oi={mixins:[Ci],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}};const Mi=ut({mixins:[Si,Oi],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ai=ut({mixins:[Fe,Ue,Oi],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-color-field",attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?i("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):i("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[i("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[i("k-color-frame",{attrs:{color:e.value}})],1),i("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[i("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:i("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[i("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[i("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[i("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[],!1,null,null,null,null).exports,Ii={props:{max:String,min:String,value:String}},Di={mixins:[Ie,Ii],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}};const ji=ut({mixins:[De,Di],emits:["input","focus","submit"],data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},methods:{async alter(t){let e=this.parse()??this.round(this.$library.dayjs()),i=this.rounding.unit,n=this.rounding.size;const s=this.selection();null!==s&&("meridiem"===s.unit?(t="pm"===e.format("a")?"subtract":"add",i="hour",n=12):(i=s.unit,i!==this.rounding.unit&&(n=1))),e=e[t](n,i).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),await this.$nextTick(),this.select(s)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate(),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await this.$nextTick(),this.$emit("submit")},onInput(t){const e=this.parse(),i=this.pattern.format(e);if(!t||i==t)return this.commit(e),this.emit(e)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,i;const n=[];this.required&&!this.dt&&n.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&n.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&n.push(this.$t("error.validation.date.before",{date:this.max})),null==(i=this.$el)||i.setCustomValidity(n.join(", "))}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports;const Ei=ut({mixins:[Fe,Ue,Di],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())??"")},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))??null,time:(null==e?void 0:e.toISO("time"))??null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time),"data-invalid":!t.novalidate&&t.isInvalid}},[e("k-input",t._b({ref:"dateInput",attrs:{type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports,Li={mixins:[Ie,J,et,it,ot,lt,rt],props:{autocomplete:{type:[Boolean,String],default:"off"},preselect:Boolean,type:{type:String,default:"text"},value:String}};const Ti=ut({mixins:[De,Li],data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{"data-font":t.font}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Bi={mixins:[Li],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const qi=ut({extends:Ti,mixins:[Bi]},null,null,!1,null,null,null,null).exports;const Pi=ut({mixins:[Fe,Ue,Bi],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ni=ut({type:"model",mixins:[Fe,V,tt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,isInvalid(){return this.required&&0===this.selected.length||this.min&&this.selected.lengththis.max},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:`k-models-field k-${t.$options.type}-field`,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:i}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)}),[],!1,null,null,null,null).exports;const zi=ut({extends:Ni,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=Ni.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Fi=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const Yi=ut({mixins:[G,Q],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Ri=ut({mixins:[G,Q],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Ui={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Hi=ut({mixins:[Ui],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[],!1,null,null,null,null).exports,Vi={mixins:[Ui,W],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Ki=ut({mixins:[Vi],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,i]of Object.entries(t))for(const n in i.fields)t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(i,n){return e("k-layout-column",t._b({key:i.id,on:{input:function(e){return t.$emit("updateColumn",{column:i,columnIndex:n,blocks:e})}}},"k-layout-column",{...i,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[],!1,null,null,null,null).exports,Wi={mixins:[Vi,X],props:{empty:String,max:Number,selector:Object,value:{type:Array,default:()=>[]}}};const Ji=ut({mixins:[Wi],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this.id,handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const i=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(i),t),this.$panel.notification.success({message:this.$t("copy.success",{count:i.length??1}),icon:"template"})},change(t,e){const i=e.columns.map((t=>t.width)),n=this.layouts.findIndex((t=>t.toString()===i.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[n]},on:{submit:i=>{this.onChange(i,n,{rowIndex:t,layoutIndex:n,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const i=structuredClone(e),n=this.updateIds(i);this.rows.splice(t+1,0,...n),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,i){if(e===this.layouts[i.layoutIndex])return;const n=i.layout,s=await this.$api.post(this.endpoints.field+"/layout",{attrs:n.attrs,columns:t}),o=n.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),l=[];if(0===o.length)l.push(s);else{const t=Math.ceil(o.length/s.columns.length)*s.columns.length;for(let e=0;e{var n;return t.blocks=(null==(n=o[i+e])?void 0:n.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&l.push(t)}}this.rows.splice(i.rowIndex,1,...l),this.save()},async paste(t,e=this.rows.length){let i=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});i.length&&(this.rows.splice(e,0,...i),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(i,n){return e("k-layout",t._b({key:i.id,on:{append:function(e){return t.select(n+1)},change:function(e){return t.change(n,i)},copy:function(e){return t.copy(e,n)},duplicate:function(e){return t.duplicate(n,i)},paste:function(e){return t.pasteboard(n+1)},prepend:function(e){return t.select(n)},remove:function(e){return t.remove(i)},select:function(e){t.selected=i.id},updateAttrs:function(e){return t.updateAttrs(n,e)},updateColumn:function(e){return t.updateColumn({layout:i,index:n,...e})}}},"k-layout",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===i.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const Gi=ut({mixins:[Fe,Wi,V],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1)),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Xi=ut({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const Zi=ut({mixins:[{mixins:[Fe,Ue,Ie,st],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const i=this.$helper.link.detect(t,this.activeTypes);i&&(this.linkType=i.type,this.linkValue=i.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=!!t},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.isInvalid=!1,this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[],!1,null,null,null,null).exports;const Qi=t=>({$from:e})=>((t,e)=>{for(let i=t.depth;i>0;i--){const n=t.node(i);if(e(n))return{pos:i>0?t.before(i):0,start:t.start(i),depth:i,node:n}}})(e,t),tn=t=>e=>{if((t=>t instanceof o)(e)){const{node:i,$from:n}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,i))return{node:i,pos:n.pos,depth:n.depth}}},en=(t,e,i={})=>{const n=tn(e)(t.selection)||Qi((t=>t.type===e))(t.selection);return 0!==yt(i)&&n?n.node.hasMarkup(e,{...n.node.attrs,...i}):!!n};function nn(t=null,e=null){if(!t||!e)return!1;const i=t.parent.childAfter(t.parentOffset);if(!i.node)return!1;const n=i.node.marks.find((t=>t.type===e));if(!n)return!1;let s=t.index(),o=t.start()+i.offset,l=s+1,a=o+i.node.nodeSize;for(;s>0&&n.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;l{s=[...s,...t.marks]}));const o=s.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:i,to:n}=t.selection;let s=[];t.doc.nodesBetween(i,n,(t=>{s=[...s,t]}));const o=s.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},insertNode:function(t,e,i,n){return(s,o)=>{o(s.tr.replaceSelectionWith(t.create(e,i,n)).scrollIntoView())}},markInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t,r=e.length-1;let u=o,c=s;if(e[r]){const n=s+e[0].indexOf(e[r-1]),l=n+e[r-1].length-1,d=n+e[r-1].lastIndexOf(e[r]),p=d+e[r].length,h=function(t,e,i){let n=[];return i.doc.nodesBetween(t,e,((t,e)=>{n=[...n,...t.marks.map((i=>({start:e,end:e+t.nodeSize,mark:i})))]})),n}(s,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===i.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&a.delete(n,d),c=n,u=c+e[r].length}return a.addMark(c,u,i.create(l)),a.removeStoredMark(i),a}))},markIsActive:function(t,e){const{from:i,$from:n,to:s,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||n.marks()):!!t.doc.rangeHasMark(i,s,e)},markPasteRule:function(t,e,o){const l=(i,n)=>{const a=[];return i.forEach((i=>{var s;if(i.isText){const{text:l,marks:r}=i;let u,c=0;const d=!!r.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(l));)if((null==(s=null==n?void 0:n.type)?void 0:s.allowsMarkType(e))&&u[1]){const t=u.index,n=t+u[0].length,s=t+u[0].indexOf(u[1]),l=s+u[1].length,r=o instanceof Function?o(u):o;t>0&&a.push(i.cut(c,t)),a.push(i.cut(s,l).mark(e.create(r).addToSet(i.marks))),c=n}cnew n(l(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,i=0){return Math.min(Math.max(parseInt(t,10),e),i)},nodeIsActive:en,nodeInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t;return e[0]&&a.replaceWith(s,o,i.create(l)),a}))},pasteRule:function(t,e,o){const l=i=>{const n=[];return i.forEach((i=>{if(i.isText){const{text:s}=i;let l,a=0;do{if(l=t.exec(s),l){const t=l.index,s=t+l[0].length,r=o instanceof Function?o(l[0]):o;t>0&&n.push(i.cut(a,t)),n.push(i.cut(t,s).mark(e.create(r).addToSet(i.marks))),a=s}}while(l);anew n(l(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,i)=>{const{tr:n,selection:s}=e;let{from:o,to:l}=s;const{$from:a,empty:r}=s;if(r){const e=nn(a,t);o=e.from,l=e.to}return n.removeMark(o,l,t),i(n)}},toggleBlockType:function(t,e,i={}){return(n,s,o)=>en(n,t,i)?l(e)(n,s,o):l(t,i)(n,s,o)},toggleList:function(t,e){return(i,n,s)=>{const{schema:o,selection:l}=i,{$from:u,$to:c}=l,d=u.blockRange(c);if(!d)return!1;const p=Qi((t=>sn(t,o)))(l);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return a(e)(i,n,s);if(sn(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=i;return e.setNodeMarkup(p.pos,t),n&&n(e),!1}}return r(t)(i,n,s)}},toggleWrap:function(t,e={}){return(i,n,s)=>en(i,t,e)?u(i,n):c(t,e)(i,n,s)},updateMark:function(t,e){return(i,n)=>{const{tr:s,selection:o,doc:l}=i,{ranges:a,empty:r}=o;if(r){const{from:i,to:n}=nn(o.$from,t);l.rangeHasMark(i,n,t)&&s.removeMark(i,n,t),s.addMark(i,n,t.create(e))}else a.forEach((i=>{const{$to:n,$from:o}=i;l.rangeHasMark(o.pos,n.pos,t)&&s.removeMark(o.pos,n.pos,t),s.addMark(o.pos,n.pos,t.create(e))}));return n(s)}}};class ln{emit(t,...e){this._callbacks=this._callbacks??{};const i=this._callbacks[t]??[];for(const n of i)n.apply(this,e);return this}off(t,e){if(arguments.length){const i=this._callbacks?this._callbacks[t]:null;i&&(e?this._callbacks[t]=i.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks??{},this._callbacks[t]=this._callbacks[t]??[],this._callbacks[t].push(e),this}}class an{constructor(t=[],e){for(const i of t)i.bindEditor(e),i.init();this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((i,n)=>{const{name:s,type:o}=n,l={},a=n.commands({schema:t,utils:on,...["node","mark"].includes(o)?{type:t[`${o}s`][s]}:{}}),r=(t,i)=>{l[t]=t=>{if("function"!=typeof i||!e.editable)return!1;e.focus();const n=i(t);return"function"==typeof n?n(e.state,e.dispatch,e):n}};if("object"==typeof a)for(const[t,e]of Object.entries(a))r(t,e);else r(s,a);return{...i,...l}}),{})}buttons(t="mark"){const e={};for(const i of this.extensions)if(i.type===t&&i.button)if(Array.isArray(i.button))for(const t of i.button)e[t.id??t.name]=t;else e[i.name]=i.button;return e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,i=this.extensions){return i.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,utils:on})))}getFromNodesAndMarks(t,e,i=this.extensions){return i.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,type:e.schema[`${i.type}s`][i.name],utils:on})))}inputRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},i),...this.getFromNodesAndMarks("inputRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>v(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,i)=>({...e,[i.name]:new Proxy(i.options,{set(e,i,n){const s=e[i]!==n;return Object.assign(e,{[i]:n}),s&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},i),...this.getFromNodesAndMarks("pasteRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof i?t:new i(t)))}}class rn{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class un extends rn{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class cn extends un{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class dn extends un{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:i}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(i)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let pn=class extends un{get name(){return"text"}get schema(){return{group:"inline"}}};class hn extends ln{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return!0!==this.options.useBuiltInExtensions?[]:[new cn({inline:this.options.inline}),new pn,new dn]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var i,n;null==(n=(i=this.commands)[t])||n.call(i,...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(i){return window.console.warn("Invalid content.","Passed value:",t,"Error:",i),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const i=`

      ${t}
      `,n=(new window.DOMParser).parseFromString(i,"text/html").body.firstElementChild;return y.fromSchema(this.schema).parse(n,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,i]of Object.entries(t))this.on(e,i);return t}createExtensions(){return new an([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,i=!0)=>{this.focused=i,this.emit(i?"focus":"blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",i);this.view.dispatch(n)};return new i({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,i)=>t(e,i,!0),blur:(e,i)=>t(e,i,!1)}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return w.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,x({rules:this.inputRules}),...this.pasteRules,...this.keymaps,v({Backspace:O}),v(M),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),i=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,i))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,i=this.state.apply(t);this.view.updateState(i),this.setActiveNodesAndMarks();const n={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",n),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",n);const{from:s,to:o}=this.state.selection,l=!e||!e.selection.eq(i.selection);this.emit(i.selection.empty?"deselect":"select",{...n,from:s,hasChanged:l,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:i}=this.selectionAtPosition(t);this.setSelection(e,i),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),i=C.fromSchema(this.schema).serializeFragment(t);return e.appendChild(i),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}insertText(t,e=!1){const{tr:i}=this.state,n=i.insertText(t);if(this.view.dispatch(n),e){const e=i.selection.from,n=e-t.length;this.setSelection(n,e)}}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,i])=>({...t,[e]:(t={})=>i(t)})),{})}removeMark(t){if(this.schema.marks[t])return on.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return S.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return S.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>on.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,i])=>({...t,[e]:on.getMarkAttrs(this.state,i)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>on.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,i])=>({...t,[e]:on.getNodeAttrs(this.state,i)})),{})}setContent(t={},e=!1,i){const{doc:n,tr:s}=this.state,o=this.createDocument(t,i),l=s.replaceWith(0,n.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(l)}setSelection(t=0,e=0){const{doc:i,tr:n}=this.state,s=on.minMax(t,0,i.content.size),o=on.minMax(e,0,i.content.size),l=S.create(i,s,o),a=n.setSelection(l);this.view.dispatch(a)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return on.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return on.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class mn extends rn{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class fn extends mn{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class gn extends mn{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:i}=t.tr.selection;for(const n of this.editor.activeMarks){const s=t.schema.marks[n],o=this.editor.state.tr.removeMark(e,i,s);this.editor.view.dispatch(o)}}get name(){return"clear"}}let kn=class extends mn{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}};class bn extends mn{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,i)=>{const n=this.editor.getMarkAttrs("email");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class vn extends mn{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}let yn=class extends mn{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,i)=>{const n=this.editor.getMarkAttrs("link");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.href,n.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs},0]}}};class $n extends mn{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}let wn=class extends mn{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class xn extends mn{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class _n extends mn{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class Cn extends un{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-8":i.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Sn extends un{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const i=this.createHardBreak(t,e);let n={"Mod-Enter":i,"Shift-Enter":i};return this.options.enter&&(n.Enter=i),n}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class On extends un{get button(){const t=this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:i}){let n={toggleHeading:n=>i.toggleBlockType(t,e.nodes.paragraph,n)};for(const s of this.options.levels)n[`h${s}`]=()=>i.toggleBlockType(t,e.nodes.paragraph,{level:s});return n}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((i=>e.textblockTypeInputRule(new RegExp(`^(#{1,${i}})\\s$`),t,(()=>({level:i})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((i,n)=>({...i,[`Shift-Ctrl-${n}`]:e.setBlockType(t,{level:n})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class Mn extends un{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const i=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),n=i.handler;return i.handler=(t,e,i,s)=>n(t,e,i,s).replaceWith(i-1,i,""),[i]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class An extends un{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class In extends un{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-9":i.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class Dn extends un{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,i)=>t.lift(e,i)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let jn=class extends rn{commands(){return{undo:()=>A,redo:()=>I,undoDepth:()=>D,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":I,"Shift-Mod-z":I,"Mod-я":A,"Shift-Mod-я":I}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class En extends rn{commands(){return{insertHtml:t=>(e,i)=>{let n=document.createElement("div");n.innerHTML=t.trim();const s=y.fromSchema(e.schema).parse(n);i(e.tr.replaceSelectionWith(s).scrollIntoView())}}}}class Ln extends rn{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let Tn=class extends rn{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Bn={mixins:[V,W,lt,rt],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const qn=ut({mixins:[Bn],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new hn({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new Ln(this.keys),new jn,new En,new Tn(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur)},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new gn,code:new kn,underline:new _n,strike:new $n,link:new yn,email:new bn,bold:new fn,italic:new vn,sup:new wn,sub:new xn,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const i in t)e[i]=Object.create(mn.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},createNodes(){const t=new Sn({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new Cn,orderedList:new In,heading:new On({levels:this.headings}),horizontalRule:new Mn,listItem:new An,quote:new Dn,...this.createNodesFromPanelPlugins()},this.nodes,((e,i)=>((e.includes("bulletList")||e.includes("orderedList"))&&i.push(new An),!0===this.inline&&(i=i.filter((t=>!0===t.schema.inline))),i.push(t),i)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const i in t)e[i]=Object.create(un.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,i){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let n=[];for(const s in t)e.includes(s)&&n.push(t[s]);return"function"==typeof i&&(n=i(e,n)),n},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Pn={mixins:[Ie,Bn,et,it]};const Nn=ut({mixins:[De,Pn],computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;class zn extends cn{get schema(){return{content:this.options.nodes.join("|")}}}const Fn={mixins:[Pn],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Yn=ut({mixins:[De,Fn],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new zn({inline:!0,nodes:this.nodes})]}},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

      |<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const Rn=ut({mixins:[Fe,Ue,Fn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t.id,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Un={mixins:[W,X,st],inheritAttrs:!1,props:{layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Hn=ut({mixins:[Un],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=structuredClone(this.value);if(!0===this.sort){const e=[];for(const i of this.options){const n=t.indexOf(i.value);-1!==n&&(e.push(i),t.splice(n,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,i){!1===this.disabled&&this.$emit("edit",t,e,i)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{staticClass:"k-tags",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(i,n){return e("k-tag",{key:n,attrs:{disabled:t.disabled,image:i.image,removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(n,i)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(n,i,e)},dblclick:function(e){return t.edit(n,i,e)}}},[e("span",{domProps:{innerHTML:t._s(i.text)}})])})),1)],1)}),[],!1,null,null,null,null).exports,Vn={mixins:[nt,at,Un,je],props:{value:{default:()=>[],type:Array}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Kn=ut({mixins:[De,Vn]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-multiselect-input"},[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),i=structuredClone(this.value);for(let n of e)n=this.$refs.tags.tag(n,this.separator),!0===this.isAllowed(n)&&i.push(n.value);this.$emit("input",i),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,i=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(i))return!1;const n=structuredClone(this.value);n.splice(e,1,i.value),this.$emit("input",n),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}},(function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[i("k-tags",e._b({ref:"tags",on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var i,n;t.stopPropagation(),null==(n=null==(i=e.$refs.toggle)?void 0:i.$el)||n.click()}}},"k-tags",e.$props,!1),[e.canAdd?i("k-button",{ref:"toggle",staticClass:"k-tags-input-toggle k-tags-navigatable input-focus",attrs:{id:e.id,autofocus:e.autofocus,disabled:e.disabled,size:"xs",icon:"add"},on:{click:function(t){return e.$refs.create.open()}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.$refs.tags.focus("prev")},function(t){return e.toggle.apply(null,arguments)}]}}):e._e()],1),i("k-picklist-dropdown",e._b({ref:"replace",attrs:{multiple:!1,options:e.replacableOptions,value:(null==(t=e.editing)?void 0:t.tag.value)??""},on:{create:e.replace,input:e.replace}},"k-picklist-dropdown",e.picklist,!1)),i("k-picklist-dropdown",e._b({ref:"create",attrs:{options:e.creatableOptions,value:e.value},on:{create:e.create,input:e.pick}},"k-picklist-dropdown",e.picklist,!1))],1)}),[],!1,null,null,null,null).exports;const Gn=ut({mixins:[Fe,Ue,Wn,xi],inheritAttrs:!1,computed:{hasNoOptions(){return 0===this.options.length&&"options"===this.accept}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Xn=ut({extends:Gn,inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Zn={mixins:[Ie,lt],props:{max:Number,min:Number,name:[Number,String],preselect:Boolean,step:[Number,String],value:{type:[Number,String],default:""}}};const Qn=ut({mixins:[De,Zn],data(){return{number:this.format(this.value),stepNumber:this.format(this.step),timeout:null,listeners:{...this.$listeners,input:t=>this.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step??0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length??0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const ts=ut({mixins:[Fe,Ue,Zn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const es=ut({mixins:[Fe,Ue],props:{empty:String,fields:[Object,Array],value:[String,Object]},data:()=>({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled,"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(i){return[i.saveable&&t.$helper.field.isVisible(i,t.value)?e("tr",{key:i.name,on:{click:function(e){return t.open(i.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(i.label))])]),e("k-table-cell",{attrs:{column:i,field:i,mobile:!0,value:t.object[i.name]},on:{input:function(e){return t.cell(i.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports;const is=ut({extends:Ni,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null,!1,null,null,null,null).exports,ns={mixins:[Li],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ss=ut({extends:Ti,mixins:[ns]},null,null,!1,null,null,null,null).exports;const os=ut({mixins:[Fe,Ue,ns,xi],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t.id,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ls={mixins:[Ie,st],props:{columns:Number,reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}};const as=ut({mixins:[De,ls],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},watch:{value:{handler(){this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",i.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(i.value)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const rs=ut({mixins:[Fe,Ue,ls],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-radio-field",attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-radio-input",e._g(e._b({ref:"input"},"k-radio-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,us={mixins:[Ie],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const cs=ut({mixins:[De,us],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default??this.baseline}},watch:{position(){this.onInvalid()},value(){this.validate()}},mounted(){this.onInvalid(),this.validate(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",i=this.step.toString().split("."),n=i.length>1?i[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-range-input",attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1)),t.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const ds=ut({mixins:[Ue,Fe,us],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ps={mixins:[Ie,st,lt],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},value:{type:[String,Number,Boolean],default:""}}};const hs=ut({mixins:[De,ps],emits:["click","input"],data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder??"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},isEmpty(){return null===this.selected||void 0===this.selected||""===this.selected},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;for(const i of this.options)i.value==t&&(e=i.text);return e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(i){return e("option",{key:i.value,attrs:{disabled:i.disabled},domProps:{value:i.value}},[t._v(" "+t._s(i.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const ms=ut({mixins:[Fe,Ue,ps],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,fs={mixins:[Li],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const gs=ut({extends:Ti,mixins:[fs],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const ks=ut({mixins:[Fe,Ue,fs],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t.id,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{value:t.slug,type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const bs=ut({mixins:[Fe],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const i=this.findIndex(t);!0!==this.disabled&&-1!==i&&this.open(this.items[i+e],null,!0)},open(t,e,i=!1){const n=this.findIndex(t);if(!0===this.disabled||-1===n)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[n+1],prev:this.items[n-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:i,on:{input:e=>{const i=this.findIndex(t);this.$panel.drawer.props.next=this.items[i+1],this.$panel.drawer.props.prev=this.items[i-1],this.$set(this.items,i,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...structuredClone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:function(e){return t.add()}}},[t._v(" "+t._s(t.empty??t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports,vs={mixins:[Li],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")},type:{default:"tel"}}};const ys=ut({extends:Ti,mixins:[vs]},null,null,!1,null,null,null,null).exports;const $s=ut({mixins:[Fe,Ue,vs],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ws=ut({mixins:[Fe,Ue,Li,xi],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t.id,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:t.inputType}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,xs={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const _s=ut({mixins:[xs],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,i={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const n of e)if("|"===n)t.push("|");else if(i[n]){const e={...i[n],click:()=>{var t;null==(t=i[n].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var i;const n=this.layout.find((e=>e.shortcut===t));n&&(e.preventDefault(),null==(i=n.click)||i.call(n))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[],!1,null,null,null,null).exports,Cs={mixins:[xs,Ie,J,et,it,lt,rt],props:{endpoints:Object,preselect:Boolean,size:String,theme:String,value:String}};const Ss=ut({mixins:[De,Cs],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){this.onInvalid(),await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,i=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===i){const i=e.selectionStart,n=e.selectionEnd,s=i===n?"end":"select";e.setRangeText(t,i,n,s)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const i=e.exec(t);return null!==i?{href:i.groups.url??i.groups.link,title:i.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return i=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),i&&i()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const i=this.selection();return i.startsWith(t)&&i.endsWith(e)?this.insert(i.slice(t.length).slice(0,i.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:function(e){var i;null==(i=t.$refs.toolbar)||i.close()},focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null:t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1)])}),[],!1,null,null,null,null).exports;const Os=ut({mixins:[Fe,Ue,Cs,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"textarea"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ms={props:{max:String,min:String,value:String}},As={mixins:[Ms],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const Is=ut({mixins:[ji,As],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ds=ut({mixins:[Fe,Ue,As],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,js={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const Es=ut({mixins:[De,js],computed:{label(){const t=this.text??[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",{ref:"input",staticClass:"k-toggle-input",attrs:{id:t.id,checked:t.value,disabled:t.disabled,label:t.label,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const Ls=ut({mixins:[Fe,Ue,js],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ts={mixins:[Ie],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Bs=ut({mixins:[De,Ts],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:{"--options":t.columns??t.options.length},attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(i,n){return e("li",{key:n,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+n,"aria-label":i.text,disabled:t.disabled,name:t.id,type:"radio"},domProps:{value:i.value,checked:t.value===i.value},on:{click:function(e){return t.onClick(i.value)},change:function(e){return t.onInput(i.value)}}}),e("label",{attrs:{for:t.id+"-"+n,title:i.text}},[i.icon?e("k-icon",{attrs:{type:i.icon}}):t._e(),t.labels||!i.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(i.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const qs=ut({mixins:[Fe,Ue,Ts],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-toggles-field",attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-input",e._g(e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"}},"k-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ps={mixins:[Li],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")},type:{type:String,default:"url"}}};const Ns=ut({extends:Ti,mixins:[Ps]},null,null,!1,null,null,null,null).exports;const zs=ut({mixins:[Fe,Ue,Ps],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Fs=ut({extends:Ni,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null,!1,null,null,null,null).exports;const Ys=ut({mixins:[Fe,Ue,Pn,xi],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Rs={install(t){t.component("k-blocks-field",yi),t.component("k-checkboxes-field",_i),t.component("k-color-field",Ai),t.component("k-date-field",Ei),t.component("k-email-field",Pi),t.component("k-files-field",zi),t.component("k-gap-field",Fi),t.component("k-headline-field",Yi),t.component("k-info-field",Ri),t.component("k-layout-field",Gi),t.component("k-line-field",Xi),t.component("k-link-field",Zi),t.component("k-list-field",Rn),t.component("k-multiselect-field",Xn),t.component("k-number-field",ts),t.component("k-object-field",es),t.component("k-pages-field",is),t.component("k-password-field",os),t.component("k-radio-field",rs),t.component("k-range-field",ds),t.component("k-select-field",ms),t.component("k-slug-field",ks),t.component("k-structure-field",bs),t.component("k-tags-field",Gn),t.component("k-text-field",ws),t.component("k-textarea-field",Os),t.component("k-tel-field",$s),t.component("k-time-field",Ds),t.component("k-toggle-field",Ls),t.component("k-toggles-field",qs),t.component("k-url-field",zs),t.component("k-users-field",Fs),t.component("k-writer-field",Ys)}},Us={mixins:[us],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Hs=ut({mixins:[cs,Us]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Vs=ut({mixins:[Ie,Ii],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,i)=>{t.push({value:i,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{days(t){let e=[];const i=7*(t-1)+1,n=i+7;for(let s=i;sthis.numberOfDays;e.push(i?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+1}-${t}`)},toOptions(t,e){for(var i=[],n=t;n<=e;n++)i.push({value:n,text:this.$helper.pad(n)});return i}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-calendar-input",on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(i){return e("th",{key:"weekday_"+i},[t._v(" "+t._s(i)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(i){return e("tr",{key:"week_"+i},t._l(t.days(i),(function(i,n){return e("td",{key:"day_"+n,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(i)&&"date","aria-selected":!!t.isSelected(i)&&"date"}},[i?e("k-button",{attrs:{disabled:t.isDisabled(i),text:i},on:{click:function(e){t.select(t.toDate(i))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports;const Ks=ut({mixins:[De,{mixins:[Ie],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}}]},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-choice-input",attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:{"sr-only":"invisible"===t.variant},attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const Ws=ut({extends:Ks},null,null,!1,null,null,null,null).exports;const Js=ut({mixins:[as,{mixins:[ls],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}},(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(i,n){return e("li",{key:n},[e("label",{attrs:{title:i.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:i.value===t.value,value:i.value},on:{click:function(e){return t.toggle(i.value)},input:function(e){return t.$emit("input",i.value)}}}),e("k-color-frame",{attrs:{color:i.value}})],1)])})),0)]):t._e()}),[],!1,null,null,null,null).exports;const Gs=ut({mixins:[De,{mixins:[Ie,st],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const i=this.$library.colors.parseAs(t??"","hsv");i?(this.formatted=this.$library.colors.toString(i,this.format),this.color=i):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,i)=>Math.min(Math.max(t,e),i),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),i=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-i/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-colorpicker-input",style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[],!1,null,null,null,null).exports;const Xs=ut({mixins:[De,{mixins:[Ie],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),i=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",i)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",i)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,i={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};i[t.key]&&this.onInput(t,i[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),i=this.getCoords(t,e),n=i.x/e.width*100,s=i.y/e.height*100;this.onInput(t,{x:n,y:s}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const i=t.split(",").map((t=>t.trim()));return{x:i[0],y:i[1]??0}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-coords-input",attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[],!1,null,null,null,null).exports,Zs={mixins:[us],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Qs=ut({mixins:[cs,Zs]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const to=ut({mixins:[Si,{mixins:[Ci],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const eo=ut({mixins:[De,{mixins:[Ie,Ms]}],props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{focus(){this.$el.querySelector("button").focus()},formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-timeoptions-input"},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(i,n){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(i){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports,io={install(t){t.component("k-alpha-input",Hs),t.component("k-calendar-input",Vs),t.component("k-checkbox-input",Ws),t.component("k-checkboxes-input",wi),t.component("k-choice-input",Ks),t.component("k-colorname-input",Mi),t.component("k-coloroptions-input",Js),t.component("k-colorpicker-input",Gs),t.component("k-coords-input",Xs),t.component("k-date-input",ji),t.component("k-email-input",qi),t.component("k-hue-input",Qs),t.component("k-list-input",Yn),t.component("k-multiselect-input",Kn),t.component("k-number-input",Qn),t.component("k-password-input",ss),t.component("k-picklist-input",Le),t.component("k-radio-input",as),t.component("k-range-input",cs),t.component("k-search-input",to),t.component("k-select-input",hs),t.component("k-slug-input",gs),t.component("k-string-input",Si),t.component("k-tags-input",Jn),t.component("k-tel-input",ys),t.component("k-text-input",Ti),t.component("k-textarea-input",Ss),t.component("k-time-input",Is),t.component("k-timeoptions-input",eo),t.component("k-toggle-input",Es),t.component("k-toggles-input",Bs),t.component("k-url-input",Ns),t.component("k-writer-input",Nn),t.component("k-calendar",Vs),t.component("k-times",eo)}};const no=ut({mixins:[Et],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,i=this,n=i._self._c;return n("k-dialog",i._b({staticClass:"k-layout-selector",attrs:{size:(null==(t=i.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return i.$emit("cancel")},submit:function(t){return i.$emit("submit",i.value)}}},"k-dialog",i.$props,!1),[n("h3",{staticClass:"k-label"},[i._v(i._s(i.label))]),n("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=i.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},i._l(i.layouts,(function(t,e){return n("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":i.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return i.$emit("input",t)}}},[n("k-grid",{attrs:{"aria-hidden":""}},i._l(t,(function(t,e){return n("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[],!1,null,null,null,null).exports,so={install(t){t.component("k-layout",Ki),t.component("k-layout-column",Hi),t.component("k-layouts",Ji),t.component("k-layout-selector",no)}},oo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}},lo={props:{html:{type:Boolean}}};const ao=ut({mixins:[lo],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(i,n){return e("li",{key:n},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const ro=ut({mixins:[oo,lo],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const i of e)i.value===t.value&&(t.text=i.text);return t}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles,html:t.html}})],1)}),[],!1,null,null,null,null).exports;const uo=ut({extends:ro,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const co=ut({mixins:[oo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),i=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return i?i.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-color-field-preview"},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[],!1,null,null,null,null).exports;const po=ut({mixins:[oo],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const ho=ut({extends:po,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null,!1,null,null,null,null).exports;const mo=ut({mixins:[oo],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const fo=ut({extends:mo,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const go=ut({extends:ro,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const ko=ut({mixins:[oo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({staticClass:"k-flag-field-preview",attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[],!1,null,null,null,null).exports;const bo=ut({mixins:[oo],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const vo=ut({mixins:[oo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:t.value}}):t._e()}),[],!1,null,null,null,null).exports;const yo=ut({mixins:[oo],inheritAttrs:!1,props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}},(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink}},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[],!1,null,null,null,null).exports;const $o=ut({extends:ro,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles(){return this.value?[{text:"{ ... }"}]:[]}}},null,null,!1,null,null,null,null).exports;const wo=ut({extends:ro,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null,!1,null,null,null,null).exports;const xo=ut({extends:ho,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null,!1,null,null,null,null).exports;const _o=ut({mixins:[oo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-toggle-field-preview"},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports;const Co=ut({extends:ro,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,So={install(t){t.component("k-array-field-preview",uo),t.component("k-bubbles-field-preview",ro),t.component("k-color-field-preview",co),t.component("k-date-field-preview",ho),t.component("k-email-field-preview",fo),t.component("k-files-field-preview",go),t.component("k-flag-field-preview",ko),t.component("k-html-field-preview",bo),t.component("k-image-field-preview",vo),t.component("k-link-field-preview",yo),t.component("k-object-field-preview",$o),t.component("k-pages-field-preview",wo),t.component("k-text-field-preview",po),t.component("k-toggle-field-preview",_o),t.component("k-time-field-preview",xo),t.component("k-url-field-preview",mo),t.component("k-users-field-preview",Co),t.component("k-list-field-preview",bo),t.component("k-writer-field-preview",bo),t.component("k-checkboxes-field-preview",ro),t.component("k-multiselect-field-preview",ro),t.component("k-radio-field-preview",ro),t.component("k-select-field-preview",ro),t.component("k-tags-field-preview",ro),t.component("k-toggles-field-preview",ro)}};const Oo=ut({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(i,n){var s;return["|"===i?e("hr",{key:n}):i.when??1?e("k-button",{key:n,class:["k-toolbar-button",i.class],attrs:{current:i.current,disabled:i.disabled,icon:i.icon,title:i.label,tabindex:"0"},on:{click:function(e){var s,o;(null==(s=i.dropdown)?void 0:s.length)?t.$refs[n+"-dropdown"][0].toggle():null==(o=i.click)||o.call(i,e)}},nativeOn:{keydown:function(t){var e;null==(e=i.key)||e.call(i,t)}}}):t._e(),(i.when??1)&&(null==(s=i.dropdown)?void 0:s.length)?e("k-dropdown-content",{key:n+"-dropdown",ref:n+"-dropdown",refInFor:!0,attrs:{options:i.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Mo=ut({extends:Bt,props:{fields:{default:()=>{const t=Bt.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports;const Ao=ut({extends:Kt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports,Io={install(t){t.component("k-toolbar",Oo),t.component("k-textarea-toolbar",_s),t.component("k-toolbar-email-dialog",Mo),t.component("k-toolbar-link-dialog",Ao)}};const Do=ut({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,i;const n=[];if(this.hasNodes){const s=[];let o=0;for(const n in this.nodeButtons){const l=this.nodeButtons[n];s.push({current:(null==(t=this.activeNode)?void 0:t.id)===l.id,disabled:!1===(null==(i=null==(e=this.activeNode)?void 0:e.when)?void 0:i.includes(l.name)),icon:l.icon,label:l.label,click:()=>this.command(l.command??n)}),!0===l.separator&&o!==Object.keys(this.nodeButtons).length-1&&s.push("-"),o++}n.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:s})}if(this.hasNodes&&this.hasMarks&&n.push("|"),this.hasMarks)for(const s in this.markButtons){const t=this.markButtons[s];"|"!==t?n.push({current:this.editor.activeMarks.includes(s),icon:t.icon,label:t.label,click:e=>this.command(t.command??s,e)}):n.push("|")}return n},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[i,n]of this.marks.entries())"|"===n?e["divider"+i]="|":t[n]&&(e[n]=t[n]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const i of this.nodes)t[i]&&(e[i]=t[i]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),i=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:n,to:s}=this.editor.selection,o=this.editor.view.coordsAtPos(n),l=this.editor.view.coordsAtPos(s,!0),a=new DOMRect(o.left,o.top,l.right-o.left,l.bottom-o.top);let r=a.x-e.x+a.width/2-t.width/2,u=a.y-e.y-t.height-5;if(t.widthe.width&&(r=e.width-t.width);else{const n=e.x+r,s=n+t.width,o=i.width+20,l=20;nwindow.innerWidth-l&&(r-=s-(window.innerWidth-l))}this.position={x:r,y:u}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[],!1,null,null,null,null).exports,jo={install(t){t.component("k-writer-toolbar",Do),t.component("k-writer",qn)}},Eo={install(t){t.component("k-counter",Pe),t.component("k-autocomplete",qe),t.component("k-form",Ne),t.component("k-form-buttons",ze),t.component("k-field",Ye),t.component("k-fieldset",Re),t.component("k-input",He),t.component("k-upload",Ve),t.use(vi),t.use(io),t.use(Rs),t.use(so),t.use(So),t.use(Io),t.use(jo)}},Lo=()=>Y((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),To=()=>Y((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),Bo=()=>Y((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),qo={install(t){t.component("k-lab-index-view",Lo),t.component("k-lab-docs-view",To),t.component("k-lab-playground-view",Bo)}};const Po=ut({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}},mounted(){window.panel.deprecated(" will be removed in a future version. Use the instead.")}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const No=ut({props:{align:{type:String,default:"start"}},mounted(){(this.$slots.left||this.$slots.center||this.$slots.right)&&window.panel.deprecated(": left/centre/right slots will be removed in a future version. Use with default slot only instead.")}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t.$slots.left||t.$slots.center||t.$slots.right?[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const zo=ut({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[],!1,null,null,null,null).exports;const Fo=ut({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){this.back&&window.panel.deprecated(": `back` prop will be removed in a future version. Use the `--bubble-back` CSS property instead."),this.color&&window.panel.deprecated(": `color` prop will be removed in a future version. Use the `--bubble-text` CSS property instead.")}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link,"data-has-text":Boolean(t.text)},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var i;return[(null==(i=t.image)?void 0:i.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Yo=ut({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports,Ro={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const Uo=ut({mixins:[Ro],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-frame",style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ho=ut({mixins:[{mixins:[Ro],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({staticClass:"k-color-frame",style:{"--color-frame-back":t.color}},"k-frame",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Vo=ut({props:{disabled:{type:Boolean}},emits:["drop"],data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ko=ut({props:{gutter:String,variant:String},mounted(){this.gutter&&window.panel.deprecated(': the `gutter` prop will be removed in a future version. Use `style="gap: "` or `variant` prop instead.')}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter,"data-variant":t.variant}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Wo=ut({props:{editable:{type:Boolean},tabs:Array},emits:["edit"],mounted(){this.tabs&&window.panel.deprecated(": `tabs` prop isn't supported anymore and has no effect. Use `` as standalone component instead."),(this.$slots.left||this.$slots.right)&&window.panel.deprecated(": left/right slots will be removed in a future version. Use `buttons` slot instead.")}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons||t.$slots.left||t.$slots.right?e("div",{staticClass:"k-header-buttons"},[t._t("buttons"),t._t("left"),t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports,Jo={props:{alt:String,color:String,type:String}};const Go=ut({mixins:[Jo],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[],!1,null,null,null,null).exports;const Xo=ut({mixins:[{mixins:[Ro,Jo],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({staticClass:"k-icon-frame",attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[],!1,null,null,null,null).exports;const Zo=ut({mixins:[{mixins:[Ro],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._g(t._b({staticClass:"k-image-frame k-image",attrs:{element:"figure"}},"k-frame",t.$props,!1),t.$listeners),[t.src?e("img",{key:t.src,attrs:{alt:t.alt??"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e()])}),[],!1,null,null,null,null).exports;const Qo=ut({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const tl=ut({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[],!1,null,null,null,null).exports;const el=ut({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(i,n){return e("k-stat",t._b({key:n},"k-stat",i,!1))})),1)}),[],!1,null,null,null,null).exports;const il=ut({inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0:t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label??this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:i}){this.values[e][t]=i,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,i){this.$emit("option",t,e,i)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table",attrs:{"aria-disabled":t.disabled}},[e("table",{attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(i,n){return e("th",{key:n+"-header",staticClass:"k-table-column",style:{width:t.width(i.width)},attrs:{"data-align":i.align,"data-column-id":n,"data-mobile":i.mobile},on:{click:function(e){return t.onHeader({column:i,columnIndex:n})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(i,n))+" ")]}),null,{column:i,columnIndex:n,label:t.label(i,n)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(i,n){return e("tr",{key:n,class:{"k-table-sortable-row":t.sortable&&!1!==i.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+n)}})]}),null,{row:i,rowIndex:n}),t.sortable&&!1!==i.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(s,o){return e("k-table-cell",{key:n+"-"+o,staticClass:"k-table-column",style:{width:t.width(s.width)},attrs:{id:o,column:s,field:t.fields[o],row:i,mobile:s.mobile,value:i[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:n,value:e})}},nativeOn:{click:function(e){return t.onCell({row:i,rowIndex:n,column:s,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:i.options??t.options,text:(i.options??t.options).length>1},on:{option:function(e){return t.onOption(e,i,n)}}})]}),null,{row:i,rowIndex:n})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const nl=ut({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type??(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{staticClass:"k-table-cell",attrs:{"data-align":t.column.align,"data-column-id":t.id,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const sl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){return{...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name}},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let i=32;for(let n=0;nt)return this.visible=this.tabs.slice(0,n),void(this.invisible=this.tabs.slice(n))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(i){return e("div",{key:i.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",i,!1),[t._v(" "+t._s(i.text)+" ")]),i.badge?e("span",{staticClass:"k-tabs-badge",attrs:{"data-theme":t.theme}},[t._v(" "+t._s(i.badge)+" ")]):t._e()],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[],!1,null,null,null,null).exports;const ol=ut({props:{align:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,ll={install(t){t.component("k-aspect-ratio",Po),t.component("k-bar",No),t.component("k-box",zo),t.component("k-bubble",Fo),t.component("k-bubbles",ao),t.component("k-color-frame",Ho),t.component("k-column",Yo),t.component("k-dropzone",Vo),t.component("k-frame",Uo),t.component("k-grid",Ko),t.component("k-header",Wo),t.component("k-icon-frame",Xo),t.component("k-image-frame",Zo),t.component("k-image",Zo),t.component("k-overlay",Qo),t.component("k-stat",tl),t.component("k-stats",el),t.component("k-table",il),t.component("k-table-cell",nl),t.component("k-tabs",sl),t.component("k-view",ol)}};const al=ut({components:{draggable:()=>Y((()=>import("./vuedraggable.min.js")),[],import.meta.url)},props:{data:Object,element:{type:String,default:"div"},handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=this.handle;return!0===t&&(t=".k-sort-handle"),{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-main"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const rl=ut({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const ul=ut({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[],!1,null,null,null,null).exports;const cl=ut({icons:window.panel.plugins.icons,methods:{viewbox(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.innerHTML=e,document.body.appendChild(i);const n=i.getBBox(),s=(n.width+2*n.x+(n.height+2*n.y))/2,o=Math.abs(s-16),l=Math.abs(s-24);return document.body.removeChild(i),o element with the corresponding viewBox attribute.`),"0 0 16 16"):"0 0 24 24"}}},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(i,n){return e("symbol",{key:n,attrs:{id:"icon-"+n,viewBox:t.viewbox(n,i)},domProps:{innerHTML:t._s(i)}})})),0)])}),[],!1,null,null,null,null).exports;const dl=ut({mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')}},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const pl=ut({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const hl=ut({},(function(){var t=this,e=t._self._c;return t.$panel.isOffline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,ml=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const fl=ut({props:{value:{type:Number,default:0,validator:ml}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){window.panel.deprecated(": `set` method will be removed in a future version. Use the `value` prop instead."),ml(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const gl=ut({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[],!1,null,null,null,null).exports,kl={install(t){t.component("k-draggable",al),t.component("k-error-boundary",rl),t.component("k-fatal",ul),t.component("k-icon",Go),t.component("k-icons",cl),t.component("k-loader",dl),t.component("k-notification",pl),t.component("k-offline-warning",hl),t.component("k-progress",fl),t.component("k-sort-handle",gl)}};const bl=ut({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){const t=[];return this.view&&t.push({link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading}),[...t,...this.crumbs]}},mounted(){this.view&&window.panel.deprecated(": `view` prop will be removed in a future version. Use `crumbs` instead.")}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.segments.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.segments,(function(i,n){return e("li",{key:n},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.loading?"loader":i.icon,link:i.link,disabled:!i.link,text:i.text??i.label,title:i.text??i.label,current:n===t.segments.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[],!1,null,null,null,null).exports;const vl=ut({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(i){return e("label",{key:i.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===i.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===i.value},on:{change:function(e){return t.$emit("select",i)}}}),i.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...i.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(i.label)+" ")])],1)})),0)])}),[],!1,null,null,null,null).exports,yl={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const $l=ut({mixins:[yl],props:{to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",{ref:"link",staticClass:"k-link",attrs:{download:t.download,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const wl=ut({mixins:[{mixins:[yl],props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"},variant:String}}],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title??this.tooltip};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},mounted(){this.tooltip&&window.panel.deprecated(": the `tooltip` prop will be removed in a future version. Use the `title` prop instead.")},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",staticClass:"k-button",attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-down"}})],1):t._e()])}),[],!1,null,null,null,null).exports;const xl=ut({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(i,n){return e("k-button",t._b({key:n},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...i},!1))}))],2)}),[],!1,null,null,null,null).exports;const _l=ut({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const i="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:n,pagination:s}=await this.$api.get(i,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=s,this.files=n.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,i=this,n=i._self._c;return n("div",{staticClass:"k-file-browser",attrs:{"data-view":i.view}},[n("div",{staticClass:"k-file-browser-layout"},[n("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[n("k-page-tree",{attrs:{current:(null==(t=i.page)?void 0:t.value)??i.opened},on:{select:i.selectPage,toggleBranch:i.togglePage}})],1),n("div",{ref:"items",staticClass:"k-file-browser-items"},[n("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=i.page)?void 0:e.label},on:{click:function(t){i.view="tree"}}}),i.files.length?n("k-browser",{attrs:{items:i.files,selected:i.selected},on:{select:i.selectFile}}):i._e()],1),n("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[i.pagination?n("k-pagination",i._b({attrs:{details:!0},on:{paginate:i.paginate}},"k-pagination",i.pagination,!1)):i._e()],1)])])}),[],!1,null,null,null,null).exports;const Cl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{const i=[];for(const t in e.columns)for(const n in e.columns[t].sections)if("fields"===e.columns[t].sections[n].type)for(const s in e.columns[t].sections[n].fields)i.push(s);return e.badge=i.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[],!1,null,null,null,null).exports;const Sl=ut({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var i;const n=[...this.$el.querySelectorAll(this.select)];let s=n.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===s&&(s=0),t){case"first":t=0;break;case"next":t=s+1;break;case"last":t=n.length-1;break;case"prev":t=s-1}t<0?this.$emit("prev"):t>=n.length?this.$emit("next"):null==(i=n[t])||i.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ol=ut({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(i){return e("li",{key:i.value,attrs:{"aria-expanded":i.open,"aria-current":t.isItem(i,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":i.hasChildren&&i.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!i.hasChildren,type:"button"},on:{click:function(e){return t.toggle(i)}}},[e("k-icon",{attrs:{type:t.arrow(i)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:i.disabled,type:"button"},on:{click:function(e){return t.select(i)},dblclick:function(e){return t.toggle(i)}}},[e("k-icon-frame",{attrs:{icon:i.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(i.label))])],1)]),i.hasChildren&&i.open?[e(t.$options.name,t._b({ref:i.value,refInFor:!0,tag:"component",attrs:{items:i.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[],!1,null,null,null,null).exports;const Ml=ut({name:"k-page-tree",extends:Ol,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t}})).data;this.root&&e.unshift("site://");let i=this;for(let s=0;sPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const i=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:i,end:Math.min(i-1+this.limit,this.total),limit:this.limit,offset:i-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.prev.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},t._l(t.pages,(function(i){return e("option",{key:i,domProps:{selected:t.page===i,value:i}},[t._v(" "+t._s(i)+" ")])})),0)]),e("k-button",{attrs:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[],!1,null,null,null,null).exports;const Il=ut({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[],!1,null,null,null,null).exports;const Dl=ut({mixins:[zt],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const i=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const n of i)delete n.dataset.selected;t>=0&&(i[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length will be removed in a future version. Use instead.')}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Ll=ut({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Tl=ut({inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("button",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,Bl={install(t){t.component("k-breadcrumb",bl),t.component("k-browser",vl),t.component("k-button",wl),t.component("k-button-group",xl),t.component("k-file-browser",_l),t.component("k-link",$l),t.component("k-model-tabs",Cl),t.component("k-navigate",Sl),t.component("k-page-tree",Ml),t.component("k-pagination",Al),t.component("k-prev-next",Il),t.component("k-search-bar",Dl),t.component("k-tag",jl),t.component("k-tags",Hn),t.component("k-tree",Ol),t.component("k-button-disabled",El),t.component("k-button-link",Ll),t.component("k-button-native",Tl)}};const ql=ut({props:{buttons:Array,headline:String,invalid:Boolean,label:String,link:String,required:Boolean}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-section",attrs:{"data-invalid":t.invalid}},[t.label||t.headline||t.buttons||t.$slots.options?e("header",{staticClass:"k-section-header"},[e("k-label",{attrs:{invalid:t.invalid,link:t.link,required:t.required,title:t.label??t.headline,type:"section"}},[t._v(" "+t._s(t.label??t.headline)+" ")]),t._t("options",(function(){return[t.buttons?e("k-button-group",{staticClass:"k-section-buttons",attrs:{buttons:t.buttons,size:"xs",variant:"filled"}}):t._e()]}))],2):t._e(),t._t("default")],2)}),[],!1,null,null,null,null).exports;const Pl=ut({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},emits:["submit"],computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{variant:"columns"}},t._l(t.tab.columns,(function(i,n){return e("k-column",{key:t.parent+"-column-"+n,attrs:{width:i.width,sticky:i.sticky}},[t._l(i.sections,(function(s,o){return[t.$helper.field.isVisible(s,t.content)?[t.exists(s.type)?e("k-"+s.type+"-section",t._b({key:t.parent+"-column-"+n+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section-name-"+s.name,attrs:{column:i.width,lock:t.lock,name:s.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",s,!1)):[e("k-box",{key:t.parent+"-column-"+n+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:s.type}),icon:"alert",theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,Nl={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const zl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},mounted(){this.onInput=Nt(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,i){this.$store.dispatch("content/update",[i,t[i]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{staticClass:"k-fields-section",attrs:{headline:t.issue?"Error":null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",theme:"negative"}}):t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[],!1,null,null,null,null).exports;const Fl=ut({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty??this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Nt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(i){this.error=i.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:`k-models-section k-${t.type}-section`,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[],!1,null,null,null,null).exports;const Yl=ut({extends:Fl,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){this.$events.on("model.update",this.reload),this.$events.on("file.sort",this.reload)},destroyed(){this.$events.off("model.update",this.reload),this.$events.off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Rl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{staticClass:"k-info-section",attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[],!1,null,null,null,null).exports;const Ul=ut({extends:Fl,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1===t.permissions.changeStatus,i=this.$helper.page.status(t.status,e);return i.click=()=>this.$dialog(t.link+"/changeStatus"),t.flag={status:t.status,disabled:e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.buttons=[i,...t.buttons??[]],t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))},type:()=>"pages"},mounted(){this.$events.on("page.changeStatus",this.reload),this.$events.on("page.sort",this.reload)},destroyed(){this.$events.off("page.changeStatus",this.reload),this.$events.off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link??this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const n=t[e].element,s=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(n.id,"listed",s),this.$panel.notification.success(),this.$events.emit("page.sort",n)}catch(i){this.$panel.error({message:i.message,details:i.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const Hl=ut({mixins:[Nl],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,Vl={install(t){t.component("k-section",ql),t.component("k-sections",Pl),t.component("k-fields-section",zl),t.component("k-files-section",Yl),t.component("k-info-section",Rl),t.component("k-pages-section",Ul),t.component("k-stats-section",Hl)}};const Kl=ut({components:{"k-highlight":()=>Y((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;const Wl=ut({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"],mounted(){this.size&&window.panel.deprecated(": the `size` prop will be removed in a future version. Use the `tag` prop instead."),this.theme&&window.panel.deprecated(": the `theme` prop will be removed in a future version.")}},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const Jl=ut({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input,"data-invalid":t.invalid}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required&&!t.invalid?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[],!1,null,null,null,null).exports;const Gl=ut({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}},mounted(){this.theme&&window.panel.deprecated(': the `theme` prop will be removed in a future version. For help text, add `.k-help "` CSS class instead.')}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports,Xl={install(t){t.component("k-code",Kl),t.component("k-headline",Wl),t.component("k-label",Jl),t.component("k-text",Gl)}},Zl={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Ql=ut({mixins:[Zl],computed:{fallbackColor(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(i=this.type)?void 0:i.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(i=this.type)?void 0:i.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[],!1,null,null,null,null).exports;const ta=ut({mixins:[Zl],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,novalidate:!0,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[],!1,null,null,null,null).exports;const ea=ut({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(i){return e("k-upload-item",t._b({key:i.id,on:{rename:function(e){return t.$emit("rename",i,e)},remove:function(e){return t.$emit("remove",i)}}},"k-upload-item",i,!1))})),1)}),[],!1,null,null,null,null).exports,ia={install(t){t.component("k-upload-item",ta),t.component("k-upload-item-preview",Ql),t.component("k-upload-items",ea)}};const na=ut({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const sa=ut({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const oa=ut({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(i,n){return e("menu",{key:n,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":n===t.menus.length-2}},t._l(i,(function(i){return e("k-button",t._b({key:i.id,staticClass:"k-panel-menu-button",attrs:{title:i.title??i.text}},"k-button",i,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[],!1,null,null,null,null).exports;const la=ut({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const aa=ut({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[],!1,null,null,null,null).exports;const ra=ut({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[],!1,null,null,null,null).exports,ua={install(t){t.component("k-activation",na),t.component("k-panel",aa),t.component("k-panel-inside",sa),t.component("k-panel-menu",oa),t.component("k-panel-outside",la),t.component("k-topbar",ra),t.component("k-inside",sa),t.component("k-outside",la)}};const ca=ut({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[],!1,null,null,null,null).exports;const da=ut({mixins:[zt],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const i=this.$panel.searches[e];t.push({label:i.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const i=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});i&&(this.results=i.results??[],this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[],!1,null,null,null,null).exports;const pa=ut({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},mounted(){this.$events.on("model.reload",this.$reload),this.$events.on("keydown.left",this.toPrev),this.$events.on("keydown.right",this.toNext)},destroyed(){this.$events.off("model.reload",this.$reload),this.$events.off("keydown.left",this.toPrev),this.$events.off("keydown.right",this.toNext)},methods:{toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const ha=ut({extends:pa,props:{preview:Object},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,i]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(i)}}},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})},setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x}% ${t.y}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{staticClass:"k-file-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"},on:{action:t.action}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-file-preview",t._b({attrs:{focus:t.focus},on:{focus:t.setFocus}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const ma=ut({props:{focus:Object},emits:["set"],methods:{set(){this.$emit("set",{x:50,y:50})},reset(){this.$emit("set",void 0)}}},(function(){var t=this;return(0,t._self._c)("k-button",{attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.reset():t.set()}}},[t.focus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2)}),[],!1,null,null,null,null).exports;const fa=ut({props:{details:{default:()=>[],type:Array},focus:{type:Object},focusable:Boolean,image:{default:()=>({}),type:Object},url:String},emits:["focus"],computed:{options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.$refs.focus.reset(),when:this.focusable&&this.focus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.$refs.focus.set(),when:this.focusable&&!this.focus}]}},methods:{setFocus(t){if(!t)return this.$emit("focus",null);this.$emit("focus",{x:t.x.toFixed(1),y:t.y.toFixed(1)})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":Boolean(t.focus)}},[e("div",{staticClass:"k-file-preview-thumb-column"},[e("div",{staticClass:"k-file-preview-thumb"},[t.image.src?[e("k-coords-input",{attrs:{disabled:!t.focusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))]),e("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"}})]:e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],2)]),e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(i){return e("div",{key:i.title},[e("dt",[t._v(t._s(i.title))]),e("dd",[i.link?e("k-link",{attrs:{to:i.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(i.text)+" ")]):[t._v(" "+t._s(i.text)+" ")]],2)])})),t.image.src?e("div",{staticClass:"k-file-preview-focus-info"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.focusable?e("k-file-focus-button",{ref:"focus",attrs:{focus:t.focus},on:{set:t.setFocus}}):t.focus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()],2)])])}),[],!1,null,null,null,null).exports,ga={install(t){t.component("k-file-view",ha),t.component("k-file-preview",fa),t.component("k-file-focus-button",ma)}};const ka=ut({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"translate",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[],!1,null,null,null,null).exports,ba={install(t){t.component("k-installation-view",ka)}};const va=ut({props:{languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,click:()=>this.$dialog(`languages/${t.id}/delete`)}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.create,text:t.$t("language.create"),icon:"add",size:"sm",variant:"filled"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[],!1,null,null,null,null).exports;const ya=ut({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},remove(){this.$dialog(`languages/${this.id}/delete`)},update(t){this.$dialog(`languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.url,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{attrs:{disabled:!t.canUpdate,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.update()}}}),t.deletable?e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.delete,title:t.$t("delete"),icon:"trash",size:"sm",variant:"filled"},on:{click:function(e){return t.remove()}}}):t._e()],1)]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[],!1,null,null,null,null).exports,$a={install(t){t.component("k-languages-view",va),t.component("k-language-view",ya)}};const wa=ut({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[],!1,null,null,null,null).exports,xa={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const _a=ut({mixins:[xa],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}},[t._v(" "+t._s(t.$t("back"))+" ")]),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)],1)}),[],!1,null,null,null,null).exports,Ca={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const Sa=ut({mixins:[Ca],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code")))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){const t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[],!1,null,null,null,null).exports;const Oa=ut({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[xa,Ca],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},mounted(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[],!1,null,null,null,null).exports,Ma={install(t){t.component("k-login-alert",wa),t.component("k-login-code-form",_a),t.component("k-login-form",Sa),t.component("k-login-view",Oa),t.component("k-login",Sa),t.component("k-login-code",_a)}};const Aa=ut({extends:pa,props:{status:Object},computed:{protectedFields:()=>["title"],statusBtn(){return{...this.$helper.page.status.call(this,this.model.status,!this.permissions.changeStatus||this.isLocked),responsive:!0,size:"sm",text:this.status.label,variant:"filled"}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}):t._e(),e("k-button",{staticClass:"k-page-view-options",attrs:{disabled:!0===t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",variant:"filled",size:"sm"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"}}),e("k-languages-dropdown"),t.status?e("k-button",t._b({staticClass:"k-page-view-status",on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}},"k-button",t.statusBtn,!1)):t._e()],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const Ia=ut({extends:pa,emits:["submit"],computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)}),[],!1,null,null,null,null).exports,Da={install(t){t.component("k-page-view",Aa),t.component("k-site-view",Ia)}};const ja=ut({extends:pa},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-user-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{"align-x":"end",options:t.$dropdown(t.id)}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-user-profile",{attrs:{"is-locked":t.isLocked,model:t.model,permissions:t.permissions}}),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const Ea=ut({extends:ja,prevnext:!1},null,null,!1,null,null,null,null).exports;const La=ut({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[],!1,null,null,null,null).exports;const Ta=ut({props:{model:Object},methods:{open(){this.model.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.model.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.model.link+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{title:t.$t("avatar")},on:{click:t.open}},[t.model.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.model.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[],!1,null,null,null,null).exports;const Ba=ut({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[],!1,null,null,null,null).exports;const qa=ut({props:{isLocked:Boolean,model:Object,permissions:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{disabled:t.isLocked,model:t.model}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:`${t.model.email}`,title:`${t.$t("email")}: ${t.model.email}`,disabled:!t.permissions.changeEmail||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeEmail")},{icon:"bolt",text:`${t.model.role}`,title:`${t.$t("role")}: ${t.model.role}`,disabled:!t.permissions.changeRole||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:`${t.model.language}`,title:`${t.$t("language")}: ${t.model.language}`,disabled:!t.permissions.changeLanguage||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeLanguage")}]}})],1)}),[],!1,null,null,null,null).exports;const Pa=ut({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,i=e._self._c;return i("k-panel-inside",{staticClass:"k-users-view"},[i("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[i("k-button",{attrs:{disabled:!e.$panel.permissions.users.create,text:e.$t("user.create"),icon:"add",size:"sm",variant:"filled"},on:{click:e.create}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),i("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),i("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[],!1,null,null,null,null).exports,Na={install(t){t.component("k-account-view",Ea),t.component("k-reset-password-view",La),t.component("k-user-avatar",Ta),t.component("k-user-info",Ba),t.component("k-user-profile",qa),t.component("k-user-view",ja),t.component("k-users-view",Pa)}};const za=ut({components:{Plugins:ut({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[],!1,null,null,null,null).exports,Security:ut({props:{exceptions:Array,security:Array,urls:Object},data(){return{issues:structuredClone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:i}=await fetch(e,{cache:"no-store"});i<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[],!1,null,null,null,null).exports},props:{environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[],!1,null,null,null,null).exports;const Fa=ut({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[],!1,null,null,null,null).exports,Ya={install(t){t.component("k-system-view",za),t.component("k-table-update-status-cell",Fa)}};const Ra=ut({props:{id:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this._self._c;return t("k-panel-inside",[t("k-"+this.id+"-plugin-view",{tag:"component"})],1)}),[],!1,null,null,null,null).exports,Ua={install(t){t.component("k-error-view",ca),t.component("k-search-view",da),t.use(ga),t.use(ba),t.use($a),t.use(Ma),t.use(Da),t.use(Ya),t.use(Na),t.component("k-plugin-view",Ra)}},Ha={install(t){t.use(kt),t.use(se),t.use(xe),t.use(Be),t.use(Eo),t.use(qo),t.use(ll),t.use(kl),t.use(Bl),t.use(Vl),t.use(Xl),t.use(ia),t.use(ua),t.use(Ua),t.use(L)}},Va={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Ka=(t={})=>{var e=t.desc?-1:1,i=-e,n=/^0/,s=/\s+/g,o=/^\s+|\s+$/g,l=/[^\x00-\x80]/,a=/^0x[0-9a-f]+$/i,r=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(n)||1===e)&&parseFloat(t)||t.replace(s," ").replace(o,"")||0}return function(t,n){var s=c(t),o=c(n);if(!s&&!o)return 0;if(!s&&o)return i;if(s&&!o)return e;var r=d(s),h=d(o),m=parseInt(s.match(a),16)||1!==r.length&&Date.parse(s),f=parseInt(o.match(a),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=r.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return i;if(b===v-1)return 0}else{if(y<$)return i;if(y>$)return e}}return 0}};function Wa(t){return Array.isArray(t)?t:Object.values(t??{})}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Ja(t,e){return t.reduce(((t,i)=>(i===e?t.push([]):t[t.length-1].push(i),t)),[[]])}function Ga(t){return Array.isArray(t)?t:[t]}Array.fromObject=Wa,Object.defineProperty(Array.prototype,"sortBy",{value:function(t){return t(this,t)},enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(Array.prototype,"split",{value:function(t){return Ja(this,t)},enumerable:!1,writable:!0,configurable:!0}),Array.wrap=Ga;const Xa={fromObject:Wa,search:(t,e,i={})=>{if((e??"").length<=(i.min??0))return t;const n=new RegExp(RegExp.escape(e),"ig"),s=i.field??"text",o=t.filter((t=>!!t[s]&&null!==t[s].match(n)));return i.limit?o.slice(0,i.limit):o},sortBy:function(t,e){const i=e.split(" "),n=i[0],s=i[1]??"asc",o=Ka({desc:"desc"===s,insensitive:!0});return t.sort(((t,e)=>{const i=String(t[n]??""),s=String(e[n]??"");return o(i,s)}))},split:Ja,wrap:Ga};const Za={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const i=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(i)return i.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const i=document.createElement("textarea");if(i.value=t,document.body.append(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.contentEditable=!0,i.readOnly=!0;const t=document.createRange();t.selectNodeContents(i);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),i.setSelectionRange(0,999999)}else i.select();return document.execCommand("copy"),i.remove(),!0}};function Qa(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function tr(t,e=!1){if(!t.match("youtu"))return!1;let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t)),s=n[0],o=n[1],l="https://"+(!0===e?"www.youtube-nocookie.com":i.host)+"/embed",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let r=i.searchParams,u=null;switch(n.join("/")){case"embed/videoseries":case"playlist":a(r.get("list"))&&(u=l+"/videoseries");break;case"watch":a(r.get("v"))&&(u=l+"/"+r.get("v"),r.has("t")&&r.set("start",r.get("t")),r.delete("v"),r.delete("t"));break;default:i.host.includes("youtu.be")&&a(s)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+s:"https://www.youtube.com/embed/"+s,r.has("t")&&r.set("start",r.get("t")),r.delete("t")):["embed","shorts"].includes(s)&&a(o)&&(u=l+"/"+o)}if(!u)return!1;const c=r.toString();return c.length&&(u+="?"+c),u}function er(t,e=!1){let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t));let s=i.searchParams,o=null;switch(!0===e&&s.append("dnt",1),i.host){case"vimeo.com":case"www.vimeo.com":o=n[0];break;case"player.vimeo.com":o=n[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let l="https://player.vimeo.com/video/"+o;const a=s.toString();return a.length&&(l+="?"+a),l}const ir={youtube:tr,vimeo:er,video:function(t,e=!1){return!0===t.includes("youtu")?tr(t,e):!0===t.includes("vimeo")&&er(t,e)}};function nr(t){var e;if(void 0!==t.default)return structuredClone(t.default);const i=window.panel.app.$options.components[`k-${t.type}-field`],n=null==(e=null==i?void 0:i.options.props)?void 0:e.value;if(void 0===n)return;const s=null==n?void 0:n.default;return"function"==typeof s?s():void 0!==s?s:null}const sr={defaultValue:nr,form:function(t){const e={};for(const i in t){const n=nr(t[i]);void 0!==n&&(e[i]=n)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const i in t.when){const n=e[i.toLowerCase()],s=t.when[i];if((void 0!==n||!(""===s||Array.isArray(s)&&0===s.length))&&n!==s)return!1}return!0},subfields:function(t,e){let i={};for(const n in e){const s=e[n];s.section=t.name,t.endpoints&&(s.endpoints={field:t.endpoints.field+"+"+n,section:t.endpoints.section,model:t.endpoints.model}),i[n]=s}return i}},or=t=>t.split(".").slice(-1).join(""),lr=t=>t.split(".").slice(0,-1).join("."),ar=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),rr={extension:or,name:lr,niceSize:ar};function ur(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const i=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&i.unshift(`[name="${e}"]`);const n=function(t,e){for(const i of e){const e=t.querySelector(i);if(!0===cr(e))return e}return null}(t,i);return n?(n.focus(),n):!0===cr(t)&&(t.focus(),t)}function cr(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const dr=t=>"function"==typeof window.Vue.options.components[t],pr=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const hr={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function mr(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function fr(t){return"site://"===t||!0===t.startsWith("page://")||!0===t.startsWith("/@/page/")}function gr(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===fr(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===mr(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const i={};for(const n of t)i[n]=e[n];return i}const kr={detect:function(t,e){if(t=t??"",e=e??gr(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const i in e)if(!0===e[i].detect(t))return{type:i,link:e[i].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace("/@/page/","page://")},isFileUUID:mr,isPageUUID:fr,preview:async function({type:t,link:e},i){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const i=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:i.title,image:i.panelImage}}catch{return null}}(e,i):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const i=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:i.filename,image:i.panelImage}}catch{return null}}(e,i):e?{label:e}:null},types:gr};const br={status:function(t,e=!1){const i={class:"k-status-icon",icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(i.title+=` (${window.panel.$t("disabled")})`),i.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",i}},vr=(t="3/2",e="100%",i=!0)=>{const n=String(t).split("/");if(2!==n.length)return e;const s=Number(n[0]),o=Number(n[1]);let l=100;return 0!==s&&0!==o&&(l=i?l/s*o:l/o*s,l=parseFloat(String(l)).toFixed(2)),l+"%"},yr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function $r(t){return String(t).replace(/[&<>"'`=/]/g,(t=>yr[t]))}function wr(t){return!t||0===String(t).length}function xr(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function _r(t="",e=""){const i=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(i,"")}function Cr(t="",e=""){const i=new RegExp(`(${RegExp.escape(e)})+$`,"g");return t.replace(i,"")}function Sr(t,e={}){const i=(t,e={})=>{const n=e[$r(t.shift())]??"…";return"…"===n||0===t.length?n:i(t,n)},n="[{]{1,2}[\\s]?",s="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${n}(.*?)${s}`,"gi"),((t,n)=>i(n.split("."),e)))).replace(new RegExp(`${n}.*${s}`,"gi"),"…")}function Or(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function Mr(){let t,e,i="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(i+="-"),i+=(12==t?4:16==t?3&e|8:e).toString(16);return i}const Ar={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:$r,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(t))return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},isEmpty:wr,lcfirst:xr,ltrim:_r,pad:function(t,e=2){t=String(t);let i="";for(;i.length]+)>)/gi,"")},template:Sr,ucfirst:Or,ucwords:function(t){return String(t).split(/ /g).map((t=>Or(t))).join(" ")},unescapeHTML:function(t){for(const e in yr)t=String(t).replaceAll(yr[e],e);return t},uuid:Mr},Ir=async(t,e)=>new Promise(((i,n)=>{const s={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},o=Object.assign(s,e),l=new XMLHttpRequest,a=new FormData;a.append(o.field,t,o.filename);for(const t in o.attributes){const e=o.attributes[t];null!=e&&a.append(t,e)}const r=e=>{if(e.lengthComputable&&o.progress){const i=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));o.progress(l,t,i)}};l.upload.addEventListener("loadstart",r),l.upload.addEventListener("progress",r),l.addEventListener("load",(e=>{let s=null;try{s=JSON.parse(e.target.response)}catch{s={status:"error",message:"The file could not be uploaded"}}"error"===s.status?(o.error(l,t,s),n(s)):(o.progress(l,t,100),o.success(l,t,s),i(s))})),l.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);o.progress(l,t,100),o.error(l,t,i),n(i)})),l.open(o.method,o.url,!0);for(const t in o.headers)l.setRequestHeader(t,o.headers[t]);l.send(a)}));function Dr(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function jr(t={},e={}){e instanceof URL&&(e=e.search);const i=new URLSearchParams(e);for(const[n,s]of Object.entries(t))null!==s&&i.set(n,s);return i}function Er(t="",e={},i){return(t=Pr(t,i)).search=jr(e,t.search),t}function Lr(t){return null!==String(t).match(/^https?:\/\//)}function Tr(t){return Pr(t).origin===window.location.origin}function Br(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function qr(t,e){return!0===Lr(t)?t:(e=e??Dr(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Pr(t,e){return t instanceof URL?t:new URL(qr(t,e))}const Nr={base:Dr,buildQuery:jr,buildUrl:Er,isAbsolute:Lr,isSameOrigin:Tr,isUrl:Br,makeAbsolute:qr,toObject:Pr},zr={install(t){t.prototype.$helper={array:Xa,clipboard:Za,clone:wt.clone,color:Qa,embed:ir,focus:ur,isComponent:dr,isUploadEvent:pr,debounce:Nt,field:sr,file:rr,keyboard:hr,link:kr,object:wt,page:br,pad:Ar.pad,ratio:vr,slug:Ar.slug,sort:Ka,string:Ar,upload:Ir,url:Nr,uuid:Ar.uuid},t.prototype.$esc=Ar.escapeHTML}},Fr={install(t){const e=(t,e,i)=>{!0!==i.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Yr={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const i of e){const e=`$${i}`;t.prototype[e]=window.panel[e]=window.panel[i]}window.panel.$vue=window.panel.app}},Rr=/^#?([\da-f]{3}){1,2}$/i,Ur=/^#?([\da-f]{4}){1,2}$/i,Hr=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Vr=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Kr(t){return"string"==typeof t&&(Rr.test(t)||Ur.test(t))}function Wr(t){return vt(t)&&"r"in t&&"g"in t&&"b"in t}function Jr(t){return vt(t)&&"h"in t&&"s"in t&&"l"in t}function Gr({h:t,s:e,v:i,a:n}){if(0===i)return{h:t,s:0,l:0,a:n};if(0===e&&1===i)return{h:t,s:1,l:1,a:n};const s=i*(2-e)/2;return{h:t,s:e=i*e/(1-Math.abs(2*s-1)),l:s,a:n}}function Xr({h:t,s:e,l:i,a:n}){const s=e*(i<.5?i:1-i);return{h:t,s:e=0===s?0:2*s/(i+s),v:i+s,a:n}}function Zr(t){if(!0===Rr.test(t)||!0===Ur.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Rr.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Qr({r:t,g:e,b:i,a:n=1}){let s="#"+(1<<24|t<<16|e<<8|i).toString(16).slice(1);return n<1&&(s+=(256|Math.round(255*n)).toString(16).slice(1)),s}function tu({h:t,s:e,l:i,a:n}){const s=e*Math.min(i,1-i),o=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:n}}function eu({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i),l=1-Math.abs(s+s-o-1);let a=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:l?o/l:0,l:(s+s-o)/2,a:n}}function iu(t){return Qr(tu(t))}function nu(t){return eu(Zr(t))}function su(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function ou(t,e){if(!0===Kr(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Zr(t);case"hsl":return nu(t);case"hsv":return Xr(nu(t))}if(!0===Wr(t))switch(e){case"hex":return Qr(t);case"rgb":return t;case"hsl":return eu(t);case"hsv":return function({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i);let l=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return l=60*(l<0?l+6:l),{h:l,s:s&&o/s,v:s,a:n}}(t)}if(!0===Jr(t))switch(e){case"hex":return iu(t);case"rgb":return tu(t);case"hsl":return t;case"hsv":return Xr(t)}if(!0===function(t){return vt(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return iu(Gr(t));case"rgb":return function({h:t,s:e,v:i,a:n}){const s=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return{r:255*s(5),g:255*s(3),b:255*s(1),a:n}}(t);case"hsl":return Gr(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function lu(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Kr(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Hr)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Vr)){let[t,i,n,s,o]=e.slice(1);const l={h:su(t,i),s:Number(n)/100,l:Number(s)/100,a:Number(o||1)};return"%"===e[6]&&(l.a=l.a/100),l}return null}const au={convert:ou,parse:lu,parseAs:function(t,e){const i=lu(t);return i&&e?ou(i,e):i},toString:function(t,e,i=!0){var n,s;let o=t;if("string"==typeof o&&(o=lu(t)),o&&e&&(o=ou(o,e)),!0===Kr(o))return!0!==i&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Wr(o)){const t=o.r.toFixed(),e=o.g.toFixed(),s=o.b.toFixed(),l=null==(n=o.a)?void 0:n.toFixed(2);return i&&l&&l<1?`rgb(${t} ${e} ${s} / ${l})`:`rgb(${t} ${e} ${s})`}if(!0===Jr(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),n=(100*o.l).toFixed(),l=null==(s=o.a)?void 0:s.toFixed(2);return i&&l&&l<1?`hsl(${t} ${e}% ${n}% / ${l})`:`hsl(${t} ${e}% ${n}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};T.extend(B),T.extend(((t,e,i)=>{i.interpret=(t,e="date")=>{const n={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const s in n[e]){const o=i(t,s,n[e][s]);if(!0===o.isValid())return o}return null}})),T.extend(((t,e,i)=>{const n=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(n(t))},i.iso=function(t,e){e&&(e=n(e)),e??(e=[n("datetime"),n("date"),n("time")]);const s=i(t,e);return s&&s.isValid()?s:null}})),T.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let i=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const n of e)i=i.set(n,t.get(n));return i}})),T.extend(((t,e,i)=>{i.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const i={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const n=this.pattern.indexOf(t);return{index:e,unit:Object.keys(i)[Object.values(i).findIndex((e=>e.includes(t)))],start:n,end:n+(t.length-1)}}))}at(t,e=t){const i=this.parts.filter((i=>i.start<=t&&i.end>=e-1));return i[0]?i[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(i,t)})),T.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const i=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===i.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let n=this.clone();const s=i.indexOf(t),o=i.slice(0,s),l=o.pop();for(const a of o)n=n.startOf(a);if(l){const e={month:12,date:n.daysInMonth(),hour:24,minute:60,second:60}[l];Math.round(n.get(l)/e)*e===e&&(n=n.add(1,"date"===t?"day":t)),n=n.startOf(t)}return n=n.set(t,Math.round(n.get(t)/e)*e),n}})),T.extend(((t,e,i)=>{e.prototype.validate=function(t,e,n="day"){if(!this.isValid())return!1;if(!t)return!0;t=i.iso(t);const s={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,n)||this[s](t,n)}}));const ru={install(t){t.prototype.$library={autosize:q,colors:au,dayjs:T}}},uu=()=>({close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},isOpen:"true"!==sessionStorage.getItem("kirby$activation$card"),open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}}),cu=t=>({async changeName(e,i,n){return t.patch(this.url(e,i,"name"),{name:n})},async delete(e,i){return t.delete(this.url(e,i))},async get(e,i,n){let s=await t.get(this.url(e,i),n);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,i){return"/"+this.url(t,e,i)},async update(e,i,n){return t.patch(this.url(e,i),n)},url(t,e,i){let n="files/"+this.id(e);return t&&(n=t+"/"+n),i&&(n+="/"+i),n}}),du=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,i){return t.get("pages/"+this.id(e)+"/blueprints",{section:i})},async changeSlug(e,i){return t.patch("pages/"+this.id(e)+"/slug",{slug:i})},async changeStatus(e,i,n){return t.patch("pages/"+this.id(e)+"/status",{status:i,position:n})},async changeTemplate(e,i){return t.patch("pages/"+this.id(e)+"/template",{template:i})},async changeTitle(e,i){return t.patch("pages/"+this.id(e)+"/title",{title:i})},async children(e,i){return t.post("pages/"+this.id(e)+"/children/search",i)},async create(e,i){return null===e||"/"===e?t.post("site/children",i):t.post("pages/"+this.id(e)+"/children",i)},async delete(e,i){return t.delete("pages/"+this.id(e),i)},async duplicate(e,i,n){return t.post("pages/"+this.id(e)+"/duplicate",{slug:i,children:n.children??!1,files:n.files??!1})},async get(e,i){let n=await t.get("pages/"+this.id(e),i);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,i){return t.post("pages/"+this.id(e)+"/files/search",i)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,i){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",i):t.post("site/children/search?select=id,title,hasChildren",i)},async update(e,i){return t.patch("pages/"+this.id(e),i)},url(t,e){let i=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(i+="/"+e),i}});class pu extends Error{constructor(t,{request:e,response:i,cause:n}){super(i.json.message??t,{cause:n}),this.request=e,this.response=i}state(){return this.response.json}}class hu extends pu{}class mu extends pu{state(){return{message:this.message,text:this.response.text}}}const fu=t=>(window.location.href=qr(t),!1),gu=async(t,e={})=>{var i;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((i=e.body)instanceof HTMLFormElement&&(i=new FormData(i)),i instanceof FormData&&(i=Object.fromEntries(i)),"object"==typeof i?JSON.stringify(i):i),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(i=e.globals,!!i&&(!1===Array.isArray(i)?String(i):i.join(","))),"x-fiber-referrer":e.referrer??!1,...$t(t)};var i})(e.headers,e),e.url=Er(t,e.query);const n=new Request(e.url,e);return!1===Tr(n.url)?fu(n.url):await ku(n,await fetch(n))},ku=async(t,e)=>{var i;if(!1===e.headers.get("Content-Type").includes("application/json"))return fu(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(n){throw new mu("Invalid JSON response",{cause:n,request:t,response:e})}if(401===e.status)throw new hu("Unauthenticated",{request:t,response:e});if("error"===(null==(i=e.json)?void 0:i.status))throw e.json;if(!1===e.ok)throw new pu(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},bu=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,i)=>t.get("users/"+e+"/blueprints",{section:i}),changeEmail:async(e,i)=>t.patch("users/"+e+"/email",{email:i}),changeLanguage:async(e,i)=>t.patch("users/"+e+"/language",{language:i}),changeName:async(e,i)=>t.patch("users/"+e+"/name",{name:i}),changePassword:async(e,i)=>t.patch("users/"+e+"/password",{password:i}),changeRole:async(e,i)=>t.patch("users/"+e+"/role",{role:i}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,i)=>t.get("users/"+e,i),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description??`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,i)=>t.patch("users/"+e,i),url(t,e){let i=t?"users/"+t:"users";return e&&(i+="/"+e),i}}),vu=t=>{const e={csrf:t.system.csrf,endpoint:Cr(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},i=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(n,s={},o=!1)=>{const l=n+"/"+JSON.stringify(s);e.requests.push(l),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,i={})=>{i={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...$t(i.headers??{})},...i},t.methodOverwrite&&"GET"!==i.method&&"POST"!==i.method&&(i.headers["x-http-method-override"]=i.method,i.method="POST"),i.url=Cr(t.endpoint,"/")+"/"+_r(e,"/");const n=new Request(i.url,i),{response:s}=await ku(n,await fetch(n));let o=s.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(n,s)}finally{i(),e.requests=e.requests.filter((t=>t!==l)),0===e.requests.length&&(t.isLoading=!1)}},e.auth=(t=>({async login(e){const i={long:e.remember??!1,email:e.email,password:e.password};return t.post("auth/login",i)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"DELETE",s))(e),e.files=cu(e),e.get=(t=>async(e,i,n,s=!1)=>(i&&(e+="?"+Object.keys(i).filter((t=>void 0!==i[t]&&null!==i[t])).map((t=>t+"="+i[t])).join("&")),t.request(e,Object.assign(n??{},{method:"GET"}),s)))(e),e.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,i)=>t.patch("languages/"+e,i)}))(e),e.pages=du(e),e.patch=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"PATCH",s))(e),e.post=(t=>async(e,i,n,s="POST",o=!1)=>t.request(e,Object.assign(n??{},{method:s,body:JSON.stringify(i)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(e),e.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=bu(e),i(),e},yu=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==vt(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),$u=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===vt(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),wu=(t,e,i)=>{const n=$u(e,i);return{...n,...yu(),async load(e,i={}){return!0!==i.silent&&(this.isLoading=!0),await t.open(e,i),this.isLoading=!1,this.addEventListeners(i.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===Br(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,i={}){var n;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(n=this.props)?void 0:n.value)??{};try{return await t.post(this.path,e,i)}catch(s){t.error(s)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const i=(await t.get(e.url,e))["$"+this.key()];if(i&&i.component===this.component)return this.props=i.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return n.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},xu=(t,e,i)=>{const n=wu(t,e,i);return{...n,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){ur(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,i){return!1===this.isOpen&&t.notification.close(),await n.open.call(this,e,i),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const i=await this.post(t,e);return!1===vt(i)?i:this.success(i["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successDispatch(e){if(!1!==vt(e.dispatch))for(const i in e.dispatch){const n=e.dispatch[i];t.app.$store.dispatch(i,!0===Array.isArray(n)?[...n]:n)}},successEvents(e){if(e.event){const i=Array.wrap(e.event);for(const n of i)"string"==typeof n&&t.events.emit(n,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const i=e.route??e.redirect;return!!i&&("string"==typeof i?t.open(i):t.open(i.url,i.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},_u=t=>{t.events.on("dialog.save",(e=>{var i;null==(i=null==e?void 0:e.preventDefault)||i.call(e),t.dialog.submit()}));const e=xu(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return{...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,i={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,i))},async openComponent(i){t.deprecated("Dialog components should no longer be used in your templates");const n=await e.open.call(this,{component:i.$options._componentTag,legacy:!0,props:{...i.$attrs,...i.$props},ref:i}),s=this.listeners();for(const t in s)i.$on(t,s[t]);return i.visible=!0,n}}},Cu=()=>({...$u("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Su=()=>({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),Ou=t=>{const e=xu(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:Su(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,i={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,i),this.tab(t.tab);const n=this.state();return!0===t.replace?this.history.replace(-1,n):this.history.add(n),this.focus(),n},set(t){return e.set.call(this,t),this.id=this.id??Mr(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}}},Mu=t=>{const e=wu(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},open(t,i={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,i)},openAsync(t,e={}){return async i=>{await this.open(t,e);const n=this.options();if(0===n.length)throw Error("The dropdown is empty");i(n)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const i="string"==typeof e.dialog?e.dialog:e.dialog.url,n="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(i,n)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Au=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(i=>{e.emit(t.context+".save",i)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const i={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let i=[t];(e.metaKey||e.ctrlKey)&&i.push("cmd"),!0===e.altKey&&i.push("alt"),!0===e.shiftKey&&i.push("shift");let n=e.key?xr(e.key):null;const s={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return s[n]&&(n=s[n]),n&&!1===["alt","control","shift","meta"].includes(n)&&i.push(n),i.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in i.document)document.addEventListener(t,this[t].bind(this),i.document[t]);for(const t in i.window)window.addEventListener(t,this[t].bind(this),i.window[t])},unsubscribe(){for(const t in i.document)document.removeEventListener(t,this[t]);for(const t in i.window)window.removeEventListener(t,this[t])},$on(...t){window.panel.deprecated("`events.$on` will be removed in a future version. Use `events.on` instead."),e.on(...t)},$emit(...t){window.panel.deprecated("`events.$emit` will be removed in a future version. Use `events.emit` instead."),e.emit(...t)},$off(...t){window.panel.deprecated("`events.$off` will be removed in a future version. Use `events.off` instead."),e.off(...t)}}},Iu={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Du=(t={})=>({...$u("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof hu&&t.user.id)return t.redirect("logout");if(e instanceof mu)return this.fatal(e);if(e instanceof pu){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof mu?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:Iu}),ju=()=>({...$u("language",{code:null,default:!1,direction:"ltr",name:null,rules:null}),get isDefault(){return this.default}}),Eu=(t,e,i)=>{if(!i.template&&!i.render&&!i.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(i=Lu(t,e,i)).template&&(i.render=null),i=Tu(i),!0===dr(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,i),i},Lu=(t,e,i)=>"string"!=typeof(null==i?void 0:i.extends)?i:!1===dr(i.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${i.extends}"`),i.extends=null,i):(i.extends=t.options.components[i.extends].extend({options:i,components:{...t.options.components,...i.components??{}}}),i),Tu=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:Et,drawer:fe,section:Nl};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},Bu=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const i of e)t.use(i);return e})(t,e.use),e.components=((t,e)=>{if(!1===vt(e))return;const i={};for(const[s,o]of Object.entries(e))try{i[s]=Eu(t,s,o)}catch(n){window.console.warn(n.message)}return i})(t,e.components),e),qu=t=>{var e;const i=$u("menu",{entries:[],hover:!1,isOpen:!1}),n=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),s={...i,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===n.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===n.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===n.matches)return!1;this.close()},open(){this.isOpen=!0,!1===n.matches&&localStorage.removeItem("kirby$menu")},resize(){if(n.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}};return t.events.on("keydown.esc",s.escape.bind(s)),t.events.on("click",s.blur.bind(s)),null==n||n.addEventListener("change",s.resize.bind(s)),s},Pu=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,i,n){var s;if(null==(s=this.controller)||s.abort(),this.controller=new AbortController,i.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:s}=await t.get(`/search/${e}`,{query:{query:i,...n},signal:this.controller.signal});return s}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Nu=()=>{const t=$u("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,i=null){if("string"!=typeof t)return;const n=this.data[t]??i;return"string"!=typeof n?n:Sr(n,e)}}};const zu=t=>{const e=$u("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return{...e,...yu(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:or(t.name),filename:t.name,id:Mr(),model:null,name:lr(t.name),niceSize:ar(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,i){e instanceof FileList?(this.set(i),this.select(e)):this.set(e);const n={component:"k-upload-dialog",props:{preview:this.preview},on:{cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(n.component="k-upload-replace-dialog",n.props.original=this.replacing),t.dialog.open(n)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,i){this.pick({...i,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");const i=[];for(const n of this.files){if(!0===n.completed)continue;if(!1===this.hasUniqueName(n)){n.error=t.t("error.file.name.unique");continue}n.error=null,n.progress=0;const s={...this.attributes};i.push((async()=>await this.upload(n,s)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let i=0,n=0;return new Promise((s=>{const o=e=>n=>{t[e]=n,i--,l()},l=()=>{if(i{e.progress=n}});e.completed=!0,e.model=n.data}catch(n){t.error(n,!1),e.error=n.message,e.progress=0}}}},Fu=t=>{const e=wu(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(i){e.set.call(this,i),t.title=this.title;const n=this.url().toString();window.location.toString()!==n&&(window.history.pushState(null,null,n),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}}},Yu={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Ru=["dialog","drawer"],Uu=["dropdown","language","menu","notification","system","translation","user"],Hu={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=uu(),this.drag=Cu(),this.events=Au(this),this.searcher=Pu(this),this.upload=zu(this),this.language=ju(),this.menu=qu(this),this.notification=Du(this),this.system=$u("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Nu(),this.user=$u("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Mu(this),this.view=Fu(this),this.drawer=Ou(this),this.dialog=_u(this),this.redirect=fu,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=Bu(window.Vue,t),this.set(window.fiber),this.api=vu(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:i}=await this.request(t,{method:"GET",...e});return(null==i?void 0:i.json)??{}},async open(t,e={}){try{if(!1===Br(t))this.set(t);else{this.isLoading=!0;const i=await this.get(t,e);this.set(i),this.isLoading=!1}return this.state()}catch(i){return this.error(i)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},i={}){const{response:n}=await this.request(t,{method:"POST",body:e,...i});return n.json},async request(t,e={}){return gu(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,i){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,i)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in Yu){const i=t[e]??this[e]??Yu[e];typeof i==typeof Yu[e]&&(this[e]=i)}for(const e of Uu)(vt(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Ru)if(!0===vt(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===vt(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===vt(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in Yu)t[e]=this[e]??Yu[e];for(const e of Uu)t[e]=this[e].state();for(const e of Ru)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===wr(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},i)=>Er(t,e,i)},Vu=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Ku={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>yt(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>((e=e??t.current)&&!1===e.includes("?language=")&&(e+="?language="+window.panel.language.code),e),model:(t,e)=>i=>(i=e.id(i),!0===e.exists(i)?t.models[i]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>structuredClone(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>structuredClone(e.model(t).changes)},mutations:{CLEAR(t){for(const e in t.models)t.models[e].changes={};for(const e in localStorage)e.startsWith("kirby$content$")&&localStorage.removeItem(e)},CREATE(t,[e,i]){if(!i)return!1;let n=t.models[e]?t.models[e].changes:i.changes;Vue.set(t.models,e,{api:i.api,originals:i.originals,changes:n??{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,i]){const n=structuredClone(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,i,n);const s=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+i,s)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,i,n]){if(!t.models[e])return!1;void 0===n&&(n=null),n=structuredClone(n);const s=JSON.stringify(n);JSON.stringify(t.models[e].originals[i]??null)==s?Vue.del(t.models[e].changes,i):Vue.set(t.models[e].changes,i,n),Vu(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){for(const e in localStorage)if(e.startsWith("kirby$content$")){const i=e.split("kirby$content$")[1],n=localStorage.getItem("kirby$content$"+i);t.commit("CREATE",[i,JSON.parse(n)])}else if(e.startsWith("kirby$form$")){const i=e.split("kirby$form$")[1],n=localStorage.getItem("kirby$form$"+i);let s=null;try{s=JSON.parse(n)}catch{}if(!s||!s.api)return localStorage.removeItem("kirby$form$"+i),!1;const o={api:s.api,originals:s.originals,changes:s.values};t.commit("CREATE",[i,o]),Vu(i,o),localStorage.removeItem("kirby$form$"+i)}},clear(t){t.commit("CLEAR")},create(t,e){const i=structuredClone(e.content);if(Array.isArray(e.ignore))for(const s of e.ignore)delete i[s];e.id=t.getters.id(e.id);const n={api:e.api,originals:i,changes:{}};t.commit("CREATE",[e.id,n]),t.dispatch("current",e.id)},current(t,e){e=t.getters.id(e),t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,i]){e=t.getters.id(e),i=t.getters.id(i),t.commit("MOVE",[e,i])},remove(t,e){e=t.getters.id(e),t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=t.getters.id(e),t.commit("REVERT",e)},async save(t,e){if(e=t.getters.id(e),t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const i=t.getters.model(e),n={...i.originals,...i.changes};try{await window.panel.api.patch(i.api,n),t.commit("CREATE",[e,{...i,originals:n}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,i,n]){if(n=n??t.state.current,null===e)for(const s in i)t.commit("UPDATE",[n,s,i[s]]);else t.commit("UPDATE",[n,e,i])}}},Wu={namespaced:!0,actions:{close(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.close(e)},goto(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)},open(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)}}},Ju={namespaced:!0,actions:{close(){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.close()},deprecated(t,e){window.panel.deprecated("`$store.notification.deprecated` will be removed in a future version. Use `$panel.deprecated` instead."),window.panel.notification.deprecated(e)},error(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.error(e)},open(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.open(e)},success(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.success(e)}}};Vue.use(N);const Gu=new N.Store({strict:!1,actions:{dialog(t,e){window.panel.deprecated("`$store.dialog` will be removed in a future version. Use `$panel.dialog.open()` instead."),window.panel.dialog.open(e)},drag(t,e){window.panel.deprecated("`$store.drag` will be removed in a future version. Use `$panel.drag.start(type, data)` instead."),window.panel.drag.start(...e)},fatal(t,e){window.panel.deprecated("`$store.fatal` will be removed in a future version. Use `$panel.notification.fatal()` instead."),window.panel.notification.fatal(e)},isLoading(t,e){window.panel.deprecated("`$store.isLoading` will be removed in a future version. Use `$panel.isLoading` instead."),window.panel.isLoading=e},navigate(){window.panel.deprecated("`$store.navigate` will be removed in a future version."),window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:Ku,drawers:Wu,notification:Ju}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(zr),Vue.use(ru),Vue.use(z),Vue.use(Ha),window.panel=Vue.prototype.$panel=Hu.create(window.panel.plugins),Vue.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),Vue.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),Vue.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:Gu,render:()=>Vue.h(R)}),Vue.use(Fr),Vue.use(Va),Vue.use(Yr),!1===CSS.supports("container","foo / inline-size")&&Y((()=>import("./container-query-polyfill.modern.min.js")),[],import.meta.url),window.panel.app.$mount("#app");export{ut as n}; +import{v as t,I as e,P as i,S as n,F as s,N as o,s as l,l as a,w as r,a as u,b as c,c as d,e as p,t as h,d as m,f,g,h as k,i as b,k as v,D as y,j as $,E as w,m as x,n as _,o as C,T as S,u as O,p as M,q as A,r as I,x as D,y as j,z as E,A as L,B as T,C as B,G as q,H as P,V as N,J as z}from"./vendor.min.js";const F={},Y=function(t,e,i){let n=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=(null==s?void 0:s.nonce)||(null==s?void 0:s.getAttribute("nonce"));n=Promise.all(e.map((e=>{if(e=function(t,e){return new URL(t,e).href}(e,i),e in F)return;F[e]=!0;const n=e.endsWith(".css"),s=n?'[rel="stylesheet"]':"";if(!!i)for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.href===e&&(!n||"stylesheet"===s.rel))return}else if(document.querySelector(`link[href="${e}"]${s}`))return;const l=document.createElement("link");return l.rel=n?"stylesheet":"modulepreload",n||(l.as="script",l.crossOrigin=""),l.href=e,o&&l.setAttribute("nonce",o),document.head.appendChild(l),n?new Promise(((t,i)=>{l.addEventListener("load",t),l.addEventListener("error",(()=>i(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}return n.then((()=>t())).catch((t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}))},R={created(){this.$panel.events.subscribe();for(const t of this.$panel.plugins.created)t(this);this.$panel.events.on("popstate",(()=>{this.$panel.open(window.location.href)})),this.$panel.events.on("drop",(()=>{this.$panel.drag.stop()})),this.$store.dispatch("content/init")},destroyed(){this.$panel.events.unsubscribe()},render(t){if(this.$panel.view.component)return t(this.$panel.view.component,{key:this.$panel.view.component,props:this.$panel.view.props})}},U={props:{after:String}},H={props:{autocomplete:String}},V={props:{autofocus:Boolean}},K={props:{before:String}},W={props:{disabled:Boolean}},J={props:{font:String}},G={props:{help:String}},X={props:{id:{type:[Number,String],default(){return this._uid}}}},Z={props:{invalid:Boolean}},Q={props:{label:String}},tt={props:{layout:{type:String,default:"list"}}},et={props:{maxlength:Number}},it={props:{minlength:Number}},nt={props:{name:[Number,String]}},st={props:{options:{default:()=>[],type:Array}}},ot={props:{pattern:String}},lt={props:{placeholder:[Number,String]}},at={props:{required:Boolean}},rt={props:{spellcheck:{type:Boolean,default:!0}}};function ut(t,e,i,n,s,o,l,a){var r,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),l?(r=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},u._ssrRegister=r):s&&(r=a?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(t,e){return r.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,r):[r]}return{exports:t,options:u}}const ct={mixins:[tt],inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},fields:{type:Object,default:()=>({})},items:{type:Array,default:()=>[]},link:{type:Boolean,default:!0},sortable:Boolean,size:{type:String,default:"medium"},theme:String}};const dt=ut({mixins:[ct],props:{image:{type:[Object,Boolean],default:()=>({})}},emits:["change","hover","item","option","sort"],computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,fields:this.fields,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$panel.drag.start("text",e)},onOption(t,e,i){this.$emit("option",t,e,i)},imageOptions(t){let e=this.image,i=t.image;return!1!==e&&!1!==i&&("object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),{...i,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption},scopedSlots:t._u([t.$scopedSlots.options?{key:"options",fn:function({row:e,rowIndex:i}){return[t._t("options",null,null,{item:e,index:i})]}}:null],null,!0)},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{"data-layout":t.layout,"data-size":t.size,handle:!0,list:t.items,options:t.dragOptions},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(i,n){return[t._t("default",(function(){return[e("k-item",t._b({key:i.id??n,class:{"k-draggable-item":t.sortable&&i.sortable},attrs:{image:t.imageOptions(i),layout:t.layout,link:!!t.link&&i.link,sortable:t.sortable&&i.sortable,theme:t.theme,width:i.column},on:{click:function(e){return t.$emit("item",i,n)},drag:function(e){return t.onDragStart(e,i.dragText)},option:function(e){return t.onOption(e,i,n)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,i,n)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:i,index:n})]},proxy:!0}],null,!0)},"k-item",i,!1))]}),null,{item:i,itemIndex:n})]}))],2)}),[],!1,null,null,null,null).exports;const pt=ut({mixins:[ct],props:{empty:{type:Object,default:()=>({})},help:String,pagination:{type:[Boolean,Object],default:!1}},emits:["action","change","empty","item","option","paginate","sort"],computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[0===t.items.length?e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})):e("k-items",t._b({on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,index:i}){return[t._t("options",null,null,{item:e,index:i})]}}],null,!0)},"k-items",{columns:t.columns,fields:t.fields,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable,theme:t.theme},!1)),t.help||t.hasPagination?e("footer",{staticClass:"k-collection-footer"},[e("k-text",{staticClass:"k-help k-collection-help",attrs:{html:t.help}}),t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ht=ut({mixins:[tt],props:{text:String,icon:String},emits:["click"],computed:{attrs(){const t={button:void 0!==this.$listeners.click,icon:this.icon,theme:"empty"};return"cardlets"!==this.layout&&"cards"!==this.layout||(t.align="center",t.height="var(--item-height-cardlet)"),t}}},(function(){var t=this;return(0,t._self._c)("k-box",t._b({staticClass:"k-empty",nativeOn:{click:function(e){return t.$emit("click",e)}}},"k-box",t.attrs,!1),[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2)}),[],!1,null,null,null,null).exports,mt={mixins:[tt],props:{image:[Object,Boolean],width:{type:String,default:"1/1"}}};const ft=ut({mixins:[mt],inheritAttrs:!1,computed:{attrs(){return{back:this.image.back??"gray-500",cover:!0,...this.image,ratio:"list"===this.layout?"auto":this.image.ratio,size:this.sizes}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image.src?e("k-image-frame",t._b({staticClass:"k-item-image"},"k-image-frame",t.attrs,!1)):e("k-icon-frame",t._b({staticClass:"k-item-image"},"k-icon-frame",t.attrs,!1))}),[],!1,null,null,null,null).exports;const gt=ut({mixins:[mt,tt],inheritAttrs:!1,props:{buttons:{type:Array,default:()=>[]},data:Object,info:String,link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,theme:String},emits:["action","click","drag","option"],computed:{hasFigure(){return!1!==this.image&&this.$helper.object.length(this.image)>0},title(){return this.$helper.string.stripHTML(this.$helper.string.unescapeHTML(this.text)).trim()}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t,e=this,i=e._self._c;return i("div",e._b({staticClass:"k-item",class:!!e.layout&&"k-"+e.layout+"-item",attrs:{"data-has-image":e.hasFigure,"data-layout":e.layout,"data-theme":e.theme},on:{click:function(t){return e.$emit("click",t)},dragstart:function(t){return e.$emit("drag",t)}}},"div",e.data,!1),[e._t("image",(function(){return[e.hasFigure?i("k-item-image",{attrs:{image:e.image,layout:e.layout,width:e.width}}):e._e()]})),e.sortable?i("k-sort-handle",{staticClass:"k-item-sort-handle",attrs:{tabindex:"-1"}}):e._e(),i("div",{staticClass:"k-item-content"},[i("h3",{staticClass:"k-item-title",attrs:{title:e.title}},[!1!==e.link?i("k-link",{attrs:{target:e.target,to:e.link}},[i("span",{domProps:{innerHTML:e._s(e.text??"–")}})]):i("span",{domProps:{innerHTML:e._s(e.text??"–")}})],1),e.info?i("p",{staticClass:"k-item-info",domProps:{innerHTML:e._s(e.info)}}):e._e()]),i("div",{staticClass:"k-item-options",attrs:{"data-only-option":!(null==(t=e.buttons)?void 0:t.length)||!e.options&&!e.$slots.options}},[e._l(e.buttons,(function(t,n){return i("k-button",e._b({key:"button-"+n},"k-button",t,!1))})),e._t("options",(function(){return[e.options?i("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:e.options},on:{option:e.onOption}}):e._e()]}))],2)],2)}),[],!1,null,null,null,null).exports,kt={install(t){t.component("k-collection",pt),t.component("k-empty",ht),t.component("k-item",gt),t.component("k-item-image",ft),t.component("k-items",dt)}};const bt=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-dialog-body"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;function vt(t){return"object"==typeof t&&(null==t?void 0:t.constructor)===Object}function yt(t){return Object.keys(t??{}).length}function $t(t){return Object.keys(t).reduce(((e,i)=>(e[i.toLowerCase()]=t[i],e)),{})}const wt={clone:function(t){if(void 0!==t)return structuredClone(t)},isEmpty:function(t){return null==t||""===t||(!(!vt(t)||0!==yt(t))||0===t.length)},isObject:vt,length:yt,merge:function t(e,i={}){for(const n in i)i[n]instanceof Object&&Object.assign(i[n],t(e[n]??{},i[n]));return Object.assign(e??{},i),e},same:function(t,e){return JSON.stringify(t)===JSON.stringify(e)},toLowerKeys:$t},xt={props:{cancelButton:{default:!0,type:[Boolean,String,Object]},disabled:{default:!1,type:Boolean},icon:{default:"check",type:String},submitButton:{type:[Boolean,String,Object],default:!0},theme:{default:"positive",type:String}}};const _t=ut({mixins:[xt],emits:["cancel"],computed:{cancel(){return this.button(this.cancelButton,{click:()=>this.$emit("cancel"),class:"k-dialog-button-cancel",icon:"cancel",text:this.$t("cancel"),variant:"filled"})},submit(){return this.button(this.submitButton,{class:"k-dialog-button-submit",disabled:this.disabled||this.$panel.dialog.isLoading,icon:this.icon,text:this.$t("confirm"),theme:this.theme,type:"submit",variant:"filled"})}},methods:{button:(t,e)=>"string"==typeof t?{...e,text:t}:!1!==t&&(!1===vt(t)?e:{...e,...t})}},(function(){var t=this,e=t._self._c;return e("k-button-group",{staticClass:"k-dialog-buttons"},[t.cancel?e("k-button",t._b({},"k-button",t.cancel,!1)):t._e(),t.submit?e("k-button",t._b({attrs:{icon:t.$panel.dialog.isLoading?"loader":t.submit.icon}},"k-button",t.submit,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Ct={props:{empty:{default:()=>window.panel.$t("dialog.fields.empty"),type:String},fields:{default:()=>[],type:[Array,Object]},novalidate:{default:!0,type:Boolean},value:{default:()=>({}),type:Object}}};const St=ut({mixins:[Ct],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-dialog-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports;const Ot=ut({},(function(){return(0,this._self._c)("footer",{staticClass:"k-dialog-footer"},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const Mt=ut({},(function(){var t=this,e=t._self._c;return"dialog"===t.$panel.notification.context?e("k-notification",{staticClass:"k-dialog-notification"}):t._e()}),[],!1,null,null,null,null).exports;const At=ut({props:{autofocus:{default:!0,type:Boolean},placeholder:{type:String},value:{type:String}},emits:["search"]},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:t.autofocus,placeholder:t.placeholder,value:t.value,icon:"search",type:"search"},on:{input:function(e){return t.$emit("search",e)}}})}),[],!1,null,null,null,null).exports,It={props:{empty:{type:String,default:()=>window.panel.$t("dialog.text.empty")},text:{type:String}}};const Dt=ut({mixins:[It]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,jt={install(t){t.component("k-dialog-body",bt),t.component("k-dialog-buttons",_t),t.component("k-dialog-fields",St),t.component("k-dialog-footer",Ot),t.component("k-dialog-notification",Mt),t.component("k-dialog-search",At),t.component("k-dialog-text",Dt)}},Et={mixins:[xt],props:{size:{default:"default",type:String},visible:{default:!1,type:Boolean}},emits:["cancel","close","input","submit","success"],methods:{cancel(){this.$emit("cancel")},close(){this.$emit("close")},error(t){this.$panel.notification.error(t)},focus(t){this.$panel.dialog.focus(t)},input(t){this.$emit("input",t)},open(){this.$panel.dialog.open(this)},submit(){this.$emit("submit",this.value)},success(t){this.$emit("success",t)}}};const Lt=ut({mixins:[Et]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"dialog"}},[e("form",{staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-has-footer":t.cancelButton||t.submitButton,"data-size":t.size,method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[t._t("header",(function(){return[e("k-dialog-notification")]})),t.$slots.default?e("k-dialog-body",[t._t("default")],2):t._e(),t._t("footer",(function(){return[t.cancelButton||t.submitButton?e("k-dialog-footer",[e("k-dialog-buttons",{attrs:{"cancel-button":t.cancelButton,disabled:t.disabled,icon:t.icon,"submit-button":t.submitButton,theme:t.theme},on:{cancel:function(e){return t.$emit("cancel")}}})],1):t._e()]}))],2)]):t._e()}),[],!1,null,null,null,null).exports;const Tt=ut({mixins:[Et],props:{cancelButton:{default:!1},changes:{type:Array},loading:{type:Boolean},size:{default:"medium"},submitButton:{default:!1}},computed:{ids(){return Object.keys(this.store).filter((t=>{var e;return this.$helper.object.length(null==(e=this.store[t])?void 0:e.changes)>0}))},store(){return this.$store.state.content.models}},watch:{ids:{handler(t){this.$panel.dialog.refresh({method:"POST",body:{ids:t}})},immediate:!0}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-changes-dialog"},"k-dialog",t.$props,!1),[!1===t.loading?[e("k-headline",[t._v(t._s(t.$t("lock.unsaved")))]),t.changes.length?e("k-items",{attrs:{items:t.changes,layout:"list"}}):e("k-empty",{attrs:{icon:"edit-line"}},[t._v(t._s(t.$t("lock.unsaved.empty")))])]:[e("k-icon",{attrs:{type:"loader"}})]],2)}),[],!1,null,null,null,null).exports;const Bt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("email"),type:"email",icon:"email"},title:{label:window.panel.$t("title"),type:"text",icon:"title"}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value}}},methods:{submit(){this.$emit("submit",this.values)}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const qt=ut({mixins:[Et],props:{details:[Object,Array],message:String,size:{default:"medium",type:String}},emits:["cancel"],computed:{detailsList(){return Array.fromObject(this.details)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:t.size,visible:t.visible},on:{cancel:function(e){return t.$emit("cancel")}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(i,n){return[e("dt",{key:"detail-label-"+n},[t._v(" "+t._s(i.label)+" ")]),e("dd",{key:"detail-message-"+n},["object"==typeof i.message?[e("ul",t._l(i.message,(function(i,n){return e("li",{key:n},[t._v(" "+t._s(i)+" ")])})),0)]:[t._v(" "+t._s(i.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Pt=ut({},(function(){var t=this;return(0,t._self._c)(t.$panel.dialog.component,t._g(t._b({key:t.$panel.dialog.timestamp,tag:"component",attrs:{visible:!0}},"component",t.$panel.dialog.props,!1),t.$panel.dialog.listeners()))}),[],!1,null,null,null,null).exports,Nt=(t,e)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout((()=>t.apply(void 0,n)),e)}},zt={props:{delay:{default:200,type:Number},hasSearch:{default:!0,type:Boolean}},data:()=>({query:""}),watch:{query(){!1!==this.hasSearch&&this.search()}},created(){this.search=Nt(this.search,this.delay)},methods:{async search(){console.warn("Search mixin: Please implement a `search` method.")}}},Ft={props:{endpoint:String,empty:Object,fetchParams:Object,item:{type:Function,default:t=>t},max:Number,multiple:{type:Boolean,default:!0},size:{type:String,default:"medium"},value:{type:Array,default:()=>[]}}};const Yt=ut({mixins:[Et,zt,Ft],emits:["cancel","fetched","submit"],data(){return{models:[],selected:this.value.reduce(((t,e)=>({...t,[e]:{id:e}})),{}),pagination:{limit:20,page:1,total:0}}},computed:{items(){return this.models.map(this.item)}},watch:{fetchParams(t,e){!1===this.$helper.object.same(t,e)&&(this.pagination.page=1,this.fetch())}},mounted(){this.fetch()},methods:{async fetch(){const t={page:this.pagination.page,search:this.query,...this.fetchParams};try{this.$panel.dialog.isLoading=!0;const e=await this.$api.get(this.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.$emit("fetched",e)}catch(e){this.$panel.error(e),this.models=[]}finally{this.$panel.dialog.isLoading=!1}},isSelected(t){return void 0!==this.selected[t.id]},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected))},async search(){this.pagination.page=0,await this.fetch()},toggle(t){if(!1!==this.multiple&&1!==this.max||(this.selected={}),this.isSelected(t))return Vue.del(this.selected,t.id);this.max&&this.max<=this.$helper.object.length(this.selected)||Vue.set(this.selected,t.id,t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({staticClass:"k-models-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},"k-dialog",t.$props,!1),[t._t("header"),t.hasSearch?e("k-dialog-search",{attrs:{value:t.query},on:{search:function(e){t.query=e}}}):t._e(),e("k-collection",{attrs:{empty:{...t.empty,text:t.$panel.dialog.isLoading?t.$t("loading"):t.empty.text},items:t.items,link:!1,pagination:{details:!0,dropdown:!1,align:"center",...t.pagination},sortable:!1,layout:"list"},on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:i}){return[e("k-choice-input",{attrs:{checked:t.isSelected(i),type:t.multiple&&1!==t.max?"checkbox":"radio",title:t.isSelected(i)?t.$t("remove"):t.$t("select")},on:{click:function(e){return e.stopPropagation(),t.toggle(i)}}}),t._t("options",null,null,{item:i})]}}],null,!0)})],2)}),[],!1,null,null,null,null).exports;const Rt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"image",text:window.panel.$t("dialog.files.empty")})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ut=ut({mixins:[Et,Ct],props:{size:{default:"medium"},submitButton:{default:()=>window.panel.$t("save")},text:{type:String}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[t.text?e("k-dialog-text",{attrs:{text:t.text}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})]}))],2)}),[],!1,null,null,null,null).exports;const Ht=ut({extends:Ut,watch:{"value.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"value.code"(t){this.fields.code.disabled||(this.value.code=this.$helper.slug(t,[this.$panel.system.ascii]),this.onCodeChanges(this.value.code))}},methods:{onCodeChanges(t){if(!t)return this.value.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),i=[e[0],e[1].toUpperCase()];this.value.locale=i.join("_")}else{let e=this.$panel.system.locales??[];this.value.locale=null==e?void 0:e[t]}},onNameChanges(t){this.value.code=this.$helper.slug(t,[this.value.rules,this.$panel.system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const Vt=ut({mixins:[{mixins:[Et],props:{license:Object,size:{default:"large"}}}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-license-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-bar",{staticStyle:{"margin-bottom":"var(--spacing-2)"}},[e("h2",{staticClass:"k-headline"},[t._v(" "+t._s(t.$t("license"))+" ")])]),e("div",{staticClass:"k-table"},[e("table",{staticStyle:{"table-layout":"auto"}},[e("tbody",[e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("type")))]),e("td",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.license.type))])]),t.license.code?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("license.code")))]),e("td",{staticClass:"k-text",attrs:{"data-mobile":"true"}},[e("code",[t._v(t._s(t.license.code))])])]):t._e(),t.license.info?e("tr",[e("th",{attrs:{"data-mobile":"true"}},[t._v(t._s(t.$t("status")))]),e("td",{attrs:{"data-mobile":"true","data-theme":t.license.theme}},[e("p",{staticClass:"k-license-dialog-status"},[e("k-icon",{attrs:{type:t.license.icon}}),t._v(" "+t._s(t.license.info)+" ")],1)])]):t._e()])])])],1)}),[],!1,null,null,null,null).exports;const Kt=ut({mixins:[Et,Ct],props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("title"),type:"text",icon:"title"},target:{label:window.panel.$t("open.newWindow"),type:"toggle",text:[window.panel.$t("no"),window.panel.$t("yes")]}})},size:{default:"medium"},submitButton:{default:()=>window.panel.$t("insert")}},data(){return{values:{href:"",title:null,...this.value,target:Boolean(this.value.target??!1)}}},methods:{submit(){const t=this.values.href.replace("file://","/@/file/").replace("page://","/@/page/");this.$emit("submit",{...this.values,href:t,target:this.values.target?"_blank":null})}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",t._b({attrs:{value:t.values},on:{cancel:function(e){return t.$emit("cancel")},input:function(e){t.values=e},submit:t.submit}},"k-form-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Wt=ut({mixins:[Ut],props:{blueprints:{type:Array},size:{default:"medium",type:String},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},template:{type:String}},computed:{templates(){return this.blueprints.map((t=>({text:t.title,value:t.name})))}},methods:{pick(t){this.$panel.dialog.reload({query:{...this.$panel.dialog.query,slug:this.value.slug,template:t,title:this.value.title}})}}},(function(){var t=this,e=t._self._c;return e("k-form-dialog",t._b({ref:"dialog",staticClass:"k-page-create-dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-form-dialog",t.$props,!1),[t.templates.length>1?e("k-select-field",{staticClass:"k-page-template-switch",attrs:{empty:!1,label:t.$t("template"),options:t.templates,required:!0,value:t.template},on:{input:function(e){return t.pick(e)}}}):t._e(),e("k-dialog-fields",{attrs:{fields:t.fields,novalidate:t.novalidate,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)}),[],!1,null,null,null,null).exports;const Jt=ut({mixins:[Et],props:{value:{default:()=>({}),type:Object}},emits:["cancel","input","submit"],methods:{select(t){this.$emit("input",{...this.value,parent:t.value})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-page-move-dialog",attrs:{"submit-button":{icon:"parent",text:t.$t("move")},size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},"k-dialog",t.$props,!1),[e("k-headline",[t._v(t._s(t.$t("page.move")))]),e("div",{staticClass:"k-page-move-parent",attrs:{tabindex:"0","data-autofocus":""}},[e("k-page-tree",{attrs:{current:t.value.parent,move:t.value.move,identifier:"id"},on:{select:t.select}})],1)],1)}),[],!1,null,null,null,null).exports;const Gt=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"page",text:window.panel.$t("dialog.pages.empty")})}},data:()=>({model:null,parent:null})},(function(){var t=this,e=t._self._c;return e("k-models-dialog",t._b({attrs:{"fetch-params":{parent:t.parent}},on:{cancel:function(e){return t.$emit("cancel")},fetched:function(e){t.model=e.model},submit:function(e){return t.$emit("submit",e)}},scopedSlots:t._u([t.model?{key:"header",fn:function(){return[e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,title:t.$t("back"),icon:"angle-left"},on:{click:function(e){t.parent=t.model.parent}}}),e("k-headline",[t._v(t._s(t.model.title))])],1)]},proxy:!0}:null,t.model?{key:"options",fn:function({item:i}){return[e("k-button",{staticClass:"k-pages-dialog-option",attrs:{disabled:!i.hasChildren,title:t.$t("open"),icon:"angle-right"},on:{click:function(e){e.stopPropagation(),t.parent=i.id}}})]}}:null],null,!0)},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports;const Xt=ut({mixins:[{mixins:[Et,It]}]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[t._t("default",(function(){return[e("k-dialog-text",{attrs:{text:t.text}})]}))],2)}),[],!1,null,null,null,null).exports;const Zt=ut({mixins:[Xt],props:{icon:{default:"trash"},submitButton:{default:()=>window.panel.$t("delete")},theme:{default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-text-dialog",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Qt=ut({mixins:[Et],props:{type:String},emits:["cancel"],data:()=>({results:null,pagination:{}}),methods:{focus(){var t;null==(t=this.$refs.search)||t.focus()},navigate(t){t&&(this.$go(t.link),this.close())},async search({type:t,query:e}){const i=await this.$panel.search(t,e);i&&(this.results=i.results,this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-search-dialog",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,role:"search",size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[e("k-search-bar",{ref:"search",attrs:{"default-type":t.type??t.$panel.view.search,"is-loading":t.$panel.searcher.isLoading,pagination:t.pagination,results:t.results,types:t.$panel.searches},on:{close:t.close,more:function(e){return t.$go("search",{query:e})},navigate:t.navigate,search:t.search}})],1)}),[],!1,null,null,null,null).exports;const te=ut({mixins:[{mixins:[Et,Ct]}],props:{fields:null,qr:{type:String,required:!0},size:{default:"large"},submitButton:{default:()=>({text:window.panel.$t("activate"),icon:"lock",theme:"notice"})}},emits:["cancel","input","submit"]},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dialog-text",{staticClass:"k-totp-dialog-intro",attrs:{text:t.$t("login.totp.enable.intro")}}),e("div",{staticClass:"k-totp-dialog-grid"},[e("div",{staticClass:"k-totp-qrcode"},[e("k-info-field",{attrs:{label:t.$t("login.totp.enable.qr.label"),text:t.qr,help:t.$t("login.totp.enable.qr.help",{secret:t.value.secret}),theme:"passive"}})],1),e("k-dialog-fields",{staticClass:"k-totp-dialog-fields",attrs:{fields:{info:{label:t.$t("login.totp.enable.confirm.headline"),type:"info",text:t.$t("login.totp.enable.confirm.text"),theme:"none"},confirm:{label:t.$t("login.totp.enable.confirm.label"),type:"text",counter:!1,font:"monospace",required:!0,placeholder:t.$t("login.code.placeholder.totp"),help:t.$t("login.totp.enable.confirm.help")},secret:{type:"hidden"}},novalidate:!0,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const ee=ut({mixins:[Et],props:{submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("upload")})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",staticClass:"k-upload-dialog",attrs:{disabled:t.disabled||0===t.$panel.upload.files.length},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},"k-dialog",t.$props,!1),[e("k-dropzone",{on:{drop:function(e){return t.$panel.upload.select(e)}}},[0===t.$panel.upload.files.length?e("k-empty",{attrs:{icon:"upload",layout:"cards"},on:{click:function(e){return t.$panel.upload.pick()}}},[t._v(" "+t._s(t.$t("files.empty"))+" ")]):e("k-upload-items",{attrs:{items:t.$panel.upload.files},on:{remove:e=>{t.$panel.upload.remove(e.id)},rename:(t,e)=>{t.name=e}}})],1)],1)}),[],!1,null,null,null,null).exports;const ie=ut({extends:ee,props:{original:Object,submitButton:{type:[String,Boolean,Object],default:()=>({icon:"upload",text:window.panel.$t("replace")})}},computed:{file(){return this.$panel.upload.files[0]}}},(function(){var t,e,i,n,s=this,o=s._self._c;return o("k-dialog",s._b({ref:"dialog",staticClass:"k-upload-dialog k-upload-replace-dialog",on:{cancel:function(t){return s.$emit("cancel")},submit:function(t){return s.$emit("submit")}}},"k-dialog",s.$props,!1),[o("ul",{staticClass:"k-upload-items"},[o("li",{staticClass:"k-upload-original"},[o("k-upload-item-preview",{attrs:{color:null==(t=s.original.image)?void 0:t.color,icon:null==(e=s.original.image)?void 0:e.icon,url:s.original.url,type:s.original.mime}})],1),o("li",[s._v("←")]),o("k-upload-item",s._b({attrs:{color:null==(i=s.original.image)?void 0:i.color,editable:!1,icon:null==(n=s.original.image)?void 0:n.icon,name:s.$helper.file.name(s.original.filename),removable:!1}},"k-upload-item",s.file,!1))],1)])}),[],!1,null,null,null,null).exports;const ne=ut({mixins:[Et,Ft],props:{empty:{type:Object,default:()=>({icon:"users",text:window.panel.$t("dialog.users.empty")})},item:{type:Function,default:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}}},(function(){var t=this;return(0,t._self._c)("k-models-dialog",t._b({on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",e)}}},"k-models-dialog",t.$props,!1))}),[],!1,null,null,null,null).exports,se={install(t){t.use(jt),t.component("k-dialog",Lt),t.component("k-changes-dialog",Tt),t.component("k-email-dialog",Bt),t.component("k-error-dialog",qt),t.component("k-fiber-dialog",Pt),t.component("k-files-dialog",Rt),t.component("k-form-dialog",Ut),t.component("k-license-dialog",Vt),t.component("k-link-dialog",Kt),t.component("k-language-dialog",Ht),t.component("k-models-dialog",Yt),t.component("k-page-create-dialog",Wt),t.component("k-page-move-dialog",Jt),t.component("k-pages-dialog",Gt),t.component("k-remove-dialog",Zt),t.component("k-search-dialog",Qt),t.component("k-text-dialog",Xt),t.component("k-totp-dialog",te),t.component("k-upload-dialog",ee),t.component("k-upload-replace-dialog",ie),t.component("k-users-dialog",ne)}};const oe=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-drawer-body scroll-y-auto"},[this._t("default")],2)}),[],!1,null,null,null,null).exports,le={props:{empty:{type:String,default:()=>window.panel.$t("drawer.fields.empty")},fields:Object,novalidate:{type:Boolean,default:!0},value:Object}};const ae=ut({mixins:[le],emits:["input","submit"],computed:{hasFields(){return this.$helper.object.length(this.fields)>0}}},(function(){var t=this,e=t._self._c;return t.hasFields?e("k-fieldset",{staticClass:"k-drawer-fields",attrs:{novalidate:t.novalidate,fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,re={props:{breadcrumb:{default:()=>[],type:Array},tab:{type:String},tabs:{default:()=>({}),type:Object}}};const ue=ut({mixins:[re],emits:["crumb","tab"]},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-drawer-header"},[e("nav",{staticClass:"k-breadcrumb k-drawer-breadcrumb"},[e("ol",t._l(t.breadcrumb,(function(i,n){return e("li",{key:i.id},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.props.icon,text:i.props.title,current:n===t.breadcrumb.length-1,variant:"dimmed"},on:{click:function(e){return t.$emit("crumb",i.id)}}})],1)})),0)]),e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.tabs},on:{open:function(e){return t.$emit("tab",e)}}}),e("nav",{staticClass:"k-drawer-options"},[t._t("default"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check",type:"submit"}})],2)],1)}),[],!1,null,null,null,null).exports;const ce=ut({},(function(){var t=this,e=t._self._c;return"drawer"===t.$panel.notification.context?e("k-notification",{staticClass:"k-drawer-notification"}):t._e()}),[],!1,null,null,null,null).exports;const de=ut({mixins:[{props:{tab:{type:String},tabs:{default:()=>({}),type:[Array,Object]}}}],emits:["open"],computed:{hasTabs(){return this.$helper.object.length(this.tabs)>1}}},(function(){var t=this,e=t._self._c;return t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(i){return e("k-button",{key:i.name,staticClass:"k-drawer-tab",attrs:{current:t.tab===i.name,text:i.label},on:{click:function(e){return t.$emit("open",i.name)}}})})),1):t._e()}),[],!1,null,null,null,null).exports,pe={props:{empty:{type:String,default:()=>window.panel.$t("drawer.text.empty")},text:{type:String}}};const he=ut({mixins:[pe]},(function(){var t=this,e=t._self._c;return t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.empty))])}),[],!1,null,null,null,null).exports,me={install(t){t.component("k-drawer-body",oe),t.component("k-drawer-fields",ae),t.component("k-drawer-header",ue),t.component("k-drawer-notification",ce),t.component("k-drawer-tabs",de),t.component("k-drawer-text",he)}},fe={mixins:[re],props:{disabled:{default:!1,type:Boolean},icon:String,id:String,options:{type:Array},title:String,visible:{default:!1,type:Boolean}}};const ge=ut({mixins:[fe],emits:["cancel","crumb","submit","tab"]},(function(){var t=this,e=t._self._c;return t.visible?e("portal",{attrs:{to:"drawer"}},[e("form",{staticClass:"k-drawer",class:t.$vnode.data.staticClass,attrs:{"aria-disabled":t.disabled,method:"dialog"},on:{submit:function(e){return e.preventDefault(),t.$emit("submit")}}},[e("k-drawer-notification"),e("k-drawer-header",{attrs:{breadcrumb:t.breadcrumb,tab:t.tab,tabs:t.tabs},on:{crumb:function(e){return t.$emit("crumb",e)},tab:function(e){return t.$emit("tab",e)}}},[t._t("options",(function(){return[t._l(t.options,(function(i,n){return[i.dropdown?[e("k-button",t._b({key:"btn-"+n,staticClass:"k-drawer-option",on:{click:function(e){t.$refs["dropdown-"+n][0].toggle()}}},"k-button",i,!1)),e("k-dropdown-content",{key:"dropdown-"+n,ref:"dropdown-"+n,refInFor:!0,attrs:{options:i.dropdown,"align-x":"end",theme:"light"}})]:e("k-button",t._b({key:n,staticClass:"k-drawer-option"},"k-button",i,!1))]}))]}))],2),e("k-drawer-body",[t._t("default")],2)],1)]):t._e()}),[],!1,null,null,null,null).exports,ke={props:{hidden:{type:Boolean},next:{type:Object},prev:{type:Object}}};const be=ut({mixins:[fe,le,ke],emits:["cancel","crumb","input","next","prev","remove","show","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-block-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.hidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const ve=ut({methods:{isCurrent(t){return this.$panel.drawer.id===t}}},(function(){var t=this,e=t._self._c;return e("div",t._l(t.$panel.drawer.history.milestones,(function(i){return e(i.component,t._g(t._b({key:i.id,tag:"component",attrs:{breadcrumb:t.$panel.drawer.breadcrumb,disabled:!1===t.isCurrent(i.id),visible:!0}},"component",t.isCurrent(i.id)?t.$panel.drawer.props:i.props,!1),t.isCurrent(i.id)?t.$panel.drawer.listeners():i.on))})),1)}),[],!1,null,null,null,null).exports;const ye=ut({mixins:[fe,le],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-form-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-drawer-fields",{attrs:{fields:t.fields,value:t.value},on:{input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)}}})],2)}),[],!1,null,null,null,null).exports;const $e=ut({mixins:[fe,le,{props:{next:{type:Object},prev:{type:Object}}}],emits:["cancel","crumb","input","next","prev","remove","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-form-drawer",t._b({ref:"drawer",staticClass:"k-structure-drawer",on:{cancel:function(e){return t.$emit("cancel",e)},crumb:function(e){return t.$emit("crumb",e)},input:function(e){return t.$emit("input",e)},submit:function(e){return t.$emit("submit",e)},tab:function(e){return t.$emit("tab",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return t.$emit("prev")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return t.$emit("next")}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return t.$emit("remove")}}})]},proxy:!0}])},"k-form-drawer",t.$props,!1))}),[],!1,null,null,null,null).exports;const we=ut({mixins:[fe,pe],emits:["cancel","crumb","input","submit","tab"]},(function(){var t=this,e=t._self._c;return e("k-drawer",t._b({ref:"drawer",staticClass:"k-text-drawer",on:{cancel:function(e){return t.$emit("cancel")},crumb:function(e){return t.$emit("crumb",e)},submit:function(e){return t.$emit("submit",t.value)},tab:function(e){return t.$emit("tab",e)}}},"k-drawer",t.$props,!1),[t._t("options",null,{slot:"options"}),e("k-dialog-text",{attrs:{text:t.text}})],2)}),[],!1,null,null,null,null).exports,xe={install(t){t.use(me),t.component("k-drawer",ge),t.component("k-block-drawer",be),t.component("k-fiber-drawer",ve),t.component("k-form-drawer",ye),t.component("k-structure-drawer",$e),t.component("k-text-drawer",we)}};const _e=ut({mounted(){window.panel.deprecated(" will be removed in a future version. Since Kirby 4.0, you don't need it anymore as wrapper element. Use `` as standalone instead.")}},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Ce=null;const Se=ut({props:{align:{type:String},alignX:{type:String,default:"start"},alignY:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},navigate:{default:!0,type:Boolean},options:[Array,Function,String],theme:{type:String,default:"dark"}},emits:["action","close","open"],data(){return{axis:{x:this.alignX,y:this.alignY},position:{x:0,y:0},isOpen:!1,items:[],opener:null}},mounted(){this.align&&window.panel.deprecated(": `align` prop will be removed in a future version. Use the `alignX` prop instead.")},methods:{close(){var t;null==(t=this.$refs.dropdown)||t.close()},async fetchOptions(t){return this.options?"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)?t(this.options):void 0:t(this.items)},focus(t=0){this.$refs.navigate.focus(t)},onClick(){this.close()},onClose(){this.resetPosition(),this.isOpen=Ce=!1,this.$emit("close"),window.removeEventListener("resize",this.setPosition)},async onOpen(){this.isOpen=!0;const t=window.scrollY;Ce=this,await this.$nextTick(),this.$el&&this.opener&&(window.addEventListener("resize",this.setPosition),await this.setPosition(),window.scrollTo(0,t),this.$emit("open"))},onOptionClick(t){return this.close(),"function"==typeof t.click?t.click.call(this):"string"==typeof t.click?this.$emit("action",t.click):void(t.click&&(t.click.name&&this.$emit(t.click.name,t.click.payload),t.click.global&&this.$events.emit(t.click.global,t.click.payload)))},open(t){var e,i;if(!0===this.disabled)return!1;Ce&&Ce!==this&&Ce.close(),this.opener=t??(null==(e=window.event)?void 0:e.target.closest("button"))??(null==(i=window.event)?void 0:i.target),this.fetchOptions((t=>{this.items=t,this.onOpen()}))},async setPosition(){this.axis={x:this.alignX??this.align,y:this.alignY},"right"===this.axis.x?this.axis.x="end":"left"===this.axis.x&&(this.axis.x="start"),"rtl"===this.$panel.direction&&("start"===this.axis.x?this.axis.x="end":"end"===this.axis.x&&(this.axis.x="start")),this.opener.$el&&(this.opener=this.opener.$el);const t=this.opener.getBoundingClientRect();this.position.x=t.left+window.scrollX+t.width,this.position.y=t.top+window.scrollY+t.height,!0!==this.$el.open&&this.$el.showModal(),await this.$nextTick();const e=this.$el.getBoundingClientRect(),i=10;"end"===this.axis.x?t.left-e.widthwindow.innerWidth-i&&e.width+ie.top&&(this.axis.y="bottom"):t.top+e.height>window.innerHeight-i&&e.height+i!0===t.default));t.push(this.item(e)),t.push("-");const i=this.languages.filter((t=>!1===t.default));for(const n of i)t.push(this.item(n));return t}},methods:{change(t){this.$reload({query:{language:t.code}})},item(t){return{click:()=>this.change(t),current:t.code===this.language.code,text:t.name}}}},(function(){var t=this,e=t._self._c;return t.languages.length>1?e("div",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{dropdown:!0,text:t.code,icon:"translate",responsive:"text",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.languages.toggle()}}}),e("k-dropdown-content",{ref:"languages",attrs:{options:t.options}})],1):t._e()}),[],!1,null,null,null,null).exports;const Ae=ut({props:{align:{type:String,default:"right"},disabled:{type:Boolean},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"},size:String,variant:String},emits:["action","option"],computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,i){"function"==typeof t?t.call(this):(this.$emit("action",t,e,i),this.$emit("option",t,e,i))},toggle(t=this.$el){this.$refs.options.toggle(t)}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,icon:t.options[0].icon??t.icon,size:t.options[0].size??t.size,title:t.options[0].title??t.options[0].tooltip??t.options[0].text,variant:t.options[0].variant??t.variant},on:{click:function(e){return t.onAction(t.options[0].option??t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("div",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{disabled:t.disabled,dropdown:!0,icon:t.icon,size:t.size,text:!0!==t.text&&!1!==t.text?t.text:null,title:t.$t("options"),variant:t.variant},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{"align-x":t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports,Ie={mixins:[V,W,X,nt,at]},De={mixins:[Ie],inheritAttrs:!1,emits:["input"],methods:{focus(){this.$el.focus()}}},je={mixins:[V,W,st,at],props:{ignore:{default:()=>[],type:Array},max:Number,min:Number,search:{default:!0,type:[Object,Boolean]}}},Ee={mixins:[Ie,je],props:{create:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!0},value:{type:[Array,String],default:()=>[]}},emits:["create","escape","input"]};const Le=ut({mixins:[De,Ee],data(){return{display:this.search.display??!0,query:""}},computed:{choices(){let t=this.filteredOptions;return!0!==this.display&&(t=t.slice(0,this.display)),t.map((t=>({...t,disabled:t.disabled||this.isFull&&!1===this.value.includes(t.value),text:this.highlight(t.text)})))},filteredOptions(){if(!(this.query.length<(this.search.min??0)))return this.$helper.array.search(this.options,this.query,{field:"text"})},isFull(){return this.max&&this.value.length>=this.max},placeholder(){return this.search.placeholder?this.search.placeholder:this.options.length>0?this.$t("filter")+"…":this.$t("enter")+"…"},showCreate(){var t;if(!1===this.create)return!1;if(this.isFull)return!1;if(0===this.query.trim().length)return!1;if(!0===this.ignore.includes(this.query))return!1;if(!0===(null==(t=this.create.ignore)?void 0:t.includes(this.query)))return!1;return 0===this.options.filter((t=>t.text===this.query||t.value===this.query)).length},showEmpty(){return!1===this.create&&0===this.filteredOptions.length}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},methods:{add(){this.showCreate&&this.$emit("create",this.query)},enter(t){var e;null==(e=t.target)||e.click()},escape(){0===this.query.length?this.$emit("escape"):this.query=""},focus(){var t;this.$refs.search?this.$refs.search.focus():null==(t=this.$refs.options)||t.focus()},highlight(t){if(t=this.$helper.string.stripHTML(t),this.query.length>0){const e=new RegExp(`(${RegExp.escape(this.query)})`,"ig");return t.replace(e,"$1")}return t},input(t){this.$emit("input",t)}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{staticClass:"k-picklist-input",attrs:{element:"nav",axis:"y",select:"input[type=search], label, .k-picklist-input-body button"},on:{prev:function(e){return t.$emit("escape")}}},[t.search?e("header",{staticClass:"k-picklist-input-header"},[e("div",{staticClass:"k-picklist-input-search"},[e("k-search-input",{ref:"search",attrs:{autofocus:t.autofocus,disabled:t.disabled,placeholder:t.placeholder,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"escape",void 0,e.key,void 0)?null:(e.preventDefault(),t.escape.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.add.apply(null,arguments))}]}}),t.showCreate?e("k-button",{staticClass:"k-picklist-input-create",attrs:{icon:"add",size:"xs"},on:{click:t.add}}):t._e()],1)]):t._e(),t.filteredOptions.length?[e("div",{staticClass:"k-picklist-input-body"},[e(t.multiple?"k-checkboxes-input":"k-radio-input",{ref:"options",tag:"component",staticClass:"k-picklist-input-options",attrs:{disabled:t.disabled,options:t.choices,value:t.value},on:{input:t.input},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.enter.apply(null,arguments))}}}),!0!==t.display&&t.filteredOptions.length>t.display?e("k-button",{staticClass:"k-picklist-input-more",attrs:{icon:"angle-down"},on:{click:function(e){t.display=!0}}},[t._v(" "+t._s(t.$t("options.all",{count:t.filteredOptions.length}))+" ")]):t._e()],1)]:t.showEmpty?[e("div",{staticClass:"k-picklist-input-body"},[e("p",{staticClass:"k-picklist-input-empty"},[t._v(" "+t._s(t.$t("options.none"))+" ")])])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Te=ut({mixins:[Ee],emits:["create","input"],methods:{close(){this.$refs.dropdown.close()},add(t){this.$emit("create",t)},input(t){this.$emit("input",t)},open(t){this.$refs.dropdown.open(t)},toggle(){this.$refs.dropdown.toggle()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown-content",{ref:"dropdown",staticClass:"k-picklist-dropdown",attrs:{"align-x":"start",disabled:t.disabled,navigate:!1},nativeOn:{click:function(t){t.stopPropagation()}}},[e("k-picklist-input",t._b({on:{create:t.add,input:t.input,escape:function(e){return t.$refs.dropdown.close()}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-picklist-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Be={install(t){t.component("k-dropdown",_e),t.component("k-dropdown-content",Se),t.component("k-dropdown-item",Oe),t.component("k-languages-dropdown",Me),t.component("k-options-dropdown",Ae),t.component("k-picklist-dropdown",Te)}};const qe=ut({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},emits:["leave","search","select"],data:()=>({matches:[],selected:{text:null}}),mounted(){window.panel.deprecated(" will be removed in a future version.")},methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){const e=this.options.filter((t=>-1!==this.skip.indexOf(t.value)));this.matches=this.$helper.array.search(e,t,{field:"text",limit:this.limit}),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",{ref:"dropdown",attrs:{autofocus:!0},on:{leave:function(e){return t.$emit("leave")}}},t._l(t.matches,(function(i,n){return e("k-dropdown-item",t._b({key:n,nativeOn:{mousedown:function(e){return t.onSelect(i)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(i))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",i,!1),[e("span",{domProps:{innerHTML:t._s(t.html?i.text:t.$esc(i.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const Pe=ut({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min||t.max?e("span",{staticClass:"k-counter-rules"},[t.min&&t.max?[t._v(t._s(t.min)+"–"+t._s(t.max))]:t.min?[t._v("≥ "+t._s(t.min))]:t.max?[t._v("≤ "+t._s(t.max))]:t._e()],2):t._e()])}),[],!1,null,null,null,null).exports;const Ne=ut({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","submit"],data:()=>({errors:{}}),methods:{focus(t){var e,i;null==(i=null==(e=this.$refs.fields)?void 0:e.focus)||i.call(e,t)},onFocus(t,e,i){this.$emit("focus",t,e,i)},onInput(t,e,i){this.$emit("input",t,e,i)},onInvalid(t){this.$emit("invalid",t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",{ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value},on:{focus:t.onFocus,input:t.onInput,invalid:t.onInvalid,submit:t.onSubmit}})]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const ze=ut({props:{lock:[Boolean,Object]},data:()=>({isLoading:null,isLocking:null}),computed:{api(){return[this.$panel.view.path+"/lock",null,null,!0]},buttons(){return"unlock"===this.mode?[{icon:"check",text:this.$t("lock.isUnlocked"),click:()=>this.resolve()},{icon:"download",text:this.$t("download"),click:()=>this.download()}]:"lock"===this.mode?[{icon:this.lock.data.unlockable?"unlock":"loader",text:this.$t("lock.isLocked",{email:this.$esc(this.lock.data.email)}),title:this.$t("lock.unlock"),disabled:!this.lock.data.unlockable,click:()=>this.unlock()}]:"changes"===this.mode?[{icon:"undo",text:this.$t("revert"),click:()=>this.revert()},{icon:"check",text:this.$t("save"),click:()=>this.save()}]:[]},disabled(){return"unlock"!==this.mode&&("lock"===this.mode?!this.lock.data.unlockable:"changes"===this.mode&&this.isDisabled)},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"changes"===this.mode?"notice":null}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.locking(),this.isLocking=setInterval(this.locking,3e4)):e&&(clearInterval(this.isLocking),this.locking(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.emit("model.reload")}},mounted(){this.supportsLocking&&(this.isLoading=setInterval(this.check,1e4)),this.$events.on("view.save",this.save)},destroyed(){clearInterval(this.isLoading),clearInterval(this.isLocking),this.$events.off("view.save",this.save)},methods:{async check(){if(!1===this.$panel.isOffline){const{lock:t}=await this.$api.get(...this.api);Vue.set(this.$panel.view.props,"lock",t)}},download(){let t="";const e=this.$store.getters["content/changes"]();for(const n in e){const i=e[n];t+=n+": \n\n","object"==typeof i&&Object.keys(i).length||Array.isArray(i)&&i.length?t+=JSON.stringify(i,null,2):t+=i,t+="\n\n----\n\n"}let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",this.$panel.view.path+".txt"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},async locking(t=!0){if(!0!==this.$panel.isOffline)if(!0===t)try{await this.$api.patch(...this.api)}catch{clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},async resolve(){await this.unlock(!1),this.$store.dispatch("content/revert")},revert(){this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"undo",text:this.$t("revert")},text:this.$t("revert.confirm")},on:{submit:()=>{this.$store.dispatch("content/revert"),this.$panel.dialog.close()}}})},async save(t){var e;null==(e=null==t?void 0:t.preventDefault)||e.call(t),await this.$store.dispatch("content/save"),this.$events.emit("model.update"),this.$panel.notification.success()},async unlock(t=!0){const e=[this.$panel.view.path+"/unlock",null,null,!0];!0!==t?(await this.$api.delete(...e),this.$reload({silent:!0})):this.$panel.dialog.open({component:"k-remove-dialog",props:{submitButton:{icon:"unlock",text:this.$t("lock.unlock")},text:this.$t("lock.unlock.submit",{email:this.$esc(this.lock.data.email)})},on:{submit:async()=>{await this.$api.patch(...e),this.$panel.dialog.close(),this.$reload({silent:!0})}}})}}},(function(){var t=this,e=t._self._c;return t.buttons.length>0?e("k-button-group",{staticClass:"k-form-buttons",attrs:{layout:"collapsed"}},t._l(t.buttons,(function(i){return e("k-button",t._b({key:i.icon,attrs:{size:"sm",variant:"filled",disabled:t.isDisabled,responsive:!0,theme:t.theme}},"k-button",i,!1))})),1):t._e()}),[],!1,null,null,null,null).exports,Fe={mixins:[W,G,X,Q,nt,at],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Ye=ut({mixins:[Fe],inheritAttrs:!1,emits:["blur","focus"]},(function(){var t=this,e=t._self._c;return e("div",{class:["k-field",`k-field-name-${t.name}`,`k-field-type-${t.type}`],attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("k-label",{attrs:{input:t.input,required:t.required,title:t.label,type:"field"}},[t._v(" "+t._s(t.label)+" ")])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Re=ut({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},emits:["focus","input","invalid","submit"],data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,i,n){this.errors[n]=e,this.$emit("invalid",this.errors)},onInput(t,e,i){const n=this.value;this.$set(n,i,t),this.$emit("input",n,e,i)},hasErrors(){return this.$helper.object.length(this.errors)>0}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fieldset"},[e("k-grid",{attrs:{variant:"fields"}},[t._l(t.fields,(function(i,n){return[t.$helper.field.isVisible(i,t.value)?e("k-column",{key:i.signature,attrs:{width:i.width}},[t.hasFieldType(i.type)?e("k-"+i.type+"-field",t._b({ref:n,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||i.disabled,"form-data":t.value,name:n,novalidate:t.novalidate,value:t.value[n]},on:{input:function(e){return t.onInput(e,i,n)},focus:function(e){return t.$emit("focus",e,i,n)},invalid:(e,s)=>t.onInvalid(e,s,i,n),submit:function(e){return t.$emit("submit",e,i,n)}}},"component",i,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:n,type:i.type}))+" ")])],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,Ue={mixins:[U,K,W,Z],inheritAttrs:!1,props:{autofocus:Boolean,type:String,icon:[String,Boolean],novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const He=ut({mixins:[Ue],data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},watch:{invalid(){this.isInvalid=this.invalid}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var i,n,s;if("INPUT"===(null==(i=null==t?void 0:t.target)?void 0:i.tagName)&&"function"==typeof(null==(n=null==t?void 0:t.target)?void 0:n[e]))return void t.target[e]();if("function"==typeof(null==(s=this.$refs.input)?void 0:s[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-description k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-description k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const Ve=ut({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},emits:["success"],methods:{open(t){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.open()` instead."),this.$panel.upload.pick(this.params(t))},params(t){return{...this.$props,...t??{},on:{complete:(t,e)=>{this.$emit("success",t,e)}}}},select(t){this.$panel.upload.select(t.target.files)},drop(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.open(t,this.params(e))},upload(t,e){window.panel.deprecated(" will be removed in a future version. Use `$panel.upload.select()` instead."),this.$panel.upload.select(t,this.params(e)),this.$panel.upload.start()}},render:()=>""},null,null,!1,null,null,null,null).exports,Ke={props:{content:{default:()=>({}),type:[Array,Object]},fieldset:{default:()=>({}),type:Object}}};const We=ut({mixins:[Ke],inheritAttrs:!1,computed:{icon(){return this.fieldset.icon??"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.name)return!1;let t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&(t=this.$helper.string.stripHTML(t),this.$helper.string.unescapeHTML(t))},name(){return this.fieldset.name??this.fieldset.label}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-title"},[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),t.name?e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports,Je={mixins:[Ke,W],props:{endpoints:{default:()=>({}),type:[Array,Object]},id:String}};const Ge=ut({mixins:[Je],inheritAttrs:!1,methods:{field(t,e=null){let i=null;for(const n of Object.values(this.fieldset.tabs??{}))n.fields[t]&&(i=n.fields[t]);return i??e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},nativeOn:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Xe={props:{isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isMergable:Boolean}};const Ze=ut({mixins:[Xe],props:{isEditable:Boolean,isSplitable:Boolean},emits:["chooseToAppend","chooseToConvert","chooseToPrepend","copy","duplicate","hide","merge","open","paste","remove","removeSelected","show","split","sortDown","sortUp"],computed:{buttons(){return this.isBatched?[{icon:"template",title:this.$t("copy"),click:()=>this.$emit("copy")},{when:this.isMergable,icon:"merge",title:this.$t("merge"),click:()=>this.$emit("merge")},{icon:"trash",title:this.$t("remove"),click:()=>this.$emit("removeSelected")}]:[{when:this.isEditable,icon:"edit",title:this.$t("edit"),click:()=>this.$emit("open")},{icon:"add",title:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},{icon:"trash",title:this.$t("delete"),click:()=>this.$emit("remove")},{icon:"sort",title:this.$t("sort.drag"),class:"k-sort-handle",key:t=>this.sort(t)},{icon:"dots",title:this.$t("more"),dropdown:[{icon:"angle-up",label:this.$t("insert.before"),disabled:this.isFull,click:()=>this.$emit("chooseToPrepend")},{icon:"angle-down",label:this.$t("insert.after"),disabled:this.isFull,click:()=>this.$emit("chooseToAppend")},"-",{when:this.isEditable,icon:"edit",label:this.$t("edit"),click:()=>this.$emit("open")},{icon:"refresh",label:this.$t("field.blocks.changeType"),click:()=>this.$emit("chooseToConvert")},{when:this.isSplitable,icon:"split",label:this.$t("split"),click:()=>this.$emit("split")},"-",{icon:"template",label:this.$t("copy"),click:()=>this.$emit("copy")},{icon:"download",label:this.$t("paste.after"),disabled:this.isFull,click:()=>this.$emit("paste")},"-",{icon:this.isHidden?"preview":"hidden",label:this.isHidden?this.$t("show"):this.$t("hide"),click:()=>this.$emit(this.isHidden?"show":"hide")},{icon:"copy",label:this.$t("duplicate"),click:()=>this.$emit("duplicate")},"-",{icon:"trash",label:this.$t("delete"),click:()=>this.$emit("remove")}]}]}},methods:{open(){this.$refs.options.open()},sort(t){switch(t.preventDefault(),t.key){case"ArrowUp":this.$emit("sortUp");break;case"ArrowDown":this.$emit("sortDown")}}}},(function(){return(0,this._self._c)("k-toolbar",{staticClass:"k-block-options",attrs:{buttons:this.buttons},nativeOn:{mousedown:function(t){t.preventDefault()}}})}),[],!1,null,null,null,null).exports;const Qe=ut({mixins:[Je,Xe],inheritAttrs:!1,props:{attrs:{default:()=>({}),type:[Array,Object]},isLastSelected:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},emits:["append","chooseToAppend","chooseToConvert","chooseToPrepend","close","copy","duplicate","focus","hide","merge","open","paste","prepend","remove","selectDown","selectUp","show","sortDown","sortUp","split","submit","update"],computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview&&this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},containerType(){const t=this.fieldset.preview;return!1!==t&&(t&&this.$helper.isComponent("k-block-type-"+t)?t:!!this.$helper.isComponent("k-block-type-"+this.type)&&this.type)},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isDisabled(){return!0===this.disabled||!0===this.fieldset.disabled},isEditable(){return!1!==this.fieldset.editable},listeners(){return{append:t=>this.$emit("append",t),chooseToAppend:t=>this.$emit("chooseToAppend",t),chooseToConvert:t=>this.$emit("chooseToConvert",t),chooseToPrepend:t=>this.$emit("chooseToPrepend",t),close:()=>this.$emit("close"),copy:()=>this.$emit("copy"),duplicate:()=>this.$emit("duplicate"),focus:()=>this.$emit("focus"),hide:()=>this.$emit("hide"),merge:()=>this.$emit("merge"),open:t=>this.open(t),paste:()=>this.$emit("paste"),prepend:t=>this.$emit("prepend",t),remove:()=>this.remove(),removeSelected:()=>this.$emit("removeSelected"),show:()=>this.$emit("show"),sortDown:()=>this.$emit("sortDown"),sortUp:()=>this.$emit("sortUp"),split:t=>this.$emit("split",t),update:t=>this.$emit("update",t)}},tabs(){const t=this.fieldset.tabs??{};for(const[e,i]of Object.entries(t))for(const[n]of Object.entries(i.fields??{}))t[e].fields[n].section=this.name,t[e].fields[n].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model};return t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){return!!this.containerType&&"k-block-type-"+this.containerType}},methods:{backspace(t){if(t.target.matches("[contenteditable], input, textarea"))return!1;t.preventDefault(),this.remove()},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;"function"==typeof(null==(t=this.$refs.editor)?void 0:t.focus)?this.$refs.editor.focus():null==(e=this.$refs.container)||e.focus()},goTo(t){var e;t&&(null==(e=t.$refs.container)||e.focus(),t.open(null,!0))},isSplitable(){var t;return!0!==this.isFull&&(!!this.$refs.editor&&((this.$refs.editor.isSplitable??!0)&&"function"==typeof(null==(t=this.$refs.editor)?void 0:t.split)))},onClose(){this.$emit("close"),this.focus()},onFocus(t){this.disabled||this.$emit("focus",t)},onFocusIn(t){var e,i;this.disabled||(null==(i=null==(e=this.$refs.options)?void 0:e.$el)?void 0:i.contains(t.target))||this.$emit("focus",t)},onInput(t){this.$emit("update",t)},open(t,e=!1){!this.isEditable||this.isBatched||this.isDisabled||(this.$panel.drawer.open({component:"k-block-drawer",id:this.id,tab:t,on:{close:this.onClose,input:this.onInput,next:()=>this.goTo(this.next),prev:()=>this.goTo(this.prev),remove:this.remove,show:this.show,submit:this.submit},props:{hidden:this.isHidden,icon:this.fieldset.icon??"box",next:this.next,prev:this.prev,tabs:this.tabs,title:this.fieldset.name,value:this.content},replace:e}),this.$emit("open"))},remove(){if(this.isBatched)return this.$emit("removeSelected");this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm")},on:{submit:()=>{this.$panel.dialog.close(),this.close(),this.$emit("remove",this.id)}}})},show(){this.$emit("show")},submit(){this.close(),this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:["k-block-container-fieldset-"+t.type,t.containerType?"k-block-container-type-"+t.containerType:""],attrs:{"data-batched":t.isBatched,"data-disabled":t.isDisabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-selected":t.isLastSelected,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:t.isDisabled?null:0},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"j",void 0,e.key,void 0)?null:e.ctrlKey?(e.preventDefault(),e.stopPropagation(),t.$emit("merge")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.altKey?(e.preventDefault(),e.stopPropagation(),t.$emit("selectUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),e.stopPropagation(),t.$emit("sortUp")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),t.backspace.apply(null,arguments)):null}],focus:function(e){return e.stopPropagation(),t.onFocus.apply(null,arguments)},focusin:function(e){return e.stopPropagation(),t.onFocusIn.apply(null,arguments)}}},[e("div",{staticClass:"k-block",class:t.className,attrs:{"data-disabled":t.isDisabled}},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component",attrs:{tabs:t.tabs}},"component",t.$props,!1),t.listeners))],1),t.isDisabled?t._e():e("k-block-options",t._g(t._b({ref:"options"},"k-block-options",{isBatched:t.isBatched,isEditable:t.isEditable,isFull:t.isFull,isHidden:t.isHidden,isMergable:t.isMergable,isSplitable:t.isSplitable()},!1),{...t.listeners,split:()=>t.$refs.editor.split(),open:()=>{"function"==typeof t.$refs.editor.open?t.$refs.editor.open():t.open()}}))],1)}),[],!1,null,null,null,null).exports,ti={mixins:[V,W,X],props:{empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},emits:["input"]};const ei=ut({mixins:[ti],inheritAttrs:!1,data(){return{blocks:this.value??[],isEditing:!1,isMultiSelectKey:!1,selected:[]}},computed:{draggableOptions(){return{id:this.id,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},isMergable(){if(this.selected.length<2)return!1;const t=this.selected.map((t=>this.find(t)));return!(new Set(t.map((t=>t.type))).size>1)&&"function"==typeof this.ref(t[0]).$refs.editor.merge}},watch:{value(){this.blocks=this.value}},mounted(){!0===this.$props.autofocus&&setTimeout(this.focus,100),this.$events.on("blur",this.onBlur),this.$events.on("click",this.onClickGlobal),this.$events.on("copy",this.onCopy),this.$events.on("keydown",this.onKey),this.$events.on("keyup",this.onKey),this.$events.on("paste",this.onPaste)},destroyed(){this.$events.off("blur",this.onBlur),this.$events.off("click",this.onClickGlobal),this.$events.off("copy",this.onCopy),this.$events.off("keydown",this.onKey),this.$events.off("keyup",this.onKey),this.$events.off("paste",this.onPaste)},methods:{async add(t="text",e){const i=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,i),this.save(),await this.$nextTick(),this.focusOrOpen(i)},choose(t){if(1===this.$helper.object.length(this.fieldsets))return this.add(Object.values(this.fieldsets)[0].type,t);this.$panel.dialog.open({component:"k-block-selector",props:{fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets},on:{submit:e=>{this.add(e,t),this.$panel.dialog.close()},paste:e=>{this.paste(e,t)}}})},chooseToConvert(t){this.$panel.dialog.open({component:"k-block-selector",props:{disabledFieldsets:[t.type],fieldsetGroups:this.fieldsetGroups,fieldsets:this.fieldsets,headline:this.$t("field.blocks.changeType")},on:{submit:e=>{this.convert(e,t),this.$panel.dialog.close()},paste:this.paste}})},copy(t){if(0===this.blocks.length)return!1;if(0===this.selected.length)return!1;let e=[];for(const i of this.blocks)this.selected.includes(i.id)&&e.push(i);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),this.selected=e.map((t=>t.id)),this.$panel.notification.success({message:this.$t("copy.success",{count:e.length}),icon:"template"})},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var i;const n=this.findIndex(e.id);if(-1===n)return!1;const s=t=>{let e={};for(const i of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...i.fields};return e},o=this.blocks[n],l=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),a=this.fieldsets[o.type],r=this.fieldsets[t];if(!r)return!1;let u=l.content;const c=s(r),d=s(a);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(i=null==o?void 0:o.content)?void 0:i[p])&&(u[p]=o.content[p])}this.blocks[n]={...l,id:o.id,content:u},this.save()},deselect(t){const e=this.selected.findIndex((e=>e===t.id));-1!==e&&this.selected.splice(e,1)},deselectAll(){this.selected=[]},async duplicate(t,e){const i={...structuredClone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,i),this.save()},fieldset(t){return this.fieldsets[t.type]??{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){const e=this.ref(t);this.selected=[(null==t?void 0:t.id)??this.blocks[0]],null==e||e.focus(),null==e||e.$el.scrollIntoView({block:"nearest"})},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){Vue.set(t,"isHidden",!0),this.save()},isInputEvent(){const t=document.querySelector(":focus");return null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer")},isLastSelected(t){const[e]=this.selected.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected.includes(t.id)},async merge(){if(this.isMergable){const t=this.selected.map((t=>this.find(t)));this.ref(t[0]).$refs.editor.merge(t);for(const e of t.slice(1))this.remove(e);await this.$nextTick(),this.focus(t[0])}},move(t){if(t.from!==t.to){const e=t.draggedContext.element,i=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(i.fieldsets).includes(e.type))return!1;if(!0===i.isFull)return!1}return!0},onBlur(){0===this.selected.length&&(this.isMultiSelectKey=!1)},onClickBlock(t,e){e&&this.isMultiSelectKey&&this.onKey(e),this.isMultiSelectKey&&(e.preventDefault(),e.stopPropagation(),this.isSelected(t)?this.deselect(t):this.select(t))},onClickGlobal(t){var e;if("function"==typeof t.target.closest&&(t.target.closest(".k-dialog")||t.target.closest(".k-drawer")))return;const i=document.querySelector(".k-overlay:last-of-type");!1!==this.$el.contains(t.target)||!1!==(null==i?void 0:i.contains(t.target))?i&&!1===(null==(e=this.$el.closest(".k-layout-column"))?void 0:e.contains(t.target))&&this.deselectAll():this.deselectAll()},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&!0!==this.isInputEvent(t)&&this.copy(t)},onFocus(t){!1===this.isMultiSelectKey&&(this.selected=[t.id])},async onKey(t){if(this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey,"Escape"===t.code&&this.selected.length>1){const t=this.find(this.selected[0]);await this.$nextTick(),this.focus(t)}},onPaste(t){return!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!0!==this.$panel.dialog.isOpen&&((0!==this.selected.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t,e){const i=this.$helper.clipboard.read(t);let n=await this.$api.post(this.endpoints.field+"/paste",{html:i});if(void 0===e){let t=this.selected[this.selected.length-1];-1===(e=this.findIndex(t))&&(e=this.blocks.length),e++}if(this.max){const t=this.max-this.blocks.length;n=n.slice(0,t)}this.blocks.splice(e,0,...n),this.save(),this.$panel.notification.success({message:this.$t("paste.success",{count:n.length}),icon:"download"})},pasteboard(){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:this.paste}})},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},ref(t){var e,i;return null==(i=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:i[0]},remove(t){const e=this.findIndex(t.id);-1!==e&&(this.deselect(t),this.$delete(this.blocks,e),this.save())},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.all"),submitButton:this.$t("delete.all")},on:{submit:()=>{this.selected=[],this.blocks=[],this.save(),this.$panel.dialog.close()}}})},removeSelected(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.blocks.delete.confirm.selected")},on:{submit:()=>{for(const t of this.selected){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.blocks)},select(t){!1===this.isSelected(t)&&this.selected.push(t.id)},selectDown(){const t=this.selected[this.selected.length-1],e=this.findIndex(t)+1;e=0&&this.select(this.blocks[e])},selectAll(){this.selected=Object.values(this.blocks).map((t=>t.id))},show(t){Vue.set(t,"isHidden",!1),this.save()},async sort(t,e,i){if(i<0)return;let n=structuredClone(this.blocks);n.splice(e,1),n.splice(i,0,t),this.blocks=n,this.save(),await this.$nextTick(),this.focus(t)},async split(t,e,i){const n=structuredClone(t);n.content={...n.content,...i[0]};const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t.type);s.content={...s.content,...n.content,...i[1]},this.blocks.splice(e,1,n,s),this.save(),await this.$nextTick(),this.focus(s)},update(t,e){const i=this.findIndex(t.id);if(-1!==i)for(const n in e)Vue.set(this.blocks[i].content,n,e[n]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-blocks",attrs:{"data-disabled":t.disabled,"data-empty":0===t.blocks.length}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",attrs:{"data-multi-select-key":t.isMultiSelectKey},on:{sort:t.save},scopedSlots:t._u([0===t.blocks.length?{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty??t.$t("field.blocks.empty"))+" ")])]},proxy:!0}:null],null,!0)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(i,n){return e("k-block",t._b({key:i.id,ref:"block-"+i.id,refInFor:!0,on:{append:function(e){return t.add(e,n+1)},chooseToAppend:function(e){return t.choose(n+1)},chooseToConvert:function(e){return t.chooseToConvert(i)},chooseToPrepend:function(e){return t.choose(n)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},duplicate:function(e){return t.duplicate(i,n)},focus:function(e){return t.onFocus(i)},hide:function(e){return t.hide(i)},merge:function(e){return t.merge()},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,n)},remove:function(e){return t.remove(i)},removeSelected:t.removeSelected,show:function(e){return t.show(i)},selectDown:t.selectDown,selectUp:t.selectUp,sortDown:function(e){return t.sort(i,n,n+1)},sortUp:function(e){return t.sort(i,n,n-1)},split:function(e){return t.split(i,n,e)},update:function(e){return t.update(i,e)}},nativeOn:{click:function(e){return t.onClickBlock(i,e)}}},"k-block",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldset:t.fieldset(i),isBatched:t.isSelected(i)&&t.selected.length>1,isFull:t.isFull,isHidden:!0===i.isHidden,isLastSelected:t.isLastSelected(i),isMergable:t.isMergable,isSelected:t.isSelected(i),next:t.prevNext(n+1),prev:t.prevNext(n-1)},!1))})),1)]:e("k-empty",{attrs:{icon:"box"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const ii=ut({inheritAttrs:!1,emits:["close","paste","submit"],computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{paste(t){this.$emit("close"),this.$emit("paste",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,visible:!0,size:"large"},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit")}}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.paste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports;const ni=ut({inheritAttrs:!1,props:{disabledFieldsets:{default:()=>[],type:Array},fieldsets:{type:Object},fieldsetGroups:{type:Object},headline:{type:String},size:{type:String,default:"medium"},value:{default:null,type:String}},emits:["cancel","input","paste","submit"],data:()=>({selected:null}),computed:{groups(){const t={};let e=0;const i=this.fieldsetGroups??{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};for(const n in i){const s=i[n];s.open=!1!==s.open,s.fieldsets=s.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==s.fieldsets.length&&(t[n]=s)}return t},shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},mounted(){this.$events.on("paste",this.paste)},destroyed(){this.$events.off("paste",this.paste)},methods:{paste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{staticClass:"k-block-selector",attrs:{"cancel-button":!1,size:t.size,"submit-button":!1,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},submit:function(e){return t.$emit("submit",t.value)}}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(i,n){return e("details",{key:n,attrs:{open:i.open}},[e("summary",[t._v(t._s(i.label))]),e("k-navigate",{staticClass:"k-block-types"},t._l(i.fieldsets,(function(i){return e("k-button",{key:i.name,attrs:{disabled:t.disabledFieldsets.includes(i.type),icon:i.icon??"box",text:i.name,size:"lg"},on:{click:function(e){return t.$emit("submit",i.type)}},nativeOn:{focus:function(e){return t.$emit("input",i.type)}}})})),1)],1)})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const si=ut({props:{value:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-background-dropdown"},[e("k-button",{attrs:{dropdown:!0,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[e("k-color-frame",{attrs:{color:t.value,ratio:"1/1"}})],1),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end",options:[{text:t.$t("field.blocks.figure.back.plain"),click:"var(--color-white)"},{text:t.$t("field.blocks.figure.back.pattern.light"),click:"var(--pattern-light)"},{text:t.$t("field.blocks.figure.back.pattern.dark"),click:"var(--pattern)"}]},on:{action:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const oi=ut({inheritAttrs:!1,props:{back:String,caption:String,captionMarks:{default:!0,type:[Boolean,Array]},disabled:Boolean,isEmpty:Boolean,emptyIcon:String,emptyText:String},emits:["open","update"]},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure",style:{"--block-figure-back":t.back},attrs:{"data-empty":t.isEmpty}},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{disabled:t.disabled,icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",attrs:{"data-disabled":t.disabled},on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const li=ut({props:{disabled:Boolean,marks:[Array,Boolean],value:String}},(function(){var t=this,e=t._self._c;return e("figcaption",{staticClass:"k-block-figure-caption"},[e("k-writer",{attrs:{disabled:t.disabled,inline:!0,marks:t.marks,spellcheck:!1,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})],1)}),[],!1,null,null,null,null).exports;const ai=ut({extends:Ge,computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-input",{ref:"language",attrs:{disabled:t.disabled,empty:!1,options:t.languages,value:t.content.language,icon:"code",type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const ri=ut({extends:Ge,props:{tabs:Object},data(){return{collapsed:this.state(),tab:Object.keys(this.tabs)[0]}},computed:{fields(){var t;return null==(t=this.tabs[this.tab])?void 0:t.fields},values(){return Object.assign({},this.content)}},methods:{open(){this.$emit("open",this.tab)},state(t){const e=`kirby.fieldsBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return JSON.parse(sessionStorage.getItem(e));sessionStorage.setItem(e,t)},toggle(){this.collapsed=!this.collapsed,this.state(this.collapsed)}}},(function(){var t=this,e=t._self._c;return e("div",{attrs:{"data-collapsed":t.collapsed},on:{dblclick:function(e){!t.fieldset.wysiwyg&&t.$emit("open")}}},[e("header",{staticClass:"k-block-type-fields-header"},[e("k-block-title",{attrs:{content:t.values,fieldset:t.fieldset},nativeOn:{click:function(e){return t.toggle.apply(null,arguments)}}}),t.collapsed?t._e():e("k-drawer-tabs",{attrs:{tab:t.tab,tabs:t.fieldset.tabs},on:{open:function(e){t.tab=e}}})],1),t.collapsed?t._e():e("k-form",{ref:"form",staticClass:"k-block-type-fields-form",attrs:{autofocus:!0,disabled:t.disabled||!t.fieldset.wysiwyg,fields:t.fields,value:t.values},on:{input:function(e){return t.$emit("update",e)}}})],1)}),[],!1,null,null,null,null).exports;const ui=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop},isEmpty(){var t;return!(null==(t=this.content.images)?void 0:t.length)},ratio(){return this.content.ratio}},methods:{onBack(t){const e=`kirby.galleryBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("figure",{style:{"--block-back":t.back},attrs:{"data-empty":t.isEmpty}},[e("ul",{on:{dblclick:t.open}},[t.isEmpty?t._l(3,(function(i){return e("li",{key:i,staticClass:"k-block-type-gallery-placeholder"},[e("k-image-frame",{attrs:{ratio:t.ratio}})],1)})):[t._l(t.content.images,(function(i){return e("li",{key:i.id},[e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,src:i.url,srcset:i.image.srcset,alt:i.alt}})],1)})),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]],2),t.content.caption?e("k-block-figure-caption",{attrs:{disabled:t.disabled,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const ci=ut({extends:Ge,inheritAttrs:!1,emits:["append","open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.$refs.input.isCursorAtStart&&!1===this.$refs.input.isCursorAtEnd},keys(){return{Enter:()=>!0===this.$refs.input.isCursorAtEnd?this.$emit("append","text"):this.split(),"Mod-Enter":this.split}},levels(){return this.field("level",{options:[]}).options},textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()},merge(t){this.update({text:t.map((t=>t.content.text)).join(" ")})},split(){var t,e;const i=null==(e=(t=this.$refs.input).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0]},{level:"h"+Math.min(parseInt(this.content.level.slice(1))+1,6),text:i[1]}])}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",t._b({ref:"input",attrs:{disabled:t.disabled,inline:!0,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"k-writer",t.textField,!1)),t.levels.length>1?e("k-input",{ref:"level",staticClass:"k-block-type-heading-level",attrs:{disabled:t.disabled,empty:!1,options:t.levels,value:t.content.level,type:"select"},on:{input:function(e){return t.update({level:e})}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const di=ut({extends:Ge,data(){return{back:this.onBack()??"white"}},computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop??!1},src(){var t,e;return"web"===this.content.location?this.content.src:!!(null==(e=null==(t=this.content.image)?void 0:t[0])?void 0:e.url)&&this.content.image[0].url},ratio(){return this.content.ratio??!1}},methods:{onBack(t){const e=`kirby.imageBlock.${this.endpoints.field}.${this.id}`;if(void 0===t)return sessionStorage.getItem(e);this.back=t,sessionStorage.setItem(e,t)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{back:t.back,caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …",disabled:t.disabled,"is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-image-frame",{attrs:{ratio:t.ratio,cover:t.crop,alt:t.content.alt,src:t.src}}):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}}),e("k-block-background-dropdown",{attrs:{value:t.back},on:{input:t.onBack}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const pi=ut({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports;const hi=ut({extends:Ge,emits:["open","split","update"],computed:{isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){return{"Mod-Enter":this.split}},marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join("").replaceAll("

      ","")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&this.$emit("split",[{text:i[0].replace(/(
    • <\/p><\/li><\/ul>)$/,"

    ")},{text:i[1].replace(/^(
    • <\/p><\/li>)/,"

        ")}])}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{disabled:t.disabled,keys:t.keys,marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const mi=ut({extends:Ge,computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,disabled:t.disabled,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,font:"monospace",type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports;const fi=ut({extends:Ge,computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{disabled:t.disabled,inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{disabled:t.disabled,inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports;const gi=ut({extends:Ge,inheritAttrs:!1,computed:{columns(){return this.table.columns??this.fields},fields(){return this.table.fields??{}},rows(){return this.content.rows??[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs??{}))e.fields.rows&&(t=e.fields.rows);return t??{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports;const ki=ut({extends:Ge,emits:["open","split","update"],computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer-input"},isSplitable(){return this.content.text.length>0&&!1===this.input().isCursorAtStart&&!1===this.input().isCursorAtEnd},keys(){const t={"Mod-Enter":this.split};return!0===this.textField.inline&&(t.Enter=this.split),t},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()},input(){return this.$refs.input.$refs.input},merge(t){this.update({text:t.map((t=>t.content.text)).join(this.textField.inline?" ":"")})},split(){var t,e;const i=null==(e=(t=this.input()).getSplitContent)?void 0:e.call(t);i&&("writer"===this.textField.type&&(i[0]=i[0].replace(/(

        <\/p>)$/,""),i[1]=i[1].replace(/^(

        <\/p>)/,"")),this.$emit("split",i.map((t=>({text:t})))))}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{disabled:t.disabled,keys:t.keys,value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports;const bi=ut({extends:Ge,computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},location(){return this.content.location},poster(){var t,e;return null==(e=null==(t=this.content.poster)?void 0:t[0])?void 0:e.url},video(){var t,e;return"kirby"===this.content.location?null==(e=null==(t=this.content.video)?void 0:t[0])?void 0:e.url:this.$helper.embed.video(this.content.url??"",!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{staticClass:"k-block-type-video-figure",attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,disabled:t.disabled,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-frame",{attrs:{ratio:"16/9"}},[t.video?["kirby"==t.location?e("video",{attrs:{src:t.video,poster:t.poster,controls:""}}):e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}})]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,vi={install(t){t.component("k-block",Qe),t.component("k-blocks",ei),t.component("k-block-options",Ze),t.component("k-block-pasteboard",ii),t.component("k-block-selector",ni),t.component("k-block-background-dropdown",si),t.component("k-block-figure",oi),t.component("k-block-figure-caption",li),t.component("k-block-title",We),t.component("k-block-type-code",ai),t.component("k-block-type-default",Ge),t.component("k-block-type-fields",ri),t.component("k-block-type-gallery",ui),t.component("k-block-type-heading",ci),t.component("k-block-type-image",di),t.component("k-block-type-line",pi),t.component("k-block-type-list",hi),t.component("k-block-type-markdown",mi),t.component("k-block-type-quote",fi),t.component("k-block-type-table",gi),t.component("k-block-type-text",ki),t.component("k-block-type-video",bi)}};const yi=ut({mixins:[Fe,ti],inheritAttrs:!1,data:()=>({opened:[]}),computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},isFull(){return this.max&&this.value.length>=this.max},options(){return[{click:()=>this.$refs.blocks.copyAll(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.blocks.pasteboard(),disabled:this.isFull,icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.blocks.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,disabled:t.isFull,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-blocks",t._g(t._b({ref:"blocks",on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},"k-blocks",t.$props,!1),t.$listeners)),t.disabled||t.isEmpty||t.isFull||!t.hasFieldsets?t._e():e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)],1)}),[],!1,null,null,null,null).exports,$i={mixins:[Ie,st],props:{columns:{default:1,type:Number},max:Number,min:Number,theme:String,value:{type:Array,default:()=>[]}}};const wi=ut({mixins:[De,$i],data:()=>({selected:[]}),computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.selected.includes(t.value),disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"checkbox",value:t.value})))}},watch:{value:{handler(t){this.selected=Array.isArray(t)?t:[],this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},input(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},select(){this.focus()},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{selected:{required:!this.required||t.required,min:!this.min||t.minLength(this.min),max:!this.max||t.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.input(i.value,e)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports,xi={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){const t=this.counterValue??this.value;return!(!1===this.counter||this.disabled||!t)&&{count:Array.isArray(t)?t.length:String(t).length,min:this.$props.min??this.$props.minlength,max:this.$props.max??this.$props.maxlength}},counterValue:()=>null}};const _i=ut({mixins:[Fe,Ue,$i,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-checkboxes-field",attrs:{input:e.id+"-0",counter:e.counterOptions}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-checkboxes-input",e._g(e._b({ref:"input"},"k-checkboxes-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ci={mixins:[Ie,H,J,et,it,ot,lt,rt],props:{ariaLabel:String,type:{default:"text",type:String},value:{type:String}}};const Si=ut({mixins:[De,Ci]},(function(){var t=this;return(0,t._self._c)("input",t._b({directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-string-input",attrs:{"aria-label":t.ariaLabel,"data-font":t.font},on:{input:function(e){return t.$emit("input",e.target.value)}}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,maxlength:t.maxlength,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1))}),[],!1,null,null,null,null).exports,Oi={mixins:[Ci],props:{autocomplete:null,font:null,maxlength:null,minlength:null,pattern:null,spellcheck:null,alpha:{type:Boolean,default:!0},format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)}}};const Mi=ut({mixins:[Si,Oi],watch:{value(){this.validate()}},mounted(){this.validate()},methods:{convert(t){if(!t)return t;try{return this.$library.colors.toString(t,this.format,this.alpha)}catch{const e=document.createElement("div");return e.style.color=t,document.body.append(e),t=window.getComputedStyle(e).color,e.remove(),this.$library.colors.toString(t,this.format,this.alpha)}},convertAndEmit(t){this.emit(this.convert(t))},emit(t){this.$emit("input",t)},onBlur(){this.convertAndEmit(this.value)},onPaste(t){t instanceof ClipboardEvent&&(t=this.$helper.clipboard.read(t,!0)),this.convertAndEmit(t)},async onSave(){var t;this.convertAndEmit(this.value),await this.$nextTick(),null==(t=this.$el.form)||t.requestSubmit()},validate(){let t="";null===this.$library.colors.parse(this.value)&&(t=this.$t("error.validation.color",{format:this.format})),this.$el.setCustomValidity(t)}}},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-colorname-input",attrs:{spellcheck:!1,autocomplete:"off",type:"text"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{blur:function(e){return t.onBlur.apply(null,arguments)},paste:function(e){return t.onPaste.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onSave.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}]}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Ai=ut({mixins:[Fe,Ue,Oi],inheritAttrs:!1,props:{icon:{type:String,default:"pipette"},mode:{type:String,default:"picker",validator:t=>["picker","input","options"].includes(t)},options:{type:Array,default:()=>[]}},computed:{convertedOptions(){return this.options.map((t=>({...t,value:this.convert(t.value)})))},currentOption(){return this.convertedOptions.find((t=>t.value===this.value))}},methods:{convert(t){return this.$library.colors.toString(t,this.format,this.alpha)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-color-field",attrs:{input:e.id}},"k-field",e.$props,!1),["options"===e.mode?i("k-coloroptions-input",e._b({staticClass:"k-color-field-options",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}}},"k-coloroptions-input",e.$props,!1)):i("k-input",e._b({attrs:{type:"color"},scopedSlots:e._u([{key:"before",fn:function(){return["picker"===e.mode?[i("button",{staticClass:"k-color-field-picker-toggle",attrs:{disabled:e.disabled,type:"button"},on:{click:function(t){return e.$refs.picker.toggle()}}},[i("k-color-frame",{attrs:{color:e.value}})],1),i("k-dropdown-content",{ref:"picker",staticClass:"k-color-field-picker"},[i("k-colorpicker-input",e._b({ref:"color",attrs:{options:e.convertedOptions},on:{input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){t.stopPropagation()}}},"k-colorpicker-input",e.$props,!1))],1)]:i("k-color-frame",{attrs:{color:e.value}})]},proxy:!0},{key:"default",fn:function(){return[i("k-colorname-input",e._b({on:{input:function(t){return e.$emit("input",t)}}},"k-colorname-input",e.$props,!1))]},proxy:!0},(null==(t=e.currentOption)?void 0:t.text)?{key:"after",fn:function(){return[i("span",{domProps:{innerHTML:e._s(e.currentOption.text)}})]},proxy:!0}:null,"picker"===e.mode?{key:"icon",fn:function(){return[i("k-button",{staticClass:"k-input-icon-button",attrs:{icon:e.icon},on:{click:function(t){return t.stopPropagation(),e.$refs.picker.toggle()}}})]},proxy:!0}:null],null,!0)},"k-input",e.$props,!1))],1)}),[],!1,null,null,null,null).exports,Ii={props:{max:String,min:String,value:String}},Di={mixins:[Ie,Ii],props:{display:{type:String,default:"DD.MM.YYYY"},step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"}}};const ji=ut({mixins:[De,Di],emits:["input","focus","submit"],data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},methods:{async alter(t){let e=this.parse()??this.round(this.$library.dayjs()),i=this.rounding.unit,n=this.rounding.size;const s=this.selection();null!==s&&("meridiem"===s.unit?(t="pm"===e.format("a")?"subtract":"add",i="hour",n=12):(i=s.unit,i!==this.rounding.unit&&(n=1))),e=e[t](n,i).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),await this.$nextTick(),this.select(s)},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.validate(),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},async onEnter(){this.onBlur(),await this.$nextTick(),this.$emit("submit")},onInput(t){const e=this.parse(),i=this.pattern.format(e);if(!t||i==t)return this.commit(e),this.emit(e)},async onTab(t){if(""==this.$el.value)return;this.onBlur(),await this.$nextTick();const e=this.selection();if(this.$el&&e.start===this.$el.selectionStart&&e.end===this.$el.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else{if(this.$el&&this.$el.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$el&&this.$el.selectionEnd-1>e.end){const t=this.pattern.at(this.$el.selectionEnd,this.$el.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()},parse(){const t=this.$library.dayjs.interpret(this.$el.value,this.inputType);return this.round(t)},round(t){return null==t?void 0:t.round(this.rounding.unit,this.rounding.size)},select(t){var e;t??(t=this.selection()),null==(e=this.$el)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$el.selectionStart,this.$el.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return null==t?void 0:t.toISO(this.inputType)},validate(){var t,e,i;const n=[];this.required&&!this.dt&&n.push(this.$t("error.validation.required")),this.min&&!1===(null==(t=this.dt)?void 0:t.validate(this.min,"min",this.rounding.unit))&&n.push(this.$t("error.validation.date.after",{date:this.min})),this.max&&!1===(null==(e=this.dt)?void 0:e.validate(this.max,"max",this.rounding.unit))&&n.push(this.$t("error.validation.date.before",{date:this.max})),null==(i=this.$el)||i.setCustomValidity(n.join(", "))}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments)):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports;const Ei=ut({mixins:[Fe,Ue,Di],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},emits:["input","submit"],data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?!this.iso.date||!this.iso.time:!this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())??"")},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))??null,time:(null==e?void 0:e.toISO("time"))??null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-has-time":Boolean(t.time),"data-invalid":!t.novalidate&&t.isInvalid}},[e("k-input",t._b({ref:"dateInput",attrs:{type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon,title:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{"align-x":"end"}},[e("k-calendar",{attrs:{value:t.iso.date,min:t.min,max:t.max},on:{input:t.onDateInput}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.time.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports,Li={mixins:[Ie,J,et,it,ot,lt,rt],props:{autocomplete:{type:[Boolean,String],default:"off"},preselect:Boolean,type:{type:String,default:"text"},value:String}};const Ti=ut({mixins:[De,Li],data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength),email:"email"!==this.type||t.email,url:"url"!==this.type||t.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{"data-font":t.font}},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Bi={mixins:[Li],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const qi=ut({extends:Ti,mixins:[Bi]},null,null,!1,null,null,null,null).exports;const Pi=ut({mixins:[Fe,Ue,Bi],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ni=ut({type:"model",mixins:[Fe,V,tt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},emits:["change","input"],data(){return{selected:this.value}},computed:{buttons(){return[{autofocus:this.autofocus,text:this.$t("select"),icon:"checklist",responsive:!0,click:()=>this.open()}]},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1,theme:this.disabled?"disabled":null}},hasDropzone:()=>!1,isInvalid(){return this.required&&0===this.selected.length||this.min&&this.selected.lengththis.max},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{drop(){},focus(){},onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$panel.dialog.open({component:`k-${this.$options.type}-dialog`,props:{endpoint:this.endpoints.field,hasSearch:this.search,max:this.max,multiple:this.multiple,value:this.selected.map((t=>t.id))},on:{submit:t=>{this.select(t),this.$panel.dialog.close()}}})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){if(0===t.length)return this.selected=[],void this.onInput();this.selected=this.selected.filter((e=>t.find((t=>t.id===e.id))));for(const e of t)this.selected.find((t=>e.id===t.id))||this.selected.push(e);this.onInput()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({class:`k-models-field k-${t.$options.type}-field`,scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[e("k-button-group",{ref:"buttons",staticClass:"k-field-options",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs",variant:"filled"}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.hasDropzone},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([t.disabled?null:{key:"options",fn:function({index:i}){return[e("k-button",{attrs:{title:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(i)}}})]}}],null,!0)},"k-collection",t.collection,!1))],1)],1)}),[],!1,null,null,null,null).exports;const zi=ut({extends:Ni,type:"files",props:{uploads:[Boolean,Object,Array]},computed:{buttons(){const t=Ni.computed.buttons.call(this);return this.hasDropzone&&t.unshift({autofocus:this.autofocus,text:this.$t("upload"),responsive:!0,icon:"upload",click:()=>this.$panel.upload.pick(this.uploadOptions)}),t},emptyProps(){return{icon:"image",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.files.empty"):this.$t("field.files.empty.single"))}},hasDropzone(){return!this.disabled&&this.more&&this.uploads},uploadOptions(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,preview:this.uploads.preview,url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",on:{done:t=>{!1===this.multiple&&(this.selected=[]);for(const e of t)void 0===this.selected.find((t=>t.id===e.id))&&this.selected.push(e);this.onInput(),this.$events.emit("file.upload"),this.$events.emit("model.update")}}}}},mounted(){this.$events.on("file.delete",this.removeById)},destroyed(){this.$events.off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$panel.upload.open(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Fi=ut({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const Yi=ut({mixins:[G,Q],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{staticClass:"h2"},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Ri=ut({mixins:[G,Q],props:{icon:String,text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[t.label?e("k-headline",[t._v(t._s(t.label))]):t._e(),e("k-box",{attrs:{icon:t.icon,theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[e("k-text",{staticClass:"k-help k-field-help",attrs:{html:t.help}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Ui={props:{endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean}};const Hi=ut({mixins:[Ui],props:{blocks:Array,width:{type:String,default:"1/1"}},emits:["input"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",style:{"--width":t.width},attrs:{id:t.id,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",t._b({ref:"blocks",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}},"k-blocks",{endpoints:t.endpoints,fieldsets:t.fieldsets,fieldsetGroups:t.fieldsetGroups,group:"layout",value:t.blocks},!1))],1)}),[],!1,null,null,null,null).exports,Vi={mixins:[Ui,W],props:{columns:Array,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object}};const Ki=ut({mixins:[Vi],props:{attrs:[Array,Object]},emits:["append","change","copy","duplicate","prepend","remove","select","updateAttrs","updateColumn"],computed:{options(){return[{click:()=>this.$emit("prepend"),icon:"angle-up",text:this.$t("insert.before")},{click:()=>this.$emit("append"),icon:"angle-down",text:this.$t("insert.after")},"-",{click:()=>this.openSettings(),icon:"settings",text:this.$t("settings"),when:!1===this.$helper.object.isEmpty(this.settings)},{click:()=>this.$emit("duplicate"),icon:"copy",text:this.$t("duplicate")},{click:()=>this.$emit("change"),disabled:1===this.layouts.length,icon:"dashboard",text:this.$t("field.layout.change")},"-",{click:()=>this.$emit("copy"),icon:"template",text:this.$t("copy")},{click:()=>this.$emit("paste"),icon:"download",text:this.$t("paste.after")},"-",{click:()=>this.remove(),icon:"trash",text:this.$t("field.layout.delete")}]},tabs(){let t=this.settings.tabs;for(const[e,i]of Object.entries(t))for(const n in i.fields)t[e].fields[n].endpoints={field:this.endpoints.field+"/fields/"+n,section:this.endpoints.section,model:this.endpoints.model};return t}},methods:{openSettings(){this.$panel.drawer.open({component:"k-form-drawer",props:{icon:"settings",tabs:this.tabs,title:this.$t("settings"),value:this.attrs},on:{input:t=>this.$emit("updateAttrs",t)}})},remove(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm")},on:{submit:()=>{this.$emit("remove"),this.$panel.dialog.close()}}})}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(i,n){return e("k-layout-column",t._b({key:i.id,on:{input:function(e){return t.$emit("updateColumn",{column:i,columnIndex:n,blocks:e})}}},"k-layout-column",{...i,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets},!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{title:t.$t("settings"),icon:"settings"},on:{click:t.openSettings}}):t._e(),e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}}),e("k-sort-handle")],1)],1)}),[],!1,null,null,null,null).exports,Wi={mixins:[Vi,X],props:{empty:String,max:Number,selector:Object,value:{type:Array,default:()=>[]}}};const Ji=ut({mixins:[Wi],emits:["input"],data(){return{current:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this.id,handle:!0,list:this.rows}},hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0}},watch:{value(){this.rows=this.value}},methods:{copy(t,e){if(0===this.rows.length)return!1;const i=void 0!==e?this.rows[e]:this.rows;this.$helper.clipboard.write(JSON.stringify(i),t),this.$panel.notification.success({message:this.$t("copy.success",{count:i.length??1}),icon:"template"})},change(t,e){const i=e.columns.map((t=>t.width)),n=this.layouts.findIndex((t=>t.toString()===i.toString()));this.$panel.dialog.open({component:"k-layout-selector",props:{label:this.$t("field.layout.change"),layouts:this.layouts,selector:this.selector,value:this.layouts[n]},on:{submit:i=>{this.onChange(i,n,{rowIndex:t,layoutIndex:n,layout:e}),this.$panel.dialog.close()}}})},duplicate(t,e){const i=structuredClone(e),n=this.updateIds(i);this.rows.splice(t+1,0,...n),this.save()},async onAdd(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.save()},async onChange(t,e,i){if(e===this.layouts[i.layoutIndex])return;const n=i.layout,s=await this.$api.post(this.endpoints.field+"/layout",{attrs:n.attrs,columns:t}),o=n.columns.filter((t=>{var e;return(null==(e=null==t?void 0:t.blocks)?void 0:e.length)>0})),l=[];if(0===o.length)l.push(s);else{const t=Math.ceil(o.length/s.columns.length)*s.columns.length;for(let e=0;e{var n;return t.blocks=(null==(n=o[i+e])?void 0:n.blocks)??[],t})),t.columns.filter((t=>{var e;return null==(e=null==t?void 0:t.blocks)?void 0:e.length})).length&&l.push(t)}}this.rows.splice(i.rowIndex,1,...l),this.save()},async paste(t,e=this.rows.length){let i=await this.$api.post(this.endpoints.field+"/layout/paste",{json:this.$helper.clipboard.read(t)});i.length&&(this.rows.splice(e,0,...i),this.save()),this.$panel.notification.success({message:this.$t("paste.success",{count:i.length}),icon:"download"})},pasteboard(t){this.$panel.dialog.open({component:"k-block-pasteboard",on:{paste:e=>this.paste(e,t)}})},remove(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.layout.delete.confirm.all")},on:{submit:()=>{this.rows=[],this.save(),this.$panel.dialog.close()}}})},save(){this.$emit("input",this.rows)},select(t){if(this.nextIndex=t,1===this.layouts.length)return this.onAdd(this.layouts[0]);this.$panel.dialog.open({component:"k-layout-selector",props:{layouts:this.layouts,selector:this.selector,value:null},on:{submit:t=>{this.onAdd(t),this.$panel.dialog.close()}}})},updateAttrs(t,e){this.rows[t].attrs=e,this.save()},updateColumn(t){this.rows[t.index].columns[t.columnIndex].blocks=t.blocks,this.save()},updateIds(t){return!1===Array.isArray(t)&&(t=[t]),t.map((t=>(t.id=this.$helper.uuid(),t.columns=t.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),t)))}}},(function(){var t=this,e=t._self._c;return e("div",[t.hasFieldsets&&t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(i,n){return e("k-layout",t._b({key:i.id,on:{append:function(e){return t.select(n+1)},change:function(e){return t.change(n,i)},copy:function(e){return t.copy(e,n)},duplicate:function(e){return t.duplicate(n,i)},paste:function(e){return t.pasteboard(n+1)},prepend:function(e){return t.select(n)},remove:function(e){return t.remove(i)},select:function(e){t.selected=i.id},updateAttrs:function(e){return t.updateAttrs(n,e)},updateColumn:function(e){return t.updateColumn({layout:i,index:n,...e})}}},"k-layout",{...i,disabled:t.disabled,endpoints:t.endpoints,fieldsetGroups:t.fieldsetGroups,fieldsets:t.fieldsets,isSelected:t.selected===i.id,layouts:t.layouts,settings:t.settings},!1))})),1)]:!1===t.hasFieldsets?e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"}},[t._v(" "+t._s(t.$t("field.blocks.fieldsets.empty"))+" ")]):e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.select(0)}}},[t._v(" "+t._s(t.empty??t.$t("field.layout.empty"))+" ")])],2)}),[],!1,null,null,null,null).exports;const Gi=ut({mixins:[Fe,Wi,V],inheritAttrs:!1,computed:{hasFieldsets(){return this.$helper.object.length(this.fieldsets)>0},isEmpty(){return 0===this.value.length},options(){return[{click:()=>this.$refs.layouts.copy(),disabled:this.isEmpty,icon:"template",text:this.$t("copy.all")},{click:()=>this.$refs.layouts.pasteboard(),icon:"download",text:this.$t("paste")},"-",{click:()=>this.$refs.layouts.removeAll(),disabled:this.isEmpty,icon:"trash",text:this.$t("delete.all")}]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field",scopedSlots:t._u([!t.disabled&&t.hasFieldsets?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{staticClass:"input-focus",attrs:{autofocus:t.autofocus,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.layouts.select(0)}}}),e("k-button",{attrs:{icon:"dots",variant:"filled",size:"xs"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:t.options,"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-layouts",t._b({ref:"layouts",on:{input:function(e){return t.$emit("input",e)}}},"k-layouts",t.$props,!1)),!t.disabled&&t.hasFieldsets?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.layouts.select(t.value.length)}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Xi=ut({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const Zi=ut({mixins:[{mixins:[Fe,Ue,Ie,st],props:{value:{default:"",type:String}}}],inheritAttrs:!1,data:()=>({linkType:null,linkValue:null,expanded:!1,isInvalid:!1}),computed:{activeTypes(){return this.$helper.link.types(this.options)},activeTypesOptions(){const t=[];for(const e in this.activeTypes)t.push({click:()=>this.switchType(e),current:e===this.currentType.id,icon:this.activeTypes[e].icon,label:this.activeTypes[e].label});return t},currentType(){return this.activeTypes[this.linkType]??Object.values(this.activeTypes)[0]}},watch:{value:{async handler(t,e){if(t===e||t===this.linkValue)return;const i=this.$helper.link.detect(t,this.activeTypes);i&&(this.linkType=i.type,this.linkValue=i.link)},immediate:!0}},mounted(){this.$events.on("click",this.onOutsideClick)},destroyed(){this.$events.off("click",this.onOutsideClick)},methods:{clear(){this.linkValue="",this.$emit("input","")},focus(){var t;null==(t=this.$refs.input)||t.focus()},onInput(t){const e=(null==t?void 0:t.trim())??"";if(this.linkType??(this.linkType=this.currentType.id),this.linkValue=e,!e.length)return this.clear();this.$emit("input",this.currentType.value(e))},onInvalid(t){this.isInvalid=!!t},onOutsideClick(t){!1===this.$el.contains(t.target)&&(this.expanded=!1)},removeModel(){this.clear(),this.expanded=!1},selectModel(t){t.uuid?this.onInput(t.uuid):(this.switchType("url"),this.onInput(t.url))},async switchType(t){t!==this.currentType.id&&(this.isInvalid=!1,this.linkType=t,this.clear(),"page"===this.currentType.id||"file"===this.currentType.id?this.expanded=!0:this.expanded=!1,await this.$nextTick(),this.focus())},toggle(){this.expanded=!this.expanded}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-link-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{invalid:t.isInvalid,icon:!1}},"k-input",t.$props,!1),[e("div",{staticClass:"k-link-input-header"},[e("k-button",{staticClass:"k-link-input-toggle",attrs:{disabled:t.disabled,dropdown:!t.disabled&&t.activeTypesOptions.length>1,icon:t.currentType.icon,variant:"filled"},on:{click:function(e){t.activeTypesOptions.length>1?t.$refs.types.toggle():t.toggle()}}},[t._v(" "+t._s(t.currentType.label)+" ")]),e("k-dropdown-content",{ref:"types",attrs:{options:t.activeTypesOptions}}),"page"===t.currentType.id||"file"===t.currentType.id?e("div",{staticClass:"k-link-input-model",on:{click:t.toggle}},[e("k-link-field-preview",{attrs:{removable:!0,type:t.currentType.id,value:t.value},on:{remove:t.removeModel},scopedSlots:t._u([{key:"placeholder",fn:function(){return[e("k-button",{staticClass:"k-link-input-model-placeholder"},[t._v(" "+t._s(t.currentType.placeholder)+" ")])]},proxy:!0}],null,!1,3171606015)}),e("k-button",{staticClass:"k-link-input-model-toggle",attrs:{icon:"bars"}})],1):e("k-"+t.currentType.input+"-input",{ref:"input",tag:"component",attrs:{id:t.id,disabled:t.disabled,pattern:t.currentType.pattern??null,placeholder:t.currentType.placeholder,value:t.linkValue},on:{invalid:t.onInvalid,input:t.onInput}})],1),"page"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"page"}},[e("div",{staticClass:"k-page-browser"},[e("k-page-tree",{attrs:{current:t.$helper.link.getPageUUID(t.value),root:!1},on:{select:function(e){return t.selectModel(e)}}})],1)]):"file"===t.currentType.id?e("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"k-link-input-body",attrs:{"data-type":"file"}},[e("k-file-browser",{attrs:{opened:t.$panel.view.props.model.uuid??t.$panel.view.props.model.id,selected:t.$helper.link.getFileUUID(t.value)},on:{select:function(e){return t.selectModel(e)}}})],1):t._e()])],1)}),[],!1,null,null,null,null).exports;const Qi=t=>({$from:e})=>((t,e)=>{for(let i=t.depth;i>0;i--){const n=t.node(i);if(e(n))return{pos:i>0?t.before(i):0,start:t.start(i),depth:i,node:n}}})(e,t),tn=t=>e=>{if((t=>t instanceof o)(e)){const{node:i,$from:n}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,i))return{node:i,pos:n.pos,depth:n.depth}}},en=(t,e,i={})=>{const n=tn(e)(t.selection)||Qi((t=>t.type===e))(t.selection);return 0!==yt(i)&&n?n.node.hasMarkup(e,{...n.node.attrs,...i}):!!n};function nn(t=null,e=null){if(!t||!e)return!1;const i=t.parent.childAfter(t.parentOffset);if(!i.node)return!1;const n=i.node.marks.find((t=>t.type===e));if(!n)return!1;let s=t.index(),o=t.start()+i.offset,l=s+1,a=o+i.node.nodeSize;for(;s>0&&n.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;l{s=[...s,...t.marks]}));const o=s.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:i,to:n}=t.selection;let s=[];t.doc.nodesBetween(i,n,(t=>{s=[...s,t]}));const o=s.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},insertNode:function(t,e,i,n){return(s,o)=>{o(s.tr.replaceSelectionWith(t.create(e,i,n)).scrollIntoView())}},markInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t,r=e.length-1;let u=o,c=s;if(e[r]){const n=s+e[0].indexOf(e[r-1]),l=n+e[r-1].length-1,d=n+e[r-1].lastIndexOf(e[r]),p=d+e[r].length,h=function(t,e,i){let n=[];return i.doc.nodesBetween(t,e,((t,e)=>{n=[...n,...t.marks.map((i=>({start:e,end:e+t.nodeSize,mark:i})))]})),n}(s,o,t).filter((t=>{const{excluded:e}=t.mark.type;return e.find((t=>t.name===i.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&a.delete(n,d),c=n,u=c+e[r].length}return a.addMark(c,u,i.create(l)),a.removeStoredMark(i),a}))},markIsActive:function(t,e){const{from:i,$from:n,to:s,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||n.marks()):!!t.doc.rangeHasMark(i,s,e)},markPasteRule:function(t,e,o){const l=(i,n)=>{const a=[];return i.forEach((i=>{var s;if(i.isText){const{text:l,marks:r}=i;let u,c=0;const d=!!r.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(l));)if((null==(s=null==n?void 0:n.type)?void 0:s.allowsMarkType(e))&&u[1]){const t=u.index,n=t+u[0].length,s=t+u[0].indexOf(u[1]),l=s+u[1].length,r=o instanceof Function?o(u):o;t>0&&a.push(i.cut(c,t)),a.push(i.cut(s,l).mark(e.create(r).addToSet(i.marks))),c=n}cnew n(l(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,i=0){return Math.min(Math.max(parseInt(t,10),e),i)},nodeIsActive:en,nodeInputRule:function(t,i,n){return new e(t,((t,e,s,o)=>{const l=n instanceof Function?n(e):n,{tr:a}=t;return e[0]&&a.replaceWith(s,o,i.create(l)),a}))},pasteRule:function(t,e,o){const l=i=>{const n=[];return i.forEach((i=>{if(i.isText){const{text:s}=i;let l,a=0;do{if(l=t.exec(s),l){const t=l.index,s=t+l[0].length,r=o instanceof Function?o(l[0]):o;t>0&&n.push(i.cut(a,t)),n.push(i.cut(t,s).mark(e.create(r).addToSet(i.marks))),a=s}}while(l);anew n(l(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,i)=>{const{tr:n,selection:s}=e;let{from:o,to:l}=s;const{$from:a,empty:r}=s;if(r){const e=nn(a,t);o=e.from,l=e.to}return n.removeMark(o,l,t),i(n)}},toggleBlockType:function(t,e,i={}){return(n,s,o)=>en(n,t,i)?l(e)(n,s,o):l(t,i)(n,s,o)},toggleList:function(t,e){return(i,n,s)=>{const{schema:o,selection:l}=i,{$from:u,$to:c}=l,d=u.blockRange(c);if(!d)return!1;const p=Qi((t=>sn(t,o)))(l);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return a(e)(i,n,s);if(sn(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=i;return e.setNodeMarkup(p.pos,t),n&&n(e),!1}}return r(t)(i,n,s)}},toggleWrap:function(t,e={}){return(i,n,s)=>en(i,t,e)?u(i,n):c(t,e)(i,n,s)},updateMark:function(t,e){return(i,n)=>{const{tr:s,selection:o,doc:l}=i,{ranges:a,empty:r}=o;if(r){const{from:i,to:n}=nn(o.$from,t);l.rangeHasMark(i,n,t)&&s.removeMark(i,n,t),s.addMark(i,n,t.create(e))}else a.forEach((i=>{const{$to:n,$from:o}=i;l.rangeHasMark(o.pos,n.pos,t)&&s.removeMark(o.pos,n.pos,t),s.addMark(o.pos,n.pos,t.create(e))}));return n(s)}}};class ln{emit(t,...e){this._callbacks=this._callbacks??{};const i=this._callbacks[t]??[];for(const n of i)n.apply(this,e);return this}off(t,e){if(arguments.length){const i=this._callbacks?this._callbacks[t]:null;i&&(e?this._callbacks[t]=i.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks??{},this._callbacks[t]=this._callbacks[t]??[],this._callbacks[t].push(e),this}}class an{constructor(t=[],e){for(const i of t)i.bindEditor(e),i.init();this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((i,n)=>{const{name:s,type:o}=n,l={},a=n.commands({schema:t,utils:on,...["node","mark"].includes(o)?{type:t[`${o}s`][s]}:{}}),r=(t,i)=>{l[t]=t=>{if("function"!=typeof i||!e.editable)return!1;e.focus();const n=i(t);return"function"==typeof n?n(e.state,e.dispatch,e):n}};if("object"==typeof a)for(const[t,e]of Object.entries(a))r(t,e);else r(s,a);return{...i,...l}}),{})}buttons(t="mark"){const e={};for(const i of this.extensions)if(i.type===t&&i.button)if(Array.isArray(i.button))for(const t of i.button)e[t.id??t.name]=t;else e[i.name]=i.button;return e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,i=this.extensions){return i.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,utils:on})))}getFromNodesAndMarks(t,e,i=this.extensions){return i.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((i=>i[t]({...e,type:e.schema[`${i.type}s`][i.name],utils:on})))}inputRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},i),...this.getFromNodesAndMarks("inputRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>v(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get markViews(){return this.extensions.filter((t=>["mark"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:i})=>({...t,[e]:i})),{})}get nodeViews(){return this.extensions.filter((t=>["node"].includes(t.type))).filter((t=>t.view)).reduce(((t,{name:e,view:i})=>({...t,[e]:i})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,i)=>({...e,[i.name]:new Proxy(i.options,{set(e,i,n){const s=e[i]!==n;return Object.assign(e,{[i]:n}),s&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const i=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},i),...this.getFromNodesAndMarks("pasteRules",{schema:t},i)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof i?t:new i(t)))}}class rn{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class un extends rn{constructor(t={}){super(t)}get type(){return"node"}get schema(){return{}}commands(){return{}}}class cn extends un{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class dn extends un{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name,separator:!0}}commands({utils:t,schema:e,type:i}){return{paragraph:()=>this.editor.activeNodes.includes("bulletList")?t.toggleList(e.nodes.bulletList,e.nodes.listItem):this.editor.activeNodes.includes("orderedList")?t.toggleList(e.nodes.orderedList,e.nodes.listItem):this.editor.activeNodes.includes("quote")?t.toggleWrap(e.nodes.quote):t.setBlockType(i)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let pn=class extends un{get name(){return"text"}get schema(){return{group:"inline"}}};class hn extends ln{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return!0!==this.options.useBuiltInExtensions?[]:[new cn({inline:this.options.inline}),new pn,new dn]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){var i,n;null==(n=(i=this.commands)[t])||n.call(i,...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(i){return window.console.warn("Invalid content.","Passed value:",t,"Error:",i),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const i=`

        ${t}
        `,n=(new window.DOMParser).parseFromString(i,"text/html").body.firstElementChild;return y.fromSchema(this.schema).parse(n,e)}return!1}createEvents(){const t=this.options.events??{};for(const[e,i]of Object.entries(t))this.on(e,i);return t}createExtensions(){return new an([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,i=!0)=>{this.focused=i,this.emit(i?"focus":"blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",i);this.view.dispatch(n)};return new i({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,i)=>t(e,i,!0),blur:(e,i)=>t(e,i,!1)}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createMarkViews(){return this.extensions.markViews}createNodes(){return this.extensions.nodes}createNodeViews(){return this.extensions.nodeViews}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new $({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return w.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,x({rules:this.inputRules}),...this.pasteRules,...this.keymaps,v({Backspace:O}),v(M),this.createFocusEvents()]})}createView(){return new _(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),attributes:{class:"k-text"},editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),i=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,i))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},markViews:this.createMarkViews(),nodeViews:this.createNodeViews(),state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,i=this.state.apply(t);this.view.updateState(i),this.setActiveNodesAndMarks();const n={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",n),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",n);const{from:s,to:o}=this.state.selection,l=!e||!e.selection.eq(i.selection);this.emit(i.selection.empty?"deselect":"select",{...n,from:s,hasChanged:l,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:i}=this.selectionAtPosition(t);this.setSelection(e,i),setTimeout((()=>this.view.focus()),10)}getHTML(t=this.state.doc.content){const e=document.createElement("div"),i=C.fromSchema(this.schema).serializeFragment(t);return e.appendChild(i),this.options.inline&&e.querySelector("p")?e.querySelector("p").innerHTML:e.innerHTML}getHTMLStartToSelection(){const t=this.state.doc.slice(0,this.selection.head).content;return this.getHTML(t)}getHTMLSelectionToEnd(){const t=this.state.doc.slice(this.selection.head).content;return this.getHTML(t)}getHTMLStartToSelectionToEnd(){return[this.getHTMLStartToSelection(),this.getHTMLSelectionToEnd()]}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}insertText(t,e=!1){const{tr:i}=this.state,n=i.insertText(t);if(this.view.dispatch(n),e){const e=i.selection.from,n=e-t.length;this.setSelection(n,e)}}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,i])=>({...t,[e]:(t={})=>i(t)})),{})}removeMark(t){if(this.schema.marks[t])return on.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}get selection(){return this.state.selection}get selectionAtEnd(){return S.atEnd(this.state.doc)}get selectionIsAtEnd(){return this.selection.head===this.selectionAtEnd.head}get selectionAtStart(){return S.atStart(this.state.doc)}get selectionIsAtStart(){return this.selection.head===this.selectionAtStart.head}selectionAtPosition(t=null){return null===t?this.selection:"start"===t||!0===t?this.selectionAtStart:"end"===t?this.selectionAtEnd:{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>on.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,i])=>({...t,[e]:on.getMarkAttrs(this.state,i)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>on.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,i])=>({...t,[e]:on.getNodeAttrs(this.state,i)})),{})}setContent(t={},e=!1,i){const{doc:n,tr:s}=this.state,o=this.createDocument(t,i),l=s.replaceWith(0,n.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(l)}setSelection(t=0,e=0){const{doc:i,tr:n}=this.state,s=on.minMax(t,0,i.content.size),o=on.minMax(e,0,i.content.size),l=S.create(i,s,o),a=n.setSelection(l);this.view.dispatch(a)}get state(){var t;return null==(t=this.view)?void 0:t.state}toggleMark(t){if(this.schema.marks[t])return on.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return on.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}class mn extends rn{command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return{}}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class fn extends mn{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class gn extends mn{get button(){return{icon:"clear",label:window.panel.$t("toolbar.button.clear")}}commands(){return()=>this.clear()}clear(){const{state:t}=this.editor,{from:e,to:i}=t.tr.selection;for(const n of this.editor.activeMarks){const s=t.schema.marks[n],o=this.editor.state.tr.removeMark(e,i,s);this.editor.view.dispatch(o)}}get name(){return"clear"}}let kn=class extends mn{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}};class bn extends mn{get button(){return{icon:"email",label:window.panel.$t("toolbar.button.email")}}commands(){return{email:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("email",this.editor)},insertEmail:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&this.editor.insertText(t.href,!0),t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,i)=>{const n=this.editor.getMarkAttrs("email");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class vn extends mn{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}let yn=class extends mn{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:t=>{if(t.altKey||t.metaKey)return this.remove();this.editor.emit("link",this.editor)},insertLink:(t={})=>{const{selection:e}=this.editor.state;if(e.empty&&!1===this.editor.activeMarks.includes("link")&&this.editor.insertText(t.href,!0),t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,i)=>{const n=this.editor.getMarkAttrs("link");n.href&&!0===i.altKey&&i.target instanceof HTMLAnchorElement&&(i.stopPropagation(),window.open(n.href,n.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs},0]}}};class $n extends mn{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}let wn=class extends mn{get button(){return{icon:"superscript",label:window.panel.$t("toolbar.button.sup")}}commands(){return()=>this.toggle()}get name(){return"sup"}get schema(){return{parseDOM:[{tag:"sup"}],toDOM:()=>["sup",0]}}};class xn extends mn{get button(){return{icon:"subscript",label:window.panel.$t("toolbar.button.sub")}}commands(){return()=>this.toggle()}get name(){return"sub"}get schema(){return{parseDOM:[{tag:"sub"}],toDOM:()=>["sub",0]}}}class _n extends mn{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class Cn extends un{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"]}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-8":i.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class Sn extends un{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,t.insertNode(e))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const i=this.createHardBreak(t,e);let n={"Mod-Enter":i,"Shift-Enter":i};return this.options.enter&&(n.Enter=i),n}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class On extends un{get button(){const t=this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})));return t[t.length-1].separator=!0,t}commands({type:t,schema:e,utils:i}){let n={toggleHeading:n=>i.toggleBlockType(t,e.nodes.paragraph,n)};for(const s of this.options.levels)n[`h${s}`]=()=>i.toggleBlockType(t,e.nodes.paragraph,{level:s});return n}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((i=>e.textblockTypeInputRule(new RegExp(`^(#{1,${i}})\\s$`),t,(()=>({level:i})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((i,n)=>({...i,[`Shift-Ctrl-${n}`]:e.setBlockType(t,{level:n})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class Mn extends un{commands({type:t,utils:e}){return()=>e.insertNode(t)}inputRules({type:t,utils:e}){const i=e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t),n=i.handler;return i.handler=(t,e,i,s)=>n(t,e,i,s).replaceWith(i-1,i,""),[i]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class An extends un{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class In extends un{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList","paragraph"],separator:!0}}commands({type:t,schema:e,utils:i}){return()=>i.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:i}){return{"Shift-Ctrl-9":i.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class Dn extends un{get button(){return{id:this.name,icon:"quote",label:window.panel.$t("field.blocks.quote.name"),name:this.name}}commands({type:t,utils:e}){return()=>e.toggleWrap(t)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*>\s$/,t)]}keys({utils:t}){return{"Shift-Tab":(e,i)=>t.lift(e,i)}}get name(){return"quote"}get schema(){return{content:"block+",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}}let jn=class extends rn{commands(){return{undo:()=>A,redo:()=>I,undoDepth:()=>D,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":I,"Shift-Mod-z":I,"Mod-я":A,"Shift-Mod-я":I}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}};class En extends rn{commands(){return{insertHtml:t=>(e,i)=>{let n=document.createElement("div");n.innerHTML=t.trim();const s=y.fromSchema(e.schema).parse(n);i(e.tr.replaceSelectionWith(s).scrollIntoView())}}}}class Ln extends rn{keys(){const t={};for(const e in this.options)t[e]=()=>(this.options[e](),!0);return t}}let Tn=class extends rn{constructor(t){super(),this.writer=t}get component(){return this.writer.$refs.toolbar}init(){this.editor.on("deselect",(({event:t})=>{var e;return null==(e=this.component)?void 0:e.close(t)})),this.editor.on("select",(({hasChanged:t})=>{var e;!1!==t&&(null==(e=this.component)||e.open())}))}get type(){return"toolbar"}};const Bn={mixins:[V,W,lt,rt],props:{breaks:Boolean,code:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},extensions:Array,headings:{default:()=>[1,2,3,4,5,6],type:[Array,Boolean]},inline:Boolean,keys:Object,marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},toolbar:{type:Object,default:()=>({inline:!0})},value:{type:String,default:""}}};const qn=ut({mixins:[Bn],emits:["input"],data(){return{editor:null,json:{},html:this.value,isEmpty:!0}},computed:{isCursorAtEnd(){return this.editor.selectionIsAtEnd},isCursorAtStart(){return this.editor.selectionIsAtStart},toolbarOptions(){return{marks:Array.isArray(this.marks)?this.marks:void 0,...this.toolbar,editor:this.editor}}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new hn({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,parseOptions:{preserveWhitespace:!0},events:{link:t=>{this.$panel.dialog.open({component:"k-link-dialog",props:{value:t.getMarkAttrs("link")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleLink",e)}}})},email:t=>{this.$panel.dialog.open({component:"k-email-dialog",props:{value:this.editor.getMarkAttrs("email")},on:{cancel:()=>t.focus(),submit:e=>{this.$panel.dialog.close(),t.command("toggleEmail",e)}}})},paste:this.paste,update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new Ln(this.keys),new jn,new En,new Tn(this),...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON(),this.$panel.events.on("click",this.onBlur),this.$panel.events.on("focus",this.onBlur)},beforeDestroy(){this.editor.destroy(),this.$panel.events.off("click",this.onBlur),this.$panel.events.off("focus",this.onBlur)},methods:{command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({clear:new gn,code:new kn,underline:new _n,strike:new $n,link:new yn,email:new bn,bold:new fn,italic:new vn,sup:new wn,sub:new xn,...this.createMarksFromPanelPlugins()},this.marks)},createMarksFromPanelPlugins(){const t=window.panel.plugins.writerMarks??{},e={};for(const i in t)e[i]=Object.create(mn.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},createNodes(){const t=new Sn({text:!0,enter:this.inline});return this.filterExtensions({bulletList:new Cn,orderedList:new In,heading:new On({levels:this.headings}),horizontalRule:new Mn,listItem:new An,quote:new Dn,...this.createNodesFromPanelPlugins()},this.nodes,((e,i)=>((e.includes("bulletList")||e.includes("orderedList"))&&i.push(new An),!0===this.inline&&(i=i.filter((t=>!0===t.schema.inline))),i.push(t),i)))},createNodesFromPanelPlugins(){const t=window.panel.plugins.writerNodes??{},e={};for(const i in t)e[i]=Object.create(un.prototype,Object.getOwnPropertyDescriptors({name:i,...t[i]}));return e},getHTML(){return this.editor.getHTML()},filterExtensions(t,e,i){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let n=[];for(const s in t)e.includes(s)&&n.push(t[s]);return"function"==typeof i&&(n=i(e,n)),n},focus(){this.editor.focus()},getSplitContent(){return this.editor.getHTMLStartToSelectionToEnd()},onBlur(t){var e;!1===this.$el.contains(t.target)&&(null==(e=this.$refs.toolbar)||e.close())},onCommand(t,...e){this.editor.command(t,...e)}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty,"data-placeholder":t.placeholder,"data-toolbar-inline":Boolean(t.toolbar.inline??!0),spellcheck:t.spellcheck}},[t.editor&&!t.disabled?e("k-writer-toolbar",t._b({ref:"toolbar",on:{command:t.onCommand}},"k-writer-toolbar",t.toolbarOptions,!1)):t._e()],1)}),[],!1,null,null,null,null).exports,Pn={mixins:[Ie,Bn,et,it]};const Nn=ut({mixins:[De,Pn],computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{counterValue:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-writer-input",on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;class zn extends cn{get schema(){return{content:this.options.nodes.join("|")}}}const Fn={mixins:[Pn],inheritAttrs:!1,props:{nodes:{type:Array,default:()=>["bulletList","orderedList"]}}};const Yn=ut({mixins:[De,Fn],data(){return{list:this.value,html:this.value}},computed:{listExtensions(){return[new zn({inline:!0,nodes:this.nodes})]}},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

        |<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.listExtensions,value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports;const Rn=ut({mixins:[Fe,Ue,Fn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t.id,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"list"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Un={mixins:[W,X,st],inheritAttrs:!1,props:{layout:String,sort:{default:!1,type:Boolean},value:{default:()=>[],type:Array}}};const Hn=ut({mixins:[Un],props:{draggable:{default:!0,type:Boolean}},emits:["edit","input"],data:()=>({tags:[]}),computed:{dragOptions(){return{delay:1,disabled:!this.isDraggable,draggable:".k-tag",handle:".k-tag-text"}},isDraggable(){return!0!==this.sort&&!1!==this.draggable&&0!==this.tags.length&&!0!==this.disabled}},watch:{value:{handler(){let t=structuredClone(this.value);if(!0===this.sort){const e=[];for(const i of this.options){const n=t.indexOf(i.value);-1!==n&&(e.push(i),t.splice(n,1))}e.push(...t),t=e}this.tags=t.map(this.tag).filter((t=>t))},immediate:!0}},methods:{edit(t,e,i){!1===this.disabled&&this.$emit("edit",t,e,i)},focus(t="last"){this.$refs.navigate.move(t)},index(t){return this.tags.findIndex((e=>e.value===t.value))},input(){this.$emit("input",this.tags.map((t=>t.value)))},navigate(t){this.focus(t)},remove(t){this.tags.length<=1?this.navigate("last"):this.navigate("prev"),this.tags.splice(t,1),this.input()},option(t){return this.options.find((e=>e.value===t.value))},select(){this.focus()},tag(t){"object"!=typeof t&&(t={value:t});const e=this.option(t);return e||{text:this.$helper.string.escapeHTML(t.text??t.value),value:t.value}}}},(function(){var t=this,e=t._self._c;return e("k-navigate",{ref:"navigate",attrs:{axis:"list"===t.layout?"y":"x",select:":where(.k-tag, .k-tags-navigatable):not(:disabled)"}},[e("k-draggable",{staticClass:"k-tags",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.input},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)},t._l(t.tags,(function(i,n){return e("k-tag",{key:n,attrs:{disabled:t.disabled,image:i.image,removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(n,i)}},nativeOn:{click:function(t){t.stopPropagation()},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.edit(n,i,e)},dblclick:function(e){return t.edit(n,i,e)}}},[e("span",{domProps:{innerHTML:t._s(i.text)}})])})),1)],1)}),[],!1,null,null,null,null).exports,Vn={mixins:[nt,at,Un,je],props:{value:{default:()=>[],type:Array}},watch:{value:{handler(){this.$emit("invalid",this.$v.$invalid,this.$v)},immediate:!0}},validations(){return{value:{required:!this.required||t.required,minLength:!this.min||t.minLength(this.min),maxLength:!this.max||t.maxLength(this.max)}}},methods:{open(){this.$refs.dropdown.open(this.$el)}}};const Kn=ut({mixins:[De,Vn]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-multiselect-input"},[e("k-tags",t._b({ref:"tags",on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.open.apply(null,arguments)}}},"k-tags",t.$props,!1),[!t.max||t.value.length({editing:null}),computed:{canAdd(){return!this.max||this.value.length!1===this.value.includes(t.value)))},picklist(){return{disabled:this.disabled,create:this.showCreate,ignore:this.ignore,min:this.min,max:this.max,search:this.showSearch}},replacableOptions(){return this.options.filter((t=>{var e;return!1===this.value.includes(t.value)||t.value===(null==(e=this.editing)?void 0:e.tag.value)}))},showCreate(){return"options"!==this.accept&&(!this.editing||{submit:this.$t("replace.with")})},showSearch(){return!1!==this.search&&(this.editing?{placeholder:this.$t("replace.with"),...this.search}:"options"===this.accept?{placeholder:this.$t("filter"),...this.search}:this.search)}},methods:{create(t){const e=t.split(this.separator).map((t=>t.trim())),i=structuredClone(this.value);for(let n of e)n=this.$refs.tags.tag(n,this.separator),!0===this.isAllowed(n)&&i.push(n.value);this.$emit("input",i),this.$refs.create.close()},async edit(t,e){this.editing={index:t,tag:e},this.$refs.replace.open()},focus(){this.canAdd&&this.$refs.create.open()},isAllowed(t){return"object"==typeof t&&0!==t.value.trim().length&&(!("options"===this.accept&&!this.$refs.tags.option(t))&&!0!==this.value.includes(t.value))},pick(t){this.$emit("input",t),this.$refs.create.close()},replace(t){const{index:e}=this.editing,i=this.$refs.tags.tag(t);if(this.$refs.replace.close(),this.editing=null,!1===this.isAllowed(i))return!1;const n=structuredClone(this.value);n.splice(e,1,i.value),this.$emit("input",n),this.$refs.tags.navigate(e)},toggle(t){return!(t.metaKey||t.altKey||t.ctrlKey)&&("ArrowDown"===t.key?(this.$refs.create.open(),void t.preventDefault()):void(String.fromCharCode(t.keyCode).match(/(\w)/g)&&this.$refs.create.open()))}}},(function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"k-tags-input",attrs:{"data-can-add":e.canAdd}},[i("k-tags",e._b({ref:"tags",on:{edit:e.edit,input:function(t){return e.$emit("input",t)}},nativeOn:{click:function(t){var i,n;t.stopPropagation(),null==(n=null==(i=e.$refs.toggle)?void 0:i.$el)||n.click()}}},"k-tags",e.$props,!1),[e.canAdd?i("k-button",{ref:"toggle",staticClass:"k-tags-input-toggle k-tags-navigatable input-focus",attrs:{id:e.id,autofocus:e.autofocus,disabled:e.disabled,size:"xs",icon:"add"},on:{click:function(t){return e.$refs.create.open()}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.$refs.tags.focus("prev")},function(t){return e.toggle.apply(null,arguments)}]}}):e._e()],1),i("k-picklist-dropdown",e._b({ref:"replace",attrs:{multiple:!1,options:e.replacableOptions,value:(null==(t=e.editing)?void 0:t.tag.value)??""},on:{create:e.replace,input:e.replace}},"k-picklist-dropdown",e.picklist,!1)),i("k-picklist-dropdown",e._b({ref:"create",attrs:{options:e.creatableOptions,value:e.value},on:{create:e.create,input:e.pick}},"k-picklist-dropdown",e.picklist,!1))],1)}),[],!1,null,null,null,null).exports;const Gn=ut({mixins:[Fe,Ue,Wn,xi],inheritAttrs:!1,computed:{hasNoOptions(){return 0===this.options.length&&"options"===this.accept}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Xn=ut({extends:Gn,inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[t.hasNoOptions?e("k-empty",{attrs:{icon:t.icon,text:t.$t("options.none")}}):e("k-input",t._g(t._b({ref:"input",attrs:{type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Zn={mixins:[Ie,lt],props:{max:Number,min:Number,name:[Number,String],preselect:Boolean,step:[Number,String],value:{type:[Number,String],default:""}}};const Qn=ut({mixins:[De,Zn],data(){return{number:this.format(this.value),stepNumber:this.format(this.step),timeout:null,listeners:{...this.$listeners,input:t=>this.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step??0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length??0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const ts=ut({mixins:[Fe,Ue,Zn],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const es=ut({mixins:[Fe,Ue],props:{empty:String,fields:[Object,Array],value:[String,Object]},data:()=>({object:{}}),computed:{hasFields(){return this.$helper.object.length(this.fields)>0},isEmpty(){return null===this.object||0===this.$helper.object.length(this.object)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value:{handler(t){this.object=this.valueToObject(t)},immediate:!0}},methods:{add(){this.object=this.$helper.field.form(this.fields),this.save(),this.open()},cell(t,e){this.$set(this.object,t,e),this.save()},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},remove(){this.object={},this.save()},open(t){if(this.disabled)return!1;this.$panel.drawer.open({component:"k-form-drawer",props:{breadcrumb:[],icon:"box",tab:"object",tabs:{object:{fields:this.form(t)}},title:this.label,value:this.object},on:{input:t=>{for(const e in t)this.$set(this.object,e,t[e]);this.save()}}})},save(){this.$emit("input",this.object)},valueToObject:t=>"object"!=typeof t?{}:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([!t.disabled&&t.hasFields?{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add",size:"xs",variant:"filled"},on:{click:t.add}}):e("k-button",{attrs:{icon:"remove",size:"xs",variant:"filled"},on:{click:t.remove}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.add}},[t._v(" "+t._s(t.empty??t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"aria-disabled":t.disabled,"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(i){return[i.saveable&&t.$helper.field.isVisible(i,t.value)?e("tr",{key:i.name,on:{click:function(e){return t.open(i.name)}}},[e("th",{attrs:{"data-has-button":"","data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(i.label))])]),e("k-table-cell",{attrs:{column:i,field:i,mobile:!0,value:t.object[i.name]},on:{input:function(e){return t.cell(i.name,e)}}})],1):t._e()]}))],2)])]:[e("k-empty",{attrs:{icon:"box"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports;const is=ut({extends:Ni,type:"pages",computed:{emptyProps(){return{icon:"page",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.pages.empty"):this.$t("field.pages.empty.single"))}}}},null,null,!1,null,null,null,null).exports,ns={mixins:[Li],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ss=ut({extends:Ti,mixins:[ns]},null,null,!1,null,null,null,null).exports;const os=ut({mixins:[Fe,Ue,ns,xi],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t.id,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ls={mixins:[Ie,st],props:{columns:Number,reset:{default:!0,type:Boolean},theme:String,value:[String,Number,Boolean]}};const as=ut({mixins:[De,ls],computed:{choices(){return this.options.map(((t,e)=>({autofocus:this.autofocus&&0===e,checked:this.value===t.value,disabled:this.disabled||t.disabled,id:`${this.id}-${e}`,info:t.info,label:t.text,name:this.name??this.id,type:"radio",value:t.value})))}},watch:{value:{handler(){this.validate()},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},select(){this.focus()},toggle(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},validate(){this.$emit("invalid",this.$v.$invalid,this.$v)}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input k-grid",style:{"--columns":t.columns},attrs:{"data-variant":"choices"}},t._l(t.choices,(function(i,n){return e("li",{key:n},[e("k-choice-input",t._b({on:{input:function(e){return t.$emit("input",i.value)}},nativeOn:{click:function(e){return e.stopPropagation(),t.toggle(i.value)}}},"k-choice-input",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const rs=ut({mixins:[Fe,Ue,ls],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-radio-field",attrs:{input:e.id+"-0"}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-radio-input",e._g(e._b({ref:"input"},"k-radio-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,us={mixins:[Ie],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:[Number,String],default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const cs=ut({mixins:[De,us],computed:{baseline(){return this.min<0?0:this.min},isEmpty(){return""===this.value||void 0===this.value||null===this.value},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default??this.baseline}},watch:{position(){this.onInvalid()},value(){this.validate()}},mounted(){this.onInvalid(),this.validate(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",i=this.step.toString().split("."),n=i.length>1?i[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)},validate(){var t;const e=[];this.required&&!0===this.isEmpty&&e.push(this.$t("error.validation.required")),!1===this.isEmpty&&this.min&&this.valuethis.max&&e.push(this.$t("error.validation.max",{max:this.max})),null==(t=this.$refs.range)||t.setCustomValidity(e.join(", "))}},validations(){return{position:{required:!this.required||t.required,min:!this.min||t.minValue(this.min),max:!this.max||t.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-range-input",attrs:{"data-disabled":t.disabled}},[e("input",t._b({ref:"range",attrs:{type:"range"},domProps:{value:t.position},on:{input:function(e){return t.$emit("input",e.target.valueAsNumber)}}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1)),t.tooltip?e("output",{staticClass:"k-range-input-tooltip",attrs:{for:t.id}},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const ds=ut({mixins:[Ue,Fe,us],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ps={mixins:[Ie,st,lt],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},value:{type:[String,Number,Boolean],default:""}}};const hs=ut({mixins:[De,ps],emits:["click","input"],data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder??"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},isEmpty(){return null===this.selected||void 0===this.selected||""===this.selected},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;for(const i of this.options)i.value==t&&(e=i.text);return e}},validations(){return{selected:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":t.isEmpty}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(i){return e("option",{key:i.value,attrs:{disabled:i.disabled},domProps:{value:i.value}},[t._v(" "+t._s(i.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports;const ms=ut({mixins:[Fe,Ue,ps],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,fs={mixins:[Li],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const gs=ut({extends:Ti,mixins:[fs],data(){return{slug:this.sluggify(this.value),slugs:this.$panel.language.rules??this.$panel.system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$panel.system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports;const ks=ut({mixins:[Fe,Ue,fs],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;let e=null==(t=this.wizard)?void 0:t.field;if(e){const t=this.formData[e.toLowerCase()];t&&(this.slug=t)}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t.id,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"sparkling",size:"xs",variant:"filled"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{value:t.slug,type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const bs=ut({mixins:[Fe],inheritAttrs:!1,props:{autofocus:Boolean,columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:[Array,Object],limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data:()=>({items:[],page:1}),computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},hasFields(){return this.$helper.object.length(this.fields)>0},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more;return t.push({icon:"edit",text:this.$t("edit"),click:"edit"}),t.push({disabled:!e,icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push("-"),t.push({icon:"trash",text:e?this.$t("delete"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value:{handler(t){t!==this.items&&(this.items=this.toItems(t))},immediate:!0}},methods:{add(t=null){if(!1===this.more)return!1;(t=t??this.$helper.field.form(this.fields))._id=t._id??this.$helper.uuid(),!0===this.prepend?this.items.unshift(t):this.items.push(t),this.save(),this.open(t)},close(){this.$panel.drawer.close(this.id)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},form(t){const e=this.$helper.field.subfields(this,this.fields);if(t)for(const i in e)e[i].autofocus=i===t;return e},findIndex(t){return this.items.findIndex((e=>e._id===t._id))},navigate(t,e){const i=this.findIndex(t);!0!==this.disabled&&-1!==i&&this.open(this.items[i+e],null,!0)},open(t,e,i=!1){const n=this.findIndex(t);if(!0===this.disabled||-1===n)return!1;this.$panel.drawer.open({component:"k-structure-drawer",id:this.id,props:{icon:this.icon??"list-bullet",next:this.items[n+1],prev:this.items[n-1],tabs:{content:{fields:this.form(e)}},title:this.label,value:t},replace:i,on:{input:e=>{const i=this.findIndex(t);this.$panel.drawer.props.next=this.items[i+1],this.$panel.drawer.props.prev=this.items[i-1],this.$set(this.items,i,e),this.save()},next:()=>{this.navigate(t,1)},prev:()=>{this.navigate(t,-1)},remove:()=>{this.remove(t)}}})},option(t,e){switch(t){case"remove":this.remove(e);break;case"duplicate":this.add({...structuredClone(e),_id:this.$helper.uuid()});break;case"edit":this.open(e)}},paginate({page:t}){this.page=t},remove(t){const e=this.findIndex(t);this.disabled||-1===e||this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm")},on:{submit:()=>{this.items.splice(e,1),this.save(),this.$panel.dialog.close(),this.close(),0===this.paginatedItems.length&&this.page>1&&this.page--}}})},removeAll(){this.$panel.dialog.open({component:"k-remove-dialog",props:{text:this.$t("field.structure.delete.confirm.all")},on:{submit:()=>{this.page=1,this.items=[],this.save(),this.$panel.dialog.close()}}})},save(t=this.items){this.$emit("input",t)},sort(t){return this.sortBy?this.$helper.array.sortBy(t,this.sortBy):t},toItems(t){return!1===Array.isArray(t)?[]:(t=t.map((t=>({_id:t._id??this.$helper.uuid(),...t}))),this.sort(t))}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([t.hasFields&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{attrs:{layout:"collapsed"}},[e("k-button",{attrs:{autofocus:t.autofocus,disabled:!t.more,responsive:!0,text:t.$t("add"),icon:"add",variant:"filled",size:"xs"},on:{click:function(e){return t.add()}}}),e("k-button",{attrs:{icon:"dots",size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{options:[{click:()=>t.add(),disabled:!t.more,icon:"add",text:t.$t("add")},{click:()=>t.removeAll(),disabled:0===t.items.length||t.disabled,icon:"trash",text:t.$t("delete.all")}],"align-x":"end"}})],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[t.hasFields?[0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:function(e){return t.add()}}},[t._v(" "+t._s(t.empty??t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.open(e.row,e.columnIndex)},input:t.save,option:t.option,paginate:t.paginate}}),t.more?e("footer",[e("k-button",{attrs:{title:t.$t("add"),icon:"add",size:"xs",variant:"filled"},on:{click:function(e){return t.add()}}})],1):t._e()]]:[e("k-empty",{attrs:{icon:"list-bullet"}},[t._v(t._s(t.$t("fields.empty")))])]],2)}),[],!1,null,null,null,null).exports,vs={mixins:[Li],props:{autocomplete:{default:"tel"},placeholder:{default:()=>window.panel.$t("tel.placeholder")},type:{default:"tel"}}};const ys=ut({extends:Ti,mixins:[vs]},null,null,!1,null,null,null,null).exports;const $s=ut({mixins:[Fe,Ue,vs],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const ws=ut({mixins:[Fe,Ue,Li,xi],inheritAttrs:!1,computed:{inputType(){return this.$helper.isComponent(`k-${this.type}-input`)?this.type:"text"}},methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t.id,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:t.inputType}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,xs={props:{buttons:{type:[Array,Boolean],default:!0},uploads:[Boolean,Object,Array]}};const _s=ut({mixins:[xs],emits:["command"],computed:{commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:[{label:this.$t("toolbar.button.heading.1"),icon:"h1",click:()=>this.command("prepend","#")},{label:this.$t("toolbar.button.heading.2"),icon:"h2",click:()=>this.command("prepend","##")},{label:this.$t("toolbar.button.heading.3"),icon:"h3",click:()=>this.command("prepend","###")}]},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",click:()=>this.command("toggle","**"),shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",click:()=>this.command("toggle","*"),shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",click:()=>this.command("dialog","link"),shortcut:"k"},email:{label:this.$t("toolbar.button.email"),icon:"email",click:()=>this.command("dialog","email"),shortcut:"e"},file:{label:this.$t("toolbar.button.file"),icon:"attachment",click:()=>this.command("file"),dropdown:this.uploads?[{label:this.$t("toolbar.button.file.select"),icon:"check",click:()=>this.command("file")},{label:this.$t("toolbar.button.file.upload"),icon:"upload",click:()=>this.command("upload")}]:void 0},code:{label:this.$t("toolbar.button.code"),icon:"code",click:()=>this.command("toggle","`")},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",click:()=>this.command("insert",((t,e)=>e.split("\n").map((t=>"- "+t)).join("\n")))},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",click:()=>this.command("insert",((t,e)=>e.split("\n").map(((t,e)=>e+1+". "+t)).join("\n")))}}},default:()=>["headlines","|","bold","italic","code","|","link","email","file","|","ul","ol"],layout(){if(!1===this.buttons)return[];const t=[],e=Array.isArray(this.buttons)?this.buttons:this.default,i={...this.commands,...window.panel.plugins.textareaButtons??{}};for(const n of e)if("|"===n)t.push("|");else if(i[n]){const e={...i[n],click:()=>{var t;null==(t=i[n].click)||t.call(this)}};t.push(e)}return t}},methods:{close(){this.$refs.toolbar.close()},command(t,...e){this.$emit("command",t,...e)},shortcut(t,e){var i;const n=this.layout.find((e=>e.shortcut===t));n&&(e.preventDefault(),null==(i=n.click)||i.call(n))}}},(function(){return(0,this._self._c)("k-toolbar",{ref:"toolbar",staticClass:"k-textarea-toolbar",attrs:{buttons:this.layout}})}),[],!1,null,null,null,null).exports,Cs={mixins:[xs,Ie,J,et,it,lt,rt],props:{endpoints:Object,preselect:Boolean,size:String,theme:String,value:String}};const Ss=ut({mixins:[De,Cs],emits:["focus","input","submit"],data:()=>({over:!1}),computed:{uploadOptions(){const t=this.restoreSelectionCallback();return{url:this.$panel.urls.api+"/"+this.endpoints.field+"/upload",multiple:!1,on:{cancel:t,done:e=>{t((()=>this.insertUpload(e)))}}}}},watch:{async value(){this.onInvalid(),await this.$nextTick(),this.$library.autosize.update(this.$refs.input)}},async mounted(){await this.$nextTick(),this.$library.autosize(this.$refs.input),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{dialog(t){const e=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-toolbar-"+t+"-dialog",props:{value:this.parseSelection()},on:{cancel:e,submit:t=>{this.$panel.dialog.close(),e((()=>this.insert(t)))}}})},file(){const t=this.restoreSelectionCallback();this.$panel.dialog.open({component:"k-files-dialog",props:{endpoint:this.endpoints.field+"/files",multiple:!1},on:{cancel:t,submit:e=>{t((()=>this.insertFile(e))),this.$panel.dialog.close()}}})},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,i=e.value;"function"==typeof t&&(t=t(this.$refs.input,this.selection())),setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===i){const i=e.selectionStart,n=e.selectionEnd,s=i===n?"end":"select";e.setRangeText(t,i,n,s)}this.$emit("input",e.value)}))},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t){this.insertFile(t),this.$events.emit("model.update")},onCommand(t,...e){if("function"!=typeof this[t])return console.warn(t+" is not a valid command");this[t](...e)},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$panel.upload.open(t.dataTransfer.files,this.uploadOptions);"text"===this.$panel.drag.type&&(this.focus(),this.insert(this.$panel.drag.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);"text"===this.$panel.drag.type&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){var e;!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&(null==(e=this.$refs.toolbar)||e.shortcut(t.key,t))},onSubmit(t){return this.$emit("submit",t)},parseSelection(){const t=this.selection();if(0===(null==t?void 0:t.length))return{href:null,title:null};let e;e=this.$panel.config.kirbytext?/^\(link:\s*(?.*?)(?:\s*text:\s*(?.*?))?\)$/is:/^(\[(?.*?)\]\((?.*?)\))|(<(?.*?)>)$/is;const i=e.exec(t);return null!==i?{href:i.groups.url??i.groups.link,title:i.groups.text??null}:{href:null,title:t}},prepend(t){this.insert(t+" "+this.selection())},restoreSelectionCallback(){const t=this.$refs.input.selectionStart,e=this.$refs.input.selectionEnd;return i=>{setTimeout((()=>{this.$refs.input.setSelectionRange(t,e),i&&i()}))}},select(){this.$refs.select()},selection(){return this.$refs.input.value.substring(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toggle(t,e){e=e??t;const i=this.selection();return i.startsWith(t)&&i.endsWith(e)?this.insert(i.slice(t.length).slice(0,i.length-t.length-e.length)):this.wrap(t,e)},upload(){this.$panel.upload.pick(this.uploadOptions)},wrap(t,e){this.insert(t+this.selection()+(e??t))}},validations(){return{value:{required:!this.required||t.required,minLength:!this.minlength||t.minLength(this.minlength),maxLength:!this.maxlength||t.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-textarea-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:function(e){var i;null==(i=t.$refs.toolbar)||i.close()},focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?e.ctrlKey||e.shiftKey||e.altKey?null:t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?e.shiftKey||e.altKey||e.metaKey?null:t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1)])}),[],!1,null,null,null,null).exports;const Os=ut({mixins:[Fe,Ue,Cs,xi],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"textarea"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ms={props:{max:String,min:String,value:String}},As={mixins:[Ms],props:{display:{type:String,default:"HH:mm"},step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"}}};const Is=ut({mixins:[ji,As],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports;const Ds=ut({mixins:[Fe,Ue,As],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{type:"time"},on:{input:function(e){return t.$emit("input",e??"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-button",{staticClass:"k-input-icon-button",attrs:{disabled:t.disabled,icon:t.icon??"clock",title:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{"align-x":"end"}},[e("k-timeoptions-input",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,js={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const Es=ut({mixins:[De,js],computed:{label(){const t=this.text??[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this;return(0,t._self._c)("k-choice-input",{ref:"input",staticClass:"k-toggle-input",attrs:{id:t.id,checked:t.value,disabled:t.disabled,label:t.label,type:"checkbox",variant:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const Ls=ut({mixins:[Fe,Ue,js],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,Ts={mixins:[Ie],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const Bs=ut({mixins:[De,Ts],watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input[checked]")||this.$el.querySelector("input"))||t.focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||t.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:{"--options":t.columns??t.options.length},attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(i,n){return e("li",{key:n,attrs:{"data-disabled":t.disabled}},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+n,"aria-label":i.text,disabled:t.disabled,name:t.id,type:"radio"},domProps:{value:i.value,checked:t.value===i.value},on:{click:function(e){return t.onClick(i.value)},change:function(e){return t.onInput(i.value)}}}),e("label",{attrs:{for:t.id+"-"+n,title:i.text}},[i.icon?e("k-icon",{attrs:{type:i.icon}}):t._e(),t.labels||!i.icon?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(i.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports;const qs=ut({mixins:[Fe,Ue,Ts],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t,e=this,i=e._self._c;return i("k-field",e._b({staticClass:"k-toggles-field",attrs:{input:e.id}},"k-field",e.$props,!1),[(null==(t=e.options)?void 0:t.length)?i("k-input",e._g(e._b({ref:"input",class:{grow:e.grow},attrs:{type:"toggles"}},"k-input",e.$props,!1),e.$listeners)):i("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)}),[],!1,null,null,null,null).exports,Ps={mixins:[Li],props:{autocomplete:{type:String,default:"url"},placeholder:{type:String,default:()=>window.panel.$t("url.placeholder")},type:{type:String,default:"url"}}};const Ns=ut({extends:Ti,mixins:[Ps]},null,null,!1,null,null,null,null).exports;const zs=ut({mixins:[Fe,Ue,Ps],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},computed:{isValidUrl(){return""!==this.value&&!0===this.$helper.url.isUrl(this.value,!0)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t.id}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link&&t.isValidUrl?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,title:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Fs=ut({extends:Ni,type:"users",computed:{emptyProps(){return{icon:"users",text:this.empty??(this.multiple&&1!==this.max?this.$t("field.users.empty"):this.$t("field.users.empty.single"))}}}},null,null,!1,null,null,null,null).exports;const Ys=ut({mixins:[Fe,Ue,Pn,xi],inheritAttrs:!1,computed:{counterValue(){const t=this.$helper.string.stripHTML(this.value??"");return this.$helper.string.unescapeHTML(t)}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t.id,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{after:t.after,before:t.before,icon:t.icon,type:"writer"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports,Rs={install(t){t.component("k-blocks-field",yi),t.component("k-checkboxes-field",_i),t.component("k-color-field",Ai),t.component("k-date-field",Ei),t.component("k-email-field",Pi),t.component("k-files-field",zi),t.component("k-gap-field",Fi),t.component("k-headline-field",Yi),t.component("k-info-field",Ri),t.component("k-layout-field",Gi),t.component("k-line-field",Xi),t.component("k-link-field",Zi),t.component("k-list-field",Rn),t.component("k-multiselect-field",Xn),t.component("k-number-field",ts),t.component("k-object-field",es),t.component("k-pages-field",is),t.component("k-password-field",os),t.component("k-radio-field",rs),t.component("k-range-field",ds),t.component("k-select-field",ms),t.component("k-slug-field",ks),t.component("k-structure-field",bs),t.component("k-tags-field",Gn),t.component("k-text-field",ws),t.component("k-textarea-field",Os),t.component("k-tel-field",$s),t.component("k-time-field",Ds),t.component("k-toggle-field",Ls),t.component("k-toggles-field",qs),t.component("k-url-field",zs),t.component("k-users-field",Fs),t.component("k-writer-field",Ys)}},Us={mixins:[us],props:{max:null,min:null,step:{default:.01,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Hs=ut({mixins:[cs,Us]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-alpha-input",attrs:{min:0,max:1},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const Vs=ut({mixins:[Ie,Ii],data(){const t=this.$library.dayjs();return{maxdate:null,mindate:null,month:t.month(),selected:null,today:t,year:t.year()}},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,i)=>{t.push({value:i,text:e})})),t},years(){const t=this.year-20,e=this.year+20;return this.toOptions(t,e)}},watch:{max:{handler(t,e){t!==e&&(this.maxdate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},min:{handler(t,e){t!==e&&(this.mindate=this.$library.dayjs.interpret(t,"date"))},immediate:!0},value:{handler(t,e){t!==e&&(this.selected=this.$library.dayjs.interpret(t,"date"),this.show(this.selected))},immediate:!0}},methods:{days(t){let e=[];const i=7*(t-1)+1,n=i+7;for(let s=i;sthis.numberOfDays;e.push(i?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.mindate,"day")||e.isAfter(this.maxdate,"day")},isSelected(t){return this.toDate(t).isSame(this.selected,"day")},isToday(t){return this.toDate(t).isSame(this.today,"day")},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){this.$emit("input",(null==t?void 0:t.toISO("date"))??null)},show(t){this.month=(t??this.today).month(),this.year=(t??this.today).year()},toDate(t=1,e){return this.$library.dayjs(`${this.year}-${(e??this.month)+1}-${t}`)},toOptions(t,e){for(var i=[],n=t;n<=e;n++)i.push({value:n,text:this.$helper.pad(n)});return i}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-calendar-input",on:{click:function(t){t.stopPropagation()}}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("date.select")))]),e("nav",[e("k-button",{attrs:{title:t.$t("prev"),icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{"aria-label":t.$t("month"),autofocus:t.autofocus,options:t.months,empty:!1,required:!0,value:t.month},on:{input:function(e){t.month=Number(e)}}}),e("k-select-input",{attrs:{"aria-label":t.$t("year"),options:t.years,empty:!1,required:!0,value:t.year},on:{input:function(e){t.year=Number(e)}}})],1),e("k-button",{attrs:{title:t.$t("next"),icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{key:t.year+"-"+t.month,staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(i){return e("th",{key:"weekday_"+i},[t._v(" "+t._s(i)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(i){return e("tr",{key:"week_"+i},t._l(t.days(i),(function(i,n){return e("td",{key:"day_"+n,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(i)&&"date","aria-selected":!!t.isSelected(i)&&"date"}},[i?e("k-button",{attrs:{disabled:t.isDisabled(i),text:i},on:{click:function(e){t.select(t.toDate(i))}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{disabled:t.disabled,text:t.$t("today")},on:{click:function(e){t.show(t.today),t.select(t.today)}}})],1)])])]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"date"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports;const Ks=ut({mixins:[De,{mixins:[Ie],props:{checked:{type:Boolean},info:{type:String},label:{type:String},type:{default:"checkbox",type:String},value:{type:[Boolean,Number,String]},variant:{type:String}}}]},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-choice-input",attrs:{"aria-disabled":t.disabled}},[e("input",t._b({class:{"sr-only":"invisible"===t.variant},attrs:{"data-variant":t.variant},on:{input:function(e){return t.$emit("input",e.target.checked)}}},"input",{autofocus:t.autofocus,id:t.id,checked:t.checked,disabled:t.disabled,name:t.name,required:t.required,type:t.type,value:t.value},!1)),t.label||t.info?e("span",{staticClass:"k-choice-input-label"},[e("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:t._s(t.label)}}),t.info?e("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]):t._e()])}),[],!1,null,null,null,null).exports;const Ws=ut({extends:Ks},null,null,!1,null,null,null,null).exports;const Js=ut({mixins:[as,{mixins:[ls],props:{format:{type:String,default:"hex",validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:String}}}],computed:{choices(){return this.options.map((t=>({...t,title:t.text??t.value,value:this.colorToString(t.value)})))}},methods:{colorToString(t){try{return this.$library.colors.toString(t,this.format)}catch{return t}}}},(function(){var t=this,e=t._self._c;return t.choices.length?e("fieldset",{staticClass:"k-coloroptions-input",attrs:{disabled:t.disabled}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("options")))]),e("ul",t._l(t.choices,(function(i,n){return e("li",{key:n},[e("label",{attrs:{title:i.title}},[e("input",{staticClass:"input-hidden",attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,name:t.name??t.id,required:t.required,type:"radio"},domProps:{checked:i.value===t.value,value:i.value},on:{click:function(e){return t.toggle(i.value)},input:function(e){return t.$emit("input",i.value)}}}),e("k-color-frame",{attrs:{color:i.value}})],1)])})),0)]):t._e()}),[],!1,null,null,null,null).exports;const Gs=ut({mixins:[De,{mixins:[Ie,st],props:{alpha:{default:!0,type:Boolean},format:{default:"hex",type:String,validator:t=>["hex","rgb","hsl"].includes(t)},value:{type:[Object,String]}}}],data:()=>({color:{h:0,s:0,v:1,a:1},formatted:null}),computed:{coords(){return this.value?{x:100*this.color.s,y:100*(1-this.color.v)}:null},hsl(){try{const t=this.$library.colors.convert(this.color,"hsl");return{h:t.h,s:(100*t.s).toFixed()+"%",l:(100*t.l).toFixed()+"%",a:t.a}}catch{return{h:0,s:"0%",l:"0%",a:1}}}},watch:{value:{handler(t,e){if(t===e||t===this.formatted)return;const i=this.$library.colors.parseAs(t??"","hsv");i?(this.formatted=this.$library.colors.toString(i,this.format),this.color=i):(this.formatted=null,this.color={h:0,s:0,v:1,a:1})},immediate:!0}},methods:{between:(t,e,i)=>Math.min(Math.max(t,e),i),emit(){return this.formatted=this.$library.colors.toString(this.color,this.format),this.$emit("input",this.formatted)},focus(){this.$refs.coords.focus()},setAlpha(t){this.color.a=this.alpha?this.between(Number(t),0,1):1,this.emit()},setCoords(t){if(!t)return this.$emit("input","");const e=Math.round(t.x),i=Math.round(t.y);this.color.s=this.between(e/100,0,1),this.color.v=this.between(1-i/100,0,1),this.emit()},setHue(t){this.color.h=this.between(Number(t),0,360),this.emit()}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-colorpicker-input",style:{"--h":t.hsl.h,"--s":t.hsl.s,"--l":t.hsl.l,"--a":t.hsl.a}},[e("legend",{staticClass:"sr-only"},[t._v(t._s(t.$t("color")))]),e("k-coords-input",{ref:"coords",attrs:{autofocus:t.autofocus,disabled:t.disabled,required:t.required,value:t.coords},on:{input:function(e){return t.setCoords(e)}}}),e("label",{attrs:{"aria-label":t.$t("hue")}},[e("k-hue-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.h},on:{input:function(e){return t.setHue(e)}}})],1),t.alpha?e("label",{attrs:{"aria-label":t.$t("alpha")}},[e("k-alpha-input",{attrs:{disabled:t.disabled,required:t.required,value:t.color.a},on:{input:function(e){return t.setAlpha(e)}}})],1):t._e(),e("k-coloroptions-input",{attrs:{disabled:t.disabled,format:t.format,options:t.options,required:t.required,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.formatted}})],1)}),[],!1,null,null,null,null).exports;const Xs=ut({mixins:[De,{mixins:[Ie],props:{reset:{default:!0,type:Boolean},value:{default:()=>({x:0,y:0}),type:Object}}}],data:()=>({x:0,y:0}),watch:{value:{handler(t){const e=this.parse(t);this.x=(null==e?void 0:e.x)??0,this.y=(null==e?void 0:e.y)??0},immediate:!0}},methods:{focus(){var t;null==(t=this.$el.querySelector("button"))||t.focus()},getCoords:(t,e)=>({x:Math.min(Math.max(t.clientX-e.left,0),e.width),y:Math.min(Math.max(t.clientY-e.top,0),e.height)}),onDelete(){this.reset&&!this.required&&this.$emit("input",null)},onDrag(t){if(0!==t.button)return;const e=t=>this.onMove(t),i=()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",i)};window.addEventListener("mousemove",e),window.addEventListener("mouseup",i)},onEnter(){var t;null==(t=this.$el.form)||t.requestSubmit()},onInput(t,e){if(t.preventDefault(),t.stopPropagation(),this.disabled)return!1;this.x=Math.min(Math.max(parseFloat(e.x??this.x??0),0),100),this.y=Math.min(Math.max(parseFloat(e.y??this.y??0),0),100),this.$emit("input",{x:this.x,y:this.y})},onKeys(t){const e=t.shiftKey?10:1,i={ArrowUp:{y:this.y-e},ArrowDown:{y:this.y+e},ArrowLeft:{x:this.x-e},ArrowRight:{x:this.x+e}};i[t.key]&&this.onInput(t,i[t.key])},async onMove(t){const e=this.$el.getBoundingClientRect(),i=this.getCoords(t,e),n=i.x/e.width*100,s=i.y/e.height*100;this.onInput(t,{x:n,y:s}),await this.$nextTick(),this.focus()},parse(t){if("object"==typeof t)return t;const e={"top left":{x:0,y:0},"top center":{x:50,y:0},"top right":{x:100,y:0},"center left":{x:0,y:50},center:{x:50,y:50},"center center":{x:50,y:50},"center right":{x:100,y:50},"bottom left":{x:0,y:100},"bottom center":{x:50,y:100},"bottom right":{x:100,y:100}};if(e[t])return e[t];const i=t.split(",").map((t=>t.trim()));return{x:i[0],y:i[1]??0}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-coords-input",attrs:{"aria-disabled":t.disabled,"data-empty":!t.value},on:{mousedown:t.onDrag,click:t.onMove,keydown:t.onKeys}},[t._t("default"),e("button",{staticClass:"k-coords-input-thumb",style:{left:`${t.x}%`,top:`${t.y}%`},attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.onDelete.apply(null,arguments)}]}}),e("input",{staticClass:"input-hidden",attrs:{name:t.name,required:t.required,tabindex:"-1",type:"text"},domProps:{value:t.value?[t.value.x,t.value.y]:null}})],2)}),[],!1,null,null,null,null).exports,Zs={mixins:[us],props:{max:null,min:null,step:{default:1,type:Number},tooltip:{default:!1,type:[Boolean,Object]}}};const Qs=ut({mixins:[cs,Zs]},(function(){var t=this;return(0,t._self._c)("k-range-input",t._b({staticClass:"k-hue-input",attrs:{min:0,max:360},on:{input:function(e){return t.$emit("input",e)}}},"k-range-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const to=ut({mixins:[Si,{mixins:[Ci],props:{autocomplete:null,pattern:null,spellcheck:null,placeholder:{default:()=>window.panel.$t("search")+" …",type:String}}}]},(function(){var t=this;return(0,t._self._c)("k-string-input",t._b({staticClass:"k-search-input",attrs:{spellcheck:!1,autocomplete:"off",type:"search"},on:{input:function(e){return t.$emit("input",e)}}},"k-string-input",t.$props,!1))}),[],!1,null,null,null,null).exports;const eo=ut({mixins:[De,{mixins:[Ie,Ms]}],props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{focus(){this.$el.querySelector("button").focus()},formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-timeoptions-input"},[e("div",[e("h3",[e("k-icon",{attrs:{type:"sun"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("day")))])],1),e("ul",t._l(t.day,(function(i,n){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{autofocus:t.autofocus&&0===n,disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("div",[e("h3",[e("k-icon",{attrs:{type:"moon"}}),t._v(" "),e("span",{staticClass:"sr-only"},[t._v(t._s(t.$t("night")))])],1),e("ul",t._l(t.night,(function(i){return e("li",{key:i.select},["-"===i?e("hr"):e("k-button",{attrs:{disabled:t.disabled,selected:i.select===t.value&&"time"},on:{click:function(e){return t.select(i.select)}}},[t._v(" "+t._s(i.display)+" ")])],1)})),0)]),e("input",{staticClass:"input-hidden",attrs:{id:t.id,disabled:t.disabled,min:t.min,max:t.max,name:t.name,required:t.required,tabindex:"-1",type:"time"},domProps:{value:t.value}})])}),[],!1,null,null,null,null).exports,io={install(t){t.component("k-alpha-input",Hs),t.component("k-calendar-input",Vs),t.component("k-checkbox-input",Ws),t.component("k-checkboxes-input",wi),t.component("k-choice-input",Ks),t.component("k-colorname-input",Mi),t.component("k-coloroptions-input",Js),t.component("k-colorpicker-input",Gs),t.component("k-coords-input",Xs),t.component("k-date-input",ji),t.component("k-email-input",qi),t.component("k-hue-input",Qs),t.component("k-list-input",Yn),t.component("k-multiselect-input",Kn),t.component("k-number-input",Qn),t.component("k-password-input",ss),t.component("k-picklist-input",Le),t.component("k-radio-input",as),t.component("k-range-input",cs),t.component("k-search-input",to),t.component("k-select-input",hs),t.component("k-slug-input",gs),t.component("k-string-input",Si),t.component("k-tags-input",Jn),t.component("k-tel-input",ys),t.component("k-text-input",Ti),t.component("k-textarea-input",Ss),t.component("k-time-input",Is),t.component("k-timeoptions-input",eo),t.component("k-toggle-input",Es),t.component("k-toggles-input",Bs),t.component("k-url-input",Ns),t.component("k-writer-input",Nn),t.component("k-calendar",Vs),t.component("k-times",eo)}};const no=ut({mixins:[Et],inheritAttrs:!1,props:{cancelButton:{default:!1},label:{default(){return this.$t("field.layout.select")},type:String},layouts:{type:Array},selector:Object,submitButton:{default:!1},value:{type:Array}},emits:["cancel","input","submit"]},(function(){var t,e,i=this,n=i._self._c;return n("k-dialog",i._b({staticClass:"k-layout-selector",attrs:{size:(null==(t=i.selector)?void 0:t.size)??"medium"},on:{cancel:function(t){return i.$emit("cancel")},submit:function(t){return i.$emit("submit",i.value)}}},"k-dialog",i.$props,!1),[n("h3",{staticClass:"k-label"},[i._v(i._s(i.label))]),n("k-navigate",{staticClass:"k-layout-selector-options",style:{"--columns":Number((null==(e=i.selector)?void 0:e.columns)??3)},attrs:{axis:"x"}},i._l(i.layouts,(function(t,e){return n("button",{key:e,staticClass:"k-layout-selector-option",attrs:{"aria-current":i.value===t,"aria-label":t.join(","),value:t},on:{click:function(e){return i.$emit("input",t)}}},[n("k-grid",{attrs:{"aria-hidden":""}},i._l(t,(function(t,e){return n("k-column",{key:e,attrs:{width:t}})})),1)],1)})),0)],1)}),[],!1,null,null,null,null).exports,so={install(t){t.component("k-layout",Ki),t.component("k-layout-column",Hi),t.component("k-layouts",Ji),t.component("k-layout-selector",no)}},oo={inheritAttrs:!1,props:{column:{default:()=>({}),type:Object},field:{default:()=>({}),type:Object},value:{}}},lo={props:{html:{type:Boolean}}};const ao=ut({mixins:[lo],inheritAttrs:!1,props:{bubbles:[Array,String]},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"===t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(i,n){return e("li",{key:n},[e("k-bubble",t._b({attrs:{html:t.html}},"k-bubble",i,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const ro=ut({mixins:[oo,lo],props:{value:{default:()=>[],type:[Array,String]}},computed:{bubbles(){let t=this.value;const e=this.column.options??this.field.options??[];return"string"==typeof t&&(t=t.split(",")),(t??[]).map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const i of e)i.value===t.value&&(t.text=i.text);return t}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles,html:t.html}})],1)}),[],!1,null,null,null,null).exports;const uo=ut({extends:ro,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const co=ut({mixins:[oo],props:{value:String},computed:{text(){var t;if(!this.value)return;const e=this.$library.colors.toString(this.value,this.field.format,this.field.alpha),i=null==(t=this.field.options)?void 0:t.find((t=>this.$library.colors.toString(t.value,this.field.format,this.field.alpha)===e));return i?i.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-color-field-preview"},[e("k-color-frame",{attrs:{color:t.value}}),t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2)}),[],!1,null,null,null,null).exports;const po=ut({mixins:[oo],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const ho=ut({extends:po,props:{value:String},class:"k-date-field-preview",computed:{display(){return this.column.display??this.field.display},format(){var t;let e=this.display??"YYYY-MM-DD";return(null==(t=this.time)?void 0:t.display)&&(e+=" "+this.time.display),e},parsed(){return this.$library.dayjs(this.value)},text(){var t;return!1===this.parsed.isValid()?this.value:null==(t=this.parsed)?void 0:t.format(this.format)},time(){return this.column.time??this.field.time}}},null,null,!1,null,null,null,null).exports;const mo=ut({mixins:[oo],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[e("span",[t._v(t._s(t.text))])]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const fo=ut({extends:mo,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const go=ut({extends:ro,class:"k-files-field-preview",props:{html:{type:Boolean,default:!0}},computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const ko=ut({mixins:[oo],props:{value:Object},computed:{status(){var t;return{...this.$helper.page.status(null==(t=this.value)?void 0:t.status),...this.value}}}},(function(){var t=this,e=t._self._c;return t.value?e("k-button",t._b({staticClass:"k-flag-field-preview",attrs:{size:"md"}},"k-button",t.status,!1)):t._e()}),[],!1,null,null,null,null).exports;const bo=ut({mixins:[oo],props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("k-text",{attrs:{html:t.html}}),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const vo=ut({mixins:[oo],props:{value:[Object]}},(function(){var t=this,e=t._self._c;return t.value?e("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:t.value}}):t._e()}),[],!1,null,null,null,null).exports;const yo=ut({mixins:[oo],inheritAttrs:!1,props:{removable:Boolean,type:String},emits:["remove"],data:()=>({model:null}),computed:{currentType(){return this.type??this.detected.type},detected(){return this.$helper.link.detect(this.value)},isLink(){return["url","email","tel"].includes(this.currentType)}},watch:{detected:{async handler(t,e){t!==e&&(this.model=await this.$helper.link.preview(this.detected))},immediate:!0},type(){this.model=null}}},(function(){var t=this,e=t._self._c;return e("div",{class:{"k-link-field-preview":!0,"k-url-field-preview":t.isLink}},["page"===t.currentType||"file"===t.currentType?[t.model?[e("k-tag",{attrs:{image:{...t.model.image,cover:!0},removable:t.removable,text:t.model.label},on:{remove:function(e){return t.$emit("remove",e)}}})]:t._t("placeholder")]:t.isLink?[e("p",{staticClass:"k-text"},[e("a",{attrs:{href:t.value,target:"_blank"}},[e("span",[t._v(t._s(t.detected.link))])])])]:[t._v(" "+t._s(t.detected.link)+" ")]],2)}),[],!1,null,null,null,null).exports;const $o=ut({extends:ro,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles(){return this.value?[{text:"{ ... }"}]:[]}}},null,null,!1,null,null,null,null).exports;const wo=ut({extends:ro,inheritAttrs:!1,class:"k-pages-field-preview",props:{html:{type:Boolean,default:!0}}},null,null,!1,null,null,null,null).exports;const xo=ut({extends:ho,class:"k-time-field-preview",computed:{format(){return this.display??"HH:mm"},parsed(){return this.$library.dayjs.iso(this.value,"time")},text(){var t;return null==(t=this.parsed)?void 0:t.format(this.format)}}},null,null,!1,null,null,null,null).exports;const _o=ut({mixins:[oo],props:{value:Boolean},emits:["input"],computed:{isEditable(){return!0!==this.field.disabled},text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-toggle-field-preview"},[e("k-toggle-input",{attrs:{disabled:!t.isEditable,text:t.text,value:t.value},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{click:function(e){t.isEditable&&e.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports;const Co=ut({extends:ro,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,So={install(t){t.component("k-array-field-preview",uo),t.component("k-bubbles-field-preview",ro),t.component("k-color-field-preview",co),t.component("k-date-field-preview",ho),t.component("k-email-field-preview",fo),t.component("k-files-field-preview",go),t.component("k-flag-field-preview",ko),t.component("k-html-field-preview",bo),t.component("k-image-field-preview",vo),t.component("k-link-field-preview",yo),t.component("k-object-field-preview",$o),t.component("k-pages-field-preview",wo),t.component("k-text-field-preview",po),t.component("k-toggle-field-preview",_o),t.component("k-time-field-preview",xo),t.component("k-url-field-preview",mo),t.component("k-users-field-preview",Co),t.component("k-list-field-preview",bo),t.component("k-writer-field-preview",bo),t.component("k-checkboxes-field-preview",ro),t.component("k-multiselect-field-preview",ro),t.component("k-radio-field-preview",ro),t.component("k-select-field-preview",ro),t.component("k-tags-field-preview",ro),t.component("k-toggles-field-preview",ro)}};const Oo=ut({mixins:[{props:{buttons:{type:Array,default:()=>[]},theme:{type:String,default:"light"}}}],methods:{close(){for(const t in this.$refs){const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar",attrs:{"data-theme":t.theme}},[t._l(t.buttons,(function(i,n){var s;return["|"===i?e("hr",{key:n}):i.when??1?e("k-button",{key:n,class:["k-toolbar-button",i.class],attrs:{current:i.current,disabled:i.disabled,icon:i.icon,title:i.label,tabindex:"0"},on:{click:function(e){var s,o;(null==(s=i.dropdown)?void 0:s.length)?t.$refs[n+"-dropdown"][0].toggle():null==(o=i.click)||o.call(i,e)}},nativeOn:{keydown:function(t){var e;null==(e=i.key)||e.call(i,t)}}}):t._e(),(i.when??1)&&(null==(s=i.dropdown)?void 0:s.length)?e("k-dropdown-content",{key:n+"-dropdown",ref:n+"-dropdown",refInFor:!0,attrs:{options:i.dropdown,theme:"dark"===t.theme?"light":"dark"}}):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Mo=ut({extends:Bt,props:{fields:{default:()=>{const t=Bt.props.fields.default();return t.title.label=window.panel.$t("link.text"),t}}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(email: ${t} text: ${e})`):this.$emit("submit",`(email: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](mailto:${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports;const Ao=ut({extends:Kt,props:{fields:{default:()=>({href:{label:window.panel.$t("link"),type:"link",placeholder:window.panel.$t("url.placeholder"),icon:"url"},title:{label:window.panel.$t("link.text"),type:"text",icon:"title"}})}},methods:{submit(){const t=this.values.href??"",e=this.values.title??"";return this.$panel.config.kirbytext?(null==e?void 0:e.length)>0?this.$emit("submit",`(link: ${t} text: ${e})`):this.$emit("submit",`(link: ${t})`):(null==e?void 0:e.length)>0?this.$emit("submit",`[${e}](${t})`):this.$emit("submit",`<${t}>`)}}},null,null,!1,null,null,null,null).exports,Io={install(t){t.component("k-toolbar",Oo),t.component("k-textarea-toolbar",_s),t.component("k-toolbar-email-dialog",Mo),t.component("k-toolbar-link-dialog",Ao)}};const Do=ut({props:{editor:{required:!0,type:Object},inline:{default:!0,type:Boolean},marks:{default:()=>["bold","italic","underline","strike","code","|","link","email","|","clear"],type:[Array,Boolean]},nodes:{default:!0,type:[Array,Boolean]}},emits:["command"],data:()=>({isOpen:!1,position:{x:0,y:0}}),computed:{activeNode(){return Object.values(this.nodeButtons).find((t=>this.isNodeActive(t)))??!1},buttons(){var t,e,i;const n=[];if(this.hasNodes){const s=[];let o=0;for(const n in this.nodeButtons){const l=this.nodeButtons[n];s.push({current:(null==(t=this.activeNode)?void 0:t.id)===l.id,disabled:!1===(null==(i=null==(e=this.activeNode)?void 0:e.when)?void 0:i.includes(l.name)),icon:l.icon,label:l.label,click:()=>this.command(l.command??n)}),!0===l.separator&&o!==Object.keys(this.nodeButtons).length-1&&s.push("-"),o++}n.push({current:Boolean(this.activeNode),icon:this.activeNode.icon??"title",dropdown:s})}if(this.hasNodes&&this.hasMarks&&n.push("|"),this.hasMarks)for(const s in this.markButtons){const t=this.markButtons[s];"|"!==t?n.push({current:this.editor.activeMarks.includes(s),icon:t.icon,label:t.label,click:e=>this.command(t.command??s,e)}):n.push("|")}return n},hasMarks(){return this.$helper.object.length(this.markButtons)>0},hasNodes(){return this.$helper.object.length(this.nodeButtons)>1},markButtons(){const t=this.editor.buttons("mark");if(!1===this.marks||0===this.$helper.object.length(t))return{};if(!0===this.marks)return t;const e={};for(const[i,n]of this.marks.entries())"|"===n?e["divider"+i]="|":t[n]&&(e[n]=t[n]);return e},nodeButtons(){const t=this.editor.buttons("node");if(!1===this.nodes||0===this.$helper.object.length(t))return{};if("block+"!==this.editor.nodes.doc.content&&t.paragraph&&delete t.paragraph,!0===this.nodes)return t;const e={};for(const i of this.nodes)t[i]&&(e[i]=t[i]);return e},positions(){return!1===this.inline?null:{top:this.position.y+"px",left:this.position.x+"px"}}},methods:{close(t){t&&!1!==this.$el.contains(t.relatedTarget)||(this.isOpen=!1)},command(t,...e){this.$emit("command",t,...e)},isNodeActive(t){if(!1===this.editor.activeNodes.includes(t.name))return!1;if("paragraph"===t.name)return!1===this.editor.activeNodes.includes("listItem")&&!1===this.editor.activeNodes.includes("quote");if(t.attrs){if(void 0===Object.values(this.editor.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs))))return!1}return!0},open(){this.isOpen=!0,this.inline&&this.$nextTick(this.setPosition)},setPosition(){const t=this.$el.getBoundingClientRect(),e=this.editor.element.getBoundingClientRect(),i=document.querySelector(".k-panel-menu").getBoundingClientRect(),{from:n,to:s}=this.editor.selection,o=this.editor.view.coordsAtPos(n),l=this.editor.view.coordsAtPos(s,!0),a=new DOMRect(o.left,o.top,l.right-o.left,l.bottom-o.top);let r=a.x-e.x+a.width/2-t.width/2,u=a.y-e.y-t.height-5;if(t.widthe.width&&(r=e.width-t.width);else{const n=e.x+r,s=n+t.width,o=i.width+20,l=20;nwindow.innerWidth-l&&(r-=s-(window.innerWidth-l))}this.position={x:r,y:u}}}},(function(){var t=this,e=t._self._c;return t.isOpen||!t.inline?e("k-toolbar",{ref:"toolbar",staticClass:"k-writer-toolbar",style:t.positions,attrs:{buttons:t.buttons,"data-inline":t.inline,theme:t.inline?"dark":"light"}}):t._e()}),[],!1,null,null,null,null).exports,jo={install(t){t.component("k-writer-toolbar",Do),t.component("k-writer",qn)}},Eo={install(t){t.component("k-counter",Pe),t.component("k-autocomplete",qe),t.component("k-form",Ne),t.component("k-form-buttons",ze),t.component("k-field",Ye),t.component("k-fieldset",Re),t.component("k-input",He),t.component("k-upload",Ve),t.use(vi),t.use(io),t.use(Rs),t.use(so),t.use(So),t.use(Io),t.use(jo)}},Lo=()=>Y((()=>import("./IndexView.min.js")),__vite__mapDeps([0,1]),import.meta.url),To=()=>Y((()=>import("./DocsView.min.js")),__vite__mapDeps([2,3,1]),import.meta.url),Bo=()=>Y((()=>import("./PlaygroundView.min.js")),__vite__mapDeps([4,3,1]),import.meta.url),qo={install(t){t.component("k-lab-index-view",Lo),t.component("k-lab-docs-view",To),t.component("k-lab-playground-view",Bo)}};const Po=ut({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}},mounted(){window.panel.deprecated(" will be removed in a future version. Use the instead.")}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const No=ut({props:{align:{type:String,default:"start"}},mounted(){(this.$slots.left||this.$slots.center||this.$slots.right)&&window.panel.deprecated(": left/centre/right slots will be removed in a future version. Use with default slot only instead.")}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar",attrs:{"data-align":t.align}},[t.$slots.left||t.$slots.center||t.$slots.right?[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const zo=ut({props:{align:{type:String,default:"start"},button:Boolean,height:String,icon:String,theme:{type:String},text:String,html:{type:Boolean}},computed:{element(){return this.button?"button":"div"},type(){return this.button?"button":null}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-box",style:t.height?{"--box-height":t.height}:null,attrs:{"data-align":t.align,"data-theme":t.theme,type:t.type}},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}),null,{html:t.html,text:t.text})],2)}),[],!1,null,null,null,null).exports;const Fo=ut({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},html:{type:Boolean},image:Object,link:String,text:String},mounted(){this.back&&window.panel.deprecated(": `back` prop will be removed in a future version. Use the `--bubble-back` CSS property instead."),this.color&&window.panel.deprecated(": `color` prop will be removed in a future version. Use the `--bubble-text` CSS property instead.")}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link,"data-has-text":Boolean(t.text)},nativeOn:{click:function(t){t.stopPropagation()}}},[t._t("image",(function(){var i;return[(null==(i=t.image)?void 0:i.src)?e("k-image-frame",t._b({},"k-image-frame",t.image,!1)):t.image?e("k-icon-frame",t._b({},"k-icon-frame",t.image,!1)):e("span")]})),t.text?[t.html?e("span",{staticClass:"k-bubble-text",domProps:{innerHTML:t._s(t.text)}}):e("span",{staticClass:"k-bubble-text"},[t._v(t._s(t.text))])]:t._e()],2)}),[],!1,null,null,null,null).exports;const Yo=ut({props:{width:{type:String,default:"1/1"},sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",style:{"--width":t.width},attrs:{"data-sticky":t.sticky}},[t.sticky?e("div",[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports,Ro={props:{element:{type:String,default:"div"},fit:String,ratio:String,cover:Boolean,back:String,theme:String}};const Uo=ut({mixins:[Ro],inheritAttrs:!1,computed:{background(){return this.$helper.color(this.back)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-frame",style:{"--fit":t.fit??(t.cover?"cover":"contain"),"--ratio":t.ratio,"--back":t.background},attrs:{"data-theme":t.theme}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ho=ut({mixins:[{mixins:[Ro],props:{color:String}}],inheritAttrs:!1},(function(){var t=this;return(0,t._self._c)("k-frame",t._b({staticClass:"k-color-frame",style:{"--color-frame-back":t.color}},"k-frame",t.$props,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Vo=ut({props:{disabled:{type:Boolean}},emits:["drop"],data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ko=ut({props:{gutter:String,variant:String},mounted(){this.gutter&&window.panel.deprecated(': the `gutter` prop will be removed in a future version. Use `style="gap: "` or `variant` prop instead.')}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter,"data-variant":t.variant}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Wo=ut({props:{editable:{type:Boolean},tabs:Array},emits:["edit"],mounted(){this.tabs&&window.panel.deprecated(": `tabs` prop isn't supported anymore and has no effect. Use `` as standalone component instead."),(this.$slots.left||this.$slots.right)&&window.panel.deprecated(": left/right slots will be removed in a future version. Use `buttons` slot instead.")}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-has-buttons":Boolean(t.$slots.buttons||t.$slots.left||t.$slots.right)}},[e("h1",{staticClass:"k-header-title"},[t.editable?e("button",{staticClass:"k-header-title-button",attrs:{type:"button"},on:{click:function(e){return t.$emit("edit")}}},[e("span",{staticClass:"k-header-title-text"},[t._t("default")],2),e("span",{staticClass:"k-header-title-icon"},[e("k-icon",{attrs:{type:"edit"}})],1)]):e("span",{staticClass:"k-header-title-text"},[t._t("default")],2)]),t.$slots.buttons||t.$slots.left||t.$slots.right?e("div",{staticClass:"k-header-buttons"},[t._t("buttons"),t._t("left"),t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports,Jo={props:{alt:String,color:String,type:String}};const Go=ut({mixins:[Jo],computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return t.isEmoji?e("span",{attrs:{"data-type":"emoji"}},[t._v(t._s(t.type))]):e("svg",{staticClass:"k-icon",style:{color:t.$helper.color(t.color)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-type":t.type}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])}),[],!1,null,null,null,null).exports;const Xo=ut({mixins:[{mixins:[Ro,Jo],props:{type:null,icon:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._b({staticClass:"k-icon-frame",attrs:{element:"figure"}},"k-frame",t.$props,!1),[e("k-icon",t._b({},"k-icon",{color:t.color,type:t.icon,alt:t.alt},!1))],1)}),[],!1,null,null,null,null).exports;const Zo=ut({mixins:[{mixins:[Ro],props:{alt:String,sizes:String,src:String,srcset:String}}],inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-frame",t._g(t._b({staticClass:"k-image-frame k-image",attrs:{element:"figure"}},"k-frame",t.$props,!1),t.$listeners),[t.src?e("img",{key:t.src,attrs:{alt:t.alt??"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e()])}),[],!1,null,null,null,null).exports;const Qo=ut({mixins:[{props:{autofocus:{default:!0,type:Boolean},nested:{default:!1,type:Boolean},type:{default:"overlay",type:String},visible:{default:!1,type:Boolean}}}],inheritAttrs:!0,emits:["cancel","close","open"],watch:{visible(t,e){t!==e&&this.toggle()}},mounted(){this.toggle()},methods:{cancel(){this.$emit("cancel"),this.close()},close(){if(!1!==this.$refs.overlay.open)return this.nested?this.onClose():void this.$refs.overlay.close()},focus(){this.$helper.focus(this.$refs.overlay)},onCancel(t){this.nested&&(t.preventDefault(),this.cancel())},onClick(t){t.target.matches(".k-portal")&&this.cancel()},onClose(){this.$emit("close")},open(){!0!==this.$refs.overlay.open&&this.$refs.overlay.showModal(),setTimeout((()=>{!0===this.autofocus&&this.focus(),this.$emit("open")}))},toggle(){!0===this.visible?this.open():this.close()}}},(function(){var t=this;return(0,t._self._c)("dialog",{ref:"overlay",staticClass:"k-overlay",attrs:{"data-type":t.type},on:{cancel:t.onCancel,mousedown:t.onClick,touchdown:t.onClick,close:t.onClose}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const tl=ut({props:{label:String,value:String,icon:String,info:String,theme:String,link:String,click:Function,dialog:{type:[String,Object]}},computed:{component(){return null!==this.target?"k-link":"div"},target(){return this.link?this.link:this.click?this.click:this.dialog?()=>this.$dialog(this.dialog):null}}},(function(){var t=this,e=t._self._c;return e(t.component,{tag:"component",staticClass:"k-stat",attrs:{"data-theme":t.theme,to:t.target}},[t.label?e("dt",{staticClass:"k-stat-label"},[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),t._v(" "+t._s(t.label)+" ")],1):t._e(),t.value?e("dd",{staticClass:"k-stat-value"},[t._v(t._s(t.value))]):t._e(),t.info?e("dd",{staticClass:"k-stat-info"},[t._v(t._s(t.info))]):t._e()])}),[],!1,null,null,null,null).exports;const el=ut({props:{reports:{type:Array,default:()=>[]},size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(i,n){return e("k-stat",t._b({key:n},"k-stat",i,!1))})),1)}),[],!1,null,null,null,null).exports;const il=ut({inheritAttrs:!1,props:{columns:{type:Object,default:()=>({})},disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:{default:()=>[],type:[Array,Function]},pagination:[Object,Boolean],sortable:Boolean},emits:["cell","change","header","input","option","paginate","sort"],data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return this.$helper.object.length(this.columns)},dragOptions(){return{disabled:!this.sortable,draggable:".k-table-sortable-row",fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return this.$scopedSlots.options||(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>null==t?void 0:t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label??this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:i}){this.values[e][t]=i,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,i){this.$emit("option",t,e,i)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table",attrs:{"aria-disabled":t.disabled}},[e("table",{attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(i,n){return e("th",{key:n+"-header",staticClass:"k-table-column",style:{width:t.width(i.width)},attrs:{"data-align":i.align,"data-column-id":n,"data-mobile":i.mobile},on:{click:function(e){return t.onHeader({column:i,columnIndex:n})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(i,n))+" ")]}),null,{column:i,columnIndex:n,label:t.label(i,n)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.colspan}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(i,n){return e("tr",{key:n,class:{"k-table-sortable-row":t.sortable&&!1!==i.sortable}},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-mobile":"true"}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+n)}})]}),null,{row:i,rowIndex:n}),t.sortable&&!1!==i.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(s,o){return e("k-table-cell",{key:n+"-"+o,staticClass:"k-table-column",style:{width:t.width(s.width)},attrs:{id:o,column:s,field:t.fields[o],row:i,mobile:s.mobile,value:i[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:n,value:e})}},nativeOn:{click:function(e){return t.onCell({row:i,rowIndex:n,column:s,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":"true"}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:i.options??t.options,text:(i.options??t.options).length>1},on:{option:function(e){return t.onOption(e,i,n)}}})]}),null,{row:i,rowIndex:n})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const nl=ut({inheritAttrs:!1,props:{column:Object,field:Object,id:String,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},emits:["input"],computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type??(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{staticClass:"k-table-cell",attrs:{"data-align":t.column.align,"data-column-id":t.id,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const sl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]},theme:{type:String,default:"passive"}},data(){return{observer:null,visible:this.tabs,invisible:[]}},computed:{buttons(){return this.visible.map(this.button)},current(){const t=this.tabs.find((t=>t.name===this.tab))??this.tabs[0];return null==t?void 0:t.name},dropdown(){return this.invisible.map(this.button)}},watch:{tabs:{async handler(){var t;null==(t=this.observer)||t.disconnect(),await this.$nextTick(),this.$el instanceof Element&&(this.observer=new ResizeObserver(this.resize),this.observer.observe(this.$el))},immediate:!0}},destroyed(){var t;null==(t=this.observer)||t.disconnect()},methods:{button(t){return{...t,current:t.name===this.current,title:t.label,text:t.label??t.text??t.name}},async resize(){const t=this.$el.offsetWidth;this.visible=this.tabs,this.invisible=[],await this.$nextTick();const e=[...this.$refs.visible].map((t=>t.$el.offsetWidth));let i=32;for(let n=0;nt)return this.visible=this.tabs.slice(0,n),void(this.invisible=this.tabs.slice(n))}}},(function(){var t=this,e=t._self._c;return t.tabs.length>1?e("nav",{staticClass:"k-tabs"},[t._l(t.buttons,(function(i){return e("div",{key:i.name,staticClass:"k-tabs-tab"},[e("k-button",t._b({ref:"visible",refInFor:!0,staticClass:"k-tab-button",attrs:{variant:"dimmed"}},"k-button",i,!1),[t._v(" "+t._s(i.text)+" ")]),i.badge?e("span",{staticClass:"k-tabs-badge",attrs:{"data-theme":t.theme}},[t._v(" "+t._s(i.badge)+" ")]):t._e()],1)})),t.invisible.length?[e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{current:!!t.invisible.find((e=>t.tab===e.name)),title:t.$t("more"),icon:"dots",variant:"dimmed"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}),e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{options:t.dropdown,"align-x":"end"}})]:t._e()],2):t._e()}),[],!1,null,null,null,null).exports;const ol=ut({props:{align:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,ll={install(t){t.component("k-aspect-ratio",Po),t.component("k-bar",No),t.component("k-box",zo),t.component("k-bubble",Fo),t.component("k-bubbles",ao),t.component("k-color-frame",Ho),t.component("k-column",Yo),t.component("k-dropzone",Vo),t.component("k-frame",Uo),t.component("k-grid",Ko),t.component("k-header",Wo),t.component("k-icon-frame",Xo),t.component("k-image-frame",Zo),t.component("k-image",Zo),t.component("k-overlay",Qo),t.component("k-stat",tl),t.component("k-stats",el),t.component("k-table",il),t.component("k-table-cell",nl),t.component("k-tabs",sl),t.component("k-view",ol)}};const al=ut({components:{draggable:()=>Y((()=>import("./vuedraggable.min.js")),[],import.meta.url)},props:{data:Object,element:{type:String,default:"div"},handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},emits:["change","end","sort","start"],computed:{dragOptions(){let t=this.handle;return!0===t&&(t=".k-sort-handle"),{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-main"),...this.options}}},methods:{onStart(t){this.$panel.drag.start("data",{}),this.$emit("start",t)},onEnd(t){this.$panel.drag.stop(),this.$emit("end",t)}}},(function(){var t=this;return(0,t._self._c)("draggable",t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},on:{change:function(e){return t.$emit("change",e)},end:t.onEnd,sort:function(e){return t.$emit("sort",e)},start:t.onStart},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const rl=ut({data:()=>({error:null}),errorCaptured(t){return this.$panel.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):Vue.h("k-box",{attrs:{theme:"negative"}},this.error.message??this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const ul=ut({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{staticClass:"k-fatal",attrs:{visible:!0}},[e("div",{staticClass:"k-fatal-box"},[e("div",{staticClass:"k-notification",attrs:{"data-theme":"negative"}},[e("p",[t._v("The JSON response could not be parsed")]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return e.stopPropagation(),t.$panel.notification.close()}}})],1),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})])])}),[],!1,null,null,null,null).exports;const cl=ut({icons:window.panel.plugins.icons,methods:{viewbox(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.innerHTML=e,document.body.appendChild(i);const n=i.getBBox(),s=(n.width+2*n.x+(n.height+2*n.y))/2,o=Math.abs(s-16),l=Math.abs(s-24);return document.body.removeChild(i),o element with the corresponding viewBox attribute.`),"0 0 16 16"):"0 0 24 24"}}},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(i,n){return e("symbol",{key:n,attrs:{id:"icon-"+n,viewBox:t.viewbox(n,i)},domProps:{innerHTML:t._s(i)}})})),0)])}),[],!1,null,null,null,null).exports;const dl=ut({mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')}},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const pl=ut({},(function(){var t=this,e=t._self._c;return t.$panel.notification.isOpen?e("div",{staticClass:"k-notification",attrs:{"data-theme":t.$panel.notification.theme}},[e("p",[t._v(t._s(t.$panel.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$panel.notification.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const hl=ut({},(function(){var t=this,e=t._self._c;return!t.$panel.system.isLocal&&t.$panel.isOffline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,ml=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const fl=ut({props:{value:{type:Number,default:0,validator:ml}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){window.panel.deprecated(": `set` method will be removed in a future version. Use the `value` prop instead."),ml(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const gl=ut({},(function(){return(0,this._self._c)("k-button",{staticClass:"k-sort-handle k-sort-button",attrs:{title:this.$t("sort.drag"),icon:"sort","aria-hidden":"true"}})}),[],!1,null,null,null,null).exports,kl={install(t){t.component("k-draggable",al),t.component("k-error-boundary",rl),t.component("k-fatal",ul),t.component("k-icon",Go),t.component("k-icons",cl),t.component("k-loader",dl),t.component("k-notification",pl),t.component("k-offline-warning",hl),t.component("k-progress",fl),t.component("k-sort-handle",gl)}};const bl=ut({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){const t=[];return this.view&&t.push({link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading}),[...t,...this.crumbs]}},mounted(){this.view&&window.panel.deprecated(": `view` prop will be removed in a future version. Use `crumbs` instead.")}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[t.segments.length>1?e("div",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"home"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown}})],1):t._e(),e("ol",t._l(t.segments,(function(i,n){return e("li",{key:n},[e("k-button",{staticClass:"k-breadcrumb-link",attrs:{icon:i.loading?"loader":i.icon,link:i.link,disabled:!i.link,text:i.text??i.label,title:i.text??i.label,current:n===t.segments.length-1&&"page",variant:"dimmed",size:"sm"}})],1)})),0)])}),[],!1,null,null,null,null).exports;const vl=ut({props:{items:{type:Array},name:{default:"items",type:String},selected:{type:String},type:{default:"radio",type:String}},emits:["select"]},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-browser"},[e("div",{staticClass:"k-browser-items"},t._l(t.items,(function(i){return e("label",{key:i.value,staticClass:"k-browser-item",attrs:{"aria-selected":t.selected===i.value}},[e("input",{attrs:{name:t.name,type:t.type},domProps:{checked:t.selected===i.value},on:{change:function(e){return t.$emit("select",i)}}}),i.image?e("k-item-image",{staticClass:"k-browser-item-image",attrs:{image:{...i.image,cover:!0,back:"black"}}}):t._e(),e("span",{staticClass:"k-browser-item-info"},[t._v(" "+t._s(i.label)+" ")])],1)})),0)])}),[],!1,null,null,null,null).exports,yl={props:{disabled:Boolean,download:Boolean,rel:String,tabindex:[String,Number],target:String,title:String}};const $l=ut({mixins:[yl],props:{to:[String,Function]},emits:["click"],computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)},relAttr(){return"_blank"===this.target?"noreferrer noopener":this.rel}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",{ref:"link",staticClass:"k-link",attrs:{download:t.download,href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title},on:{click:t.onClick}},[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"aria-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const wl=ut({mixins:[{mixins:[yl],props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],dialog:String,drawer:String,dropdown:Boolean,element:String,icon:String,id:[String,Number],link:String,responsive:[Boolean,String],role:String,selected:[String,Boolean],size:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"},variant:String}}],inheritAttrs:!1,emits:["click"],computed:{attrs(){const t={"aria-current":this.current,"aria-disabled":this.disabled,"aria-label":this.text??this.title,"aria-selected":this.selected,"data-responsive":this.responsive,"data-size":this.size,"data-theme":this.theme,"data-variant":this.variant,id:this.id,tabindex:this.tabindex,title:this.title??this.tooltip};return"k-link"===this.component?(t.disabled=this.disabled,t.download=this.download,t.to=this.link,t.rel=this.rel,t.target=this.target):"button"===this.component&&(t.autofocus=this.autofocus,t.role=this.role,t.type=this.type),this.dropdown&&(t["aria-haspopup"]="menu",t["data-dropdown"]=this.dropdown),t},component(){return this.element?this.element:this.link?"k-link":"button"}},mounted(){this.tooltip&&window.panel.deprecated(": the `tooltip` prop will be removed in a future version. Use the `title` prop instead.")},methods:{focus(){var t,e;null==(e=(t=this.$el).focus)||e.call(t)},onClick(t){var e;return this.disabled?(t.preventDefault(),!1):this.dialog?this.$dialog(this.dialog):this.drawer?this.$drawer(this.drawer):(null==(e=this.click)||e.call(this,t),void this.$emit("click",t))}}},(function(){var t=this,e=t._self._c;return e(t.component,t._b({tag:"component",staticClass:"k-button",attrs:{"data-has-icon":Boolean(t.icon),"data-has-text":Boolean(t.text||t.$slots.default)},on:{click:t.onClick}},"component",t.attrs,!1),[t.icon?e("span",{staticClass:"k-button-icon"},[e("k-icon",{attrs:{type:t.icon}})],1):t._e(),t.text||t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default",(function(){return[t._v(" "+t._s(t.text)+" ")]}))],2):t._e(),t.dropdown&&(t.text||t.$slots.default)?e("span",{staticClass:"k-button-arrow"},[e("k-icon",{attrs:{type:"angle-down"}})],1):t._e()])}),[],!1,null,null,null,null).exports;const xl=ut({props:{buttons:Array,layout:String,variant:String,theme:String,size:String,responsive:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group",attrs:{"data-layout":t.layout}},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(i,n){return e("k-button",t._b({key:n},"k-button",{variant:t.variant,theme:t.theme,size:t.size,responsive:t.responsive,...i},!1))}))],2)}),[],!1,null,null,null,null).exports;const _l=ut({props:{limit:{default:50,type:Number},opened:{type:String},selected:{type:String}},emits:["select"],data(){return{files:[],page:null,pagination:null,view:this.opened?"files":"tree"}},methods:{paginate(t){this.selectPage(this.page,t.page)},selectFile(t){this.$emit("select",t)},async selectPage(t,e=1){this.page=t;const i="/"===t.id?"/site/files":"/pages/"+this.$api.pages.id(t.id)+"/files",{data:n,pagination:s}=await this.$api.get(i,{select:"filename,id,panelImage,url,uuid",limit:this.limit,page:e});this.pagination=s,this.files=n.map((t=>({label:t.filename,image:t.panelImage,id:t.id,url:t.url,uuid:t.uuid,value:t.uuid??t.url}))),this.view="files"},async togglePage(){await this.$nextTick(),this.$refs.tree.scrollIntoView({behaviour:"smooth",block:"nearest",inline:"nearest"})}}},(function(){var t,e,i=this,n=i._self._c;return n("div",{staticClass:"k-file-browser",attrs:{"data-view":i.view}},[n("div",{staticClass:"k-file-browser-layout"},[n("aside",{ref:"tree",staticClass:"k-file-browser-tree"},[n("k-page-tree",{attrs:{current:(null==(t=i.page)?void 0:t.value)??i.opened},on:{select:i.selectPage,toggleBranch:i.togglePage}})],1),n("div",{ref:"items",staticClass:"k-file-browser-items"},[n("k-button",{staticClass:"k-file-browser-back-button",attrs:{icon:"angle-left",text:null==(e=i.page)?void 0:e.label},on:{click:function(t){i.view="tree"}}}),i.files.length?n("k-browser",{attrs:{items:i.files,selected:i.selected},on:{select:i.selectFile}}):i._e()],1),n("div",{staticClass:"k-file-browser-pagination",on:{click:function(t){t.stopPropagation()}}},[i.pagination?n("k-pagination",i._b({attrs:{details:!0},on:{paginate:i.paginate}},"k-pagination",i.pagination,!1)):i._e()],1)])])}),[],!1,null,null,null,null).exports;const Cl=ut({props:{tab:String,tabs:{type:Array,default:()=>[]}},computed:{withBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{const i=[];for(const t in e.columns)for(const n in e.columns[t].sections)if("fields"===e.columns[t].sections[n].type)for(const s in e.columns[t].sections[n].fields)i.push(s);return e.badge=i.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this;return(0,t._self._c)("k-tabs",{staticClass:"k-model-tabs",attrs:{tab:t.tab,tabs:t.withBadges,theme:"notice"}})}),[],!1,null,null,null,null).exports;const Sl=ut({props:{axis:String,disabled:Boolean,element:{type:String,default:"div"},select:{type:String,default:":where(button, a):not(:disabled)"}},emits:["next","prev"],computed:{keys(){switch(this.axis){case"x":return{ArrowLeft:this.prev,ArrowRight:this.next};case"y":return{ArrowUp:this.prev,ArrowDown:this.next};default:return{ArrowLeft:this.prev,ArrowRight:this.next,ArrowUp:this.prev,ArrowDown:this.next}}}},mounted(){this.$el.addEventListener("keydown",this.keydown)},destroyed(){this.$el.removeEventListener("keydown",this.keydown)},methods:{focus(t=0,e){this.move(t,e)},keydown(t){var e;if(this.disabled)return!1;null==(e=this.keys[t.key])||e.apply(this,[t])},move(t=0,e){var i;const n=[...this.$el.querySelectorAll(this.select)];let s=n.findIndex((t=>t===document.activeElement||t.contains(document.activeElement)));switch(-1===s&&(s=0),t){case"first":t=0;break;case"next":t=s+1;break;case"last":t=n.length-1;break;case"prev":t=s-1}t<0?this.$emit("prev"):t>=n.length?this.$emit("next"):null==(i=n[t])||i.focus(),null==e||e.preventDefault()},next(t){this.move("next",t)},prev(t){this.move("prev",t)}}},(function(){var t=this;return(0,t._self._c)(t.element,{tag:"component",staticClass:"k-navigate"},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Ol=ut({name:"k-tree",inheritAttrs:!1,props:{element:{type:String,default:"k-tree"},current:{type:String},items:{type:[Array,Object]},level:{default:0,type:Number}},emits:["close","open","select","toggle"],data(){return{state:this.items}},methods:{arrow:t=>!0===t.loading?"loader":t.open?"angle-down":"angle-right",close(t){this.$set(t,"open",!1),this.$emit("close",t)},isItem:(t,e)=>t.value===e,open(t){this.$set(t,"open",!0),this.$emit("open",t)},select(t){this.$emit("select",t)},toggle(t){this.$emit("toggle",t),!0===t.open?this.close(t):this.open(t)}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-tree",class:t.$options.name,style:{"--tree-level":t.level}},t._l(t.state,(function(i){return e("li",{key:i.value,attrs:{"aria-expanded":i.open,"aria-current":t.isItem(i,t.current)}},[e("p",{staticClass:"k-tree-branch",attrs:{"data-has-subtree":i.hasChildren&&i.open}},[e("button",{staticClass:"k-tree-toggle",attrs:{disabled:!i.hasChildren,type:"button"},on:{click:function(e){return t.toggle(i)}}},[e("k-icon",{attrs:{type:t.arrow(i)}})],1),e("button",{staticClass:"k-tree-folder",attrs:{disabled:i.disabled,type:"button"},on:{click:function(e){return t.select(i)},dblclick:function(e){return t.toggle(i)}}},[e("k-icon-frame",{attrs:{icon:i.icon??"folder"}}),e("span",{staticClass:"k-tree-folder-label"},[t._v(t._s(i.label))])],1)]),i.hasChildren&&i.open?[e(t.$options.name,t._b({ref:i.value,refInFor:!0,tag:"component",attrs:{items:i.children,level:t.level+1},on:{close:function(e){return t.$emit("close",e)},open:function(e){return t.$emit("open",e)},select:function(e){return t.$emit("select",e)},toggle:function(e){return t.$emit("toggle",e)}}},"component",t.$props,!1))]:t._e()],2)})),0)}),[],!1,null,null,null,null).exports;const Ml=ut({name:"k-page-tree",extends:Ol,inheritAttrs:!1,props:{current:{type:String},move:{type:String},root:{default:!0,type:Boolean}},data:()=>({state:[]}),async mounted(){if(this.items)this.state=this.items;else{const t=await this.load(null);await this.open(t[0]),this.state=this.root?t:t[0].children,this.current&&this.preselect(this.current)}},methods:{findItem(t){return this.state.find((e=>this.isItem(e,t)))},isItem:(t,e)=>t.value===e||t.uuid===e||t.id===e,async load(t){return await this.$panel.get("site/tree",{query:{move:this.move??null,parent:t}})},async open(t){if(t){if(!1===t.hasChildren)return!1;this.$set(t,"loading",!0),"string"==typeof t.children&&(t.children=await this.load(t.children)),this.$set(t,"open",!0),this.$set(t,"loading",!1)}},async preselect(t){const e=(await this.$panel.get("site/tree/parents",{query:{page:t,root:this.root}})).data;let i=this;for(let s=0;sPromise.resolve()}},emits:["paginate"],computed:{detailsText(){return 1===this.limit?this.start:this.start+"-"+this.end},end(){return Math.min(this.start-1+this.limit,this.total)},offset(){return this.start-1},pages(){return Math.ceil(this.total/this.limit)},start(){return(this.page-1)*this.limit+1}},methods:{async goTo(t){var e;try{await this.validate(t),null==(e=this.$refs.dropdown)||e.close();const i=((t=Math.max(1,Math.min(t,this.pages)))-1)*this.limit+1;this.$emit("paginate",{page:t,start:i,end:Math.min(i-1+this.limit,this.total),limit:this.limit,offset:i-1,total:this.total})}catch{}},prev(){this.goTo(this.page-1)},next(){this.goTo(this.page+1)}}},(function(){var t=this,e=t._self._c;return t.pages>1?e("k-button-group",{staticClass:"k-pagination",attrs:{layout:"collapsed"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.prev.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.next.apply(null,arguments)}]}},[e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.start<=1,title:t.$t("prev"),icon:"angle-left",size:"xs",variant:"filled"},on:{click:t.prev}}),t.details?[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:t.total<=t.limit,text:t.total>1?`${t.detailsText} / ${t.total}`:t.total,size:"xs",variant:"filled"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",attrs:{"align-x":"end"},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:void e.stopPropagation()},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:void e.stopPropagation()}]}},[e("form",{attrs:{method:"dialog"},on:{click:function(t){t.stopPropagation()},submit:function(e){return t.goTo(t.$refs.page.value)}}},[e("label",[t._v(" "+t._s(t.$t("pagination.page"))+": "),e("select",{ref:"page",attrs:{autofocus:!0}},t._l(t.pages,(function(i){return e("option",{key:i,domProps:{selected:t.page===i,value:i}},[t._v(" "+t._s(i)+" ")])})),0)]),e("k-button",{attrs:{type:"submit",icon:"check"}})],1)])]:t._e(),e("k-button",{staticClass:"k-pagination-button",attrs:{disabled:t.end>=t.total,title:t.$t("next"),icon:"angle-right",size:"xs",variant:"filled"},on:{click:t.next}})],2):t._e()}),[],!1,null,null,null,null).exports;const Il=ut({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]},isFullyDisabled(){return 0===this.buttons.filter((t=>!t.disabled)).length}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){var t=this,e=t._self._c;return t.isFullyDisabled?t._e():e("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:t.buttons,layout:"collapsed",size:"xs"}})}),[],!1,null,null,null,null).exports;const Dl=ut({mixins:[zt],props:{defaultType:String,isLoading:Boolean,pagination:{type:Object,default:()=>({})},results:Array,types:{type:Object,default:()=>({})}},emits:["close","more","navigate","search"],data(){return{selected:-1,type:this.types[this.defaultType]?this.defaultType:Object.keys(this.types)[0]}},computed:{typesDropdown(){return Object.values(this.types).map((t=>({...t,current:this.type===t.id,click:()=>{this.type=t.id,this.focus()}})))}},watch:{type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onDown(){this.select(Math.min(this.selected+1,this.results.length-1))},onEnter(){this.$emit("navigate",this.results[this.selected]??this.results[0])},onUp(){this.select(Math.max(this.selected-1,-1))},async search(){var t,e;null==(t=this.$refs.types)||t.close(),null==(e=this.select)||e.call(this,-1),this.$emit("search",{type:this.type,query:this.query})},select(t){var e;this.selected=t;const i=(null==(e=this.$refs.results)?void 0:e.$el.querySelectorAll(".k-item"))??[];for(const n of i)delete n.dataset.selected;t>=0&&(i[t].dataset.selected=!0)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-search-bar"},[e("div",{staticClass:"k-search-bar-input"},[t.typesDropdown.length>1?[e("k-button",{staticClass:"k-search-bar-types",attrs:{dropdown:!0,icon:t.types[t.type].icon,text:t.types[t.type].label,variant:"dimmed"},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types",attrs:{options:t.typesDropdown}})]:t._e(),e("k-search-input",{ref:"input",attrs:{"aria-label":t.$t("search"),autofocus:!0,value:t.query},on:{input:function(e){t.query=e}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-bar-close",attrs:{icon:t.isLoading?"loader":"cancel",title:t.$t("close")},on:{click:function(e){return t.$emit("close")}}})],2),t.results?e("div",{staticClass:"k-search-bar-results"},[t.results.length?e("k-collection",{ref:"results",attrs:{items:t.results},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t._e(),e("footer",{staticClass:"k-search-bar-footer"},[0===t.results.length?e("p",[t._v(" "+t._s(t.$t("search.results.none"))+" ")]):t._e(),t.results.length will be removed in a future version. Use instead.')}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Ll=ut({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},mounted(){window.panel.deprecated(' will be removed in a future version. Use instead.')},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Tl=ut({inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}},mounted(){window.panel.deprecated(" will be removed in a future version. Use instead.")}},(function(){var t=this,e=t._self._c;return e("button",{staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,Bl={install(t){t.component("k-breadcrumb",bl),t.component("k-browser",vl),t.component("k-button",wl),t.component("k-button-group",xl),t.component("k-file-browser",_l),t.component("k-link",$l),t.component("k-model-tabs",Cl),t.component("k-navigate",Sl),t.component("k-page-tree",Ml),t.component("k-pagination",Al),t.component("k-prev-next",Il),t.component("k-search-bar",Dl),t.component("k-tag",jl),t.component("k-tags",Hn),t.component("k-tree",Ol),t.component("k-button-disabled",El),t.component("k-button-link",Ll),t.component("k-button-native",Tl)}};const ql=ut({props:{buttons:Array,headline:String,invalid:Boolean,label:String,link:String,required:Boolean}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-section",attrs:{"data-invalid":t.invalid}},[t.label||t.headline||t.buttons||t.$slots.options?e("header",{staticClass:"k-section-header"},[e("k-label",{attrs:{invalid:t.invalid,link:t.link,required:t.required,title:t.label??t.headline,type:"section"}},[t._v(" "+t._s(t.label??t.headline)+" ")]),t._t("options",(function(){return[t.buttons?e("k-button-group",{staticClass:"k-section-buttons",attrs:{buttons:t.buttons,size:"xs",variant:"filled"}}):t._e()]}))],2):t._e(),t._t("default")],2)}),[],!1,null,null,null,null).exports;const Pl=ut({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},emits:["submit"],computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{variant:"columns"}},t._l(t.tab.columns,(function(i,n){return e("k-column",{key:t.parent+"-column-"+n,attrs:{width:i.width,sticky:i.sticky}},[t._l(i.sections,(function(s,o){return[t.$helper.field.isVisible(s,t.content)?[t.exists(s.type)?e("k-"+s.type+"-section",t._b({key:t.parent+"-column-"+n+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section-name-"+s.name,attrs:{column:i.width,lock:t.lock,name:s.name,parent:t.parent,timestamp:t.$panel.view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",s,!1)):[e("k-box",{key:t.parent+"-column-"+n+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:s.type}),icon:"alert",theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,Nl={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const zl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},mounted(){this.onInput=Nt(this.onInput,50),this.fetch()},methods:{async fetch(){try{const t=await this.load();this.fields=t.fields;for(const e in this.fields)this.fields[e].section=this.name,this.fields[e].endpoints={field:this.parent+"/fields/"+e,section:this.parent+"/sections/"+this.name,model:this.parent}}catch(t){this.issue=t}finally{this.isLoading=!1}},onInput(t,e,i){this.$store.dispatch("content/update",[i,t[i]])},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("k-section",{staticClass:"k-fields-section",attrs:{headline:t.issue?"Error":null}},[t.issue?e("k-box",{attrs:{text:t.issue.message,html:!1,icon:"alert",theme:"negative"}}):t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.onInput,submit:t.onSubmit}})],1)}),[],!1,null,null,null,null).exports;const Fl=ut({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("filter"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd,responsive:!0}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,fields:this.options.fields,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty??this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm(){this.search()},timestamp(){this.reload()}},mounted(){this.search=Nt(this.search,200),this.load()},methods:{async load(t){this.isProcessing=!0,t||(this.isLoading=!0);const e=this.pagination.page??localStorage.getItem(this.paginationId)??1;try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:e,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(i){this.error=i.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},async reload(){await this.load(!0)},async search(){this.pagination.page=0,await this.reload()},update(){this.reload(),this.$events.emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{class:`k-models-section k-${t.type}-section`,attrs:{buttons:t.buttons,"data-processing":t.isProcessing,headline:t.options.headline??" ",invalid:t.isInvalid,link:t.options.link,required:Boolean(t.options.min)}},[t.error?e("k-box",{attrs:{icon:"alert",theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("filter")+" …",value:t.searchterm,icon:"search",type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1)]],2):t._e()}),[],!1,null,null,null,null).exports;const Yl=ut({extends:Fl,computed:{addIcon:()=>"upload",canAdd(){return this.$panel.permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadOptions(){return{...this.options.upload,url:this.$panel.urls.api+"/"+this.options.upload.api,on:{complete:()=>{this.$panel.notification.success({context:"view"}),this.$events.emit("file.upload")}}}}},mounted(){this.$events.on("model.update",this.reload),this.$events.on("file.sort",this.reload)},destroyed(){this.$events.off("model.update",this.reload),this.$events.off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$panel.upload.pick(this.uploadOptions)},onDrop(t){this.canAdd&&this.$panel.upload.open(t,this.uploadOptions)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$panel.notification.success(),this.$events.emit("file.sort")}catch(e){this.$panel.error(e),this.reload()}finally{this.isProcessing=!1}},replace(t){this.$panel.upload.replace(t,this.uploadOptions)}}},null,null,!1,null,null,null,null).exports;const Rl=ut({mixins:[Nl],inheritAttrs:!1,data:()=>({icon:null,label:null,text:null,theme:null}),async mounted(){const t=await this.load();this.icon=t.icon,this.label=t.label,this.text=t.text,this.theme=t.theme??"info"}},(function(){var t=this,e=t._self._c;return e("k-section",{staticClass:"k-info-section",attrs:{headline:t.label}},[e("k-box",{attrs:{html:!0,icon:t.icon,text:t.text,theme:t.theme}})],1)}),[],!1,null,null,null,null).exports;const Ul=ut({extends:Fl,computed:{canAdd(){return this.options.add&&this.$panel.permissions.pages.create},items(){return this.data.map((t=>{const e=!1===t.permissions.changeStatus,i=this.$helper.page.status(t.status,e);return i.click=()=>this.$dialog(t.link+"/changeStatus"),t.flag={status:t.status,disabled:e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.buttons=[i,...t.buttons??[]],t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))},type:()=>"pages"},mounted(){this.$events.on("page.changeStatus",this.reload),this.$events.on("page.sort",this.reload)},destroyed(){this.$events.off("page.changeStatus",this.reload),this.$events.off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link??this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const n=t[e].element,s=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(n.id,"listed",s),this.$panel.notification.success(),this.$events.emit("page.sort",n)}catch(i){this.$panel.error({message:i.message,details:i.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const Hl=ut({mixins:[Nl],data:()=>({headline:null,isLoading:!0,reports:null,size:null}),async mounted(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("k-section",{staticClass:"k-stats-section",attrs:{headline:t.headline}},[t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,Vl={install(t){t.component("k-section",ql),t.component("k-sections",Pl),t.component("k-fields-section",zl),t.component("k-files-section",Yl),t.component("k-info-section",Rl),t.component("k-pages-section",Ul),t.component("k-stats-section",Hl)}};const Kl=ut({components:{"k-highlight":()=>Y((()=>import("./Highlight.min.js")),__vite__mapDeps([5,1]),import.meta.url)},props:{language:{type:String}}},(function(){var t=this,e=t._self._c;return e("k-highlight",[e("div",[e("pre",{staticClass:"k-code",attrs:{"data-language":t.language}},[e("code",{key:t.$slots.default[0].text+"-"+t.language,class:t.language?`language-${t.language}`:null},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;const Wl=ut({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}},emits:["click"],mounted(){this.size&&window.panel.deprecated(": the `size` prop will be removed in a future version. Use the `tag` prop instead."),this.theme&&window.panel.deprecated(": the `theme` prop will be removed in a future version.")}},(function(){var t=this,e=t._self._c;return e(t.tag,{tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size},on:{click:function(e){return t.$emit("click",e)}}},[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const Jl=ut({props:{input:{type:[String,Number]},invalid:{type:Boolean},link:{type:String},required:{default:!1,type:Boolean},type:{default:"field",type:String}},computed:{element(){return"section"===this.type?"h2":"label"}}},(function(){var t=this,e=t._self._c;return e(t.element,{tag:"component",staticClass:"k-label",class:"k-"+t.type+"-label",attrs:{for:t.input,"data-invalid":t.invalid}},[t.link?e("k-link",{attrs:{to:t.link}},[e("span",{staticClass:"k-label-text"},[t._t("default")],2)]):e("span",{staticClass:"k-label-text"},[t._t("default")],2),t.required&&!t.invalid?e("abbr",{attrs:{title:t.$t(t.type+".required")}},[t._v("✶")]):t._e(),e("abbr",{staticClass:"k-label-invalid",attrs:{title:t.$t(t.type+".invalid")}},[t._v("×")])],1)}),[],!1,null,null,null,null).exports;const Gl=ut({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}},mounted(){this.theme&&window.panel.deprecated(': the `theme` prop will be removed in a future version. For help text, add `.k-help "` CSS class instead.')}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports,Xl={install(t){t.component("k-code",Kl),t.component("k-headline",Wl),t.component("k-label",Jl),t.component("k-text",Gl)}},Zl={props:{back:String,color:String,cover:{type:Boolean,default:!0},icon:String,type:String,url:String}};const Ql=ut({mixins:[Zl],computed:{fallbackColor(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"orange-500":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"aqua-500":(null==(i=this.type)?void 0:i.startsWith("video/"))?"yellow-500":"white"},fallbackIcon(){var t,e,i;return(null==(t=this.type)?void 0:t.startsWith("image/"))?"image":(null==(e=this.type)?void 0:e.startsWith("audio/"))?"audio":(null==(i=this.type)?void 0:i.startsWith("video/"))?"video":"file"},isPreviewable(){return["image/jpeg","image/jpg","image/gif","image/png","image/webp","image/avif","image/svg+xml"].includes(this.type)}}},(function(){var t=this,e=t._self._c;return e("a",{staticClass:"k-upload-item-preview",attrs:{href:t.url,target:"_blank"}},[t.isPreviewable?e("k-image",{attrs:{cover:t.cover,src:t.url,back:t.back??"pattern"}}):e("k-icon-frame",{attrs:{color:t.color??t.fallbackColor,icon:t.icon??t.fallbackIcon,back:t.back??"black",ratio:"1/1"}})],1)}),[],!1,null,null,null,null).exports;const ta=ut({mixins:[Zl],props:{completed:Boolean,editable:{type:Boolean,default:!0},error:[String,Boolean],extension:String,id:String,name:String,niceSize:String,progress:Number,removable:{type:Boolean,default:!0}},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("li",{staticClass:"k-upload-item",attrs:{"data-completed":t.completed}},[e("k-upload-item-preview",{attrs:{back:t.back,color:t.color,cover:t.cover,icon:t.icon,type:t.type,url:t.url}}),e("k-input",{staticClass:"k-upload-item-input",attrs:{disabled:t.completed||!t.editable,after:"."+t.extension,novalidate:!0,required:!0,value:t.name,allow:"a-z0-9@._-",type:"slug"},on:{input:function(e){return t.$emit("rename",e)}}}),e("div",{staticClass:"k-upload-item-body"},[e("p",{staticClass:"k-upload-item-meta"},[t._v(" "+t._s(t.niceSize)+" "),t.progress?[t._v(" - "+t._s(t.progress)+"% ")]:t._e()],2),t.error?e("p",{staticClass:"k-upload-item-error"},[t._v(" "+t._s(t.error)+" ")]):t.progress?e("k-progress",{staticClass:"k-upload-item-progress",attrs:{value:t.progress}}):t._e()],1),e("div",{staticClass:"k-upload-item-toggle"},[t.completed||t.progress||!t.removable?!t.completed&&t.progress?e("k-button",{attrs:{disabled:!0,icon:"loader"}}):t.completed?e("k-button",{attrs:{icon:"check",theme:"positive"},on:{click:function(e){return t.$emit("remove")}}}):t._e():e("k-button",{attrs:{icon:"remove"},on:{click:function(e){return t.$emit("remove")}}})],1)],1)}),[],!1,null,null,null,null).exports;const ea=ut({props:{items:Array},emits:["remove","rename"]},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-upload-items"},t._l(t.items,(function(i){return e("k-upload-item",t._b({key:i.id,on:{rename:function(e){return t.$emit("rename",i,e)},remove:function(e){return t.$emit("remove",i)}}},"k-upload-item",i,!1))})),1)}),[],!1,null,null,null,null).exports,ia={install(t){t.component("k-upload-item",ta),t.component("k-upload-item-preview",Ql),t.component("k-upload-items",ea)}};const na=ut({props:{status:{default:"missing",type:String}}},(function(){var t=this,e=t._self._c;return t.$panel.activation.isOpen?e("div",{staticClass:"k-activation"},[e("p",[e("strong",[t._v(t._s(t.$t(`license.status.${t.status}.bubble`)))]),"missing"===t.status?[e("a",{attrs:{href:"https://getkirby.com/buy",target:"_blank"}},[t._v(t._s(t.$t("license.buy")))]),t._v(" & "),e("button",{attrs:{type:"button"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.activate"))+" ")])]:t._e()],2),e("k-button",{staticClass:"k-activation-toggle",attrs:{icon:"cancel-small"},on:{click:function(e){return t.$panel.activation.close()}}})],1):t._e()}),[],!1,null,null,null,null).exports;const sa=ut({computed:{notification(){return"view"!==this.$panel.notification.context||this.$panel.notification.isFatal?null:this.$panel.notification}}},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside"},[e("k-panel-menu"),e("main",{staticClass:"k-panel-main"},[e("k-topbar",{attrs:{breadcrumb:t.$panel.view.breadcrumb,view:t.$panel.view}},[t._t("topbar")],2),t._t("default")],2),t.notification&&"error"!==t.notification.type?e("k-button",{staticClass:"k-panel-notification",attrs:{icon:t.notification.icon,text:t.notification.message,theme:t.notification.theme,variant:"filled"},on:{click:function(e){return t.notification.close()}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const oa=ut({data:()=>({over:!1}),computed:{activationButton(){return"missing"===this.$panel.license?{click:()=>this.$dialog("registration"),text:this.$t("activate")}:"legacy"===this.$panel.license&&{click:()=>this.$dialog("license"),text:this.$t("renew")}},hasSearch(){return this.$helper.object.length(this.$panel.searches)>0},menus(){return this.$helper.array.split(this.$panel.menu.entries,"-")}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-panel-menu",attrs:{"aria-label":t.$t("menu"),"data-hover":t.$panel.menu.hover},on:{mouseenter:function(e){t.$panel.menu.hover=!0},mouseleave:function(e){t.$panel.menu.hover=!1}}},[e("div",{staticClass:"k-panel-menu-body"},[t.hasSearch?e("k-button",{staticClass:"k-panel-menu-search k-panel-menu-button",attrs:{text:t.$t("search"),icon:"search"},on:{click:function(e){return t.$panel.search()}}}):t._e(),t._l(t.menus,(function(i,n){return e("menu",{key:n,staticClass:"k-panel-menu-buttons",attrs:{"data-second-last":n===t.menus.length-2}},t._l(i,(function(i){return e("k-button",t._b({key:i.id,staticClass:"k-panel-menu-button",attrs:{title:i.title??i.text}},"k-button",i,!1))})),1)})),t.activationButton?e("menu",[e("k-button",t._b({staticClass:"k-activation-button k-panel-menu-button",attrs:{icon:"key",theme:"love",variant:"filled"}},"k-button",t.activationButton,!1)),e("k-activation",{attrs:{status:t.$panel.license}})],1):t._e()],2),e("k-button",{staticClass:"k-panel-menu-toggle",attrs:{icon:t.$panel.menu.isOpen?"angle-left":"angle-right",title:t.$panel.menu.isOpen?t.$t("collapse"):t.$t("expand"),size:"xs"},on:{click:function(e){return t.$panel.menu.toggle()}}})],1)}),[],!1,null,null,null,null).exports;const la=ut({},(function(){return(0,this._self._c)("k-panel",{staticClass:"k-panel-outside",attrs:{tabindex:"0"}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;const aa=ut({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$panel.drag.isDragging,"data-loading":t.$panel.isLoading,"data-language":t.$panel.language.code,"data-language-default":t.$panel.language.isDefault,"data-menu":t.$panel.menu.isOpen?"true":"false","data-role":t.$panel.user.role,"data-translation":t.$panel.translation.code,"data-user":t.$panel.user.id,dir:t.$panel.direction}},[t._t("default"),t.$panel.dialog.isOpen&&!t.$panel.dialog.legacy?e("k-fiber-dialog"):t._e(),t.$panel.drawer.isOpen&&!t.$panel.drawer.legacy?e("k-fiber-drawer"):t._e(),t.$panel.notification.isFatal&&t.$panel.notification.isOpen?e("k-fatal",{attrs:{html:t.$panel.notification.message}}):t._e(),e("k-offline-warning"),e("k-icons"),e("k-overlay",{attrs:{nested:t.$panel.drawer.history.milestones.length>1,visible:t.$panel.drawer.isOpen,type:"drawer"},on:{close:function(e){return t.$panel.drawer.close()}}},[e("portal-target",{staticClass:"k-drawer-portal k-portal",attrs:{name:"drawer",multiple:""}})],1),e("k-overlay",{attrs:{visible:t.$panel.dialog.isOpen,type:"dialog"},on:{close:function(e){return t.$panel.dialog.close()}}},[e("portal-target",{staticClass:"k-dialog-portal k-portal",attrs:{name:"dialog",multiple:""}})],1),e("portal-target",{staticClass:"k-overlay-portal k-portal",attrs:{name:"overlay",multiple:""}})],2)}),[],!1,null,null,null,null).exports;const ra=ut({props:{breadcrumb:Array,view:Object},computed:{crumbs(){return[{link:this.view.link,label:this.view.label??this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$panel.isLoading},...this.breadcrumb]}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-button",{staticClass:"k-panel-menu-proxy",attrs:{icon:"bars"},on:{click:function(e){return t.$panel.menu.toggle()}}}),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.crumbs}}),e("div",{staticClass:"k-topbar-spacer"}),e("div",{staticClass:"k-topbar-signals"},[t._t("default")],2)],1)}),[],!1,null,null,null,null).exports,ua={install(t){t.component("k-activation",na),t.component("k-panel",aa),t.component("k-panel-inside",sa),t.component("k-panel-menu",oa),t.component("k-panel-outside",la),t.component("k-topbar",ra),t.component("k-inside",sa),t.component("k-outside",la)}};const ca=ut({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-panel-${t.layout}`,{tag:"component",staticClass:"k-error-view"},["outside"===t.layout?[e("div",[e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])],1)]:[e("k-header",[t._v(t._s(t.$t("error")))]),e("k-box",{attrs:{icon:"alert",theme:"negative"}},[t._v(t._s(t.error))])]],2)}),[],!1,null,null,null,null).exports;const da=ut({mixins:[zt],props:{type:{default:"pages",type:String}},data:()=>({query:new URLSearchParams(window.location.search).get("query"),pagination:{},results:[]}),computed:{currentType(){return this.$panel.searches[this.type]??Object.values(this.$panel.searches)[0]},empty(){return this.isLoading?this.$t("searching")+"…":this.query.length<2?this.$t("search.min",{min:2}):this.$t("search.results.none")},isLoading(){return this.$panel.searcher.isLoading},tabs(){const t=[];for(const e in this.$panel.searches){const i=this.$panel.searches[e];t.push({label:i.label,link:"/search/?type="+e+"&query="+this.query,name:e})}return t}},watch:{isLoading(t){this.$panel.isLoading=t},query:{handler(){this.search(1)},immediate:!0},type(){this.search()}},methods:{focus(){var t;null==(t=this.$refs.input)||t.focus()},onPaginate(t){this.search(t.page)},async search(t){t||(t=new URLSearchParams(window.location.search).get("page")??1);const e=this.$panel.url(window.location,{type:this.currentType.id,query:this.query,page:t});window.history.pushState("","",e.toString());const i=await this.$panel.search(this.currentType.id,this.query,{page:t,limit:15});i&&(this.results=i.results??[],this.pagination=i.pagination)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-search-view"},[e("k-header",[t._v(" "+t._s(t.$t("search"))+" "),e("k-input",{ref:"input",staticClass:"k-search-view-input",attrs:{slot:"buttons","aria-label":t.$t("search"),autofocus:!0,icon:t.isLoading?"loader":"search",placeholder:t.$t("search")+" …",spellcheck:!1,value:t.query,type:"text"},on:{input:function(e){t.query=e}},slot:"buttons"})],1),e("k-tabs",{attrs:{tab:t.currentType.id,tabs:t.tabs}}),e("div",{staticClass:"k-search-view-results"},[e("k-collection",{attrs:{items:t.results,empty:{icon:t.isLoading?"loader":"search",text:t.empty},pagination:t.pagination},on:{paginate:t.onPaginate}})],1)],1)}),[],!1,null,null,null,null).exports;const pa=ut({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"$panel.view.timestamp":{handler(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},immediate:!0}},mounted(){this.$events.on("model.reload",this.$reload),this.$events.on("keydown.left",this.toPrev),this.$events.on("keydown.right",this.toNext)},destroyed(){this.$events.off("model.reload",this.$reload),this.$events.off("keydown.left",this.toPrev),this.$events.off("keydown.right",this.toNext)},methods:{toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const ha=ut({extends:pa,props:{preview:Object},computed:{focus(){const t=this.$store.getters["content/values"]().focus;if(!t)return;const[e,i]=t.replaceAll("%","").split(" ");return{x:parseFloat(e),y:parseFloat(i)}}},methods:{action(t){if("replace"===t)return this.$panel.upload.replace({...this.preview,...this.model})},setFocus(t){!0===this.$helper.object.isObject(t)&&(t=`${t.x}% ${t.y}%`),this.$store.dispatch("content/update",["focus",t])}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-file-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-file-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{staticClass:"k-file-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"},on:{action:t.action}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-file-preview",t._b({attrs:{focus:t.focus},on:{focus:t.setFocus}},"k-file-preview",t.preview,!1)),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const ma=ut({props:{focus:Object},emits:["set"],methods:{set(){this.$emit("set",{x:50,y:50})},reset(){this.$emit("set",void 0)}}},(function(){var t=this;return(0,t._self._c)("k-button",{attrs:{icon:t.focus?"cancel-small":"preview",title:t.focus?t.$t("file.focus.reset"):void 0,size:"xs",variant:"filled"},on:{click:function(e){t.focus?t.reset():t.set()}}},[t.focus?[t._v(t._s(t.focus.x)+"% "+t._s(t.focus.y)+"%")]:[t._v(t._s(t.$t("file.focus.placeholder")))]],2)}),[],!1,null,null,null,null).exports;const fa=ut({props:{details:{default:()=>[],type:Array},focus:{type:Object},focusable:Boolean,image:{default:()=>({}),type:Object},url:String},emits:["focus"],computed:{options(){return[{icon:"open",text:this.$t("open"),link:this.url,target:"_blank"},{icon:"cancel",text:this.$t("file.focus.reset"),click:()=>this.$refs.focus.reset(),when:this.focusable&&this.focus},{icon:"preview",text:this.$t("file.focus.placeholder"),click:()=>this.$refs.focus.set(),when:this.focusable&&!this.focus}]}},methods:{setFocus(t){if(!t)return this.$emit("focus",null);this.$emit("focus",{x:t.x.toFixed(1),y:t.y.toFixed(1)})}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview",attrs:{"data-has-focus":Boolean(t.focus)}},[e("div",{staticClass:"k-file-preview-thumb-column"},[e("div",{staticClass:"k-file-preview-thumb"},[t.image.src?[e("k-coords-input",{attrs:{disabled:!t.focusable,value:t.focus},on:{input:function(e){return t.setFocus(e)}}},[e("img",t._b({on:{dragstart:function(t){t.preventDefault()}}},"img",t.image,!1))]),e("k-button",{staticStyle:{color:"var(--color-gray-500)"},attrs:{icon:"dots",size:"xs"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.options,theme:"light"}})]:e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],2)]),e("div",{staticClass:"k-file-preview-details"},[e("dl",[t._l(t.details,(function(i){return e("div",{key:i.title},[e("dt",[t._v(t._s(i.title))]),e("dd",[i.link?e("k-link",{attrs:{to:i.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(i.text)+" ")]):[t._v(" "+t._s(i.text)+" ")]],2)])})),t.image.src?e("div",{staticClass:"k-file-preview-focus-info"},[e("dt",[t._v(t._s(t.$t("file.focus.title")))]),e("dd",[t.focusable?e("k-file-focus-button",{ref:"focus",attrs:{focus:t.focus},on:{set:t.setFocus}}):t.focus?[t._v(" "+t._s(t.focus.x)+"% "+t._s(t.focus.y)+"% ")]:[t._v("–")]],2)]):t._e()],2)])])}),[],!1,null,null,null,null).exports,ga={install(t){t.component("k-file-view",ha),t.component("k-file-preview",fa),t.component("k-file-focus-button",ma)}};const ka=ut({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$panel.translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"translate",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(t){this.$panel.error(t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{staticClass:"k-installation-view"},[e("div",{staticClass:"k-dialog k-installation-dialog"},[e("k-dialog-body",[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh",size:"lg",theme:"positive",variant:"filled"},on:{click:t.$reload}})],1)],1)],1)])}),[],!1,null,null,null,null).exports,ba={install(t){t.component("k-installation-view",ka)}};const va=ut({props:{languages:{type:Array,default:()=>[]},variables:{type:Boolean,default:!0}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"translate"},link:()=>{if(!1===this.variables)return null;this.$go(`languages/${t.id}`)},options:[{icon:"edit",text:this.$t("edit"),disabled:!1===this.variables,click:()=>this.$go(`languages/${t.id}`)},{icon:"cog",text:this.$t("settings"),disabled:!this.$panel.permissions.languages.update,click:()=>this.$dialog(`languages/${t.id}/update`)},{when:t.deletable,icon:"trash",text:this.$t("delete"),disabled:!this.$panel.permissions.languages.delete,click:()=>this.$dialog(`languages/${t.id}/delete`)}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"buttons"},slot:"buttons"},[e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.create,text:t.$t("language.create"),icon:"add",size:"sm",variant:"filled"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),t.languages.length>0?[e("k-section",{attrs:{headline:t.$t("languages.default")}},[e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("k-section",{attrs:{headline:t.$t("languages.secondary")}},[t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"translate",disabled:!t.$panel.permissions.languages.create},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)}),[],!1,null,null,null,null).exports;const ya=ut({props:{code:String,deletable:Boolean,direction:String,id:String,info:Array,next:Object,name:String,prev:Object,translations:Array,url:String},computed:{canUpdate(){return this.$panel.permissions.languages.update}},methods:{createTranslation(){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/create`)},option(t,e){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(e.key))}/${t}`)},remove(){this.$dialog(`languages/${this.id}/delete`)},update(t){this.$dialog(`languages/${this.id}/update`,{on:{ready:()=>{this.$panel.dialog.focus(t)}}})},updateTranslation({row:t}){this.canUpdate&&this.$dialog(`languages/${this.id}/translations/${window.btoa(encodeURIComponent(t.key))}/update`)}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-language-view",scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{attrs:{editable:t.canUpdate},on:{edit:function(e){return t.update()}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{attrs:{link:t.url,title:t.$t("open"),icon:"open",size:"sm",target:"_blank",variant:"filled"}}),e("k-button",{attrs:{disabled:!t.canUpdate,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.update()}}}),t.deletable?e("k-button",{attrs:{disabled:!t.$panel.permissions.languages.delete,title:t.$t("delete"),icon:"trash",size:"sm",variant:"filled"},on:{click:function(e){return t.remove()}}}):t._e()],1)]},proxy:!0}])},[t._v(" "+t._s(t.name)+" ")]),e("k-section",{attrs:{headline:t.$t("language.settings")}},[e("k-stats",{attrs:{reports:t.info,size:"small"}})],1),e("k-section",{attrs:{buttons:[{click:t.createTranslation,disabled:!t.canUpdate,icon:"add",text:t.$t("add")}],headline:t.$t("language.variables")}},[t.translations.length?[e("k-table",{attrs:{columns:{key:{label:t.$t("language.variable.key"),mobile:!0,width:"1/4"},value:{label:t.$t("language.variable.value"),mobile:!0}},disabled:!t.canUpdate,rows:t.translations},on:{cell:t.updateTranslation,option:t.option}})]:[e("k-empty",{attrs:{disabled:!t.canUpdate,icon:"translate"},on:{click:t.createTranslation}},[t._v(" "+t._s(t.$t("language.variables.empty"))+" ")])]],2)],1)}),[],!1,null,null,null,null).exports,$a={install(t){t.component("k-languages-view",va),t.component("k-language-view",ya)}};const wa=ut({emits:["click"]},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-notification k-login-alert",attrs:{"data-theme":"error"}},[e("p",[t._t("default")],2),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){return t.$emit("click")}}})],1)}),[],!1,null,null,null,null).exports,xa={props:{methods:{type:Array,default:()=>[]},pending:{type:Object,default:()=>({challenge:"email"})},value:String}};const _a=ut({mixins:[xa],emits:["error"],data(){return{code:this.value??"",isLoading:!1}},computed:{mode(){return this.methods.includes("password-reset")?"password-reset":"login"},submitText(){const t=this.isLoading?" …":"";return"password-reset"===this.mode?this.$t("login.reset")+t:this.$t("login")+t}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;try{await this.$api.auth.verifyCode(this.code),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"}),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[t.pending.email?e("k-user-info",{attrs:{user:t.pending.email}}):t._e(),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("footer",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left",link:"/logout",size:"lg",variant:"filled"}},[t._v(" "+t._s(t.$t("back"))+" ")]),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",type:"submit",theme:"positive",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)],1)}),[],!1,null,null,null,null).exports,Ca={props:{methods:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})}}};const Sa=ut({mixins:[Ca],emits:["error"],data(){return{mode:null,isLoading:!1,user:{email:"",password:"",remember:!1,...this.value}}},computed:{alternateMode(){return"email-password"===this.form?"email":"email-password"},canToggle(){return null!==this.codeMode&&(!1!==this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code")))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){const t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.mode?this.mode:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},submitText(){const t=this.isLoading?" …":"";return this.isResetForm?this.$t("login.reset")+t:this.$t("login")+t},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.alternateMode)}},methods:{async login(){this.$emit("error",null),this.isLoading=!0;const t={...this.user};"email"===this.mode&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]}),this.$panel.notification.success({message:this.$t("welcome")+"!",icon:"smile"})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggle(){this.mode=this.alternateMode,this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggle}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("footer",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("k-checkbox-input",{attrs:{label:t.$t("login.remember"),checked:t.user.remember,value:t.user.remember},on:{input:function(e){t.user.remember=e}}}):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",size:"lg",theme:"positive",type:"submit",variant:"filled"}},[t._v(" "+t._s(t.submitText)+" ")])],1)])}),[],!1,null,null,null,null).exports;const Oa=ut({components:{"k-login-plugin-form":window.panel.plugins.login},mixins:[xa,Ca],props:{value:{type:Object,default:()=>({code:"",email:"",password:""})}},data:()=>({issue:""}),computed:{component:()=>window.panel.plugins.login?"k-login-plugin-form":"k-login-form",form(){return this.pending.email?"code":"login"}},mounted(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel-outside",{class:"code"===t.form?"k-login-code-view":"k-login-view"},[e("div",{staticClass:"k-dialog k-login k-login-dialog"},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{nativeOn:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-dialog-body",["code"===t.form?e("k-login-code-form",t._b({on:{error:t.onError}},"k-login-code-form",{methods:t.methods,pending:t.pending,value:t.value.code},!1)):e(t.component,t._b({tag:"component",on:{error:t.onError}},"component",{methods:t.methods,value:t.value},!1))],1)],1)])}),[],!1,null,null,null,null).exports,Ma={install(t){t.component("k-login-alert",wa),t.component("k-login-code-form",_a),t.component("k-login-form",Sa),t.component("k-login-view",Oa),t.component("k-login",Sa),t.component("k-login-code",_a)}};const Aa=ut({extends:pa,props:{status:Object},computed:{protectedFields:()=>["title"],statusBtn(){return{...this.$helper.page.status.call(this,this.model.status,!this.permissions.changeStatus||this.isLocked),responsive:!0,size:"sm",text:this.status.label,variant:"filled"}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-page-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[e("k-header",{staticClass:"k-page-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}):t._e(),e("k-button",{staticClass:"k-page-view-options",attrs:{disabled:!0===t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",variant:"filled",size:"sm"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id),"align-x":"end"}}),e("k-languages-dropdown"),t.status?e("k-button",t._b({staticClass:"k-page-view-status",on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}},"k-button",t.statusBtn,!1)):t._e()],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const Ia=ut({extends:pa,emits:["submit"],computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-site-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{staticClass:"k-site-view-header",attrs:{editable:t.permissions.changeTitle&&!t.isLocked},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,title:t.$t("open"),icon:"open",target:"_blank",variant:"filled",size:"sm"}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)}),[],!1,null,null,null,null).exports,Da={install(t){t.component("k-page-view",Aa),t.component("k-site-view",Ia)}};const ja=ut({extends:pa},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-user-view",attrs:{"data-has-tabs":t.tabs.length>1,"data-id":t.model.id,"data-locked":t.isLocked,"data-template":t.blueprint},scopedSlots:t._u([{key:"topbar",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[e("k-header",{staticClass:"k-user-view-header",attrs:{editable:t.permissions.changeName&&!t.isLocked},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-user-view-options",attrs:{disabled:t.isLocked,dropdown:!0,title:t.$t("settings"),icon:"cog",size:"sm",variant:"filled"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{"align-x":"end",options:t.$dropdown(t.id)}}),e("k-languages-dropdown")],1),e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-user-profile",{attrs:{"is-locked":t.isLocked,model:t.model,permissions:t.permissions}}),e("k-model-tabs",{attrs:{tab:t.tab.name,tabs:t.tabs}}),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)}),[],!1,null,null,null,null).exports;const Ea=ut({extends:ja,prevnext:!1},null,null,!1,null,null,null,null).exports;const La=ut({data:()=>({isLoading:!1,values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password",width:"1/2"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password",width:"1/2"}}}},mounted(){this.$panel.title=this.$t("view.resetPassword")},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.$panel.notification.error(this.$t("error.user.password.invalid"));if(this.values.password!==this.values.passwordConfirmation)return this.$panel.notification.error(this.$t("error.user.password.notSame"));this.isLoading=!0;try{await this.$api.users.changePassword(this.$panel.user.id,this.values.password),this.$panel.notification.success(),this.$go("/")}catch(t){this.$panel.notification.error(t)}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-password-reset-view"},[e("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[e("k-header",{scopedSlots:t._u([{key:"buttons",fn:function(){return[e("k-button",{attrs:{icon:"check",theme:"notice",type:"submit",variant:"filled",size:"sm"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)]},proxy:!0}])},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),e("k-user-info",{attrs:{user:t.$panel.user}}),e("k-fieldset",{attrs:{fields:t.fields,value:t.values}})],1)])}),[],!1,null,null,null,null).exports;const Ta=ut({props:{model:Object},methods:{open(){this.model.avatar?this.$refs.dropdown.toggle():this.upload()},async remove(){await this.$api.users.deleteAvatar(this.model.id),this.$panel.notification.success(),this.$reload()},upload(){this.$panel.upload.pick({url:this.$panel.urls.api+"/"+this.model.link+"/avatar",accept:"image/*",immediate:!0,multiple:!1})}}},(function(){var t=this,e=t._self._c;return e("k-button",{staticClass:"k-user-view-image",attrs:{title:t.$t("avatar")},on:{click:t.open}},[t.model.avatar?[e("k-image-frame",{attrs:{cover:!0,src:t.model.avatar}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:[{icon:"upload",text:t.$t("change"),click:t.upload},{icon:"trash",text:t.$t("delete"),click:t.remove}]}})]:e("k-icon-frame",{attrs:{icon:"user"}})],2)}),[],!1,null,null,null,null).exports;const Ba=ut({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image-frame",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon-frame",{attrs:{color:"white",back:"black",icon:"user"}}),t._v(" "+t._s(t.user.name??t.user.email??t.user)+" ")],1)}),[],!1,null,null,null,null).exports;const qa=ut({props:{isLocked:Boolean,model:Object,permissions:Object}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-profile"},[e("k-user-avatar",{attrs:{disabled:t.isLocked,model:t.model}}),e("k-button-group",{attrs:{buttons:[{icon:"email",text:`${t.model.email}`,title:`${t.$t("email")}: ${t.model.email}`,disabled:!t.permissions.changeEmail||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeEmail")},{icon:"bolt",text:`${t.model.role}`,title:`${t.$t("role")}: ${t.model.role}`,disabled:!t.permissions.changeRole||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeRole")},{icon:"translate",text:`${t.model.language}`,title:`${t.$t("language")}: ${t.model.language}`,disabled:!t.permissions.changeLanguage||t.isLocked,click:()=>t.$dialog(t.model.link+"/changeLanguage")}]}})],1)}),[],!1,null,null,null,null).exports;const Pa=ut({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{empty(){return{icon:"users",text:this.$t("role.empty")}},items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))},tabs(){const t=[{name:"all",label:this.$t("role.all"),link:"/users"}];for(const e of this.roles)t.push({name:e.id,label:e.title,link:"/users?role="+e.id});return t}},methods:{create(){var t;this.$dialog("users/create",{query:{role:null==(t=this.role)?void 0:t.id}})},paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t,e=this,i=e._self._c;return i("k-panel-inside",{staticClass:"k-users-view"},[i("k-header",{staticClass:"k-users-view-header",scopedSlots:e._u([{key:"buttons",fn:function(){return[i("k-button",{attrs:{disabled:!e.$panel.permissions.users.create,text:e.$t("user.create"),icon:"add",size:"sm",variant:"filled"},on:{click:e.create}})]},proxy:!0}])},[e._v(" "+e._s(e.$t("view.users"))+" ")]),i("k-tabs",{attrs:{tab:(null==(t=e.role)?void 0:t.id)??"all",tabs:e.tabs}}),i("k-collection",{attrs:{empty:e.empty,items:e.items,pagination:e.users.pagination},on:{paginate:e.paginate}})],1)}),[],!1,null,null,null,null).exports,Na={install(t){t.component("k-account-view",Ea),t.component("k-reset-password-view",La),t.component("k-user-avatar",Ta),t.component("k-user-info",Ba),t.component("k-user-profile",qa),t.component("k-user-view",ja),t.component("k-users-view",Pa)}};const za=ut({components:{Plugins:ut({props:{plugins:Array}},(function(){var t=this,e=t._self._c;return t.plugins.length?e("k-section",{attrs:{headline:t.$t("plugins"),link:"https://getkirby.com/plugins"}},[e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()}),[],!1,null,null,null,null).exports,Security:ut({props:{exceptions:Array,security:Array,urls:Object},data(){return{issues:structuredClone(this.security)}},async mounted(){console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled??Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.issues.length-this.security.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return;const{status:i}=await fetch(e,{cache:"no-store"});i<400&&this.issues.push({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})},retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return t.issues.length?e("k-section",{attrs:{headline:t.$t("security"),buttons:[{title:t.$t("retry"),icon:"refresh",click:t.retry}]}},[e("k-items",{attrs:{items:t.issues.map((t=>({image:{back:"var(--color-red-200)",icon:t.icon??"alert",color:"var(--color-red)"},target:"_blank",...t})))}})],1):t._e()}),[],!1,null,null,null,null).exports},props:{environment:Array,exceptions:Array,info:Object,plugins:Array,security:Array,urls:Object},mounted(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check."))},methods:{copy(){const t=JSON.stringify({info:this.info,security:this.security.map((t=>t.text)),plugins:this.plugins.map((t=>({name:t.name.text,version:t.version.currentVersion})))},null,2);this.$helper.clipboard.write(t),this.$panel.notification.success({message:this.$t("system.info.copied")})}}},(function(){var t=this,e=t._self._c;return e("k-panel-inside",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("k-section",{attrs:{headline:t.$t("environment"),buttons:[{text:t.$t("system.info.copy"),icon:"copy",responsive:!0,click:t.copy}]}},[e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),e("security",{attrs:{security:t.security,urls:t.urls}}),e("plugins",{attrs:{plugins:t.plugins}})],1)}),[],!1,null,null,null,null).exports;const Fa=ut({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{dropdown:!0,icon:t.value.icon,href:t.value.url,text:t.value.currentVersion,theme:t.value.theme,size:"xs",variant:"filled"},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{"align-x":"end"}},[e("dl",{staticClass:"k-plugin-info"},[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))]),e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))]),e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))]),e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])]),t.value.url?[e("hr"),e("k-button",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")])]:t._e()],2)]],2)}),[],!1,null,null,null,null).exports,Ya={install(t){t.component("k-system-view",za),t.component("k-table-update-status-cell",Fa)}};const Ra=ut({props:{id:String},mounted(){window.panel.deprecated(" will be removed in a future version.")}},(function(){var t=this._self._c;return t("k-panel-inside",[t("k-"+this.id+"-plugin-view",{tag:"component"})],1)}),[],!1,null,null,null,null).exports,Ua={install(t){t.component("k-error-view",ca),t.component("k-search-view",da),t.use(ga),t.use(ba),t.use($a),t.use(Ma),t.use(Da),t.use(Ya),t.use(Na),t.component("k-plugin-view",Ra)}},Ha={install(t){t.use(kt),t.use(se),t.use(xe),t.use(Be),t.use(Eo),t.use(qo),t.use(ll),t.use(kl),t.use(Bl),t.use(Vl),t.use(Xl),t.use(ia),t.use(ua),t.use(Ua),t.use(L)}},Va={install(t){window.onunhandledrejection=t=>{t.preventDefault(),window.panel.error(t.reason)},t.config.errorHandler=window.panel.error.bind(window.panel)}},Ka=(t={})=>{var e=t.desc?-1:1,i=-e,n=/^0/,s=/\s+/g,o=/^\s+|\s+$/g,l=/[^\x00-\x80]/,a=/^0x[0-9a-f]+$/i,r=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(n)||1===e)&&parseFloat(t)||t.replace(s," ").replace(o,"")||0}return function(t,n){var s=c(t),o=c(n);if(!s&&!o)return 0;if(!s&&o)return i;if(s&&!o)return e;var r=d(s),h=d(o),m=parseInt(s.match(a),16)||1!==r.length&&Date.parse(s),f=parseInt(o.match(a),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=r.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(w<0)return i;if(b===v-1)return 0}else{if(y<$)return i;if(y>$)return e}}return 0}};function Wa(t){return Array.isArray(t)?t:Object.values(t??{})}RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};function Ja(t,e){return t.reduce(((t,i)=>(i===e?t.push([]):t[t.length-1].push(i),t)),[[]])}function Ga(t){return Array.isArray(t)?t:[t]}Array.fromObject=Wa,Object.defineProperty(Array.prototype,"sortBy",{value:function(t){return t(this,t)},enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(Array.prototype,"split",{value:function(t){return Ja(this,t)},enumerable:!1,writable:!0,configurable:!0}),Array.wrap=Ga;const Xa={fromObject:Wa,search:(t,e,i={})=>{if((e??"").length<=(i.min??0))return t;const n=new RegExp(RegExp.escape(e),"ig"),s=i.field??"text",o=t.filter((t=>!!t[s]&&null!==t[s].match(n)));return i.limit?o.slice(0,i.limit):o},sortBy:function(t,e){const i=e.split(" "),n=i[0],s=i[1]??"asc",o=Ka({desc:"desc"===s,insensitive:!0});return t.sort(((t,e)=>{const i=String(t[n]??""),s=String(e[n]??"");return o(i,s)}))},split:Ja,wrap:Ga};const Za={read:function(t,e=!1){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){if(t.preventDefault(),!0===e)return t.clipboardData.getData("text/plain");const i=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(i)return i.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const i=document.createElement("textarea");if(i.value=t,document.body.append(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.contentEditable=!0,i.readOnly=!0;const t=document.createRange();t.selectNodeContents(i);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),i.setSelectionRange(0,999999)}else i.select();return document.execCommand("copy"),i.remove(),!0}};function Qa(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function tr(t,e=!1){if(!t.match("youtu"))return!1;let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t)),s=n[0],o=n[1],l="https://"+(!0===e?"www.youtube-nocookie.com":i.host)+"/embed",a=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let r=i.searchParams,u=null;switch(n.join("/")){case"embed/videoseries":case"playlist":a(r.get("list"))&&(u=l+"/videoseries");break;case"watch":a(r.get("v"))&&(u=l+"/"+r.get("v"),r.has("t")&&r.set("start",r.get("t")),r.delete("v"),r.delete("t"));break;default:i.host.includes("youtu.be")&&a(s)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+s:"https://www.youtube.com/embed/"+s,r.has("t")&&r.set("start",r.get("t")),r.delete("t")):["embed","shorts"].includes(s)&&a(o)&&(u=l+"/"+o)}if(!u)return!1;const c=r.toString();return c.length&&(u+="?"+c),u}function er(t,e=!1){let i=null;try{i=new URL(t)}catch{return!1}const n=i.pathname.split("/").filter((t=>""!==t));let s=i.searchParams,o=null;switch(!0===e&&s.append("dnt",1),i.host){case"vimeo.com":case"www.vimeo.com":o=n[0];break;case"player.vimeo.com":o=n[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let l="https://player.vimeo.com/video/"+o;const a=s.toString();return a.length&&(l+="?"+a),l}const ir={youtube:tr,vimeo:er,video:function(t,e=!1){return!0===t.includes("youtu")?tr(t,e):!0===t.includes("vimeo")&&er(t,e)}};function nr(t){var e;if(void 0!==t.default)return structuredClone(t.default);const i=window.panel.app.$options.components[`k-${t.type}-field`],n=null==(e=null==i?void 0:i.options.props)?void 0:e.value;if(void 0===n)return;const s=null==n?void 0:n.default;return"function"==typeof s?s():void 0!==s?s:null}const sr={defaultValue:nr,form:function(t){const e={};for(const i in t){const n=nr(t[i]);void 0!==n&&(e[i]=n)}return e},isVisible:function(t,e){if("hidden"===t.type||!0===t.hidden)return!1;if(!t.when)return!0;for(const i in t.when){const n=e[i.toLowerCase()],s=t.when[i];if((void 0!==n||!(""===s||Array.isArray(s)&&0===s.length))&&n!==s)return!1}return!0},subfields:function(t,e){let i={};for(const n in e){const s=e[n];s.section=t.name,t.endpoints&&(s.endpoints={field:t.endpoints.field+"+"+n,section:t.endpoints.section,model:t.endpoints.model}),i[n]=s}return i}},or=t=>t.split(".").slice(-1).join(""),lr=t=>t.split(".").slice(0,-1).join("."),ar=t=>Intl.NumberFormat("en",{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow"}).format(t),rr={extension:or,name:lr,niceSize:ar};function ur(t,e){if("string"==typeof t&&(t=document.querySelector(t)),!t)return!1;if(!e&&t.contains(document.activeElement)&&t!==document.activeElement)return!1;const i=[":where([autofocus], [data-autofocus])",":where(input, textarea, select, [contenteditable=true], .input-focus)","[type=submit]","button"];e&&i.unshift(`[name="${e}"]`);const n=function(t,e){for(const i of e){const e=t.querySelector(i);if(!0===cr(e))return e}return null}(t,i);return n?(n.focus(),n):!0===cr(t)&&(t.focus(),t)}function cr(t){return!!t&&(!t.matches("[disabled], [aria-disabled], input[type=hidden]")&&(!t.closest("[aria-disabled]")&&!t.closest("[disabled]")&&"function"==typeof t.focus))}const dr=t=>"function"==typeof window.Vue.options.components[t],pr=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const hr={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}};function mr(t){return!0===t.startsWith("file://")||!0===t.startsWith("/@/file/")}function fr(t){return"site://"===t||!0===t.startsWith("page://")||!0===t.startsWith("/@/page/")}function gr(t=[]){const e={url:{detect:t=>/^(http|https):\/\//.test(t),icon:"url",id:"url",label:window.panel.$t("url"),link:t=>t,placeholder:window.panel.$t("url.placeholder"),input:"url",value:t=>t},page:{detect:t=>!0===fr(t),icon:"page",id:"page",label:window.panel.$t("page"),link:t=>t,placeholder:window.panel.$t("select")+" …",input:"text",value:t=>t},file:{detect:t=>!0===mr(t),icon:"file",id:"file",label:window.panel.$t("file"),link:t=>t,placeholder:window.panel.$t("select")+" …",value:t=>t},email:{detect:t=>t.startsWith("mailto:"),icon:"email",id:"email",label:window.panel.$t("email"),link:t=>t.replace(/^mailto:/,""),placeholder:window.panel.$t("email.placeholder"),input:"email",value:t=>"mailto:"+t},tel:{detect:t=>t.startsWith("tel:"),icon:"phone",id:"tel",label:window.panel.$t("tel"),link:t=>t.replace(/^tel:/,""),pattern:"[+]{0,1}[0-9]+",placeholder:window.panel.$t("tel.placeholder"),input:"tel",value:t=>"tel:"+t},anchor:{detect:t=>t.startsWith("#"),icon:"anchor",id:"anchor",label:"Anchor",link:t=>t,pattern:"^#.+",placeholder:"#element",input:"text",value:t=>t},custom:{detect:()=>!0,icon:"title",id:"custom",label:window.panel.$t("custom"),link:t=>t,input:"text",value:t=>t}};if(!t.length)return e;const i={};for(const n of t)i[n]=e[n];return i}const kr={detect:function(t,e){if(t=t??"",e=e??gr(),0===t.length)return{type:Object.keys(e)[0]??"url",link:""};for(const i in e)if(!0===e[i].detect(t))return{type:i,link:e[i].link(t)}},getFileUUID:function(t){return t.replace("/@/file/","file://")},getPageUUID:function(t){return t.replace("/@/page/","page://")},isFileUUID:mr,isPageUUID:fr,preview:async function({type:t,link:e},i){return"page"===t&&e?await async function(t,e=["title","panelImage"]){if("site://"===t)return{label:window.panel.$t("view.site")};try{const i=await window.panel.api.pages.get(t,{select:e.join(",")});return{label:i.title,image:i.panelImage}}catch{return null}}(e,i):"file"===t&&e?await async function(t,e=["filename","panelImage"]){try{const i=await window.panel.api.files.get(null,t,{select:e.join(",")});return{label:i.filename,image:i.panelImage}}catch{return null}}(e,i):e?{label:e}:null},types:gr};const br={status:function(t,e=!1){const i={class:"k-status-icon",icon:"status-"+t,title:window.panel.$t("page.status")+": "+window.panel.$t("page.status."+t),disabled:e,size:"xs",style:"--icon-size: 15px"};return e&&(i.title+=` (${window.panel.$t("disabled")})`),i.theme="draft"===t?"negative-icon":"unlisted"===t?"info-icon":"positive-icon",i}},vr=(t="3/2",e="100%",i=!0)=>{const n=String(t).split("/");if(2!==n.length)return e;const s=Number(n[0]),o=Number(n[1]);let l=100;return 0!==s&&0!==o&&(l=i?l/s*o:l/o*s,l=parseFloat(String(l)).toFixed(2)),l+"%"},yr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function $r(t){return String(t).replace(/[&<>"'`=/]/g,(t=>yr[t]))}function wr(t){return!t||0===String(t).length}function xr(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)}function _r(t="",e=""){const i=new RegExp(`^(${RegExp.escape(e)})+`,"g");return t.replace(i,"")}function Cr(t="",e=""){const i=new RegExp(`(${RegExp.escape(e)})+$`,"g");return t.replace(i,"")}function Sr(t,e={}){const i=(t,e={})=>{const n=e[$r(t.shift())]??"…";return"…"===n||0===t.length?n:i(t,n)},n="[{]{1,2}[\\s]?",s="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${n}(.*?)${s}`,"gi"),((t,n)=>i(n.split("."),e)))).replace(new RegExp(`${n}.*${s}`,"gi"),"…")}function Or(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}function Mr(){let t,e,i="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(i+="-"),i+=(12==t?4:16==t?3&e|8:e).toString(16);return i}const Ar={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:$r,hasEmoji:function(t){if("string"!=typeof t)return!1;if(!0===/^[a-z0-9_-]+$/.test(t))return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},isEmpty:wr,lcfirst:xr,ltrim:_r,pad:function(t,e=2){t=String(t);let i="";for(;i.length]+)>)/gi,"")},template:Sr,ucfirst:Or,ucwords:function(t){return String(t).split(/ /g).map((t=>Or(t))).join(" ")},unescapeHTML:function(t){for(const e in yr)t=String(t).replaceAll(yr[e],e);return t},uuid:Mr},Ir=async(t,e)=>new Promise(((i,n)=>{const s={url:"/",field:"file",method:"POST",filename:t.name,headers:{},attributes:{},complete:()=>{},error:()=>{},success:()=>{},progress:()=>{}},o=Object.assign(s,e),l=new XMLHttpRequest,a=new FormData;a.append(o.field,t,o.filename);for(const t in o.attributes){const e=o.attributes[t];null!=e&&a.append(t,e)}const r=e=>{if(e.lengthComputable&&o.progress){const i=Math.max(0,Math.min(100,Math.ceil(e.loaded/e.total*100)));o.progress(l,t,i)}};l.upload.addEventListener("loadstart",r),l.upload.addEventListener("progress",r),l.addEventListener("load",(e=>{let s=null;try{s=JSON.parse(e.target.response)}catch{s={status:"error",message:"The file could not be uploaded"}}"error"===s.status?(o.error(l,t,s),n(s)):(o.progress(l,t,100),o.success(l,t,s),i(s))})),l.addEventListener("error",(e=>{const i=JSON.parse(e.target.response);o.progress(l,t,100),o.error(l,t,i),n(i)})),l.open(o.method,o.url,!0);for(const t in o.headers)l.setRequestHeader(t,o.headers[t]);l.send(a)}));function Dr(){var t;return new URL((null==(t=document.querySelector("base"))?void 0:t.href)??window.location.origin)}function jr(t={},e={}){e instanceof URL&&(e=e.search);const i=new URLSearchParams(e);for(const[n,s]of Object.entries(t))null!==s&&i.set(n,s);return i}function Er(t="",e={},i){return(t=Pr(t,i)).search=jr(e,t.search),t}function Lr(t){return null!==String(t).match(/^https?:\/\//)}function Tr(t){return Pr(t).origin===window.location.origin}function Br(t,e){if((t instanceof URL||t instanceof Location)&&(t=t.toString()),"string"!=typeof t)return!1;try{new URL(t,window.location)}catch{return!1}if(!0===e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:localhost)|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i.test(t)}return!0}function qr(t,e){return!0===Lr(t)?t:(e=e??Dr(),(e=String(e).replaceAll(/\/$/g,""))+"/"+(t=String(t).replaceAll(/^\//g,"")))}function Pr(t,e){return t instanceof URL?t:new URL(qr(t,e))}const Nr={base:Dr,buildQuery:jr,buildUrl:Er,isAbsolute:Lr,isSameOrigin:Tr,isUrl:Br,makeAbsolute:qr,toObject:Pr},zr={install(t){t.prototype.$helper={array:Xa,clipboard:Za,clone:wt.clone,color:Qa,embed:ir,focus:ur,isComponent:dr,isUploadEvent:pr,debounce:Nt,field:sr,file:rr,keyboard:hr,link:kr,object:wt,page:br,pad:Ar.pad,ratio:vr,slug:Ar.slug,sort:Ka,string:Ar,upload:Ir,url:Nr,uuid:Ar.uuid},t.prototype.$esc=Ar.escapeHTML}},Fr={install(t){const e=(t,e,i)=>{!0!==i.context.disabled?t.dir=window.panel.language.direction:t.dir=null};t.directive("direction",{bind:e,update:e})}},Yr={install(t){window.panel.redirect=window.panel.redirect.bind(window.panel),window.panel.reload=window.panel.reload.bind(window.panel),window.panel.request=window.panel.request.bind(window.panel),window.panel.search=window.panel.search.bind(window.panel);const e=["api","config","direction","events","language","languages","license","menu","multilang","permissions","search","searches","system","t","translation","url","urls","user","view"];for(const i of e){const e=`$${i}`;t.prototype[e]=window.panel[e]=window.panel[i]}window.panel.$vue=window.panel.app}},Rr=/^#?([\da-f]{3}){1,2}$/i,Ur=/^#?([\da-f]{4}){1,2}$/i,Hr=/^rgba?\(\s*(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s)+(\d{1,3})(%?)(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i,Vr=/^hsla?\(\s*(\d{1,3}\.?\d*)(deg|rad|grad|turn)?(?:,|\s)+(\d{1,3})%(?:,|\s)+(\d{1,3})%(?:,|\s|\/)*(\d*(?:\.\d+)?)(%?)\s*\)?$/i;function Kr(t){return"string"==typeof t&&(Rr.test(t)||Ur.test(t))}function Wr(t){return vt(t)&&"r"in t&&"g"in t&&"b"in t}function Jr(t){return vt(t)&&"h"in t&&"s"in t&&"l"in t}function Gr({h:t,s:e,v:i,a:n}){if(0===i)return{h:t,s:0,l:0,a:n};if(0===e&&1===i)return{h:t,s:1,l:1,a:n};const s=i*(2-e)/2;return{h:t,s:e=i*e/(1-Math.abs(2*s-1)),l:s,a:n}}function Xr({h:t,s:e,l:i,a:n}){const s=e*(i<.5?i:1-i);return{h:t,s:e=0===s?0:2*s/(i+s),v:i+s,a:n}}function Zr(t){if(!0===Rr.test(t)||!0===Ur.test(t)){"#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.split("").reduce(((t,e)=>t+e+e),""));const e=parseInt(t,16);return!0===Rr.test(t)?{r:e>>16,g:e>>8&255,b:255&e,a:1}:{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:Math.round((255&e)/255*100)/100}}throw new Error(`unknown hex color: ${t}`)}function Qr({r:t,g:e,b:i,a:n=1}){let s="#"+(1<<24|t<<16|e<<8|i).toString(16).slice(1);return n<1&&(s+=(256|Math.round(255*n)).toString(16).slice(1)),s}function tu({h:t,s:e,l:i,a:n}){const s=e*Math.min(i,1-i),o=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return{r:255*o(0),g:255*o(8),b:255*o(4),a:n}}function eu({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i),l=1-Math.abs(s+s-o-1);let a=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return a=60*(a<0?a+6:a),{h:a,s:l?o/l:0,l:(s+s-o)/2,a:n}}function iu(t){return Qr(tu(t))}function nu(t){return eu(Zr(t))}function su(t,e){return t=Number(t),"grad"===e?t*=.9:"rad"===e?t*=180/Math.PI:"turn"===e&&(t*=360),parseInt(t%360)}function ou(t,e){if(!0===Kr(t))switch("#"!==t[0]&&(t="#"+t),e){case"hex":return t;case"rgb":return Zr(t);case"hsl":return nu(t);case"hsv":return Xr(nu(t))}if(!0===Wr(t))switch(e){case"hex":return Qr(t);case"rgb":return t;case"hsl":return eu(t);case"hsv":return function({r:t,g:e,b:i,a:n}){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),o=s-Math.min(t,e,i);let l=o&&(s==t?(e-i)/o:s==e?2+(i-t)/o:4+(t-e)/o);return l=60*(l<0?l+6:l),{h:l,s:s&&o/s,v:s,a:n}}(t)}if(!0===Jr(t))switch(e){case"hex":return iu(t);case"rgb":return tu(t);case"hsl":return t;case"hsv":return Xr(t)}if(!0===function(t){return vt(t)&&"h"in t&&"s"in t&&"v"in t}(t))switch(e){case"hex":return iu(Gr(t));case"rgb":return function({h:t,s:e,v:i,a:n}){const s=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return{r:255*s(5),g:255*s(3),b:255*s(1),a:n}}(t);case"hsl":return Gr(t);case"hsv":return t}throw new Error(`Invalid color conversion: ${JSON.stringify(t)} -> ${e}`)}function lu(t){let e;if(!t||"string"!=typeof t)return!1;if(!0===Kr(t))return"#"!==t[0]&&(t="#"+t),t;if(e=t.match(Hr)){const t={r:Number(e[1]),g:Number(e[3]),b:Number(e[5]),a:Number(e[7]||1)};return"%"===e[2]&&(t.r=Math.ceil(2.55*t.r)),"%"===e[4]&&(t.g=Math.ceil(2.55*t.g)),"%"===e[6]&&(t.b=Math.ceil(2.55*t.b)),"%"===e[8]&&(t.a=t.a/100),t}if(e=t.match(Vr)){let[t,i,n,s,o]=e.slice(1);const l={h:su(t,i),s:Number(n)/100,l:Number(s)/100,a:Number(o||1)};return"%"===e[6]&&(l.a=l.a/100),l}return null}const au={convert:ou,parse:lu,parseAs:function(t,e){const i=lu(t);return i&&e?ou(i,e):i},toString:function(t,e,i=!0){var n,s;let o=t;if("string"==typeof o&&(o=lu(t)),o&&e&&(o=ou(o,e)),!0===Kr(o))return!0!==i&&(5===o.length?o=o.slice(0,4):o.length>7&&(o=o.slice(0,7))),o.toLowerCase();if(!0===Wr(o)){const t=o.r.toFixed(),e=o.g.toFixed(),s=o.b.toFixed(),l=null==(n=o.a)?void 0:n.toFixed(2);return i&&l&&l<1?`rgb(${t} ${e} ${s} / ${l})`:`rgb(${t} ${e} ${s})`}if(!0===Jr(o)){const t=o.h.toFixed(),e=(100*o.s).toFixed(),n=(100*o.l).toFixed(),l=null==(s=o.a)?void 0:s.toFixed(2);return i&&l&&l<1?`hsl(${t} ${e}% ${n}% / ${l})`:`hsl(${t} ${e}% ${n}%)`}throw new Error(`Unsupported color: ${JSON.stringify(t)}`)}};T.extend(B),T.extend(((t,e,i)=>{i.interpret=(t,e="date")=>{const n={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM YYYY":!0,"MMM DD":!1,"MMM D":!1,"MM YYYY":!0,"M YYYY":!0,"MMMM DD YYYY":!0,"MMMM D YYYY":!0,"MMMM DD YY":!0,"MMMM D YY":!0,"MMMM DD, YYYY":!0,"MMMM D, YYYY":!0,"MMMM DD, YY":!0,"MMMM D, YY":!0,"MMMM DD. YYYY":!0,"MMMM D. YYYY":!0,"MMMM DD. YY":!0,"MMMM D. YY":!0,DDMMYYYY:!0,DDMMYY:!0,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HHmmss a":!1,"HHmm a":!1,"HH a":!1,HHmmss:!1,HHmm:!1,"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const s in n[e]){const o=i(t,s,n[e][s]);if(!0===o.isValid())return o}return null}})),T.extend(((t,e,i)=>{const n=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(n(t))},i.iso=function(t,e){e&&(e=n(e)),e??(e=[n("datetime"),n("date"),n("time")]);const s=i(t,e);return s&&s.isValid()?s:null}})),T.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let i=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.hasOwn(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const n of e)i=i.set(n,t.get(n));return i}})),T.extend(((t,e,i)=>{i.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const i={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const n=this.pattern.indexOf(t);return{index:e,unit:Object.keys(i)[Object.values(i).findIndex((e=>e.includes(t)))],start:n,end:n+(t.length-1)}}))}at(t,e=t){const i=this.parts.filter((i=>i.start<=t&&i.end>=e-1));return i[0]?i[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(i,t)})),T.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const i=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===i.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let n=this.clone();const s=i.indexOf(t),o=i.slice(0,s),l=o.pop();for(const a of o)n=n.startOf(a);if(l){const e={month:12,date:n.daysInMonth(),hour:24,minute:60,second:60}[l];Math.round(n.get(l)/e)*e===e&&(n=n.add(1,"date"===t?"day":t)),n=n.startOf(t)}return n=n.set(t,Math.round(n.get(t)/e)*e),n}})),T.extend(((t,e,i)=>{e.prototype.validate=function(t,e,n="day"){if(!this.isValid())return!1;if(!t)return!0;t=i.iso(t);const s={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,n)||this[s](t,n)}}));const ru={install(t){t.prototype.$library={autosize:q,colors:au,dayjs:T}}},uu=()=>({close(){sessionStorage.setItem("kirby$activation$card","true"),this.isOpen=!1},isOpen:"true"!==sessionStorage.getItem("kirby$activation$card"),open(){sessionStorage.removeItem("kirby$activation$card"),this.isOpen=!0}}),cu=t=>({async changeName(e,i,n){return t.patch(this.url(e,i,"name"),{name:n})},async delete(e,i){return t.delete(this.url(e,i))},async get(e,i,n){let s=await t.get(this.url(e,i),n);return!0===Array.isArray(s.content)&&(s.content={}),s},id:t=>!0===t.startsWith("/@/file/")?t.replace("/@/file/","@"):!0===t.startsWith("file://")?t.replace("file://","@"):t,link(t,e,i){return"/"+this.url(t,e,i)},async update(e,i,n){return t.patch(this.url(e,i),n)},url(t,e,i){let n="files/"+this.id(e);return t&&(n=t+"/"+n),i&&(n+="/"+i),n}}),du=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,i){return t.get("pages/"+this.id(e)+"/blueprints",{section:i})},async changeSlug(e,i){return t.patch("pages/"+this.id(e)+"/slug",{slug:i})},async changeStatus(e,i,n){return t.patch("pages/"+this.id(e)+"/status",{status:i,position:n})},async changeTemplate(e,i){return t.patch("pages/"+this.id(e)+"/template",{template:i})},async changeTitle(e,i){return t.patch("pages/"+this.id(e)+"/title",{title:i})},async children(e,i){return t.post("pages/"+this.id(e)+"/children/search",i)},async create(e,i){return null===e||"/"===e?t.post("site/children",i):t.post("pages/"+this.id(e)+"/children",i)},async delete(e,i){return t.delete("pages/"+this.id(e),i)},async duplicate(e,i,n){return t.post("pages/"+this.id(e)+"/duplicate",{slug:i,children:n.children??!1,files:n.files??!1})},async get(e,i){let n=await t.get("pages/"+this.id(e),i);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>!0===t.startsWith("/@/page/")?t.replace("/@/page/","@"):!0===t.startsWith("page://")?t.replace("page://","@"):t.replace(/\//g,"+"),async files(e,i){return t.post("pages/"+this.id(e)+"/files/search",i)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,i){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",i):t.post("site/children/search?select=id,title,hasChildren",i)},async update(e,i){return t.patch("pages/"+this.id(e),i)},url(t,e){let i=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(i+="/"+e),i}});class pu extends Error{constructor(t,{request:e,response:i,cause:n}){super(i.json.message??t,{cause:n}),this.request=e,this.response=i}state(){return this.response.json}}class hu extends pu{}class mu extends pu{state(){return{message:this.message,text:this.response.text}}}const fu=t=>(window.location.href=qr(t),!1),gu=async(t,e={})=>{var i;(e={cache:"no-store",credentials:"same-origin",mode:"same-origin",...e}).body=((i=e.body)instanceof HTMLFormElement&&(i=new FormData(i)),i instanceof FormData&&(i=Object.fromEntries(i)),"object"==typeof i?JSON.stringify(i):i),e.headers=((t={},e={})=>{return{"content-type":"application/json","x-csrf":e.csrf??!1,"x-fiber":!0,"x-fiber-globals":(i=e.globals,!!i&&(!1===Array.isArray(i)?String(i):i.join(","))),"x-fiber-referrer":e.referrer??!1,...$t(t)};var i})(e.headers,e),e.url=Er(t,e.query);const n=new Request(e.url,e);return!1===Tr(n.url)?fu(n.url):await ku(n,await fetch(n))},ku=async(t,e)=>{var i;if(!1===e.headers.get("Content-Type").includes("application/json"))return fu(e.url);try{e.text=await e.text(),e.json=JSON.parse(e.text)}catch(n){throw new mu("Invalid JSON response",{cause:n,request:t,response:e})}if(401===e.status)throw new hu("Unauthenticated",{request:t,response:e});if("error"===(null==(i=e.json)?void 0:i.status))throw e.json;if(!1===e.ok)throw new pu(`The request to ${e.url} failed`,{request:t,response:e});return{request:t,response:e}},bu=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,i)=>t.get("users/"+e+"/blueprints",{section:i}),changeEmail:async(e,i)=>t.patch("users/"+e+"/email",{email:i}),changeLanguage:async(e,i)=>t.patch("users/"+e+"/language",{language:i}),changeName:async(e,i)=>t.patch("users/"+e+"/name",{name:i}),changePassword:async(e,i)=>t.patch("users/"+e+"/password",{password:i}),changeRole:async(e,i)=>t.patch("users/"+e+"/role",{role:i}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,i)=>t.get("users/"+e,i),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description??`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,i)=>t.patch("users/"+e,i),url(t,e){let i=t?"users/"+t:"users";return e&&(i+="/"+e),i}}),vu=t=>{const e={csrf:t.system.csrf,endpoint:Cr(t.urls.api,"/"),methodOverwrite:!0,ping:null,requests:[],running:0},i=()=>{clearInterval(e.ping),e.ping=setInterval(e.auth.ping,3e5)};return e.request=async(n,s={},o=!1)=>{const l=n+"/"+JSON.stringify(s);e.requests.push(l),!1===o&&(t.isLoading=!0),e.language=t.language.code;try{return await(t=>async(e,i={})=>{i={cache:"no-store",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json","x-csrf":t.csrf,"x-language":t.language,...$t(i.headers??{})},...i},t.methodOverwrite&&"GET"!==i.method&&"POST"!==i.method&&(i.headers["x-http-method-override"]=i.method,i.method="POST"),i.url=Cr(t.endpoint,"/")+"/"+_r(e,"/");const n=new Request(i.url,i),{response:s}=await ku(n,await fetch(n));let o=s.json;return o.data&&"model"===o.type&&(o=o.data),o})(e)(n,s)}finally{i(),e.requests=e.requests.filter((t=>t!==l)),0===e.requests.length&&(t.isLoading=!1)}},e.auth=(t=>({async login(e){const i={long:e.remember??!1,email:e.email,password:e.password};return t.post("auth/login",i)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(e),e.delete=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"DELETE",s))(e),e.files=cu(e),e.get=(t=>async(e,i,n,s=!1)=>(i&&(e+="?"+Object.keys(i).filter((t=>void 0!==i[t]&&null!==i[t])).map((t=>t+"="+i[t])).join("&")),t.request(e,Object.assign(n??{},{method:"GET"}),s)))(e),e.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,i)=>t.patch("languages/"+e,i)}))(e),e.pages=du(e),e.patch=(t=>async(e,i,n,s=!1)=>t.post(e,i,n,"PATCH",s))(e),e.post=(t=>async(e,i,n,s="POST",o=!1)=>t.request(e,Object.assign(n??{},{method:s,body:JSON.stringify(i)}),o))(e),e.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(e),e.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(e),e.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(e),e.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(e),e.users=bu(e),i(),e},yu=()=>({addEventListener(t,e){"function"==typeof e&&(this.on[t]=e)},addEventListeners(t){if(!1!==vt(t))for(const e in t)this.addEventListener(e,t[e])},emit(t,...e){return this.hasEventListener(t)?this.on[t](...e):()=>{}},hasEventListener(t){return"function"==typeof this.on[t]},listeners(){return this.on},on:{}}),$u=(t,e={})=>({...e,key:()=>t,defaults:()=>e,reset(){return this.set(this.defaults())},set(t){this.validateState(t);for(const e in this.defaults())this[e]=t[e]??this.defaults()[e];return this.state()},state(){const t={};for(const e in this.defaults())t[e]=this[e]??this.defaults()[e];return t},validateState(t){if(!1===vt(t))throw new Error(`Invalid ${this.key()} state`);return!0}}),wu=(t,e,i)=>{const n=$u(e,i);return{...n,...yu(),async load(e,i={}){return!0!==i.silent&&(this.isLoading=!0),await t.open(e,i),this.isLoading=!1,this.addEventListeners(i.on),this.state()},async open(t,e={}){return"function"==typeof e&&(e={on:{submit:e}}),!0===Br(t)?this.load(t,e):(this.set(t),this.addEventListeners(e.on),this.emit("open",t,e),this.state())},async post(e,i={}){var n;if(!this.path)throw new Error(`The ${this.key()} cannot be posted`);this.isLoading=!0,e=e??(null==(n=this.props)?void 0:n.value)??{};try{return await t.post(this.path,e,i)}catch(s){t.error(s)}finally{this.isLoading=!1}return!1},async refresh(e={}){e.url=e.url??this.url();const i=(await t.get(e.url,e))["$"+this.key()];if(i&&i.component===this.component)return this.props=i.props,this.state()},async reload(t={}){if(!this.path)return!1;this.open(this.url(),t)},set(t){return n.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),this.state()},url(){return t.url(this.path,this.query)}}},xu=(t,e,i)=>{const n=wu(t,e,i);return{...n,async cancel(){this.isOpen&&this.emit("cancel"),this.close()},async close(){!1!==this.isOpen&&(this.isOpen=!1,this.emit("close"),this.reset(),0===t.overlays().length&&(document.documentElement.removeAttribute("data-overlay"),document.documentElement.style.removeProperty("--scroll-top")))},focus(t){ur(`.k-${this.key()}-portal`,t)},input(t){!1!==this.isOpen&&(Vue.set(this.props,"value",t),this.emit("input",t))},isOpen:!1,listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this)}},async open(e,i){return!1===this.isOpen&&t.notification.close(),await n.open.call(this,e,i),this.component&&(document.documentElement.setAttribute("data-overlay","true"),document.documentElement.style.setProperty("--scroll-top",window.scrollY+"px"),this.isOpen=!0),this.state()},async submit(t,e={}){if(t=t??this.props.value,this.hasEventListener("submit"))return this.emit("submit",t,e);if(!this.path)return this.close();const i=await this.post(t,e);return!1===vt(i)?i:this.success(i["$"+this.key()]??{})},success(e){return this.hasEventListener("success")?this.emit("success",e):("string"==typeof e&&t.notification.success(e),this.close(),this.successNotification(e),this.successEvents(e),this.successDispatch(e),e.route||e.redirect?this.successRedirect(e):t.view.reload(e.reload),e)},successDispatch(e){if(!1!==vt(e.dispatch))for(const i in e.dispatch){const n=e.dispatch[i];t.app.$store.dispatch(i,!0===Array.isArray(n)?[...n]:n)}},successEvents(e){if(e.event){const i=Array.wrap(e.event);for(const n of i)"string"==typeof n&&t.events.emit(n,e)}!1!==e.emit&&t.events.emit("success",e)},successNotification(e){e.message&&t.notification.success(e.message)},successRedirect(e){const i=e.route??e.redirect;return!!i&&("string"==typeof i?t.open(i):t.open(i.url,i.options))},get value(){var t;return null==(t=this.props)?void 0:t.value}}},_u=t=>{t.events.on("dialog.save",(e=>{var i;null==(i=null==e?void 0:e.preventDefault)||i.call(e),t.dialog.submit()}));const e=xu(t,"dialog",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,legacy:!1,ref:null});return{...e,async close(){this.ref&&(this.ref.visible=!1),e.close.call(this)},async open(t,i={}){return t instanceof window.Vue?this.openComponent(t):("string"==typeof t&&(t=`/dialogs/${t}`),e.open.call(this,t,i))},async openComponent(i){t.deprecated("Dialog components should no longer be used in your templates");const n=await e.open.call(this,{component:i.$options._componentTag,legacy:!0,props:{...i.$attrs,...i.$props},ref:i}),s=this.listeners();for(const t in s)i.$on(t,s[t]);return i.visible=!0,n}}},Cu=()=>({...$u("drag",{type:null,data:{}}),get isDragging(){return null!==this.type},start(t,e){this.type=t,this.data=e},stop(){this.type=null,this.data={}}}),Su=()=>({add(t){if(!t.id)throw new Error("The state needs an ID");!0!==this.has(t.id)&&this.milestones.push(t)},at(t){return this.milestones.at(t)},clear(){this.milestones=[]},get(t=null){return null===t?this.milestones:this.milestones.find((e=>e.id===t))},goto(t){const e=this.index(t);if(-1!==e)return this.milestones=this.milestones.slice(0,e+1),this.milestones[e]},has(t){return void 0!==this.get(t)},index(t){return this.milestones.findIndex((e=>e.id===t))},isEmpty(){return 0===this.milestones.length},last(){return this.milestones.at(-1)},milestones:[],remove(t=null){return null===t?this.removeLast():this.milestones=this.milestones.filter((e=>e.id!==t))},removeLast(){return this.milestones=this.milestones.slice(0,-1)},replace(t,e){-1===t&&(t=this.milestones.length-1),Vue.set(this.milestones,t,e)}}),Ou=t=>{const e=xu(t,"drawer",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,id:null});return t.events.on("drawer.save",(e=>{e.preventDefault(),t.drawer.submit()})),{...e,get breadcrumb(){return this.history.milestones},async close(t){if(!1!==this.isOpen&&(!0===t&&this.history.clear(),void 0===t||t===this.id)){if(this.history.removeLast(),!0!==this.history.isEmpty())return this.open(this.history.last());e.close.call(this)}},goTo(t){const e=this.history.goto(t);void 0!==e&&this.open(e)},history:Su(),get icon(){return this.props.icon??"box"},input(t){Vue.set(this.props,"value",t),this.emit("input",this.props.value)},listeners(){return{...this.on,cancel:this.cancel.bind(this),close:this.close.bind(this),crumb:this.goTo.bind(this),input:this.input.bind(this),submit:this.submit.bind(this),success:this.success.bind(this),tab:this.tab.bind(this)}},async open(t,i={}){"string"==typeof t&&(t=`/drawers/${t}`),await e.open.call(this,t,i),this.tab(t.tab);const n=this.state();return!0===t.replace?this.history.replace(-1,n):this.history.add(n),this.focus(),n},set(t){return e.set.call(this,t),this.id=this.id??Mr(),this.state()},tab(t){const e=this.props.tabs??{};if(!(t=t??Object.keys(e??{})[0]))return!1;Vue.set(this.props,"fields",e[t].fields),Vue.set(this.props,"tab",t),this.emit("tab",t),setTimeout((()=>{this.focus()}))}}},Mu=t=>{const e=wu(t,"dropdown",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null});return{...e,close(){this.emit("close"),this.reset()},open(t,i={}){return"string"==typeof t&&(t=`/dropdowns/${t}`),e.open.call(this,t,i)},openAsync(t,e={}){return async i=>{await this.open(t,e);const n=this.options();if(0===n.length)throw Error("The dropdown is empty");i(n)}},options(){return!1===Array.isArray(this.props.options)?[]:this.props.options.map((e=>e.dialog?(e.click=()=>{const i="string"==typeof e.dialog?e.dialog:e.dialog.url,n="object"==typeof e.dialog?e.dialog:{};return t.app.$dialog(i,n)},e):e))},set(t){return t.options&&(t.props={options:t.options}),e.set.call(this,t)}}},Au=t=>{const e=P();e.on("online",(()=>{t.isOffline=!1})),e.on("offline",(()=>{t.isOffline=!0})),e.on("keydown.cmd.s",(i=>{e.emit(t.context+".save",i)})),e.on("keydown.cmd.shift.f",(()=>t.search())),e.on("keydown.cmd./",(()=>t.search()));const i={document:{blur:!0,click:!1,copy:!0,focus:!0,paste:!0},window:{dragenter:!1,dragexit:!1,dragleave:!1,dragover:!1,drop:!1,keydown:!1,keyup:!1,offline:!1,online:!1,popstate:!1}};return{blur(t){this.emit("blur",t)},click(t){this.emit("click",t)},copy(t){this.emit("copy",t)},dragenter(t){this.entered=t.target,this.prevent(t),this.emit("dragenter",t)},dragexit(t){this.prevent(t),this.entered=null,this.emit("dragexit",t)},dragleave(t){this.prevent(t),this.entered===t.target&&(this.entered=null,this.emit("dragleave",t))},dragover(t){this.prevent(t),this.emit("dragover",t)},drop(t){this.prevent(t),this.entered=null,this.emit("drop",t)},emit:e.emit,entered:null,focus(t){this.emit("focus",t)},keychain(t,e){let i=[t];(e.metaKey||e.ctrlKey)&&i.push("cmd"),!0===e.altKey&&i.push("alt"),!0===e.shiftKey&&i.push("shift");let n=e.key?xr(e.key):null;const s={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};return s[n]&&(n=s[n]),n&&!1===["alt","control","shift","meta"].includes(n)&&i.push(n),i.join(".")},keydown(t){this.emit(this.keychain("keydown",t),t),this.emit("keydown",t)},keyup(t){this.emit(this.keychain("keyup",t),t),this.emit("keyup",t)},off:e.off,offline(t){this.emit("offline",t)},on:e.on,online(t){this.emit("online",t)},paste(t){this.emit("paste",t)},popstate(t){this.emit("popstate",t)},prevent(t){t.stopPropagation(),t.preventDefault()},subscribe(){for(const t in i.document)document.addEventListener(t,this[t].bind(this),i.document[t]);for(const t in i.window)window.addEventListener(t,this[t].bind(this),i.window[t])},unsubscribe(){for(const t in i.document)document.removeEventListener(t,this[t]);for(const t in i.window)window.removeEventListener(t,this[t])},$on(...t){window.panel.deprecated("`events.$on` will be removed in a future version. Use `events.on` instead."),e.on(...t)},$emit(...t){window.panel.deprecated("`events.$emit` will be removed in a future version. Use `events.emit` instead."),e.emit(...t)},$off(...t){window.panel.deprecated("`events.$off` will be removed in a future version. Use `events.off` instead."),e.off(...t)}}},Iu={interval:null,start(t,e){this.stop(),t&&(this.interval=setInterval(e,t))},stop(){clearInterval(this.interval),this.interval=null}},Du=(t={})=>({...$u("notification",{context:null,details:null,icon:null,isOpen:!1,message:null,theme:null,timeout:null,type:null}),close(){return this.timer.stop(),this.reset(),this.state()},deprecated(t){console.warn("Deprecated: "+t)},error(e){if(e instanceof hu&&t.user.id)return t.redirect("logout");if(e instanceof mu)return this.fatal(e);if(e instanceof pu){const t=Object.values(e.response.json).find((t=>"string"==typeof(null==t?void 0:t.error)));t&&(e.message=t.error)}return"string"==typeof e&&(e={message:e}),e={message:e.message??"Something went wrong",details:e.details??{}},"view"===t.context&&t.dialog.open({component:"k-error-dialog",props:e}),this.open({message:e.message,icon:"alert",theme:"negative",type:"error"})},info(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"info",theme:"info",...t})},get isFatal(){return"fatal"===this.type},fatal(t){return"string"==typeof t?this.open({message:t,type:"fatal"}):t instanceof mu?this.open({message:t.response.text,type:"fatal"}):this.open({message:t.message??"Something went wrong",type:"fatal"})},open(e){return this.timer.stop(),"string"==typeof e?this.success(e):("error"!==e.type&&"fatal"!==e.type&&(e.timeout??(e.timeout=4e3)),this.set({context:t.context,...e}),this.isOpen=!0,this.timer.start(this.timeout,(()=>this.close())),this.state())},success(t={}){return"string"==typeof t&&(t={message:t}),this.open({icon:"check",theme:"positive",...t})},timer:Iu}),ju=()=>({...$u("language",{code:null,default:!1,direction:"ltr",name:null,rules:null}),get isDefault(){return this.default}}),Eu=(t,e,i)=>{if(!i.template&&!i.render&&!i.extends)throw new Error(`Neither template nor render method provided. Nor extending a component when loading plugin component "${e}". The component has not been registered.`);return(i=Lu(t,e,i)).template&&(i.render=null),i=Tu(i),!0===dr(e)&&window.console.warn(`Plugin is replacing "${e}"`),t.component(e,i),i},Lu=(t,e,i)=>"string"!=typeof(null==i?void 0:i.extends)?i:!1===dr(i.extends)?(window.console.warn(`Problem with plugin trying to register component "${e}": cannot extend non-existent component "${i.extends}"`),i.extends=null,i):(i.extends=t.options.components[i.extends].extend({options:i,components:{...t.options.components,...i.components??{}}}),i),Tu=t=>{if(!1===Array.isArray(t.mixins))return t;const e={dialog:Et,drawer:fe,section:Nl};return t.mixins=t.mixins.map((t=>"string"==typeof t?e[t]:t)),t},Bu=(t,e={})=>((e={components:{},created:[],icons:{},login:null,textareaButtons:{},use:[],thirdParty:{},writerMarks:{},writerNodes:{},...e}).use=((t,e)=>{if(!1===Array.isArray(e))return[];for(const i of e)t.use(i);return e})(t,e.use),e.components=((t,e)=>{if(!1===vt(e))return;const i={};for(const[s,o]of Object.entries(e))try{i[s]=Eu(t,s,o)}catch(n){window.console.warn(n.message)}return i})(t,e.components),e),qu=t=>{var e;const i=$u("menu",{entries:[],hover:!1,isOpen:!1}),n=null==(e=window.matchMedia)?void 0:e.call(window,"(max-width: 60rem)"),s={...i,blur(t){const e=document.querySelector(".k-panel-menu");if(!e||!1===n.matches)return!1;!1===document.querySelector(".k-panel-menu-proxy").contains(t.target)&&!1===e.contains(t.target)&&this.close()},close(){this.isOpen=!1,!1===n.matches&&localStorage.setItem("kirby$menu",!0)},escape(){if(!1===n.matches)return!1;this.close()},open(){this.isOpen=!0,!1===n.matches&&localStorage.removeItem("kirby$menu")},resize(){if(n.matches)return this.close();null!==localStorage.getItem("kirby$menu")?this.isOpen=!1:this.isOpen=!0},set(t){return this.entries=t,this.resize(),this.state()},toggle(){this.isOpen?this.close():this.open()}};return t.events.on("keydown.esc",s.escape.bind(s)),t.events.on("click",s.blur.bind(s)),null==n||n.addEventListener("change",s.resize.bind(s)),s},Pu=t=>({controller:null,requests:0,get isLoading(){return this.requests>0},open(e){t.menu.escape(),t.dialog.open({component:"k-search-dialog",props:{type:e}})},async query(e,i,n){var s;if(null==(s=this.controller)||s.abort(),this.controller=new AbortController,i.length<2)return{results:null,pagination:{}};this.requests++;try{const{$search:s}=await t.get(`/search/${e}`,{query:{query:i,...n},signal:this.controller.signal});return s}catch(o){if("AbortError"!==o.name)return{results:[],pagination:{}}}finally{this.requests--}}}),Nu=()=>{const t=$u("translation",{code:null,data:{},direction:"ltr",name:null});return{...t,set(e){return t.set.call(this,e),document.documentElement.lang=this.code,document.body.dir=this.direction,this.state()},translate(t,e,i=null){if("string"!=typeof t)return;const n=this.data[t]??i;return"string"!=typeof n?n:Sr(n,e)}}};const zu=t=>{const e=$u("upload",{accept:"*",attributes:{},files:[],max:null,multiple:!0,preview:{},replacing:null,url:null});return{...e,...yu(),input:null,cancel(){this.emit("cancel"),this.completed.length>0&&(this.emit("complete",this.completed),t.view.reload()),this.reset()},get completed(){return this.files.filter((t=>t.completed)).map((t=>t.model))},done(){t.dialog.close(),this.completed.length>0&&(this.emit("done",this.completed),!1===t.drawer.isOpen&&(t.notification.success({context:"view"}),t.view.reload())),this.reset()},findDuplicate(t){return this.files.findLastIndex((e=>e.src.name===t.src.name&&e.src.type===t.src.type&&e.src.size===t.src.size&&e.src.lastModified===t.src.lastModified))},hasUniqueName(t){return this.files.filter((e=>e.name===t.name&&e.extension===t.extension)).length<2},file(t){const e=URL.createObjectURL(t);return{...this.preview,completed:!1,error:null,extension:or(t.name),filename:t.name,id:Mr(),model:null,name:lr(t.name),niceSize:ar(t.size),progress:0,size:t.size,src:t,type:t.type,url:e}},open(e,i){e instanceof FileList?(this.set(i),this.select(e)):this.set(e);const n={component:"k-upload-dialog",props:{preview:this.preview},on:{cancel:()=>this.cancel(),submit:async()=>{t.dialog.isLoading=!0,await this.submit(),t.dialog.isLoading=!1}}};this.replacing&&(n.component="k-upload-replace-dialog",n.props.original=this.replacing),t.dialog.open(n)},pick(t){this.set(t),this.input=document.createElement("input"),this.input.type="file",this.input.classList.add("sr-only"),this.input.value=null,this.input.accept=this.accept,this.input.multiple=this.multiple,this.input.click(),this.input.addEventListener("change",(e=>{!0===(null==t?void 0:t.immediate)?(this.set(t),this.select(e.target.files),this.submit()):this.open(e.target.files,t),this.input.remove()}))},remove(t){this.files=this.files.filter((e=>e.id!==t))},replace(e,i){this.pick({...i,url:t.urls.api+"/"+e.link,accept:"."+e.extension+","+e.mime,multiple:!1,replacing:e})},reset(){e.reset.call(this),this.files.splice(0)},select(t,e){if(this.set(e),t instanceof Event&&(t=t.target.files),t instanceof FileList==!1)throw new Error("Please provide a FileList");t=(t=[...t]).map((t=>this.file(t))),this.files=[...this.files,...t],this.files=this.files.filter(((t,e)=>this.findDuplicate(t)===e)),null!==this.max&&(this.files=this.files.slice(-1*this.max)),this.emit("select",this.files)},set(t){if(t)return e.set.call(this,t),this.on={},this.addEventListeners(t.on??{}),1===this.max&&(this.multiple=!1),!1===this.multiple&&(this.max=1),this.state()},async submit(){var e;if(!this.url)throw new Error("The upload URL is missing");const i=[];for(const n of this.files){if(!0===n.completed)continue;if(!1===this.hasUniqueName(n)){n.error=t.t("error.file.name.unique");continue}n.error=null,n.progress=0;const s={...this.attributes};i.push((async()=>await this.upload(n,s)));const o=null==(e=this.attributes)?void 0:e.sort;null!=o&&this.attributes.sort++}if(await async function(t,e=20){let i=0,n=0;return new Promise((s=>{const o=e=>n=>{t[e]=n,i--,l()},l=()=>{if(i{e.progress=n}});e.completed=!0,e.model=n.data}catch(n){t.error(n,!1),e.error=n.message,e.progress=0}}}},Fu=t=>{const e=wu(t,"view",{component:null,isLoading:!1,on:{},path:null,props:{},query:{},referrer:null,timestamp:null,breadcrumb:[],breadcrumbLabel:null,icon:null,id:null,link:null,search:"pages",title:null});return{...e,set(i){e.set.call(this,i),t.title=this.title;const n=this.url().toString();window.location.toString()!==n&&(window.history.pushState(null,null,n),window.scrollTo(0,0))},async submit(){throw new Error("Not yet implemented")}}},Yu={config:{},languages:[],license:"missing",multilang:!1,permissions:{},searches:{},urls:{}},Ru=["dialog","drawer"],Uu=["dropdown","language","menu","notification","system","translation","user"],Hu={create(t={}){return this.isLoading=!1,this.isOffline=!1,this.activation=uu(),this.drag=Cu(),this.events=Au(this),this.searcher=Pu(this),this.upload=zu(this),this.language=ju(),this.menu=qu(this),this.notification=Du(this),this.system=$u("system",{ascii:{},csrf:null,isLocal:null,locales:{},slugs:[],title:null}),this.translation=Nu(),this.user=$u("user",{email:null,id:null,language:null,role:null,username:null}),this.dropdown=Mu(this),this.view=Fu(this),this.drawer=Ou(this),this.dialog=_u(this),this.redirect=fu,this.reload=this.view.reload.bind(this.view),this.t=this.translation.translate.bind(this.translation),this.plugins=Bu(window.Vue,t),this.set(window.fiber),this.api=vu(this),Vue.reactive(this)},get context(){return this.dialog.isOpen?"dialog":this.drawer.isOpen?"drawer":"view"},get debug(){return!0===this.config.debug},deprecated(t){this.notification.deprecated(t)},get direction(){return this.translation.direction},error(t,e=!0){if(!0===this.debug&&console.error(t),!0===e)return this.notification.error(t)},async get(t,e={}){const{response:i}=await this.request(t,{method:"GET",...e});return(null==i?void 0:i.json)??{}},async open(t,e={}){try{if(!1===Br(t))this.set(t);else{this.isLoading=!0;const i=await this.get(t,e);this.set(i),this.isLoading=!1}return this.state()}catch(i){return this.error(i)}},overlays(){const t=[];return!0===this.drawer.isOpen&&t.push("drawer"),!0===this.dialog.isOpen&&t.push("dialog"),t},async post(t,e={},i={}){const{response:n}=await this.request(t,{method:"POST",body:e,...i});return n.json},async request(t,e={}){return gu(t,{referrer:this.view.path,csrf:this.system.csrf,...e})},async search(t,e,i){return void 0===e?this.searcher.open(t):this.searcher.query(t,e,i)},set(t={}){t=Object.fromEntries(Object.entries(t).map((([t,e])=>[t.replace("$",""),e])));for(const e in Yu){const i=t[e]??this[e]??Yu[e];typeof i==typeof Yu[e]&&(this[e]=i)}for(const e of Uu)(vt(t[e])||Array.isArray(t[e]))&&this[e].set(t[e]);for(const e of Ru)if(!0===vt(t[e])){if(t[e].redirect)return this.open(t[e].redirect);this[e].open(t[e])}else void 0!==t[e]&&this[e].close(!0);!0===vt(t.dropdown)?this.dropdown.open(t.dropdown):void 0!==t.dropdown&&this.dropdown.close(),!0===vt(t.view)&&this.view.open(t.view)},state(){const t={};for(const e in Yu)t[e]=this[e]??Yu[e];for(const e of Uu)t[e]=this[e].state();for(const e of Ru)t[e]=this[e].state();return t.dropdown=this.dropdown.state(),t.view=this.view.state(),t},get title(){return document.title},set title(t){!1===wr(this.system.title)&&(t+=" | "+this.system.title),document.title=t},url:(t="",e={},i)=>Er(t,e,i)},Vu=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Ku={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.hasOwn(t.models,e),hasChanges:(t,e)=>t=>yt(e.model(t).changes)>0,isCurrent:t=>e=>t.current===e,id:t=>e=>((e=e??t.current)&&!1===e.includes("?language=")&&(e+="?language="+window.panel.language.code),e),model:(t,e)=>i=>(i=e.id(i),!0===e.exists(i)?t.models[i]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>structuredClone(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>structuredClone(e.model(t).changes)},mutations:{CLEAR(t){for(const e in t.models)t.models[e].changes={};for(const e in localStorage)e.startsWith("kirby$content$")&&localStorage.removeItem(e)},CREATE(t,[e,i]){if(!i)return!1;let n=t.models[e]?t.models[e].changes:i.changes;Vue.set(t.models,e,{api:i.api,originals:i.originals,changes:n??{}})},CURRENT(t,e){t.current=e},MOVE(t,[e,i]){const n=structuredClone(t.models[e]);Vue.del(t.models,e),Vue.set(t.models,i,n);const s=localStorage.getItem("kirby$content$"+e);localStorage.removeItem("kirby$content$"+e),localStorage.setItem("kirby$content$"+i,s)},REMOVE(t,e){Vue.del(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,e){t.models[e]&&(Vue.set(t.models[e],"changes",{}),localStorage.removeItem("kirby$content$"+e))},STATUS(t,e){Vue.set(t.status,"enabled",e)},UPDATE(t,[e,i,n]){if(!t.models[e])return!1;void 0===n&&(n=null),n=structuredClone(n);const s=JSON.stringify(n);JSON.stringify(t.models[e].originals[i]??null)==s?Vue.del(t.models[e].changes,i):Vue.set(t.models[e].changes,i,n),Vu(e,{api:t.models[e].api,originals:t.models[e].originals,changes:t.models[e].changes})}},actions:{init(t){for(const e in localStorage)if(e.startsWith("kirby$content$")){const i=e.split("kirby$content$")[1],n=localStorage.getItem("kirby$content$"+i);t.commit("CREATE",[i,JSON.parse(n)])}else if(e.startsWith("kirby$form$")){const i=e.split("kirby$form$")[1],n=localStorage.getItem("kirby$form$"+i);let s=null;try{s=JSON.parse(n)}catch{}if(!s||!s.api)return localStorage.removeItem("kirby$form$"+i),!1;const o={api:s.api,originals:s.originals,changes:s.values};t.commit("CREATE",[i,o]),Vu(i,o),localStorage.removeItem("kirby$form$"+i)}},clear(t){t.commit("CLEAR")},create(t,e){const i=structuredClone(e.content);if(Array.isArray(e.ignore))for(const s of e.ignore)delete i[s];e.id=t.getters.id(e.id);const n={api:e.api,originals:i,changes:{}};t.commit("CREATE",[e.id,n]),t.dispatch("current",e.id)},current(t,e){e=t.getters.id(e),t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,i]){e=t.getters.id(e),i=t.getters.id(i),t.commit("MOVE",[e,i])},remove(t,e){e=t.getters.id(e),t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=t.getters.id(e),t.commit("REVERT",e)},async save(t,e){if(e=t.getters.id(e),t.getters.isCurrent(e)&&!1===t.state.status.enabled)return!1;t.dispatch("disable");const i=t.getters.model(e),n={...i.originals,...i.changes};try{await window.panel.api.patch(i.api,n),t.commit("CREATE",[e,{...i,originals:n}]),t.dispatch("revert",e)}finally{t.dispatch("enable")}},update(t,[e,i,n]){if(n=n??t.state.current,null===e)for(const s in i)t.commit("UPDATE",[n,s,i[s]]);else t.commit("UPDATE",[n,e,i])}}},Wu={namespaced:!0,actions:{close(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.close(e)},goto(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)},open(t,e){window.panel.deprecated("`$store.drawer` will be removed in a future version. Use `$panel.drawer` instead."),window.panel.drawer.goto(e)}}},Ju={namespaced:!0,actions:{close(){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.close()},deprecated(t,e){window.panel.deprecated("`$store.notification.deprecated` will be removed in a future version. Use `$panel.deprecated` instead."),window.panel.notification.deprecated(e)},error(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.error(e)},open(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.open(e)},success(t,e){window.panel.deprecated("`$store.notification` will be removed in a future version. Use `$panel.notification` instead."),window.panel.notification.success(e)}}};Vue.use(N);const Gu=new N.Store({strict:!1,actions:{dialog(t,e){window.panel.deprecated("`$store.dialog` will be removed in a future version. Use `$panel.dialog.open()` instead."),window.panel.dialog.open(e)},drag(t,e){window.panel.deprecated("`$store.drag` will be removed in a future version. Use `$panel.drag.start(type, data)` instead."),window.panel.drag.start(...e)},fatal(t,e){window.panel.deprecated("`$store.fatal` will be removed in a future version. Use `$panel.notification.fatal()` instead."),window.panel.notification.fatal(e)},isLoading(t,e){window.panel.deprecated("`$store.isLoading` will be removed in a future version. Use `$panel.isLoading` instead."),window.panel.isLoading=e},navigate(){window.panel.deprecated("`$store.navigate` will be removed in a future version."),window.panel.dialog.close(),window.panel.drawer.close()}},modules:{content:Ku,drawers:Wu,notification:Ju}});Vue.config.productionTip=!1,Vue.config.devtools=!0,Vue.use(zr),Vue.use(ru),Vue.use(z),Vue.use(Ha),window.panel=Vue.prototype.$panel=Hu.create(window.panel.plugins),Vue.prototype.$dialog=window.panel.dialog.open.bind(window.panel.dialog),Vue.prototype.$drawer=window.panel.drawer.open.bind(window.panel.drawer),Vue.prototype.$dropdown=window.panel.dropdown.openAsync.bind(window.panel.dropdown),Vue.prototype.$go=window.panel.view.open.bind(window.panel.view),Vue.prototype.$reload=window.panel.reload.bind(window.panel),window.panel.app=new Vue({store:Gu,render:()=>Vue.h(R)}),Vue.use(Fr),Vue.use(Va),Vue.use(Yr),!1===CSS.supports("container","foo / inline-size")&&Y((()=>import("./container-query-polyfill.modern.min.js")),[],import.meta.url),window.panel.app.$mount("#app");export{ut as n}; diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 790316a719..5a68be2019 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'getkirby/cms', - 'pretty_version' => '4.4.0', - 'version' => '4.4.0.0', - 'reference' => NULL, + 'pretty_version' => '4.4.1', + 'version' => '4.4.1.0', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -47,9 +47,9 @@ 'dev_requirement' => false, ), 'getkirby/cms' => array( - 'pretty_version' => '4.4.0', - 'version' => '4.4.0.0', - 'reference' => NULL, + 'pretty_version' => '4.4.1', + 'version' => '4.4.1.0', + 'reference' => null, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From 4ff0da04c446cdb4b7a10f32f0fbabe6c71bb5e4 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 23 Sep 2024 10:02:42 +0200 Subject: [PATCH 2/2] Fix code coverage annotations --- tests/Filesystem/FilenameTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Filesystem/FilenameTest.php b/tests/Filesystem/FilenameTest.php index 3b68f58b55..572d03e881 100644 --- a/tests/Filesystem/FilenameTest.php +++ b/tests/Filesystem/FilenameTest.php @@ -290,6 +290,7 @@ public function testGrayscale($prop, $value, $expected) /** * @covers ::name + * @covers ::sanitizeName */ public function testName() { @@ -299,6 +300,7 @@ public function testName() /** * @covers ::name + * @covers ::sanitizeName */ public function testNameSanitization() { @@ -308,6 +310,7 @@ public function testNameSanitization() /** * @covers ::name + * @covers ::sanitizeName */ public function testNameSanitizationWithLanguageRules() {