pacem 0.53.0-stevin → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/css/pacem-dark-content.min.css +1 -1
  2. package/dist/css/pacem-dark-shell.min.css +1 -1
  3. package/dist/css/pacem-dark.min.css +1 -1
  4. package/dist/css/pacem-light-content.min.css +1 -1
  5. package/dist/css/pacem-light-shell.min.css +1 -1
  6. package/dist/css/pacem-light.min.css +1 -1
  7. package/dist/css/pacem-phousys-content.min.css +1 -1
  8. package/dist/css/pacem-phousys-shell.min.css +1 -1
  9. package/dist/css/pacem-phousys.min.css +1 -1
  10. package/dist/js/azure-maps.d.ts +1 -1
  11. package/dist/js/pacem-2d.d.ts +1 -1
  12. package/dist/js/pacem-2d.js +2 -1
  13. package/dist/js/pacem-2d.min.js +2 -2
  14. package/dist/js/pacem-3d.d.ts +29 -1
  15. package/dist/js/pacem-3d.js +58 -24
  16. package/dist/js/pacem-3d.min.js +2 -2
  17. package/dist/js/pacem-charts.d.ts +1 -1
  18. package/dist/js/pacem-charts.js +2 -1
  19. package/dist/js/pacem-charts.min.js +2 -2
  20. package/dist/js/pacem-cms.d.ts +1 -1
  21. package/dist/js/pacem-cms.js +2 -1
  22. package/dist/js/pacem-cms.min.js +2 -2
  23. package/dist/js/pacem-core.d.ts +1 -1
  24. package/dist/js/pacem-core.js +2 -1
  25. package/dist/js/pacem-core.min.js +2 -2
  26. package/dist/js/pacem-foundation.d.ts +1 -1
  27. package/dist/js/pacem-foundation.js +2 -1
  28. package/dist/js/pacem-foundation.min.js +2 -2
  29. package/dist/js/pacem-fx.d.ts +1 -1
  30. package/dist/js/pacem-fx.js +2 -1
  31. package/dist/js/pacem-fx.min.js +2 -2
  32. package/dist/js/pacem-logging.d.ts +1 -1
  33. package/dist/js/pacem-logging.js +2 -1
  34. package/dist/js/pacem-logging.min.js +2 -2
  35. package/dist/js/pacem-maps.d.ts +1 -1
  36. package/dist/js/pacem-maps.js +2 -1
  37. package/dist/js/pacem-maps.min.js +2 -2
  38. package/dist/js/pacem-media.d.ts +1 -1
  39. package/dist/js/pacem-media.js +2 -1
  40. package/dist/js/pacem-media.min.js +2 -2
  41. package/dist/js/pacem-networking.d.ts +1 -1
  42. package/dist/js/pacem-networking.js +2 -1
  43. package/dist/js/pacem-networking.min.js +2 -2
  44. package/dist/js/pacem-numerical.d.ts +1 -1
  45. package/dist/js/pacem-numerical.js +2 -1
  46. package/dist/js/pacem-numerical.min.js +2 -2
  47. package/dist/js/pacem-plus.d.ts +1 -1
  48. package/dist/js/pacem-plus.js +2 -1
  49. package/dist/js/pacem-plus.min.js +2 -2
  50. package/dist/js/pacem-scaffolding.d.ts +1 -1
  51. package/dist/js/pacem-scaffolding.js +11 -1
  52. package/dist/js/pacem-scaffolding.min.js +2 -2
  53. package/dist/js/pacem-ui.d.ts +1 -1
  54. package/dist/js/pacem-ui.js +2 -1
  55. package/dist/js/pacem-ui.min.js +2 -2
  56. package/dist/js/swagger-types.d.ts +1 -1
  57. package/package.json +8 -9
@@ -1,6 +1,6 @@
1
1
  /**
2
- * pacem v0.53.0-stevin (https://js.pacem.it)
2
+ * pacem v0.53.0 (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- var Pacem,__decorate=this&&this.__decorate||function(e,t,s,a){var o,i=arguments.length,n=i<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,a);else for(var r=e.length-1;r>=0;r--)(o=e[r])&&(n=(i<3?o(n):i>3?o(t,s,n):o(t,s))||n);return i>3&&n&&Object.defineProperty(t,s,n),n};!function(e){!function(t){!function(s){let a;!function(e){e.Vertical="vertical",e.Horizontal="horizontal"}(a=s.AdapterOrientation||(s.AdapterOrientation={})),s.AdapterPageButtonRefreshEventName="pagerefresh";class AdapterPageButtonRefreshEvent extends CustomEvent{constructor(e){super(s.AdapterPageButtonRefreshEventName,{detail:e,bubbles:!1,cancelable:!1})}}s.AdapterPageButtonRefreshEvent=AdapterPageButtonRefreshEvent;let o=class PacemAdapterElement extends t.PacemAdapter{constructor(){super(...arguments),this._itemCreatedHandler=e=>{const t=e.detail.index;this._pageMap.set(t,e.detail.dom[0].firstElementChild),this._fireAdapterPageRefreshCallback(t,e.detail.item)},this._pageMap=new Map,this.interactive=!0,this.swipeEnabled=!0,this.loop=!0,this.labelCallback=(e,t)=>(t+1).toString(),this._itemRegisterHandler=s=>{let a=s.detail;!e.Utils.isNull(this._swiper)&&a instanceof t.PacemElement&&-1==a.behaviors.indexOf(this._swiper)&&a.behaviors.push(this._swiper)},this._itemUnregisterHandler=s=>{let a,o=s.detail;!e.Utils.isNull(this._swiper)&&o instanceof t.PacemElement&&(a=o.behaviors.indexOf(this._swiper))>=0&&o.behaviors.splice(a,1)},this._keydownHandler=e=>{if(this.interactive)if(this.orientation===a.Vertical)switch(e.keyCode){case 40:this._next(e);break;case 38:this._previous(e)}else switch(e.keyCode){case 39:this._next(e);break;case 37:this._previous(e)}}}masterPropertyChangedCallback(e,t,s,a){switch(super.masterPropertyChangedCallback(e,t,s,a),e){case"items":this._syncViewWithItems();break;case"index":this._index=s}}viewActivatedCallback(){super.viewActivatedCallback(),this._repeater.addEventListener(t.RepeaterItemCreateEventName,this._itemCreatedHandler,!1),this._syncViewWithItems()}disconnectedCallback(){this._repeater&&this._repeater.removeEventListener(t.RepeaterItemCreateEventName,this._itemCreatedHandler,!1),super.disconnectedCallback()}initializeCallback(){super.initializeCallback(),this.addEventListener("keydown",this._keydownHandler,!1);const t=this.master;if(!e.Utils.isNull(t)){const s=this._previousTabIndex=t.tabIndex;(!s||s<0)&&(t.tabIndex=0),t.addEventListener("keydown",this._keydownHandler,!1),t.addEventListener(e.Components.ItemRegisterEventName,this._itemRegisterHandler,!1),t.addEventListener(e.Components.ItemUnregisterEventName,this._itemUnregisterHandler,!1)}this._syncViewWithItems()}destroyCallback(){this.removeEventListener("keydown",this._keydownHandler,!1);const t=this.master;if(!e.Utils.isNull(t)){if(t.removeEventListener("keydown",this._keydownHandler,!1),t.removeEventListener(e.Components.ItemRegisterEventName,this._itemRegisterHandler,!1),t.removeEventListener(e.Components.ItemUnregisterEventName,this._itemUnregisterHandler,!1),!e.Utils.isNullOrEmpty(t.items))for(let e of t.items){const t=e.behaviors,s=t.indexOf(this._swiper);s>=0&&t.splice(s,1)}t.tabIndex=this._previousTabIndex}super.destroyCallback()}itemPropertyChangedCallback(e,t,s,a,o){super.itemPropertyChangedCallback(e,t,s,a,o),this._tickVersion(),this._fireAdapterPageRefreshCallback(e)}_fireAdapterPageRefreshCallback(e,t){var s=(t=t||this.master.items[e]).hide||!1,a=t.disabled||!1,o=this._labelCallback(t,e);const i=new AdapterPageButtonRefreshEvent({index:e,hide:s,disabled:a,content:o});this.dispatchEvent(i),s=this._isHidden(t,e,i.detail.hide),a=this._isDisabled(t,e,i.detail.disabled),o=i.detail.content;const n=this._pageMap;if(n.has(e)){const t=n.get(e),i=t.firstElementChild;let r=e=>{e&&t.removeEventListener("load",r,!1),t.hide=s,t.disabled=a,i.content=o};t.isReady?r():t.addEventListener("load",r,!1)}}_tickVersion(){this._v=Date.now()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"interval":this._resetTimer(s);break;case"swipeEnabled":this._swiper.disabled=!s||!this.interactive;break;case"interactive":this.hidden=!s,this._swiper.disabled=!s||!this.swipeEnabled;break;case"pausable":1==s?this._liPause.removeAttribute("hidden"):this._liPause.setAttribute("hidden","hidden")}}_syncViewWithItems(){if(!(!this.isReady||e.Utils.isNull(this.master)||e.Utils.isNull(this._prevBtn)||e.Utils.isNull(this._nextBtn)||e.Utils.isNull(this._repeater))){var s=this.master.items;if(this._prevBtn.hide=this._nextBtn.hide=this._panel.hide=!(s&&s.length>1),this._panel.hide=e.Utils.isNullOrEmpty(s),this._repeater.datasource=s,this._index=this.master.index,!e.Utils.isNullOrEmpty(s))for(let e of s)e instanceof t.PacemElement&&-1==e.behaviors.indexOf(this._swiper)&&e.behaviors.push(this._swiper)}}_toggle(t){(this._paused=!this._paused)?(e.avoidHandler(t),this._resetTimer(0)):this._next(t)}_resetTimer(e){clearInterval(this._handle),e>0&&(this._handle=window.setInterval(()=>{super.next()},e))}_next(t){t.type!==e.UI.SwipeEventType.SwipeLeft&&e.avoidHandler(t),this._resetTimer(this.interval),super.next(this.loop)}_previous(t){t.type!==e.UI.SwipeEventType.SwipeRight&&e.avoidHandler(t),this._resetTimer(this.interval),super.previous(this.loop)}_select(t,s){e.avoidHandler(s),this._resetTimer(this.interval),this.deselectable&&t===this._index?this.master.index=this._index=-1:super.select(t)}_isDisabled(e,t,s,a){return this._disableOrHide(e,t,s)}_isHidden(e,t,s,a){return this._disableOrHide(e,t,s)}_disableOrHide(e,s,a){const o=e instanceof t.PacemElement&&!0===a;return(-1===this._index&&!1===o||!0===o&&s===this._index)&&(this.deselectable?this.master.index=this._index=-1:super.select(s)),o}_labelCallback(e,t,s){return this.labelCallback(e,t)}};__decorate([e.ViewChild(e.P+"-repeater")],o.prototype,"_repeater",void 0),__decorate([e.ViewChild(e.P+"-button."+e.PCSS+"-adapter-previous")],o.prototype,"_prevBtn",void 0),__decorate([e.ViewChild(e.P+"-button."+e.PCSS+"-adapter-next")],o.prototype,"_nextBtn",void 0),__decorate([e.ViewChild(e.P+"-panel")],o.prototype,"_panel",void 0),__decorate([e.ViewChild(e.P+"-swipe")],o.prototype,"_swiper",void 0),__decorate([e.ViewChild("."+e.PCSS+"-adapter-dashboard > li[pacem]")],o.prototype,"_liPause",void 0),__decorate([e.Debounce()],o.prototype,"_tickVersion",null),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"pausable",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],o.prototype,"interval",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"orientation",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"interactive",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"swipeEnabled",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"deselectable",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"loop",void 0),__decorate([e.Watch({emit:!1})],o.prototype,"labelCallback",void 0),__decorate([e.Watch()],o.prototype,"_index",void 0),__decorate([e.Watch()],o.prototype,"_paused",void 0),__decorate([e.Watch()],o.prototype,"_v",void 0),__decorate([e.Throttle(333)],o.prototype,"_next",null),__decorate([e.Throttle(333)],o.prototype,"_previous",null),o=__decorate([e.CustomElement({tagName:e.P+"-adapter",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-button class="${e.PCSS}-adapter-previous" on-click=":host._previous($event)">&lt;</${e.P}-button>\n <${e.P}-button class="${e.PCSS}-adapter-next" on-click=":host._next($event)">&gt;</${e.P}-button>\n <${e.P}-swipe on-swipeleft=":host._next($event)" on-swiperight=":host._previous($event)"></${e.P}-swipe>\n <${e.P}-panel tabindex="0">\n <${e.P}-repeater>\n <ol class="${e.PCSS}-adapter-dashboard">\n <li pacem hidden>\n <${e.P}-button class="${e.PCSS}-play-pause"\n css-class="{{ {'paused' : :host._paused, 'playing': !:host._paused } }}" \n disabled="{{ !:host.pausable }}" on-click=":host._toggle($event)"></${e.P}-button>\n </li>\n <template>\n <li>\n <${e.P}-button on-click=":host._select(^index, $event)" class="${e.PCSS}-adapter-page" css-class="{{ { '${e.PCSS}-adapter-active': ^index === :host._index } }}">\n <${e.P}-span></${e.P}-span>\n </${e.P}-button>\n </li>\n </template>\n </ol></${e.P}-repeater></${e.P}-panel>`})],o),s.PacemAdapterElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemAnchorElement extends t.PacemElement{constructor(){super("link"),this._fetching=!1}get fetching(){return this._fetching}connectedCallback(){super.connectedCallback(),this.hasAttribute("tab-order")||(this.tabOrder=0)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"target":(e.Utils.isNullOrEmpty(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-target");break;case"href":(e.Utils.isNull(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-url");break;case"download":(e.Utils.isNullOrEmpty(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-download")}}emit(t){if(super.emit(t),this.disabled)return;switch(t.type){case"mousedown":e.Utils.addClass(this,e.PCSS+"-active");break;case"keydown":"Enter"===t.key&&(t.preventDefault(),e.Utils.addClass(this,e.PCSS+"-active"));break;case"blur":case"mouseup":e.Utils.removeClass(this,e.PCSS+"-active");break;case"keyup":"Enter"===t.key&&(this.click(),e.Utils.removeClass(this,e.PCSS+"-active"))}const s=this.href,a=this.target,o=this.router,i=this.download,n=()=>e.Utils.isNull(o)?s:e.Utils.URIs.format(s,o.state);e.Utils.isNull(s)||t.defaultPrevented||("click"===t.type&&t.ctrlKey||"mousedown"===t.type&&1===t.button?window.open(n(),"_blank"):"click"===t.type&&(!0===i?this._download(n()):"string"!=typeof i||e.Utils.isNullOrEmpty(i)?e.Utils.isNullOrEmpty(a)?e.Utils.isNull(o)?location.assign(s):o.path=s:window.open(n(),a):this._download(n(),i)))}async _download(t,s){this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"fetching",oldValue:this._fetching,currentValue:this._fetching=!0}));try{await e.Utils.download(t,{credentials:this.fetchCredentials,headers:this.fetchHeaders,filename:s})}finally{this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"fetching",oldValue:this._fetching,currentValue:this._fetching=!1}))}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"fetchCredentials",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],a.prototype,"fetchHeaders",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],a.prototype,"href",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],a.prototype,"target",void 0),__decorate([e.Watch({reflectBack:!1,converter:{convert:e=>{switch(e){case"true":return!0;case"false":return!1;default:return e}},convertBack:e=>e}})],a.prototype,"download",void 0),__decorate([e.Watch({reflectBack:!1,converter:e.PropertyConverters.Element})],a.prototype,"router",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-a"})],a),s.PacemAnchorElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(e){!function(e){e.ElementOrPointPropertyConverter={convert:e=>document.querySelector(e)??JSON.parse(e)}}(e.UI||(e.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o,i,n,r;!function(e){e.Menu="menu",e.Tooltip="tooltip",e.Inert="inert"}(a=s.BalloonBehavior||(s.BalloonBehavior={})),function(e){e.Hover="hover",e.Click="click",e.ContextMenu="contextmenu",e.Focus="focus"}(o=s.BalloonTrigger||(s.BalloonTrigger={})),function(e){e.Start="start",e.Center="center",e.End="end",e.Auto="auto"}(i=s.BalloonAlignment||(s.BalloonAlignment={})),function(e){e.Top="top",e.Left="left",e.Bottom="bottom",e.Right="right",e.Auto="auto",e.HorizontalAuto="x",e.VerticalAuto="y"}(n=s.BalloonPosition||(s.BalloonPosition={})),function(e){e.Auto="auto",e.Match="match"}(r=s.BalloonSizing||(s.BalloonSizing={})),s.BalloonPopupEventName="popup",s.BalloonPopoutEventName="popout";const l={Defaults:{trigger:o.Hover,position:n.Auto,size:r.Auto,behavior:a.Menu,verticalOffset:0,horizontalOffset:0,hoverDelay:250,hoverTimeout:500,align:i.Center,track:!0}},c="balloon-right balloon-left balloon-bottom balloon-top balloon-start balloon-center balloon-end",d=e.PCSS+"-balloon "+c+" balloon-out balloon-in balloon-on";let h=class PacemBalloonElement extends t.PacemElement{constructor(){super(...arguments),this._options=l.Defaults,this._originalNeighborhood=null,this._popoutDelegate=e=>{this.popout()},this._hoverDelegate=e=>{this.disabled||this.popup(this._options.hoverDelay)},this._outConditionalDelegate=e=>{(e.srcElement||e.target)!=this&&this._outDelegate(e)},this._mousedownConditionalDelegate=t=>{e.preventDefaultHandler(t),this._visible&&e.stopPropagationHandler(t)},this._outDelegate=e=>{this.popout(this._options.hoverTimeout)},this._toggleDelegate=e=>{e.preventDefault(),this._visible?this._outDelegate(e):this._hoverDelegate(e)}}get visible(){return this._visible}propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),"target"===t?(s instanceof Element&&this._removeHandlers(s),a instanceof Element||this._adjust()):"options"===t?(this.target instanceof Element&&this._removeHandlers(this.target),this._options=e.Utils.extend({},e.Utils.clone(l.Defaults),a),this._synchronizeOptions()):"disabled"===t&&a&&this.popout(),this.target instanceof Element&&"disabled"!==t&&this._setHandlers(this.target)}viewActivatedCallback(){super.viewActivatedCallback(),this._ensurePopup(),this.target=this.target||this.parentElement,this._synchronizeOptions()}disconnectedCallback(){super.disconnectedCallback(),this._destroyPopup(),this.target instanceof Element&&this._removeHandlers(this.target)}_synchronizeOptions(){const t=this,s=t.options||{};if(s.moveToRoot&&e.Utils.isNull(this._originalNeighborhood))this._originalNeighborhood={parent:t.parentElement,nextSibling:t.nextElementSibling},document.body.appendChild(t);else if(!s.moveToRoot&&!e.Utils.isNull(this._originalNeighborhood)){const s=this._originalNeighborhood.parent;e.Utils.isNull(s)||s.appendChild(t),this._originalNeighborhood=null}}_ensurePopup(){const t=this,s=t._container;return t&&s&&!e.Utils.hasClass(t,e.PCSS+"-balloon")&&(e.Utils.addClass(t,e.PCSS+"-balloon"),t.style.position="absolute",s.style.position="relative",s.style.zIndex="1",t.style.visibility="hidden"),t}_destroyPopup(){var t=this,s=t._container;e.Utils.removeClass(t,d),t.style.position="",e.Utils.isNull(s)||(s.style.position="",s.style.zIndex="")}_registerEvents(){const t=this._ensurePopup(),s=this._options;switch(s.behavior){case a.Menu:switch(s.trigger){case o.Focus:t.addEventListener("mousedown",e.stopPropagationHandler,!1),t.addEventListener("focus",this._hoverDelegate,!1);break;case o.Click:case o.ContextMenu:t.addEventListener("mousedown",e.stopPropagationHandler,!1),window.document.body.addEventListener("mousedown",this._outConditionalDelegate,!1);break;default:t.addEventListener("mouseenter",this._hoverDelegate,!1),t.addEventListener("mouseleave",this._outDelegate,!1)}break;case a.Tooltip:switch(s.trigger){case o.Focus:case o.Click:case o.ContextMenu:window.document.body.addEventListener("mousedown",this._outConditionalDelegate,!1)}}}_unregisterEvents(){var t=this._ensurePopup(),s=this._options;switch(s.behavior){case a.Menu:switch(s.trigger){case o.Focus:t.removeEventListener("mousedown",e.stopPropagationHandler,!1),t.removeEventListener("focus",this._hoverDelegate,!1);break;case o.Click:case o.ContextMenu:t.removeEventListener("mousedown",e.stopPropagationHandler,!1),window.document.body.removeEventListener("mousedown",this._outConditionalDelegate,!1);break;default:t.removeEventListener("mouseenter",this._hoverDelegate,!1),t.removeEventListener("mouseleave",this._outDelegate,!1)}break;case a.Tooltip:switch(s.trigger){case o.Click:case o.ContextMenu:window.document.body.removeEventListener("mousedown",this._outConditionalDelegate,!1)}}}_onLayoutChange(e){this._visible&&this._adjust()}_adjust(){const t=this,s=t.target;if(e.Utils.isNull(s))return;const a=s instanceof Element?e.Utils.offset(s):{top:s.y,left:s.x,width:0,height:0},o=e.Utils.windowSize;var d=this._options,h=d.position,p=d.align;if(h!=n.Top&&h!=n.Bottom&&h!=n.Left&&h!=n.Right){let t=o.height,s=o.width;const i=a.left-e.Utils.scrollLeft,r=a.top-e.Utils.scrollTop,l=t-(r+a.height),c=s-(i+a.width);if(h===n.HorizontalAuto)h=i>c?n.Left:n.Right;else h=r>l?n.Top:n.Bottom}if(d.size===r.Match)switch(h){case n.Bottom:case n.Top:t.style.minWidth=a.width+"px",t.style.minHeight="";break;case n.Left:case n.Right:t.style.minHeight=a.height+"px",t.style.minWidth=""}else t.style.minWidth=t.style.minHeight="";const m=t.offsetWidth,u=t.offsetHeight,v=a.width-m,_=.5*v,g=a.height-u,b=.5*g;switch(p){case i.Center:case i.Start:case i.End:break;case i.Auto:switch(p=i.Center,h){case n.Right:case n.Left:const t=e.Utils.scrollTop+o.height/2;a.top+a.height<t?p=i.Start:a.top>t&&(p=i.End);break;case n.Top:case n.Bottom:const s=e.Utils.scrollLeft+o.width/2;a.left+a.width<s?p=i.Start:a.left>s&&(p=i.End)}break;default:p=l.Defaults.align}e.Utils.removeClass(t,c),e.Utils.addClass(t,"balloon-"+h),e.Utils.addClass(t,"balloon-"+p);const y=e.Utils.Css.getVariableValue(`--${e.PCSS}-balloon-tail-size`),C=e.Utils.Css.getVariableValue(`--${e.PCSS}-balloon-tail-inset`),f=parseInt(C)+.5*parseInt(y),P=a.width/2,w=a.height/2,E=d.autoAdjust&&f>P,k=d.autoAdjust&&f>w;switch(h){case n.Top:switch(a.top-=u,p){case i.Center:a.left+=_;break;case i.End:a.left+=v,E&&(a.left+=f-P);break;case i.Start:E&&(a.left-=f-P)}break;case n.Left:switch(a.left-=m,p){case i.Center:a.top+=b;break;case i.End:a.top+=g,k&&(a.top+=f-w);break;case i.Start:k&&(a.top-=f-w)}break;case n.Right:switch(a.left+=a.width,p){case i.Center:a.top+=b;break;case i.End:a.top+=g,k&&(a.top+=f-w);break;case i.Start:k&&(a.top-=f-w)}break;default:switch(a.top+=a.height,p){case i.Center:a.left+=_;break;case i.End:a.left+=v,E&&(a.left+=f-P);break;case i.Start:E&&(a.left-=f-P)}}a.left=Math.min(o.width-m,Math.max(0,a.left)),a.top+=d.verticalOffset,a.left+=d.horizontalOffset,t.style.top=Math.round(a.top)+"px",t.style.left=Math.round(a.left)+"px"}_adjustWatchers(t){const s=this.options||{};e.Utils.isNull(this._resize)||(this._resize.disabled=!t,this._position.disabled=!t||!(s.track||s.trackPosition))}popup(t=0){if(clearTimeout(this._timer),t>0)return void(this._timer=setTimeout(()=>this.popup(),t));const a=this,o=e.Utils.isVisible(a);this._adjustWatchers(!0),o||this.disabled||(this._registerEvents(),a.style.pointerEvents="none",this._visible=!0,a.style.visibility="visible",this._adjust(),e.Utils.addClass(a,"balloon-in"),e.Utils.addAnimationEndCallback(a,()=>{e.Utils.addClass(a,"balloon-on"),a.dispatchEvent(new e.PropertyChangeEvent({propertyName:"visible",oldValue:!1,currentValue:!0})),a.dispatchEvent(new Event(s.BalloonPopupEventName)),a.style.pointerEvents="auto"},500))}popout(t=0){if(clearTimeout(this._timer),t>0)return void(this._timer=setTimeout(()=>this.popout(),t));var a=this;const o=e.Utils.isVisible(a);this._adjustWatchers(!1),o&&(this._unregisterEvents(),a.style.pointerEvents="none",e.Utils.removeClass(a,"balloon-in balloon-on"),e.Utils.addClass(a,"balloon-out"),e.Utils.addAnimationEndCallback(a,()=>{a.style.visibility="hidden",this._visible=!1,e.Utils.removeClass(a,d),a.dispatchEvent(new Event(s.BalloonPopoutEventName)),a.dispatchEvent(new e.PropertyChangeEvent({propertyName:"visible",oldValue:!0,currentValue:!1}))},500))}toggle(t=0){e.Utils.isVisible(this)||this.disabled?this.popout(t):this.popup(t)}_removeHandlers(t){e.Utils.isNull(t)||(t.removeEventListener("mouseenter",this._hoverDelegate,!1),t.removeEventListener("mouseleave",this._outDelegate,!1),t.removeEventListener("mousedown",this._popoutDelegate,!1),t.removeEventListener("mousedown",this._mousedownConditionalDelegate,!1),t.removeEventListener("click",this._toggleDelegate,!1),t.removeEventListener("focus",this._hoverDelegate,!1),t.removeEventListener("blur",this._outDelegate,!1),t.removeEventListener("contextmenu",this._toggleDelegate,!1))}_setHandlers(e){this.popout();var t=this._options;if(t.behavior!=a.Inert)switch(t.trigger){case o.Hover:e.addEventListener("mouseenter",this._hoverDelegate,!1),e.addEventListener("mouseleave",this._outDelegate,!1),e.addEventListener("mousedown",this._popoutDelegate,!1);break;case o.Focus:e.addEventListener("focus",this._hoverDelegate,!1),e.addEventListener("blur",this._outDelegate,!1);break;case o.Click:t.hoverDelay=t.hoverTimeout=0,e.addEventListener("mousedown",this._mousedownConditionalDelegate,!1),e.addEventListener("click",this._toggleDelegate,!1);break;case o.ContextMenu:t.hoverDelay=t.hoverTimeout=0,e.addEventListener("contextmenu",this._toggleDelegate,!1)}}};__decorate([e.ViewChild(`.${e.PCSS}-balloon`)],h.prototype,"_container",void 0),__decorate([e.ViewChild(e.P+"-resize[content]")],h.prototype,"_resize",void 0),__decorate([e.ViewChild(e.P+"-resize[watch-position=true]")],h.prototype,"_position",void 0),__decorate([e.Watch({converter:s.ElementOrPointPropertyConverter})],h.prototype,"target",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],h.prototype,"options",void 0),h=__decorate([e.CustomElement({tagName:e.P+"-balloon",shadow:!0,template:`<${e.P}-resize target="{{ :host.target }}" disabled="true" watch-position="true" on-${t.ResizeEventName}=":host._onLayoutChange($event)"></${e.P}-resize>\n<div class="${e.PCSS}-balloon"><${e.P}-resize on-${t.ResizeEventName}=":host._onLayoutChange($event)" disabled="true" content><slot></slot></${e.P}-resize></div>\n<div class="corner top-left" part="corner-topleft"></div><div class="corner bottom-left" part="corner-bottomleft"></div><div class="corner top-right" part="corner-topright"></div><div class="corner bottom-right" part="corner-bottomright"></div>`})],h),s.PacemBalloonElement=h}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o,i;!function(e){e.Auto="auto",e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e.Center="center"}(a=s.BinderAnchor||(s.BinderAnchor={})),function(e){e.Default="default",e.Arrow="arrow",e.FatArrow="fatarrow",e.None="none"}(o=s.BinderEnd||(s.BinderEnd={})),function(e){e.Mass="mass",e.Path="path"}(i=s.BinderTension||(s.BinderTension={})),s.BinderInteractionEventName="interact";class BinderInteractionEvent extends e.CustomUIEvent{constructor(e){super(s.BinderInteractionEventName,null,e)}}s.BinderInteractionEvent=BinderInteractionEvent;const n="pacem:components:ui:binders";class BindersCollector{constructor(e){this.binders=[],this.fire=e=>{for(var t of this.binders)t.refresh(this.resize.target,e.detail)};const s=this.resize=new t.PacemResizeElement;s.target=e,s.watchPosition=!0,document.body.appendChild(s)}dispose(){this.resize.remove()}}class BinderUtils{static{this._pageBinders=[]}static _updateResizeListener(){const s=this._pageBinders;if(e.Utils.isNull(this._bodyResizeListener)){const a=this._bodyResizeListener=new t.PacemResizeElement;a.target=document.body,document.body.appendChild(a),document.addEventListener(e.Components.ResizeEventName,()=>{for(let e of s)e.invalidateSize()},!1)}this._bodyResizeListener.disabled=0===s.length}static register(t,s){var a=e.CustomElementUtils.getAttachedPropertyValue(t,n),o=this._pageBinders;e.Utils.isNull(a)&&(a=new BindersCollector(t),e.CustomElementUtils.setAttachedPropertyValue(t,n,a)),-1==a.binders.indexOf(s)&&(0===a.binders.length&&a.resize.addEventListener(e.Components.ResizeEventName,a.fire,!1),s.refresh(t,a.resize.currentSize),a.binders.push(s)),-1===o.indexOf(s)&&(o.push(s),this._updateResizeListener())}static unregister(t,s){var a,o,i=e.CustomElementUtils.getAttachedPropertyValue(t,n),r=this._pageBinders;!e.Utils.isNull(i)&&(a=i.binders.indexOf(s))>-1&&(i.binders.splice(a,1),0===i.binders.length&&(i.resize.removeEventListener(e.Components.ResizeEventName,i.fire,!1),i.dispose(),e.CustomElementUtils.deleteAttachedPropertyValue(t,n))),(o=r.indexOf(s))>=0&&(r.splice(o,1),this._updateResizeListener())}}const r=["click","dblclick","mouseover","mouseout","mouseenter","mouseleave","mousedown","mouseup","mousemove","contextmenu"];let l=class PacemBinderElement extends t.PacemElement{constructor(){super(...arguments),this._broadcastHandler=e=>{var t=new BinderInteractionEvent(e);this.dispatchEvent(t)},this._state={}}connectedCallback(){super.connectedCallback(),this._ensurePath()}viewActivatedCallback(){super.viewActivatedCallback(),this.from instanceof Element&&BinderUtils.register(this.from,this),this.to instanceof Element&&BinderUtils.register(this.to,this)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"from":case"to":s instanceof Element&&BinderUtils.unregister(s,this),a instanceof Element?BinderUtils.register(a,this):this.refresh(a);break;case"fromLimit":case"toLimit":case"fromEnd":case"toEnd":case"tension":this._draw();break;case"fromAnchor":this.refresh(this.from);break;case"toAnchor":this.refresh(this.to);break;case"cssClass":e.Utils.isNull(this._svg)||this._svg.setAttribute("class",e.PCSS+"-binder "+this.className);break;case"hide":o||this._setPathVisibility()}}disconnectedCallback(){e.Utils.isNull(this._path)||(r.forEach(e=>{this._path.removeEventListener(e,this._broadcastHandler,!1)}),this._svg.remove(),this._path=void 0),this.from instanceof Element&&BinderUtils.unregister(this.from,this),this.to instanceof Element&&BinderUtils.unregister(this.to,this),super.disconnectedCallback()}_setPathVisibility(t=this._path,s=this.hide,a=this.interactive){e.Utils.isNull(t)||(s?t.setAttribute("display","none"):t.removeAttribute("display"),a?(t.setAttribute("pointer-events","visibleStroke"),t.tabIndex=0):(t.removeAttribute("pointer-events"),t.tabIndex=-1))}_ensurePath(){if(e.Utils.isNull(this._path)){let t=this._svg=document.createElementNS("http://www.w3.org/2000/svg","svg");t.style.position="absolute",e.Utils.addClass(t,e.PCSS+"-binder "+this.className),t.style.top="0",t.style.left="0",t.style.overflow="hidden",t.style.pointerEvents="none";const s=this._path=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("fill","none"),s.setAttribute("display","none"),this._setPathVisibility(),t.appendChild(s),this.invalidateSize(),document.body.appendChild(t),r.forEach(e=>{s.addEventListener(e,this._broadcastHandler,!1)})}}invalidateSize(){const t=this._svg;e.Utils.isNull(t)||(t.setAttribute("width",document.body.scrollWidth.toString()),t.setAttribute("height",document.body.scrollHeight.toString()))}_computeAnchorPoints(t,s,n,r,l,c,d){var h,p,m,u;const v=t.top,_=t.left,g=t.width,b=t.height,y=g/2,C=b/2,f=r.top,P=r.left,w=r.width,E=r.height,k=w/2,x=E/2,U={x:_+y,y:v+C},S={x:P+k,y:f+x},$={x:_+y,y:v},A={x:_+y,y:v+b},D={x:_,y:v+C},N={x:_+g,y:v+C},L={x:P+k,y:f},T={x:P+k,y:f+E},H={x:P,y:f+x},B={x:P+w,y:f+x},O={p1_top:$,p1_bottom:A,p1_left:D,p1_right:N,p2_top:L,p2_bottom:T,p2_left:H,p2_right:B};var W={};function I(t,s){const a=t+"_"+s;return W[a]=W[a]||e.Point.distance(O["p1_"+t],O["p2_"+s])}if(s==a.Auto||l==a.Auto){const e={x:U.x,y:-U.y},t={x:S.x,y:-S.y},o=180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI;switch(o){case 0:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left);break;case 90:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom);break;case 180:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case-90:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top);break;default:if(o<90&&o>0){let e=I("top","left"),t=I("right","left"),o=I("right","bottom"),i=I("top","bottom");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Left);break;case i:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom);break;case o:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Bottom);break;default:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left)}}else if(o<180&&o>90){let e=I("top","right"),t=I("left","right"),o=I("left","bottom"),i=I("top","bottom");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Right);break;case t:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case o:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Bottom);break;default:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom)}}else if(o<-90){let e=I("bottom","right"),t=I("left","right"),o=I("left","top"),i=I("bottom","top");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Right);break;case t:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case o:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Top);break;default:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top)}}else{let e=I("bottom","left"),t=I("right","left"),o=I("right","top"),i=I("bottom","top");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Left);break;case t:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left);break;case o:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Top);break;default:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top)}}}}function R(e){switch(e){case o.Arrow:case o.FatArrow:return 2;default:return 1}}const M=R(n),z=R(c);switch(s){case a.Bottom:h=A;break;case a.Center:m=h={x:_+y,y:v+C};break;case a.Left:h=D;break;case a.Right:h=N;break;case a.Top:h=$}switch(l){case a.Bottom:p=T;break;case a.Center:u=p={x:P+k,y:f+x};break;case a.Left:p=H;break;case a.Right:p=B;break;case a.Top:p=L}if(d===i.Path){const e=.333;switch(s){case a.Bottom:m={x:h.x,y:h.y+Math.abs(M*e*(p.y-h.y))};break;case a.Left:m={x:h.x-Math.abs(M*e*(p.x-h.x)),y:h.y};break;case a.Right:m={x:h.x+Math.abs(M*e*(p.x-h.x)),y:h.y};break;case a.Top:m={x:h.x,y:h.y-Math.abs(M*e*(h.y-p.y))}}switch(l){case a.Bottom:u={x:p.x,y:p.y+Math.abs(z*e*(p.y-h.y))};break;case a.Left:u={x:p.x-Math.abs(z*e*(p.x-h.x)),y:p.y};break;case a.Right:u={x:p.x+Math.abs(z*e*(p.x-h.x)),y:p.y};break;case a.Top:u={x:p.x,y:p.y-Math.abs(z*e*(p.y-h.y))}}}else{switch(s){case a.Bottom:m={x:h.x,y:h.y+Math.abs(M*(A.y-U.y))};break;case a.Left:m={x:h.x-Math.abs(M*(U.x-D.x)),y:h.y};break;case a.Right:m={x:h.x+Math.abs(M*(N.x-U.x)),y:h.y};break;case a.Top:m={x:h.x,y:h.y-Math.abs(M*($.y-U.y))}}switch(l){case a.Bottom:u={x:p.x,y:p.y+Math.abs(z*(T.y-S.y))};break;case a.Left:u={x:p.x-Math.abs(z*(S.x-H.x)),y:p.y};break;case a.Right:u={x:p.x+Math.abs(z*(B.x-S.x)),y:p.y};break;case a.Top:u={x:p.x,y:p.y-Math.abs(z*(L.y-S.y))}}}return{points:[h,m,p,u],anchors:[s,l]}}refresh(t,s){var o;if(e.Utils.isNull(t)||e.Utils.isNull(o=this._path))return;const i=!e.Utils.isNull(this.from)&&!e.Utils.isNull(this.to),n=e.Utils.isNull(this.from)&&e.Utils.isNull(this.to);if((this.disabled||!i)&&(o.removeAttribute("d"),n))return;const r=t===this.from?"from":"to";var l=("from"===r?this.fromAnchor:this.toAnchor)||a.Auto;e.Utils.isNull(s)&&(t instanceof Element?r in this._state&&(s=this._state[r].size):(s={height:0,width:0,left:t.x,top:t.y},l=a.Center)),e.Utils.isNull(s)||(this._state[r]={size:s,anchor:l},i&&this._draw())}_draw(){var t=this._state.from,s=this._state.to,a=this._path;if(e.Utils.isNull(a))return;if(e.Utils.isNullOrEmpty(t)||e.Utils.isNullOrEmpty(s)||this.from instanceof HTMLElement&&!e.Utils.isVisible(this.from)||this.to instanceof HTMLElement&&!e.Utils.isVisible(this.to))return void a.setAttribute("d","");const{points:i,anchors:n}=this._computeAnchorPoints(t.size,t.anchor,this.fromEnd,s.size,s.anchor,this.toEnd,this.tension),r=i[0],l=i[1],c=i[2],d=i[3],h=n[0],p=n[1],m=r.x,u=r.y,v=l.x,_=l.y,g=c.x,b=c.y,y=d.x,C=d.y;let f=this._getDefaultEndingPath(m,u);switch(this.fromEnd){case o.Arrow:f=this._getArrowEndingPath(m,u,h);break;case o.FatArrow:f=this._getFatArrowEndingPath(m,u,h);break;case o.None:f=""}let P=this._getDefaultEndingPath(g,b);switch(this.toEnd){case o.Arrow:P=this._getArrowEndingPath(g,b,p);break;case o.FatArrow:P=this._getFatArrowEndingPath(g,b,p);break;case o.None:P=""}const w=f+`M${m},${u} C${v},${_} ${y},${C} ${g},${b}`+P;-1===w.indexOf("NaN")&&a.setAttribute("d",w),e.Utils.isNullOrEmpty(this.color)||(a.style.stroke=this.color)}_getDefaultEndingPath(e,t){return`M${e-2},${t-2} h4 v4 h-4 z`}_getArrowEndingPath(e,t,s){switch(s){case a.Bottom:return`M${e-4},${t+4} l4,-4 l4,4`;case a.Top:return`M${e-4},${t-4} l4,4 l4,-4`;case a.Left:return`M${e-4},${t-4} l4,4 l-4,4`;case a.Right:return`M${e+4},${t-4} l-4,4 l4,4`;default:return""}}_getFatArrowEndingPath(e,t,s){switch(s){case a.Bottom:case a.Top:case a.Left:case a.Right:return this._getArrowEndingPath(e,t,s)+" z";default:return""}}};__decorate([e.Watch({emit:!1,converter:s.ElementOrPointPropertyConverter})],l.prototype,"from",void 0),__decorate([e.Watch({emit:!1,converter:s.ElementOrPointPropertyConverter})],l.prototype,"to",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"fromAnchor",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"toAnchor",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"fromEnd",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"toEnd",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"tension",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"color",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],l.prototype,"interactive",void 0),l=__decorate([e.CustomElement({tagName:e.P+"-binder"})],l),s.PacemBinderElement=l}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemBladeElement extends t.PacemElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"open"===e&&this._toggle(s)}_toggle(t=this.open){(t?e.Utils.addClass:e.Utils.removeClass)(this,"blade-open");const s=t?"open":"close";this.dispatchEvent(new Event(s))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"open",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-blade",shadow:!0})],a),s.PacemBladeElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemButtonElement extends t.PacemIterableElement{constructor(){super("button")}connectedCallback(){super.connectedCallback(),this.hasAttribute("tab-order")||(this.tabOrder=0)}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"iconGlyph":case"iconUrl":this.dataset[e]=s}}emit(t){let a=s=>{if(super.emit(s),!s.defaultPrevented)if("click"!==s.type||e.Utils.isNullOrEmpty(this.commandName))switch(s.type){case"mousedown":0===t.button&&e.Utils.addClass(this,e.PCSS+"-active");break;case"keydown":32!==s.keyCode&&13!==s.keyCode||(t.preventDefault(),e.Utils.addClass(this,e.PCSS+"-active"));break;case"blur":case"mouseup":e.Utils.removeClass(this,e.PCSS+"-active");break;case"keyup":32!==s.keyCode&&13!==s.keyCode||(this.click(),e.Utils.removeClass(this,e.PCSS+"-active"))}else this.dispatchEvent(new e.CommandEvent({commandName:this.commandName,commandArgument:this.commandArgument}))};this.disabled||"click"!==t.type||e.Utils.isNull(this.confirmationDialog)?t instanceof MouseEvent&&0!==t.button||a(t):this.confirmationDialog.open(this.confirmationMessage).then(e=>{e.button!==s.DialogButton.Yes&&e.button!==s.DialogButton.Ok||a(t)})}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"iconGlyph",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"iconUrl",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"commandName",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],a.prototype,"commandArgument",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"confirmationMessage",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],a.prototype,"confirmationDialog",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-button"})],a),s.PacemButtonElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemButtonsetElement extends t.PacemIterativeElement{connectedCallback(){super.connectedCallback(),"tabindex"in this.attributes||(this.tabIndex=0)}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),"index"===e){let e=0;for(var o of this.items){if(e==s){o.focus();break}e++}}}validate(e){return e instanceof s.PacemButtonElement}};a=__decorate([e.CustomElement({tagName:e.P+"-buttonset"})],a),s.PacemButtonsetElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Month="month",e.Week="week",e.Day="day"}(a=s.CalendarZoom||(s.CalendarZoom={}));class ViewDateChangeEvent extends e.CustomTypedEvent{constructor(e){super("viewdatechange",e)}}s.ViewDateChangeEvent=ViewDateChangeEvent;class DateSelectEvent extends e.CustomTypedEvent{constructor(e){super("dateselect",e,{bubbles:!0})}}s.DateSelectEvent=DateSelectEvent;class TimeSelectEvent extends e.CustomTypedEvent{constructor(e){super("timeselect",e,{bubbles:!0})}}s.TimeSelectEvent=TimeSelectEvent;const o=36e5,i=864e5,n=[0,.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5];let r=new Date;const l=e.Utils.Dates.dateOnly(r).valueOf(),c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];let d=class PacemCalendarEventElement extends t.PacemItemElement{propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),cancelAnimationFrame(this._handle),this._handle=requestAnimationFrame(()=>{let t=this.container;e.Utils.isNull(t)||t.dispatchEvent(new e.PropertyChangeEvent({propertyName:"items",oldValue:t.items,currentValue:t.items}))})}};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],d.prototype,"start",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],d.prototype,"end",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],d.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Json})],d.prototype,"place",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],d.prototype,"allDay",void 0),d=__decorate([e.CustomElement({tagName:e.P+"-calendar-event"})],d),s.PacemCalendarEventElement=d;class CalendarEventSelectEvent extends e.CustomTypedEvent{constructor(e){super("eventselect",e,{bubbles:!1,cancelable:!0})}}s.CalendarEventSelectEvent=CalendarEventSelectEvent;class CalendarEventUnselectEvent extends e.CustomTypedEvent{constructor(e){super("eventunselect",e,{bubbles:!1,cancelable:!0})}}s.CalendarEventUnselectEvent=CalendarEventUnselectEvent;class PacemCalendarBaseElement extends t.PacemItemsContainerElement{validate(e){return e instanceof d}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),"viewDate"!==t&&"weekStart"!==t||this._synchronizeWeek(),t){case"viewDate":this.dispatchEvent(new ViewDateChangeEvent(a)),e.Utils.removeClass(this,"viewdate-next viewdate-previous"),requestAnimationFrame(()=>{e.Utils.addClass(this,s>a?"viewdate-previous":"viewdate-next")});break;case"zoom":e.Utils.removeClass(this,"viewdate-next viewdate-previous")}}oneventselect(e,t){this.dispatchEvent(new CalendarEventSelectEvent({element:e,event:t}))}oneventunselect(e,t){this.dispatchEvent(new CalendarEventUnselectEvent({element:e,event:t}))}getHeaderLabel(t,s){const o=s===a.Week?{weekday:"short",day:"numeric",month:"numeric"}:s===a.Day?{weekday:"long"}:{weekday:"short"};return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),o)}getDayLabel(t){const s=1==t.getDate()?{month:"short",day:"numeric"}:{day:"numeric"};return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),s)}getHourLabel(t){return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),{hour:"numeric"})}getTimeLabel(t){return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),{hour:"numeric",minute:"numeric"})}isNow(t,s){const a=e.Utils.parseDate(t),o=e.Utils.parseDate(s||new Date);return a.getHours()===o.getHours()&&this.isToday(t,s)}isToday(e,t){return this.isDate(e,t||new Date)}isViewDay(e,t=this.viewDate){return this.isDate(e,t||this.viewDate||new Date)}isDate(t,s){if(!e.Utils.Dates.isDate(s)||!e.Utils.Dates.isDate(t))return!1;const a=e.Utils.parseDate(t),o=e.Utils.parseDate(s);return a.getDate()===o.getDate()&&a.getMonth()==o.getMonth()&&a.getFullYear()===o.getFullYear()}isViewWeek(t){const s=e.Utils.parseDate(t);return this.week&&this.week.find(e=>e.getDate()==s.getDate()&&e.getMonth()==s.getMonth()&&e.getDate()==s.getDate())}isViewMonth(t){const s=e.Utils.parseDate(t),a=e.Utils.parseDate(this.viewDate||new Date);return s.getMonth()==a.getMonth()&&s.getFullYear()===a.getFullYear()}isTimeSlotDisabled(t,s,a){if(!e.Utils.isNullOrEmpty(t)){a=a||0;const o=new Date(s.getFullYear(),s.getMonth(),s.getDate(),Math.floor(a),a%1*60),i=o.getTimezoneOffset(),n=o.valueOf()-60*i*1e3;for(let s of t){let t=e.Utils.Dates.parse(s.from),a=e.Utils.Dates.parse(s.to);if((!t||t&&t.valueOf()<=n)&&(!a||a&&a.valueOf()>n)&&(a||t))return!0}}return!1}_getWeekStart(e,t){let s=e.getDay(),a=e.valueOf();const o=(t||"m").toLowerCase().startsWith("m")?1:0;return s===o?a:(0===s&&(s=7),a+(o-s)*i)}_getDatasource(t,s=this.weekStart){let a=e.Utils.Dates.dateOnly(e.Utils.parseDate(t));const n=this.month;let r=n&&n.length&&n[0]&&n[0].length&&n[0][0];if(r&&r.getMonth()==a.getMonth()&&r.getFullYear()==a.getFullYear()&&n.find(t=>!e.Utils.isNull(t.find(e=>e.valueOf()==a.valueOf()))))return n;let l=new Date(a.getFullYear(),a.getMonth(),1),c=this._getWeekStart(l,s),d=[],h=[];do{let t=e.Utils.Dates.dateOnly(new Date(c));h.push(t),7==h.length&&d.push(h.splice(0)),c=t.valueOf()+i+o}while(d.length<6);return this.month=d}_synchronizeWeek(){const t=e.Utils.parseDate(this.viewDate),s=new Date(t.getFullYear(),t.getMonth(),1),a=this._getDatasource(s,this.weekStart).filter((e,s)=>e.some(e=>e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear()))[0];this.week&&this.week.length&&this.week[0]===a[0]||(this.week=a)}}__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],PacemCalendarBaseElement.prototype,"viewDate",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],PacemCalendarBaseElement.prototype,"now",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],PacemCalendarBaseElement.prototype,"zoom",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],PacemCalendarBaseElement.prototype,"weekStart",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"week",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"month",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"disabledRanges",void 0),s.PacemCalendarBaseElement=PacemCalendarBaseElement;class PacemCalendarWithEventsBaseElement extends PacemCalendarBaseElement{constructor(){super(...arguments),this._datasource=[]}get datasource(){return this._datasource}_getSortedItems(e){return e.slice().sort((e,t)=>{const s=e.start.valueOf(),a=t.start.valueOf();if(s!=a)return s<a?-1:1;const o=e.end.valueOf()-s,i=t.end.valueOf()-a;return o!=i?o>i?-1:1:0})}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"month":case"week":case"items":case"zoom":case"viewDate":cancelAnimationFrame(this._handle),this._handle=requestAnimationFrame(()=>{let t=this._datasource,s=this._datasource=this.buildDataSource(this._getSortedItems(this.items||[]));this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"datasource",oldValue:t,currentValue:s}))})}}}function h(t,s){let a=s.length-1,o=s[0].valueOf(),i=s[a].valueOf();return t.filter(t=>{let s=e.Utils.Dates.dateOnly(t.start),a=e.Utils.Dates.dateOnly(t.end);return s.valueOf()<=i&&a.valueOf()>=o}).map(t=>{let o=e.Utils.Dates.dateOnly(t.start),i=s.find(e=>e.valueOf()==o.valueOf()),n=s.indexOf(i),r=e.Utils.Dates.dateOnly(t.end),l=s.find(e=>e.valueOf()==r.valueOf()),c=s.indexOf(l),d=-1==n?0:n,h=-1==c?a:c;return{start:t.start,end:t.end,allDay:!0,day:d,continuing:{start:-1==n,end:-1==c},span:h+1-d,caption:t.caption,event:t}})}s.PacemCalendarWithEventsBaseElement=PacemCalendarWithEventsBaseElement;let p=class PacemAgendaElement extends PacemCalendarWithEventsBaseElement{constructor(){super(...arguments),this._allDayDatasource=[]}buildDataSource(t){var s=this.week;this.zoom===a.Day&&(s=[e.Utils.Dates.dateOnly(this.viewDate)]);let o=[];if(!e.Utils.isNull(s)){this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"allDayDatasource",oldValue:this._allDayDatasource,currentValue:this._allDayDatasource=h(t.filter(e=>e.end.valueOf()-e.start.valueOf()>=i),s)}));for(let a=0;a<s.length;a++){let r=s[a].valueOf(),l=t.filter(t=>{let s=e.Utils.Dates.dateOnly(t.start),a=e.Utils.Dates.dateOnly(t.end);return s.valueOf()<=r&&a.valueOf()>=r}).map(e=>{let t=e.start.valueOf(),s=e.end.valueOf(),a={allDay:e.allDay||s-t>=i,continuing:{start:t<r,end:s>r+i},caption:e.caption,hour:0,span:n.length-1,offset:{start:"0",end:"0"},event:e},o=e.start.getHours()+e.start.getMinutes()/60,l=a.continuing.start?0:Math.floor(2*o),c=e.end.getHours()+e.end.getMinutes()/60,d=-1+(a.continuing.end?n.length:Math.ceil(2*c)),h=d+1,p=h>=n.length?24:n[h],m=p-n[l];return a.hour=l,a.span=1+d-l,a.continuing.start||(a.offset.start=(o-n[l])/m*100+"%"),a.continuing.end||(a.offset.end=(p-c)/m*100+"%"),a});o.push(l)}}return o}get allDayDatasource(){return this._allDayDatasource}propertyChangedCallback(t,s,o,i){super.propertyChangedCallback(t,s,o,i);const n=this._clock;if("time"===t)this.dispatchEvent(new TimeSelectEvent(o));else if(!e.Utils.isNull(n)&&("now"===t&&(n.now=o,n.className=`hour-${o.getHours()} minute-${o.getMinutes()}`),"now"===t||"zoom"===t||"viewDate"===t)){const e=this.now,t=this.zoom,s=e&&t&&(this.isViewDay(e)&&t===a.Day||this.isViewWeek(e)&&t===a.Week);n.hidden=!s}}};__decorate([e.ViewChild(e.P+"-clock")],p.prototype,"_clock",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],p.prototype,"time",void 0),p=__decorate([e.CustomElement({tagName:e.P+"-agenda",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-agenda agenda-grid" datasource="{{ :host.datasource }}">${function(){let t="";for(let s=0;s<7;s++)0==s&&(t+='<div class="agenda-left all-day"></div>'),t+=`<${e.P}-panel class="agenda-slot all-day day-${s+1}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate), 'today': :host.isToday(:host.week[${s}], :host.now)} }}"></${e.P}-panel>`;for(let s=0;s<7;s++)for(let a of n){let i=a%1==0,n="hour-"+(i?"whole":"half");0==s&&i&&(t+=`<${e.P}-text class="agenda-left ${n} hour-${2*a+1}"" text="{{ :host.getHourLabel(${l+a*o}) }}"></${e.P}-text>`),t+=`<${e.P}-panel on-click=":host.time = Pacem.Utils.Dates.parse(:host.week[${s}].valueOf() + ${a*o})" disabled="{{ :host.isTimeSlotDisabled(:host.disabledRanges, :host.week[${s}], ${a}) }}" class="agenda-slot ${n} day-${s+1} hour-${2*a+1}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate), 'today': :host.isToday(:host.week[${s}], :host.now)} }}"></${e.P}-panel>`}return t}()}<${e.P}-clock hidden></${e.P}-clock>\n <template>\n <${e.P}-repeater class="agenda-day" datasource="{{ ^item }}">\n <template>\n <${e.P}-panel class="agenda-event-wrapper" \ncss-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item.span +1), 'day-start-'+ (!^item.continuing.start), 'day-end-'+ (!^item.continuing.end)] }}">\n <${e.P}-panel class="agenda-event" css="{{ {'top': ^item.offset.start, 'bottom': ^item.offset.end} }}" tab-order="{{ (^^index + 1) * 1000 + (^item.hour + 1) * 100 + ^index }}"\n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)">\n <${e.P}-span class="event-caption" text="{{ ^item.caption }}"></${e.P}-span>\n </${e.P}-panel>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n </template>\n <${e.P}-repeater class="agenda-allday" datasource="{{ :host.allDayDatasource }}">\n <template>\n <${e.P}-panel class="agenda-event" tab-order="{{ (^index + 1) * 500 + (^item.day + 1) * 50 + ^index }}" css-class="{{ ['day-start-'+ (^item.day + 1), 'day-end-'+ (^item.day + ^item.span + 1)] }}"\n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)">\n <${e.P}-text class="event-caption" text="{{ ^item.caption }}"></${e.P}-text>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n</${e.P}-repeater><${e.P}-content></${e.P}-content>`})],p),s.PacemAgendaElement=p;let m=class PacemCalendarElement extends PacemCalendarWithEventsBaseElement{buildDataSource(t){const s=this.month;let a=[];if(!e.Utils.isNull(s))for(let e=0;e<s.length;e++){let o=h(t,s[e]);a.push(o)}return a}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),"dayLabelFormatter"===e)this._formatVersion=Date.now()}_setDate(e){e?.valueOf()!==this.date?.valueOf()&&(this.date=e,this.dispatchEvent(new DateSelectEvent(e)))}getDayLabel(e,t=this._formatVersion){const s=this.dayLabelFormatter;return"function"==typeof s?s(e):super.getDayLabel(e)}};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],m.prototype,"date",void 0),__decorate([e.Watch({emit:!1})],m.prototype,"dayLabelFormatter",void 0),__decorate([e.Watch()],m.prototype,"_formatVersion",void 0),m=__decorate([e.CustomElement({tagName:e.P+"-calendar",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-calendar calendar-grid" datasource="{{ :host.datasource }}">${function(){let t="";for(let s=0;s<6;s++)for(let a=0;a<7;a++){let o=`class="calendar-day week-${s+1} day-${a+1}"`;t+=`<${e.P}-panel disabled="{{ :host.isTimeSlotDisabled(:host.disabledRanges, :host.month[${s}][${a}]) }}" on-click=":host._setDate(:host.month[${s}][${a}])" ${o} css-class="{{ {'viewmonth': :host.isViewMonth(:host.month[${s}][${a}]), 'viewday': :host.isViewDay(:host.month[${s}][${a}], :host.viewDate), 'today': :host.isToday(:host.month[${s}][${a}], :host.now), 'selected-date': :host.isDate(:host.month[${s}][${a}], :host.date)} }}"><${e.P}-span culture="{{ :host.culture }}" class="text-ellipsed" text="{{ :host.getDayLabel(:host.month[${s}][${a}], :host._formatVersion) }}"></${e.P}-span></${e.P}-panel>`}return t}()}\n <template>\n <${e.P}-repeater class="calendar-week" datasource="{{ ^item }}">\n <template>\n <${e.P}-panel class="calendar-event" tab-order="{{ (^^index + 1) * 1000 + (^item.day + 1) * 100 + ^index }}" \n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)"\n css-class="{{ ['day-start-'+ (^item.day + 1), 'day-end-'+ (^item.day + ^item.span + 1)] }}">\n <${e.P}-span class="event-startdate" culture="{{ :host.culture }}" hide="{{ ^item.continuing.start }}" text="{{ :host.getTimeLabel(^item.event.start) }}"></${e.P}-span>\n <${e.P}-span class="event-caption" text="{{ ^item.caption }}"></${e.P}-span>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n </template>\n</${e.P}-repeater><${e.P}-content></${e.P}-content>`})],m),s.PacemCalendarElement=m;let u=class PacemClockElement extends t.PacemElement{};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],u.prototype,"now",void 0),u=__decorate([e.CustomElement({tagName:e.P+"-clock"})],u),s.PacemClockElement=u;let v=class PacemScheduleElement extends PacemCalendarBaseElement{viewActivatedCallback(){super.viewActivatedCallback(),this._calendar.addEventListener("dateselect",this.emitHandler,!1),this._agenda.addEventListener("timeselect",this.emitHandler,!1),this.now=new Date}disconnectedCallback(){this._calendar&&(this._calendar.removeEventListener("dateselect",this.emitHandler,!1),this._agenda.removeEventListener("timeselect",this.emitHandler,!1)),super.disconnectedCallback()}};__decorate([e.ViewChild(e.P+"-calendar")],v.prototype,"_calendar",void 0),__decorate([e.ViewChild(e.P+"-agenda")],v.prototype,"_agenda",void 0),v=__decorate([e.CustomElement({tagName:e.P+"-schedule",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-panel class="${e.PCSS}-schedule" css-class="{{ ['schedule-'+ (:host.zoom || '${a.Month}')] }}">\n <${e.P}-timer interval="10000" on-tick=":host.now = Pacem.Utils.parseDate(Date.now())"></${e.P}-timer>\n ${function(){let t="";for(let s=0;s<7;s++)t+=`<${e.P}-span culture="{{ :host.culture }}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate)} }}" class="schedule-heading day-${s+1} text-ellipsed" text="{{ :host.getHeaderLabel(:host.week[${s}], :host.zoom) }}"></${e.P}-span>`;return e.Utils.uniqueCode(),`<div class="schedule-header schedule-grid"><div class="heading-left"></div>${t}</div>`}()}\n <${e.P}-agenda disabled-ranges="{{ :host.disabledRanges }}" on-eventselect=":host.handle($event)" on-eventunselect=":host.handle($event)" now="{{ :host.now }}" culture="{{ :host.culture }}" view-date="{{ :host.viewDate }}" zoom="{{ :host.zoom }}" week-start="{{ :host.weekStart }}" items="{{ :host.items }}"></${e.P}-agenda>\n <${e.P}-calendar disabled-ranges="{{ :host.disabledRanges }}" on-eventselect=":host.handle($event)" on-eventunselect=":host.handle($event)" now="{{ :host.now }}" culture="{{ :host.culture }}" view-date="{{ :host.viewDate }}" zoom="{{ :host.zoom }}" week-start="{{ :host.weekStart }}" items="{{ :host.items }}"></${e.P}-calendar>\n <${e.P}-content></${e.P}-content>\n</${e.P}-panel>`})],v),s.PacemScheduleElement=v;class PacemCalendarRuleBaseElement extends HTMLElement{constructor(){super(...arguments),this._disabledRanges=[]}viewActivatedCallback(){if(e.Utils.isNull(this._target=e.CustomElementUtils.findAncestor(this,e=>e instanceof PacemCalendarBaseElement)))throw`Missing ancestor calendar element for ${this.constructor.name}.`;this.refreshDisabledRanges()}disconnectedCallback(){this._target=void 0}get target(){return this._target}refreshDisabledRanges(){if(e.Utils.isNullOrEmpty(this._target))return;let t=this._target.disabledRanges||[];for(let e of this._disabledRanges){let s=t.indexOf(e);s>=0&&t.splice(s,1)}this._disabledRanges=this.computeDisabledRanges()||[];for(let e of this._disabledRanges)t.push(e);this._target.disabledRanges=t}}__decorate([e.Debounce(!0)],PacemCalendarRuleBaseElement.prototype,"refreshDisabledRanges",null),s.PacemCalendarRuleBaseElement=PacemCalendarRuleBaseElement;let _=class PacemCalendarDayOfWeekRuleElement extends PacemCalendarRuleBaseElement{constructor(){super(...arguments),this._daysOfWeek=[],this._calendarChangeHandler=e=>{"month"==e.detail.propertyName&&this.refreshDisabledRanges()}}viewActivatedCallback(){super.viewActivatedCallback(),this.target.addEventListener(e.PropertyChangeEventName,this._calendarChangeHandler,!1)}propertyChangedCallback(e,t,s,a){"days"===e&&(this._daysOfWeek=(s||[]).map(e=>c.indexOf(e)).filter(e=>e>=0),this.refreshDisabledRanges())}computeDisabledRanges(){let t=[];for(let s of this.target.month)for(let a of s)if(-1==this._daysOfWeek.indexOf(a.getDay())){let s=e.Utils.Dates.dateOnly(a),n=e.Utils.Dates.dateOnly(new Date(s.valueOf()+i+o));t.push({from:s,to:n})}return t}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.StringArray})],_.prototype,"days",void 0),_=__decorate([e.CustomElement({tagName:e.P+"-calendar-daysofweek-rule"})],_),s.PacemCalendarDayOfWeekRuleElement=_}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemCollapseElement extends t.PacemEventTarget{constructor(){super(...arguments),this._resizeHandler=e=>{this.#e=e.detail,this._toggle()}}#e;propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"collapse":this._toggle();case"disabled":e.Utils.isNull(this._resizer)||(this._resizer.disabled=this.disabled||this.collapse)}}viewActivatedCallback(){super.viewActivatedCallback();const e=this._resizer;this.#e=e.currentSize,this._toggle()}_toggle(){const t=this,s=this.collapse,a=this.#e;this.disabled||e.Utils.isNull(t)||(this.horizontal?(e.Utils.addClass(t,e.PCSS+"-horizontal"),t.style.height=a&&a.height+"px"||"",t.style.width=s?"0":a&&a.width+"px"||""):(e.Utils.removeClass(t,e.PCSS+"-horizontal"),t.style.height=s?"0":a&&a.height+"px"||""))}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"collapse",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"horizontal",void 0),__decorate([e.ViewChild(e.P+"-resize")],a.prototype,"_resizer",void 0),__decorate([e.ViewChild("[part=content]")],a.prototype,"_container",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-collapse",shadow:!0,template:`<${e.P}-resize on-${t.ResizeEventName}=":host._resizeHandler($event)" target="{{ ::_container }}"></${e.P}-resize><div part="container"><div part="content"><slot></slot></div></div>`})],a),s.PacemCollapseElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o;!function(e){e.YesNo="yesno",e.YesNoCancel="yesnocancel",e.Ok="ok",e.OkCancel="okcancel"}(a=s.DialogButtons||(s.DialogButtons={})),function(e){e.Yes="yes",e.No="no",e.Cancel="cancel",e.Ok="ok"}(o=s.DialogButton||(s.DialogButton={})),s.DialogResultEventName="commit";class DialogResultEvent extends e.CustomTypedEvent{constructor(e){super(s.DialogResultEventName,e)}}s.DialogResultEvent=DialogResultEvent;class PacemDialogBase extends t.PacemElement{open(t){const s=this.lightbox;if(!e.Utils.isNull(this._deferred))throw`${i.name} already open.`;const a=this._deferred=Promise.withResolvers();return this.hide||this.disabled?(this.log(e.Logging.LogLevel.Warn,"Dialog hidden or disabled, opening forbidden."),a.reject()):(this.dispatchEvent(new Event("open")),s.show=!0,this.state=t),a.promise}commit(t,s){e.avoidHandler(s),this.log(e.Logging.LogLevel.Debug,`Committing dialog by clicking '${t}'.`);const a=this.state;var o=new DialogResultEvent({button:t,state:a});this.lightbox.show=!1,this._deferred.resolve(o.detail),this._deferred=null,this.dispatchEvent(o)}}__decorate([e.Watch()],PacemDialogBase.prototype,"state",void 0),s.PacemDialogBase=PacemDialogBase;let i=class PacemDialogElement extends PacemDialogBase{constructor(){super(...arguments),this.buttons=a.Ok,this.okCaption="OK",this.yesCaption="Yes",this.noCaption="No",this.cancelCaption="Cancel"}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a)}open(e){const t=super.open(e);switch(this.buttons){case a.Ok:case a.OkCancel:this.dialogButtons.ok.focus();break;default:this.dialogButtons.yes.focus()}return t}viewActivatedCallback(){super.viewActivatedCallback()}get dialogButtons(){const e=this._buttons;return{ok:e&&e.firstElementChild.firstElementChild,yes:e&&e.firstElementChild.children.item(1),no:e&&e.firstElementChild.children.item(2),cancel:e&&e.firstElementChild.lastElementChild}}};__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"buttons",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"okCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"yesCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"noCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"cancelCaption",void 0),__decorate([e.ViewChild(`.${e.PCSS}-dialog-buttons`)],i.prototype,"_buttons",void 0),__decorate([e.ViewChild(e.P+"-lightbox")],i.prototype,"lightbox",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-dialog",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-lightbox modal="true" logger="{{ :host.logger }}">\n <${e.P}-content></${e.P}-content>\n <div class="${e.PCSS}-dialog-buttons ${e.PCSS}-buttonset buttons" part="dialog-buttons" slot="bottom">\n <div class="buttonset-left">\n <${e.P}-button class="button button-size size-small primary dialog-ok" css-class="{{ {'buttonset-last': :host.buttons === 'ok'} }}" on-click=":host.commit('ok', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'ok' && :host.buttons !== 'okcancel' }}"><${e.P}-text text="{{ :host.okCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small primary dialog-yes" css-class="{{ {'buttonset-first': :host.buttons !== 'ok' || :host.buttons !== 'okcancel'} }}" on-click=":host.commit('yes', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons === 'ok' || :host.buttons === 'okcancel' }}"><${e.P}-text text="{{ :host.yesCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small dialog-no" css-class="{{ {'buttonset-last': :host.buttons === 'yesno'} }}" on-click=":host.commit('no', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'yesno' && :host.buttons !== 'yesnocancel' }}"><${e.P}-text text="{{ :host.noCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small dialog-cancel" on-click=":host.commit('cancel', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'yesnocancel' && :host.buttons !== 'okcancel' }}"><${e.P}-text text="{{ :host.cancelCaption }}"></${e.P}-text></${e.P}-button>\n </div>\n </div>\n</${e.P}-lightbox>`})],i),s.PacemDialogElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemDividerElement extends t.PacemElement{constructor(){super("separator")}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),a||"orientation"!==e||this._syncOrientation(s)}viewActivatedCallback(){super.viewActivatedCallback(),this._syncOrientation()}_syncOrientation(t=this.orientation){if("vertical"!==t&&(t="horizontal"),super.aria.attributes.set("orientation",t),"vertical"===t)e.Utils.addClass(this,"divider-vertical");else e.Utils.removeClass(this,"divider-vertical")}};__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],a.prototype,"orientation",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-divider",shadow:!0,template:'<div part="divider"><div part="prepend"></div><slot part="content"></slot><div part="append"></div></div>'})],a),s.PacemDividerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a=/^\s*<svg\s/,o=/^fa(b|r|s|l|d|t|-brands|-solid|-regular|-light|-thin|-duotone)?\s+fa-/,i="https://kit.fontawesome.com/4922589c3c.js",n=!0,r=/^lni\s+lni-/,l=/^ci[dlsbf]-/,c=/^material-icons?\s+([\w]+)/,d=/^material(-symbols?)?\s+([\w]+)/,h="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200",p=/^(https?:\/\/|\/\/)?.+\.(webp|svg|gif|png|jpe?g)$/,m=[];function u(t,s,a,o,i){return m.indexOf(t)>=0?Promise.resolve():(m.push(t),e.Utils.Css.isClassDefined(t)?Promise.resolve():i?e.CustomElementUtils.importjs(s,a,o):e.CustomElementUtils.importcss(s,a,o))}let v=class PacemIconElement extends t.PacemElement{constructor(){super("",{hidden:"true"})}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),!a)switch(e){case"icon":this._setIcon();break;case"hide":s||this.aria.attributes.set("hidden","true")}}viewActivatedCallback(){super.viewActivatedCallback(),this._setIcon()}_setIcon(t=this.icon){(function(t){return new Promise((s,m)=>{if(e.Utils.isNullOrEmpty(t))m("No icon provided");else if(a.test(t))s(t);else if(o.test(t))u("fa",i,void 0,n,!0).then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(d.test(t))u("material-symbols",h).then(e=>{const a=d.exec(t),o=a[2],i=t.substring(a[0].length);s(`<i class="material-symbols-outlined${i}">${o}</i>`)},e=>m(e));else if(c.test(t))u("material-icons",h).then(e=>{const a=c.exec(t),o=a[1],i=t.substring(a[0].length);s(`<i class="material-icons${i}">${o}</i>`)},e=>m(e));else if(r.test(t))u("lni","https://cdn.lineicons.com/2.0/LineIcons.css").then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(l.test(t))u("clb","https://unpkg.com/@coreui/icons/css/all.min.css").then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(p.test(t))s(`<img src="${t}" />`);else{const a=t.trim().split(" "),o=a[0],i=a.length>1?" "+a.slice(1).join(" "):"";s(`<i class="${e.PCSS}-icon${i}">${o}</i>`)}})})(t).then(e=>{this.innerHTML=e},e=>{this.innerHTML=""})}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],v.prototype,"icon",void 0),v=__decorate([e.CustomElement({tagName:e.P+"-icon"})],v),s.PacemIconElement=v}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemImageElement extends t.PacemElement{constructor(){super("img")}propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"src":case"disabled":this._setSource();break;case"size":case"adapt":this._setLayout();break;case"loading":(a?e.Utils.removeClass:e.Utils.addClass)(this,"img-ready")}}viewActivatedCallback(){super.viewActivatedCallback(),this._setLayout(),this._setSource()}_setLayout(){const t=!e.Utils.isNullOrEmpty(this.size),s=this.adapt||"auto",a=this.size||this.#t||{width:"0",height:"0"};this.style.backgroundSize=s;const o="auto"===s,i=a.width,n=a.height;(o||t)&&(this.style.width=i||"",this.style.height=n||"")}#t;async _setSource(){if(this.disabled||!this.isReady)return;const t=this.src;if(this.style.backgroundImage="",!e.Utils.isNullOrEmpty(t)){this.loading=!0;try{const s=await e.Utils.loadImage(t);let a,o,i;window.performance&&(o=performance.getEntriesByName(s.src))&&(i=o[0])&&(a=i.decodedBodySize),this.#t={width:s.naturalWidth+"px",height:s.naturalHeight+"px",weight:a},this._setLayout(),this.style.backgroundImage=`url("${s.src}")`}catch(e){}finally{this.loading=!1}}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"adapt",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"src",void 0),__decorate([e.Watch({emit:!1,converter:{convert:(e,t)=>{const s=/^\s*([\d.]+)(px|em|rem|vw|vh)?\s*(?:,\s*([\d.]+)(px|em|rem|vw|vh)?)?\s*$/i.exec(e),a=s?s[1]+(s[2]||"px"):"0";return{width:a,height:s?s[3]?s[3]+(s[4]||"px"):a:"0"}},convertBack:(e,t)=>`${e?.width},${e?.height}`},reflectBack:!0})],a.prototype,"size",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"loading",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-img"})],a),s.PacemImageElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemInfiniteScrollerElement extends t.PacemEventTarget{constructor(){super(),this._scrollDelegate=()=>this._doScroll(),this._enabled=!0,this._viewportHeight=0,this._innerHeight=0,this._isDocument=!1,this._container=null,this._viewport=null,this._scroller=null,this._bottomGap=10,this._container=this,this._viewport=this,this._scroller=this}viewActivatedCallback(){super.viewActivatedCallback(),this.setInfiniteScrollContainer(this._container)}disconnectedCallback(){e.Utils.isNull(this._scroller)||this._scroller.removeEventListener("scroll",this._scrollDelegate,!1),super.disconnectedCallback()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"container":this.setInfiniteScrollContainer(s);break;case"disabled":(this._enabled=!s)&&this._doScroll();break;case"threshold":this._bottomGap=s||0}}setInfiniteScrollContainer(e="$document"){var t=e,s=this._isDocument="$document"===t||t===document.body||t===document.documentElement;this._container=s?document.body||document.documentElement:"string"==typeof e?document.querySelector(t):t,this._viewport=s?window:this._container,this._scroller&&this._scroller.removeEventListener("scroll",this._scrollDelegate,!1),this._scroller=s?window.document:this._container,this._scroller.addEventListener("scroll",this._scrollDelegate,!1),this._enabled&&this._doScroll()}_emitFetchMore(){var e=new CustomEvent("fetchmore");this.dispatchEvent(e)}_doScroll(){if(this._enabled)if(this._computeHeight())this._doScroll();else{var e=this._scroller instanceof Document?window.pageYOffset:this._scroller.scrollTop,t=this._viewportHeight,s=this._innerHeight;(s-(e+t)<this._bottomGap||s<=t)&&(this._emitFetchMore(),window.requestAnimationFrame(()=>{this._enabled&&this._doScroll()}))}}_computeHeight(){if(this._container){var t,s=this._container,a=Number.MAX_VALUE,o=0;if(this._isDocument){var i=s;t=Math.max(i.scrollHeight,i.offsetHeight,i.clientHeight)}else{for(var n=0;n<s.children.length;n++){var r=s.children.item(n),l=r.offsetTop,c=r.offsetHeight,d=l+c;l<a&&(a=l),d>o&&(o=d)}t=Math.round(o-a)}var h=this._viewport instanceof Window?e.Utils.windowSize.height:this._viewport.offsetHeight;return(t!=this._innerHeight||h!=this._viewportHeight)&&(this._innerHeight=t,this._viewportHeight=h,!0)}}};__decorate([e.Watch({converter:e.PropertyConverters.String})],a.prototype,"container",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.Number})],a.prototype,"threshold",void 0),__decorate([e.Debounce(100)],a.prototype,"_doScroll",null),a=__decorate([e.CustomElement({tagName:e.P+"-infinite-scroller"})],a),s.PacemInfiniteScrollerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){class PacemAdaptedIterativeElement extends t.PacemElement{constructor(){super(...arguments),this.index=0}isCloseTo(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isCloseToCore(t,s,this.datasource.length)}isPrevious(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isPreviousCore(t,s,this.datasource.length)}isNext(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isNextCore(t,s,this.datasource.length)}_isNextCore(e,t,s){return(t+1)%s===e}_isPreviousCore(e,t,s){return(t-1+s)%s===e}_isCloseToCore(e,t,s){return(t+s)%s==(e+s)%s||this._isNextCore(e,t,s)||this._isPreviousCore(e,t,s)}}__decorate([e.Watch({converter:e.PropertyConverters.Number})],PacemAdaptedIterativeElement.prototype,"index",void 0),__decorate([e.Watch()],PacemAdaptedIterativeElement.prototype,"datasource",void 0),s.PacemAdaptedIterativeElement=PacemAdaptedIterativeElement}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.ClickOutsideClose="clickOutsideClose",e.ExplicitClose="explicitClose"}(a=s.LightboxBehavior||(s.LightboxBehavior={}));let o=class PacemLightboxElement extends t.PacemElement{constructor(){super(...arguments),this._keyupHandler=e=>{27===e.keyCode&&this.show&&!this.modal&&(this.show=!1)},this._wrapperMousedownHandler=t=>{this.modal||this.behavior===a.ExplicitClose?e.stopPropagationHandler(t):this.show=!1},this._slotchangeHandler=e=>{this._resetLayout()},this._closeHandler=e=>{this._close(e)}}_resetLayout(){this._disposeButton();const t=this._ensureButton();e.Utils.isNull(t)||t.addEventListener("click",this._closeHandler,!1)}_toggleCloseVisibility(){const t=this._closeWrapper;e.Utils.isNull(t)||(t.hidden=this.modal)}viewActivatedCallback(){super.viewActivatedCallback(),this._toggleCloseVisibility();var t=this._wrapperElement,s=this._container;t.addEventListener("mousedown",this._wrapperMousedownHandler,!1),s.addEventListener("mousedown",e.stopPropagationHandler,!1),document.body.removeEventListener("scroll",e.avoidHandler,!0),window.addEventListener("keyup",this._keyupHandler,!1),this._resetLayout(),this._slot.addEventListener("slotchange",this._slotchangeHandler,!1)}propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"show":const t=this._wrapperElement,o=this._container;if(a){this.inert=!1,this.dispatchEvent(new Event("open",{bubbles:!0,cancelable:!1})),t.style.display="",t.hidden=!1,window.requestAnimationFrame(()=>{e.Utils.addPart(t,"lightbox-wrapper-shown"),e.Utils.addPart(o,"lightbox-shown")});var i=this.querySelector("."+e.PCSS+"-scrollable");i&&window.requestAnimationFrame(()=>i.scrollTop=0)}else s&&(this.inert=!0,this.dispatchEvent(new Event("close",{bubbles:!0,cancelable:!1})),e.Utils.removePart(t,"lightbox-wrapper-shown"),e.Utils.removePart(o,"lightbox-shown"),e.Utils.addAnimationEndCallback(t,e=>{e.hidden=!0,e.style.display="none"},500));break;case"modal":this._toggleCloseVisibility()}}disconnectedCallback(){this.show&&this._close();var t=this._wrapperElement,s=this._container;document.body.removeEventListener("scroll",e.avoidHandler,!0),e.Utils.isNull(t)||t.removeEventListener("mousedown",this._wrapperMousedownHandler,!1),e.Utils.isNull(s)||s.removeEventListener("mousedown",e.stopPropagationHandler,!1),window.removeEventListener("keyup",this._keyupHandler,!1),this._disposeButton(),this._disposeSlot(),super.disconnectedCallback()}_disposeButton(){this.#s?.removeEventListener("click",this._closeHandler),this.#s=null}_disposeSlot(){this._slot?.removeEventListener("slotchange",this._slotchangeHandler,!1)}_close(t){e.Utils.isNull(t)||e.avoidHandler(t),this.show=!1}#s;_ensureButton(){if(!e.Utils.isNull(this.#s))return this.#s;const t=this._slot;if(e.Utils.isNull(t))return null;const a=this._lookForAButton();if(!e.Utils.isNull(a))return this.#s=a;const o=new s.PacemButtonElement;return o.setAttribute("slot","close"),o.className=`${e.PCSS}-margin margin-0 ${e.PCSS}-rise rise--2 button-circle circle-smaller`,o.iconGlyph="close",this.appendChild(o),this.#s=o}_lookForAButton(){const t=this._slot;if(e.Utils.isNull(t))return null;const s=t.assignedElements({flatten:!0});return e.Utils.isNullOrEmpty(s)?null:s[0]}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"show",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"modal",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"behavior",void 0),__decorate([e.ViewChild("."+e.PCSS+"-lightbox-wrapper")],o.prototype,"_wrapperElement",void 0),__decorate([e.ViewChild("."+e.PCSS+"-lightbox")],o.prototype,"_container",void 0),__decorate([e.ViewChild("slot[name=close]")],o.prototype,"_slot",void 0),__decorate([e.ViewChild("div[part=close]")],o.prototype,"_closeWrapper",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-lightbox",shadow:!0,template:`<div class="${e.PCSS}-lightbox-wrapper" part="lightbox-wrapper" hidden>\n <div class="${e.PCSS}-lightbox" part="lightbox">\n <div part="top"><slot name="top"></slot></div>\n <div class="${e.PCSS}-scrollable" part="scrollable">\n <slot></slot>\n </div>\n <div part="bottom"><slot name="bottom"></slot></div>\n <div part="close">\n <slot name="close"></slot>\n </div>\n </div>\n</div>`})],o),s.PacemLightboxElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Spinner="spin",e.Pacem="pacem",e.Custom="custom"}(a=s.LoaderType||(s.LoaderType={}));let o=class PacemLoaderElement extends t.PacemElement{viewActivatedCallback(){super.viewActivatedCallback();var t="_"+e.Utils.uniqueCode();this._svgSpinner.innerHTML=`<defs>\n <mask id="hole${t}">\n <rect width="100%" height="100%" fill="white" />\n <circle cx="36" cy="36" r="12"></circle>\n <path d="M18,0 L32,16 H40 L54,0 Z" fill="#000"></path>\n <g transform="rotate(120,36,36)">\n <path d="M18,0 L32,16 H40 L54,0 Z" fill="#000"></path>\n </g>\n </mask>\n </defs>\n\n <circle class="circle1" cx="36" cy="36" r="34" stroke-width="4" fill="none"></circle>\n <g class="gear">\n <circle cx="36" cy="36" r="25" mask="url(#hole${t})"></circle>\n </g>\n <circle class="circle2" cx="36" cy="36" r="8" stroke-width="2" fill="none"></circle>\n\n <g class="bounds">\n <path d="M8,0 H0 V8 M64,0 H71 V8 M71,63 V71 H64 M8,71 H0 V63" stroke-width="2"></path>\n </g>`}propertyChangedCallback(t,s,o,i){if(super.propertyChangedCallback(t,s,o,i),!e.Utils.isNull(this._container))switch(t){case"active":case"disabled":!0!==this.active||this.disabled?e.Utils.removeClass(this._container,"active"):e.Utils.addClass(this._container,"active");break;case"type":if(this._svgSpinner.setAttribute("hidden","hidden"),this._spinner.setAttribute("hidden","hidden"),o===a.Pacem)this._svgSpinner.removeAttribute("hidden");else this._spinner.removeAttribute("hidden")}}};__decorate([e.ViewChild("div."+e.PCSS+"-spinner")],o.prototype,"_spinner",void 0),__decorate([e.ViewChild("div."+e.PCSS+"-loader")],o.prototype,"_container",void 0),__decorate([e.ViewChild("svg")],o.prototype,"_svgSpinner",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"active",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],o.prototype,"type",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-loader",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${e.PCSS}-loader" pacem>\n <div class="${e.PCSS}-spinner" pacem>\n <div></div>\n <div></div>\n </div>\n <svg class="${e.PCSS}-spinner" pacem hidden xmlns="http://www.w3.org/2000/svg" \n xmlns:xlink="http://www.w3.org/1999/xlink"\n viewBox="-18,-18,108,108" preserveAspectRatio="xMidYMid">\n </svg>\n </div>`})],o),s.PacemLoaderElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){const t=(e,t,s)=>{const a=t.exec(e);return a&&a.length?s(a):null},s=[{exec:e=>t(e,/^((<|&lt;)!--(?:(?!(--(>|&gt;)))[\s\S])*(--(?:>|&gt;)|$))/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t,index:e.index}]})},{exec:(e,s)=>t(e,/^(<|&lt;)([\w-]+)(?:\s+[\w-]+(?:=(?:'[^']*'|"[^"]*"))*)*(\s*\/?(?:&gt;|>))/,a=>{const o=a[1],i=a[2],n=a[3],r=a[0].length-n.length,l=o.length+i.length,c=e.substring(l,r),d=s.tokenize(c,[{exec:e=>t(e,/^(\s+[\w-]+)(=('[^']*'|"[^"]*"))?/,e=>{const t=e[1],s=[{type:"code-attribute",raw:t,text:t,index:e[0].indexOf(t)}];return e.length>2&&s.push({type:"code-string",raw:e[2],text:e[2],index:e.index+e[0].length-e[2].length}),s})}]),h=[{type:"code-tag",raw:o,text:o,index:0},{type:"code-tagname",raw:i,text:i,index:o.length}];return Array.prototype.push.apply(h,d),h.push({type:"code-tag",raw:n,text:n,index:r}),h})},{exec:e=>t(e,/^((?:<|&lt;)\/)([\w-]+)(\s*(?:&gt;|>))/,e=>{const t=e[1],s=e[2],a=e[3];return[{type:"code-tag",raw:t,text:t,index:0},{type:"code-tagname",raw:s,text:s,index:t.length},{type:"code-tag",raw:a,text:a,index:e.index+e[0].length-a.length}]})},{exec:e=>t(e,/^(<|&lt;)?((?!<|&lt;).)+/,e=>{const t=e[0];return[{type:"text",raw:t,text:t}]})}],a=[{exec:(e,s)=>t(e,/^\/\/.*/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\/\*(?:(?!(\*\/))[\s\S])*(?:\*\/|$)/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^('(\\'|[^'])*[^\\]?'|@?\$?"(\\"|[^"])*[^\\]?")/,e=>{const t=e[0];return[{type:"code-string",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|static|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|nameof|orderby|partial|remove|select|set|value|var|when|where|yield)\b/,e=>{const t=e[0];return[{type:"code-keyword",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b((0x[0-9a-fA-F]|[\d])*\.?[\d]+)\b/,e=>{const t=e[0];return[{type:"code-number",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^(@?\w+|:|\?\??|\?=?|\|\|?|&&?|&=?|;|,|=|\*=?|--|-=?|\+\+|\+=?|\/=?|\^|\(|\[|\)|\]|\{|\})/,e=>{const t=e[0];return[{type:"text",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\s+/,e=>{const t=e[0];return[{type:"space",raw:t,text:t}]})}],o=[a[0],a[1],{exec:(e,s)=>t(e,/^('(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"|`(\\`|[^`])*[^\\]?`)/,e=>{const t=e[0];return[{type:"code-string",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b(abstract|any|arguments|async|await|boolean|break|byte|case|catch|char|class|const|continue|debugger|declare|default|delete|do|double|else|enum|eval|export|extends|false|final|finally|float|for|function|get|goto|if|implements|import|in|instanceof|int|interface|let|long|native|new|null|number|package|private|protected|public|return|short|static|string|super|switch|synchronized|this|throw|throws|transient|true|try|type|typeof|var|void|volatile|while|with|yield)\b/,e=>{const t=e[0];return[{type:"code-keyword",raw:t,text:t}]})},a[4],a[5],a[6]],i={rule:{exec:e=>{const t=/\{tweet\}\(([^\)]+)\)/.exec(e);return t&&t.length>1?[{type:"tweet",raw:t[0],text:t[1],index:t.index}]:null}},type:"inline"},n={rule:{exec:e=>{const t=/\{yt([\d]+x[\d]+)?\}\(([^\)]+)\)/.exec(e);if(t&&t.length>2){const e=(t[1]||"560x315").split("x"),s=e[0],a=e[1];return[{type:"youtube",raw:t[0],text:t[2],index:t.index,width:s,height:a}]}return null}},type:"inline"},r=t=>{switch(t.type){case"youtube":return`\x3c!-- youtube embed --\x3e\n<iframe width="${t.width}" height="${t.height}" src="https://www.youtube-nocookie.com/embed/${t.text}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>`;case"tweet":return`\x3c!-- twitter embed --\x3e\n<${e.P}-tweetembed tweetid="${t.text}"></${e.P}-tweetembed>`;case"code-string":case"code-keyword":case"code-number":case"code-comment":case"code-tag":case"code-tagname":case"code-attribute":return`<span class="${t.type}">${t.text}</span>`}};e.MarkdownService=class MarkdownService{constructor(){const e=[i,n];for(let t of["c-sharp","c","c#","csharp","c++","cpp"]){const s=a.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,s)}for(let t of["ts","js","typescript","javascript"]){const s=o.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,s)}for(let t of["xml","html"]){const a=s.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,a)}this.#a=e}#a;#o=new e.Compile.Markdown.Parser;_escape(e){return(e??"").replace(/</g,"&lt;")}toHtml(e){return this.#o.toHtml(this._escape(e),this.#a,r)}tokenize(e){return this.#o.tokenize(this._escape(e),this.#a)}}}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemMarkdownElement extends t.PacemElement{constructor(t=new e.MarkdownService){super(),this._md=t}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"value"===e&&(this.innerHTML=this.html())}tokens(e=this.value){return this._md.tokenize(e)}html(e=this.value){return this._md.toHtml(e)}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"value",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-markdown"})],a),s.PacemMarkdownElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemMarqueeElement extends t.PacemElement{constructor(){super(...arguments),this._state={overlap:0,content:0}}connectedCallback(){super.connectedCallback();const e=this._css=document.createElement("style");document.head.appendChild(e)}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"speed"===e&&this._adjust()}viewActivatedCallback(){super.viewActivatedCallback(),this._adjust()}disconnectedCallback(){e.Utils.isNull(this._css)||this._css.remove(),super.disconnectedCallback()}_overlapResize(e){this._state.overlap=e.detail.width,this._adjust()}_contentResize(e){this._state.content=e.detail.width,this._adjust()}_adjust(){const t=this._state;if(t.content>0&&t.overlap>0){const s=this._marquee,a="marquee-"+e.Utils.uniqueCode(),o=Math.round(t.overlap),i=-Math.round(t.content);this._css.innerHTML=`@keyframes ${a} {\n 0% {\n transform: translateX(${o}px);\n }\n\n 100% {\n transform: translateX(${i}px);\n }\n}`;const n=this.speed||20,r=Math.max(n,Math.round(n*Math.abs(o-i)/1920));s.style.animationName=a,s.style.animationDuration=r+"s",s.style.animationIterationCount="infinite",s.style.animationTimingFunction="linear"}}};__decorate([e.ViewChild(`.${e.PCSS}-marquee`)],a.prototype,"_marquee",void 0),__decorate([e.ViewChild(`.${e.PCSS}-marquee-overlap`)],a.prototype,"_overlap",void 0),__decorate([e.ViewChild(e.P+"-resize")],a.prototype,"_resizer",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"speed",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-marquee",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${e.PCSS}-marquee"><${e.P}-content></${e.P}-content></div><div class="${e.PCSS}-marquee-overlap"></div>\n<${e.P}-resize target="{{ :host._overlap }}" on-${t.ResizeEventName}=":host._overlapResize($event)"></${e.P}-resize>\n<${e.P}-resize target="{{ :host._marquee }}" on-${t.ResizeEventName}=":host._contentResize($event)"></${e.P}-resize>`})],a),s.PacemMarqueeElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){s.MEDIAQUERY_XS="(max-width: 767px)",s.MEDIAQUERY_SM="(min-width: 768px)",s.MEDIAQUERY_MD="(min-width: 992px)",s.MEDIAQUERY_LG="(min-width: 1200px)",s.MEDIAQUERY_XL="(min-width: 1824px)",s.MEDIAQUERY_HD="(min-width: 1920px)",s.MEDIAQUERY_2K="(min-width: 2048px)",s.MEDIAQUERY_4K="(min-width: 3840px)",s.MEDIAQUERY_PORTRAIT="(orientation: portrait)",s.MEDIAQUERY_LANDSCAPE="(orientation: landscape)",s.MEDIAQUERY_PREFERS_LIGHT="(prefers-color-scheme: light)",s.MEDIAQUERY_PREFERS_DARK="(prefers-color-scheme: dark)";let a=class PacemMediaQueryElement extends t.PacemEventTarget{constructor(){super(...arguments),this._changeHandler=e=>{this.isMatch=e.matches}}#i;viewActivatedCallback(){super.viewActivatedCallback(),this._init()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"query":a||this._init();break;case"isMatch":this._broadcastChange(s)}}disconnectedCallback(){this._init(""),super.disconnectedCallback()}_broadcastChange(e=this.isMatch){this.dispatchEvent(new Event("change")),this.dispatchEvent(new Event(e?"match":"unmatch"))}_init(t=this.query){const s=this.#i;if(e.Utils.isNull(s)||s.removeEventListener("change",this._changeHandler),!e.Utils.isNullOrEmpty(t)){const e=this.#i=window.matchMedia(t);e.addEventListener("change",this._changeHandler),this.isMatch=e.matches}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"query",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.Boolean})],a.prototype,"isMatch",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-media-query"})],a),s.PacemMediaQueryElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){var a;let o=class PacemMenuElement extends t.PacemElement{constructor(){super(...arguments),this.synchronizeShell=!0,this._stopPropagationHandlerConditional=t=>{if(!e.Utils.isNull(this._container)&&!e.Utils.isNull(this._base)){const t=e.Utils.offset(this._container),s=e.Utils.offset(this._base);t.width<s.width&&(this.open=!1)}}}viewActivatedCallback(){super.viewActivatedCallback(),this._container.addEventListener("click",e.stopPropagationHandler,!1),this._container.addEventListener("scroll",e.stopPropagationHandler,!1),this._sync()}disconnectedCallback(){window.removeEventListener("navigate",this._stopPropagationHandlerConditional,!1),e.Utils.isNull(this._container)||(this._container.removeEventListener("click",e.stopPropagationHandler,!1),this._container.removeEventListener("scroll",e.stopPropagationHandler,!1)),this._sync(!1),super.disconnectedCallback()}connectedCallback(){super.connectedCallback(),window.addEventListener("navigate",this._stopPropagationHandlerConditional,!1),this._shell=e.CustomElementUtils.findAncestorShell(this)}_toggle(t){e.avoidHandler(t),this.open=!this.open,this.dispatchEvent(new Event("toggle"))}_sync(t=this.open){this.synchronizeShell?(e.Utils.addClass(this,"menu-sync"),e.Utils.addClass(this._shell,e.PCSS+(!0===t?"-menu-open":"-menu-close")),e.Utils.removeClass(this._shell,e.PCSS+(!0===t?"-menu-close":"-menu-open"))):(e.Utils.removeClass(this,"menu-sync"),e.Utils.removeClass(this._shell,e.PCSS+"-menu-close "+e.PCSS+"-menu-open")),this.outset?e.Utils.addClass(this,"menu-outset"):e.Utils.removeClass(this,"menu-outset")}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"open"!==e&&"synchronizeShell"!==e&&"outset"!==e||this._sync()}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"open",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"hideHamburgerButton",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"hideBackButton",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"outset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"synchronizeShell",void 0),__decorate([e.ViewChild("nav")],o.prototype,"_container",void 0),__decorate([e.ViewChild(`.${e.PCSS}-menu`)],o.prototype,"_base",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-menu",template:`<${e.P}-panel class="${e.PCSS}-menu" css-class="{{ {'menu-close': !:host.open, 'menu-open': :host.open} }}" on-click=":host._toggle($event)"> \n <nav><${e.P}-content></${e.P}-content></nav>\n</${e.P}-panel>\n<${e.P}-shell-proxy>\n<${e.P}-button hide="{{ :host.hideBackButton }}" class="${e.PCSS}-back ${e.PCSS}-menu button-flat" css-class="{{ {'menu-close': !:host.open, 'menu-open': :host.open} }}" on-click=":host._toggle($event)">BACK</${e.P}-button>\n<${e.P}-button hide="{{ :host.hideHamburgerButton }}" class="${e.PCSS}-hamburger ${e.PCSS}-menu button-flat" css-class="{{ {'menu-close': :host.open, 'menu-open': !:host.open} }}" on-click=":host._toggle($event)">MENU</${e.P}-button></${e.P}-shell-proxy>`,shadow:e.Defaults.USE_SHADOW_ROOT})],o),s.PacemMenuElement=o;let i=a=class PacemMenuCursorElement extends t.PacemElement{constructor(){super(...arguments),this._onPathChange=t=>{const s=this._menu,i=t&&t.detail||window.location.pathname;if(e.Utils.isNull(s))this.log(e.Logging.LogLevel.Warn,`Couldn't find a ${o} ancestor for this ${a}.`);else{var n=s.querySelectorAll(e.P+"-a"),r=null;for(let e=0;e<n.length;e++){let t=n.item(e);if(t.href===i){r=t;break}}if(e.Utils.isNull(r)&&(r=s.querySelector(`a[href='${i}']`)),!e.Utils.isNull(r)){const t=e.Utils.offset(r),a=e.Utils.offset(s);this.style.top=t.top+"px",this.style.left=a.left+"px",this.style.width="0",this.style.height=t.height+"px",e.Utils.addAnimationEndCallback(this,()=>{this.style.width=t.width+t.left-a.left+"px"},500)}}}}viewActivatedCallback(){super.viewActivatedCallback(),this._menu=e.CustomElementUtils.findAncestorOfType(this,o),this._onPathChange()}connectedCallback(){super.connectedCallback(),window.addEventListener("navigate",this._onPathChange,!1)}disconnectedCallback(){this._menu=null,window.removeEventListener("navigate",this._onPathChange,!1),super.disconnectedCallback()}};i=a=__decorate([e.CustomElement({tagName:e.P+"-menu-cursor"})],i),s.PacemMenuCursorElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemPagerElement extends t.PacemElement{propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"index":case"total":case"pages":case"size":case"mode":this._databind()}}_databind(){const t=this._repeater;if(e.Utils.isNull(t))return;var s=[];const a=this.size??10,o=this.pages??5,i=this.total??0,n=this.index??0,r=this.mode??"standard";if(i>0){let t=Math.ceil(i/a),l=Math.floor(n/a),c=Math.max(0,Math.ceil(l-o/2)),d=Math.min(t-1,c+o-1);for(;c>0&&1+d-c<o;)c--;"numeric-only"===r?c>0&&s.push({caption:1..toLocaleString(e.Utils.lang(this)),index:0,disabled:!(l>0)}):(s.push({caption:"&laquo;",index:0,first:!0,disabled:!(l>0)}),s.push({caption:"&lt;",index:a*(l-1),previous:!0,disabled:!(l>0)})),(c>0&&"numeric-only"!==r||c>1&&"numeric-only"===r)&&s.push({caption:"&hellip;",index:a*(c-1)});for(let t=c;t<=d;t++)s.push({caption:(t+1).toLocaleString(e.Utils.lang(this)),index:t*a});(d<t-1&&"numeric-only"!==r||d<t-2&&"numeric-only"===r)&&s.push({caption:"&hellip;",index:a*(d+1)}),"numeric-only"===r?d<t-1&&s.push({caption:t.toLocaleString(e.Utils.lang(this)),index:a*(t-1),disabled:!(l<t-1)}):(s.push({caption:"&gt;",index:a*(l+1),next:!0,disabled:!(l<t-1)}),s.push({caption:"&raquo;",index:a*(t-1),last:!0,disabled:!(l<t-1)})),this.index=l*a}t.datasource=s}};__decorate([e.ViewChild(e.P+"-repeater")],a.prototype,"_repeater",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"index",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"total",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"pages",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"size",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],a.prototype,"mode",void 0),__decorate([e.Debounce(!0)],a.prototype,"_databind",null),a=__decorate([e.CustomElement({tagName:e.P+"-pager",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-pager"><div class="${e.PCSS}-buttonset">\n<div class="pager-buttons">\n <template>\n <${e.P}-button class="${e.PCSS}-page button" on-click=":host.index = ^item.index" disabled="{{ ^item.disabled }}"\n css-class="{{ { 'currentpage': ^item.index === :host.index, 'firstpage buttonset-first': ^item.first, 'previouspage': ^item.previous, 'nextpage': ^item.next, 'lastpage buttonset-last': ^item.last } }}"><${e.P}-span content="{{ ^item.caption }}"></${e.P}-span></${e.P}-button>\n </template>\n</div>\n</div></${e.P}-repeater>`})],a),s.PacemPagerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemPictureSourceElement extends t.PacemItemElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a);const i=this.container;i instanceof o&&["srcset","media","type","disabled"].indexOf(e)>=0&&i.refreshSources()}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"srcset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"media",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"type",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-picture-source"})],a),s.PacemPictureSourceElement=a;let o=class PacemPictureElement extends t.PacemItemsContainerElement{constructor(){super("img",{label:"picture"}),this._updateCurrentSrcHandler=e=>{this.currentSrc=this._img.currentSrc}}validate(e){return e instanceof a}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"src":this._setSource();break;case"items":this._setSources();break;case"tooltip":this._setAltText()}}viewActivatedCallback(){super.viewActivatedCallback(),this._img.addEventListener("load",this._updateCurrentSrcHandler,!1),this._setSource(),this._setAltText(),this._setSources()}disconnectedCallback(){const t=this._img;e.Utils.isNull(t)||t.removeEventListener("load",this._updateCurrentSrcHandler,!1),super.disconnectedCallback()}refreshSources(){this._setSources()}_setSources(t=this.items){const s=this._picture,a=this._img;if(!e.Utils.isNull(s)&&!e.Utils.isNull(a)){const o=s.querySelectorAll("source"),i=t?.length??0;for(let t=0;t<i;t++){const i=this.items[t];let n;o.length<=t?(n=document.createElement("source"),n.setAttribute("part","source"),s.insertBefore(n,a)):n=o.item(t),i.disabled||e.Utils.isNullOrEmpty(i.srcset)?n.removeAttribute("srcset"):n.srcset=i.srcset,e.Utils.isNullOrEmpty(i.media)?n.removeAttribute("media"):n.media=i.media,e.Utils.isNullOrEmpty(i.type)?n.removeAttribute("type"):n.type=i.type}for(let e=o.length-1;e>=i;e--){o.item(e).remove()}}}_setSource(t=this.src){const s=this._img;e.Utils.isNull(s)||(e.Utils.isNullOrEmpty(t)?s.removeAttribute("src"):s.src=t)}_setAltText(t=this.tooltip){const s=this._img;e.Utils.isNull(s)||(e.Utils.isNullOrEmpty(t)?s.alt=this.aria.attributes.toObject().label:s.alt=t)}};__decorate([e.ViewChild("picture")],o.prototype,"_picture",void 0),__decorate([e.ViewChild("img")],o.prototype,"_img",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"src",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],o.prototype,"currentSrc",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-picture",shadow:!0,template:'<picture part="picture"><img loading="lazy" part="img" /></picture><slot></slot>'})],o),s.PacemPictureElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemProgressbarElement extends t.PacemElement{constructor(){super("progressbar",{valuemin:"0%",valuemax:"100%",valuenow:"0%"})}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"percentage":this._bar.style.transform=`translateX(${-100+(a||0)}%)`,this._glow.style.transform=`scaleX(${.01*(a||0)})`;let t=e.Utils.leftPad(Math.floor(a),2,"0")+"%";this.aria.attributes.set("valuenow",t),e.Utils.isNullOrEmpty(this.caption)&&this.aria.attributes.set("valuetext",this._caption.textContent=t);break;case"caption":this.aria.attributes.set("valuetext",this._caption.textContent=a)}}};__decorate([e.ViewChild(".progressbar-bar")],a.prototype,"_bar",void 0),__decorate([e.ViewChild(".progressbar-glow")],a.prototype,"_glow",void 0),__decorate([e.ViewChild(".progressbar-caption")],a.prototype,"_caption",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"percentage",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-progressbar",shadow:e.Defaults.USE_SHADOW_ROOT,template:'<div class="progressbar-glow"></div>\n <div class="progressbar-track"><div class="progressbar-bar"></div></div>\n <label class="progressbar-caption"></label>'})],a),s.PacemProgressbarElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemSidebarElement extends t.PacemElement{constructor(){super(...arguments),this.open=!1,this.synchronizeShell=!0}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"open":case"synchronizeShell":this._sync()}}disconnectedCallback(){this._sync(!1),super.disconnectedCallback()}_sync(t=this.open){const s=this.#n;this.synchronizeShell?(e.Utils.addClass(this,"sidebar-sync"),e.Utils.addClass(s,e.PCSS+(!0===t?"-sidebar-open":"-sidebar-close")),e.Utils.removeClass(s,e.PCSS+(!0===t?"-sidebar-close":"-sidebar-open"))):(e.Utils.removeClass(this,"sidebar-sync"),e.Utils.removeClass(s,e.PCSS+"-sidebar-close "+e.PCSS+"-sidebar-open"))}#n;connectedCallback(){super.connectedCallback(),this.#n=e.CustomElementUtils.findAncestorShell(this)}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"open",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"synchronizeShell",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-sidebar",template:`<${e.P}-panel class="sidebar-drawer" part="drawer" css-part="{{ { 'open': :host.open } }}" css-class="{{ {'open': :host.open } }}">\n <slot></slot>\n</${e.P}-panel>`,shadow:!0})],a),s.PacemSidebarElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemSlideElement extends t.PacemIterableElement{};a=__decorate([e.CustomElement({tagName:e.P+"-slide"})],a),s.PacemSlideElement=a;let o=class PacemSlideshowElement extends t.PacemIterativeElement{validate(e){return e instanceof a}};o=__decorate([e.CustomElement({tagName:e.P+"-slideshow"})],o),s.PacemSlideshowElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){!function(s){let a=class PacemTweetEmbedElement extends t.PacemElement{constructor(){super(...arguments),this._scriptsLoaded=!1}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"tweetid"===e&&this._scriptsLoaded&&this._render()}viewActivatedCallback(){super.viewActivatedCallback(),e.CustomElementUtils.importjs("https://platform.twitter.com/widgets.js").then(()=>{this._scriptsLoaded=!0,this._render()})}_render(){this.tweetid&&this._scriptsLoaded&&twttr.ready(e=>e.widgets.createTweet(this.tweetid,this))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"tweetid",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-tweetembed"})],a),s.PacemTweetEmbedElement=a}(s.Social||(s.Social={}))}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Persistent="persistent",e.QuickReturn="quickreturn"}(a=s.StickyHeaderVisibility||(s.StickyHeaderVisibility={}));let o=class PacemStickyHeaderElement extends t.PacemEventTarget{constructor(){super(...arguments),this.#r={left:0,top:0},this._scrollHandler=e=>{this.offset=e.detail}}#l;#r;#c;#n;_ensureScrollAwareElement(){if(e.Utils.isNull(this.#l)){const s=this.#l=new t.PacemScrollAwareElement;this.log(e.Logging.LogLevel.Debug,"creating scroll aware "+this.#c);(this.#n=e.CustomElementUtils.findAncestorShell(this)).appendChild(s),s.dataset.target=this.#c,s.addEventListener(t.ScrollEventName,this._scrollHandler,!1)}this.#l.disabled=this.disabled}_manageOffsetChange(t=this.offset){if(this.disabled)return;const s=this.visibility||a.Persistent,o=this.#r.top,i=t.top,n=this.threshold||0,r=this.#n;o<=n&&i>n?(e.Utils.removeClass(r,"sticky-header-top"),e.Utils.addClass(r,"sticky-header-scroll"),s===a.QuickReturn&&(e.Utils.addClass(r,"sticky-header-fade"),this.visible=!1)):o>n&&i<=n?(e.Utils.removeClass(r,"sticky-header-fade"),e.Utils.removeClass(r,"sticky-header-scroll"),e.Utils.addClass(r,"sticky-header-top")):o>n&&i>n&&o>i?(this.visible=!0,e.Utils.removeClass(r,"sticky-header-fade")):o>n&&i>n&&o<i&&s==a.QuickReturn&&e.Utils.addClass(r,"sticky-header-fade"),this.#r=t}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"offset":this._manageOffsetChange(s);break;case"disabled":this._ensureScrollAwareElement()}}connectedCallback(){super.connectedCallback(),this.#c=this.id||"sticky-"+e.Utils.uniqueCode(),this._ensureScrollAwareElement()}disconnectedCallback(){const s=this.#l,a=this.#n;e.Utils.isNull(s)||(this.log(e.Logging.LogLevel.Debug,"disposing scroll aware "+this.#c),s.removeEventListener(t.ScrollEventName,this._scrollHandler,!1),s.remove(),this.#l=void 0,e.Utils.removeClass(a,"sticky-header-fade"),e.Utils.removeClass(a,"sticky-header-top"),e.Utils.removeClass(a,"sticky-header-scroll")),super.disconnectedCallback()}};__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],o.prototype,"threshold",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Point})],o.prototype,"offset",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"visible",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],o.prototype,"visibility",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-sticky-header"})],o),s.PacemStickyHeaderElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a="tab-focus",o={convert:(t,s)=>t.startsWith("#")?e.PropertyConverters.Element.convert(t,s):e.PropertyConverters.String.convert(t,s),convertBack:(t,s)=>t instanceof Node?e.PropertyConverters.Element.convertBack(t,s):e.PropertyConverters.String.convertBack(t,s),retryConversionWhenReady:!0};let i=class PacemTabElement extends t.PacemIterableElement{constructor(){super("tab"),this._slotChangeHandler=t=>{const s=this.#d,a=this.#d=this.content;this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"content",currentValue:a,oldValue:s}))}}viewActivatedCallback(){super.viewActivatedCallback(),this._slotLabel.addEventListener("slotchange",this._slotChangeHandler,!1)}disconnectedCallback(){const t=this._slotLabel;e.Utils.isNull(t)||t.removeEventListener("slotchange",this._slotChangeHandler,!1),super.disconnectedCallback()}#d;get content(){return this.querySelectorAll("*[slot=label]")}};__decorate([e.ViewChild("slot[name=label]")],i.prototype,"_slotLabel",void 0),__decorate([e.Watch({converter:o})],i.prototype,"label",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"key",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-tab",shadow:!0,template:'<slot name="label" part="label"></slot><slot></slot>'})],i),s.PacemTabElement=i;let n=class PacemTabsElement extends t.PacemIterativeElement{constructor(t=new e.Animations.TweenService){super("tablist"),this._tweener=t}_labelCallback(e,t){const s=e.content;if(s.length>0){let e="";return s.forEach(t=>{e+=t.outerHTML}),e}return e.label instanceof Node?e.label:`<span class="${e.key||"tab"}">${e.label}</span>`}_syncOrientation(t=this.orientation){if(e.Utils.isNull(this._defaultTabAdapter)||(this._defaultTabAdapter.orientation=t),!e.Utils.isNull(this._tabs)){(t===s.AdapterOrientation.Vertical?e.Utils.addClass:e.Utils.removeClass)(this._tabs,"tabs-vertical")}}_syncVisibility(t=this.index,s=-1){const o=this._container,i=o.clientHeight,n=getComputedStyle(o),r="border-box"===n.boxSizing?0:parseInt(n.paddingTop)+parseInt(n.paddingBottom);o.style.height=i-r+"px";let l=0;for(let i of this.items||[])l===t?(e.Utils.addClass(i,"tab-in"),requestAnimationFrame(()=>{e.Utils.addClass(i,a),e.Utils.removeClass(i,"tab-in"),e.Utils.addAnimationEndCallback(i,t=>{e.Utils.removeClass(t,"tab-previous tab-next");const s=e.Utils.offset(t).height;this._tweener.run(parseInt(o.style.height),s,100,0,e.Animations.Easings.sineOut,(e,t)=>{o.style.height=Math.round(t)+"px"}).then(e=>{o.style.height=""})},500)}),i.aria.attributes.set("selected","true")):(e.Utils.removeClass(i,"tab-previous tab-next"),e.Utils.addClass(i,l<t?"tab-previous":"tab-next"),l===s&&(e.Utils.addClass(i,"tab-out"),e.Utils.removeClass(i,a),e.Utils.addAnimationEndCallback(i,t=>{e.Utils.removeClass(t,"tab-out")},500),i.aria.attributes.set("selected","false"))),l++}viewActivatedCallback(){super.viewActivatedCallback(),e.Utils.isNull(this.adapter)&&(this._syncOrientation(),this._syncVisibility(),this.adapter=this._defaultTabAdapter)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"adapter":e.Utils.isNull(a)&&(this.adapter=this._defaultTabAdapter),this._isUsingDefaultTabAdapter=this.adapter===this._defaultTabAdapter;break;case"index":this._syncVisibility(a,s);break;case"orientation":this._syncOrientation(a)}}validate(e){return e instanceof i}};__decorate([e.ViewChild(e.P+"-adapter")],n.prototype,"_defaultTabAdapter",void 0),__decorate([e.ViewChild("."+e.PCSS+"-tabs")],n.prototype,"_tabs",void 0),__decorate([e.ViewChild("."+e.PCSS+"-tabs-content")],n.prototype,"_container",void 0),__decorate([e.Watch()],n.prototype,"_isUsingDefaultTabAdapter",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],n.prototype,"orientation",void 0),n=__decorate([e.CustomElement({tagName:e.P+"-tabs",shadow:!1,template:`<div class="${e.PCSS}-tabs">\n <${e.P}-adapter class="${e.PCSS}-tabs-adapter" swipe-enabled="false" hide="{{ !:host._isUsingDefaultTabAdapter }}" label-callback="{{ :host._labelCallback }}"></${e.P}-adapter>\n <div class="${e.PCSS}-tabs-content">\n <${e.P}-content></${e.P}-content>\n </div>\n</div>`})],n),s.PacemTabsElement=n}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){var a;const o="pacem:toast:pops";let i=a=class PacemToastElement extends t.PacemElement{constructor(){super(...arguments),this.autohide=!0,this.timeout=3e3,this._doHide=e=>{window.clearTimeout(this._handle),this.show=!1}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._doHide,!1)}propertyChangedCallback(t,s,i,n){if(super.propertyChangedCallback(t,s,i,n),"show"===t)if(!0!==i)e.Utils.removeClass(this,"toast-show"),e.Utils.addClass(this,"toast-hide"),this.dispatchEvent(new CustomEvent("close")),e.Utils.waitForAnimationEnd(this,1e3).then(()=>{e.Utils.removeClass(this,"toast-hide")});else{let t=e.CustomElementUtils.getAttachedPropertyValue(a,o,0)-1;e.CustomElementUtils.setAttachedPropertyValue(a,o,t),this.style.order=""+t,e.Utils.addClass(this,"toast-show"),this._show()}}disconnectedCallback(){this.removeEventListener("click",this._doHide,!1),super.disconnectedCallback()}_show(){window.clearTimeout(this._handle),this.disabled||this.autohide&&(this._handle=window.setTimeout(()=>{this.show=!1},this.timeout))}popup(){this.show?this._show():this.show=!0}static toast(t,s,o,i){var n=new a;if(e.Utils.isNullOrEmpty(i?.cssClass))n.className="toast-"+s;else{const t=e.Utils.isArray(i.cssClass)?i.cssClass.join(" "):i.cssClass;e.Utils.addClass(n,t)}e.Utils.isNull(i?.autohide)||(n.autohide=i.autohide),i?.timeout>0&&(n.timeout=i.timeout);const r=document.createElement("i");r.className=e.PCSS+"-icon text-bigger-steady "+e.PCSS+"-margin margin-right-1 flex-auto";var l="info";switch(s){case"danger":case"error":l="error";break;case"warning":l="warning";break;case"success":l="check_circle"}r.textContent=l;const c=document.createElement("div");e.Utils.addClass(c,"display-flex flex-stretch flex-start flex-nowrap"),c.appendChild(r);const d=document.createElement("span");return e.Utils.addClass(d,"text-small text-pre"),"string"==typeof o?d.innerHTML=o:d.appendChild(o),c.appendChild(d),n.appendChild(c),t.appendChild(n),new Promise((t,s)=>{window.setTimeout(()=>{n.popup()},100);const a=()=>{n.removeEventListener("close",a,!1),t(),e.Utils.waitForAnimationEnd(n,1e3).then(e=>{n.remove()})};n.addEventListener("close",a,!1)})}static toast2(t,s,o,i){let n=i?.cssClass,r=["fill-"+s+"-container","fill-glass","border-solid","border-size--2","border-round","border-radius--6"];return e.Utils.isNullOrEmpty(n)||(e.Utils.isArray(n)?Array.prototype.push.apply(r,n):Array.prototype.push.apply(r,n.split(" "))),a.toast(t,s,o,e.Utils.extend({},i??{},{cssClass:r}))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],i.prototype,"autohide",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"timeout",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"show",void 0),__decorate([e.Transformer("poptoast")],i,"toast",null),__decorate([e.Transformer("poptoastcontainer")],i,"toast2",null),i=a=__decorate([e.CustomElement({tagName:e.P+"-toast"})],i),s.PacemToastElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemTocElement extends t.PacemElement{constructor(t=new e.Animations.TweenService){super(),this._tweener=t,this._items=[],this._scrollToSelf=e=>{this._scrollTo("#"+e.target.id)},this._hashChange=e=>{e.preventDefault(),this._scrollTo(window.location.hash,!1)}}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"target":e.Utils.isNull(this._observer)||this._observe();break;case"selector":this.refresh()}}connectedCallback(){super.connectedCallback(),window.addEventListener("hashchange",this._hashChange,!1)}disconnectedCallback(){window.removeEventListener("hashchange",this._hashChange,!1),e.Utils.isNull(this._observer)||this._observer.disconnect(),super.disconnectedCallback()}viewActivatedCallback(){super.viewActivatedCallback(),this._observer=new MutationObserver(e=>{this.refresh()}),this._observe()}_onScroll(t){this._update(e.Utils.scrollTop)}_observe(){this._observer.observe(this.target||document.body,{subtree:!0,childList:!0})}_getTop(t){return e.Utils.offset(t).top}_scrollTo(t,s=!0){if(/^#[^&=]+$/.test(t)){const a=!e.Utils.isNullOrEmpty(t)&&document.querySelector(t),o=!e.Utils.isNull(a)&&this._items.find(e=>e.dom===a);if(o&&!e.Utils.isNull(o.dom)){const t=this._getTop(o.dom)-(this.offset||0);if(s){let s=e.Utils.scrollTop;window.location.hash=o.dom.id,this._tweener.run(s,t,500,0,e.Animations.Easings.sineInOut,(e,t)=>{window.scrollTo(0,t)})}else window.scrollTo(0,t)}}}_startScrollTo(t,s){e.avoidHandler(s),this._scrollTo(t.url)}_update(t){const s=t+(this.offset||0);var a=this._items&&this._items.length>0&&this._items[0];for(var o of this._items){if(!(e.Utils.offset(o.dom).top<=s))break;a=o}const i=[];for(var o of this._items)e.Utils.isNullOrEmpty(o.dom.id)&&(o.dom.id=o.dom.innerText.trim().replace(/[^a-zA-Z0-9]/g,"-").replace(/-*$/,"").replace(/^-*/,"").toLowerCase()),i.push({focus:o===a,label:o.dom.innerText,url:"#"+o.dom.id});e.Utils.isNull(this._repeater)||(this._repeater.datasource=i)}refresh(){for(let t of this._items)t.dom.removeEventListener("click",this._scrollToSelf,!1),e.Utils.removeClass(t.dom,e.PCSS+"-toc-item");const t=this.selector;if(e.Utils.isNullOrEmpty(t))return this._repeater&&(this._repeater.datasource=[]),void(this.hasContent=!1);const s=(this.target||document).querySelectorAll(t),a=[];for(let t=0;t<s.length;t++){const o=s.item(t);o.addEventListener("click",this._scrollToSelf,!1),e.Utils.addClass(o,e.PCSS+"-toc-item"),a.push({dom:o,top:this._getTop(o)})}this._items=a,this._update(e.Utils.scrollTop),this.hasContent=!e.Utils.isNullOrEmpty(a);let o=window.location.hash;e.Utils.isNullOrEmpty(o)||setTimeout(()=>{this._scrollTo(o,!0)},1e3)}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"selector",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],a.prototype,"offset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],a.prototype,"target",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Element})],a.prototype,"router",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"hasContent",void 0),__decorate([e.ViewChild(e.P+"-repeater")],a.prototype,"_repeater",void 0),__decorate([e.Debounce(100)],a.prototype,"_onScroll",null),__decorate([e.Debounce(250)],a.prototype,"refresh",null),a=__decorate([e.CustomElement({tagName:e.P+"-toc",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-scroll-aware on-${t.ScrollEventName}=":host._onScroll($event)" url="{{ :host.url }}"></${e.P}-scroll-aware>\n<${e.P}-repeater><nav class="${e.PCSS}-toc"><template>\n <${e.P}-a on-click=":host._startScrollTo(^item, $event)" router="{{ :host.router }}" css-class="{{ {'toc-focus': ^item.focus} }}" href="{{ ^item.url }}"><${e.P}-text text="{{ ^item.label }}"></${e.P}-text></${e.P}-a>\n</template></nav></${e.P}-repeater>`})],a),s.PacemTocElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a=2*Math.PI;function o(e,t,s,a){return{x:e+s*Math.cos(a),y:t+s*Math.sin(a)}}let i=class PacemTunerElement extends t.PacemElement{constructor(){super(),this.min=0,this.max=100,this._rotateStartHandler=e=>{const t=this.#h=this._getAngle(e),s=this._rotate;s.minRotation=0-t,s.maxRotation=a-t,this._setValue(t)},this._rotateEndHandler=e=>{},this._rotateHandler=e=>{e.preventDefault();const t=e.detail.rotation+this.#h;this._setValue(t)}}#h;viewActivatedCallback(){super.viewActivatedCallback();const t=this._rotate,s=this._tween;t.addEventListener(e.UI.RotateEventType.Start,this._rotateStartHandler,!1),t.addEventListener(e.UI.RotateEventType.Rotate,this._rotateHandler,!1),t.addEventListener(e.UI.RotateEventType.End,this._rotateEndHandler,!1),t.register(this._canvas),this._toggleRotate(),requestAnimationFrame(()=>this._draw(this.min)),s.easing=e.Animations.Easings.sineInOut,s.delay=100*Math.random()-100+500,s.start=this.value>this.min}disconnectedCallback(){const t=this._rotate,s=this._canvas;e.Utils.isNull(t)||(t.removeEventListener(e.UI.RotateEventType.Rotate,this._rotateHandler,!1),e.Utils.isNull(s)||t.unregister(s)),super.disconnectedCallback()}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"interactive":this._toggleRotate(a),a?e.Utils.addClass(this,"tuner-interactive"):e.Utils.removeClass(this,"tuner-interactive");break;case"round":if(Math.round(a)!=a||a<0)throw`${this.constructor.name}: round value must be an integer greater or equal to zero.`;break;default:this._draw()}}_toggleRotate(t=this.interactive){const s=this._rotate;e.Utils.isNull(s)||(s.disabled=!t)}_angleToValue(e){const t=Math.pow(10,this.round||0),s=this.min+e*(this.max-this.min)/a;return Math.round(t*s)/t}_valueToAngle(e=this.value??this.min){return a*(e-this.min)/(this.max-this.min)}_setValue(e){const t=this._angleToValue(e).clamp(this.min,this.max);t!=this.value&&(this.value=t,this.dispatchEvent(new Event("change")))}_getAngle(t){const s={vertex:t.detail.center,end:t.detail.currentPosition,start:{x:t.detail.center.x,y:t.detail.center.y-1}},o=e.Angle.value(s);return o>0?a-o:-o}_draw(t=this.value){if(this.disabled||e.Utils.isNull(this._rail))return;t=(isNaN(t)?this.min:t).clamp(this.min,this.max);const s=this._rail,a=this._counterRail,i=t===this.min,n=t===this.max;if(i||n){const e="M 50 50 m -50,0 a 50,50 0 1,1 100,0 a 50,50 0 1,1 -100,0";s.setAttribute("d",i?"":e),a.setAttribute("d",n?"":e)}else{const e=.5*Math.PI,i=o(50,50,50,-e),n=this._valueToAngle(t),r=o(50,50,50,-e+n),l=n>Math.PI?1:0,c=`M ${r.x} ${r.y} A 50 50 0 ${l} 0 ${i.x} ${i.y}`;s.setAttribute("d",c);const d=r,h=o(50,50,50,3*e),p=this._valueToAngle(this.max-t)>Math.PI?1:0,m=`M ${h.x} ${h.y} A 50 50 0 ${p} 0 ${d.x} ${d.y}`;a.setAttribute("d",m)}}};__decorate([e.ViewChild("svg")],i.prototype,"_canvas",void 0),__decorate([e.ViewChild("path[part=rail]")],i.prototype,"_rail",void 0),__decorate([e.ViewChild("path[part=complementary-rail]")],i.prototype,"_counterRail",void 0),__decorate([e.ViewChild(e.P+"-tween")],i.prototype,"_tween",void 0),__decorate([e.ViewChild(e.P+"-rotate")],i.prototype,"_rotate",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],i.prototype,"value",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"min",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"max",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],i.prototype,"interactive",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"round",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-tuner",shadow:!0,template:`<svg xmlns="http://www.w3.org/2000/svg" class="${e.PCSS}-tuner" part="tuner" viewBox="0 0 100 100">\n <circle part="track" cx="50" cy="50" r="50" />\n <path part="rail" />\n <path part="complementary-rail" />\n </svg><div class="${e.PCSS}-content" part="content"><slot></slot></div>\n <${e.P}-rotate></${e.P}-rotate>\n<${e.P}-tween on-step=":host._draw($event.detail.value)" on-end="this.disabled = true" duration="500" to="{{ :host.value }}" from="{{ :host.min }}"></${e.P}-tween>`})],i),s.PacemTunerElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemVibrateElement extends t.PacemEventTarget{vibrate(){if(this.disabled)return;const t=this.pattern;e.Utils.isNullOrEmpty(t)||"function"==typeof navigator.vibrate&&navigator.vibrate(t)}};__decorate([e.Watch({emit:!1,converter:{convert:e=>e?.split(/[ ,]+/).map(e=>parseInt(e)),convertBack:e=>e?.join(" ")}})],a.prototype,"pattern",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-vibrate"})],a),s.PacemVibrateElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a={convert:(e,t)=>{try{return document.querySelector(e)??(t.isConnected?e:null)}catch{return e}},convertBack:e=>e instanceof Element&&e.id?"#"+e.id:e,retryConversionWhenReady:!0};let o=class PacemViewElement extends t.PacemEventTarget{constructor(){super(...arguments),this._templateChangeHandler=e=>{const t=e.target;this._setTmpl(t.target)}}propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),"url"===t||"disabled"===t?(this._dispose(s),this._manage()):"fetching"===t&&(a?e.Utils.addClass:e.Utils.removeClass)(this,"view-fetching")}viewActivatedCallback(){super.viewActivatedCallback();const e=this.url;this._isReference(e)&&!this.disabled&&this._manageRef()}_isReference(e){return e instanceof HTMLElement||"string"==typeof e&&e.trim().startsWith("#")}_dispose(e){e instanceof t.PacemTemplateProxyElement&&e.removeEventListener("templatechange",this._templateChangeHandler)}_manage(){if(this.disabled)return;const t=this.debounce||0,s=this.url;this._isReference(s)?(clearTimeout(this._fetchHandle),this._fetchHandle=setTimeout(()=>this._manageRef(),t)):"string"!=typeof s||e.Utils.isNullOrEmpty(s)?this.innerHTML="":(this.fetching=!0,clearTimeout(this._fetchHandle),this._fetchHandle=setTimeout(()=>this._manageUrl(s),t))}_manageRef(){const s=this.url,a=s instanceof HTMLElement?s:document.querySelector("template"+s);a instanceof t.PacemTemplateProxyElement?(a.addEventListener("templatechange",this._templateChangeHandler,!1),this._setTmpl(a.target)):a instanceof HTMLTemplateElement?this._setTmpl(a):e.Utils.isNull(a)?this.log(e.Logging.LogLevel.Error,"Template element not found."):this.log(e.Logging.LogLevel.Error,`Invalid '${a.constructor.name}' element, HTMLTemplate expected.`)}_setTmpl(t){cancelAnimationFrame(this._renderHandle),this.innerHTML="",this._renderHandle=requestAnimationFrame(()=>{e.Utils.isNull(t)?this.log(e.Logging.LogLevel.Error,"Template element not found."):(this.appendChild(t.cloneNode(!0).content),this._dispatchRender())})}#p;_manageUrl(t){this.#p&&this.#p.abort();const{signal:s}=this.#p=new AbortController;fetch(t,{credentials:"same-origin",signal:s}).then(async t=>{const s=(t,s)=>{301!==t.status&&302!==t.status||!this.followRedirects?t.ok||this.renderErrors?s.then(t=>e.Utils.addAnimationEndCallback(this,()=>this._manageResult(t),500)):this._manageResult(""):this._manageUrl(t.headers.get("Location"))},a=+t.headers.get("Content-Length");if(a>0){this.progress=0;let e=0;const o=[],i=t.body.getReader();for(;;){const{done:t,value:s}=await i.read();if(t)break;this.progress=(e+=s.length)/a,o.push(s)}s(t,new Promise((t,s)=>{try{let s=new Uint8Array(e),a=0;for(let e of o)s.set(e,a),a+=e.length;t(new TextDecoder("utf-8").decode(s))}catch(e){s(e)}}))}else s(t,t.text())},e=>{})}_manageResult(t){cancelAnimationFrame(this._renderHandle),this.scrollTo({top:0,left:0,behavior:"instant"}),this.innerHTML="",this._renderHandle=requestAnimationFrame(()=>{this.innerHTML=t,this.fetching=!1,this.progress=Number.NaN,e.Utils.addAnimationEndCallback(this,()=>{this._dispatchRender()},500)})}_dispatchRender(){this.dispatchEvent(new CustomEvent("render"))}};__decorate([e.Watch({reflectBack:!0,converter:a})],o.prototype,"url",void 0),__decorate([e.Watch()],o.prototype,"fetching",void 0),__decorate([e.Watch()],o.prototype,"progress",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"renderErrors",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"followRedirects",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],o.prototype,"debounce",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-view"})],o),s.PacemViewElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a="window-title";let o=class PacemWindowAreaElement extends t.PacemIterativeElement{constructor(){super(...arguments),this._zIndex=1,this._startHandler=t=>{this._incrementZIndex(t.detail.element),e.Utils.addClass(t.detail.element,"window-rescaling")},this._blurHandler=t=>{e.Utils.removeClass(t.detail.element,"window-rescaling")},this._focusHandler=e=>{this._incrementZIndex(e.currentTarget)},this._itemPropertyChangeHandler=t=>{if("floating"===t.detail.propertyName&&!1===t.detail.currentValue){const s=t.currentTarget,a=this.items.indexOf(s);e.Utils.addClass(s,"docking-in"),this.adapter.select(a),e.Utils.addAnimationEndCallback(s,t=>{e.Utils.removeClass(t,"docking-in")},150)}},this._adapterPagerCallback=e=>{const t=e.detail.index,s=this.items[t];e.detail.hide=s.hide||s.floating}}validate(e){return e instanceof i}_incrementZIndex(e){this._zIndex!=parseInt(e.style.zIndex)&&(e.style.zIndex=""+ ++this._zIndex)}connectedCallback(){super.connectedCallback();let t=e.CustomElementUtils.findAncestorShell(this);this._behaviors=[t.appendChild(this._dragDrop=document.createElement(e.P+"-drag-drop")),t.appendChild(this._rescale=document.createElement(e.P+"-rescale"))],this._dragDrop.handleSelector="."+a,this._rescale.addEventListener(e.UI.RescaleEventType.Start,this._startHandler,!1),this._rescale.addEventListener(e.UI.RescaleEventType.End,this._blurHandler,!1)}viewActivatedCallback(){if(super.viewActivatedCallback(),e.Utils.isNull(this.adapter)){const t=this.adapter=this.appendChild(document.createElement(e.P+"-adapter"));e.Utils.addClass(t,"windows-adapter"),t.labelCallback=(e,t)=>e.caption,t.swipeEnabled=!1,t.deselectable=!0,t.initialize(this)}this.adapter.addEventListener(s.AdapterPageButtonRefreshEventName,this._adapterPagerCallback,!1)}disconnectedCallback(){e.Utils.isNull(this.adapter)||(this.adapter.removeEventListener(s.AdapterPageButtonRefreshEventName,this._adapterPagerCallback,!1),this.adapter.remove(),this.adapter=null),this._rescale.removeEventListener(e.UI.RescaleEventType.End,this._blurHandler,!1),this._rescale.removeEventListener(e.UI.RescaleEventType.Start,this._startHandler,!1);for(let e of this._behaviors)e.remove();super.disconnectedCallback()}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"index"===e&&this._syncVisibility()}register(t){const s=super.register(t);if(s){t.addEventListener(e.PropertyChangeEventName,this._itemPropertyChangeHandler,!1),t.addEventListener("mousedown",this._focusHandler,!1);for(let e of this._behaviors){-1===t.behaviors.indexOf(e)&&t.behaviors.push(e)}}return s}unregister(t){const s=super.unregister(t);if(s){t.removeEventListener(e.PropertyChangeEventName,this._itemPropertyChangeHandler,!1),t.removeEventListener("mousedown",this._focusHandler,!1);for(let e of this._behaviors){const s=t.behaviors.indexOf(e);s>=0&&t.behaviors.splice(s,1)}}return s}_syncVisibility(){let t=0;const s=this.items??[];for(let a of s)t===this.index?e.Utils.addClass(a,"dock-open"):e.Utils.removeClass(a,"dock-open"),t++}};o=__decorate([e.CustomElement({tagName:e.P+"-window-area"})],o),s.PacemWindowAreaElement=o;let i=class PacemWindowElement extends t.PacemIterableElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"minimized"!==e&&"floating"!==e||this._syncLayout()}viewActivatedCallback(){super.viewActivatedCallback(),this._syncLayout()}_syncLayout(){(this.minimized?e.Utils.addClass:e.Utils.removeClass).apply(this,[this,"window-min"]),(this.floating?e.Utils.removeClass:e.Utils.addClass).apply(this,[this,"window-dock"])}};__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"minimized",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"floating",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-window",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${a}">\n <${e.P}-text text="{{ :host.caption || 'Window' }}"></${e.P}-text>\n</div>\n<div class="window-buttons ${e.PCSS}-buttonset"><div class="buttonset-right">\n <${e.P}-button class="button" on-click=":host.minimized = !:host.minimized" icon-glyph="{{ :host.minimized ? 'maximize' : 'minimize' }}" hide="{{ !:host.floating }}"></${e.P}-button>\n <${e.P}-button class="button" on-click=":host.floating = !:host.floating" css-class="{{ {'buttonset-first': !:host.floating} }}" icon-glyph="{{ :host.floating? 'lock_open' : 'lock' }}"></${e.P}-button>\n</div></div>\n<div class="window-content"><${e.P}-content></${e.P}-content></div>`})],i),s.PacemWindowElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));
6
+ "use strict";var Pacem,__decorate=this&&this.__decorate||function(e,t,s,a){var o,i=arguments.length,n=i<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,a);else for(var r=e.length-1;r>=0;r--)(o=e[r])&&(n=(i<3?o(n):i>3?o(t,s,n):o(t,s))||n);return i>3&&n&&Object.defineProperty(t,s,n),n};!function(e){!function(t){!function(s){let a;!function(e){e.Vertical="vertical",e.Horizontal="horizontal"}(a=s.AdapterOrientation||(s.AdapterOrientation={})),s.AdapterPageButtonRefreshEventName="pagerefresh";class AdapterPageButtonRefreshEvent extends CustomEvent{constructor(e){super(s.AdapterPageButtonRefreshEventName,{detail:e,bubbles:!1,cancelable:!1})}}s.AdapterPageButtonRefreshEvent=AdapterPageButtonRefreshEvent;let o=class PacemAdapterElement extends t.PacemAdapter{constructor(){super(...arguments),this._itemCreatedHandler=e=>{const t=e.detail.index;this._pageMap.set(t,e.detail.dom[0].firstElementChild),this._fireAdapterPageRefreshCallback(t,e.detail.item)},this._pageMap=new Map,this.interactive=!0,this.swipeEnabled=!0,this.loop=!0,this.labelCallback=(e,t)=>(t+1).toString(),this._itemRegisterHandler=s=>{let a=s.detail;!e.Utils.isNull(this._swiper)&&a instanceof t.PacemElement&&-1==a.behaviors.indexOf(this._swiper)&&a.behaviors.push(this._swiper)},this._itemUnregisterHandler=s=>{let a,o=s.detail;!e.Utils.isNull(this._swiper)&&o instanceof t.PacemElement&&(a=o.behaviors.indexOf(this._swiper))>=0&&o.behaviors.splice(a,1)},this._keydownHandler=e=>{if(this.interactive)if(this.orientation===a.Vertical)switch(e.keyCode){case 40:this._next(e);break;case 38:this._previous(e)}else switch(e.keyCode){case 39:this._next(e);break;case 37:this._previous(e)}}}masterPropertyChangedCallback(e,t,s,a){switch(super.masterPropertyChangedCallback(e,t,s,a),e){case"items":this._syncViewWithItems();break;case"index":this._index=s}}viewActivatedCallback(){super.viewActivatedCallback(),this._repeater.addEventListener(t.RepeaterItemCreateEventName,this._itemCreatedHandler,!1),this._syncViewWithItems()}disconnectedCallback(){this._repeater&&this._repeater.removeEventListener(t.RepeaterItemCreateEventName,this._itemCreatedHandler,!1),super.disconnectedCallback()}initializeCallback(){super.initializeCallback(),this.addEventListener("keydown",this._keydownHandler,!1);const t=this.master;if(!e.Utils.isNull(t)){const s=this._previousTabIndex=t.tabIndex;(!s||s<0)&&(t.tabIndex=0),t.addEventListener("keydown",this._keydownHandler,!1),t.addEventListener(e.Components.ItemRegisterEventName,this._itemRegisterHandler,!1),t.addEventListener(e.Components.ItemUnregisterEventName,this._itemUnregisterHandler,!1)}this._syncViewWithItems()}destroyCallback(){this.removeEventListener("keydown",this._keydownHandler,!1);const t=this.master;if(!e.Utils.isNull(t)){if(t.removeEventListener("keydown",this._keydownHandler,!1),t.removeEventListener(e.Components.ItemRegisterEventName,this._itemRegisterHandler,!1),t.removeEventListener(e.Components.ItemUnregisterEventName,this._itemUnregisterHandler,!1),!e.Utils.isNullOrEmpty(t.items))for(let e of t.items){const t=e.behaviors,s=t.indexOf(this._swiper);s>=0&&t.splice(s,1)}t.tabIndex=this._previousTabIndex}super.destroyCallback()}itemPropertyChangedCallback(e,t,s,a,o){super.itemPropertyChangedCallback(e,t,s,a,o),this._tickVersion(),this._fireAdapterPageRefreshCallback(e)}_fireAdapterPageRefreshCallback(e,t){var s=(t=t||this.master.items[e]).hide||!1,a=t.disabled||!1,o=this._labelCallback(t,e);const i=new AdapterPageButtonRefreshEvent({index:e,hide:s,disabled:a,content:o});this.dispatchEvent(i),s=this._isHidden(t,e,i.detail.hide),a=this._isDisabled(t,e,i.detail.disabled),o=i.detail.content;const n=this._pageMap;if(n.has(e)){const t=n.get(e),i=t.firstElementChild;let r=e=>{e&&t.removeEventListener("load",r,!1),t.hide=s,t.disabled=a,i.content=o};t.isReady?r():t.addEventListener("load",r,!1)}}_tickVersion(){this._v=Date.now()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"interval":this._resetTimer(s);break;case"swipeEnabled":this._swiper.disabled=!s||!this.interactive;break;case"interactive":this.hidden=!s,this._swiper.disabled=!s||!this.swipeEnabled;break;case"pausable":1==s?this._liPause.removeAttribute("hidden"):this._liPause.setAttribute("hidden","hidden")}}_syncViewWithItems(){if(!(!this.isReady||e.Utils.isNull(this.master)||e.Utils.isNull(this._prevBtn)||e.Utils.isNull(this._nextBtn)||e.Utils.isNull(this._repeater))){var s=this.master.items;if(this._prevBtn.hide=this._nextBtn.hide=this._panel.hide=!(s&&s.length>1),this._panel.hide=e.Utils.isNullOrEmpty(s),this._repeater.datasource=s,this._index=this.master.index,!e.Utils.isNullOrEmpty(s))for(let e of s)e instanceof t.PacemElement&&-1==e.behaviors.indexOf(this._swiper)&&e.behaviors.push(this._swiper)}}_toggle(t){(this._paused=!this._paused)?(e.avoidHandler(t),this._resetTimer(0)):this._next(t)}_resetTimer(e){clearInterval(this._handle),e>0&&(this._handle=window.setInterval(()=>{super.next()},e))}_next(t){t.type!==e.UI.SwipeEventType.SwipeLeft&&e.avoidHandler(t),this._resetTimer(this.interval),super.next(this.loop)}_previous(t){t.type!==e.UI.SwipeEventType.SwipeRight&&e.avoidHandler(t),this._resetTimer(this.interval),super.previous(this.loop)}_select(t,s){e.avoidHandler(s),this._resetTimer(this.interval),this.deselectable&&t===this._index?this.master.index=this._index=-1:super.select(t)}_isDisabled(e,t,s,a){return this._disableOrHide(e,t,s)}_isHidden(e,t,s,a){return this._disableOrHide(e,t,s)}_disableOrHide(e,s,a){const o=e instanceof t.PacemElement&&!0===a;return(-1===this._index&&!1===o||!0===o&&s===this._index)&&(this.deselectable?this.master.index=this._index=-1:super.select(s)),o}_labelCallback(e,t,s){return this.labelCallback(e,t)}};__decorate([e.ViewChild(e.P+"-repeater")],o.prototype,"_repeater",void 0),__decorate([e.ViewChild(e.P+"-button."+e.PCSS+"-adapter-previous")],o.prototype,"_prevBtn",void 0),__decorate([e.ViewChild(e.P+"-button."+e.PCSS+"-adapter-next")],o.prototype,"_nextBtn",void 0),__decorate([e.ViewChild(e.P+"-panel")],o.prototype,"_panel",void 0),__decorate([e.ViewChild(e.P+"-swipe")],o.prototype,"_swiper",void 0),__decorate([e.ViewChild("."+e.PCSS+"-adapter-dashboard > li[pacem]")],o.prototype,"_liPause",void 0),__decorate([e.Debounce()],o.prototype,"_tickVersion",null),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"pausable",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],o.prototype,"interval",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"orientation",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"interactive",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"swipeEnabled",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"deselectable",void 0),__decorate([e.Watch({emit:!1,reflectBack:!0,converter:e.PropertyConverters.Boolean})],o.prototype,"loop",void 0),__decorate([e.Watch({emit:!1})],o.prototype,"labelCallback",void 0),__decorate([e.Watch()],o.prototype,"_index",void 0),__decorate([e.Watch()],o.prototype,"_paused",void 0),__decorate([e.Watch()],o.prototype,"_v",void 0),__decorate([e.Throttle(333)],o.prototype,"_next",null),__decorate([e.Throttle(333)],o.prototype,"_previous",null),o=__decorate([e.CustomElement({tagName:e.P+"-adapter",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-button class="${e.PCSS}-adapter-previous" on-click=":host._previous($event)">&lt;</${e.P}-button>\n <${e.P}-button class="${e.PCSS}-adapter-next" on-click=":host._next($event)">&gt;</${e.P}-button>\n <${e.P}-swipe on-swipeleft=":host._next($event)" on-swiperight=":host._previous($event)"></${e.P}-swipe>\n <${e.P}-panel tabindex="0">\n <${e.P}-repeater>\n <ol class="${e.PCSS}-adapter-dashboard">\n <li pacem hidden>\n <${e.P}-button class="${e.PCSS}-play-pause"\n css-class="{{ {'paused' : :host._paused, 'playing': !:host._paused } }}" \n disabled="{{ !:host.pausable }}" on-click=":host._toggle($event)"></${e.P}-button>\n </li>\n <template>\n <li>\n <${e.P}-button on-click=":host._select(^index, $event)" class="${e.PCSS}-adapter-page" css-class="{{ { '${e.PCSS}-adapter-active': ^index === :host._index } }}">\n <${e.P}-span></${e.P}-span>\n </${e.P}-button>\n </li>\n </template>\n </ol></${e.P}-repeater></${e.P}-panel>`})],o),s.PacemAdapterElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemAnchorElement extends t.PacemElement{constructor(){super("link"),this._fetching=!1}get fetching(){return this._fetching}connectedCallback(){super.connectedCallback(),this.hasAttribute("tab-order")||(this.tabOrder=0)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"target":(e.Utils.isNullOrEmpty(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-target");break;case"href":(e.Utils.isNull(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-url");break;case"download":(e.Utils.isNullOrEmpty(a)?e.Utils.removeClass:e.Utils.addClass)(this,"a-download")}}emit(t){if(super.emit(t),this.disabled)return;switch(t.type){case"mousedown":e.Utils.addClass(this,e.PCSS+"-active");break;case"keydown":"Enter"===t.key&&(t.preventDefault(),e.Utils.addClass(this,e.PCSS+"-active"));break;case"blur":case"mouseup":e.Utils.removeClass(this,e.PCSS+"-active");break;case"keyup":"Enter"===t.key&&(this.click(),e.Utils.removeClass(this,e.PCSS+"-active"))}const s=this.href,a=this.target,o=this.router,i=this.download,n=()=>e.Utils.isNull(o)?s:e.Utils.URIs.format(s,o.state);e.Utils.isNull(s)||t.defaultPrevented||("click"===t.type&&t.ctrlKey||"mousedown"===t.type&&1===t.button?window.open(n(),"_blank"):"click"===t.type&&(!0===i?this._download(n()):"string"!=typeof i||e.Utils.isNullOrEmpty(i)?e.Utils.isNullOrEmpty(a)?e.Utils.isNull(o)?location.assign(s):o.path=s:window.open(n(),a):this._download(n(),i)))}async _download(t,s){this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"fetching",oldValue:this._fetching,currentValue:this._fetching=!0}));try{await e.Utils.download(t,{credentials:this.fetchCredentials,headers:this.fetchHeaders,filename:s})}finally{this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"fetching",oldValue:this._fetching,currentValue:this._fetching=!1}))}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"fetchCredentials",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],a.prototype,"fetchHeaders",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],a.prototype,"href",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],a.prototype,"target",void 0),__decorate([e.Watch({reflectBack:!1,converter:{convert:e=>{switch(e){case"true":return!0;case"false":return!1;default:return e}},convertBack:e=>e}})],a.prototype,"download",void 0),__decorate([e.Watch({reflectBack:!1,converter:e.PropertyConverters.Element})],a.prototype,"router",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-a"})],a),s.PacemAnchorElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(e){!function(e){e.ElementOrPointPropertyConverter={convert:e=>document.querySelector(e)??JSON.parse(e)}}(e.UI||(e.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o,i,n,r;!function(e){e.Menu="menu",e.Tooltip="tooltip",e.Inert="inert"}(a=s.BalloonBehavior||(s.BalloonBehavior={})),function(e){e.Hover="hover",e.Click="click",e.ContextMenu="contextmenu",e.Focus="focus"}(o=s.BalloonTrigger||(s.BalloonTrigger={})),function(e){e.Start="start",e.Center="center",e.End="end",e.Auto="auto"}(i=s.BalloonAlignment||(s.BalloonAlignment={})),function(e){e.Top="top",e.Left="left",e.Bottom="bottom",e.Right="right",e.Auto="auto",e.HorizontalAuto="x",e.VerticalAuto="y"}(n=s.BalloonPosition||(s.BalloonPosition={})),function(e){e.Auto="auto",e.Match="match"}(r=s.BalloonSizing||(s.BalloonSizing={})),s.BalloonPopupEventName="popup",s.BalloonPopoutEventName="popout";const l={Defaults:{trigger:o.Hover,position:n.Auto,size:r.Auto,behavior:a.Menu,verticalOffset:0,horizontalOffset:0,hoverDelay:250,hoverTimeout:500,align:i.Center,track:!0}},c="balloon-right balloon-left balloon-bottom balloon-top balloon-start balloon-center balloon-end",d=e.PCSS+"-balloon "+c+" balloon-out balloon-in balloon-on";let h=class PacemBalloonElement extends t.PacemElement{constructor(){super(...arguments),this._options=l.Defaults,this._originalNeighborhood=null,this._popoutDelegate=e=>{this.popout()},this._hoverDelegate=e=>{this.disabled||this.popup(this._options.hoverDelay)},this._outConditionalDelegate=e=>{(e.srcElement||e.target)!=this&&this._outDelegate(e)},this._mousedownConditionalDelegate=t=>{e.preventDefaultHandler(t),this._visible&&e.stopPropagationHandler(t)},this._outDelegate=e=>{this.popout(this._options.hoverTimeout)},this._toggleDelegate=e=>{e.preventDefault(),this._visible?this._outDelegate(e):this._hoverDelegate(e)}}get visible(){return this._visible}propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),"target"===t?(s instanceof Element&&this._removeHandlers(s),a instanceof Element||this._adjust()):"options"===t?(this.target instanceof Element&&this._removeHandlers(this.target),this._options=e.Utils.extend({},e.Utils.clone(l.Defaults),a),this._synchronizeOptions()):"disabled"===t&&a&&this.popout(),this.target instanceof Element&&"disabled"!==t&&this._setHandlers(this.target)}viewActivatedCallback(){super.viewActivatedCallback(),this._ensurePopup(),this.target=this.target||this.parentElement,this._synchronizeOptions()}disconnectedCallback(){super.disconnectedCallback(),this._destroyPopup(),this.target instanceof Element&&this._removeHandlers(this.target)}_synchronizeOptions(){const t=this,s=t.options||{};if(s.moveToRoot&&e.Utils.isNull(this._originalNeighborhood))this._originalNeighborhood={parent:t.parentElement,nextSibling:t.nextElementSibling},document.body.appendChild(t);else if(!s.moveToRoot&&!e.Utils.isNull(this._originalNeighborhood)){const s=this._originalNeighborhood.parent;e.Utils.isNull(s)||s.appendChild(t),this._originalNeighborhood=null}}_ensurePopup(){const t=this,s=t._container;return t&&s&&!e.Utils.hasClass(t,e.PCSS+"-balloon")&&(e.Utils.addClass(t,e.PCSS+"-balloon"),t.style.position="absolute",s.style.position="relative",s.style.zIndex="1",t.style.visibility="hidden"),t}_destroyPopup(){var t=this,s=t._container;e.Utils.removeClass(t,d),t.style.position="",e.Utils.isNull(s)||(s.style.position="",s.style.zIndex="")}_registerEvents(){const t=this._ensurePopup(),s=this._options;switch(s.behavior){case a.Menu:switch(s.trigger){case o.Focus:t.addEventListener("mousedown",e.stopPropagationHandler,!1),t.addEventListener("focus",this._hoverDelegate,!1);break;case o.Click:case o.ContextMenu:t.addEventListener("mousedown",e.stopPropagationHandler,!1),window.document.body.addEventListener("mousedown",this._outConditionalDelegate,!1);break;default:t.addEventListener("mouseenter",this._hoverDelegate,!1),t.addEventListener("mouseleave",this._outDelegate,!1)}break;case a.Tooltip:switch(s.trigger){case o.Focus:case o.Click:case o.ContextMenu:window.document.body.addEventListener("mousedown",this._outConditionalDelegate,!1)}}}_unregisterEvents(){var t=this._ensurePopup(),s=this._options;switch(s.behavior){case a.Menu:switch(s.trigger){case o.Focus:t.removeEventListener("mousedown",e.stopPropagationHandler,!1),t.removeEventListener("focus",this._hoverDelegate,!1);break;case o.Click:case o.ContextMenu:t.removeEventListener("mousedown",e.stopPropagationHandler,!1),window.document.body.removeEventListener("mousedown",this._outConditionalDelegate,!1);break;default:t.removeEventListener("mouseenter",this._hoverDelegate,!1),t.removeEventListener("mouseleave",this._outDelegate,!1)}break;case a.Tooltip:switch(s.trigger){case o.Click:case o.ContextMenu:window.document.body.removeEventListener("mousedown",this._outConditionalDelegate,!1)}}}_onLayoutChange(e){this._visible&&this._adjust()}_adjust(){const t=this,s=t.target;if(e.Utils.isNull(s))return;const a=s instanceof Element?e.Utils.offset(s):{top:s.y,left:s.x,width:0,height:0},o=e.Utils.windowSize;var d=this._options,h=d.position,p=d.align;if(h!=n.Top&&h!=n.Bottom&&h!=n.Left&&h!=n.Right){let t=o.height,s=o.width;const i=a.left-e.Utils.scrollLeft,r=a.top-e.Utils.scrollTop,l=t-(r+a.height),c=s-(i+a.width);if(h===n.HorizontalAuto)h=i>c?n.Left:n.Right;else h=r>l?n.Top:n.Bottom}if(d.size===r.Match)switch(h){case n.Bottom:case n.Top:t.style.minWidth=a.width+"px",t.style.minHeight="";break;case n.Left:case n.Right:t.style.minHeight=a.height+"px",t.style.minWidth=""}else t.style.minWidth=t.style.minHeight="";const m=t.offsetWidth,u=t.offsetHeight,v=a.width-m,_=.5*v,g=a.height-u,b=.5*g;switch(p){case i.Center:case i.Start:case i.End:break;case i.Auto:switch(p=i.Center,h){case n.Right:case n.Left:const t=e.Utils.scrollTop+o.height/2;a.top+a.height<t?p=i.Start:a.top>t&&(p=i.End);break;case n.Top:case n.Bottom:const s=e.Utils.scrollLeft+o.width/2;a.left+a.width<s?p=i.Start:a.left>s&&(p=i.End)}break;default:p=l.Defaults.align}e.Utils.removeClass(t,c),e.Utils.addClass(t,"balloon-"+h),e.Utils.addClass(t,"balloon-"+p);const y=e.Utils.Css.getVariableValue(`--${e.PCSS}-balloon-tail-size`),C=e.Utils.Css.getVariableValue(`--${e.PCSS}-balloon-tail-inset`),f=parseInt(C)+.5*parseInt(y),P=a.width/2,w=a.height/2,E=d.autoAdjust&&f>P,k=d.autoAdjust&&f>w;switch(h){case n.Top:switch(a.top-=u,p){case i.Center:a.left+=_;break;case i.End:a.left+=v,E&&(a.left+=f-P);break;case i.Start:E&&(a.left-=f-P)}break;case n.Left:switch(a.left-=m,p){case i.Center:a.top+=b;break;case i.End:a.top+=g,k&&(a.top+=f-w);break;case i.Start:k&&(a.top-=f-w)}break;case n.Right:switch(a.left+=a.width,p){case i.Center:a.top+=b;break;case i.End:a.top+=g,k&&(a.top+=f-w);break;case i.Start:k&&(a.top-=f-w)}break;default:switch(a.top+=a.height,p){case i.Center:a.left+=_;break;case i.End:a.left+=v,E&&(a.left+=f-P);break;case i.Start:E&&(a.left-=f-P)}}a.left=Math.min(o.width-m,Math.max(0,a.left)),a.top+=d.verticalOffset,a.left+=d.horizontalOffset,t.style.top=Math.round(a.top)+"px",t.style.left=Math.round(a.left)+"px"}_adjustWatchers(t){const s=this.options||{};e.Utils.isNull(this._resize)||(this._resize.disabled=!t,this._position.disabled=!t||!(s.track||s.trackPosition))}popup(t=0){if(clearTimeout(this._timer),t>0)return void(this._timer=setTimeout(()=>this.popup(),t));const a=this,o=e.Utils.isVisible(a);this._adjustWatchers(!0),o||this.disabled||(this._registerEvents(),a.style.pointerEvents="none",this._visible=!0,a.style.visibility="visible",this._adjust(),e.Utils.addClass(a,"balloon-in"),e.Utils.addAnimationEndCallback(a,()=>{e.Utils.addClass(a,"balloon-on"),a.dispatchEvent(new e.PropertyChangeEvent({propertyName:"visible",oldValue:!1,currentValue:!0})),a.dispatchEvent(new Event(s.BalloonPopupEventName)),a.style.pointerEvents="auto"},500))}popout(t=0){if(clearTimeout(this._timer),t>0)return void(this._timer=setTimeout(()=>this.popout(),t));var a=this;const o=e.Utils.isVisible(a);this._adjustWatchers(!1),o&&(this._unregisterEvents(),a.style.pointerEvents="none",e.Utils.removeClass(a,"balloon-in balloon-on"),e.Utils.addClass(a,"balloon-out"),e.Utils.addAnimationEndCallback(a,()=>{a.style.visibility="hidden",this._visible=!1,e.Utils.removeClass(a,d),a.dispatchEvent(new Event(s.BalloonPopoutEventName)),a.dispatchEvent(new e.PropertyChangeEvent({propertyName:"visible",oldValue:!0,currentValue:!1}))},500))}toggle(t=0){e.Utils.isVisible(this)||this.disabled?this.popout(t):this.popup(t)}_removeHandlers(t){e.Utils.isNull(t)||(t.removeEventListener("mouseenter",this._hoverDelegate,!1),t.removeEventListener("mouseleave",this._outDelegate,!1),t.removeEventListener("mousedown",this._popoutDelegate,!1),t.removeEventListener("mousedown",this._mousedownConditionalDelegate,!1),t.removeEventListener("click",this._toggleDelegate,!1),t.removeEventListener("focus",this._hoverDelegate,!1),t.removeEventListener("blur",this._outDelegate,!1),t.removeEventListener("contextmenu",this._toggleDelegate,!1))}_setHandlers(e){this.popout();var t=this._options;if(t.behavior!=a.Inert)switch(t.trigger){case o.Hover:e.addEventListener("mouseenter",this._hoverDelegate,!1),e.addEventListener("mouseleave",this._outDelegate,!1),e.addEventListener("mousedown",this._popoutDelegate,!1);break;case o.Focus:e.addEventListener("focus",this._hoverDelegate,!1),e.addEventListener("blur",this._outDelegate,!1);break;case o.Click:t.hoverDelay=t.hoverTimeout=0,e.addEventListener("mousedown",this._mousedownConditionalDelegate,!1),e.addEventListener("click",this._toggleDelegate,!1);break;case o.ContextMenu:t.hoverDelay=t.hoverTimeout=0,e.addEventListener("contextmenu",this._toggleDelegate,!1)}}};__decorate([e.ViewChild(`.${e.PCSS}-balloon`)],h.prototype,"_container",void 0),__decorate([e.ViewChild(e.P+"-resize[content]")],h.prototype,"_resize",void 0),__decorate([e.ViewChild(e.P+"-resize[watch-position=true]")],h.prototype,"_position",void 0),__decorate([e.Watch({converter:s.ElementOrPointPropertyConverter})],h.prototype,"target",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],h.prototype,"options",void 0),h=__decorate([e.CustomElement({tagName:e.P+"-balloon",shadow:!0,template:`<${e.P}-resize target="{{ :host.target }}" disabled="true" watch-position="true" on-${t.ResizeEventName}=":host._onLayoutChange($event)"></${e.P}-resize>\n<div class="${e.PCSS}-balloon"><${e.P}-resize on-${t.ResizeEventName}=":host._onLayoutChange($event)" disabled="true" content><slot></slot></${e.P}-resize></div>\n<div class="corner top-left" part="corner-topleft"></div><div class="corner bottom-left" part="corner-bottomleft"></div><div class="corner top-right" part="corner-topright"></div><div class="corner bottom-right" part="corner-bottomright"></div>`})],h),s.PacemBalloonElement=h}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o,i;!function(e){e.Auto="auto",e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e.Center="center"}(a=s.BinderAnchor||(s.BinderAnchor={})),function(e){e.Default="default",e.Arrow="arrow",e.FatArrow="fatarrow",e.None="none"}(o=s.BinderEnd||(s.BinderEnd={})),function(e){e.Mass="mass",e.Path="path"}(i=s.BinderTension||(s.BinderTension={})),s.BinderInteractionEventName="interact";class BinderInteractionEvent extends e.CustomUIEvent{constructor(e){super(s.BinderInteractionEventName,null,e)}}s.BinderInteractionEvent=BinderInteractionEvent;const n="pacem:components:ui:binders";class BindersCollector{constructor(e){this.binders=[],this.fire=e=>{for(var t of this.binders)t.refresh(this.resize.target,e.detail)};const s=this.resize=new t.PacemResizeElement;s.target=e,s.watchPosition=!0,document.body.appendChild(s)}dispose(){this.resize.remove()}}class BinderUtils{static{this._pageBinders=[]}static _updateResizeListener(){const s=this._pageBinders;if(e.Utils.isNull(this._bodyResizeListener)){const a=this._bodyResizeListener=new t.PacemResizeElement;a.target=document.body,document.body.appendChild(a),document.addEventListener(e.Components.ResizeEventName,()=>{for(let e of s)e.invalidateSize()},!1)}this._bodyResizeListener.disabled=0===s.length}static register(t,s){var a=e.CustomElementUtils.getAttachedPropertyValue(t,n),o=this._pageBinders;e.Utils.isNull(a)&&(a=new BindersCollector(t),e.CustomElementUtils.setAttachedPropertyValue(t,n,a)),-1==a.binders.indexOf(s)&&(0===a.binders.length&&a.resize.addEventListener(e.Components.ResizeEventName,a.fire,!1),s.refresh(t,a.resize.currentSize),a.binders.push(s)),-1===o.indexOf(s)&&(o.push(s),this._updateResizeListener())}static unregister(t,s){var a,o,i=e.CustomElementUtils.getAttachedPropertyValue(t,n),r=this._pageBinders;!e.Utils.isNull(i)&&(a=i.binders.indexOf(s))>-1&&(i.binders.splice(a,1),0===i.binders.length&&(i.resize.removeEventListener(e.Components.ResizeEventName,i.fire,!1),i.dispose(),e.CustomElementUtils.deleteAttachedPropertyValue(t,n))),(o=r.indexOf(s))>=0&&(r.splice(o,1),this._updateResizeListener())}}const r=["click","dblclick","mouseover","mouseout","mouseenter","mouseleave","mousedown","mouseup","mousemove","contextmenu"];let l=class PacemBinderElement extends t.PacemElement{constructor(){super(...arguments),this._broadcastHandler=e=>{var t=new BinderInteractionEvent(e);this.dispatchEvent(t)},this._state={}}connectedCallback(){super.connectedCallback(),this._ensurePath()}viewActivatedCallback(){super.viewActivatedCallback(),this.from instanceof Element&&BinderUtils.register(this.from,this),this.to instanceof Element&&BinderUtils.register(this.to,this)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"from":case"to":s instanceof Element&&BinderUtils.unregister(s,this),a instanceof Element?BinderUtils.register(a,this):this.refresh(a);break;case"fromLimit":case"toLimit":case"fromEnd":case"toEnd":case"tension":this._draw();break;case"fromAnchor":this.refresh(this.from);break;case"toAnchor":this.refresh(this.to);break;case"cssClass":e.Utils.isNull(this._svg)||this._svg.setAttribute("class",e.PCSS+"-binder "+this.className);break;case"hide":o||this._setPathVisibility()}}disconnectedCallback(){e.Utils.isNull(this._path)||(r.forEach(e=>{this._path.removeEventListener(e,this._broadcastHandler,!1)}),this._svg.remove(),this._path=void 0),this.from instanceof Element&&BinderUtils.unregister(this.from,this),this.to instanceof Element&&BinderUtils.unregister(this.to,this),super.disconnectedCallback()}_setPathVisibility(t=this._path,s=this.hide,a=this.interactive){e.Utils.isNull(t)||(s?t.setAttribute("display","none"):t.removeAttribute("display"),a?(t.setAttribute("pointer-events","visibleStroke"),t.tabIndex=0):(t.removeAttribute("pointer-events"),t.tabIndex=-1))}_ensurePath(){if(e.Utils.isNull(this._path)){let t=this._svg=document.createElementNS("http://www.w3.org/2000/svg","svg");t.style.position="absolute",e.Utils.addClass(t,e.PCSS+"-binder "+this.className),t.style.top="0",t.style.left="0",t.style.overflow="hidden",t.style.pointerEvents="none";const s=this._path=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("fill","none"),s.setAttribute("display","none"),this._setPathVisibility(),t.appendChild(s),this.invalidateSize(),document.body.appendChild(t),r.forEach(e=>{s.addEventListener(e,this._broadcastHandler,!1)})}}invalidateSize(){const t=this._svg;e.Utils.isNull(t)||(t.setAttribute("width",document.body.scrollWidth.toString()),t.setAttribute("height",document.body.scrollHeight.toString()))}_computeAnchorPoints(t,s,n,r,l,c,d){var h,p,m,u;const v=t.top,_=t.left,g=t.width,b=t.height,y=g/2,C=b/2,f=r.top,P=r.left,w=r.width,E=r.height,k=w/2,x=E/2,U={x:_+y,y:v+C},S={x:P+k,y:f+x},$={x:_+y,y:v},A={x:_+y,y:v+b},D={x:_,y:v+C},N={x:_+g,y:v+C},L={x:P+k,y:f},T={x:P+k,y:f+E},H={x:P,y:f+x},B={x:P+w,y:f+x},O={p1_top:$,p1_bottom:A,p1_left:D,p1_right:N,p2_top:L,p2_bottom:T,p2_left:H,p2_right:B};var W={};function I(t,s){const a=t+"_"+s;return W[a]=W[a]||e.Point.distance(O["p1_"+t],O["p2_"+s])}if(s==a.Auto||l==a.Auto){const e={x:U.x,y:-U.y},t={x:S.x,y:-S.y},o=180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI;switch(o){case 0:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left);break;case 90:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom);break;case 180:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case-90:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top);break;default:if(o<90&&o>0){let e=I("top","left"),t=I("right","left"),o=I("right","bottom"),i=I("top","bottom");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Left);break;case i:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom);break;case o:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Bottom);break;default:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left)}}else if(o<180&&o>90){let e=I("top","right"),t=I("left","right"),o=I("left","bottom"),i=I("top","bottom");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Right);break;case t:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case o:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Bottom);break;default:s==a.Auto&&(s=a.Top),l==a.Auto&&(l=a.Bottom)}}else if(o<-90){let e=I("bottom","right"),t=I("left","right"),o=I("left","top"),i=I("bottom","top");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Right);break;case t:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Right);break;case o:s==a.Auto&&(s=a.Left),l==a.Auto&&(l=a.Top);break;default:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top)}}else{let e=I("bottom","left"),t=I("right","left"),o=I("right","top"),i=I("bottom","top");switch(Math.min(e,t,o,i)){case e:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Left);break;case t:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Left);break;case o:s==a.Auto&&(s=a.Right),l==a.Auto&&(l=a.Top);break;default:s==a.Auto&&(s=a.Bottom),l==a.Auto&&(l=a.Top)}}}}function R(e){switch(e){case o.Arrow:case o.FatArrow:return 2;default:return 1}}const M=R(n),z=R(c);switch(s){case a.Bottom:h=A;break;case a.Center:m=h={x:_+y,y:v+C};break;case a.Left:h=D;break;case a.Right:h=N;break;case a.Top:h=$}switch(l){case a.Bottom:p=T;break;case a.Center:u=p={x:P+k,y:f+x};break;case a.Left:p=H;break;case a.Right:p=B;break;case a.Top:p=L}if(d===i.Path){const e=.333;switch(s){case a.Bottom:m={x:h.x,y:h.y+Math.abs(M*e*(p.y-h.y))};break;case a.Left:m={x:h.x-Math.abs(M*e*(p.x-h.x)),y:h.y};break;case a.Right:m={x:h.x+Math.abs(M*e*(p.x-h.x)),y:h.y};break;case a.Top:m={x:h.x,y:h.y-Math.abs(M*e*(h.y-p.y))}}switch(l){case a.Bottom:u={x:p.x,y:p.y+Math.abs(z*e*(p.y-h.y))};break;case a.Left:u={x:p.x-Math.abs(z*e*(p.x-h.x)),y:p.y};break;case a.Right:u={x:p.x+Math.abs(z*e*(p.x-h.x)),y:p.y};break;case a.Top:u={x:p.x,y:p.y-Math.abs(z*e*(p.y-h.y))}}}else{switch(s){case a.Bottom:m={x:h.x,y:h.y+Math.abs(M*(A.y-U.y))};break;case a.Left:m={x:h.x-Math.abs(M*(U.x-D.x)),y:h.y};break;case a.Right:m={x:h.x+Math.abs(M*(N.x-U.x)),y:h.y};break;case a.Top:m={x:h.x,y:h.y-Math.abs(M*($.y-U.y))}}switch(l){case a.Bottom:u={x:p.x,y:p.y+Math.abs(z*(T.y-S.y))};break;case a.Left:u={x:p.x-Math.abs(z*(S.x-H.x)),y:p.y};break;case a.Right:u={x:p.x+Math.abs(z*(B.x-S.x)),y:p.y};break;case a.Top:u={x:p.x,y:p.y-Math.abs(z*(L.y-S.y))}}}return{points:[h,m,p,u],anchors:[s,l]}}refresh(t,s){var o;if(e.Utils.isNull(t)||e.Utils.isNull(o=this._path))return;const i=!e.Utils.isNull(this.from)&&!e.Utils.isNull(this.to),n=e.Utils.isNull(this.from)&&e.Utils.isNull(this.to);if((this.disabled||!i)&&(o.removeAttribute("d"),n))return;const r=t===this.from?"from":"to";var l=("from"===r?this.fromAnchor:this.toAnchor)||a.Auto;e.Utils.isNull(s)&&(t instanceof Element?r in this._state&&(s=this._state[r].size):(s={height:0,width:0,left:t.x,top:t.y},l=a.Center)),e.Utils.isNull(s)||(this._state[r]={size:s,anchor:l},i&&this._draw())}_draw(){var t=this._state.from,s=this._state.to,a=this._path;if(e.Utils.isNull(a))return;if(e.Utils.isNullOrEmpty(t)||e.Utils.isNullOrEmpty(s)||this.from instanceof HTMLElement&&!e.Utils.isVisible(this.from)||this.to instanceof HTMLElement&&!e.Utils.isVisible(this.to))return void a.setAttribute("d","");const{points:i,anchors:n}=this._computeAnchorPoints(t.size,t.anchor,this.fromEnd,s.size,s.anchor,this.toEnd,this.tension),r=i[0],l=i[1],c=i[2],d=i[3],h=n[0],p=n[1],m=r.x,u=r.y,v=l.x,_=l.y,g=c.x,b=c.y,y=d.x,C=d.y;let f=this._getDefaultEndingPath(m,u);switch(this.fromEnd){case o.Arrow:f=this._getArrowEndingPath(m,u,h);break;case o.FatArrow:f=this._getFatArrowEndingPath(m,u,h);break;case o.None:f=""}let P=this._getDefaultEndingPath(g,b);switch(this.toEnd){case o.Arrow:P=this._getArrowEndingPath(g,b,p);break;case o.FatArrow:P=this._getFatArrowEndingPath(g,b,p);break;case o.None:P=""}const w=f+`M${m},${u} C${v},${_} ${y},${C} ${g},${b}`+P;-1===w.indexOf("NaN")&&a.setAttribute("d",w),e.Utils.isNullOrEmpty(this.color)||(a.style.stroke=this.color)}_getDefaultEndingPath(e,t){return`M${e-2},${t-2} h4 v4 h-4 z`}_getArrowEndingPath(e,t,s){switch(s){case a.Bottom:return`M${e-4},${t+4} l4,-4 l4,4`;case a.Top:return`M${e-4},${t-4} l4,4 l4,-4`;case a.Left:return`M${e-4},${t-4} l4,4 l-4,4`;case a.Right:return`M${e+4},${t-4} l-4,4 l4,4`;default:return""}}_getFatArrowEndingPath(e,t,s){switch(s){case a.Bottom:case a.Top:case a.Left:case a.Right:return this._getArrowEndingPath(e,t,s)+" z";default:return""}}};__decorate([e.Watch({emit:!1,converter:s.ElementOrPointPropertyConverter})],l.prototype,"from",void 0),__decorate([e.Watch({emit:!1,converter:s.ElementOrPointPropertyConverter})],l.prototype,"to",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"fromAnchor",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"toAnchor",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"fromEnd",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"toEnd",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"tension",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],l.prototype,"color",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],l.prototype,"interactive",void 0),l=__decorate([e.CustomElement({tagName:e.P+"-binder"})],l),s.PacemBinderElement=l}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemBladeElement extends t.PacemElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"open"===e&&this._toggle(s)}_toggle(t=this.open){(t?e.Utils.addClass:e.Utils.removeClass)(this,"blade-open");const s=t?"open":"close";this.dispatchEvent(new Event(s))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"open",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-blade",shadow:!0})],a),s.PacemBladeElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemButtonElement extends t.PacemIterableElement{constructor(){super("button")}connectedCallback(){super.connectedCallback(),this.hasAttribute("tab-order")||(this.tabOrder=0)}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"iconGlyph":case"iconUrl":this.dataset[e]=s}}emit(t){let a=s=>{if(super.emit(s),!s.defaultPrevented)if("click"!==s.type||e.Utils.isNullOrEmpty(this.commandName))switch(s.type){case"mousedown":0===t.button&&e.Utils.addClass(this,e.PCSS+"-active");break;case"keydown":32!==s.keyCode&&13!==s.keyCode||(t.preventDefault(),e.Utils.addClass(this,e.PCSS+"-active"));break;case"blur":case"mouseup":e.Utils.removeClass(this,e.PCSS+"-active");break;case"keyup":32!==s.keyCode&&13!==s.keyCode||(this.click(),e.Utils.removeClass(this,e.PCSS+"-active"))}else this.dispatchEvent(new e.CommandEvent({commandName:this.commandName,commandArgument:this.commandArgument}))};this.disabled||"click"!==t.type||e.Utils.isNull(this.confirmationDialog)?t instanceof MouseEvent&&0!==t.button||a(t):this.confirmationDialog.open(this.confirmationMessage).then(e=>{e.button!==s.DialogButton.Yes&&e.button!==s.DialogButton.Ok||a(t)})}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"iconGlyph",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"iconUrl",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"commandName",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],a.prototype,"commandArgument",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"confirmationMessage",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],a.prototype,"confirmationDialog",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-button"})],a),s.PacemButtonElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemButtonsetElement extends t.PacemIterativeElement{connectedCallback(){super.connectedCallback(),"tabindex"in this.attributes||(this.tabIndex=0)}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),"index"===e){let e=0;for(var o of this.items){if(e==s){o.focus();break}e++}}}validate(e){return e instanceof s.PacemButtonElement}};a=__decorate([e.CustomElement({tagName:e.P+"-buttonset"})],a),s.PacemButtonsetElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Month="month",e.Week="week",e.Day="day"}(a=s.CalendarZoom||(s.CalendarZoom={}));class ViewDateChangeEvent extends e.CustomTypedEvent{constructor(e){super("viewdatechange",e)}}s.ViewDateChangeEvent=ViewDateChangeEvent;class DateSelectEvent extends e.CustomTypedEvent{constructor(e){super("dateselect",e,{bubbles:!0})}}s.DateSelectEvent=DateSelectEvent;class TimeSelectEvent extends e.CustomTypedEvent{constructor(e){super("timeselect",e,{bubbles:!0})}}s.TimeSelectEvent=TimeSelectEvent;const o=36e5,i=864e5,n=[0,.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5];let r=new Date;const l=e.Utils.Dates.dateOnly(r).valueOf(),c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];let d=class PacemCalendarEventElement extends t.PacemItemElement{propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),cancelAnimationFrame(this._handle),this._handle=requestAnimationFrame(()=>{let t=this.container;e.Utils.isNull(t)||t.dispatchEvent(new e.PropertyChangeEvent({propertyName:"items",oldValue:t.items,currentValue:t.items}))})}};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],d.prototype,"start",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],d.prototype,"end",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],d.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Json})],d.prototype,"place",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],d.prototype,"allDay",void 0),d=__decorate([e.CustomElement({tagName:e.P+"-calendar-event"})],d),s.PacemCalendarEventElement=d;class CalendarEventSelectEvent extends e.CustomTypedEvent{constructor(e){super("eventselect",e,{bubbles:!1,cancelable:!0})}}s.CalendarEventSelectEvent=CalendarEventSelectEvent;class CalendarEventUnselectEvent extends e.CustomTypedEvent{constructor(e){super("eventunselect",e,{bubbles:!1,cancelable:!0})}}s.CalendarEventUnselectEvent=CalendarEventUnselectEvent;class PacemCalendarBaseElement extends t.PacemItemsContainerElement{validate(e){return e instanceof d}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),"viewDate"!==t&&"weekStart"!==t||this._synchronizeWeek(),t){case"viewDate":this.dispatchEvent(new ViewDateChangeEvent(a)),e.Utils.removeClass(this,"viewdate-next viewdate-previous"),requestAnimationFrame(()=>{e.Utils.addClass(this,s>a?"viewdate-previous":"viewdate-next")});break;case"zoom":e.Utils.removeClass(this,"viewdate-next viewdate-previous")}}oneventselect(e,t){this.dispatchEvent(new CalendarEventSelectEvent({element:e,event:t}))}oneventunselect(e,t){this.dispatchEvent(new CalendarEventUnselectEvent({element:e,event:t}))}getHeaderLabel(t,s){const o=s===a.Week?{weekday:"short",day:"numeric",month:"numeric"}:s===a.Day?{weekday:"long"}:{weekday:"short"};return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),o)}getDayLabel(t){const s=1==t.getDate()?{month:"short",day:"numeric"}:{day:"numeric"};return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),s)}getHourLabel(t){return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),{hour:"numeric"})}getTimeLabel(t){return e.Utils.parseDate(t).toLocaleString(e.Utils.lang(this),{hour:"numeric",minute:"numeric"})}isNow(t,s){const a=e.Utils.parseDate(t),o=e.Utils.parseDate(s||new Date);return a.getHours()===o.getHours()&&this.isToday(t,s)}isToday(e,t){return this.isDate(e,t||new Date)}isViewDay(e,t=this.viewDate){return this.isDate(e,t||this.viewDate||new Date)}isDate(t,s){if(!e.Utils.Dates.isDate(s)||!e.Utils.Dates.isDate(t))return!1;const a=e.Utils.parseDate(t),o=e.Utils.parseDate(s);return a.getDate()===o.getDate()&&a.getMonth()==o.getMonth()&&a.getFullYear()===o.getFullYear()}isViewWeek(t){const s=e.Utils.parseDate(t);return this.week&&this.week.find(e=>e.getDate()==s.getDate()&&e.getMonth()==s.getMonth()&&e.getDate()==s.getDate())}isViewMonth(t){const s=e.Utils.parseDate(t),a=e.Utils.parseDate(this.viewDate||new Date);return s.getMonth()==a.getMonth()&&s.getFullYear()===a.getFullYear()}isTimeSlotDisabled(t,s,a){if(!e.Utils.isNullOrEmpty(t)){a=a||0;const o=new Date(s.getFullYear(),s.getMonth(),s.getDate(),Math.floor(a),a%1*60),i=o.getTimezoneOffset(),n=o.valueOf()-60*i*1e3;for(let s of t){let t=e.Utils.Dates.parse(s.from),a=e.Utils.Dates.parse(s.to);if((!t||t&&t.valueOf()<=n)&&(!a||a&&a.valueOf()>n)&&(a||t))return!0}}return!1}_getWeekStart(e,t){let s=e.getDay(),a=e.valueOf();const o=(t||"m").toLowerCase().startsWith("m")?1:0;return s===o?a:(0===s&&(s=7),a+(o-s)*i)}_getDatasource(t,s=this.weekStart){let a=e.Utils.Dates.dateOnly(e.Utils.parseDate(t));const n=this.month;let r=n&&n.length&&n[0]&&n[0].length&&n[0][0];if(r&&r.getMonth()==a.getMonth()&&r.getFullYear()==a.getFullYear()&&n.find(t=>!e.Utils.isNull(t.find(e=>e.valueOf()==a.valueOf()))))return n;let l=new Date(a.getFullYear(),a.getMonth(),1),c=this._getWeekStart(l,s),d=[],h=[];do{let t=e.Utils.Dates.dateOnly(new Date(c));h.push(t),7==h.length&&d.push(h.splice(0)),c=t.valueOf()+i+o}while(d.length<6);return this.month=d}_synchronizeWeek(){const t=e.Utils.parseDate(this.viewDate),s=new Date(t.getFullYear(),t.getMonth(),1),a=this._getDatasource(s,this.weekStart).filter((e,s)=>e.some(e=>e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear()))[0];this.week&&this.week.length&&this.week[0]===a[0]||(this.week=a)}}__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],PacemCalendarBaseElement.prototype,"viewDate",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],PacemCalendarBaseElement.prototype,"now",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],PacemCalendarBaseElement.prototype,"zoom",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],PacemCalendarBaseElement.prototype,"weekStart",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"week",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"month",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Eval})],PacemCalendarBaseElement.prototype,"disabledRanges",void 0),s.PacemCalendarBaseElement=PacemCalendarBaseElement;class PacemCalendarWithEventsBaseElement extends PacemCalendarBaseElement{constructor(){super(...arguments),this._datasource=[]}get datasource(){return this._datasource}_getSortedItems(e){return e.slice().sort((e,t)=>{const s=e.start.valueOf(),a=t.start.valueOf();if(s!=a)return s<a?-1:1;const o=e.end.valueOf()-s,i=t.end.valueOf()-a;return o!=i?o>i?-1:1:0})}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"month":case"week":case"items":case"zoom":case"viewDate":cancelAnimationFrame(this._handle),this._handle=requestAnimationFrame(()=>{let t=this._datasource,s=this._datasource=this.buildDataSource(this._getSortedItems(this.items||[]));this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"datasource",oldValue:t,currentValue:s}))})}}}function h(t,s){let a=s.length-1,o=s[0].valueOf(),i=s[a].valueOf();return t.filter(t=>{let s=e.Utils.Dates.dateOnly(t.start),a=e.Utils.Dates.dateOnly(t.end);return s.valueOf()<=i&&a.valueOf()>=o}).map(t=>{let o=e.Utils.Dates.dateOnly(t.start),i=s.find(e=>e.valueOf()==o.valueOf()),n=s.indexOf(i),r=e.Utils.Dates.dateOnly(t.end),l=s.find(e=>e.valueOf()==r.valueOf()),c=s.indexOf(l),d=-1==n?0:n,h=-1==c?a:c;return{start:t.start,end:t.end,allDay:!0,day:d,continuing:{start:-1==n,end:-1==c},span:h+1-d,caption:t.caption,event:t}})}s.PacemCalendarWithEventsBaseElement=PacemCalendarWithEventsBaseElement;let p=class PacemAgendaElement extends PacemCalendarWithEventsBaseElement{constructor(){super(...arguments),this._allDayDatasource=[]}buildDataSource(t){var s=this.week;this.zoom===a.Day&&(s=[e.Utils.Dates.dateOnly(this.viewDate)]);let o=[];if(!e.Utils.isNull(s)){this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"allDayDatasource",oldValue:this._allDayDatasource,currentValue:this._allDayDatasource=h(t.filter(e=>e.end.valueOf()-e.start.valueOf()>=i),s)}));for(let a=0;a<s.length;a++){let r=s[a].valueOf(),l=t.filter(t=>{let s=e.Utils.Dates.dateOnly(t.start),a=e.Utils.Dates.dateOnly(t.end);return s.valueOf()<=r&&a.valueOf()>=r}).map(e=>{let t=e.start.valueOf(),s=e.end.valueOf(),a={allDay:e.allDay||s-t>=i,continuing:{start:t<r,end:s>r+i},caption:e.caption,hour:0,span:n.length-1,offset:{start:"0",end:"0"},event:e},o=e.start.getHours()+e.start.getMinutes()/60,l=a.continuing.start?0:Math.floor(2*o),c=e.end.getHours()+e.end.getMinutes()/60,d=-1+(a.continuing.end?n.length:Math.ceil(2*c)),h=d+1,p=h>=n.length?24:n[h],m=p-n[l];return a.hour=l,a.span=1+d-l,a.continuing.start||(a.offset.start=(o-n[l])/m*100+"%"),a.continuing.end||(a.offset.end=(p-c)/m*100+"%"),a});o.push(l)}}return o}get allDayDatasource(){return this._allDayDatasource}propertyChangedCallback(t,s,o,i){super.propertyChangedCallback(t,s,o,i);const n=this._clock;if("time"===t)this.dispatchEvent(new TimeSelectEvent(o));else if(!e.Utils.isNull(n)&&("now"===t&&(n.now=o,n.className=`hour-${o.getHours()} minute-${o.getMinutes()}`),"now"===t||"zoom"===t||"viewDate"===t)){const e=this.now,t=this.zoom,s=e&&t&&(this.isViewDay(e)&&t===a.Day||this.isViewWeek(e)&&t===a.Week);n.hidden=!s}}};__decorate([e.ViewChild(e.P+"-clock")],p.prototype,"_clock",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],p.prototype,"time",void 0),p=__decorate([e.CustomElement({tagName:e.P+"-agenda",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-agenda agenda-grid" datasource="{{ :host.datasource }}">${function(){let t="";for(let s=0;s<7;s++)0==s&&(t+='<div class="agenda-left all-day"></div>'),t+=`<${e.P}-panel class="agenda-slot all-day day-${s+1}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate), 'today': :host.isToday(:host.week[${s}], :host.now)} }}"></${e.P}-panel>`;for(let s=0;s<7;s++)for(let a of n){let i=a%1==0,n="hour-"+(i?"whole":"half");0==s&&i&&(t+=`<${e.P}-text class="agenda-left ${n} hour-${2*a+1}"" text="{{ :host.getHourLabel(${l+a*o}) }}"></${e.P}-text>`),t+=`<${e.P}-panel on-click=":host.time = Pacem.Utils.Dates.parse(:host.week[${s}].valueOf() + ${a*o})" disabled="{{ :host.isTimeSlotDisabled(:host.disabledRanges, :host.week[${s}], ${a}) }}" class="agenda-slot ${n} day-${s+1} hour-${2*a+1}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate), 'today': :host.isToday(:host.week[${s}], :host.now)} }}"></${e.P}-panel>`}return t}()}<${e.P}-clock hidden></${e.P}-clock>\n <template>\n <${e.P}-repeater class="agenda-day" datasource="{{ ^item }}">\n <template>\n <${e.P}-panel class="agenda-event-wrapper" \ncss-class="{{ ['hour-start-'+ (^item.hour + 1), 'hour-end-'+ (^item.hour + ^item.span +1), 'day-start-'+ (!^item.continuing.start), 'day-end-'+ (!^item.continuing.end)] }}">\n <${e.P}-panel class="agenda-event" css="{{ {'top': ^item.offset.start, 'bottom': ^item.offset.end} }}" tab-order="{{ (^^index + 1) * 1000 + (^item.hour + 1) * 100 + ^index }}"\n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)">\n <${e.P}-span class="event-caption" text="{{ ^item.caption }}"></${e.P}-span>\n </${e.P}-panel>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n </template>\n <${e.P}-repeater class="agenda-allday" datasource="{{ :host.allDayDatasource }}">\n <template>\n <${e.P}-panel class="agenda-event" tab-order="{{ (^index + 1) * 500 + (^item.day + 1) * 50 + ^index }}" css-class="{{ ['day-start-'+ (^item.day + 1), 'day-end-'+ (^item.day + ^item.span + 1)] }}"\n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)">\n <${e.P}-text class="event-caption" text="{{ ^item.caption }}"></${e.P}-text>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n</${e.P}-repeater><${e.P}-content></${e.P}-content>`})],p),s.PacemAgendaElement=p;let m=class PacemCalendarElement extends PacemCalendarWithEventsBaseElement{buildDataSource(t){const s=this.month;let a=[];if(!e.Utils.isNull(s))for(let e=0;e<s.length;e++){let o=h(t,s[e]);a.push(o)}return a}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),"dayLabelFormatter"===e)this._formatVersion=Date.now()}_setDate(e){e?.valueOf()!==this.date?.valueOf()&&(this.date=e,this.dispatchEvent(new DateSelectEvent(e)))}getDayLabel(e,t=this._formatVersion){const s=this.dayLabelFormatter;return"function"==typeof s?s(e):super.getDayLabel(e)}};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],m.prototype,"date",void 0),__decorate([e.Watch({emit:!1})],m.prototype,"dayLabelFormatter",void 0),__decorate([e.Watch()],m.prototype,"_formatVersion",void 0),m=__decorate([e.CustomElement({tagName:e.P+"-calendar",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-calendar calendar-grid" datasource="{{ :host.datasource }}">${function(){let t="";for(let s=0;s<6;s++)for(let a=0;a<7;a++){let o=`class="calendar-day week-${s+1} day-${a+1}"`;t+=`<${e.P}-panel disabled="{{ :host.isTimeSlotDisabled(:host.disabledRanges, :host.month[${s}][${a}]) }}" on-click=":host._setDate(:host.month[${s}][${a}])" ${o} css-class="{{ {'viewmonth': :host.isViewMonth(:host.month[${s}][${a}]), 'viewday': :host.isViewDay(:host.month[${s}][${a}], :host.viewDate), 'today': :host.isToday(:host.month[${s}][${a}], :host.now), 'selected-date': :host.isDate(:host.month[${s}][${a}], :host.date)} }}"><${e.P}-span culture="{{ :host.culture }}" class="text-ellipsed" text="{{ :host.getDayLabel(:host.month[${s}][${a}], :host._formatVersion) }}"></${e.P}-span></${e.P}-panel>`}return t}()}\n <template>\n <${e.P}-repeater class="calendar-week" datasource="{{ ^item }}">\n <template>\n <${e.P}-panel class="calendar-event" tab-order="{{ (^^index + 1) * 1000 + (^item.day + 1) * 100 + ^index }}" \n on-focus=":host.oneventselect($this, ^item.event)" on-blur=":host.oneventunselect($this, ^item.event)"\n css-class="{{ ['day-start-'+ (^item.day + 1), 'day-end-'+ (^item.day + ^item.span + 1)] }}">\n <${e.P}-span class="event-startdate" culture="{{ :host.culture }}" hide="{{ ^item.continuing.start }}" text="{{ :host.getTimeLabel(^item.event.start) }}"></${e.P}-span>\n <${e.P}-span class="event-caption" text="{{ ^item.caption }}"></${e.P}-span>\n </${e.P}-panel>\n </template>\n </${e.P}-repeater>\n </template>\n</${e.P}-repeater><${e.P}-content></${e.P}-content>`})],m),s.PacemCalendarElement=m;let u=class PacemClockElement extends t.PacemElement{};__decorate([e.Watch({converter:e.PropertyConverters.Datetime})],u.prototype,"now",void 0),u=__decorate([e.CustomElement({tagName:e.P+"-clock"})],u),s.PacemClockElement=u;let v=class PacemScheduleElement extends PacemCalendarBaseElement{viewActivatedCallback(){super.viewActivatedCallback(),this._calendar.addEventListener("dateselect",this.emitHandler,!1),this._agenda.addEventListener("timeselect",this.emitHandler,!1),this.now=new Date}disconnectedCallback(){this._calendar&&(this._calendar.removeEventListener("dateselect",this.emitHandler,!1),this._agenda.removeEventListener("timeselect",this.emitHandler,!1)),super.disconnectedCallback()}};__decorate([e.ViewChild(e.P+"-calendar")],v.prototype,"_calendar",void 0),__decorate([e.ViewChild(e.P+"-agenda")],v.prototype,"_agenda",void 0),v=__decorate([e.CustomElement({tagName:e.P+"-schedule",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-panel class="${e.PCSS}-schedule" css-class="{{ ['schedule-'+ (:host.zoom || '${a.Month}')] }}">\n <${e.P}-timer interval="10000" on-tick=":host.now = Pacem.Utils.parseDate(Date.now())"></${e.P}-timer>\n ${function(){let t="";for(let s=0;s<7;s++)t+=`<${e.P}-span culture="{{ :host.culture }}" css-class="{{ {'viewday': :host.isViewDay(:host.week[${s}], :host.viewDate)} }}" class="schedule-heading day-${s+1} text-ellipsed" text="{{ :host.getHeaderLabel(:host.week[${s}], :host.zoom) }}"></${e.P}-span>`;return e.Utils.uniqueCode(),`<div class="schedule-header schedule-grid"><div class="heading-left"></div>${t}</div>`}()}\n <${e.P}-agenda disabled-ranges="{{ :host.disabledRanges }}" on-eventselect=":host.handle($event)" on-eventunselect=":host.handle($event)" now="{{ :host.now }}" culture="{{ :host.culture }}" view-date="{{ :host.viewDate }}" zoom="{{ :host.zoom }}" week-start="{{ :host.weekStart }}" items="{{ :host.items }}"></${e.P}-agenda>\n <${e.P}-calendar disabled-ranges="{{ :host.disabledRanges }}" on-eventselect=":host.handle($event)" on-eventunselect=":host.handle($event)" now="{{ :host.now }}" culture="{{ :host.culture }}" view-date="{{ :host.viewDate }}" zoom="{{ :host.zoom }}" week-start="{{ :host.weekStart }}" items="{{ :host.items }}"></${e.P}-calendar>\n <${e.P}-content></${e.P}-content>\n</${e.P}-panel>`})],v),s.PacemScheduleElement=v;class PacemCalendarRuleBaseElement extends HTMLElement{constructor(){super(...arguments),this._disabledRanges=[]}viewActivatedCallback(){if(e.Utils.isNull(this._target=e.CustomElementUtils.findAncestor(this,e=>e instanceof PacemCalendarBaseElement)))throw`Missing ancestor calendar element for ${this.constructor.name}.`;this.refreshDisabledRanges()}disconnectedCallback(){this._target=void 0}get target(){return this._target}refreshDisabledRanges(){if(e.Utils.isNullOrEmpty(this._target))return;let t=this._target.disabledRanges||[];for(let e of this._disabledRanges){let s=t.indexOf(e);s>=0&&t.splice(s,1)}this._disabledRanges=this.computeDisabledRanges()||[];for(let e of this._disabledRanges)t.push(e);this._target.disabledRanges=t}}__decorate([e.Debounce(!0)],PacemCalendarRuleBaseElement.prototype,"refreshDisabledRanges",null),s.PacemCalendarRuleBaseElement=PacemCalendarRuleBaseElement;let _=class PacemCalendarDayOfWeekRuleElement extends PacemCalendarRuleBaseElement{constructor(){super(...arguments),this._daysOfWeek=[],this._calendarChangeHandler=e=>{"month"==e.detail.propertyName&&this.refreshDisabledRanges()}}viewActivatedCallback(){super.viewActivatedCallback(),this.target.addEventListener(e.PropertyChangeEventName,this._calendarChangeHandler,!1)}propertyChangedCallback(e,t,s,a){"days"===e&&(this._daysOfWeek=(s||[]).map(e=>c.indexOf(e)).filter(e=>e>=0),this.refreshDisabledRanges())}computeDisabledRanges(){let t=[];for(let s of this.target.month)for(let a of s)if(-1==this._daysOfWeek.indexOf(a.getDay())){let s=e.Utils.Dates.dateOnly(a),n=e.Utils.Dates.dateOnly(new Date(s.valueOf()+i+o));t.push({from:s,to:n})}return t}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.StringArray})],_.prototype,"days",void 0),_=__decorate([e.CustomElement({tagName:e.P+"-calendar-daysofweek-rule"})],_),s.PacemCalendarDayOfWeekRuleElement=_}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemCollapseElement extends t.PacemEventTarget{constructor(){super(...arguments),this._resizeHandler=e=>{this.#e=e.detail,this._toggle()}}#e;propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"collapse":this._toggle();case"disabled":e.Utils.isNull(this._resizer)||(this._resizer.disabled=this.disabled||this.collapse)}}viewActivatedCallback(){super.viewActivatedCallback();const e=this._resizer;this.#e=e.currentSize,this._toggle()}_toggle(){const t=this,s=this.collapse,a=this.#e;this.disabled||e.Utils.isNull(t)||(this.horizontal?(e.Utils.addClass(t,e.PCSS+"-horizontal"),t.style.height=a&&a.height+"px"||"",t.style.width=s?"0":a&&a.width+"px"||""):(e.Utils.removeClass(t,e.PCSS+"-horizontal"),t.style.height=s?"0":a&&a.height+"px"||""))}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"collapse",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"horizontal",void 0),__decorate([e.ViewChild(e.P+"-resize")],a.prototype,"_resizer",void 0),__decorate([e.ViewChild("[part=content]")],a.prototype,"_container",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-collapse",shadow:!0,template:`<${e.P}-resize on-${t.ResizeEventName}=":host._resizeHandler($event)" target="{{ ::_container }}"></${e.P}-resize><div part="container"><div part="content"><slot></slot></div></div>`})],a),s.PacemCollapseElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a,o;!function(e){e.YesNo="yesno",e.YesNoCancel="yesnocancel",e.Ok="ok",e.OkCancel="okcancel"}(a=s.DialogButtons||(s.DialogButtons={})),function(e){e.Yes="yes",e.No="no",e.Cancel="cancel",e.Ok="ok"}(o=s.DialogButton||(s.DialogButton={})),s.DialogResultEventName="commit";class DialogResultEvent extends e.CustomTypedEvent{constructor(e){super(s.DialogResultEventName,e)}}s.DialogResultEvent=DialogResultEvent;class PacemDialogBase extends t.PacemElement{open(t){const s=this.lightbox;if(!e.Utils.isNull(this._deferred))throw`${i.name} already open.`;const a=this._deferred=Promise.withResolvers();return this.hide||this.disabled?(this.log(e.Logging.LogLevel.Warn,"Dialog hidden or disabled, opening forbidden."),a.reject()):(this.dispatchEvent(new Event("open")),s.show=!0,this.state=t),a.promise}commit(t,s){e.avoidHandler(s),this.log(e.Logging.LogLevel.Debug,`Committing dialog by clicking '${t}'.`);const a=this.state;var o=new DialogResultEvent({button:t,state:a});this.lightbox.show=!1,this._deferred.resolve(o.detail),this._deferred=null,this.dispatchEvent(o)}}__decorate([e.Watch()],PacemDialogBase.prototype,"state",void 0),s.PacemDialogBase=PacemDialogBase;let i=class PacemDialogElement extends PacemDialogBase{constructor(){super(...arguments),this.buttons=a.Ok,this.okCaption="OK",this.yesCaption="Yes",this.noCaption="No",this.cancelCaption="Cancel"}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a)}open(e){const t=super.open(e);switch(this.buttons){case a.Ok:case a.OkCancel:this.dialogButtons.ok.focus();break;default:this.dialogButtons.yes.focus()}return t}viewActivatedCallback(){super.viewActivatedCallback()}get dialogButtons(){const e=this._buttons;return{ok:e&&e.firstElementChild.firstElementChild,yes:e&&e.firstElementChild.children.item(1),no:e&&e.firstElementChild.children.item(2),cancel:e&&e.firstElementChild.lastElementChild}}};__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"buttons",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"okCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"yesCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"noCaption",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.String})],i.prototype,"cancelCaption",void 0),__decorate([e.ViewChild(`.${e.PCSS}-dialog-buttons`)],i.prototype,"_buttons",void 0),__decorate([e.ViewChild(e.P+"-lightbox")],i.prototype,"lightbox",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-dialog",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-lightbox modal="true" logger="{{ :host.logger }}">\n <${e.P}-content></${e.P}-content>\n <div class="${e.PCSS}-dialog-buttons ${e.PCSS}-buttonset buttons" part="dialog-buttons" slot="bottom">\n <div class="buttonset-left">\n <${e.P}-button class="button button-size size-small primary dialog-ok" css-class="{{ {'buttonset-last': :host.buttons === 'ok'} }}" on-click=":host.commit('ok', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'ok' && :host.buttons !== 'okcancel' }}"><${e.P}-text text="{{ :host.okCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small primary dialog-yes" css-class="{{ {'buttonset-first': :host.buttons !== 'ok' || :host.buttons !== 'okcancel'} }}" on-click=":host.commit('yes', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons === 'ok' || :host.buttons === 'okcancel' }}"><${e.P}-text text="{{ :host.yesCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small dialog-no" css-class="{{ {'buttonset-last': :host.buttons === 'yesno'} }}" on-click=":host.commit('no', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'yesno' && :host.buttons !== 'yesnocancel' }}"><${e.P}-text text="{{ :host.noCaption }}"></${e.P}-text></${e.P}-button>\n <${e.P}-button class="button button-size size-small dialog-cancel" on-click=":host.commit('cancel', $event)" disabled="{{ :host.disabled || this.hide }}" hide="{{ :host.buttons !== 'yesnocancel' && :host.buttons !== 'okcancel' }}"><${e.P}-text text="{{ :host.cancelCaption }}"></${e.P}-text></${e.P}-button>\n </div>\n </div>\n</${e.P}-lightbox>`})],i),s.PacemDialogElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemDividerElement extends t.PacemElement{constructor(){super("separator")}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),a||"orientation"!==e||this._syncOrientation(s)}viewActivatedCallback(){super.viewActivatedCallback(),this._syncOrientation()}_syncOrientation(t=this.orientation){if("vertical"!==t&&(t="horizontal"),super.aria.attributes.set("orientation",t),"vertical"===t)e.Utils.addClass(this,"divider-vertical");else e.Utils.removeClass(this,"divider-vertical")}};__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],a.prototype,"orientation",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-divider",shadow:!0,template:'<div part="divider"><div part="prepend"></div><slot part="content"></slot><div part="append"></div></div>'})],a),s.PacemDividerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a=/^\s*<svg\s/,o=/^fa(b|r|s|l|d|t|-brands|-solid|-regular|-light|-thin|-duotone)?\s+fa-/,i="https://kit.fontawesome.com/4922589c3c.js",n=!0,r=/^lni\s+lni-/,l=/^ci[dlsbf]-/,c=/^material-icons?\s+([\w]+)/,d=/^material(-symbols?)?\s+([\w]+)/,h="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200",p=/^(https?:\/\/|\/\/)?.+\.(webp|svg|gif|png|jpe?g)$/,m=[];function u(t,s,a,o,i){return m.indexOf(t)>=0?Promise.resolve():(m.push(t),e.Utils.Css.isClassDefined(t)?Promise.resolve():i?e.CustomElementUtils.importjs(s,a,o):e.CustomElementUtils.importcss(s,a,o))}let v=class PacemIconElement extends t.PacemElement{constructor(){super("",{hidden:"true"})}propertyChangedCallback(e,t,s,a){if(super.propertyChangedCallback(e,t,s,a),!a)switch(e){case"icon":this._setIcon();break;case"hide":s||this.aria.attributes.set("hidden","true")}}viewActivatedCallback(){super.viewActivatedCallback(),this._setIcon()}_setIcon(t=this.icon){(function(t){return new Promise((s,m)=>{if(e.Utils.isNullOrEmpty(t))m("No icon provided");else if(a.test(t))s(t);else if(o.test(t))u("fa",i,void 0,n,!0).then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(d.test(t))u("material-symbols",h).then(e=>{const a=d.exec(t),o=a[2],i=t.substring(a[0].length);s(`<i class="material-symbols-outlined${i}">${o}</i>`)},e=>m(e));else if(c.test(t))u("material-icons",h).then(e=>{const a=c.exec(t),o=a[1],i=t.substring(a[0].length);s(`<i class="material-icons${i}">${o}</i>`)},e=>m(e));else if(r.test(t))u("lni","https://cdn.lineicons.com/2.0/LineIcons.css").then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(l.test(t))u("clb","https://unpkg.com/@coreui/icons/css/all.min.css").then(e=>{s(`<i class="${t}"></i>`)},e=>m(e));else if(p.test(t))s(`<img src="${t}" />`);else{const a=t.trim().split(" "),o=a[0],i=a.length>1?" "+a.slice(1).join(" "):"";s(`<i class="${e.PCSS}-icon${i}">${o}</i>`)}})})(t).then(e=>{this.innerHTML=e},e=>{this.innerHTML=""})}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],v.prototype,"icon",void 0),v=__decorate([e.CustomElement({tagName:e.P+"-icon"})],v),s.PacemIconElement=v}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemImageElement extends t.PacemElement{constructor(){super("img")}propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"src":case"disabled":this._setSource();break;case"size":case"adapt":this._setLayout();break;case"loading":(a?e.Utils.removeClass:e.Utils.addClass)(this,"img-ready")}}viewActivatedCallback(){super.viewActivatedCallback(),this._setLayout(),this._setSource()}_setLayout(){const t=!e.Utils.isNullOrEmpty(this.size),s=this.adapt||"auto",a=this.size||this.#t||{width:"0",height:"0"};this.style.backgroundSize=s;const o="auto"===s,i=a.width,n=a.height;(o||t)&&(this.style.width=i||"",this.style.height=n||"")}#t;async _setSource(){if(this.disabled||!this.isReady)return;const t=this.src;if(this.style.backgroundImage="",!e.Utils.isNullOrEmpty(t)){this.loading=!0;try{const s=await e.Utils.loadImage(t);let a,o,i;window.performance&&(o=performance.getEntriesByName(s.src))&&(i=o[0])&&(a=i.decodedBodySize),this.#t={width:s.naturalWidth+"px",height:s.naturalHeight+"px",weight:a},this._setLayout(),this.style.backgroundImage=`url("${s.src}")`}catch(e){}finally{this.loading=!1}}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"adapt",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"src",void 0),__decorate([e.Watch({emit:!1,converter:{convert:(e,t)=>{const s=/^\s*([\d.]+)(px|em|rem|vw|vh)?\s*(?:,\s*([\d.]+)(px|em|rem|vw|vh)?)?\s*$/i.exec(e),a=s?s[1]+(s[2]||"px"):"0";return{width:a,height:s?s[3]?s[3]+(s[4]||"px"):a:"0"}},convertBack:(e,t)=>`${e?.width},${e?.height}`},reflectBack:!0})],a.prototype,"size",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"loading",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-img"})],a),s.PacemImageElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemInfiniteScrollerElement extends t.PacemEventTarget{constructor(){super(),this._scrollDelegate=()=>this._doScroll(),this._enabled=!0,this._viewportHeight=0,this._innerHeight=0,this._isDocument=!1,this._container=null,this._viewport=null,this._scroller=null,this._bottomGap=10,this._container=this,this._viewport=this,this._scroller=this}viewActivatedCallback(){super.viewActivatedCallback(),this.setInfiniteScrollContainer(this._container)}disconnectedCallback(){e.Utils.isNull(this._scroller)||this._scroller.removeEventListener("scroll",this._scrollDelegate,!1),super.disconnectedCallback()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"container":this.setInfiniteScrollContainer(s);break;case"disabled":(this._enabled=!s)&&this._doScroll();break;case"threshold":this._bottomGap=s||0}}setInfiniteScrollContainer(e="$document"){var t=e,s=this._isDocument="$document"===t||t===document.body||t===document.documentElement;this._container=s?document.body||document.documentElement:"string"==typeof e?document.querySelector(t):t,this._viewport=s?window:this._container,this._scroller&&this._scroller.removeEventListener("scroll",this._scrollDelegate,!1),this._scroller=s?window.document:this._container,this._scroller.addEventListener("scroll",this._scrollDelegate,!1),this._enabled&&this._doScroll()}_emitFetchMore(){var e=new CustomEvent("fetchmore");this.dispatchEvent(e)}_doScroll(){if(this._enabled)if(this._computeHeight())this._doScroll();else{var e=this._scroller instanceof Document?window.pageYOffset:this._scroller.scrollTop,t=this._viewportHeight,s=this._innerHeight;(s-(e+t)<this._bottomGap||s<=t)&&(this._emitFetchMore(),window.requestAnimationFrame(()=>{this._enabled&&this._doScroll()}))}}_computeHeight(){if(this._container){var t,s=this._container,a=Number.MAX_VALUE,o=0;if(this._isDocument){var i=s;t=Math.max(i.scrollHeight,i.offsetHeight,i.clientHeight)}else{for(var n=0;n<s.children.length;n++){var r=s.children.item(n),l=r.offsetTop,c=r.offsetHeight,d=l+c;l<a&&(a=l),d>o&&(o=d)}t=Math.round(o-a)}var h=this._viewport instanceof Window?e.Utils.windowSize.height:this._viewport.offsetHeight;return(t!=this._innerHeight||h!=this._viewportHeight)&&(this._innerHeight=t,this._viewportHeight=h,!0)}}};__decorate([e.Watch({converter:e.PropertyConverters.String})],a.prototype,"container",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.Number})],a.prototype,"threshold",void 0),__decorate([e.Debounce(100)],a.prototype,"_doScroll",null),a=__decorate([e.CustomElement({tagName:e.P+"-infinite-scroller"})],a),s.PacemInfiniteScrollerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){class PacemAdaptedIterativeElement extends t.PacemElement{constructor(){super(...arguments),this.index=0}isCloseTo(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isCloseToCore(t,s,this.datasource.length)}isPrevious(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isPreviousCore(t,s,this.datasource.length)}isNext(t,s){return!e.Utils.isNull(this.datasource)&&0!=this.datasource.length&&this._isNextCore(t,s,this.datasource.length)}_isNextCore(e,t,s){return(t+1)%s===e}_isPreviousCore(e,t,s){return(t-1+s)%s===e}_isCloseToCore(e,t,s){return(t+s)%s==(e+s)%s||this._isNextCore(e,t,s)||this._isPreviousCore(e,t,s)}}__decorate([e.Watch({converter:e.PropertyConverters.Number})],PacemAdaptedIterativeElement.prototype,"index",void 0),__decorate([e.Watch()],PacemAdaptedIterativeElement.prototype,"datasource",void 0),s.PacemAdaptedIterativeElement=PacemAdaptedIterativeElement}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.ClickOutsideClose="clickOutsideClose",e.ExplicitClose="explicitClose"}(a=s.LightboxBehavior||(s.LightboxBehavior={}));let o=class PacemLightboxElement extends t.PacemElement{constructor(){super(...arguments),this._keyupHandler=e=>{27===e.keyCode&&this.show&&!this.modal&&(this.show=!1)},this._wrapperMousedownHandler=t=>{this.modal||this.behavior===a.ExplicitClose?e.stopPropagationHandler(t):this.show=!1},this._slotchangeHandler=e=>{this._resetLayout()},this._closeHandler=e=>{this._close(e)}}_resetLayout(){this._disposeButton();const t=this._ensureButton();e.Utils.isNull(t)||t.addEventListener("click",this._closeHandler,!1)}_toggleCloseVisibility(){const t=this._closeWrapper;e.Utils.isNull(t)||(t.hidden=this.modal)}viewActivatedCallback(){super.viewActivatedCallback(),this._toggleCloseVisibility();var t=this._wrapperElement,s=this._container;t.addEventListener("mousedown",this._wrapperMousedownHandler,!1),s.addEventListener("mousedown",e.stopPropagationHandler,!1),document.body.removeEventListener("scroll",e.avoidHandler,!0),window.addEventListener("keyup",this._keyupHandler,!1),this._resetLayout(),this._slot.addEventListener("slotchange",this._slotchangeHandler,!1)}propertyChangedCallback(t,s,a,o){if(super.propertyChangedCallback(t,s,a,o),!o)switch(t){case"show":const t=this._wrapperElement,o=this._container;if(a){this.inert=!1,this.dispatchEvent(new Event("open",{bubbles:!0,cancelable:!1})),t.style.display="",t.hidden=!1,window.requestAnimationFrame(()=>{e.Utils.addPart(t,"lightbox-wrapper-shown"),e.Utils.addPart(o,"lightbox-shown")});var i=this.querySelector("."+e.PCSS+"-scrollable");i&&window.requestAnimationFrame(()=>i.scrollTop=0)}else s&&(this.inert=!0,this.dispatchEvent(new Event("close",{bubbles:!0,cancelable:!1})),e.Utils.removePart(t,"lightbox-wrapper-shown"),e.Utils.removePart(o,"lightbox-shown"),e.Utils.addAnimationEndCallback(t,e=>{e.hidden=!0,e.style.display="none"},500));break;case"modal":this._toggleCloseVisibility()}}disconnectedCallback(){this.show&&this._close();var t=this._wrapperElement,s=this._container;document.body.removeEventListener("scroll",e.avoidHandler,!0),e.Utils.isNull(t)||t.removeEventListener("mousedown",this._wrapperMousedownHandler,!1),e.Utils.isNull(s)||s.removeEventListener("mousedown",e.stopPropagationHandler,!1),window.removeEventListener("keyup",this._keyupHandler,!1),this._disposeButton(),this._disposeSlot(),super.disconnectedCallback()}_disposeButton(){this.#s?.removeEventListener("click",this._closeHandler),this.#s=null}_disposeSlot(){this._slot?.removeEventListener("slotchange",this._slotchangeHandler,!1)}_close(t){e.Utils.isNull(t)||e.avoidHandler(t),this.show=!1}#s;_ensureButton(){if(!e.Utils.isNull(this.#s))return this.#s;const t=this._slot;if(e.Utils.isNull(t))return null;const a=this._lookForAButton();if(!e.Utils.isNull(a))return this.#s=a;const o=new s.PacemButtonElement;return o.setAttribute("slot","close"),o.className=`${e.PCSS}-margin margin-0 ${e.PCSS}-rise rise--2 button-circle circle-smaller`,o.iconGlyph="close",this.appendChild(o),this.#s=o}_lookForAButton(){const t=this._slot;if(e.Utils.isNull(t))return null;const s=t.assignedElements({flatten:!0});return e.Utils.isNullOrEmpty(s)?null:s[0]}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"show",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"modal",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"behavior",void 0),__decorate([e.ViewChild("."+e.PCSS+"-lightbox-wrapper")],o.prototype,"_wrapperElement",void 0),__decorate([e.ViewChild("."+e.PCSS+"-lightbox")],o.prototype,"_container",void 0),__decorate([e.ViewChild("slot[name=close]")],o.prototype,"_slot",void 0),__decorate([e.ViewChild("div[part=close]")],o.prototype,"_closeWrapper",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-lightbox",shadow:!0,template:`<div class="${e.PCSS}-lightbox-wrapper" part="lightbox-wrapper" hidden>\n <div class="${e.PCSS}-lightbox" part="lightbox">\n <div part="top"><slot name="top"></slot></div>\n <div class="${e.PCSS}-scrollable" part="scrollable">\n <slot></slot>\n </div>\n <div part="bottom"><slot name="bottom"></slot></div>\n <div part="close">\n <slot name="close"></slot>\n </div>\n </div>\n</div>`})],o),s.PacemLightboxElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Spinner="spin",e.Pacem="pacem",e.Custom="custom"}(a=s.LoaderType||(s.LoaderType={}));let o=class PacemLoaderElement extends t.PacemElement{viewActivatedCallback(){super.viewActivatedCallback();var t="_"+e.Utils.uniqueCode();this._svgSpinner.innerHTML=`<defs>\n <mask id="hole${t}">\n <rect width="100%" height="100%" fill="white" />\n <circle cx="36" cy="36" r="12"></circle>\n <path d="M18,0 L32,16 H40 L54,0 Z" fill="#000"></path>\n <g transform="rotate(120,36,36)">\n <path d="M18,0 L32,16 H40 L54,0 Z" fill="#000"></path>\n </g>\n </mask>\n </defs>\n\n <circle class="circle1" cx="36" cy="36" r="34" stroke-width="4" fill="none"></circle>\n <g class="gear">\n <circle cx="36" cy="36" r="25" mask="url(#hole${t})"></circle>\n </g>\n <circle class="circle2" cx="36" cy="36" r="8" stroke-width="2" fill="none"></circle>\n\n <g class="bounds">\n <path d="M8,0 H0 V8 M64,0 H71 V8 M71,63 V71 H64 M8,71 H0 V63" stroke-width="2"></path>\n </g>`}propertyChangedCallback(t,s,o,i){if(super.propertyChangedCallback(t,s,o,i),!e.Utils.isNull(this._container))switch(t){case"active":case"disabled":!0!==this.active||this.disabled?e.Utils.removeClass(this._container,"active"):e.Utils.addClass(this._container,"active");break;case"type":if(this._svgSpinner.setAttribute("hidden","hidden"),this._spinner.setAttribute("hidden","hidden"),o===a.Pacem)this._svgSpinner.removeAttribute("hidden");else this._spinner.removeAttribute("hidden")}}};__decorate([e.ViewChild("div."+e.PCSS+"-spinner")],o.prototype,"_spinner",void 0),__decorate([e.ViewChild("div."+e.PCSS+"-loader")],o.prototype,"_container",void 0),__decorate([e.ViewChild("svg")],o.prototype,"_svgSpinner",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"active",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],o.prototype,"type",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-loader",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${e.PCSS}-loader" pacem>\n <div class="${e.PCSS}-spinner" pacem>\n <div></div>\n <div></div>\n </div>\n <svg class="${e.PCSS}-spinner" pacem hidden xmlns="http://www.w3.org/2000/svg" \n xmlns:xlink="http://www.w3.org/1999/xlink"\n viewBox="-18,-18,108,108" preserveAspectRatio="xMidYMid">\n </svg>\n </div>`})],o),s.PacemLoaderElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){const t=(e,t,s)=>{const a=t.exec(e);return a&&a.length?s(a):null},s=[{exec:e=>t(e,/^((<|&lt;)!--(?:(?!(--(>|&gt;)))[\s\S])*(--(?:>|&gt;)|$))/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t,index:e.index}]})},{exec:(e,s)=>t(e,/^(<|&lt;)([\w-]+)(?:\s+[\w-]+(?:=(?:'[^']*'|"[^"]*"))*)*(\s*\/?(?:&gt;|>))/,a=>{const o=a[1],i=a[2],n=a[3],r=a[0].length-n.length,l=o.length+i.length,c=e.substring(l,r),d=s.tokenize(c,[{exec:e=>t(e,/^(\s+[\w-]+)(=('[^']*'|"[^"]*"))?/,e=>{const t=e[1],s=[{type:"code-attribute",raw:t,text:t,index:e[0].indexOf(t)}];return e.length>2&&s.push({type:"code-string",raw:e[2],text:e[2],index:e.index+e[0].length-e[2].length}),s})}]),h=[{type:"code-tag",raw:o,text:o,index:0},{type:"code-tagname",raw:i,text:i,index:o.length}];return Array.prototype.push.apply(h,d),h.push({type:"code-tag",raw:n,text:n,index:r}),h})},{exec:e=>t(e,/^((?:<|&lt;)\/)([\w-]+)(\s*(?:&gt;|>))/,e=>{const t=e[1],s=e[2],a=e[3];return[{type:"code-tag",raw:t,text:t,index:0},{type:"code-tagname",raw:s,text:s,index:t.length},{type:"code-tag",raw:a,text:a,index:e.index+e[0].length-a.length}]})},{exec:e=>t(e,/^(<|&lt;)?((?!<|&lt;).)+/,e=>{const t=e[0];return[{type:"text",raw:t,text:t}]})}],a=[{exec:(e,s)=>t(e,/^\/\/.*/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\/\*(?:(?!(\*\/))[\s\S])*(?:\*\/|$)/,e=>{const t=e[0];return[{type:"code-comment",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^('(\\'|[^'])*[^\\]?'|@?\$?"(\\"|[^"])*[^\\]?")/,e=>{const t=e[0];return[{type:"code-string",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|static|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|nameof|orderby|partial|remove|select|set|value|var|when|where|yield)\b/,e=>{const t=e[0];return[{type:"code-keyword",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b((0x[0-9a-fA-F]|[\d])*\.?[\d]+)\b/,e=>{const t=e[0];return[{type:"code-number",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^(@?\w+|:|\?\??|\?=?|\|\|?|&&?|&=?|;|,|=|\*=?|--|-=?|\+\+|\+=?|\/=?|\^|\(|\[|\)|\]|\{|\})/,e=>{const t=e[0];return[{type:"text",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\s+/,e=>{const t=e[0];return[{type:"space",raw:t,text:t}]})}],o=[a[0],a[1],{exec:(e,s)=>t(e,/^('(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"|`(\\`|[^`])*[^\\]?`)/,e=>{const t=e[0];return[{type:"code-string",raw:t,text:t}]})},{exec:(e,s)=>t(e,/^\b(abstract|any|arguments|async|await|boolean|break|byte|case|catch|char|class|const|continue|debugger|declare|default|delete|do|double|else|enum|eval|export|extends|false|final|finally|float|for|function|get|goto|if|implements|import|in|instanceof|int|interface|let|long|native|new|null|number|package|private|protected|public|return|short|static|string|super|switch|synchronized|this|throw|throws|transient|true|try|type|typeof|var|void|volatile|while|with|yield)\b/,e=>{const t=e[0];return[{type:"code-keyword",raw:t,text:t}]})},a[4],a[5],a[6]],i={rule:{exec:e=>{const t=/\{tweet\}\(([^\)]+)\)/.exec(e);return t&&t.length>1?[{type:"tweet",raw:t[0],text:t[1],index:t.index}]:null}},type:"inline"},n={rule:{exec:e=>{const t=/\{yt([\d]+x[\d]+)?\}\(([^\)]+)\)/.exec(e);if(t&&t.length>2){const e=(t[1]||"560x315").split("x"),s=e[0],a=e[1];return[{type:"youtube",raw:t[0],text:t[2],index:t.index,width:s,height:a}]}return null}},type:"inline"},r=t=>{switch(t.type){case"youtube":return`\x3c!-- youtube embed --\x3e\n<iframe width="${t.width}" height="${t.height}" src="https://www.youtube-nocookie.com/embed/${t.text}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>`;case"tweet":return`\x3c!-- twitter embed --\x3e\n<${e.P}-tweetembed tweetid="${t.text}"></${e.P}-tweetembed>`;case"code-string":case"code-keyword":case"code-number":case"code-comment":case"code-tag":case"code-tagname":case"code-attribute":return`<span class="${t.type}">${t.text}</span>`}};e.MarkdownService=class MarkdownService{constructor(){const e=[i,n];for(let t of["c-sharp","c","c#","csharp","c++","cpp"]){const s=a.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,s)}for(let t of["ts","js","typescript","javascript"]){const s=o.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,s)}for(let t of["xml","html"]){const a=s.map(e=>({rule:e,lang:t,type:"code"}));Array.prototype.push.apply(e,a)}this.#a=e}#a;#o=new e.Compile.Markdown.Parser;_escape(e){return(e??"").replace(/</g,"&lt;")}toHtml(e){return this.#o.toHtml(this._escape(e),this.#a,r)}tokenize(e){return this.#o.tokenize(this._escape(e),this.#a)}}}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemMarkdownElement extends t.PacemElement{constructor(t=new e.MarkdownService){super(),this._md=t}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"value"===e&&(this.innerHTML=this.html())}tokens(e=this.value){return this._md.tokenize(e)}html(e=this.value){return this._md.toHtml(e)}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"value",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-markdown"})],a),s.PacemMarkdownElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemMarqueeElement extends t.PacemElement{constructor(){super(...arguments),this._state={overlap:0,content:0}}connectedCallback(){super.connectedCallback();const e=this._css=document.createElement("style");document.head.appendChild(e)}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"speed"===e&&this._adjust()}viewActivatedCallback(){super.viewActivatedCallback(),this._adjust()}disconnectedCallback(){e.Utils.isNull(this._css)||this._css.remove(),super.disconnectedCallback()}_overlapResize(e){this._state.overlap=e.detail.width,this._adjust()}_contentResize(e){this._state.content=e.detail.width,this._adjust()}_adjust(){const t=this._state;if(t.content>0&&t.overlap>0){const s=this._marquee,a="marquee-"+e.Utils.uniqueCode(),o=Math.round(t.overlap),i=-Math.round(t.content);this._css.innerHTML=`@keyframes ${a} {\n 0% {\n transform: translateX(${o}px);\n }\n\n 100% {\n transform: translateX(${i}px);\n }\n}`;const n=this.speed||20,r=Math.max(n,Math.round(n*Math.abs(o-i)/1920));s.style.animationName=a,s.style.animationDuration=r+"s",s.style.animationIterationCount="infinite",s.style.animationTimingFunction="linear"}}};__decorate([e.ViewChild(`.${e.PCSS}-marquee`)],a.prototype,"_marquee",void 0),__decorate([e.ViewChild(`.${e.PCSS}-marquee-overlap`)],a.prototype,"_overlap",void 0),__decorate([e.ViewChild(e.P+"-resize")],a.prototype,"_resizer",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"speed",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-marquee",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${e.PCSS}-marquee"><${e.P}-content></${e.P}-content></div><div class="${e.PCSS}-marquee-overlap"></div>\n<${e.P}-resize target="{{ :host._overlap }}" on-${t.ResizeEventName}=":host._overlapResize($event)"></${e.P}-resize>\n<${e.P}-resize target="{{ :host._marquee }}" on-${t.ResizeEventName}=":host._contentResize($event)"></${e.P}-resize>`})],a),s.PacemMarqueeElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){s.MEDIAQUERY_XS="(max-width: 767px)",s.MEDIAQUERY_SM="(min-width: 768px)",s.MEDIAQUERY_MD="(min-width: 992px)",s.MEDIAQUERY_LG="(min-width: 1200px)",s.MEDIAQUERY_XL="(min-width: 1824px)",s.MEDIAQUERY_HD="(min-width: 1920px)",s.MEDIAQUERY_2K="(min-width: 2048px)",s.MEDIAQUERY_4K="(min-width: 3840px)",s.MEDIAQUERY_PORTRAIT="(orientation: portrait)",s.MEDIAQUERY_LANDSCAPE="(orientation: landscape)",s.MEDIAQUERY_PREFERS_LIGHT="(prefers-color-scheme: light)",s.MEDIAQUERY_PREFERS_DARK="(prefers-color-scheme: dark)";let a=class PacemMediaQueryElement extends t.PacemEventTarget{constructor(){super(...arguments),this._changeHandler=e=>{this.isMatch=e.matches}}#i;viewActivatedCallback(){super.viewActivatedCallback(),this._init()}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"query":a||this._init();break;case"isMatch":this._broadcastChange(s)}}disconnectedCallback(){this._init(""),super.disconnectedCallback()}_broadcastChange(e=this.isMatch){this.dispatchEvent(new Event("change")),this.dispatchEvent(new Event(e?"match":"unmatch"))}_init(t=this.query){const s=this.#i;if(e.Utils.isNull(s)||s.removeEventListener("change",this._changeHandler),!e.Utils.isNullOrEmpty(t)){const e=this.#i=window.matchMedia(t);e.addEventListener("change",this._changeHandler),this.isMatch=e.matches}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"query",void 0),__decorate([e.Watch({reflectBack:!0,converter:e.PropertyConverters.Boolean})],a.prototype,"isMatch",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-media-query"})],a),s.PacemMediaQueryElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){var a;let o=class PacemMenuElement extends t.PacemElement{constructor(){super(...arguments),this.synchronizeShell=!0,this._stopPropagationHandlerConditional=t=>{if(!e.Utils.isNull(this._container)&&!e.Utils.isNull(this._base)){const t=e.Utils.offset(this._container),s=e.Utils.offset(this._base);t.width<s.width&&(this.open=!1)}}}viewActivatedCallback(){super.viewActivatedCallback(),this._container.addEventListener("click",e.stopPropagationHandler,!1),this._container.addEventListener("scroll",e.stopPropagationHandler,!1),this._sync()}disconnectedCallback(){window.removeEventListener("navigate",this._stopPropagationHandlerConditional,!1),e.Utils.isNull(this._container)||(this._container.removeEventListener("click",e.stopPropagationHandler,!1),this._container.removeEventListener("scroll",e.stopPropagationHandler,!1)),this._sync(!1),super.disconnectedCallback()}connectedCallback(){super.connectedCallback(),window.addEventListener("navigate",this._stopPropagationHandlerConditional,!1),this._shell=e.CustomElementUtils.findAncestorShell(this)}_toggle(t){e.avoidHandler(t),this.open=!this.open,this.dispatchEvent(new Event("toggle"))}_sync(t=this.open){this.synchronizeShell?(e.Utils.addClass(this,"menu-sync"),e.Utils.addClass(this._shell,e.PCSS+(!0===t?"-menu-open":"-menu-close")),e.Utils.removeClass(this._shell,e.PCSS+(!0===t?"-menu-close":"-menu-open"))):(e.Utils.removeClass(this,"menu-sync"),e.Utils.removeClass(this._shell,e.PCSS+"-menu-close "+e.PCSS+"-menu-open")),this.outset?e.Utils.addClass(this,"menu-outset"):e.Utils.removeClass(this,"menu-outset")}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"open"!==e&&"synchronizeShell"!==e&&"outset"!==e||this._sync()}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"open",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"hideHamburgerButton",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"hideBackButton",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"outset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"synchronizeShell",void 0),__decorate([e.ViewChild("nav")],o.prototype,"_container",void 0),__decorate([e.ViewChild(`.${e.PCSS}-menu`)],o.prototype,"_base",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-menu",template:`<${e.P}-panel class="${e.PCSS}-menu" css-class="{{ {'menu-close': !:host.open, 'menu-open': :host.open} }}" on-click=":host._toggle($event)"> \n <nav><${e.P}-content></${e.P}-content></nav>\n</${e.P}-panel>\n<${e.P}-shell-proxy>\n<${e.P}-button hide="{{ :host.hideBackButton }}" class="${e.PCSS}-back ${e.PCSS}-menu button-flat" css-class="{{ {'menu-close': !:host.open, 'menu-open': :host.open} }}" on-click=":host._toggle($event)">BACK</${e.P}-button>\n<${e.P}-button hide="{{ :host.hideHamburgerButton }}" class="${e.PCSS}-hamburger ${e.PCSS}-menu button-flat" css-class="{{ {'menu-close': :host.open, 'menu-open': !:host.open} }}" on-click=":host._toggle($event)">MENU</${e.P}-button></${e.P}-shell-proxy>`,shadow:e.Defaults.USE_SHADOW_ROOT})],o),s.PacemMenuElement=o;let i=a=class PacemMenuCursorElement extends t.PacemElement{constructor(){super(...arguments),this._onPathChange=t=>{const s=this._menu,i=t&&t.detail||window.location.pathname;if(e.Utils.isNull(s))this.log(e.Logging.LogLevel.Warn,`Couldn't find a ${o} ancestor for this ${a}.`);else{var n=s.querySelectorAll(e.P+"-a"),r=null;for(let e=0;e<n.length;e++){let t=n.item(e);if(t.href===i){r=t;break}}if(e.Utils.isNull(r)&&(r=s.querySelector(`a[href='${i}']`)),!e.Utils.isNull(r)){const t=e.Utils.offset(r),a=e.Utils.offset(s);this.style.top=t.top+"px",this.style.left=a.left+"px",this.style.width="0",this.style.height=t.height+"px",e.Utils.addAnimationEndCallback(this,()=>{this.style.width=t.width+t.left-a.left+"px"},500)}}}}viewActivatedCallback(){super.viewActivatedCallback(),this._menu=e.CustomElementUtils.findAncestorOfType(this,o),this._onPathChange()}connectedCallback(){super.connectedCallback(),window.addEventListener("navigate",this._onPathChange,!1)}disconnectedCallback(){this._menu=null,window.removeEventListener("navigate",this._onPathChange,!1),super.disconnectedCallback()}};i=a=__decorate([e.CustomElement({tagName:e.P+"-menu-cursor"})],i),s.PacemMenuCursorElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemPagerElement extends t.PacemElement{propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"index":case"total":case"pages":case"size":case"mode":this._databind()}}_databind(){const t=this._repeater;if(e.Utils.isNull(t))return;var s=[];const a=this.size??10,o=this.pages??5,i=this.total??0,n=this.index??0,r=this.mode??"standard";if(i>0){let t=Math.ceil(i/a),l=Math.floor(n/a),c=Math.max(0,Math.ceil(l-o/2)),d=Math.min(t-1,c+o-1);for(;c>0&&1+d-c<o;)c--;"numeric-only"===r?c>0&&s.push({caption:1..toLocaleString(e.Utils.lang(this)),index:0,disabled:!(l>0)}):(s.push({caption:"&laquo;",index:0,first:!0,disabled:!(l>0)}),s.push({caption:"&lt;",index:a*(l-1),previous:!0,disabled:!(l>0)})),(c>0&&"numeric-only"!==r||c>1&&"numeric-only"===r)&&s.push({caption:"&hellip;",index:a*(c-1)});for(let t=c;t<=d;t++)s.push({caption:(t+1).toLocaleString(e.Utils.lang(this)),index:t*a});(d<t-1&&"numeric-only"!==r||d<t-2&&"numeric-only"===r)&&s.push({caption:"&hellip;",index:a*(d+1)}),"numeric-only"===r?d<t-1&&s.push({caption:t.toLocaleString(e.Utils.lang(this)),index:a*(t-1),disabled:!(l<t-1)}):(s.push({caption:"&gt;",index:a*(l+1),next:!0,disabled:!(l<t-1)}),s.push({caption:"&raquo;",index:a*(t-1),last:!0,disabled:!(l<t-1)})),this.index=l*a}t.datasource=s}};__decorate([e.ViewChild(e.P+"-repeater")],a.prototype,"_repeater",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"index",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"total",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"pages",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],a.prototype,"size",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],a.prototype,"mode",void 0),__decorate([e.Debounce(!0)],a.prototype,"_databind",null),a=__decorate([e.CustomElement({tagName:e.P+"-pager",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-repeater class="${e.PCSS}-pager"><div class="${e.PCSS}-buttonset">\n<div class="pager-buttons">\n <template>\n <${e.P}-button class="${e.PCSS}-page button" on-click=":host.index = ^item.index" disabled="{{ ^item.disabled }}"\n css-class="{{ { 'currentpage': ^item.index === :host.index, 'firstpage buttonset-first': ^item.first, 'previouspage': ^item.previous, 'nextpage': ^item.next, 'lastpage buttonset-last': ^item.last } }}"><${e.P}-span content="{{ ^item.caption }}"></${e.P}-span></${e.P}-button>\n </template>\n</div>\n</div></${e.P}-repeater>`})],a),s.PacemPagerElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemPictureSourceElement extends t.PacemItemElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a);const i=this.container;i instanceof o&&["srcset","media","type","disabled"].indexOf(e)>=0&&i.refreshSources()}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"srcset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"media",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"type",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-picture-source"})],a),s.PacemPictureSourceElement=a;let o=class PacemPictureElement extends t.PacemItemsContainerElement{constructor(){super("img",{label:"picture"}),this._updateCurrentSrcHandler=e=>{this.currentSrc=this._img.currentSrc}}validate(e){return e instanceof a}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"src":this._setSource();break;case"items":this._setSources();break;case"tooltip":this._setAltText()}}viewActivatedCallback(){super.viewActivatedCallback(),this._img.addEventListener("load",this._updateCurrentSrcHandler,!1),this._setSource(),this._setAltText(),this._setSources()}disconnectedCallback(){const t=this._img;e.Utils.isNull(t)||t.removeEventListener("load",this._updateCurrentSrcHandler,!1),super.disconnectedCallback()}refreshSources(){this._setSources()}_setSources(t=this.items){const s=this._picture,a=this._img;if(!e.Utils.isNull(s)&&!e.Utils.isNull(a)){const o=s.querySelectorAll("source"),i=t?.length??0;for(let t=0;t<i;t++){const i=this.items[t];let n;o.length<=t?(n=document.createElement("source"),n.setAttribute("part","source"),s.insertBefore(n,a)):n=o.item(t),i.disabled||e.Utils.isNullOrEmpty(i.srcset)?n.removeAttribute("srcset"):n.srcset=i.srcset,e.Utils.isNullOrEmpty(i.media)?n.removeAttribute("media"):n.media=i.media,e.Utils.isNullOrEmpty(i.type)?n.removeAttribute("type"):n.type=i.type}for(let e=o.length-1;e>=i;e--){o.item(e).remove()}}}_setSource(t=this.src){const s=this._img;e.Utils.isNull(s)||(e.Utils.isNullOrEmpty(t)?s.removeAttribute("src"):s.src=t)}_setAltText(t=this.tooltip){const s=this._img;e.Utils.isNull(s)||(e.Utils.isNullOrEmpty(t)?s.alt=this.aria.attributes.toObject().label:s.alt=t)}};__decorate([e.ViewChild("picture")],o.prototype,"_picture",void 0),__decorate([e.ViewChild("img")],o.prototype,"_img",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"src",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],o.prototype,"currentSrc",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-picture",shadow:!0,template:'<picture part="picture"><img loading="lazy" part="img" /></picture><slot></slot>'})],o),s.PacemPictureElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemProgressbarElement extends t.PacemElement{constructor(){super("progressbar",{valuemin:"0%",valuemax:"100%",valuenow:"0%"})}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"percentage":this._bar.style.transform=`translateX(${-100+(a||0)}%)`,this._glow.style.transform=`scaleX(${.01*(a||0)})`;let t=e.Utils.leftPad(Math.floor(a),2,"0")+"%";this.aria.attributes.set("valuenow",t),e.Utils.isNullOrEmpty(this.caption)&&this.aria.attributes.set("valuetext",this._caption.textContent=t);break;case"caption":this.aria.attributes.set("valuetext",this._caption.textContent=a)}}};__decorate([e.ViewChild(".progressbar-bar")],a.prototype,"_bar",void 0),__decorate([e.ViewChild(".progressbar-glow")],a.prototype,"_glow",void 0),__decorate([e.ViewChild(".progressbar-caption")],a.prototype,"_caption",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],a.prototype,"percentage",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-progressbar",shadow:e.Defaults.USE_SHADOW_ROOT,template:'<div class="progressbar-glow"></div>\n <div class="progressbar-track"><div class="progressbar-bar"></div></div>\n <label class="progressbar-caption"></label>'})],a),s.PacemProgressbarElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemSidebarElement extends t.PacemElement{constructor(){super(...arguments),this.open=!1,this.synchronizeShell=!0}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"open":case"synchronizeShell":this._sync()}}disconnectedCallback(){this._sync(!1),super.disconnectedCallback()}_sync(t=this.open){const s=this.#n;this.synchronizeShell?(e.Utils.addClass(this,"sidebar-sync"),e.Utils.addClass(s,e.PCSS+(!0===t?"-sidebar-open":"-sidebar-close")),e.Utils.removeClass(s,e.PCSS+(!0===t?"-sidebar-close":"-sidebar-open"))):(e.Utils.removeClass(this,"sidebar-sync"),e.Utils.removeClass(s,e.PCSS+"-sidebar-close "+e.PCSS+"-sidebar-open"))}#n;connectedCallback(){super.connectedCallback(),this.#n=e.CustomElementUtils.findAncestorShell(this)}};__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"open",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],a.prototype,"synchronizeShell",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-sidebar",template:`<${e.P}-panel class="sidebar-drawer" part="drawer" css-part="{{ { 'open': :host.open } }}" css-class="{{ {'open': :host.open } }}">\n <slot></slot>\n</${e.P}-panel>`,shadow:!0})],a),s.PacemSidebarElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemSlideElement extends t.PacemIterableElement{};a=__decorate([e.CustomElement({tagName:e.P+"-slide"})],a),s.PacemSlideElement=a;let o=class PacemSlideshowElement extends t.PacemIterativeElement{validate(e){return e instanceof a}};o=__decorate([e.CustomElement({tagName:e.P+"-slideshow"})],o),s.PacemSlideshowElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){!function(s){let a=class PacemTweetEmbedElement extends t.PacemElement{constructor(){super(...arguments),this._scriptsLoaded=!1}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"tweetid"===e&&this._scriptsLoaded&&this._render()}viewActivatedCallback(){super.viewActivatedCallback(),e.CustomElementUtils.importjs("https://platform.twitter.com/widgets.js").then(()=>{this._scriptsLoaded=!0,this._render()})}_render(){this.tweetid&&this._scriptsLoaded&&twttr.ready(e=>e.widgets.createTweet(this.tweetid,this))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"tweetid",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-tweetembed"})],a),s.PacemTweetEmbedElement=a}(s.Social||(s.Social={}))}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a;!function(e){e.Persistent="persistent",e.QuickReturn="quickreturn"}(a=s.StickyHeaderVisibility||(s.StickyHeaderVisibility={}));let o=class PacemStickyHeaderElement extends t.PacemEventTarget{constructor(){super(...arguments),this.#r={left:0,top:0},this._scrollHandler=e=>{this.offset=e.detail}}#l;#r;#c;#n;_ensureScrollAwareElement(){if(e.Utils.isNull(this.#l)){const s=this.#l=new t.PacemScrollAwareElement;this.log(e.Logging.LogLevel.Debug,"creating scroll aware "+this.#c);(this.#n=e.CustomElementUtils.findAncestorShell(this)).appendChild(s),s.dataset.target=this.#c,s.addEventListener(t.ScrollEventName,this._scrollHandler,!1)}this.#l.disabled=this.disabled}_manageOffsetChange(t=this.offset){if(this.disabled)return;const s=this.visibility||a.Persistent,o=this.#r.top,i=t.top,n=this.threshold||0,r=this.#n;o<=n&&i>n?(e.Utils.removeClass(r,"sticky-header-top"),e.Utils.addClass(r,"sticky-header-scroll"),s===a.QuickReturn&&(e.Utils.addClass(r,"sticky-header-fade"),this.visible=!1)):o>n&&i<=n?(e.Utils.removeClass(r,"sticky-header-fade"),e.Utils.removeClass(r,"sticky-header-scroll"),e.Utils.addClass(r,"sticky-header-top")):o>n&&i>n&&o>i?(this.visible=!0,e.Utils.removeClass(r,"sticky-header-fade")):o>n&&i>n&&o<i&&s==a.QuickReturn&&e.Utils.addClass(r,"sticky-header-fade"),this.#r=t}propertyChangedCallback(e,t,s,a){switch(super.propertyChangedCallback(e,t,s,a),e){case"offset":this._manageOffsetChange(s);break;case"disabled":this._ensureScrollAwareElement()}}connectedCallback(){super.connectedCallback(),this.#c=this.id||"sticky-"+e.Utils.uniqueCode(),this._ensureScrollAwareElement()}disconnectedCallback(){const s=this.#l,a=this.#n;e.Utils.isNull(s)||(this.log(e.Logging.LogLevel.Debug,"disposing scroll aware "+this.#c),s.removeEventListener(t.ScrollEventName,this._scrollHandler,!1),s.remove(),this.#l=void 0,e.Utils.removeClass(a,"sticky-header-fade"),e.Utils.removeClass(a,"sticky-header-top"),e.Utils.removeClass(a,"sticky-header-scroll")),super.disconnectedCallback()}};__decorate([e.Watch({converter:e.PropertyConverters.Number,emit:!1})],o.prototype,"threshold",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Point})],o.prototype,"offset",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],o.prototype,"visible",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String,emit:!1})],o.prototype,"visibility",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-sticky-header"})],o),s.PacemStickyHeaderElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a="tab-focus",o={convert:(t,s)=>t.startsWith("#")?e.PropertyConverters.Element.convert(t,s):e.PropertyConverters.String.convert(t,s),convertBack:(t,s)=>t instanceof Node?e.PropertyConverters.Element.convertBack(t,s):e.PropertyConverters.String.convertBack(t,s),retryConversionWhenReady:!0};let i=class PacemTabElement extends t.PacemIterableElement{constructor(){super("tab"),this._slotChangeHandler=t=>{const s=this.#d,a=this.#d=this.content;this.dispatchEvent(new e.PropertyChangeEvent({propertyName:"content",currentValue:a,oldValue:s}))}}viewActivatedCallback(){super.viewActivatedCallback(),this._slotLabel.addEventListener("slotchange",this._slotChangeHandler,!1)}disconnectedCallback(){const t=this._slotLabel;e.Utils.isNull(t)||t.removeEventListener("slotchange",this._slotChangeHandler,!1),super.disconnectedCallback()}#d;get content(){return this.querySelectorAll("*[slot=label]")}};__decorate([e.ViewChild("slot[name=label]")],i.prototype,"_slotLabel",void 0),__decorate([e.Watch({converter:o})],i.prototype,"label",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"key",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-tab",shadow:!0,template:'<slot name="label" part="label"></slot><slot></slot>'})],i),s.PacemTabElement=i;let n=class PacemTabsElement extends t.PacemIterativeElement{constructor(t=new e.Animations.TweenService){super("tablist"),this._tweener=t}_labelCallback(e,t){const s=e.content;if(s.length>0){let e="";return s.forEach(t=>{e+=t.outerHTML}),e}return e.label instanceof Node?e.label:`<span class="${e.key||"tab"}">${e.label}</span>`}_syncOrientation(t=this.orientation){if(e.Utils.isNull(this._defaultTabAdapter)||(this._defaultTabAdapter.orientation=t),!e.Utils.isNull(this._tabs)){(t===s.AdapterOrientation.Vertical?e.Utils.addClass:e.Utils.removeClass)(this._tabs,"tabs-vertical")}}_syncVisibility(t=this.index,s=-1){const o=this._container,i=o.clientHeight,n=getComputedStyle(o),r="border-box"===n.boxSizing?0:parseInt(n.paddingTop)+parseInt(n.paddingBottom);o.style.height=i-r+"px";let l=0;for(let i of this.items||[])l===t?(e.Utils.addClass(i,"tab-in"),requestAnimationFrame(()=>{e.Utils.addClass(i,a),e.Utils.removeClass(i,"tab-in"),e.Utils.addAnimationEndCallback(i,t=>{e.Utils.removeClass(t,"tab-previous tab-next");const s=e.Utils.offset(t).height;this._tweener.run(parseInt(o.style.height),s,100,0,e.Animations.Easings.sineOut,(e,t)=>{o.style.height=Math.round(t)+"px"}).then(e=>{o.style.height=""})},500)}),i.aria.attributes.set("selected","true")):(e.Utils.removeClass(i,"tab-previous tab-next"),e.Utils.addClass(i,l<t?"tab-previous":"tab-next"),l===s&&(e.Utils.addClass(i,"tab-out"),e.Utils.removeClass(i,a),e.Utils.addAnimationEndCallback(i,t=>{e.Utils.removeClass(t,"tab-out")},500),i.aria.attributes.set("selected","false"))),l++}viewActivatedCallback(){super.viewActivatedCallback(),e.Utils.isNull(this.adapter)&&(this._syncOrientation(),this._syncVisibility(),this.adapter=this._defaultTabAdapter)}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"adapter":e.Utils.isNull(a)&&(this.adapter=this._defaultTabAdapter),this._isUsingDefaultTabAdapter=this.adapter===this._defaultTabAdapter;break;case"index":this._syncVisibility(a,s);break;case"orientation":this._syncOrientation(a)}}validate(e){return e instanceof i}};__decorate([e.ViewChild(e.P+"-adapter")],n.prototype,"_defaultTabAdapter",void 0),__decorate([e.ViewChild("."+e.PCSS+"-tabs")],n.prototype,"_tabs",void 0),__decorate([e.ViewChild("."+e.PCSS+"-tabs-content")],n.prototype,"_container",void 0),__decorate([e.Watch()],n.prototype,"_isUsingDefaultTabAdapter",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],n.prototype,"orientation",void 0),n=__decorate([e.CustomElement({tagName:e.P+"-tabs",shadow:!1,template:`<div class="${e.PCSS}-tabs">\n <${e.P}-adapter class="${e.PCSS}-tabs-adapter" swipe-enabled="false" hide="{{ !:host._isUsingDefaultTabAdapter }}" label-callback="{{ :host._labelCallback }}"></${e.P}-adapter>\n <div class="${e.PCSS}-tabs-content">\n <${e.P}-content></${e.P}-content>\n </div>\n</div>`})],n),s.PacemTabsElement=n}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){var a;const o="pacem:toast:pops";let i=a=class PacemToastElement extends t.PacemElement{constructor(){super(...arguments),this.autohide=!0,this.timeout=3e3,this._doHide=e=>{window.clearTimeout(this._handle),this.show=!1}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._doHide,!1)}propertyChangedCallback(t,s,i,n){if(super.propertyChangedCallback(t,s,i,n),"show"===t)if(!0!==i)e.Utils.removeClass(this,"toast-show"),e.Utils.addClass(this,"toast-hide"),this.dispatchEvent(new CustomEvent("close")),e.Utils.waitForAnimationEnd(this,1e3).then(()=>{e.Utils.removeClass(this,"toast-hide")});else{let t=e.CustomElementUtils.getAttachedPropertyValue(a,o,0)-1;e.CustomElementUtils.setAttachedPropertyValue(a,o,t),this.style.order=""+t,e.Utils.addClass(this,"toast-show"),this._show()}}disconnectedCallback(){this.removeEventListener("click",this._doHide,!1),super.disconnectedCallback()}_show(){window.clearTimeout(this._handle),this.disabled||this.autohide&&(this._handle=window.setTimeout(()=>{this.show=!1},this.timeout))}popup(){this.show?this._show():this.show=!0}static toast(t,s,o,i){var n=new a;if(e.Utils.isNullOrEmpty(i?.cssClass))n.className="toast-"+s;else{const t=e.Utils.isArray(i.cssClass)?i.cssClass.join(" "):i.cssClass;e.Utils.addClass(n,t)}e.Utils.isNull(i?.autohide)||(n.autohide=i.autohide),i?.timeout>0&&(n.timeout=i.timeout);const r=document.createElement("i");r.className=e.PCSS+"-icon text-bigger-steady "+e.PCSS+"-margin margin-right-1 flex-auto";var l="info";switch(s){case"danger":case"error":l="error";break;case"warning":l="warning";break;case"success":l="check_circle"}r.textContent=l;const c=document.createElement("div");e.Utils.addClass(c,"display-flex flex-stretch flex-start flex-nowrap"),c.appendChild(r);const d=document.createElement("span");return e.Utils.addClass(d,"text-small text-pre"),"string"==typeof o?d.innerHTML=o:d.appendChild(o),c.appendChild(d),n.appendChild(c),t.appendChild(n),new Promise((t,s)=>{window.setTimeout(()=>{n.popup()},100);const a=()=>{n.removeEventListener("close",a,!1),t(),e.Utils.waitForAnimationEnd(n,1e3).then(e=>{n.remove()})};n.addEventListener("close",a,!1)})}static toast2(t,s,o,i){let n=i?.cssClass,r=["fill-"+s+"-container","fill-glass","border-solid","border-size--2","border-round","border-radius--6"];return e.Utils.isNullOrEmpty(n)||(e.Utils.isArray(n)?Array.prototype.push.apply(r,n):Array.prototype.push.apply(r,n.split(" "))),a.toast(t,s,o,e.Utils.extend({},i??{},{cssClass:r}))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],i.prototype,"autohide",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"timeout",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"show",void 0),__decorate([e.Transformer("poptoast")],i,"toast",null),__decorate([e.Transformer("poptoastcontainer")],i,"toast2",null),i=a=__decorate([e.CustomElement({tagName:e.P+"-toast"})],i),s.PacemToastElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemTocElement extends t.PacemElement{constructor(t=new e.Animations.TweenService){super(),this._tweener=t,this._items=[],this._scrollToSelf=e=>{this._scrollTo("#"+e.target.id)},this._hashChange=e=>{e.preventDefault(),this._scrollTo(window.location.hash,!1)}}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"target":e.Utils.isNull(this._observer)||this._observe();break;case"selector":this.refresh()}}connectedCallback(){super.connectedCallback(),window.addEventListener("hashchange",this._hashChange,!1)}disconnectedCallback(){window.removeEventListener("hashchange",this._hashChange,!1),e.Utils.isNull(this._observer)||this._observer.disconnect(),super.disconnectedCallback()}viewActivatedCallback(){super.viewActivatedCallback(),this._observer=new MutationObserver(e=>{this.refresh()}),this._observe()}_onScroll(t){this._update(e.Utils.scrollTop)}_observe(){this._observer.observe(this.target||document.body,{subtree:!0,childList:!0})}_getTop(t){return e.Utils.offset(t).top}_scrollTo(t,s=!0){if(/^#[^&=]+$/.test(t)){const a=!e.Utils.isNullOrEmpty(t)&&document.querySelector(t),o=!e.Utils.isNull(a)&&this._items.find(e=>e.dom===a);if(o&&!e.Utils.isNull(o.dom)){const t=this._getTop(o.dom)-(this.offset||0);if(s){let s=e.Utils.scrollTop;window.location.hash=o.dom.id,this._tweener.run(s,t,500,0,e.Animations.Easings.sineInOut,(e,t)=>{window.scrollTo(0,t)})}else window.scrollTo(0,t)}}}_startScrollTo(t,s){e.avoidHandler(s),this._scrollTo(t.url)}_update(t){const s=t+(this.offset||0);var a=this._items&&this._items.length>0&&this._items[0];for(var o of this._items){if(!(e.Utils.offset(o.dom).top<=s))break;a=o}const i=[];for(var o of this._items)e.Utils.isNullOrEmpty(o.dom.id)&&(o.dom.id=o.dom.innerText.trim().replace(/[^a-zA-Z0-9]/g,"-").replace(/-*$/,"").replace(/^-*/,"").toLowerCase()),i.push({focus:o===a,label:o.dom.innerText,url:"#"+o.dom.id});e.Utils.isNull(this._repeater)||(this._repeater.datasource=i)}refresh(){for(let t of this._items)t.dom.removeEventListener("click",this._scrollToSelf,!1),e.Utils.removeClass(t.dom,e.PCSS+"-toc-item");const t=this.selector;if(e.Utils.isNullOrEmpty(t))return this._repeater&&(this._repeater.datasource=[]),void(this.hasContent=!1);const s=(this.target||document).querySelectorAll(t),a=[];for(let t=0;t<s.length;t++){const o=s.item(t);o.addEventListener("click",this._scrollToSelf,!1),e.Utils.addClass(o,e.PCSS+"-toc-item"),a.push({dom:o,top:this._getTop(o)})}this._items=a,this._update(e.Utils.scrollTop),this.hasContent=!e.Utils.isNullOrEmpty(a);let o=window.location.hash;e.Utils.isNullOrEmpty(o)||setTimeout(()=>{this._scrollTo(o,!0)},1e3)}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],a.prototype,"selector",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],a.prototype,"offset",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],a.prototype,"target",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Element})],a.prototype,"router",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],a.prototype,"hasContent",void 0),__decorate([e.ViewChild(e.P+"-repeater")],a.prototype,"_repeater",void 0),__decorate([e.Debounce(100)],a.prototype,"_onScroll",null),__decorate([e.Debounce(250)],a.prototype,"refresh",null),a=__decorate([e.CustomElement({tagName:e.P+"-toc",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<${e.P}-scroll-aware on-${t.ScrollEventName}=":host._onScroll($event)" url="{{ :host.url }}"></${e.P}-scroll-aware>\n<${e.P}-repeater><nav class="${e.PCSS}-toc"><template>\n <${e.P}-a on-click=":host._startScrollTo(^item, $event)" router="{{ :host.router }}" css-class="{{ {'toc-focus': ^item.focus} }}" href="{{ ^item.url }}"><${e.P}-text text="{{ ^item.label }}"></${e.P}-text></${e.P}-a>\n</template></nav></${e.P}-repeater>`})],a),s.PacemTocElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a=2*Math.PI;function o(e,t,s,a){return{x:e+s*Math.cos(a),y:t+s*Math.sin(a)}}let i=class PacemTunerElement extends t.PacemElement{constructor(){super(),this.min=0,this.max=100,this._rotateStartHandler=e=>{const t=this.#h=this._getAngle(e),s=this._rotate;s.minRotation=0-t,s.maxRotation=a-t,this._setValue(t)},this._rotateEndHandler=e=>{},this._rotateHandler=e=>{e.preventDefault();const t=e.detail.rotation+this.#h;this._setValue(t)}}#h;viewActivatedCallback(){super.viewActivatedCallback();const t=this._rotate,s=this._tween;t.addEventListener(e.UI.RotateEventType.Start,this._rotateStartHandler,!1),t.addEventListener(e.UI.RotateEventType.Rotate,this._rotateHandler,!1),t.addEventListener(e.UI.RotateEventType.End,this._rotateEndHandler,!1),t.register(this._canvas),this._toggleRotate(),requestAnimationFrame(()=>this._draw(this.min)),s.easing=e.Animations.Easings.sineInOut,s.delay=100*Math.random()-100+500,s.start=this.value>this.min}disconnectedCallback(){const t=this._rotate,s=this._canvas;e.Utils.isNull(t)||(t.removeEventListener(e.UI.RotateEventType.Rotate,this._rotateHandler,!1),e.Utils.isNull(s)||t.unregister(s)),super.disconnectedCallback()}propertyChangedCallback(t,s,a,o){switch(super.propertyChangedCallback(t,s,a,o),t){case"interactive":this._toggleRotate(a),a?e.Utils.addClass(this,"tuner-interactive"):e.Utils.removeClass(this,"tuner-interactive");break;case"round":if(Math.round(a)!=a||a<0)throw`${this.constructor.name}: round value must be an integer greater or equal to zero.`;break;default:this._draw()}}_toggleRotate(t=this.interactive){const s=this._rotate;e.Utils.isNull(s)||(s.disabled=!t)}_angleToValue(e){const t=Math.pow(10,this.round||0),s=this.min+e*(this.max-this.min)/a;return Math.round(t*s)/t}_valueToAngle(e=this.value??this.min){return a*(e-this.min)/(this.max-this.min)}_setValue(e){const t=this._angleToValue(e).clamp(this.min,this.max);t!=this.value&&(this.value=t,this.dispatchEvent(new Event("change")))}_getAngle(t){const s={vertex:t.detail.center,end:t.detail.currentPosition,start:{x:t.detail.center.x,y:t.detail.center.y-1}},o=e.Angle.value(s);return o>0?a-o:-o}_draw(t=this.value){if(this.disabled||e.Utils.isNull(this._rail))return;t=(isNaN(t)?this.min:t).clamp(this.min,this.max);const s=this._rail,a=this._counterRail,i=t===this.min,n=t===this.max;if(i||n){const e="M 50 50 m -50,0 a 50,50 0 1,1 100,0 a 50,50 0 1,1 -100,0";s.setAttribute("d",i?"":e),a.setAttribute("d",n?"":e)}else{const e=.5*Math.PI,i=o(50,50,50,-e),n=this._valueToAngle(t),r=o(50,50,50,-e+n),l=n>Math.PI?1:0,c=`M ${r.x} ${r.y} A 50 50 0 ${l} 0 ${i.x} ${i.y}`;s.setAttribute("d",c);const d=r,h=o(50,50,50,3*e),p=this._valueToAngle(this.max-t)>Math.PI?1:0,m=`M ${h.x} ${h.y} A 50 50 0 ${p} 0 ${d.x} ${d.y}`;a.setAttribute("d",m)}}};__decorate([e.ViewChild("svg")],i.prototype,"_canvas",void 0),__decorate([e.ViewChild("path[part=rail]")],i.prototype,"_rail",void 0),__decorate([e.ViewChild("path[part=complementary-rail]")],i.prototype,"_counterRail",void 0),__decorate([e.ViewChild(e.P+"-tween")],i.prototype,"_tween",void 0),__decorate([e.ViewChild(e.P+"-rotate")],i.prototype,"_rotate",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Number})],i.prototype,"value",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"min",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"max",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],i.prototype,"interactive",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"round",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-tuner",shadow:!0,template:`<svg xmlns="http://www.w3.org/2000/svg" class="${e.PCSS}-tuner" part="tuner" viewBox="0 0 100 100">\n <circle part="track" cx="50" cy="50" r="50" />\n <path part="rail" />\n <path part="complementary-rail" />\n </svg><div class="${e.PCSS}-content" part="content"><slot></slot></div>\n <${e.P}-rotate></${e.P}-rotate>\n<${e.P}-tween on-step=":host._draw($event.detail.value)" on-end="this.disabled = true" duration="500" to="{{ :host.value }}" from="{{ :host.min }}"></${e.P}-tween>`})],i),s.PacemTunerElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){let a=class PacemVibrateElement extends t.PacemEventTarget{vibrate(){if(this.disabled)return;const t=this.pattern;e.Utils.isNullOrEmpty(t)||"function"==typeof navigator.vibrate&&navigator.vibrate(t)}};__decorate([e.Watch({emit:!1,converter:{convert:e=>e?.split(/[ ,]+/).map(e=>parseInt(e)),convertBack:e=>e?.join(" ")}})],a.prototype,"pattern",void 0),a=__decorate([e.CustomElement({tagName:e.P+"-vibrate"})],a),s.PacemVibrateElement=a}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a={convert:(e,t)=>{try{return document.querySelector(e)??(t.isConnected?e:null)}catch{return e}},convertBack:e=>e instanceof Element&&e.id?"#"+e.id:e,retryConversionWhenReady:!0};let o=class PacemViewElement extends t.PacemEventTarget{constructor(){super(...arguments),this._templateChangeHandler=e=>{const t=e.target;this._setTmpl(t.target)}}propertyChangedCallback(t,s,a,o){super.propertyChangedCallback(t,s,a,o),"url"===t||"disabled"===t?(this._dispose(s),this._manage()):"fetching"===t&&(a?e.Utils.addClass:e.Utils.removeClass)(this,"view-fetching")}viewActivatedCallback(){super.viewActivatedCallback();const e=this.url;this._isReference(e)&&!this.disabled&&this._manageRef()}_isReference(e){return e instanceof HTMLElement||"string"==typeof e&&e.trim().startsWith("#")}_dispose(e){e instanceof t.PacemTemplateProxyElement&&e.removeEventListener("templatechange",this._templateChangeHandler)}_manage(){if(this.disabled)return;const t=this.debounce||0,s=this.url;this._isReference(s)?(clearTimeout(this._fetchHandle),this._fetchHandle=setTimeout(()=>this._manageRef(),t)):"string"!=typeof s||e.Utils.isNullOrEmpty(s)?this.innerHTML="":(this.fetching=!0,clearTimeout(this._fetchHandle),this._fetchHandle=setTimeout(()=>this._manageUrl(s),t))}_manageRef(){const s=this.url,a=s instanceof HTMLElement?s:document.querySelector("template"+s);a instanceof t.PacemTemplateProxyElement?(a.addEventListener("templatechange",this._templateChangeHandler,!1),this._setTmpl(a.target)):a instanceof HTMLTemplateElement?this._setTmpl(a):e.Utils.isNull(a)?this.log(e.Logging.LogLevel.Error,"Template element not found."):this.log(e.Logging.LogLevel.Error,`Invalid '${a.constructor.name}' element, HTMLTemplate expected.`)}_setTmpl(t){cancelAnimationFrame(this._renderHandle),this.innerHTML="",this._renderHandle=requestAnimationFrame(()=>{e.Utils.isNull(t)?this.log(e.Logging.LogLevel.Error,"Template element not found."):(this.appendChild(t.cloneNode(!0).content),this._dispatchRender())})}#p;_manageUrl(t){this.#p&&this.#p.abort();const{signal:s}=this.#p=new AbortController;fetch(t,{credentials:"same-origin",signal:s}).then(async t=>{const s=(t,s)=>{301!==t.status&&302!==t.status||!this.followRedirects?t.ok||this.renderErrors?s.then(t=>e.Utils.addAnimationEndCallback(this,()=>this._manageResult(t),500)):this._manageResult(""):this._manageUrl(t.headers.get("Location"))},a=+t.headers.get("Content-Length");if(a>0){this.progress=0;let e=0;const o=[],i=t.body.getReader();for(;;){const{done:t,value:s}=await i.read();if(t)break;this.progress=(e+=s.length)/a,o.push(s)}s(t,new Promise((t,s)=>{try{let s=new Uint8Array(e),a=0;for(let e of o)s.set(e,a),a+=e.length;t(new TextDecoder("utf-8").decode(s))}catch(e){s(e)}}))}else s(t,t.text())},e=>{})}_manageResult(t){cancelAnimationFrame(this._renderHandle),this.scrollTo({top:0,left:0,behavior:"instant"}),this.innerHTML="",this._renderHandle=requestAnimationFrame(()=>{this.innerHTML=t,this.fetching=!1,this.progress=Number.NaN,e.Utils.addAnimationEndCallback(this,()=>{this._dispatchRender()},500)})}_dispatchRender(){this.dispatchEvent(new CustomEvent("render"))}};__decorate([e.Watch({reflectBack:!0,converter:a})],o.prototype,"url",void 0),__decorate([e.Watch()],o.prototype,"fetching",void 0),__decorate([e.Watch()],o.prototype,"progress",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"renderErrors",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"followRedirects",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],o.prototype,"debounce",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-view"})],o),s.PacemViewElement=o}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(s){const a="window-title";let o=class PacemWindowAreaElement extends t.PacemIterativeElement{constructor(){super(...arguments),this._zIndex=1,this._startHandler=t=>{this._incrementZIndex(t.detail.element),e.Utils.addClass(t.detail.element,"window-rescaling")},this._blurHandler=t=>{e.Utils.removeClass(t.detail.element,"window-rescaling")},this._focusHandler=e=>{this._incrementZIndex(e.currentTarget)},this._itemPropertyChangeHandler=t=>{if("floating"===t.detail.propertyName&&!1===t.detail.currentValue){const s=t.currentTarget,a=this.items.indexOf(s);e.Utils.addClass(s,"docking-in"),this.adapter.select(a),e.Utils.addAnimationEndCallback(s,t=>{e.Utils.removeClass(t,"docking-in")},150)}},this._adapterPagerCallback=e=>{const t=e.detail.index,s=this.items[t];e.detail.hide=s.hide||s.floating}}validate(e){return e instanceof i}_incrementZIndex(e){this._zIndex!=parseInt(e.style.zIndex)&&(e.style.zIndex=""+ ++this._zIndex)}connectedCallback(){super.connectedCallback();let t=e.CustomElementUtils.findAncestorShell(this);this._behaviors=[t.appendChild(this._dragDrop=document.createElement(e.P+"-drag-drop")),t.appendChild(this._rescale=document.createElement(e.P+"-rescale"))],this._dragDrop.handleSelector="."+a,this._rescale.addEventListener(e.UI.RescaleEventType.Start,this._startHandler,!1),this._rescale.addEventListener(e.UI.RescaleEventType.End,this._blurHandler,!1)}viewActivatedCallback(){if(super.viewActivatedCallback(),e.Utils.isNull(this.adapter)){const t=this.adapter=this.appendChild(document.createElement(e.P+"-adapter"));e.Utils.addClass(t,"windows-adapter"),t.labelCallback=(e,t)=>e.caption,t.swipeEnabled=!1,t.deselectable=!0,t.initialize(this)}this.adapter.addEventListener(s.AdapterPageButtonRefreshEventName,this._adapterPagerCallback,!1)}disconnectedCallback(){e.Utils.isNull(this.adapter)||(this.adapter.removeEventListener(s.AdapterPageButtonRefreshEventName,this._adapterPagerCallback,!1),this.adapter.remove(),this.adapter=null),this._rescale.removeEventListener(e.UI.RescaleEventType.End,this._blurHandler,!1),this._rescale.removeEventListener(e.UI.RescaleEventType.Start,this._startHandler,!1);for(let e of this._behaviors)e.remove();super.disconnectedCallback()}propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"index"===e&&this._syncVisibility()}register(t){const s=super.register(t);if(s){t.addEventListener(e.PropertyChangeEventName,this._itemPropertyChangeHandler,!1),t.addEventListener("mousedown",this._focusHandler,!1);for(let e of this._behaviors){-1===t.behaviors.indexOf(e)&&t.behaviors.push(e)}}return s}unregister(t){const s=super.unregister(t);if(s){t.removeEventListener(e.PropertyChangeEventName,this._itemPropertyChangeHandler,!1),t.removeEventListener("mousedown",this._focusHandler,!1);for(let e of this._behaviors){const s=t.behaviors.indexOf(e);s>=0&&t.behaviors.splice(s,1)}}return s}_syncVisibility(){let t=0;const s=this.items??[];for(let a of s)t===this.index?e.Utils.addClass(a,"dock-open"):e.Utils.removeClass(a,"dock-open"),t++}};o=__decorate([e.CustomElement({tagName:e.P+"-window-area"})],o),s.PacemWindowAreaElement=o;let i=class PacemWindowElement extends t.PacemIterableElement{propertyChangedCallback(e,t,s,a){super.propertyChangedCallback(e,t,s,a),"minimized"!==e&&"floating"!==e||this._syncLayout()}viewActivatedCallback(){super.viewActivatedCallback(),this._syncLayout()}_syncLayout(){(this.minimized?e.Utils.addClass:e.Utils.removeClass).apply(this,[this,"window-min"]),(this.floating?e.Utils.removeClass:e.Utils.addClass).apply(this,[this,"window-dock"])}};__decorate([e.Watch({converter:e.PropertyConverters.String})],i.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"minimized",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"floating",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-window",shadow:e.Defaults.USE_SHADOW_ROOT,template:`<div class="${a}">\n <${e.P}-text text="{{ :host.caption || 'Window' }}"></${e.P}-text>\n</div>\n<div class="window-buttons ${e.PCSS}-buttonset"><div class="buttonset-right">\n <${e.P}-button class="button" on-click=":host.minimized = !:host.minimized" icon-glyph="{{ :host.minimized ? 'maximize' : 'minimize' }}" hide="{{ !:host.floating }}"></${e.P}-button>\n <${e.P}-button class="button" on-click=":host.floating = !:host.floating" css-class="{{ {'buttonset-first': !:host.floating} }}" icon-glyph="{{ :host.floating? 'lock_open' : 'lock' }}"></${e.P}-button>\n</div></div>\n<div class="window-content"><${e.P}-content></${e.P}-content></div>`})],i),s.PacemWindowElement=i}(t.UI||(t.UI={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));