@hotosm/ui 0.2.0-b2 → 0.2.0-b3
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.
- package/components/Tracking.js +6 -7
- package/dist/components.js +1 -1
- package/package.json +1 -1
package/components/Tracking.js
CHANGED
|
@@ -40,7 +40,7 @@ export class Tracking extends LitElement {
|
|
|
40
40
|
and measure traffic usage and activity. You can learn about how we use the data
|
|
41
41
|
about your visit or information you provide reading our
|
|
42
42
|
<a
|
|
43
|
-
|
|
43
|
+
style="color: #d63f3f;"
|
|
44
44
|
href="https://www.hotosm.org/privacy"
|
|
45
45
|
target="_blank"
|
|
46
46
|
rel="noopener noreferrer"
|
|
@@ -48,8 +48,8 @@ export class Tracking extends LitElement {
|
|
|
48
48
|
By clicking "I Agree", you consent to the use of cookies.
|
|
49
49
|
</p>
|
|
50
50
|
|
|
51
|
-
<sl-button @click=${this._setAgree}>I Agree</sl-button>
|
|
52
|
-
<sl-button @click=${this._setDisagree}>I Do Not Agree</sl-button>
|
|
51
|
+
<sl-button @click=${(e) => { this._setAgree(e); }}>I Agree</sl-button>
|
|
52
|
+
<sl-button @click=${(e) => { this._setDisagree(e); }}>I Do Not Agree</sl-button>
|
|
53
53
|
</sl-alert>`;
|
|
54
54
|
}
|
|
55
55
|
_setAgree(_e) {
|
|
@@ -76,7 +76,7 @@ export class Tracking extends LitElement {
|
|
|
76
76
|
super.connectedCallback();
|
|
77
77
|
// Close and halt execution if wrong domain
|
|
78
78
|
if (!this.force && window.location.hostname !== this.domain) {
|
|
79
|
-
console.warn(
|
|
79
|
+
console.warn(`Matomo init failed. ${window.location.hostname} does not match ${this.domain}.`);
|
|
80
80
|
this.isOpen = false;
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -134,9 +134,7 @@ Tracking.styles = [
|
|
|
134
134
|
font-weight: var(--sl-font-weight-bold);
|
|
135
135
|
font-size: var(--sl-font-size-large);
|
|
136
136
|
color: #d63f3f;
|
|
137
|
-
|
|
138
|
-
#hot-red-text {
|
|
139
|
-
color: #d63f3f;
|
|
137
|
+
text-align: center;
|
|
140
138
|
}
|
|
141
139
|
sl-alert::part(base) {
|
|
142
140
|
position: absolute;
|
|
@@ -145,6 +143,7 @@ Tracking.styles = [
|
|
|
145
143
|
transform: translateX(-50%);
|
|
146
144
|
z-index: 1000;
|
|
147
145
|
width: 80vw;
|
|
146
|
+
text-align: center;
|
|
148
147
|
}
|
|
149
148
|
`
|
|
150
149
|
];
|
package/dist/components.js
CHANGED
|
@@ -118,4 +118,4 @@ function Rt(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Ref
|
|
|
118
118
|
`}};Ee.styles=[yt,Ce],Ee.dependencies={"sl-icon":se},Pt([Rt(".icon-button")],Ee.prototype,"button",2),Pt([Bt()],Ee.prototype,"hasFocus",2),Pt([Mt()],Ee.prototype,"name",2),Pt([Mt()],Ee.prototype,"library",2),Pt([Mt()],Ee.prototype,"src",2),Pt([Mt()],Ee.prototype,"href",2),Pt([Mt()],Ee.prototype,"target",2),Pt([Mt()],Ee.prototype,"download",2),Pt([Mt()],Ee.prototype,"label",2),Pt([Mt({type:Boolean,reflect:!0})],Ee.prototype,"disabled",2),Ee.define("sl-icon-button");var Se=n`:host{--padding:0;display:none}:host([active]){display:block}.tab-panel{display:block;padding:var(--padding)}`,ze=0,Pe=class extends Tt{constructor(){super(...arguments),this.attrId=++ze,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return V`<slot part="base" class="${he({"tab-panel":!0,"tab-panel--active":this.active})}"></slot>`}};Pe.styles=[yt,Se],Pt([Mt({reflect:!0})],Pe.prototype,"name",2),Pt([Mt({type:Boolean,reflect:!0})],Pe.prototype,"active",2),Pt([ee("active")],Pe.prototype,"handleActiveChange",1),Pe.define("sl-tab-panel");var Oe=n`:host{display:inline-block}.tab{display:inline-flex;align-items:center;font-family:var(--sl-font-sans);font-size:var(--sl-font-size-small);font-weight:var(--sl-font-weight-semibold);border-radius:var(--sl-border-radius-medium);color:var(--sl-color-neutral-600);padding:var(--sl-spacing-medium) var(--sl-spacing-large);white-space:nowrap;user-select:none;-webkit-user-select:none;cursor:pointer;transition:var(--transition-speed) box-shadow,var(--transition-speed) color}.tab:hover:not(.tab--disabled){color:var(--sl-color-primary-600)}.tab:focus{outline:0}.tab:focus-visible:not(.tab--disabled){color:var(--sl-color-primary-600)}.tab:focus-visible{outline:var(--sl-focus-ring);outline-offset:calc(-1 * var(--sl-focus-ring-width) - var(--sl-focus-ring-offset))}.tab.tab--active:not(.tab--disabled){color:var(--sl-color-primary-600)}.tab.tab--closable{padding-inline-end:var(--sl-spacing-small)}.tab.tab--disabled{opacity:.5;cursor:not-allowed}.tab__close-button{font-size:var(--sl-font-size-small);margin-inline-start:var(--sl-spacing-small)}.tab__close-button::part(base){padding:var(--sl-spacing-3x-small)}@media (forced-colors:active){.tab.tab--active:not(.tab--disabled){outline:solid 1px transparent;outline-offset:-3px}}`,Le=0,Me=class extends Tt{constructor(){super(...arguments),this.localize=new vt(this),this.attrId=++Le,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.tab.focus(t)}blur(){this.tab.blur()}render(){return this.id=this.id.length>0?this.id:this.componentId,V`<div part="base" class="${he({tab:!0,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})}" tabindex="${this.disabled?"-1":"0"}"><slot></slot>${this.closable?V`<sl-icon-button part="close-button" exportparts="base:close-button__base" name="x-lg" library="system" label="${this.localize.term("close")}" class="tab__close-button" @click="${this.handleCloseClick}" tabindex="-1"></sl-icon-button>`:""}</div>`}};Me.styles=[yt,Oe],Me.dependencies={"sl-icon-button":Ee},Pt([Rt(".tab")],Me.prototype,"tab",2),Pt([Mt({reflect:!0})],Me.prototype,"panel",2),Pt([Mt({type:Boolean,reflect:!0})],Me.prototype,"active",2),Pt([Mt({type:Boolean})],Me.prototype,"closable",2),Pt([Mt({type:Boolean,reflect:!0})],Me.prototype,"disabled",2),Pt([ee("active")],Me.prototype,"handleActiveChange",1),Pt([ee("disabled")],Me.prototype,"handleDisabledChange",1),Me.define("sl-tab");const Be={list:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/>\n </svg>\n ',"info-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">\n <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>\n <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>\n </svg>\n ',"arrow-counterclockwise":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2v1z"/>\n <path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466z"/>\n </svg>\n ',"arrow-clockwise":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/>\n <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/>\n </svg>\n ',"type-bold":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-bold" viewBox="0 0 16 16">\n <path d="M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13H8.21zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"/>\n </svg>\n ',"type-italic":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-italic" viewBox="0 0 16 16">\n <path d="M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"/>\n </svg>\n ',"type-underline":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-underline" viewBox="0 0 16 16">\n <path d="M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57-1.709 0-2.687-1.08-2.687-2.57V3.136zM12.5 15h-9v-1h9v1z"/>\n </svg>\n ',"justify-left":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-justify-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/>\n </svg>\n ',justify:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-justify" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/>\n </svg>\n ',"justify-right":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-justify-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M6 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/>\n </svg>\n '},Re=t=>t in Be?`data:image/svg+xml,${encodeURIComponent(Be[t])}`:"";function Te(){te("bundled",{resolver:Re})}var Ne=function(t,e,o,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};Te();const Ue=new URL(new URL("assets/logo-CqlPtOQW.png",import.meta.url).href,import.meta.url);class De extends rt{constructor(){super(...arguments),this.name="hot-header",this.title="",this.logo=Ue,this.drawer=!0}render(){const t="string"==typeof this.logo||this.logo instanceof URL?"string"==typeof this.logo?this.logo:this.logo.href:"";return V`<header>${t.length>0?V`<div id="logo-block"><img id="logo" src="${this.logo}" alt="Logo"></div>`:null} ${this.title.length>0?V`<h1>${this.title}</h1>`:null}<sl-tab-group><sl-tab slot="nav" panel="projects">Explore Projects</sl-tab><sl-tab slot="nav" panel="organisations">Manage Organizations</sl-tab></sl-tab-group>${this.drawer?V`<div id="drawer-block" style="font-size:32px"><sl-icon-button library="bundled" name="list" label="drawer-open"></sl-icon-button></div>`:null}</header>`}}De.styles=[n`@unocss-placeholder;`,n`header{display:flex;justify-content:space-between;align-items:center;background:var(--app-color-primary);color:#fff;padding:12px;padding-top:4px;position:fixed;left:0;top:0;height:50px;width:100%;-webkit-app-region:drag}header h1{margin-top:0;margin-bottom:0;font-size:12px;font-weight:700}nav a{margin-left:10px}#logo-block{height:40px;max-width:50%;display:flex;justify-content:space-between;align-items:center;gap:8px}#logo{height:100%;width:100%}#drawer-block{display:flex;justify-content:space-between;align-items:right;gap:8px;padding-right:30px}@media(prefers-color-scheme:light){header{color:#000}nav a{color:initial}}`],Ne([Mt()],De.prototype,"name",void 0),Ne([Mt({type:String})],De.prototype,"title",void 0),Ne([Mt({type:String})],De.prototype,"logo",void 0),Ne([Mt({type:Boolean})],De.prototype,"drawer",void 0),customElements.define("hot-header",De);var Fe=n`:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`,Ve=class extends Tt{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=je(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--focus",!0)}handleBlur(t){const e=je(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--focus",!1)}handleMouseOver(t){const e=je(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--hover",!0)}handleMouseOut(t){const e=je(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--hover",!1)}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),i=je(e);i&&(i.toggleAttribute("data-sl-button-group__button",!0),i.toggleAttribute("data-sl-button-group__button--first",0===o),i.toggleAttribute("data-sl-button-group__button--inner",o>0&&o<t.length-1),i.toggleAttribute("data-sl-button-group__button--last",o===t.length-1),i.toggleAttribute("data-sl-button-group__button--radio","sl-radio-button"===i.tagName.toLowerCase()))}))}render(){return V`<div part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}"><slot @slotchange="${this.handleSlotChange}"></slot></div>`}};function je(t){var e;const o="sl-button, sl-radio-button";return null!=(e=t.closest(o))?e:t.querySelector(o)}Ve.styles=[yt,Fe],Pt([Rt("slot")],Ve.prototype,"defaultSlot",2),Pt([Bt()],Ve.prototype,"disableRole",2),Pt([Mt()],Ve.prototype,"label",2),Ve.define("sl-button-group"),se.define("sl-icon");var He=n`:host{--max-width:20rem;--hide-delay:0ms;--show-delay:150ms;display:contents}.tooltip{--arrow-size:var(--sl-tooltip-arrow-size);--arrow-color:var(--sl-tooltip-background-color)}.tooltip::part(popup){z-index:var(--sl-z-index-tooltip)}.tooltip[placement^=top]::part(popup){transform-origin:bottom}.tooltip[placement^=bottom]::part(popup){transform-origin:top}.tooltip[placement^=left]::part(popup){transform-origin:right}.tooltip[placement^=right]::part(popup){transform-origin:left}.tooltip__body{display:block;width:max-content;max-width:var(--max-width);border-radius:var(--sl-tooltip-border-radius);background-color:var(--sl-tooltip-background-color);font-family:var(--sl-tooltip-font-family);font-size:var(--sl-tooltip-font-size);font-weight:var(--sl-tooltip-font-weight);line-height:var(--sl-tooltip-line-height);text-align:start;white-space:normal;color:var(--sl-tooltip-color);padding:var(--sl-tooltip-padding);pointer-events:none;user-select:none;-webkit-user-select:none}`,Ie=n`:host{--arrow-color:var(--sl-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}.popup{position:absolute;isolation:isolate;max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}.popup--fixed{position:fixed}.popup:not(.popup--active){display:none}.popup__arrow{position:absolute;width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);rotate:45deg;background:var(--arrow-color);z-index:-1}.popup-hover-bridge:not(.popup-hover-bridge--visible){display:none}.popup-hover-bridge{position:fixed;z-index:calc(var(--sl-z-index-dropdown) - 1);top:0;right:0;bottom:0;left:0;clip-path:polygon(var(--hover-bridge-top-left-x,0) var(--hover-bridge-top-left-y,0),var(--hover-bridge-top-right-x,0) var(--hover-bridge-top-right-y,0),var(--hover-bridge-bottom-right-x,0) var(--hover-bridge-bottom-right-y,0),var(--hover-bridge-bottom-left-x,0) var(--hover-bridge-bottom-left-y,0))}`;const We=Math.min,qe=Math.max,Ge=Math.round,Ke=Math.floor,Ze=t=>({x:t,y:t}),Xe={left:"right",right:"left",bottom:"top",top:"bottom"},Ye={start:"end",end:"start"};function Je(t,e,o){return qe(t,We(e,o))}function Qe(t,e){return"function"==typeof t?t(e):t}function to(t){return t.split("-")[0]}function eo(t){return t.split("-")[1]}function oo(t){return"x"===t?"y":"x"}function io(t){return"y"===t?"height":"width"}function ro(t){return["top","bottom"].includes(to(t))?"y":"x"}function no(t){return oo(ro(t))}function so(t){return t.replace(/start|end/g,(t=>Ye[t]))}function ao(t){return t.replace(/left|right|bottom|top/g,(t=>Xe[t]))}function lo(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function co(t){const{x:e,y:o,width:i,height:r}=t;return{width:i,height:r,top:o,left:e,right:e+i,bottom:o+r,x:e,y:o}}function ho(t,e,o){let{reference:i,floating:r}=t;const n=ro(e),s=no(e),a=io(s),l=to(e),c="y"===n,h=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,u=i[a]/2-r[a]/2;let p;switch(l){case"top":p={x:h,y:i.y-r.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-r.width,y:d};break;default:p={x:i.x,y:i.y}}switch(eo(e)){case"start":p[s]-=u*(o&&c?-1:1);break;case"end":p[s]+=u*(o&&c?-1:1)}return p}async function uo(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:n,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=Qe(e,t),b=lo(p),f=a[u?"floating"===d?"reference":"floating":d],g=co(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(f)))||o?f:f.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),m="floating"===d?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==n.getOffsetParent?void 0:n.getOffsetParent(a.floating)),y=await(null==n.isElement?void 0:n.isElement(v))&&await(null==n.getScale?void 0:n.getScale(v))||{x:1,y:1},w=co(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:l}):m);return{top:(g.top-w.top+b.top)/y.y,bottom:(w.bottom-g.bottom+b.bottom)/y.y,left:(g.left-w.left+b.left)/y.x,right:(w.right-g.right+b.right)/y.x}}function po(t){return go(t)?(t.nodeName||"").toLowerCase():"#document"}function bo(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function fo(t){var e;return null==(e=(go(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function go(t){return t instanceof Node||t instanceof bo(t).Node}function mo(t){return t instanceof Element||t instanceof bo(t).Element}function vo(t){return t instanceof HTMLElement||t instanceof bo(t).HTMLElement}function yo(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof bo(t).ShadowRoot)}function wo(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=Ao(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(r)}function xo(t){return["table","td","th"].includes(po(t))}function _o(t){const e=$o(),o=Ao(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function $o(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ko(t){return["html","body","#document"].includes(po(t))}function Ao(t){return bo(t).getComputedStyle(t)}function Co(t){return mo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Eo(t){if("html"===po(t))return t;const e=t.assignedSlot||t.parentNode||yo(t)&&t.host||fo(t);return yo(e)?e.host:e}function So(t){const e=Eo(t);return ko(e)?t.ownerDocument?t.ownerDocument.body:t.body:vo(e)&&wo(e)?e:So(e)}function zo(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=So(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),s=bo(r);return n?e.concat(s,s.visualViewport||[],wo(r)?r:[],s.frameElement&&o?zo(s.frameElement):[]):e.concat(r,zo(r,[],o))}function Po(t){const e=Ao(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=vo(t),n=r?t.offsetWidth:o,s=r?t.offsetHeight:i,a=Ge(o)!==n||Ge(i)!==s;return a&&(o=n,i=s),{width:o,height:i,$:a}}function Oo(t){return mo(t)?t:t.contextElement}function Lo(t){const e=Oo(t);if(!vo(e))return Ze(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:n}=Po(e);let s=(n?Ge(o.width):o.width)/i,a=(n?Ge(o.height):o.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Mo=Ze(0);function Bo(t){const e=bo(t);return $o()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Mo}function Ro(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),n=Oo(t);let s=Ze(1);e&&(i?mo(i)&&(s=Lo(i)):s=Lo(t));const a=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==bo(t))&&e}(n,o,i)?Bo(n):Ze(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,h=r.width/s.x,d=r.height/s.y;if(n){const t=bo(n),e=i&&mo(i)?bo(i):i;let o=t,r=o.frameElement;for(;r&&i&&e!==o;){const t=Lo(r),e=r.getBoundingClientRect(),i=Ao(r),n=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=n,c+=s,o=bo(r),r=o.frameElement}}return co({width:h,height:d,x:l,y:c})}const To=[":popover-open",":modal"];function No(t){return To.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Uo(t){return Ro(fo(t)).left+Co(t).scrollLeft}function Do(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=bo(t),i=fo(t),r=o.visualViewport;let n=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){n=r.width,s=r.height;const t=$o();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:n,height:s,x:a,y:l}}(t,o);else if("document"===e)i=function(t){const e=fo(t),o=Co(t),i=t.ownerDocument.body,r=qe(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=qe(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-o.scrollLeft+Uo(t);const a=-o.scrollTop;return"rtl"===Ao(i).direction&&(s+=qe(e.clientWidth,i.clientWidth)-r),{width:r,height:n,x:s,y:a}}(fo(t));else if(mo(e))i=function(t,e){const o=Ro(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,n=vo(t)?Lo(t):Ze(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(e,o);else{const o=Bo(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return co(i)}function Fo(t,e){const o=Eo(t);return!(o===e||!mo(o)||ko(o))&&("fixed"===Ao(o).position||Fo(o,e))}function Vo(t,e,o){const i=vo(e),r=fo(e),n="fixed"===o,s=Ro(t,!0,n,e);let a={scrollLeft:0,scrollTop:0};const l=Ze(0);if(i||!i&&!n)if(("body"!==po(e)||wo(r))&&(a=Co(e)),i){const t=Ro(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=Uo(r));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function jo(t){return"static"===Ao(t).position}function Ho(t,e){return vo(t)&&"fixed"!==Ao(t).position?e?e(t):t.offsetParent:null}function Io(t,e){const o=bo(t);if(No(t))return o;if(!vo(t)){let e=Eo(t);for(;e&&!ko(e);){if(mo(e)&&!jo(e))return e;e=Eo(e)}return o}let i=Ho(t,e);for(;i&&xo(i)&&jo(i);)i=Ho(i,e);return i&&ko(i)&&jo(i)&&!_o(i)?o:i||function(t){let e=Eo(t);for(;vo(e)&&!ko(e);){if(_o(e))return e;e=Eo(e)}return null}(t)||o}const Wo={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:i,strategy:r}=t;const n="fixed"===r,s=fo(i),a=!!e&&No(e.floating);if(i===s||a&&n)return o;let l={scrollLeft:0,scrollTop:0},c=Ze(1);const h=Ze(0),d=vo(i);if((d||!d&&!n)&&(("body"!==po(i)||wo(s))&&(l=Co(i)),vo(i))){const t=Ro(i);c=Lo(i),h.x=t.x+i.clientLeft,h.y=t.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+h.x,y:o.y*c.y-l.scrollTop*c.y+h.y}},getDocumentElement:fo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===o?No(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let i=zo(t,[],!1).filter((t=>mo(t)&&"body"!==po(t))),r=null;const n="fixed"===Ao(t).position;let s=n?Eo(t):t;for(;mo(s)&&!ko(s);){const e=Ao(s),o=_o(s);o||"fixed"!==e.position||(r=null),(n?!o&&!r:!o&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||wo(s)&&!o&&Fo(t,s))?i=i.filter((t=>t!==s)):r=e,s=Eo(s)}return e.set(t,i),i}(e,this._c):[].concat(o),i],s=n[0],a=n.reduce(((t,o)=>{const i=Do(e,o,r);return t.top=qe(i.top,t.top),t.right=We(i.right,t.right),t.bottom=We(i.bottom,t.bottom),t.left=qe(i.left,t.left),t}),Do(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Io,getElementRects:async function(t){const e=this.getOffsetParent||Io,o=this.getDimensions,i=await o(t.floating);return{reference:Vo(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=Po(t);return{width:e,height:o}},getScale:Lo,isElement:mo,isRTL:function(t){return"rtl"===Ao(t).direction}};function qo(t,e,o,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=Oo(t),h=r||n?[...c?zo(c):[],...zo(e)]:[];h.forEach((t=>{r&&t.addEventListener("scroll",o,{passive:!0}),n&&t.addEventListener("resize",o)}));const d=c&&a?function(t,e){let o,i=null;const r=fo(t);function n(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),n();const{left:c,top:h,width:d,height:u}=t.getBoundingClientRect();if(a||e(),!d||!u)return;const p={rootMargin:-Ke(h)+"px "+-Ke(r.clientWidth-(c+d))+"px "+-Ke(r.clientHeight-(h+u))+"px "+-Ke(c)+"px",threshold:qe(0,We(1,l))||1};let b=!0;function f(t){const e=t[0].intersectionRatio;if(e!==l){if(!b)return s();e?s(!1,e):o=setTimeout((()=>{s(!1,1e-7)}),1e3)}b=!1}try{i=new IntersectionObserver(f,{...p,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(f,p)}i.observe(t)}(!0),n}(c,o):null;let u,p=-1,b=null;s&&(b=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&b&&(b.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=b)||t.observe(e)}))),o()})),c&&!l&&b.observe(c),b.observe(e));let f=l?Ro(t):null;return l&&function e(){const i=Ro(t);!f||i.x===f.x&&i.y===f.y&&i.width===f.width&&i.height===f.height||o();f=i,u=requestAnimationFrame(e)}(),o(),()=>{var t;h.forEach((t=>{r&&t.removeEventListener("scroll",o),n&&t.removeEventListener("resize",o)})),null==d||d(),null==(t=b)||t.disconnect(),b=null,l&&cancelAnimationFrame(u)}}const Go=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,i;const{x:r,y:n,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:o,platform:i,elements:r}=t,n=await(null==i.isRTL?void 0:i.isRTL(r.floating)),s=to(o),a=eo(o),l="y"===ro(o),c=["left","top"].includes(s)?-1:1,h=n&&l?-1:1,d=Qe(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:b}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof b&&(p="end"===a?-1*b:b),l?{x:p*h,y:u*c}:{x:u*c,y:p*h}}(e,t);return s===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:r+l.x,y:n+l.y,data:{...l,placement:s}}}}},Ko=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:n=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=Qe(t,e),c={x:o,y:i},h=await uo(e,l),d=ro(to(r)),u=oo(d);let p=c[u],b=c[d];if(n){const t="y"===u?"bottom":"right";p=Je(p+h["y"===u?"top":"left"],p,p-h[t])}if(s){const t="y"===d?"bottom":"right";b=Je(b+h["y"===d?"top":"left"],b,b-h[t])}const f=a.fn({...e,[u]:p,[d]:b});return{...f,data:{x:f.x-o,y:f.y-i}}}}},Zo=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,i;const{placement:r,middlewareData:n,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...g}=Qe(t,e);if(null!=(o=n.arrow)&&o.alignmentOffset)return{};const m=to(r),v=to(a)===a,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=u||(v||!f?[ao(a)]:function(t){const e=ao(t);return[so(t),e,so(e)]}(a));u||"none"===b||w.push(...function(t,e,o,i){const r=eo(t);let n=function(t,e,o){const i=["left","right"],r=["right","left"],n=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?r:i:e?i:r;case"left":case"right":return e?n:s;default:return[]}}(to(t),"start"===o,i);return r&&(n=n.map((t=>t+"-"+r)),e&&(n=n.concat(n.map(so)))),n}(a,f,b,y));const x=[a,...w],_=await uo(e,g),$=[];let k=(null==(i=n.flip)?void 0:i.overflows)||[];if(h&&$.push(_[m]),d){const t=function(t,e,o){void 0===o&&(o=!1);const i=eo(t),r=no(t),n=io(r);let s="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[n]>e.floating[n]&&(s=ao(s)),[s,ao(s)]}(r,s,y);$.push(_[t[0]],_[t[1]])}if(k=[...k,{placement:r,overflows:$}],!$.every((t=>t<=0))){var A,C;const t=((null==(A=n.flip)?void 0:A.index)||0)+1,e=x[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let o=null==(C=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:C.placement;if(!o)switch(p){case"bestFit":{var E;const t=null==(E=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0];t&&(o=t);break}case"initialPlacement":o=a}if(r!==o)return{reset:{placement:o}}}return{}}}},Xo=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:o,rects:i,platform:r,elements:n}=e,{apply:s=(()=>{}),...a}=Qe(t,e),l=await uo(e,a),c=to(o),h=eo(o),d="y"===ro(o),{width:u,height:p}=i.floating;let b,f;"top"===c||"bottom"===c?(b=c,f=h===(await(null==r.isRTL?void 0:r.isRTL(n.floating))?"start":"end")?"left":"right"):(f=c,b="end"===h?"top":"bottom");const g=p-l.top-l.bottom,m=u-l.left-l.right,v=We(p-l[b],g),y=We(u-l[f],m),w=!e.middlewareData.shift;let x=v,_=y;if(d?_=h||w?We(y,m):m:x=h||w?We(v,g):g,w&&!h){const t=qe(l.left,0),e=qe(l.right,0),o=qe(l.top,0),i=qe(l.bottom,0);d?_=u-2*(0!==t||0!==e?t+e:qe(l.left,l.right)):x=p-2*(0!==o||0!==i?o+i:qe(l.top,l.bottom))}await s({...e,availableWidth:_,availableHeight:x});const $=await r.getDimensions(n.floating);return u!==$.width||p!==$.height?{reset:{rects:!0}}:{}}}},Yo=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:n,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=Qe(t,e)||{};if(null==c)return{};const d=lo(h),u={x:o,y:i},p=no(r),b=io(p),f=await s.getDimensions(c),g="y"===p,m=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=n.reference[b]+n.reference[p]-u[p]-n.floating[b],x=u[p]-n.reference[p],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let $=_?_[y]:0;$&&await(null==s.isElement?void 0:s.isElement(_))||($=a.floating[y]||n.floating[b]);const k=w/2-x/2,A=$/2-f[b]/2-1,C=We(d[m],A),E=We(d[v],A),S=C,z=$-f[b]-E,P=$/2-f[b]/2+k,O=Je(S,P,z),L=!l.arrow&&null!=eo(r)&&P!==O&&n.reference[b]/2-(P<S?C:E)-f[b]/2<0,M=L?P<S?P-S:P-z:0;return{[p]:u[p]+M,data:{[p]:O,centerOffset:P-O-M,...L&&{alignmentOffset:M}},reset:L}}}),Jo=(t,e,o)=>{const i=new Map,r={platform:Wo,...o},n={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:s}=o,a=n.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:d}=ho(c,i,l),u=i,p={},b=0;for(let o=0;o<a.length;o++){const{name:n,fn:f}=a[o],{x:g,y:m,data:v,reset:y}=await f({x:h,y:d,initialPlacement:i,placement:u,strategy:r,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=g?g:h,d=null!=m?m:d,p={...p,[n]:{...p[n],...v}},y&&b<=50&&(b++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):y.rects),({x:h,y:d}=ho(c,u,l))),o=-1)}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}})(t,e,{...r,platform:n})};function Qo(t){return function(t){for(let e=t;e;e=ti(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=ti(t);e;e=ti(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function ti(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var ei=class extends Tt{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,i=0,r=0,n=0,s=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top<e.top?(o=t.left,i=t.bottom,r=t.right,n=t.bottom,s=e.left,a=e.top,l=e.right,c=e.top):(o=e.left,i=e.bottom,r=e.right,n=e.bottom,s=t.left,a=t.top,l=t.right,c=t.top):t.left<e.left?(o=t.right,i=t.top,r=e.left,n=e.top,s=t.right,a=t.bottom,l=e.left,c=e.bottom):(o=e.right,i=e.top,r=t.left,n=t.top,s=e.right,a=e.bottom,l=t.left,c=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${o}px`),this.style.setProperty("--hover-bridge-top-left-y",`${i}px`),this.style.setProperty("--hover-bridge-top-right-x",`${r}px`),this.style.setProperty("--hover-bridge-top-right-y",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${a}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${c}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||function(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t&&(!("contextElement"in t)||t instanceof Element)}(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){this.anchorEl&&(this.cleanup=qo(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[Go({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(Xo({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(Zo({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Ko({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(Xo({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Yo({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>Wo.getOffsetParent(t,Qo):Wo.getOffsetParent;Jo(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:zt(St({},Wo),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:o,placement:i})=>{const r="rtl"===getComputedStyle(this).direction,n={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let i="",s="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",s=r?o:"",l=r?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";s=r?"":o,l=r?o:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:s,bottom:a,left:l,[n]:"calc(var(--arrow-size-diagonal) * -1)"})}})),requestAnimationFrame((()=>this.updateHoverBridge())),this.emit("sl-reposition")}render(){return V`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><span part="hover-bridge" class="${he({"popup-hover-bridge":!0,"popup-hover-bridge--visible":this.hoverBridge&&this.active})}"></span><div part="popup" class="${he({popup:!0,"popup--active":this.active,"popup--fixed":"fixed"===this.strategy,"popup--has-arrow":this.arrow})}"><slot></slot>${this.arrow?V`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}</div>`}};ei.styles=[yt,Ie],Pt([Rt(".popup")],ei.prototype,"popup",2),Pt([Rt(".popup__arrow")],ei.prototype,"arrowEl",2),Pt([Mt()],ei.prototype,"anchor",2),Pt([Mt({type:Boolean,reflect:!0})],ei.prototype,"active",2),Pt([Mt({reflect:!0})],ei.prototype,"placement",2),Pt([Mt({reflect:!0})],ei.prototype,"strategy",2),Pt([Mt({type:Number})],ei.prototype,"distance",2),Pt([Mt({type:Number})],ei.prototype,"skidding",2),Pt([Mt({type:Boolean})],ei.prototype,"arrow",2),Pt([Mt({attribute:"arrow-placement"})],ei.prototype,"arrowPlacement",2),Pt([Mt({attribute:"arrow-padding",type:Number})],ei.prototype,"arrowPadding",2),Pt([Mt({type:Boolean})],ei.prototype,"flip",2),Pt([Mt({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],ei.prototype,"flipFallbackPlacements",2),Pt([Mt({attribute:"flip-fallback-strategy"})],ei.prototype,"flipFallbackStrategy",2),Pt([Mt({type:Object})],ei.prototype,"flipBoundary",2),Pt([Mt({attribute:"flip-padding",type:Number})],ei.prototype,"flipPadding",2),Pt([Mt({type:Boolean})],ei.prototype,"shift",2),Pt([Mt({type:Object})],ei.prototype,"shiftBoundary",2),Pt([Mt({attribute:"shift-padding",type:Number})],ei.prototype,"shiftPadding",2),Pt([Mt({attribute:"auto-size"})],ei.prototype,"autoSize",2),Pt([Mt()],ei.prototype,"sync",2),Pt([Mt({type:Object})],ei.prototype,"autoSizeBoundary",2),Pt([Mt({attribute:"auto-size-padding",type:Number})],ei.prototype,"autoSizePadding",2),Pt([Mt({attribute:"hover-bridge",type:Boolean})],ei.prototype,"hoverBridge",2);var oi=new Map,ii=new WeakMap;function ri(t,e){return"rtl"===e.toLowerCase()?{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}:t}function ni(t,e){oi.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function si(t,e,o){const i=ii.get(t);if(null==i?void 0:i[e])return ri(i[e],o.dir);const r=oi.get(e);return r?ri(r,o.dir):{keyframes:[],options:{duration:0}}}function ai(t,e){return new Promise((o=>{t.addEventListener(e,(function i(r){r.target===t&&(t.removeEventListener(e,i),o())}))}))}function li(t,e,o){return new Promise((i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const r=t.animate(e,zt(St({},o),{duration:hi()?0:o.duration}));r.addEventListener("cancel",i,{once:!0}),r.addEventListener("finish",i,{once:!0})}))}function ci(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function hi(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function di(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel(),requestAnimationFrame(e)})))))}var ui=class extends Tt{constructor(){super(),this.localize=new vt(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=ci(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=ci(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await di(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=si(this,"tooltip.show",{dir:this.localize.dir()});await li(this.popup.popup,e,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await di(this.body);const{keyframes:t,options:o}=si(this,"tooltip.hide",{dir:this.localize.dir()});await li(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,ai(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,ai(this,"sl-after-hide")}render(){return V`<sl-popup part="base" exportparts="
|
|
119
119
|
popup:base__popup,
|
|
120
120
|
arrow:base__arrow
|
|
121
|
-
" class="${he({tooltip:!0,"tooltip--open":this.open})}" placement="${this.placement}" distance="${this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow hover-bridge>${""}<slot slot="anchor" aria-describedby="tooltip"></slot>${""}<div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live="${this.open?"polite":"off"}"><slot name="content">${this.content}</slot></div></sl-popup>`}};ui.styles=[yt,He],ui.dependencies={"sl-popup":ei},Pt([Rt("slot:not([name])")],ui.prototype,"defaultSlot",2),Pt([Rt(".tooltip__body")],ui.prototype,"body",2),Pt([Rt("sl-popup")],ui.prototype,"popup",2),Pt([Mt()],ui.prototype,"content",2),Pt([Mt()],ui.prototype,"placement",2),Pt([Mt({type:Boolean,reflect:!0})],ui.prototype,"disabled",2),Pt([Mt({type:Number})],ui.prototype,"distance",2),Pt([Mt({type:Boolean,reflect:!0})],ui.prototype,"open",2),Pt([Mt({type:Number})],ui.prototype,"skidding",2),Pt([Mt()],ui.prototype,"trigger",2),Pt([Mt({type:Boolean})],ui.prototype,"hoist",2),Pt([ee("open",{waitUntilFirstUpdate:!0})],ui.prototype,"handleOpenChange",1),Pt([ee(["content","distance","hoist","placement","skidding"])],ui.prototype,"handleOptionsChange",1),Pt([ee("disabled")],ui.prototype,"handleDisabledChange",1),ni("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),ni("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),ui.define("sl-tooltip");var pi=function(t,e,o,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};Te();class bi extends rt{constructor(){super(...arguments),this.name="hot-toolbar",this.tooltipPosition="top",this.undo=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-undo-click"))},this.redo=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-redo-click"))},this.bold=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-bold-click"))},this.italic=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-italic-click"))},this.underline=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-underline-click"))},this.alignLeft=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-leftalign-click"))},this.alignCenter=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-centeralign-click"))},this.alignRight=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-rightalign-click"))}}render(){return V`<div class="button-group-toolbar">${this.renderButtonGroup("History",[{content:"Undo",icon:"arrow-counterclockwise",label:"Undo",action:this.undo},{content:"Redo",icon:"arrow-clockwise",label:"Redo",action:this.redo}])} ${this.renderButtonGroup("Formatting",[{content:"Bold",icon:"type-bold",label:"Bold",action:this.bold},{content:"Italic",icon:"type-italic",label:"Italic",action:this.italic},{content:"Underline",icon:"type-underline",label:"Underline",action:this.underline}])} ${this.renderButtonGroup("Alignment",[{content:"Align Left",icon:"justify-left",label:"Align Left",action:this.alignLeft},{content:"Align Center",icon:"justify",label:"Align Center",action:this.alignCenter},{content:"Align Right",icon:"justify-right",label:"Align Right",action:this.alignRight}])}</div>`}renderButtonGroup(t,e){return V`<sl-button-group label="${t}">${e.map((t=>this.renderButton(t)))}</sl-button-group>`}renderButton({content:t,icon:e,label:o,action:i}){return V`<sl-tooltip content="${t}" placement="${this.tooltipPosition}"><sl-button @click="${i??(()=>{})}"><sl-icon library="bundled" name="${e}" label="${o}"></sl-icon></sl-button></sl-tooltip>`}}bi.styles=[n`@unocss-placeholder;`],pi([Mt()],bi.prototype,"name",void 0),pi([Mt({type:String,attribute:"tooltip-position"})],bi.prototype,"tooltipPosition",void 0),customElements.define("hot-toolbar",bi);var fi=n`:host{display:contents;margin:0}.alert{position:relative;display:flex;align-items:stretch;background-color:var(--sl-panel-background-color);border:solid var(--sl-panel-border-width) var(--sl-panel-border-color);border-top-width:calc(var(--sl-panel-border-width) * 3);border-radius:var(--sl-border-radius-medium);font-family:var(--sl-font-sans);font-size:var(--sl-font-size-small);font-weight:var(--sl-font-weight-normal);line-height:1.6;color:var(--sl-color-neutral-700);margin:inherit}.alert:not(.alert--closable) .alert__close-button,.alert:not(.alert--has-icon) .alert__icon{display:none}.alert__icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sl-font-size-large);padding-inline-start:var(--sl-spacing-large)}.alert--primary{border-top-color:var(--sl-color-primary-600)}.alert--primary .alert__icon{color:var(--sl-color-primary-600)}.alert--success{border-top-color:var(--sl-color-success-600)}.alert--success .alert__icon{color:var(--sl-color-success-600)}.alert--neutral{border-top-color:var(--sl-color-neutral-600)}.alert--neutral .alert__icon{color:var(--sl-color-neutral-600)}.alert--warning{border-top-color:var(--sl-color-warning-600)}.alert--warning .alert__icon{color:var(--sl-color-warning-600)}.alert--danger{border-top-color:var(--sl-color-danger-600)}.alert--danger .alert__icon{color:var(--sl-color-danger-600)}.alert__message{flex:1 1 auto;display:block;padding:var(--sl-spacing-large);overflow:hidden}.alert__close-button{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sl-font-size-medium);padding-inline-end:var(--sl-spacing-medium)}`,gi=Object.assign(document.createElement("div"),{className:"sl-toast-stack"}),mi=class extends Tt{constructor(){super(...arguments),this.hasSlotController=new ae(this,"icon","suffix"),this.localize=new vt(this),this.open=!1,this.closable=!1,this.variant="primary",this.duration=1/0}firstUpdated(){this.base.hidden=!this.open}restartAutoHide(){clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration))}handleCloseClick(){this.hide()}handleMouseMove(){this.restartAutoHide()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.duration<1/0&&this.restartAutoHide(),await di(this.base),this.base.hidden=!1;const{keyframes:t,options:e}=si(this,"alert.show",{dir:this.localize.dir()});await li(this.base,t,e),this.emit("sl-after-show")}else{this.emit("sl-hide"),clearTimeout(this.autoHideTimeout),await di(this.base);const{keyframes:t,options:e}=si(this,"alert.hide",{dir:this.localize.dir()});await li(this.base,t,e),this.base.hidden=!0,this.emit("sl-after-hide")}}handleDurationChange(){this.restartAutoHide()}async show(){if(!this.open)return this.open=!0,ai(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,ai(this,"sl-after-hide")}async toast(){return new Promise((t=>{null===gi.parentElement&&document.body.append(gi),gi.appendChild(this),requestAnimationFrame((()=>{this.clientWidth,this.show()})),this.addEventListener("sl-after-hide",(()=>{gi.removeChild(this),t(),null===gi.querySelector("sl-alert")&&gi.remove()}),{once:!0})}))}render(){return V`<div part="base" class="${he({alert:!0,"alert--open":this.open,"alert--closable":this.closable,"alert--has-icon":this.hasSlotController.test("icon"),"alert--primary":"primary"===this.variant,"alert--success":"success"===this.variant,"alert--neutral":"neutral"===this.variant,"alert--warning":"warning"===this.variant,"alert--danger":"danger"===this.variant})}" role="alert" aria-hidden="${this.open?"false":"true"}" @mousemove="${this.handleMouseMove}"><div part="icon" class="alert__icon"><slot name="icon"></slot></div><div part="message" class="alert__message" aria-live="polite"><slot></slot></div>${this.closable?V`<sl-icon-button part="close-button" exportparts="base:close-button__base" class="alert__close-button" name="x-lg" library="system" label="${this.localize.term("close")}" @click="${this.handleCloseClick}"></sl-icon-button>`:""}</div>`}};mi.styles=[yt,fi],mi.dependencies={"sl-icon-button":Ee},Pt([Rt('[part~="base"]')],mi.prototype,"base",2),Pt([Mt({type:Boolean,reflect:!0})],mi.prototype,"open",2),Pt([Mt({type:Boolean,reflect:!0})],mi.prototype,"closable",2),Pt([Mt({reflect:!0})],mi.prototype,"variant",2),Pt([Mt({type:Number})],mi.prototype,"duration",2),Pt([ee("open",{waitUntilFirstUpdate:!0})],mi.prototype,"handleOpenChange",1),Pt([ee("duration")],mi.prototype,"handleDurationChange",1),ni("alert.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),ni("alert.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),mi.define("sl-alert");var vi=function(t,e,o,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};Te();class yi extends rt{constructor(){super(...arguments),this.name="hot-tracking",this.siteId="",this.domain="",this.force=!1,this.isOpen=!0}render(){return V`<sl-alert variant="danger" ?open="${this.isOpen}"><sl-icon id="hot-red-text" library="bundled" slot="icon" name="info-circle"></sl-icon><p id="tracking-header">About the information we collect</p><p>We use cookies and similar technologies to recognize and analyze your visits, and measure traffic usage and activity. You can learn about how we use the data about your visit or information you provide reading our <a id="hot-red-text" href="https://www.hotosm.org/privacy" target="_blank" rel="noopener noreferrer">privacy policy</a>. By clicking "I Agree", you consent to the use of cookies.</p><sl-button @click="${this._setAgree}">I Agree</sl-button><sl-button @click="${this._setDisagree}">I Do Not Agree</sl-button></sl-alert>`}_setAgree(t){const e=window._paq=window._paq||[];0!==e.length&&(e.push(["rememberConsentGiven"]),this.isOpen=!1,localStorage.setItem(`${this.siteId}-matomo-agree`,"true"),this.dispatchEvent(new Event("agree",{bubbles:!0,composed:!0})))}_setDisagree(t){const e=window._paq=window._paq||[];0!==e.length&&(e.push(["forgetConsentGiven"]),this.isOpen=!1,localStorage.setItem(`${this.siteId}-matomo-agree`,"false"),this.dispatchEvent(new Event("disagree",{bubbles:!0,composed:!0})))}connectedCallback(){if(super.connectedCallback(),!this.force&&window.location.hostname!==this.domain)return console.warn("Matomo init failed. Provided domain does not match current domain."),void(this.isOpen=!1);const t=this.siteId;if(!this.force&&(0===t.length||0===this.domain.length))return console.warn("Matomo init failed. No site id or domains provided."),void(this.isOpen=!1);const e=localStorage.getItem(`${this.siteId}-matomo-agree`);if("false"===e)return void(this.isOpen=!1);"true"===e&&(this.isOpen=!1),console.log(`Setting Matomo tracking for site=${t} domain=${this.domain}`);const o=window._paq=window._paq||[];o.push(["requireConsent"]),o.push(["setDomains",[this.domain]]),o.push(["trackPageView"]),o.push(["enableLinkTracking"]),o.push(["trackVisibleContentImpressions"]),function(){const e="//matomo.hotosm.org/";o.push(["setTrackerUrl",e+"matomo.php"]),o.push(["setSiteId",t]);const i=document,r=i.createElement("script"),n=i.getElementsByTagName("script")[0];null!=n?.parentNode?(r.async=!0,r.src=e+"matomo.js",n.parentNode.insertBefore(r,n)):console.warn("Script insertion failed. Parent node is null.")}()}}yi.styles=[n`@unocss-placeholder;`,n`#tracking-header{font-weight:var(--sl-font-weight-bold);font-size:var(--sl-font-size-large);color:#d63f3f}#hot-red-text{color:#d63f3f}sl-alert::part(base){position:absolute;bottom:20px;left:50%;transform:translateX(-50%);z-index:1000;width:80vw}`],vi([Mt()],yi.prototype,"name",void 0),vi([Mt({type:String,attribute:"site-id"})],yi.prototype,"siteId",void 0),vi([Mt({type:String})],yi.prototype,"domain",void 0),vi([Mt({type:Boolean})],yi.prototype,"force",void 0),vi([Bt()],yi.prototype,"isOpen",void 0),customElements.define("hot-tracking",yi);export{Ae as Button,De as Header,bi as Toolbar,yi as Tracking};
|
|
121
|
+
" class="${he({tooltip:!0,"tooltip--open":this.open})}" placement="${this.placement}" distance="${this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow hover-bridge>${""}<slot slot="anchor" aria-describedby="tooltip"></slot>${""}<div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live="${this.open?"polite":"off"}"><slot name="content">${this.content}</slot></div></sl-popup>`}};ui.styles=[yt,He],ui.dependencies={"sl-popup":ei},Pt([Rt("slot:not([name])")],ui.prototype,"defaultSlot",2),Pt([Rt(".tooltip__body")],ui.prototype,"body",2),Pt([Rt("sl-popup")],ui.prototype,"popup",2),Pt([Mt()],ui.prototype,"content",2),Pt([Mt()],ui.prototype,"placement",2),Pt([Mt({type:Boolean,reflect:!0})],ui.prototype,"disabled",2),Pt([Mt({type:Number})],ui.prototype,"distance",2),Pt([Mt({type:Boolean,reflect:!0})],ui.prototype,"open",2),Pt([Mt({type:Number})],ui.prototype,"skidding",2),Pt([Mt()],ui.prototype,"trigger",2),Pt([Mt({type:Boolean})],ui.prototype,"hoist",2),Pt([ee("open",{waitUntilFirstUpdate:!0})],ui.prototype,"handleOpenChange",1),Pt([ee(["content","distance","hoist","placement","skidding"])],ui.prototype,"handleOptionsChange",1),Pt([ee("disabled")],ui.prototype,"handleDisabledChange",1),ni("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),ni("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),ui.define("sl-tooltip");var pi=function(t,e,o,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};Te();class bi extends rt{constructor(){super(...arguments),this.name="hot-toolbar",this.tooltipPosition="top",this.undo=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-undo-click"))},this.redo=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-redo-click"))},this.bold=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-bold-click"))},this.italic=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-italic-click"))},this.underline=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-underline-click"))},this.alignLeft=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-leftalign-click"))},this.alignCenter=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-centeralign-click"))},this.alignRight=t=>{t.stopPropagation(),this.dispatchEvent(new Event("hot-rightalign-click"))}}render(){return V`<div class="button-group-toolbar">${this.renderButtonGroup("History",[{content:"Undo",icon:"arrow-counterclockwise",label:"Undo",action:this.undo},{content:"Redo",icon:"arrow-clockwise",label:"Redo",action:this.redo}])} ${this.renderButtonGroup("Formatting",[{content:"Bold",icon:"type-bold",label:"Bold",action:this.bold},{content:"Italic",icon:"type-italic",label:"Italic",action:this.italic},{content:"Underline",icon:"type-underline",label:"Underline",action:this.underline}])} ${this.renderButtonGroup("Alignment",[{content:"Align Left",icon:"justify-left",label:"Align Left",action:this.alignLeft},{content:"Align Center",icon:"justify",label:"Align Center",action:this.alignCenter},{content:"Align Right",icon:"justify-right",label:"Align Right",action:this.alignRight}])}</div>`}renderButtonGroup(t,e){return V`<sl-button-group label="${t}">${e.map((t=>this.renderButton(t)))}</sl-button-group>`}renderButton({content:t,icon:e,label:o,action:i}){return V`<sl-tooltip content="${t}" placement="${this.tooltipPosition}"><sl-button @click="${i??(()=>{})}"><sl-icon library="bundled" name="${e}" label="${o}"></sl-icon></sl-button></sl-tooltip>`}}bi.styles=[n`@unocss-placeholder;`],pi([Mt()],bi.prototype,"name",void 0),pi([Mt({type:String,attribute:"tooltip-position"})],bi.prototype,"tooltipPosition",void 0),customElements.define("hot-toolbar",bi);var fi=n`:host{display:contents;margin:0}.alert{position:relative;display:flex;align-items:stretch;background-color:var(--sl-panel-background-color);border:solid var(--sl-panel-border-width) var(--sl-panel-border-color);border-top-width:calc(var(--sl-panel-border-width) * 3);border-radius:var(--sl-border-radius-medium);font-family:var(--sl-font-sans);font-size:var(--sl-font-size-small);font-weight:var(--sl-font-weight-normal);line-height:1.6;color:var(--sl-color-neutral-700);margin:inherit}.alert:not(.alert--closable) .alert__close-button,.alert:not(.alert--has-icon) .alert__icon{display:none}.alert__icon{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sl-font-size-large);padding-inline-start:var(--sl-spacing-large)}.alert--primary{border-top-color:var(--sl-color-primary-600)}.alert--primary .alert__icon{color:var(--sl-color-primary-600)}.alert--success{border-top-color:var(--sl-color-success-600)}.alert--success .alert__icon{color:var(--sl-color-success-600)}.alert--neutral{border-top-color:var(--sl-color-neutral-600)}.alert--neutral .alert__icon{color:var(--sl-color-neutral-600)}.alert--warning{border-top-color:var(--sl-color-warning-600)}.alert--warning .alert__icon{color:var(--sl-color-warning-600)}.alert--danger{border-top-color:var(--sl-color-danger-600)}.alert--danger .alert__icon{color:var(--sl-color-danger-600)}.alert__message{flex:1 1 auto;display:block;padding:var(--sl-spacing-large);overflow:hidden}.alert__close-button{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sl-font-size-medium);padding-inline-end:var(--sl-spacing-medium)}`,gi=Object.assign(document.createElement("div"),{className:"sl-toast-stack"}),mi=class extends Tt{constructor(){super(...arguments),this.hasSlotController=new ae(this,"icon","suffix"),this.localize=new vt(this),this.open=!1,this.closable=!1,this.variant="primary",this.duration=1/0}firstUpdated(){this.base.hidden=!this.open}restartAutoHide(){clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration))}handleCloseClick(){this.hide()}handleMouseMove(){this.restartAutoHide()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.duration<1/0&&this.restartAutoHide(),await di(this.base),this.base.hidden=!1;const{keyframes:t,options:e}=si(this,"alert.show",{dir:this.localize.dir()});await li(this.base,t,e),this.emit("sl-after-show")}else{this.emit("sl-hide"),clearTimeout(this.autoHideTimeout),await di(this.base);const{keyframes:t,options:e}=si(this,"alert.hide",{dir:this.localize.dir()});await li(this.base,t,e),this.base.hidden=!0,this.emit("sl-after-hide")}}handleDurationChange(){this.restartAutoHide()}async show(){if(!this.open)return this.open=!0,ai(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,ai(this,"sl-after-hide")}async toast(){return new Promise((t=>{null===gi.parentElement&&document.body.append(gi),gi.appendChild(this),requestAnimationFrame((()=>{this.clientWidth,this.show()})),this.addEventListener("sl-after-hide",(()=>{gi.removeChild(this),t(),null===gi.querySelector("sl-alert")&&gi.remove()}),{once:!0})}))}render(){return V`<div part="base" class="${he({alert:!0,"alert--open":this.open,"alert--closable":this.closable,"alert--has-icon":this.hasSlotController.test("icon"),"alert--primary":"primary"===this.variant,"alert--success":"success"===this.variant,"alert--neutral":"neutral"===this.variant,"alert--warning":"warning"===this.variant,"alert--danger":"danger"===this.variant})}" role="alert" aria-hidden="${this.open?"false":"true"}" @mousemove="${this.handleMouseMove}"><div part="icon" class="alert__icon"><slot name="icon"></slot></div><div part="message" class="alert__message" aria-live="polite"><slot></slot></div>${this.closable?V`<sl-icon-button part="close-button" exportparts="base:close-button__base" class="alert__close-button" name="x-lg" library="system" label="${this.localize.term("close")}" @click="${this.handleCloseClick}"></sl-icon-button>`:""}</div>`}};mi.styles=[yt,fi],mi.dependencies={"sl-icon-button":Ee},Pt([Rt('[part~="base"]')],mi.prototype,"base",2),Pt([Mt({type:Boolean,reflect:!0})],mi.prototype,"open",2),Pt([Mt({type:Boolean,reflect:!0})],mi.prototype,"closable",2),Pt([Mt({reflect:!0})],mi.prototype,"variant",2),Pt([Mt({type:Number})],mi.prototype,"duration",2),Pt([ee("open",{waitUntilFirstUpdate:!0})],mi.prototype,"handleOpenChange",1),Pt([ee("duration")],mi.prototype,"handleDurationChange",1),ni("alert.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),ni("alert.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),mi.define("sl-alert");var vi=function(t,e,o,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};Te();class yi extends rt{constructor(){super(...arguments),this.name="hot-tracking",this.siteId="",this.domain="",this.force=!1,this.isOpen=!0}render(){return V`<sl-alert variant="danger" ?open="${this.isOpen}"><sl-icon id="hot-red-text" library="bundled" slot="icon" name="info-circle"></sl-icon><p id="tracking-header">About the information we collect</p><p>We use cookies and similar technologies to recognize and analyze your visits, and measure traffic usage and activity. You can learn about how we use the data about your visit or information you provide reading our <a style="color:#d63f3f" href="https://www.hotosm.org/privacy" target="_blank" rel="noopener noreferrer">privacy policy</a>. By clicking "I Agree", you consent to the use of cookies.</p><sl-button @click="${t=>{this._setAgree(t)}}">I Agree</sl-button><sl-button @click="${t=>{this._setDisagree(t)}}">I Do Not Agree</sl-button></sl-alert>`}_setAgree(t){const e=window._paq=window._paq||[];0!==e.length&&(e.push(["rememberConsentGiven"]),this.isOpen=!1,localStorage.setItem(`${this.siteId}-matomo-agree`,"true"),this.dispatchEvent(new Event("agree",{bubbles:!0,composed:!0})))}_setDisagree(t){const e=window._paq=window._paq||[];0!==e.length&&(e.push(["forgetConsentGiven"]),this.isOpen=!1,localStorage.setItem(`${this.siteId}-matomo-agree`,"false"),this.dispatchEvent(new Event("disagree",{bubbles:!0,composed:!0})))}connectedCallback(){if(super.connectedCallback(),!this.force&&window.location.hostname!==this.domain)return console.warn(`Matomo init failed. ${window.location.hostname} does not match ${this.domain}.`),void(this.isOpen=!1);const t=this.siteId;if(!this.force&&(0===t.length||0===this.domain.length))return console.warn("Matomo init failed. No site id or domains provided."),void(this.isOpen=!1);const e=localStorage.getItem(`${this.siteId}-matomo-agree`);if("false"===e)return void(this.isOpen=!1);"true"===e&&(this.isOpen=!1),console.log(`Setting Matomo tracking for site=${t} domain=${this.domain}`);const o=window._paq=window._paq||[];o.push(["requireConsent"]),o.push(["setDomains",[this.domain]]),o.push(["trackPageView"]),o.push(["enableLinkTracking"]),o.push(["trackVisibleContentImpressions"]),function(){const e="//matomo.hotosm.org/";o.push(["setTrackerUrl",e+"matomo.php"]),o.push(["setSiteId",t]);const i=document,r=i.createElement("script"),n=i.getElementsByTagName("script")[0];null!=n?.parentNode?(r.async=!0,r.src=e+"matomo.js",n.parentNode.insertBefore(r,n)):console.warn("Script insertion failed. Parent node is null.")}()}}yi.styles=[n`@unocss-placeholder;`,n`#tracking-header{font-weight:var(--sl-font-weight-bold);font-size:var(--sl-font-size-large);color:#d63f3f;text-align:center}sl-alert::part(base){position:absolute;bottom:20px;left:50%;transform:translateX(-50%);z-index:1000;width:80vw;text-align:center}`],vi([Mt()],yi.prototype,"name",void 0),vi([Mt({type:String,attribute:"site-id"})],yi.prototype,"siteId",void 0),vi([Mt({type:String})],yi.prototype,"domain",void 0),vi([Mt({type:Boolean})],yi.prototype,"force",void 0),vi([Bt()],yi.prototype,"isOpen",void 0),customElements.define("hot-tracking",yi);export{Ae as Button,De as Header,bi as Toolbar,yi as Tracking};
|