@dnncommunity/dnn-elements 0.15.0-beta.21 → 0.15.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,5 +7,5 @@ var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e ins
7
7
  /** Reusable DNN UI component to pick a color
8
8
  * @copyright Copyright (c) .NET Foundation. All rights reserved.
9
9
  * @license MIT
10
- */var v=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var b=e("dnn_color_picker",function(){function e(e){var r=this;t(this,e);this.colorChanged=n(this,"colorChanged",7);this.color="FFFFFF";this.colorBoxHeight="50%";this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";this.handleSaturationLightnessMouseDown=function(e){e.preventDefault();r.handleDragLightnessSaturation(e);window.addEventListener("mousemove",r.handleDragLightnessSaturation);window.addEventListener("mouseup",r.handleSaturationLightnessMouseUp)};this.handleDragLightnessSaturation=function(e){var t=r.saturationLightnessBox.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width;var o=e.clientY-t.top;if(o<0){o=0}if(o>t.height){o=t.height}o=1-o/t.height;var i=new g;i.hue=r.currentColor.hue;i.saturation=n;i.lightness=o;r.currentColor=i};this.handleSaturationLightnessMouseUp=function(){window.removeEventListener("mousemove",r.handleDragLightnessSaturation);window.removeEventListener("mouseup",r.handleSaturationLightnessMouseUp)};this.handleHueMouseDown=function(e){e.preventDefault();r.handleDragHue(e);window.addEventListener("mousemove",r.handleDragHue);window.addEventListener("mouseup",r.handleHueMouseUp)};this.handleHueMouseUp=function(){window.removeEventListener("mousemove",r.handleDragHue);window.removeEventListener("mouseup",r.handleHueMouseUp)};this.handleDragHue=function(e){var t=r.hueRange.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width*360;var o=new g;o.hue=n;o.saturation=r.currentColor.saturation;o.lightness=r.currentColor.lightness;r.currentColor=o};this.handleComponentValueChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var o=new g;if(n<0){n=0}if(n>255){n=255}var i=r.currentColor.red;var s=r.currentColor.green;var a=r.currentColor.blue;switch(t){case"red":i=n;break;case"green":s=n;break;case"blue":a=n;break}o.green=s;o.red=i;o.blue=a;r.currentColor=o};this.handleHSLChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var o=new g;if(n!=null){var i=r.currentColor.hue;var s=r.currentColor.saturation;var a=r.currentColor.lightness;switch(t){case"hue":if(n<0){n=0}if(n>359){n=0}i=n;break;case"saturation":if(n<0){n=0}if(n>100){n=100}s=n/100;break;case"lightness":if(n<0){n=0}if(n>100){n=100}a=n/100;break}o.hue=i;o.saturation=s;o.lightness=a;r.currentColor=o}};this.handleSaturationLightnessKeyDown=function(e){var t=new g;t.hue=r.currentColor.hue;t.saturation=r.currentColor.saturation;t.lightness=r.currentColor.lightness;var n=.01;if(e.shiftKey){n=.1}switch(e.key){case"ArrowUp":t.lightness+=n;break;case"ArrowDown":t.lightness-=n;break;case"ArrowLeft":t.saturation-=n;break;case"ArrowRight":t.saturation+=n}r.currentColor=t};this.handleHueKeyDown=function(e){var t=new g;t.hue=r.currentColor.hue;t.saturation=r.currentColor.saturation;t.lightness=r.currentColor.lightness;var n=1;if(e.shiftKey){n=10}switch(e.key){case"ArrowLeft":t.hue-=n;break;case"ArrowRight":t.hue+=n}r.currentColor=t}}e.prototype.colorChangedHandler=function(e){this.colorChanged.emit(e)};e.prototype.handeCurrentColorChanged=function(e){this.colorChangedHandler(e)};e.prototype.componentWillLoad=function(){this.handleHexChange(this.color)};e.prototype.componentDidLoad=function(){this.el.style.setProperty("--color-box-height",this.colorBoxHeight.toString())};e.prototype.getHex=function(){return this.getDoublet(this.currentColor.red)+this.getDoublet(this.currentColor.green)+this.getDoublet(this.currentColor.blue)};e.prototype.getContrast=function(){return this.currentColor.contrastColor};e.prototype.getDoublet=function(e){var t=e.toString(16).toUpperCase();if(t.length===1){return"0"+t}return t};e.prototype.handleHexChange=function(e){var t=new g;if(e.match(/^(?:[\da-f]{3}|[\da-f]{6})$/i).length>0){if(e.length===3){var n=e[0]+e[0]+e[1]+e[1]+e[2]+e[2];e=n}t.red=parseInt(e.substr(0,2),16);t.green=parseInt(e.substr(2,2),16);t.blue=parseInt(e.substr(4,2),16)}else{t.red=this.currentColor.red;t.green=this.currentColor.green;t.blue=this.currentColor.blue}this.currentColor=t};e.prototype.switchColorMode=function(e){switch(e.target.id){case"rgb-switch":this.rgbDisplay="none";this.hslDisplay="none";this.hexDisplay="flex";break;case"hex-switch":this.rgbDisplay="none";this.hslDisplay="flex";this.hexDisplay="none";break;case"hsl-switch":this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";break;default:this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none"}};e.prototype.render=function(){var e=this;var t=this.currentColor.hue;var n=this.currentColor.saturation;var o=this.currentColor.lightness;var i=this.currentColor.red;var s=this.currentColor.green;var a=this.currentColor.blue;return r("div",{class:"dnn-color-picker"},r("div",{class:"dnn-color-sliders"},r("div",{class:"dnn-color-s-b",ref:function(t){return e.saturationLightnessBox=t},style:{backgroundColor:"hsl(".concat(t,",100%,50%)")},onMouseDown:this.handleSaturationLightnessMouseDown.bind(this)},r("button",{class:"dnn-s-b-picker","aria-label":"Press up or down to adjust lightness, left or right to adjust saturation, hold shift to move by 10%",role:"slider","aria-valuemin":"0","aria-valuemax":"100","aria-valuetext":"Saturation: ".concat(Math.round(this.currentColor.saturation*100),"%, Lightness: ").concat(Math.round(this.currentColor.lightness*100),"%"),style:{left:Math.round(n*100)+"%",bottom:Math.round(o*100)+"%"},onKeyDown:function(t){return e.handleSaturationLightnessKeyDown(t)}})),r("div",{class:"dnn-color-bar"},r("div",{class:"dnn-color-result",style:{backgroundColor:"#"+this.getHex(),boxShadow:"0 0 2px 1px "+"#"+this.getContrast()}}),r("div",{class:"dnn-color-hue",ref:function(t){return e.hueRange=t},onMouseDown:this.handleHueMouseDown.bind(this)},r("button",{class:"dnn-hue-picker","aria-label":"Press left or right to adjust hue, hold shift to move by 10 degrees",role:"slider","aria-valuemin":"0","aria-valuemax":"359","aria-valuenow":Math.round(t),style:{left:(t/359*100).toString()+"%"},onKeyDown:function(t){return e.handleHueKeyDown(t)}})))),r("div",{class:"dnn-color-fields"},r("div",{class:"dnn-rgb-color-fields",style:{display:this.rgbDisplay}},r("div",{class:"dnn-rgb-color-field"},r("label",null,"R"),r("input",{type:"number",min:"0",max:"255",step:"1",class:"red",value:i,"aria-label":"red value",onChange:function(t){return e.handleComponentValueChange(t,"red")}})),r("div",{class:"dnn-rgb-color-field"},r("label",null,"G"),r("input",{type:"number",min:"0",max:"255",class:"green",value:s,"aria-label":"green value",onChange:function(t){return e.handleComponentValueChange(t,"green")}})),r("div",{class:"dnn-rgb-color-field"},r("label",null,"B"),r("input",{type:"number",min:"0",max:"255",class:"blue",value:a,"aria-label":"blue value",onChange:function(t){return e.handleComponentValueChange(t,"blue")}})),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"rgb-switch",onClick:this.switchColorMode.bind(this),"aria-label":"switch to hexadecimal value entry"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),r("div",{class:"dnn-hsl-color-fields",style:{display:this.hslDisplay}},r("div",{class:"dnn-hsl-color-field"},r("label",null,"H"),r("input",{type:"number",min:"0",max:"359",step:1,value:Math.round(t),"aria-label":"Hue",onChange:function(t){return e.handleHSLChange(t,"hue")}})),r("div",{class:"dnn-hsl-color-field"},r("label",null,"S"),r("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(n*100),"aria-label":"Saturation",onChange:function(t){return e.handleHSLChange(t,"saturation")}})),r("div",{class:"dnn-hsl-color-field"},r("label",null,"L"),r("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(o*100),"aria-label":"Lightness",onChange:function(t){return e.handleHSLChange(t,"lightness")}})),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"hsl-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to red, green, blue entry mode"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),r("div",{class:"dnn-hex-color-fields",style:{display:this.hexDisplay}},r("div",{class:"dnn-hex-color-field"},r("label",null,"HEX"),r("div",{class:"hex-input"},r("input",{type:"text","aria-label":"Hexadecimal value",value:this.getHex(),onChange:function(t){return e.handleHexChange(t.target.value)}}),r("button",{class:"copy","aria-label":"copy value"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))))),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"hex-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to hue saturation lightness values"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"})))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currentColor:["handeCurrentColorChanged"]}},enumerable:false,configurable:true});return e}());v([s(100)],b.prototype,"colorChangedHandler",null);b.style=m;var x=":host{--border-color:var(--dnn-color-tertiary-contrast, lightgray);--border-radius:var(--dnn-controls-radius, 5px);--drop-background-color:var(--dnn-color-tertiary, lightblue);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem;text-align:center;border:2px dashed var(--border-color);border-radius:var(--border-radius);padding:1rem;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host(.dropping){background-color:var(--drop-background-color)}p{margin:0;padding:0}button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:0px;margin:0;padding:0;background-color:transparent}button:hover{cursor:pointer}button svg{margin-right:0.5rem}label.upload-file{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}label.upload-file input{display:none}.video-preview{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.video-preview button{margin:1rem}";var w=e("dnn_dropzone",function(){function e(e){var r=this;t(this,e);this.filesSelected=n(this,"filesSelected",7);this.resx={dragAndDropFile:"Drag and drop a file",capture:"Capture",or:"or",takePicture:"Take a picture",uploadFile:"Upload a file"};this.allowCameraMode=false;this.captureQuality=.8;this.canTakeSnapshots=false;this.takingPicture=false;this.handleDragOver=function(e){e.stopPropagation();e.preventDefault();e.dataTransfer.dropEffect="copy";r.dropzone.classList.add("dropping")};this.handleDrop=function(e){e.stopPropagation();e.preventDefault();var t=e.dataTransfer.files;if(r.hasInvalidExtensions(t)){return}var n=r.getFilesFromFileList(t);r.filesSelected.emit(n)}}e.prototype.componentDidLoad=function(){var e=this;if(this.allowCameraMode){this.checkIfBrowserCanTakeSnapshots().then((function(t){return e.canTakeSnapshots=t}))}if(this.allowedExtensions!=undefined&&this.allowedExtensions.length>0){var t=this.allowedExtensions.map((function(e){return".".concat(e)}));var n=t.join(",");this.fileInput.accept=n}};e.prototype.checkIfBrowserCanTakeSnapshots=function(){return new Promise((function(e){var t=navigator.mediaDevices;if(t==undefined||t.enumerateDevices==undefined){e(false)}t.enumerateDevices().then((function(t){var n=t.some((function(e){return e.kind=="videoinput"}));e(n)}))}))};e.prototype.getFilesFromFileList=function(e){var t=[];for(var n=0;n<e.length;n++){var r=e[n];t.push(r)}return t};e.prototype.handleUploadButton=function(e){var t=this.getFilesFromFileList(e.files);this.filesSelected.emit(t)};e.prototype.hasInvalidExtensions=function(e){var t=false;for(var n=0;n<e.length;n++){var r=e[n];var o=/(?:\.([^.]+))?$/;var i=o.exec(r.name)[1];if(i==undefined){t=true}if(this.allowedExtensions!=undefined&&!this.allowedExtensions.includes(i)){t=true}return t}};e.prototype.takeSnapshot=function(){var e=this;this.takingPicture=true;navigator.mediaDevices.getUserMedia({video:true,audio:false}).then((function(t){e.videoPreview.srcObject=t;e.videoPreview.play().then((function(){e.videoSettings=t.getVideoTracks()[0].getSettings()}))})).catch((function(e){return alert(e)}))};e.prototype.applySnapshot=function(){var e=this;var t=document.createElement("canvas");var n=t.getContext("2d");t.width=this.videoSettings.width;t.height=this.videoSettings.height;n.drawImage(this.videoPreview,0,0);t.toBlob((function(t){var n=new File([t],"image.jpeg",{type:"image/jpeg"});e.takingPicture=false;var r=[n];e.filesSelected.emit(r)}),"image/jpeg",this.captureQuality)};e.prototype.render=function(){var e=this;var t,n,i,s,a,l;return r(o,{ref:function(t){return e.dropzone=t},class:"dropzone",onDragOver:this.handleDragOver,onDrop:this.handleDrop,onDragLeave:function(){return e.dropzone.classList.remove("dropping")}},!this.takingPicture&&[r("p",null,(t=this.resx)===null||t===void 0?void 0:t.dragAndDropFile),r("p",null,"- ",(n=this.resx)===null||n===void 0?void 0:n.or," -"),r("label",{class:"upload-file"},r("input",{type:"file",ref:function(t){return e.fileInput=t},onChange:function(t){return e.handleUploadButton(t.target)}}),r("span",null,r("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("g",null,r("rect",{fill:"none",height:"24",width:"24"})),r("g",null,r("path",{d:"M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"}))))," ",(i=this.resx)===null||i===void 0?void 0:i.uploadFile),this.canTakeSnapshots&&[r("p",null,"- ",(s=this.resx)===null||s===void 0?void 0:s.or," -"),r("button",{onClick:function(){return e.takeSnapshot()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("circle",{cx:"12",cy:"12",r:"3.2"}),r("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})),(a=this.resx)===null||a===void 0?void 0:a.takePicture)]],this.takingPicture&&r("div",{class:"video-preview"},r("video",{ref:function(t){return e.videoPreview=t}}),r("button",{onClick:function(){return e.applySnapshot()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("circle",{cx:"12",cy:"12",r:"3.2"}),r("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}))," ",(l=this.resx)===null||l===void 0?void 0:l.capture)))};return e}());w.style=x;var y;(function(e){e[e["nw"]=0]="nw";e[e["ne"]=1]="ne";e[e["se"]=2]="se";e[e["sw"]=3]="sw"})(y||(y={}));function k(e,t){var n=0;var r=0;if(e instanceof MouseEvent){n=e.movementX;r=e.movementY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var o=e.touches[0];if(t!=undefined){n=o.pageX-this.previousTouch.pageX;r=o.pageY-this.previousTouch.pageY}t=o}}return{movementX:n,movementY:r}}var C=":host{display:block}canvas{display:none}.view{visibility:hidden;opacity:0;height:0;overflow:hidden;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.view.visible{visibility:visible;opacity:1;height:initial;overflow:visible}.view .cropper{position:relative;width:100%}.view .cropper img{width:100%;display:block;margin:0 auto}.view .cropper .backdrop{-webkit-backdrop-filter:saturate(0.5);backdrop-filter:saturate(0.5);-webkit-backdrop-filter:brightness(0.5);backdrop-filter:brightness(0.5);position:absolute;left:0;top:0;width:100%;height:100%}.view .cropper .crop{position:absolute;top:0;left:0;width:100%;height:100%;outline:2px dashed white;-webkit-box-shadow:black 0 0 0px 2px;box-shadow:black 0 0 0px 2px;-webkit-backdrop-filter:saturate(2);backdrop-filter:saturate(2);-webkit-backdrop-filter:brightness(2);backdrop-filter:brightness(2);cursor:move}.view .cropper .crop>div{width:20px;height:20px;background-color:white;border:2px solid rgba(0, 0, 0, 0.5);position:absolute}.view .cropper .crop>div.nw,.view .cropper .crop>div.ne{top:-17px}.view .cropper .crop>div.ne,.view .cropper .crop>div.se{right:-17px}.view .cropper .crop>div.se,.view .cropper .crop>div.sw{bottom:-17px}.view .cropper .crop>div.sw,.view .cropper .crop>div.nw{left:-17px}.view .cropper .crop>div.nw,.view .cropper .crop>div.se{cursor:nwse-resize}.view .cropper .crop>div.ne,.view .cropper .crop>div.sw{cursor:nesw-resize}dnn-modal{--max-width:512px}";var M=e("dnn_image_cropper",function(){function e(e){var r=this;t(this,e);this.imageCropChanged=n(this,"imageCropChanged",7);this.width=600;this.height=600;this.resx={capture:"Capture",dragAndDropFile:"Drag and drop an image",or:"or",takePicture:"Take a picture",uploadFile:"Upload an image",imageTooSmall:"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.",modalCloseText:"Close"};this.quality=.8;this.preventUndersized=false;this.handleCropMouseDown=function(e){e.stopPropagation();e.preventDefault();var t=e.target;var n=t.classList[0];document.addEventListener("mouseup",r.handleImageCropFinished,false);document.addEventListener("touchend",r.handleImageCropFinished,false);switch(n){case"crop":document.addEventListener("mousemove",r.handleCropDrag,false);document.addEventListener("touchmove",r.handleCropDrag,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleCropDrag)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleCropDrag)}));break;case"nw":document.addEventListener("mousemove",r.handleNwMouseMove,false);document.addEventListener("touchmove",r.handleNwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleNwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleNwMouseMove)}));break;case"ne":document.addEventListener("mousemove",r.handleNeMouseMove,false);document.addEventListener("touchmove",r.handleNeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleNeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleNeMouseMove)}));break;case"se":document.addEventListener("mousemove",r.handleSeMouseMove,false);document.addEventListener("touchmove",r.handleSeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleSeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleSeMouseMove)}));break;case"sw":document.addEventListener("mousemove",r.handleSwMouseMove,false);document.addEventListener("touchmove",r.handleSwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleSwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleSwMouseMove)}));break}};this.handleImageCropFinished=function(e){r.emitImage();document.removeEventListener("mouseup",r.handleImageCropFinished);r.previousTouch=undefined};this.handleNwMouseMove=function(e){r.handleCornerDrag(e,y.nw)};this.handleNeMouseMove=function(e){r.handleCornerDrag(e,y.ne)};this.handleSeMouseMove=function(e){r.handleCornerDrag(e,y.se)};this.handleSwMouseMove=function(e){r.handleCornerDrag(e,y.sw)};this.handleCornerDrag=function(e,t){if(!r.isMouseStillInTarget(e)){return}var n=r.getCornerLeftTop(t),o=n.left,i=n.top;var s=0;var a=0;var l="horizontal";var d=r.width/r.height;var c=r.crop.getBoundingClientRect();var h=r.image.getBoundingClientRect();var u=k(e,r.previousTouch),p=u.movementX,f=u.movementY;if(Math.abs(p)<Math.abs(f)){l="vertical"}if(l=="horizontal"){switch(t){case y.nw:case y.sw:s=c.width-p;a=s/d;break;case y.ne:case y.se:s=c.width+p;a=s/d;break}}else{switch(t){case y.nw:case y.ne:a=c.height-f;s=a*d;break;case y.se:case y.sw:a=c.height+f;s=a*d;break}}switch(t){case y.ne:case y.nw:var g=c.height-a;i=r.crop.offsetTop+g}switch(t){case y.nw:case y.sw:var m=c.width-s;o=r.crop.offsetLeft+m;if(o<0)o=0;if(o>h.width)o=h.width;if(i<0)i=0;if(i>h.height)i=h.height;if(o+s>h.width)s=h.width-o;if(i+a>h.height)a=h.height-i;break;case y.ne:case y.se:if(i<0)i=0;if(i>h.height)i=h.height;if(o+s>h.width)s=h.width-o;if(i+a>h.height)a=h.height-i;break}if(s/a!=d){return}if(r.preventUndersized){var v=r.image.width/r.image.naturalWidth;if(s/v<r.width||a/v<r.height){return}}switch(t){case y.ne:r.crop.style.top="".concat(i,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.nw:r.crop.style.left="".concat(o,"px");r.crop.style.top="".concat(i,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.se:r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.sw:r.crop.style.left="".concat(o,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break}};this.handleCropDrag=function(e){if(!r.isMouseStillInTarget(e)){return}var t=k(e,r.previousTouch),n=t.movementX,o=t.movementY;var i=r.crop.offsetLeft+n;var s=r.crop.offsetTop+o;var a=r.image.getBoundingClientRect();var l=r.crop.getBoundingClientRect();if(i<0){i=0}if(s<0){s=0}if(i+l.width>a.width){i=r.crop.offsetLeft}if(s+l.height>a.height){s=r.crop.offsetTop}r.crop.style.left=i+"px";r.crop.style.top=s+"px"}}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.setView("noPictureView")}))};e.prototype.setView=function(e){var t=this.host.shadowRoot.querySelectorAll(".view");t.forEach((function(e){return e.classList.remove("visible")}));switch(e){case"noPictureView":this.noPictureView.classList.add("visible");break;case"hasPictureView":this.hasPictureView.classList.add("visible");break}this.view=e};e.prototype.initCrop=function(){var e=this.width/this.height;var t=this.image.getBoundingClientRect();var n=t.width/t.height;if(e>n){var r=t.width/e;var o=t.height-r;this.crop.style.top=Math.round(o/2).toString()+"px";this.crop.style.height=Math.round(r).toString()+"px"}else{var i=t.height*e;var o=t.width-i;this.crop.style.left=Math.round(o/2).toString()+"px";this.crop.style.width=Math.round(i).toString()+"px"}};e.prototype.setImage=function(){var e=this;this.image.addEventListener("load",(function(){e.initCrop();e.emitImage()}));this.image.src=this.canvas.toDataURL()};e.prototype.handleNewFile=function(e){var t=this;if(e.type.split("/")[0]!="image"){return}var n=new FileReader;n.onload=function(e){var n=new Image;n.onload=function(){t.canvas.width=n.width;t.canvas.height=n.height;if(t.preventUndersized&&(n.width<t.width||n.height<t.height)){t.imageTooSmallModal.show();return}var e=t.canvas.getContext("2d");e.drawImage(n,0,0);t.setView("hasPictureView");t.setImage()};n.src=e.target.result.toString()};n.readAsDataURL(e)};e.prototype.emitImage=function(){var e=this.crop.offsetLeft/this.image.width*this.image.naturalWidth;var t=this.crop.offsetTop/this.image.height*this.image.naturalHeight;var n=this.crop.getBoundingClientRect();var r=n.width/this.image.width*this.image.naturalWidth;var o=n.height/this.image.height*this.image.naturalHeight;if(e<0)e=0;if(e>this.image.naturalWidth)e=this.image.naturalWidth;if(t<0)t=0;if(t>this.image.naturalWidth)t=this.image.naturalWidth;if(r>this.image.naturalWidth)r=this.image.naturalWidth;if(o>this.image.naturalHeight)o=this.image.naturalHeight;var i=this.generateCroppedImage(e,t,r,o,this.width,this.height);this.imageCropChanged.emit(i)};e.prototype.generateCroppedImage=function(e,t,n,r,o,i){this.canvas.width=o;this.canvas.height=i;var s=this.canvas.getContext("2d");s.clearRect(0,0,o,i);s.drawImage(this.image,e,t,n,r,0,0,o,i);return this.canvas.toDataURL("image/jpeg",this.quality)};e.prototype.getCornerLeftTop=function(e){var t=0;var n=0;switch(e){case y.se:t=this.crop.offsetLeft;n=this.crop.offsetTop;break;case y.sw:n=this.crop.offsetTop;break}return{top:n,left:t}};e.prototype.isMouseStillInTarget=function(e){var t=false;var n;var r;var o=this.image.getBoundingClientRect();if(e instanceof MouseEvent){n=e.clientX;r=e.clientY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var i=e.touches[0];n=i.clientX;r=i.clientY}}if(n>=o.x&&r>=o.y&&n<=o.left+o.width&&r<=o.top+o.height){t=true}var s=this.crop.querySelectorAll("div");s.forEach((function(e){var o=e.getBoundingClientRect();if(n>=o.x&&r>=o.y&&n<=o.left+o.width&&r<=o.top+o.height){t=true}}));return t};e.prototype.render=function(){var e=this;return r(o,{ref:function(t){return e.host=t}},r("canvas",{ref:function(t){return e.canvas=t}}),r("div",{class:"view",ref:function(t){return e.hasPictureView=t}},r("div",{class:"cropper"},r("img",{ref:function(t){return e.image=t}}),r("div",{class:"backdrop"}),r("div",{class:"crop",ref:function(t){return e.crop=t},onMouseDown:this.handleCropMouseDown,onTouchStart:this.handleCropMouseDown},r("div",{class:"nw"}),r("div",{class:"ne"}),r("div",{class:"se"}),r("div",{class:"sw"})))),r("div",{class:"view",ref:function(t){return e.noPictureView=t}},r("dnn-dropzone",{allowCameraMode:true,onFilesSelected:function(t){return e.handleNewFile(t.detail[0])},resx:{capture:this.resx.capture,dragAndDropFile:this.resx.dragAndDropFile,or:this.resx.or,takePicture:this.resx.takePicture,uploadFile:this.resx.uploadFile}})),r("dnn-modal",{ref:function(t){return e.imageTooSmallModal=t},"close-text":this.resx.modalCloseText},r("p",null,this.resx.imageTooSmall.replace("{width}",this.width.toString()).replace("{height}",this.height.toString()))))};return e}());M.style=C;var D=":host{display:block}:host .overlay{background-color:rgba(0, 0, 0, 0.5);position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;visibility:hidden;opacity:0}:host .overlay .modal{max-width:var(--max-width, 1200px);background-color:white;padding:30px;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;z-index:2;position:relative;margin:10%;max-height:80%;border-radius:var(--dnn-controls-radius, 5px);-webkit-box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);display:block}:host .overlay .modal .close{position:absolute;background-color:white;border:2px solid white;border-radius:50%;padding:0;margin:0;top:-12px;right:-12px;outline:none;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .overlay .modal .close:focus,:host .overlay .modal .close:hover{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary, blue);box-shadow:0 0 2px 2px var(--dnn-color-primary, blue)}:host .overlay .modal .close svg{width:24px;height:24px;color:grey}:host .overlay.visible{visibility:visible;opacity:1}:host .overlay.visible .modal{-webkit-transform:scale(1);transform:scale(1);-webkit-box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);display:block}";var L=e("dnn_modal",function(){function e(e){t(this,e);this.dismissed=n(this,"dismissed",7);this.backdropDismiss=true;this.closeText="Close modal";this.showCloseButton=true;this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.handleDismiss=function(){this.visible=false;this.dismissed.emit()};e.prototype.handleBackdropClick=function(e){var t=e.target;if(t.id==="backdrop"&&this.backdropDismiss){this.handleDismiss()}};e.prototype.render=function(){var e=this;return r(o,null,r("div",{id:"backdrop",class:this.visible?"overlay visible":"overlay",onClick:function(t){return e.handleBackdropClick(t)}},r("div",{class:"modal"},this.showCloseButton&&r("button",{class:"close","aria-label":this.closeText,onClick:function(){return e.handleDismiss()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))),r("slot",null))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());L.style=D;var _=":host{display:block}.add-role-row{display:-ms-flexbox;display:flex;gap:1em;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.add-role-row label{margin-right:0.5em}.search-user{display:-ms-flexbox;display:flex;gap:1em;margin-top:1em}.search-user .search-control{position:relative}.search-user .search-control dnn-collapsible{position:absolute;left:0;top:calc(100% - 2px);width:100%;-webkit-box-shadow:0px 4px 4px;box-shadow:0px 4px 4px}.search-user .search-control dnn-collapsible .dropdown{background-color:white;border:1px solid lightgray;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.search-user .search-control dnn-collapsible .dropdown button{background-color:transparent;border:none;border-bottom:1px solid lightgray;padding:0.25em;margin:0;text-align:left}table{border:1px solid lightgray;border-collapse:collapse;margin-top:1em}table thead{text-align:center}table thead tr{border-bottom:1px solid lightgray}table thead th{background-color:lightgray;padding:0.25em 0.5em}table thead th:first-child{border-right:1px solid lightgray}table tbody tr{border-bottom:1px dotted lightgray}table tbody tr th{text-align:left;border-right:1px solid lightgray;padding:0 0.5em}table tbody tr td{text-align:center}table tbody tr td dnn-checkbox span{display:none}table tbody tr td button{background-color:transparent;border:0;padding:0;margin:0;margin-right:1em}";var S=e("dnn_permissions_grid",function(){function e(e){t(this,e);this.userSearchQueryChanged=n(this,"userSearchQueryChanged",7);this.permissionsChanged=n(this,"permissionsChanged",7);this.resx={Add:"Add",AllRoles:"All Roles",FilterByGroup:"Filter By Group",GlobalRoles:"Global Roles",Role:"Role",RolePermissions:"Role Permissions",SelectRole:"Select Role",User:"User",UserPermissions:"User Permissions"};this.foundUsers=[];this.selectedRoleGroupId=-1}e.prototype.handleFoundUsersChanged=function(e){var t=this;if((e===null||e===void 0?void 0:e.length)>0){setTimeout((function(){t.userCollapsible.expanded=true}),100)}};e.prototype.componentWillLoad=function(){document.addEventListener("click",this.dismissUserResults.bind(this))};e.prototype.disconnectedCallback=function(){document.removeEventListener("click",this.disconnectedCallback.bind(this))};e.prototype.dismissUserResults=function(e){var t=this.roleDropDown.getBoundingClientRect();if(e.pageX>t.right||e.pageX<t.left||e.pageY>t.bottom||e.pageY<t.top){this.userCollapsible.expanded=false}};e.prototype.handleRoleGroupChanged=function(e){var t=e.selectedIndex;var n=Number.parseInt(e.options[t].value);this.selectedRoleGroupId=n};e.prototype.addRole=function(){var e=Number.parseInt(this.roleDropDown.options[this.roleDropDown.selectedIndex].value);var t=this.roles.filter((function(t){return t.RoleId==e}))[0];this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray(__spreadArray([],this.permissions.rolePermissions,true),[{default:false,locked:false,permissions:[],roleId:t.RoleId,roleName:t.RoleName}],false)});this.permissionsChanged.emit(this.permissions)};e.prototype.addUser=function(){if(this.pickedUser!=undefined){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray(__spreadArray([],this.permissions.userPermissions,true),[{displayName:this.pickedUser.displayName,permissions:[],userId:this.pickedUser.userId}],false)});this.pickedUser=undefined;this.userQuery="";this.permissionsChanged.emit(this.permissions)}};e.prototype.getRoles=function(){var e=this;var t=this.roles.filter((function(t){return!e.permissions.rolePermissions.some((function(e){return e.roleId==t.RoleId}))}));if(this.selectedRoleGroupId==-2){return t}if(this.selectedRoleGroupId==-1){return t.filter((function(e){return e.IsSystemRole}))}return t.filter((function(t){return t.RoleGroupId==e.selectedRoleGroupId}))};e.prototype.renderRoleCheckBox=function(e,t){var n=this;var o=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];if(e.locked){return r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("g",{fill:"none"},r("path",{d:"M0 0h24v24H0V0z"}),r("path",{d:"M0 0h24v24H0V0z",opacity:".87"})),r("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}))}var i=o==undefined?"intermediate":o.allowAccess?"checked":"unchecked";return r("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(r){return n.handleRoleChanged(r.detail,e,t)}},r("div",{slot:"intermediateicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),r("div",{slot:"uncheckedicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),r("span",null,t.permissionName))};e.prototype.renderUserCheckBox=function(e,t){var n=this;var o=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];var i=o==undefined?"intermediate":o.allowAccess?"checked":"unchecked";return r("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(r){return n.handleUserChanged(r.detail,e,t)}},r("div",{slot:"intermediateicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),r("div",{slot:"uncheckedicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),r("span",null,t.permissionName))};e.prototype.handleRoleChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return r})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.handleUserChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return r})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.removeRole=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.filter((function(t){return t.roleId!=e.roleId})),true)});this.permissionsChanged.emit()};e.prototype.removeUser=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.filter((function(t){return t.userId!=e.userId})),true)});this.permissionsChanged.emit(this.permissions)};e.prototype.handleQueryChanged=function(e){this.userQuery=e;if(e==undefined||e.length==0){this.userCollapsible.expanded=false;this.pickedUser=undefined;this.foundUsers=[];return}this.userSearchQueryChanged.emit(e)};e.prototype.handleSearchUserFieldKeyDown=function(e){if(e.key!="ArrowDown"){return}e.preventDefault();var t=this.userCollapsible.querySelector("button");if(t!=undefined){t.focus()}};e.prototype.handleSearchedUserKeyDown=function(e){var t=e.target;switch(e.key){case"ArrowDown":e.preventDefault();var n=t.nextElementSibling;n===null||n===void 0?void 0:n.focus();break;case"ArrowUp":e.preventDefault();var r=t.previousElementSibling;r===null||r===void 0?void 0:r.focus();break}};e.prototype.handleUserPicked=function(e){this.userQuery=e.displayName;this.pickedUser=e};e.prototype.getFilteredUsers=function(){var e=this;return this.foundUsers.filter((function(t){return!e.permissions.userPermissions.some((function(e){return e.userId==t.userId}))}))};e.prototype.render=function(){var e=this;var t=this.getRoles();return r(o,null,r("div",{class:"add-role-row"},r("div",{class:"dropdown"},r("label",null,this.resx.FilterByGroup," :"),r("select",{onChange:function(t){return e.handleRoleGroupChanged(t.target)}},r("option",{value:-2,selected:this.selectedRoleGroupId==-2},this.resx.AllRoles),r("option",{value:-1,selected:this.selectedRoleGroupId==-1},this.resx.GlobalRoles),this.roleGroups.map((function(t){return r("option",{value:t.id,selected:e.selectedRoleGroupId==t.id},t.name)})))),t&&t.length>0&&[r("div",{class:"dropdown"},r("label",null,this.resx.SelectRole," :"),r("select",{ref:function(t){return e.roleDropDown=t}},this.getRoles().map((function(e){return r("option",{value:e.RoleId},e.RoleName)})))),r("dnn-button",{type:"primary",onClick:function(){return e.addRole()}},this.resx.Add)]),r("table",{class:"roles-table"},r("caption",null,this.resx.RolePermissions),r("thead",null,r("tr",null,r("th",null,this.resx.Role),this.permissions.permissionDefinitions.map((function(e){return r("th",null,e.permissionName)})),r("th",null," "))),r("tbody",null,this.permissions.rolePermissions.map((function(t){return r("tr",null,r("th",null,t.roleName),e.permissions.permissionDefinitions.map((function(n){return r("td",null,e.renderRoleCheckBox(t,n))})),r("td",null,!t.default&&r("button",{onClick:function(){return e.removeRole(t)}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))),r("div",{class:"search-user"},r("div",{class:"search-control"},r("dnn-searchbox",{placeholder:this.resx.User,debounced:true,onQueryChanged:function(t){return e.handleQueryChanged(t.detail)},onKeyDown:function(t){return e.handleSearchUserFieldKeyDown(t)},query:this.userQuery}),r("dnn-collapsible",{ref:function(t){return e.userCollapsible=t}},r("div",{class:"dropdown"},this.getFilteredUsers().map((function(t){return r("button",{onKeyDown:function(t){return e.handleSearchedUserKeyDown(t)},onClick:function(){return e.handleUserPicked(t)}},t.displayName)}))))),this.pickedUser&&r("dnn-button",{onClick:function(){return e.addUser()}},this.resx.Add)),this.permissions.userPermissions&&this.permissions.userPermissions.length>0&&r("table",{class:"users-table"},r("caption",null,this.resx.UserPermissions),r("thead",null,r("tr",null,r("th",null,this.resx.User),this.permissions.permissionDefinitions.map((function(e){return r("th",null,e.permissionName)})),r("th",null," "))),r("tbody",null,this.permissions.userPermissions.map((function(t){return r("tr",null,r("th",null,t.displayName),e.permissions.permissionDefinitions.map((function(n){return r("td",null,e.renderUserCheckBox(t,n))})),r("td",null,r("button",{onClick:function(){return e.removeUser(t)}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))))};Object.defineProperty(e,"watchers",{get:function(){return{foundUsers:["handleFoundUsersChanged"]}},enumerable:false,configurable:true});return e}());S.style=_;var z=":host{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;--background-color:transparent;--color:#333;--border-size:1px;--border-color:grey;--border-active-color:black;--border-radius:var(--dnn-controls-radius, 5px);--padding:var(--dnn-controls-padding, 5px);--focus-color:var(--dnn-color-primary, blue)}:host input{width:100%;border:var(--border-size) solid var(--border-color);outline:none;border-radius:var(--border-radius);padding:var(--padding);padding-right:32px;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host input:focus,:host input:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--focus-color);box-shadow:0 0 2px 2px var(--focus-color)}:host svg{position:absolute;top:0;right:0;height:100%;-webkit-transform:scale(0.7);transform:scale(0.7);fill:var(--color);outline:var(--color);color:var(--color);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host button{background:transparent;border:0;margin:0;padding:0}:host button:focus svg,:host button:hover svg{fill:var(--focus-color);outline:var(--focus-color);color:var(--focus-color)}";var I=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var H=e("dnn_searchbox",function(){function e(e){t(this,e);this.queryChanged=n(this,"queryChanged",7);this.placeholder="";this.debounced=true;this.query=""}e.prototype.fireQueryChanged=function(){if(this.debounced){this.debouncedHandleQueryChanged()}else{this.handleQueryChanged()}};e.prototype.handleQueryChanged=function(){this.queryChanged.emit(this.query)};e.prototype.debouncedHandleQueryChanged=function(){this.handleQueryChanged()};e.prototype.render=function(){var e=this;return r(o,null,r("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.query=t.target.value}}),this.query!==""?r("button",{class:"svg clear",onClick:function(){return e.query=""}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))):r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))};Object.defineProperty(e,"watchers",{get:function(){return{query:["fireQueryChanged"]}},enumerable:false,configurable:true});return e}());I([s(500)],H.prototype,"debouncedHandleQueryChanged",null);H.style=z;var E=":host{--color:#888;--color-sorted:var(--dnn-color-primary, rgb(2,139,255));--color-hover:var(--dnn-color-primary-light, #36a1ff);display:inline-block}button{outline:none;border:none;margin:0;padding:0;background-color:transparent;outline:none;display:inline-block;line-height:1em;position:relative;top:0.25em}button svg{height:1.5em;width:auto;fill:var(--color)}button.active svg{fill:var(--color-sorted)}button:hover svg,button:focus svg{fill:var(--color-hover)}";var P=e("dnn_sort_icon",function(){function e(e){t(this,e);this.sortChanged=n(this,"sortChanged",7);this.sortDirection="none"}e.prototype.changeSort=function(){switch(this.sortDirection){case"asc":this.sortDirection="desc";break;case"desc":this.sortDirection="asc";break;case"none":this.sortDirection="asc";break}this.sortChanged.emit(this.sortDirection)};e.prototype.render=function(){var e=this;return r(o,null,r("button",{class:{active:this.sortDirection!="none"},onClick:function(){return e.changeSort()}},this.sortDirection=="none"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z"})),this.sortDirection=="asc"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 7 H 12 L 6 0 Z"})),this.sortDirection=="desc"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 9 H 12 L 6 16 Z"}))))};return e}());P.style=E;var R="";var T=e("dnn_tab",function(){function e(e){t(this,e);this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.render=function(){return r(o,null,this.visible&&r("slot",null))};return e}());T.style=R;var j=":host{display:block;--color-background:var(--dnn-color-secondary-dark, lightgray);--color-text:var(--dnn-color-secondary-contrast, #333);--color-visible:var(--dnn-color-primary, #3792ED);--color-visible-text:var(--dnn-color-primary-contrast, #FFF);--color-focus:var(--dnn-color-primary, #3792ed)}.tabTitles{display:-ms-flexbox;display:flex;background-color:var(--color-background);color:var(--color-text)}.tabTitles button{padding:0.5rem 1rem;border:0;margin:0;background-color:transparent}.tabTitles button.visible{background-color:var(--color-visible);color:var(--color-bisible-text)}.tabTitles button:focus,.tabTitles button:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--color-focus);box-shadow:0 0 2px 2px var(--color-focus)}.currentTab{border:1px solid var(--color-background);padding:1rem}";var F=e("dnn_tabs",function(){function e(e){t(this,e);this.tabTitles=[];this.selectedTabTitle=""}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.updateTitles();e.showFirstTab()}))};e.prototype.getTabs=function(){return this.component.shadowRoot.querySelector("slot").assignedElements()};e.prototype.updateTitles=function(){var e=this;var t=this.getTabs();t.forEach((function(t){return e.tabTitles=__spreadArray(__spreadArray([],e.tabTitles,true),[t.tabTitle],false)}))};e.prototype.showFirstTab=function(){var e=this.getTabs()[0];e.show();this.selectedTabTitle=e.tabTitle};e.prototype.showTab=function(e){var t=this.getTabs();t.forEach((function(t){if(t.tabTitle==e){t.show();return}t.hide()}));this.selectedTabTitle=e};e.prototype.render=function(){var e=this;return r(o,{ref:function(t){return e.component=t}},r("div",{class:"tabTitles"},this.tabTitles.map((function(t){return r("button",{class:e.selectedTabTitle==t?"visible":"",onClick:function(){return e.showTab(t)}},t)}))),r("div",{class:"currentTab"},r("slot",null)))};return e}());F.style=j;var A=":host{display:inline-block;outline:none;cursor:pointer}button{height:1.5em;width:2.5em;outline:none;background-color:var(--background, #888);border:0;border-radius:var(--border-radius, var(--dnn-controls-radius, 0.75em));padding:0.1em;position:relative;margin:0;-webkit-transition:background-color 300ms ease-in-out;transition:background-color 300ms ease-in-out;position:relative;cursor:pointer}button:hover,button:focus{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary);box-shadow:0 0 2px 2px var(--dnn-color-primary)}button.checked{background-color:var(--background-checked, var(--dnn-color-primary, blue))}button.checked .handle{left:calc(1em + 4px)}button:disabled{opacity:0.5;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none}button .handle{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;background-color:white;width:1em;height:1em;border-radius:var(--handle-border-radius, var(--dnn-controls-radius, 50%));position:absolute;top:calc(50% - 0.5em);left:2px}";var B=e("dnn_toggle",function(){function e(e){t(this,e);this.checkChanged=n(this,"checkChanged",7);this.checked=false;this.disabled=false}e.prototype.checkedChanged=function(e){this.checkChanged.emit({checked:e})};e.prototype.render=function(){var e=this;return r(o,null,r("button",{disabled:this.disabled,class:{checked:this.checked},onClick:function(){if(!e.disabled){e.checked=!e.checked}}},r("div",{class:"handle"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["checkedChanged"]}},enumerable:false,configurable:true});return e}());B.style=A;var O=":host{display:-ms-flexbox;display:flex;overflow:visible}.expander{width:24px;height:24px}.expander button{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;background-color:transparent;border:none;padding:0;margin:0;height:1em;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;position:relative;top:2px}.expander button svg :first-child{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;fill:white;stroke:black}.expander.expanded button{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.expander.expanded button svg :first-child{fill:black;stroke:black}div.item .item-slot{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25em;min-height:24px}div.item div.children{overflow:hidden;height:0;-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}";var U=e("dnn_treeview_item",function(){function e(e){t(this,e);this.userExpanded=n(this,"userExpanded",3);this.userCollapsed=n(this,"userCollapsed",3);this.expanded=false;this.hasChildren=false}e.prototype.watchExpanded=function(e){if(e){this.expander.classList.add("expanded");this.collapsible.expanded=true;return}this.expander.classList.remove("expanded");this.collapsible.expanded=false};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){var t=e.childElement.children[0];var n=t.assignedElements().length;if(n>0){e.hasChildren=true}if(e.expanded){e.expander.classList.add("expanded");e.collapsible.expanded=false;setTimeout((function(){e.collapsible.expanded=true}),300)}}))};e.prototype.toggleCollapse=function(){this.expanded=!this.expanded;if(this.expanded){this.expander.classList.add("expanded");this.userExpanded.emit();return}this.expander.classList.remove("expanded");this.userCollapsed.emit()};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"expander",ref:function(t){return e.expander=t}},this.hasChildren&&r("button",{onClick:function(){return e.toggleCollapse()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M10 17l5-5-5-5v10z"}),r("path",{d:"M0 24V0h24v24H0z",fill:"none"})))),r("div",{class:"item"},r("div",{class:"item-slot"},r("slot",null)),r("dnn-collapsible",{ref:function(t){return e.collapsible=t},expanded:this.expanded},r("div",{ref:function(t){return e.childElement=t}},r("slot",{name:"children"})))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}());U.style=O;var V=":host{--background-color:var(--dnn-color-primary-contrast, white);--foreground-color:var(--dnn-color-primary, #3792ED);display:block}.menu-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;background-color:var(--background-color)}.menu-container .menu{margin:0.5em;display:-ms-flexbox;display:flex;gap:1em;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;white-space:nowrap;width:100%}.menu-container .overflow{margin-left:auto;position:relative}.menu-container .overflow button{cursor:pointer;padding:0;margin:0;background-color:transparent;border:none}.menu-container .overflow button svg{fill:var(--foreground-color)}.menu-container .overflow .dropdown{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;white-space:nowrap;right:0;-webkit-transition:100ms ease-in-out;transition:100ms ease-in-out;height:0;overflow:hidden}.menu-container .overflow .dropdown.visible{padding:1em;gap:0.5em;background-color:var(--background-color);-webkit-box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7);box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7)}";var W=e("dnn_vertical_overflow_menu",function(){function e(e){t(this,e);this.showDropdownButton=false;this.showDropdownMenu=false;this.previousMenuWidth=0}e.prototype.componentDidRender=function(){var e=this;requestAnimationFrame((function(){e.moveItemsToDropDownIfNecessery();e.resizeObserver=new ResizeObserver((function(t){for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.contentRect.width<e.previousMenuWidth){e.moveItemsToDropDownIfNecessery()}if(e.previousMenuWidth>0&&o.contentRect.width>e.previousMenuWidth){e.moveItemsToMenuIfPossible()}e.previousMenuWidth=o.contentRect.width}}));e.resizeObserver.observe(e.element)}))};e.prototype.moveItemsToDropDownIfNecessery=function(){var e=this;var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var r=parseFloat(getComputedStyle(this.element).fontSize)*2;t.forEach((function(t){return r+=e.getFullWidth(t)}));r+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);if(r>n){this.showDropdownButton=true;var o=t[t.length-1];if(this.dropdown==undefined){return}o.slot="dropdown";this.moveItemsToDropDownIfNecessery()}};e.prototype.moveItemsToMenuIfPossible=function(){var e=this;if(this.dropdown==undefined||!this.dropdown.hasChildNodes()){return}var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var r=parseFloat(getComputedStyle(this.element).fontSize)*2;r+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);t.forEach((function(t){return r+=e.getFullWidth(t)}));var o=this.dropdown.querySelector("slot").assignedElements()[0];if(o!=undefined){r+=this.getFullWidth(o)}if(r<n){if(o!=undefined){o.slot=""}if(o==undefined){this.dropdown.classList.remove("visible");this.showDropdownMenu=false;this.showDropdownButton=false}}};e.prototype.getFullWidth=function(e){var t=e.getBoundingClientRect().width;var n=getComputedStyle(e);t+=parseFloat(n.marginLeft);t+=parseFloat(n.marginRight);t+=parseFloat(n.paddingLeft);t+=parseFloat(n.paddingRight);return t};e.prototype.toggleOverflowMenu=function(){var e=this;this.showDropdownMenu=!this.showDropdownMenu;if(this.showDropdownMenu){this.dropdown.classList.add("visible");var t=0;var n=Array.from(this.dropdown.querySelector("slot").assignedElements());n.forEach((function(e){return t+=e.getBoundingClientRect().height}));var r=parseFloat(getComputedStyle(this.dropdown).fontSize);var o=r*(this.dropdown.children.length-1)/2;t+=o;var i=r*2;t+=i;this.dropdown.style.height="".concat(t,"px");var s=function(t){var n=e.button.getBoundingClientRect();if(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom){e.toggleOverflowMenu()}document.removeEventListener("click",s)};setTimeout((function(){document.addEventListener("click",s,false)}),100)}else{this.dropdown.classList.remove("visible");this.dropdown.style.height="0px"}};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"menu-container"},r("div",{class:"menu",ref:function(t){return e.menu=t}},r("slot",null)),this.showDropdownButton&&r("div",{class:"overflow"},r("button",{ref:function(t){return e.button=t},class:"icon",onClick:function(){return e.toggleOverflowMenu()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),r("div",{class:"dropdown",ref:function(t){return e.dropdown=t}},r("slot",{name:"dropdown"})))))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());W.style=V;var N=":host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;margin:0 auto;position:relative;--left-pane-background-color:transparent;--right-pane-background-color:transparent}button{border:none;margin:0;padding:0;cursor:ew-resize;position:absolute;height:100%;background-color:transparent}button.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane{overflow-y:auto}.pane.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane.left{background-color:var(--left-pane-background-color)}.pane.right{background-color:var(--right-pane-background-color);-ms-flex-positive:1;flex-grow:1}";var q=e("dnn_vertical_splitview",function(){function e(e){t(this,e);this.widthChanged=n(this,"widthChanged",7);this.splitterWidth=16;this.splitWidthPercentage=30;this.leftWidth=0;this.rightWidth=0}e.prototype.setSplitWidthPercentage=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var n=this;return __generator(this,(function(r){t=this.element.shadowRoot.querySelectorAll(".pane");requestAnimationFrame((function(){t.forEach((function(e){return e.classList.add("transition")}));n.splitter.classList.add("transition");requestAnimationFrame((function(){var r=n.element.getBoundingClientRect().width;var o=r*e/100;if(o<0){o=0}if(o>r){o=r}n.leftWidth=o;n.rightWidth=r-o;setTimeout((function(){t.forEach((function(e){return e.classList.remove("transition")}));n.splitter.classList.remove("transition")}),300)}))}));return[2]}))}))};e.prototype.getSplitWidthPercentage=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.getBoundingClientRect().width;return[2,this.leftWidth/e]}))}))};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.resizeObserver=new ResizeObserver((function(){var t=e.element.getBoundingClientRect().width;e.leftWidth=t*e.splitWidthPercentage/100;e.rightWidth=t-e.leftWidth;e.widthChanged.emit(e.splitWidthPercentage)}));e.resizeObserver.observe(e.element)}))};e.prototype.handleMouseDown=function(e){var t=this;e.preventDefault();var n=function(e){requestAnimationFrame((function(){var n=t.element.getBoundingClientRect().width;var r=k(e,t.previousTouch).movementX;var o=t.leftWidth+r;if(o<0){o=0}if(o>n){o=n}t.leftWidth=o;t.rightWidth=n-o;t.splitWidthPercentage=t.leftWidth/n*100}))};var r=function(){document.removeEventListener("mousemove",n);document.removeEventListener("touchmove",n);var e=t.element.getBoundingClientRect().width;var r=t.leftWidth/e*100;t.widthChanged.emit(r)};document.addEventListener("mouseup",r);document.addEventListener("touchend",r);document.addEventListener("mousemove",n);document.addEventListener("touchmove",n)};e.prototype.handleKeyDown=function(e){var t=0;switch(e.key){case"ArrowLeft":t=-10;break;case"ArrowRight":t=10;break;default:return}if(e.shiftKey){t=t*10}var n=this.element.getBoundingClientRect().width;var r=this.leftWidth+t;if(r<0){r=0}if(r>n){r=n}this.leftWidth=r;this.rightWidth=n-this.leftWidth};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"left pane",style:{width:"".concat(this.leftWidth,"px")}},r("slot",{name:"left"})),r("button",{onMouseDown:function(t){return e.handleMouseDown(t)},onTouchStart:function(t){return e.handleMouseDown(t)},onKeyDown:function(t){return e.handleKeyDown(t)},ref:function(t){return e.splitter=t},style:{minWidth:"".concat(this.splitterWidth.toString(),"px"),left:"".concat(this.leftWidth-2,"px")}},r("slot",null)),r("div",{class:"right pane",style:{width:"".concat(this.rightWidth,"px")}},r("slot",{name:"right"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());q.style=N}}}));
11
- //# sourceMappingURL=p-31dc68a7.system.entry.js.map
10
+ */var v=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var b=e("dnn_color_picker",function(){function e(e){var r=this;t(this,e);this.colorChanged=n(this,"colorChanged",7);this.color="FFFFFF";this.colorBoxHeight="50%";this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";this.handleSaturationLightnessMouseDown=function(e){e.preventDefault();r.handleDragLightnessSaturation(e);window.addEventListener("mousemove",r.handleDragLightnessSaturation);window.addEventListener("mouseup",r.handleSaturationLightnessMouseUp)};this.handleDragLightnessSaturation=function(e){var t=r.saturationLightnessBox.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width;var o=e.clientY-t.top;if(o<0){o=0}if(o>t.height){o=t.height}o=1-o/t.height;var i=new g;i.hue=r.currentColor.hue;i.saturation=n;i.lightness=o;r.currentColor=i};this.handleSaturationLightnessMouseUp=function(){window.removeEventListener("mousemove",r.handleDragLightnessSaturation);window.removeEventListener("mouseup",r.handleSaturationLightnessMouseUp)};this.handleHueMouseDown=function(e){e.preventDefault();r.handleDragHue(e);window.addEventListener("mousemove",r.handleDragHue);window.addEventListener("mouseup",r.handleHueMouseUp)};this.handleHueMouseUp=function(){window.removeEventListener("mousemove",r.handleDragHue);window.removeEventListener("mouseup",r.handleHueMouseUp)};this.handleDragHue=function(e){var t=r.hueRange.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width*360;var o=new g;o.hue=n;o.saturation=r.currentColor.saturation;o.lightness=r.currentColor.lightness;r.currentColor=o};this.handleComponentValueChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var o=new g;if(n<0){n=0}if(n>255){n=255}var i=r.currentColor.red;var s=r.currentColor.green;var a=r.currentColor.blue;switch(t){case"red":i=n;break;case"green":s=n;break;case"blue":a=n;break}o.green=s;o.red=i;o.blue=a;r.currentColor=o};this.handleHSLChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var o=new g;if(n!=null){var i=r.currentColor.hue;var s=r.currentColor.saturation;var a=r.currentColor.lightness;switch(t){case"hue":if(n<0){n=0}if(n>359){n=0}i=n;break;case"saturation":if(n<0){n=0}if(n>100){n=100}s=n/100;break;case"lightness":if(n<0){n=0}if(n>100){n=100}a=n/100;break}o.hue=i;o.saturation=s;o.lightness=a;r.currentColor=o}};this.handleSaturationLightnessKeyDown=function(e){var t=new g;t.hue=r.currentColor.hue;t.saturation=r.currentColor.saturation;t.lightness=r.currentColor.lightness;var n=.01;if(e.shiftKey){n=.1}switch(e.key){case"ArrowUp":t.lightness+=n;break;case"ArrowDown":t.lightness-=n;break;case"ArrowLeft":t.saturation-=n;break;case"ArrowRight":t.saturation+=n}r.currentColor=t};this.handleHueKeyDown=function(e){var t=new g;t.hue=r.currentColor.hue;t.saturation=r.currentColor.saturation;t.lightness=r.currentColor.lightness;var n=1;if(e.shiftKey){n=10}switch(e.key){case"ArrowLeft":t.hue-=n;break;case"ArrowRight":t.hue+=n}r.currentColor=t}}e.prototype.colorChangedHandler=function(e){this.colorChanged.emit(e)};e.prototype.handeCurrentColorChanged=function(e){this.colorChangedHandler(e)};e.prototype.componentWillLoad=function(){this.handleHexChange(this.color)};e.prototype.componentDidLoad=function(){this.el.style.setProperty("--color-box-height",this.colorBoxHeight.toString())};e.prototype.getHex=function(){return this.getDoublet(this.currentColor.red)+this.getDoublet(this.currentColor.green)+this.getDoublet(this.currentColor.blue)};e.prototype.getContrast=function(){return this.currentColor.contrastColor};e.prototype.getDoublet=function(e){var t=e.toString(16).toUpperCase();if(t.length===1){return"0"+t}return t};e.prototype.handleHexChange=function(e){var t=new g;if(e.match(/^(?:[\da-f]{3}|[\da-f]{6})$/i).length>0){if(e.length===3){var n=e[0]+e[0]+e[1]+e[1]+e[2]+e[2];e=n}t.red=parseInt(e.substr(0,2),16);t.green=parseInt(e.substr(2,2),16);t.blue=parseInt(e.substr(4,2),16)}else{t.red=this.currentColor.red;t.green=this.currentColor.green;t.blue=this.currentColor.blue}this.currentColor=t};e.prototype.switchColorMode=function(e){switch(e.target.id){case"rgb-switch":this.rgbDisplay="none";this.hslDisplay="none";this.hexDisplay="flex";break;case"hex-switch":this.rgbDisplay="none";this.hslDisplay="flex";this.hexDisplay="none";break;case"hsl-switch":this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";break;default:this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none"}};e.prototype.render=function(){var e=this;var t=this.currentColor.hue;var n=this.currentColor.saturation;var o=this.currentColor.lightness;var i=this.currentColor.red;var s=this.currentColor.green;var a=this.currentColor.blue;return r("div",{class:"dnn-color-picker"},r("div",{class:"dnn-color-sliders"},r("div",{class:"dnn-color-s-b",ref:function(t){return e.saturationLightnessBox=t},style:{backgroundColor:"hsl(".concat(t,",100%,50%)")},onMouseDown:this.handleSaturationLightnessMouseDown.bind(this)},r("button",{class:"dnn-s-b-picker","aria-label":"Press up or down to adjust lightness, left or right to adjust saturation, hold shift to move by 10%",role:"slider","aria-valuemin":"0","aria-valuemax":"100","aria-valuetext":"Saturation: ".concat(Math.round(this.currentColor.saturation*100),"%, Lightness: ").concat(Math.round(this.currentColor.lightness*100),"%"),style:{left:Math.round(n*100)+"%",bottom:Math.round(o*100)+"%"},onKeyDown:function(t){return e.handleSaturationLightnessKeyDown(t)}})),r("div",{class:"dnn-color-bar"},r("div",{class:"dnn-color-result",style:{backgroundColor:"#"+this.getHex(),boxShadow:"0 0 2px 1px "+"#"+this.getContrast()}}),r("div",{class:"dnn-color-hue",ref:function(t){return e.hueRange=t},onMouseDown:this.handleHueMouseDown.bind(this)},r("button",{class:"dnn-hue-picker","aria-label":"Press left or right to adjust hue, hold shift to move by 10 degrees",role:"slider","aria-valuemin":"0","aria-valuemax":"359","aria-valuenow":Math.round(t),style:{left:(t/359*100).toString()+"%"},onKeyDown:function(t){return e.handleHueKeyDown(t)}})))),r("div",{class:"dnn-color-fields"},r("div",{class:"dnn-rgb-color-fields",style:{display:this.rgbDisplay}},r("div",{class:"dnn-rgb-color-field"},r("label",null,"R"),r("input",{type:"number",min:"0",max:"255",step:"1",class:"red",value:i,"aria-label":"red value",onChange:function(t){return e.handleComponentValueChange(t,"red")}})),r("div",{class:"dnn-rgb-color-field"},r("label",null,"G"),r("input",{type:"number",min:"0",max:"255",class:"green",value:s,"aria-label":"green value",onChange:function(t){return e.handleComponentValueChange(t,"green")}})),r("div",{class:"dnn-rgb-color-field"},r("label",null,"B"),r("input",{type:"number",min:"0",max:"255",class:"blue",value:a,"aria-label":"blue value",onChange:function(t){return e.handleComponentValueChange(t,"blue")}})),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"rgb-switch",onClick:this.switchColorMode.bind(this),"aria-label":"switch to hexadecimal value entry"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),r("div",{class:"dnn-hsl-color-fields",style:{display:this.hslDisplay}},r("div",{class:"dnn-hsl-color-field"},r("label",null,"H"),r("input",{type:"number",min:"0",max:"359",step:1,value:Math.round(t),"aria-label":"Hue",onChange:function(t){return e.handleHSLChange(t,"hue")}})),r("div",{class:"dnn-hsl-color-field"},r("label",null,"S"),r("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(n*100),"aria-label":"Saturation",onChange:function(t){return e.handleHSLChange(t,"saturation")}})),r("div",{class:"dnn-hsl-color-field"},r("label",null,"L"),r("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(o*100),"aria-label":"Lightness",onChange:function(t){return e.handleHSLChange(t,"lightness")}})),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"hsl-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to red, green, blue entry mode"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),r("div",{class:"dnn-hex-color-fields",style:{display:this.hexDisplay}},r("div",{class:"dnn-hex-color-field"},r("label",null,"HEX"),r("div",{class:"hex-input"},r("input",{type:"text","aria-label":"Hexadecimal value",value:this.getHex(),onChange:function(t){return e.handleHexChange(t.target.value)}}),r("button",{class:"copy","aria-label":"copy value"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))))),r("div",{class:"dnn-color-mode-switch"},r("button",{id:"hex-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to hue saturation lightness values"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"})))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currentColor:["handeCurrentColorChanged"]}},enumerable:false,configurable:true});return e}());v([s(100)],b.prototype,"colorChangedHandler",null);b.style=m;var x=":host{--border-color:var(--dnn-color-tertiary-contrast, lightgray);--border-radius:var(--dnn-controls-radius, 5px);--drop-background-color:var(--dnn-color-tertiary, lightblue);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem;text-align:center;border:2px dashed var(--border-color);border-radius:var(--border-radius);padding:1rem;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host(.dropping){background-color:var(--drop-background-color)}p{margin:0;padding:0}button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:0px;margin:0;padding:0;background-color:transparent}button:hover{cursor:pointer}button svg{margin-right:0.5rem}label.upload-file{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}label.upload-file input{display:none}.video-preview{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.video-preview button{margin:1rem}";var w=e("dnn_dropzone",function(){function e(e){var r=this;t(this,e);this.filesSelected=n(this,"filesSelected",7);this.resx={dragAndDropFile:"Drag and drop a file",capture:"Capture",or:"or",takePicture:"Take a picture",uploadFile:"Upload a file"};this.allowCameraMode=false;this.captureQuality=.8;this.canTakeSnapshots=false;this.takingPicture=false;this.handleDragOver=function(e){e.stopPropagation();e.preventDefault();e.dataTransfer.dropEffect="copy";r.dropzone.classList.add("dropping")};this.handleDrop=function(e){e.stopPropagation();e.preventDefault();var t=e.dataTransfer.files;if(r.hasInvalidExtensions(t)){return}var n=r.getFilesFromFileList(t);r.filesSelected.emit(n)}}e.prototype.componentDidLoad=function(){var e=this;if(this.allowCameraMode){this.checkIfBrowserCanTakeSnapshots().then((function(t){return e.canTakeSnapshots=t}))}if(this.allowedExtensions!=undefined&&this.allowedExtensions.length>0){var t=this.allowedExtensions.map((function(e){return".".concat(e)}));var n=t.join(",");this.fileInput.accept=n}};e.prototype.checkIfBrowserCanTakeSnapshots=function(){return new Promise((function(e){var t=navigator.mediaDevices;if(t==undefined||t.enumerateDevices==undefined){e(false)}t.enumerateDevices().then((function(t){var n=t.some((function(e){return e.kind=="videoinput"}));e(n)}))}))};e.prototype.getFilesFromFileList=function(e){var t=[];for(var n=0;n<e.length;n++){var r=e[n];t.push(r)}return t};e.prototype.handleUploadButton=function(e){var t=this.getFilesFromFileList(e.files);this.filesSelected.emit(t)};e.prototype.hasInvalidExtensions=function(e){var t=false;for(var n=0;n<e.length;n++){var r=e[n];var o=/(?:\.([^.]+))?$/;var i=o.exec(r.name)[1];if(i==undefined){t=true}if(this.allowedExtensions!=undefined&&!this.allowedExtensions.includes(i)){t=true}return t}};e.prototype.takeSnapshot=function(){var e=this;this.takingPicture=true;navigator.mediaDevices.getUserMedia({video:true,audio:false}).then((function(t){e.videoPreview.srcObject=t;e.videoPreview.play().then((function(){e.videoSettings=t.getVideoTracks()[0].getSettings()}))})).catch((function(e){return alert(e)}))};e.prototype.applySnapshot=function(){var e=this;var t=document.createElement("canvas");var n=t.getContext("2d");t.width=this.videoSettings.width;t.height=this.videoSettings.height;n.drawImage(this.videoPreview,0,0);t.toBlob((function(t){var n=new File([t],"image.jpeg",{type:"image/jpeg"});e.takingPicture=false;var r=[n];e.filesSelected.emit(r)}),"image/jpeg",this.captureQuality)};e.prototype.render=function(){var e=this;var t,n,i,s,a,l;return r(o,{ref:function(t){return e.dropzone=t},class:"dropzone",onDragOver:this.handleDragOver,onDrop:this.handleDrop,onDragLeave:function(){return e.dropzone.classList.remove("dropping")}},!this.takingPicture&&[r("p",null,(t=this.resx)===null||t===void 0?void 0:t.dragAndDropFile),r("p",null,"- ",(n=this.resx)===null||n===void 0?void 0:n.or," -"),r("label",{class:"upload-file"},r("input",{type:"file",ref:function(t){return e.fileInput=t},onChange:function(t){return e.handleUploadButton(t.target)}}),r("span",null,r("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("g",null,r("rect",{fill:"none",height:"24",width:"24"})),r("g",null,r("path",{d:"M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"}))))," ",(i=this.resx)===null||i===void 0?void 0:i.uploadFile),this.canTakeSnapshots&&[r("p",null,"- ",(s=this.resx)===null||s===void 0?void 0:s.or," -"),r("button",{onClick:function(){return e.takeSnapshot()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("circle",{cx:"12",cy:"12",r:"3.2"}),r("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})),(a=this.resx)===null||a===void 0?void 0:a.takePicture)]],this.takingPicture&&r("div",{class:"video-preview"},r("video",{ref:function(t){return e.videoPreview=t}}),r("button",{onClick:function(){return e.applySnapshot()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("circle",{cx:"12",cy:"12",r:"3.2"}),r("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}))," ",(l=this.resx)===null||l===void 0?void 0:l.capture)))};return e}());w.style=x;var y;(function(e){e[e["nw"]=0]="nw";e[e["ne"]=1]="ne";e[e["se"]=2]="se";e[e["sw"]=3]="sw"})(y||(y={}));function k(e,t){var n=0;var r=0;if(e instanceof MouseEvent){n=e.movementX;r=e.movementY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var o=e.touches[0];if(t!=undefined){n=o.pageX-this.previousTouch.pageX;r=o.pageY-this.previousTouch.pageY}t=o}}return{movementX:n,movementY:r}}var C=":host{display:block}canvas{display:none}.view{visibility:hidden;opacity:0;height:0;overflow:hidden;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.view.visible{visibility:visible;opacity:1;height:initial;overflow:visible}.view .cropper{position:relative;width:100%}.view .cropper img{width:100%;display:block;margin:0 auto}.view .cropper .backdrop{-webkit-backdrop-filter:saturate(0.5);backdrop-filter:saturate(0.5);-webkit-backdrop-filter:brightness(0.5);backdrop-filter:brightness(0.5);position:absolute;left:0;top:0;width:100%;height:100%}.view .cropper .crop{position:absolute;top:0;left:0;width:100%;height:100%;outline:2px dashed white;-webkit-box-shadow:black 0 0 0px 2px;box-shadow:black 0 0 0px 2px;-webkit-backdrop-filter:saturate(2);backdrop-filter:saturate(2);-webkit-backdrop-filter:brightness(2);backdrop-filter:brightness(2);cursor:move}.view .cropper .crop>div{width:20px;height:20px;background-color:white;border:2px solid rgba(0, 0, 0, 0.5);position:absolute}.view .cropper .crop>div.nw,.view .cropper .crop>div.ne{top:-17px}.view .cropper .crop>div.ne,.view .cropper .crop>div.se{right:-17px}.view .cropper .crop>div.se,.view .cropper .crop>div.sw{bottom:-17px}.view .cropper .crop>div.sw,.view .cropper .crop>div.nw{left:-17px}.view .cropper .crop>div.nw,.view .cropper .crop>div.se{cursor:nwse-resize}.view .cropper .crop>div.ne,.view .cropper .crop>div.sw{cursor:nesw-resize}dnn-modal{--max-width:512px}";var M=e("dnn_image_cropper",function(){function e(e){var r=this;t(this,e);this.imageCropChanged=n(this,"imageCropChanged",7);this.width=600;this.height=600;this.resx={capture:"Capture",dragAndDropFile:"Drag and drop an image",or:"or",takePicture:"Take a picture",uploadFile:"Upload an image",imageTooSmall:"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.",modalCloseText:"Close"};this.quality=.8;this.preventUndersized=false;this.handleCropMouseDown=function(e){e.stopPropagation();e.preventDefault();var t=e.target;var n=t.classList[0];document.addEventListener("mouseup",r.handleImageCropFinished,false);document.addEventListener("touchend",r.handleImageCropFinished,false);switch(n){case"crop":document.addEventListener("mousemove",r.handleCropDrag,false);document.addEventListener("touchmove",r.handleCropDrag,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleCropDrag)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleCropDrag)}));break;case"nw":document.addEventListener("mousemove",r.handleNwMouseMove,false);document.addEventListener("touchmove",r.handleNwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleNwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleNwMouseMove)}));break;case"ne":document.addEventListener("mousemove",r.handleNeMouseMove,false);document.addEventListener("touchmove",r.handleNeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleNeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleNeMouseMove)}));break;case"se":document.addEventListener("mousemove",r.handleSeMouseMove,false);document.addEventListener("touchmove",r.handleSeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleSeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleSeMouseMove)}));break;case"sw":document.addEventListener("mousemove",r.handleSwMouseMove,false);document.addEventListener("touchmove",r.handleSwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",r.handleSwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",r.handleSwMouseMove)}));break}};this.handleImageCropFinished=function(e){r.emitImage();document.removeEventListener("mouseup",r.handleImageCropFinished);r.previousTouch=undefined};this.handleNwMouseMove=function(e){r.handleCornerDrag(e,y.nw)};this.handleNeMouseMove=function(e){r.handleCornerDrag(e,y.ne)};this.handleSeMouseMove=function(e){r.handleCornerDrag(e,y.se)};this.handleSwMouseMove=function(e){r.handleCornerDrag(e,y.sw)};this.handleCornerDrag=function(e,t){if(!r.isMouseStillInTarget(e)){return}var n=r.getCornerLeftTop(t),o=n.left,i=n.top;var s=0;var a=0;var l="horizontal";var d=r.width/r.height;var c=r.crop.getBoundingClientRect();var h=r.image.getBoundingClientRect();var u=k(e,r.previousTouch),p=u.movementX,f=u.movementY;if(Math.abs(p)<Math.abs(f)){l="vertical"}if(l=="horizontal"){switch(t){case y.nw:case y.sw:s=c.width-p;a=s/d;break;case y.ne:case y.se:s=c.width+p;a=s/d;break}}else{switch(t){case y.nw:case y.ne:a=c.height-f;s=a*d;break;case y.se:case y.sw:a=c.height+f;s=a*d;break}}switch(t){case y.ne:case y.nw:var g=c.height-a;i=r.crop.offsetTop+g}switch(t){case y.nw:case y.sw:var m=c.width-s;o=r.crop.offsetLeft+m;if(o<0)o=0;if(o>h.width)o=h.width;if(i<0)i=0;if(i>h.height)i=h.height;if(o+s>h.width)s=h.width-o;if(i+a>h.height)a=h.height-i;break;case y.ne:case y.se:if(i<0)i=0;if(i>h.height)i=h.height;if(o+s>h.width)s=h.width-o;if(i+a>h.height)a=h.height-i;break}if(s/a!=d){return}if(r.preventUndersized){var v=r.image.width/r.image.naturalWidth;if(s/v<r.width||a/v<r.height){return}}switch(t){case y.ne:r.crop.style.top="".concat(i,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.nw:r.crop.style.left="".concat(o,"px");r.crop.style.top="".concat(i,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.se:r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break;case y.sw:r.crop.style.left="".concat(o,"px");r.crop.style.width="".concat(s,"px");r.crop.style.height="".concat(a,"px");break}};this.handleCropDrag=function(e){if(!r.isMouseStillInTarget(e)){return}var t=k(e,r.previousTouch),n=t.movementX,o=t.movementY;var i=r.crop.offsetLeft+n;var s=r.crop.offsetTop+o;var a=r.image.getBoundingClientRect();var l=r.crop.getBoundingClientRect();if(i<0){i=0}if(s<0){s=0}if(i+l.width>a.width){i=r.crop.offsetLeft}if(s+l.height>a.height){s=r.crop.offsetTop}r.crop.style.left=i+"px";r.crop.style.top=s+"px"}}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.setView("noPictureView")}))};e.prototype.setView=function(e){var t=this.host.shadowRoot.querySelectorAll(".view");t.forEach((function(e){return e.classList.remove("visible")}));switch(e){case"noPictureView":this.noPictureView.classList.add("visible");break;case"hasPictureView":this.hasPictureView.classList.add("visible");break}this.view=e};e.prototype.initCrop=function(){var e=this.width/this.height;var t=this.image.getBoundingClientRect();var n=t.width/t.height;if(e>n){var r=t.width/e;var o=t.height-r;this.crop.style.top=Math.round(o/2).toString()+"px";this.crop.style.height=Math.round(r).toString()+"px"}else{var i=t.height*e;var o=t.width-i;this.crop.style.left=Math.round(o/2).toString()+"px";this.crop.style.width=Math.round(i).toString()+"px"}};e.prototype.setImage=function(){var e=this;this.image.addEventListener("load",(function(){e.initCrop();e.emitImage()}));this.image.src=this.canvas.toDataURL()};e.prototype.handleNewFile=function(e){var t=this;if(e.type.split("/")[0]!="image"){return}var n=new FileReader;n.onload=function(e){var n=new Image;n.onload=function(){t.canvas.width=n.width;t.canvas.height=n.height;if(t.preventUndersized&&(n.width<t.width||n.height<t.height)){t.imageTooSmallModal.show();return}var e=t.canvas.getContext("2d");e.drawImage(n,0,0);t.setView("hasPictureView");t.setImage()};n.src=e.target.result.toString()};n.readAsDataURL(e)};e.prototype.emitImage=function(){var e=this.crop.offsetLeft/this.image.width*this.image.naturalWidth;var t=this.crop.offsetTop/this.image.height*this.image.naturalHeight;var n=this.crop.getBoundingClientRect();var r=n.width/this.image.width*this.image.naturalWidth;var o=n.height/this.image.height*this.image.naturalHeight;if(e<0)e=0;if(e>this.image.naturalWidth)e=this.image.naturalWidth;if(t<0)t=0;if(t>this.image.naturalWidth)t=this.image.naturalWidth;if(r>this.image.naturalWidth)r=this.image.naturalWidth;if(o>this.image.naturalHeight)o=this.image.naturalHeight;var i=this.generateCroppedImage(e,t,r,o,this.width,this.height);this.imageCropChanged.emit(i)};e.prototype.generateCroppedImage=function(e,t,n,r,o,i){this.canvas.width=o;this.canvas.height=i;var s=this.canvas.getContext("2d");s.clearRect(0,0,o,i);s.drawImage(this.image,e,t,n,r,0,0,o,i);return this.canvas.toDataURL("image/jpeg",this.quality)};e.prototype.getCornerLeftTop=function(e){var t=0;var n=0;switch(e){case y.se:t=this.crop.offsetLeft;n=this.crop.offsetTop;break;case y.sw:n=this.crop.offsetTop;break}return{top:n,left:t}};e.prototype.isMouseStillInTarget=function(e){var t=false;var n;var r;var o=this.image.getBoundingClientRect();if(e instanceof MouseEvent){n=e.clientX;r=e.clientY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var i=e.touches[0];n=i.clientX;r=i.clientY}}if(n>=o.x&&r>=o.y&&n<=o.left+o.width&&r<=o.top+o.height){t=true}var s=this.crop.querySelectorAll("div");s.forEach((function(e){var o=e.getBoundingClientRect();if(n>=o.x&&r>=o.y&&n<=o.left+o.width&&r<=o.top+o.height){t=true}}));return t};e.prototype.render=function(){var e=this;return r(o,{ref:function(t){return e.host=t}},r("canvas",{ref:function(t){return e.canvas=t}}),r("div",{class:"view",ref:function(t){return e.hasPictureView=t}},r("div",{class:"cropper"},r("img",{ref:function(t){return e.image=t}}),r("div",{class:"backdrop"}),r("div",{class:"crop",ref:function(t){return e.crop=t},onMouseDown:this.handleCropMouseDown,onTouchStart:this.handleCropMouseDown},r("div",{class:"nw"}),r("div",{class:"ne"}),r("div",{class:"se"}),r("div",{class:"sw"})))),r("div",{class:"view",ref:function(t){return e.noPictureView=t}},r("dnn-dropzone",{allowCameraMode:true,onFilesSelected:function(t){return e.handleNewFile(t.detail[0])},resx:{capture:this.resx.capture,dragAndDropFile:this.resx.dragAndDropFile,or:this.resx.or,takePicture:this.resx.takePicture,uploadFile:this.resx.uploadFile}})),r("dnn-modal",{ref:function(t){return e.imageTooSmallModal=t},"close-text":this.resx.modalCloseText},r("p",null,this.resx.imageTooSmall.replace("{width}",this.width.toString()).replace("{height}",this.height.toString()))))};return e}());M.style=C;var D=":host{display:block}:host .overlay{background-color:rgba(0, 0, 0, 0.5);position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;visibility:hidden;opacity:0}:host .overlay .modal{max-width:var(--max-width, 1200px);background-color:white;padding:30px;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;z-index:2;position:relative;margin:10%;max-height:80%;border-radius:var(--dnn-controls-radius, 5px);-webkit-box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);display:block}:host .overlay .modal .close{position:absolute;background-color:white;border:2px solid white;border-radius:50%;padding:0;margin:0;top:-12px;right:-12px;outline:none;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .overlay .modal .close:focus,:host .overlay .modal .close:hover{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary, blue);box-shadow:0 0 2px 2px var(--dnn-color-primary, blue)}:host .overlay .modal .close svg{width:24px;height:24px;color:grey}:host .overlay.visible{visibility:visible;opacity:1}:host .overlay.visible .modal{-webkit-transform:scale(1);transform:scale(1);-webkit-box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);display:block}";var L=e("dnn_modal",function(){function e(e){t(this,e);this.dismissed=n(this,"dismissed",7);this.backdropDismiss=true;this.closeText="Close modal";this.showCloseButton=true;this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.handleDismiss=function(){this.visible=false;this.dismissed.emit()};e.prototype.handleBackdropClick=function(e){var t=e.target;if(t.id==="backdrop"&&this.backdropDismiss){this.handleDismiss()}};e.prototype.render=function(){var e=this;return r(o,null,r("div",{id:"backdrop",class:this.visible?"overlay visible":"overlay",onClick:function(t){return e.handleBackdropClick(t)}},r("div",{class:"modal"},this.showCloseButton&&r("button",{class:"close","aria-label":this.closeText,onClick:function(){return e.handleDismiss()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))),r("slot",null))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());L.style=D;var _=":host{display:block}.add-role-row{display:-ms-flexbox;display:flex;gap:1em;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.add-role-row label{margin-right:0.5em}.search-user{display:-ms-flexbox;display:flex;gap:1em;margin-top:1em}.search-user .search-control{position:relative}.search-user .search-control dnn-collapsible{position:absolute;left:0;top:calc(100% - 2px);width:100%;-webkit-box-shadow:0px 4px 4px;box-shadow:0px 4px 4px}.search-user .search-control dnn-collapsible .dropdown{background-color:white;border:1px solid lightgray;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.search-user .search-control dnn-collapsible .dropdown button{background-color:transparent;border:none;border-bottom:1px solid lightgray;padding:0.25em;margin:0;text-align:left}table{border:1px solid lightgray;border-collapse:collapse;margin-top:1em}table thead{text-align:center}table thead tr{border-bottom:1px solid lightgray}table thead th{background-color:lightgray;padding:0.25em 0.5em}table thead th:first-child{border-right:1px solid lightgray}table tbody tr{border-bottom:1px dotted lightgray}table tbody tr th{text-align:left;border-right:1px solid lightgray;padding:0 0.5em}table tbody tr td{text-align:center}table tbody tr td dnn-checkbox span{display:none}table tbody tr td button{background-color:transparent;border:0;padding:0;margin:0;margin-right:1em}";var S=e("dnn_permissions_grid",function(){function e(e){t(this,e);this.userSearchQueryChanged=n(this,"userSearchQueryChanged",7);this.permissionsChanged=n(this,"permissionsChanged",7);this.resx={Add:"Add",AllRoles:"All Roles",FilterByGroup:"Filter By Group",GlobalRoles:"Global Roles",Role:"Role",RolePermissions:"Role Permissions",SelectRole:"Select Role",User:"User",UserPermissions:"User Permissions"};this.foundUsers=[];this.selectedRoleGroupId=-1}e.prototype.handleFoundUsersChanged=function(e){var t=this;if((e===null||e===void 0?void 0:e.length)>0){setTimeout((function(){t.userCollapsible.expanded=true}),100)}};e.prototype.componentWillLoad=function(){document.addEventListener("click",this.dismissUserResults.bind(this))};e.prototype.disconnectedCallback=function(){document.removeEventListener("click",this.disconnectedCallback.bind(this))};e.prototype.dismissUserResults=function(e){var t=this.roleDropDown.getBoundingClientRect();if(e.pageX>t.right||e.pageX<t.left||e.pageY>t.bottom||e.pageY<t.top){this.userCollapsible.expanded=false}};e.prototype.handleRoleGroupChanged=function(e){var t=e.selectedIndex;var n=Number.parseInt(e.options[t].value);this.selectedRoleGroupId=n};e.prototype.addRole=function(){var e=Number.parseInt(this.roleDropDown.options[this.roleDropDown.selectedIndex].value);var t=this.roles.filter((function(t){return t.RoleId==e}))[0];this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray(__spreadArray([],this.permissions.rolePermissions,true),[{default:false,locked:false,permissions:[],roleId:t.RoleId,roleName:t.RoleName}],false)});this.permissionsChanged.emit(this.permissions)};e.prototype.addUser=function(){if(this.pickedUser!=undefined){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray(__spreadArray([],this.permissions.userPermissions,true),[{displayName:this.pickedUser.displayName,permissions:[],userId:this.pickedUser.userId}],false)});this.pickedUser=undefined;this.userQuery="";this.permissionsChanged.emit(this.permissions)}};e.prototype.getRoles=function(){var e=this;var t=this.roles.filter((function(t){return!e.permissions.rolePermissions.some((function(e){return e.roleId==t.RoleId}))}));if(this.selectedRoleGroupId==-2){return t}if(this.selectedRoleGroupId==-1){return t.filter((function(e){return e.IsSystemRole}))}return t.filter((function(t){return t.RoleGroupId==e.selectedRoleGroupId}))};e.prototype.renderRoleCheckBox=function(e,t){var n=this;var o=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];if(e.locked){return r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("g",{fill:"none"},r("path",{d:"M0 0h24v24H0V0z"}),r("path",{d:"M0 0h24v24H0V0z",opacity:".87"})),r("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}))}var i=o==undefined?"intermediate":o.allowAccess?"checked":"unchecked";return r("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(r){return n.handleRoleChanged(r.detail,e,t)}},r("div",{slot:"intermediateicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),r("div",{slot:"uncheckedicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),r("span",null,t.permissionName))};e.prototype.renderUserCheckBox=function(e,t){var n=this;var o=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];var i=o==undefined?"intermediate":o.allowAccess?"checked":"unchecked";return r("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(r){return n.handleUserChanged(r.detail,e,t)}},r("div",{slot:"intermediateicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),r("div",{slot:"uncheckedicon"},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),r("span",null,t.permissionName))};e.prototype.handleRoleChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var r=Object.assign({},e);r.permissions=__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return r})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.handleUserChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray(__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return r})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var r=Object.assign({},e);r.permissions=__spreadArray([],r.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return r})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.removeRole=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.filter((function(t){return t.roleId!=e.roleId})),true)});this.permissionsChanged.emit()};e.prototype.removeUser=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.filter((function(t){return t.userId!=e.userId})),true)});this.permissionsChanged.emit(this.permissions)};e.prototype.handleQueryChanged=function(e){this.userQuery=e;if(e==undefined||e.length==0){this.userCollapsible.expanded=false;this.pickedUser=undefined;this.foundUsers=[];return}this.userSearchQueryChanged.emit(e)};e.prototype.handleSearchUserFieldKeyDown=function(e){if(e.key!="ArrowDown"){return}e.preventDefault();var t=this.userCollapsible.querySelector("button");if(t!=undefined){t.focus()}};e.prototype.handleSearchedUserKeyDown=function(e){var t=e.target;switch(e.key){case"ArrowDown":e.preventDefault();var n=t.nextElementSibling;n===null||n===void 0?void 0:n.focus();break;case"ArrowUp":e.preventDefault();var r=t.previousElementSibling;r===null||r===void 0?void 0:r.focus();break}};e.prototype.handleUserPicked=function(e){this.userQuery=e.displayName;this.pickedUser=e};e.prototype.getFilteredUsers=function(){var e=this;return this.foundUsers.filter((function(t){return!e.permissions.userPermissions.some((function(e){return e.userId==t.userId}))}))};e.prototype.render=function(){var e=this;var t=this.getRoles();return r(o,null,r("div",{class:"add-role-row"},r("div",{class:"dropdown"},r("label",null,this.resx.FilterByGroup," :"),r("select",{onChange:function(t){return e.handleRoleGroupChanged(t.target)}},r("option",{value:-2,selected:this.selectedRoleGroupId==-2},this.resx.AllRoles),r("option",{value:-1,selected:this.selectedRoleGroupId==-1},this.resx.GlobalRoles),this.roleGroups.map((function(t){return r("option",{value:t.id,selected:e.selectedRoleGroupId==t.id},t.name)})))),t&&t.length>0&&[r("div",{class:"dropdown"},r("label",null,this.resx.SelectRole," :"),r("select",{ref:function(t){return e.roleDropDown=t}},this.getRoles().map((function(e){return r("option",{value:e.RoleId},e.RoleName)})))),r("dnn-button",{type:"primary",onClick:function(){return e.addRole()}},this.resx.Add)]),r("table",{class:"roles-table"},r("caption",null,this.resx.RolePermissions),r("thead",null,r("tr",null,r("th",null,this.resx.Role),this.permissions.permissionDefinitions.map((function(e){return r("th",null,e.permissionName)})),r("th",null," "))),r("tbody",null,this.permissions.rolePermissions.map((function(t){return r("tr",null,r("th",null,t.roleName),e.permissions.permissionDefinitions.map((function(n){return r("td",null,e.renderRoleCheckBox(t,n))})),r("td",null,!t.default&&r("button",{onClick:function(){return e.removeRole(t)}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))),r("div",{class:"search-user"},r("div",{class:"search-control"},r("dnn-searchbox",{placeholder:this.resx.User,debounced:true,onQueryChanged:function(t){return e.handleQueryChanged(t.detail)},onKeyDown:function(t){return e.handleSearchUserFieldKeyDown(t)},query:this.userQuery}),r("dnn-collapsible",{ref:function(t){return e.userCollapsible=t}},r("div",{class:"dropdown"},this.getFilteredUsers().map((function(t){return r("button",{onKeyDown:function(t){return e.handleSearchedUserKeyDown(t)},onClick:function(){return e.handleUserPicked(t)}},t.displayName)}))))),this.pickedUser&&r("dnn-button",{onClick:function(){return e.addUser()}},this.resx.Add)),this.permissions.userPermissions&&this.permissions.userPermissions.length>0&&r("table",{class:"users-table"},r("caption",null,this.resx.UserPermissions),r("thead",null,r("tr",null,r("th",null,this.resx.User),this.permissions.permissionDefinitions.map((function(e){return r("th",null,e.permissionName)})),r("th",null," "))),r("tbody",null,this.permissions.userPermissions.map((function(t){return r("tr",null,r("th",null,t.displayName),e.permissions.permissionDefinitions.map((function(n){return r("td",null,e.renderUserCheckBox(t,n))})),r("td",null,r("button",{onClick:function(){return e.removeUser(t)}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))))};Object.defineProperty(e,"watchers",{get:function(){return{foundUsers:["handleFoundUsersChanged"]}},enumerable:false,configurable:true});return e}());S.style=_;var z=":host{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;--background-color:transparent;--color:#333;--border-size:1px;--border-color:grey;--border-active-color:black;--border-radius:var(--dnn-controls-radius, 5px);--padding:var(--dnn-controls-padding, 5px);--focus-color:var(--dnn-color-primary, blue)}:host input{width:100%;border:var(--border-size) solid var(--border-color);outline:none;border-radius:var(--border-radius);padding:var(--padding);padding-right:32px;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host input:focus,:host input:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--focus-color);box-shadow:0 0 2px 2px var(--focus-color)}:host svg{position:absolute;top:0;right:0;height:100%;-webkit-transform:scale(0.7);transform:scale(0.7);fill:var(--color);outline:var(--color);color:var(--color);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host button{background:transparent;border:0;margin:0;padding:0}:host button:focus svg,:host button:hover svg{fill:var(--focus-color);outline:var(--focus-color);color:var(--focus-color)}";var I=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};var H=e("dnn_searchbox",function(){function e(e){t(this,e);this.queryChanged=n(this,"queryChanged",7);this.placeholder="";this.debounced=true;this.query=""}e.prototype.fireQueryChanged=function(){if(this.debounced){this.debouncedHandleQueryChanged()}else{this.handleQueryChanged()}};e.prototype.handleQueryChanged=function(){this.queryChanged.emit(this.query)};e.prototype.debouncedHandleQueryChanged=function(){this.handleQueryChanged()};e.prototype.render=function(){var e=this;return r(o,null,r("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.query=t.target.value}}),this.query!==""?r("button",{class:"svg clear",onClick:function(){return e.query=""}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))):r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))};Object.defineProperty(e,"watchers",{get:function(){return{query:["fireQueryChanged"]}},enumerable:false,configurable:true});return e}());I([s(500)],H.prototype,"debouncedHandleQueryChanged",null);H.style=z;var E=":host{--color:#888;--color-sorted:var(--dnn-color-primary, rgb(2,139,255));--color-hover:var(--dnn-color-primary-light, #36a1ff);display:inline-block}button{outline:none;border:none;margin:0;padding:0;background-color:transparent;outline:none;display:inline-block;line-height:1em;position:relative;top:0.25em}button svg{height:1.5em;width:auto;fill:var(--color)}button.active svg{fill:var(--color-sorted)}button:hover svg,button:focus svg{fill:var(--color-hover)}";var P=e("dnn_sort_icon",function(){function e(e){t(this,e);this.sortChanged=n(this,"sortChanged",7);this.sortDirection="none"}e.prototype.changeSort=function(){switch(this.sortDirection){case"asc":this.sortDirection="desc";break;case"desc":this.sortDirection="asc";break;case"none":this.sortDirection="asc";break}this.sortChanged.emit(this.sortDirection)};e.prototype.render=function(){var e=this;return r(o,null,r("button",{class:{active:this.sortDirection!="none"},onClick:function(){return e.changeSort()}},this.sortDirection=="none"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z"})),this.sortDirection=="asc"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 7 H 12 L 6 0 Z"})),this.sortDirection=="desc"&&r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},r("path",{d:"M 0 9 H 12 L 6 16 Z"}))))};return e}());P.style=E;var R="";var T=e("dnn_tab",function(){function e(e){t(this,e);this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.render=function(){return r(o,null,this.visible&&r("slot",null))};return e}());T.style=R;var j=":host{display:block;--color-background:var(--dnn-color-secondary-dark, lightgray);--color-text:var(--dnn-color-secondary-contrast, #333);--color-visible:var(--dnn-color-primary, #3792ED);--color-visible-text:var(--dnn-color-primary-contrast, #FFF);--color-focus:var(--dnn-color-primary, #3792ed)}.tabTitles{display:-ms-flexbox;display:flex;background-color:var(--color-background);color:var(--color-text)}.tabTitles button{padding:0.5rem 1rem;border:0;margin:0;background-color:transparent}.tabTitles button.visible{background-color:var(--color-visible);color:var(--color-bisible-text)}.tabTitles button:focus,.tabTitles button:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--color-focus);box-shadow:0 0 2px 2px var(--color-focus)}.currentTab{border:1px solid var(--color-background)}";var F=e("dnn_tabs",function(){function e(e){t(this,e);this.tabTitles=[];this.selectedTabTitle=""}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.updateTitles();e.showFirstTab()}))};e.prototype.getTabs=function(){return this.component.shadowRoot.querySelector("slot").assignedElements()};e.prototype.updateTitles=function(){var e=this;var t=this.getTabs();t.forEach((function(t){return e.tabTitles=__spreadArray(__spreadArray([],e.tabTitles,true),[t.tabTitle],false)}))};e.prototype.showFirstTab=function(){var e=this.getTabs()[0];e.show();this.selectedTabTitle=e.tabTitle};e.prototype.showTab=function(e){var t=this.getTabs();t.forEach((function(t){if(t.tabTitle==e){t.show();return}t.hide()}));this.selectedTabTitle=e};e.prototype.render=function(){var e=this;return r(o,{ref:function(t){return e.component=t}},r("div",{class:"tabTitles"},this.tabTitles.map((function(t){return r("button",{class:e.selectedTabTitle==t?"visible":"",onClick:function(){return e.showTab(t)}},t)}))),r("div",{class:"currentTab"},r("slot",null)))};return e}());F.style=j;var A=":host{display:inline-block;outline:none;cursor:pointer}button{height:1.5em;width:2.5em;outline:none;background-color:var(--background, #888);border:0;border-radius:var(--border-radius, var(--dnn-controls-radius, 0.75em));padding:0.1em;position:relative;margin:0;-webkit-transition:background-color 300ms ease-in-out;transition:background-color 300ms ease-in-out;position:relative;cursor:pointer}button:hover,button:focus{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary);box-shadow:0 0 2px 2px var(--dnn-color-primary)}button.checked{background-color:var(--background-checked, var(--dnn-color-primary, blue))}button.checked .handle{left:calc(1em + 4px)}button:disabled{opacity:0.5;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none}button .handle{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;background-color:white;width:1em;height:1em;border-radius:var(--handle-border-radius, var(--dnn-controls-radius, 50%));position:absolute;top:calc(50% - 0.5em);left:2px}";var B=e("dnn_toggle",function(){function e(e){t(this,e);this.checkChanged=n(this,"checkChanged",7);this.checked=false;this.disabled=false}e.prototype.checkedChanged=function(e){this.checkChanged.emit({checked:e})};e.prototype.render=function(){var e=this;return r(o,null,r("button",{disabled:this.disabled,class:{checked:this.checked},onClick:function(){if(!e.disabled){e.checked=!e.checked}}},r("div",{class:"handle"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["checkedChanged"]}},enumerable:false,configurable:true});return e}());B.style=A;var O=":host{display:-ms-flexbox;display:flex;overflow:visible}.expander{width:24px;height:24px}.expander button{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;background-color:transparent;border:none;padding:0;margin:0;height:1em;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;position:relative;top:2px}.expander button svg :first-child{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;fill:white;stroke:black}.expander.expanded button{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.expander.expanded button svg :first-child{fill:black;stroke:black}div.item .item-slot{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25em;min-height:24px}div.item div.children{overflow:hidden;height:0;-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}";var U=e("dnn_treeview_item",function(){function e(e){t(this,e);this.userExpanded=n(this,"userExpanded",3);this.userCollapsed=n(this,"userCollapsed",3);this.expanded=false;this.hasChildren=false}e.prototype.watchExpanded=function(e){if(e){this.expander.classList.add("expanded");this.collapsible.expanded=true;return}this.expander.classList.remove("expanded");this.collapsible.expanded=false};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){var t=e.childElement.children[0];var n=t.assignedElements().length;if(n>0){e.hasChildren=true}if(e.expanded){e.expander.classList.add("expanded");e.collapsible.expanded=false;setTimeout((function(){e.collapsible.expanded=true}),300)}}))};e.prototype.toggleCollapse=function(){this.expanded=!this.expanded;if(this.expanded){this.expander.classList.add("expanded");this.userExpanded.emit();return}this.expander.classList.remove("expanded");this.userCollapsed.emit()};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"expander",ref:function(t){return e.expander=t}},this.hasChildren&&r("button",{onClick:function(){return e.toggleCollapse()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M10 17l5-5-5-5v10z"}),r("path",{d:"M0 24V0h24v24H0z",fill:"none"})))),r("div",{class:"item"},r("div",{class:"item-slot"},r("slot",null)),r("dnn-collapsible",{ref:function(t){return e.collapsible=t},expanded:this.expanded},r("div",{ref:function(t){return e.childElement=t}},r("slot",{name:"children"})))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}());U.style=O;var V=":host{--background-color:var(--dnn-color-primary-contrast, white);--foreground-color:var(--dnn-color-primary, #3792ED);display:block}.menu-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;background-color:var(--background-color)}.menu-container .menu{margin:0.5em;display:-ms-flexbox;display:flex;gap:1em;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;white-space:nowrap;width:100%}.menu-container .overflow{margin-left:auto;position:relative}.menu-container .overflow button{cursor:pointer;padding:0;margin:0;background-color:transparent;border:none}.menu-container .overflow button svg{fill:var(--foreground-color)}.menu-container .overflow .dropdown{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;white-space:nowrap;right:0;-webkit-transition:100ms ease-in-out;transition:100ms ease-in-out;height:0;overflow:hidden}.menu-container .overflow .dropdown.visible{padding:1em;gap:0.5em;background-color:var(--background-color);-webkit-box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7);box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7)}";var W=e("dnn_vertical_overflow_menu",function(){function e(e){t(this,e);this.showDropdownButton=false;this.showDropdownMenu=false;this.previousMenuWidth=0}e.prototype.componentDidRender=function(){var e=this;requestAnimationFrame((function(){e.moveItemsToDropDownIfNecessery();e.resizeObserver=new ResizeObserver((function(t){for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.contentRect.width<e.previousMenuWidth){e.moveItemsToDropDownIfNecessery()}if(e.previousMenuWidth>0&&o.contentRect.width>e.previousMenuWidth){e.moveItemsToMenuIfPossible()}e.previousMenuWidth=o.contentRect.width}}));e.resizeObserver.observe(e.element)}))};e.prototype.moveItemsToDropDownIfNecessery=function(){var e=this;var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var r=parseFloat(getComputedStyle(this.element).fontSize)*2;t.forEach((function(t){return r+=e.getFullWidth(t)}));r+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);if(r>n){this.showDropdownButton=true;var o=t[t.length-1];if(this.dropdown==undefined){return}o.slot="dropdown";this.moveItemsToDropDownIfNecessery()}};e.prototype.moveItemsToMenuIfPossible=function(){var e=this;if(this.dropdown==undefined||!this.dropdown.hasChildNodes()){return}var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var r=parseFloat(getComputedStyle(this.element).fontSize)*2;r+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);t.forEach((function(t){return r+=e.getFullWidth(t)}));var o=this.dropdown.querySelector("slot").assignedElements()[0];if(o!=undefined){r+=this.getFullWidth(o)}if(r<n){if(o!=undefined){o.slot=""}if(o==undefined){this.dropdown.classList.remove("visible");this.showDropdownMenu=false;this.showDropdownButton=false}}};e.prototype.getFullWidth=function(e){var t=e.getBoundingClientRect().width;var n=getComputedStyle(e);t+=parseFloat(n.marginLeft);t+=parseFloat(n.marginRight);t+=parseFloat(n.paddingLeft);t+=parseFloat(n.paddingRight);return t};e.prototype.toggleOverflowMenu=function(){var e=this;this.showDropdownMenu=!this.showDropdownMenu;if(this.showDropdownMenu){this.dropdown.classList.add("visible");var t=0;var n=Array.from(this.dropdown.querySelector("slot").assignedElements());n.forEach((function(e){return t+=e.getBoundingClientRect().height}));var r=parseFloat(getComputedStyle(this.dropdown).fontSize);var o=r*(this.dropdown.children.length-1)/2;t+=o;var i=r*2;t+=i;this.dropdown.style.height="".concat(t,"px");var s=function(t){var n=e.button.getBoundingClientRect();if(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom){e.toggleOverflowMenu()}document.removeEventListener("click",s)};setTimeout((function(){document.addEventListener("click",s,false)}),100)}else{this.dropdown.classList.remove("visible");this.dropdown.style.height="0px"}};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"menu-container"},r("div",{class:"menu",ref:function(t){return e.menu=t}},r("slot",null)),this.showDropdownButton&&r("div",{class:"overflow"},r("button",{ref:function(t){return e.button=t},class:"icon",onClick:function(){return e.toggleOverflowMenu()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},r("path",{d:"M0 0h24v24H0z",fill:"none"}),r("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),r("div",{class:"dropdown",ref:function(t){return e.dropdown=t}},r("slot",{name:"dropdown"})))))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());W.style=V;var N=":host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;margin:0 auto;position:relative;--left-pane-background-color:transparent;--right-pane-background-color:transparent}button{border:none;margin:0;padding:0;cursor:ew-resize;position:absolute;height:100%;background-color:transparent}button.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane{overflow-y:auto}.pane.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane.left{background-color:var(--left-pane-background-color)}.pane.right{background-color:var(--right-pane-background-color);-ms-flex-positive:1;flex-grow:1}";var q=e("dnn_vertical_splitview",function(){function e(e){t(this,e);this.widthChanged=n(this,"widthChanged",7);this.splitterWidth=16;this.splitWidthPercentage=30;this.leftWidth=0;this.rightWidth=0}e.prototype.setSplitWidthPercentage=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var n=this;return __generator(this,(function(r){t=this.element.shadowRoot.querySelectorAll(".pane");requestAnimationFrame((function(){t.forEach((function(e){return e.classList.add("transition")}));n.splitter.classList.add("transition");requestAnimationFrame((function(){var r=n.element.getBoundingClientRect().width;var o=r*e/100;if(o<0){o=0}if(o>r){o=r}n.leftWidth=o;n.rightWidth=r-o;setTimeout((function(){t.forEach((function(e){return e.classList.remove("transition")}));n.splitter.classList.remove("transition")}),300)}))}));return[2]}))}))};e.prototype.getSplitWidthPercentage=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.getBoundingClientRect().width;return[2,this.leftWidth/e]}))}))};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.resizeObserver=new ResizeObserver((function(){var t=e.element.getBoundingClientRect().width;e.leftWidth=t*e.splitWidthPercentage/100;e.rightWidth=t-e.leftWidth;e.widthChanged.emit(e.splitWidthPercentage)}));e.resizeObserver.observe(e.element)}))};e.prototype.handleMouseDown=function(e){var t=this;e.preventDefault();var n=function(e){requestAnimationFrame((function(){var n=t.element.getBoundingClientRect().width;var r=k(e,t.previousTouch).movementX;var o=t.leftWidth+r;if(o<0){o=0}if(o>n){o=n}t.leftWidth=o;t.rightWidth=n-o;t.splitWidthPercentage=t.leftWidth/n*100}))};var r=function(){document.removeEventListener("mousemove",n);document.removeEventListener("touchmove",n);var e=t.element.getBoundingClientRect().width;var r=t.leftWidth/e*100;t.widthChanged.emit(r)};document.addEventListener("mouseup",r);document.addEventListener("touchend",r);document.addEventListener("mousemove",n);document.addEventListener("touchmove",n)};e.prototype.handleKeyDown=function(e){var t=0;switch(e.key){case"ArrowLeft":t=-10;break;case"ArrowRight":t=10;break;default:return}if(e.shiftKey){t=t*10}var n=this.element.getBoundingClientRect().width;var r=this.leftWidth+t;if(r<0){r=0}if(r>n){r=n}this.leftWidth=r;this.rightWidth=n-this.leftWidth};e.prototype.render=function(){var e=this;return r(o,null,r("div",{class:"left pane",style:{width:"".concat(this.leftWidth,"px")}},r("slot",{name:"left"})),r("button",{onMouseDown:function(t){return e.handleMouseDown(t)},onTouchStart:function(t){return e.handleMouseDown(t)},onKeyDown:function(t){return e.handleKeyDown(t)},ref:function(t){return e.splitter=t},style:{minWidth:"".concat(this.splitterWidth.toString(),"px"),left:"".concat(this.leftWidth-2,"px")}},r("slot",null)),r("div",{class:"right pane",style:{width:"".concat(this.rightWidth,"px")}},r("slot",{name:"right"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());q.style=N}}}));
11
+ //# sourceMappingURL=p-1893c229.system.entry.js.map