From bce4c4060e33f81f58a80e7ae771cefe453df5cf Mon Sep 17 00:00:00 2001 From: Nick Ng Date: Tue, 19 Dec 2023 10:55:07 +0800 Subject: [PATCH] chore: updated dist files --- dist/index.js | 49 ++++++++++++++++++++++++++++++++++++++----------- dist/index.mjs | 49 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 76 insertions(+), 22 deletions(-) diff --git a/dist/index.js b/dist/index.js index df682da..2fd02d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -89,7 +89,9 @@ target.insertBefore(node, anchor || null); } function detach(node) { - node.parentNode.removeChild(node); + if (node.parentNode) { + node.parentNode.removeChild(node); + } } function element(name) { return document.createElement(name); @@ -104,7 +106,7 @@ return Array.from(element.childNodes); } function set_style(node, key, value, important) { - if (value === null) { + if (value == null) { node.style.removeProperty(key); } else { @@ -119,9 +121,9 @@ const dirty_components = []; const binding_callbacks = []; - const render_callbacks = []; + let render_callbacks = []; const flush_callbacks = []; - const resolved_promise = Promise.resolve(); + const resolved_promise = /* @__PURE__ */ Promise.resolve(); let update_scheduled = false; function schedule_update() { if (!update_scheduled) { @@ -153,15 +155,29 @@ const seen_callbacks = new Set(); let flushidx = 0; // Do *not* move this inside the flush() function function flush() { + // Do not reenter flush while dirty components are updated, as this can + // result in an infinite loop. Instead, let the inner flush handle it. + // Reentrancy is ok afterwards for bindings etc. + if (flushidx !== 0) { + return; + } const saved_component = current_component; do { // first, call beforeUpdate functions // and update components - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); + try { + while (flushidx < dirty_components.length) { + const component = dirty_components[flushidx]; + flushidx++; + set_current_component(component); + update(component.$$); + } + } + catch (e) { + // reset dirty state to not end up in a deadlocked state and then rethrow + dirty_components.length = 0; + flushidx = 0; + throw e; } set_current_component(null); dirty_components.length = 0; @@ -198,6 +214,16 @@ $$.after_update.forEach(add_render_callback); } } + /** + * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`. + */ + function flush_render_callbacks(fns) { + const filtered = []; + const targets = []; + render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); + targets.forEach((c) => c()); + render_callbacks = filtered; + } const outroing = new Set(); let outros; function transition_in(block, local) { @@ -251,6 +277,7 @@ function destroy_component(component, detaching) { const $$ = component.$$; if ($$.fragment !== null) { + flush_render_callbacks($$.after_update); run_all($$.on_destroy); $$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to @@ -357,9 +384,9 @@ } } - let jsPanel={version:"4.16.0",date:"2022-07-03 19:05",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)));},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>document.documentMode||!1)(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&o.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n}),function(){if("function"==typeof window.CustomEvent)return !1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}e.prototype=window.Event.prototype,window.CustomEvent=e;}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return (void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var o=t>0?0|t:0;return this.substring(o,o+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return "";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var o=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+=t.substring(0,o-t.length)}),Number.isInteger=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let o=Object(this),n=o.length>>>0;if(0===n)return !1;let a=0|t,s=Math.max(a>=0?a:n-Math.abs(a),0);for(;sjsPanel.modifier=e),void document.addEventListener("keyup",()=>jsPanel.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"]);},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return !!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return [t,t,t,t];if(Array.isArray(t)){if(1===t.length)return [t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1]);}return t},pOsize(e,t){let o=t||this.defaults.contentSize;const n=e.parentElement;if("string"==typeof o){const e=o.trim().split(" ");(o={}).width=e[0],2===e.length?o.height=e[1]:o.height=e[0];}else o.width&&!o.height?o.height=o.width:o.height&&!o.width&&(o.width=o.height);if(String(o.width).match(/^[0-9.]+$/gi))o.width+="px";else if("string"==typeof o.width&&o.width.endsWith("%"))if(n===document.body)o.width=window.innerWidth*(parseFloat(o.width)/100)+"px";else {const e=window.getComputedStyle(n),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);o.width=(parseFloat(e.width)-t)*(parseFloat(o.width)/100)+"px";}else "function"==typeof o.width&&(o.width=o.width.call(e,e),"number"==typeof o.width?o.width+="px":"string"==typeof o.width&&o.width.match(/^[0-9.]+$/gi)&&(o.width+="px"));if(String(o.height).match(/^[0-9.]+$/gi))o.height+="px";else if("string"==typeof o.height&&o.height.endsWith("%"))if(n===document.body)o.height=window.innerHeight*(parseFloat(o.height)/100)+"px";else {const e=window.getComputedStyle(n),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);o.height=(parseFloat(e.height)-t)*(parseFloat(o.height)/100)+"px";}else "function"==typeof o.height&&(o.height=o.height.call(e,e),"number"==typeof o.height?o.height+="px":"string"==typeof o.height&&o.height.match(/^[0-9.]+$/gi)&&(o.height+="px"));return o},pOborder(e){let t=[],o=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return o.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(o[t]=jsPanel.getCssVariableValue(e));}),o.forEach(e=>{jsPanel.colorNames[e]?t[2]="#"+jsPanel.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e;}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},o=e.toLowerCase(),n=o.match(/xl|lg|md|sm|xs/),a=o.match(/closeonly|none/);return n&&(t.size=n[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,o="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let n=e.indexOf(")");(t=e.slice(0,n+1).replace(/\s+/g,"")).startsWith("var")&&(t=jsPanel.getCssVariableValue(t)),o=e.slice(n+1,e.length).trim();}else if(e.match(/^(#|\w|--)/)){let n=e.indexOf(" ");n>0?(t=e.slice(0,n+1).replace(/\s+/g,""),o=e.slice(n+1,e.length).trim()):t=e,t.startsWith("--")&&(t=jsPanel.getCssVariableValue(t));}if(t.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(t="#"+t),o.startsWith("fillcolor")){let e=o.indexOf(" ");o=(o=o.slice(e+1,o.length).trim().replace(/\s+/g,"")).match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)?"#"+o:jsPanel.colorNames[o]?"#"+jsPanel.colorNames[o]:o.match(/^(--|var)/)?jsPanel.getCssVariableValue(o):"#fff";}return {color:t,colors:!1,filling:o}},color(e){let t,o,n,a,s,r,l,i,c,d=e.toLowerCase(),p={};const h=/^rgba?\(([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3}),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,f=/^hsla?\(([0-9]{1,3}),([0-9]{1,3}%),([0-9]{1,3}%),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,u=this.colorNames;return u[d]&&(d=u[d]),null!==d.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/gi)?((d=d.replace("#","")).length%2==1?(t=d.slice(0,1).repeat(2),o=d.slice(1,2).repeat(2),n=d.slice(2,3).repeat(2),p.rgb={r:parseInt(t,16),g:parseInt(o,16),b:parseInt(n,16)},p.hex=`#${t}${o}${n}`):(p.rgb={r:parseInt(d.slice(0,2),16),g:parseInt(d.slice(2,4),16),b:parseInt(d.slice(4,6),16)},p.hex=`#${d}`),c=this.rgbToHsl(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl=c,p.rgb.css=`rgb(${p.rgb.r},${p.rgb.g},${p.rgb.b})`):d.match(h)?(l=h.exec(d),p.rgb={css:d,r:l[1],g:l[2],b:l[3]},p.hex=this.rgbToHex(l[1],l[2],l[3]),c=this.rgbToHsl(l[1],l[2],l[3]),p.hsl=c):d.match(f)?(a=(l=f.exec(d))[1]/360,s=l[2].slice(0,l[2].length-1)/100,r=l[3].slice(0,l[3].length-1)/100,i=this.hslToRgb(a,s,r),p.rgb={css:`rgb(${i[0]},${i[1]},${i[2]})`,r:i[0],g:i[1],b:i[2]},p.hex=this.rgbToHex(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl={css:`hsl(${l[1]},${l[2]},${l[3]})`,h:l[1],s:l[2],l:l[3]}):(p.hex="#f5f5f5",p.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},p.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),p},calcColors(e){const t=this.colorBrightnessThreshold,o=this.color(e),n=this.lighten(e,this.colorFilledLight),a=this.darken(e,this.colorFilled),s=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",r=this.perceivedBrightness(n)<=t?"#ffffff":"#000000",l=this.perceivedBrightness(a)<=t?"#ffffff":"#000000",i=this.lighten(e,this.colorFilledDark),c=this.perceivedBrightness(i)<=t?"#ffffff":"#000000";return [o.hsl.css,n,a,s,r,l,i,c]},darken(e,t){const o=this.color(e).hsl,n=parseFloat(o.l),a=Math.round(n-n*t)+"%";return `hsl(${o.h},${o.s},${a})`},lighten(e,t){const o=this.color(e).hsl,n=parseFloat(o.l),a=Math.round(n+(100-n)*t)+"%";return `hsl(${o.h},${o.s},${a})`},hslToRgb(e,t,o){let n,a,s;if(0===t)n=a=s=o;else {let r=(e,t,o)=>(o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e),l=o<.5?o*(1+t):o+t-o*t,i=2*o-l;n=r(i,l,e+1/3),a=r(i,l,e),s=r(i,l,e-1/3);}return [Math.round(255*n),Math.round(255*a),Math.round(255*s)]},rgbToHsl(e,t,o){e/=255,t/=255,o/=255;let n,a,s=Math.max(e,t,o),r=Math.min(e,t,o),l=(s+r)/2;if(s===r)n=a=0;else {let i=s-r;switch(a=l>.5?i/(2-s-r):i/(s+r),s){case e:n=(t-o)/i+(te.match(/^(down|right|up|left)$/i));n.length&&(t.autoposition=n[0],o.splice(o.indexOf(n[0]),1));let a=o.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));a.length?(t.my=a[0],t.at=a[1]||a[0],o.splice(o.indexOf(a[0]),1),a[1]&&o.splice(o.indexOf(a[1]),1)):(t.my="center",t.at="center");let s=o.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return s.length&&(t.offsetX=s[0].match(/^[+-]?\d*\.?\d+$/i)?`${s[0]}px`:s[0],s[1]?t.offsetY=s[1].match(/^[+-]?\d*\.?\d+$/i)?`${s[1]}px`:s[1]:t.offsetY=t.offsetX,o.splice(o.indexOf(s[0]),1),s[1]&&o.splice(o.indexOf(s[1]),1)),o.length&&(t.of=o.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(o=>{"function"==typeof t[o]&&(t[o]=t[o].call(e,e));}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const o="window"===e.options.container?"window":e.parentElement,n=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),s="window"===o?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},r="window"===o?{x:1,y:1}:{x:s.width/o.offsetWidth,y:s.height/o.offsetHeight},l="window"===o?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(o);let i;s.width-=(parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))*r.x,s.height-=(parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth))*r.y,i=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():s;let c=this.getScrollbarWidth(document.body),d=this.getScrollbarWidth(e.parentElement),p="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width/2+"px":s.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width+"px":s.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width/2+"px":-n.width/2+"px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-(n.width-i.width)/2+"px":s.width/2-n.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+(i.width-n.width/2)+"px":s.width-n.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width+"px":-n.width+"px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width+i.width/2+"px":s.width/2-n.width+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width-n.width+"px":s.width-n.width+"px","window"!==o&&(p=parseFloat(p)-d.y+"px")));let h="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+"px":"0px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+i.height/2+"px":s.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+i.height+"px":s.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+"px":-n.height/2+"px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+i.height/2+"px":s.height/2-n.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+i.height+"px":s.height-n.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+"px":-n.height+"px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+i.height/2+"px":s.height/2-n.height+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+i.height+"px":s.height-n.height+"px",h="window"!==o?parseFloat(h)-d.x+"px":parseFloat(h)-c.x+"px")),e.style.left=1===r.x?p:parseFloat(p)/r.x+"px",e.style.top=1===r.y?h:parseFloat(h)/r.y+"px";let f=getComputedStyle(e),u={left:f.left,top:f.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(u=this.applyPositionAutopos(e,u,t)),(t.offsetX||t.offsetY)&&(u=this.applyPositionOffset(e,u,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(u=this.applyPositionMinMax(e,u,t)),t.modify&&(u=this.applyPositionModify(e,u,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,o){const n=`${o.my}-${o.autoposition.toLowerCase()}`;e.classList.add(n);const a=Array.prototype.slice.call(document.querySelectorAll(`.${n}`)),s=a.indexOf(e);if(a.length>1){switch(o.autoposition){case"down":a.forEach((e,o)=>{o>0&&o<=s&&(t.top=parseFloat(t.top)+a[--o].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px");});break;case"up":a.forEach((e,o)=>{o>0&&o<=s&&(t.top=parseFloat(t.top)-a[--o].getBoundingClientRect().height-jsPanel.autopositionSpacing+"px");});break;case"right":a.forEach((e,o)=>{o>0&&o<=s&&(t.left=parseFloat(t.left)+a[--o].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px");});break;case"left":a.forEach((e,o)=>{o>0&&o<=s&&(t.left=parseFloat(t.left)-a[--o].getBoundingClientRect().width-jsPanel.autopositionSpacing+"px");});}e.style.left=t.left,e.style.top=t.top;}return {left:t.left,top:t.top}},applyPositionOffset(e,t,o){["offsetX","offsetY"].forEach(e=>{o[e]?("function"==typeof o[e]&&(o[e]=o[e].call(t,t,o)),!1===isNaN(o[e])&&(o[e]=`${o[e]}px`)):o[e]="0px";}),e.style.left=`calc(${e.style.left} + ${o.offsetX})`,e.style.top=`calc(${e.style.top} + ${o.offsetY})`;const n=getComputedStyle(e);return {left:n.left,top:n.top}},applyPositionMinMax(e,t,o){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{o[e]&&("function"==typeof o[e]&&(o[e]=o[e].call(t,t,o)),(Number.isInteger(o[e])||o[e].match(/^\d+$/))&&(o[e]=`${o[e]}px`));}),o.minLeft){e.style.left=o.minLeft;let n=getComputedStyle(e).left;parseFloat(n)parseFloat(t.left)?e.style.left=t.left:t.left=n;}if(o.maxTop){e.style.top=o.maxTop;let n=getComputedStyle(e).top;parseFloat(n)>parseFloat(t.top)?e.style.top=t.top:t.top=n;}const n=getComputedStyle(e);return {left:n.left,top:n.top}},applyPositionModify(e,t,o){if(o.modify&&"function"==typeof o.modify){const n=o.modify.call(t,t,o);e.style.left=Number.isInteger(n.left)||n.left.match(/^\d+$/)?`${n.left}px`:n.left,e.style.top=Number.isInteger(n.top)||n.top.match(/^\d+$/)?`${n.top}px`:n.top;}const n=getComputedStyle(e);return {left:n.left,top:n.top}},autopositionRemaining(e){let t,o=e.options.container;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(o=>{e.classList.contains(o)&&(t=o);}),t){("window"===o?document.body:"string"==typeof o?document.querySelector(o):o).querySelectorAll(`.${t}`).forEach(e=>e.reposition());}},getThemeDetails(e){const t=this.pOtheme(e);if(this.themes.some(e=>e===t.color.split(/\s/i)[0])){let e=t.color.split(/\s/i)[0],o=document.createElement("button");o.className=e+"-bg",document.body.appendChild(o),t.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0;}else if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),o=document.createElement("button");o.className="btn btn"+t.color.slice(e),document.body.appendChild(o),t.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0;}else if(t.color.startsWith("mdb-")){let e,o=t.color.indexOf("-")+1,n=document.createElement("span");e=t.color.endsWith("-dark")?(e=t.color.slice(o)).replace("-dark","-color-dark"):t.color.slice(o)+"-color",n.className=e,document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0;}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return this.themes.forEach(t=>{["panel",`jsPanel-theme-${t}`,`panel-${t}`,`${t}-color`].forEach(t=>e.classList.remove(t)),e.header.classList.remove(`jsPanel-theme-${t}`);}),e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(o=>e.querySelector(o).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000";}return e},applyCustomTheme(e,t){let o={bgPanel:"#ffffff",bgContent:"#fffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},n="object"==typeof t?Object.assign(o,t):o,a=n.bgPanel,s=n.bgContent,r=n.colorHeader,l=n.colorContent,i=n.bgFooter,c=n.colorFooter;return this.colorNames[a]?e.style.background="#"+this.colorNames[a]:e.style.background=this.getCssVariableValue(a),this.colorNames[r]&&(r="#"+this.colorNames[r]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(r)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(r)),this.colorNames[s]?e.content.style.background="#"+this.colorNames[s]:e.content.style.background=this.getCssVariableValue(s),this.colorNames[l]?e.content.style.color="#"+this.colorNames[l]:e.content.style.color=this.getCssVariableValue(l),this.perceivedBrightness(r)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(l)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[i]?e.footer.style.background="#"+this.colorNames[i]:e.footer.style.background=this.getCssVariableValue(i),this.colorNames[c]?e.footer.style.color="#"+this.colorNames[c]:e.footer.style.color=this.getCssVariableValue(c),n.border&&e.setBorder(n.border),n.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(n.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return {y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return {y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[o,n]of Object.entries(t))e.style[o]="string"==typeof n?jsPanel.getCssVariableValue(n):n;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",o){if(!document.querySelector(`script[src="${e}"]`)){const n=document.createElement("script");n.src=e,n.type=t,document.head.appendChild(n),o&&(n.onload=o);}},ajax(e,t){let o,n,a=new XMLHttpRequest;const s={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=jsPanel.strToHtml(this.responseText);o.urlSelector&&(e=e.querySelector(o.urlSelector)),t.contentRemove(),t.content.append(e);}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)o=Object.assign({},s,{url:e});else {if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the url parameter!";jsPanel.errorpanel(e);}return}(o=Object.assign({},s,e)).url=e.url,!1===o.async&&(o.timeout=0,o.withCredentials&&(o.withCredentials=void 0),o.responseType&&(o.responseType=void 0));}n=o.url.trim().split(/\s+/),o.url=encodeURI(n[0]),n.length>1&&(n.shift(),o.urlSelector=n.join(" ")),a.onreadystatechange=(()=>{4===a.readyState&&(200===a.status?t?o.done.call(a,a,t):o.done.call(a,a):o.fail&&(t?o.fail.call(a,a,t):o.fail.call(a,a)),o.always&&(t?o.always.call(a,a,t):o.always.call(a,a)),t&&(o.autoresize||o.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,o),jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(a,a,t):e.call(a,a);}));}),a.open(o.method,o.url,o.async,o.user,o.pwd),a.timeout=o.timeout||0,o.withCredentials&&(a.withCredentials=o.withCredentials),o.responseType&&(a.responseType=o.responseType),o.beforeSend&&(t?o.beforeSend.call(a,a,t):o.beforeSend.call(a,a)),o.data?a.send(o.data):a.send(null);},fetch(e,t){let o;const n={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let o=jsPanel.strToHtml(e);t.contentRemove(),t.content.append(o);}}};if(t&&"string"==typeof e)o=Object.assign({},n,{resource:encodeURI(e)});else {if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the resource parameter!";jsPanel.errorpanel(e);}return}(o=Object.assign({},n,e)).resource=encodeURI(e.resource);}const a=o.fetchInit||{};o.beforeSend&&(t?o.beforeSend.call(e,e,t):o.beforeSend.call(e,e)),fetch(o.resource,a).then(e=>{if(e.ok)return e[o.bodyMethod]()}).then(e=>{t?o.done.call(e,e,t):o.done.call(e,e),t&&(o.autoresize||o.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,o);});},ajaxAutoresizeAutoreposition(e,t){const o=e.options.contentSize;if("string"==typeof o&&o.match(/auto/i)){const n=o.split(" "),a=Object.assign({},{width:n[0],height:n[1]});t.autoresize&&e.resize(a),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}else if("object"==typeof o&&("auto"===o.width||"auto"===o.height)){const n=Object.assign({},o);t.autoresize&&e.resize(n),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled");}),t.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,o){const n=document.createElement("div"),a=e.parentElement;n.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(n.style.width=o+"px",n.style.height=o+"px"):"ct"===t||"cb"===t?n.style.height=o+"px":"lc"!==t&&"rc"!==t||(n.style.width=o+"px"),a!==document.body&&(n.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(n);},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e));},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t]);},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,o="some",n,a){if("function"==typeof t&&(t=[t]),o)return t[o](t=>t.call(e,e,n,a));t.forEach(t=>t.call(e,e,n,a));},resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=jsPanel.zi.next());},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e}

`});},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const o=document.getElementById(e.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID ${e.id} already exists in the document.`;jsPanel.errorpanel(t);}return !1}let n=this.pOcontainer(e.container);if("object"==typeof n&&n.length&&n.length>0&&(n=n[0]),!n){if(this.errorReporting){let e="◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist";jsPanel.errorpanel(e);}return !1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[];});const a=e.template||this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.progressbar=a.autocloseProgressbar=a.querySelector(".jsPanel-progressbar");const s=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),r=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),i=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[s,r,l,i,c,d,p,h,f,u,m,g,b,y].forEach(e=>e.panel=a);const j=a.querySelector(".jsPanel-btn-close"),x=a.querySelector(".jsPanel-btn-maximize"),E=a.querySelector(".jsPanel-btn-normalize"),C=a.querySelector(".jsPanel-btn-smallify"),P=a.querySelector(".jsPanel-btn-minimize");j&&jsPanel.pointerup.forEach(e=>{j.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify();});}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.minimize();});});let F=jsPanel.extensions;for(let e in F)Object.prototype.hasOwnProperty.call(F,e)&&(a[e]=F[e]);if(a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length||(t[2]=a.style.backgroundColor),t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=jsPanel.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.options.header?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.options.footerToolbar?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,o)=>{let n;if("minimized"===a.status&&(n=!0,a.normalize()),jsPanel.clearTheme(a),"object"==typeof t)e.border=void 0,jsPanel.applyCustomTheme(a,t);else if("string"==typeof t){"none"===t&&(t="white");let e=jsPanel.getThemeDetails(t);jsPanel.applyColorTheme(a,e);}return n&&a.minimize(),o&&o.call(a,a),a}),a.remove=((e,t,o)=>{a.parentElement.removeChild(a),document.getElementById(e)?o&&o.call(a,e,a):(a.removeMinimizedReplacement(),a.status="closed",t&&document.dispatchEvent(v),document.dispatchEvent(w),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),o&&o.call(e,e)),window.removeEventListener("resize",a.windowResizeHandler),document.removeEventListener("jspanelresize",a.parentResizeHandler);}),a.close=((e,t)=>{if(a.parentElement){if(a.closetimer&&window.clearInterval(a.closetimer),document.dispatchEvent(y),a.statusBefore=a.status,a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",o=>{o.stopPropagation(),a.remove(a.id,t,e);})):a.remove(a.id,t,e);}}),a.maximize=((t,o)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(c);const n=a.parentElement,s=jsPanel.pOcontainment(e.maximizedMargin);return n===document.body?(a.style.width=document.documentElement.clientWidth-s[1]-s[3]+"px",a.style.height=document.documentElement.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"):(a.style.width=n.clientWidth-s[1]-s[3]+"px",a.style.height=n.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),o||a.front(),document.dispatchEvent(d),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e);}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,o,n,s=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(s);break;case"parentpanel":(t=(n=(o=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[n.length-1]).append(s);break;case"parent":(t=(o=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",o.append(t)),t.append(s);break;default:document.querySelector(e.minimizeTo).append(s);}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(l),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const o=window.getComputedStyle(a),n=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth)+n+"px",C.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(u),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const s=a.querySelectorAll(".jsPanel-minimized-box");return s[s.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(g),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),C.style.transform="rotate(0deg)";const o=a.querySelectorAll(".jsPanel-minimized-box");o[o.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore);}return a}),a.front=((t,o=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else {const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi();}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&o&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){let e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),o=a.snappableTo;o.startsWith("left")?e[0]=t[3]:o.startsWith("right")&&(e[0]=-t[1]),o.endsWith("top")?e[1]=t[0]:o.endsWith("bottom")&&(e[1]=-t[2]);}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`);}t||(a.snapped=a.snappableTo);}),a.move=((e,t)=>{let o=a.overlaps(e,"paddingbox"),n=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=o.left+"px",a.style.top=o.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,n),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,o,n)=>{e.call(t,t,o,n);}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),o=t?t.parentElement:null;return e&&e.call(a,a,o),!!t&&o}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),o=window.getComputedStyle(a.headertitle).color,n=window.getComputedStyle(a),s=e.iconfont,r=t.querySelector(".jsPanel-controlbar");return "auto-show-hide"!==a.options.header?jsPanel.setStyles(t,{backgroundColor:n.backgroundColor,backgroundPositionX:n.backgroundPositionX,backgroundPositionY:n.backgroundPositionY,backgroundRepeat:n.backgroundRepeat,backgroundAttachment:n.backgroundAttachment,backgroundImage:n.backgroundImage,backgroundSize:n.backgroundSize,backgroundOrigin:n.backgroundOrigin,backgroundClip:n.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=o,r.style.color=o,r.querySelectorAll("button").forEach(e=>e.style.color=o),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e);}),a.setIconfont(s,t),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}):r.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}):r.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}):r.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e);}),a.drag=((e={})=>{let t,o,n;const s=new CustomEvent("jspaneldragstart",{detail:a.id}),r=new CustomEvent("jspaneldrag",{detail:a.id}),l=new CustomEvent("jspaneldragstop",{detail:a.id});[s,r,l].forEach(e=>e.panel=a);const i=e=>{let t=e.split("-");return t.forEach((e,o)=>{t[o]=e.charAt(0).toUpperCase()+e.slice(1);}),"snap"+t.join("")};function c(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,o,!1),a.style.opacity=1;});}let d=e.handles||jsPanel.defaults.dragit.handles,p=e.cursor||jsPanel.defaults.dragit.cursor;function h(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,o)),jsPanel.removeSnapAreas(),t){if(a.style.opacity=1,t=void 0,n.snap){switch(a.snappableTo){case"left-top":a.snap(n.snap.snapLeftTop);break;case"center-top":a.snap(n.snap.snapCenterTop);break;case"right-top":a.snap(n.snap.snapRightTop);break;case"right-center":a.snap(n.snap.snapRightCenter);break;case"right-bottom":a.snap(n.snap.snapRightBottom);break;case"center-bottom":a.snap(n.snap.snapCenterBottom);break;case"left-bottom":a.snap(n.snap.snapLeftBottom);break;case"left-center":a.snap(n.snap.snapLeftCenter);}n.snap.callback&&a.snappableTo&&"function"==typeof n.snap.callback&&(n.snap.callback.call(a,a),n.snap.repositionOnSnap&&!1!==n.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo)),a.snappableTo&&n.snap.repositionOnSnap&&n.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo);}if(a.droppableTo&&a.droppableTo){let e=a.parentElement;a.move(a.droppableTo),n.drop.callback&&n.drop.callback.call(a,a,a.droppableTo,e);}if(document.dispatchEvent(l),n.stop.length){let t=window.getComputedStyle(a),o={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,n.stop,!1,o,e);}a.saveCurrentPosition(),a.calcSizeFactors();}a.controlbar.style.pointerEvents="inherit",a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,h);}return a.querySelectorAll(d).forEach(l=>{l.style.touchAction="none",l.style.cursor=p,jsPanel.pointerdown.forEach(i=>{l.addEventListener(i,l=>{if(l.button&&l.button>0)return !1;if((n=Object.assign({},jsPanel.defaults.dragit,e)).disableOnMaximized&&"maximized"===a.status)return !1;if((n.containment||0===n.containment)&&(n.containment=jsPanel.pOcontainment(n.containment)),n.grid&&Array.isArray(n.grid)&&1===n.grid.length&&(n.grid[1]=n.grid[0]),n.snap&&("object"==typeof n.snap?n.snap=Object.assign({},jsPanel.defaultSnapConfig,n.snap):n.snap=jsPanel.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;a.controlbar.style.pointerEvents="none",a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let i=window.getComputedStyle(a),d=parseFloat(i.left),p=parseFloat(i.top),h=parseFloat(i.width),f=parseFloat(i.height),u=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,g=a.parentElement,b=g.getBoundingClientRect(),y=window.getComputedStyle(g),w=a.getScaleFactor(),v=0,j=jsPanel.getScrollbarWidth(g);o=(e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(s),a.style.opacity=n.opacity,a.snapped&&n.snap.resizeToPreSnap&&a.currentData.beforeSnap){a.resize(a.currentData.beforeSnap.width+" "+a.currentData.beforeSnap.height),a.setControls([".jsPanel-btn-normalize"]);let e=a.getBoundingClientRect(),t=u-(e.left+e.width),o=e.width/2;t>-o&&(v=t+o);}if(a.front(),a.snapped=!1,"maximized"===a.status&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized"),n.drop&&n.drop.dropZones){let e=n.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e);}):t.push(e);}),t=t.filter(function(e,t,o){return o.indexOf(e)===t}),n.drop.dropZones=t;}n.start.length&&jsPanel.processCallbacks(a,n.start,!1,{left:d,top:p,width:h,height:f},e);}let o,l,i,c,x,E,C,P,F,z;t=1;let S,A=e.touches?e.touches[0].clientX:e.clientX,k=e.touches?e.touches[0].clientY:e.clientY,B=window.getComputedStyle(a);if(g===document.body){let e=a.getBoundingClientRect();F=window.innerWidth-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(e.left+e.width),z=window.innerHeight-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(e.top+e.height);}else F=parseInt(y.width,10)-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(parseInt(B.left,10)+parseInt(B.width,10)),z=parseInt(y.height,10)-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(parseInt(B.top,10)+parseInt(B.height,10));o=parseFloat(B.left),i=parseFloat(B.top),x=F,C=z,n.snap&&("panel"===n.snap.trigger?(l=o**2,c=i**2,E=x**2,P=C**2):"pointer"===n.snap.trigger&&("window"===a.options.container?(o=A,l=A**2,c=(i=k)**2,E=(x=window.innerWidth-A)**2,P=(C=window.innerHeight-k)**2):(o=(S=a.overlaps(g,"paddingbox",e)).pointer.left,i=S.pointer.top,x=S.pointer.right,C=S.pointer.bottom,l=S.pointer.left**2,c=S.pointer.top**2,E=S.pointer.right**2,P=S.pointer.bottom**2)));let T=Math.sqrt(l+c),L=Math.sqrt(l+P),R=Math.sqrt(E+c),W=Math.sqrt(E+P),D=Math.abs(o-x)/2,$=Math.abs(i-C)/2,O=Math.sqrt(l+$**2),q=Math.sqrt(c+D**2),H=Math.sqrt(E+$**2),M=Math.sqrt(P+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(r),n.axis&&"x"!==n.axis||(a.style.left=d+(A-u)/w.x+v+"px"),n.axis&&"y"!==n.axis||(a.style.top=p+(k-m)/w.y+"px"),n.grid){let e=n.grid,t=n.axis,o=e[0]*Math.round((d+(A-u))/e[0]),s=e[1]*Math.round((p+(k-m))/e[1]);t&&"x"!==t||(a.style.left=`${o}px`),t&&"y"!==t||(a.style.top=`${s}px`);}if(n.containment||0===n.containment){let e,t,o=n.containment;if("window"===a.options.container)e=window.innerWidth-parseFloat(B.width)-o[1]-j.y,t=window.innerHeight-parseFloat(B.height)-o[2]-j.x;else {let n=parseFloat(y.borderLeftWidth)+parseFloat(y.borderRightWidth),a=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth);e=b.width/w.x-parseFloat(B.width)-o[1]-n-j.y,t=b.height/w.y-parseFloat(B.height)-o[2]-a-j.x;}parseFloat(a.style.left)<=o[3]&&(a.style.left=o[3]+"px"),parseFloat(a.style.top)<=o[0]&&(a.style.top=o[0]+"px"),parseFloat(a.style.left)>=e&&(a.style.left=e+"px"),parseFloat(a.style.top)>=t&&(a.style.top=t+"px");}if(n.drag.length){let t={left:o,top:i,right:x,bottom:C,width:parseFloat(B.width),height:parseFloat(B.height)};jsPanel.processCallbacks(a,n.drag,!1,t,e);}if(n.snap){let e=n.snap.sensitivity,t=g===document.body?window.innerWidth/8:b.width/8,s=g===document.body?window.innerHeight/8:b.height/8;a.snappableTo=!1,jsPanel.removeSnapAreas(),T0&&S.pointer.top>0?(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e))):L0&&S.pointer.bottom>0?(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e))):R0&&S.pointer.top>0?(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e))):W0&&S.pointer.bottom>0?(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e))):i0?(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e))):o0?(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e))):x0?(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e))):C0?(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)));}if(n.drop&&n.drop.dropZones){let t=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",o=document[t](e.clientX,e.clientY);Array.isArray(o)||(o=Array.prototype.slice.call(o)),n.drop.dropZones.forEach(e=>{o.includes(e)&&(a.droppableTo=e);}),o.includes(a.droppableTo)||(a.droppableTo=!1);}}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,o)),window.addEventListener("mouseout",c,!1);});}),jsPanel.pointerup.forEach(e=>{document.addEventListener(e,h),window.removeEventListener("mouseout",c);}),e.disable&&(l.style.pointerEvents="none");}),a}),a.dragit=(t=>{const o=Object.assign({},jsPanel.defaults.dragit,e.dragit),n=a.querySelectorAll(o.handles);return "disable"===t?n.forEach(e=>e.style.pointerEvents="none"):n.forEach(e=>e.style.pointerEvents="auto"),a}),a.sizeit=((e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:a.id}),o=new CustomEvent("jspanelresize",{detail:a.id}),n=new CustomEvent("jspanelresizestop",{detail:a.id});[t,o,n].forEach(e=>e.panel=a);let s,r,l,i,c,d,p={};p.handles=e.handles||jsPanel.defaults.resizeit.handles,p.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,a.append(t);});let h=!!e.aspectRatio&&e.aspectRatio;function f(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>document.removeEventListener(e,s,!1));}function u(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,s,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,o,n=e.target.className;if(n.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),n.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),p.grid&&Array.isArray(p.grid)){1===p.grid.length&&(p.grid[1]=p.grid[0]);const e=parseFloat(a.style.width),n=parseFloat(a.style.height),s=e%p.grid[0],r=n%p.grid[1],l=parseFloat(a.style.left),i=parseFloat(a.style.top),c=l%p.grid[0],d=i%p.grid[1];sd+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(n),p.stop.length){let t=window.getComputedStyle(a),o={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,p.stop,!1,o,e);}}a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),p.aspectRatio=h,document.removeEventListener(e,u);}return a.querySelectorAll(".jsPanel-resizeit-handle").forEach(n=>{n.style.touchAction="none",jsPanel.pointerdown.forEach(h=>{n.addEventListener(h,n=>{if(n.preventDefault(),n.stopPropagation(),n.button&&n.button>0)return !1;let h=1;if(((p=Object.assign({},jsPanel.defaults.resizeit,e)).containment||0===p.containment)&&(p.containment=jsPanel.pOcontainment(p.containment)),p.aspectRatio&&!0===p.aspectRatio&&(p.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;e.altKey?p.aspectRatio="content":e.ctrlKey?p.aspectRatio="panel":e.shiftKey&&(p.aspectRatio=!1,h=2);}let u="function"==typeof p.maxWidth?p.maxWidth():p.maxWidth||1e4,m="function"==typeof p.maxHeight?p.maxHeight():p.maxHeight||1e4,g="function"==typeof p.minWidth?p.minWidth():p.minWidth,b="function"==typeof p.minHeight?p.minHeight():p.minHeight;a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const y=a.parentElement,w=y.tagName.toLowerCase(),v=a.getBoundingClientRect(),j=y.getBoundingClientRect(),x=window.getComputedStyle(y,null),E=parseInt(x.borderLeftWidth,10),C=parseInt(x.borderTopWidth,10),P=x.getPropertyValue("position"),F=n.clientX||0===n.clientX||n.touches[0].clientX,z=n.clientY||0===n.clientY||n.touches[0].clientY,S=F/z,A=n.target.classList,k=a.getScaleFactor(),B=v.width/v.height,T=a.content.getBoundingClientRect(),L=T.width/T.height,R=a.header.getBoundingClientRect().height,W=a.footer.getBoundingClientRect().height||0;let D=v.left,$=v.top,O=1e4,q=1e4,H=1e4,M=1e4;c=v.width,d=v.height,"body"!==w&&(D=v.left-j.left+y.scrollLeft,$=v.top-j.top+y.scrollTop),"body"===w&&p.containment?(O=document.documentElement.clientWidth-v.left,H=document.documentElement.clientHeight-v.top,q=v.width+v.left,M=v.height+v.top):p.containment&&("static"===P?(O=j.width-v.left+E,H=j.height+j.top-v.top+C,q=v.width+(v.left-j.left)-E,M=v.height+(v.top-j.top)-C):(O=y.clientWidth-(v.left-j.left)/k.x+E,H=y.clientHeight-(v.top-j.top)/k.y+C,q=(v.width+v.left-j.left)/k.x-E,M=a.clientHeight+(v.top-j.top)/k.y-C)),p.containment&&(q-=p.containment[3],M-=p.containment[0],O-=p.containment[1],H-=p.containment[2]);const N=window.getComputedStyle(a),I=parseFloat(N.width)-v.width,V=parseFloat(N.height)-v.height;let X=parseFloat(N.left)-v.left,Y=parseFloat(N.top)-v.top;y!==document.body&&(X+=j.left,Y+=j.top);let Z=parseInt(N.borderTopWidth,10),U=parseInt(N.borderRightWidth,10),K=parseInt(N.borderBottomWidth,10),_=parseInt(N.borderLeftWidth,10);s=(e=>{e.preventDefault(),r||(document.dispatchEvent(t),p.start.length&&jsPanel.processCallbacks(a,p.start,!1,{width:c,height:d,left:D,top:$},e),a.front(),"maximized"===a.status&&(a.status="normalized",a.controlbar.querySelector(".jsPanel-btn-maximize")&&a.setControlStatus("maximize","show"),a.controlbar.querySelector(".jsPanel-btn-normalize")&&a.setControlStatus("normalize","hide")),v.height>d+5&&(a.status="normalized",a.setControls([".jsPanel-btn-normalize"]))),r=1,document.dispatchEvent(o);let s=e.touches?e.touches[0].clientX:e.clientX,f=e.touches?e.touches[0].clientY:e.clientY;A.contains("jsPanel-resizeit-e")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),"content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-s")?((i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-w")?((l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-n")?((i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-se")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-sw")?((i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),p.aspectRatio&&(a.style.width=i*B+"px"),(l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-ne")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(p.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(f=(s=f*S)/S),(l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?a.style.width=(i-R-W-Z-K)*L+Z+K+"px":"panel"===p.aspectRatio&&(a.style.width=i*B+"px")),window.getSelection().removeAllRanges();const w=window.getComputedStyle(a),j={left:parseFloat(w.left),top:parseFloat(w.top),right:parseFloat(w.right),bottom:parseFloat(w.bottom),width:parseFloat(w.width),height:parseFloat(w.height)};p.resize.length&&jsPanel.processCallbacks(a,p.resize,!1,j,e);}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,s,!1)),window.addEventListener("mouseout",f,!1);});}),jsPanel.pointerup.forEach(function(e){document.addEventListener(e,u),window.removeEventListener("mouseout",f);}),e.disable&&(n.style.pointerEvents="none");}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return "disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return {x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height));}}),a.saveCurrentDimensions=((e=!1)=>{const t=window.getComputedStyle(a);a.currentData.width=t.width,"normalized"===a.status&&(a.currentData.height=t.height),e&&(a.style.height=t.height);}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top;}),a.reposition=((...t)=>{let o,n=e.position,s=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?n=e:"boolean"==typeof e?s=e:"function"==typeof e&&(o=e);}),jsPanel.position(a,n),a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),s&&a.saveCurrentPosition(),o&&o.call(a,a),a}),a.repositionOnSnap=(t=>{let o="0",n="0",s=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":o=s[3],n=s[0];break;case"right-top":o=-s[1],n=s[0];break;case"right-bottom":o=-s[1],n=-s[2];break;case"left-bottom":o=s[3],n=-s[2];break;case"center-top":o=s[3]/2-s[1]/2,n=s[0];break;case"center-bottom":o=s[3]/2-s[1]/2,n=-s[2];break;case"left-center":o=s[3],n=s[0]/2-s[2]/2;break;case"right-center":o=-s[1],n=s[0]/2-s[2]/2;}jsPanel.position(a,t),jsPanel.setStyles(a,{left:`calc(${a.style.left} + ${o}px)`,top:`calc(${a.style.top} + ${n}px)`});}),a.overlaps=((e,t,o)=>{let n,s=a.getBoundingClientRect(),r=getComputedStyle(a.parentElement),l=a.getScaleFactor(),i={top:0,right:0,bottom:0,left:0},c=0,d=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(i.top=parseInt(r.borderTopWidth,10)*l.y,i.right=parseInt(r.borderRightWidth,10)*l.x,i.bottom=parseInt(r.borderBottomWidth,10)*l.y,i.left=parseInt(r.borderLeftWidth,10)*l.x),n="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),o&&(c=o.touches?o.touches[0].clientX:o.clientX,d=o.touches?o.touches[0].clientY:o.clientY,p=c-n.left,h=d-n.top);let f=s.leftn.left,u=s.topn.top;return {overlaps:f&&u,top:s.top-n.top-i.top,right:n.right-s.right-i.right,bottom:n.bottom-s.bottom-i.bottom,left:s.left-n.left-i.left,parentBorderWidth:i,panelRect:s,referenceRect:n,pointer:{clientX:c,clientY:d,left:p-i.left,top:h-i.top,right:n.width-p-i.right,bottom:n.height-h-i.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height;}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%";}return a}),a.resize=((...e)=>{let t,o=window.getComputedStyle(a),n={width:o.width,height:o.height},s=!0;e.forEach(e=>{"string"==typeof e?n=e:"object"==typeof e?n=Object.assign(n,e):"boolean"==typeof e?s=e:"function"==typeof e&&(t=e);});let r=jsPanel.pOsize(a,n);a.style.width=r.width,a.style.height=r.height,a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),s&&a.saveCurrentDimensions(),a.status="normalized";let l=a.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.windowResizeHandler=(t=>{if(t.target===window){let o,n,s=a.status,r=e.onwindowresize;if("maximized"===s&&r)a.maximize(!1,!0);else if(a.snapped&&"minimized"!==s)a.snap(a.snapped,!0);else if("normalized"===s||"smallified"===s||"maximized"===s){let e=typeof r;"boolean"===e?(o=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",n=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=n<=0?0:n+"px"):"function"===e?r.call(a,t,a):"object"===e&&(!0===r.preset?(o=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",n=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=n<=0?0:n+"px",r.callback.call(a,t,a)):r.callback.call(a,t,a));}else "smallifiedmax"===s&&r&&a.maximize(!1,!0).smallify();a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition());}}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),o=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${o}`)&&(e.style.display="block");}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none");}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",o)=>{const n=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),n.style.pointerEvents="none",n.style.opacity=.4,n.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),n.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),n.style.display="block",n.style.pointerEvents="auto",n.style.opacity=1,n.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(n.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),n.style.pointerEvents="auto",n.style.opacity=1,n.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(n),a.setAttribute(`data-btn${e}`,"removed");}return o&&o.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`);}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem");}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>a.addControl(e));}let o=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);o.push(t);});const n=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=n,o.forEach(e=>{n[e]&&a.setControlStatus(e,n[e]);}),a.setControlSize(n.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let o=[a.headerlogo],n=document.querySelector("#"+a.id+"-min");return n&&o.push(n.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?o.forEach(t=>t.innerHTML=e):o.forEach(t=>{jsPanel.emptyNode(t);let o=document.createElement("img");o.src=e,t.append(o);}):o.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false");}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>a.setAttribute(`data-btn${e}`,"removed")),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let o=[a.headertitle],n=document.querySelector("#"+a.id+"-min");return n&&o.push(n.querySelector(".jsPanel-title")),"string"==typeof e?o.forEach(t=>t.innerHTML=e):"function"==typeof e?o.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e();}):o.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),t&&t.call(a,a),a}),a.setIconfont=((e,t=a,o)=>{if(e){let o,n;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)o=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)o=[e,e,e,e,e,e],n=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))o=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else {if("bootstrap"!==e&&"glyphicon"!==e)return t;o=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"];}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>jsPanel.emptyNode(e).innerHTML=""),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=o[a],"material-icons"===e&&(t.textContent=n[a]);});}return o&&o.call(t,t),t}),a.addToolbar=((e,t,o)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t);});else if("function"==typeof t){let o=t.call(a,a);"string"==typeof o?e.innerHTML=o:e.append(o);}else e.append(t);return e.classList.add("active"),o&&o.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault());}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const o=a.controlbar.querySelectorAll(".jsPanel-btn").length;let n=document.createElement("button");n.innerHTML=t.html,n.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,n.style.color=a.header.style.color,t.position>o?a.controlbar.append(n):a.controlbar.insertBefore(n,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const s=t.ariaLabel||t.name;return s&&n.setAttribute("aria-label",s),jsPanel.pointerup.forEach(e=>{n.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;t.handler.call(a,a,n);});}),t.afterInsert&&t.afterInsert.call(n,n),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang);});}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),n.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px";});break;case"xs":e.forEach(e=>{e.style.height="26px";});break;case"sm":e.forEach(e=>{e.style.height="30px";});break;case"lg":e.forEach(e=>{e.style.height="38px";});break;case"xl":e.forEach(e=>{e.style.height="42px";});}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t);}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t);});}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.css)for(const[t,o]of Object.entries(e.css))if("panel"===t)a.className+=` ${o}`;else {let e=a.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${o}`);}if(e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,a),e.contentFetch&&this.fetch(e.contentFetch,a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1]);}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let o=a.progressbar.querySelector("div");o.addEventListener("animationend",e=>{e.stopPropagation(),a.progressbar.classList.remove("active"),a.close();}),t.progressbar&&(a.progressbar.classList.add("active"),t.background?jsPanel.themes.indexOf(t.background)>-1?a.progressbar.classList.add(t.background+"-bg"):jsPanel.colorNames[t.background]?a.progressbar.style.background="#"+jsPanel.colorNames[t.background]:a.progressbar.style.background=t.background:a.progressbar.classList.add("success-bg")),o.style.animation=`${t.time} progressbar`;}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(i),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn);}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t);}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[];}),a.drag(e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors();},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[];}),a.sizeit(e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status);},!1),a.addEventListener("jspanelresizestop",o=>{o.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors());},!1);}if(a.saveCurrentDimensions(!0),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front();},!1);}),e.onwindowresize&&"window"===a.options.container&&window.addEventListener("resize",a.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,o=typeof t,n=a.isChildpanel();if(n){const e=n.content;let s=[];a.parentResizeHandler=(r=>{if(r.panel===n){s[0]=e.offsetWidth,s[1]=e.offsetHeight;let n,r,l=a.status;"maximized"===l&&t?a.maximize():a.snapped&&"minimized"!==l?a.snap(a.snapped,!0):"normalized"===l||"smallified"===l||"maximized"===l?"function"===o?t.call(a,a,{width:s[0],height:s[1]}):"object"===o&&!0===t.preset?(n=(s[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",r=(s[1]-a.offsetHeight)*a.vf,a.style.top=r<=0?0:r+"px",t.callback.call(a,a,{width:s[0],height:s[1]})):"boolean"===o&&(n=(s[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",r=(s[1]-a.offsetHeight)*a.vf,a.style.top=r<=0?0:r+"px"):"smallifiedmax"===l&&t&&a.maximize().smallify();}}),document.addEventListener("jspanelresize",a.parentResizeHandler,!1);}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(a,a)):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(a,a)):e.callback.call(a,a)),t&&t.call(a,a),document.dispatchEvent(s),a}}; + let jsPanel={version:"4.16.1",date:"2022-11-03 09:18",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)));},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>document.documentMode||!1)(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return !1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e;}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return (void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var n=t>0?0|t:0;return this.substring(n,n+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return "";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var n=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+=t.substring(0,n-t.length)}),Number.isInteger=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let n=Object(this),o=n.length>>>0;if(0===o)return !1;let a=0|t,r=Math.max(a>=0?a:o-Math.abs(a),0);for(;rjsPanel.modifier=e),void document.addEventListener("keyup",()=>jsPanel.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"]);},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return !!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return [t,t,t,t];if(Array.isArray(t)){if(1===t.length)return [t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1]);}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const o=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0];}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[\d.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else {const e=window.getComputedStyle(o),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px";}else "function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[\d.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[\d.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else {const e=window.getComputedStyle(o),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px";}else "function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[\d.]+$/gi)&&(n.height+="px"));return n},pOborder(e){let t=[],n=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return n.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(n[t]=jsPanel.getCssVariableValue(e));}),n.forEach(e=>{jsPanel.colorNames[e]?t[2]="#"+jsPanel.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e;}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,n="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let o=e.indexOf(")");(t=e.slice(0,o+1).replace(/\s+/g,"")).startsWith("var")&&(t=jsPanel.getCssVariableValue(t)),n=e.slice(o+1,e.length).trim();}else if(e.match(/^(#|\w|--)/)){let o=e.indexOf(" ");o>0?(t=e.slice(0,o+1).replace(/\s+/g,""),n=e.slice(o+1,e.length).trim()):t=e,t.startsWith("--")&&(t=jsPanel.getCssVariableValue(t));}if(t.match(/^([\da-f]{3}|[\da-f]{6})$/gi)&&(t="#"+t),n.startsWith("fillcolor")){let e=n.indexOf(" ");n=(n=n.slice(e+1,n.length).trim().replace(/\s+/g,"")).match(/^([\da-f]{3}|[\da-f]{6})$/gi)?"#"+n:jsPanel.colorNames[n]?"#"+jsPanel.colorNames[n]:n.match(/^(--|var)/)?jsPanel.getCssVariableValue(n):"#fff";}return {color:t,colors:!1,filling:n}},color(e){let t,n,o,a,r,s,l,i,d,c=e.toLowerCase(),p={};const h=/^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3}),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,f=/^hsla?\((\d{1,3}),(\d{1,3}%),(\d{1,3}%),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,u=this.colorNames;return u[c]&&(c=u[c]),null!==c.match(/^#?([\da-f]{3}|[\da-f]{6})$/gi)?((c=c.replace("#","")).length%2==1?(t=c.slice(0,1).repeat(2),n=c.slice(1,2).repeat(2),o=c.slice(2,3).repeat(2),p.rgb={r:parseInt(t,16),g:parseInt(n,16),b:parseInt(o,16)},p.hex=`#${t}${n}${o}`):(p.rgb={r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16)},p.hex=`#${c}`),d=this.rgbToHsl(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl=d,p.rgb.css=`rgb(${p.rgb.r},${p.rgb.g},${p.rgb.b})`):c.match(h)?(l=h.exec(c),p.rgb={css:c,r:l[1],g:l[2],b:l[3]},p.hex=this.rgbToHex(l[1],l[2],l[3]),d=this.rgbToHsl(l[1],l[2],l[3]),p.hsl=d):c.match(f)?(a=(l=f.exec(c))[1]/360,r=l[2].slice(0,l[2].length-1)/100,s=l[3].slice(0,l[3].length-1)/100,i=this.hslToRgb(a,r,s),p.rgb={css:`rgb(${i[0]},${i[1]},${i[2]})`,r:i[0],g:i[1],b:i[2]},p.hex=this.rgbToHex(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl={css:`hsl(${l[1]},${l[2]},${l[3]})`,h:l[1],s:l[2],l:l[3]}):(p.hex="#f5f5f5",p.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},p.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),p},calcColors(e){const t=this.colorBrightnessThreshold,n=this.color(e),o=this.lighten(e,this.colorFilledLight),a=this.darken(e,this.colorFilled),r=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",s=this.perceivedBrightness(o)<=t?"#ffffff":"#000000",l=this.perceivedBrightness(a)<=t?"#ffffff":"#000000",i=this.lighten(e,this.colorFilledDark),d=this.perceivedBrightness(i)<=t?"#ffffff":"#000000";return [n.hsl.css,o,a,r,s,l,i,d]},darken(e,t){const n=this.color(e).hsl,o=parseFloat(n.l),a=Math.round(o-o*t)+"%";return `hsl(${n.h},${n.s},${a})`},lighten(e,t){const n=this.color(e).hsl,o=parseFloat(n.l),a=Math.round(o+(100-o)*t)+"%";return `hsl(${n.h},${n.s},${a})`},hslToRgb(e,t,n){let o,a,r;if(0===t)o=a=r=n;else {let s=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),l=n<.5?n*(1+t):n+t-n*t,i=2*n-l;o=s(i,l,e+1/3),a=s(i,l,e),r=s(i,l,e-1/3);}return [Math.round(255*o),Math.round(255*a),Math.round(255*r)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let o,a,r=Math.max(e,t,n),s=Math.min(e,t,n),l=(r+s)/2;if(r===s)o=a=0;else {let i=r-s;switch(a=l>.5?i/(2-r-s):i/(r+s),r){case e:o=(t-n)/i+(te.match(/^(down|right|up|left)$/i));o.length&&(t.autoposition=o[0],n.splice(n.indexOf(o[0]),1));let a=n.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));a.length?(t.my=a[0],t.at=a[1]||a[0],n.splice(n.indexOf(a[0]),1),a[1]&&n.splice(n.indexOf(a[1]),1)):(t.my="center",t.at="center");let r=n.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return r.length&&(t.offsetX=r[0].match(/^[+-]?\d*\.?\d+$/i)?`${r[0]}px`:r[0],r[1]?t.offsetY=r[1].match(/^[+-]?\d*\.?\d+$/i)?`${r[1]}px`:r[1]:t.offsetY=t.offsetX,n.splice(n.indexOf(r[0]),1),r[1]&&n.splice(n.indexOf(r[1]),1)),n.length&&(t.of=n.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e));}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,o=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),r="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},s="window"===n?{x:1,y:1}:{x:r.width/n.offsetWidth,y:r.height/n.offsetHeight},l="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let i;r.width-=(parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))*s.x,r.height-=(parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth))*s.y,i=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():r;let d=this.getScrollbarWidth(document.body),c=this.getScrollbarWidth(e.parentElement),p="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width/2+"px":r.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width+"px":r.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width/2+"px":-o.width/2+"px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-(o.width-i.width)/2+"px":r.width/2-o.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+(i.width-o.width/2)+"px":r.width-o.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width+"px":-o.width+"px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width+i.width/2+"px":r.width/2-o.width+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width-o.width+"px":r.width-o.width+"px","window"!==n&&(p=parseFloat(p)-c.y+"px")));let h="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+"px":"0px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+i.height/2+"px":r.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+i.height+"px":r.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+"px":-o.height/2+"px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+i.height/2+"px":r.height/2-o.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+i.height+"px":r.height-o.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+"px":-o.height+"px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+i.height/2+"px":r.height/2-o.height+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+i.height+"px":r.height-o.height+"px",h="window"!==n?parseFloat(h)-c.x+"px":parseFloat(h)-d.x+"px")),e.style.left=1===s.x?p:parseFloat(p)/s.x+"px",e.style.top=1===s.y?h:parseFloat(h)/s.y+"px";let f=getComputedStyle(e),u={left:f.left,top:f.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(u=this.applyPositionAutopos(e,u,t)),(t.offsetX||t.offsetY)&&(u=this.applyPositionOffset(e,u,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(u=this.applyPositionMinMax(e,u,t)),t.modify&&(u=this.applyPositionModify(e,u,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,n){const o=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(o);const a=Array.prototype.slice.call(document.querySelectorAll(`.${o}`)),r=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":a.forEach((e,n)=>{n>0&&n<=r&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px");});break;case"up":a.forEach((e,n)=>{n>0&&n<=r&&(t.top=parseFloat(t.top)-a[--n].getBoundingClientRect().height-jsPanel.autopositionSpacing+"px");});break;case"right":a.forEach((e,n)=>{n>0&&n<=r&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px");});break;case"left":a.forEach((e,n)=>{n>0&&n<=r&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width-jsPanel.autopositionSpacing+"px");});}e.style.left=t.left,e.style.top=t.top;}return {left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px";}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const o=getComputedStyle(e);return {left:o.left,top:o.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`));}),n.minLeft){e.style.left=n.minLeft;let o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=o;}if(n.maxTop){e.style.top=n.maxTop;let o=getComputedStyle(e).top;parseFloat(o)>parseFloat(t.top)?e.style.top=t.top:t.top=o;}const o=getComputedStyle(e);return {left:o.left,top:o.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?`${o.left}px`:o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?`${o.top}px`:o.top;}const o=getComputedStyle(e);return {left:o.left,top:o.top}},autopositionRemaining(e){let t,n=e.options.container;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n);}),t){("window"===n?document.body:"string"==typeof n?document.querySelector(n):n).querySelectorAll(`.${t}`).forEach(e=>e.reposition());}},getThemeDetails(e){const t=this.pOtheme(e);if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),n=document.createElement("button");n.className="btn btn"+t.color.slice(e),document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0;}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(n=>e.querySelector(n).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000";}return e},applyCustomTheme(e,t){let n={bgPanel:"#ffffff",bgContent:"#ffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},o="object"==typeof t?Object.assign(n,t):n,a=o.bgPanel,r=o.bgContent,s=o.colorHeader,l=o.colorContent,i=o.bgFooter,d=o.colorFooter;return this.colorNames[a]?e.style.background="#"+this.colorNames[a]:e.style.background=this.getCssVariableValue(a),this.colorNames[s]&&(s="#"+this.colorNames[s]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(s)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(s)),this.colorNames[r]?e.content.style.background="#"+this.colorNames[r]:e.content.style.background=this.getCssVariableValue(r),this.colorNames[l]?e.content.style.color="#"+this.colorNames[l]:e.content.style.color=this.getCssVariableValue(l),this.perceivedBrightness(s)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(l)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[i]?e.footer.style.background="#"+this.colorNames[i]:e.footer.style.background=this.getCssVariableValue(i),this.colorNames[d]?e.footer.style.color="#"+this.colorNames[d]:e.footer.style.color=this.getCssVariableValue(d),o.border&&e.setBorder(o.border),o.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(o.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return {y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return {y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[n,o]of Object.entries(t))e.style[n]="string"==typeof o?jsPanel.getCssVariableValue(o):o;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const o=document.createElement("script");o.src=e,o.type=t,document.head.appendChild(o),n&&(o.onload=n);}},ajax(e,t){let n,o,a=new XMLHttpRequest;const r={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=jsPanel.strToHtml(this.responseText);n.urlSelector&&(e=e.querySelector(n.urlSelector)),t.contentRemove(),t.content.append(e);}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)n=Object.assign({},r,{url:e});else {if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the url parameter!";jsPanel.errorpanel(e);}return}(n=Object.assign({},r,e)).url=e.url,!1===n.async&&(n.timeout=0,n.withCredentials&&(n.withCredentials=void 0),n.responseType&&(n.responseType=void 0));}o=n.url.trim().split(/\s+/),n.url=encodeURI(o[0]),o.length>1&&(o.shift(),n.urlSelector=o.join(" ")),a.onreadystatechange=(()=>{4===a.readyState&&(200===a.status?t?n.done.call(a,a,t):n.done.call(a,a):n.fail&&(t?n.fail.call(a,a,t):n.fail.call(a,a)),n.always&&(t?n.always.call(a,a,t):n.always.call(a,a)),t&&(n.autoresize||n.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,n),jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(a,a,t):e.call(a,a);}));}),a.open(n.method,n.url,n.async,n.user,n.pwd),a.timeout=n.timeout||0,n.withCredentials&&(a.withCredentials=n.withCredentials),n.responseType&&(a.responseType=n.responseType),n.beforeSend&&(t?n.beforeSend.call(a,a,t):n.beforeSend.call(a,a)),n.data?a.send(n.data):a.send(null);},fetch(e,t){let n;const o={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let n=jsPanel.strToHtml(e);t.contentRemove(),t.content.append(n);}}};if(t&&"string"==typeof e)n=Object.assign({},o,{resource:encodeURI(e)});else {if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the resource parameter!";jsPanel.errorpanel(e);}return}(n=Object.assign({},o,e)).resource=encodeURI(e.resource);}const a=n.fetchInit||{};n.beforeSend&&(t?n.beforeSend.call(e,e,t):n.beforeSend.call(e,e)),fetch(n.resource,a).then(e=>{if(e.ok)return e[n.bodyMethod]()}).then(e=>{t?n.done.call(e,e,t):n.done.call(e,e),t&&(n.autoresize||n.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,n);});},ajaxAutoresizeAutoreposition(e,t){const n=e.options.contentSize;if("string"==typeof n&&n.match(/auto/i)){const o=n.split(" "),a=Object.assign({},{width:o[0],height:o[1]});t.autoresize&&e.resize(a),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}else if("object"==typeof n&&("auto"===n.width||"auto"===n.height)){const o=Object.assign({},n);t.autoresize&&e.resize(o),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled");}),t.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,n){const o=document.createElement("div"),a=e.parentElement;o.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(o);},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e));},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t]);},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,n="some",o,a){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,o,a));t.forEach(t=>t.call(e,e,o,a));},resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=jsPanel.zi.next());},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e}

`});},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID ${e.id} already exists in the document.`;jsPanel.errorpanel(t);}return !1}let o=this.pOcontainer(e.container);if("object"==typeof o&&o.length&&o.length>0&&(o=o[0]),!o){if(this.errorReporting){let e="◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist";jsPanel.errorpanel(e);}return !1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[];});const a=e.template||this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.progressbar=a.autocloseProgressbar=a.querySelector(".jsPanel-progressbar");const r=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),s=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),i=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[r,s,l,i,d,c,p,h,f,u,m,g,b,y].forEach(e=>e.panel=a);const j=a.querySelector(".jsPanel-btn-close"),E=a.querySelector(".jsPanel-btn-maximize"),x=a.querySelector(".jsPanel-btn-normalize"),C=a.querySelector(".jsPanel-btn-smallify"),P=a.querySelector(".jsPanel-btn-minimize");j&&jsPanel.pointerup.forEach(e=>{j.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify();});}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.minimize();});});let F=jsPanel.extensions;for(let e in F)Object.prototype.hasOwnProperty.call(F,e)&&(a[e]=F[e]);if(a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length||(t[2]=a.style.backgroundColor),t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=jsPanel.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.options.header?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.options.footerToolbar?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,n)=>{let o;if("minimized"===a.status&&(o=!0,a.normalize()),jsPanel.clearTheme(a),"object"==typeof t)e.border=void 0,jsPanel.applyCustomTheme(a,t);else if("string"==typeof t){"none"===t&&(t="white");let e=jsPanel.getThemeDetails(t);jsPanel.applyColorTheme(a,e);}return o&&a.minimize(),n&&n.call(a,a),a}),a.remove=((e,t,n)=>{a.parentElement.removeChild(a),document.getElementById(e)?n&&n.call(a,e,a):(a.removeMinimizedReplacement(),a.status="closed",t&&document.dispatchEvent(v),document.dispatchEvent(w),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),n&&n.call(e,e)),window.removeEventListener("resize",a.windowResizeHandler),document.removeEventListener("jspanelresize",a.parentResizeHandler);}),a.close=((e,t)=>{if(a.parentElement){if(a.closetimer&&window.clearInterval(a.closetimer),document.dispatchEvent(y),a.statusBefore=a.status,a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",n=>{n.stopPropagation(),a.remove(a.id,t,e);})):a.remove(a.id,t,e);}}),a.maximize=((t,n)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(d);const o=a.parentElement,r=jsPanel.pOcontainment(e.maximizedMargin);return o===document.body?(a.style.width=document.documentElement.clientWidth-r[1]-r[3]+"px",a.style.height=document.documentElement.clientHeight-r[0]-r[2]+"px",a.style.left=r[3]+"px",a.style.top=r[0]+"px"):(a.style.width=o.clientWidth-r[1]-r[3]+"px",a.style.height=o.clientHeight-r[0]-r[2]+"px",a.style.left=r[3]+"px",a.style.top=r[0]+"px"),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),n||a.front(),document.dispatchEvent(c),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e);}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,n,o,r=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(r);break;case"parentpanel":(t=(o=(n=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[o.length-1]).append(r);break;case"parent":(t=(n=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(r);break;default:document.querySelector(e.minimizeTo).append(r);}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(l),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const n=window.getComputedStyle(a),o=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",C.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const r=a.querySelectorAll(".jsPanel-minimized-box");return r[r.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(g),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),C.style.transform="rotate(0deg)";const n=a.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore);}return a}),a.front=((t,n=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else {const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi();}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&n&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){let e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),n=a.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2]);}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`);}t||(a.snapped=a.snappableTo);}),a.move=((e,t)=>{let n=a.overlaps(e,"paddingbox"),o=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=n.left+"px",a.style.top=n.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,o),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,o)=>{e.call(t,t,n,o);}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(a,a,n),!!t&&n}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(a.headertitle).color,o=window.getComputedStyle(a),r=e.iconfont,s=t.querySelector(".jsPanel-controlbar");return "auto-show-hide"!==a.options.header?jsPanel.setStyles(t,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,s.style.color=n,s.querySelectorAll("button").forEach(e=>e.style.color=n),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e);}),a.setIconfont(r,t),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}):s.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}):s.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}):s.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e);}),a.drag=((e={})=>{let t,n,o;const r=new CustomEvent("jspaneldragstart",{detail:a.id}),s=new CustomEvent("jspaneldrag",{detail:a.id}),l=new CustomEvent("jspaneldragstop",{detail:a.id});[r,s,l].forEach(e=>e.panel=a);const i=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1);}),"snap"+t.join("")};function d(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,n,!1),a.style.opacity=1;});}let c=e.handles||jsPanel.defaults.dragit.handles,p=e.cursor||jsPanel.defaults.dragit.cursor;function h(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,n)),jsPanel.removeSnapAreas(),t){if(a.style.opacity=1,t=void 0,o.snap){switch(a.snappableTo){case"left-top":a.snap(o.snap.snapLeftTop);break;case"center-top":a.snap(o.snap.snapCenterTop);break;case"right-top":a.snap(o.snap.snapRightTop);break;case"right-center":a.snap(o.snap.snapRightCenter);break;case"right-bottom":a.snap(o.snap.snapRightBottom);break;case"center-bottom":a.snap(o.snap.snapCenterBottom);break;case"left-bottom":a.snap(o.snap.snapLeftBottom);break;case"left-center":a.snap(o.snap.snapLeftCenter);}o.snap.callback&&a.snappableTo&&"function"==typeof o.snap.callback&&(o.snap.callback.call(a,a),o.snap.repositionOnSnap&&!1!==o.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo)),a.snappableTo&&o.snap.repositionOnSnap&&o.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo);}if(a.droppableTo&&a.droppableTo){let e=a.parentElement;a.move(a.droppableTo),o.drop.callback&&o.drop.callback.call(a,a,a.droppableTo,e);}if(document.dispatchEvent(l),o.stop.length){let t=window.getComputedStyle(a),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,o.stop,!1,n,e);}a.saveCurrentPosition(),a.calcSizeFactors();}a.controlbar.style.pointerEvents="inherit",a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,h);}return a.querySelectorAll(c).forEach(l=>{l.style.touchAction="none",l.style.cursor=p,jsPanel.pointerdown.forEach(i=>{l.addEventListener(i,l=>{if(l.button&&l.button>0)return !1;if((o=Object.assign({},jsPanel.defaults.dragit,e)).disableOnMaximized&&"maximized"===a.status)return !1;if((o.containment||0===o.containment)&&(o.containment=jsPanel.pOcontainment(o.containment)),o.grid&&Array.isArray(o.grid)&&1===o.grid.length&&(o.grid[1]=o.grid[0]),o.snap&&("object"==typeof o.snap?o.snap=Object.assign({},jsPanel.defaultSnapConfig,o.snap):o.snap=jsPanel.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;a.controlbar.style.pointerEvents="none",a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let i=window.getComputedStyle(a),c=parseFloat(i.left),p=parseFloat(i.top),h=parseFloat(i.width),f=parseFloat(i.height),u=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,g=a.parentElement,b=g.getBoundingClientRect(),y=window.getComputedStyle(g),w=a.getScaleFactor(),v=0,j=jsPanel.getScrollbarWidth(g);n=(e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(r),a.style.opacity=o.opacity,a.snapped&&o.snap.resizeToPreSnap&&a.currentData.beforeSnap){a.resize(a.currentData.beforeSnap.width+" "+a.currentData.beforeSnap.height),a.setControls([".jsPanel-btn-normalize"]);let e=a.getBoundingClientRect(),t=u-(e.left+e.width),n=e.width/2;t>-n&&(v=t+n);}if(a.front(),a.snapped=!1,"maximized"===a.status&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized"),o.drop&&o.drop.dropZones){let e=o.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e);}):t.push(e);}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),o.drop.dropZones=t;}o.start.length&&jsPanel.processCallbacks(a,o.start,!1,{left:c,top:p,width:h,height:f},e);}let n,l,i,d,E,x,C,P,F,z;t=1;let S,A=e.touches?e.touches[0].clientX:e.clientX,k=e.touches?e.touches[0].clientY:e.clientY,B=window.getComputedStyle(a);if(g===document.body){let e=a.getBoundingClientRect();F=window.innerWidth-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(e.left+e.width),z=window.innerHeight-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(e.top+e.height);}else F=parseInt(y.width,10)-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(parseInt(B.left,10)+parseInt(B.width,10)),z=parseInt(y.height,10)-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(parseInt(B.top,10)+parseInt(B.height,10));n=parseFloat(B.left),i=parseFloat(B.top),E=F,C=z,o.snap&&("panel"===o.snap.trigger?(l=n**2,d=i**2,x=E**2,P=C**2):"pointer"===o.snap.trigger&&("window"===a.options.container?(n=A,l=A**2,d=(i=k)**2,x=(E=window.innerWidth-A)**2,P=(C=window.innerHeight-k)**2):(n=(S=a.overlaps(g,"paddingbox",e)).pointer.left,i=S.pointer.top,E=S.pointer.right,C=S.pointer.bottom,l=S.pointer.left**2,d=S.pointer.top**2,x=S.pointer.right**2,P=S.pointer.bottom**2)));let T=Math.sqrt(l+d),L=Math.sqrt(l+P),R=Math.sqrt(x+d),W=Math.sqrt(x+P),D=Math.abs(n-E)/2,$=Math.abs(i-C)/2,q=Math.sqrt(l+$**2),O=Math.sqrt(d+D**2),H=Math.sqrt(x+$**2),M=Math.sqrt(P+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(s),o.axis&&"x"!==o.axis||(a.style.left=c+(A-u)/w.x+v+"px"),o.axis&&"y"!==o.axis||(a.style.top=p+(k-m)/w.y+"px"),o.grid){let e=o.grid,t=o.axis,n=e[0]*Math.round((c+(A-u))/e[0]),r=e[1]*Math.round((p+(k-m))/e[1]);t&&"x"!==t||(a.style.left=`${n}px`),t&&"y"!==t||(a.style.top=`${r}px`);}if(o.containment||0===o.containment){let e,t,n=o.containment;if("window"===a.options.container)e=window.innerWidth-parseFloat(B.width)-n[1]-j.y,t=window.innerHeight-parseFloat(B.height)-n[2]-j.x;else {let o=parseFloat(y.borderLeftWidth)+parseFloat(y.borderRightWidth),a=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth);e=b.width/w.x-parseFloat(B.width)-n[1]-o-j.y,t=b.height/w.y-parseFloat(B.height)-n[2]-a-j.x;}parseFloat(a.style.left)<=n[3]&&(a.style.left=n[3]+"px"),parseFloat(a.style.top)<=n[0]&&(a.style.top=n[0]+"px"),parseFloat(a.style.left)>=e&&(a.style.left=e+"px"),parseFloat(a.style.top)>=t&&(a.style.top=t+"px");}if(o.drag.length){let t={left:n,top:i,right:E,bottom:C,width:parseFloat(B.width),height:parseFloat(B.height)};jsPanel.processCallbacks(a,o.drag,!1,t,e);}if(o.snap){let e=o.snap.sensitivity,t=g===document.body?window.innerWidth/8:b.width/8,r=g===document.body?window.innerHeight/8:b.height/8;a.snappableTo=!1,jsPanel.removeSnapAreas(),T0&&S.pointer.top>0?(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e))):L0&&S.pointer.bottom>0?(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e))):R0&&S.pointer.top>0?(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e))):W0&&S.pointer.bottom>0?(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e))):i0?(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e))):n0?(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e))):E0?(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e))):C0?(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)));}if(o.drop&&o.drop.dropZones){let t=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",n=document[t](e.clientX,e.clientY);Array.isArray(n)||(n=Array.prototype.slice.call(n)),o.drop.dropZones.forEach(e=>{n.includes(e)&&(a.droppableTo=e);}),n.includes(a.droppableTo)||(a.droppableTo=!1);}}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,n)),window.addEventListener("mouseout",d,!1);});}),jsPanel.pointerup.forEach(e=>{document.addEventListener(e,h),window.removeEventListener("mouseout",d);}),e.disable&&(l.style.pointerEvents="none");}),a}),a.dragit=(t=>{const n=Object.assign({},jsPanel.defaults.dragit,e.dragit),o=a.querySelectorAll(n.handles);return "disable"===t?o.forEach(e=>e.style.pointerEvents="none"):o.forEach(e=>e.style.pointerEvents="auto"),a}),a.sizeit=((e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:a.id}),n=new CustomEvent("jspanelresize",{detail:a.id}),o=new CustomEvent("jspanelresizestop",{detail:a.id});[t,n,o].forEach(e=>e.panel=a);let r,s,l,i,d,c,p={};p.handles=e.handles||jsPanel.defaults.resizeit.handles,p.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,a.append(t);});let h=!!e.aspectRatio&&e.aspectRatio;function f(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>document.removeEventListener(e,r,!1));}function u(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,r,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,n,o=e.target.className;if(o.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),o.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(n=!0),p.grid&&Array.isArray(p.grid)){1===p.grid.length&&(p.grid[1]=p.grid[0]);const e=parseFloat(a.style.width),o=parseFloat(a.style.height),r=e%p.grid[0],s=o%p.grid[1],l=parseFloat(a.style.left),i=parseFloat(a.style.top),d=l%p.grid[0],c=i%p.grid[1];rc+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(o),p.stop.length){let t=window.getComputedStyle(a),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,p.stop,!1,n,e);}}a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),p.aspectRatio=h,document.removeEventListener(e,u);}return a.querySelectorAll(".jsPanel-resizeit-handle").forEach(o=>{o.style.touchAction="none",jsPanel.pointerdown.forEach(h=>{o.addEventListener(h,o=>{if(o.preventDefault(),o.stopPropagation(),o.button&&o.button>0)return !1;let h=1;if(((p=Object.assign({},jsPanel.defaults.resizeit,e)).containment||0===p.containment)&&(p.containment=jsPanel.pOcontainment(p.containment)),p.aspectRatio&&!0===p.aspectRatio&&(p.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;e.altKey?p.aspectRatio="content":e.ctrlKey?p.aspectRatio="panel":e.shiftKey&&(p.aspectRatio=!1,h=2);}let u="function"==typeof p.maxWidth?p.maxWidth():p.maxWidth||1e4,m="function"==typeof p.maxHeight?p.maxHeight():p.maxHeight||1e4,g="function"==typeof p.minWidth?p.minWidth():p.minWidth,b="function"==typeof p.minHeight?p.minHeight():p.minHeight;a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const y=a.parentElement,w=y.tagName.toLowerCase(),v=a.getBoundingClientRect(),j=y.getBoundingClientRect(),E=window.getComputedStyle(y,null),x=parseInt(E.borderLeftWidth,10),C=parseInt(E.borderTopWidth,10),P=E.getPropertyValue("position"),F=o.clientX||0===o.clientX||o.touches[0].clientX,z=o.clientY||0===o.clientY||o.touches[0].clientY,S=F/z,A=o.target.classList,k=a.getScaleFactor(),B=v.width/v.height,T=a.content.getBoundingClientRect(),L=T.width/T.height,R=a.header.getBoundingClientRect().height,W=a.footer.getBoundingClientRect().height||0;let D=v.left,$=v.top,q=1e4,O=1e4,H=1e4,M=1e4;d=v.width,c=v.height,"body"!==w&&(D=v.left-j.left+y.scrollLeft,$=v.top-j.top+y.scrollTop),"body"===w&&p.containment?(q=document.documentElement.clientWidth-v.left,H=document.documentElement.clientHeight-v.top,O=v.width+v.left,M=v.height+v.top):p.containment&&("static"===P?(q=j.width-v.left+x,H=j.height+j.top-v.top+C,O=v.width+(v.left-j.left)-x,M=v.height+(v.top-j.top)-C):(q=y.clientWidth-(v.left-j.left)/k.x+x,H=y.clientHeight-(v.top-j.top)/k.y+C,O=(v.width+v.left-j.left)/k.x-x,M=a.clientHeight+(v.top-j.top)/k.y-C)),p.containment&&(O-=p.containment[3],M-=p.containment[0],q-=p.containment[1],H-=p.containment[2]);const I=window.getComputedStyle(a),N=parseFloat(I.width)-v.width,V=parseFloat(I.height)-v.height;let X=parseFloat(I.left)-v.left,Y=parseFloat(I.top)-v.top;y!==document.body&&(X+=j.left,Y+=j.top);let Z=parseInt(I.borderTopWidth,10),U=parseInt(I.borderRightWidth,10),K=parseInt(I.borderBottomWidth,10),_=parseInt(I.borderLeftWidth,10);r=(e=>{e.preventDefault(),s||(document.dispatchEvent(t),p.start.length&&jsPanel.processCallbacks(a,p.start,!1,{width:d,height:c,left:D,top:$},e),a.front(),"maximized"===a.status&&(a.status="normalized",a.controlbar.querySelector(".jsPanel-btn-maximize")&&a.setControlStatus("maximize","show"),a.controlbar.querySelector(".jsPanel-btn-normalize")&&a.setControlStatus("normalize","hide")),v.height>c+5&&(a.status="normalized",a.setControls([".jsPanel-btn-normalize"]))),s=1,document.dispatchEvent(n);let r=e.touches?e.touches[0].clientX:e.clientX,f=e.touches?e.touches[0].clientY:e.clientY;A.contains("jsPanel-resizeit-e")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),"content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-s")?((i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-w")?((l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-n")?((i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-se")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-sw")?((i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),p.aspectRatio&&(a.style.width=i*B+"px"),(l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-ne")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(p.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(f=(r=f*S)/S),(l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?a.style.width=(i-R-W-Z-K)*L+Z+K+"px":"panel"===p.aspectRatio&&(a.style.width=i*B+"px")),window.getSelection().removeAllRanges();const w=window.getComputedStyle(a),j={left:parseFloat(w.left),top:parseFloat(w.top),right:parseFloat(w.right),bottom:parseFloat(w.bottom),width:parseFloat(w.width),height:parseFloat(w.height)};p.resize.length&&jsPanel.processCallbacks(a,p.resize,!1,j,e);}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,r,!1)),window.addEventListener("mouseout",f,!1);});}),jsPanel.pointerup.forEach(function(e){document.addEventListener(e,u),window.removeEventListener("mouseout",f);}),e.disable&&(o.style.pointerEvents="none");}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return "disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return {x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height));}}),a.saveCurrentDimensions=(()=>{const e=window.getComputedStyle(a);a.currentData.width=e.width,a.currentData.height=e.height;}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top;}),a.reposition=((...t)=>{let n,o=e.position,r=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?o=e:"boolean"==typeof e?r=e:"function"==typeof e&&(n=e);}),jsPanel.position(a,o),a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),r&&a.saveCurrentPosition(),n&&n.call(a,a),a}),a.repositionOnSnap=(t=>{let n="0",o="0",r=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=r[3],o=r[0];break;case"right-top":n=-r[1],o=r[0];break;case"right-bottom":n=-r[1],o=-r[2];break;case"left-bottom":n=r[3],o=-r[2];break;case"center-top":n=r[3]/2-r[1]/2,o=r[0];break;case"center-bottom":n=r[3]/2-r[1]/2,o=-r[2];break;case"left-center":n=r[3],o=r[0]/2-r[2]/2;break;case"right-center":n=-r[1],o=r[0]/2-r[2]/2;}jsPanel.position(a,t),jsPanel.setStyles(a,{left:`calc(${a.style.left} + ${n}px)`,top:`calc(${a.style.top} + ${o}px)`});}),a.overlaps=((e,t,n)=>{let o,r=a.getBoundingClientRect(),s=getComputedStyle(a.parentElement),l=a.getScaleFactor(),i={top:0,right:0,bottom:0,left:0},d=0,c=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(i.top=parseInt(s.borderTopWidth,10)*l.y,i.right=parseInt(s.borderRightWidth,10)*l.x,i.bottom=parseInt(s.borderBottomWidth,10)*l.y,i.left=parseInt(s.borderLeftWidth,10)*l.x),o="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(d=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,p=d-o.left,h=c-o.top);let f=r.lefto.left,u=r.topo.top;return {overlaps:f&&u,top:r.top-o.top-i.top,right:o.right-r.right-i.right,bottom:o.bottom-r.bottom-i.bottom,left:r.left-o.left-i.left,parentBorderWidth:i,panelRect:r,referenceRect:o,pointer:{clientX:d,clientY:c,left:p-i.left,top:h-i.top,right:o.width-p-i.right,bottom:o.height-h-i.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height;}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%";}return a}),a.resize=((...e)=>{let t,n=window.getComputedStyle(a),o={width:n.width,height:n.height},r=!0;e.forEach(e=>{"string"==typeof e?o=e:"object"==typeof e?o=Object.assign(o,e):"boolean"==typeof e?r=e:"function"==typeof e&&(t=e);});let s=jsPanel.pOsize(a,o);a.style.width=s.width,a.style.height=s.height,a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),r&&a.saveCurrentDimensions(),a.status="normalized";let l=a.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.windowResizeHandler=(t=>{if(t.target===window){let n,o,r=a.status,s=e.onwindowresize;if("maximized"===r&&s)a.maximize(!1,!0);else if(a.snapped&&"minimized"!==r)a.snap(a.snapped,!0);else if("normalized"===r||"smallified"===r||"maximized"===r){let e=typeof s;"boolean"===e?(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px"):"function"===e?s.call(a,t,a):"object"===e&&(!0===s.preset?(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px",s.callback.call(a,t,a)):s.callback.call(a,t,a));}else "smallifiedmax"===r&&s&&a.maximize(!1,!0).smallify();a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition());}}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${n}`)&&(e.style.display="block");}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none");}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",n)=>{const o=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),o.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(o.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(o),a.setAttribute(`data-btn${e}`,"removed");}return n&&n.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`);}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem");}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>a.addControl(e));}let n=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z\d]{3,}/i)[0].substring(12);n.push(t);});const o=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=o,n.forEach(e=>{o[e]&&a.setControlStatus(e,o[e]);}),a.setControlSize(o.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let n=[a.headerlogo],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?n.forEach(t=>t.innerHTML=e):n.forEach(t=>{jsPanel.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n);}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false");}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>a.setAttribute(`data-btn${e}`,"removed")),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let n=[a.headertitle],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>t.innerHTML=e):"function"==typeof e?n.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e();}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),t&&t.call(a,a),a}),a.setIconfont=((e,t=a,n)=>{if(e){let n,o;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],o=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else {if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"];}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>jsPanel.emptyNode(e).innerHTML=""),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=n[a],"material-icons"===e&&(t.textContent=o[a]);});}return n&&n.call(t,t),t}),a.addToolbar=((e,t,n)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t);});else if("function"==typeof t){let n=t.call(a,a);"string"==typeof n?e.innerHTML=n:e.append(n);}else e.append(t);return e.classList.add("active"),n&&n.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault());}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const n=a.controlbar.querySelectorAll(".jsPanel-btn").length;let o=document.createElement("button");o.innerHTML=t.html,o.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,o.style.color=a.header.style.color,t.position>n?a.controlbar.append(o):a.controlbar.insertBefore(o,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const r=t.ariaLabel||t.name;return r&&o.setAttribute("aria-label",r),jsPanel.pointerup.forEach(e=>{o.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;t.handler.call(a,a,o);});}),t.afterInsert&&t.afterInsert.call(o,o),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang);});}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),o.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px";});break;case"xs":e.forEach(e=>{e.style.height="26px";});break;case"sm":e.forEach(e=>{e.style.height="30px";});break;case"lg":e.forEach(e=>{e.style.height="38px";});break;case"xl":e.forEach(e=>{e.style.height="42px";});}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t);}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t);});}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.css)for(const[t,n]of Object.entries(e.css))if("panel"===t)a.className+=` ${n}`;else {let e=a.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${n}`);}if(e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,a),e.contentFetch&&this.fetch(e.contentFetch,a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1]);}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=a.progressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),a.progressbar.classList.remove("active"),a.close();}),t.progressbar&&(a.progressbar.classList.add("active"),t.background?jsPanel.colorNames[t.background]?a.progressbar.style.background="#"+jsPanel.colorNames[t.background]:a.progressbar.style.background=t.background:a.progressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`;}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(i),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn);}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t);}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[];}),a.drag(e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors();},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[];}),a.sizeit(e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status);},!1),a.addEventListener("jspanelresizestop",n=>{n.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors());},!1);}if(a.saveCurrentDimensions(),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front();},!1);}),e.onwindowresize&&"window"===a.options.container&&window.addEventListener("resize",a.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,n=typeof t,o=a.isChildpanel();if(o){const e=o.content;let r=[];a.parentResizeHandler=(s=>{if(s.panel===o){r[0]=e.offsetWidth,r[1]=e.offsetHeight;let o,s,l=a.status;"maximized"===l&&t?a.maximize():a.snapped&&"minimized"!==l?a.snap(a.snapped,!0):"normalized"===l||"smallified"===l||"maximized"===l?"function"===n?t.call(a,a,{width:r[0],height:r[1]}):"object"===n&&!0===t.preset?(o=(r[0]-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",s=(r[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px",t.callback.call(a,a,{width:r[0],height:r[1]})):"boolean"===n&&(o=(r[0]-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",s=(r[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px"):"smallifiedmax"===l&&t&&a.maximize().smallify();}}),document.addEventListener("jspanelresize",a.parentResizeHandler,!1);}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(a,a)):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(a,a)):e.callback.call(a,a)),t&&(Array.isArray(t)?t.forEach(e=>e.call(a,a)):t.call(a,a)),document.dispatchEvent(r),a}}; - /* src/JsPanel.svelte generated by Svelte v3.52.0 */ + /* src/JsPanel.svelte generated by Svelte v3.59.2 */ const get_footerToolbar_slot_changes = dirty => ({}); const get_footerToolbar_slot_context = ctx => ({}); const get_content_slot_changes = dirty => ({}); diff --git a/dist/index.mjs b/dist/index.mjs index a8367a0..8b3743f 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -83,7 +83,9 @@ function insert(target, node, anchor) { target.insertBefore(node, anchor || null); } function detach(node) { - node.parentNode.removeChild(node); + if (node.parentNode) { + node.parentNode.removeChild(node); + } } function element(name) { return document.createElement(name); @@ -98,7 +100,7 @@ function children(element) { return Array.from(element.childNodes); } function set_style(node, key, value, important) { - if (value === null) { + if (value == null) { node.style.removeProperty(key); } else { @@ -113,9 +115,9 @@ function set_current_component(component) { const dirty_components = []; const binding_callbacks = []; -const render_callbacks = []; +let render_callbacks = []; const flush_callbacks = []; -const resolved_promise = Promise.resolve(); +const resolved_promise = /* @__PURE__ */ Promise.resolve(); let update_scheduled = false; function schedule_update() { if (!update_scheduled) { @@ -147,15 +149,29 @@ function add_render_callback(fn) { const seen_callbacks = new Set(); let flushidx = 0; // Do *not* move this inside the flush() function function flush() { + // Do not reenter flush while dirty components are updated, as this can + // result in an infinite loop. Instead, let the inner flush handle it. + // Reentrancy is ok afterwards for bindings etc. + if (flushidx !== 0) { + return; + } const saved_component = current_component; do { // first, call beforeUpdate functions // and update components - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); + try { + while (flushidx < dirty_components.length) { + const component = dirty_components[flushidx]; + flushidx++; + set_current_component(component); + update(component.$$); + } + } + catch (e) { + // reset dirty state to not end up in a deadlocked state and then rethrow + dirty_components.length = 0; + flushidx = 0; + throw e; } set_current_component(null); dirty_components.length = 0; @@ -192,6 +208,16 @@ function update($$) { $$.after_update.forEach(add_render_callback); } } +/** + * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`. + */ +function flush_render_callbacks(fns) { + const filtered = []; + const targets = []; + render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); + targets.forEach((c) => c()); + render_callbacks = filtered; +} const outroing = new Set(); let outros; function transition_in(block, local) { @@ -245,6 +271,7 @@ function mount_component(component, target, anchor, customElement) { function destroy_component(component, detaching) { const $$ = component.$$; if ($$.fragment !== null) { + flush_render_callbacks($$.after_update); run_all($$.on_destroy); $$.fragment && $$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to @@ -351,9 +378,9 @@ class SvelteComponent { } } -let jsPanel={version:"4.16.0",date:"2022-07-03 19:05",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)));},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>document.documentMode||!1)(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&o.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n}),function(){if("function"==typeof window.CustomEvent)return !1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}e.prototype=window.Event.prototype,window.CustomEvent=e;}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return (void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var o=t>0?0|t:0;return this.substring(o,o+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return "";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var o=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+=t.substring(0,o-t.length)}),Number.isInteger=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let o=Object(this),n=o.length>>>0;if(0===n)return !1;let a=0|t,s=Math.max(a>=0?a:n-Math.abs(a),0);for(;sjsPanel.modifier=e),void document.addEventListener("keyup",()=>jsPanel.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"]);},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return !!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return [t,t,t,t];if(Array.isArray(t)){if(1===t.length)return [t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1]);}return t},pOsize(e,t){let o=t||this.defaults.contentSize;const n=e.parentElement;if("string"==typeof o){const e=o.trim().split(" ");(o={}).width=e[0],2===e.length?o.height=e[1]:o.height=e[0];}else o.width&&!o.height?o.height=o.width:o.height&&!o.width&&(o.width=o.height);if(String(o.width).match(/^[0-9.]+$/gi))o.width+="px";else if("string"==typeof o.width&&o.width.endsWith("%"))if(n===document.body)o.width=window.innerWidth*(parseFloat(o.width)/100)+"px";else {const e=window.getComputedStyle(n),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);o.width=(parseFloat(e.width)-t)*(parseFloat(o.width)/100)+"px";}else "function"==typeof o.width&&(o.width=o.width.call(e,e),"number"==typeof o.width?o.width+="px":"string"==typeof o.width&&o.width.match(/^[0-9.]+$/gi)&&(o.width+="px"));if(String(o.height).match(/^[0-9.]+$/gi))o.height+="px";else if("string"==typeof o.height&&o.height.endsWith("%"))if(n===document.body)o.height=window.innerHeight*(parseFloat(o.height)/100)+"px";else {const e=window.getComputedStyle(n),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);o.height=(parseFloat(e.height)-t)*(parseFloat(o.height)/100)+"px";}else "function"==typeof o.height&&(o.height=o.height.call(e,e),"number"==typeof o.height?o.height+="px":"string"==typeof o.height&&o.height.match(/^[0-9.]+$/gi)&&(o.height+="px"));return o},pOborder(e){let t=[],o=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return o.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(o[t]=jsPanel.getCssVariableValue(e));}),o.forEach(e=>{jsPanel.colorNames[e]?t[2]="#"+jsPanel.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e;}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},o=e.toLowerCase(),n=o.match(/xl|lg|md|sm|xs/),a=o.match(/closeonly|none/);return n&&(t.size=n[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,o="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let n=e.indexOf(")");(t=e.slice(0,n+1).replace(/\s+/g,"")).startsWith("var")&&(t=jsPanel.getCssVariableValue(t)),o=e.slice(n+1,e.length).trim();}else if(e.match(/^(#|\w|--)/)){let n=e.indexOf(" ");n>0?(t=e.slice(0,n+1).replace(/\s+/g,""),o=e.slice(n+1,e.length).trim()):t=e,t.startsWith("--")&&(t=jsPanel.getCssVariableValue(t));}if(t.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(t="#"+t),o.startsWith("fillcolor")){let e=o.indexOf(" ");o=(o=o.slice(e+1,o.length).trim().replace(/\s+/g,"")).match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)?"#"+o:jsPanel.colorNames[o]?"#"+jsPanel.colorNames[o]:o.match(/^(--|var)/)?jsPanel.getCssVariableValue(o):"#fff";}return {color:t,colors:!1,filling:o}},color(e){let t,o,n,a,s,r,l,i,c,d=e.toLowerCase(),p={};const h=/^rgba?\(([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3}),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,f=/^hsla?\(([0-9]{1,3}),([0-9]{1,3}%),([0-9]{1,3}%),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,u=this.colorNames;return u[d]&&(d=u[d]),null!==d.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/gi)?((d=d.replace("#","")).length%2==1?(t=d.slice(0,1).repeat(2),o=d.slice(1,2).repeat(2),n=d.slice(2,3).repeat(2),p.rgb={r:parseInt(t,16),g:parseInt(o,16),b:parseInt(n,16)},p.hex=`#${t}${o}${n}`):(p.rgb={r:parseInt(d.slice(0,2),16),g:parseInt(d.slice(2,4),16),b:parseInt(d.slice(4,6),16)},p.hex=`#${d}`),c=this.rgbToHsl(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl=c,p.rgb.css=`rgb(${p.rgb.r},${p.rgb.g},${p.rgb.b})`):d.match(h)?(l=h.exec(d),p.rgb={css:d,r:l[1],g:l[2],b:l[3]},p.hex=this.rgbToHex(l[1],l[2],l[3]),c=this.rgbToHsl(l[1],l[2],l[3]),p.hsl=c):d.match(f)?(a=(l=f.exec(d))[1]/360,s=l[2].slice(0,l[2].length-1)/100,r=l[3].slice(0,l[3].length-1)/100,i=this.hslToRgb(a,s,r),p.rgb={css:`rgb(${i[0]},${i[1]},${i[2]})`,r:i[0],g:i[1],b:i[2]},p.hex=this.rgbToHex(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl={css:`hsl(${l[1]},${l[2]},${l[3]})`,h:l[1],s:l[2],l:l[3]}):(p.hex="#f5f5f5",p.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},p.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),p},calcColors(e){const t=this.colorBrightnessThreshold,o=this.color(e),n=this.lighten(e,this.colorFilledLight),a=this.darken(e,this.colorFilled),s=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",r=this.perceivedBrightness(n)<=t?"#ffffff":"#000000",l=this.perceivedBrightness(a)<=t?"#ffffff":"#000000",i=this.lighten(e,this.colorFilledDark),c=this.perceivedBrightness(i)<=t?"#ffffff":"#000000";return [o.hsl.css,n,a,s,r,l,i,c]},darken(e,t){const o=this.color(e).hsl,n=parseFloat(o.l),a=Math.round(n-n*t)+"%";return `hsl(${o.h},${o.s},${a})`},lighten(e,t){const o=this.color(e).hsl,n=parseFloat(o.l),a=Math.round(n+(100-n)*t)+"%";return `hsl(${o.h},${o.s},${a})`},hslToRgb(e,t,o){let n,a,s;if(0===t)n=a=s=o;else {let r=(e,t,o)=>(o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e),l=o<.5?o*(1+t):o+t-o*t,i=2*o-l;n=r(i,l,e+1/3),a=r(i,l,e),s=r(i,l,e-1/3);}return [Math.round(255*n),Math.round(255*a),Math.round(255*s)]},rgbToHsl(e,t,o){e/=255,t/=255,o/=255;let n,a,s=Math.max(e,t,o),r=Math.min(e,t,o),l=(s+r)/2;if(s===r)n=a=0;else {let i=s-r;switch(a=l>.5?i/(2-s-r):i/(s+r),s){case e:n=(t-o)/i+(te.match(/^(down|right|up|left)$/i));n.length&&(t.autoposition=n[0],o.splice(o.indexOf(n[0]),1));let a=o.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));a.length?(t.my=a[0],t.at=a[1]||a[0],o.splice(o.indexOf(a[0]),1),a[1]&&o.splice(o.indexOf(a[1]),1)):(t.my="center",t.at="center");let s=o.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return s.length&&(t.offsetX=s[0].match(/^[+-]?\d*\.?\d+$/i)?`${s[0]}px`:s[0],s[1]?t.offsetY=s[1].match(/^[+-]?\d*\.?\d+$/i)?`${s[1]}px`:s[1]:t.offsetY=t.offsetX,o.splice(o.indexOf(s[0]),1),s[1]&&o.splice(o.indexOf(s[1]),1)),o.length&&(t.of=o.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(o=>{"function"==typeof t[o]&&(t[o]=t[o].call(e,e));}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const o="window"===e.options.container?"window":e.parentElement,n=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),s="window"===o?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},r="window"===o?{x:1,y:1}:{x:s.width/o.offsetWidth,y:s.height/o.offsetHeight},l="window"===o?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(o);let i;s.width-=(parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))*r.x,s.height-=(parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth))*r.y,i=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():s;let c=this.getScrollbarWidth(document.body),d=this.getScrollbarWidth(e.parentElement),p="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width/2+"px":s.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width+"px":s.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width/2+"px":-n.width/2+"px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-(n.width-i.width)/2+"px":s.width/2-n.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+(i.width-n.width/2)+"px":s.width-n.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width+"px":-n.width+"px":t.at.startsWith("center")?p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)-n.width+i.width/2+"px":s.width/2-n.width+"px":t.at.startsWith("right-")&&(p=t.of?i.left-s.left-parseFloat(l.borderLeftWidth)+i.width-n.width+"px":s.width-n.width+"px","window"!==o&&(p=parseFloat(p)-d.y+"px")));let h="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+"px":"0px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+i.height/2+"px":s.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)+i.height+"px":s.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+"px":-n.height/2+"px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+i.height/2+"px":s.height/2-n.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height/2+i.height+"px":s.height-n.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+"px":-n.height+"px":t.at.endsWith("center")?h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+i.height/2+"px":s.height/2-n.height+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-s.top-parseFloat(l.borderTopWidth)-n.height+i.height+"px":s.height-n.height+"px",h="window"!==o?parseFloat(h)-d.x+"px":parseFloat(h)-c.x+"px")),e.style.left=1===r.x?p:parseFloat(p)/r.x+"px",e.style.top=1===r.y?h:parseFloat(h)/r.y+"px";let f=getComputedStyle(e),u={left:f.left,top:f.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(u=this.applyPositionAutopos(e,u,t)),(t.offsetX||t.offsetY)&&(u=this.applyPositionOffset(e,u,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(u=this.applyPositionMinMax(e,u,t)),t.modify&&(u=this.applyPositionModify(e,u,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,o){const n=`${o.my}-${o.autoposition.toLowerCase()}`;e.classList.add(n);const a=Array.prototype.slice.call(document.querySelectorAll(`.${n}`)),s=a.indexOf(e);if(a.length>1){switch(o.autoposition){case"down":a.forEach((e,o)=>{o>0&&o<=s&&(t.top=parseFloat(t.top)+a[--o].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px");});break;case"up":a.forEach((e,o)=>{o>0&&o<=s&&(t.top=parseFloat(t.top)-a[--o].getBoundingClientRect().height-jsPanel.autopositionSpacing+"px");});break;case"right":a.forEach((e,o)=>{o>0&&o<=s&&(t.left=parseFloat(t.left)+a[--o].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px");});break;case"left":a.forEach((e,o)=>{o>0&&o<=s&&(t.left=parseFloat(t.left)-a[--o].getBoundingClientRect().width-jsPanel.autopositionSpacing+"px");});}e.style.left=t.left,e.style.top=t.top;}return {left:t.left,top:t.top}},applyPositionOffset(e,t,o){["offsetX","offsetY"].forEach(e=>{o[e]?("function"==typeof o[e]&&(o[e]=o[e].call(t,t,o)),!1===isNaN(o[e])&&(o[e]=`${o[e]}px`)):o[e]="0px";}),e.style.left=`calc(${e.style.left} + ${o.offsetX})`,e.style.top=`calc(${e.style.top} + ${o.offsetY})`;const n=getComputedStyle(e);return {left:n.left,top:n.top}},applyPositionMinMax(e,t,o){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{o[e]&&("function"==typeof o[e]&&(o[e]=o[e].call(t,t,o)),(Number.isInteger(o[e])||o[e].match(/^\d+$/))&&(o[e]=`${o[e]}px`));}),o.minLeft){e.style.left=o.minLeft;let n=getComputedStyle(e).left;parseFloat(n)parseFloat(t.left)?e.style.left=t.left:t.left=n;}if(o.maxTop){e.style.top=o.maxTop;let n=getComputedStyle(e).top;parseFloat(n)>parseFloat(t.top)?e.style.top=t.top:t.top=n;}const n=getComputedStyle(e);return {left:n.left,top:n.top}},applyPositionModify(e,t,o){if(o.modify&&"function"==typeof o.modify){const n=o.modify.call(t,t,o);e.style.left=Number.isInteger(n.left)||n.left.match(/^\d+$/)?`${n.left}px`:n.left,e.style.top=Number.isInteger(n.top)||n.top.match(/^\d+$/)?`${n.top}px`:n.top;}const n=getComputedStyle(e);return {left:n.left,top:n.top}},autopositionRemaining(e){let t,o=e.options.container;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(o=>{e.classList.contains(o)&&(t=o);}),t){("window"===o?document.body:"string"==typeof o?document.querySelector(o):o).querySelectorAll(`.${t}`).forEach(e=>e.reposition());}},getThemeDetails(e){const t=this.pOtheme(e);if(this.themes.some(e=>e===t.color.split(/\s/i)[0])){let e=t.color.split(/\s/i)[0],o=document.createElement("button");o.className=e+"-bg",document.body.appendChild(o),t.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0;}else if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),o=document.createElement("button");o.className="btn btn"+t.color.slice(e),document.body.appendChild(o),t.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0;}else if(t.color.startsWith("mdb-")){let e,o=t.color.indexOf("-")+1,n=document.createElement("span");e=t.color.endsWith("-dark")?(e=t.color.slice(o)).replace("-dark","-color-dark"):t.color.slice(o)+"-color",n.className=e,document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0;}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return this.themes.forEach(t=>{["panel",`jsPanel-theme-${t}`,`panel-${t}`,`${t}-color`].forEach(t=>e.classList.remove(t)),e.header.classList.remove(`jsPanel-theme-${t}`);}),e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(o=>e.querySelector(o).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000";}return e},applyCustomTheme(e,t){let o={bgPanel:"#ffffff",bgContent:"#fffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},n="object"==typeof t?Object.assign(o,t):o,a=n.bgPanel,s=n.bgContent,r=n.colorHeader,l=n.colorContent,i=n.bgFooter,c=n.colorFooter;return this.colorNames[a]?e.style.background="#"+this.colorNames[a]:e.style.background=this.getCssVariableValue(a),this.colorNames[r]&&(r="#"+this.colorNames[r]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(r)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(r)),this.colorNames[s]?e.content.style.background="#"+this.colorNames[s]:e.content.style.background=this.getCssVariableValue(s),this.colorNames[l]?e.content.style.color="#"+this.colorNames[l]:e.content.style.color=this.getCssVariableValue(l),this.perceivedBrightness(r)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(l)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[i]?e.footer.style.background="#"+this.colorNames[i]:e.footer.style.background=this.getCssVariableValue(i),this.colorNames[c]?e.footer.style.color="#"+this.colorNames[c]:e.footer.style.color=this.getCssVariableValue(c),n.border&&e.setBorder(n.border),n.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(n.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return {y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return {y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[o,n]of Object.entries(t))e.style[o]="string"==typeof n?jsPanel.getCssVariableValue(n):n;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",o){if(!document.querySelector(`script[src="${e}"]`)){const n=document.createElement("script");n.src=e,n.type=t,document.head.appendChild(n),o&&(n.onload=o);}},ajax(e,t){let o,n,a=new XMLHttpRequest;const s={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=jsPanel.strToHtml(this.responseText);o.urlSelector&&(e=e.querySelector(o.urlSelector)),t.contentRemove(),t.content.append(e);}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)o=Object.assign({},s,{url:e});else {if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the url parameter!";jsPanel.errorpanel(e);}return}(o=Object.assign({},s,e)).url=e.url,!1===o.async&&(o.timeout=0,o.withCredentials&&(o.withCredentials=void 0),o.responseType&&(o.responseType=void 0));}n=o.url.trim().split(/\s+/),o.url=encodeURI(n[0]),n.length>1&&(n.shift(),o.urlSelector=n.join(" ")),a.onreadystatechange=(()=>{4===a.readyState&&(200===a.status?t?o.done.call(a,a,t):o.done.call(a,a):o.fail&&(t?o.fail.call(a,a,t):o.fail.call(a,a)),o.always&&(t?o.always.call(a,a,t):o.always.call(a,a)),t&&(o.autoresize||o.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,o),jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(a,a,t):e.call(a,a);}));}),a.open(o.method,o.url,o.async,o.user,o.pwd),a.timeout=o.timeout||0,o.withCredentials&&(a.withCredentials=o.withCredentials),o.responseType&&(a.responseType=o.responseType),o.beforeSend&&(t?o.beforeSend.call(a,a,t):o.beforeSend.call(a,a)),o.data?a.send(o.data):a.send(null);},fetch(e,t){let o;const n={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let o=jsPanel.strToHtml(e);t.contentRemove(),t.content.append(o);}}};if(t&&"string"==typeof e)o=Object.assign({},n,{resource:encodeURI(e)});else {if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the resource parameter!";jsPanel.errorpanel(e);}return}(o=Object.assign({},n,e)).resource=encodeURI(e.resource);}const a=o.fetchInit||{};o.beforeSend&&(t?o.beforeSend.call(e,e,t):o.beforeSend.call(e,e)),fetch(o.resource,a).then(e=>{if(e.ok)return e[o.bodyMethod]()}).then(e=>{t?o.done.call(e,e,t):o.done.call(e,e),t&&(o.autoresize||o.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,o);});},ajaxAutoresizeAutoreposition(e,t){const o=e.options.contentSize;if("string"==typeof o&&o.match(/auto/i)){const n=o.split(" "),a=Object.assign({},{width:n[0],height:n[1]});t.autoresize&&e.resize(a),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}else if("object"==typeof o&&("auto"===o.width||"auto"===o.height)){const n=Object.assign({},o);t.autoresize&&e.resize(n),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled");}),t.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,o){const n=document.createElement("div"),a=e.parentElement;n.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(n.style.width=o+"px",n.style.height=o+"px"):"ct"===t||"cb"===t?n.style.height=o+"px":"lc"!==t&&"rc"!==t||(n.style.width=o+"px"),a!==document.body&&(n.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(n);},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e));},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t]);},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,o="some",n,a){if("function"==typeof t&&(t=[t]),o)return t[o](t=>t.call(e,e,n,a));t.forEach(t=>t.call(e,e,n,a));},resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=jsPanel.zi.next());},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e}

`});},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const o=document.getElementById(e.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID ${e.id} already exists in the document.`;jsPanel.errorpanel(t);}return !1}let n=this.pOcontainer(e.container);if("object"==typeof n&&n.length&&n.length>0&&(n=n[0]),!n){if(this.errorReporting){let e="◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist";jsPanel.errorpanel(e);}return !1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[];});const a=e.template||this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.progressbar=a.autocloseProgressbar=a.querySelector(".jsPanel-progressbar");const s=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),r=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),i=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[s,r,l,i,c,d,p,h,f,u,m,g,b,y].forEach(e=>e.panel=a);const j=a.querySelector(".jsPanel-btn-close"),x=a.querySelector(".jsPanel-btn-maximize"),E=a.querySelector(".jsPanel-btn-normalize"),C=a.querySelector(".jsPanel-btn-smallify"),P=a.querySelector(".jsPanel-btn-minimize");j&&jsPanel.pointerup.forEach(e=>{j.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify();});}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.minimize();});});let F=jsPanel.extensions;for(let e in F)Object.prototype.hasOwnProperty.call(F,e)&&(a[e]=F[e]);if(a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length||(t[2]=a.style.backgroundColor),t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=jsPanel.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.options.header?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.options.footerToolbar?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,o)=>{let n;if("minimized"===a.status&&(n=!0,a.normalize()),jsPanel.clearTheme(a),"object"==typeof t)e.border=void 0,jsPanel.applyCustomTheme(a,t);else if("string"==typeof t){"none"===t&&(t="white");let e=jsPanel.getThemeDetails(t);jsPanel.applyColorTheme(a,e);}return n&&a.minimize(),o&&o.call(a,a),a}),a.remove=((e,t,o)=>{a.parentElement.removeChild(a),document.getElementById(e)?o&&o.call(a,e,a):(a.removeMinimizedReplacement(),a.status="closed",t&&document.dispatchEvent(v),document.dispatchEvent(w),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),o&&o.call(e,e)),window.removeEventListener("resize",a.windowResizeHandler),document.removeEventListener("jspanelresize",a.parentResizeHandler);}),a.close=((e,t)=>{if(a.parentElement){if(a.closetimer&&window.clearInterval(a.closetimer),document.dispatchEvent(y),a.statusBefore=a.status,a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",o=>{o.stopPropagation(),a.remove(a.id,t,e);})):a.remove(a.id,t,e);}}),a.maximize=((t,o)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(c);const n=a.parentElement,s=jsPanel.pOcontainment(e.maximizedMargin);return n===document.body?(a.style.width=document.documentElement.clientWidth-s[1]-s[3]+"px",a.style.height=document.documentElement.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"):(a.style.width=n.clientWidth-s[1]-s[3]+"px",a.style.height=n.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),o||a.front(),document.dispatchEvent(d),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e);}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,o,n,s=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(s);break;case"parentpanel":(t=(n=(o=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[n.length-1]).append(s);break;case"parent":(t=(o=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",o.append(t)),t.append(s);break;default:document.querySelector(e.minimizeTo).append(s);}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(l),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const o=window.getComputedStyle(a),n=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth)+n+"px",C.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(u),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const s=a.querySelectorAll(".jsPanel-minimized-box");return s[s.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(g),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),C.style.transform="rotate(0deg)";const o=a.querySelectorAll(".jsPanel-minimized-box");o[o.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore);}return a}),a.front=((t,o=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else {const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi();}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&o&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){let e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),o=a.snappableTo;o.startsWith("left")?e[0]=t[3]:o.startsWith("right")&&(e[0]=-t[1]),o.endsWith("top")?e[1]=t[0]:o.endsWith("bottom")&&(e[1]=-t[2]);}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`);}t||(a.snapped=a.snappableTo);}),a.move=((e,t)=>{let o=a.overlaps(e,"paddingbox"),n=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=o.left+"px",a.style.top=o.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,n),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,o,n)=>{e.call(t,t,o,n);}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),o=t?t.parentElement:null;return e&&e.call(a,a,o),!!t&&o}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),o=window.getComputedStyle(a.headertitle).color,n=window.getComputedStyle(a),s=e.iconfont,r=t.querySelector(".jsPanel-controlbar");return "auto-show-hide"!==a.options.header?jsPanel.setStyles(t,{backgroundColor:n.backgroundColor,backgroundPositionX:n.backgroundPositionX,backgroundPositionY:n.backgroundPositionY,backgroundRepeat:n.backgroundRepeat,backgroundAttachment:n.backgroundAttachment,backgroundImage:n.backgroundImage,backgroundSize:n.backgroundSize,backgroundOrigin:n.backgroundOrigin,backgroundClip:n.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=o,r.style.color=o,r.querySelectorAll("button").forEach(e=>e.style.color=o),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e);}),a.setIconfont(s,t),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}):r.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}):r.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}):r.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e);}),a.drag=((e={})=>{let t,o,n;const s=new CustomEvent("jspaneldragstart",{detail:a.id}),r=new CustomEvent("jspaneldrag",{detail:a.id}),l=new CustomEvent("jspaneldragstop",{detail:a.id});[s,r,l].forEach(e=>e.panel=a);const i=e=>{let t=e.split("-");return t.forEach((e,o)=>{t[o]=e.charAt(0).toUpperCase()+e.slice(1);}),"snap"+t.join("")};function c(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,o,!1),a.style.opacity=1;});}let d=e.handles||jsPanel.defaults.dragit.handles,p=e.cursor||jsPanel.defaults.dragit.cursor;function h(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,o)),jsPanel.removeSnapAreas(),t){if(a.style.opacity=1,t=void 0,n.snap){switch(a.snappableTo){case"left-top":a.snap(n.snap.snapLeftTop);break;case"center-top":a.snap(n.snap.snapCenterTop);break;case"right-top":a.snap(n.snap.snapRightTop);break;case"right-center":a.snap(n.snap.snapRightCenter);break;case"right-bottom":a.snap(n.snap.snapRightBottom);break;case"center-bottom":a.snap(n.snap.snapCenterBottom);break;case"left-bottom":a.snap(n.snap.snapLeftBottom);break;case"left-center":a.snap(n.snap.snapLeftCenter);}n.snap.callback&&a.snappableTo&&"function"==typeof n.snap.callback&&(n.snap.callback.call(a,a),n.snap.repositionOnSnap&&!1!==n.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo)),a.snappableTo&&n.snap.repositionOnSnap&&n.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo);}if(a.droppableTo&&a.droppableTo){let e=a.parentElement;a.move(a.droppableTo),n.drop.callback&&n.drop.callback.call(a,a,a.droppableTo,e);}if(document.dispatchEvent(l),n.stop.length){let t=window.getComputedStyle(a),o={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,n.stop,!1,o,e);}a.saveCurrentPosition(),a.calcSizeFactors();}a.controlbar.style.pointerEvents="inherit",a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,h);}return a.querySelectorAll(d).forEach(l=>{l.style.touchAction="none",l.style.cursor=p,jsPanel.pointerdown.forEach(i=>{l.addEventListener(i,l=>{if(l.button&&l.button>0)return !1;if((n=Object.assign({},jsPanel.defaults.dragit,e)).disableOnMaximized&&"maximized"===a.status)return !1;if((n.containment||0===n.containment)&&(n.containment=jsPanel.pOcontainment(n.containment)),n.grid&&Array.isArray(n.grid)&&1===n.grid.length&&(n.grid[1]=n.grid[0]),n.snap&&("object"==typeof n.snap?n.snap=Object.assign({},jsPanel.defaultSnapConfig,n.snap):n.snap=jsPanel.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;a.controlbar.style.pointerEvents="none",a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let i=window.getComputedStyle(a),d=parseFloat(i.left),p=parseFloat(i.top),h=parseFloat(i.width),f=parseFloat(i.height),u=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,g=a.parentElement,b=g.getBoundingClientRect(),y=window.getComputedStyle(g),w=a.getScaleFactor(),v=0,j=jsPanel.getScrollbarWidth(g);o=(e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(s),a.style.opacity=n.opacity,a.snapped&&n.snap.resizeToPreSnap&&a.currentData.beforeSnap){a.resize(a.currentData.beforeSnap.width+" "+a.currentData.beforeSnap.height),a.setControls([".jsPanel-btn-normalize"]);let e=a.getBoundingClientRect(),t=u-(e.left+e.width),o=e.width/2;t>-o&&(v=t+o);}if(a.front(),a.snapped=!1,"maximized"===a.status&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized"),n.drop&&n.drop.dropZones){let e=n.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e);}):t.push(e);}),t=t.filter(function(e,t,o){return o.indexOf(e)===t}),n.drop.dropZones=t;}n.start.length&&jsPanel.processCallbacks(a,n.start,!1,{left:d,top:p,width:h,height:f},e);}let o,l,i,c,x,E,C,P,F,z;t=1;let S,A=e.touches?e.touches[0].clientX:e.clientX,k=e.touches?e.touches[0].clientY:e.clientY,B=window.getComputedStyle(a);if(g===document.body){let e=a.getBoundingClientRect();F=window.innerWidth-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(e.left+e.width),z=window.innerHeight-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(e.top+e.height);}else F=parseInt(y.width,10)-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(parseInt(B.left,10)+parseInt(B.width,10)),z=parseInt(y.height,10)-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(parseInt(B.top,10)+parseInt(B.height,10));o=parseFloat(B.left),i=parseFloat(B.top),x=F,C=z,n.snap&&("panel"===n.snap.trigger?(l=o**2,c=i**2,E=x**2,P=C**2):"pointer"===n.snap.trigger&&("window"===a.options.container?(o=A,l=A**2,c=(i=k)**2,E=(x=window.innerWidth-A)**2,P=(C=window.innerHeight-k)**2):(o=(S=a.overlaps(g,"paddingbox",e)).pointer.left,i=S.pointer.top,x=S.pointer.right,C=S.pointer.bottom,l=S.pointer.left**2,c=S.pointer.top**2,E=S.pointer.right**2,P=S.pointer.bottom**2)));let T=Math.sqrt(l+c),L=Math.sqrt(l+P),R=Math.sqrt(E+c),W=Math.sqrt(E+P),D=Math.abs(o-x)/2,$=Math.abs(i-C)/2,O=Math.sqrt(l+$**2),q=Math.sqrt(c+D**2),H=Math.sqrt(E+$**2),M=Math.sqrt(P+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(r),n.axis&&"x"!==n.axis||(a.style.left=d+(A-u)/w.x+v+"px"),n.axis&&"y"!==n.axis||(a.style.top=p+(k-m)/w.y+"px"),n.grid){let e=n.grid,t=n.axis,o=e[0]*Math.round((d+(A-u))/e[0]),s=e[1]*Math.round((p+(k-m))/e[1]);t&&"x"!==t||(a.style.left=`${o}px`),t&&"y"!==t||(a.style.top=`${s}px`);}if(n.containment||0===n.containment){let e,t,o=n.containment;if("window"===a.options.container)e=window.innerWidth-parseFloat(B.width)-o[1]-j.y,t=window.innerHeight-parseFloat(B.height)-o[2]-j.x;else {let n=parseFloat(y.borderLeftWidth)+parseFloat(y.borderRightWidth),a=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth);e=b.width/w.x-parseFloat(B.width)-o[1]-n-j.y,t=b.height/w.y-parseFloat(B.height)-o[2]-a-j.x;}parseFloat(a.style.left)<=o[3]&&(a.style.left=o[3]+"px"),parseFloat(a.style.top)<=o[0]&&(a.style.top=o[0]+"px"),parseFloat(a.style.left)>=e&&(a.style.left=e+"px"),parseFloat(a.style.top)>=t&&(a.style.top=t+"px");}if(n.drag.length){let t={left:o,top:i,right:x,bottom:C,width:parseFloat(B.width),height:parseFloat(B.height)};jsPanel.processCallbacks(a,n.drag,!1,t,e);}if(n.snap){let e=n.snap.sensitivity,t=g===document.body?window.innerWidth/8:b.width/8,s=g===document.body?window.innerHeight/8:b.height/8;a.snappableTo=!1,jsPanel.removeSnapAreas(),T0&&S.pointer.top>0?(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e))):L0&&S.pointer.bottom>0?(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e))):R0&&S.pointer.top>0?(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e))):W0&&S.pointer.bottom>0?(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e))):i0?(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e))):o0?(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e))):x0?(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e))):C0?(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)));}if(n.drop&&n.drop.dropZones){let t=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",o=document[t](e.clientX,e.clientY);Array.isArray(o)||(o=Array.prototype.slice.call(o)),n.drop.dropZones.forEach(e=>{o.includes(e)&&(a.droppableTo=e);}),o.includes(a.droppableTo)||(a.droppableTo=!1);}}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,o)),window.addEventListener("mouseout",c,!1);});}),jsPanel.pointerup.forEach(e=>{document.addEventListener(e,h),window.removeEventListener("mouseout",c);}),e.disable&&(l.style.pointerEvents="none");}),a}),a.dragit=(t=>{const o=Object.assign({},jsPanel.defaults.dragit,e.dragit),n=a.querySelectorAll(o.handles);return "disable"===t?n.forEach(e=>e.style.pointerEvents="none"):n.forEach(e=>e.style.pointerEvents="auto"),a}),a.sizeit=((e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:a.id}),o=new CustomEvent("jspanelresize",{detail:a.id}),n=new CustomEvent("jspanelresizestop",{detail:a.id});[t,o,n].forEach(e=>e.panel=a);let s,r,l,i,c,d,p={};p.handles=e.handles||jsPanel.defaults.resizeit.handles,p.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,a.append(t);});let h=!!e.aspectRatio&&e.aspectRatio;function f(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>document.removeEventListener(e,s,!1));}function u(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,s,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,o,n=e.target.className;if(n.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),n.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),p.grid&&Array.isArray(p.grid)){1===p.grid.length&&(p.grid[1]=p.grid[0]);const e=parseFloat(a.style.width),n=parseFloat(a.style.height),s=e%p.grid[0],r=n%p.grid[1],l=parseFloat(a.style.left),i=parseFloat(a.style.top),c=l%p.grid[0],d=i%p.grid[1];sd+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(n),p.stop.length){let t=window.getComputedStyle(a),o={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,p.stop,!1,o,e);}}a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),p.aspectRatio=h,document.removeEventListener(e,u);}return a.querySelectorAll(".jsPanel-resizeit-handle").forEach(n=>{n.style.touchAction="none",jsPanel.pointerdown.forEach(h=>{n.addEventListener(h,n=>{if(n.preventDefault(),n.stopPropagation(),n.button&&n.button>0)return !1;let h=1;if(((p=Object.assign({},jsPanel.defaults.resizeit,e)).containment||0===p.containment)&&(p.containment=jsPanel.pOcontainment(p.containment)),p.aspectRatio&&!0===p.aspectRatio&&(p.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;e.altKey?p.aspectRatio="content":e.ctrlKey?p.aspectRatio="panel":e.shiftKey&&(p.aspectRatio=!1,h=2);}let u="function"==typeof p.maxWidth?p.maxWidth():p.maxWidth||1e4,m="function"==typeof p.maxHeight?p.maxHeight():p.maxHeight||1e4,g="function"==typeof p.minWidth?p.minWidth():p.minWidth,b="function"==typeof p.minHeight?p.minHeight():p.minHeight;a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const y=a.parentElement,w=y.tagName.toLowerCase(),v=a.getBoundingClientRect(),j=y.getBoundingClientRect(),x=window.getComputedStyle(y,null),E=parseInt(x.borderLeftWidth,10),C=parseInt(x.borderTopWidth,10),P=x.getPropertyValue("position"),F=n.clientX||0===n.clientX||n.touches[0].clientX,z=n.clientY||0===n.clientY||n.touches[0].clientY,S=F/z,A=n.target.classList,k=a.getScaleFactor(),B=v.width/v.height,T=a.content.getBoundingClientRect(),L=T.width/T.height,R=a.header.getBoundingClientRect().height,W=a.footer.getBoundingClientRect().height||0;let D=v.left,$=v.top,O=1e4,q=1e4,H=1e4,M=1e4;c=v.width,d=v.height,"body"!==w&&(D=v.left-j.left+y.scrollLeft,$=v.top-j.top+y.scrollTop),"body"===w&&p.containment?(O=document.documentElement.clientWidth-v.left,H=document.documentElement.clientHeight-v.top,q=v.width+v.left,M=v.height+v.top):p.containment&&("static"===P?(O=j.width-v.left+E,H=j.height+j.top-v.top+C,q=v.width+(v.left-j.left)-E,M=v.height+(v.top-j.top)-C):(O=y.clientWidth-(v.left-j.left)/k.x+E,H=y.clientHeight-(v.top-j.top)/k.y+C,q=(v.width+v.left-j.left)/k.x-E,M=a.clientHeight+(v.top-j.top)/k.y-C)),p.containment&&(q-=p.containment[3],M-=p.containment[0],O-=p.containment[1],H-=p.containment[2]);const N=window.getComputedStyle(a),I=parseFloat(N.width)-v.width,V=parseFloat(N.height)-v.height;let X=parseFloat(N.left)-v.left,Y=parseFloat(N.top)-v.top;y!==document.body&&(X+=j.left,Y+=j.top);let Z=parseInt(N.borderTopWidth,10),U=parseInt(N.borderRightWidth,10),K=parseInt(N.borderBottomWidth,10),_=parseInt(N.borderLeftWidth,10);s=(e=>{e.preventDefault(),r||(document.dispatchEvent(t),p.start.length&&jsPanel.processCallbacks(a,p.start,!1,{width:c,height:d,left:D,top:$},e),a.front(),"maximized"===a.status&&(a.status="normalized",a.controlbar.querySelector(".jsPanel-btn-maximize")&&a.setControlStatus("maximize","show"),a.controlbar.querySelector(".jsPanel-btn-normalize")&&a.setControlStatus("normalize","hide")),v.height>d+5&&(a.status="normalized",a.setControls([".jsPanel-btn-normalize"]))),r=1,document.dispatchEvent(o);let s=e.touches?e.touches[0].clientX:e.clientX,f=e.touches?e.touches[0].clientY:e.clientY;A.contains("jsPanel-resizeit-e")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),"content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-s")?((i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-w")?((l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-n")?((i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-se")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-sw")?((i=d+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),p.aspectRatio&&(a.style.width=i*B+"px"),(l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-ne")?((l=c+(s-F)*h/k.x+I)>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(s-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=O+"px",a.style.height=O/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(p.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(f=(s=f*S)/S),(l=c+(F-s)*h/k.x+I)<=u&&l>=g&&l<=q&&(a.style.left=D+(s-F)/k.x+X+"px"),l>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",p.aspectRatio&&(a.style.height=l/B+"px"),(i=d+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?a.style.width=(i-R-W-Z-K)*L+Z+K+"px":"panel"===p.aspectRatio&&(a.style.width=i*B+"px")),window.getSelection().removeAllRanges();const w=window.getComputedStyle(a),j={left:parseFloat(w.left),top:parseFloat(w.top),right:parseFloat(w.right),bottom:parseFloat(w.bottom),width:parseFloat(w.width),height:parseFloat(w.height)};p.resize.length&&jsPanel.processCallbacks(a,p.resize,!1,j,e);}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,s,!1)),window.addEventListener("mouseout",f,!1);});}),jsPanel.pointerup.forEach(function(e){document.addEventListener(e,u),window.removeEventListener("mouseout",f);}),e.disable&&(n.style.pointerEvents="none");}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return "disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return {x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height));}}),a.saveCurrentDimensions=((e=!1)=>{const t=window.getComputedStyle(a);a.currentData.width=t.width,"normalized"===a.status&&(a.currentData.height=t.height),e&&(a.style.height=t.height);}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top;}),a.reposition=((...t)=>{let o,n=e.position,s=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?n=e:"boolean"==typeof e?s=e:"function"==typeof e&&(o=e);}),jsPanel.position(a,n),a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),s&&a.saveCurrentPosition(),o&&o.call(a,a),a}),a.repositionOnSnap=(t=>{let o="0",n="0",s=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":o=s[3],n=s[0];break;case"right-top":o=-s[1],n=s[0];break;case"right-bottom":o=-s[1],n=-s[2];break;case"left-bottom":o=s[3],n=-s[2];break;case"center-top":o=s[3]/2-s[1]/2,n=s[0];break;case"center-bottom":o=s[3]/2-s[1]/2,n=-s[2];break;case"left-center":o=s[3],n=s[0]/2-s[2]/2;break;case"right-center":o=-s[1],n=s[0]/2-s[2]/2;}jsPanel.position(a,t),jsPanel.setStyles(a,{left:`calc(${a.style.left} + ${o}px)`,top:`calc(${a.style.top} + ${n}px)`});}),a.overlaps=((e,t,o)=>{let n,s=a.getBoundingClientRect(),r=getComputedStyle(a.parentElement),l=a.getScaleFactor(),i={top:0,right:0,bottom:0,left:0},c=0,d=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(i.top=parseInt(r.borderTopWidth,10)*l.y,i.right=parseInt(r.borderRightWidth,10)*l.x,i.bottom=parseInt(r.borderBottomWidth,10)*l.y,i.left=parseInt(r.borderLeftWidth,10)*l.x),n="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),o&&(c=o.touches?o.touches[0].clientX:o.clientX,d=o.touches?o.touches[0].clientY:o.clientY,p=c-n.left,h=d-n.top);let f=s.leftn.left,u=s.topn.top;return {overlaps:f&&u,top:s.top-n.top-i.top,right:n.right-s.right-i.right,bottom:n.bottom-s.bottom-i.bottom,left:s.left-n.left-i.left,parentBorderWidth:i,panelRect:s,referenceRect:n,pointer:{clientX:c,clientY:d,left:p-i.left,top:h-i.top,right:n.width-p-i.right,bottom:n.height-h-i.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height;}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%";}return a}),a.resize=((...e)=>{let t,o=window.getComputedStyle(a),n={width:o.width,height:o.height},s=!0;e.forEach(e=>{"string"==typeof e?n=e:"object"==typeof e?n=Object.assign(n,e):"boolean"==typeof e?s=e:"function"==typeof e&&(t=e);});let r=jsPanel.pOsize(a,n);a.style.width=r.width,a.style.height=r.height,a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),s&&a.saveCurrentDimensions(),a.status="normalized";let l=a.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.windowResizeHandler=(t=>{if(t.target===window){let o,n,s=a.status,r=e.onwindowresize;if("maximized"===s&&r)a.maximize(!1,!0);else if(a.snapped&&"minimized"!==s)a.snap(a.snapped,!0);else if("normalized"===s||"smallified"===s||"maximized"===s){let e=typeof r;"boolean"===e?(o=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",n=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=n<=0?0:n+"px"):"function"===e?r.call(a,t,a):"object"===e&&(!0===r.preset?(o=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",n=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=n<=0?0:n+"px",r.callback.call(a,t,a)):r.callback.call(a,t,a));}else "smallifiedmax"===s&&r&&a.maximize(!1,!0).smallify();a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition());}}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),o=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${o}`)&&(e.style.display="block");}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none");}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",o)=>{const n=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),n.style.pointerEvents="none",n.style.opacity=.4,n.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),n.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),n.style.display="block",n.style.pointerEvents="auto",n.style.opacity=1,n.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(n.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),n.style.pointerEvents="auto",n.style.opacity=1,n.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(n),a.setAttribute(`data-btn${e}`,"removed");}return o&&o.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`);}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem");}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>a.addControl(e));}let o=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);o.push(t);});const n=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=n,o.forEach(e=>{n[e]&&a.setControlStatus(e,n[e]);}),a.setControlSize(n.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let o=[a.headerlogo],n=document.querySelector("#"+a.id+"-min");return n&&o.push(n.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?o.forEach(t=>t.innerHTML=e):o.forEach(t=>{jsPanel.emptyNode(t);let o=document.createElement("img");o.src=e,t.append(o);}):o.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false");}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>a.setAttribute(`data-btn${e}`,"removed")),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let o=[a.headertitle],n=document.querySelector("#"+a.id+"-min");return n&&o.push(n.querySelector(".jsPanel-title")),"string"==typeof e?o.forEach(t=>t.innerHTML=e):"function"==typeof e?o.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e();}):o.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),t&&t.call(a,a),a}),a.setIconfont=((e,t=a,o)=>{if(e){let o,n;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)o=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)o=[e,e,e,e,e,e],n=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))o=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else {if("bootstrap"!==e&&"glyphicon"!==e)return t;o=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"];}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>jsPanel.emptyNode(e).innerHTML=""),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=o[a],"material-icons"===e&&(t.textContent=n[a]);});}return o&&o.call(t,t),t}),a.addToolbar=((e,t,o)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t);});else if("function"==typeof t){let o=t.call(a,a);"string"==typeof o?e.innerHTML=o:e.append(o);}else e.append(t);return e.classList.add("active"),o&&o.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault());}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const o=a.controlbar.querySelectorAll(".jsPanel-btn").length;let n=document.createElement("button");n.innerHTML=t.html,n.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,n.style.color=a.header.style.color,t.position>o?a.controlbar.append(n):a.controlbar.insertBefore(n,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const s=t.ariaLabel||t.name;return s&&n.setAttribute("aria-label",s),jsPanel.pointerup.forEach(e=>{n.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;t.handler.call(a,a,n);});}),t.afterInsert&&t.afterInsert.call(n,n),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang);});}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),n.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px";});break;case"xs":e.forEach(e=>{e.style.height="26px";});break;case"sm":e.forEach(e=>{e.style.height="30px";});break;case"lg":e.forEach(e=>{e.style.height="38px";});break;case"xl":e.forEach(e=>{e.style.height="42px";});}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t);}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t);});}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.css)for(const[t,o]of Object.entries(e.css))if("panel"===t)a.className+=` ${o}`;else {let e=a.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${o}`);}if(e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,a),e.contentFetch&&this.fetch(e.contentFetch,a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1]);}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let o=a.progressbar.querySelector("div");o.addEventListener("animationend",e=>{e.stopPropagation(),a.progressbar.classList.remove("active"),a.close();}),t.progressbar&&(a.progressbar.classList.add("active"),t.background?jsPanel.themes.indexOf(t.background)>-1?a.progressbar.classList.add(t.background+"-bg"):jsPanel.colorNames[t.background]?a.progressbar.style.background="#"+jsPanel.colorNames[t.background]:a.progressbar.style.background=t.background:a.progressbar.classList.add("success-bg")),o.style.animation=`${t.time} progressbar`;}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(i),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn);}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t);}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[];}),a.drag(e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors();},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[];}),a.sizeit(e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status);},!1),a.addEventListener("jspanelresizestop",o=>{o.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors());},!1);}if(a.saveCurrentDimensions(!0),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front();},!1);}),e.onwindowresize&&"window"===a.options.container&&window.addEventListener("resize",a.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,o=typeof t,n=a.isChildpanel();if(n){const e=n.content;let s=[];a.parentResizeHandler=(r=>{if(r.panel===n){s[0]=e.offsetWidth,s[1]=e.offsetHeight;let n,r,l=a.status;"maximized"===l&&t?a.maximize():a.snapped&&"minimized"!==l?a.snap(a.snapped,!0):"normalized"===l||"smallified"===l||"maximized"===l?"function"===o?t.call(a,a,{width:s[0],height:s[1]}):"object"===o&&!0===t.preset?(n=(s[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",r=(s[1]-a.offsetHeight)*a.vf,a.style.top=r<=0?0:r+"px",t.callback.call(a,a,{width:s[0],height:s[1]})):"boolean"===o&&(n=(s[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",r=(s[1]-a.offsetHeight)*a.vf,a.style.top=r<=0?0:r+"px"):"smallifiedmax"===l&&t&&a.maximize().smallify();}}),document.addEventListener("jspanelresize",a.parentResizeHandler,!1);}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(a,a)):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(a,a)):e.callback.call(a,a)),t&&t.call(a,a),document.dispatchEvent(s),a}}; +let jsPanel={version:"4.16.1",date:"2022-11-03 09:18",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)));},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>document.documentMode||!1)(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return !1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e;}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return (void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var n=t>0?0|t:0;return this.substring(n,n+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return "";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var n=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+=t.substring(0,n-t.length)}),Number.isInteger=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let n=Object(this),o=n.length>>>0;if(0===o)return !1;let a=0|t,r=Math.max(a>=0?a:o-Math.abs(a),0);for(;rjsPanel.modifier=e),void document.addEventListener("keyup",()=>jsPanel.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"]);},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return !!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return [t,t,t,t];if(Array.isArray(t)){if(1===t.length)return [t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1]);}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const o=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0];}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[\d.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else {const e=window.getComputedStyle(o),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px";}else "function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[\d.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[\d.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else {const e=window.getComputedStyle(o),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px";}else "function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[\d.]+$/gi)&&(n.height+="px"));return n},pOborder(e){let t=[],n=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return n.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(n[t]=jsPanel.getCssVariableValue(e));}),n.forEach(e=>{jsPanel.colorNames[e]?t[2]="#"+jsPanel.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e;}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,n="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let o=e.indexOf(")");(t=e.slice(0,o+1).replace(/\s+/g,"")).startsWith("var")&&(t=jsPanel.getCssVariableValue(t)),n=e.slice(o+1,e.length).trim();}else if(e.match(/^(#|\w|--)/)){let o=e.indexOf(" ");o>0?(t=e.slice(0,o+1).replace(/\s+/g,""),n=e.slice(o+1,e.length).trim()):t=e,t.startsWith("--")&&(t=jsPanel.getCssVariableValue(t));}if(t.match(/^([\da-f]{3}|[\da-f]{6})$/gi)&&(t="#"+t),n.startsWith("fillcolor")){let e=n.indexOf(" ");n=(n=n.slice(e+1,n.length).trim().replace(/\s+/g,"")).match(/^([\da-f]{3}|[\da-f]{6})$/gi)?"#"+n:jsPanel.colorNames[n]?"#"+jsPanel.colorNames[n]:n.match(/^(--|var)/)?jsPanel.getCssVariableValue(n):"#fff";}return {color:t,colors:!1,filling:n}},color(e){let t,n,o,a,r,s,l,i,d,c=e.toLowerCase(),p={};const h=/^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3}),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,f=/^hsla?\((\d{1,3}),(\d{1,3}%),(\d{1,3}%),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,u=this.colorNames;return u[c]&&(c=u[c]),null!==c.match(/^#?([\da-f]{3}|[\da-f]{6})$/gi)?((c=c.replace("#","")).length%2==1?(t=c.slice(0,1).repeat(2),n=c.slice(1,2).repeat(2),o=c.slice(2,3).repeat(2),p.rgb={r:parseInt(t,16),g:parseInt(n,16),b:parseInt(o,16)},p.hex=`#${t}${n}${o}`):(p.rgb={r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16)},p.hex=`#${c}`),d=this.rgbToHsl(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl=d,p.rgb.css=`rgb(${p.rgb.r},${p.rgb.g},${p.rgb.b})`):c.match(h)?(l=h.exec(c),p.rgb={css:c,r:l[1],g:l[2],b:l[3]},p.hex=this.rgbToHex(l[1],l[2],l[3]),d=this.rgbToHsl(l[1],l[2],l[3]),p.hsl=d):c.match(f)?(a=(l=f.exec(c))[1]/360,r=l[2].slice(0,l[2].length-1)/100,s=l[3].slice(0,l[3].length-1)/100,i=this.hslToRgb(a,r,s),p.rgb={css:`rgb(${i[0]},${i[1]},${i[2]})`,r:i[0],g:i[1],b:i[2]},p.hex=this.rgbToHex(p.rgb.r,p.rgb.g,p.rgb.b),p.hsl={css:`hsl(${l[1]},${l[2]},${l[3]})`,h:l[1],s:l[2],l:l[3]}):(p.hex="#f5f5f5",p.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},p.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),p},calcColors(e){const t=this.colorBrightnessThreshold,n=this.color(e),o=this.lighten(e,this.colorFilledLight),a=this.darken(e,this.colorFilled),r=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",s=this.perceivedBrightness(o)<=t?"#ffffff":"#000000",l=this.perceivedBrightness(a)<=t?"#ffffff":"#000000",i=this.lighten(e,this.colorFilledDark),d=this.perceivedBrightness(i)<=t?"#ffffff":"#000000";return [n.hsl.css,o,a,r,s,l,i,d]},darken(e,t){const n=this.color(e).hsl,o=parseFloat(n.l),a=Math.round(o-o*t)+"%";return `hsl(${n.h},${n.s},${a})`},lighten(e,t){const n=this.color(e).hsl,o=parseFloat(n.l),a=Math.round(o+(100-o)*t)+"%";return `hsl(${n.h},${n.s},${a})`},hslToRgb(e,t,n){let o,a,r;if(0===t)o=a=r=n;else {let s=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),l=n<.5?n*(1+t):n+t-n*t,i=2*n-l;o=s(i,l,e+1/3),a=s(i,l,e),r=s(i,l,e-1/3);}return [Math.round(255*o),Math.round(255*a),Math.round(255*r)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let o,a,r=Math.max(e,t,n),s=Math.min(e,t,n),l=(r+s)/2;if(r===s)o=a=0;else {let i=r-s;switch(a=l>.5?i/(2-r-s):i/(r+s),r){case e:o=(t-n)/i+(te.match(/^(down|right|up|left)$/i));o.length&&(t.autoposition=o[0],n.splice(n.indexOf(o[0]),1));let a=n.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));a.length?(t.my=a[0],t.at=a[1]||a[0],n.splice(n.indexOf(a[0]),1),a[1]&&n.splice(n.indexOf(a[1]),1)):(t.my="center",t.at="center");let r=n.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return r.length&&(t.offsetX=r[0].match(/^[+-]?\d*\.?\d+$/i)?`${r[0]}px`:r[0],r[1]?t.offsetY=r[1].match(/^[+-]?\d*\.?\d+$/i)?`${r[1]}px`:r[1]:t.offsetY=t.offsetX,n.splice(n.indexOf(r[0]),1),r[1]&&n.splice(n.indexOf(r[1]),1)),n.length&&(t.of=n.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e));}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,o=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),r="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},s="window"===n?{x:1,y:1}:{x:r.width/n.offsetWidth,y:r.height/n.offsetHeight},l="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let i;r.width-=(parseFloat(l.borderLeftWidth)+parseFloat(l.borderRightWidth))*s.x,r.height-=(parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth))*s.y,i=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():r;let d=this.getScrollbarWidth(document.body),c=this.getScrollbarWidth(e.parentElement),p="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width/2+"px":r.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width+"px":r.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width/2+"px":-o.width/2+"px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-(o.width-i.width)/2+"px":r.width/2-o.width/2+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+(i.width-o.width/2)+"px":r.width-o.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width+"px":-o.width+"px":t.at.startsWith("center")?p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)-o.width+i.width/2+"px":r.width/2-o.width+"px":t.at.startsWith("right-")&&(p=t.of?i.left-r.left-parseFloat(l.borderLeftWidth)+i.width-o.width+"px":r.width-o.width+"px","window"!==n&&(p=parseFloat(p)-c.y+"px")));let h="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+"px":"0px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+i.height/2+"px":r.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)+i.height+"px":r.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+"px":-o.height/2+"px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+i.height/2+"px":r.height/2-o.height/2+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height/2+i.height+"px":r.height-o.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+"px":-o.height+"px":t.at.endsWith("center")?h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+i.height/2+"px":r.height/2-o.height+"px":t.at.endsWith("-bottom")&&(h=t.of?i.top-r.top-parseFloat(l.borderTopWidth)-o.height+i.height+"px":r.height-o.height+"px",h="window"!==n?parseFloat(h)-c.x+"px":parseFloat(h)-d.x+"px")),e.style.left=1===s.x?p:parseFloat(p)/s.x+"px",e.style.top=1===s.y?h:parseFloat(h)/s.y+"px";let f=getComputedStyle(e),u={left:f.left,top:f.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(u=this.applyPositionAutopos(e,u,t)),(t.offsetX||t.offsetY)&&(u=this.applyPositionOffset(e,u,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(u=this.applyPositionMinMax(e,u,t)),t.modify&&(u=this.applyPositionModify(e,u,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,n){const o=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(o);const a=Array.prototype.slice.call(document.querySelectorAll(`.${o}`)),r=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":a.forEach((e,n)=>{n>0&&n<=r&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px");});break;case"up":a.forEach((e,n)=>{n>0&&n<=r&&(t.top=parseFloat(t.top)-a[--n].getBoundingClientRect().height-jsPanel.autopositionSpacing+"px");});break;case"right":a.forEach((e,n)=>{n>0&&n<=r&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px");});break;case"left":a.forEach((e,n)=>{n>0&&n<=r&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width-jsPanel.autopositionSpacing+"px");});}e.style.left=t.left,e.style.top=t.top;}return {left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px";}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const o=getComputedStyle(e);return {left:o.left,top:o.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`));}),n.minLeft){e.style.left=n.minLeft;let o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=o;}if(n.maxTop){e.style.top=n.maxTop;let o=getComputedStyle(e).top;parseFloat(o)>parseFloat(t.top)?e.style.top=t.top:t.top=o;}const o=getComputedStyle(e);return {left:o.left,top:o.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?`${o.left}px`:o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?`${o.top}px`:o.top;}const o=getComputedStyle(e);return {left:o.left,top:o.top}},autopositionRemaining(e){let t,n=e.options.container;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n);}),t){("window"===n?document.body:"string"==typeof n?document.querySelector(n):n).querySelectorAll(`.${t}`).forEach(e=>e.reposition());}},getThemeDetails(e){const t=this.pOtheme(e);if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),n=document.createElement("button");n.className="btn btn"+t.color.slice(e),document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0;}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(n=>e.querySelector(n).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000";}return e},applyCustomTheme(e,t){let n={bgPanel:"#ffffff",bgContent:"#ffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},o="object"==typeof t?Object.assign(n,t):n,a=o.bgPanel,r=o.bgContent,s=o.colorHeader,l=o.colorContent,i=o.bgFooter,d=o.colorFooter;return this.colorNames[a]?e.style.background="#"+this.colorNames[a]:e.style.background=this.getCssVariableValue(a),this.colorNames[s]&&(s="#"+this.colorNames[s]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(s)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(s)),this.colorNames[r]?e.content.style.background="#"+this.colorNames[r]:e.content.style.background=this.getCssVariableValue(r),this.colorNames[l]?e.content.style.color="#"+this.colorNames[l]:e.content.style.color=this.getCssVariableValue(l),this.perceivedBrightness(s)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(l)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[i]?e.footer.style.background="#"+this.colorNames[i]:e.footer.style.background=this.getCssVariableValue(i),this.colorNames[d]?e.footer.style.color="#"+this.colorNames[d]:e.footer.style.color=this.getCssVariableValue(d),o.border&&e.setBorder(o.border),o.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(o.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return {y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return {y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[n,o]of Object.entries(t))e.style[n]="string"==typeof o?jsPanel.getCssVariableValue(o):o;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const o=document.createElement("script");o.src=e,o.type=t,document.head.appendChild(o),n&&(o.onload=n);}},ajax(e,t){let n,o,a=new XMLHttpRequest;const r={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=jsPanel.strToHtml(this.responseText);n.urlSelector&&(e=e.querySelector(n.urlSelector)),t.contentRemove(),t.content.append(e);}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)n=Object.assign({},r,{url:e});else {if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the url parameter!";jsPanel.errorpanel(e);}return}(n=Object.assign({},r,e)).url=e.url,!1===n.async&&(n.timeout=0,n.withCredentials&&(n.withCredentials=void 0),n.responseType&&(n.responseType=void 0));}o=n.url.trim().split(/\s+/),n.url=encodeURI(o[0]),o.length>1&&(o.shift(),n.urlSelector=o.join(" ")),a.onreadystatechange=(()=>{4===a.readyState&&(200===a.status?t?n.done.call(a,a,t):n.done.call(a,a):n.fail&&(t?n.fail.call(a,a,t):n.fail.call(a,a)),n.always&&(t?n.always.call(a,a,t):n.always.call(a,a)),t&&(n.autoresize||n.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,n),jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(a,a,t):e.call(a,a);}));}),a.open(n.method,n.url,n.async,n.user,n.pwd),a.timeout=n.timeout||0,n.withCredentials&&(a.withCredentials=n.withCredentials),n.responseType&&(a.responseType=n.responseType),n.beforeSend&&(t?n.beforeSend.call(a,a,t):n.beforeSend.call(a,a)),n.data?a.send(n.data):a.send(null);},fetch(e,t){let n;const o={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let n=jsPanel.strToHtml(e);t.contentRemove(),t.content.append(n);}}};if(t&&"string"==typeof e)n=Object.assign({},o,{resource:encodeURI(e)});else {if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the resource parameter!";jsPanel.errorpanel(e);}return}(n=Object.assign({},o,e)).resource=encodeURI(e.resource);}const a=n.fetchInit||{};n.beforeSend&&(t?n.beforeSend.call(e,e,t):n.beforeSend.call(e,e)),fetch(n.resource,a).then(e=>{if(e.ok)return e[n.bodyMethod]()}).then(e=>{t?n.done.call(e,e,t):n.done.call(e,e),t&&(n.autoresize||n.autoreposition)&&jsPanel.ajaxAutoresizeAutoreposition(t,n);});},ajaxAutoresizeAutoreposition(e,t){const n=e.options.contentSize;if("string"==typeof n&&n.match(/auto/i)){const o=n.split(" "),a=Object.assign({},{width:o[0],height:o[1]});t.autoresize&&e.resize(a),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}else if("object"==typeof n&&("auto"===n.width||"auto"===n.height)){const o=Object.assign({},n);t.autoresize&&e.resize(o),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition();}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled");}),t.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n
\n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,n){const o=document.createElement("div"),a=e.parentElement;o.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(o);},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e));},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t]);},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,n="some",o,a){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,o,a));t.forEach(t=>t.call(e,e,o,a));},resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=jsPanel.zi.next());},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e}

`});},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return {next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID ${e.id} already exists in the document.`;jsPanel.errorpanel(t);}return !1}let o=this.pOcontainer(e.container);if("object"==typeof o&&o.length&&o.length>0&&(o=o[0]),!o){if(this.errorReporting){let e="◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist";jsPanel.errorpanel(e);}return !1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[];});const a=e.template||this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.progressbar=a.autocloseProgressbar=a.querySelector(".jsPanel-progressbar");const r=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),s=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),i=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[r,s,l,i,d,c,p,h,f,u,m,g,b,y].forEach(e=>e.panel=a);const j=a.querySelector(".jsPanel-btn-close"),E=a.querySelector(".jsPanel-btn-maximize"),x=a.querySelector(".jsPanel-btn-normalize"),C=a.querySelector(".jsPanel-btn-smallify"),P=a.querySelector(".jsPanel-btn-minimize");j&&jsPanel.pointerup.forEach(e=>{j.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify();});}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.minimize();});});let F=jsPanel.extensions;for(let e in F)Object.prototype.hasOwnProperty.call(F,e)&&(a[e]=F[e]);if(a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length||(t[2]=a.style.backgroundColor),t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=jsPanel.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.options.header?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.options.footerToolbar?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,n)=>{let o;if("minimized"===a.status&&(o=!0,a.normalize()),jsPanel.clearTheme(a),"object"==typeof t)e.border=void 0,jsPanel.applyCustomTheme(a,t);else if("string"==typeof t){"none"===t&&(t="white");let e=jsPanel.getThemeDetails(t);jsPanel.applyColorTheme(a,e);}return o&&a.minimize(),n&&n.call(a,a),a}),a.remove=((e,t,n)=>{a.parentElement.removeChild(a),document.getElementById(e)?n&&n.call(a,e,a):(a.removeMinimizedReplacement(),a.status="closed",t&&document.dispatchEvent(v),document.dispatchEvent(w),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),n&&n.call(e,e)),window.removeEventListener("resize",a.windowResizeHandler),document.removeEventListener("jspanelresize",a.parentResizeHandler);}),a.close=((e,t)=>{if(a.parentElement){if(a.closetimer&&window.clearInterval(a.closetimer),document.dispatchEvent(y),a.statusBefore=a.status,a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",n=>{n.stopPropagation(),a.remove(a.id,t,e);})):a.remove(a.id,t,e);}}),a.maximize=((t,n)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(d);const o=a.parentElement,r=jsPanel.pOcontainment(e.maximizedMargin);return o===document.body?(a.style.width=document.documentElement.clientWidth-r[1]-r[3]+"px",a.style.height=document.documentElement.clientHeight-r[0]-r[2]+"px",a.style.left=r[3]+"px",a.style.top=r[0]+"px"):(a.style.width=o.clientWidth-r[1]-r[3]+"px",a.style.height=o.clientHeight-r[0]-r[2]+"px",a.style.left=r[3]+"px",a.style.top=r[0]+"px"),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),n||a.front(),document.dispatchEvent(c),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e);}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,n,o,r=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(r);break;case"parentpanel":(t=(o=(n=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[o.length-1]).append(r);break;case"parent":(t=(n=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(r);break;default:document.querySelector(e.minimizeTo).append(r);}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(l),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),C.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const n=window.getComputedStyle(a),o=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",C.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const r=a.querySelectorAll(".jsPanel-minimized-box");return r[r.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(g),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),C.style.transform="rotate(0deg)";const n=a.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore);}return a}),a.front=((t,n=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else {const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi();}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&n&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){let e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),n=a.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2]);}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`);}t||(a.snapped=a.snappableTo);}),a.move=((e,t)=>{let n=a.overlaps(e,"paddingbox"),o=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=n.left+"px",a.style.top=n.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,o),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,o)=>{e.call(t,t,n,o);}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(a,a,n),!!t&&n}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(a.headertitle).color,o=window.getComputedStyle(a),r=e.iconfont,s=t.querySelector(".jsPanel-controlbar");return "auto-show-hide"!==a.options.header?jsPanel.setStyles(t,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,s.style.color=n,s.querySelectorAll("button").forEach(e=>e.style.color=n),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e);}),a.setIconfont(r,t),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.normalize();});}):s.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.maximize();});}):s.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}):s.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e);}),a.drag=((e={})=>{let t,n,o;const r=new CustomEvent("jspaneldragstart",{detail:a.id}),s=new CustomEvent("jspaneldrag",{detail:a.id}),l=new CustomEvent("jspaneldragstop",{detail:a.id});[r,s,l].forEach(e=>e.panel=a);const i=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1);}),"snap"+t.join("")};function d(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,n,!1),a.style.opacity=1;});}let c=e.handles||jsPanel.defaults.dragit.handles,p=e.cursor||jsPanel.defaults.dragit.cursor;function h(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,n)),jsPanel.removeSnapAreas(),t){if(a.style.opacity=1,t=void 0,o.snap){switch(a.snappableTo){case"left-top":a.snap(o.snap.snapLeftTop);break;case"center-top":a.snap(o.snap.snapCenterTop);break;case"right-top":a.snap(o.snap.snapRightTop);break;case"right-center":a.snap(o.snap.snapRightCenter);break;case"right-bottom":a.snap(o.snap.snapRightBottom);break;case"center-bottom":a.snap(o.snap.snapCenterBottom);break;case"left-bottom":a.snap(o.snap.snapLeftBottom);break;case"left-center":a.snap(o.snap.snapLeftCenter);}o.snap.callback&&a.snappableTo&&"function"==typeof o.snap.callback&&(o.snap.callback.call(a,a),o.snap.repositionOnSnap&&!1!==o.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo)),a.snappableTo&&o.snap.repositionOnSnap&&o.snap[i(a.snappableTo)]&&a.repositionOnSnap(a.snappableTo);}if(a.droppableTo&&a.droppableTo){let e=a.parentElement;a.move(a.droppableTo),o.drop.callback&&o.drop.callback.call(a,a,a.droppableTo,e);}if(document.dispatchEvent(l),o.stop.length){let t=window.getComputedStyle(a),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,o.stop,!1,n,e);}a.saveCurrentPosition(),a.calcSizeFactors();}a.controlbar.style.pointerEvents="inherit",a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,h);}return a.querySelectorAll(c).forEach(l=>{l.style.touchAction="none",l.style.cursor=p,jsPanel.pointerdown.forEach(i=>{l.addEventListener(i,l=>{if(l.button&&l.button>0)return !1;if((o=Object.assign({},jsPanel.defaults.dragit,e)).disableOnMaximized&&"maximized"===a.status)return !1;if((o.containment||0===o.containment)&&(o.containment=jsPanel.pOcontainment(o.containment)),o.grid&&Array.isArray(o.grid)&&1===o.grid.length&&(o.grid[1]=o.grid[0]),o.snap&&("object"==typeof o.snap?o.snap=Object.assign({},jsPanel.defaultSnapConfig,o.snap):o.snap=jsPanel.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;a.controlbar.style.pointerEvents="none",a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let i=window.getComputedStyle(a),c=parseFloat(i.left),p=parseFloat(i.top),h=parseFloat(i.width),f=parseFloat(i.height),u=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,g=a.parentElement,b=g.getBoundingClientRect(),y=window.getComputedStyle(g),w=a.getScaleFactor(),v=0,j=jsPanel.getScrollbarWidth(g);n=(e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(r),a.style.opacity=o.opacity,a.snapped&&o.snap.resizeToPreSnap&&a.currentData.beforeSnap){a.resize(a.currentData.beforeSnap.width+" "+a.currentData.beforeSnap.height),a.setControls([".jsPanel-btn-normalize"]);let e=a.getBoundingClientRect(),t=u-(e.left+e.width),n=e.width/2;t>-n&&(v=t+n);}if(a.front(),a.snapped=!1,"maximized"===a.status&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized"),o.drop&&o.drop.dropZones){let e=o.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e);}):t.push(e);}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),o.drop.dropZones=t;}o.start.length&&jsPanel.processCallbacks(a,o.start,!1,{left:c,top:p,width:h,height:f},e);}let n,l,i,d,E,x,C,P,F,z;t=1;let S,A=e.touches?e.touches[0].clientX:e.clientX,k=e.touches?e.touches[0].clientY:e.clientY,B=window.getComputedStyle(a);if(g===document.body){let e=a.getBoundingClientRect();F=window.innerWidth-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(e.left+e.width),z=window.innerHeight-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(e.top+e.height);}else F=parseInt(y.width,10)-parseInt(y.borderLeftWidth,10)-parseInt(y.borderRightWidth,10)-(parseInt(B.left,10)+parseInt(B.width,10)),z=parseInt(y.height,10)-parseInt(y.borderTopWidth,10)-parseInt(y.borderBottomWidth,10)-(parseInt(B.top,10)+parseInt(B.height,10));n=parseFloat(B.left),i=parseFloat(B.top),E=F,C=z,o.snap&&("panel"===o.snap.trigger?(l=n**2,d=i**2,x=E**2,P=C**2):"pointer"===o.snap.trigger&&("window"===a.options.container?(n=A,l=A**2,d=(i=k)**2,x=(E=window.innerWidth-A)**2,P=(C=window.innerHeight-k)**2):(n=(S=a.overlaps(g,"paddingbox",e)).pointer.left,i=S.pointer.top,E=S.pointer.right,C=S.pointer.bottom,l=S.pointer.left**2,d=S.pointer.top**2,x=S.pointer.right**2,P=S.pointer.bottom**2)));let T=Math.sqrt(l+d),L=Math.sqrt(l+P),R=Math.sqrt(x+d),W=Math.sqrt(x+P),D=Math.abs(n-E)/2,$=Math.abs(i-C)/2,q=Math.sqrt(l+$**2),O=Math.sqrt(d+D**2),H=Math.sqrt(x+$**2),M=Math.sqrt(P+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(s),o.axis&&"x"!==o.axis||(a.style.left=c+(A-u)/w.x+v+"px"),o.axis&&"y"!==o.axis||(a.style.top=p+(k-m)/w.y+"px"),o.grid){let e=o.grid,t=o.axis,n=e[0]*Math.round((c+(A-u))/e[0]),r=e[1]*Math.round((p+(k-m))/e[1]);t&&"x"!==t||(a.style.left=`${n}px`),t&&"y"!==t||(a.style.top=`${r}px`);}if(o.containment||0===o.containment){let e,t,n=o.containment;if("window"===a.options.container)e=window.innerWidth-parseFloat(B.width)-n[1]-j.y,t=window.innerHeight-parseFloat(B.height)-n[2]-j.x;else {let o=parseFloat(y.borderLeftWidth)+parseFloat(y.borderRightWidth),a=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth);e=b.width/w.x-parseFloat(B.width)-n[1]-o-j.y,t=b.height/w.y-parseFloat(B.height)-n[2]-a-j.x;}parseFloat(a.style.left)<=n[3]&&(a.style.left=n[3]+"px"),parseFloat(a.style.top)<=n[0]&&(a.style.top=n[0]+"px"),parseFloat(a.style.left)>=e&&(a.style.left=e+"px"),parseFloat(a.style.top)>=t&&(a.style.top=t+"px");}if(o.drag.length){let t={left:n,top:i,right:E,bottom:C,width:parseFloat(B.width),height:parseFloat(B.height)};jsPanel.processCallbacks(a,o.drag,!1,t,e);}if(o.snap){let e=o.snap.sensitivity,t=g===document.body?window.innerWidth/8:b.width/8,r=g===document.body?window.innerHeight/8:b.height/8;a.snappableTo=!1,jsPanel.removeSnapAreas(),T0&&S.pointer.top>0?(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-top",jsPanel.createSnapArea(a,"lt",e))):L0&&S.pointer.bottom>0?(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-bottom",jsPanel.createSnapArea(a,"lb",e))):R0&&S.pointer.top>0?(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-top",jsPanel.createSnapArea(a,"rt",e))):W0&&S.pointer.bottom>0?(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-bottom",jsPanel.createSnapArea(a,"rb",e))):i0?(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-top",jsPanel.createSnapArea(a,"ct",e))):n0?(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="left-center",jsPanel.createSnapArea(a,"lc",e))):E0?(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="right-center",jsPanel.createSnapArea(a,"rc",e))):C0?(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)):(a.snappableTo=!1,jsPanel.removeSnapAreas())):(a.snappableTo="center-bottom",jsPanel.createSnapArea(a,"cb",e)));}if(o.drop&&o.drop.dropZones){let t=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",n=document[t](e.clientX,e.clientY);Array.isArray(n)||(n=Array.prototype.slice.call(n)),o.drop.dropZones.forEach(e=>{n.includes(e)&&(a.droppableTo=e);}),n.includes(a.droppableTo)||(a.droppableTo=!1);}}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,n)),window.addEventListener("mouseout",d,!1);});}),jsPanel.pointerup.forEach(e=>{document.addEventListener(e,h),window.removeEventListener("mouseout",d);}),e.disable&&(l.style.pointerEvents="none");}),a}),a.dragit=(t=>{const n=Object.assign({},jsPanel.defaults.dragit,e.dragit),o=a.querySelectorAll(n.handles);return "disable"===t?o.forEach(e=>e.style.pointerEvents="none"):o.forEach(e=>e.style.pointerEvents="auto"),a}),a.sizeit=((e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:a.id}),n=new CustomEvent("jspanelresize",{detail:a.id}),o=new CustomEvent("jspanelresizestop",{detail:a.id});[t,n,o].forEach(e=>e.panel=a);let r,s,l,i,d,c,p={};p.handles=e.handles||jsPanel.defaults.resizeit.handles,p.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,a.append(t);});let h=!!e.aspectRatio&&e.aspectRatio;function f(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>document.removeEventListener(e,r,!1));}function u(e){if(jsPanel.pointermove.forEach(e=>document.removeEventListener(e,r,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,n,o=e.target.className;if(o.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),o.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(n=!0),p.grid&&Array.isArray(p.grid)){1===p.grid.length&&(p.grid[1]=p.grid[0]);const e=parseFloat(a.style.width),o=parseFloat(a.style.height),r=e%p.grid[0],s=o%p.grid[1],l=parseFloat(a.style.left),i=parseFloat(a.style.top),d=l%p.grid[0],c=i%p.grid[1];rc+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(o),p.stop.length){let t=window.getComputedStyle(a),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};jsPanel.processCallbacks(a,p.stop,!1,n,e);}}a.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),p.aspectRatio=h,document.removeEventListener(e,u);}return a.querySelectorAll(".jsPanel-resizeit-handle").forEach(o=>{o.style.touchAction="none",jsPanel.pointerdown.forEach(h=>{o.addEventListener(h,o=>{if(o.preventDefault(),o.stopPropagation(),o.button&&o.button>0)return !1;let h=1;if(((p=Object.assign({},jsPanel.defaults.resizeit,e)).containment||0===p.containment)&&(p.containment=jsPanel.pOcontainment(p.containment)),p.aspectRatio&&!0===p.aspectRatio&&(p.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;e.altKey?p.aspectRatio="content":e.ctrlKey?p.aspectRatio="panel":e.shiftKey&&(p.aspectRatio=!1,h=2);}let u="function"==typeof p.maxWidth?p.maxWidth():p.maxWidth||1e4,m="function"==typeof p.maxHeight?p.maxHeight():p.maxHeight||1e4,g="function"==typeof p.minWidth?p.minWidth():p.minWidth,b="function"==typeof p.minHeight?p.minHeight():p.minHeight;a.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const y=a.parentElement,w=y.tagName.toLowerCase(),v=a.getBoundingClientRect(),j=y.getBoundingClientRect(),E=window.getComputedStyle(y,null),x=parseInt(E.borderLeftWidth,10),C=parseInt(E.borderTopWidth,10),P=E.getPropertyValue("position"),F=o.clientX||0===o.clientX||o.touches[0].clientX,z=o.clientY||0===o.clientY||o.touches[0].clientY,S=F/z,A=o.target.classList,k=a.getScaleFactor(),B=v.width/v.height,T=a.content.getBoundingClientRect(),L=T.width/T.height,R=a.header.getBoundingClientRect().height,W=a.footer.getBoundingClientRect().height||0;let D=v.left,$=v.top,q=1e4,O=1e4,H=1e4,M=1e4;d=v.width,c=v.height,"body"!==w&&(D=v.left-j.left+y.scrollLeft,$=v.top-j.top+y.scrollTop),"body"===w&&p.containment?(q=document.documentElement.clientWidth-v.left,H=document.documentElement.clientHeight-v.top,O=v.width+v.left,M=v.height+v.top):p.containment&&("static"===P?(q=j.width-v.left+x,H=j.height+j.top-v.top+C,O=v.width+(v.left-j.left)-x,M=v.height+(v.top-j.top)-C):(q=y.clientWidth-(v.left-j.left)/k.x+x,H=y.clientHeight-(v.top-j.top)/k.y+C,O=(v.width+v.left-j.left)/k.x-x,M=a.clientHeight+(v.top-j.top)/k.y-C)),p.containment&&(O-=p.containment[3],M-=p.containment[0],q-=p.containment[1],H-=p.containment[2]);const I=window.getComputedStyle(a),N=parseFloat(I.width)-v.width,V=parseFloat(I.height)-v.height;let X=parseFloat(I.left)-v.left,Y=parseFloat(I.top)-v.top;y!==document.body&&(X+=j.left,Y+=j.top);let Z=parseInt(I.borderTopWidth,10),U=parseInt(I.borderRightWidth,10),K=parseInt(I.borderBottomWidth,10),_=parseInt(I.borderLeftWidth,10);r=(e=>{e.preventDefault(),s||(document.dispatchEvent(t),p.start.length&&jsPanel.processCallbacks(a,p.start,!1,{width:d,height:c,left:D,top:$},e),a.front(),"maximized"===a.status&&(a.status="normalized",a.controlbar.querySelector(".jsPanel-btn-maximize")&&a.setControlStatus("maximize","show"),a.controlbar.querySelector(".jsPanel-btn-normalize")&&a.setControlStatus("normalize","hide")),v.height>c+5&&(a.status="normalized",a.setControls([".jsPanel-btn-normalize"]))),s=1,document.dispatchEvent(n);let r=e.touches?e.touches[0].clientX:e.clientX,f=e.touches?e.touches[0].clientY:e.clientY;A.contains("jsPanel-resizeit-e")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),"content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-s")?((i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-w")?((l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-n")?((i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-se")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),"content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-sw")?((i=c+(f-z)*h/k.y+V)>=H&&(i=H),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px",2===h&&(a.style.top=$-(f-z)+"px"),p.aspectRatio&&(a.style.width=i*B+"px"),(l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px","content"===p.aspectRatio?(a.style.height=(l-U-_)/L+R+W+Z+K+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*L+"px")):"panel"===p.aspectRatio&&(a.style.height=l/B+"px",p.containment&&(a.overlaps(y)).bottom<=p.containment[2]&&(a.style.height=H+"px",a.style.width=H*B+"px"))):A.contains("jsPanel-resizeit-ne")?((l=d+(r-F)*h/k.x+N)>=q&&(l=q),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",2===h&&(a.style.left=D-(r-F)+"px"),p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?(a.style.width=(i-R-W-Z-K)*L+Z+K+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/L+"px")):"panel"===p.aspectRatio&&(a.style.width=i*B+"px",p.containment&&(a.overlaps(y)).right<=p.containment[1]&&(a.style.width=q+"px",a.style.height=q/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(p.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(f=(r=f*S)/S),(l=d+(F-r)*h/k.x+N)<=u&&l>=g&&l<=O&&(a.style.left=D+(r-F)/k.x+X+"px"),l>=O&&(l=O),l>=u&&(l=u),l<=g&&(l=g),a.style.width=l+"px",p.aspectRatio&&(a.style.height=l/B+"px"),(i=c+(z-f)*h/k.y+V)<=m&&i>=b&&i<=M&&(a.style.top=$+(f-z)/k.y+Y+"px"),i>=M&&(i=M),i>=m&&(i=m),i<=b&&(i=b),a.style.height=i+"px","content"===p.aspectRatio?a.style.width=(i-R-W-Z-K)*L+Z+K+"px":"panel"===p.aspectRatio&&(a.style.width=i*B+"px")),window.getSelection().removeAllRanges();const w=window.getComputedStyle(a),j={left:parseFloat(w.left),top:parseFloat(w.top),right:parseFloat(w.right),bottom:parseFloat(w.bottom),width:parseFloat(w.width),height:parseFloat(w.height)};p.resize.length&&jsPanel.processCallbacks(a,p.resize,!1,j,e);}),jsPanel.pointermove.forEach(e=>document.addEventListener(e,r,!1)),window.addEventListener("mouseout",f,!1);});}),jsPanel.pointerup.forEach(function(e){document.addEventListener(e,u),window.removeEventListener("mouseout",f);}),e.disable&&(o.style.pointerEvents="none");}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return "disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return {x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height));}}),a.saveCurrentDimensions=(()=>{const e=window.getComputedStyle(a);a.currentData.width=e.width,a.currentData.height=e.height;}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top;}),a.reposition=((...t)=>{let n,o=e.position,r=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?o=e:"boolean"==typeof e?r=e:"function"==typeof e&&(n=e);}),jsPanel.position(a,o),a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),r&&a.saveCurrentPosition(),n&&n.call(a,a),a}),a.repositionOnSnap=(t=>{let n="0",o="0",r=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=r[3],o=r[0];break;case"right-top":n=-r[1],o=r[0];break;case"right-bottom":n=-r[1],o=-r[2];break;case"left-bottom":n=r[3],o=-r[2];break;case"center-top":n=r[3]/2-r[1]/2,o=r[0];break;case"center-bottom":n=r[3]/2-r[1]/2,o=-r[2];break;case"left-center":n=r[3],o=r[0]/2-r[2]/2;break;case"right-center":n=-r[1],o=r[0]/2-r[2]/2;}jsPanel.position(a,t),jsPanel.setStyles(a,{left:`calc(${a.style.left} + ${n}px)`,top:`calc(${a.style.top} + ${o}px)`});}),a.overlaps=((e,t,n)=>{let o,r=a.getBoundingClientRect(),s=getComputedStyle(a.parentElement),l=a.getScaleFactor(),i={top:0,right:0,bottom:0,left:0},d=0,c=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(i.top=parseInt(s.borderTopWidth,10)*l.y,i.right=parseInt(s.borderRightWidth,10)*l.x,i.bottom=parseInt(s.borderBottomWidth,10)*l.y,i.left=parseInt(s.borderLeftWidth,10)*l.x),o="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(d=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,p=d-o.left,h=c-o.top);let f=r.lefto.left,u=r.topo.top;return {overlaps:f&&u,top:r.top-o.top-i.top,right:o.right-r.right-i.right,bottom:o.bottom-r.bottom-i.bottom,left:r.left-o.left-i.left,parentBorderWidth:i,panelRect:r,referenceRect:o,pointer:{clientX:d,clientY:c,left:p-i.left,top:h-i.top,right:o.width-p-i.right,bottom:o.height-h-i.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height;}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%";}return a}),a.resize=((...e)=>{let t,n=window.getComputedStyle(a),o={width:n.width,height:n.height},r=!0;e.forEach(e=>{"string"==typeof e?o=e:"object"==typeof e?o=Object.assign(o,e):"boolean"==typeof e?r=e:"function"==typeof e&&(t=e);});let s=jsPanel.pOsize(a,o);a.style.width=s.width,a.style.height=s.height,a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition()),r&&a.saveCurrentDimensions(),a.status="normalized";let l=a.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.windowResizeHandler=(t=>{if(t.target===window){let n,o,r=a.status,s=e.onwindowresize;if("maximized"===r&&s)a.maximize(!1,!0);else if(a.snapped&&"minimized"!==r)a.snap(a.snapped,!0);else if("normalized"===r||"smallified"===r||"maximized"===r){let e=typeof s;"boolean"===e?(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px"):"function"===e?s.call(a,t,a):"object"===e&&(!0===s.preset?(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px",s.callback.call(a,t,a)):s.callback.call(a,t,a));}else "smallifiedmax"===r&&s&&a.maximize(!1,!0).smallify();a.slaves&&a.slaves.size>0&&a.slaves.forEach(e=>e.reposition());}}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${n}`)&&(e.style.display="block");}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none");}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",n)=>{const o=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),o.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(o.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(o),a.setAttribute(`data-btn${e}`,"removed");}return n&&n.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`);}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem");}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>a.addControl(e));}let n=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z\d]{3,}/i)[0].substring(12);n.push(t);});const o=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=o,n.forEach(e=>{o[e]&&a.setControlStatus(e,o[e]);}),a.setControlSize(o.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let n=[a.headerlogo],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?n.forEach(t=>t.innerHTML=e):n.forEach(t=>{jsPanel.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n);}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false");}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>a.setAttribute(`data-btn${e}`,"removed")),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let n=[a.headertitle],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>t.innerHTML=e):"function"==typeof e?n.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e();}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e);}),t&&t.call(a,a),a}),a.setIconfont=((e,t=a,n)=>{if(e){let n,o;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],o=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else {if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"];}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>jsPanel.emptyNode(e).innerHTML=""),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=n[a],"material-icons"===e&&(t.textContent=o[a]);});}return n&&n.call(t,t),t}),a.addToolbar=((e,t,n)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t);});else if("function"==typeof t){let n=t.call(a,a);"string"==typeof n?e.innerHTML=n:e.append(n);}else e.append(t);return e.classList.add("active"),n&&n.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;a.close(null,!0);});}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault());}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const n=a.controlbar.querySelectorAll(".jsPanel-btn").length;let o=document.createElement("button");o.innerHTML=t.html,o.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,o.style.color=a.header.style.color,t.position>n?a.controlbar.append(o):a.controlbar.insertBefore(o,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const r=t.ariaLabel||t.name;return r&&o.setAttribute("aria-label",r),jsPanel.pointerup.forEach(e=>{o.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return !1;t.handler.call(a,a,o);});}),t.afterInsert&&t.afterInsert.call(o,o),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang);});}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),o.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px";});break;case"xs":e.forEach(e=>{e.style.height="26px";});break;case"sm":e.forEach(e=>{e.style.height="30px";});break;case"lg":e.forEach(e=>{e.style.height="38px";});break;case"xl":e.forEach(e=>{e.style.height="42px";});}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t);}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t);});}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.css)for(const[t,n]of Object.entries(e.css))if("panel"===t)a.className+=` ${n}`;else {let e=a.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${n}`);}if(e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,a),e.contentFetch&&this.fetch(e.contentFetch,a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1]);}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=a.progressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),a.progressbar.classList.remove("active"),a.close();}),t.progressbar&&(a.progressbar.classList.add("active"),t.background?jsPanel.colorNames[t.background]?a.progressbar.style.background="#"+jsPanel.colorNames[t.background]:a.progressbar.style.background=t.background:a.progressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`;}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(i),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn);}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t);}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[];}),a.drag(e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors();},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[];}),a.sizeit(e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status);},!1),a.addEventListener("jspanelresizestop",n=>{n.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(i),document.dispatchEvent(s),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors());},!1);}if(a.saveCurrentDimensions(),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front();},!1);}),e.onwindowresize&&"window"===a.options.container&&window.addEventListener("resize",a.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,n=typeof t,o=a.isChildpanel();if(o){const e=o.content;let r=[];a.parentResizeHandler=(s=>{if(s.panel===o){r[0]=e.offsetWidth,r[1]=e.offsetHeight;let o,s,l=a.status;"maximized"===l&&t?a.maximize():a.snapped&&"minimized"!==l?a.snap(a.snapped,!0):"normalized"===l||"smallified"===l||"maximized"===l?"function"===n?t.call(a,a,{width:r[0],height:r[1]}):"object"===n&&!0===t.preset?(o=(r[0]-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",s=(r[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px",t.callback.call(a,a,{width:r[0],height:r[1]})):"boolean"===n&&(o=(r[0]-a.offsetWidth)*a.hf,a.style.left=o<=0?0:o+"px",s=(r[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px"):"smallifiedmax"===l&&t&&a.maximize().smallify();}}),document.addEventListener("jspanelresize",a.parentResizeHandler,!1);}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(a,a)):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(a,a)):e.callback.call(a,a)),t&&(Array.isArray(t)?t.forEach(e=>e.call(a,a)):t.call(a,a)),document.dispatchEvent(r),a}}; -/* src/JsPanel.svelte generated by Svelte v3.52.0 */ +/* src/JsPanel.svelte generated by Svelte v3.59.2 */ const get_footerToolbar_slot_changes = dirty => ({}); const get_footerToolbar_slot_context = ctx => ({}); const get_content_slot_changes = dirty => ({});