From 4fb408691f5ba3273651f1bb659acbd0c43f1a60 Mon Sep 17 00:00:00 2001 From: antoine Date: Wed, 19 Jul 2023 13:18:46 +0200 Subject: [PATCH] Assets --- resources/assets/dist/mix-manifest.json | 2 +- resources/assets/dist/sharp.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/dist/mix-manifest.json b/resources/assets/dist/mix-manifest.json index f7862a19d..71fa7c7dc 100644 --- a/resources/assets/dist/mix-manifest.json +++ b/resources/assets/dist/mix-manifest.json @@ -1,5 +1,5 @@ { - "/sharp.js": "/sharp.js?id=bf7c9841e3f54fdada87cca1b1fbbf57", + "/sharp.js": "/sharp.js?id=4ca81f02bf4dac69e9da716b9cededea", "/client-api.js": "/client-api.js?id=414df3ae4d446b5a9913f975a7080c17", "/manifest.js": "/manifest.js?id=2d1b2dace7fcde89c62fd11c2792eea1", "/vendors.css": "/vendors.css?id=9e49e6c50d04b8682ecdc57389f76e37", diff --git a/resources/assets/dist/sharp.js b/resources/assets/dist/sharp.js index a25ccac68..b3c952c80 100644 --- a/resources/assets/dist/sharp.js +++ b/resources/assets/dist/sharp.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[705],{81975:function(t,e,n){n.d(e,{kO:function(){return b},ip:function(){return d},l3:function(){return u},Bd:function(){return s},vI:function(){return l},dV:function(){return f}});var r=n(24903);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var v={components:{TemplateRenderer:h.e},props:{data:Object,options:Object},computed:{templateData:function(){var t=this.data;t.slot;return m(t,p)},templateProps:function(){return this.options.attributes.filter((function(t){return"slot"!==t}))}}},b=(0,n(51900).Z)(v,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("TemplateRenderer",{attrs:{name:"Embed","template-data":t.templateData,"template-props":t.templateProps,template:t.options.template}},[t._t("default",(function(){return[t.data.slot?[n("div",{domProps:{innerHTML:t._s(t.data.slot)}})]:t._e()]}))],2)}),[],!1,null,null,null).exports},75969:function(t,e,n){n.d(e,{op:function(){return m},VD:function(){return p},ji:function(){return o},TS:function(){return v},YX:function(){return d},Jz:function(){return h},AZ:function(){return i},Bt:function(){return c},tj:function(){return u},HN:function(){return f}});var r=n(24903);function i(t){var e=t.entityKey,n=t.instanceId,i=t.files,o=t.thumbnailWidth,a=t.thumbnailHeight;return r.hi.post("/files/".concat(e,"/").concat(null!=n?n:""),{files:i,thumbnail_width:o,thumbnail_height:a}).then((function(t){return t.data.files}))}function o(t){var e=t.entityKey,n=t.instanceId,i=t.disk,o=t.path;return(0,r.JW)("/download/".concat(e,"/").concat(null!=n?n:""),{params:{disk:i,path:o}})}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?{isEmpty:null==o.default,value:o.default}:{value:K({dynamicOptions:o,attributeValue:e,contextData:i,contextSources:a})}}(o,i[1],{dynamicAttributes:e,contextData:n}),l=t.resolvedEmptyAttributes||[];return a.isEmpty&&l.push(o),N(N({},t),{},{resolvedEmptyAttributes:l,attributes:N(N({},t.attributes),{},H({},o,a.value))})}),{});return{attributes:r.attributes,resolvedEmptyAttributes:r.resolvedEmptyAttributes}}function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.dependantAttributes,i=t.$attrs.dynamicAttributes,o=(r||[]).some((function(t){return V(i,t)}));o?t.$nextTick(e):e()}function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tt(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;return tt(tt({},t),{},et({},i,tt(tt({},l),{},{readOnly:u})))}),{})}function ot(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e=this.searchMinChars?(0,r.yC)(this.localValues,t,{searchKeys:this.searchKeys}):this.localValues},updateRemoteSuggestions:function(t){var e,n=this;return null===(e=this.cancelSource)||void 0===e||e.cancel(),this.cancelSource=f.CancelToken.source(),m({url:this.remoteEndpoint,method:this.remoteMethod,locale:this.locale,searchAttribute:this.remoteSearchAttribute,dataWrapper:this.dataWrapper,fieldKey:this.fieldKey,query:t,cancelToken:this.cancelSource.token}).then((function(t){n.suggestions=t,n.scroll()})).finally((function(){n.isLoading=!1}))},scroll:function(){(0,p.Eb)(this)},handleSelect:function(t){this.$emit("input",t)},handleDropdownClose:function(){this.opened=!1,this.$emit("close")},handleDropdownOpen:function(){this.opened=!0,this.$emit("open"),this.scroll()},handleClearButtonClicked:function(){var t=this;this.$emit("input",null),this.$nextTick((function(){t.$refs.multiselect.activate()}))},resolveTemplateData:function(t){return lt(lt({},this.templateData),this.localizedTemplateData(t))},itemMatchValue:function(t){return t[this.itemIdAttribute]==this.value[this.itemIdAttribute]},findLocalValue:function(){return this.value&&null!=this.value[this.itemIdAttribute]?this.localValues.some(this.itemMatchValue)?this.localValues.find(this.itemMatchValue):((0,r.H)("Autocomplete (key: ".concat(this.fieldKey,") can't find local value matching : ").concat(JSON.stringify(this.value))),null):null},setDefault:function(){var t,e=this;return(t=l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.$emit("input",e.findLocalValue(),{force:!0}),t.next=3,e.$nextTick();case 3:e.ready=!0;case 4:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ot(o,r,i,a,l,"next",t)}function l(t){ot(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.updateRemoteSuggestions=u()(this.updateRemoteSuggestions,this.debounceDelay),"local"!==this.mode||this.searchKeys||(0,r.ZK)("Autocomplete (key: ".concat(this.fieldKey,") has local mode but no searchKeys, default set to ['value']")),this.isRemote?this.ready=!0:J(this,this.setDefault,{dependantAttributes:["localValues"]})}},ct=ut,dt=n(51900),ft=(0,dt.Z)(ct,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpAutocomplete",class:t.classes},[t.ready?[t.overlayVisible?[n("div",{staticClass:"form-control clearable SharpAutocomplete__result"},[n("TemplateRenderer",{attrs:{name:"ResultItem",template:t.resultItemTemplate,"template-data":t.resolveTemplateData(t.value),"template-props":t.searchKeys}}),t._v(" "),n("ClearButton",{on:{click:t.handleClearButtonClicked}})],1)]:[n("Multiselect",{ref:"multiselect",staticClass:"SharpAutocomplete__multiselect form-control",class:{"form-select":!this.isRemote,"SharpAutocomplete__multiselect--hide-dropdown":t.hideDropdown},attrs:{id:t.id,value:t.value,options:t.suggestions,"track-by":t.itemIdAttribute,"internal-search":!1,placeholder:t.placeholder,loading:t.isLoading,multiple:t.multiple,disabled:t.readOnly,"hide-selected":t.hideSelected,"allow-empty":t.allowEmpty,"preserve-search":t.preserveSearch,"show-pointer":t.showPointer,searchable:t.searchable,readonly:t.readOnly,tabindex:t.readOnly?-1:0},on:{"search-change":function(e){return t.updateSuggestions(e)},select:t.handleSelect,input:function(e){return t.$emit("multiselect-input",e)},close:t.handleDropdownClose,open:t.handleDropdownOpen},scopedSlots:t._u([{key:"clear",fn:function(){return[t.clearButtonVisible?[n("ClearButton",{on:{click:t.handleClearButtonClicked}})]:t._e()]},proxy:!0},{key:"singleLabel",fn:function(e){var r=e.option;return[n("TemplateRenderer",{attrs:{name:"ResultItem",template:t.resultItemTemplate,"template-data":t.resolveTemplateData(r),"template-props":t.searchKeys}})]}},{key:"option",fn:function(e){var r=e.option;return[n("TemplateRenderer",{attrs:{name:"ListItem",template:t.listItemTemplate,"template-data":t.resolveTemplateData(r),"template-props":t.searchKeys}})]}},{key:"loading",fn:function(){return[n("Loading",{attrs:{visible:t.isLoading,small:""}})]},proxy:!0},{key:"noResult",fn:function(){return[t._v("\n "+t._s(t.l("form.autocomplete.no_results_text"))+"\n ")]},proxy:!0}],null,!1,1785377836)})]]:t._e()],2)}),[],!1,null,null,null).exports;function ht(t,e){var n=e.maxlength;return n&&(null==t?void 0:t.length)>n?(0,r.KQ)("form.text.validation.maxlength").replace(":maxlength",n):null}function pt(t){return t.normalize()}var mt={name:"SharpTextarea",props:{value:String,placeholder:String,readOnly:Boolean,maxLength:Number,rows:Number},methods:{validate:function(t){return ht(t,{maxlength:this.maxLength})},handleInput:function(t){var e=pt(t.target.value),n=this.validate(e);this.$emit("input",e,{error:n})}}},vt=(0,dt.Z)(mt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("textarea",{staticClass:"SharpTextarea form-control",attrs:{rows:t.rows,placeholder:t.placeholder,disabled:t.readOnly},domProps:{value:t.value},on:{input:t.handleInput}})}),[],!1,null,null,null).exports,bt={name:"SharpText",props:{value:[String,Number],placeholder:String,readOnly:Boolean,maxLength:Number,inputType:{type:String,default:"text"}},methods:{validate:function(t){return ht(t,{maxlength:this.maxLength})},handleInput:function(t){var e=pt(t.target.value),n=this.validate(e);this.$emit("input",e,{error:n})},focus:function(){this.$refs.input.focus()}}},yt=(0,dt.Z)(bt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{ref:"input",staticClass:"SharpText form-control",attrs:{type:t.inputType,placeholder:t.placeholder,disabled:t.readOnly},domProps:{value:t.value},on:{input:t.handleInput}})}),[],!1,null,null,null).exports,gt={components:{TextField:yt},props:{value:[String,Number],showControls:Boolean,min:Number,max:Number,step:Number}},wt=(0,dt.Z)(gt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("TextField",t._g(t._b({class:{"hide-controls":!t.showControls},attrs:{value:t.value,step:t.step,min:t.min,max:t.max,"input-type":"number"}},"TextField",t.$attrs,!1),t.$listeners))}),[],!1,null,null,null).exports,_t=n(94831),Ot=n(17652),St=n(75969);function Ct(t){var e,n,r,i=t.filters,o=t.imageWidth,a=t.imageHeight,l=null!==(e=null==i||null===(n=i.rotate)||void 0===n?void 0:n.angle)&&void 0!==e?e:0,s=o,u=a;Math.abs(l)%180&&(s=a,u=o);var c=null!==(r=null==i?void 0:i.crop)&&void 0!==r?r:{},d=c.width,f=c.height,h=c.x,p=c.y;return{width:(null!=d?d:1)*s,height:(null!=f?f:1)*u,x:(null!=h?h:0)*s,y:(null!=p?p:0)*u,rotate:-1*l}}function jt(t){var e=t.cropData,n=t.imageWidth,r=t.imageHeight,i=n,o=r;return Math.abs(e.rotate)%180&&(i=r,o=n),{crop:{width:(0,St.tj)(e.width/i,4),height:(0,St.tj)(e.height/o,4),x:(0,St.tj)(e.x/i,4),y:(0,St.tj)(e.y/o,4)},rotate:{angle:(0,St.tj)(-1*e.rotate,4)}}}function xt(t,e){var n=t.getCropBoxData(),r=t.getContainerData();n.width=2,n.height=2,n.top=0;var i=r.width/2-1;n.left=i,t.setCropBoxData(n),t.rotateTo(e);var o=t.getCanvasData(),a=o.height,l=r.height,s=l/a,u=Math.min(o.width*s,r.width);o.height=l,o.width=u,o.top=0,o.left=(r.width-o.width)/2,t.setCanvasData(o),n.left=0,n.top=0,n.width=o.width,n.height=o.height,t.setCropBoxData(n)}function kt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Pt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){kt(o,r,i,a,l,"next",t)}function l(t){kt(o,r,i,a,l,"throw",t)}a(void 0)}))}}var Dt={components:{Modal:p.u_,Loading:p.gb,VueCropper:Ot.Z,Button:p.zx},inject:{$form:{default:null}},props:{value:Object,visible:Boolean,src:String,ratioX:Number,ratioY:Number},data:function(){return{ready:!1,cropData:null,originalImg:null}},watch:{value:"handleValueChanged"},computed:{imageSrc:function(){return this.originalImg||this.src},cropperOptions:function(){return{viewMode:2,dragMode:"move",aspectRatio:this.ratioX/this.ratioY,autoCropArea:1,guides:!1,background:!0,rotatable:!0,restore:!1,data:this.cropData,ready:this.handleCropperReady}}},methods:{l:r.KQ,handleRotateClicked:function(t){!function(t,e){var n=t.getData();xt(t,n.rotate+e)}(this.$refs.cropper.cropper,t)},handleValueChanged:function(){this.value||(this.cropData=null,this.originalImg=null)},handleOkClicked:function(){var t=this.$refs.cropper,e=t.getData(!0);this.cropData=e,this.$emit("submit",t)},handleShow:function(){this.init()},initOriginalThumbnail:function(){var t=this;return Pt(l().mark((function e(){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.originalImg){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,St.AZ)({entityKey:t.$form.entityKey,instanceId:t.$form.instanceId,files:[{path:t.value.path,disk:t.value.disk}],thumbnailWidth:1200,thumbnailHeight:1e3});case 4:if(r=e.sent,t.originalImg=null===(n=r[0])||void 0===n?void 0:n.thumbnail,t.originalImg){e.next=8;break}return e.abrupt("return",Promise.reject("Sharp Upload: original thumbnail not found in POST /api/files request"));case 8:return e.next=10,new Promise((function(e){var n=new Image;n.src=t.originalImg,n.onload=function(){t.cropData=Ct({filters:t.value.filters,imageWidth:n.naturalWidth,imageHeight:n.naturalHeight}),e()},n.onerror=function(){t.originalImg=null,e()}}));case 10:case"end":return e.stop()}}),e)})))()},init:function(){var t=this;return Pt(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ready=!1,null===(n=t.value)||void 0===n||!n.path){e.next=4;break}return e.next=4,t.initOriginalThumbnail();case 4:t.ready=!0;case 5:case"end":return e.stop()}}),e)})))()},handleCropperReady:function(){var t,e=this.$refs.cropper.cropper;null!==(t=this.cropData)&&void 0!==t&&t.rotate&&(xt(e,this.cropData.rotate),e.setData(this.cropData))}}},At=(0,dt.Z)(Dt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Modal",t._g({ref:"modal",attrs:{visible:t.visible,title:t.l("modals.cropper.title"),"no-close-on-backdrop":"","dialog-class":"modal-dialog-scrollable","content-class":"h-100",size:"xl"},on:{ok:t.handleOkClicked,show:t.handleShow},scopedSlots:t._u([{key:"footer-prepend",fn:function(){return[n("div",{staticClass:"row align-items-center"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{text:""},on:{click:function(e){return t.handleRotateClicked(-90)}}},[n("i",{staticClass:"fas fa-undo"})]),t._v(" "),n("Button",{staticClass:"me-auto",attrs:{text:""},on:{click:function(e){return t.handleRotateClicked(90)}}},[n("i",{staticClass:"fas fa-redo"})])],1),t._v(" "),n("div",{staticClass:"col d-none d-lg-block"},[n("div",{staticClass:"text-muted fs-7 lh-sm"},[t._v("\n "+t._s(t.l("form.upload.edit_modal.description"))+"\n ")])])])]},proxy:!0}])},t.$listeners),[t.ready?[n("vue-cropper",t._b({ref:"cropper",staticClass:"SharpUpload__modal-vue-cropper h-100",attrs:{src:t.imageSrc,alt:"Source image"}},"vue-cropper",t.cropperOptions,!1))]:[n("div",{staticClass:"d-flex align-items-center justify-content-center",staticStyle:{height:"300px"}},[n("Loading")],1)]],2)}),[],!1,null,null,null).exports;function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lt(t){for(var e=1;e0&&void 0!==arguments[0])||arguments[0];this.removeFile(this.file),this.files.splice(0,1),this.setPending(!1),this.resetThumbnails(),this.transformedImg=null,t&&(this.$emit("input",null),this.$emit("reset"))},handleEditButtonClick:function(){this.showEditModal=!0},handleRemoveClicked:function(){this.remove(),this.$emit("removed")},handleClick:function(){this.uploader._uploader.hiddenFileInput.click()},handleDrop:function(t){var e,n;this.file&&(null===(e=t.dataTransfer)||void 0===e||null===(n=e.files)||void 0===n?void 0:n.length)>0&&this.remove(!1)},handleEditSubmitted:function(t){this.updateTransformedImage(t),this.updateFilters(t)},onCropperReady:function(){this.hasInitialTransform&&(this.updateTransformedImage(this.$refs.cropper),this.updateFilters(this.$refs.cropper))},updateFilters:function(t){var e,n=t.getData(!0),r=t.getImageData(),i=Lt(Lt({},this.value),{},{transformed:!0,filters:Lt(Lt({},null===(e=this.value)||void 0===e?void 0:e.filters),jt({cropData:n,imageWidth:r.naturalWidth,imageHeight:r.naturalHeight}))});this.$emit("input",i),this.$emit("updated",i)},updateTransformedImage:function(t){var e=this;this.resetTransformedImage(),t.getCroppedCanvas({width:300,height:300}).toBlob((function(t){e.transformedImg=URL.createObjectURL(t)}))},resetTransformedImage:function(){this.transformedImg&&URL.revokeObjectURL(this.transformedImg)},resetThumbnails:function(){var t;null!==(t=this.file)&&void 0!==t&&t.blobUrl&&!this.persistThumbnails&&URL.revokeObjectURL(this.file.blobUrl),this.resetTransformedImage()},validateValue:function(){return!!this.value.name||(0,r.H)("Upload field '".concat(this.downloadId,'\' has an invalid value: expects to have a "name", given :'),JSON.parse(JSON.stringify(this.value)))},init:function(){var t;this.value?(this.file?Object.assign(this.file,this.value):this.addedFile(Lt(Lt({},this.value),{},{upload:{}})),this.$set(this.file,"thumbnail",null!==(t=this.value.thumbnail)&&void 0!==t?t:null)):this.files=[]}},created:function(){this.options.thumbnailWidth=null,this.options.thumbnailHeight=null,this.options.maxFiles=1,this.value&&!this.value.file&&this.validateValue()&&(this.init(),this.file.status="exist")},mounted:function(){var t,e=this.uploader._uploader;e.disable(),e.listeners=e.listeners.filter((function(t){return!t.events.click})),e.enable(),e.on("drop",this.handleDrop),e.on("thumbnail",this.onThumbnail),null!==(t=this.value)&&void 0!==t&&t.file&&(e.addFile(this.value.file),this.$emit("input",{}))},beforeDestroy:function(){this.resetThumbnails(),this.setPending(!1),this.uploader._uploader.destroy()}},$t=Ft,Tt=(0,dt.Z)($t,(function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{staticClass:"SharpUpload",class:e.classes},[r("div",[e.file?[r("div",{staticClass:"card card-body SharpUpload__card",class:{"border-danger":e.hasError}},[r("div",{class:{row:e.showThumbnail}},[e.showThumbnail?[r("div",{staticClass:"SharpUpload__thumbnail",class:[e.compactThumbnail?"col-4 col-sm-3 col-xl-2":"col-4 col-md-4"]},[r("img",{attrs:{src:e.imageSrc,alt:""}})])]:e._e(),e._v(" "),r("div",{staticClass:"SharpUpload__infos",class:(t={},t[e.compactThumbnail?"col-8 col-sm-9 col-xl-10":"col-8 col-md-8"]=e.showThumbnail,t)},[r("div",{staticClass:"mb-3"},[r("label",{staticClass:"SharpUpload__filename text-truncate d-block"},[e._v(e._s(e.fileName))]),e._v(" "),r("div",{staticClass:"SharpUpload__info mt-2"},[r("div",{staticClass:"row g-2"},[e.size?[r("div",{staticClass:"col-auto"},[e._v(e._s(e.size))])]:e._e(),e._v(" "),e.hasDownload?[r("div",{staticClass:"col-auto"},[r("a",{staticClass:"SharpUpload__download-link",attrs:{href:e.downloadUrl,download:e.fileName}},[r("i",{staticClass:"fas fa-download"}),e._v("\n "+e._s(e.l("form.upload.download_link"))+"\n ")])])]:e._e()],2)]),e._v(" "),r("transition",{attrs:{name:"SharpUpload__progress"}},[e.inProgress?[r("div",{staticClass:"SharpUpload__progress mt-2"},[r("div",{staticClass:"SharpUpload__progress-bar",style:{width:e.progress+"%"},attrs:{role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":"0","aria-valuemax":"100"}})])]:e._e()],2)],1),e._v(" "),e.readOnly?e._e():[r("div",[e.hasEdit&&!e.hasError?[r("Button",{attrs:{outline:"",small:""},on:{click:e.handleEditButtonClick}},[e._v("\n "+e._s(e.l("form.upload.edit_button"))+"\n ")])]:e._e(),e._v(" "),r("Button",{staticClass:"SharpUpload__remove-button",attrs:{variant:"danger",outline:"",small:""},on:{click:e.handleRemoveClicked}},[e._v("\n "+e._s(e.l("form.upload.remove_button"))+"\n ")])],2)]],2)],2)])]:[r("Button",{staticClass:"SharpUpload__browse dz-message",attrs:{text:"",block:"",disabled:e.readOnly,type:"button"},on:{click:e.handleClick}},[e._v("\n "+e._s(e.l("form.upload.browse_button"))+"\n ")])],e._v(" "),r("div",{ref:"clip-preview-template",staticClass:"clip-preview-template",staticStyle:{display:"none"}},[r("div")])],2),e._v(" "),r("EditModal",{ref:"modal",attrs:{value:e.value,visible:e.showEditModal,src:e.originalImageSrc,"ratio-x":e.ratioX,"ratio-y":e.ratioY},on:{"update:visible":function(t){e.showEditModal=t},submit:e.handleEditSubmitted}}),e._v(" "),e.hasInitialTransform?[r("vue-cropper",{ref:"cropper",staticClass:"d-none",attrs:{src:e.originalImageSrc,"aspect-ratio":e.ratioX/e.ratioY,"auto-crop-area":1,ready:e.onCropperReady}})]:e._e(),e._v(" "),r("a",{ref:"dlLink",staticStyle:{display:"none"}})],2)}),[],!1,null,null,null).exports;function Mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vt(t){for(var e=1;e0&&this.$refs.multiselect.filteredOptions.length>1?this.$refs.multiselect.pointer=1:this.$refs.multiselect.pointer=0},onTagsChanged:function(){this.$emit("input",this.tags.map((function(t){return new ae(t)})))}},created:function(){this.lastIndex+=this.options.length,this.tags=(this.value||[]).map(this.patchTag)}},se=(0,dt.Z)(le,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("Multiselect",{ref:"multiselect",staticClass:"SharpTags form-select",attrs:{id:t.id,value:t.tags,options:t.indexedOptions,placeholder:t.dynamicPlaceholder,"tag-placeholder":t.createText,max:t.maxTagCount,taggable:t.creatable,"close-on-select":!1,disabled:t.readOnly,"track-by":"_internalId",label:"label","custom-label":t.localizedCustomLabel,multiple:"",searchable:"","hide-selected":"","show-labels":!1},on:{"search-change":t.handleTextInput,input:t.handleInput,tag:t.handleNewTag}})}),[],!1,null,null,null).exports,ue=n(30381),ce=n.n(ue),de=(n(94470),{name:"SharpDatePicker",components:{VDatePicker:n(23919).DatePicker},props:{value:[Date,Object],isRange:Boolean,mondayFirst:Boolean,displayFormat:String},computed:{popoverOptions:function(){var t;return{visibility:"focus",hideDelay:10,placement:"bottom",modifiers:[{name:"preventOverflow",options:{boundary:null!==(t=document.querySelector("[data-popover-boundary]"))&&void 0!==t?t:"clippingParents",padding:8}},{name:"flip",enabled:!1}]}},masks:function(){return{input:this.displayFormat||void 0}},locale:function(){return document.documentElement.lang},firstDayOfWeek:function(){return this.mondayFirst?2:1},attributes:function(){return[{key:"today",dot:!0,dates:new Date}]}},methods:{handleInput:function(t){this.$emit("input",t)}}}),fe=(0,dt.Z)(de,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("v-date-picker",t._g(t._b({staticClass:"SharpDatePicker",attrs:{value:t.value,popover:t.popoverOptions,"is-range":t.isRange,locale:t.locale,"first-day-of-week":t.firstDayOfWeek,attributes:t.attributes,color:"primary",is24hr:"","trim-weeks":""},on:{input:t.handleInput},scopedSlots:t._u([{key:"default",fn:function(e){return[t._t("default",null,null,e)]}}],null,!0)},"v-date-picker",t.$attrs,!1),t.$listeners))}),[],!1,null,null,null).exports;function he(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}ce().locale(ce().locales().includes(document.documentElement.lang)?document.documentElement.lang:"en");var pe={name:"SharpDate",components:{DatePicker:fe,ClearButton:p.Cd},mixins:[o.WH],props:{id:String,value:{type:[Date,String]},hasDate:{type:Boolean,default:!0},hasTime:{type:Boolean,default:!1},displayFormat:String,mondayFirst:Boolean,stepTime:{type:Number,default:30},minTime:String,maxTime:String,readOnly:Boolean},data:function(){return{localInputValue:null}},computed:{format:function(){return this.hasTime&&!this.hasDate?"HH:mm":null},mode:function(){return this.hasDate&&this.hasTime?"dateTime":this.hasTime?"time":"date"},validHours:function(){return{min:this.minTime?parseInt(this.minTime):null,max:this.maxTime?parseInt(this.maxTime):null}},pickerValue:function(){return this.value?ce()(this.value,this.format).toDate():null},inputValue:function(){return"string"==typeof this.localInputValue?this.localInputValue:this.value?ce()(this.value,this.format).format(this.displayFormat):""},hasClearButton:function(){return!!this.value}},methods:{getMoment:function(){return this.value?ce()(this.value,this.format):ce()()},formatDateValue:function(t){return t?this.hasDate?this.hasTime?ce()(t).format():ce()(t).format("YYYY-MM-DD"):ce()(t).format("HH:mm"):null},handleDateChanged:function(t){this.$emit("input",this.formatDateValue(t))},handleInput:function(t){var e=ce()(t.target.value,this.displayFormat,!0);this.localInputValue=t.target.value,e.isValid()?(this.rollback(),this.$emit("input",this.formatDateValue(e.toDate())),this.updatePopover()):this.$emit("error","".concat((0,r.KQ)("form.date.validation_error.format")," (").concat(this.displayFormat,")"))},handlePrependButtonClicked:function(){var t=this;setTimeout((function(){return t.$refs.input.focus()}))},handleBlur:function(){this.localInputValue&&this.rollback()},updatePopover:function(){this.$refs.input.dispatchEvent(new Event("change",{bubbles:!0}))},increase:function(t){this.translate(t.target,1)},decrease:function(t){this.translate(t.target,-1)},translate:function(t,e){var n,r=this;return(n=l().mark((function n(){var i;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=r.changeOnArrowPressed(t.selectionStart,e))){n.next=6;break}return n.next=4,r.$nextTick();case 4:t.setSelectionRange(i.start,i.end),r.updatePopover();case 6:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(r,i){var o=n.apply(t,e);function a(t){he(o,r,i,a,l,"next",t)}function l(t){he(o,r,i,a,l,"throw",t)}a(void 0)}))})()},add:function(t,e){var n=this.getMoment();n.add(t,e),this.$emit("input",this.formatDateValue(n.toDate()))},nearestMinutesDist:function(t){var e=this.getMoment().minutes();if(e%this.stepTime==0)return t*this.stepTime;var n=t<0?"floor":"ceil";return this.stepTime*Math[n](e/this.stepTime)-e},updateMoment:function(t,e){switch(t){case"H":this.add(e,"hours");break;case"m":this.add(this.nearestMinutesDist(e),"minutes");break;case"s":this.add(e,"seconds");break;case"Y":this.add(e,"years");break;case"M":this.add(e,"months");break;case"D":this.add(e,"days");break;default:return!1}return!0},changeOnArrowPressed:function(t,e){var n=t;if(!this.updateMoment(this.displayFormat[n],e)&&t&&(n--,!this.updateMoment(this.displayFormat[n],e)))return null;var r=this.displayFormat[n];return{start:this.displayFormat.indexOf(r),end:this.displayFormat.lastIndexOf(r)+1}},rollback:function(){this.$emit("clear"),this.localInputValue=null},clear:function(){var t=this;this.rollback(),this.$emit("input",null),setTimeout((function(){return t.$refs.input.focus()}))}}},me=pe,ve=(0,dt.Z)(me,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpDate"},[n("div",{staticClass:"SharpDate__input-wrapper position-relative"},[n("DatePicker",{attrs:{value:t.pickerValue,mode:t.mode,"minute-increment":t.stepTime,"monday-first":t.mondayFirst,"update-on-input":!1},on:{input:t.handleDateChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.inputEvents;e.togglePopover;return[n("div",{staticClass:"input-group",class:{"input-group--clearable":t.hasClearButton}},[n("button",{staticClass:"input-group-text btn",on:{click:t.handlePrependButtonClicked}},[n("svg",{staticClass:"align-middle",staticStyle:{fill:"currentColor"},attrs:{width:"1.25em",height:"1.25em",viewBox:"0 0 32 32"}},[n("path",{attrs:{d:"M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"}})])]),t._v(" "),n("input",t._g({ref:"input",staticClass:"form-control clearable SharpDate__input",class:{"SharpDate__input--valuated":t.value},attrs:{id:t.id,placeholder:t.displayFormat,disabled:t.readOnly,autocomplete:"off"},domProps:{value:t.inputValue},on:{input:t.handleInput,blur:t.handleBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.increase.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.decrease.apply(null,arguments))}]}},r)),t._v(" "),t.hasClearButton?[n("ClearButton",{ref:"clearButton",on:{click:t.clear}})]:t._e()],2)]}}])})],1)])}),[],!1,null,null,null),be=ve.exports,ye={name:"SharpCheck",props:{value:Boolean,text:String,readOnly:Boolean,uniqueIdentifier:String,id:String},computed:{resolvedId:function(){var t;return null!==(t=this.id)&&void 0!==t?t:this.uniqueIdentifier}},methods:{handleCheck:function(t){this.$emit("input",t.target.checked)}}},ge=(0,dt.Z)(ye,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpCheck form-check"},[n("input",{staticClass:"form-check-input",attrs:{type:"checkbox",id:t.resolvedId,disabled:t.readOnly},domProps:{checked:t.value},on:{change:t.handleCheck}}),t._v(" "),n("label",{staticClass:"form-check-label",attrs:{for:t.resolvedId}},[t._v("\n "+t._s(t.text)+"\n ")])])}),[],!1,null,null,null).exports,we=n(16596),_e=n.n(we),Oe={name:"FieldsLayout",components:{Grid:p.rj},props:{layout:{type:Array,required:!0},visible:{type:Object,default:function(){return{}}}},data:function(){return{fieldsetMap:{}}},methods:{isFieldset:function(t){return!!t.legend},isFieldsetVisible:function(t){var e=this;return(t.fields||[]).flat().some((function(t){return e.visible[t.key]}))},updateLayout:function(){this.$el.querySelectorAll(":scope > .SharpGrid__row").forEach((function(t){var e=!!t.querySelector(":scope > .SharpGrid__col > .SharpForm__form-item--has-label"),n=!!t.querySelector(".SharpFieldLocaleSelect");t.classList.toggle("SharpGrid__row--has-label",e),t.classList.toggle("SharpGrid__row--has-locale-select",n)}))}},mounted:function(){this.updateLayout()},updated:function(){this.updateLayout()}},Se=(0,dt.Z)(Oe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Grid",{attrs:{rows:t.layout},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[t.isFieldset(r)?[n("fieldset",{directives:[{name:"show",rawName:"v-show",value:t.isFieldsetVisible(r),expression:"isFieldsetVisible(fieldLayout)"}]},[n("legend",{staticClass:"SharpForm__label form-label"},[t._v(t._s(r.legend))]),t._v(" "),n("div",{staticClass:"card SharpForm__fieldset shadow-sm"},[n("div",{staticClass:"card-body"},[n("FieldsLayout",{attrs:{layout:r.fields},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.fieldLayout;return[t._t("default",null,{fieldLayout:n})]}}],null,!0)})],1)])])]:[t._t("default",null,{fieldLayout:r})]]}}])})}),[],!1,null,null,null).exports,Ce={name:"SharpListItem",extends:Se,mixins:[o.IE]},je=(0,dt.Z)(Ce,undefined,undefined,!1,null,null,null).exports;function xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ke(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:this.data,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.fieldLocale,o=this[t][e];return this.localized&&o.localized&&C(o)?j({localeObject:r[e],locale:i[e],value:n}):n},defaultFieldLocaleMap:function(t,e){var n=t.fields,r=t.locales;return Object.values(n).filter((function(t){var e;return"list"===t.type?Object.values(null!==(e=t.itemFields)&&void 0!==e?e:{}).some((function(t){return t.localized})):t.localized})).reduce((function(t,n){return ke(ke({},t),{},Pe({},n.key,e||r&&r[0]))}),{})}}}}var Ae={props:{field:Object,limit:Number,disabled:Boolean},data:function(){return{dragActive:!1}},computed:{classes:function(){return{"SharpListUpload--active":this.dragActive,"SharpListUpload--disabled":this.disabled}},text:function(){return this.getText({link:'$1'})},label:function(){return this.getText()},accept:function(){var t;return null===(t=this.field.fileFilter)||void 0===t?void 0:t.join(",")},helpText:function(){return(0,r.KQ)("form.list.bulk_upload.help_text").replace(":limit",this.limit)}},methods:{getText:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.link;return(0,r.KQ)("form.list.bulk_upload.text").replace(/\[(.+?)]\(.*?\)/,null!=e?e:"$1")},handleDragEnter:function(){this.dragActive=!0},handleDragLeave:function(){this.dragActive=!1},handleDrop:function(){this.dragActive=!1},handleTextClicked:function(){this.$refs.input.click()},handleChanged:function(t){this.$emit("change",t),t.target.value=""}}},Ee=Ae,Le=(0,dt.Z)(Ee,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-group-item text-muted SharpListUpload",class:t.classes},[n("div",{staticClass:"SharpListUpload__content d-flex align-items-center justify-content-center"},[n("div",{staticClass:"SharpListUpload__text"},[n("div",{staticClass:"row align-items-center gx-0"},[n("div",{staticClass:"col-auto"},[n("svg",{staticClass:"SharpListUpload__icon",attrs:{width:"2em",height:"2em",viewBox:"0 0 32 32"}},[n("path",{attrs:{d:"M26,24v4H6V24H4v4H4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2h0V24Z"}}),n("polygon",{attrs:{points:"26 14 24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14"}})])]),t._v(" "),n("div",{staticClass:"col"},[n("div",{domProps:{innerHTML:t._s(t.text)},on:{click:function(e){return e.preventDefault(),t.handleTextClicked.apply(null,arguments)}}})])])])]),t._v(" "),n("div",{staticClass:"SharpListUpload__help"},[t._v("\n "+t._s(t.helpText)+"\n ")]),t._v(" "),n("input",{ref:"input",staticClass:"SharpListUpload__input",attrs:{type:"file","aria-label":t.label,disabled:t.disabled,accept:t.accept,multiple:""},on:{change:t.handleChanged,dragenter:t.handleDragEnter,dragleave:t.handleDragLeave,drop:t.handleDrop}})])}),[],!1,null,null,null),Ie=Le.exports,Be=["_fieldsLocale"];function Fe(t){return function(t){if(Array.isArray(t))return Me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Te(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||Te(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){if(t){if("string"==typeof t)return Me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(t,e):void 0}}function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Ne={name:"SharpList",inject:["$form"],mixins:[o.WH,De("itemFields")],components:{ListUpload:Ie,Draggable:_e(),ListItem:je,Button:p.zx,TemplateRenderer:i.e},props:{fieldKey:String,fieldLayout:Object,value:Array,addable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},addText:{type:String,default:"Ajouter un élément"},itemFields:{type:Object,required:!0},collapsedItemTemplate:String,maxItemCount:Number,bulkUploadField:String,bulkUploadLimit:{type:Number,default:10},itemIdAttribute:String,readOnly:Boolean,locale:[String,Array]},data:function(){return{list:[],dragActive:!1,dragging:!1,lastIndex:0}},watch:{list:"handleListChanged",locale:"handleLocaleChanged"},computed:{classes:function(){return{"SharpList--can-sort":this.showSortButton,"SharpList--dragging":this.dragging}},dragOptions:function(){return{handle:this.dragActive?".SharpList__item":".SharpList__drag-handle",filter:".SharpListUpload"}},canAddItem:function(){return this.addable&&(this.list.length1},showRemoveButton:function(){return this.removable&&!this.isReadOnly},dragIndexSymbol:function(){return Symbol("dragIndex")},indexSymbol:function(){return Symbol("index")},hasPendingActions:function(){var t;return null===(t=this.$form)||void 0===t?void 0:t.hasUploadingFields(this.fieldKey)},isReadOnly:function(){return this.readOnly||this.dragActive},hasUpload:function(){var t;return"upload"===(null===(t=this.uploadField)||void 0===t?void 0:t.type)&&this.canAddItem&&this.uploadLimit>0},uploadField:function(){return this.bulkUploadField?this.itemFields[this.bulkUploadField]:null},uploadLimit:function(){if(this.maxItemCount){var t=this.maxItemCount-this.list.length;return Math.min(t,this.bulkUploadLimit)}return this.bulkUploadLimit}},methods:{handleListChanged:function(){this.$emit("locale-change",this.list.map((function(t){return t._fieldsLocale})))},handleLocaleChanged:function(t){var e=this;"string"==typeof t&&this.list.forEach((function(n){Object.assign(n,e.withLocale(null,t))}))},itemData:function(t){t._fieldsLocale;return Re(t,Be)},transformedFields:function(t){var e=this.list[t],n=this.itemData(e);return it(this.itemFields,n)},indexedList:function(){var t=this;return(this.value||[]).map((function(e,n){return t.withLocale(ze(Ke({},t.indexSymbol,n),e))}))},createItem:function(){var t;return Object.entries(this.itemFields).reduce((function(t,e){var n=$e(e,2),r=n[0],i=n[1];return t[r]="editor"===i.type?{}:null,t}),this.withLocale((Ke(t={},this.itemIdAttribute,null),Ke(t,this.indexSymbol,this.lastIndex++),t)))},insertNewItem:function(t,e){e.target&&e.target.blur(),this.list.splice(t,0,this.createItem())},add:function(){this.list.push(this.createItem())},remove:function(t){this.list.splice(t,1)},update:function(t){var e=this;return function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.forced,a=ze({},e.list[t]),l=ze(ze({},o?null:Y(e.itemFields,n,(function(){return e.fieldLocalizedValue(n,null,a,a._fieldsLocale)}))),{},Ke({},n,e.fieldLocalizedValue(n,r,a,a._fieldsLocale)));Object.assign(e.list[t],l)}},updateLocale:function(t,e,n){this.$set(this.list[t]._fieldsLocale,e,n),this.handleListChanged()},collapsedItemData:function(t){return ze({$index:t[this.dragIndexSymbol]},t)},toggleDrag:function(){var t=this;this.dragActive=!this.dragActive,this.list.forEach((function(e,n){return e[t.dragIndexSymbol]=n}))},withLocale:function(t,e){var n;return ze(ze({},t),{},{_fieldsLocale:this.defaultFieldLocaleMap({fields:this.itemFields,locales:null===(n=this.$form)||void 0===n?void 0:n.locales},e)})},handleUploadChanged:function(t){var e=this,n=Fe(t.target.files).slice(0,this.uploadLimit);if(t.target.files.length>this.uploadLimit){var i=(0,r.KQ)("form.list.bulk_upload.validation.limit").replace(":limit",this.uploadLimit);(0,r.wp)(i,{title:(0,r.KQ)("modals.error.title")})}n.forEach((function(t){var n=e.createItem();n[e.bulkUploadField]={file:t},e.list.push(n)}))},initList:function(){this.list=this.indexedList(),this.lastIndex=this.list.length,this.$emit("input",this.list)}},created:function(){var t;this.localized=null===(t=this.$form)||void 0===t?void 0:t.localized,this.initList()}},He=Ne,Ue=(0,dt.Z)(He,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpList",class:t.classes,on:{dragstart:function(e){t.dragging=!0},dragend:function(e){t.dragging=!1}}},[n("div",{staticClass:"SharpList__sticky-wrapper text-end"},[t.showSortButton?[n("Button",{staticClass:"SharpList__sort-button",staticStyle:{"pointer-events":"auto"},attrs:{text:"",small:"",active:t.dragActive},on:{click:t.toggleDrag}},[t._v("\n "+t._s(t.l("form.list.sort_button.inactive"))+"\n "),n("svg",{staticStyle:{"margin-left":".5em"},attrs:{width:"1.125em",height:"1.125em",viewBox:"0 0 24 22","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M20 14V0h-4v14h-4l6 8 6-8zM4 8v14h4V8h4L6 0 0 8z"}})])])]:t._e()],2),t._v(" "),n("Draggable",{ref:"draggable",attrs:{options:t.dragOptions,list:t.list},scopedSlots:t._u([t.showAddButton?{key:"footer",fn:function(){return[n("div",{class:{"mt-3":t.list.length>0||t.hasUpload}},[n("Button",{key:-1,staticClass:"SharpList__add-button",attrs:{disabled:t.isReadOnly,text:"",block:""},on:{click:t.add}},[t._v("\n + "+t._s(t.addText)+"\n ")])],1)]},proxy:!0}:null],null,!0)},[n("transition-group",{staticClass:"list-group shadow-sm",attrs:{name:"expand",tag:"div"}},[t._l(t.list,(function(e,r){return[n("div",{key:e[t.indexSymbol],staticClass:"SharpList__item list-group-item",class:{"SharpList__item--drag-active":t.dragActive}},[t.showInsertButton?[n("div",{staticClass:"SharpList__new-item-zone"},[n("Button",{attrs:{small:""},on:{click:function(e){return t.insertNewItem(r,e)}}},[t._v("\n "+t._s(t.l("form.list.insert_button"))+"\n ")])],1)]:t._e(),t._v(" "),t.dragActive&&t.collapsedItemTemplate?[n("TemplateRenderer",{attrs:{name:"CollapsedItem",template:t.collapsedItemTemplate,"template-data":t.collapsedItemData(e)}})]:[n("ListItem",{attrs:{layout:t.fieldLayout.item,"error-identifier":r},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.fieldLayout;return[n("FieldDisplay",{attrs:{"field-key":o.key,"context-fields":t.transformedFields(r),"context-data":e,"error-identifier":o.key,"config-identifier":o.key,"update-data":t.update(r),locale:e._fieldsLocale[o.key],"read-only":t.isReadOnly,list:!0},on:{"locale-change":function(e,n){return t.updateLocale(r,e,n)}}})]}}],null,!0)}),t._v(" "),t.showRemoveButton?[n("button",{staticClass:"SharpList__remove-button btn-close",attrs:{"aria-label":t.l("form.list.remove_button")},on:{click:function(e){return t.remove(r)}}})]:t._e()],t._v(" "),t.showSortButton?[n("div",{staticClass:"SharpList__drag-handle d-flex align-items-center px-1"},[n("i",{staticClass:"fas fa-grip-vertical opacity-25"})])]:t._e()],2)]})),t._v(" "),t.hasUpload?[n("ListUpload",{key:"upload",attrs:{field:t.uploadField,limit:t.uploadLimit,disabled:t.isReadOnly},on:{change:t.handleUploadChanged}})]:t._e()],2)],1),t._v(" "),t.readOnly&&!t.list.length?[n("em",{staticClass:"SharpList__empty-alert"},[t._v(t._s(t.l("form.list.empty")))])]:t._e()],2)}),[],!1,null,null,null).exports;function Ze(t,e,n){if(e){var r=document.querySelector('label[for="'.concat(e,'"]'));r&&(r.addEventListener("click",n),t.$on("hook:beforeDestroy",(function(){r.removeEventListener("click",n)})))}}var qe={components:{Multiselect:p.J,ClearButton:p.Cd},props:{id:String,value:[Array,String,Number],options:Array,labels:Object,multiple:Boolean,clearable:Boolean,placeholder:String,maxSelected:Number,readOnly:Boolean},computed:{multiselectOptions:function(){return this.options.map((function(t){return t.id}))},hasClearButton:function(){return this.clearable&&!this.multiple&&null!=this.value}},methods:{multiselectLabel:function(t){return this.labels[t]},remove:function(){this.$emit("input",null),this.$refs.multiselect.activate()},handleInput:function(t){this.$emit("input",t)}},mounted:function(){var t=this;Ze(this,this.id,(function(){t.$el.focus()}))}},Qe=(0,dt.Z)(qe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Multiselect",{ref:"multiselect",attrs:{id:t.id,value:t.value,searchable:!1,options:t.multiselectOptions,multiple:t.multiple,"hide-selected":t.multiple,"close-on-select":!t.multiple,"custom-label":t.multiselectLabel,placeholder:t.placeholder,disabled:t.readOnly,max:t.maxSelected,"allow-empty":t.clearable},on:{input:t.handleInput,open:function(e){return t.$emit("open")},close:function(e){return t.$emit("close")}},scopedSlots:t._u([t.hasClearButton?{key:"caret",fn:function(){return[n("ClearButton",{staticClass:"SharpSelect__clear-button",on:{click:t.remove}})]},proxy:!0}:null,{key:"tag",fn:function(e){var r=e.option,i=e.remove;return[n("span",{key:r,staticClass:"multiselect__tag"},[n("span",[t._v(t._s(t.multiselectLabel(r)))]),t._v(" "),n("i",{staticClass:"multiselect__tag-icon",attrs:{"aria-hidden":"true",tabindex:"1"},on:{keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),i(r))},mousedown:function(t){return t.preventDefault(),t.stopPropagation(),i(r)}}})])]}},{key:"option",fn:function(){return[t._t("option")]},proxy:!0}],null,!0)})}),[],!1,null,null,null).exports;function We(t,e){return null!=t.id&&null!=e&&t.id==e}function Ge(t){return function(t){if(Array.isArray(t))return Ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ye(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ye(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.maxSelected?(0,r.KQ)("form.select.validation.max_selected").replace(":max_selected",this.maxSelected):null}}},Xe=(0,dt.Z)(Je,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"card card-body form-control":t.root}},[n("div",{staticClass:"row gy-1 gx-3",class:t.inline?"row-cols-auto":"row-cols-1"},[t._l(t.options,(function(e,r){return[n("div",{staticClass:"col"},[n("Check",{key:e.id,staticClass:"mb-0",attrs:{id:t.checkboxId(r),value:t.isChecked(e),text:t.labels[e.id],"read-only":t.readOnly},on:{input:function(n){return t.handleCheckboxChanged(n,e)}}})],1)]}))],2),t._v(" "),t.showSelectAll?[n("div",{staticClass:"SharpSelect__links mt-3"},[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleSelectAllClicked.apply(null,arguments)}}},[t._v(t._s(t.lang("form.select.select_all")))])]),t._v(" "),n("div",{staticClass:"col-auto"},[n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleUnselectAllClicked.apply(null,arguments)}}},[t._v(t._s(t.lang("form.select.unselect_all")))])])])])]:t._e()],2)}),[],!1,null,null,null),tn=Xe.exports,en={props:{value:[String,Number],options:Array,labels:Object,uniqueIdentifier:String,readOnly:Boolean,inline:Boolean,root:Boolean},methods:{isSelected:function(t){return We(t,this.value)},handleRadioChanged:function(t){this.$emit("input",t.id)}}},nn=(0,dt.Z)(en,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"card card-body form-control":t.root}},[n("div",{staticClass:"row gy-1 gx-3",class:t.inline?"row-cols-auto":"row-cols-1"},[t._l(t.options,(function(e,r){return[n("div",{key:e.id,staticClass:"col"},[n("div",{staticClass:"form-check mb-0"},[n("input",{staticClass:"form-check-input",attrs:{type:"radio",tabindex:"0",id:t.uniqueIdentifier+"."+r,disabled:t.readOnly,name:t.uniqueIdentifier},domProps:{checked:t.isSelected(e),value:e.id},on:{change:function(n){return t.handleRadioChanged(e)}}}),t._v(" "),n("label",{staticClass:"form-check-label",attrs:{for:t.uniqueIdentifier+"."+r}},[t._v("\n "+t._s(t.labels[e.id])+"\n ")])])])]}))],2)])}),[],!1,null,null,null).exports,rn={name:"SharpSelect",mixins:[qt],props:{value:[Array,String,Number],uniqueIdentifier:String,options:{type:Array,required:!0,default:function(){return[]}},multiple:{type:Boolean,default:!1},display:{type:String,default:"dropdown"},clearable:{type:Boolean,default:!1},showSelectAll:{type:Boolean,default:!0},placeholder:{type:String,default:"-"},maxSelected:Number,readOnly:Boolean,inline:{type:Boolean,default:!0},root:Boolean},watch:{options:function(){this.init()}},computed:{classes:function(){return["SharpSelect--".concat(this.display),{"SharpSelect--multiple":this.multiple}]},component:function(){return"dropdown"===this.display?Qe:this.multiple?tn:nn},optionsLabel:function(){var t=this;return this.options.reduce((function(e,n){return e[n.id]=t.localizedOptionLabel(n),e}),{})}},methods:{handleInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.error;this.$emit("input",t,{error:n})},setDefault:function(){!this.clearable&&!this.multiple&&null==this.value&&this.options.length>0&&this.$emit("input",this.options[0].id,{force:!0})},init:function(){J(this,this.setDefault,{dependantAttributes:["options"]})},blur:function(){var t;null===(t=this.$refs.component.$refs)||void 0===t||t.multiselect.deactivate()}},created:function(){this.init()}},on=rn,an=(0,dt.Z)(on,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._b({ref:"component",tag:"component",staticClass:"SharpSelect",class:t.classes,attrs:{labels:t.optionsLabel},on:{input:t.handleInput}},"component",[t.$props,t.$attrs],!1))}),[],!1,null,null,null).exports,ln={name:"SharpHtml",components:{TemplateRenderer:i.e},props:{value:Object,template:String}},sn=(0,dt.Z)(ln,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("TemplateRenderer",{attrs:{name:"Html",template:t.template,"template-data":t.value}})}),[],!1,null,null,null).exports,un=n(36292),cn=["maxBounds"];function dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hn(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var pn={mapTypeControl:!1,streetViewControl:!1};function mn(t){var e=t;return Array.isArray(e)?new google.maps.LatLngBounds(e[0],e[1]):null}function vn(t){var e=t.maxBounds,n=function(t){for(var e=1;e0&&(e.search=t[0].address)})).finally((function(){e.loading=!1})))},handleSearchSubmitted:function(){var t=this,e=this.search;this.message="",this.loading=!0,Yn(this.geocodingProvider,{address:e},this.geocodingOptions).then((function(n){n.length>0?(t.currentLocation=n[0].location,t.currentBounds=n[0].bounds,t.$emit("change",t.currentLocation)):t.message=t.lSub("geocode_input.message.no_results").replace(":query",e||"")})).catch((function(e){t.message="".concat(t.lSub("geocode_input.message.error")).concat(e?" (".concat(e,")"):"")})).finally((function(){t.loading=!1}))}}},Xn=(0,dt.Z)(Jn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpGeolocationEdit",class:t.classes},[t.hasGeocoding?[n("div",{staticClass:"mb-2"},[n("form",{on:{submit:function(e){return e.preventDefault(),t.handleSearchSubmitted.apply(null,arguments)}}},[n("div",{staticClass:"row no-gutters"},[n("div",{staticClass:"col position-relative"},[n("TextField",{staticClass:"SharpGeolocationEdit__input",attrs:{value:t.search,placeholder:t.lSub("geocode_input.placeholder")},on:{input:t.handleSearchInput}}),t._v(" "),n("Loading",{staticClass:"SharpGeolocationEdit__loading",attrs:{visible:t.loading,small:""}})],1),t._v(" "),n("div",{staticClass:"col-auto pl-2"},[n("Button",{attrs:{outline:""}},[t._v(t._s(t.lSub("search_button")))])],1)])]),t._v(" "),t.message?[n("small",[t._v(t._s(t.message))])]:t._e()],2)]:t._e(),t._v(" "),n(t.editableMapComponent,{tag:"component",staticClass:"SharpGeolocationEdit__map",class:t.mapClasses,attrs:{"marker-position":t.currentLocation,center:t.center,bounds:t.currentBounds,zoom:t.zoom,"max-bounds":t.maxBounds,"tiles-url":t.tilesUrl},on:{change:t.handleMarkerPositionChanged}})],2)}),[],!1,null,null,null),tr=Xn.exports;function er(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var nr={name:"SharpGeolocation",mixins:[o.WH],inject:{$tab:{default:null}},components:{GeolocationEdit:tr,Button:p.zx,Modal:p.u_},props:{value:Object,readOnly:Boolean,uniqueIdentifier:String,geocoding:Boolean,apiKey:String,boundaries:Object,zoomLevel:{type:Number,default:4},initialPosition:{type:Object,default:function(){return{lat:46.1445458,lng:-2.4343779}}},displayUnit:{type:String,default:"DD",validator:function(t){return"DMS"===t||"DD"===t}},mapsProvider:{type:Object,default:function(){return{name:"gmaps"}}},geocodingProvider:{type:Object,default:function(){return{name:"gmaps"}}}},data:function(){return{ready:!1,modalVisible:!1,location:this.value}},computed:{isLoading:function(){return!this.ready},isEmpty:function(){return!this.value},latLngString:function(){return"DMS"===this.displayUnit?{lat:Mn(this.value.lat),lng:Mn(this.value.lng,!0)}:"DD"===this.displayUnit?this.value:void 0},mapComponent:function(){return"gmaps"===(t=Vn(this.mapsProvider))?_n:"osm"===t?Tn:void 0;var t},mapClasses:function(){return["SharpGeolocation__map--".concat(Vn(this.mapsProvider))]},tilesUrl:function(){return Kn(zn(this.mapsProvider))},maxBounds:function(){return this.boundaries?[this.boundaries.sw,this.boundaries.ne]:null},modalTitle:function(){return this.geocoding?this.l("form.geolocation.modal.title"):this.l("form.geolocation.modal.title-no-geocoding")}},methods:{providerName:Vn,providerOptions:zn,handleModalSubmitted:function(){this.$emit("input",this.location)},handleRemoveButtonClicked:function(){this.$emit("input",null)},handleShowModalButtonClicked:function(){this.modalVisible=!0},handleEditButtonClicked:function(){this.modalVisible=!0},handleLocationChanged:function(t){this.location=t},loadProvider:function(t){var e,n=Vn(t),r=zn(t).apiKey;return e={apiKey:r},"gmaps"===n?Promise.resolve(Dn(e)):Promise.resolve()},init:function(){var t,e=this;return(t=l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadProvider(e.mapsProvider);case 2:if(!e.geocodingProvider){t.next=5;break}return t.next=5,e.loadProvider(e.geocodingProvider);case 5:e.ready=!0;case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){er(o,r,i,a,l,"next",t)}function l(t){er(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.init()},mounted:function(){var t;null===(t=this.$tab)||void 0===t||t.$once("active",(function(){Rn()}))}},rr=nr,ir=(0,dt.Z)(rr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpGeolocation"},[t.isLoading?[t._v("\n "+t._s(t.l("form.geolocation.loading"))+"\n ")]:t.isEmpty?[n("Button",{attrs:{text:"",block:""},on:{click:t.handleShowModalButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.browse_button"))+"\n ")])]:[n("div",{staticClass:"card card-body form-control"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-7"},[n(t.mapComponent,{tag:"component",staticClass:"SharpGeolocation__map",class:t.mapClasses,attrs:{"marker-position":t.value,center:t.value,zoom:t.zoomLevel,"max-bounds":t.maxBounds,"tiles-url":t.tilesUrl}})],1),t._v(" "),n("div",{staticClass:"col-5 pl-0"},[n("div",{staticClass:"d-flex flex-column justify-content-between h-100"},[n("div",[n("div",[n("small",[t._v("Latitude : "+t._s(t.latLngString.lat))])]),t._v(" "),n("div",[n("small",[t._v("Longitude : "+t._s(t.latLngString.lng))])])]),t._v(" "),n("div",[n("Button",{staticClass:"remove-button",attrs:{variant:"danger",small:"",outline:"",disabled:t.readOnly},on:{click:t.handleRemoveButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.remove_button"))+"\n ")]),t._v(" "),n("Button",{attrs:{small:"",outline:"",disabled:t.readOnly},on:{click:t.handleEditButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.edit_button"))+"\n ")])],1)])])])])],t._v(" "),n("Modal",{attrs:{title:t.modalTitle,visible:t.modalVisible,"no-close-on-backdrop":""},on:{"update:visible":function(e){t.modalVisible=e},ok:t.handleModalSubmitted}},[n("transition",{attrs:{duration:300}},[t.modalVisible?[n("GeolocationEdit",{attrs:{location:t.value,center:t.value||t.initialPosition,zoom:t.zoomLevel,"max-bounds":t.maxBounds,"maps-provider":t.providerName(t.mapsProvider),"maps-options":t.providerOptions(t.mapsProvider),geocoding:t.geocoding,"geocoding-provider":t.providerName(t.geocodingProvider),"geocoding-options":t.providerOptions(t.geocodingProvider)},on:{change:t.handleLocationChanged}})]:t._e()],2)],1)],2)}),[],!1,null,null,null).exports,or=n(27935),ar=n(42752);function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sr(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n> ").concat(e.name),{isError:!0,title:(0,r.KQ)("modals.error.title")})},handleUpdated:function(t){this.updateAttributes({filters:t.filters}),this.node.attrs.file||this.extension.options.onUpdate(t)},handleSuccess:function(t){this.updateAttributes(vr(vr({},t),{},{file:null,uploaded:!0})),this.extension.options.onSuccess(t)},init:function(){var t,e=this;return(t=l().mark((function t(){var n;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.node.attrs.file&&!e.node.attrs.notFound){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.extension.options.registerFile(e.value);case 4:(n=t.sent)?e.updateAttributes(n):e.updateAttributes({notFound:!0});case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){pr(o,r,i,a,l,"next",t)}function l(t){pr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.init()},beforeDestroy:function(){this.node.attrs.file||this.extension.options.onRemove(this.value)}},gr=yr,wr=(0,dt.Z)(gr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeRenderer",{staticClass:"editor__node",attrs:{node:t.node}},[n("VueClip",t._b({attrs:{value:t.value,root:!1,options:t.options,invalid:!!t.error,"persist-thumbnails":""},on:{thumbnail:t.handleThumbnailChanged,updated:t.handleUpdated,removed:t.handleRemoveClicked,success:t.handleSuccess,error:t.handleError}},"VueClip",t.fieldProps,!1)),t._v(" "),t.error?[n("div",{staticClass:"invalid-feedback d-block",staticStyle:{"font-size":".75rem"}},[t._v("\n "+t._s(t.error)+"\n ")])]:t._e()],2)}),[],!1,null,null,null).exports,_r=n(2376);function Or(t){return function(t){if(Array.isArray(t))return Sr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n').concat(r||n,"")).run():t.chain().focus().setLink({href:n}).run()},isActive:function(t){return t.isActive("link")},icon:Dr("link"),label:(0,r.KQ)("form.editor.toolbar.link.title")},"upload-image":{command:function(t){return t.chain().focus().newUpload().run()},isActive:function(t){return t.isActive("upload")||t.isActive("image")},icon:Dr("image"),label:(0,r.KQ)("form.editor.toolbar.upload_image.title")},upload:{command:function(t){return t.chain().focus().newUpload().run()},isActive:function(t){return t.isActive("upload")},icon:Dr("document"),label:(0,r.KQ)("form.editor.toolbar.upload.title")},"horizontal-rule":{command:function(t){return t.chain().focus().setHorizontalRule().run()},isActive:function(t){return t.isActive("horizontalRule")},icon:Dr("hr"),label:(0,r.KQ)("form.editor.toolbar.horizontal_rule.title")},iframe:{command:function(t){return t.chain().focus().insertIframe().run()},isActive:function(t){return t.isActive("iframe")},icon:Dr("iframe"),label:(0,r.KQ)("form.editor.toolbar.iframe.title")},table:{command:function(t){return t.chain().focus().insertTable().run()},isActive:function(t){return t.isActive("table")},icon:Dr("table")},html:{command:function(t){return t.chain().focus().insertHtml().run()},isActive:function(t){return t.isActive("html")},icon:Dr("html")},"code-block":{command:function(t){return t.chain().focus().toggleCodeBlock().run()},isActive:function(t){return t.isActive("codeBlock")},icon:Dr("code-block")},superscript:{command:function(t){return t.chain().focus().toggleSuperscript().run()},isActive:function(t){return t.isActive("superscript")},icon:Dr("superscript")},undo:{command:function(t){return t.chain().undo().run()},icon:Dr("undo"),label:(0,r.KQ)("form.editor.toolbar.undo.title")},redo:{command:function(t){return t.chain().redo().run()},icon:Dr("redo"),label:(0,r.KQ)("form.editor.toolbar.redo.title")}},Er=n(16248),Lr=n(57883),Ir={components:{Button:p.zx,Dropdown:p.Lt,BDropdownForm:Er.N,BFormGroup:Lr.x,TextInput:yt},props:{id:String,active:Boolean,editor:Object},data:function(){return{label:null,href:null,hasSelectedText:!1,inserted:!1,selection:null}},computed:{hasLabelInput:function(){return!this.active&&!this.hasSelectedText},isEdit:function(){return this.inserted}},methods:{lang:r.KQ,fieldId:function(t){return"".concat(this.id,"-").concat(t)},hide:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.dropdown.hide(),t&&this.editor.chain().focus().run()},handleDropdownShow:function(){var t=this.editor.state.selection;if(this.href=null,this.inserted=!1,this.hasSelectedText=!t.empty,this.active){var e=this.editor.getAttributes("link");this.href=null==e?void 0:e.href,this.inserted=!0}this.hasSelectedText&&(this.editor.commands.setLink({href:"#"}),this.selection={from:t.from,to:t.to})},handleDropdownShown:function(){var t=this;setTimeout((function(){t.$refs.input.focus()}),0)},handleDropdownHide:function(){if(!this.inserted&&this.hasSelectedText){var t=this.editor.state.selection,e=t.from,n=t.to;this.editor.chain().setTextSelection(this.selection.from,this.selection.to).unsetLink().setTextSelection(e,n).run()}},handleCancelClicked:function(){this.hide()},handleLinkSubmitted:function(){this.href?(this.$emit("submit",{href:this.href,label:this.label}),this.inserted=!0):this.hide()},handleRemoveClicked:function(){this.$emit("remove")}}},Br=Ir,Fr=(0,dt.Z)(Br,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown editor__dropdown--link",attrs:{variant:"light",active:t.active},on:{show:t.handleDropdownShow,shown:t.handleDropdownShown,hide:t.handleDropdownHide},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("default")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[n("b-dropdown-form",{on:{submit:function(e){return e.preventDefault(),t.handleLinkSubmitted.apply(null,arguments)}}},[t.isEdit?[n("button",{staticClass:"btn-close position-absolute end-0 top-0 p-2 fs-8",attrs:{type:"button"},on:{click:t.handleCancelClicked}},[n("span",{staticClass:"visually-hidden"},[t._v(t._s(t.lang("modals.cancel_button","Cancel")))])])]:t._e(),t._v(" "),t.hasLabelInput?[n("div",{staticClass:"mb-3"},[n("label",{staticClass:"form-label",attrs:{for:t.fieldId("label")}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.text_label","Text"))+"\n ")]),t._v(" "),n("TextInput",{attrs:{id:t.fieldId("label")},model:{value:t.label,callback:function(e){t.label=e},expression:"label"}})],1)]:t._e(),t._v(" "),n("div",{staticClass:"mb-3"},[n("label",{staticClass:"form-label",attrs:{for:t.fieldId("href")}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.url_label","URL"))+"\n ")]),t._v(" "),n("TextInput",{ref:"input",attrs:{id:t.fieldId("href"),placeholder:"https://example.org",autocomplete:"off"},model:{value:t.href,callback:function(e){t.href=e},expression:"href"}})],1),t._v(" "),n("div",{staticClass:"mt-3"},[n("div",{staticClass:"row g-2 flex-sm-nowrap"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{type:"submit",small:"",variant:"primary"}},[t.isEdit?[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.update_button","Update"))+"\n ")]:[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.insert_button","Insert link"))+"\n ")]],2)],1),t._v(" "),n("div",{staticClass:"col-auto"},[t.isEdit?[n("Button",{attrs:{type:"button",small:"",variant:"danger",outline:""},on:{click:t.handleRemoveClicked}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.remove_button","Remove link"))+"\n ")])]:[n("Button",{attrs:{type:"button",small:"",variant:"light"},on:{click:t.handleCancelClicked}},[t._v("\n "+t._s(t.lang("modals.cancel_button","Cancel"))+"\n ")])]],2)])])],2)]}}],null,!0)},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null),$r=Fr.exports,Tr={components:{Button:p.zx,Dropdown:p.Lt,DropdownItem:p.hP,DropdownSeparator:p.u2},props:{id:String,active:Boolean,editor:Object},data:function(){return{}},methods:{lang:r.KQ,handleInsertClicked:function(){var t=this;this.command((function(){t.editor.chain().focus().insertTable().run()}))},command:function(t){var e=this;t(),setTimeout((function(){e.editor.chain().focus().run()}),0)}}},Mr=(0,dt.Z)(Tr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown editor__dropdown--table",attrs:{variant:"light",active:t.active},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("default")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[n("DropdownItem",{attrs:{disabled:t.editor.isActive("table")},on:{click:t.handleInsertClicked}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_table","Insert table"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addRowBefore()},on:{click:function(e){t.command((function(){return t.editor.chain().addRowBefore().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_row_above","Insert row above"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addRowAfter()},on:{click:function(e){t.command((function(){return t.editor.chain().addRowAfter().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_row_below","Insert row below"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteRow()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteRow().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_row","Remove row"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addColumnBefore()},on:{click:function(e){t.command((function(){return t.editor.chain().addColumnBefore().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_col_left","Insert column to the left"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addColumnAfter()},on:{click:function(e){t.command((function(){return t.editor.chain().addColumnAfter().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_col_right","Insert column to the right"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteColumn()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteColumn().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_col","Remove column"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteTable()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteTable().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_table","Remove table"))+"\n ")])]}}],null,!0)},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Vr={components:{Dropdown:p.Lt,DropdownItem:p.hP},props:{id:String,editor:Object,options:Array},data:function(){return{}},computed:{disabled:function(){return this.options.every((function(t){return t.disabled}))}},methods:{runCommand:function(t){var e=this;t.command(),setTimeout((function(){e.editor.chain().focus().run()}),0)}}},zr=(0,dt.Z)(Vr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown",attrs:{variant:"light",small:"",disabled:t.disabled},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n Options\n ")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[t._l(t.options,(function(e){return[n("DropdownItem",{attrs:{disabled:e.disabled},on:{click:function(n){return t.runCommand(e)}}},[t._v("\n "+t._s(e.label)+"\n ")])]}))]}}])},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Kr={components:{Dropdown:p.Lt,DropdownItem:p.hP},props:{embeds:Array,editor:Object},methods:{lang:r.KQ,handleClicked:function(t){this.editor.chain().focus().insertEmbed({embedKey:t.key}).run()}}},Rr=(0,dt.Z)(Kr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown",attrs:{variant:"light",small:""},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.lang("form.editor.dropdown.embeds"))+"\n ")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[t._l(t.embeds,(function(e){return[n("DropdownItem",{on:{click:function(n){return t.handleClicked(e)}}},[t._v("\n "+t._s(e.label)+"\n ")])]}))]}}])},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Nr=["upload"];function Hr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ur(t){return function(t){if(Array.isArray(t))return Zr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Zr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?[n("div",{staticClass:"btn-group"},[n("OptionsDropdown",{attrs:{options:t.options,editor:t.editor}})],1)]:t._e(),t._v(" "),t.customEmbeds&&t.customEmbeds.length>0?[n("div",{staticClass:"btn-group"},[n("EmbedDropdown",{attrs:{embeds:t.customEmbeds,editor:t.editor}})],1)]:t._e()],2)])}),[],!1,null,null,null).exports,Wr=n(37400);function Gr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Yr(t){return function(t){if(Array.isArray(t))return Jr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.maxLength?(0,r.KQ)("form.text.validation.maxlength").replace(":maxlength",this.maxLength):null},handleFocus:function(){this.firstFocus=!1},focus:function(){var t=this.firstFocus?"end":null;this.editor.commands.focus(t)},handleSelectionUpdated:function(){var t=this.editor.state.selection,e=t.from,n=t.to,r=Math.min(e,n),i=this.editor.view.coordsAtPos(r);if(this.toolbar){var o=this.$refs.header.getBoundingClientRect();i.topt.maxLength}},[t._v("\n "+t._s(t.lang("form.editor.character_count").replace(":count",t.characterCount+" / "+t.maxLength))+"\n ")])]:[t._v("\n "+t._s(t.lang("form.editor.character_count").replace(":count",t.characterCount))+"\n ")]],2)]:t._e()],2)])}),[],!1,null,null,null).exports,ni=n(12806);function ri(t){return function(t){if(Array.isArray(t))return ii(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ii(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ii(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n',rows:"6"},domProps:{value:t.html},on:{input:[function(e){e.target.composing||(t.html=e.target.value)},t.handleInput],paste:t.handleChanged,focus:function(t){return t.target.select()}}}),t._v(" "),t.previewHtml&&!t.invalid?[n("div",{staticClass:"iframe-node__modal-renderer mt-3",domProps:{innerHTML:t._s(t.previewHtml)}})]:t._e()],2)],2)}),[],!1,null,null,null).exports,ci=ar.NB.create({name:"iframe",group:"block",atom:!0,addOptions:function(){return{HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes:function(){return{src:{default:null},frameborder:{default:0},width:{default:null},height:{default:null},allow:{default:null},allowfullscreen:{default:null},isNew:{default:!1,renderHTML:function(){return null}}}},parseHTML:function(){return[{tag:"iframe"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["div",this.options.HTMLAttributes,["iframe",e]]},addPasteRules:function(){var t=this;return[new ar.hD({find:/(?:^|\s)().*/g,handler:function(e){e.state;var n=e.range,r=e.match[1];setTimeout((function(){t.editor.commands.insertContentAt(n,r)}))}})]},addCommands:function(){var t=this;return{insertIframe:function(){return function(e){var n=e.commands,r=e.tr;return n.insertContentAt(r.selection.to,{type:t.name,attrs:{isNew:!0}})}}}},addNodeView:function(){return(0,or.uf)(ui)}}),di=n(91382),fi=n(7490),hi=n(35525),pi=n(99404),mi=n(26761),vi=n(25748),bi=n(93237),yi=n(60363),gi=n(33991),wi=n(43626),_i=n(658),Oi=n(50601),Si=n(83416),Ci=n(41705),ji=n(84348),xi=ar.hj.create({name:"selected",addProseMirrorPlugins:function(){return[new _r.Sy({props:{decorations:function(t){var e=t.selection,n=[];return t.doc.nodesBetween(e.from,e.to,(function(t,e){t.isBlock&&n.push(ji.p.node(e,e+t.nodeSize,{class:"selected"}))})),ji.EH.create(t.doc,n)}}})]}});function ki(t){return function(t){if(Array.isArray(t))return Pi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Pi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n");return(new window.DOMParser).parseFromString(e,"text/html").body}function Ai(t,e){var n=ni.aw.fromSchema(e),r=Di(t.outerHTML);return n.parseSlice(r).content}function Ei(t,e){return ki(t.children).forEach((function(t){var n;if(t.hasAttribute("data-html-content")&&1===t.children.length)null!==(n=Ai(t.firstElementChild,e).firstChild)&&void 0!==n&&n.type.name.startsWith("embed:")&&t.parentElement.replaceChild(t.firstElementChild,t);else if(!Ai(t,e).size){var r=document.createElement("div");r.setAttribute("data-html-content","true"),t.parentElement.replaceChild(r,t),r.appendChild(t)}})),t.innerHTML}var Li={components:{NodeViewWrapper:or.T5,Button:p.zx,Modal:p.u_},props:{node:Object,editor:Object,updateAttributes:Function,selected:Boolean,deleteNode:Function},data:function(){return{editContent:null,editVisible:this.node.attrs.new}},methods:{lang:r.KQ,handleEditClicked:function(){this.editContent=this.node.attrs.content,this.$refs.modal.show()},handleModalOk:function(){var t=Di(this.editContent).innerHTML;this.updateAttributes({content:t,new:!1})},handleModalShown:function(t){t.target.querySelector("textarea").focus()},handleModalHidden:function(){var t=this;this.node.attrs.content||this.deleteNode(),setTimeout((function(){t.editor.commands.focus()}))}}},Ii=(0,dt.Z)(Li,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeViewWrapper",[n("div",{staticClass:"card editor__node html-node",class:{"shadow border-primary":t.selected}},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("pre",{staticClass:"mb-0"},[t._v(t._s(t.node.attrs.content))])]),t._v(" "),n("div",{staticClass:"col-auto me-n2 my-n2"},[n("Button",{attrs:{small:"",variant:"light"},on:{click:t.handleEditClicked}},[n("i",{staticClass:"fas fa-pencil-alt fs-7"})])],1)])])]),t._v(" "),n("Modal",{ref:"modal",attrs:{visible:t.editVisible},on:{"update:visible":function(e){t.editVisible=e},ok:t.handleModalOk,hidden:t.handleModalHidden,shown:t.handleModalShown},scopedSlots:t._u([{key:"title",fn:function(){return[t.node.attrs.new?[t._v("\n "+t._s(t.lang("form.editor.dialogs.raw_html.insert_title"))+"\n ")]:[t._v("\n "+t._s(t.lang("form.editor.dialogs.raw_html.edit_title"))+"\n ")]]},proxy:!0}])},[t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.editContent,expression:"editContent"}],staticClass:"form-control",attrs:{rows:"6"},domProps:{value:t.editContent},on:{input:function(e){e.target.composing||(t.editContent=e.target.value)}}})])],1)}),[],!1,null,null,null).exports,Bi=ar.NB.create({name:"html-content",group:"block",onBeforeCreate:function(){var t,e;this.editor.storage.markdown||this.editor.setOptions({content:(t=this.editor.options.content,e=this.editor.schema,Ei(Di(t),e))})},addStorage:function(){return{markdown:{parse:{updateDOM:function(t){Ei(t,this.editor.schema)}}}}},addAttributes:function(){return{content:{default:"",parseHTML:function(t){return t.innerHTML.trim()}},new:{default:!1}}},renderHTML:function(t){var e=t.node,n=document.createElement("div");return n.setAttribute("data-html-content","true"),n.innerHTML=e.attrs.content,n},parseHTML:function(){return[{tag:"[data-html-content]"}]},addCommands:function(){var t=this;return{insertHtml:function(){return function(e){return e.commands.insertContent({type:t.name,attrs:{new:!0}})}}}},addNodeView:function(){return(0,or.uf)(Ii)}});function Fi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return $i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n"),n.parseSlice(i,{preserveWhitespace:!0,context:r})}return null},transformPastedHTML:function(e){return t.options.inline?e.replace(/<\/p>\s*]*>/g,"

").replace(/]*>/g,"").replace(/<\/p>/g,""):e}}})]}});var Ri=ar.vc.create({name:"small",parseHTML:function(){return[{tag:"small"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["small",(0,ar.P1)(this.options.HTMLAttributes,e),0]},addCommands:function(){var t=this;return{toggleSmall:function(){return function(e){return e.commands.toggleMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-s":function(){return t.editor.commands.toggleSmall()}}}}),Ni=n(88776);function Hi(t,e){return!t||t.some((function(t){return t===e}))}function Ui(t){return function(t){if(Array.isArray(t))return Zi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Zi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)){t.next=6;break}return t.next=3,d(a.registeredFiles);case 3:e=t.sent,c(e),a.onResolve();case 6:a.created=!0,a.registeredFiles=[];case 8:case"end":return t.stop()}}),t)}))))},h={fieldProps:Gi(Gi({},n),{},{uniqueIdentifier:r,fieldConfigIdentifier:i}),state:a,registerFile:(s=Qi(l().mark((function t(n){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a.created){t.next=3;break}return c([].concat(Ui(e.value.files),[n])),t.abrupt("return",n);case 3:return a.registeredFiles.push(n),t.next=6,a.resolved;case 6:return t.abrupt("return",e.value.files.find((function(t){return(0,St.TS)(n,t)})));case 7:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)}),onSuccess:function(t){c([].concat(Ui(e.value.files),[t]))},onRemove:function(t){c(e.value.files.filter((function(e){return!(0,St.TS)(e,t)})))},onUpdate:function(t){c(e.value.files.map((function(e){return(0,St.TS)(e,t)?t:e})))}};return jr.extend(f).configure(h)}function Xi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function to(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eo(t){if(!t)return fi.X;var e=function(t){return t.map((function(t){return t.match(/^heading-(\d)$/)})).filter((function(t){return!!t})).map((function(t){return Number(t[1])}))}(t);return e.length>0?fi.X.configure({levels:e}):void 0}function no(t){if(Hi(t,"link"))return pi.r.configure({openOnClick:!1,HTMLAttributes:{rel:null,target:null}})}function ro(t){if(Hi(t,"horizontal-rule"))return vi.b.extend({selectable:!1})}function io(t){if(Hi(t,"table"))return[yi.iA,gi.S,wi.x,_i.p]}function oo(t){if(t)return bi.V.configure({placeholder:t})}function ao(t){if(Hi(t,"iframe"))return ci}function lo(t){if(Hi(t,"highlight"))return Oi.y$}function so(t){if(Hi(t,"small"))return Ri}function uo(t){if(Hi(t,"code-block"))return Si.dn}function co(t){if(Hi(t,"superscript"))return Ci.$}function fo(t){var e=t.toolbar,n=t.inline,r=bo({toolbar:null!=e?e:[],inline:n}),i=(0,ar.J1)(r);return Ki.configure({schema:i,inline:n})}function ho(t){var e=t.inline;return hi.U.extend({addKeyboardShortcuts:function(){var t=this;return e?function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n").concat(t.innerHTML),i.remove())}}))}(e),function(t){ko(t).forEach((function(e){if(function(t){Co(t.childNodes).reverse().slice(0,2).filter((function(t){var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,"br")})).forEach((function(t){t.nextSibling||t.remove()}))}(e),e.childNodes.length){var n=document.createElement("p");n.innerHTML=e.innerHTML,t.replaceChild(n,e)}else e.remove()}))}(e),e.innerHTML}function ko(t){return Co(t.children).filter((function(t){return t.matches("div")&&!t.attributes.length}))}var Po={props:{editor:Object,name:String,value:Object,locales:Array,locale:String,createEditor:Function},data:function(){return{localizedEditors:{}}},methods:{isActive:function(t){return this.locale===t}},created:function(){var t=this;!this.editor&&this.locales&&(this.localizedEditors=Object.fromEntries(this.locales.map((function(e){var n,r,i;return[e,t.createEditor({content:null!==(n=null===(r=t.value)||void 0===r||null===(i=r.text)||void 0===i?void 0:i[e])&&void 0!==n?n:null})]}))))},beforeDestroy:function(){Object.values(this.localizedEditors).forEach((function(t){t.destroy()}))}},Do=(0,dt.Z)(Po,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.editor?[t._t("default",null,{editor:t.editor}),t._v(" "),n("input",{attrs:{type:"hidden",name:t.name},domProps:{value:t.value&&t.value.text}})]:[t._l(t.locales,(function(e){return[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive(e),expression:"isActive(locale)"}],key:e},[t._t("default",null,{editor:t.localizedEditors[e],locale:e})],2)]}))]],2)}),[],!1,null,null,null).exports;function Ao(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Eo(t){for(var e=1;e/g,""):t.replace(/(

\s*<\/p>)+$/,"")}(e.getHTML(),{inline:this.inline}));this.$emit("input",this.localizedValue(i,n),{error:r})},createEditor:function(t){var e=t.content;return new or.ML(Eo(Eo({},yo),{},{extensions:this.extensions,content:xo(e),editable:!this.readOnly}))}},created:function(){this.isLocalized||(this.editor=this.createEditor({content:this.localizedText}))},beforeDestroy:function(){var t;null===(t=this.editor)||void 0===t||t.destroy()}},Bo=(0,dt.Z)(Io,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("LocalizedEditors",{attrs:{editor:t.editor,name:t.uniqueIdentifier,value:t.value,locale:t.locale,locales:t.locales,"create-editor":t.createEditor},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.editor,i=e.locale;return[n("SharpEditor",t._b({attrs:{editor:r},on:{update:function(e){return t.handleUpdate(Object.assign({},{editor:r,locale:i},e))}}},"SharpEditor",t.$props,!1))]}}])})],1)}),[],!1,null,null,null).exports,Fo=n(3695);function $o(t){return function(t){if(Array.isArray(t))return To(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return To(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return To(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function To(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==n[2]?n[2]:{},a=o.forced,r.data=Qo(Qo(Qo({},r.data),a?null:Y(r.fields,t,(function(t){return r.fieldLocalizedValue(t.key,null)}))),{},Wo({},t,r.fieldLocalizedValue(t,e)));case 2:case"end":return i.stop()}}),i)})))()},updateVisibility:function(t,e){this.$set(this.fieldVisible,t,e)},updateLocale:function(t,e){this.$set(this.fieldLocale,t,e)},updateFieldError:function(t,e){e&&(e[ea]=!0),this.errors=Qo(Qo({},this.errors),{},Wo({},t,e))},handleLocaleChanged:function(t){this.fieldLocale=this.defaultFieldLocaleMap({fields:this.fields,locales:this.locales},t)},mount:function(t){var e=t.fields,n=t.layout,r=t.data,i=t.authorizations,o=t.locales,a=t.breadcrumb,l=t.config;this.fields=e,this.data=null!=r?r:{},this.layout=this.patchLayout(n),this.locales=o,this.authorizations=null!=i?i:{},this.breadcrumb=a,this.config=null!=l?l:{},e&&(this.fieldVisible=Object.keys(this.fields).reduce((function(t,e){return t[e]=!0,t}),{}),this.fieldLocale=this.defaultFieldLocaleMap({fields:e,locales:o})),this.validate()},validate:function(){var t;Object.keys(this.fieldLocale).length>0&&!this.locales.length&&(t="Some fields are localized but the form hasn't any locales configured",(0,r.wp)(t,{title:"Data error",isError:!0}))},handleError:function(t){var e;return 422===(null===(e=t.response)||void 0===e?void 0:e.status)&&(this.errors=t.response.data.errors||{}),Promise.reject(t)},patchLayout:function(t){if(!t)return null;this.noTabs&&(t={tabs:[{columns:[{fields:t}]}]});var e=0,n=function t(n){n.legend?n.id="".concat(e++,"#").concat(n.legend):n.fields&&n.fields.forEach((function(e){e.forEach(t)}))};return t.tabs.forEach((function(t){return t.columns.forEach(n)})),t},serialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;return Object.fromEntries(Object.entries(null!=e?e:{}).filter((function(e){var n,r=Zo(e,1)[0];return"html"!==(null===(n=t.fields[r])||void 0===n?void 0:n.type)})))},setLoading:function(t){this.$emit("loading",t),this.loading=t},get:function(){var t=this;return this.axiosInstance.get(this.apiPath,{params:this.apiParams}).then((function(e){return t.mount(e.data),t.$emit("update:form",e.data),e})).catch((function(e){return t.$emit("error",e),Promise.reject(e)}))},init:function(){var t=this;return Yo(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.independant){e.next=5;break}t.mount(t.form),t.ready=!0,e.next=12;break;case 5:if(!t.entityKey){e.next=11;break}return e.next=8,t.get();case 8:t.ready=!0,e.next=12;break;case 11:(0,r.H)("no entity key provided");case 12:case"end":return e.stop()}}),e)})))()},redirectForResponse:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.replace,r=t.data.redirectUrl;n?location.replace(r):location.href=r},redirectToParentPage:function(){location.href=(0,r.Z_)(this.breadcrumb.items)},submit:function(){var t=arguments,e=this;return Yo(l().mark((function n(){var r,i,o,a,s;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.length>0&&void 0!==t[0]?t[0]:{},i=r.postFn,!e.isUploading){n.next=3;break}return n.abrupt("return");case 3:return e.setLoading(!0),o=e.serialize(),a=function(){return i?i(o):e.post(e.apiPath,o)},n.next=8,a().catch(e.handleError).finally((function(){e.setLoading(!1)}));case 8:if(s=n.sent,!e.independant){n.next=12;break}return e.$emit("submit",s),n.abrupt("return",s);case 12:e.setLoading(!0),e.$store.dispatch("setLoading",!0),e.redirectForResponse(s);case 15:case"end":return n.stop()}}),n)})))()},handleSubmitClicked:function(){this.submit().catch((function(){}))},handleDeleteClicked:function(){var t=this;return Yo(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.deleteConfirmationText){e.next=3;break}return e.next=3,(0,r.i0)(t.config.deleteConfirmationText,{okTitle:(0,r.KQ)("modals.confirm.delete.ok_button"),okVariant:"danger"});case 3:t.axiosInstance.delete(t.apiPath).then((function(e){t.redirectForResponse(e,{replace:!0})}));case 4:case"end":return e.stop()}}),e)})))()},handleCancelClicked:function(){this.redirectToParentPage()},setUploading:function(t,e){this.uploadingFields=Qo(Qo({},this.uploadingFields),{},Wo({},t,e))},hasUploadingFields:function(t){return Object.entries(this.uploadingFields).some((function(e){var n=Zo(e,2),r=n[0],i=n[1];return r.startsWith("".concat(t,"."))&&i}))}},created:function(){this.init()}},ra=na,ia=(0,dt.Z)(ra,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpForm",attrs:{"data-popover-boundary":""}},[t._t("action-bar",null,{props:t.actionBarProps,listeners:t.actionBarListeners}),t._v(" "),t.ready?[t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),t.hasErrors&&t.showAlert?[n("div",{staticClass:"alert alert-danger SharpForm__alert",attrs:{role:"alert"}},[n("div",{staticClass:"fw-bold"},[t._v(t._s(t.l("form.validation_error.title")))]),t._v(" "),n("div",[t._v(t._s(t.l("form.validation_error.description")))])])]:t._e(),t._v(" "),n("TabbedLayout",{ref:"tabbedLayout",attrs:{layout:t.layout},scopedSlots:t._u([t.localized?{key:"nav-prepend",fn:function(){return[n("LocaleSelect",{attrs:{locale:t.currentLocale,locales:t.locales},on:{change:t.handleLocaleChanged}})]},proxy:!0}:null,{key:"default",fn:function(e){var r=e.tab;return[n("Grid",{ref:"columnsGrid",attrs:{rows:[r.columns]},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[n("FieldsLayout",{ref:"fieldLayout",attrs:{layout:r.fields,visible:t.fieldVisible},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.fieldLayout;return[n("FieldDisplay",{ref:"field",attrs:{"field-key":r.key,"context-fields":t.transformedFields,"context-data":t.data,"field-layout":r,locale:t.fieldLocale[r.key],"read-only":t.isReadOnly,"error-identifier":r.key,"config-identifier":r.key,root:"","update-data":t.updateData,"update-visibility":t.updateVisibility},on:{"locale-change":t.updateLocale}})]}}],null,!0)})]}}],null,!0)})]}}],null,!0)})]:t._e()],2)}),[],!1,null,null,null).exports,oa={components:{Modal:p.u_,Form:ia},inject:{$form:{default:null}},props:{visible:Boolean,form:Object,post:Function},data:function(){return{loading:!1}},methods:{handleSubmitButtonClicked:function(t){var e=this;t.preventDefault(),this.loading=!0,this.$refs.form.submit({postFn:this.post}).finally((function(){e.loading=!1}))},handleCancelClicked:function(){this.$emit("cancel")}}};function aa(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function la(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){aa(o,r,i,a,l,"next",t)}function l(t){aa(o,r,i,a,l,"throw",t)}a(void 0)}))}}function sa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ua(t){for(var e=1;e0}},methods:{lang:r.KQ,handleEditClicked:function(){this.showForm()},handleCancelClicked:function(){var t=this;this.node.attrs.isNew&&(this.deleteNode(),setTimeout((function(){t.editor.commands.focus()}),0))},handleRemoveClicked:function(){this.deleteNode()},showForm:function(){var t=this;return la(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.extension.options.resolveForm(t.embedData);case 2:t.modalForm=e.sent,t.modalVisible=!0;case 4:case"end":return e.stop()}}),e)})))()},postForm:function(t){var e=this;return la(l().mark((function n(){var r;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.extension.options.postForm(t);case 2:r=n.sent,e.updateAttributes({attributes:r,additionalData:r,isNew:!1}),e.modalVisible=!1;case 5:case"end":return n.stop()}}),n)})))()},init:function(){var t=this;return la(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.node.attrs.isNew){e.next=11;break}if(!t.hasForm){e.next=6;break}return e.next=4,t.showForm();case 4:e.next=10;break;case 6:return e.next=8,t.$nextTick();case 8:t.updateAttributes({isNew:!1}),t.editor.commands.focus();case 10:return e.abrupt("return");case 11:if(!t.hasForm){e.next=16;break}return e.next=14,t.extension.options.getAdditionalData(t.node.attrs.attributes);case 14:(n=e.sent)&&t.updateAttributes({additionalData:n});case 16:case"end":return e.stop()}}),e)})))()}},created:function(){this.init()}},fa=(0,dt.Z)(da,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeRenderer",{staticClass:"editor__node embed-node",attrs:{node:t.node}},[t.node.attrs.isNew?t._e():[n("div",{staticClass:"card"},[n("div",{staticClass:"card-body"},[n("EmbedRenderer",{staticClass:"embed-node__template",attrs:{data:t.embedData,options:t.extension.options}}),t._v(" "),n("div",{staticClass:"mt-3"},[n("div",{staticClass:"row row-cols-auto gx-2"},[t.hasForm?[n("div",[n("Button",{attrs:{outline:"",small:""},on:{click:t.handleEditClicked}},[t._v("\n "+t._s(t.lang("form.upload.edit_button"))+"\n ")])],1)]:t._e(),t._v(" "),n("div",[n("Button",{attrs:{variant:"danger",outline:"",small:""},on:{click:t.handleRemoveClicked}},[t._v("\n "+t._s(t.lang("form.upload.remove_button"))+"\n ")])],1)],2)])],1)])],t._v(" "),n("EmbedFormModal",{attrs:{visible:t.modalVisible,form:t.modalForm,post:t.postForm},on:{"update:visible":function(e){t.modalVisible=e},cancel:t.handleCancelClicked},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n "+t._s(t.extension.options.label)+"\n ")]},proxy:!0}])})],2)}),[],!1,null,null,null).exports;function ha(t){return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(t,e){return(e?"-":"")+t.toLowerCase()}))}function pa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ma(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Oa(t){var e=function(t,e){if("object"!==wa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==wa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wa(e)?e:String(e)}function Sa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ca(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ea(t){return function(t){if(Array.isArray(t))return Ia(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||La(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function La(t,e){if(t){if("string"==typeof t)return Ia(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(t,e):void 0}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},e=t.placeholder,n=t.toolbar,r=t.inline;return[bo({toolbar:n,inline:r}),fo({toolbar:n,inline:r}),oo(e),po({inline:r}),mo(),Bi,xi].flat().filter((function(t){return!!t}))}({placeholder:this.placeholder,toolbar:this.toolbar,inline:this.inline})),Ea(this.embedExtensions),[this.uploadExtension]);return t.filter((function(t){return!!t}))},uploadExtension:function(){var t;return null!==(t=this.embeds)&&void 0!==t&&t.upload?Ji.call(this,{fieldProps:this.embeds.upload,uniqueIdentifier:this.uniqueIdentifier,fieldConfigIdentifier:this.fieldConfigIdentifier,form:this.$form}):null},embedExtensions:function(){var t,e=this,n=null!==(t=this.embeds)&&void 0!==t?t:{},r=(n.upload,Aa(n,Pa));return Object.entries(r).map((function(t){var n=Da(t,2);return function(t){var e,n=t.embedKey,r=t.embedOptions,i=t.form,o=kn.default.observable({embeds:[],currentIndex:0,created:!1,resolved:null,onResolve:null});o.resolved=new Promise((function(t){return o.onResolve=t}));var a={name:"embed:".concat(n),onCreate:u()(ka(l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o.currentIndex>0)){t.next=5;break}return t.next=3,e=o.embeds,(0,No.vI)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,embeds:e,form:!0});case 3:o.embeds=t.sent,o.onResolve();case 5:o.created=!0;case 6:case"end":return t.stop()}var e}),t)}))))},s={label:r.label,tag:r.tag,attributes:null!==(e=r.attributes)&&void 0!==e?e:[],template:r.template,state:o,isReady:function(){return o.created},getEmbed:function(t){return o.embeds[t]},getAdditionalData:function(t){return ka(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.created){e.next=2;break}return e.abrupt("return",null);case 2:return n=o.currentIndex++,o.embeds.push(t),e.next=6,o.resolved;case 6:return e.abrupt("return",o.embeds[n]);case 7:case"end":return e.stop()}}),e)})))()},onUpdate:function(t,e){o.embeds=Ca(Ca({},o.embeds),{},ja({},t,e))},onRemove:function(t){var e=o.embeds,n=(e[t],_a(e,[t].map(Oa)));o.embeds=n},resolveForm:function(t){return(0,No.Bd)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,attributes:t})},postForm:function(t){return(0,No.l3)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,data:t})}};return ga.extend(a).configure(s)}({embedKey:n[0],embedOptions:n[1],form:e.$form})}))}}},Ta=$a,Ma=(0,dt.Z)(Ta,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.markdown?[n("MarkdownContentEditor",t._g(t._b({attrs:{extensions:t.extensions}},"MarkdownContentEditor",[t.$props,t.$attrs],!1),t.$listeners))]:[n("HtmlContentEditor",t._g(t._b({attrs:{extensions:t.extensions}},"HtmlContentEditor",[t.$props,t.$attrs],!1),t.$listeners))]],2)}),[],!1,null,null,null).exports,Va={components:{DatePicker:fe,ClearButton:p.Cd},props:{value:{default:function(){return{start:null,end:null}}},displayFormat:{type:String,default:"DD/MM/YYYY"},startPlaceholder:{type:String,default:function(){return(0,r.KQ)("form.daterange.start_placeholder")}},endPlaceholder:{type:String,default:function(){return(0,r.KQ)("form.daterange.end_placeholder")}},clearable:{type:Boolean,default:!0},readOnly:Boolean,mondayFirst:Boolean,small:Boolean,updateOnInput:{type:Boolean,default:!0}},computed:{hasClearButton:function(){var t,e;return this.clearable&&!(null===(t=this.value)||void 0===t||!t.start)&&!(null===(e=this.value)||void 0===e||!e.end)}},methods:{handleChanged:function(t){var e,n,r,i,o,a;(null==t||null===(e=t.start)||void 0===e?void 0:e.toDateString())===(null===(n=this.oldValue)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.toDateString())&&(null==t||null===(i=t.end)||void 0===i?void 0:i.toDateString())===(null===(o=this.oldValue)||void 0===o||null===(a=o.end)||void 0===a?void 0:a.toDateString())||(this.$emit("input",t),this.oldValue=t)},handleClearClicked:function(){this.$emit("input",null)},focus:function(){var t=this;setTimeout((function(){t.$el.querySelector(".form-control").focus()}))}}},za=(0,dt.Z)(Va,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("DatePicker",{staticClass:"SharpDateRange position-relative",attrs:{value:t.value,"monday-first":t.mondayFirst,"display-format":t.displayFormat,columns:t.$screens({default:1,lg:2}),"update-on-input":t.updateOnInput,"is-range":""},on:{input:t.handleChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.inputValue,i=e.inputEvents;return[n("div",{staticClass:"input-group",class:{"input-group-sm":t.small}},[t.small&&!t.value?[n("div",t._g({staticClass:"form-control dropdown-toggle",attrs:{tabindex:"0"}},i.start),[n("span")])]:[n("input",t._g(t._b({staticClass:"form-control border-end-0",attrs:{placeholder:t.startPlaceholder,disabled:t.readOnly,autocomplete:"off"},domProps:{value:r.start}},"input",t.$props,!1),i.start)),t._v(" "),n("div",{staticClass:"form-control SharpDateRange__dash px-0 border-start-0 border-end-0"},[t._v("\n -\n ")]),t._v(" "),n("input",t._g(t._b({staticClass:"form-control border-start-0",class:{clearable:t.hasClearButton},attrs:{placeholder:t.endPlaceholder,disabled:t.readOnly,autocomplete:"off"},domProps:{value:r.end}},"input",t.$props,!1),i.end))]],2),t._v(" "),t.hasClearButton?[n("ClearButton",{on:{click:t.handleClearClicked}})]:t._e()]}}])})}),[],!1,null,null,null).exports,Ka={autocomplete:ft,text:yt,textarea:vt,editor:Ma,number:wt,upload:Zt,tags:se,date:be,check:ge,list:Ue,select:an,html:sn,geolocation:ir,daterange:za},Ra=["key"];function Na(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ha(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var qa={name:"SharpField",inheritAttrs:!1,provide:function(){return{$field:this}},props:{fieldKey:String,fieldType:String,fieldProps:Object,fieldLayout:Object,value:[String,Number,Boolean,Object,Array,Date],locale:[Array,String],uniqueIdentifier:String,fieldConfigIdentifier:String,updateData:Function,readOnly:Boolean,root:Boolean},computed:{isCustom:function(){return(0,r.X0)(this.fieldType)},component:function(){return this.isCustom?(0,r.vW)(this.fieldType):Ka[this.fieldType]}},render:function(t){var e=this;if(!this.component)return this.custom||(0,r.H)("Unknown field type '".concat(this.fieldType,"'"),this.fieldProps),null;var n=this.fieldProps,i=(n.key,Za(n,Ra));return t(this.component,{class:"SharpField",props:{fieldKey:this.fieldKey,fieldLayout:this.fieldLayout,value:this.value,locale:this.locale,uniqueIdentifier:this.uniqueIdentifier,fieldConfigIdentifier:this.fieldConfigIdentifier,root:this.root},attrs:Ha({id:this.$attrs.id,dynamicAttributes:i.dynamicAttributes},i),on:Ha(Ha({},this.$listeners),{},{input:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!e.fieldProps.readOnly||n.force?(e.updateData(e.fieldKey,t,{forced:n.force}),e.$emit("input",t,{force:n.force,error:n.error})):(0,r.cM)("SharpField '".concat(e.fieldKey,"', can't update because is readOnly"))}})})}},Qa=qa,Wa=(0,dt.Z)(Qa,undefined,undefined,!1,null,null,null).exports,Ga={props:{locales:{type:Array,required:!0},currentLocale:{type:String,required:!0},fieldValue:[String,Number,Boolean,Object,Array],isLocaleObject:Boolean,errors:Array},methods:{isActive:function(t){return this.currentLocale===t},isEmpty:function(t){var e=this.isLocaleObject?(this.fieldValue||{})[t]:this.fieldValue;return Array.isArray(e)?!e.length:!e},hasError:function(t){var e;return null===(e=this.errors)||void 0===e?void 0:e.includes(t)},handleButtonClicked:function(t){this.$emit("change",t)}}},Ya=(0,dt.Z)(Ga,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFieldLocaleSelect"},[n("div",{staticClass:"row gx-1"},[t._l(t.locales,(function(e){return[n("div",{staticClass:"col-auto d-flex"},[n("button",{staticClass:"SharpFieldLocaleSelect__btn ml-2",class:{"SharpFieldLocaleSelect__btn--active":t.isActive(e),"SharpFieldLocaleSelect__btn--empty":t.isEmpty(e),"SharpFieldLocaleSelect__btn--error":t.hasError(e)},on:{click:function(n){return t.handleButtonClicked(e)}}},[t._v("\n "+t._s(e)+"\n ")])])]}))],2)])}),[],!1,null,null,null).exports;function Ja(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Xa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},showLabel:function(){return!!this.label},resolvedOriginalValue:function(){return function(t){var e=t.field,n=t.value;return"editor"===e.type?(n||{}).text:n}({field:this.fieldProps,value:this.originalValue})},isLocaleObject:function(){return C(this.fieldProps)||"editor"===this.fieldProps.type},mergedErrorIdentifier:function(){return this.getMergedIdentifier("mergedErrorIdentifier",this.errorIdentifier)},mergedLocalizedErrorIdentifier:function(){return this.localizedErrorIdentifier?this.getMergedIdentifier("mergedErrorIdentifier",this.localizedErrorIdentifier):null},errorsLocales:function(){var t=this;return Object.entries(this.$form.errors).filter((function(t){var e=Ja(t,2);e[0];return!!e[1]})).map((function(e){var n=Ja(e,1)[0].match(new RegExp("^".concat(t.mergedErrorIdentifier,"\\.([^.]+)$")));return null==n?void 0:n[1]})).filter((function(e){var n;return e&&(null===(n=t.$form.locales)||void 0===n?void 0:n.includes(e))}))}},methods:{updateError:function(t){var e,n=null!==(e=t[this.mergedLocalizedErrorIdentifier])&&void 0!==e?e:t[this.mergedErrorIdentifier];if(Array.isArray(n))this.setError(n[0]);else if(this.fieldProps.localized&&this.errorsLocales.length>0){var i=this.errorsLocales.join(", ").toUpperCase(),o=(0,r.KQ)("form.validation_error.localized").replace(":locales",i);this.setError(o)}else null==n?this.clear(!1):(0,r.H)('FieldContainer : Not processable error "'.concat(this.mergedErrorIdentifier,'" : '),n)},setError:function(t){var e;this.state="error",this.stateMessage=t,null===(e=this.$tab)||void 0===e||e.$emit("error",this.mergedErrorIdentifier)},setOk:function(){this.state="ok",this.stateMessage=""},clear:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.state="default",this.stateMessage="",t&&(this.emitClear(this.mergedErrorIdentifier),this.mergedLocalizedErrorIdentifier&&this.emitClear(this.mergedLocalizedErrorIdentifier))},emitClear:function(t){var e;null===(e=this.$tab)||void 0===e||e.$emit("clear",t),this.$form.updateFieldError(t,null)},triggerFocus:function(){this.$set(this.fieldProps,"focused",!0)},handleBlur:function(){this.$set(this.fieldProps,"focused",!1)},handleValueChanged:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.error;r?this.$form.updateFieldError(null!==(e=this.mergedLocalizedErrorIdentifier)&&void 0!==e?e:this.mergedErrorIdentifier,[r]):"error"===this.state&&this.clear()},handleLocaleChanged:function(t){this.$emit("locale-change",this.fieldKey,t)}},directives:{sticky:Wr.CA}},il=rl,ol=(0,dt.Z)(il,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFieldContainer SharpForm__form-item",class:t.formGroupClasses,style:t.extraStyle},[n("div",{directives:[{name:"sticky",rawName:"v-sticky",value:"list"===t.fieldType,expression:"fieldType === 'list'"}],staticClass:"SharpForm__field-header"},[n("div",{staticClass:"row align-items-end"},[n("div",{staticClass:"col d-flex"},[t.showLabel?[n("label",{staticClass:"SharpForm__label form-label",attrs:{for:t.fieldId}},[t._v("\n "+t._s(t.label)+"\n ")])]:[n("div",{staticClass:"SharpForm__label SharpForm__label--placeholder form-label"})]],2),t._v(" "),t.fieldProps.localized?[n("div",{staticClass:"col-auto"},[n("FieldLocaleSelect",{attrs:{locales:t.$form.locales,"current-locale":t.locale,"field-value":t.resolvedOriginalValue,"is-locale-object":t.isLocaleObject,errors:t.errorsLocales},on:{change:t.handleLocaleChanged}})],1)]:t._e()],2)]),t._v(" "),n("div",{staticClass:"SharpForm__field-content"},[n("Field",t._b({ref:"field",attrs:{id:t.fieldId,"unique-identifier":t.mergedErrorIdentifier,"field-config-identifier":t.mergedConfigIdentifier},on:{error:t.setError,ok:t.setOk,clear:t.clear,blur:t.handleBlur,"locale-change":t.handleLocaleChanged,input:t.handleValueChanged}},"Field",t.$props,!1))],1),t._v(" "),t.stateMessage?[n("div",{staticClass:"invalid-feedback d-block"},[t._v(t._s(t.stateMessage))])]:t._e(),t._v(" "),t.helpMessage?[n("div",{staticClass:"SharpForm__help-message form-text"},[t._v(t._s(t.helpMessage))])]:t._e()],2)}),[],!1,null,null,null).exports;function al(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ll(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ll(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function ll(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function ml(t){return ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ml(t)}function vl(t,e,n){return!n||function(t,e,n){var i=!0,o=n.operator;if("or"!==o&&"and"!==o)return(0,r.H)("Conditional display : unknown operator '".concat(o,"'"),n),!0;var a,l=al(n.fields);try{for(l.s();!(a=l.n()).done;){var s=a.value;s.key in t||((0,r.H)("Conditional display : can't find a field with key '".concat(n.key,"' in 'fields'"),n),i=!0);var u=t[s.key],c=e[s.key];if("autocomplete"===u.type||"select"===u.type||"tags"===u.type?i=sl({condValues:s.values,fieldValue:"autocomplete"===u.type?c&&c.id:c,isSingleSelect:"select"===u.type&&!u.multiple||"autocomplete"===u.type}):"check"===u.type?"boolean"!=typeof s.values?((0,r.H)("Conditional display : 'values' must be a boolean for a 'check' field ('".concat(s.key,"')"),n,u),i=!0):i=!!c===s.values:((0,r.H)("Conditional display : unprocessable field type '".concat(u.type,"'"),u),i=!0),"and"===o&&!i)return!1;if("or"===o&&i)return!0}}catch(t){l.e(t)}finally{l.f()}return i}(t,e,n)}var bl=function(t,e,n,i){return t.localized&&e.localized&&n&&C(e)?"object"!==ml(n)||(0,ul.isArray)(n)?((0,r.H)("Localized field '".concat(e.key,"' value must be a object, given :"),JSON.stringify(n)),n):n[i]:n},yl={name:"SharpFieldDisplay",functional:!0,inject:["$form"],render:function(t,e){var n=e.props,o=e.injections,a=e.data,l=n.fieldKey,s=n.contextFields,u=n.contextData,c=n.errorIdentifier,d=n.updateVisibility,f=n.readOnly,h=pl(n,cl),p=o.$form,m=s[l],v=u[l];if(!(l in s))return(0,r.H)("Field display ('layout') : Can't find a field with key '".concat(l,"' in 'fields'"),s),t(i.u,{props:{name:l}});var b=vl(s,u,m.conditionalDisplay);return d&&d(l,b),b?t(ol,fl(fl({},a),{},{attrs:fl({fieldKey:l,fieldProps:fl(fl({},m),{},{readOnly:f||m.readOnly}),fieldType:m.type,value:bl(p,m,v,n.locale),originalValue:v,label:m.label,helpMessage:m.helpMessage,errorIdentifier:c,localizedErrorIdentifier:m.localized?"".concat(c,".").concat(n.locale):null},h)})):null}},gl={name:"SharpActionBarForm",mixins:[o.WH],components:{ActionBar:p.ol,Button:p.zx,Breadcrumb:p.aG},props:{showSubmitButton:Boolean,showDeleteButton:Boolean,showBackButton:Boolean,create:Boolean,uploading:Boolean,loading:Boolean,breadcrumb:Array,showBreadcrumb:Boolean,hasDeleteConfirmation:Boolean},data:function(){return{deleteFocused:!1}},computed:{submitLabel:function(){return this.uploading?(0,r.KQ)("action_bar.form.submit_button.pending.upload"):this.create?(0,r.KQ)("action_bar.form.submit_button.create"):(0,r.KQ)("action_bar.form.submit_button.update")}},methods:{handleSubmitClicked:function(){this.$emit("submit")},handleDeleteClicked:function(){this.deleteFocused||this.hasDeleteConfirmation?this.$emit("delete"):this.deleteFocused=!0},handleCancelClicked:function(){this.$emit("cancel")}}},wl=(0,dt.Z)(gl,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ActionBar",{scopedSlots:t._u([{key:"left",fn:function(){return[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"light",large:"",outline:""},on:{click:t.handleCancelClicked}},[t.showBackButton?[t._v("\n "+t._s(t.l("action_bar.form.back_button"))+"\n ")]:[t._v("\n "+t._s(t.l("action_bar.form.cancel_button"))+"\n ")]],2)],1),t._v(" "),t.showDeleteButton?[n("div",{staticClass:"col-auto"},[t.deleteFocused?[n("Button",{attrs:{variant:"danger",disabled:t.loading,large:""},on:{click:t.handleDeleteClicked,blur:function(e){t.deleteFocused=!1}}},[t._v("\n "+t._s(t.l("action_bar.form.delete_button"))+"\n ")])]:[n("Button",{staticClass:"px-3",attrs:{variant:"light",disabled:t.loading,large:"",outline:""},on:{click:t.handleDeleteClicked}},[n("svg",{attrs:{width:"1.125em",height:"1.125em",viewBox:"0 0 16 24","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M4 0h8v2H4zM0 3v4h1v17h14V7h1V3H0zm13 18H3V8h10v13z"}}),t._v(" "),n("path",{attrs:{d:"M5 10h2v9H5zm4 0h2v9H9z"}})])])]],2)]:t._e()],2)]},proxy:!0},{key:"right",fn:function(){return[t.showSubmitButton?[n("Button",{attrs:{variant:"light",large:"",disabled:t.uploading||t.loading},on:{click:t.handleSubmitClicked}},[t._v("\n "+t._s(t.submitLabel)+"\n ")])]:t._e()]},proxy:!0},{key:"extras",fn:function(){return[t.showBreadcrumb?[n("Breadcrumb",{attrs:{items:t.breadcrumb}})]:t._e()]},proxy:!0}])})}),[],!1,null,null,null).exports,_l={components:{Form:ia,ActionBarForm:wl},data:function(){return{form:null}},computed:{entityKey:function(){return this.$route.params.entityKey},instanceId:function(){return this.$route.params.instanceId}},methods:{handleError:function(t){this.$emit("error",t)},handleFormUpdated:function(t){this.updateDocumentTitle(t)},updateDocumentTitle:function(t){var e,n,r=null===(e=t.breadcrumb)||void 0===e||null===(n=e.items[t.breadcrumb.items.length-1])||void 0===n?void 0:n.documentTitleLabel;r&&(document.title="".concat(r,", ").concat(document.title))}}},Ol=[{name:"form",path:"/(.*)?/s-form/:entityKey/:instanceId?",component:(0,dt.Z)(_l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"FormPage"},[n("div",{staticClass:"container"},[n("Form",{attrs:{form:t.form,"entity-key":t.entityKey,"instance-id":t.instanceId},on:{"update:form":[function(e){t.form=e},t.handleFormUpdated],error:t.handleError},scopedSlots:t._u([{key:"action-bar",fn:function(e){var r=e.props,i=e.listeners;return[n("ActionBarForm",t._g(t._b({},"ActionBarForm",r,!1),i))]}}])})],1)])}),[],!1,null,null,null).exports}];function Sl(t,e){var n=e.router;e.store;t.component("FieldDisplay",yl),n.addRoutes(Ol)}},50779:function(t,e,n){n.d(e,{ol:function(){return f},aG:function(){return p},zx:function(){return v},Cd:function(){return y},FR:function(){return F},UQ:function(){return P},Lt:function(){return z},hP:function(){return N},u2:function(){return U},Mc:function(){return W},rj:function(){return X},gb:function(){return rt},fz:function(){return ot},u_:function(){return ut},Qm:function(){return dt},J:function(){return yt},LY:function(){return w},yV:function(){return S},HN:function(){return _t},xc:function(){return St},WD:function(){return Tt},u:function(){return Kt},ZP:function(){return Rt},tL:function(){return u},Eb:function(){return l}});var r=n(87757),i=n.n(r);function o(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function l(t){o(a,r,i,l,s,"next",t)}function s(t){o(a,r,i,l,s,"throw",t)}l(void 0)}))}}function l(t){return s.apply(this,arguments)}function s(){return(s=a(i().mark((function t(e){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){return setTimeout(t,10)}));case 2:n=e.$el.querySelector(".multiselect__content"),(r=n.getBoundingClientRect()).bottom>window.innerHeight&&window.scrollBy({top:r.bottom-window.innerHeight+20,behavior:"smooth"});case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(){var t=document.documentElement.style.getPropertyValue("--navbar-height");return parseInt(t)||0}var c={name:"SharpActionBar",props:{container:Boolean},computed:{hasExtras:function(){return this.$slots.extras||this.$slots["extras-right"]}},methods:{layout:function(t){document.documentElement.style.setProperty("--navbar-height","".concat(t.height,"px"))}},mounted:function(){var t=this;this.layout(this.$refs.bar.getBoundingClientRect()),window.ResizeObserver&&new ResizeObserver((function(e){t.layout(e[0].target.getBoundingClientRect())})).observe(this.$refs.bar)}},d=n(51900),f=(0,d.Z)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpActionBar"},[n("div",{ref:"bar",staticClass:"SharpActionBar__bar sticky-top"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row align-items-center g-2 gx-md-4"},[n("div",{staticClass:"col SharpActionBar__col--left",staticStyle:{"min-width":"0"}},[t._t("left")],2),t._v(" "),n("div",{staticClass:"col-auto SharpActionBar__col--right"},[t._t("right")],2)])])]),t._v(" "),t.hasExtras?[n("div",{class:{container:t.container}},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm"},[n("div",{staticClass:"SharpActionBar__extras"},[t._t("extras")],2)]),t._v(" "),t.$slots["extras-right"]?[n("div",{staticClass:"col-sm-auto"},[n("div",{staticClass:"SharpActionBar__extras"},[t._t("extras-right")],2)])]:t._e()],2)])]:t._e()],2)}),[],!1,null,null,null).exports,h={props:{items:Array},computed:{icon:function(){var t;return null===(t=this.$store.state.currentEntity)||void 0===t?void 0:t.icon}},methods:{isActive:function(t){return t===this.items.length-1}}},p=(0,d.Z)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"d-flex"},[n("div",{staticClass:"input-group input-group-sm w-auto"},[t.icon?[n("div",{staticClass:"input-group-text"},[n("i",{staticClass:"fa fa-sm",class:t.icon,staticStyle:{opacity:".75","font-size":".75rem"}})])]:t._e(),t._v(" "),n("div",{staticClass:"form-control"},[n("div",{staticClass:"breadcrumb p-0 m-0"},[t._l(t.items,(function(e,r){return[n("div",{staticClass:"breadcrumb-item",class:{active:t.isActive(r)}},[t.isActive(r)?[n("span",[t._v(t._s(e.name))])]:[n("a",{attrs:{href:e.url}},[t._v(t._s(e.name))])]],2)]}))],2)])],2)])}),[],!1,null,null,null).exports,m={props:{variant:{type:String,default:"primary"},text:Boolean,outline:Boolean,small:Boolean,large:Boolean,active:Boolean,block:Boolean,href:String,disabled:Boolean},computed:{variantClass:function(){return!this.hasTextStyle&&this.variant?"btn".concat(this.outline?"-outline":"","-").concat(this.variant):null},classes:function(){return[this.variantClass,{"btn-sm":this.small,"btn-lg":this.large,"btn-text":this.hasTextStyle,"btn-block":this.block,active:this.active,disabled:this.disabled}]},hasTextStyle:function(){return!0===this.text},tag:function(){return this.href?"a":"button"}},methods:{focus:function(){this.$el.focus()}}},v=(0,d.Z)(m,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.tag,t._g({tag:"component",staticClass:"SharpButton btn",class:t.classes,attrs:{href:t.href,disabled:t.disabled}},t.$listeners),[t._t("default")],2)}),[],!1,null,null,null).exports,b={props:{formControl:{type:Boolean,default:!0}},computed:{classes:function(){return{"SharpClearButton--form-control":this.formControl}}},methods:{click:function(){this.$el.click()}}},y=(0,d.Z)(b,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",t._g({staticClass:"SharpClearButton btn",class:t.classes,attrs:{type:"button"}},t.$listeners),[n("svg",{staticClass:"SharpClearButton__icon",attrs:{"aria-label":"close",width:"10",height:"10",viewBox:"0 0 10 10","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M9.8 8.6L8.4 10 5 6.4 1.4 10 0 8.6 3.6 5 .1 1.4 1.5 0 5 3.6 8.6 0 10 1.4 6.4 5z"}})])])}),[],!1,null,null,null).exports,g={name:"SharpNavItem",props:{current:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},href:String,target:String,linkClass:String}},w=(0,d.Z)(g,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"SharpLeftNav__item",class:{"SharpLeftNav__item--active":t.current,"SharpLeftNav__item--disabled":t.disabled},attrs:{role:"menuitem"}},[t.disabled?[n("span",{staticClass:"SharpLeftNav__item-link",class:t.linkClass},[t._t("default")],2)]:[n("a",{staticClass:"SharpLeftNav__item-link",class:t.linkClass,attrs:{href:t.href,target:t.target}},[t._t("default")],2)]],2)}),[],!1,null,null,null).exports,_={components:{BCollapse:n(11688).k},props:{label:String,opened:Boolean,collapsible:Boolean},data:function(){return{expanded:this.opened||!this.collapsible}},methods:{toggle:function(){this.collapsible&&(this.expanded=!this.expanded)}}},O=(0,d.Z)(_,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"SharpLeftNav__item SharpLeftNav__item--has-children",class:{"SharpLeftNav__item--expanded":t.expanded,"SharpLeftNav__item--disabled":!t.collapsible}},[n("div",{staticClass:"SharpLeftNav__item-link",attrs:{tabindex:t.collapsible?"0":"-1"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toggle.apply(null,arguments)},click:t.toggle}},[n("div",{staticClass:"row gx-2 align-items-center flex-nowrap"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[t._t("label",(function(){return[t._v("\n "+t._s(t.label)+"\n ")]}))],2),t._v(" "),t.collapsible?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpLeftNav__item-icon"},[n("svg",{staticClass:"SharpLeftNav__icon",attrs:{width:"10",height:"5",viewBox:"0 0 10 5","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M10 0L5 5 0 0z"}})])])])]:t._e()],2)]),t._v(" "),n("b-collapse",{attrs:{visible:t.expanded}},[n("ul",{staticClass:"SharpLeftNav__list SharpLeftNav__list--nested",attrs:{role:"menu","aria-hidden":"true"}},[t._t("default")],2)])],1)}),[],!1,null,null,null),S=O.exports,C={name:"SharpPagination",inheritAttrs:!1,components:{BPagination:n(61081).c},props:{totalRows:Number,perPage:Number,minPageEndButtons:{type:Number,default:0}},computed:{hideGotoEndButtons:function(){return Math.ceil(this.totalRows/Math.max(this.perPage,1))t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1},draggableOptions:function(){return{disabled:!this.reorderActive}},currentItems:function(){return this.reorderActive?this.reorderedItems:this.items},isEmpty:function(){return 0===(this.items||[]).length},styles:function(){return{"--append-width":this.appendWidth?"".concat(this.appendWidth,"px"):null}}},methods:{handleItemsChanged:function(t){this.reorderedItems=t,this.$emit("change",t)},handleSortClicked:function(t){this.$emit("sort-change",{prop:t,dir:this.sort===t&&"asc"===this.dir?"desc":"asc"})},handlePageChanged:function(t){this.$emit("page-change",t)},handleReorderActiveChanged:function(t){this.reorderedItems=t?E(this.items):null},getAppendWidth:function(t){if(!t)return 0;var e=t.querySelector(".SharpDataList__row-append");return e?e.offsetWidth:0},updateLayout:function(){var t,e=this;return(t=i().mark((function t(){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.appendWidth=0,t.next=3,e.$nextTick();case 3:n=e.getAppendWidth(e.$refs.head),r=e.getAppendWidth(e.$refs.body),e.appendWidth=Math.max(n,r);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){A(o,r,i,a,l,"next",t)}function l(t){A(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},mounted:function(){this.updateLayout(),window.addEventListener("resize",this.updateLayout)},destroyed:function(){window.removeEventListener("resize",this.updateLayout)}},B=I,F=(0,d.Z)(B,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpDataList",class:{"SharpDataList--reordering":t.reorderActive},style:t.styles},[t.isEmpty?[n("div",{staticClass:"SharpDataList__empty p-3"},[t._t("empty"),t._v(" "),t._t("append-body")],2)]:[t.$slots["append-head"]?[n("div",{staticClass:"d-flex justify-content-end mb-3 d-sm-none"},[t._t("append-head")],2)]:t._e(),t._v(" "),n("div",{staticClass:"SharpDataList__table SharpDataList__table--border"},[t.hideHeader?t._e():[n("div",{ref:"head",staticClass:"SharpDataList__thead"},[n("DataListRow",{attrs:{columns:t.columns,header:""},scopedSlots:t._u([{key:"cell",fn:function(e){var r=e.column;return[n("div",{staticClass:"row"},[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"row align-items-center gx-2"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("div",{staticClass:"overflow-hidden"},[t._v("\n "+t._s(r.label)+"\n ")])]),t._v(" "),r.sortable?[n("div",{staticClass:"col-auto"},[n("svg",{staticClass:"SharpDataList__caret",class:{"SharpDataList__caret--selected":t.sort===r.key,"SharpDataList__caret--ascending":t.sort===r.key&&"asc"===t.dir},attrs:{width:"10",height:"5",viewBox:"0 0 10 5","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M10 0L5 5 0 0z"}})]),t._v(" "),n("a",{staticClass:"SharpDataList__sort-link",attrs:{href:""},on:{click:function(e){return e.preventDefault(),t.handleSortClicked(r.key)}}})])]:t._e()],2)])])]}},t.$slots["append-head"]?{key:"append",fn:function(){return[t._t("append-head")]},proxy:!0}:null],null,!0)})],1)],t._v(" "),n("div",{ref:"body",staticClass:"SharpDataList__tbody"},[n("Draggable",{attrs:{options:t.draggableOptions,value:t.reorderedItems},on:{input:t.handleItemsChanged}},[t._l(t.currentItems,(function(e){return[t._t("item",(function(){return[n("DataListRow",{attrs:{columns:t.columns,row:e}})]}),{item:e})]}))],2),t._v(" "),t._t("append-body")],2)],2)],t._v(" "),t.hasPagination?[n("div",{staticClass:"SharpDataList__pagination-container"},[n("Pagination",{attrs:{"total-rows":t.totalCount,"per-page":t.pageSize,"min-page-end-buttons":3,limit:7,value:t.page},on:{change:t.handlePageChanged}})],1)]:t._e()],2)}),[],!1,null,null,null).exports;function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0}},methods:{handleValueChanged:function(t){this.search=t},handleClearButtonClicked:function(){this.search="",this.$emit("submit",""),this.$emit("clear"),this.$refs.input.focus()},handleFocused:function(){this.$emit("focus")},handleBlur:function(){this.$emit("blur")},handleFocusout:function(t){t.relatedTarget&&this.$el.contains(t.relatedTarget)||(this.search=this.value)},handleSubmitted:function(){this.$emit("submit",this.search)}}},wt=(0,d.Z)(gt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpSearch",attrs:{role:"search"}},[n("form",{staticClass:"h-100",on:{submit:function(e){return e.preventDefault(),t.handleSubmitted.apply(null,arguments)}}},[n("label",{staticClass:"SharpSearch__label visually-hidden",attrs:{id:"ab-search-label",for:"ab-search-input"}},[t._v(t._s(t.placeholder))]),t._v(" "),n("div",{staticClass:"input-group input-group-sm flex-nowrap"},[n("div",{staticClass:"position-relative flex-fill",staticStyle:{"min-width":"0"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],ref:"input",staticClass:"SharpSearch__input form-control form-control-sm",attrs:{placeholder:t.placeholder,disabled:t.disabled,type:"text",id:"ab-search-input",role:"search","aria-labelledby":"ab-search-label"},domProps:{value:t.search},on:{focus:t.handleFocused,blur:t.handleBlur,focusout:t.handleFocusout,input:function(e){e.target.composing||(t.search=e.target.value)}}}),t._v(" "),n("button",{staticClass:"btn btn-sm SharpSearch__clear h-100 d-inline-flex align-items-center position-absolute",class:{invisible:!t.clearVisible},attrs:{type:"button","aria-label":"Clear search"},on:{click:t.handleClearButtonClicked}},[n("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm3.5 10.1l-1.4 1.4L8 9.4l-2.1 2.1-1.4-1.4L6.6 8 4.5 5.9l1.4-1.4L8 6.6l2.1-2.1 1.4 1.4L9.4 8l2.1 2.1z"}})])])]),t._v(" "),n("button",{staticClass:"btn btn-sm btn-outline-primary SharpSearch__button"},[n("svg",{staticClass:"align-middle",attrs:{width:"1.25em",height:"1.25em",viewBox:"0 0 16 16","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M6 2c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zm0-2C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM16 13.8L13.8 16l-3.6-3.6 2.2-2.2z"}}),t._v(" "),n("path",{attrs:{d:"M16 13.8L13.8 16l-3.6-3.6 2.2-2.2z"}})])])])])])}),[],!1,null,null,null),_t=wt.exports,Ot={name:"SharpStateIcon",props:{color:{required:!0,type:String}},computed:{style:function(){return{background:this.color}}}},St=(0,d.Z)(Ot,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"StateIcon",style:t.style})}),[],!1,null,null,null).exports;function Ct(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var jt={name:"SharpTab",components:{BTab:n(51015).L},provide:function(){return{$tab:this}},props:{title:String,active:Boolean},data:function(){return{errors:{}}},computed:{hasError:function(){return Object.keys(this.errors).length>0},classes:function(){return{"is-invalid":this.hasError}}},methods:{setError:function(t){this.$set(this.errors,t,!0)},clearError:function(t){this.$delete(this.errors,t)},handleActiveChanged:function(t){var e,n=this;return(e=i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return e.next=3,n.$nextTick();case 3:n.$emit("active");case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){Ct(o,r,i,a,l,"next",t)}function l(t){Ct(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){var t=this;this.$on("error",(function(e){return t.setError(e)})),this.$on("clear",(function(e){return t.clearError(e)}))}},xt=jt,kt=(0,d.Z)(xt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("b-tab",{attrs:{"title-link-class":t.classes,active:t.active},on:{"update:active":t.handleActiveChanged},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n "+t._s(t.title)+"\n ")]},proxy:!0}])},[t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports,Pt={name:"SharpTabs",components:{BTabs:n(21247).M},computed:{dropdownButtonClasses:function(){return this.tabs[this.currentTab].hasError?"error-dot":this.tabsHaveError?"error-dot--partial":""}}},Dt=(0,d.Z)(Pt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-tabs",{staticClass:"SharpTabs",attrs:{"nav-class":"SharpTabs__nav mb-4 align-items-center",pills:""},scopedSlots:t._u([{key:"tabs-start",fn:function(){return[n("li",{staticClass:"nav-item me-sm-auto"},[t._t("nav-prepend")],2)]},proxy:!0},{key:"tabs-end",fn:function(){return[n("li",{staticClass:"ms-auto"})]},proxy:!0}],null,!0)},[t._v(" "),t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports;function At(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Et(t){for(var e=1;e1}},methods:{isActive:function(t){return this.$route.query.tab===It(t.title)},handleTabActivated:function(t){this.$router.replace({query:Et(Et({},this.$route.query),{},{tab:It(t.title)})})}}},Ft=Bt,$t=(0,d.Z)(Ft,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpTabbedLayout"},[t.showTabs?[n("Tabs",{scopedSlots:t._u([{key:"nav-prepend",fn:function(){return[t._t("nav-prepend")]},proxy:!0}],null,!0)},[t._v(" "),t._l(t.layout.tabs,(function(e,r){return[n("Tab",{key:"tab-"+r,attrs:{title:e.title,active:t.isActive(e)},on:{active:function(n){return t.handleTabActivated(e)}}},[t._t("default",null,{tab:e})],2)]}))],2)]:[t.$slots["nav-prepend"]?[n("div",{staticClass:"my-4"},[t._t("nav-prepend")],2)]:t._e(),t._v(" "),n("div",{staticClass:"tab-pane"},[t._l(t.layout.tabs,(function(e){return[t._t("default",null,{tab:e}),t._v(" "),n("hr",{staticClass:"SharpTabbedLayout__divider"})]}))],2)]],2)}),[],!1,null,null,null),Tt=$t.exports;function Mt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var Vt={components:{BTooltip:n(49845).T},props:{target:Function,triggers:String,placement:String,overflowOnly:Boolean,disabled:Boolean},data:function(){return{isOverflowing:!1}},computed:{isEnabled:function(){return!this.disabled&&(!this.overflowOnly||this.isOverflowing)}},methods:{layout:function(t){this.isOverflowing=t.scrollWidth>t.offsetWidth},getTarget:function(){return this.target()}},mounted:function(){var t,e=this;return(t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:n=e.getTarget(),e.layout(n),"ResizeObserver"in window&&(e.observer=new ResizeObserver((function(){return e.layout(n)})),e.observer.observe(n));case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Mt(o,r,i,a,l,"next",t)}function l(t){Mt(o,r,i,a,l,"throw",t)}a(void 0)}))})()},beforeDestroy:function(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}},zt=Vt,Kt=(0,d.Z)(zt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("b-tooltip",{attrs:{target:t.target,triggers:t.triggers,placement:t.placement,disabled:!t.isEnabled}},[t._t("default")],2)}),[],!1,null,null,null).exports;function Rt(t,e){e.store,e.router;t.component("sharp-dropdown",z),t.component("sharp-dropdown-item",N)}},86831:function(t,e,n){n.d(e,{hi:function(){return D},JW:function(){return E},LC:function(){return A},e$:function(){return C},Qj:function(){return L},gU:function(){return j}});var r=n(9669),i=n.n(r),o=n(4372),a=n.n(o),l=n(4786),s=n(80129),u=n.n(s);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.params;return D.getUri({url:"".concat(l.v,"/").concat(t.replace(/^\//,"")),params:n})}function L(){return a().read("XSRF-TOKEN")}},66418:function(t,e,n){n.d(e,{e:function(){return l},u:function(){return h}});function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n'.concat(null!==(t=this.template)&&void 0!==t?t:"",""),props:[].concat(r(this.templateProps||[]),r(Object.keys(null!==(e=this.templateData)&&void 0!==e?e:{}))),mounted:function(){var t,e,n,r=!(null!==(t=this.$el.children)&&void 0!==t&&t.length||null!==(e=this.$el.innerText)&&void 0!==e&&e.trim());this.$emit("content-change",{isEmpty:r}),(null===(n=this.$el.children)||void 0===n?void 0:n.length)>0&&this.$el.classList.add("SharpTemplate--has-children")}}}}},a=n(51900),l=(0,a.Z)(o,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._g(t._b({tag:"component"},"component",t.templateData,!1),t.$listeners),[t._t("default")],2)}),[],!1,null,null,null).exports,s={props:{name:String}},u=n(93379),c=n.n(u),d=n(27531),f={insert:"head",singleton:!1},h=(c()(d.Z,f),d.Z.locals,(0,a.Z)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"unknown-field"},[n("span",[t._v("Unknown field «"+t._s(t.name)+"»")])])}),[],!1,null,"d6c36028",null).exports)},4786:function(t,e,n){n.d(e,{IW:function(){return a},_n:function(){return i},v:function(){return o}});var r,i=(r=document.head.querySelector("meta[name=base-url]"))?"/".concat(r.content):"/sharp",o="".concat(i,"/api"),a="".concat(o,"/upload")},37400:function(t,e,n){function r(t,e,n){var r=e.value;!n.children.length||n.children.every((function(t){return function(t){return t.text?0===t.text.trim().length:t.elm instanceof HTMLElement?"none"===t.elm.style.display:!t.tag}(t)}))?t.classList.add(r):t.classList.remove(r)}n.d(e,{tl:function(){return i},CA:function(){return c}});var i={inserted:r,componentUpdated:r},o=n(23493),a=n.n(o);function l(t,e){for(var n=0;nthis.sentinel.getBoundingClientRect().top),e&&this.el.style.setProperty("--sticky-offset","".concat(t.top-e.getBoundingClientRect().top,"px"))}}},{key:"setStuck",value:function(t){this.el.classList.toggle("stuck",t),this.el.dispatchEvent(new CustomEvent("sticky-change",{detail:t}))}}])&&l(e.prototype,n),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),c={inserted:function(t,e){var n=e.value,r=e.expression;!n&&r||(t._stickyObserver=new u(t))},update:function(t,e){var n;e.value&&!t._stickyObserver&&(t._stickyObserver=new u(t)),null===(n=t._stickyObserver)||void 0===n||n.refresh()},unbind:function(t){var e;null===(e=t._stickyObserver)||void 0===e||e.destroy()}}},24903:function(t,e,n){n.d(e,{_n:function(){return _._n},IW:function(){return _.IW},hi:function(){return r.hi},JW:function(){return r.JW},eH:function(){return C},Q6:function(){return w},iW:function(){return T},Z_:function(){return S},e$:function(){return r.e$},Ki:function(){return B},Qj:function(){return r.Qj},gU:function(){return r.gU},Gh:function(){return E.G},U1:function(){return F},X0:function(){return D},KQ:function(){return i.K},cM:function(){return p},H:function(){return v},Vz:function(){return f.Vz},vW:function(){return A},yC:function(){return d},uN:function(){return f.uN},wp:function(){return O.wp},i0:function(){return O.i0},AU:function(){return M},ZK:function(){return m},h3:function(){return I}});var r=n(86831),i=n(16114),o=n(21057),a=n.n(o);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.searchKeys,i=new(a())(t,s(s({},c),{},{keys:r}));return i.search(e)}var f=n(88264);function h(t){return"SHARP : ".concat(t)}function p(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"sm";return{data:function(){return{isViewportSmall:!1}},methods:{$_responsiveUpdate:function(){var t=this.$_testElm.offsetWidth;this.isViewportSmall=!!t}},created:function(){var e="viewport-down-".concat(t);this.$_testElm=document.getElementById(e),this.$_testElm||(this.$_testElm=document.createElement("div"),this.$_testElm.id=e,this.$_testElm.classList.add("d-".concat(t,"-none")),document.body.appendChild(this.$_testElm)),this.$_responsiveUpdate(),this.$_debouncedRespnsiveUpdate=u()(this.$_responsiveUpdate,300),window.addEventListener("resize",this.$_debouncedRespnsiveUpdate)},destroyed:function(){window.removeEventListener("resize",this.$_debouncedRespnsiveUpdate)}}}var d={mixins:[r],props:{configIdentifier:{type:String,required:!0}},computed:{mergedConfigIdentifier:function(){return this.getMergedIdentifier("mergedConfigIdentifier",this.configIdentifier)}}},f=n(79226),h={mixins:[{inject:["axiosInstance"],methods:{showLoading:function(){this.$store.dispatch("setLoading",!0)},hideLoading:function(){this.$store.dispatch("setLoading",!1)},installInterceptors:function(){var t=this;this.axiosInstance.interceptors.request.use((function(e){return t.showLoading(),e}),(function(t){return Promise.reject(t)})),this.axiosInstance.interceptors.response.use((function(e){return t.hideLoading(),e}),(function(e){return t.hideLoading(),Promise.reject(e)}))}},created:function(){this.synchronous||(this.installInterceptors(),this.showLoading())}}],inject:["axiosInstance"],data:function(){return{data:null,layout:null}},methods:{get:function(){var t=this;return this.axiosInstance.get(this.apiPath,{params:this.apiParams}).then((function(e){return t.mount(e.data),(0,f.G)(e.data.notifications),Promise.resolve(e)}))},post:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.apiPath,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.data,n=arguments.length>2?arguments[2]:void 0;return this.axiosInstance.post(t,e,n)}}},p=n(87757),m=n.n(p),v=n(25025),b=n(4935);function y(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){y(o,r,i,a,l,"next",t)}function l(t){y(o,r,i,a,l,"throw",t)}a(void 0)}))}}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=e.append,r=s().resolve(t),i=r.href,o=r.route;if(n){var a=s().currentRoute.path.replace(/\/$/,""),l=s().resolve(a+o.fullPath);i=l.href}return i}function c(){if(document.referrer){var t=new URL(document.referrer);if(t.origin===location.origin)return s().resolve(t.pathname+t.search).route}}},95164:function(t,e,n){n(74577),n(3758),n(3573),n(68965),n(15634),n(76554),n(81817),n(61357),n(19266),n(88188);var r=n(70538),i=n(20629),o=n(78345),a=n(36292),l=n(14765),s=n.n(l),u=n(50779),c=n(95003),d={components:{Modal:u.u_,Form:c.l0,LoadingOverlay:u.fz},props:{command:Object,entityKey:String,instanceId:[Number,String],loading:Boolean},data:function(){return{visible:!1}},watch:{command:function(t){this.visible=!(null==t||!t.form)}},computed:{title:function(){var t,e,n;return null!==(t=null===(e=this.command)||void 0===e?void 0:e.modal_title)&&void 0!==t?t:null===(n=this.command)||void 0===n?void 0:n.label},confirmLabel:function(){var t;return null===(t=this.command)||void 0===t?void 0:t.modal_confirm_label}},methods:{submit:function(){var t;return(t=this.$refs.form).submit.apply(t,arguments)},handleSubmitButtonClicked:function(t){t.preventDefault(),this.$emit("submit",this)},handleClosed:function(){this.$emit("close")},handleLoadingChanged:function(t){this.$emit("update:loading",t)}}},f=d,h=n(51900),p=(0,h.Z)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Modal",{attrs:{"modal-class":"form-modal",visible:t.visible,loading:t.loading,title:t.title,"ok-title":t.confirmLabel},on:{"update:visible":function(e){t.visible=e},ok:t.handleSubmitButtonClicked,hidden:t.handleClosed}},[n("transition",[t.visible?[n("Form",{ref:"form",staticStyle:{"transition-duration":"300ms"},attrs:{"entity-key":t.entityKey,"instance-id":t.instanceId,form:t.command.form,"show-alert":!1,independant:"","ignore-authorizations":""},on:{loading:t.handleLoadingChanged}})]:t._e()],2)],1)}),[],!1,null,null,null).exports,m={name:"SharpCommandsDropdown",components:{Dropdown:u.Lt,DropdownItem:u.hP,DropdownSeparator:u.u2},props:{commands:{type:Array},small:{type:Boolean,default:!0},hasState:Boolean},computed:{commandGroups:function(){return this.commands.filter((function(t){return t.length>0}))},classes:function(){return{"SharpCommandsDropdown--has-state":this.hasState}}},methods:{handleCommandClicked:function(t){this.$emit("select",t)}}},v=(0,h.Z)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({staticClass:"SharpCommandsDropdown",class:t.classes,attrs:{small:t.small,right:""},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("text")]},proxy:!0}],null,!0)},"Dropdown",t.$attrs,!1),[t._v(" "),t._t("prepend"),t._v(" "),t._l(t.commandGroups,(function(e,r){return[r>0?[n("DropdownSeparator")]:t._e(),t._v(" "),t._l(e,(function(e){return[n("DropdownItem",{key:e.key,on:{click:function(n){return t.handleCommandClicked(e)}}},[t._v("\n "+t._s(e.label)+"\n "),e.description?[n("div",{staticClass:"SharpCommandsDropdown__description"},[t._v("\n "+t._s(e.description)+"\n ")])]:t._e()],2)]}))]}))],2)}),[],!1,null,null,null).exports,b={name:"SharpViewPanel",props:{content:String},computed:{visible:function(){return!!this.content}},methods:{handleBackdropClicked:function(){this.$emit("close")}},directives:{srcdoc:{inserted:function(t,e){var n=e.value;t.contentWindow.document.write(n)}}}},y=b,g=(0,h.Z)(y,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"SharpViewPanel__glasspane",on:{click:t.handleBackdropClicked}}),t._v(" "),n("transition",{attrs:{"enter-class":"SharpViewPanel--collapsed","enter-active-class":"SharpViewPanel--expanding","enter-to-class":"SharpViewPanel--expanded","leave-class":"SharpViewPanel--expanded","leave-active-class":"SharpViewPanel--collapsing","leave-to-class":"SharpViewPanel--collapsed"}},[t.visible?[n("div",{staticClass:"SharpViewPanel"},[n("iframe",{directives:[{name:"srcdoc",rawName:"v-srcdoc",value:t.content,expression:"content"}],attrs:{src:"about:blank",sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-downloads"}})])]:t._e()],2)],1)}),[],!1,null,null,null).exports;var w,_,O,S="SET_COMMANDS",C={namespaced:!0,state:{commands:null},mutations:(w={},_=S,O=function(t,e){t.commands=e},_ in w?Object.defineProperty(w,_,{value:O,enumerable:!0,configurable:!0,writable:!0}):w[_]=O,w),getters:{forType:function(t){return function(e){return t.commands?t.commands[e]:null}}},actions:{update:function(t,e){var n=t.commit,r=e.commands;n(S,r)}}};var j=n(87757),x=n.n(j),k=n(24903);function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:function(t){return t};return Object.entries(t).reduce((function(t,n){var r=F(n,2),i=r[0],o=r[1];return I(I({},t),{},B({},z(i),e(o,i)))}),{})}(t,(function(t,n){return e.serializeValue({filter:e.filter(n),value:t})}))}},getValuesFromQuery:function(){return function(t){return function(t){return Object.entries(t||{}).filter((function(t){var e=F(t,1)[0];return V.test(e)})).reduce((function(t,e){var n=F(e,2),r=n[0],i=n[1];return I(I({},t),{},B({},r.replace(V,""),i))}),{})}(t)}},resolveFilterValue:function(t,e){return function(t){var n=t.filter,r=t.value;return null==r?e.defaultValue(n):n.multiple&&!Array.isArray(r)?[r]:"daterange"===n.type?(0,k.Vz)(r):"check"===n.type?"1"===r:r}},serializeValue:function(){return function(t){var e=t.filter,n=t.value;return e?"daterange"===e.type?(0,k.uN)(n):"check"===e.type?n?"1":null:n:n}},nextValues:function(t){return function(e){var n=e.filter,r=e.value;return n.master?H(H({},Object.fromEntries(Object.entries(t.values).map((function(t){var e=K(t,2),n=e[0];e[1];return[n,null]})))),{},U({},n.key,r)):H(H({},t.values),{},U({},n.key,r))}},nextQuery:function(t,e){return function(t){var n=t.filter,r=t.value;return e.getQueryParams(e.nextValues({filter:n,value:r}))}}},actions:{update:function(t,e){var n=t.commit,r=t.dispatch,i=e.filters,o=e.values;return n(Z,i),Promise.all((i||[]).map((function(t){r("setFilterValue",{filter:t,value:(o||{})[t.key]})})))},setFilterValue:function(t,e){var n=t.commit,r=t.getters,i=e.filter,o=e.value;n(q,{key:i.key,value:r.resolveFilterValue({filter:i,value:o})})}}};function W(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var G={namespaced:!0,modules:{filters:Q},actions:{get:function(t){return(e=x().mark((function e(){var n,r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.dispatch,e.next=3,k.hi.get("filters").then((function(t){return t.data}));case 3:r=e.sent,n("filters/update",{filters:r.filters});case 5:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){W(o,r,i,a,l,"next",t)}function l(t){W(o,r,i,a,l,"throw",t)}a(void 0)}))})();var e},post:function(t,e){!function(t){if(null==t)throw new TypeError("Cannot destructure undefined")}(t);var n=e.filter,r=e.value;return function(t){var e=t.filterKey,n=t.value;return k.hi.post("filters/".concat(e),{value:n})}({filterKey:n.key,value:r})}}},Y=n(24877),J={name:"SharpFilterDateRange",components:{DateRange:c.C0,FilterControl:Y.Z},props:{value:{required:!0},required:Boolean,displayFormat:String,mondayFirst:Boolean,disabled:Boolean,label:String},methods:{handleClicked:function(){this.$refs.range.focus()},handleInput:function(t){this.$emit("input",t)}}},X=(0,h.Z)(J,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFilterDateRange"},[n("FilterControl",{attrs:{label:t.label},on:{"label-click":t.handleClicked}},[n("DateRange",{ref:"range",staticClass:"SharpFilterDateRange__field",attrs:{value:t.value,"display-format":t.displayFormat,"monday-first":t.mondayFirst,clearable:!t.required,"read-only":t.disabled,"update-on-input":!1,small:""},on:{input:t.handleInput}})],1)],1)}),[],!1,null,null,null).exports,tt=n(89955),et={props:{filterKey:String,label:String,value:Boolean,disabled:Boolean},computed:{id:function(){return"filter-".concat(this.filterKey)}},methods:{handleChanged:function(t){this.$emit("input",t.target.checked)}}},nt=(0,h.Z)(et,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFilterCheck form-check mt-1 mx-2"},[n("input",{staticClass:"form-check-input",attrs:{id:t.id,type:"checkbox",name:t.filterKey,disabled:t.disabled},domProps:{checked:t.value},on:{change:t.handleChanged}}),t._v(" "),n("label",{staticClass:"ui-font fs-8",attrs:{for:t.id}},[t._v("\n "+t._s(t.label)+"\n ")])])}),[],!1,null,null,null).exports;var rt,it={name:"SharpFilter",props:{filter:{type:Object,required:!0},value:[Object,Array,String,Number],disabled:Boolean},computed:{filterComponent:function(){return"select"===(t=this.filter.type)?tt.Z:"daterange"===t?X:"check"===t?nt:void 0;var t}},methods:{handleInput:function(t){this.$emit("input",t)}}},ot=it,at=(0,h.Z)(ot,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.filterComponent,t._b({tag:"component",attrs:{"filter-key":t.filter.key,value:t.value,disabled:t.disabled},on:{input:t.handleInput}},"component",t.filter,!1))}),[],!1,null,null,null).exports;n(17749);function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;e0}));return{series:n.map((function(t){return t.data[0]})),colors:At(n.map((function(t){return t.color}))),labels:n.map((function(t){var e;return null!==(e=t.label)&&void 0!==e?e:""}))}}(e):void 0;var n,r,i,o,a}var Mt={name:"SharpWidgetChart",props:{display:String,title:String,value:Object,ratioX:Number,ratioY:Number,height:Number,minimal:Boolean,showLegend:{type:Boolean,default:!0},dateLabels:Boolean,options:Object},data:function(){return{zoomed:!1}},computed:{classes:function(){return["SharpWidgetChart--".concat(this.display),{"SharpWidgetChart--aspect-ratio":!this.height}]},style:function(){return{"--ratio-x":this.ratioX,"--ratio-y":this.ratioY}},chartComp:function(){return"line"===(t=this.display)?Lt:"bar"===t?Bt:"pie"===t?$t:void 0;var t},chartData:function(){return Tt(this.display,this.value)},chartOptions:function(){var t,e,n,r,i,o=this;return{chart:{toolbar:{show:this.zoomed},height:null!==(t=this.height)&&void 0!==t?t:"100%",width:"100%",sparkline:{enabled:this.minimal},parentHeightOffset:0,events:{zoomed:function(){o.zoomed=!0}}},xaxis:{type:null!==(e=this.options)&&void 0!==e&&e.horizontal||!this.dateLabels?"category":"datetime"},plotOptions:{bar:{horizontal:!(null===(n=this.options)||void 0===n||!n.horizontal)}},legend:{show:this.showLegend&&!this.minimal},stroke:{curve:null===(r=null===(i=this.options)||void 0===i?void 0:i.curved)||void 0===r||r?"smooth":"straight"}}}}},Vt=(0,h.Z)(Mt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.title?[n("h2",{staticClass:"SharpWidget__title mb-2 mt-3"},[t._v(t._s(t.title))])]:t._e(),t._v(" "),n(t.chartComp,{tag:"component",staticClass:"SharpWidgetChart",class:t.classes,style:t.style,attrs:{"chart-data":t.chartData,options:t.chartOptions}})],2)}),[],!1,null,null,null).exports;function zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e0?{key:"extras",fn:function(){return[n("div",{staticClass:"row mx-n2"},[t._l(t.filters,(function(e){return[n("div",{staticClass:"col-auto px-2"},[n("SharpFilter",{key:e.id,attrs:{filter:e,value:t.filterValue(e.key)},on:{input:function(n){return t.handleFilterChanged(e,n)}}})],1)]}))],2)]},proxy:!0}:null,t.commands.length?{key:"extras-right",fn:function(){return[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("dashboard.commands.dashboard.label"))+"\n ")]},proxy:!0}],null,!1,3867860828)})]},proxy:!0}:null],null,!0)})}),[],!1,null,null,null).exports;function Yt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xt(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},multiforms:function(){return this.forms?Object.values(this.forms):null},canCreate:function(){return this.showCreateButton&&!!this.authorizations.create},canReorder:function(){return this.showReorderButton&&this.config.reorderable&&this.authorizations.update&&this.items.length>1},canSearch:function(){return this.showSearchField&&!!this.config.searchable},items:function(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.list.items)&&void 0!==t?t:[]},columns:function(){var t=this;return this.layout.map((function(e){return be(be({},e),t.containers[e.key])}))},paginated:function(){return!!this.config.paginated},totalCount:function(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.list.totalCount)&&void 0!==t?t:this.items.length},pageSize:function(){var t;return null===(t=this.data)||void 0===t?void 0:t.list.pageSize},hasActionsColumn:function(){var t=this;return!this.reorderActive&&this.items.some((function(e){return t.instanceHasState(e)||t.instanceHasCommands(e)}))},hasStateOnly:function(){var t=this;return this.items.some((function(e){return!t.instanceHasCommands(e)&&t.instanceHasState(e)&&!t.instanceHasStateAuthorization(e)}))}},methods:{storeGetter:function(t){return this.$store.getters["".concat(this.module,"/").concat(t)]},storeDispatch:function(t,e){return this.$store.dispatch("".concat(this.module,"/").concat(t),e)},handleSearchSubmitted:function(t){this.search=t,this.storeDispatch("setQuery",be(be({},this.query),{},{search:t,page:1}))},handleFilterChanged:function(t,e){this.storeDispatch("setQuery",be(be(be({},this.query),this.filterNextQuery({filter:t,value:e})),{},{page:1}))},handleReorderButtonClicked:function(){this.reorderActive=!this.reorderActive,this.reorderedItems=this.reorderActive?pe(this.items):null,this.$emit("reordering",this.reorderActive)},handleReorderSubmitted:function(){var t=this;return this.storeDispatch("reorder",{instances:this.reorderedItems.map((function(e){return t.instanceId(e)}))}).then((function(){t.data.list.items=pe(t.reorderedItems),t.reorderedItems=null,t.reorderActive=!1,t.$emit("reordering",!1)}))},handleCreateButtonClicked:function(t){var e=t?this.formUrl({formKey:t.key}):this.formUrl();location.href=e},instanceId:function(t){var e=this.config.instanceIdAttribute;return e?t[e]:t.id},instanceState:function(t){if(!this.instanceHasState(t))return null;var e=this.config.state.attribute;return e?t[e]:t.state},instanceHasState:function(t){return!!this.config.state&&this.showEntityState},instanceHasCommands:function(t){return this.instanceCommands(t).flat().length>0},instanceHasStateAuthorization:function(t){if(!this.instanceHasState(t))return!1;var e=this.config.state.authorization,n=this.instanceId(t);return Array.isArray(e)?e.includes(n):!!e},instanceCommands:function(t){var e=this;return(this.config.commands.instance||[]).reduce((function(n,r){return[].concat(pe(n),[r.filter((function(n){return e.isInstanceCommandAllowed(t,n)}))])}),[])},instanceStateOptions:function(t){if(!this.config.state)return null;var e=this.instanceState(t);return this.config.state.values.find((function(t){return t.value===e}))},instanceForm:function(t){var e=this.instanceId(t);return this.multiforms.find((function(t){return t.instances.includes(e)}))},instanceUrl:function(t){var e=this.instanceId(t);if(!this.instanceHasViewAuthorization(t))return null;if(this.hasShowPage)return this.showUrl({instanceId:e});if(this.hasMultiforms){var n=this.instanceForm(t)||{};return this.formUrl({formKey:n.key,instanceId:e})}return this.formUrl({instanceId:e})},instanceHasViewAuthorization:function(t){var e=this.instanceId(t),n=this.authorizations.view;return Array.isArray(n)?n.includes(e):!!n},instanceIsFocused:function(t){var e=this.instanceId(t);return this.focusedItem&&this.focusedItem===e},filterByKey:function(t){return(this.config.filters||[]).find((function(e){return e.key===t}))},setState:function(t,e){var n=this,r=this.instanceId(t);return this.axiosInstance.post("".concat(this.apiPath,"/state/").concat(r),{attribute:this.config.state.attribute,value:e}).then((function(t){var e=t.data;n.handleCommandActionRequested(e.action,e)})).catch((function(t){var e,n,r=null===(e=t.response)||void 0===e?void 0:e.data;422===(null===(n=t.response)||void 0===n?void 0:n.status)&&(0,k.wp)(r.message,{title:(0,k.KQ)("modals.state.422.title"),isError:!0})}))},handleInstanceStateChanged:function(t,e){this.setState(t,e)},handleInstanceCommandRequested:function(t,e){var n=this.instanceId(t);this.handleCommandRequested(e,{instanceId:n})},handleSortChanged:function(t){var e=t.prop,n=t.dir;this.storeDispatch("setQuery",be(be({},this.query),{},{page:1,sort:e,dir:n}))},handleReorderedItemsChanged:function(t){this.reorderedItems=t},handlePageChanged:function(t){this.storeDispatch("setQuery",be(be({},this.query),{},{page:t}))},formUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.formKey,n=t.instanceId;return(0,k.iW)({entityKey:e?"".concat(this.entityKey,":").concat(e):this.entityKey,instanceId:n},{append:!0})},showUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.instanceId;return(0,k.AU)({entityKey:this.entityKey,instanceId:e},{append:!0})},tryParseNumber:function(t){if(Array.isArray(t))return t.map(this.tryParseNumber);var e=Number(t);return isNaN(Number(e))?t:e},filterValueOrDefault:function(t,e){return null!=t&&""!==t?this.tryParseNumber(t):e.default||(e.multiple?[]:null)},showLoading:function(){this.inline||this.$store.dispatch("setLoading",!0)},hideLoading:function(){this.inline||this.$store.dispatch("setLoading",!1)},initCommands:function(){this.addCommandActionHandlers({refresh:this.handleRefreshCommand})},handleCommandRequested:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.instanceId,r=this.commandsQuery,i=this.commandEndpoint(t.key,n);this.currentCommandInstanceId=n,this.sendCommand(t,{postCommand:function(t){return k.hi.post(i,be({query:r},t),{responseType:"blob"})},getForm:function(t){return k.hi.get("".concat(i,"/form"),{params:be(be({},r),t)}).then((function(t){return t.data}))}})},handleRefreshCommand:function(t){var e=this;this.data.list.items=this.items.map((function(n){return r=t.items,i=n,r.find((function(t){return e.instanceId(i)===e.instanceId(t)}))||n;var r,i}))},commandEndpoint:function(t,e){return"".concat(this.apiPath,"/command/").concat(t).concat(e?"/".concat(e):"")},isEntityCommandAllowed:function(t){var e=this.hiddenCommands?this.hiddenCommands.entity:null;return!!t.authorization&&!(e||[]).includes(t.key)},isInstanceCommandAllowed:function(t,e){var n=this.instanceId(t),r=this.hiddenCommands?this.hiddenCommands.instance:null;return(Array.isArray(e.authorization)?e.authorization.includes(n):!!e.authorization)&&!(r||[]).includes(e.key)},mount:function(t){var e,n,r=t.containers,i=t.layout,o=t.data,a=t.fields,l=t.config,s=t.authorizations,u=t.forms;this.containers=r,this.layout=i,this.data=null!=o?o:{},this.fields=null!=a?a:{},this.config=be(be({},l),{},{commands:null!==(e=null==l?void 0:l.commands)&&void 0!==e?e:{},filters:null!==(n=null==l?void 0:l.filters)&&void 0!==n?n:[]}),this.authorizations=s,this.forms=u,this.page=this.data.list.page,!this.sortDir&&(this.sortDir=this.config.defaultSortDir),!this.sortedBy&&(this.sortedBy=this.config.defaultSort)},bindParams:function(t){var e=t.search,n=t.page,r=t.sort,i=t.dir;this.search=e,n&&(this.page=Number(n)),r&&(this.sortedBy=r),i&&(this.sortDir=i)},init:function(){var t,e=this;return(t=x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.visible){t.next=2;break}return t.abrupt("return");case 2:return e.loading=!0,t.next=5,e.storeDispatch("setEntityKey",e.entityKey);case 5:return t.next=7,e.get().catch((function(t){return e.$emit("error",t),Promise.reject(t)}));case 7:return e.bindParams(e.query),t.next=10,e.storeDispatch("update",{config:e.config,filtersValues:e.getFiltersValuesFromQuery(e.query)});case 10:e.$emit("change",{data:e.data,layout:e.layout,config:e.config,containers:e.containers,authorizations:e.authorizations,forms:e.forms}),e.ready=!0,e.loading=!1;case 13:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){he(o,r,i,a,l,"next",t)}function l(t){he(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},beforeMount:function(){this.init(),this.initCommands()}},we=ge,_e=(0,h.Z)(we,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpEntityList",class:t.classes},[t._t("action-bar",null,{props:t.actionBarProps,listeners:t.actionBarListeners}),t._v(" "),t.ready?[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}]},[t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),n("DataList",{attrs:{items:t.items,columns:t.columns,page:t.page,paginated:t.paginated,"total-count":t.totalCount,"page-size":t.pageSize,"reorder-active":t.reorderActive,sort:t.sortedBy,dir:t.sortDir},on:{change:t.handleReorderedItemsChanged,"sort-change":t.handleSortChanged,"page-change":t.handlePageChanged},scopedSlots:t._u([{key:"empty",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.empty_text"))+"\n ")]},proxy:!0},{key:"append-head",fn:function(){return[t.hasEntityCommands?[n("div",{staticClass:"d-flex align-items-center justify-content-end"},[n("CommandsDropdown",{attrs:{commands:t.dropdownEntityCommands,disabled:t.reorderActive},on:{select:t.handleCommandRequested},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.commands.entity.label"))+"\n ")]},proxy:!0}],null,!1,2220987489)})],1)]:t._e()]},proxy:!0},{key:"item",fn:function(e){var r=e.item;return[n("DataListRow",{attrs:{url:t.instanceUrl(r),columns:t.columns,highlight:t.instanceIsFocused(r),row:r},scopedSlots:t._u([t.hasActionsColumn?{key:"append",fn:function(e){return[n("EntityActions",{attrs:{config:t.config,"has-state":t.instanceHasState(r),state:t.instanceState(r),"state-options":t.instanceStateOptions(r),"state-disabled":!t.instanceHasStateAuthorization(r),"has-commands":t.instanceHasCommands(r),commands:t.instanceCommands(r)},on:{command:function(e){return t.handleInstanceCommandRequested(r,e)},"state-change":function(e){return t.handleInstanceStateChanged(r,e)},selecting:function(t){return e.toggleHighlight(t)}}})]}}:null],null,!0)})]}},{key:"append-body",fn:function(){return[t.inline&&t.loading?[n("LoadingOverlay",{attrs:{small:"",absolute:"",fade:""}})]:t._e()]},proxy:!0}],null,!1,2931809364)})],2)]:t.visible&&t.inline?[n("Loading",{attrs:{small:"",fade:""}})]:t._e(),t._v(" "),n("CommandFormModal",t._g(t._b({attrs:{command:t.currentCommand,"entity-key":t.entityKey,"instance-id":t.currentCommandInstanceId}},"CommandFormModal",t.commandFormProps,!1),t.commandFormListeners)),t._v(" "),n("CommandViewPanel",{attrs:{content:t.commandViewContent},on:{close:t.handleCommandViewPanelClosed}})],2)}),[],!1,null,null,null).exports,Oe={components:{Dropdown:u.Lt,DropdownItem:u.hP},props:{forms:Array},computed:{hasIcon:function(){var t;return null===(t=this.forms)||void 0===t?void 0:t.some((function(t){return t.icon}))},visibleForms:function(){var t;return null===(t=this.forms)||void 0===t?void 0:t.filter((function(t){return!!t.label||t.icon}))}},methods:{l:k.KQ,handleSelected:function(t){this.$emit("select",t)}}},Se=(0,h.Z)(Oe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({attrs:{text:t.l("action_bar.list.forms_dropdown")}},"Dropdown",t.$attrs,!1),[t._l(t.visibleForms,(function(e){return[n("DropdownItem",{key:e.key,on:{click:function(n){return t.handleSelected(e)}}},[n("div",{staticClass:"row gx-2 flex-nowrap"},[t.hasIcon?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"fa-fw"},[n("i",{staticClass:"fa",class:e.icon})])])]:t._e(),t._v(" "),n("div",{staticClass:"col"},[t._v("\n "+t._s(e.label)+"\n ")])],2)])]}))],2)}),[],!1,null,null,null).exports,Ce={props:{count:Number,search:String},methods:{lang:k.KQ},computed:{searchLabel:function(){return(0,k.KQ)("action_bar.list.search.title").replace(":search",this.search)}}},je=(0,h.Z)(Ce,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpEntityListTitle"},[n("div",{staticClass:"row align-items-center gx-2 h-100"},[t.$slots.default?[n("div",{staticClass:"col-auto"},[t._t("default")],2)]:t._e(),t._v(" "),t.count?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpEntityListTitle__info"},[n("div",{staticClass:"row",staticStyle:{"--bs-gutter-x":"inherit"}},[t.$slots.default?[n("div",{staticClass:"col-auto"},[t._v("\n •\n ")])]:t._e(),t._v(" "),n("div",{staticClass:"col"},[n("span",{staticClass:"text-nowrap"},[t._v(t._s(t.count)+" "+t._s(t.lang("action_bar.list.items_count")))])])],2)])])]:t._e(),t._v(" "),t.search?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpEntityListTitle__info"},[n("div",{staticClass:"row",staticStyle:{"--bs-gutter-x":"inherit"}},[n("div",{staticClass:"col-auto"},[t._v("\n •\n ")]),t._v(" "),n("div",{staticClass:"col"},[n("span",{staticClass:"text-nowrap"},[t._v(t._s(t.searchLabel))])])])])])]:t._e()],2)])}),[],!1,null,null,null).exports,xe={name:"SharpActionBarList",mixins:[ht.WH],components:{EntityListTitle:je,MultiformDropdown:Se,ActionBar:u.ol,Dropdown:u.Lt,DropdownItem:u.hP,SharpFilter:at,Search:u.HN,Button:u.zx},props:{count:Number,search:String,filters:Array,filtersValues:Object,forms:Array,primaryCommand:Object,canCreate:Boolean,canReorder:Boolean,canSearch:Boolean,reorderActive:Boolean},computed:{hasForms:function(){return this.forms&&this.forms.length>0},currentEntity:function(){return this.$store.state.currentEntity}},methods:{handleSearchSubmitted:function(t){this.$emit("search-submit",t)},handleFilterChanged:function(t,e){this.$emit("filter-change",t,e)},handlePrimaryCommandClicked:function(){this.$emit("command",this.primaryCommand)},handleReorderButtonClicked:function(){this.$emit("reorder-click"),document.activeElement.blur()},handleReorderSubmitButtonClicked:function(){this.$emit("reorder-submit")},handleCreateButtonClicked:function(){this.$emit("create")},handleCreateFormSelected:function(t){this.$emit("create",t)}}},ke=xe;function Pe(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function De(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ae(t){for(var e=1;e0},hasState:function(){return!!this.state},title:function(){var t;return this.breadcrumb&&this.showBreadcrumb?null===(t=this.breadcrumb[this.breadcrumb.length-1])||void 0===t?void 0:t.name:null}},methods:{handleEditButtonClicked:function(){this.$emit("edit")},handleCommandSelected:function(t){this.$emit("command",t)},handleStateChanged:function(t){this.$emit("state-change",t)},handleScroll:function(){this.showTitle=document.querySelector(".ShowPage__content").getBoundingClientRect().top<0}},mounted:function(){window.addEventListener("scroll",this.handleScroll)}},qe=(0,h.Z)(Ze,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ActionBar",{scopedSlots:t._u([{key:"left",fn:function(){return[n("div",{staticClass:"row align-items-center gx-4"},[t.showBackButton?[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{href:t.backUrl,outline:"",variant:"light",large:""}},[t._v("\n "+t._s(t.l("action_bar.show.back_button"))+"\n ")])],1)]:t._e(),t._v(" "),t.title?[n("div",{staticClass:"col d-none d-md-block",staticStyle:{"min-width":"0"}},[n("div",{staticClass:"h5 mb-0 text-truncate",class:{"opacity-0":!t.showTitle},staticStyle:{transition:"opacity .2s ease-in-out"}},[t._v("\n "+t._s(t.title)+"\n ")])])]:t._e()],2)]},proxy:!0},{key:"right",fn:function(){return[t.canEdit?[n("Button",{attrs:{href:t.formUrl,disabled:t.editDisabled,variant:"light",large:""}},[t._v("\n "+t._s(t.l("action_bar.show.edit_button"))+"\n ")])]:t._e()]},proxy:!0},{key:"extras",fn:function(){return[t.showBreadcrumb?[n("Breadcrumb",{attrs:{items:t.breadcrumb}})]:t._e()]},proxy:!0},{key:"extras-right",fn:function(){return[n("div",{staticClass:"row gx-3"},[t.hasState?[n("div",{staticClass:"col-auto"},[n("ModalSelect",{attrs:{title:t.l("modals.entity_state.edit.title"),"ok-title":t.l("modals.entity_state.edit.ok_button"),value:t.state.value,options:t.stateValues,size:"sm"},on:{change:t.handleStateChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.on;return[n("Button",t._g({staticClass:"btn--opacity-1",class:{"dropdown-toggle":t.canChangeState},attrs:{disabled:!t.canChangeState,text:"",small:""}},r),[n("StateIcon",{staticClass:"me-1",staticStyle:{"vertical-align":"-.125em"},attrs:{color:t.state.color}}),t._v(" "),n("span",{staticClass:"text-truncate"},[t._v(t._s(t.state.label))])],1)]}},{key:"item-prepend",fn:function(t){var e=t.option;return[n("StateIcon",{attrs:{color:e.color}})]}}],null,!1,617643985)})],1)]:t._e(),t._v(" "),t.hasCommands?[n("div",{staticClass:"col-auto"},[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.commands.instance.label"))+"\n ")]},proxy:!0}],null,!1,2971469203)})],1)]:t._e()],2)]},proxy:!0}])})}),[],!1,null,null,null).exports,Qe=n(58949),We=n(37400),Ge={mixins:[ht.WH],components:{Search:u.HN,SharpFilter:at,MultiformDropdown:Se,Button:u.zx},props:{ready:Boolean,count:Number,search:String,hasSearchQuery:Boolean,filters:Array,filtersValues:Object,primaryCommand:Object,forms:Array,canCreate:Boolean,canReorder:Boolean,canSearch:Boolean,reorderActive:Boolean,collapsed:Boolean,hasActiveQuery:Boolean,sticky:Boolean},data:function(){return{stuck:!1}},computed:{hasForms:function(){return this.forms&&this.forms.length>0},hasLeftControls:function(){var t;return this.hasActiveQuery||this.count>0&&((null===(t=this.filters)||void 0===t?void 0:t.length)>0||this.canSearch)},hasRightControls:function(){return this.canReorder||this.canCreate||!!this.primaryCommand},hasOuterTitle:function(){return this.$slots.default&&(!this.ready||this.hasLeftControls)},barVisible:function(){return!this.collapsed||!this.hasLeftControls},searchLabel:function(){return(0,k.KQ)("action_bar.list.search.title").replace(":search",this.search)}},methods:{handleSearchSubmitted:function(t){this.$emit("search-submit",t)},handleFilterChanged:function(t,e){this.$emit("filter-change",t,e)},handleReorderButtonClicked:function(){this.$emit("reorder-click"),document.activeElement.blur()},handleReorderSubmitButtonClicked:function(){this.$emit("reorder-submit")},handlePrimaryCommandClicked:function(){this.$emit("command",this.primaryCommand)},handleCreateButtonClicked:function(){this.$emit("create")},handleCreateFormSelected:function(t){this.$emit("create",t)}},directives:{sticky:We.CA}},Ye=Ge,Je=(0,h.Z)(Ye,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"sticky",rawName:"v-sticky",value:t.sticky,expression:"sticky"}],staticClass:"action-bar",class:{"position-sticky":t.sticky},on:{"sticky-change":function(e){t.stuck=e.detail}}},[n("div",{staticClass:"position-relative"},[t.hasOuterTitle?[n("div",{staticClass:"mb-2"},[t._t("default")],2)]:t._e(),t._v(" "),t.ready&&t.barVisible?[n("div",{staticClass:"row align-items-end align-content-end",attrs:{"data-sticky-anchor":""}},[t.hasLeftControls&&!t.stuck?[n("div",{staticClass:"col-sm mb-2"},[n("div",{staticClass:"row gy-1 gx-2 gx-md-3"},[t._l(t.filters,(function(e){return[n("div",{staticClass:"col-auto mb-1"},[n("div",{staticClass:"action-bar__element"},[n("SharpFilter",{key:e.id,staticClass:"h-100",attrs:{filter:e,value:t.filtersValues[e.key],disabled:t.reorderActive},on:{input:function(n){return t.handleFilterChanged(e,n)}}})],1)])]})),t._v(" "),t.canSearch?[n("div",{staticClass:"col-auto mb-1"},[n("div",{staticClass:"action-bar__element"},[n("Search",{staticClass:"h-100",attrs:{value:t.search,placeholder:t.l("action_bar.list.search.placeholder"),disabled:t.reorderActive},on:{submit:t.handleSearchSubmitted}})],1)])]:t._e()],2)])]:[n("div",{staticClass:"col-sm align-self-end"},[t._t("default")],2)],t._v(" "),t.hasRightControls&&!t.collapsed?[n("div",{staticClass:"col-sm-auto mb-2"},[n("div",{staticClass:"row flex-nowrap justify-content-end g-2 gx-md-3"},[t.canReorder?[n("div",{staticClass:"col-auto"},[t.reorderActive?[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{text:""},on:{click:t.handleReorderButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button.cancel"))+"\n ")])],1),t._v(" "),n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"primary"},on:{click:t.handleReorderSubmitButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button.finish"))+"\n ")])],1)])]:[n("Button",{attrs:{text:""},on:{click:t.handleReorderButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button"))+"\n ")])]],2)]:t._e(),t._v(" "),t.primaryCommand&&!t.reorderActive?[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"primary"},on:{click:t.handlePrimaryCommandClicked}},[t._v("\n "+t._s(t.primaryCommand.label)+"\n ")])],1)]:t._e(),t._v(" "),t.canCreate&&!t.reorderActive?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"action-bar__element"},[t.hasForms?[n("MultiformDropdown",{attrs:{forms:t.forms,variant:"primary",right:""},on:{select:t.handleCreateFormSelected}})]:[n("Button",{attrs:{variant:"primary"},on:{click:t.handleCreateButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.create_button"))+"\n ")])]],2)])]:t._e()],2)])]:t._e()],2)]:t._e()],2)])}),[],!1,null,null,null).exports,Xe={props:{label:String}},tn=(0,h.Z)(Xe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.label?[n("div",{staticClass:"show-field__label form-label"},[t._v(t._s(t.label))])]:t._e(),t._v(" "),n("div",{staticClass:"show-field__content"},[t._t("default")],2)],2)}),[],!1,null,null,null).exports;function en(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.lazy;t.$watch(e,(function(e){t.$emit("visible-change",e)}),{immediate:!r})}function nn(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var rn={mixins:[ht.WH],components:{EntityListTitle:je,EntityList:_e,CommandsDropdown:v,ActionBar:Je,FieldLayout:tn},props:{fieldKey:String,entityListKey:String,showCreateButton:Boolean,showReorderButton:Boolean,showSearchField:Boolean,showEntityState:Boolean,showCount:Boolean,hiddenFilters:Object,hiddenCommands:Object,label:String,emptyVisible:Boolean,collapsable:Boolean},data:function(){return{list:null,collapsed:this.collapsable&&!this.getFocusedItem(),focusedItem:this.getFocusedItem(),sticky:!1}},computed:{classes:function(){return{"ShowEntityListField--collapsed":this.collapsed}},storeModule:function(){return"show/entity-lists/".concat(this.fieldKey)},query:function(){return this.storeGetter("query")},filters:function(){return this.storeGetter("filters/filters")},getFiltersQueryParams:function(){return this.storeGetter("filters/getQueryParams")},filtersValues:function(){return this.storeGetter("filters/values")},isVisible:function(){if(this.hasCollapse||this.emptyVisible)return!0;if(this.list){var t,e=this.list,n=e.data,r=e.authorizations;return!!((null===(t=n.list.items)||void 0===t?void 0:t.length)>0||this.showCreateButton&&r.create||this.hasActiveQuery)}},visibleFilters:function(){var t=this;return this.hiddenFilters?this.filters.filter((function(e){return!(e.key in t.hiddenFilters)})):this.filters},hasActiveQuery:function(){var t=this,e=this.visibleFilters.some((function(e){return null!=t.filtersValues[e.key]}));return!!this.query.search||e},hasCollapse:function(){return this.collapsable}},methods:{hasCommands:function(t){return t&&t.some((function(t){return t&&t.length>0}))},storeGetter:function(t){return this.$store.getters["".concat(this.storeModule,"/").concat(t)]},handleChanged:function(t){var e,n=this;return(e=x().mark((function e(){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.list=t,e.next=3,n.$nextTick();case 3:n.layout();case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){nn(o,r,i,a,l,"next",t)}function l(t){nn(o,r,i,a,l,"throw",t)}a(void 0)}))})()},handleDetailsToggle:function(t){this.collapsed=!t.target.open},getFocusedItem:function(){var t=(0,Qe.aE)();if(null!=t&&t.name&&(0,k.eH)(t.params.entityKey,this.entityListKey)&&t.params.instanceId&&t.path.length>this.$route.path.length)return Number(t.params.instanceId)},layout:function(){this.sticky=this.$el.offsetHeight>window.innerHeight-(0,u.tL)()}},created:function(){var t=this,e=this.storeModule.split("/");this.$store.hasModule(e)||this.$store.registerModule(e,se),this.hiddenFilters&&this.$store.dispatch("".concat(this.storeModule,"/setQuery"),this.getFiltersQueryParams(this.hiddenFilters)),en(this,(function(){return t.isVisible}),{lazy:!0})},mounted:function(){var t=this;if(this.focusedItem){var e=this.$el.getBoundingClientRect();window.scrollBy(0,e.top-100)}window.addEventListener("resize",(function(){return t.layout()}))}},on=rn,an=(0,h.Z)(on,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("FieldLayout",{staticClass:"ShowEntityListField",class:t.classes},[n("EntityList",{attrs:{"entity-key":t.entityListKey,module:t.storeModule,"show-create-button":t.showCreateButton,"show-reorder-button":t.showReorderButton,"show-search-field":t.showSearchField,"show-entity-state":t.showEntityState,"hidden-commands":t.hiddenCommands,visible:!t.collapsed,"focused-item":t.focusedItem,inline:""},on:{change:t.handleChanged,reordering:function(e){return t.$emit("reordering",e)}},scopedSlots:t._u([{key:"action-bar",fn:function(e){var r=e.props,i=e.listeners;return[n("ActionBar",t._g(t._b({staticClass:"ShowEntityListField__action-bar",attrs:{collapsed:t.collapsed,filters:t.visibleFilters,"has-active-query":t.hasActiveQuery,sticky:t.sticky}},"ActionBar",r,!1),i),[t.hasCollapse?[n("div",{staticClass:"ShowSection__header ShowSection__header--collapsable position-relative"},[n("div",{staticClass:"row align-items-center gx-0 h-100"},[n("div",{staticClass:"col-auto"},[n("details",{attrs:{open:!t.collapsed},on:{toggle:t.handleDetailsToggle}},[n("summary",{staticClass:"stretched-link"},[n("span",{staticClass:"visually-hidden"},[t._v(t._s(t.label))])])])]),t._v(" "),n("div",{staticClass:"col"},[n("EntityListTitle",{attrs:{count:t.showCount?r.count:null}},[n("h2",{staticClass:"ShowEntityListField__label ShowSection__title mb-0"},[t._v("\n "+t._s(t.label)+"\n ")])])],1)])])]:[n("div",{staticClass:"ShowSection__header d-grid"},[n("EntityListTitle",{attrs:{count:t.showCount?r.count:null}},[n("h2",{staticClass:"ShowEntityListField__label ShowSection__title mb-0"},[t._v("\n "+t._s(t.label)+"\n ")])])],1)]],2)]}}])})],1)}),[],!1,null,null,null).exports,ln=n(15104),sn=n.n(ln);function un(t){return function(t){if(Array.isArray(t))return cn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cn(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n".concat(this.formattedContent,""),components:zn({"x-sharp-file":Ln,"x-sharp-image":Ln,"html-content":Bn},Object.values(null!==(t=this.embeds)&&void 0!==t?t:{}).reduce((function(t,e){return zn(zn({},t),{},Kn({},e.tag,{name:"Embed_".concat((n=e).tag),template:'\n \n \n \n \n \n ',components:{EmbedRenderer:hn.kO},inject:["state"],props:mn({},null===(r=n.attributes)||void 0===r?void 0:r.filter((function(t){return"slot"!==t})).reduce((function(t,e){return mn(mn({},t),{},vn({},e,null))}),{})),data:function(){return{index:0}},computed:{embedOptions:function(){return n},embedData:function(){var t,e=this,r=this.state.embeds[n.key][this.index];return mn(mn({},null===(t=n.attributes)||void 0===t?void 0:t.reduce((function(t,n){return mn(mn({},t),{},vn({},n,(0,hn.ip)(e.$props[n])))}),{})),r)}},created:function(){this.index=this.state.embeds[n.key].length,this.state.embeds[n.key].push(this.embedData),(0,k.U1)(this.embedOptions.tag)}}));var n,r}),{}))}},formattedContent:function(){var t=document.createElement("template");return t.innerHTML=this.content,t.content.querySelectorAll("[data-html-content]").forEach((function(e){var n=document.createElement("html-content");n.setAttribute("content",e.innerHTML.trim()),t.content.insertBefore(n,e),t.content.removeChild(e)})),t.innerHTML}},methods:{init:function(){var t=this;return Mn(x().mark((function e(){var n,r,i;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.$store.getters["show/entityKey"],r=t.$store.getters["show/instanceId"],!((i=t.state.files).length>0)){e.next=7;break}return e.next=6,(0,fn.AZ)({entityKey:n,instanceId:r,files:i,thumbnailWidth:fn.VD,thumbnailHeight:fn.op});case 6:t.state.files=e.sent;case 7:Object.entries(t.state.embeds).filter((function(t){var e=Fn(t,2);e[0];return e[1].length>0})).forEach(function(){var e=Mn(x().mark((function e(i){var o,a,l,s;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Fn(i,2),a=o[0],l=o[1],e.next=3,(0,hn.vI)({entityKey:n,instanceId:r,embedKey:a,embeds:l});case 3:s=e.sent,t.state.embeds=zn(zn({},t.state.embeds),{},Kn({},a,s));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 8:case"end":return e.stop()}}),e)})))()},initState:function(){var t;this.state.files=[],this.state.embeds=Object.fromEntries(Object.entries(null!==(t=this.embeds)&&void 0!==t?t:{}).map((function(t){return[Fn(t,1)[0],[]]})))},handleContentChanged:function(){var t=this;return Mn(x().mark((function e(){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.initState(),e.next=3,t.$nextTick();case 3:return e.next=5,t.init();case 5:case"end":return e.stop()}}),e)})))()}},created:function(){this.initState()},mounted:function(){this.init()}},Nn=Rn,Hn=(0,h.Z)(Nn,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,{tag:"component"})}),[],!1,null,null,null).exports,Un={mixins:[ht.WH],components:{FieldLayout:tn,TextRenderer:Hn},props:{value:[Object,String],collapseToWordCount:Number,label:String,emptyVisible:Boolean,html:Boolean,localized:Boolean,locale:String,embeds:Object},data:function(){return{expanded:!1}},computed:{classes:function(){return{"ShowTextField--html":this.html}},resolvedValue:function(){var t;return this.localized?null===(t=this.value)||void 0===t?void 0:t[this.locale]:this.value},currentContent:function(){return this.resolvedValue?this.hasCollapsed&&!this.expanded?this.collapsedContent:this.html?this.resolvedValue:dn(this.resolvedValue).trim():null},hasCollapsed:function(){return!!this.collapsedContent},collapsedContent:function(){if(!this.collapseToWordCount||!this.value)return null;var t=this.resolvedValue.trim(),e=dn(t),n=this.html?t:e,r=function(t,e){var n=un(t.matchAll(/\S+\s*/g));return n.length>e?n.slice(0,e).map((function(t){return t[0]})).join(""):t}(e,this.collapseToWordCount);return r.lengtht.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},wrapperElement:function(){return this.hasCollapse?"details":"div"}},methods:{lang:k.KQ,handleCommandSelected:function(t){this.$emit("command",t)},handleDetailsToggle:function(t){this.collapsed=!t.target.open}}},fr=(0,h.Z)(dr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ShowSection",class:t.classes},[n("div",{staticClass:"row"},[t.hasCollapse||t.section.title?[n("div",{staticClass:"col"},[t.hasCollapse?[n("details",{attrs:{open:!t.collapsed},on:{toggle:t.handleDetailsToggle}},[n("summary",{staticClass:"ShowSection__header ShowSection__header--collapsable"},[n("h2",{staticClass:"ShowSection__title d-inline-block mb-0"},[t._v(t._s(t.section.title||" "))])])])]:t.section.title?[n("div",{staticClass:"ShowSection__header"},[n("h2",{staticClass:"ShowSection__title"},[t._v(t._s(t.section.title))])])]:t._e()],2)]:t._e(),t._v(" "),t.hasCommands&&!t.collapsed?[n("div",{staticClass:"col-auto align-self-end mb-2"},[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.lang("entity_list.commands.instance.label"))+"\n ")]},proxy:!0}],null,!1,3630638811)})],1)]:t._e()],2),t._v(" "),t.collapsed?t._e():[n("div",{staticClass:"ShowSection__content"},[n("Grid",{staticClass:"ShowSection__grid",attrs:{rows:[t.section.columns],"col-class":function(){return"ShowSection__col"}},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[n("Grid",{staticClass:"ShowPage__fields-grid",attrs:{rows:r.fields,"row-class":t.fieldsRowClass},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.itemLayout;return[t._t("default",null,{fieldLayout:n})]}}],null,!0)})]}}],null,!1,3782670149)})],1)]],2)}),[],!1,null,null,null).exports;function hr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function pr(t){return function(t){if(Array.isArray(t))return mr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},title:function(){var t,e;return this.ready&&this.config.titleAttribute?null!==(t=this.fields[this.config.titleAttribute])&&void 0!==t&&t.localized?null===(e=this.data[this.config.titleAttribute])||void 0===e?void 0:e[this.locale]:this.data[this.config.titleAttribute]:null},isReordering:function(){return Object.values(this.reorderingLists).some((function(t){return t}))}}),methods:{fieldOptions:function(t){var e,n=null===(e=this.fields)||void 0===e?void 0:e[t.key];return n||console.error('Show page: unknown field "'.concat(t.key,'"')),n},fieldValue:function(t){var e;return null===(e=this.data)||void 0===e?void 0:e[t.key]},isFieldVisible:function(t){var e;return!1!==(null===(e=this.fieldsVisible)||void 0===e?void 0:e[t.key])},isSectionCollapsable:function(t){return t.collapsable&&!this.sectionHasField(t,"entityList")},sectionLayout:function(t){return this.sectionHasField(t,"entityList")?"contents":"card"},sectionCommands:function(t){var e;return t.key?(null!==(e=this.config.commands[t.key])&&void 0!==e?e:[]).map((function(t){return t.filter((function(t){return t.authorization}))})):null},fieldsRowClass:function(t){var e=this,n=t.map((function(t){var n=e.fieldOptions(t);return"ShowPage__fields-row--".concat(n.type)}));return["ShowPage__fields-row"].concat(pr(n))},sectionFields:function(t){return t.columns.reduce((function(t,e){return[].concat(pr(t),pr(e.fields.flat()))}),[])},isSectionVisible:function(t){var e,n=this;return this.sectionFields(t).some((function(t){return n.isFieldVisible(t)}))||(null===(e=this.sectionCommands(t))||void 0===e?void 0:e.flat().length)},sectionHasField:function(t,e){var n=this;return this.sectionFields(t).some((function(t){var r=n.fieldOptions(t);return r&&r.type===e}))},handleFieldVisibilityChanged:function(t,e){this.fieldsVisible=br(br({},this.fieldsVisible),{},yr({},t,e))},handleLocaleChanged:function(t){this.locale=t},handleReordering:function(t,e){this.reorderingLists=yr({},t,e)},handleCommandRequested:function(t){var e=this;this.sendCommand(t,{postCommand:function(n){return e.$store.dispatch("show/postCommand",{command:t,data:n})},getForm:function(n){return e.$store.dispatch("show/getCommandForm",{command:t,query:br({},n)})}})},handleStateChanged:function(t){var e=this;return this.$store.dispatch("show/postState",t).then((function(t){e.handleCommandActionRequested(t.action,t)})).catch((function(t){var e,n,r=null===(e=t.response)||void 0===e?void 0:e.data;422===(null===(n=t.response)||void 0===n?void 0:n.status)&&(0,k.wp)(r.message,{title:(0,k.KQ)("modals.state.422.title"),isError:!0})}))},handleRefreshCommand:function(){this.init()},initCommands:function(){this.addCommandActionHandlers({refresh:this.handleRefreshCommand})},updateDocumentTitle:function(t){var e,n,r=null===(e=t.breadcrumb)||void 0===e||null===(n=e.items[t.breadcrumb.items.length-1])||void 0===n?void 0:n.documentTitleLabel;r&&(document.title="".concat(r,", ").concat(document.title))},init:function(){var t,e=this;return(t=x().mark((function t(){var n,r;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("show/setEntityKey",e.$route.params.entityKey);case 2:return t.next=4,e.$store.dispatch("show/setInstanceId",e.$route.params.instanceId);case 4:return t.next=6,(0,k.h3)(e.$store.dispatch("show/get").catch((function(t){return e.$emit("error",t),Promise.reject(t)})));case 6:n=t.sent,(0,k.Gh)(n.notifications),e.updateDocumentTitle(n),e.localized&&(e.locale=null===(r=e.locales)||void 0===r?void 0:r[0]),e.ready=!0,e.refreshKey++;case 12:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){hr(o,r,i,a,l,"next",t)}function l(t){hr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},beforeMount:function(){this.init(),this.initCommands()}},wr=gr,_r=[{name:"show",path:"/(.*)?/s-show/:entityKey/:instanceId?",component:(0,h.Z)(wr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ShowPage",class:t.classes},[n("div",{staticClass:"container"},[t.ready?[n("ActionBarShow",{attrs:{commands:t.authorizedCommands,state:t.instanceState,"state-values":t.stateValues,"form-url":t.formUrl,"back-url":t.backUrl,"can-edit":t.canEdit,"can-change-state":t.canChangeState,"show-back-button":t.showBackButton,breadcrumb:t.breadcrumbItems,"show-breadcrumb":t.breadcrumb.visible,"edit-disabled":t.isReordering},on:{command:t.handleCommandRequested,"state-change":t.handleStateChanged}}),t._v(" "),t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),n("div",{staticClass:"ShowPage__content"},[t.title||t.localized?[n("div",{class:t.title?"mb-3":"mb-4"},[n("div",{staticClass:"row align-items-center gx-3 gx-md-4"},[t.localized?[n("div",{staticClass:"col-auto"},[n("LocaleSelect",{attrs:{locales:t.locales,locale:t.locale},on:{change:t.handleLocaleChanged}})],1)]:t._e(),t._v(" "),t.title?[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("h1",{staticClass:"mb-0 text-truncate h2",domProps:{innerHTML:t._s(t.title)}})])]:t._e()],2)])]:t._e(),t._v(" "),t._l(t.layout.sections,(function(e){return[n("Section",{directives:[{name:"show",rawName:"v-show",value:t.isSectionVisible(e),expression:"isSectionVisible(section)"}],staticClass:"ShowPage__section",attrs:{section:e,layout:t.sectionLayout(e),"fields-row-class":t.fieldsRowClass,collapsable:t.isSectionCollapsable(e),commands:t.sectionCommands(e)},on:{command:t.handleCommandRequested},scopedSlots:t._u([{key:"default",fn:function(r){var i=r.fieldLayout;return[t.fieldOptions(i)?[n("ShowField",{key:t.refreshKey,attrs:{options:t.fieldOptions(i),value:t.fieldValue(i),locale:t.locale,locales:t.locales,"config-identifier":i.key,layout:i,collapsable:e.collapsable},on:{"visible-change":function(e){return t.handleFieldVisibilityChanged(i.key,e)},reordering:function(e){return t.handleReordering(i.key,e)}}})]:[n("UnknownField",{attrs:{name:i.key}})]]}}],null,!0)})]}))],2)]:[n("ActionBarShow")]],2),t._v(" "),n("CommandFormModal",t._g(t._b({attrs:{command:t.currentCommand,"entity-key":t.entityKey,"instance-id":t.instanceId}},"CommandFormModal",t.commandFormProps,!1),t.commandFormListeners)),t._v(" "),n("CommandViewPanel",{attrs:{content:t.commandViewContent},on:{close:t.handleCommandViewPanelClosed}})],1)}),[],!1,null,null,null).exports}];var Or=n(86831),Sr={name:"SharpActionView",components:{Modal:u.u_,LoadingOverlay:u.fz,ActionBar:u.ol},provide:function(){return{axiosInstance:(0,Or.LC)()}},data:function(){return{showErrorPage:!1,errorPageData:null}},computed:{dialogs:function(){return this.$store.state.dialogs},isLoading:function(){return this.$store.getters.isLoading}},methods:{handlePageError:function(t){var e=t.response,n=e.status,r=e.data;("get"===t.config.method&&404===n||403===n)&&(this.showErrorPage=!0,this.errorPageData={status:n,message:r.message})}}},Cr=(0,h.Z)(Sr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpActionView"},[t.showErrorPage?[n("div",{staticClass:"container"},[n("ActionBar"),t._v(" "),n("h1",[t._v("Error "+t._s(t.errorPageData.status))]),t._v(" "),n("p",[t._v(t._s(t.errorPageData.message))])],1)]:[n("router-view",{on:{error:t.handlePageError}}),t._v(" "),n("notifications",{staticStyle:{top:"6rem",right:"1rem"},attrs:{position:"top right","animation-name":"slideRight",reverse:""},scopedSlots:t._u([{key:"body",fn:function(e){var r=e.item,i=e.close;return[n("div",{staticClass:"toast show mb-3",class:"border-"+r.type,attrs:{role:"alert","aria-live":"assertive","aria-atomic":"true","data-test":"notification"}},[n("div",{staticClass:"toast-header"},[n("strong",{staticClass:"me-auto"},[t._v(t._s(r.title))]),t._v(" "),n("button",{staticClass:"btn-close",attrs:{type:"button","data-test":"close-notification","aria-label":"Close"},on:{click:i}})]),t._v(" "),r.text?[n("div",{staticClass:"toast-body",domProps:{innerHTML:t._s(r.text)}})]:t._e()],2)]}}])}),t._v(" "),t._l(t.dialogs,(function(e){return[n("Modal",t._b({key:e.id,on:{ok:e.okCallback,hidden:e.hiddenCallback}},"Modal",e.props,!1),[n("div",{domProps:{innerHTML:t._s(e.text)}})])]}))],t._v(" "),n("LoadingOverlay",{staticClass:"SharpActionView__loading",attrs:{visible:t.isLoading,fade:""}})],2)}),[],!1,null,null,null).exports;function jr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var xr={name:"SharpLeftNav",mixins:[(0,ht.Et)("lg")],components:{Loading:u.gb},props:{currentEntity:Object,title:String,collapseable:{type:Boolean,default:!0}},data:function(){return{ready:!1,collapsed:!1,state:"expanded"}},watch:{collapsed:{handler:function(t){document.body.classList.toggle("leftNav--collapsed",this.collapsed),this.state=t?"collapsing":"expanding",setTimeout(this.updateState,250)}}},computed:{currentIcon:function(){var t;return null===(t=this.currentEntity)||void 0===t?void 0:t.icon},classes:function(){return["SharpLeftNav--".concat(this.state),{"SharpLeftNav--collapseable":this.collapseable}]}},methods:{updateState:function(){this.state=this.collapsed?"collapsed":"expanded"},handleClicked:function(){this.collapsed&&(this.collapsed=!1)},init:function(){var t,e=this;return(t=x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$store.dispatch("setCurrentEntity",e.currentEntity),e.ready=!0;case 2:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){jr(o,r,i,a,l,"next",t)}function l(t){jr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.collapsed=this.isViewportSmall,this.updateState(),this.init()}},kr=xr,Pr=(0,h.Z)(kr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"SharpLeftNav",class:t.classes,attrs:{role:"navigation","aria-label":"Menu Sharp"},on:{click:t.handleClicked}},[n("div",{staticClass:"SharpLeftNav__top-icon"},[n("i",{staticClass:"fa",class:t.currentIcon})]),t._v(" "),n("div",{staticClass:"flex-grow-0"},[n("div",{staticClass:"SharpLeftNav__title-container position-relative"},[t._t("title",(function(){return[n("h2",{staticClass:"SharpLeftNav__title mb-0"},[t._v(t._s(t.title))])]}))],2)]),t._v(" "),n("div",{staticClass:"flex-grow-1 position-relative",staticStyle:{"min-height":"0"}},[n("div",{staticClass:"SharpLeftNav__content d-flex flex-column"},[n("div",{staticClass:"SharpLeftNav__inner flex-grow-1 pb-5",staticStyle:{"min-height":"0"}},[t._t("default")],2),t._v(" "),n("a",{staticClass:"SharpLeftNav__collapse-button btn btn-text",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),e.stopPropagation(),t.collapsed=!t.collapsed}}},[n("svg",{staticClass:"SharpLeftNav__collapse-arrow",staticStyle:{fill:"currentColor"},attrs:{width:"8",height:"12",viewBox:"0 0 8 12","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M7.5 10.6L2.8 6l4.7-4.6L6.1 0 0 6l6.1 6z"}})])])])])])}),[],!1,null,null,null).exports,Dr=n(70584);r.default.use(s()),r.default.use(a.N9,{installComponents:!1}),r.default.use(o.Z),r.default.use(i.ZP);var Ar=(0,Qe.Nd)(),Er=(0,Dr.h)();r.default.use((function(t,e){e.store,e.router}),{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router;e.store.registerModule("dashboard",ft),n.addRoutes(ie)}),{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router;e.store.registerModule("entity-list",se),n.addRoutes(Fe)}),{store:Er,router:Ar}),r.default.use((function(t,e){e.store.registerModule("global-filters",G),t.component("sharp-global-filters",(function(){return Promise.resolve().then(n.bind(n,17749))}))}),{store:Er,router:Ar}),r.default.use(c.ZP,{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router,r=e.store;n.addRoutes(_r),r.registerModule("show",Ue),t.component("ShowField",cr)}),{store:Er,router:Ar}),r.default.use(u.ZP,{store:Er,router:Ar}),r.default.component("sharp-action-view",Cr),r.default.component("sharp-left-nav",Pr),r.default.component("sharp-nav-section",u.yV),r.default.component("sharp-nav-item",u.LY),new r.default({el:"#sharp-app",store:Er,router:Ar})},70584:function(t,e,n){n.d(e,{h:function(){return a}});var r=n(20629),i={state:{loading:!1,dialogs:[],currentEntity:null},mutations:{setLoading:function(t,e){t.loading=!!e},setDialogs:function(t,e){t.dialogs=e},setCurrentEntity:function(t,e){t.currentEntity=e}},getters:{isLoading:function(t){return!!t.loading}},actions:{setLoading:function(t,e){(0,t.commit)("setLoading",e)},setDialogs:function(t,e){(0,t.commit)("setDialogs",e)},setCurrentEntity:function(t,e){(0,t.commit)("setCurrentEntity",e)}}},o=null;function a(){return o||(o=new r.ZP.Store(i))}},4935:function(t,e,n){n.d(e,{i0:function(){return b},wp:function(){return v}});var r=n(70584),i=n(16114),o=["text","okCallback","okCloseOnly","isError"],a=["title"],l=["title"];function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var p=0;function m(t){var e=t.text,n=(t.okCallback,t.okCloseOnly),i=t.isError,a=h(t,o),l=p++;function s(){(0,r.h)().dispatch("setDialogs",(0,r.h)().state.dialogs.filter((function(t){return t.id!==l})))}return new Promise((function(t){(0,r.h)().dispatch("setDialogs",[].concat(d((0,r.h)().state.dialogs),[{id:l,props:u(u({},a),{},{okOnly:n,noCloseOnBackdrop:n,noCloseOnEsc:n,visible:!0,isError:i}),okCallback:t,hiddenCallback:s,text:e}]))}))}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.title,r=h(e,a);return m(u({okCloseOnly:!0,text:t,title:n},r))}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.title,r=h(e,l);return m(u({text:t,title:n,size:"sm",hideHeader:!0,okTitle:(0,i.K)("modals.confirm.ok_button"),bodyClass:"pt-4"},r))}},16114:function(t,e,n){function r(t,e){var n,r=null===(n=window.i18n)||void 0===n?void 0:n[t];return r||(void 0!==e?e:t)}n.d(e,{K:function(){return r}})},79226:function(t,e,n){n.d(e,{G:function(){return i}});var r=n(70538);function i(t){setTimeout((function(){var e;null==t||null===(e=t.forEach)||void 0===e||e.call(t,(function(t){return n=(e=t).level,i=e.title,o=e.message,a=e.autoHide,void r.default.notify({title:i,type:n,text:o,duration:a?4e3:-1});var e,n,i,o,a}))}),500)}},88264:function(t,e,n){n.d(e,{Oh:function(){return c},Vz:function(){return f},mB:function(){return d},uN:function(){return h}});var r=n(80129),i=n.n(r),o=n(30381),a=n.n(o);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},e=t["content-disposition"];if(e&&e.includes("attachment")){var n=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,r=n.exec(e);if(null!=r&&r[1])return r[1].replace(/['"]/g,"")}return null}n.d(e,{E:function(){return r},U:function(){return i}})},27531:function(t,e,n){var r=n(23645),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,".unknown-field[data-v-d6c36028]{background:rgba(255,0,0,.25);border:1px solid red;font-family:Courier New,Courier,monospace;font-weight:700;padding:.5em 1em}",""]),e.Z=i},60330:function(){},25390:function(){},24877:function(t,e,n){n.d(e,{Z:function(){return i}});var r={name:"SharpFilterControl",props:{label:String},methods:{handleLabelClicked:function(){this.$emit("label-click")},handleClicked:function(){this.$emit("click")}}},i=(0,n(51900).Z)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"input-group input-group-sm flex-nowrap SharpFilterControl",on:{click:t.handleClicked}},[t.label?[n("div",{staticClass:"input-group-text bg-white",on:{click:t.handleLabelClicked}},[t._v("\n "+t._s(t.label)+"\n ")])]:t._e(),t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports},17749:function(t,e,n){n.r(e),n.d(e,{default:function(){return p}});var r=n(87757),i=n.n(r),o=n(20629),a=n(24903),l=n(89955),s=n(50779);function u(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={components:{FilterSelect:l.Z,Dropdown:s.Lt},computed:function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var v={components:{TemplateRenderer:h.e},props:{data:Object,options:Object},computed:{templateData:function(){var t=this.data;t.slot;return m(t,p)},templateProps:function(){return this.options.attributes.filter((function(t){return"slot"!==t}))}}},b=(0,n(51900).Z)(v,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("TemplateRenderer",{attrs:{name:"Embed","template-data":t.templateData,"template-props":t.templateProps,template:t.options.template}},[t._t("default",(function(){return[t.data.slot?[n("div",{domProps:{innerHTML:t._s(t.data.slot)}})]:t._e()]}))],2)}),[],!1,null,null,null).exports},75969:function(t,e,n){n.d(e,{op:function(){return m},VD:function(){return p},ji:function(){return o},TS:function(){return v},YX:function(){return d},Jz:function(){return h},AZ:function(){return i},Bt:function(){return c},tj:function(){return u},HN:function(){return f}});var r=n(24903);function i(t){var e=t.entityKey,n=t.instanceId,i=t.files,o=t.thumbnailWidth,a=t.thumbnailHeight;return r.hi.post("/files/".concat(e,"/").concat(null!=n?n:""),{files:i,thumbnail_width:o,thumbnail_height:a}).then((function(t){return t.data.files}))}function o(t){var e=t.entityKey,n=t.instanceId,i=t.disk,o=t.path;return(0,r.JW)("/download/".concat(e,"/").concat(null!=n?n:""),{params:{disk:i,path:o}})}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?{isEmpty:null==o.default,value:o.default}:{value:K({dynamicOptions:o,attributeValue:e,contextData:i,contextSources:a})}}(o,i[1],{dynamicAttributes:e,contextData:n}),l=t.resolvedEmptyAttributes||[];return a.isEmpty&&l.push(o),N(N({},t),{},{resolvedEmptyAttributes:l,attributes:N(N({},t.attributes),{},H({},o,a.value))})}),{});return{attributes:r.attributes,resolvedEmptyAttributes:r.resolvedEmptyAttributes}}function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.dependantAttributes,i=t.$attrs.dynamicAttributes,o=(r||[]).some((function(t){return V(i,t)}));o?t.$nextTick(e):e()}function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tt(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;return tt(tt({},t),{},et({},i,tt(tt({},l),{},{readOnly:u})))}),{})}function ot(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e=this.searchMinChars?(0,r.yC)(this.localValues,t,{searchKeys:this.searchKeys}):this.localValues},updateRemoteSuggestions:function(t){var e,n=this;return null===(e=this.cancelSource)||void 0===e||e.cancel(),this.cancelSource=f.CancelToken.source(),m({url:this.remoteEndpoint,method:this.remoteMethod,locale:this.locale,searchAttribute:this.remoteSearchAttribute,dataWrapper:this.dataWrapper,fieldKey:this.fieldKey,query:t,cancelToken:this.cancelSource.token}).then((function(t){n.suggestions=t,n.scroll()})).finally((function(){n.isLoading=!1}))},scroll:function(){(0,p.Eb)(this)},handleSelect:function(t){this.$emit("input",t)},handleDropdownClose:function(){this.opened=!1,this.$emit("close")},handleDropdownOpen:function(){this.opened=!0,this.$emit("open"),this.scroll()},handleClearButtonClicked:function(){var t=this;this.$emit("input",null),this.$nextTick((function(){t.$refs.multiselect.activate()}))},resolveTemplateData:function(t){return lt(lt({},this.templateData),this.localizedTemplateData(t))},itemMatchValue:function(t){return t[this.itemIdAttribute]==this.value[this.itemIdAttribute]},findLocalValue:function(){return this.value&&null!=this.value[this.itemIdAttribute]?this.localValues.some(this.itemMatchValue)?this.localValues.find(this.itemMatchValue):((0,r.H)("Autocomplete (key: ".concat(this.fieldKey,") can't find local value matching : ").concat(JSON.stringify(this.value))),null):null},setDefault:function(){var t,e=this;return(t=l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.$emit("input",e.findLocalValue(),{force:!0}),t.next=3,e.$nextTick();case 3:e.ready=!0;case 4:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ot(o,r,i,a,l,"next",t)}function l(t){ot(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.updateRemoteSuggestions=u()(this.updateRemoteSuggestions,this.debounceDelay),"local"!==this.mode||this.searchKeys||(0,r.ZK)("Autocomplete (key: ".concat(this.fieldKey,") has local mode but no searchKeys, default set to ['value']")),this.isRemote?this.ready=!0:J(this,this.setDefault,{dependantAttributes:["localValues"]})}},ct=ut,dt=n(51900),ft=(0,dt.Z)(ct,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpAutocomplete",class:t.classes},[t.ready?[t.overlayVisible?[n("div",{staticClass:"form-control clearable SharpAutocomplete__result"},[n("TemplateRenderer",{attrs:{name:"ResultItem",template:t.resultItemTemplate,"template-data":t.resolveTemplateData(t.value),"template-props":t.searchKeys}}),t._v(" "),n("ClearButton",{on:{click:t.handleClearButtonClicked}})],1)]:[n("Multiselect",{ref:"multiselect",staticClass:"SharpAutocomplete__multiselect form-control",class:{"form-select":!this.isRemote,"SharpAutocomplete__multiselect--hide-dropdown":t.hideDropdown},attrs:{id:t.id,value:t.value,options:t.suggestions,"track-by":t.itemIdAttribute,"internal-search":!1,placeholder:t.placeholder,loading:t.isLoading,multiple:t.multiple,disabled:t.readOnly,"hide-selected":t.hideSelected,"allow-empty":t.allowEmpty,"preserve-search":t.preserveSearch,"show-pointer":t.showPointer,searchable:t.searchable,readonly:t.readOnly,tabindex:t.readOnly?-1:0},on:{"search-change":function(e){return t.updateSuggestions(e)},select:t.handleSelect,input:function(e){return t.$emit("multiselect-input",e)},close:t.handleDropdownClose,open:t.handleDropdownOpen},scopedSlots:t._u([{key:"clear",fn:function(){return[t.clearButtonVisible?[n("ClearButton",{on:{click:t.handleClearButtonClicked}})]:t._e()]},proxy:!0},{key:"singleLabel",fn:function(e){var r=e.option;return[n("TemplateRenderer",{attrs:{name:"ResultItem",template:t.resultItemTemplate,"template-data":t.resolveTemplateData(r),"template-props":t.searchKeys}})]}},{key:"option",fn:function(e){var r=e.option;return[n("TemplateRenderer",{attrs:{name:"ListItem",template:t.listItemTemplate,"template-data":t.resolveTemplateData(r),"template-props":t.searchKeys}})]}},{key:"loading",fn:function(){return[n("Loading",{attrs:{visible:t.isLoading,small:""}})]},proxy:!0},{key:"noResult",fn:function(){return[t._v("\n "+t._s(t.l("form.autocomplete.no_results_text"))+"\n ")]},proxy:!0}],null,!1,1785377836)})]]:t._e()],2)}),[],!1,null,null,null).exports;function ht(t,e){var n=e.maxlength;return n&&(null==t?void 0:t.length)>n?(0,r.KQ)("form.text.validation.maxlength").replace(":maxlength",n):null}function pt(t){return t.normalize()}var mt={name:"SharpTextarea",props:{value:String,placeholder:String,readOnly:Boolean,maxLength:Number,rows:Number},methods:{validate:function(t){return ht(t,{maxlength:this.maxLength})},handleInput:function(t){var e=pt(t.target.value),n=this.validate(e);this.$emit("input",e,{error:n})}}},vt=(0,dt.Z)(mt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("textarea",{staticClass:"SharpTextarea form-control",attrs:{rows:t.rows,placeholder:t.placeholder,disabled:t.readOnly},domProps:{value:t.value},on:{input:t.handleInput}})}),[],!1,null,null,null).exports,bt={name:"SharpText",props:{value:[String,Number],type:String,placeholder:String,readOnly:Boolean,maxLength:Number,inputType:{type:String,default:"text"}},methods:{validate:function(t){return ht(t,{maxlength:this.maxLength})},handleInput:function(t){var e=pt(t.target.value),n=this.validate(e);this.$emit("input",e,{error:n})},focus:function(){this.$refs.input.focus()}}},yt=(0,dt.Z)(bt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{ref:"input",staticClass:"SharpText form-control",attrs:{type:t.inputType,placeholder:t.placeholder,disabled:t.readOnly},domProps:{value:t.value},on:{input:t.handleInput}})}),[],!1,null,null,null).exports,gt={components:{TextField:yt},props:{value:[String,Number],showControls:Boolean,min:Number,max:Number,step:Number}},wt=(0,dt.Z)(gt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("TextField",t._g(t._b({class:{"hide-controls":!t.showControls},attrs:{value:t.value,step:t.step,min:t.min,max:t.max,"input-type":"number"}},"TextField",t.$attrs,!1),t.$listeners))}),[],!1,null,null,null).exports,_t=n(94831),Ot=n(17652),St=n(75969);function Ct(t){var e,n,r,i=t.filters,o=t.imageWidth,a=t.imageHeight,l=null!==(e=null==i||null===(n=i.rotate)||void 0===n?void 0:n.angle)&&void 0!==e?e:0,s=o,u=a;Math.abs(l)%180&&(s=a,u=o);var c=null!==(r=null==i?void 0:i.crop)&&void 0!==r?r:{},d=c.width,f=c.height,h=c.x,p=c.y;return{width:(null!=d?d:1)*s,height:(null!=f?f:1)*u,x:(null!=h?h:0)*s,y:(null!=p?p:0)*u,rotate:-1*l}}function jt(t){var e=t.cropData,n=t.imageWidth,r=t.imageHeight,i=n,o=r;return Math.abs(e.rotate)%180&&(i=r,o=n),{crop:{width:(0,St.tj)(e.width/i,4),height:(0,St.tj)(e.height/o,4),x:(0,St.tj)(e.x/i,4),y:(0,St.tj)(e.y/o,4)},rotate:{angle:(0,St.tj)(-1*e.rotate,4)}}}function xt(t,e){var n=t.getCropBoxData(),r=t.getContainerData();n.width=2,n.height=2,n.top=0;var i=r.width/2-1;n.left=i,t.setCropBoxData(n),t.rotateTo(e);var o=t.getCanvasData(),a=o.height,l=r.height,s=l/a,u=Math.min(o.width*s,r.width);o.height=l,o.width=u,o.top=0,o.left=(r.width-o.width)/2,t.setCanvasData(o),n.left=0,n.top=0,n.width=o.width,n.height=o.height,t.setCropBoxData(n)}function kt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Pt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){kt(o,r,i,a,l,"next",t)}function l(t){kt(o,r,i,a,l,"throw",t)}a(void 0)}))}}var Dt={components:{Modal:p.u_,Loading:p.gb,VueCropper:Ot.Z,Button:p.zx},inject:{$form:{default:null}},props:{value:Object,visible:Boolean,src:String,ratioX:Number,ratioY:Number},data:function(){return{ready:!1,cropData:null,originalImg:null}},watch:{value:"handleValueChanged"},computed:{imageSrc:function(){return this.originalImg||this.src},cropperOptions:function(){return{viewMode:2,dragMode:"move",aspectRatio:this.ratioX/this.ratioY,autoCropArea:1,guides:!1,background:!0,rotatable:!0,restore:!1,data:this.cropData,ready:this.handleCropperReady}}},methods:{l:r.KQ,handleRotateClicked:function(t){!function(t,e){var n=t.getData();xt(t,n.rotate+e)}(this.$refs.cropper.cropper,t)},handleValueChanged:function(){this.value||(this.cropData=null,this.originalImg=null)},handleOkClicked:function(){var t=this.$refs.cropper,e=t.getData(!0);this.cropData=e,this.$emit("submit",t)},handleShow:function(){this.init()},initOriginalThumbnail:function(){var t=this;return Pt(l().mark((function e(){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.originalImg){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,St.AZ)({entityKey:t.$form.entityKey,instanceId:t.$form.instanceId,files:[{path:t.value.path,disk:t.value.disk}],thumbnailWidth:1200,thumbnailHeight:1e3});case 4:if(r=e.sent,t.originalImg=null===(n=r[0])||void 0===n?void 0:n.thumbnail,t.originalImg){e.next=8;break}return e.abrupt("return",Promise.reject("Sharp Upload: original thumbnail not found in POST /api/files request"));case 8:return e.next=10,new Promise((function(e){var n=new Image;n.src=t.originalImg,n.onload=function(){t.cropData=Ct({filters:t.value.filters,imageWidth:n.naturalWidth,imageHeight:n.naturalHeight}),e()},n.onerror=function(){t.originalImg=null,e()}}));case 10:case"end":return e.stop()}}),e)})))()},init:function(){var t=this;return Pt(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ready=!1,null===(n=t.value)||void 0===n||!n.path){e.next=4;break}return e.next=4,t.initOriginalThumbnail();case 4:t.ready=!0;case 5:case"end":return e.stop()}}),e)})))()},handleCropperReady:function(){var t,e=this.$refs.cropper.cropper;null!==(t=this.cropData)&&void 0!==t&&t.rotate&&(xt(e,this.cropData.rotate),e.setData(this.cropData))}}},At=(0,dt.Z)(Dt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Modal",t._g({ref:"modal",attrs:{visible:t.visible,title:t.l("modals.cropper.title"),"no-close-on-backdrop":"","dialog-class":"modal-dialog-scrollable","content-class":"h-100",size:"xl"},on:{ok:t.handleOkClicked,show:t.handleShow},scopedSlots:t._u([{key:"footer-prepend",fn:function(){return[n("div",{staticClass:"row align-items-center"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{text:""},on:{click:function(e){return t.handleRotateClicked(-90)}}},[n("i",{staticClass:"fas fa-undo"})]),t._v(" "),n("Button",{staticClass:"me-auto",attrs:{text:""},on:{click:function(e){return t.handleRotateClicked(90)}}},[n("i",{staticClass:"fas fa-redo"})])],1),t._v(" "),n("div",{staticClass:"col d-none d-lg-block"},[n("div",{staticClass:"text-muted fs-7 lh-sm"},[t._v("\n "+t._s(t.l("form.upload.edit_modal.description"))+"\n ")])])])]},proxy:!0}])},t.$listeners),[t.ready?[n("vue-cropper",t._b({ref:"cropper",staticClass:"SharpUpload__modal-vue-cropper h-100",attrs:{src:t.imageSrc,alt:"Source image"}},"vue-cropper",t.cropperOptions,!1))]:[n("div",{staticClass:"d-flex align-items-center justify-content-center",staticStyle:{height:"300px"}},[n("Loading")],1)]],2)}),[],!1,null,null,null).exports;function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lt(t){for(var e=1;e0&&void 0!==arguments[0])||arguments[0];this.removeFile(this.file),this.files.splice(0,1),this.setPending(!1),this.resetThumbnails(),this.transformedImg=null,t&&(this.$emit("input",null),this.$emit("reset"))},handleEditButtonClick:function(){this.showEditModal=!0},handleRemoveClicked:function(){this.remove(),this.$emit("removed")},handleClick:function(){this.uploader._uploader.hiddenFileInput.click()},handleDrop:function(t){var e,n;this.file&&(null===(e=t.dataTransfer)||void 0===e||null===(n=e.files)||void 0===n?void 0:n.length)>0&&this.remove(!1)},handleEditSubmitted:function(t){this.updateTransformedImage(t),this.updateFilters(t)},onCropperReady:function(){this.hasInitialTransform&&(this.updateTransformedImage(this.$refs.cropper),this.updateFilters(this.$refs.cropper))},updateFilters:function(t){var e,n=t.getData(!0),r=t.getImageData(),i=Lt(Lt({},this.value),{},{transformed:!0,filters:Lt(Lt({},null===(e=this.value)||void 0===e?void 0:e.filters),jt({cropData:n,imageWidth:r.naturalWidth,imageHeight:r.naturalHeight}))});this.$emit("input",i),this.$emit("updated",i)},updateTransformedImage:function(t){var e=this;this.resetTransformedImage(),t.getCroppedCanvas({width:300,height:300}).toBlob((function(t){e.transformedImg=URL.createObjectURL(t)}))},resetTransformedImage:function(){this.transformedImg&&URL.revokeObjectURL(this.transformedImg)},resetThumbnails:function(){var t;null!==(t=this.file)&&void 0!==t&&t.blobUrl&&!this.persistThumbnails&&URL.revokeObjectURL(this.file.blobUrl),this.resetTransformedImage()},validateValue:function(){return!!this.value.name||(0,r.H)("Upload field '".concat(this.downloadId,'\' has an invalid value: expects to have a "name", given :'),JSON.parse(JSON.stringify(this.value)))},init:function(){var t;this.value?(this.file?Object.assign(this.file,this.value):this.addedFile(Lt(Lt({},this.value),{},{upload:{}})),this.$set(this.file,"thumbnail",null!==(t=this.value.thumbnail)&&void 0!==t?t:null)):this.files=[]}},created:function(){this.options.thumbnailWidth=null,this.options.thumbnailHeight=null,this.options.maxFiles=1,this.value&&!this.value.file&&this.validateValue()&&(this.init(),this.file.status="exist")},mounted:function(){var t,e=this.uploader._uploader;e.disable(),e.listeners=e.listeners.filter((function(t){return!t.events.click})),e.enable(),e.on("drop",this.handleDrop),e.on("thumbnail",this.onThumbnail),null!==(t=this.value)&&void 0!==t&&t.file&&(e.addFile(this.value.file),this.$emit("input",{}))},beforeDestroy:function(){this.resetThumbnails(),this.setPending(!1),this.uploader._uploader.destroy()}},$t=Ft,Tt=(0,dt.Z)($t,(function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{staticClass:"SharpUpload",class:e.classes},[r("div",[e.file?[r("div",{staticClass:"card card-body SharpUpload__card",class:{"border-danger":e.hasError}},[r("div",{class:{row:e.showThumbnail}},[e.showThumbnail?[r("div",{staticClass:"SharpUpload__thumbnail",class:[e.compactThumbnail?"col-4 col-sm-3 col-xl-2":"col-4 col-md-4"]},[r("img",{attrs:{src:e.imageSrc,alt:""}})])]:e._e(),e._v(" "),r("div",{staticClass:"SharpUpload__infos",class:(t={},t[e.compactThumbnail?"col-8 col-sm-9 col-xl-10":"col-8 col-md-8"]=e.showThumbnail,t)},[r("div",{staticClass:"mb-3"},[r("label",{staticClass:"SharpUpload__filename text-truncate d-block"},[e._v(e._s(e.fileName))]),e._v(" "),r("div",{staticClass:"SharpUpload__info mt-2"},[r("div",{staticClass:"row g-2"},[e.size?[r("div",{staticClass:"col-auto"},[e._v(e._s(e.size))])]:e._e(),e._v(" "),e.hasDownload?[r("div",{staticClass:"col-auto"},[r("a",{staticClass:"SharpUpload__download-link",attrs:{href:e.downloadUrl,download:e.fileName}},[r("i",{staticClass:"fas fa-download"}),e._v("\n "+e._s(e.l("form.upload.download_link"))+"\n ")])])]:e._e()],2)]),e._v(" "),r("transition",{attrs:{name:"SharpUpload__progress"}},[e.inProgress?[r("div",{staticClass:"SharpUpload__progress mt-2"},[r("div",{staticClass:"SharpUpload__progress-bar",style:{width:e.progress+"%"},attrs:{role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":"0","aria-valuemax":"100"}})])]:e._e()],2)],1),e._v(" "),e.readOnly?e._e():[r("div",[e.hasEdit&&!e.hasError?[r("Button",{attrs:{outline:"",small:""},on:{click:e.handleEditButtonClick}},[e._v("\n "+e._s(e.l("form.upload.edit_button"))+"\n ")])]:e._e(),e._v(" "),r("Button",{staticClass:"SharpUpload__remove-button",attrs:{variant:"danger",outline:"",small:""},on:{click:e.handleRemoveClicked}},[e._v("\n "+e._s(e.l("form.upload.remove_button"))+"\n ")])],2)]],2)],2)])]:[r("Button",{staticClass:"SharpUpload__browse dz-message",attrs:{text:"",block:"",disabled:e.readOnly,type:"button"},on:{click:e.handleClick}},[e._v("\n "+e._s(e.l("form.upload.browse_button"))+"\n ")])],e._v(" "),r("div",{ref:"clip-preview-template",staticClass:"clip-preview-template",staticStyle:{display:"none"}},[r("div")])],2),e._v(" "),r("EditModal",{ref:"modal",attrs:{value:e.value,visible:e.showEditModal,src:e.originalImageSrc,"ratio-x":e.ratioX,"ratio-y":e.ratioY},on:{"update:visible":function(t){e.showEditModal=t},submit:e.handleEditSubmitted}}),e._v(" "),e.hasInitialTransform?[r("vue-cropper",{ref:"cropper",staticClass:"d-none",attrs:{src:e.originalImageSrc,"aspect-ratio":e.ratioX/e.ratioY,"auto-crop-area":1,ready:e.onCropperReady}})]:e._e(),e._v(" "),r("a",{ref:"dlLink",staticStyle:{display:"none"}})],2)}),[],!1,null,null,null).exports;function Mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vt(t){for(var e=1;e0&&this.$refs.multiselect.filteredOptions.length>1?this.$refs.multiselect.pointer=1:this.$refs.multiselect.pointer=0},onTagsChanged:function(){this.$emit("input",this.tags.map((function(t){return new ae(t)})))}},created:function(){this.lastIndex+=this.options.length,this.tags=(this.value||[]).map(this.patchTag)}},se=(0,dt.Z)(le,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("Multiselect",{ref:"multiselect",staticClass:"SharpTags form-select",attrs:{id:t.id,value:t.tags,options:t.indexedOptions,placeholder:t.dynamicPlaceholder,"tag-placeholder":t.createText,max:t.maxTagCount,taggable:t.creatable,"close-on-select":!1,disabled:t.readOnly,"track-by":"_internalId",label:"label","custom-label":t.localizedCustomLabel,multiple:"",searchable:"","hide-selected":"","show-labels":!1},on:{"search-change":t.handleTextInput,input:t.handleInput,tag:t.handleNewTag}})}),[],!1,null,null,null).exports,ue=n(30381),ce=n.n(ue),de=(n(94470),{name:"SharpDatePicker",components:{VDatePicker:n(23919).DatePicker},props:{value:[Date,Object],isRange:Boolean,mondayFirst:Boolean,displayFormat:String},computed:{popoverOptions:function(){var t;return{visibility:"focus",hideDelay:10,placement:"bottom",modifiers:[{name:"preventOverflow",options:{boundary:null!==(t=document.querySelector("[data-popover-boundary]"))&&void 0!==t?t:"clippingParents",padding:8}},{name:"flip",enabled:!1}]}},masks:function(){return{input:this.displayFormat||void 0}},locale:function(){return document.documentElement.lang},firstDayOfWeek:function(){return this.mondayFirst?2:1},attributes:function(){return[{key:"today",dot:!0,dates:new Date}]}},methods:{handleInput:function(t){this.$emit("input",t)}}}),fe=(0,dt.Z)(de,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("v-date-picker",t._g(t._b({staticClass:"SharpDatePicker",attrs:{value:t.value,popover:t.popoverOptions,"is-range":t.isRange,locale:t.locale,"first-day-of-week":t.firstDayOfWeek,attributes:t.attributes,color:"primary",is24hr:"","trim-weeks":""},on:{input:t.handleInput},scopedSlots:t._u([{key:"default",fn:function(e){return[t._t("default",null,null,e)]}}],null,!0)},"v-date-picker",t.$attrs,!1),t.$listeners))}),[],!1,null,null,null).exports;function he(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}ce().locale(ce().locales().includes(document.documentElement.lang)?document.documentElement.lang:"en");var pe={name:"SharpDate",components:{DatePicker:fe,ClearButton:p.Cd},mixins:[o.WH],props:{id:String,value:{type:[Date,String]},hasDate:{type:Boolean,default:!0},hasTime:{type:Boolean,default:!1},displayFormat:String,mondayFirst:Boolean,stepTime:{type:Number,default:30},minTime:String,maxTime:String,readOnly:Boolean},data:function(){return{localInputValue:null}},computed:{format:function(){return this.hasTime&&!this.hasDate?"HH:mm":null},mode:function(){return this.hasDate&&this.hasTime?"dateTime":this.hasTime?"time":"date"},validHours:function(){return{min:this.minTime?parseInt(this.minTime):null,max:this.maxTime?parseInt(this.maxTime):null}},pickerValue:function(){return this.value?ce()(this.value,this.format).toDate():null},inputValue:function(){return"string"==typeof this.localInputValue?this.localInputValue:this.value?ce()(this.value,this.format).format(this.displayFormat):""},hasClearButton:function(){return!!this.value}},methods:{getMoment:function(){return this.value?ce()(this.value,this.format):ce()()},formatDateValue:function(t){return t?this.hasDate?this.hasTime?ce()(t).format():ce()(t).format("YYYY-MM-DD"):ce()(t).format("HH:mm"):null},handleDateChanged:function(t){this.$emit("input",this.formatDateValue(t))},handleInput:function(t){var e=ce()(t.target.value,this.displayFormat,!0);this.localInputValue=t.target.value,e.isValid()?(this.rollback(),this.$emit("input",this.formatDateValue(e.toDate())),this.updatePopover()):this.$emit("error","".concat((0,r.KQ)("form.date.validation_error.format")," (").concat(this.displayFormat,")"))},handlePrependButtonClicked:function(){var t=this;setTimeout((function(){return t.$refs.input.focus()}))},handleBlur:function(){this.localInputValue&&this.rollback()},updatePopover:function(){this.$refs.input.dispatchEvent(new Event("change",{bubbles:!0}))},increase:function(t){this.translate(t.target,1)},decrease:function(t){this.translate(t.target,-1)},translate:function(t,e){var n,r=this;return(n=l().mark((function n(){var i;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=r.changeOnArrowPressed(t.selectionStart,e))){n.next=6;break}return n.next=4,r.$nextTick();case 4:t.setSelectionRange(i.start,i.end),r.updatePopover();case 6:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(r,i){var o=n.apply(t,e);function a(t){he(o,r,i,a,l,"next",t)}function l(t){he(o,r,i,a,l,"throw",t)}a(void 0)}))})()},add:function(t,e){var n=this.getMoment();n.add(t,e),this.$emit("input",this.formatDateValue(n.toDate()))},nearestMinutesDist:function(t){var e=this.getMoment().minutes();if(e%this.stepTime==0)return t*this.stepTime;var n=t<0?"floor":"ceil";return this.stepTime*Math[n](e/this.stepTime)-e},updateMoment:function(t,e){switch(t){case"H":this.add(e,"hours");break;case"m":this.add(this.nearestMinutesDist(e),"minutes");break;case"s":this.add(e,"seconds");break;case"Y":this.add(e,"years");break;case"M":this.add(e,"months");break;case"D":this.add(e,"days");break;default:return!1}return!0},changeOnArrowPressed:function(t,e){var n=t;if(!this.updateMoment(this.displayFormat[n],e)&&t&&(n--,!this.updateMoment(this.displayFormat[n],e)))return null;var r=this.displayFormat[n];return{start:this.displayFormat.indexOf(r),end:this.displayFormat.lastIndexOf(r)+1}},rollback:function(){this.$emit("clear"),this.localInputValue=null},clear:function(){var t=this;this.rollback(),this.$emit("input",null),setTimeout((function(){return t.$refs.input.focus()}))}}},me=pe,ve=(0,dt.Z)(me,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpDate"},[n("div",{staticClass:"SharpDate__input-wrapper position-relative"},[n("DatePicker",{attrs:{value:t.pickerValue,mode:t.mode,"minute-increment":t.stepTime,"monday-first":t.mondayFirst,"update-on-input":!1},on:{input:t.handleDateChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.inputEvents;e.togglePopover;return[n("div",{staticClass:"input-group",class:{"input-group--clearable":t.hasClearButton}},[n("button",{staticClass:"input-group-text btn",on:{click:t.handlePrependButtonClicked}},[n("svg",{staticClass:"align-middle",staticStyle:{fill:"currentColor"},attrs:{width:"1.25em",height:"1.25em",viewBox:"0 0 32 32"}},[n("path",{attrs:{d:"M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"}})])]),t._v(" "),n("input",t._g({ref:"input",staticClass:"form-control clearable SharpDate__input",class:{"SharpDate__input--valuated":t.value},attrs:{id:t.id,placeholder:t.displayFormat,disabled:t.readOnly,autocomplete:"off"},domProps:{value:t.inputValue},on:{input:t.handleInput,blur:t.handleBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.increase.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.decrease.apply(null,arguments))}]}},r)),t._v(" "),t.hasClearButton?[n("ClearButton",{ref:"clearButton",on:{click:t.clear}})]:t._e()],2)]}}])})],1)])}),[],!1,null,null,null),be=ve.exports,ye={name:"SharpCheck",props:{value:Boolean,text:String,readOnly:Boolean,uniqueIdentifier:String,id:String},computed:{resolvedId:function(){var t;return null!==(t=this.id)&&void 0!==t?t:this.uniqueIdentifier}},methods:{handleCheck:function(t){this.$emit("input",t.target.checked)}}},ge=(0,dt.Z)(ye,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpCheck form-check"},[n("input",{staticClass:"form-check-input",attrs:{type:"checkbox",id:t.resolvedId,disabled:t.readOnly},domProps:{checked:t.value},on:{change:t.handleCheck}}),t._v(" "),n("label",{staticClass:"form-check-label",attrs:{for:t.resolvedId}},[t._v("\n "+t._s(t.text)+"\n ")])])}),[],!1,null,null,null).exports,we=n(16596),_e=n.n(we),Oe={name:"FieldsLayout",components:{Grid:p.rj},props:{layout:{type:Array,required:!0},visible:{type:Object,default:function(){return{}}}},data:function(){return{fieldsetMap:{}}},methods:{isFieldset:function(t){return!!t.legend},isFieldsetVisible:function(t){var e=this;return(t.fields||[]).flat().some((function(t){return e.visible[t.key]}))},updateLayout:function(){this.$el.querySelectorAll(":scope > .SharpGrid__row").forEach((function(t){var e=!!t.querySelector(":scope > .SharpGrid__col > .SharpForm__form-item--has-label"),n=!!t.querySelector(".SharpFieldLocaleSelect");t.classList.toggle("SharpGrid__row--has-label",e),t.classList.toggle("SharpGrid__row--has-locale-select",n)}))}},mounted:function(){this.updateLayout()},updated:function(){this.updateLayout()}},Se=(0,dt.Z)(Oe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Grid",{attrs:{rows:t.layout},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[t.isFieldset(r)?[n("fieldset",{directives:[{name:"show",rawName:"v-show",value:t.isFieldsetVisible(r),expression:"isFieldsetVisible(fieldLayout)"}]},[n("legend",{staticClass:"SharpForm__label form-label"},[t._v(t._s(r.legend))]),t._v(" "),n("div",{staticClass:"card SharpForm__fieldset shadow-sm"},[n("div",{staticClass:"card-body"},[n("FieldsLayout",{attrs:{layout:r.fields},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.fieldLayout;return[t._t("default",null,{fieldLayout:n})]}}],null,!0)})],1)])])]:[t._t("default",null,{fieldLayout:r})]]}}])})}),[],!1,null,null,null).exports,Ce={name:"SharpListItem",extends:Se,mixins:[o.IE]},je=(0,dt.Z)(Ce,undefined,undefined,!1,null,null,null).exports;function xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ke(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:this.data,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.fieldLocale,o=this[t][e];return this.localized&&o.localized&&C(o)?j({localeObject:r[e],locale:i[e],value:n}):n},defaultFieldLocaleMap:function(t,e){var n=t.fields,r=t.locales;return Object.values(n).filter((function(t){var e;return"list"===t.type?Object.values(null!==(e=t.itemFields)&&void 0!==e?e:{}).some((function(t){return t.localized})):t.localized})).reduce((function(t,n){return ke(ke({},t),{},Pe({},n.key,e||r&&r[0]))}),{})}}}}var Ae={props:{field:Object,limit:Number,disabled:Boolean},data:function(){return{dragActive:!1}},computed:{classes:function(){return{"SharpListUpload--active":this.dragActive,"SharpListUpload--disabled":this.disabled}},text:function(){return this.getText({link:'$1'})},label:function(){return this.getText()},accept:function(){var t;return null===(t=this.field.fileFilter)||void 0===t?void 0:t.join(",")},helpText:function(){return(0,r.KQ)("form.list.bulk_upload.help_text").replace(":limit",this.limit)}},methods:{getText:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.link;return(0,r.KQ)("form.list.bulk_upload.text").replace(/\[(.+?)]\(.*?\)/,null!=e?e:"$1")},handleDragEnter:function(){this.dragActive=!0},handleDragLeave:function(){this.dragActive=!1},handleDrop:function(){this.dragActive=!1},handleTextClicked:function(){this.$refs.input.click()},handleChanged:function(t){this.$emit("change",t),t.target.value=""}}},Ee=Ae,Le=(0,dt.Z)(Ee,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-group-item text-muted SharpListUpload",class:t.classes},[n("div",{staticClass:"SharpListUpload__content d-flex align-items-center justify-content-center"},[n("div",{staticClass:"SharpListUpload__text"},[n("div",{staticClass:"row align-items-center gx-0"},[n("div",{staticClass:"col-auto"},[n("svg",{staticClass:"SharpListUpload__icon",attrs:{width:"2em",height:"2em",viewBox:"0 0 32 32"}},[n("path",{attrs:{d:"M26,24v4H6V24H4v4H4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2h0V24Z"}}),n("polygon",{attrs:{points:"26 14 24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14"}})])]),t._v(" "),n("div",{staticClass:"col"},[n("div",{domProps:{innerHTML:t._s(t.text)},on:{click:function(e){return e.preventDefault(),t.handleTextClicked.apply(null,arguments)}}})])])])]),t._v(" "),n("div",{staticClass:"SharpListUpload__help"},[t._v("\n "+t._s(t.helpText)+"\n ")]),t._v(" "),n("input",{ref:"input",staticClass:"SharpListUpload__input",attrs:{type:"file","aria-label":t.label,disabled:t.disabled,accept:t.accept,multiple:""},on:{change:t.handleChanged,dragenter:t.handleDragEnter,dragleave:t.handleDragLeave,drop:t.handleDrop}})])}),[],!1,null,null,null),Ie=Le.exports,Be=["_fieldsLocale"];function Fe(t){return function(t){if(Array.isArray(t))return Me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Te(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||Te(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){if(t){if("string"==typeof t)return Me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(t,e):void 0}}function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Ne={name:"SharpList",inject:["$form"],mixins:[o.WH,De("itemFields")],components:{ListUpload:Ie,Draggable:_e(),ListItem:je,Button:p.zx,TemplateRenderer:i.e},props:{fieldKey:String,fieldLayout:Object,value:Array,addable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},addText:{type:String,default:"Ajouter un élément"},itemFields:{type:Object,required:!0},collapsedItemTemplate:String,maxItemCount:Number,bulkUploadField:String,bulkUploadLimit:{type:Number,default:10},itemIdAttribute:String,readOnly:Boolean,locale:[String,Array]},data:function(){return{list:[],dragActive:!1,dragging:!1,lastIndex:0}},watch:{list:"handleListChanged",locale:"handleLocaleChanged"},computed:{classes:function(){return{"SharpList--can-sort":this.showSortButton,"SharpList--dragging":this.dragging}},dragOptions:function(){return{handle:this.dragActive?".SharpList__item":".SharpList__drag-handle",filter:".SharpListUpload"}},canAddItem:function(){return this.addable&&(this.list.length1},showRemoveButton:function(){return this.removable&&!this.isReadOnly},dragIndexSymbol:function(){return Symbol("dragIndex")},indexSymbol:function(){return Symbol("index")},hasPendingActions:function(){var t;return null===(t=this.$form)||void 0===t?void 0:t.hasUploadingFields(this.fieldKey)},isReadOnly:function(){return this.readOnly||this.dragActive},hasUpload:function(){var t;return"upload"===(null===(t=this.uploadField)||void 0===t?void 0:t.type)&&this.canAddItem&&this.uploadLimit>0},uploadField:function(){return this.bulkUploadField?this.itemFields[this.bulkUploadField]:null},uploadLimit:function(){if(this.maxItemCount){var t=this.maxItemCount-this.list.length;return Math.min(t,this.bulkUploadLimit)}return this.bulkUploadLimit}},methods:{handleListChanged:function(){this.$emit("locale-change",this.list.map((function(t){return t._fieldsLocale})))},handleLocaleChanged:function(t){var e=this;"string"==typeof t&&this.list.forEach((function(n){Object.assign(n,e.withLocale(null,t))}))},itemData:function(t){t._fieldsLocale;return Re(t,Be)},transformedFields:function(t){var e=this.list[t],n=this.itemData(e);return it(this.itemFields,n)},indexedList:function(){var t=this;return(this.value||[]).map((function(e,n){return t.withLocale(ze(Ke({},t.indexSymbol,n),e))}))},createItem:function(){var t;return Object.entries(this.itemFields).reduce((function(t,e){var n=$e(e,2),r=n[0],i=n[1];return t[r]="editor"===i.type?{}:null,t}),this.withLocale((Ke(t={},this.itemIdAttribute,null),Ke(t,this.indexSymbol,this.lastIndex++),t)))},insertNewItem:function(t,e){e.target&&e.target.blur(),this.list.splice(t,0,this.createItem())},add:function(){this.list.push(this.createItem())},remove:function(t){this.list.splice(t,1)},update:function(t){var e=this;return function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.forced,a=ze({},e.list[t]),l=ze(ze({},o?null:Y(e.itemFields,n,(function(){return e.fieldLocalizedValue(n,null,a,a._fieldsLocale)}))),{},Ke({},n,e.fieldLocalizedValue(n,r,a,a._fieldsLocale)));Object.assign(e.list[t],l)}},updateLocale:function(t,e,n){this.$set(this.list[t]._fieldsLocale,e,n),this.handleListChanged()},collapsedItemData:function(t){return ze({$index:t[this.dragIndexSymbol]},t)},toggleDrag:function(){var t=this;this.dragActive=!this.dragActive,this.list.forEach((function(e,n){return e[t.dragIndexSymbol]=n}))},withLocale:function(t,e){var n;return ze(ze({},t),{},{_fieldsLocale:this.defaultFieldLocaleMap({fields:this.itemFields,locales:null===(n=this.$form)||void 0===n?void 0:n.locales},e)})},handleUploadChanged:function(t){var e=this,n=Fe(t.target.files).slice(0,this.uploadLimit);if(t.target.files.length>this.uploadLimit){var i=(0,r.KQ)("form.list.bulk_upload.validation.limit").replace(":limit",this.uploadLimit);(0,r.wp)(i,{title:(0,r.KQ)("modals.error.title")})}n.forEach((function(t){var n=e.createItem();n[e.bulkUploadField]={file:t},e.list.push(n)}))},initList:function(){this.list=this.indexedList(),this.lastIndex=this.list.length,this.$emit("input",this.list)}},created:function(){var t;this.localized=null===(t=this.$form)||void 0===t?void 0:t.localized,this.initList()}},He=Ne,Ue=(0,dt.Z)(He,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpList",class:t.classes,on:{dragstart:function(e){t.dragging=!0},dragend:function(e){t.dragging=!1}}},[n("div",{staticClass:"SharpList__sticky-wrapper text-end"},[t.showSortButton?[n("Button",{staticClass:"SharpList__sort-button",staticStyle:{"pointer-events":"auto"},attrs:{text:"",small:"",active:t.dragActive},on:{click:t.toggleDrag}},[t._v("\n "+t._s(t.l("form.list.sort_button.inactive"))+"\n "),n("svg",{staticStyle:{"margin-left":".5em"},attrs:{width:"1.125em",height:"1.125em",viewBox:"0 0 24 22","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M20 14V0h-4v14h-4l6 8 6-8zM4 8v14h4V8h4L6 0 0 8z"}})])])]:t._e()],2),t._v(" "),n("Draggable",{ref:"draggable",attrs:{options:t.dragOptions,list:t.list},scopedSlots:t._u([t.showAddButton?{key:"footer",fn:function(){return[n("div",{class:{"mt-3":t.list.length>0||t.hasUpload}},[n("Button",{key:-1,staticClass:"SharpList__add-button",attrs:{disabled:t.isReadOnly,text:"",block:""},on:{click:t.add}},[t._v("\n + "+t._s(t.addText)+"\n ")])],1)]},proxy:!0}:null],null,!0)},[n("transition-group",{staticClass:"list-group shadow-sm",attrs:{name:"expand",tag:"div"}},[t._l(t.list,(function(e,r){return[n("div",{key:e[t.indexSymbol],staticClass:"SharpList__item list-group-item",class:{"SharpList__item--drag-active":t.dragActive}},[t.showInsertButton?[n("div",{staticClass:"SharpList__new-item-zone"},[n("Button",{attrs:{small:""},on:{click:function(e){return t.insertNewItem(r,e)}}},[t._v("\n "+t._s(t.l("form.list.insert_button"))+"\n ")])],1)]:t._e(),t._v(" "),t.dragActive&&t.collapsedItemTemplate?[n("TemplateRenderer",{attrs:{name:"CollapsedItem",template:t.collapsedItemTemplate,"template-data":t.collapsedItemData(e)}})]:[n("ListItem",{attrs:{layout:t.fieldLayout.item,"error-identifier":r},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.fieldLayout;return[n("FieldDisplay",{attrs:{"field-key":o.key,"context-fields":t.transformedFields(r),"context-data":e,"error-identifier":o.key,"config-identifier":o.key,"update-data":t.update(r),locale:e._fieldsLocale[o.key],"read-only":t.isReadOnly,list:!0},on:{"locale-change":function(e,n){return t.updateLocale(r,e,n)}}})]}}],null,!0)}),t._v(" "),t.showRemoveButton?[n("button",{staticClass:"SharpList__remove-button btn-close",attrs:{"aria-label":t.l("form.list.remove_button")},on:{click:function(e){return t.remove(r)}}})]:t._e()],t._v(" "),t.showSortButton?[n("div",{staticClass:"SharpList__drag-handle d-flex align-items-center px-1"},[n("i",{staticClass:"fas fa-grip-vertical opacity-25"})])]:t._e()],2)]})),t._v(" "),t.hasUpload?[n("ListUpload",{key:"upload",attrs:{field:t.uploadField,limit:t.uploadLimit,disabled:t.isReadOnly},on:{change:t.handleUploadChanged}})]:t._e()],2)],1),t._v(" "),t.readOnly&&!t.list.length?[n("em",{staticClass:"SharpList__empty-alert"},[t._v(t._s(t.l("form.list.empty")))])]:t._e()],2)}),[],!1,null,null,null).exports;function Ze(t,e,n){if(e){var r=document.querySelector('label[for="'.concat(e,'"]'));r&&(r.addEventListener("click",n),t.$on("hook:beforeDestroy",(function(){r.removeEventListener("click",n)})))}}var qe={components:{Multiselect:p.J,ClearButton:p.Cd},props:{id:String,value:[Array,String,Number],options:Array,labels:Object,multiple:Boolean,clearable:Boolean,placeholder:String,maxSelected:Number,readOnly:Boolean},computed:{multiselectOptions:function(){return this.options.map((function(t){return t.id}))},hasClearButton:function(){return this.clearable&&!this.multiple&&null!=this.value}},methods:{multiselectLabel:function(t){return this.labels[t]},remove:function(){this.$emit("input",null),this.$refs.multiselect.activate()},handleInput:function(t){this.$emit("input",t)}},mounted:function(){var t=this;Ze(this,this.id,(function(){t.$el.focus()}))}},Qe=(0,dt.Z)(qe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Multiselect",{ref:"multiselect",attrs:{id:t.id,value:t.value,searchable:!1,options:t.multiselectOptions,multiple:t.multiple,"hide-selected":t.multiple,"close-on-select":!t.multiple,"custom-label":t.multiselectLabel,placeholder:t.placeholder,disabled:t.readOnly,max:t.maxSelected,"allow-empty":t.clearable},on:{input:t.handleInput,open:function(e){return t.$emit("open")},close:function(e){return t.$emit("close")}},scopedSlots:t._u([t.hasClearButton?{key:"caret",fn:function(){return[n("ClearButton",{staticClass:"SharpSelect__clear-button",on:{click:t.remove}})]},proxy:!0}:null,{key:"tag",fn:function(e){var r=e.option,i=e.remove;return[n("span",{key:r,staticClass:"multiselect__tag"},[n("span",[t._v(t._s(t.multiselectLabel(r)))]),t._v(" "),n("i",{staticClass:"multiselect__tag-icon",attrs:{"aria-hidden":"true",tabindex:"1"},on:{keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),i(r))},mousedown:function(t){return t.preventDefault(),t.stopPropagation(),i(r)}}})])]}},{key:"option",fn:function(){return[t._t("option")]},proxy:!0}],null,!0)})}),[],!1,null,null,null).exports;function We(t,e){return null!=t.id&&null!=e&&t.id==e}function Ge(t){return function(t){if(Array.isArray(t))return Ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ye(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ye(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.maxSelected?(0,r.KQ)("form.select.validation.max_selected").replace(":max_selected",this.maxSelected):null}}},Xe=(0,dt.Z)(Je,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"card card-body form-control":t.root}},[n("div",{staticClass:"row gy-1 gx-3",class:t.inline?"row-cols-auto":"row-cols-1"},[t._l(t.options,(function(e,r){return[n("div",{staticClass:"col"},[n("Check",{key:e.id,staticClass:"mb-0",attrs:{id:t.checkboxId(r),value:t.isChecked(e),text:t.labels[e.id],"read-only":t.readOnly},on:{input:function(n){return t.handleCheckboxChanged(n,e)}}})],1)]}))],2),t._v(" "),t.showSelectAll?[n("div",{staticClass:"SharpSelect__links mt-3"},[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleSelectAllClicked.apply(null,arguments)}}},[t._v(t._s(t.lang("form.select.select_all")))])]),t._v(" "),n("div",{staticClass:"col-auto"},[n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleUnselectAllClicked.apply(null,arguments)}}},[t._v(t._s(t.lang("form.select.unselect_all")))])])])])]:t._e()],2)}),[],!1,null,null,null),tn=Xe.exports,en={props:{value:[String,Number],options:Array,labels:Object,uniqueIdentifier:String,readOnly:Boolean,inline:Boolean,root:Boolean},methods:{isSelected:function(t){return We(t,this.value)},handleRadioChanged:function(t){this.$emit("input",t.id)}}},nn=(0,dt.Z)(en,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"card card-body form-control":t.root}},[n("div",{staticClass:"row gy-1 gx-3",class:t.inline?"row-cols-auto":"row-cols-1"},[t._l(t.options,(function(e,r){return[n("div",{key:e.id,staticClass:"col"},[n("div",{staticClass:"form-check mb-0"},[n("input",{staticClass:"form-check-input",attrs:{type:"radio",tabindex:"0",id:t.uniqueIdentifier+"."+r,disabled:t.readOnly,name:t.uniqueIdentifier},domProps:{checked:t.isSelected(e),value:e.id},on:{change:function(n){return t.handleRadioChanged(e)}}}),t._v(" "),n("label",{staticClass:"form-check-label",attrs:{for:t.uniqueIdentifier+"."+r}},[t._v("\n "+t._s(t.labels[e.id])+"\n ")])])])]}))],2)])}),[],!1,null,null,null).exports,rn={name:"SharpSelect",mixins:[qt],props:{value:[Array,String,Number],uniqueIdentifier:String,options:{type:Array,required:!0,default:function(){return[]}},multiple:{type:Boolean,default:!1},display:{type:String,default:"dropdown"},clearable:{type:Boolean,default:!1},showSelectAll:{type:Boolean,default:!0},placeholder:{type:String,default:"-"},maxSelected:Number,readOnly:Boolean,inline:{type:Boolean,default:!0},root:Boolean},watch:{options:function(){this.init()}},computed:{classes:function(){return["SharpSelect--".concat(this.display),{"SharpSelect--multiple":this.multiple}]},component:function(){return"dropdown"===this.display?Qe:this.multiple?tn:nn},optionsLabel:function(){var t=this;return this.options.reduce((function(e,n){return e[n.id]=t.localizedOptionLabel(n),e}),{})}},methods:{handleInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.error;this.$emit("input",t,{error:n})},setDefault:function(){!this.clearable&&!this.multiple&&null==this.value&&this.options.length>0&&this.$emit("input",this.options[0].id,{force:!0})},init:function(){J(this,this.setDefault,{dependantAttributes:["options"]})},blur:function(){var t;null===(t=this.$refs.component.$refs)||void 0===t||t.multiselect.deactivate()}},created:function(){this.init()}},on=rn,an=(0,dt.Z)(on,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._b({ref:"component",tag:"component",staticClass:"SharpSelect",class:t.classes,attrs:{labels:t.optionsLabel},on:{input:t.handleInput}},"component",[t.$props,t.$attrs],!1))}),[],!1,null,null,null).exports,ln={name:"SharpHtml",components:{TemplateRenderer:i.e},props:{value:Object,template:String}},sn=(0,dt.Z)(ln,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("TemplateRenderer",{attrs:{name:"Html",template:t.template,"template-data":t.value}})}),[],!1,null,null,null).exports,un=n(36292),cn=["maxBounds"];function dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hn(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var pn={mapTypeControl:!1,streetViewControl:!1};function mn(t){var e=t;return Array.isArray(e)?new google.maps.LatLngBounds(e[0],e[1]):null}function vn(t){var e=t.maxBounds,n=function(t){for(var e=1;e0&&(e.search=t[0].address)})).finally((function(){e.loading=!1})))},handleSearchSubmitted:function(){var t=this,e=this.search;this.message="",this.loading=!0,Yn(this.geocodingProvider,{address:e},this.geocodingOptions).then((function(n){n.length>0?(t.currentLocation=n[0].location,t.currentBounds=n[0].bounds,t.$emit("change",t.currentLocation)):t.message=t.lSub("geocode_input.message.no_results").replace(":query",e||"")})).catch((function(e){t.message="".concat(t.lSub("geocode_input.message.error")).concat(e?" (".concat(e,")"):"")})).finally((function(){t.loading=!1}))}}},Xn=(0,dt.Z)(Jn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpGeolocationEdit",class:t.classes},[t.hasGeocoding?[n("div",{staticClass:"mb-2"},[n("form",{on:{submit:function(e){return e.preventDefault(),t.handleSearchSubmitted.apply(null,arguments)}}},[n("div",{staticClass:"row no-gutters"},[n("div",{staticClass:"col position-relative"},[n("TextField",{staticClass:"SharpGeolocationEdit__input",attrs:{value:t.search,placeholder:t.lSub("geocode_input.placeholder")},on:{input:t.handleSearchInput}}),t._v(" "),n("Loading",{staticClass:"SharpGeolocationEdit__loading",attrs:{visible:t.loading,small:""}})],1),t._v(" "),n("div",{staticClass:"col-auto pl-2"},[n("Button",{attrs:{outline:""}},[t._v(t._s(t.lSub("search_button")))])],1)])]),t._v(" "),t.message?[n("small",[t._v(t._s(t.message))])]:t._e()],2)]:t._e(),t._v(" "),n(t.editableMapComponent,{tag:"component",staticClass:"SharpGeolocationEdit__map",class:t.mapClasses,attrs:{"marker-position":t.currentLocation,center:t.center,bounds:t.currentBounds,zoom:t.zoom,"max-bounds":t.maxBounds,"tiles-url":t.tilesUrl},on:{change:t.handleMarkerPositionChanged}})],2)}),[],!1,null,null,null),tr=Xn.exports;function er(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var nr={name:"SharpGeolocation",mixins:[o.WH],inject:{$tab:{default:null}},components:{GeolocationEdit:tr,Button:p.zx,Modal:p.u_},props:{value:Object,readOnly:Boolean,uniqueIdentifier:String,geocoding:Boolean,apiKey:String,boundaries:Object,zoomLevel:{type:Number,default:4},initialPosition:{type:Object,default:function(){return{lat:46.1445458,lng:-2.4343779}}},displayUnit:{type:String,default:"DD",validator:function(t){return"DMS"===t||"DD"===t}},mapsProvider:{type:Object,default:function(){return{name:"gmaps"}}},geocodingProvider:{type:Object,default:function(){return{name:"gmaps"}}}},data:function(){return{ready:!1,modalVisible:!1,location:this.value}},computed:{isLoading:function(){return!this.ready},isEmpty:function(){return!this.value},latLngString:function(){return"DMS"===this.displayUnit?{lat:Mn(this.value.lat),lng:Mn(this.value.lng,!0)}:"DD"===this.displayUnit?this.value:void 0},mapComponent:function(){return"gmaps"===(t=Vn(this.mapsProvider))?_n:"osm"===t?Tn:void 0;var t},mapClasses:function(){return["SharpGeolocation__map--".concat(Vn(this.mapsProvider))]},tilesUrl:function(){return Kn(zn(this.mapsProvider))},maxBounds:function(){return this.boundaries?[this.boundaries.sw,this.boundaries.ne]:null},modalTitle:function(){return this.geocoding?this.l("form.geolocation.modal.title"):this.l("form.geolocation.modal.title-no-geocoding")}},methods:{providerName:Vn,providerOptions:zn,handleModalSubmitted:function(){this.$emit("input",this.location)},handleRemoveButtonClicked:function(){this.$emit("input",null)},handleShowModalButtonClicked:function(){this.modalVisible=!0},handleEditButtonClicked:function(){this.modalVisible=!0},handleLocationChanged:function(t){this.location=t},loadProvider:function(t){var e,n=Vn(t),r=zn(t).apiKey;return e={apiKey:r},"gmaps"===n?Promise.resolve(Dn(e)):Promise.resolve()},init:function(){var t,e=this;return(t=l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadProvider(e.mapsProvider);case 2:if(!e.geocodingProvider){t.next=5;break}return t.next=5,e.loadProvider(e.geocodingProvider);case 5:e.ready=!0;case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){er(o,r,i,a,l,"next",t)}function l(t){er(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.init()},mounted:function(){var t;null===(t=this.$tab)||void 0===t||t.$once("active",(function(){Rn()}))}},rr=nr,ir=(0,dt.Z)(rr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpGeolocation"},[t.isLoading?[t._v("\n "+t._s(t.l("form.geolocation.loading"))+"\n ")]:t.isEmpty?[n("Button",{attrs:{text:"",block:""},on:{click:t.handleShowModalButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.browse_button"))+"\n ")])]:[n("div",{staticClass:"card card-body form-control"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-7"},[n(t.mapComponent,{tag:"component",staticClass:"SharpGeolocation__map",class:t.mapClasses,attrs:{"marker-position":t.value,center:t.value,zoom:t.zoomLevel,"max-bounds":t.maxBounds,"tiles-url":t.tilesUrl}})],1),t._v(" "),n("div",{staticClass:"col-5 pl-0"},[n("div",{staticClass:"d-flex flex-column justify-content-between h-100"},[n("div",[n("div",[n("small",[t._v("Latitude : "+t._s(t.latLngString.lat))])]),t._v(" "),n("div",[n("small",[t._v("Longitude : "+t._s(t.latLngString.lng))])])]),t._v(" "),n("div",[n("Button",{staticClass:"remove-button",attrs:{variant:"danger",small:"",outline:"",disabled:t.readOnly},on:{click:t.handleRemoveButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.remove_button"))+"\n ")]),t._v(" "),n("Button",{attrs:{small:"",outline:"",disabled:t.readOnly},on:{click:t.handleEditButtonClicked}},[t._v("\n "+t._s(t.l("form.geolocation.edit_button"))+"\n ")])],1)])])])])],t._v(" "),n("Modal",{attrs:{title:t.modalTitle,visible:t.modalVisible,"no-close-on-backdrop":""},on:{"update:visible":function(e){t.modalVisible=e},ok:t.handleModalSubmitted}},[n("transition",{attrs:{duration:300}},[t.modalVisible?[n("GeolocationEdit",{attrs:{location:t.value,center:t.value||t.initialPosition,zoom:t.zoomLevel,"max-bounds":t.maxBounds,"maps-provider":t.providerName(t.mapsProvider),"maps-options":t.providerOptions(t.mapsProvider),geocoding:t.geocoding,"geocoding-provider":t.providerName(t.geocodingProvider),"geocoding-options":t.providerOptions(t.geocodingProvider)},on:{change:t.handleLocationChanged}})]:t._e()],2)],1)],2)}),[],!1,null,null,null).exports,or=n(27935),ar=n(42752);function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sr(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n> ").concat(e.name),{isError:!0,title:(0,r.KQ)("modals.error.title")})},handleUpdated:function(t){this.updateAttributes({filters:t.filters}),this.node.attrs.file||this.extension.options.onUpdate(t)},handleSuccess:function(t){this.updateAttributes(vr(vr({},t),{},{file:null,uploaded:!0})),this.extension.options.onSuccess(t)},init:function(){var t,e=this;return(t=l().mark((function t(){var n;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.node.attrs.file&&!e.node.attrs.notFound){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.extension.options.registerFile(e.value);case 4:(n=t.sent)?e.updateAttributes(n):e.updateAttributes({notFound:!0});case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){pr(o,r,i,a,l,"next",t)}function l(t){pr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.init()},beforeDestroy:function(){this.node.attrs.file||this.extension.options.onRemove(this.value)}},gr=yr,wr=(0,dt.Z)(gr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeRenderer",{staticClass:"editor__node",attrs:{node:t.node}},[n("VueClip",t._b({attrs:{value:t.value,root:!1,options:t.options,invalid:!!t.error,"persist-thumbnails":""},on:{thumbnail:t.handleThumbnailChanged,updated:t.handleUpdated,removed:t.handleRemoveClicked,success:t.handleSuccess,error:t.handleError}},"VueClip",t.fieldProps,!1)),t._v(" "),t.error?[n("div",{staticClass:"invalid-feedback d-block",staticStyle:{"font-size":".75rem"}},[t._v("\n "+t._s(t.error)+"\n ")])]:t._e()],2)}),[],!1,null,null,null).exports,_r=n(2376);function Or(t){return function(t){if(Array.isArray(t))return Sr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n').concat(r||n,"")).run():t.chain().focus().setLink({href:n}).run()},isActive:function(t){return t.isActive("link")},icon:Dr("link"),label:(0,r.KQ)("form.editor.toolbar.link.title")},"upload-image":{command:function(t){return t.chain().focus().newUpload().run()},isActive:function(t){return t.isActive("upload")||t.isActive("image")},icon:Dr("image"),label:(0,r.KQ)("form.editor.toolbar.upload_image.title")},upload:{command:function(t){return t.chain().focus().newUpload().run()},isActive:function(t){return t.isActive("upload")},icon:Dr("document"),label:(0,r.KQ)("form.editor.toolbar.upload.title")},"horizontal-rule":{command:function(t){return t.chain().focus().setHorizontalRule().run()},isActive:function(t){return t.isActive("horizontalRule")},icon:Dr("hr"),label:(0,r.KQ)("form.editor.toolbar.horizontal_rule.title")},iframe:{command:function(t){return t.chain().focus().insertIframe().run()},isActive:function(t){return t.isActive("iframe")},icon:Dr("iframe"),label:(0,r.KQ)("form.editor.toolbar.iframe.title")},table:{command:function(t){return t.chain().focus().insertTable().run()},isActive:function(t){return t.isActive("table")},icon:Dr("table")},html:{command:function(t){return t.chain().focus().insertHtml().run()},isActive:function(t){return t.isActive("html")},icon:Dr("html")},"code-block":{command:function(t){return t.chain().focus().toggleCodeBlock().run()},isActive:function(t){return t.isActive("codeBlock")},icon:Dr("code-block")},superscript:{command:function(t){return t.chain().focus().toggleSuperscript().run()},isActive:function(t){return t.isActive("superscript")},icon:Dr("superscript")},undo:{command:function(t){return t.chain().undo().run()},icon:Dr("undo"),label:(0,r.KQ)("form.editor.toolbar.undo.title")},redo:{command:function(t){return t.chain().redo().run()},icon:Dr("redo"),label:(0,r.KQ)("form.editor.toolbar.redo.title")}},Er=n(16248),Lr=n(57883),Ir={components:{Button:p.zx,Dropdown:p.Lt,BDropdownForm:Er.N,BFormGroup:Lr.x,TextInput:yt},props:{id:String,active:Boolean,editor:Object},data:function(){return{label:null,href:null,hasSelectedText:!1,inserted:!1,selection:null}},computed:{hasLabelInput:function(){return!this.active&&!this.hasSelectedText},isEdit:function(){return this.inserted}},methods:{lang:r.KQ,fieldId:function(t){return"".concat(this.id,"-").concat(t)},hide:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.dropdown.hide(),t&&this.editor.chain().focus().run()},handleDropdownShow:function(){var t=this.editor.state.selection;if(this.href=null,this.inserted=!1,this.hasSelectedText=!t.empty,this.active){var e=this.editor.getAttributes("link");this.href=null==e?void 0:e.href,this.inserted=!0}this.hasSelectedText&&(this.editor.commands.setLink({href:"#"}),this.selection={from:t.from,to:t.to})},handleDropdownShown:function(){var t=this;setTimeout((function(){t.$refs.input.focus()}),0)},handleDropdownHide:function(){if(!this.inserted&&this.hasSelectedText){var t=this.editor.state.selection,e=t.from,n=t.to;this.editor.chain().setTextSelection(this.selection.from,this.selection.to).unsetLink().setTextSelection(e,n).run()}},handleCancelClicked:function(){this.hide()},handleLinkSubmitted:function(){this.href?(this.$emit("submit",{href:this.href,label:this.label}),this.inserted=!0):this.hide()},handleRemoveClicked:function(){this.$emit("remove")}}},Br=Ir,Fr=(0,dt.Z)(Br,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown editor__dropdown--link",attrs:{variant:"light",active:t.active},on:{show:t.handleDropdownShow,shown:t.handleDropdownShown,hide:t.handleDropdownHide},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("default")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[n("b-dropdown-form",{on:{submit:function(e){return e.preventDefault(),t.handleLinkSubmitted.apply(null,arguments)}}},[t.isEdit?[n("button",{staticClass:"btn-close position-absolute end-0 top-0 p-2 fs-8",attrs:{type:"button"},on:{click:t.handleCancelClicked}},[n("span",{staticClass:"visually-hidden"},[t._v(t._s(t.lang("modals.cancel_button","Cancel")))])])]:t._e(),t._v(" "),t.hasLabelInput?[n("div",{staticClass:"mb-3"},[n("label",{staticClass:"form-label",attrs:{for:t.fieldId("label")}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.text_label","Text"))+"\n ")]),t._v(" "),n("TextInput",{attrs:{id:t.fieldId("label")},model:{value:t.label,callback:function(e){t.label=e},expression:"label"}})],1)]:t._e(),t._v(" "),n("div",{staticClass:"mb-3"},[n("label",{staticClass:"form-label",attrs:{for:t.fieldId("href")}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.url_label","URL"))+"\n ")]),t._v(" "),n("TextInput",{ref:"input",attrs:{id:t.fieldId("href"),placeholder:"https://example.org",autocomplete:"off"},model:{value:t.href,callback:function(e){t.href=e},expression:"href"}})],1),t._v(" "),n("div",{staticClass:"mt-3"},[n("div",{staticClass:"row g-2 flex-sm-nowrap"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{type:"submit",small:"",variant:"primary"}},[t.isEdit?[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.update_button","Update"))+"\n ")]:[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.insert_button","Insert link"))+"\n ")]],2)],1),t._v(" "),n("div",{staticClass:"col-auto"},[t.isEdit?[n("Button",{attrs:{type:"button",small:"",variant:"danger",outline:""},on:{click:t.handleRemoveClicked}},[t._v("\n "+t._s(t.lang("form.editor.dialogs.link.remove_button","Remove link"))+"\n ")])]:[n("Button",{attrs:{type:"button",small:"",variant:"light"},on:{click:t.handleCancelClicked}},[t._v("\n "+t._s(t.lang("modals.cancel_button","Cancel"))+"\n ")])]],2)])])],2)]}}],null,!0)},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null),$r=Fr.exports,Tr={components:{Button:p.zx,Dropdown:p.Lt,DropdownItem:p.hP,DropdownSeparator:p.u2},props:{id:String,active:Boolean,editor:Object},data:function(){return{}},methods:{lang:r.KQ,handleInsertClicked:function(){var t=this;this.command((function(){t.editor.chain().focus().insertTable().run()}))},command:function(t){var e=this;t(),setTimeout((function(){e.editor.chain().focus().run()}),0)}}},Mr=(0,dt.Z)(Tr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown editor__dropdown--table",attrs:{variant:"light",active:t.active},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("default")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[n("DropdownItem",{attrs:{disabled:t.editor.isActive("table")},on:{click:t.handleInsertClicked}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_table","Insert table"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addRowBefore()},on:{click:function(e){t.command((function(){return t.editor.chain().addRowBefore().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_row_above","Insert row above"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addRowAfter()},on:{click:function(e){t.command((function(){return t.editor.chain().addRowAfter().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_row_below","Insert row below"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteRow()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteRow().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_row","Remove row"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addColumnBefore()},on:{click:function(e){t.command((function(){return t.editor.chain().addColumnBefore().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_col_left","Insert column to the left"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().addColumnAfter()},on:{click:function(e){t.command((function(){return t.editor.chain().addColumnAfter().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.insert_col_right","Insert column to the right"))+"\n ")]),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteColumn()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteColumn().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_col","Remove column"))+"\n ")]),t._v(" "),n("DropdownSeparator"),t._v(" "),n("DropdownItem",{attrs:{disabled:!t.editor.can().deleteTable()},on:{click:function(e){t.command((function(){return t.editor.chain().deleteTable().run()}))}}},[t._v("\n "+t._s(t.lang("form.editor.dropdown.table.remove_table","Remove table"))+"\n ")])]}}],null,!0)},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Vr={components:{Dropdown:p.Lt,DropdownItem:p.hP},props:{id:String,editor:Object,options:Array},data:function(){return{}},computed:{disabled:function(){return this.options.every((function(t){return t.disabled}))}},methods:{runCommand:function(t){var e=this;t.command(),setTimeout((function(){e.editor.chain().focus().run()}),0)}}},zr=(0,dt.Z)(Vr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown",attrs:{variant:"light",small:"",disabled:t.disabled},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n Options\n ")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[t._l(t.options,(function(e){return[n("DropdownItem",{attrs:{disabled:e.disabled},on:{click:function(n){return t.runCommand(e)}}},[t._v("\n "+t._s(e.label)+"\n ")])]}))]}}])},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Kr={components:{Dropdown:p.Lt,DropdownItem:p.hP},props:{embeds:Array,editor:Object},methods:{lang:r.KQ,handleClicked:function(t){this.editor.chain().focus().insertEmbed({embedKey:t.key}).run()}}},Rr=(0,dt.Z)(Kr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({ref:"dropdown",staticClass:"editor__dropdown",attrs:{variant:"light",small:""},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.lang("form.editor.dropdown.embeds"))+"\n ")]},proxy:!0},{key:"default",fn:function(e){e.hide;return[t._l(t.embeds,(function(e){return[n("DropdownItem",{on:{click:function(n){return t.handleClicked(e)}}},[t._v("\n "+t._s(e.label)+"\n ")])]}))]}}])},"Dropdown",t.$attrs,!1))}),[],!1,null,null,null).exports,Nr=["upload"];function Hr(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ur(t){return function(t){if(Array.isArray(t))return Zr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Zr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?[n("div",{staticClass:"btn-group"},[n("OptionsDropdown",{attrs:{options:t.options,editor:t.editor}})],1)]:t._e(),t._v(" "),t.customEmbeds&&t.customEmbeds.length>0?[n("div",{staticClass:"btn-group"},[n("EmbedDropdown",{attrs:{embeds:t.customEmbeds,editor:t.editor}})],1)]:t._e()],2)])}),[],!1,null,null,null).exports,Wr=n(37400);function Gr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Yr(t){return function(t){if(Array.isArray(t))return Jr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.maxLength?(0,r.KQ)("form.text.validation.maxlength").replace(":maxlength",this.maxLength):null},handleFocus:function(){this.firstFocus=!1},focus:function(){var t=this.firstFocus?"end":null;this.editor.commands.focus(t)},handleSelectionUpdated:function(){var t=this.editor.state.selection,e=t.from,n=t.to,r=Math.min(e,n),i=this.editor.view.coordsAtPos(r);if(this.toolbar){var o=this.$refs.header.getBoundingClientRect();i.topt.maxLength}},[t._v("\n "+t._s(t.lang("form.editor.character_count").replace(":count",t.characterCount+" / "+t.maxLength))+"\n ")])]:[t._v("\n "+t._s(t.lang("form.editor.character_count").replace(":count",t.characterCount))+"\n ")]],2)]:t._e()],2)])}),[],!1,null,null,null).exports,ni=n(12806);function ri(t){return function(t){if(Array.isArray(t))return ii(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ii(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ii(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ii(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n',rows:"6"},domProps:{value:t.html},on:{input:[function(e){e.target.composing||(t.html=e.target.value)},t.handleInput],paste:t.handleChanged,focus:function(t){return t.target.select()}}}),t._v(" "),t.previewHtml&&!t.invalid?[n("div",{staticClass:"iframe-node__modal-renderer mt-3",domProps:{innerHTML:t._s(t.previewHtml)}})]:t._e()],2)],2)}),[],!1,null,null,null).exports,ci=ar.NB.create({name:"iframe",group:"block",atom:!0,addOptions:function(){return{HTMLAttributes:{class:"iframe-wrapper"}}},addAttributes:function(){return{src:{default:null},frameborder:{default:0},width:{default:null},height:{default:null},allow:{default:null},allowfullscreen:{default:null},isNew:{default:!1,renderHTML:function(){return null}}}},parseHTML:function(){return[{tag:"iframe"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["div",this.options.HTMLAttributes,["iframe",e]]},addPasteRules:function(){var t=this;return[new ar.hD({find:/(?:^|\s)().*/g,handler:function(e){e.state;var n=e.range,r=e.match[1];setTimeout((function(){t.editor.commands.insertContentAt(n,r)}))}})]},addCommands:function(){var t=this;return{insertIframe:function(){return function(e){var n=e.commands,r=e.tr;return n.insertContentAt(r.selection.to,{type:t.name,attrs:{isNew:!0}})}}}},addNodeView:function(){return(0,or.uf)(ui)}}),di=n(91382),fi=n(7490),hi=n(35525),pi=n(99404),mi=n(26761),vi=n(25748),bi=n(93237),yi=n(60363),gi=n(33991),wi=n(43626),_i=n(658),Oi=n(50601),Si=n(83416),Ci=n(41705),ji=n(84348),xi=ar.hj.create({name:"selected",addProseMirrorPlugins:function(){return[new _r.Sy({props:{decorations:function(t){var e=t.selection,n=[];return t.doc.nodesBetween(e.from,e.to,(function(t,e){t.isBlock&&n.push(ji.p.node(e,e+t.nodeSize,{class:"selected"}))})),ji.EH.create(t.doc,n)}}})]}});function ki(t){return function(t){if(Array.isArray(t))return Pi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Pi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n");return(new window.DOMParser).parseFromString(e,"text/html").body}function Ai(t,e){var n=ni.aw.fromSchema(e),r=Di(t.outerHTML);return n.parseSlice(r).content}function Ei(t,e){return ki(t.children).forEach((function(t){var n;if(t.hasAttribute("data-html-content")&&1===t.children.length)null!==(n=Ai(t.firstElementChild,e).firstChild)&&void 0!==n&&n.type.name.startsWith("embed:")&&t.parentElement.replaceChild(t.firstElementChild,t);else if(!Ai(t,e).size){var r=document.createElement("div");r.setAttribute("data-html-content","true"),t.parentElement.replaceChild(r,t),r.appendChild(t)}})),t.innerHTML}var Li={components:{NodeViewWrapper:or.T5,Button:p.zx,Modal:p.u_},props:{node:Object,editor:Object,updateAttributes:Function,selected:Boolean,deleteNode:Function},data:function(){return{editContent:null,editVisible:this.node.attrs.new}},methods:{lang:r.KQ,handleEditClicked:function(){this.editContent=this.node.attrs.content,this.$refs.modal.show()},handleModalOk:function(){var t=Di(this.editContent).innerHTML;this.updateAttributes({content:t,new:!1})},handleModalShown:function(t){t.target.querySelector("textarea").focus()},handleModalHidden:function(){var t=this;this.node.attrs.content||this.deleteNode(),setTimeout((function(){t.editor.commands.focus()}))}}},Ii=(0,dt.Z)(Li,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeViewWrapper",[n("div",{staticClass:"card editor__node html-node",class:{"shadow border-primary":t.selected}},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("pre",{staticClass:"mb-0"},[t._v(t._s(t.node.attrs.content))])]),t._v(" "),n("div",{staticClass:"col-auto me-n2 my-n2"},[n("Button",{attrs:{small:"",variant:"light"},on:{click:t.handleEditClicked}},[n("i",{staticClass:"fas fa-pencil-alt fs-7"})])],1)])])]),t._v(" "),n("Modal",{ref:"modal",attrs:{visible:t.editVisible},on:{"update:visible":function(e){t.editVisible=e},ok:t.handleModalOk,hidden:t.handleModalHidden,shown:t.handleModalShown},scopedSlots:t._u([{key:"title",fn:function(){return[t.node.attrs.new?[t._v("\n "+t._s(t.lang("form.editor.dialogs.raw_html.insert_title"))+"\n ")]:[t._v("\n "+t._s(t.lang("form.editor.dialogs.raw_html.edit_title"))+"\n ")]]},proxy:!0}])},[t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.editContent,expression:"editContent"}],staticClass:"form-control",attrs:{rows:"6"},domProps:{value:t.editContent},on:{input:function(e){e.target.composing||(t.editContent=e.target.value)}}})])],1)}),[],!1,null,null,null).exports,Bi=ar.NB.create({name:"html-content",group:"block",onBeforeCreate:function(){var t,e;this.editor.storage.markdown||this.editor.setOptions({content:(t=this.editor.options.content,e=this.editor.schema,Ei(Di(t),e))})},addStorage:function(){return{markdown:{parse:{updateDOM:function(t){Ei(t,this.editor.schema)}}}}},addAttributes:function(){return{content:{default:"",parseHTML:function(t){return t.innerHTML.trim()}},new:{default:!1}}},renderHTML:function(t){var e=t.node,n=document.createElement("div");return n.setAttribute("data-html-content","true"),n.innerHTML=e.attrs.content,n},parseHTML:function(){return[{tag:"[data-html-content]"}]},addCommands:function(){var t=this;return{insertHtml:function(){return function(e){return e.commands.insertContent({type:t.name,attrs:{new:!0}})}}}},addNodeView:function(){return(0,or.uf)(Ii)}});function Fi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return $i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n"),n.parseSlice(i,{preserveWhitespace:!0,context:r})}return null},transformPastedHTML:function(e){return t.options.inline?e.replace(/<\/p>\s*]*>/g,"

").replace(/]*>/g,"").replace(/<\/p>/g,""):e}}})]}});var Ri=ar.vc.create({name:"small",parseHTML:function(){return[{tag:"small"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["small",(0,ar.P1)(this.options.HTMLAttributes,e),0]},addCommands:function(){var t=this;return{toggleSmall:function(){return function(e){return e.commands.toggleMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-s":function(){return t.editor.commands.toggleSmall()}}}}),Ni=n(88776);function Hi(t,e){return!t||t.some((function(t){return t===e}))}function Ui(t){return function(t){if(Array.isArray(t))return Zi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Zi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)){t.next=6;break}return t.next=3,d(a.registeredFiles);case 3:e=t.sent,c(e),a.onResolve();case 6:a.created=!0,a.registeredFiles=[];case 8:case"end":return t.stop()}}),t)}))))},h={fieldProps:Gi(Gi({},n),{},{uniqueIdentifier:r,fieldConfigIdentifier:i}),state:a,registerFile:(s=Qi(l().mark((function t(n){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a.created){t.next=3;break}return c([].concat(Ui(e.value.files),[n])),t.abrupt("return",n);case 3:return a.registeredFiles.push(n),t.next=6,a.resolved;case 6:return t.abrupt("return",e.value.files.find((function(t){return(0,St.TS)(n,t)})));case 7:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)}),onSuccess:function(t){c([].concat(Ui(e.value.files),[t]))},onRemove:function(t){c(e.value.files.filter((function(e){return!(0,St.TS)(e,t)})))},onUpdate:function(t){c(e.value.files.map((function(e){return(0,St.TS)(e,t)?t:e})))}};return jr.extend(f).configure(h)}function Xi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function to(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eo(t){if(!t)return fi.X;var e=function(t){return t.map((function(t){return t.match(/^heading-(\d)$/)})).filter((function(t){return!!t})).map((function(t){return Number(t[1])}))}(t);return e.length>0?fi.X.configure({levels:e}):void 0}function no(t){if(Hi(t,"link"))return pi.r.configure({openOnClick:!1,HTMLAttributes:{rel:null,target:null}})}function ro(t){if(Hi(t,"horizontal-rule"))return vi.b.extend({selectable:!1})}function io(t){if(Hi(t,"table"))return[yi.iA,gi.S,wi.x,_i.p]}function oo(t){if(t)return bi.V.configure({placeholder:t})}function ao(t){if(Hi(t,"iframe"))return ci}function lo(t){if(Hi(t,"highlight"))return Oi.y$}function so(t){if(Hi(t,"small"))return Ri}function uo(t){if(Hi(t,"code-block"))return Si.dn}function co(t){if(Hi(t,"superscript"))return Ci.$}function fo(t){var e=t.toolbar,n=t.inline,r=bo({toolbar:null!=e?e:[],inline:n}),i=(0,ar.J1)(r);return Ki.configure({schema:i,inline:n})}function ho(t){var e=t.inline;return hi.U.extend({addKeyboardShortcuts:function(){var t=this;return e?function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n").concat(t.innerHTML),i.remove())}}))}(e),function(t){ko(t).forEach((function(e){if(function(t){Co(t.childNodes).reverse().slice(0,2).filter((function(t){var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,"br")})).forEach((function(t){t.nextSibling||t.remove()}))}(e),e.childNodes.length){var n=document.createElement("p");n.innerHTML=e.innerHTML,t.replaceChild(n,e)}else e.remove()}))}(e),e.innerHTML}function ko(t){return Co(t.children).filter((function(t){return t.matches("div")&&!t.attributes.length}))}var Po={props:{editor:Object,name:String,value:Object,locales:Array,locale:String,createEditor:Function},data:function(){return{localizedEditors:{}}},methods:{isActive:function(t){return this.locale===t}},created:function(){var t=this;!this.editor&&this.locales&&(this.localizedEditors=Object.fromEntries(this.locales.map((function(e){var n,r,i;return[e,t.createEditor({content:null!==(n=null===(r=t.value)||void 0===r||null===(i=r.text)||void 0===i?void 0:i[e])&&void 0!==n?n:null})]}))))},beforeDestroy:function(){Object.values(this.localizedEditors).forEach((function(t){t.destroy()}))}},Do=(0,dt.Z)(Po,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.editor?[t._t("default",null,{editor:t.editor}),t._v(" "),n("input",{attrs:{type:"hidden",name:t.name},domProps:{value:t.value&&t.value.text}})]:[t._l(t.locales,(function(e){return[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive(e),expression:"isActive(locale)"}],key:e},[t._t("default",null,{editor:t.localizedEditors[e],locale:e})],2)]}))]],2)}),[],!1,null,null,null).exports;function Ao(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Eo(t){for(var e=1;e/g,""):t.replace(/(

\s*<\/p>)+$/,"")}(e.getHTML(),{inline:this.inline}));this.$emit("input",this.localizedValue(i,n),{error:r})},createEditor:function(t){var e=t.content;return new or.ML(Eo(Eo({},yo),{},{extensions:this.extensions,content:xo(e),editable:!this.readOnly}))}},created:function(){this.isLocalized||(this.editor=this.createEditor({content:this.localizedText}))},beforeDestroy:function(){var t;null===(t=this.editor)||void 0===t||t.destroy()}},Bo=(0,dt.Z)(Io,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("LocalizedEditors",{attrs:{editor:t.editor,name:t.uniqueIdentifier,value:t.value,locale:t.locale,locales:t.locales,"create-editor":t.createEditor},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.editor,i=e.locale;return[n("SharpEditor",t._b({attrs:{editor:r},on:{update:function(e){return t.handleUpdate(Object.assign({},{editor:r,locale:i},e))}}},"SharpEditor",t.$props,!1))]}}])})],1)}),[],!1,null,null,null).exports,Fo=n(3695);function $o(t){return function(t){if(Array.isArray(t))return To(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return To(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return To(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function To(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==n[2]?n[2]:{},a=o.forced,r.data=Qo(Qo(Qo({},r.data),a?null:Y(r.fields,t,(function(t){return r.fieldLocalizedValue(t.key,null)}))),{},Wo({},t,r.fieldLocalizedValue(t,e)));case 2:case"end":return i.stop()}}),i)})))()},updateVisibility:function(t,e){this.$set(this.fieldVisible,t,e)},updateLocale:function(t,e){this.$set(this.fieldLocale,t,e)},updateFieldError:function(t,e){e&&(e[ea]=!0),this.errors=Qo(Qo({},this.errors),{},Wo({},t,e))},handleLocaleChanged:function(t){this.fieldLocale=this.defaultFieldLocaleMap({fields:this.fields,locales:this.locales},t)},mount:function(t){var e=t.fields,n=t.layout,r=t.data,i=t.authorizations,o=t.locales,a=t.breadcrumb,l=t.config;this.fields=e,this.data=null!=r?r:{},this.layout=this.patchLayout(n),this.locales=o,this.authorizations=null!=i?i:{},this.breadcrumb=a,this.config=null!=l?l:{},e&&(this.fieldVisible=Object.keys(this.fields).reduce((function(t,e){return t[e]=!0,t}),{}),this.fieldLocale=this.defaultFieldLocaleMap({fields:e,locales:o})),this.validate()},validate:function(){var t;Object.keys(this.fieldLocale).length>0&&!this.locales.length&&(t="Some fields are localized but the form hasn't any locales configured",(0,r.wp)(t,{title:"Data error",isError:!0}))},handleError:function(t){var e;return 422===(null===(e=t.response)||void 0===e?void 0:e.status)&&(this.errors=t.response.data.errors||{}),Promise.reject(t)},patchLayout:function(t){if(!t)return null;this.noTabs&&(t={tabs:[{columns:[{fields:t}]}]});var e=0,n=function t(n){n.legend?n.id="".concat(e++,"#").concat(n.legend):n.fields&&n.fields.forEach((function(e){e.forEach(t)}))};return t.tabs.forEach((function(t){return t.columns.forEach(n)})),t},serialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;return Object.fromEntries(Object.entries(null!=e?e:{}).filter((function(e){var n,r=Zo(e,1)[0];return"html"!==(null===(n=t.fields[r])||void 0===n?void 0:n.type)})))},setLoading:function(t){this.$emit("loading",t),this.loading=t},get:function(){var t=this;return this.axiosInstance.get(this.apiPath,{params:this.apiParams}).then((function(e){return t.mount(e.data),t.$emit("update:form",e.data),e})).catch((function(e){return t.$emit("error",e),Promise.reject(e)}))},init:function(){var t=this;return Yo(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.independant){e.next=5;break}t.mount(t.form),t.ready=!0,e.next=12;break;case 5:if(!t.entityKey){e.next=11;break}return e.next=8,t.get();case 8:t.ready=!0,e.next=12;break;case 11:(0,r.H)("no entity key provided");case 12:case"end":return e.stop()}}),e)})))()},redirectForResponse:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.replace,r=t.data.redirectUrl;n?location.replace(r):location.href=r},redirectToParentPage:function(){location.href=(0,r.Z_)(this.breadcrumb.items)},submit:function(){var t=arguments,e=this;return Yo(l().mark((function n(){var r,i,o,a,s;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.length>0&&void 0!==t[0]?t[0]:{},i=r.postFn,!e.isUploading){n.next=3;break}return n.abrupt("return");case 3:return e.setLoading(!0),o=e.serialize(),a=function(){return i?i(o):e.post(e.apiPath,o)},n.next=8,a().catch(e.handleError).finally((function(){e.setLoading(!1)}));case 8:if(s=n.sent,!e.independant){n.next=12;break}return e.$emit("submit",s),n.abrupt("return",s);case 12:e.setLoading(!0),e.$store.dispatch("setLoading",!0),e.redirectForResponse(s);case 15:case"end":return n.stop()}}),n)})))()},handleSubmitClicked:function(){this.submit().catch((function(){}))},handleDeleteClicked:function(){var t=this;return Yo(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.deleteConfirmationText){e.next=3;break}return e.next=3,(0,r.i0)(t.config.deleteConfirmationText,{okTitle:(0,r.KQ)("modals.confirm.delete.ok_button"),okVariant:"danger"});case 3:t.axiosInstance.delete(t.apiPath).then((function(e){t.redirectForResponse(e,{replace:!0})}));case 4:case"end":return e.stop()}}),e)})))()},handleCancelClicked:function(){this.redirectToParentPage()},setUploading:function(t,e){this.uploadingFields=Qo(Qo({},this.uploadingFields),{},Wo({},t,e))},hasUploadingFields:function(t){return Object.entries(this.uploadingFields).some((function(e){var n=Zo(e,2),r=n[0],i=n[1];return r.startsWith("".concat(t,"."))&&i}))}},created:function(){this.init()}},ra=na,ia=(0,dt.Z)(ra,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpForm",attrs:{"data-popover-boundary":""}},[t._t("action-bar",null,{props:t.actionBarProps,listeners:t.actionBarListeners}),t._v(" "),t.ready?[t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),t.hasErrors&&t.showAlert?[n("div",{staticClass:"alert alert-danger SharpForm__alert",attrs:{role:"alert"}},[n("div",{staticClass:"fw-bold"},[t._v(t._s(t.l("form.validation_error.title")))]),t._v(" "),n("div",[t._v(t._s(t.l("form.validation_error.description")))])])]:t._e(),t._v(" "),n("TabbedLayout",{ref:"tabbedLayout",attrs:{layout:t.layout},scopedSlots:t._u([t.localized?{key:"nav-prepend",fn:function(){return[n("LocaleSelect",{attrs:{locale:t.currentLocale,locales:t.locales},on:{change:t.handleLocaleChanged}})]},proxy:!0}:null,{key:"default",fn:function(e){var r=e.tab;return[n("Grid",{ref:"columnsGrid",attrs:{rows:[r.columns]},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[n("FieldsLayout",{ref:"fieldLayout",attrs:{layout:r.fields,visible:t.fieldVisible},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.fieldLayout;return[n("FieldDisplay",{ref:"field",attrs:{"field-key":r.key,"context-fields":t.transformedFields,"context-data":t.data,"field-layout":r,locale:t.fieldLocale[r.key],"read-only":t.isReadOnly,"error-identifier":r.key,"config-identifier":r.key,root:"","update-data":t.updateData,"update-visibility":t.updateVisibility},on:{"locale-change":t.updateLocale}})]}}],null,!0)})]}}],null,!0)})]}}],null,!0)})]:t._e()],2)}),[],!1,null,null,null).exports,oa={components:{Modal:p.u_,Form:ia},inject:{$form:{default:null}},props:{visible:Boolean,form:Object,post:Function},data:function(){return{loading:!1}},methods:{handleSubmitButtonClicked:function(t){var e=this;t.preventDefault(),this.loading=!0,this.$refs.form.submit({postFn:this.post}).finally((function(){e.loading=!1}))},handleCancelClicked:function(){this.$emit("cancel")}}};function aa(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function la(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){aa(o,r,i,a,l,"next",t)}function l(t){aa(o,r,i,a,l,"throw",t)}a(void 0)}))}}function sa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ua(t){for(var e=1;e0}},methods:{lang:r.KQ,handleEditClicked:function(){this.showForm()},handleCancelClicked:function(){var t=this;this.node.attrs.isNew&&(this.deleteNode(),setTimeout((function(){t.editor.commands.focus()}),0))},handleRemoveClicked:function(){this.deleteNode()},showForm:function(){var t=this;return la(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.extension.options.resolveForm(t.embedData);case 2:t.modalForm=e.sent,t.modalVisible=!0;case 4:case"end":return e.stop()}}),e)})))()},postForm:function(t){var e=this;return la(l().mark((function n(){var r;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.extension.options.postForm(t);case 2:r=n.sent,e.updateAttributes({attributes:r,additionalData:r,isNew:!1}),e.modalVisible=!1;case 5:case"end":return n.stop()}}),n)})))()},init:function(){var t=this;return la(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.node.attrs.isNew){e.next=11;break}if(!t.hasForm){e.next=6;break}return e.next=4,t.showForm();case 4:e.next=10;break;case 6:return e.next=8,t.$nextTick();case 8:t.updateAttributes({isNew:!1}),t.editor.commands.focus();case 10:return e.abrupt("return");case 11:if(!t.hasForm){e.next=16;break}return e.next=14,t.extension.options.getAdditionalData(t.node.attrs.attributes);case 14:(n=e.sent)&&t.updateAttributes({additionalData:n});case 16:case"end":return e.stop()}}),e)})))()}},created:function(){this.init()}},fa=(0,dt.Z)(da,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("NodeRenderer",{staticClass:"editor__node embed-node",attrs:{node:t.node}},[t.node.attrs.isNew?t._e():[n("div",{staticClass:"card"},[n("div",{staticClass:"card-body"},[n("EmbedRenderer",{staticClass:"embed-node__template",attrs:{data:t.embedData,options:t.extension.options}}),t._v(" "),n("div",{staticClass:"mt-3"},[n("div",{staticClass:"row row-cols-auto gx-2"},[t.hasForm?[n("div",[n("Button",{attrs:{outline:"",small:""},on:{click:t.handleEditClicked}},[t._v("\n "+t._s(t.lang("form.upload.edit_button"))+"\n ")])],1)]:t._e(),t._v(" "),n("div",[n("Button",{attrs:{variant:"danger",outline:"",small:""},on:{click:t.handleRemoveClicked}},[t._v("\n "+t._s(t.lang("form.upload.remove_button"))+"\n ")])],1)],2)])],1)])],t._v(" "),n("EmbedFormModal",{attrs:{visible:t.modalVisible,form:t.modalForm,post:t.postForm},on:{"update:visible":function(e){t.modalVisible=e},cancel:t.handleCancelClicked},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n "+t._s(t.extension.options.label)+"\n ")]},proxy:!0}])})],2)}),[],!1,null,null,null).exports;function ha(t){return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(t,e){return(e?"-":"")+t.toLowerCase()}))}function pa(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ma(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Oa(t){var e=function(t,e){if("object"!==wa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==wa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wa(e)?e:String(e)}function Sa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ca(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ea(t){return function(t){if(Array.isArray(t))return Ia(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||La(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function La(t,e){if(t){if("string"==typeof t)return Ia(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(t,e):void 0}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},e=t.placeholder,n=t.toolbar,r=t.inline;return[bo({toolbar:n,inline:r}),fo({toolbar:n,inline:r}),oo(e),po({inline:r}),mo(),Bi,xi].flat().filter((function(t){return!!t}))}({placeholder:this.placeholder,toolbar:this.toolbar,inline:this.inline})),Ea(this.embedExtensions),[this.uploadExtension]);return t.filter((function(t){return!!t}))},uploadExtension:function(){var t;return null!==(t=this.embeds)&&void 0!==t&&t.upload?Ji.call(this,{fieldProps:this.embeds.upload,uniqueIdentifier:this.uniqueIdentifier,fieldConfigIdentifier:this.fieldConfigIdentifier,form:this.$form}):null},embedExtensions:function(){var t,e=this,n=null!==(t=this.embeds)&&void 0!==t?t:{},r=(n.upload,Aa(n,Pa));return Object.entries(r).map((function(t){var n=Da(t,2);return function(t){var e,n=t.embedKey,r=t.embedOptions,i=t.form,o=kn.default.observable({embeds:[],currentIndex:0,created:!1,resolved:null,onResolve:null});o.resolved=new Promise((function(t){return o.onResolve=t}));var a={name:"embed:".concat(n),onCreate:u()(ka(l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o.currentIndex>0)){t.next=5;break}return t.next=3,e=o.embeds,(0,No.vI)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,embeds:e,form:!0});case 3:o.embeds=t.sent,o.onResolve();case 5:o.created=!0;case 6:case"end":return t.stop()}var e}),t)}))))},s={label:r.label,tag:r.tag,attributes:null!==(e=r.attributes)&&void 0!==e?e:[],template:r.template,state:o,isReady:function(){return o.created},getEmbed:function(t){return o.embeds[t]},getAdditionalData:function(t){return ka(l().mark((function e(){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.created){e.next=2;break}return e.abrupt("return",null);case 2:return n=o.currentIndex++,o.embeds.push(t),e.next=6,o.resolved;case 6:return e.abrupt("return",o.embeds[n]);case 7:case"end":return e.stop()}}),e)})))()},onUpdate:function(t,e){o.embeds=Ca(Ca({},o.embeds),{},ja({},t,e))},onRemove:function(t){var e=o.embeds,n=(e[t],_a(e,[t].map(Oa)));o.embeds=n},resolveForm:function(t){return(0,No.Bd)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,attributes:t})},postForm:function(t){return(0,No.l3)({entityKey:i.entityKey,instanceId:i.instanceId,embedKey:n,data:t})}};return ga.extend(a).configure(s)}({embedKey:n[0],embedOptions:n[1],form:e.$form})}))}}},Ta=$a,Ma=(0,dt.Z)(Ta,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.markdown?[n("MarkdownContentEditor",t._g(t._b({attrs:{extensions:t.extensions}},"MarkdownContentEditor",[t.$props,t.$attrs],!1),t.$listeners))]:[n("HtmlContentEditor",t._g(t._b({attrs:{extensions:t.extensions}},"HtmlContentEditor",[t.$props,t.$attrs],!1),t.$listeners))]],2)}),[],!1,null,null,null).exports,Va={components:{DatePicker:fe,ClearButton:p.Cd},props:{value:{default:function(){return{start:null,end:null}}},displayFormat:{type:String,default:"DD/MM/YYYY"},startPlaceholder:{type:String,default:function(){return(0,r.KQ)("form.daterange.start_placeholder")}},endPlaceholder:{type:String,default:function(){return(0,r.KQ)("form.daterange.end_placeholder")}},clearable:{type:Boolean,default:!0},readOnly:Boolean,mondayFirst:Boolean,small:Boolean,updateOnInput:{type:Boolean,default:!0}},computed:{hasClearButton:function(){var t,e;return this.clearable&&!(null===(t=this.value)||void 0===t||!t.start)&&!(null===(e=this.value)||void 0===e||!e.end)}},methods:{handleChanged:function(t){var e,n,r,i,o,a;(null==t||null===(e=t.start)||void 0===e?void 0:e.toDateString())===(null===(n=this.oldValue)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.toDateString())&&(null==t||null===(i=t.end)||void 0===i?void 0:i.toDateString())===(null===(o=this.oldValue)||void 0===o||null===(a=o.end)||void 0===a?void 0:a.toDateString())||(this.$emit("input",t),this.oldValue=t)},handleClearClicked:function(){this.$emit("input",null)},focus:function(){var t=this;setTimeout((function(){t.$el.querySelector(".form-control").focus()}))}}},za=(0,dt.Z)(Va,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("DatePicker",{staticClass:"SharpDateRange position-relative",attrs:{value:t.value,"monday-first":t.mondayFirst,"display-format":t.displayFormat,columns:t.$screens({default:1,lg:2}),"update-on-input":t.updateOnInput,"is-range":""},on:{input:t.handleChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.inputValue,i=e.inputEvents;return[n("div",{staticClass:"input-group",class:{"input-group-sm":t.small}},[t.small&&!t.value?[n("div",t._g({staticClass:"form-control dropdown-toggle",attrs:{tabindex:"0"}},i.start),[n("span")])]:[n("input",t._g(t._b({staticClass:"form-control border-end-0",attrs:{placeholder:t.startPlaceholder,disabled:t.readOnly,autocomplete:"off"},domProps:{value:r.start}},"input",t.$props,!1),i.start)),t._v(" "),n("div",{staticClass:"form-control SharpDateRange__dash px-0 border-start-0 border-end-0"},[t._v("\n -\n ")]),t._v(" "),n("input",t._g(t._b({staticClass:"form-control border-start-0",class:{clearable:t.hasClearButton},attrs:{placeholder:t.endPlaceholder,disabled:t.readOnly,autocomplete:"off"},domProps:{value:r.end}},"input",t.$props,!1),i.end))]],2),t._v(" "),t.hasClearButton?[n("ClearButton",{on:{click:t.handleClearClicked}})]:t._e()]}}])})}),[],!1,null,null,null).exports,Ka={autocomplete:ft,text:yt,textarea:vt,editor:Ma,number:wt,upload:Zt,tags:se,date:be,check:ge,list:Ue,select:an,html:sn,geolocation:ir,daterange:za},Ra=["key"];function Na(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ha(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var qa={name:"SharpField",inheritAttrs:!1,provide:function(){return{$field:this}},props:{fieldKey:String,fieldType:String,fieldProps:Object,fieldLayout:Object,value:[String,Number,Boolean,Object,Array,Date],locale:[Array,String],uniqueIdentifier:String,fieldConfigIdentifier:String,updateData:Function,readOnly:Boolean,root:Boolean},computed:{isCustom:function(){return(0,r.X0)(this.fieldType)},component:function(){return this.isCustom?(0,r.vW)(this.fieldType):Ka[this.fieldType]}},render:function(t){var e=this;if(!this.component)return this.custom||(0,r.H)("Unknown field type '".concat(this.fieldType,"'"),this.fieldProps),null;var n=this.fieldProps,i=(n.key,Za(n,Ra));return t(this.component,{class:"SharpField",props:{fieldKey:this.fieldKey,fieldLayout:this.fieldLayout,value:this.value,locale:this.locale,uniqueIdentifier:this.uniqueIdentifier,fieldConfigIdentifier:this.fieldConfigIdentifier,root:this.root},attrs:Ha({id:this.$attrs.id,dynamicAttributes:i.dynamicAttributes},i),on:Ha(Ha({},this.$listeners),{},{input:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!e.fieldProps.readOnly||n.force?(e.updateData(e.fieldKey,t,{forced:n.force}),e.$emit("input",t,{force:n.force,error:n.error})):(0,r.cM)("SharpField '".concat(e.fieldKey,"', can't update because is readOnly"))}})})}},Qa=qa,Wa=(0,dt.Z)(Qa,undefined,undefined,!1,null,null,null).exports,Ga={props:{locales:{type:Array,required:!0},currentLocale:{type:String,required:!0},fieldValue:[String,Number,Boolean,Object,Array],isLocaleObject:Boolean,errors:Array},methods:{isActive:function(t){return this.currentLocale===t},isEmpty:function(t){var e=this.isLocaleObject?(this.fieldValue||{})[t]:this.fieldValue;return Array.isArray(e)?!e.length:!e},hasError:function(t){var e;return null===(e=this.errors)||void 0===e?void 0:e.includes(t)},handleButtonClicked:function(t){this.$emit("change",t)}}},Ya=(0,dt.Z)(Ga,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFieldLocaleSelect"},[n("div",{staticClass:"row gx-1"},[t._l(t.locales,(function(e){return[n("div",{staticClass:"col-auto d-flex"},[n("button",{staticClass:"SharpFieldLocaleSelect__btn ml-2",class:{"SharpFieldLocaleSelect__btn--active":t.isActive(e),"SharpFieldLocaleSelect__btn--empty":t.isEmpty(e),"SharpFieldLocaleSelect__btn--error":t.hasError(e)},on:{click:function(n){return t.handleButtonClicked(e)}}},[t._v("\n "+t._s(e)+"\n ")])])]}))],2)])}),[],!1,null,null,null).exports;function Ja(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Xa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xa(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},showLabel:function(){return!!this.label},resolvedOriginalValue:function(){return function(t){var e=t.field,n=t.value;return"editor"===e.type?(n||{}).text:n}({field:this.fieldProps,value:this.originalValue})},isLocaleObject:function(){return C(this.fieldProps)||"editor"===this.fieldProps.type},mergedErrorIdentifier:function(){return this.getMergedIdentifier("mergedErrorIdentifier",this.errorIdentifier)},mergedLocalizedErrorIdentifier:function(){return this.localizedErrorIdentifier?this.getMergedIdentifier("mergedErrorIdentifier",this.localizedErrorIdentifier):null},errorsLocales:function(){var t=this;return Object.entries(this.$form.errors).filter((function(t){var e=Ja(t,2);e[0];return!!e[1]})).map((function(e){var n=Ja(e,1)[0].match(new RegExp("^".concat(t.mergedErrorIdentifier,"\\.([^.]+)$")));return null==n?void 0:n[1]})).filter((function(e){var n;return e&&(null===(n=t.$form.locales)||void 0===n?void 0:n.includes(e))}))}},methods:{updateError:function(t){var e,n=null!==(e=t[this.mergedLocalizedErrorIdentifier])&&void 0!==e?e:t[this.mergedErrorIdentifier];if(Array.isArray(n))this.setError(n[0]);else if(this.fieldProps.localized&&this.errorsLocales.length>0){var i=this.errorsLocales.join(", ").toUpperCase(),o=(0,r.KQ)("form.validation_error.localized").replace(":locales",i);this.setError(o)}else null==n?this.clear(!1):(0,r.H)('FieldContainer : Not processable error "'.concat(this.mergedErrorIdentifier,'" : '),n)},setError:function(t){var e;this.state="error",this.stateMessage=t,null===(e=this.$tab)||void 0===e||e.$emit("error",this.mergedErrorIdentifier)},setOk:function(){this.state="ok",this.stateMessage=""},clear:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.state="default",this.stateMessage="",t&&(this.emitClear(this.mergedErrorIdentifier),this.mergedLocalizedErrorIdentifier&&this.emitClear(this.mergedLocalizedErrorIdentifier))},emitClear:function(t){var e;null===(e=this.$tab)||void 0===e||e.$emit("clear",t),this.$form.updateFieldError(t,null)},triggerFocus:function(){this.$set(this.fieldProps,"focused",!0)},handleBlur:function(){this.$set(this.fieldProps,"focused",!1)},handleValueChanged:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.error;r?this.$form.updateFieldError(null!==(e=this.mergedLocalizedErrorIdentifier)&&void 0!==e?e:this.mergedErrorIdentifier,[r]):"error"===this.state&&this.clear()},handleLocaleChanged:function(t){this.$emit("locale-change",this.fieldKey,t)}},directives:{sticky:Wr.CA}},il=rl,ol=(0,dt.Z)(il,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFieldContainer SharpForm__form-item",class:t.formGroupClasses,style:t.extraStyle},[n("div",{directives:[{name:"sticky",rawName:"v-sticky",value:"list"===t.fieldType,expression:"fieldType === 'list'"}],staticClass:"SharpForm__field-header"},[n("div",{staticClass:"row align-items-end"},[n("div",{staticClass:"col d-flex"},[t.showLabel?[n("label",{staticClass:"SharpForm__label form-label",attrs:{for:t.fieldId}},[t._v("\n "+t._s(t.label)+"\n ")])]:[n("div",{staticClass:"SharpForm__label SharpForm__label--placeholder form-label"})]],2),t._v(" "),t.fieldProps.localized?[n("div",{staticClass:"col-auto"},[n("FieldLocaleSelect",{attrs:{locales:t.$form.locales,"current-locale":t.locale,"field-value":t.resolvedOriginalValue,"is-locale-object":t.isLocaleObject,errors:t.errorsLocales},on:{change:t.handleLocaleChanged}})],1)]:t._e()],2)]),t._v(" "),n("div",{staticClass:"SharpForm__field-content"},[n("Field",t._b({ref:"field",attrs:{id:t.fieldId,"unique-identifier":t.mergedErrorIdentifier,"field-config-identifier":t.mergedConfigIdentifier},on:{error:t.setError,ok:t.setOk,clear:t.clear,blur:t.handleBlur,"locale-change":t.handleLocaleChanged,input:t.handleValueChanged}},"Field",t.$props,!1))],1),t._v(" "),t.stateMessage?[n("div",{staticClass:"invalid-feedback d-block"},[t._v(t._s(t.stateMessage))])]:t._e(),t._v(" "),t.helpMessage?[n("div",{staticClass:"SharpForm__help-message form-text"},[t._v(t._s(t.helpMessage))])]:t._e()],2)}),[],!1,null,null,null).exports;function al(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ll(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ll(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function ll(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function ml(t){return ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ml(t)}function vl(t,e,n){return!n||function(t,e,n){var i=!0,o=n.operator;if("or"!==o&&"and"!==o)return(0,r.H)("Conditional display : unknown operator '".concat(o,"'"),n),!0;var a,l=al(n.fields);try{for(l.s();!(a=l.n()).done;){var s=a.value;s.key in t||((0,r.H)("Conditional display : can't find a field with key '".concat(n.key,"' in 'fields'"),n),i=!0);var u=t[s.key],c=e[s.key];if("autocomplete"===u.type||"select"===u.type||"tags"===u.type?i=sl({condValues:s.values,fieldValue:"autocomplete"===u.type?c&&c.id:c,isSingleSelect:"select"===u.type&&!u.multiple||"autocomplete"===u.type}):"check"===u.type?"boolean"!=typeof s.values?((0,r.H)("Conditional display : 'values' must be a boolean for a 'check' field ('".concat(s.key,"')"),n,u),i=!0):i=!!c===s.values:((0,r.H)("Conditional display : unprocessable field type '".concat(u.type,"'"),u),i=!0),"and"===o&&!i)return!1;if("or"===o&&i)return!0}}catch(t){l.e(t)}finally{l.f()}return i}(t,e,n)}var bl=function(t,e,n,i){return t.localized&&e.localized&&n&&C(e)?"object"!==ml(n)||(0,ul.isArray)(n)?((0,r.H)("Localized field '".concat(e.key,"' value must be a object, given :"),JSON.stringify(n)),n):n[i]:n},yl={name:"SharpFieldDisplay",functional:!0,inject:["$form"],render:function(t,e){var n=e.props,o=e.injections,a=e.data,l=n.fieldKey,s=n.contextFields,u=n.contextData,c=n.errorIdentifier,d=n.updateVisibility,f=n.readOnly,h=pl(n,cl),p=o.$form,m=s[l],v=u[l];if(!(l in s))return(0,r.H)("Field display ('layout') : Can't find a field with key '".concat(l,"' in 'fields'"),s),t(i.u,{props:{name:l}});var b=vl(s,u,m.conditionalDisplay);return d&&d(l,b),b?t(ol,fl(fl({},a),{},{attrs:fl({fieldKey:l,fieldProps:fl(fl({},m),{},{readOnly:f||m.readOnly}),fieldType:m.type,value:bl(p,m,v,n.locale),originalValue:v,label:m.label,helpMessage:m.helpMessage,errorIdentifier:c,localizedErrorIdentifier:m.localized?"".concat(c,".").concat(n.locale):null},h)})):null}},gl={name:"SharpActionBarForm",mixins:[o.WH],components:{ActionBar:p.ol,Button:p.zx,Breadcrumb:p.aG},props:{showSubmitButton:Boolean,showDeleteButton:Boolean,showBackButton:Boolean,create:Boolean,uploading:Boolean,loading:Boolean,breadcrumb:Array,showBreadcrumb:Boolean,hasDeleteConfirmation:Boolean},data:function(){return{deleteFocused:!1}},computed:{submitLabel:function(){return this.uploading?(0,r.KQ)("action_bar.form.submit_button.pending.upload"):this.create?(0,r.KQ)("action_bar.form.submit_button.create"):(0,r.KQ)("action_bar.form.submit_button.update")}},methods:{handleSubmitClicked:function(){this.$emit("submit")},handleDeleteClicked:function(){this.deleteFocused||this.hasDeleteConfirmation?this.$emit("delete"):this.deleteFocused=!0},handleCancelClicked:function(){this.$emit("cancel")}}},wl=(0,dt.Z)(gl,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ActionBar",{scopedSlots:t._u([{key:"left",fn:function(){return[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"light",large:"",outline:""},on:{click:t.handleCancelClicked}},[t.showBackButton?[t._v("\n "+t._s(t.l("action_bar.form.back_button"))+"\n ")]:[t._v("\n "+t._s(t.l("action_bar.form.cancel_button"))+"\n ")]],2)],1),t._v(" "),t.showDeleteButton?[n("div",{staticClass:"col-auto"},[t.deleteFocused?[n("Button",{attrs:{variant:"danger",disabled:t.loading,large:""},on:{click:t.handleDeleteClicked,blur:function(e){t.deleteFocused=!1}}},[t._v("\n "+t._s(t.l("action_bar.form.delete_button"))+"\n ")])]:[n("Button",{staticClass:"px-3",attrs:{variant:"light",disabled:t.loading,large:"",outline:""},on:{click:t.handleDeleteClicked}},[n("svg",{attrs:{width:"1.125em",height:"1.125em",viewBox:"0 0 16 24","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M4 0h8v2H4zM0 3v4h1v17h14V7h1V3H0zm13 18H3V8h10v13z"}}),t._v(" "),n("path",{attrs:{d:"M5 10h2v9H5zm4 0h2v9H9z"}})])])]],2)]:t._e()],2)]},proxy:!0},{key:"right",fn:function(){return[t.showSubmitButton?[n("Button",{attrs:{variant:"light",large:"",disabled:t.uploading||t.loading},on:{click:t.handleSubmitClicked}},[t._v("\n "+t._s(t.submitLabel)+"\n ")])]:t._e()]},proxy:!0},{key:"extras",fn:function(){return[t.showBreadcrumb?[n("Breadcrumb",{attrs:{items:t.breadcrumb}})]:t._e()]},proxy:!0}])})}),[],!1,null,null,null).exports,_l={components:{Form:ia,ActionBarForm:wl},data:function(){return{form:null}},computed:{entityKey:function(){return this.$route.params.entityKey},instanceId:function(){return this.$route.params.instanceId}},methods:{handleError:function(t){this.$emit("error",t)},handleFormUpdated:function(t){this.updateDocumentTitle(t)},updateDocumentTitle:function(t){var e,n,r=null===(e=t.breadcrumb)||void 0===e||null===(n=e.items[t.breadcrumb.items.length-1])||void 0===n?void 0:n.documentTitleLabel;r&&(document.title="".concat(r,", ").concat(document.title))}}},Ol=[{name:"form",path:"/(.*)?/s-form/:entityKey/:instanceId?",component:(0,dt.Z)(_l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"FormPage"},[n("div",{staticClass:"container"},[n("Form",{attrs:{form:t.form,"entity-key":t.entityKey,"instance-id":t.instanceId},on:{"update:form":[function(e){t.form=e},t.handleFormUpdated],error:t.handleError},scopedSlots:t._u([{key:"action-bar",fn:function(e){var r=e.props,i=e.listeners;return[n("ActionBarForm",t._g(t._b({},"ActionBarForm",r,!1),i))]}}])})],1)])}),[],!1,null,null,null).exports}];function Sl(t,e){var n=e.router;e.store;t.component("FieldDisplay",yl),n.addRoutes(Ol)}},50779:function(t,e,n){n.d(e,{ol:function(){return f},aG:function(){return p},zx:function(){return v},Cd:function(){return y},FR:function(){return F},UQ:function(){return P},Lt:function(){return z},hP:function(){return N},u2:function(){return U},Mc:function(){return W},rj:function(){return X},gb:function(){return rt},fz:function(){return ot},u_:function(){return ut},Qm:function(){return dt},J:function(){return yt},LY:function(){return w},yV:function(){return S},HN:function(){return _t},xc:function(){return St},WD:function(){return Tt},u:function(){return Kt},ZP:function(){return Rt},tL:function(){return u},Eb:function(){return l}});var r=n(87757),i=n.n(r);function o(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function l(t){o(a,r,i,l,s,"next",t)}function s(t){o(a,r,i,l,s,"throw",t)}l(void 0)}))}}function l(t){return s.apply(this,arguments)}function s(){return(s=a(i().mark((function t(e){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){return setTimeout(t,10)}));case 2:n=e.$el.querySelector(".multiselect__content"),(r=n.getBoundingClientRect()).bottom>window.innerHeight&&window.scrollBy({top:r.bottom-window.innerHeight+20,behavior:"smooth"});case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(){var t=document.documentElement.style.getPropertyValue("--navbar-height");return parseInt(t)||0}var c={name:"SharpActionBar",props:{container:Boolean},computed:{hasExtras:function(){return this.$slots.extras||this.$slots["extras-right"]}},methods:{layout:function(t){document.documentElement.style.setProperty("--navbar-height","".concat(t.height,"px"))}},mounted:function(){var t=this;this.layout(this.$refs.bar.getBoundingClientRect()),window.ResizeObserver&&new ResizeObserver((function(e){t.layout(e[0].target.getBoundingClientRect())})).observe(this.$refs.bar)}},d=n(51900),f=(0,d.Z)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpActionBar"},[n("div",{ref:"bar",staticClass:"SharpActionBar__bar sticky-top"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row align-items-center g-2 gx-md-4"},[n("div",{staticClass:"col SharpActionBar__col--left",staticStyle:{"min-width":"0"}},[t._t("left")],2),t._v(" "),n("div",{staticClass:"col-auto SharpActionBar__col--right"},[t._t("right")],2)])])]),t._v(" "),t.hasExtras?[n("div",{class:{container:t.container}},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm"},[n("div",{staticClass:"SharpActionBar__extras"},[t._t("extras")],2)]),t._v(" "),t.$slots["extras-right"]?[n("div",{staticClass:"col-sm-auto"},[n("div",{staticClass:"SharpActionBar__extras"},[t._t("extras-right")],2)])]:t._e()],2)])]:t._e()],2)}),[],!1,null,null,null).exports,h={props:{items:Array},computed:{icon:function(){var t;return null===(t=this.$store.state.currentEntity)||void 0===t?void 0:t.icon}},methods:{isActive:function(t){return t===this.items.length-1}}},p=(0,d.Z)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"d-flex"},[n("div",{staticClass:"input-group input-group-sm w-auto"},[t.icon?[n("div",{staticClass:"input-group-text"},[n("i",{staticClass:"fa fa-sm",class:t.icon,staticStyle:{opacity:".75","font-size":".75rem"}})])]:t._e(),t._v(" "),n("div",{staticClass:"form-control"},[n("div",{staticClass:"breadcrumb p-0 m-0"},[t._l(t.items,(function(e,r){return[n("div",{staticClass:"breadcrumb-item",class:{active:t.isActive(r)}},[t.isActive(r)?[n("span",[t._v(t._s(e.name))])]:[n("a",{attrs:{href:e.url}},[t._v(t._s(e.name))])]],2)]}))],2)])],2)])}),[],!1,null,null,null).exports,m={props:{variant:{type:String,default:"primary"},text:Boolean,outline:Boolean,small:Boolean,large:Boolean,active:Boolean,block:Boolean,href:String,disabled:Boolean},computed:{variantClass:function(){return!this.hasTextStyle&&this.variant?"btn".concat(this.outline?"-outline":"","-").concat(this.variant):null},classes:function(){return[this.variantClass,{"btn-sm":this.small,"btn-lg":this.large,"btn-text":this.hasTextStyle,"btn-block":this.block,active:this.active,disabled:this.disabled}]},hasTextStyle:function(){return!0===this.text},tag:function(){return this.href?"a":"button"}},methods:{focus:function(){this.$el.focus()}}},v=(0,d.Z)(m,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.tag,t._g({tag:"component",staticClass:"SharpButton btn",class:t.classes,attrs:{href:t.href,disabled:t.disabled}},t.$listeners),[t._t("default")],2)}),[],!1,null,null,null).exports,b={props:{formControl:{type:Boolean,default:!0}},computed:{classes:function(){return{"SharpClearButton--form-control":this.formControl}}},methods:{click:function(){this.$el.click()}}},y=(0,d.Z)(b,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",t._g({staticClass:"SharpClearButton btn",class:t.classes,attrs:{type:"button"}},t.$listeners),[n("svg",{staticClass:"SharpClearButton__icon",attrs:{"aria-label":"close",width:"10",height:"10",viewBox:"0 0 10 10","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M9.8 8.6L8.4 10 5 6.4 1.4 10 0 8.6 3.6 5 .1 1.4 1.5 0 5 3.6 8.6 0 10 1.4 6.4 5z"}})])])}),[],!1,null,null,null).exports,g={name:"SharpNavItem",props:{current:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},href:String,target:String,linkClass:String}},w=(0,d.Z)(g,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"SharpLeftNav__item",class:{"SharpLeftNav__item--active":t.current,"SharpLeftNav__item--disabled":t.disabled},attrs:{role:"menuitem"}},[t.disabled?[n("span",{staticClass:"SharpLeftNav__item-link",class:t.linkClass},[t._t("default")],2)]:[n("a",{staticClass:"SharpLeftNav__item-link",class:t.linkClass,attrs:{href:t.href,target:t.target}},[t._t("default")],2)]],2)}),[],!1,null,null,null).exports,_={components:{BCollapse:n(11688).k},props:{label:String,opened:Boolean,collapsible:Boolean},data:function(){return{expanded:this.opened||!this.collapsible}},methods:{toggle:function(){this.collapsible&&(this.expanded=!this.expanded)}}},O=(0,d.Z)(_,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"SharpLeftNav__item SharpLeftNav__item--has-children",class:{"SharpLeftNav__item--expanded":t.expanded,"SharpLeftNav__item--disabled":!t.collapsible}},[n("div",{staticClass:"SharpLeftNav__item-link",attrs:{tabindex:t.collapsible?"0":"-1"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toggle.apply(null,arguments)},click:t.toggle}},[n("div",{staticClass:"row gx-2 align-items-center flex-nowrap"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[t._t("label",(function(){return[t._v("\n "+t._s(t.label)+"\n ")]}))],2),t._v(" "),t.collapsible?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpLeftNav__item-icon"},[n("svg",{staticClass:"SharpLeftNav__icon",attrs:{width:"10",height:"5",viewBox:"0 0 10 5","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M10 0L5 5 0 0z"}})])])])]:t._e()],2)]),t._v(" "),n("b-collapse",{attrs:{visible:t.expanded}},[n("ul",{staticClass:"SharpLeftNav__list SharpLeftNav__list--nested",attrs:{role:"menu","aria-hidden":"true"}},[t._t("default")],2)])],1)}),[],!1,null,null,null),S=O.exports,C={name:"SharpPagination",inheritAttrs:!1,components:{BPagination:n(61081).c},props:{totalRows:Number,perPage:Number,minPageEndButtons:{type:Number,default:0}},computed:{hideGotoEndButtons:function(){return Math.ceil(this.totalRows/Math.max(this.perPage,1))t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1},draggableOptions:function(){return{disabled:!this.reorderActive}},currentItems:function(){return this.reorderActive?this.reorderedItems:this.items},isEmpty:function(){return 0===(this.items||[]).length},styles:function(){return{"--append-width":this.appendWidth?"".concat(this.appendWidth,"px"):null}}},methods:{handleItemsChanged:function(t){this.reorderedItems=t,this.$emit("change",t)},handleSortClicked:function(t){this.$emit("sort-change",{prop:t,dir:this.sort===t&&"asc"===this.dir?"desc":"asc"})},handlePageChanged:function(t){this.$emit("page-change",t)},handleReorderActiveChanged:function(t){this.reorderedItems=t?E(this.items):null},getAppendWidth:function(t){if(!t)return 0;var e=t.querySelector(".SharpDataList__row-append");return e?e.offsetWidth:0},updateLayout:function(){var t,e=this;return(t=i().mark((function t(){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.appendWidth=0,t.next=3,e.$nextTick();case 3:n=e.getAppendWidth(e.$refs.head),r=e.getAppendWidth(e.$refs.body),e.appendWidth=Math.max(n,r);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){A(o,r,i,a,l,"next",t)}function l(t){A(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},mounted:function(){this.updateLayout(),window.addEventListener("resize",this.updateLayout)},destroyed:function(){window.removeEventListener("resize",this.updateLayout)}},B=I,F=(0,d.Z)(B,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpDataList",class:{"SharpDataList--reordering":t.reorderActive},style:t.styles},[t.isEmpty?[n("div",{staticClass:"SharpDataList__empty p-3"},[t._t("empty"),t._v(" "),t._t("append-body")],2)]:[t.$slots["append-head"]?[n("div",{staticClass:"d-flex justify-content-end mb-3 d-sm-none"},[t._t("append-head")],2)]:t._e(),t._v(" "),n("div",{staticClass:"SharpDataList__table SharpDataList__table--border"},[t.hideHeader?t._e():[n("div",{ref:"head",staticClass:"SharpDataList__thead"},[n("DataListRow",{attrs:{columns:t.columns,header:""},scopedSlots:t._u([{key:"cell",fn:function(e){var r=e.column;return[n("div",{staticClass:"row"},[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"row align-items-center gx-2"},[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("div",{staticClass:"overflow-hidden"},[t._v("\n "+t._s(r.label)+"\n ")])]),t._v(" "),r.sortable?[n("div",{staticClass:"col-auto"},[n("svg",{staticClass:"SharpDataList__caret",class:{"SharpDataList__caret--selected":t.sort===r.key,"SharpDataList__caret--ascending":t.sort===r.key&&"asc"===t.dir},attrs:{width:"10",height:"5",viewBox:"0 0 10 5","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M10 0L5 5 0 0z"}})]),t._v(" "),n("a",{staticClass:"SharpDataList__sort-link",attrs:{href:""},on:{click:function(e){return e.preventDefault(),t.handleSortClicked(r.key)}}})])]:t._e()],2)])])]}},t.$slots["append-head"]?{key:"append",fn:function(){return[t._t("append-head")]},proxy:!0}:null],null,!0)})],1)],t._v(" "),n("div",{ref:"body",staticClass:"SharpDataList__tbody"},[n("Draggable",{attrs:{options:t.draggableOptions,value:t.reorderedItems},on:{input:t.handleItemsChanged}},[t._l(t.currentItems,(function(e){return[t._t("item",(function(){return[n("DataListRow",{attrs:{columns:t.columns,row:e}})]}),{item:e})]}))],2),t._v(" "),t._t("append-body")],2)],2)],t._v(" "),t.hasPagination?[n("div",{staticClass:"SharpDataList__pagination-container"},[n("Pagination",{attrs:{"total-rows":t.totalCount,"per-page":t.pageSize,"min-page-end-buttons":3,limit:7,value:t.page},on:{change:t.handlePageChanged}})],1)]:t._e()],2)}),[],!1,null,null,null).exports;function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0}},methods:{handleValueChanged:function(t){this.search=t},handleClearButtonClicked:function(){this.search="",this.$emit("submit",""),this.$emit("clear"),this.$refs.input.focus()},handleFocused:function(){this.$emit("focus")},handleBlur:function(){this.$emit("blur")},handleFocusout:function(t){t.relatedTarget&&this.$el.contains(t.relatedTarget)||(this.search=this.value)},handleSubmitted:function(){this.$emit("submit",this.search)}}},wt=(0,d.Z)(gt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpSearch",attrs:{role:"search"}},[n("form",{staticClass:"h-100",on:{submit:function(e){return e.preventDefault(),t.handleSubmitted.apply(null,arguments)}}},[n("label",{staticClass:"SharpSearch__label visually-hidden",attrs:{id:"ab-search-label",for:"ab-search-input"}},[t._v(t._s(t.placeholder))]),t._v(" "),n("div",{staticClass:"input-group input-group-sm flex-nowrap"},[n("div",{staticClass:"position-relative flex-fill",staticStyle:{"min-width":"0"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],ref:"input",staticClass:"SharpSearch__input form-control form-control-sm",attrs:{placeholder:t.placeholder,disabled:t.disabled,type:"text",id:"ab-search-input",role:"search","aria-labelledby":"ab-search-label"},domProps:{value:t.search},on:{focus:t.handleFocused,blur:t.handleBlur,focusout:t.handleFocusout,input:function(e){e.target.composing||(t.search=e.target.value)}}}),t._v(" "),n("button",{staticClass:"btn btn-sm SharpSearch__clear h-100 d-inline-flex align-items-center position-absolute",class:{invisible:!t.clearVisible},attrs:{type:"button","aria-label":"Clear search"},on:{click:t.handleClearButtonClicked}},[n("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm3.5 10.1l-1.4 1.4L8 9.4l-2.1 2.1-1.4-1.4L6.6 8 4.5 5.9l1.4-1.4L8 6.6l2.1-2.1 1.4 1.4L9.4 8l2.1 2.1z"}})])])]),t._v(" "),n("button",{staticClass:"btn btn-sm btn-outline-primary SharpSearch__button"},[n("svg",{staticClass:"align-middle",attrs:{width:"1.25em",height:"1.25em",viewBox:"0 0 16 16","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M6 2c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zm0-2C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM16 13.8L13.8 16l-3.6-3.6 2.2-2.2z"}}),t._v(" "),n("path",{attrs:{d:"M16 13.8L13.8 16l-3.6-3.6 2.2-2.2z"}})])])])])])}),[],!1,null,null,null),_t=wt.exports,Ot={name:"SharpStateIcon",props:{color:{required:!0,type:String}},computed:{style:function(){return{background:this.color}}}},St=(0,d.Z)(Ot,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"StateIcon",style:t.style})}),[],!1,null,null,null).exports;function Ct(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var jt={name:"SharpTab",components:{BTab:n(51015).L},provide:function(){return{$tab:this}},props:{title:String,active:Boolean},data:function(){return{errors:{}}},computed:{hasError:function(){return Object.keys(this.errors).length>0},classes:function(){return{"is-invalid":this.hasError}}},methods:{setError:function(t){this.$set(this.errors,t,!0)},clearError:function(t){this.$delete(this.errors,t)},handleActiveChanged:function(t){var e,n=this;return(e=i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return e.next=3,n.$nextTick();case 3:n.$emit("active");case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){Ct(o,r,i,a,l,"next",t)}function l(t){Ct(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){var t=this;this.$on("error",(function(e){return t.setError(e)})),this.$on("clear",(function(e){return t.clearError(e)}))}},xt=jt,kt=(0,d.Z)(xt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("b-tab",{attrs:{"title-link-class":t.classes,active:t.active},on:{"update:active":t.handleActiveChanged},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n "+t._s(t.title)+"\n ")]},proxy:!0}])},[t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports,Pt={name:"SharpTabs",components:{BTabs:n(21247).M},computed:{dropdownButtonClasses:function(){return this.tabs[this.currentTab].hasError?"error-dot":this.tabsHaveError?"error-dot--partial":""}}},Dt=(0,d.Z)(Pt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-tabs",{staticClass:"SharpTabs",attrs:{"nav-class":"SharpTabs__nav mb-4 align-items-center",pills:""},scopedSlots:t._u([{key:"tabs-start",fn:function(){return[n("li",{staticClass:"nav-item me-sm-auto"},[t._t("nav-prepend")],2)]},proxy:!0},{key:"tabs-end",fn:function(){return[n("li",{staticClass:"ms-auto"})]},proxy:!0}],null,!0)},[t._v(" "),t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports;function At(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Et(t){for(var e=1;e1}},methods:{isActive:function(t){return this.$route.query.tab===It(t.title)},handleTabActivated:function(t){this.$router.replace({query:Et(Et({},this.$route.query),{},{tab:It(t.title)})})}}},Ft=Bt,$t=(0,d.Z)(Ft,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpTabbedLayout"},[t.showTabs?[n("Tabs",{scopedSlots:t._u([{key:"nav-prepend",fn:function(){return[t._t("nav-prepend")]},proxy:!0}],null,!0)},[t._v(" "),t._l(t.layout.tabs,(function(e,r){return[n("Tab",{key:"tab-"+r,attrs:{title:e.title,active:t.isActive(e)},on:{active:function(n){return t.handleTabActivated(e)}}},[t._t("default",null,{tab:e})],2)]}))],2)]:[t.$slots["nav-prepend"]?[n("div",{staticClass:"my-4"},[t._t("nav-prepend")],2)]:t._e(),t._v(" "),n("div",{staticClass:"tab-pane"},[t._l(t.layout.tabs,(function(e){return[t._t("default",null,{tab:e}),t._v(" "),n("hr",{staticClass:"SharpTabbedLayout__divider"})]}))],2)]],2)}),[],!1,null,null,null),Tt=$t.exports;function Mt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var Vt={components:{BTooltip:n(49845).T},props:{target:Function,triggers:String,placement:String,overflowOnly:Boolean,disabled:Boolean},data:function(){return{isOverflowing:!1}},computed:{isEnabled:function(){return!this.disabled&&(!this.overflowOnly||this.isOverflowing)}},methods:{layout:function(t){this.isOverflowing=t.scrollWidth>t.offsetWidth},getTarget:function(){return this.target()}},mounted:function(){var t,e=this;return(t=i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:n=e.getTarget(),e.layout(n),"ResizeObserver"in window&&(e.observer=new ResizeObserver((function(){return e.layout(n)})),e.observer.observe(n));case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Mt(o,r,i,a,l,"next",t)}function l(t){Mt(o,r,i,a,l,"throw",t)}a(void 0)}))})()},beforeDestroy:function(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}},zt=Vt,Kt=(0,d.Z)(zt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("b-tooltip",{attrs:{target:t.target,triggers:t.triggers,placement:t.placement,disabled:!t.isEnabled}},[t._t("default")],2)}),[],!1,null,null,null).exports;function Rt(t,e){e.store,e.router;t.component("sharp-dropdown",z),t.component("sharp-dropdown-item",N)}},86831:function(t,e,n){n.d(e,{hi:function(){return D},JW:function(){return E},LC:function(){return A},e$:function(){return C},Qj:function(){return L},gU:function(){return j}});var r=n(9669),i=n.n(r),o=n(4372),a=n.n(o),l=n(4786),s=n(80129),u=n.n(s);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.params;return D.getUri({url:"".concat(l.v,"/").concat(t.replace(/^\//,"")),params:n})}function L(){return a().read("XSRF-TOKEN")}},66418:function(t,e,n){n.d(e,{e:function(){return l},u:function(){return h}});function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n'.concat(null!==(t=this.template)&&void 0!==t?t:"",""),props:[].concat(r(this.templateProps||[]),r(Object.keys(null!==(e=this.templateData)&&void 0!==e?e:{}))),mounted:function(){var t,e,n,r=!(null!==(t=this.$el.children)&&void 0!==t&&t.length||null!==(e=this.$el.innerText)&&void 0!==e&&e.trim());this.$emit("content-change",{isEmpty:r}),(null===(n=this.$el.children)||void 0===n?void 0:n.length)>0&&this.$el.classList.add("SharpTemplate--has-children")}}}}},a=n(51900),l=(0,a.Z)(o,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,t._g(t._b({tag:"component"},"component",t.templateData,!1),t.$listeners),[t._t("default")],2)}),[],!1,null,null,null).exports,s={props:{name:String}},u=n(93379),c=n.n(u),d=n(27531),f={insert:"head",singleton:!1},h=(c()(d.Z,f),d.Z.locals,(0,a.Z)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"unknown-field"},[n("span",[t._v("Unknown field «"+t._s(t.name)+"»")])])}),[],!1,null,"d6c36028",null).exports)},4786:function(t,e,n){n.d(e,{IW:function(){return a},_n:function(){return i},v:function(){return o}});var r,i=(r=document.head.querySelector("meta[name=base-url]"))?"/".concat(r.content):"/sharp",o="".concat(i,"/api"),a="".concat(o,"/upload")},37400:function(t,e,n){function r(t,e,n){var r=e.value;!n.children.length||n.children.every((function(t){return function(t){return t.text?0===t.text.trim().length:t.elm instanceof HTMLElement?"none"===t.elm.style.display:!t.tag}(t)}))?t.classList.add(r):t.classList.remove(r)}n.d(e,{tl:function(){return i},CA:function(){return c}});var i={inserted:r,componentUpdated:r},o=n(23493),a=n.n(o);function l(t,e){for(var n=0;nthis.sentinel.getBoundingClientRect().top),e&&this.el.style.setProperty("--sticky-offset","".concat(t.top-e.getBoundingClientRect().top,"px"))}}},{key:"setStuck",value:function(t){this.el.classList.toggle("stuck",t),this.el.dispatchEvent(new CustomEvent("sticky-change",{detail:t}))}}])&&l(e.prototype,n),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),c={inserted:function(t,e){var n=e.value,r=e.expression;!n&&r||(t._stickyObserver=new u(t))},update:function(t,e){var n;e.value&&!t._stickyObserver&&(t._stickyObserver=new u(t)),null===(n=t._stickyObserver)||void 0===n||n.refresh()},unbind:function(t){var e;null===(e=t._stickyObserver)||void 0===e||e.destroy()}}},24903:function(t,e,n){n.d(e,{_n:function(){return _._n},IW:function(){return _.IW},hi:function(){return r.hi},JW:function(){return r.JW},eH:function(){return C},Q6:function(){return w},iW:function(){return T},Z_:function(){return S},e$:function(){return r.e$},Ki:function(){return B},Qj:function(){return r.Qj},gU:function(){return r.gU},Gh:function(){return E.G},U1:function(){return F},X0:function(){return D},KQ:function(){return i.K},cM:function(){return p},H:function(){return v},Vz:function(){return f.Vz},vW:function(){return A},yC:function(){return d},uN:function(){return f.uN},wp:function(){return O.wp},i0:function(){return O.i0},AU:function(){return M},ZK:function(){return m},h3:function(){return I}});var r=n(86831),i=n(16114),o=n(21057),a=n.n(o);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.searchKeys,i=new(a())(t,s(s({},c),{},{keys:r}));return i.search(e)}var f=n(88264);function h(t){return"SHARP : ".concat(t)}function p(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"sm";return{data:function(){return{isViewportSmall:!1}},methods:{$_responsiveUpdate:function(){var t=this.$_testElm.offsetWidth;this.isViewportSmall=!!t}},created:function(){var e="viewport-down-".concat(t);this.$_testElm=document.getElementById(e),this.$_testElm||(this.$_testElm=document.createElement("div"),this.$_testElm.id=e,this.$_testElm.classList.add("d-".concat(t,"-none")),document.body.appendChild(this.$_testElm)),this.$_responsiveUpdate(),this.$_debouncedRespnsiveUpdate=u()(this.$_responsiveUpdate,300),window.addEventListener("resize",this.$_debouncedRespnsiveUpdate)},destroyed:function(){window.removeEventListener("resize",this.$_debouncedRespnsiveUpdate)}}}var d={mixins:[r],props:{configIdentifier:{type:String,required:!0}},computed:{mergedConfigIdentifier:function(){return this.getMergedIdentifier("mergedConfigIdentifier",this.configIdentifier)}}},f=n(79226),h={mixins:[{inject:["axiosInstance"],methods:{showLoading:function(){this.$store.dispatch("setLoading",!0)},hideLoading:function(){this.$store.dispatch("setLoading",!1)},installInterceptors:function(){var t=this;this.axiosInstance.interceptors.request.use((function(e){return t.showLoading(),e}),(function(t){return Promise.reject(t)})),this.axiosInstance.interceptors.response.use((function(e){return t.hideLoading(),e}),(function(e){return t.hideLoading(),Promise.reject(e)}))}},created:function(){this.synchronous||(this.installInterceptors(),this.showLoading())}}],inject:["axiosInstance"],data:function(){return{data:null,layout:null}},methods:{get:function(){var t=this;return this.axiosInstance.get(this.apiPath,{params:this.apiParams}).then((function(e){return t.mount(e.data),(0,f.G)(e.data.notifications),Promise.resolve(e)}))},post:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.apiPath,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.data,n=arguments.length>2?arguments[2]:void 0;return this.axiosInstance.post(t,e,n)}}},p=n(87757),m=n.n(p),v=n(25025),b=n(4935);function y(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){y(o,r,i,a,l,"next",t)}function l(t){y(o,r,i,a,l,"throw",t)}a(void 0)}))}}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=e.append,r=s().resolve(t),i=r.href,o=r.route;if(n){var a=s().currentRoute.path.replace(/\/$/,""),l=s().resolve(a+o.fullPath);i=l.href}return i}function c(){if(document.referrer){var t=new URL(document.referrer);if(t.origin===location.origin)return s().resolve(t.pathname+t.search).route}}},95164:function(t,e,n){n(74577),n(3758),n(3573),n(68965),n(15634),n(76554),n(81817),n(61357),n(19266),n(88188);var r=n(70538),i=n(20629),o=n(78345),a=n(36292),l=n(14765),s=n.n(l),u=n(50779),c=n(40604),d={components:{Modal:u.u_,Form:c.l0,LoadingOverlay:u.fz},props:{command:Object,entityKey:String,instanceId:[Number,String],loading:Boolean},data:function(){return{visible:!1}},watch:{command:function(t){this.visible=!(null==t||!t.form)}},computed:{title:function(){var t,e,n;return null!==(t=null===(e=this.command)||void 0===e?void 0:e.modal_title)&&void 0!==t?t:null===(n=this.command)||void 0===n?void 0:n.label},confirmLabel:function(){var t;return null===(t=this.command)||void 0===t?void 0:t.modal_confirm_label}},methods:{submit:function(){var t;return(t=this.$refs.form).submit.apply(t,arguments)},handleSubmitButtonClicked:function(t){t.preventDefault(),this.$emit("submit",this)},handleClosed:function(){this.$emit("close")},handleLoadingChanged:function(t){this.$emit("update:loading",t)}}},f=d,h=n(51900),p=(0,h.Z)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Modal",{attrs:{"modal-class":"form-modal",visible:t.visible,loading:t.loading,title:t.title,"ok-title":t.confirmLabel},on:{"update:visible":function(e){t.visible=e},ok:t.handleSubmitButtonClicked,hidden:t.handleClosed}},[n("transition",[t.visible?[n("Form",{ref:"form",staticStyle:{"transition-duration":"300ms"},attrs:{"entity-key":t.entityKey,"instance-id":t.instanceId,form:t.command.form,"show-alert":!1,independant:"","ignore-authorizations":""},on:{loading:t.handleLoadingChanged}})]:t._e()],2)],1)}),[],!1,null,null,null).exports,m={name:"SharpCommandsDropdown",components:{Dropdown:u.Lt,DropdownItem:u.hP,DropdownSeparator:u.u2},props:{commands:{type:Array},small:{type:Boolean,default:!0},hasState:Boolean},computed:{commandGroups:function(){return this.commands.filter((function(t){return t.length>0}))},classes:function(){return{"SharpCommandsDropdown--has-state":this.hasState}}},methods:{handleCommandClicked:function(t){this.$emit("select",t)}}},v=(0,h.Z)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({staticClass:"SharpCommandsDropdown",class:t.classes,attrs:{small:t.small,right:""},scopedSlots:t._u([{key:"text",fn:function(){return[t._t("text")]},proxy:!0}],null,!0)},"Dropdown",t.$attrs,!1),[t._v(" "),t._t("prepend"),t._v(" "),t._l(t.commandGroups,(function(e,r){return[r>0?[n("DropdownSeparator")]:t._e(),t._v(" "),t._l(e,(function(e){return[n("DropdownItem",{key:e.key,on:{click:function(n){return t.handleCommandClicked(e)}}},[t._v("\n "+t._s(e.label)+"\n "),e.description?[n("div",{staticClass:"SharpCommandsDropdown__description"},[t._v("\n "+t._s(e.description)+"\n ")])]:t._e()],2)]}))]}))],2)}),[],!1,null,null,null).exports,b={name:"SharpViewPanel",props:{content:String},computed:{visible:function(){return!!this.content}},methods:{handleBackdropClicked:function(){this.$emit("close")}},directives:{srcdoc:{inserted:function(t,e){var n=e.value;t.contentWindow.document.write(n)}}}},y=b,g=(0,h.Z)(y,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"SharpViewPanel__glasspane",on:{click:t.handleBackdropClicked}}),t._v(" "),n("transition",{attrs:{"enter-class":"SharpViewPanel--collapsed","enter-active-class":"SharpViewPanel--expanding","enter-to-class":"SharpViewPanel--expanded","leave-class":"SharpViewPanel--expanded","leave-active-class":"SharpViewPanel--collapsing","leave-to-class":"SharpViewPanel--collapsed"}},[t.visible?[n("div",{staticClass:"SharpViewPanel"},[n("iframe",{directives:[{name:"srcdoc",rawName:"v-srcdoc",value:t.content,expression:"content"}],attrs:{src:"about:blank",sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-downloads"}})])]:t._e()],2)],1)}),[],!1,null,null,null).exports;var w,_,O,S="SET_COMMANDS",C={namespaced:!0,state:{commands:null},mutations:(w={},_=S,O=function(t,e){t.commands=e},_ in w?Object.defineProperty(w,_,{value:O,enumerable:!0,configurable:!0,writable:!0}):w[_]=O,w),getters:{forType:function(t){return function(e){return t.commands?t.commands[e]:null}}},actions:{update:function(t,e){var n=t.commit,r=e.commands;n(S,r)}}};var j=n(87757),x=n.n(j),k=n(24903);function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:function(t){return t};return Object.entries(t).reduce((function(t,n){var r=F(n,2),i=r[0],o=r[1];return I(I({},t),{},B({},z(i),e(o,i)))}),{})}(t,(function(t,n){return e.serializeValue({filter:e.filter(n),value:t})}))}},getValuesFromQuery:function(){return function(t){return function(t){return Object.entries(t||{}).filter((function(t){var e=F(t,1)[0];return V.test(e)})).reduce((function(t,e){var n=F(e,2),r=n[0],i=n[1];return I(I({},t),{},B({},r.replace(V,""),i))}),{})}(t)}},resolveFilterValue:function(t,e){return function(t){var n=t.filter,r=t.value;return null==r?e.defaultValue(n):n.multiple&&!Array.isArray(r)?[r]:"daterange"===n.type?(0,k.Vz)(r):"check"===n.type?"1"===r:r}},serializeValue:function(){return function(t){var e=t.filter,n=t.value;return e?"daterange"===e.type?(0,k.uN)(n):"check"===e.type?n?"1":null:n:n}},nextValues:function(t){return function(e){var n=e.filter,r=e.value;return n.master?H(H({},Object.fromEntries(Object.entries(t.values).map((function(t){var e=K(t,2),n=e[0];e[1];return[n,null]})))),{},U({},n.key,r)):H(H({},t.values),{},U({},n.key,r))}},nextQuery:function(t,e){return function(t){var n=t.filter,r=t.value;return e.getQueryParams(e.nextValues({filter:n,value:r}))}}},actions:{update:function(t,e){var n=t.commit,r=t.dispatch,i=e.filters,o=e.values;return n(Z,i),Promise.all((i||[]).map((function(t){r("setFilterValue",{filter:t,value:(o||{})[t.key]})})))},setFilterValue:function(t,e){var n=t.commit,r=t.getters,i=e.filter,o=e.value;n(q,{key:i.key,value:r.resolveFilterValue({filter:i,value:o})})}}};function W(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var G={namespaced:!0,modules:{filters:Q},actions:{get:function(t){return(e=x().mark((function e(){var n,r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.dispatch,e.next=3,k.hi.get("filters").then((function(t){return t.data}));case 3:r=e.sent,n("filters/update",{filters:r.filters});case 5:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){W(o,r,i,a,l,"next",t)}function l(t){W(o,r,i,a,l,"throw",t)}a(void 0)}))})();var e},post:function(t,e){!function(t){if(null==t)throw new TypeError("Cannot destructure undefined")}(t);var n=e.filter,r=e.value;return function(t){var e=t.filterKey,n=t.value;return k.hi.post("filters/".concat(e),{value:n})}({filterKey:n.key,value:r})}}},Y=n(24877),J={name:"SharpFilterDateRange",components:{DateRange:c.C0,FilterControl:Y.Z},props:{value:{required:!0},required:Boolean,displayFormat:String,mondayFirst:Boolean,disabled:Boolean,label:String},methods:{handleClicked:function(){this.$refs.range.focus()},handleInput:function(t){this.$emit("input",t)}}},X=(0,h.Z)(J,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFilterDateRange"},[n("FilterControl",{attrs:{label:t.label},on:{"label-click":t.handleClicked}},[n("DateRange",{ref:"range",staticClass:"SharpFilterDateRange__field",attrs:{value:t.value,"display-format":t.displayFormat,"monday-first":t.mondayFirst,clearable:!t.required,"read-only":t.disabled,"update-on-input":!1,small:""},on:{input:t.handleInput}})],1)],1)}),[],!1,null,null,null).exports,tt=n(89955),et={props:{filterKey:String,label:String,value:Boolean,disabled:Boolean},computed:{id:function(){return"filter-".concat(this.filterKey)}},methods:{handleChanged:function(t){this.$emit("input",t.target.checked)}}},nt=(0,h.Z)(et,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpFilterCheck form-check mt-1 mx-2"},[n("input",{staticClass:"form-check-input",attrs:{id:t.id,type:"checkbox",name:t.filterKey,disabled:t.disabled},domProps:{checked:t.value},on:{change:t.handleChanged}}),t._v(" "),n("label",{staticClass:"ui-font fs-8",attrs:{for:t.id}},[t._v("\n "+t._s(t.label)+"\n ")])])}),[],!1,null,null,null).exports;var rt,it={name:"SharpFilter",props:{filter:{type:Object,required:!0},value:[Object,Array,String,Number],disabled:Boolean},computed:{filterComponent:function(){return"select"===(t=this.filter.type)?tt.Z:"daterange"===t?X:"check"===t?nt:void 0;var t}},methods:{handleInput:function(t){this.$emit("input",t)}}},ot=it,at=(0,h.Z)(ot,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.filterComponent,t._b({tag:"component",attrs:{"filter-key":t.filter.key,value:t.value,disabled:t.disabled},on:{input:t.handleInput}},"component",t.filter,!1))}),[],!1,null,null,null).exports;n(17749);function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;e0}));return{series:n.map((function(t){return t.data[0]})),colors:At(n.map((function(t){return t.color}))),labels:n.map((function(t){var e;return null!==(e=t.label)&&void 0!==e?e:""}))}}(e):void 0;var n,r,i,o,a}var Mt={name:"SharpWidgetChart",props:{display:String,title:String,value:Object,ratioX:Number,ratioY:Number,height:Number,minimal:Boolean,showLegend:{type:Boolean,default:!0},dateLabels:Boolean,options:Object},data:function(){return{zoomed:!1}},computed:{classes:function(){return["SharpWidgetChart--".concat(this.display),{"SharpWidgetChart--aspect-ratio":!this.height}]},style:function(){return{"--ratio-x":this.ratioX,"--ratio-y":this.ratioY}},chartComp:function(){return"line"===(t=this.display)?Lt:"bar"===t?Bt:"pie"===t?$t:void 0;var t},chartData:function(){return Tt(this.display,this.value)},chartOptions:function(){var t,e,n,r,i,o=this;return{chart:{toolbar:{show:this.zoomed},height:null!==(t=this.height)&&void 0!==t?t:"100%",width:"100%",sparkline:{enabled:this.minimal},parentHeightOffset:0,events:{zoomed:function(){o.zoomed=!0}}},xaxis:{type:null!==(e=this.options)&&void 0!==e&&e.horizontal||!this.dateLabels?"category":"datetime"},plotOptions:{bar:{horizontal:!(null===(n=this.options)||void 0===n||!n.horizontal)}},legend:{show:this.showLegend&&!this.minimal},stroke:{curve:null===(r=null===(i=this.options)||void 0===i?void 0:i.curved)||void 0===r||r?"smooth":"straight"}}}}},Vt=(0,h.Z)(Mt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.title?[n("h2",{staticClass:"SharpWidget__title mb-2 mt-3"},[t._v(t._s(t.title))])]:t._e(),t._v(" "),n(t.chartComp,{tag:"component",staticClass:"SharpWidgetChart",class:t.classes,style:t.style,attrs:{"chart-data":t.chartData,options:t.chartOptions}})],2)}),[],!1,null,null,null).exports;function zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e0?{key:"extras",fn:function(){return[n("div",{staticClass:"row mx-n2"},[t._l(t.filters,(function(e){return[n("div",{staticClass:"col-auto px-2"},[n("SharpFilter",{key:e.id,attrs:{filter:e,value:t.filterValue(e.key)},on:{input:function(n){return t.handleFilterChanged(e,n)}}})],1)]}))],2)]},proxy:!0}:null,t.commands.length?{key:"extras-right",fn:function(){return[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("dashboard.commands.dashboard.label"))+"\n ")]},proxy:!0}],null,!1,3867860828)})]},proxy:!0}:null],null,!0)})}),[],!1,null,null,null).exports;function Yt(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function Jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xt(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},multiforms:function(){return this.forms?Object.values(this.forms):null},canCreate:function(){return this.showCreateButton&&!!this.authorizations.create},canReorder:function(){return this.showReorderButton&&this.config.reorderable&&this.authorizations.update&&this.items.length>1},canSearch:function(){return this.showSearchField&&!!this.config.searchable},items:function(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.list.items)&&void 0!==t?t:[]},columns:function(){var t=this;return this.layout.map((function(e){return be(be({},e),t.containers[e.key])}))},paginated:function(){return!!this.config.paginated},totalCount:function(){var t,e;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.list.totalCount)&&void 0!==t?t:this.items.length},pageSize:function(){var t;return null===(t=this.data)||void 0===t?void 0:t.list.pageSize},hasActionsColumn:function(){var t=this;return!this.reorderActive&&this.items.some((function(e){return t.instanceHasState(e)||t.instanceHasCommands(e)}))},hasStateOnly:function(){var t=this;return this.items.some((function(e){return!t.instanceHasCommands(e)&&t.instanceHasState(e)&&!t.instanceHasStateAuthorization(e)}))}},methods:{storeGetter:function(t){return this.$store.getters["".concat(this.module,"/").concat(t)]},storeDispatch:function(t,e){return this.$store.dispatch("".concat(this.module,"/").concat(t),e)},handleSearchSubmitted:function(t){this.search=t,this.storeDispatch("setQuery",be(be({},this.query),{},{search:t,page:1}))},handleFilterChanged:function(t,e){this.storeDispatch("setQuery",be(be(be({},this.query),this.filterNextQuery({filter:t,value:e})),{},{page:1}))},handleReorderButtonClicked:function(){this.reorderActive=!this.reorderActive,this.reorderedItems=this.reorderActive?pe(this.items):null,this.$emit("reordering",this.reorderActive)},handleReorderSubmitted:function(){var t=this;return this.storeDispatch("reorder",{instances:this.reorderedItems.map((function(e){return t.instanceId(e)}))}).then((function(){t.data.list.items=pe(t.reorderedItems),t.reorderedItems=null,t.reorderActive=!1,t.$emit("reordering",!1)}))},handleCreateButtonClicked:function(t){var e=t?this.formUrl({formKey:t.key}):this.formUrl();location.href=e},instanceId:function(t){var e=this.config.instanceIdAttribute;return e?t[e]:t.id},instanceState:function(t){if(!this.instanceHasState(t))return null;var e=this.config.state.attribute;return e?t[e]:t.state},instanceHasState:function(t){return!!this.config.state&&this.showEntityState},instanceHasCommands:function(t){return this.instanceCommands(t).flat().length>0},instanceHasStateAuthorization:function(t){if(!this.instanceHasState(t))return!1;var e=this.config.state.authorization,n=this.instanceId(t);return Array.isArray(e)?e.includes(n):!!e},instanceCommands:function(t){var e=this;return(this.config.commands.instance||[]).reduce((function(n,r){return[].concat(pe(n),[r.filter((function(n){return e.isInstanceCommandAllowed(t,n)}))])}),[])},instanceStateOptions:function(t){if(!this.config.state)return null;var e=this.instanceState(t);return this.config.state.values.find((function(t){return t.value===e}))},instanceForm:function(t){var e=this.instanceId(t);return this.multiforms.find((function(t){return t.instances.includes(e)}))},instanceUrl:function(t){var e=this.instanceId(t);if(!this.instanceHasViewAuthorization(t))return null;if(this.hasShowPage)return this.showUrl({instanceId:e});if(this.hasMultiforms){var n=this.instanceForm(t)||{};return this.formUrl({formKey:n.key,instanceId:e})}return this.formUrl({instanceId:e})},instanceHasViewAuthorization:function(t){var e=this.instanceId(t),n=this.authorizations.view;return Array.isArray(n)?n.includes(e):!!n},instanceIsFocused:function(t){var e=this.instanceId(t);return this.focusedItem&&this.focusedItem===e},filterByKey:function(t){return(this.config.filters||[]).find((function(e){return e.key===t}))},setState:function(t,e){var n=this,r=this.instanceId(t);return this.axiosInstance.post("".concat(this.apiPath,"/state/").concat(r),{attribute:this.config.state.attribute,value:e}).then((function(t){var e=t.data;n.handleCommandActionRequested(e.action,e)})).catch((function(t){var e,n,r=null===(e=t.response)||void 0===e?void 0:e.data;422===(null===(n=t.response)||void 0===n?void 0:n.status)&&(0,k.wp)(r.message,{title:(0,k.KQ)("modals.state.422.title"),isError:!0})}))},handleInstanceStateChanged:function(t,e){this.setState(t,e)},handleInstanceCommandRequested:function(t,e){var n=this.instanceId(t);this.handleCommandRequested(e,{instanceId:n})},handleSortChanged:function(t){var e=t.prop,n=t.dir;this.storeDispatch("setQuery",be(be({},this.query),{},{page:1,sort:e,dir:n}))},handleReorderedItemsChanged:function(t){this.reorderedItems=t},handlePageChanged:function(t){this.storeDispatch("setQuery",be(be({},this.query),{},{page:t}))},formUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.formKey,n=t.instanceId;return(0,k.iW)({entityKey:e?"".concat(this.entityKey,":").concat(e):this.entityKey,instanceId:n},{append:!0})},showUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.instanceId;return(0,k.AU)({entityKey:this.entityKey,instanceId:e},{append:!0})},tryParseNumber:function(t){if(Array.isArray(t))return t.map(this.tryParseNumber);var e=Number(t);return isNaN(Number(e))?t:e},filterValueOrDefault:function(t,e){return null!=t&&""!==t?this.tryParseNumber(t):e.default||(e.multiple?[]:null)},showLoading:function(){this.inline||this.$store.dispatch("setLoading",!0)},hideLoading:function(){this.inline||this.$store.dispatch("setLoading",!1)},initCommands:function(){this.addCommandActionHandlers({refresh:this.handleRefreshCommand})},handleCommandRequested:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.instanceId,r=this.commandsQuery,i=this.commandEndpoint(t.key,n);this.currentCommandInstanceId=n,this.sendCommand(t,{postCommand:function(t){return k.hi.post(i,be({query:r},t),{responseType:"blob"})},getForm:function(t){return k.hi.get("".concat(i,"/form"),{params:be(be({},r),t)}).then((function(t){return t.data}))}})},handleRefreshCommand:function(t){var e=this;this.data.list.items=this.items.map((function(n){return r=t.items,i=n,r.find((function(t){return e.instanceId(i)===e.instanceId(t)}))||n;var r,i}))},commandEndpoint:function(t,e){return"".concat(this.apiPath,"/command/").concat(t).concat(e?"/".concat(e):"")},isEntityCommandAllowed:function(t){var e=this.hiddenCommands?this.hiddenCommands.entity:null;return!!t.authorization&&!(e||[]).includes(t.key)},isInstanceCommandAllowed:function(t,e){var n=this.instanceId(t),r=this.hiddenCommands?this.hiddenCommands.instance:null;return(Array.isArray(e.authorization)?e.authorization.includes(n):!!e.authorization)&&!(r||[]).includes(e.key)},mount:function(t){var e,n,r=t.containers,i=t.layout,o=t.data,a=t.fields,l=t.config,s=t.authorizations,u=t.forms;this.containers=r,this.layout=i,this.data=null!=o?o:{},this.fields=null!=a?a:{},this.config=be(be({},l),{},{commands:null!==(e=null==l?void 0:l.commands)&&void 0!==e?e:{},filters:null!==(n=null==l?void 0:l.filters)&&void 0!==n?n:[]}),this.authorizations=s,this.forms=u,this.page=this.data.list.page,!this.sortDir&&(this.sortDir=this.config.defaultSortDir),!this.sortedBy&&(this.sortedBy=this.config.defaultSort)},bindParams:function(t){var e=t.search,n=t.page,r=t.sort,i=t.dir;this.search=e,n&&(this.page=Number(n)),r&&(this.sortedBy=r),i&&(this.sortDir=i)},init:function(){var t,e=this;return(t=x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.visible){t.next=2;break}return t.abrupt("return");case 2:return e.loading=!0,t.next=5,e.storeDispatch("setEntityKey",e.entityKey);case 5:return t.next=7,e.get().catch((function(t){return e.$emit("error",t),Promise.reject(t)}));case 7:return e.bindParams(e.query),t.next=10,e.storeDispatch("update",{config:e.config,filtersValues:e.getFiltersValuesFromQuery(e.query)});case 10:e.$emit("change",{data:e.data,layout:e.layout,config:e.config,containers:e.containers,authorizations:e.authorizations,forms:e.forms}),e.ready=!0,e.loading=!1;case 13:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){he(o,r,i,a,l,"next",t)}function l(t){he(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},beforeMount:function(){this.init(),this.initCommands()}},we=ge,_e=(0,h.Z)(we,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpEntityList",class:t.classes},[t._t("action-bar",null,{props:t.actionBarProps,listeners:t.actionBarListeners}),t._v(" "),t.ready?[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}]},[t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),n("DataList",{attrs:{items:t.items,columns:t.columns,page:t.page,paginated:t.paginated,"total-count":t.totalCount,"page-size":t.pageSize,"reorder-active":t.reorderActive,sort:t.sortedBy,dir:t.sortDir},on:{change:t.handleReorderedItemsChanged,"sort-change":t.handleSortChanged,"page-change":t.handlePageChanged},scopedSlots:t._u([{key:"empty",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.empty_text"))+"\n ")]},proxy:!0},{key:"append-head",fn:function(){return[t.hasEntityCommands?[n("div",{staticClass:"d-flex align-items-center justify-content-end"},[n("CommandsDropdown",{attrs:{commands:t.dropdownEntityCommands,disabled:t.reorderActive},on:{select:t.handleCommandRequested},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.commands.entity.label"))+"\n ")]},proxy:!0}],null,!1,2220987489)})],1)]:t._e()]},proxy:!0},{key:"item",fn:function(e){var r=e.item;return[n("DataListRow",{attrs:{url:t.instanceUrl(r),columns:t.columns,highlight:t.instanceIsFocused(r),row:r},scopedSlots:t._u([t.hasActionsColumn?{key:"append",fn:function(e){return[n("EntityActions",{attrs:{config:t.config,"has-state":t.instanceHasState(r),state:t.instanceState(r),"state-options":t.instanceStateOptions(r),"state-disabled":!t.instanceHasStateAuthorization(r),"has-commands":t.instanceHasCommands(r),commands:t.instanceCommands(r)},on:{command:function(e){return t.handleInstanceCommandRequested(r,e)},"state-change":function(e){return t.handleInstanceStateChanged(r,e)},selecting:function(t){return e.toggleHighlight(t)}}})]}}:null],null,!0)})]}},{key:"append-body",fn:function(){return[t.inline&&t.loading?[n("LoadingOverlay",{attrs:{small:"",absolute:"",fade:""}})]:t._e()]},proxy:!0}],null,!1,2931809364)})],2)]:t.visible&&t.inline?[n("Loading",{attrs:{small:"",fade:""}})]:t._e(),t._v(" "),n("CommandFormModal",t._g(t._b({attrs:{command:t.currentCommand,"entity-key":t.entityKey,"instance-id":t.currentCommandInstanceId}},"CommandFormModal",t.commandFormProps,!1),t.commandFormListeners)),t._v(" "),n("CommandViewPanel",{attrs:{content:t.commandViewContent},on:{close:t.handleCommandViewPanelClosed}})],2)}),[],!1,null,null,null).exports,Oe={components:{Dropdown:u.Lt,DropdownItem:u.hP},props:{forms:Array},computed:{hasIcon:function(){var t;return null===(t=this.forms)||void 0===t?void 0:t.some((function(t){return t.icon}))},visibleForms:function(){var t;return null===(t=this.forms)||void 0===t?void 0:t.filter((function(t){return!!t.label||t.icon}))}},methods:{l:k.KQ,handleSelected:function(t){this.$emit("select",t)}}},Se=(0,h.Z)(Oe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",t._b({attrs:{text:t.l("action_bar.list.forms_dropdown")}},"Dropdown",t.$attrs,!1),[t._l(t.visibleForms,(function(e){return[n("DropdownItem",{key:e.key,on:{click:function(n){return t.handleSelected(e)}}},[n("div",{staticClass:"row gx-2 flex-nowrap"},[t.hasIcon?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"fa-fw"},[n("i",{staticClass:"fa",class:e.icon})])])]:t._e(),t._v(" "),n("div",{staticClass:"col"},[t._v("\n "+t._s(e.label)+"\n ")])],2)])]}))],2)}),[],!1,null,null,null).exports,Ce={props:{count:Number,search:String},methods:{lang:k.KQ},computed:{searchLabel:function(){return(0,k.KQ)("action_bar.list.search.title").replace(":search",this.search)}}},je=(0,h.Z)(Ce,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpEntityListTitle"},[n("div",{staticClass:"row align-items-center gx-2 h-100"},[t.$slots.default?[n("div",{staticClass:"col-auto"},[t._t("default")],2)]:t._e(),t._v(" "),t.count?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpEntityListTitle__info"},[n("div",{staticClass:"row",staticStyle:{"--bs-gutter-x":"inherit"}},[t.$slots.default?[n("div",{staticClass:"col-auto"},[t._v("\n •\n ")])]:t._e(),t._v(" "),n("div",{staticClass:"col"},[n("span",{staticClass:"text-nowrap"},[t._v(t._s(t.count)+" "+t._s(t.lang("action_bar.list.items_count")))])])],2)])])]:t._e(),t._v(" "),t.search?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"SharpEntityListTitle__info"},[n("div",{staticClass:"row",staticStyle:{"--bs-gutter-x":"inherit"}},[n("div",{staticClass:"col-auto"},[t._v("\n •\n ")]),t._v(" "),n("div",{staticClass:"col"},[n("span",{staticClass:"text-nowrap"},[t._v(t._s(t.searchLabel))])])])])])]:t._e()],2)])}),[],!1,null,null,null).exports,xe={name:"SharpActionBarList",mixins:[ht.WH],components:{EntityListTitle:je,MultiformDropdown:Se,ActionBar:u.ol,Dropdown:u.Lt,DropdownItem:u.hP,SharpFilter:at,Search:u.HN,Button:u.zx},props:{count:Number,search:String,filters:Array,filtersValues:Object,forms:Array,primaryCommand:Object,canCreate:Boolean,canReorder:Boolean,canSearch:Boolean,reorderActive:Boolean},computed:{hasForms:function(){return this.forms&&this.forms.length>0},currentEntity:function(){return this.$store.state.currentEntity}},methods:{handleSearchSubmitted:function(t){this.$emit("search-submit",t)},handleFilterChanged:function(t,e){this.$emit("filter-change",t,e)},handlePrimaryCommandClicked:function(){this.$emit("command",this.primaryCommand)},handleReorderButtonClicked:function(){this.$emit("reorder-click"),document.activeElement.blur()},handleReorderSubmitButtonClicked:function(){this.$emit("reorder-submit")},handleCreateButtonClicked:function(){this.$emit("create")},handleCreateFormSelected:function(t){this.$emit("create",t)}}},ke=xe;function Pe(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function De(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ae(t){for(var e=1;e0},hasState:function(){return!!this.state},title:function(){var t;return this.breadcrumb&&this.showBreadcrumb?null===(t=this.breadcrumb[this.breadcrumb.length-1])||void 0===t?void 0:t.name:null}},methods:{handleEditButtonClicked:function(){this.$emit("edit")},handleCommandSelected:function(t){this.$emit("command",t)},handleStateChanged:function(t){this.$emit("state-change",t)},handleScroll:function(){this.showTitle=document.querySelector(".ShowPage__content").getBoundingClientRect().top<0}},mounted:function(){window.addEventListener("scroll",this.handleScroll)}},qe=(0,h.Z)(Ze,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ActionBar",{scopedSlots:t._u([{key:"left",fn:function(){return[n("div",{staticClass:"row align-items-center gx-4"},[t.showBackButton?[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{href:t.backUrl,outline:"",variant:"light",large:""}},[t._v("\n "+t._s(t.l("action_bar.show.back_button"))+"\n ")])],1)]:t._e(),t._v(" "),t.title?[n("div",{staticClass:"col d-none d-md-block",staticStyle:{"min-width":"0"}},[n("div",{staticClass:"h5 mb-0 text-truncate",class:{"opacity-0":!t.showTitle},staticStyle:{transition:"opacity .2s ease-in-out"}},[t._v("\n "+t._s(t.title)+"\n ")])])]:t._e()],2)]},proxy:!0},{key:"right",fn:function(){return[t.canEdit?[n("Button",{attrs:{href:t.formUrl,disabled:t.editDisabled,variant:"light",large:""}},[t._v("\n "+t._s(t.l("action_bar.show.edit_button"))+"\n ")])]:t._e()]},proxy:!0},{key:"extras",fn:function(){return[t.showBreadcrumb?[n("Breadcrumb",{attrs:{items:t.breadcrumb}})]:t._e()]},proxy:!0},{key:"extras-right",fn:function(){return[n("div",{staticClass:"row gx-3"},[t.hasState?[n("div",{staticClass:"col-auto"},[n("ModalSelect",{attrs:{title:t.l("modals.entity_state.edit.title"),"ok-title":t.l("modals.entity_state.edit.ok_button"),value:t.state.value,options:t.stateValues,size:"sm"},on:{change:t.handleStateChanged},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.on;return[n("Button",t._g({staticClass:"btn--opacity-1",class:{"dropdown-toggle":t.canChangeState},attrs:{disabled:!t.canChangeState,text:"",small:""}},r),[n("StateIcon",{staticClass:"me-1",staticStyle:{"vertical-align":"-.125em"},attrs:{color:t.state.color}}),t._v(" "),n("span",{staticClass:"text-truncate"},[t._v(t._s(t.state.label))])],1)]}},{key:"item-prepend",fn:function(t){var e=t.option;return[n("StateIcon",{attrs:{color:e.color}})]}}],null,!1,617643985)})],1)]:t._e(),t._v(" "),t.hasCommands?[n("div",{staticClass:"col-auto"},[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.l("entity_list.commands.instance.label"))+"\n ")]},proxy:!0}],null,!1,2971469203)})],1)]:t._e()],2)]},proxy:!0}])})}),[],!1,null,null,null).exports,Qe=n(58949),We=n(37400),Ge={mixins:[ht.WH],components:{Search:u.HN,SharpFilter:at,MultiformDropdown:Se,Button:u.zx},props:{ready:Boolean,count:Number,search:String,hasSearchQuery:Boolean,filters:Array,filtersValues:Object,primaryCommand:Object,forms:Array,canCreate:Boolean,canReorder:Boolean,canSearch:Boolean,reorderActive:Boolean,collapsed:Boolean,hasActiveQuery:Boolean,sticky:Boolean},data:function(){return{stuck:!1}},computed:{hasForms:function(){return this.forms&&this.forms.length>0},hasLeftControls:function(){var t;return this.hasActiveQuery||this.count>0&&((null===(t=this.filters)||void 0===t?void 0:t.length)>0||this.canSearch)},hasRightControls:function(){return this.canReorder||this.canCreate||!!this.primaryCommand},hasOuterTitle:function(){return this.$slots.default&&(!this.ready||this.hasLeftControls)},barVisible:function(){return!this.collapsed||!this.hasLeftControls},searchLabel:function(){return(0,k.KQ)("action_bar.list.search.title").replace(":search",this.search)}},methods:{handleSearchSubmitted:function(t){this.$emit("search-submit",t)},handleFilterChanged:function(t,e){this.$emit("filter-change",t,e)},handleReorderButtonClicked:function(){this.$emit("reorder-click"),document.activeElement.blur()},handleReorderSubmitButtonClicked:function(){this.$emit("reorder-submit")},handlePrimaryCommandClicked:function(){this.$emit("command",this.primaryCommand)},handleCreateButtonClicked:function(){this.$emit("create")},handleCreateFormSelected:function(t){this.$emit("create",t)}},directives:{sticky:We.CA}},Ye=Ge,Je=(0,h.Z)(Ye,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"sticky",rawName:"v-sticky",value:t.sticky,expression:"sticky"}],staticClass:"action-bar",class:{"position-sticky":t.sticky},on:{"sticky-change":function(e){t.stuck=e.detail}}},[n("div",{staticClass:"position-relative"},[t.hasOuterTitle?[n("div",{staticClass:"mb-2"},[t._t("default")],2)]:t._e(),t._v(" "),t.ready&&t.barVisible?[n("div",{staticClass:"row align-items-end align-content-end",attrs:{"data-sticky-anchor":""}},[t.hasLeftControls&&!t.stuck?[n("div",{staticClass:"col-sm mb-2"},[n("div",{staticClass:"row gy-1 gx-2 gx-md-3"},[t._l(t.filters,(function(e){return[n("div",{staticClass:"col-auto mb-1"},[n("div",{staticClass:"action-bar__element"},[n("SharpFilter",{key:e.id,staticClass:"h-100",attrs:{filter:e,value:t.filtersValues[e.key],disabled:t.reorderActive},on:{input:function(n){return t.handleFilterChanged(e,n)}}})],1)])]})),t._v(" "),t.canSearch?[n("div",{staticClass:"col-auto mb-1"},[n("div",{staticClass:"action-bar__element"},[n("Search",{staticClass:"h-100",attrs:{value:t.search,placeholder:t.l("action_bar.list.search.placeholder"),disabled:t.reorderActive},on:{submit:t.handleSearchSubmitted}})],1)])]:t._e()],2)])]:[n("div",{staticClass:"col-sm align-self-end"},[t._t("default")],2)],t._v(" "),t.hasRightControls&&!t.collapsed?[n("div",{staticClass:"col-sm-auto mb-2"},[n("div",{staticClass:"row flex-nowrap justify-content-end g-2 gx-md-3"},[t.canReorder?[n("div",{staticClass:"col-auto"},[t.reorderActive?[n("div",{staticClass:"row gx-3"},[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{text:""},on:{click:t.handleReorderButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button.cancel"))+"\n ")])],1),t._v(" "),n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"primary"},on:{click:t.handleReorderSubmitButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button.finish"))+"\n ")])],1)])]:[n("Button",{attrs:{text:""},on:{click:t.handleReorderButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.reorder_button"))+"\n ")])]],2)]:t._e(),t._v(" "),t.primaryCommand&&!t.reorderActive?[n("div",{staticClass:"col-auto"},[n("Button",{attrs:{variant:"primary"},on:{click:t.handlePrimaryCommandClicked}},[t._v("\n "+t._s(t.primaryCommand.label)+"\n ")])],1)]:t._e(),t._v(" "),t.canCreate&&!t.reorderActive?[n("div",{staticClass:"col-auto"},[n("div",{staticClass:"action-bar__element"},[t.hasForms?[n("MultiformDropdown",{attrs:{forms:t.forms,variant:"primary",right:""},on:{select:t.handleCreateFormSelected}})]:[n("Button",{attrs:{variant:"primary"},on:{click:t.handleCreateButtonClicked}},[t._v("\n "+t._s(t.l("action_bar.list.create_button"))+"\n ")])]],2)])]:t._e()],2)])]:t._e()],2)]:t._e()],2)])}),[],!1,null,null,null).exports,Xe={props:{label:String}},tn=(0,h.Z)(Xe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.label?[n("div",{staticClass:"show-field__label form-label"},[t._v(t._s(t.label))])]:t._e(),t._v(" "),n("div",{staticClass:"show-field__content"},[t._t("default")],2)],2)}),[],!1,null,null,null).exports;function en(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.lazy;t.$watch(e,(function(e){t.$emit("visible-change",e)}),{immediate:!r})}function nn(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var rn={mixins:[ht.WH],components:{EntityListTitle:je,EntityList:_e,CommandsDropdown:v,ActionBar:Je,FieldLayout:tn},props:{fieldKey:String,entityListKey:String,showCreateButton:Boolean,showReorderButton:Boolean,showSearchField:Boolean,showEntityState:Boolean,showCount:Boolean,hiddenFilters:Object,hiddenCommands:Object,label:String,emptyVisible:Boolean,collapsable:Boolean},data:function(){return{list:null,collapsed:this.collapsable&&!this.getFocusedItem(),focusedItem:this.getFocusedItem(),sticky:!1}},computed:{classes:function(){return{"ShowEntityListField--collapsed":this.collapsed}},storeModule:function(){return"show/entity-lists/".concat(this.fieldKey)},query:function(){return this.storeGetter("query")},filters:function(){return this.storeGetter("filters/filters")},getFiltersQueryParams:function(){return this.storeGetter("filters/getQueryParams")},filtersValues:function(){return this.storeGetter("filters/values")},isVisible:function(){if(this.hasCollapse||this.emptyVisible)return!0;if(this.list){var t,e=this.list,n=e.data,r=e.authorizations;return!!((null===(t=n.list.items)||void 0===t?void 0:t.length)>0||this.showCreateButton&&r.create||this.hasActiveQuery)}},visibleFilters:function(){var t=this;return this.hiddenFilters?this.filters.filter((function(e){return!(e.key in t.hiddenFilters)})):this.filters},hasActiveQuery:function(){var t=this,e=this.visibleFilters.some((function(e){return null!=t.filtersValues[e.key]}));return!!this.query.search||e},hasCollapse:function(){return this.collapsable}},methods:{hasCommands:function(t){return t&&t.some((function(t){return t&&t.length>0}))},storeGetter:function(t){return this.$store.getters["".concat(this.storeModule,"/").concat(t)]},handleChanged:function(t){var e,n=this;return(e=x().mark((function e(){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.list=t,e.next=3,n.$nextTick();case 3:n.layout();case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){nn(o,r,i,a,l,"next",t)}function l(t){nn(o,r,i,a,l,"throw",t)}a(void 0)}))})()},handleDetailsToggle:function(t){this.collapsed=!t.target.open},getFocusedItem:function(){var t=(0,Qe.aE)();if(null!=t&&t.name&&(0,k.eH)(t.params.entityKey,this.entityListKey)&&t.params.instanceId&&t.path.length>this.$route.path.length)return Number(t.params.instanceId)},layout:function(){this.sticky=this.$el.offsetHeight>window.innerHeight-(0,u.tL)()}},created:function(){var t=this,e=this.storeModule.split("/");this.$store.hasModule(e)||this.$store.registerModule(e,se),this.hiddenFilters&&this.$store.dispatch("".concat(this.storeModule,"/setQuery"),this.getFiltersQueryParams(this.hiddenFilters)),en(this,(function(){return t.isVisible}),{lazy:!0})},mounted:function(){var t=this;if(this.focusedItem){var e=this.$el.getBoundingClientRect();window.scrollBy(0,e.top-100)}window.addEventListener("resize",(function(){return t.layout()}))}},on=rn,an=(0,h.Z)(on,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("FieldLayout",{staticClass:"ShowEntityListField",class:t.classes},[n("EntityList",{attrs:{"entity-key":t.entityListKey,module:t.storeModule,"show-create-button":t.showCreateButton,"show-reorder-button":t.showReorderButton,"show-search-field":t.showSearchField,"show-entity-state":t.showEntityState,"hidden-commands":t.hiddenCommands,visible:!t.collapsed,"focused-item":t.focusedItem,inline:""},on:{change:t.handleChanged,reordering:function(e){return t.$emit("reordering",e)}},scopedSlots:t._u([{key:"action-bar",fn:function(e){var r=e.props,i=e.listeners;return[n("ActionBar",t._g(t._b({staticClass:"ShowEntityListField__action-bar",attrs:{collapsed:t.collapsed,filters:t.visibleFilters,"has-active-query":t.hasActiveQuery,sticky:t.sticky}},"ActionBar",r,!1),i),[t.hasCollapse?[n("div",{staticClass:"ShowSection__header ShowSection__header--collapsable position-relative"},[n("div",{staticClass:"row align-items-center gx-0 h-100"},[n("div",{staticClass:"col-auto"},[n("details",{attrs:{open:!t.collapsed},on:{toggle:t.handleDetailsToggle}},[n("summary",{staticClass:"stretched-link"},[n("span",{staticClass:"visually-hidden"},[t._v(t._s(t.label))])])])]),t._v(" "),n("div",{staticClass:"col"},[n("EntityListTitle",{attrs:{count:t.showCount?r.count:null}},[n("h2",{staticClass:"ShowEntityListField__label ShowSection__title mb-0"},[t._v("\n "+t._s(t.label)+"\n ")])])],1)])])]:[n("div",{staticClass:"ShowSection__header d-grid"},[n("EntityListTitle",{attrs:{count:t.showCount?r.count:null}},[n("h2",{staticClass:"ShowEntityListField__label ShowSection__title mb-0"},[t._v("\n "+t._s(t.label)+"\n ")])])],1)]],2)]}}])})],1)}),[],!1,null,null,null).exports,ln=n(15104),sn=n.n(ln);function un(t){return function(t){if(Array.isArray(t))return cn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cn(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n".concat(this.formattedContent,""),components:zn({"x-sharp-file":Ln,"x-sharp-image":Ln,"html-content":Bn},Object.values(null!==(t=this.embeds)&&void 0!==t?t:{}).reduce((function(t,e){return zn(zn({},t),{},Kn({},e.tag,{name:"Embed_".concat((n=e).tag),template:'\n \n \n \n \n \n ',components:{EmbedRenderer:hn.kO},inject:["state"],props:mn({},null===(r=n.attributes)||void 0===r?void 0:r.filter((function(t){return"slot"!==t})).reduce((function(t,e){return mn(mn({},t),{},vn({},e,null))}),{})),data:function(){return{index:0}},computed:{embedOptions:function(){return n},embedData:function(){var t,e=this,r=this.state.embeds[n.key][this.index];return mn(mn({},null===(t=n.attributes)||void 0===t?void 0:t.reduce((function(t,n){return mn(mn({},t),{},vn({},n,(0,hn.ip)(e.$props[n])))}),{})),r)}},created:function(){this.index=this.state.embeds[n.key].length,this.state.embeds[n.key].push(this.embedData),(0,k.U1)(this.embedOptions.tag)}}));var n,r}),{}))}},formattedContent:function(){var t=document.createElement("template");return t.innerHTML=this.content,t.content.querySelectorAll("[data-html-content]").forEach((function(e){var n=document.createElement("html-content");n.setAttribute("content",e.innerHTML.trim()),t.content.insertBefore(n,e),t.content.removeChild(e)})),t.innerHTML}},methods:{init:function(){var t=this;return Mn(x().mark((function e(){var n,r,i;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.$store.getters["show/entityKey"],r=t.$store.getters["show/instanceId"],!((i=t.state.files).length>0)){e.next=7;break}return e.next=6,(0,fn.AZ)({entityKey:n,instanceId:r,files:i,thumbnailWidth:fn.VD,thumbnailHeight:fn.op});case 6:t.state.files=e.sent;case 7:Object.entries(t.state.embeds).filter((function(t){var e=Fn(t,2);e[0];return e[1].length>0})).forEach(function(){var e=Mn(x().mark((function e(i){var o,a,l,s;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Fn(i,2),a=o[0],l=o[1],e.next=3,(0,hn.vI)({entityKey:n,instanceId:r,embedKey:a,embeds:l});case 3:s=e.sent,t.state.embeds=zn(zn({},t.state.embeds),{},Kn({},a,s));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 8:case"end":return e.stop()}}),e)})))()},initState:function(){var t;this.state.files=[],this.state.embeds=Object.fromEntries(Object.entries(null!==(t=this.embeds)&&void 0!==t?t:{}).map((function(t){return[Fn(t,1)[0],[]]})))},handleContentChanged:function(){var t=this;return Mn(x().mark((function e(){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.initState(),e.next=3,t.$nextTick();case 3:return e.next=5,t.init();case 5:case"end":return e.stop()}}),e)})))()}},created:function(){this.initState()},mounted:function(){this.init()}},Nn=Rn,Hn=(0,h.Z)(Nn,(function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.component,{tag:"component"})}),[],!1,null,null,null).exports,Un={mixins:[ht.WH],components:{FieldLayout:tn,TextRenderer:Hn},props:{value:[Object,String],collapseToWordCount:Number,label:String,emptyVisible:Boolean,html:Boolean,localized:Boolean,locale:String,embeds:Object},data:function(){return{expanded:!1}},computed:{classes:function(){return{"ShowTextField--html":this.html}},resolvedValue:function(){var t;return this.localized?null===(t=this.value)||void 0===t?void 0:t[this.locale]:this.value},currentContent:function(){return this.resolvedValue?this.hasCollapsed&&!this.expanded?this.collapsedContent:this.html?this.resolvedValue:dn(this.resolvedValue).trim():null},hasCollapsed:function(){return!!this.collapsedContent},collapsedContent:function(){if(!this.collapseToWordCount||!this.value)return null;var t=this.resolvedValue.trim(),e=dn(t),n=this.html?t:e,r=function(t,e){var n=un(t.matchAll(/\S+\s*/g));return n.length>e?n.slice(0,e).map((function(t){return t[0]})).join(""):t}(e,this.collapseToWordCount);return r.lengtht.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},wrapperElement:function(){return this.hasCollapse?"details":"div"}},methods:{lang:k.KQ,handleCommandSelected:function(t){this.$emit("command",t)},handleDetailsToggle:function(t){this.collapsed=!t.target.open}}},fr=(0,h.Z)(dr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ShowSection",class:t.classes},[n("div",{staticClass:"row"},[t.hasCollapse||t.section.title?[n("div",{staticClass:"col"},[t.hasCollapse?[n("details",{attrs:{open:!t.collapsed},on:{toggle:t.handleDetailsToggle}},[n("summary",{staticClass:"ShowSection__header ShowSection__header--collapsable"},[n("h2",{staticClass:"ShowSection__title d-inline-block mb-0"},[t._v(t._s(t.section.title||" "))])])])]:t.section.title?[n("div",{staticClass:"ShowSection__header"},[n("h2",{staticClass:"ShowSection__title"},[t._v(t._s(t.section.title))])])]:t._e()],2)]:t._e(),t._v(" "),t.hasCommands&&!t.collapsed?[n("div",{staticClass:"col-auto align-self-end mb-2"},[n("CommandsDropdown",{attrs:{commands:t.commands},on:{select:t.handleCommandSelected},scopedSlots:t._u([{key:"text",fn:function(){return[t._v("\n "+t._s(t.lang("entity_list.commands.instance.label"))+"\n ")]},proxy:!0}],null,!1,3630638811)})],1)]:t._e()],2),t._v(" "),t.collapsed?t._e():[n("div",{staticClass:"ShowSection__content"},[n("Grid",{staticClass:"ShowSection__grid",attrs:{rows:[t.section.columns],"col-class":function(){return"ShowSection__col"}},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.itemLayout;return[n("Grid",{staticClass:"ShowPage__fields-grid",attrs:{rows:r.fields,"row-class":t.fieldsRowClass},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.itemLayout;return[t._t("default",null,{fieldLayout:n})]}}],null,!0)})]}}],null,!1,3782670149)})],1)]],2)}),[],!1,null,null,null).exports;function hr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function pr(t){return function(t){if(Array.isArray(t))return mr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},title:function(){var t,e;return this.ready&&this.config.titleAttribute?null!==(t=this.fields[this.config.titleAttribute])&&void 0!==t&&t.localized?null===(e=this.data[this.config.titleAttribute])||void 0===e?void 0:e[this.locale]:this.data[this.config.titleAttribute]:null},isReordering:function(){return Object.values(this.reorderingLists).some((function(t){return t}))}}),methods:{fieldOptions:function(t){var e,n=null===(e=this.fields)||void 0===e?void 0:e[t.key];return n||console.error('Show page: unknown field "'.concat(t.key,'"')),n},fieldValue:function(t){var e;return null===(e=this.data)||void 0===e?void 0:e[t.key]},isFieldVisible:function(t){var e;return!1!==(null===(e=this.fieldsVisible)||void 0===e?void 0:e[t.key])},isSectionCollapsable:function(t){return t.collapsable&&!this.sectionHasField(t,"entityList")},sectionLayout:function(t){return this.sectionHasField(t,"entityList")?"contents":"card"},sectionCommands:function(t){var e;return t.key?(null!==(e=this.config.commands[t.key])&&void 0!==e?e:[]).map((function(t){return t.filter((function(t){return t.authorization}))})):null},fieldsRowClass:function(t){var e=this,n=t.map((function(t){var n=e.fieldOptions(t);return"ShowPage__fields-row--".concat(n.type)}));return["ShowPage__fields-row"].concat(pr(n))},sectionFields:function(t){return t.columns.reduce((function(t,e){return[].concat(pr(t),pr(e.fields.flat()))}),[])},isSectionVisible:function(t){var e,n=this;return this.sectionFields(t).some((function(t){return n.isFieldVisible(t)}))||(null===(e=this.sectionCommands(t))||void 0===e?void 0:e.flat().length)},sectionHasField:function(t,e){var n=this;return this.sectionFields(t).some((function(t){var r=n.fieldOptions(t);return r&&r.type===e}))},handleFieldVisibilityChanged:function(t,e){this.fieldsVisible=br(br({},this.fieldsVisible),{},yr({},t,e))},handleLocaleChanged:function(t){this.locale=t},handleReordering:function(t,e){this.reorderingLists=yr({},t,e)},handleCommandRequested:function(t){var e=this;this.sendCommand(t,{postCommand:function(n){return e.$store.dispatch("show/postCommand",{command:t,data:n})},getForm:function(n){return e.$store.dispatch("show/getCommandForm",{command:t,query:br({},n)})}})},handleStateChanged:function(t){var e=this;return this.$store.dispatch("show/postState",t).then((function(t){e.handleCommandActionRequested(t.action,t)})).catch((function(t){var e,n,r=null===(e=t.response)||void 0===e?void 0:e.data;422===(null===(n=t.response)||void 0===n?void 0:n.status)&&(0,k.wp)(r.message,{title:(0,k.KQ)("modals.state.422.title"),isError:!0})}))},handleRefreshCommand:function(){this.init()},initCommands:function(){this.addCommandActionHandlers({refresh:this.handleRefreshCommand})},updateDocumentTitle:function(t){var e,n,r=null===(e=t.breadcrumb)||void 0===e||null===(n=e.items[t.breadcrumb.items.length-1])||void 0===n?void 0:n.documentTitleLabel;r&&(document.title="".concat(r,", ").concat(document.title))},init:function(){var t,e=this;return(t=x().mark((function t(){var n,r;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("show/setEntityKey",e.$route.params.entityKey);case 2:return t.next=4,e.$store.dispatch("show/setInstanceId",e.$route.params.instanceId);case 4:return t.next=6,(0,k.h3)(e.$store.dispatch("show/get").catch((function(t){return e.$emit("error",t),Promise.reject(t)})));case 6:n=t.sent,(0,k.Gh)(n.notifications),e.updateDocumentTitle(n),e.localized&&(e.locale=null===(r=e.locales)||void 0===r?void 0:r[0]),e.ready=!0,e.refreshKey++;case 12:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){hr(o,r,i,a,l,"next",t)}function l(t){hr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},beforeMount:function(){this.init(),this.initCommands()}},wr=gr,_r=[{name:"show",path:"/(.*)?/s-show/:entityKey/:instanceId?",component:(0,h.Z)(wr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ShowPage",class:t.classes},[n("div",{staticClass:"container"},[t.ready?[n("ActionBarShow",{attrs:{commands:t.authorizedCommands,state:t.instanceState,"state-values":t.stateValues,"form-url":t.formUrl,"back-url":t.backUrl,"can-edit":t.canEdit,"can-change-state":t.canChangeState,"show-back-button":t.showBackButton,breadcrumb:t.breadcrumbItems,"show-breadcrumb":t.breadcrumb.visible,"edit-disabled":t.isReordering},on:{command:t.handleCommandRequested,"state-change":t.handleStateChanged}}),t._v(" "),t.config.globalMessage?[n("GlobalMessage",{attrs:{options:t.config.globalMessage,data:t.data,fields:t.fields}})]:t._e(),t._v(" "),n("div",{staticClass:"ShowPage__content"},[t.title||t.localized?[n("div",{class:t.title?"mb-3":"mb-4"},[n("div",{staticClass:"row align-items-center gx-3 gx-md-4"},[t.localized?[n("div",{staticClass:"col-auto"},[n("LocaleSelect",{attrs:{locales:t.locales,locale:t.locale},on:{change:t.handleLocaleChanged}})],1)]:t._e(),t._v(" "),t.title?[n("div",{staticClass:"col",staticStyle:{"min-width":"0"}},[n("h1",{staticClass:"mb-0 text-truncate h2",domProps:{innerHTML:t._s(t.title)}})])]:t._e()],2)])]:t._e(),t._v(" "),t._l(t.layout.sections,(function(e){return[n("Section",{directives:[{name:"show",rawName:"v-show",value:t.isSectionVisible(e),expression:"isSectionVisible(section)"}],staticClass:"ShowPage__section",attrs:{section:e,layout:t.sectionLayout(e),"fields-row-class":t.fieldsRowClass,collapsable:t.isSectionCollapsable(e),commands:t.sectionCommands(e)},on:{command:t.handleCommandRequested},scopedSlots:t._u([{key:"default",fn:function(r){var i=r.fieldLayout;return[t.fieldOptions(i)?[n("ShowField",{key:t.refreshKey,attrs:{options:t.fieldOptions(i),value:t.fieldValue(i),locale:t.locale,locales:t.locales,"config-identifier":i.key,layout:i,collapsable:e.collapsable},on:{"visible-change":function(e){return t.handleFieldVisibilityChanged(i.key,e)},reordering:function(e){return t.handleReordering(i.key,e)}}})]:[n("UnknownField",{attrs:{name:i.key}})]]}}],null,!0)})]}))],2)]:[n("ActionBarShow")]],2),t._v(" "),n("CommandFormModal",t._g(t._b({attrs:{command:t.currentCommand,"entity-key":t.entityKey,"instance-id":t.instanceId}},"CommandFormModal",t.commandFormProps,!1),t.commandFormListeners)),t._v(" "),n("CommandViewPanel",{attrs:{content:t.commandViewContent},on:{close:t.handleCommandViewPanelClosed}})],1)}),[],!1,null,null,null).exports}];var Or=n(86831),Sr={name:"SharpActionView",components:{Modal:u.u_,LoadingOverlay:u.fz,ActionBar:u.ol},provide:function(){return{axiosInstance:(0,Or.LC)()}},data:function(){return{showErrorPage:!1,errorPageData:null}},computed:{dialogs:function(){return this.$store.state.dialogs},isLoading:function(){return this.$store.getters.isLoading}},methods:{handlePageError:function(t){var e=t.response,n=e.status,r=e.data;("get"===t.config.method&&404===n||403===n)&&(this.showErrorPage=!0,this.errorPageData={status:n,message:r.message})}}},Cr=(0,h.Z)(Sr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"SharpActionView"},[t.showErrorPage?[n("div",{staticClass:"container"},[n("ActionBar"),t._v(" "),n("h1",[t._v("Error "+t._s(t.errorPageData.status))]),t._v(" "),n("p",[t._v(t._s(t.errorPageData.message))])],1)]:[n("router-view",{on:{error:t.handlePageError}}),t._v(" "),n("notifications",{staticStyle:{top:"6rem",right:"1rem"},attrs:{position:"top right","animation-name":"slideRight",reverse:""},scopedSlots:t._u([{key:"body",fn:function(e){var r=e.item,i=e.close;return[n("div",{staticClass:"toast show mb-3",class:"border-"+r.type,attrs:{role:"alert","aria-live":"assertive","aria-atomic":"true","data-test":"notification"}},[n("div",{staticClass:"toast-header"},[n("strong",{staticClass:"me-auto"},[t._v(t._s(r.title))]),t._v(" "),n("button",{staticClass:"btn-close",attrs:{type:"button","data-test":"close-notification","aria-label":"Close"},on:{click:i}})]),t._v(" "),r.text?[n("div",{staticClass:"toast-body",domProps:{innerHTML:t._s(r.text)}})]:t._e()],2)]}}])}),t._v(" "),t._l(t.dialogs,(function(e){return[n("Modal",t._b({key:e.id,on:{ok:e.okCallback,hidden:e.hiddenCallback}},"Modal",e.props,!1),[n("div",{domProps:{innerHTML:t._s(e.text)}})])]}))],t._v(" "),n("LoadingOverlay",{staticClass:"SharpActionView__loading",attrs:{visible:t.isLoading,fade:""}})],2)}),[],!1,null,null,null).exports;function jr(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}var xr={name:"SharpLeftNav",mixins:[(0,ht.Et)("lg")],components:{Loading:u.gb},props:{currentEntity:Object,title:String,collapseable:{type:Boolean,default:!0}},data:function(){return{ready:!1,collapsed:!1,state:"expanded"}},watch:{collapsed:{handler:function(t){document.body.classList.toggle("leftNav--collapsed",this.collapsed),this.state=t?"collapsing":"expanding",setTimeout(this.updateState,250)}}},computed:{currentIcon:function(){var t;return null===(t=this.currentEntity)||void 0===t?void 0:t.icon},classes:function(){return["SharpLeftNav--".concat(this.state),{"SharpLeftNav--collapseable":this.collapseable}]}},methods:{updateState:function(){this.state=this.collapsed?"collapsed":"expanded"},handleClicked:function(){this.collapsed&&(this.collapsed=!1)},init:function(){var t,e=this;return(t=x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$store.dispatch("setCurrentEntity",e.currentEntity),e.ready=!0;case 2:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){jr(o,r,i,a,l,"next",t)}function l(t){jr(o,r,i,a,l,"throw",t)}a(void 0)}))})()}},created:function(){this.collapsed=this.isViewportSmall,this.updateState(),this.init()}},kr=xr,Pr=(0,h.Z)(kr,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"SharpLeftNav",class:t.classes,attrs:{role:"navigation","aria-label":"Menu Sharp"},on:{click:t.handleClicked}},[n("div",{staticClass:"SharpLeftNav__top-icon"},[n("i",{staticClass:"fa",class:t.currentIcon})]),t._v(" "),n("div",{staticClass:"flex-grow-0"},[n("div",{staticClass:"SharpLeftNav__title-container position-relative"},[t._t("title",(function(){return[n("h2",{staticClass:"SharpLeftNav__title mb-0"},[t._v(t._s(t.title))])]}))],2)]),t._v(" "),n("div",{staticClass:"flex-grow-1 position-relative",staticStyle:{"min-height":"0"}},[n("div",{staticClass:"SharpLeftNav__content d-flex flex-column"},[n("div",{staticClass:"SharpLeftNav__inner flex-grow-1 pb-5",staticStyle:{"min-height":"0"}},[t._t("default")],2),t._v(" "),n("a",{staticClass:"SharpLeftNav__collapse-button btn btn-text",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),e.stopPropagation(),t.collapsed=!t.collapsed}}},[n("svg",{staticClass:"SharpLeftNav__collapse-arrow",staticStyle:{fill:"currentColor"},attrs:{width:"8",height:"12",viewBox:"0 0 8 12","fill-rule":"evenodd"}},[n("path",{attrs:{d:"M7.5 10.6L2.8 6l4.7-4.6L6.1 0 0 6l6.1 6z"}})])])])])])}),[],!1,null,null,null).exports,Dr=n(70584);r.default.use(s()),r.default.use(a.N9,{installComponents:!1}),r.default.use(o.Z),r.default.use(i.ZP);var Ar=(0,Qe.Nd)(),Er=(0,Dr.h)();r.default.use((function(t,e){e.store,e.router}),{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router;e.store.registerModule("dashboard",ft),n.addRoutes(ie)}),{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router;e.store.registerModule("entity-list",se),n.addRoutes(Fe)}),{store:Er,router:Ar}),r.default.use((function(t,e){e.store.registerModule("global-filters",G),t.component("sharp-global-filters",(function(){return Promise.resolve().then(n.bind(n,17749))}))}),{store:Er,router:Ar}),r.default.use(c.ZP,{store:Er,router:Ar}),r.default.use((function(t,e){var n=e.router,r=e.store;n.addRoutes(_r),r.registerModule("show",Ue),t.component("ShowField",cr)}),{store:Er,router:Ar}),r.default.use(u.ZP,{store:Er,router:Ar}),r.default.component("sharp-action-view",Cr),r.default.component("sharp-left-nav",Pr),r.default.component("sharp-nav-section",u.yV),r.default.component("sharp-nav-item",u.LY),new r.default({el:"#sharp-app",store:Er,router:Ar})},70584:function(t,e,n){n.d(e,{h:function(){return a}});var r=n(20629),i={state:{loading:!1,dialogs:[],currentEntity:null},mutations:{setLoading:function(t,e){t.loading=!!e},setDialogs:function(t,e){t.dialogs=e},setCurrentEntity:function(t,e){t.currentEntity=e}},getters:{isLoading:function(t){return!!t.loading}},actions:{setLoading:function(t,e){(0,t.commit)("setLoading",e)},setDialogs:function(t,e){(0,t.commit)("setDialogs",e)},setCurrentEntity:function(t,e){(0,t.commit)("setCurrentEntity",e)}}},o=null;function a(){return o||(o=new r.ZP.Store(i))}},4935:function(t,e,n){n.d(e,{i0:function(){return b},wp:function(){return v}});var r=n(70584),i=n(16114),o=["text","okCallback","okCloseOnly","isError"],a=["title"],l=["title"];function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var p=0;function m(t){var e=t.text,n=(t.okCallback,t.okCloseOnly),i=t.isError,a=h(t,o),l=p++;function s(){(0,r.h)().dispatch("setDialogs",(0,r.h)().state.dialogs.filter((function(t){return t.id!==l})))}return new Promise((function(t){(0,r.h)().dispatch("setDialogs",[].concat(d((0,r.h)().state.dialogs),[{id:l,props:u(u({},a),{},{okOnly:n,noCloseOnBackdrop:n,noCloseOnEsc:n,visible:!0,isError:i}),okCallback:t,hiddenCallback:s,text:e}]))}))}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.title,r=h(e,a);return m(u({okCloseOnly:!0,text:t,title:n},r))}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.title,r=h(e,l);return m(u({text:t,title:n,size:"sm",hideHeader:!0,okTitle:(0,i.K)("modals.confirm.ok_button"),bodyClass:"pt-4"},r))}},16114:function(t,e,n){function r(t,e){var n,r=null===(n=window.i18n)||void 0===n?void 0:n[t];return r||(void 0!==e?e:t)}n.d(e,{K:function(){return r}})},79226:function(t,e,n){n.d(e,{G:function(){return i}});var r=n(70538);function i(t){setTimeout((function(){var e;null==t||null===(e=t.forEach)||void 0===e||e.call(t,(function(t){return n=(e=t).level,i=e.title,o=e.message,a=e.autoHide,void r.default.notify({title:i,type:n,text:o,duration:a?4e3:-1});var e,n,i,o,a}))}),500)}},88264:function(t,e,n){n.d(e,{Oh:function(){return c},Vz:function(){return f},mB:function(){return d},uN:function(){return h}});var r=n(80129),i=n.n(r),o=n(30381),a=n.n(o);function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},e=t["content-disposition"];if(e&&e.includes("attachment")){var n=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,r=n.exec(e);if(null!=r&&r[1])return r[1].replace(/['"]/g,"")}return null}n.d(e,{E:function(){return r},U:function(){return i}})},27531:function(t,e,n){var r=n(23645),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,".unknown-field[data-v-d6c36028]{background:rgba(255,0,0,.25);border:1px solid red;font-family:Courier New,Courier,monospace;font-weight:700;padding:.5em 1em}",""]),e.Z=i},60330:function(){},25390:function(){},24877:function(t,e,n){n.d(e,{Z:function(){return i}});var r={name:"SharpFilterControl",props:{label:String},methods:{handleLabelClicked:function(){this.$emit("label-click")},handleClicked:function(){this.$emit("click")}}},i=(0,n(51900).Z)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"input-group input-group-sm flex-nowrap SharpFilterControl",on:{click:t.handleClicked}},[t.label?[n("div",{staticClass:"input-group-text bg-white",on:{click:t.handleLabelClicked}},[t._v("\n "+t._s(t.label)+"\n ")])]:t._e(),t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports},17749:function(t,e,n){n.r(e),n.d(e,{default:function(){return p}});var r=n(87757),i=n.n(r),o=n(20629),a=n(24903),l=n(89955),s=n(50779);function u(t,e,n,r,i,o,a){try{var l=t[o](a),s=l.value}catch(t){return void n(t)}l.done?e(s):Promise.resolve(s).then(r,i)}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={components:{FilterSelect:l.Z,Dropdown:s.Lt},computed:function(t){for(var e=1;e