@kubex/zinc 1.1.181 → 1.1.182

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/dist/zn.min.js CHANGED
@@ -1,8 +1,8 @@
1
- import{a as bo,b as A8,c as Vr,d as c,e as W}from"./chunks/zn.UBLZO6CI.js";var Rf=bo((Wc,qf)=>{(function(o,i){typeof Wc=="object"&&typeof qf=="object"?qf.exports=i():typeof define=="function"&&define.amd?define([],i):typeof Wc=="object"?Wc.AirDatepicker=i():o.AirDatepicker=i()})(Wc,(function(){return(function(){"use strict";var o={d:function(H,x){for(var A in x)o.o(x,A)&&!o.o(H,A)&&Object.defineProperty(H,A,{enumerable:!0,get:x[A]})},o:function(H,x){return Object.prototype.hasOwnProperty.call(H,x)}},i={};o.d(i,{default:function(){return pe}});var t={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},r={classes:"",inline:!1,locale:{days:["\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435","\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041F\u044F\u0442\u043D\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043E\u0442\u0430"],daysShort:["\u0412\u043E\u0441","\u041F\u043E\u043D","\u0412\u0442\u043E","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041F\u044F\u0442","\u0421\u0443\u0431"],daysMin:["\u0412\u0441","\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431"],months:["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],monthsShort:["\u042F\u043D\u0432","\u0424\u0435\u0432","\u041C\u0430\u0440","\u0410\u043F\u0440","\u041C\u0430\u0439","\u0418\u044E\u043D","\u0418\u044E\u043B","\u0410\u0432\u0433","\u0421\u0435\u043D","\u041E\u043A\u0442","\u041D\u043E\u044F","\u0414\u0435\u043A"],today:"\u0421\u0435\u0433\u043E\u0434\u043D\u044F",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:t.days,minView:t.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function n(H){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;return typeof H=="string"?x.querySelector(H):H}function a(){let{tagName:H="div",className:x="",innerHtml:A="",id:w="",attrs:O={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=document.createElement(H);return x&&I.classList.add(...x.split(" ")),w&&(I.id=w),A&&(I.innerHTML=A),O&&s(I,O),I}function s(H,x){for(let[A,w]of Object.entries(x))w!==void 0&&H.setAttribute(A,w);return H}function l(H){return new Date(H.getFullYear(),H.getMonth()+1,0).getDate()}function d(H){let x=H.getHours(),{hours:A,dayPeriod:w}=h(x);return{year:H.getFullYear(),month:H.getMonth(),fullMonth:H.getMonth()+1<10?"0"+(H.getMonth()+1):H.getMonth()+1,date:H.getDate(),fullDate:H.getDate()<10?"0"+H.getDate():H.getDate(),day:H.getDay(),hours:x,fullHours:m(x),hours12:A,dayPeriod:w,fullHours12:m(A),minutes:H.getMinutes(),fullMinutes:H.getMinutes()<10?"0"+H.getMinutes():H.getMinutes()}}function h(H){return{dayPeriod:H>11?"pm":"am",hours:H%12==0?12:H%12}}function m(H){return H<10?"0"+H:H}function f(H){let x=10*Math.floor(H.getFullYear()/10);return[x,x+9]}function b(){let H=[];for(var x=arguments.length,A=new Array(x),w=0;w<x;w++)A[w]=arguments[w];return A.forEach((O=>{if(typeof O=="object")for(let I in O)O[I]&&H.push(I);else O&&H.push(O)})),H.join(" ")}function g(H,x){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.days;if(!H||!x)return!1;let w=d(H),O=d(x);return{[t.days]:w.date===O.date&&w.month===O.month&&w.year===O.year,[t.months]:w.month===O.month&&w.year===O.year,[t.years]:w.year===O.year}[A]}function v(H,x,A){let w=_(H,!1).getTime(),O=_(x,!1).getTime();return A?w>=O:w>O}function y(H,x){return!v(H,x,!0)}function _(H){let x=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=new Date(H.getTime());return typeof x!="boolean"||x||(function(w){w.setHours(0,0,0,0)})(A),A}function E(H,x,A){H.length?H.forEach((w=>{w.addEventListener(x,A)})):H.addEventListener(x,A)}function N(H,x){return!(!H||H===document||H instanceof DocumentFragment)&&(H.matches(x)?H:N(H.parentNode,x))}function G(H,x,A){return H>A?A:H<x?x:H}function R(H){for(var x=arguments.length,A=new Array(x>1?x-1:0),w=1;w<x;w++)A[w-1]=arguments[w];return A.filter((O=>O)).forEach((O=>{for(let[I,$]of Object.entries(O))if($!==void 0&&$.toString()==="[object Object]"){let B=H[I]!==void 0?H[I].toString():void 0,j=$.toString(),ee=Array.isArray($)?[]:{};H[I]=H[I]?B!==j?ee:H[I]:ee,R(H[I],$)}else H[I]=$})),H}function C(H){let x=H;return H instanceof Date||(typeof H=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(H)&&(H+="T00:00:00"),x=new Date(H)),isNaN(x.getTime())&&(console.log(`Unable to convert value "${H}" to Date object`),x=!1),x}function L(H){let x="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+x+")("+H+")($|<|"+x+")","g")}function M(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Y{constructor(){let{type:x,date:A,dp:w,opts:O,body:I}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,"focus",(()=>{this.$cell.classList.add("-focus-"),this.focused=!0})),M(this,"removeFocus",(()=>{this.$cell.classList.remove("-focus-"),this.focused=!1})),M(this,"select",(()=>{this.$cell.classList.add("-selected-"),this.selected=!0})),M(this,"removeSelect",(()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1})),M(this,"onChangeSelectedDate",(()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())})),M(this,"onChangeFocusDate",($=>{if(!$)return void(this.focused&&this.removeFocus());let B=g($,this.date,this.type);B?this.focus():!B&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()})),M(this,"render",(()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell))),this.type=x,this.singleType=this.type.slice(0,-1),this.date=A,this.dp=w,this.opts=O,this.body=I,this.customData=!1,this.init()}init(){var x,A;let{onRenderCell:w}=this.opts;w&&(this.customData=w({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),(x=this.customData)!==null&&x!==void 0&&x.disabled?this.dp.disableDate(this.date):((A=this.customData)===null||A===void 0?void 0:A.disabled)===!1&&this.dp.enableDate(this.date)}_bindDatepickerEvents(){this.dp.on(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(t.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(t.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var x;let{year:A,month:w,fullMonth:O,date:I,fullDate:$}=d(this.date),B=((x=this.customData)===null||x===void 0?void 0:x.attrs)||{};this.$cell=a({attrs:{"data-year":A,"data-month":w,"data-date":I,"data-iso-date":`${A}-${O}-${$}`,...B}}),this.$cell.adpCell=this}_getClassName(){var x;let A=new Date,{selectOtherMonths:w,selectOtherYears:O}=this.opts,{minDate:I,maxDate:$,isDateDisabled:B}=this.dp,{day:j}=d(this.date),ee=this._isOutOfMinMaxRange(),ne=B(this.date),ae=b("air-datepicker-cell",`-${this.singleType}-`,{"-current-":g(A,this.date,this.type),"-min-date-":I&&g(I,this.date,this.type),"-max-date-":$&&g($,this.date,this.type)}),de="";switch(this.type){case t.days:de=b({"-weekend-":this.dp.isWeekend(j),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!w||ee||ne});break;case t.months:de=b({"-disabled-":ee});break;case t.years:de=b({"-other-decade-":this.isOtherDecade,"-disabled-":ee||this.isOtherDecade&&!O})}return b(ae,de,(x=this.customData)===null||x===void 0?void 0:x.classes).split(" ")}_getHtml(){var x;let{year:A,month:w,date:O}=d(this.date),{showOtherMonths:I,showOtherYears:$}=this.opts;if((x=this.customData)!==null&&x!==void 0&&x.html)return this.customData.html;switch(this.type){case t.days:return!I&&this.isOtherMonth?"":O;case t.months:return this.dp.locale[this.opts.monthsField][w];case t.years:return!$&&this.isOtherDecade?"":A}}_isOutOfMinMaxRange(){let{minDate:x,maxDate:A}=this.dp,{type:w,date:O}=this,{month:I,year:$,date:B}=d(O),j=w===t.days,ee=w===t.years,ne=!!x&&new Date($,ee?x.getMonth():I,j?B:x.getDate()),ae=!!A&&new Date($,ee?A.getMonth():I,j?B:A.getDate());return x&&A?y(ne,x)||v(ae,A):x?y(ne,x):A?v(ae,A):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){let{selectedDates:x,focusDate:A,rangeDateTo:w,rangeDateFrom:O}=this.dp,I=x.length;if(this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),!I)return;let $=O,B=w;if(I===1&&A){let de=v(A,x[0]);$=de?x[0]:A,B=de?A:x[0]}let j=b({"-in-range-":$&&B&&(ee=this.date,ne=$,ae=B,v(ee,ne)&&y(ee,ae)),"-range-from-":$&&g(this.date,$,this.type),"-range-to-":B&&g(this.date,B,this.type)});var ee,ne,ae;j&&this.$cell.classList.add(...j.split(" "))}_handleSelectedStatus(){let x=this.dp._checkIfDateIsSelected(this.date,this.type);x?this.select():!x&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){g(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function ie(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}let ye={[t.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${t.days}-"></div>`,[t.months]:`<div class="air-datepicker-body--cells -${t.months}-"></div>`,[t.years]:`<div class="air-datepicker-body--cells -${t.years}-"></div>`},Ie=".air-datepicker-cell";class Ve{constructor(x){let{dp:A,type:w,opts:O}=x;ie(this,"handleClick",(I=>{let $=I.target.closest(Ie).adpCell;if($.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let B=this.dp._checkIfDateIsSelected($.date,$.type);B?this.dp._handleAlreadySelectedDates(B,$.date):this.dp.selectDate($.date)})),ie(this,"handleDayNameClick",(I=>{let $=I.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number($),datepicker:this.dp})})),ie(this,"onChangeCurrentView",(I=>{I!==this.type?this.hide():(this.show(),this.render())})),ie(this,"onMouseOverCell",(I=>{let $=N(I.target,Ie);this.dp.setFocusDate(!!$&&$.adpCell.date)})),ie(this,"onMouseOutCell",(()=>{this.dp.setFocusDate(!1)})),ie(this,"onClickBody",(I=>{let{onClickDayName:$}=this.opts,B=I.target;B.closest(Ie)&&this.handleClick(I),$&&B.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(I)})),ie(this,"onMouseDown",(I=>{this.pressed=!0;let $=N(I.target,Ie),B=$&&$.adpCell;g(B.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),g(B.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)})),ie(this,"onMouseMove",(I=>{if(!this.pressed||!this.dp.isMinViewReached)return;I.preventDefault();let $=N(I.target,Ie),B=$&&$.adpCell,{selectedDates:j,rangeDateTo:ee,rangeDateFrom:ne}=this.dp;if(!B||B.isDisabled)return;let{date:ae}=B;if(j.length===2){if(this.rangeFromFocused&&!v(ae,ee)){let{hours:de,minutes:Xe}=d(ne);ae.setHours(de),ae.setMinutes(Xe),this.dp.rangeDateFrom=ae,this.dp.replaceDate(ne,ae)}if(this.rangeToFocused&&!y(ae,ne)){let{hours:de,minutes:Xe}=d(ee);ae.setHours(de),ae.setMinutes(Xe),this.dp.rangeDateTo=ae,this.dp.replaceDate(ee,ae)}}})),ie(this,"onMouseUp",(()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1})),ie(this,"onChangeViewDate",((I,$)=>{if(!this.isVisible)return;let B=f(I),j=f($);switch(this.dp.currentView){case t.days:if(g(I,$,t.months))return;break;case t.months:if(g(I,$,t.years))return;break;case t.years:if(B[0]===j[0]&&B[1]===j[1])return}this.render()})),ie(this,"render",(()=>{this.destroyCells(),this._generateCells(),this.cells.forEach((I=>{this.$cells.appendChild(I.render())}))})),this.dp=A,this.type=w,this.opts=O,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===t.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:x,dynamicRange:A}=this.opts;E(this.$el,"mouseover",this.onMouseOverCell),E(this.$el,"mouseout",this.onMouseOutCell),E(this.$el,"click",this.onClickBody),x&&A&&(E(this.$el,"mousedown",this.onMouseDown),E(this.$el,"mousemove",this.onMouseMove),E(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(t.eventChangeViewDate,this.onChangeViewDate),this.dp.on(t.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=a({className:`air-datepicker-body -${this.type}-`,innerHtml:ye[this.type]}),this.$names=n(".air-datepicker-body--day-names",this.$el),this.$cells=n(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.dp.locale.firstDay,A="",w=this.dp.isWeekend,{onClickDayName:O}=this.opts,I=x,$=0;for(;$<7;){let B=I%7;A+=`<div class="${b("air-datepicker-body--day-name",{[t.cssClassWeekend]:w(B),"-clickable-":!!O})}" data-day-index='${B}'>${this.dp.locale.daysMin[B]}</div>`,$++,I++}return A}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(x){let{type:A,dp:w,opts:O}=this;return new Y({type:A,dp:w,opts:O,date:x,body:this})}_generateCells(){Ve.getDatesFunction(this.type)(this.dp,(x=>{this.cells.push(this._generateCell(x))}))}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach((x=>x.destroy())),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(t.eventChangeViewDate,this.onChangeViewDate),this.dp.off(t.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(x,A){let{viewDate:w,opts:{fixedHeight:O},locale:{firstDay:I}}=x,$=l(w),{year:B,month:j}=d(w),ee=new Date(B,j,1),ne=new Date(B,j,$),ae=ee.getDay()-I,de=6-ne.getDay()+I;ae=ae<0?ae+7:ae,de=de>6?de-7:de;let Xe=(function(si,Fa){let{year:go,month:Ms,date:uc}=d(si);return new Date(go,Ms,uc-Fa)})(ee,ae),Tr=$+ae+de,tr=Xe.getDate(),{year:Hi,month:jo}=d(Xe),Br=0;O&&(Tr=42);let ai=[];for(;Br<Tr;){let si=new Date(Hi,jo,tr+Br);A&&A(si),ai.push(si),Br++}return ai}static getMonthsDates(x,A){let{year:w}=x.parsedViewDate,O=0,I=[];for(;O<12;){let $=new Date(w,O);I.push($),A&&A($),O++}return I}static getYearsDates(x,A){let w=f(x.viewDate),O=w[0]-1,I=w[1]+1,$=O,B=[];for(;$<=I;){let j=new Date($,0);B.push(j),A&&A(j),$++}return B}static getDatesFunction(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.days;return{[t.days]:Ve.getDaysDates,[t.months]:Ve.getMonthsDates,[t.years]:Ve.getYearsDates}[x]}}function Ye(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Wt{constructor(x){let{dp:A,opts:w}=x;Ye(this,"onClickNav",(O=>{let I=N(O.target,".air-datepicker-nav--action");if(!I)return;let $=I.dataset.action;this.dp[$]()})),Ye(this,"onChangeViewDate",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),Ye(this,"onChangeCurrentView",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),Ye(this,"onClickNavTitle",(()=>{this.dp.isFinalView||this.dp.up()})),Ye(this,"update",(()=>{let{prevHtml:O,nextHtml:I}=this.opts;this.$prev.innerHTML=O,this.$next.innerHTML=I,this._resetNavStatus(),this.render(),this.handleNavStatus()})),Ye(this,"renderDelay",(()=>{setTimeout(this.render)})),Ye(this,"render",(()=>{this.$title.innerHTML=this._getTitle(),(function(O,I){for(let $ in I)I[$]?O.classList.add($):O.classList.remove($)})(this.$title,{"-disabled-":this.dp.isFinalView})})),this.dp=A,this.opts=w,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=n(".air-datepicker-nav--title",this.$el),this.$prev=n('[data-action="prev"]',this.$el),this.$next=n('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(t.eventChangeViewDate,this.onChangeViewDate),this.dp.on(t.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(t.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(t.eventChangeTime,this.render))}destroy(){this.dp.off(t.eventChangeViewDate,this.onChangeViewDate),this.dp.off(t.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(t.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(t.eventChangeTime,this.render))}_createElement(){this.$el=a({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:x,opts:A}=this,w=A.navTitles[x.currentView];return typeof w=="function"?w(x):x.formatDate(x.viewDate,w)}handleNavStatus(){let{disableNavWhenOutOfRange:x}=this.opts,{minDate:A,maxDate:w}=this.dp;if(!A&&!w||!x)return;let{year:O,month:I}=this.dp.parsedViewDate,$=!!A&&d(A),B=!!w&&d(w);switch(this.dp.currentView){case t.days:A&&$.month>=I&&$.year>=O&&this._disableNav("prev"),w&&B.month<=I&&B.year<=O&&this._disableNav("next");break;case t.months:A&&$.year>=O&&this._disableNav("prev"),w&&B.year<=O&&this._disableNav("next");break;case t.years:{let j=f(this.dp.viewDate);A&&$.year>=j[0]&&this._disableNav("prev"),w&&B.year<=j[1]&&this._disableNav("next");break}}}_disableNav(x){n('[data-action="'+x+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){(function(x){for(var A=arguments.length,w=new Array(A>1?A-1:0),O=1;O<A;O++)w[O-1]=arguments[O];x.length?x.forEach((I=>{I.classList.remove(...w)})):x.classList.remove(...w)})(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:x,nextHtml:A}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${x}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${A}</div>`}get isNavIsFunction(){let{navTitles:x}=this.opts;return Object.keys(x).find((A=>typeof x[A]=="function"))}}var Nt={today:{content:H=>H.locale.today,onClick:H=>H.setViewDate(new Date)},clear:{content:H=>H.locale.clear,onClick:H=>H.clear()}};class yr{constructor(x){let{dp:A,opts:w}=x;this.dp=A,this.opts=w,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=a({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:x}=this.opts;Array.isArray(x)||(x=[x]),x.forEach((A=>{let w=A;typeof A=="string"&&Nt[A]&&(w=Nt[A]);let O=this.createButton(w);w.onClick&&this.attachEventToButton(O,w.onClick),this.$el.appendChild(O)}))}attachEventToButton(x,A){x.addEventListener("click",(()=>{A(this.dp)}))}createButton(x){let{content:A,className:w,tagName:O="button",attrs:I={}}=x;return a({tagName:O,innerHtml:`<span tabindex='-1'>${typeof A=="function"?A(this.dp):A}</span>`,className:b("air-datepicker-button",w),attrs:I})}render(){this.generateButtons()}}function Pt(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class At{constructor(){let{opts:x,dp:A}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pt(this,"toggleTimepickerIsActive",(O=>{this.dp.timepickerIsActive=O})),Pt(this,"onChangeSelectedDate",(O=>{let{date:I,updateTime:$=!1}=O;I&&(this.setMinMaxTime(I),this.setCurrentTime(!!$&&I),this.addTimeToDate(I))})),Pt(this,"onChangeLastSelectedDate",(O=>{O&&(this.setTime(O),this.render())})),Pt(this,"onChangeInputRange",(O=>{let I=O.target;this[I.getAttribute("name")]=I.value,this.updateText(),this.dp.trigger(t.eventChangeTime,{hours:this.hours,minutes:this.minutes})})),Pt(this,"onMouseEnterLeave",(O=>{let I=O.target.getAttribute("name"),$=this.$minutesText;I==="hours"&&($=this.$hoursText),$.classList.toggle("-focus-")})),Pt(this,"onFocus",(()=>{this.toggleTimepickerIsActive(!0)})),Pt(this,"onBlur",(()=>{this.toggleTimepickerIsActive(!1)})),this.opts=x,this.dp=A;let{timeFormat:w}=this.dp.locale;w&&(w.match(L("h"))||w.match(L("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(t.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let x="input";navigator.userAgent.match(/trident/gi)&&(x="change"),E(this.$ranges,x,this.onChangeInputRange),E(this.$ranges,"mouseenter",this.onMouseEnterLeave),E(this.$ranges,"mouseleave",this.onMouseEnterLeave),E(this.$ranges,"focus",this.onFocus),E(this.$ranges,"mousedown",this.onFocus),E(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=a({className:b("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(t.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:x,hours:A,displayHours:w,minutes:O,minHours:I,minMinutes:$,maxHours:B,maxMinutes:j,dayPeriod:ee,opts:{hoursStep:ne,minutesStep:ae}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${m(w)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${m(O)}</span> `+(x?`<span class='air-datepicker-time--current-ampm'>${ee}</span>`:"")+`</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row"> <input type="range" name="hours" value="${A}" min="${I}" max="${B}" step="${ne}"/> </div> <div class="air-datepicker-time--row"> <input type="range" name="minutes" value="${O}" min="${$}" max="${j}" step="${ae}"/> </div></div>`}defineDOM(){let x=A=>n(A,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=x('[name="hours"]'),this.$minutes=x('[name="minutes"]'),this.$hoursText=x(".air-datepicker-time--current-hours"),this.$minutesText=x(".air-datepicker-time--current-minutes"),this.$ampm=x(".air-datepicker-time--current-ampm")}setTime(x){this.setMinMaxTime(x),this.setCurrentTime(x)}addTimeToDate(x){x&&(x.setHours(this.hours),x.setMinutes(this.minutes))}setMinMaxTime(x){if(this.setMinMaxTimeFromOptions(),x){let{minDate:A,maxDate:w}=this.dp;A&&g(x,A)&&this.setMinTimeFromMinDate(A),w&&g(x,w)&&this.setMaxTimeFromMaxDate(w)}}setCurrentTime(x){let{hours:A,minutes:w}=x?d(x):this;this.hours=G(A,this.minHours,this.maxHours),this.minutes=G(w,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:x,minMinutes:A,maxHours:w,maxMinutes:O}=this.opts;this.minHours=G(x,0,23),this.minMinutes=G(A,0,59),this.maxHours=G(w,0,23),this.maxMinutes=G(O,0,59)}setMinTimeFromMinDate(x){let{lastSelectedDate:A}=this.dp;this.minHours=x.getHours(),A&&A.getHours()>x.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=x.getMinutes()}setMaxTimeFromMaxDate(x){let{lastSelectedDate:A}=this.dp;this.maxHours=x.getHours(),A&&A.getHours()<x.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=x.getMinutes()}updateSliders(){s(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,s(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=m(this.displayHours),this.$minutesText.innerHTML=m(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(x){this._hours=x;let{hours:A,dayPeriod:w}=h(x);this.displayHours=this.ampm?A:x,this.dayPeriod=w}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function vt(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Cn{constructor(x){let{dp:A,opts:w}=x;vt(this,"pressedKeys",new Set),vt(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],O=>O.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],O=>O.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],O=>O.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],O=>O.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],O=>O.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],O=>O.year-=10],[["Control","Shift","ArrowUp"],(O,I)=>I.up()]])),vt(this,"handleHotKey",(O=>{let I=this.hotKeys.get(O),$=d(this.getInitialFocusDate());I($,this.dp);let{year:B,month:j,date:ee}=$,ne=l(new Date(B,j));ne<ee&&(ee=ne);let ae=this.dp.getClampedDate(new Date(B,j,ee));this.dp.setFocusDate(ae,{viewDateTransition:!0})})),vt(this,"isHotKeyPressed",(()=>{let O=!1,I=this.pressedKeys.size,$=B=>this.pressedKeys.has(B);for(let[B]of this.hotKeys){if(O)break;if(Array.isArray(B[0]))B.forEach((j=>{O||I!==j.length||(O=j.every($)&&B)}));else{if(I!==B.length)continue;O=B.every($)&&B}}return O})),vt(this,"isArrow",(O=>O>=37&&O<=40)),vt(this,"onKeyDown",(O=>{if(!this.dp.visible&&!this.dp.treatAsInline)return;let{key:I,which:$}=O,{dp:B,dp:{focusDate:j},opts:ee}=this;this.registerKey(I);let ne=this.isHotKeyPressed();if(ne)return O.preventDefault(),void this.handleHotKey(ne);if(this.isArrow($))return O.preventDefault(),void this.focusNextCell(I);if(I==="Enter"){if(B.currentView!==ee.minView)return void B.down();if(j){let ae=B._checkIfDateIsSelected(j);return void(ae?B._handleAlreadySelectedDates(ae,j):B.selectDate(j))}}I==="Escape"&&this.dp.hide()})),vt(this,"onKeyUp",(O=>{this.removeKey(O.key)})),this.dp=A,this.opts=w,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:x}=this.dp;x.addEventListener("keydown",this.onKeyDown),x.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:x}=this.dp;x.removeEventListener("keydown",this.onKeyDown),x.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:x,currentView:A,selectedDates:w,parsedViewDate:{year:O,month:I}}=this.dp,$=x||w[w.length-1];if(!$)switch(A){case t.days:$=new Date(O,I,new Date().getDate());break;case t.months:$=new Date(O,I,1);break;case t.years:$=new Date(O,0,1)}return $}focusNextCell(x){let A=this.getInitialFocusDate(),{currentView:w}=this.dp,{days:O,months:I,years:$}=t,B=d(A),j=B.year,ee=B.month,ne=B.date;switch(x){case"ArrowLeft":w===O&&(ne-=1),w===I&&(ee-=1),w===$&&(j-=1);break;case"ArrowUp":w===O&&(ne-=7),w===I&&(ee-=3),w===$&&(j-=4);break;case"ArrowRight":w===O&&(ne+=1),w===I&&(ee+=1),w===$&&(j+=1);break;case"ArrowDown":w===O&&(ne+=7),w===I&&(ee+=3),w===$&&(j+=4)}let ae=this.dp.getClampedDate(new Date(j,ee,ne));this.dp.setFocusDate(ae,{viewDateTransition:!0})}registerKey(x){this.pressedKeys.add(x)}removeKey(x){this.pressedKeys.delete(x)}}let Uo={on(H,x){this.__events||(this.__events={}),this.__events[H]?this.__events[H].push(x):this.__events[H]=[x]},off(H,x){this.__events&&this.__events[H]&&(this.__events[H]=this.__events[H].filter((A=>A!==x)))},removeAllEvents(){this.__events={}},trigger(H){for(var x=arguments.length,A=new Array(x>1?x-1:0),w=1;w<x;w++)A[w-1]=arguments[w];this.__events&&this.__events[H]&&this.__events[H].forEach((O=>{O(...A)}))}};function xe(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}let Pi="",Me="",ve=!1;class pe{static buildGlobalContainer(x){ve=!0,Pi=a({className:x,id:x}),n("body").appendChild(Pi)}constructor(x,A){var w=this;if(xe(this,"viewIndexes",[t.days,t.months,t.years]),xe(this,"next",(()=>{let{year:$,month:B}=this.parsedViewDate;switch(this.currentView){case t.days:this.setViewDate(new Date($,B+1,1));break;case t.months:this.setViewDate(new Date($+1,B,1));break;case t.years:this.setViewDate(new Date($+10,0,1))}})),xe(this,"prev",(()=>{let{year:$,month:B}=this.parsedViewDate;switch(this.currentView){case t.days:this.setViewDate(new Date($,B-1,1));break;case t.months:this.setViewDate(new Date($-1,B,1));break;case t.years:this.setViewDate(new Date($-10,0,1))}})),xe(this,"_finishHide",(()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)})),xe(this,"setPosition",(function($){let B=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof($=$||w.opts.position)=="function")return void(w.customHide=$({$datepicker:w.$datepicker,$target:w.$el,$pointer:w.$pointer,isViewChange:B,done:w._finishHide}));let j,ee,{isMobile:ne}=w.opts,ae=w.$el.getBoundingClientRect(),de=w.$el.getBoundingClientRect(),Xe=w.$datepicker.offsetParent,Tr=w.$el.offsetParent,tr=w.$datepicker.getBoundingClientRect(),Hi=$.split(" "),jo=window.scrollY,Br=window.scrollX,ai=w.opts.offset,si=Hi[0],Fa=Hi[1];if(ne)w.$datepicker.style.cssText="left: 50%; top: 50%";else{if(Xe===Tr&&Xe!==document.body&&(de={top:w.$el.offsetTop,left:w.$el.offsetLeft,width:ae.width,height:w.$el.offsetHeight},jo=0,Br=0),Xe!==Tr&&Xe!==document.body){let go=Xe.getBoundingClientRect();de={top:ae.top-go.top,left:ae.left-go.left,width:ae.width,height:ae.height},jo=0,Br=0}switch(si){case"top":j=de.top-tr.height-ai;break;case"right":ee=de.left+de.width+ai;break;case"bottom":j=de.top+de.height+ai;break;case"left":ee=de.left-tr.width-ai}switch(Fa){case"top":j=de.top;break;case"right":ee=de.left+de.width-tr.width;break;case"bottom":j=de.top+de.height-tr.height;break;case"left":ee=de.left;break;case"center":/left|right/.test(si)?j=de.top+de.height/2-tr.height/2:ee=de.left+de.width/2-tr.width/2}w.$datepicker.style.cssText=`left: ${ee+Br}px; top: ${j+jo}px`}})),xe(this,"_setInputValue",(()=>{let{opts:$,$altField:B,locale:{dateFormat:j}}=this,{altFieldDateFormat:ee,altField:ne}=$;ne&&B&&(B.value=this._getInputValue(ee)),this.$el.value=this._getInputValue(j),this.$el.dispatchEvent(new Event("change"))})),xe(this,"_getInputValue",($=>{let{selectedDates:B,opts:j}=this,{multipleDates:ee,multipleDatesSeparator:ne}=j;if(!B.length)return"";let ae=typeof $=="function",de=ae?$(ee?B:B[0]):B.map((Xe=>this.formatDate(Xe,$)));return de=ae?de:de.join(ne),de})),xe(this,"_checkIfDateIsSelected",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.days,j=!1;return w.selectedDates.some((ee=>{let ne=g($,ee,B);return j=ne&&ee,ne})),j})),xe(this,"_scheduleCallAfterTransition",($=>{this._cancelScheduledCall(),$&&$(!1),this._onTransitionEnd=()=>{$&&$(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})})),xe(this,"_cancelScheduledCall",(()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)})),xe(this,"setViewDate",($=>{if(!(($=C($))instanceof Date)||g($,this.viewDate))return;let B=this.viewDate;this.viewDate=$;let{onChangeViewDate:j}=this.opts;if(j){let{month:ee,year:ne}=this.parsedViewDate;j({month:ee,year:ne,decade:this.curDecade})}this.trigger(t.eventChangeViewDate,$,B)})),xe(this,"setFocusDate",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!$||($=C($))instanceof Date)&&(w.focusDate=$,w.trigger(t.eventChangeFocusDate,$,B))})),xe(this,"setCurrentView",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(w.viewIndexes.includes($)){if(w.currentView=$,w.elIsInput&&w.visible&&w.setPosition(void 0,!0),w.trigger(t.eventChangeCurrentView,$),!w.views[$]){let j=w.views[$]=new Ve({dp:w,opts:w.opts,type:$});w.shouldUpdateDOM&&w.$content.appendChild(j.$el)}w.opts.onChangeView&&!B.silent&&w.opts.onChangeView($)}})),xe(this,"_updateLastSelectedDate",($=>{this.lastSelectedDate=$,this.trigger(t.eventChangeLastSelectedDate,$)})),xe(this,"destroy",(()=>{if(this.isDestroyed)return;let{showEvent:$,isMobile:B}=this.opts,j=this.$datepicker.parentNode;j&&j.removeChild(this.$datepicker),this.$el.removeEventListener($,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),B&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0})),xe(this,"update",(function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=R({},w.opts),{silent:ee}=B;R(w.opts,$);let{timepicker:ne,buttons:ae,range:de,selectedDates:Xe,isMobile:Tr}=w.opts,tr=w.visible||w.treatAsInline;w._createMinMaxDates(),w._limitViewDateByMaxMinDates(),w._handleLocale(),Xe&&(w.selectedDates=[],w.selectDate(Xe,{silent:ee})),$.view&&w.setCurrentView($.view,{silent:ee}),w._setInputValue(),j.range&&!de?(w.rangeDateTo=!1,w.rangeDateFrom=!1):!j.range&&de&&w.selectedDates.length&&(w.rangeDateFrom=w.selectedDates[0],w.rangeDateTo=w.selectedDates[1]),j.timepicker&&!ne?(tr&&w.timepicker.destroy(),w.timepicker=!1,w.$timepicker.parentNode.removeChild(w.$timepicker)):!j.timepicker&&ne&&w._addTimepicker(),!j.buttons&&ae?w._addButtons():j.buttons&&!ae?(w.buttons.destroy(),w.$buttons.parentNode.removeChild(w.$buttons)):tr&&j.buttons&&ae&&w.buttons.clearHtml().render(),!j.isMobile&&Tr?(w.treatAsInline||Me||w._createMobileOverlay(),w._addMobileAttributes(),w.visible&&w._showMobileOverlay()):j.isMobile&&!Tr&&(w._removeMobileAttributes(),w.visible&&(Me.classList.remove("-active-"),typeof w.opts.position!="function"&&w.setPosition())),tr&&(w.nav.update(),w.views[w.currentView].render(),w.currentView===t.days&&w.views[w.currentView].renderDayNames())})),xe(this,"disableDate",(($,B)=>{(Array.isArray($)?$:[$]).forEach((j=>{let ee=C(j);if(!ee)return;let ne=B?"delete":"add";this.disabledDates[ne](this.formatDate(ee,"yyyy-MM-dd"));let ae=this.getCell(ee,this.currentViewSingular);ae&&ae.adpCell.render()}),[])})),xe(this,"enableDate",($=>{this.disableDate($,!0)})),xe(this,"isDateDisabled",($=>{let B=C($);return this.disabledDates.has(this.formatDate(B,"yyyy-MM-dd"))})),xe(this,"isOtherMonth",($=>{let{month:B}=d($);return B!==this.parsedViewDate.month})),xe(this,"isOtherYear",($=>{let{year:B}=d($);return B!==this.parsedViewDate.year})),xe(this,"isOtherDecade",($=>{let{year:B}=d($),[j,ee]=f(this.viewDate);return B<j||B>ee})),xe(this,"_onChangeSelectedDate",($=>{let{silent:B}=$;setTimeout((()=>{this._setInputValue(),this.opts.onSelect&&!B&&this._triggerOnSelect()}))})),xe(this,"_onChangeFocusedDate",(function($){let{viewDateTransition:B}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!$)return;let j=!1;B&&(j=w.isOtherMonth($)||w.isOtherYear($)||w.isOtherDecade($)),j&&w.setViewDate($),w.opts.onFocus&&w.opts.onFocus({datepicker:w,date:$})})),xe(this,"_onChangeTime",($=>{let{hours:B,minutes:j}=$,ee=new Date,{lastSelectedDate:ne,opts:{onSelect:ae}}=this,de=ne;ne||(de=ee);let Xe=this.getCell(de,this.currentViewSingular),Tr=Xe&&Xe.adpCell;Tr&&Tr.isDisabled||(de.setHours(B),de.setMinutes(j),ne?(this._setInputValue(),ae&&this._triggerOnSelect()):this.selectDate(de))})),xe(this,"_onFocus",($=>{this.visible||this.show()})),xe(this,"_onBlur",($=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()})),xe(this,"_onMouseDown",($=>{this.inFocus=!0})),xe(this,"_onMouseUp",($=>{this.inFocus=!1,this.$el.focus()})),xe(this,"_onResize",(()=>{this.visible&&typeof this.opts.position!="function"&&this.setPosition()})),xe(this,"_onClickOverlay",(()=>{this.visible&&this.hide()})),xe(this,"getViewDates",(function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.days;return Ve.getDatesFunction($)(w)})),xe(this,"isWeekend",($=>this.opts.weekends.includes($))),xe(this,"getClampedDate",($=>{let{minDate:B,maxDate:j}=this,ee=$;return j&&v($,j)?ee=j:B&&y($,B)&&(ee=B),ee})),this.$el=n(x),!this.$el)return;this.$datepicker=a({className:"air-datepicker"}),this.opts=R({},r,A),this.$customContainer=!!this.opts.container&&n(this.opts.container),this.$altField=n(this.opts.altField||!1);let{view:O,startDate:I}=this.opts;I||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=C(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=O,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:x,treatAsInline:A,opts:{inline:w,isMobile:O,selectedDates:I,keyboardNav:$,onlyTimepicker:B}}=this,j=n("body");(!ve||ve&&Pi&&!j.contains(Pi))&&!w&&this.elIsInput&&!this.$customContainer&&pe.buildGlobalContainer(pe.defaultGlobalContainerId),!O||Me||A||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(w||this._bindEvents(),$&&!B&&(this.keyboardNav=new Cn({dp:this,opts:x}))),I&&this.selectDate(I,{silent:!0}),this.opts.visible&&!A&&this.show(),O&&!A&&this.$el.setAttribute("readonly",!0),A&&this._createComponents()}_createMobileOverlay(){Me=a({className:"air-datepicker-overlay"}),Pi.appendChild(Me)}_createComponents(){let{opts:x,treatAsInline:A,opts:{inline:w,buttons:O,timepicker:I,position:$,classes:B,onlyTimepicker:j,isMobile:ee}}=this;this._buildBaseHtml(),this.elIsInput&&(w||this._setPositionClasses($)),!w&&this.elIsInput||this.$datepicker.classList.add("-inline-"),B&&this.$datepicker.classList.add(...B.split(" ")),j&&this.$datepicker.classList.add("-only-timepicker-"),ee&&!A&&this._addMobileAttributes(),this.views[this.currentView]=new Ve({dp:this,type:this.currentView,opts:x}),this.nav=new Wt({dp:this,opts:x}),I&&this._addTimepicker(),O&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let x in this.views)this.views[x].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){Me.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){Me.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||this.initialReadonly===""||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:x,maxDate:A}=this.opts;this.minDate=!!x&&C(x),this.maxDate=!!A&&C(A)}_addTimepicker(){this.$timepicker=a({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new At({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=a({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new yr({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(t.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(t.eventChangeFocusDate,this._onChangeFocusedDate),this.on(t.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:x}=this.opts;var A,w;this.elIsInput?x?(A=this.$datepicker,(w=this.$el).parentNode.insertBefore(A,w.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=n(".air-datepicker--content",this.$datepicker),this.$pointer=n(".air-datepicker--pointer",this.$datepicker),this.$nav=n(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:x,dateFormat:A,firstDay:w,timepicker:O,onlyTimepicker:I,timeFormat:$,dateTimeSeparator:B}=this.opts;var j;this.locale=(j=x,JSON.parse(JSON.stringify(j))),A&&(this.locale.dateFormat=A),$!==void 0&&$!==""&&(this.locale.timeFormat=$);let{timeFormat:ee}=this.locale;if(w!==""&&(this.locale.firstDay=w),O&&typeof A!="function"){let ne=ee?B:"";this.locale.dateFormat=[this.locale.dateFormat,ee||""].join(ne)}I&&typeof A!="function"&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(x){if(typeof x=="function")return void this.$datepicker.classList.add("-custom-position-");let A=(x=x.split(" "))[0],w=`air-datepicker -${A}-${x[1]}- -from-${A}-`;this.$datepicker.classList.add(...w.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:x,minDate:A,maxDate:w}=this;w&&v(x,w)&&this.setViewDate(w),A&&y(x,A)&&this.setViewDate(A)}formatDate(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.viewDate,A=arguments.length>1?arguments[1]:void 0;if(x=C(x),!(x instanceof Date))return;let w=A,O=this.locale,I=d(x),$=I.dayPeriod,B=f(x),j=pe.replacer,ee={T:x.getTime(),m:I.minutes,mm:I.fullMinutes,h:I.hours12,hh:I.fullHours12,H:I.hours,HH:I.fullHours,aa:$,AA:$.toUpperCase(),E:O.daysShort[I.day],EEEE:O.days[I.day],d:I.date,dd:I.fullDate,M:I.month+1,MM:I.fullMonth,MMM:O.monthsShort[I.month],MMMM:O.months[I.month],yy:I.year.toString().slice(-2),yyyy:I.year,yyyy1:B[0],yyyy2:B[1]};for(let[ne,ae]of Object.entries(ee))w=j(w,L(ne),ae);return w}down(x){this._handleUpDownActions(x,"down")}up(x){this._handleUpDownActions(x,"up")}selectDate(x){let A,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{currentView:O,parsedViewDate:I,selectedDates:$}=this,{updateTime:B,silent:j}=w,{moveToOtherMonthsOnSelect:ee,moveToOtherYearsOnSelect:ne,multipleDates:ae,range:de,autoClose:Xe,onBeforeSelect:Tr}=this.opts,tr=$.length;if(Array.isArray(x))return x.forEach((Hi=>{this.selectDate(Hi,w)})),new Promise((Hi=>{setTimeout(Hi)}));if((x=C(x))instanceof Date){if(Tr&&!j&&!Tr({date:x,datepicker:this}))return Promise.resolve();if(O===t.days&&x.getMonth()!==I.month&&ee&&(A=new Date(x.getFullYear(),x.getMonth(),1)),O===t.years&&x.getFullYear()!==I.year&&ne&&(A=new Date(x.getFullYear(),0,1)),A&&this.setViewDate(A),ae&&!de){if(tr===ae)return;this._checkIfDateIsSelected(x)||$.push(x)}else if(de)switch(tr){case 1:$.push(x),this.rangeDateTo||(this.rangeDateTo=x),v(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=x),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[x],this.rangeDateFrom=x,this.rangeDateTo="";break;default:this.selectedDates=[x],this.rangeDateFrom=x}else this.selectedDates=[x];return this.trigger(t.eventChangeSelectedDate,{action:t.actionSelectDate,silent:w?.silent,date:x,updateTime:B}),this._updateLastSelectedDate(x),Xe&&!this.timepickerIsActive&&this.visible&&(ae||de?de&&tr===1&&this.hide():this.hide()),new Promise((Hi=>{setTimeout(Hi)}))}}unselectDate(x){let A=this.selectedDates,w=this;if((x=C(x))instanceof Date)return A.some(((O,I)=>{if(g(O,x))return A.splice(I,1),w.selectedDates.length?(w.rangeDateTo="",w.rangeDateFrom=A[0],w._updateLastSelectedDate(w.selectedDates[w.selectedDates.length-1])):(w.rangeDateFrom="",w.rangeDateTo="",w._updateLastSelectedDate(!1)),this.trigger(t.eventChangeSelectedDate,{action:t.actionUnselectDate,date:x}),!0}))}replaceDate(x,A){let w=this.selectedDates.find((I=>g(I,x,this.currentView))),O=this.selectedDates.indexOf(w);O<0||g(this.selectedDates[O],A,this.currentView)||(this.selectedDates[O]=A,this.trigger(t.eventChangeSelectedDate,{action:t.actionSelectDate,date:A,updateTime:!0}),this._updateLastSelectedDate(A))}clear(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(t.eventChangeSelectedDate,{action:t.actionUnselectDate,silent:x.silent}),new Promise((A=>{setTimeout(A)}))}show(){let{onShow:x,isMobile:A}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,x&&this._scheduleCallAfterTransition(x),A&&this._showMobileOverlay()}hide(){let{onHide:x,isMobile:A}=this.opts,w=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition((O=>{!this.customHide&&(O&&w||!O&&!w)&&this._finishHide(),x&&x(O)})),A&&Me.classList.remove("-active-")}_triggerOnSelect(){let x=[],A=[],{selectedDates:w,locale:O,opts:{onSelect:I,multipleDates:$,range:B}}=this,j=$||B,ee=typeof O.dateFormat=="function";w.length&&(x=w.map(_),A=ee?$?O.dateFormat(x):x.map((ne=>O.dateFormat(ne))):x.map((ne=>this.formatDate(ne,O.dateFormat)))),I({date:j?x:x[0],formattedDate:j?A:A[0],datepicker:this})}_handleAlreadySelectedDates(x,A){let{selectedDates:w,rangeDateFrom:O,rangeDateTo:I}=this,{range:$,toggleSelected:B}=this.opts,j=w.length,ee=typeof B=="function"?B({datepicker:this,date:A}):B,ne=!!($&&j===1&&x),ae=ne?_(A):A;$&&!ee&&(j!==2&&this.selectDate(ae),j===2&&g(O,I))||(ee?this.unselectDate(ae):this._updateLastSelectedDate(ne?ae:x))}_handleUpDownActions(x,A){if(!((x=C(x||this.focusDate||this.viewDate))instanceof Date))return;let w=A==="up"?this.viewIndex+1:this.viewIndex-1;w>2&&(w=2),w<0&&(w=0),this.setViewDate(new Date(x.getFullYear(),x.getMonth(),1)),this.setCurrentView(this.viewIndexes[w])}getCell(x){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.day;if(!((x=C(x))instanceof Date))return;let{year:w,month:O,date:I}=d(x),$=`[data-year="${w}"]`,B=`[data-month="${O}"]`,j={[t.day]:`${$}${B}[data-date="${I}"]`,[t.month]:`${$}${B}`,[t.year]:`${$}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(j[A]):void 0}_showMobileOverlay(){Me.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce(((x,A)=>parseFloat(A)+x),0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return d(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return f(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===t.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===t.days}get $container(){return this.$customContainer||Pi}static replacer(x,A,w){return x.replace(A,(function(O,I,$,B){return I+w+B}))}}var Te;return xe(pe,"defaults",r),xe(pe,"version","3.6.0"),xe(pe,"defaultGlobalContainerId","air-datepicker-global-container"),Te=pe.prototype,Object.assign(Te,Uo),i.default})()}))});var $w=bo((zle,Tw)=>{var Yi=-1,di=1,fr=0;function Qc(o,i,t,r,n){if(o===i)return o?[[fr,o]]:[];if(t!=null){var a=_E(o,i,t);if(a)return a}var s=Zf(o,i),l=o.substring(0,s);o=o.substring(s),i=i.substring(s),s=_h(o,i);var d=o.substring(o.length-s);o=o.substring(0,o.length-s),i=i.substring(0,i.length-s);var h=mE(o,i);return l&&h.unshift([fr,l]),d&&h.push([fr,d]),eg(h,n),r&&bE(h),h}function mE(o,i){var t;if(!o)return[[di,i]];if(!i)return[[Yi,o]];var r=o.length>i.length?o:i,n=o.length>i.length?i:o,a=r.indexOf(n);if(a!==-1)return t=[[di,r.substring(0,a)],[fr,n],[di,r.substring(a+n.length)]],o.length>i.length&&(t[0][0]=t[2][0]=Yi),t;if(n.length===1)return[[Yi,o],[di,i]];var s=gE(o,i);if(s){var l=s[0],d=s[1],h=s[2],m=s[3],f=s[4],b=Qc(l,h),g=Qc(d,m);return b.concat([[fr,f]],g)}return fE(o,i)}function fE(o,i){for(var t=o.length,r=i.length,n=Math.ceil((t+r)/2),a=n,s=2*n,l=new Array(s),d=new Array(s),h=0;h<s;h++)l[h]=-1,d[h]=-1;l[a+1]=0,d[a+1]=0;for(var m=t-r,f=m%2!==0,b=0,g=0,v=0,y=0,_=0;_<n;_++){for(var E=-_+b;E<=_-g;E+=2){var N=a+E,G;E===-_||E!==_&&l[N-1]<l[N+1]?G=l[N+1]:G=l[N-1]+1;for(var R=G-E;G<t&&R<r&&o.charAt(G)===i.charAt(R);)G++,R++;if(l[N]=G,G>t)g+=2;else if(R>r)b+=2;else if(f){var C=a+m-E;if(C>=0&&C<s&&d[C]!==-1){var L=t-d[C];if(G>=L)return yw(o,i,G,R)}}}for(var M=-_+v;M<=_-y;M+=2){var C=a+M,L;M===-_||M!==_&&d[C-1]<d[C+1]?L=d[C+1]:L=d[C-1]+1;for(var Y=L-M;L<t&&Y<r&&o.charAt(t-L-1)===i.charAt(r-Y-1);)L++,Y++;if(d[C]=L,L>t)y+=2;else if(Y>r)v+=2;else if(!f){var N=a+m-M;if(N>=0&&N<s&&l[N]!==-1){var G=l[N],R=a+G-N;if(L=t-L,G>=L)return yw(o,i,G,R)}}}}return[[Yi,o],[di,i]]}function yw(o,i,t,r){var n=o.substring(0,t),a=i.substring(0,r),s=o.substring(t),l=i.substring(r),d=Qc(n,a),h=Qc(s,l);return d.concat(h)}function Zf(o,i){if(!o||!i||o.charAt(0)!==i.charAt(0))return 0;for(var t=0,r=Math.min(o.length,i.length),n=r,a=0;t<n;)o.substring(a,n)==i.substring(a,n)?(t=n,a=t):r=n,n=Math.floor((r-t)/2+t);return kw(o.charCodeAt(n-1))&&n--,n}function xw(o,i){var t=o.length,r=i.length;if(t==0||r==0)return 0;t>r?o=o.substring(t-r):t<r&&(i=i.substring(0,t));var n=Math.min(t,r);if(o==i)return n;for(var a=0,s=1;;){var l=o.substring(n-s),d=i.indexOf(l);if(d==-1)return a;s+=d,(d==0||o.substring(n-s)==i.substring(0,s))&&(a=s,s++)}}function _h(o,i){if(!o||!i||o.slice(-1)!==i.slice(-1))return 0;for(var t=0,r=Math.min(o.length,i.length),n=r,a=0;t<n;)o.substring(o.length-n,o.length-a)==i.substring(i.length-n,i.length-a)?(t=n,a=t):r=n,n=Math.floor((r-t)/2+t);return Sw(o.charCodeAt(o.length-n))&&n--,n}function gE(o,i){var t=o.length>i.length?o:i,r=o.length>i.length?i:o;if(t.length<4||r.length*2<t.length)return null;function n(g,v,y){for(var _=g.substring(y,y+Math.floor(g.length/4)),E=-1,N="",G,R,C,L;(E=v.indexOf(_,E+1))!==-1;){var M=Zf(g.substring(y),v.substring(E)),Y=_h(g.substring(0,y),v.substring(0,E));N.length<Y+M&&(N=v.substring(E-Y,E)+v.substring(E,E+M),G=g.substring(0,y-Y),R=g.substring(y+M),C=v.substring(0,E-Y),L=v.substring(E+M))}return N.length*2>=g.length?[G,R,C,L,N]:null}var a=n(t,r,Math.ceil(t.length/4)),s=n(t,r,Math.ceil(t.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var d,h,m,f;o.length>i.length?(d=l[0],h=l[1],m=l[2],f=l[3]):(m=l[0],f=l[1],d=l[2],h=l[3]);var b=l[4];return[d,h,m,f,b]}function bE(o){for(var i=!1,t=[],r=0,n=null,a=0,s=0,l=0,d=0,h=0;a<o.length;)o[a][0]==fr?(t[r++]=a,s=d,l=h,d=0,h=0,n=o[a][1]):(o[a][0]==di?d+=o[a][1].length:h+=o[a][1].length,n&&n.length<=Math.max(s,l)&&n.length<=Math.max(d,h)&&(o.splice(t[r-1],0,[Yi,n]),o[t[r-1]+1][0]=di,r--,r--,a=r>0?t[r-1]:-1,s=0,l=0,d=0,h=0,n=null,i=!0)),a++;for(i&&eg(o),xE(o),a=1;a<o.length;){if(o[a-1][0]==Yi&&o[a][0]==di){var m=o[a-1][1],f=o[a][1],b=xw(m,f),g=xw(f,m);b>=g?(b>=m.length/2||b>=f.length/2)&&(o.splice(a,0,[fr,f.substring(0,b)]),o[a-1][1]=m.substring(0,m.length-b),o[a+1][1]=f.substring(b),a++):(g>=m.length/2||g>=f.length/2)&&(o.splice(a,0,[fr,m.substring(0,g)]),o[a-1][0]=di,o[a-1][1]=f.substring(0,f.length-g),o[a+1][0]=Yi,o[a+1][1]=m.substring(g),a++),a++}a++}}var ww=/[^a-zA-Z0-9]/,_w=/\s/,zw=/[\r\n]/,vE=/\n\r?\n$/,yE=/^\r?\n\r?\n/;function xE(o){function i(g,v){if(!g||!v)return 6;var y=g.charAt(g.length-1),_=v.charAt(0),E=y.match(ww),N=_.match(ww),G=E&&y.match(_w),R=N&&_.match(_w),C=G&&y.match(zw),L=R&&_.match(zw),M=C&&g.match(vE),Y=L&&v.match(yE);return M||Y?5:C||L?4:E&&!G&&R?3:G||R?2:E||N?1:0}for(var t=1;t<o.length-1;){if(o[t-1][0]==fr&&o[t+1][0]==fr){var r=o[t-1][1],n=o[t][1],a=o[t+1][1],s=_h(r,n);if(s){var l=n.substring(n.length-s);r=r.substring(0,r.length-s),n=l+n.substring(0,n.length-s),a=l+a}for(var d=r,h=n,m=a,f=i(r,n)+i(n,a);n.charAt(0)===a.charAt(0);){r+=n.charAt(0),n=n.substring(1)+a.charAt(0),a=a.substring(1);var b=i(r,n)+i(n,a);b>=f&&(f=b,d=r,h=n,m=a)}o[t-1][1]!=d&&(d?o[t-1][1]=d:(o.splice(t-1,1),t--),o[t][1]=h,m?o[t+1][1]=m:(o.splice(t+1,1),t--))}t++}}function eg(o,i){o.push([fr,""]);for(var t=0,r=0,n=0,a="",s="",l;t<o.length;){if(t<o.length-1&&!o[t][1]){o.splice(t,1);continue}switch(o[t][0]){case di:n++,s+=o[t][1],t++;break;case Yi:r++,a+=o[t][1],t++;break;case fr:var d=t-n-r-1;if(i){if(d>=0&&Ew(o[d][1])){var h=o[d][1].slice(-1);if(o[d][1]=o[d][1].slice(0,-1),a=h+a,s=h+s,!o[d][1]){o.splice(d,1),t--;var m=d-1;o[m]&&o[m][0]===di&&(n++,s=o[m][1]+s,m--),o[m]&&o[m][0]===Yi&&(r++,a=o[m][1]+a,m--),d=m}}if(Cw(o[t][1])){var h=o[t][1].charAt(0);o[t][1]=o[t][1].slice(1),a+=h,s+=h}}if(t<o.length-1&&!o[t][1]){o.splice(t,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=Zf(s,a),l!==0&&(d>=0?o[d][1]+=s.substring(0,l):(o.splice(0,0,[fr,s.substring(0,l)]),t++),s=s.substring(l),a=a.substring(l)),l=_h(s,a),l!==0&&(o[t][1]=s.substring(s.length-l)+o[t][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=n+r;a.length===0&&s.length===0?(o.splice(t-f,f),t=t-f):a.length===0?(o.splice(t-f,f,[di,s]),t=t-f+1):s.length===0?(o.splice(t-f,f,[Yi,a]),t=t-f+1):(o.splice(t-f,f,[Yi,a],[di,s]),t=t-f+2)}t!==0&&o[t-1][0]===fr?(o[t-1][1]+=o[t][1],o.splice(t,1)):t++,n=0,r=0,a="",s="";break}}o[o.length-1][1]===""&&o.pop();var b=!1;for(t=1;t<o.length-1;)o[t-1][0]===fr&&o[t+1][0]===fr&&(o[t][1].substring(o[t][1].length-o[t-1][1].length)===o[t-1][1]?(o[t][1]=o[t-1][1]+o[t][1].substring(0,o[t][1].length-o[t-1][1].length),o[t+1][1]=o[t-1][1]+o[t+1][1],o.splice(t-1,1),b=!0):o[t][1].substring(0,o[t+1][1].length)==o[t+1][1]&&(o[t-1][1]+=o[t+1][1],o[t][1]=o[t][1].substring(o[t+1][1].length)+o[t+1][1],o.splice(t+1,1),b=!0)),t++;b&&eg(o,i)}function kw(o){return o>=55296&&o<=56319}function Sw(o){return o>=56320&&o<=57343}function Cw(o){return Sw(o.charCodeAt(0))}function Ew(o){return kw(o.charCodeAt(o.length-1))}function wE(o){for(var i=[],t=0;t<o.length;t++)o[t][1].length>0&&i.push(o[t]);return i}function Jf(o,i,t,r){return Ew(o)||Cw(r)?null:wE([[fr,o],[Yi,i],[di,t],[fr,r]])}function _E(o,i,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,n=typeof t=="number"?null:t.newRange,a=o.length,s=i.length;if(r.length===0&&(n===null||n.length===0)){var l=r.index,d=o.slice(0,l),h=o.slice(l),m=n?n.index:null;e:{var f=l+s-a;if(m!==null&&m!==f||f<0||f>s)break e;var b=i.slice(0,f),g=i.slice(f);if(g!==h)break e;var v=Math.min(l,f),y=d.slice(0,v),_=b.slice(0,v);if(y!==_)break e;var E=d.slice(v),N=b.slice(v);return Jf(y,E,N,h)}e:{if(m!==null&&m!==l)break e;var G=l,b=i.slice(0,G),g=i.slice(G);if(b!==d)break e;var R=Math.min(a-G,s-G),C=h.slice(h.length-R),L=g.slice(g.length-R);if(C!==L)break e;var E=h.slice(0,h.length-R),N=g.slice(0,g.length-R);return Jf(d,E,N,C)}}if(r.length>0&&n&&n.length===0)e:{var y=o.slice(0,r.index),C=o.slice(r.index+r.length),v=y.length,R=C.length;if(s<v+R)break e;var _=i.slice(0,v),L=i.slice(s-R);if(y!==_||C!==L)break e;var E=o.slice(v,a-R),N=i.slice(v,s-R);return Jf(y,E,N,C)}return null}function zh(o,i,t,r){return Qc(o,i,t,r,!0)}zh.INSERT=di;zh.DELETE=Yi;zh.EQUAL=fr;Tw.exports=zh});var fg=bo((Jc,gl)=>{var zE=200,Fw="__lodash_hash_undefined__",Bw=9007199254740991,lg="[object Arguments]",kE="[object Array]",Vw="[object Boolean]",Uw="[object Date]",SE="[object Error]",cg="[object Function]",jw="[object GeneratorFunction]",kh="[object Map]",Gw="[object Number]",dg="[object Object]",Aw="[object Promise]",Ww="[object RegExp]",Sh="[object Set]",Kw="[object String]",Yw="[object Symbol]",rg="[object WeakMap]",Xw="[object ArrayBuffer]",Ch="[object DataView]",Qw="[object Float32Array]",Jw="[object Float64Array]",Zw="[object Int8Array]",e_="[object Int16Array]",t_="[object Int32Array]",r_="[object Uint8Array]",i_="[object Uint8ClampedArray]",n_="[object Uint16Array]",o_="[object Uint32Array]",CE=/[\\^$.*+?()[\]{}|]/g,EE=/\w*$/,TE=/^\[object .+?Constructor\]$/,$E=/^(?:0|[1-9]\d*)$/,gt={};gt[lg]=gt[kE]=gt[Xw]=gt[Ch]=gt[Vw]=gt[Uw]=gt[Qw]=gt[Jw]=gt[Zw]=gt[e_]=gt[t_]=gt[kh]=gt[Gw]=gt[dg]=gt[Ww]=gt[Sh]=gt[Kw]=gt[Yw]=gt[r_]=gt[i_]=gt[n_]=gt[o_]=!0;gt[SE]=gt[cg]=gt[rg]=!1;var AE=typeof global=="object"&&global&&global.Object===Object&&global,LE=typeof self=="object"&&self&&self.Object===Object&&self,So=AE||LE||Function("return this")(),a_=typeof Jc=="object"&&Jc&&!Jc.nodeType&&Jc,Lw=a_&&typeof gl=="object"&&gl&&!gl.nodeType&&gl,ME=Lw&&Lw.exports===a_;function IE(o,i){return o.set(i[0],i[1]),o}function qE(o,i){return o.add(i),o}function RE(o,i){for(var t=-1,r=o?o.length:0;++t<r&&i(o[t],t,o)!==!1;);return o}function DE(o,i){for(var t=-1,r=i.length,n=o.length;++t<r;)o[n+t]=i[t];return o}function s_(o,i,t,r){var n=-1,a=o?o.length:0;for(r&&a&&(t=o[++n]);++n<a;)t=i(t,o[n],n,o);return t}function OE(o,i){for(var t=-1,r=Array(o);++t<o;)r[t]=i(t);return r}function NE(o,i){return o?.[i]}function l_(o){var i=!1;if(o!=null&&typeof o.toString!="function")try{i=!!(o+"")}catch{}return i}function Mw(o){var i=-1,t=Array(o.size);return o.forEach(function(r,n){t[++i]=[n,r]}),t}function pg(o,i){return function(t){return o(i(t))}}function Iw(o){var i=-1,t=Array(o.size);return o.forEach(function(r){t[++i]=r}),t}var PE=Array.prototype,HE=Function.prototype,Eh=Object.prototype,tg=So["__core-js_shared__"],qw=(function(){var o=/[^.]+$/.exec(tg&&tg.keys&&tg.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),c_=HE.toString,da=Eh.hasOwnProperty,Th=Eh.toString,FE=RegExp("^"+c_.call(da).replace(CE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rw=ME?So.Buffer:void 0,Dw=So.Symbol,Ow=So.Uint8Array,BE=pg(Object.getPrototypeOf,Object),VE=Object.create,UE=Eh.propertyIsEnumerable,jE=PE.splice,Nw=Object.getOwnPropertySymbols,GE=Rw?Rw.isBuffer:void 0,WE=pg(Object.keys,Object),ig=yl(So,"DataView"),Zc=yl(So,"Map"),ng=yl(So,"Promise"),og=yl(So,"Set"),ag=yl(So,"WeakMap"),ed=yl(Object,"create"),KE=ps(ig),YE=ps(Zc),XE=ps(ng),QE=ps(og),JE=ps(ag),Pw=Dw?Dw.prototype:void 0,Hw=Pw?Pw.valueOf:void 0;function ds(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function ZE(){this.__data__=ed?ed(null):{}}function e6(o){return this.has(o)&&delete this.__data__[o]}function t6(o){var i=this.__data__;if(ed){var t=i[o];return t===Fw?void 0:t}return da.call(i,o)?i[o]:void 0}function r6(o){var i=this.__data__;return ed?i[o]!==void 0:da.call(i,o)}function i6(o,i){var t=this.__data__;return t[o]=ed&&i===void 0?Fw:i,this}ds.prototype.clear=ZE;ds.prototype.delete=e6;ds.prototype.get=t6;ds.prototype.has=r6;ds.prototype.set=i6;function Co(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function n6(){this.__data__=[]}function o6(o){var i=this.__data__,t=$h(i,o);if(t<0)return!1;var r=i.length-1;return t==r?i.pop():jE.call(i,t,1),!0}function a6(o){var i=this.__data__,t=$h(i,o);return t<0?void 0:i[t][1]}function s6(o){return $h(this.__data__,o)>-1}function l6(o,i){var t=this.__data__,r=$h(t,o);return r<0?t.push([o,i]):t[r][1]=i,this}Co.prototype.clear=n6;Co.prototype.delete=o6;Co.prototype.get=a6;Co.prototype.has=s6;Co.prototype.set=l6;function bl(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function c6(){this.__data__={hash:new ds,map:new(Zc||Co),string:new ds}}function d6(o){return Ah(this,o).delete(o)}function p6(o){return Ah(this,o).get(o)}function h6(o){return Ah(this,o).has(o)}function u6(o,i){return Ah(this,o).set(o,i),this}bl.prototype.clear=c6;bl.prototype.delete=d6;bl.prototype.get=p6;bl.prototype.has=h6;bl.prototype.set=u6;function vl(o){this.__data__=new Co(o)}function m6(){this.__data__=new Co}function f6(o){return this.__data__.delete(o)}function g6(o){return this.__data__.get(o)}function b6(o){return this.__data__.has(o)}function v6(o,i){var t=this.__data__;if(t instanceof Co){var r=t.__data__;if(!Zc||r.length<zE-1)return r.push([o,i]),this;t=this.__data__=new bl(r)}return t.set(o,i),this}vl.prototype.clear=m6;vl.prototype.delete=f6;vl.prototype.get=g6;vl.prototype.has=b6;vl.prototype.set=v6;function y6(o,i){var t=ug(o)||V6(o)?OE(o.length,String):[],r=t.length,n=!!r;for(var a in o)(i||da.call(o,a))&&!(n&&(a=="length"||P6(a,r)))&&t.push(a);return t}function d_(o,i,t){var r=o[i];(!(da.call(o,i)&&m_(r,t))||t===void 0&&!(i in o))&&(o[i]=t)}function $h(o,i){for(var t=o.length;t--;)if(m_(o[t][0],i))return t;return-1}function x6(o,i){return o&&p_(i,mg(i),o)}function sg(o,i,t,r,n,a,s){var l;if(r&&(l=a?r(o,n,a,s):r(o)),l!==void 0)return l;if(!Lh(o))return o;var d=ug(o);if(d){if(l=D6(o),!i)return I6(o,l)}else{var h=cs(o),m=h==cg||h==jw;if(j6(o))return C6(o,i);if(h==dg||h==lg||m&&!a){if(l_(o))return a?o:{};if(l=O6(m?{}:o),!i)return q6(o,x6(l,o))}else{if(!gt[h])return a?o:{};l=N6(o,h,sg,i)}}s||(s=new vl);var f=s.get(o);if(f)return f;if(s.set(o,l),!d)var b=t?R6(o):mg(o);return RE(b||o,function(g,v){b&&(v=g,g=o[v]),d_(l,v,sg(g,i,t,r,v,o,s))}),l}function w6(o){return Lh(o)?VE(o):{}}function _6(o,i,t){var r=i(o);return ug(o)?r:DE(r,t(o))}function z6(o){return Th.call(o)}function k6(o){if(!Lh(o)||F6(o))return!1;var i=g_(o)||l_(o)?FE:TE;return i.test(ps(o))}function S6(o){if(!u_(o))return WE(o);var i=[];for(var t in Object(o))da.call(o,t)&&t!="constructor"&&i.push(t);return i}function C6(o,i){if(i)return o.slice();var t=new o.constructor(o.length);return o.copy(t),t}function hg(o){var i=new o.constructor(o.byteLength);return new Ow(i).set(new Ow(o)),i}function E6(o,i){var t=i?hg(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.byteLength)}function T6(o,i,t){var r=i?t(Mw(o),!0):Mw(o);return s_(r,IE,new o.constructor)}function $6(o){var i=new o.constructor(o.source,EE.exec(o));return i.lastIndex=o.lastIndex,i}function A6(o,i,t){var r=i?t(Iw(o),!0):Iw(o);return s_(r,qE,new o.constructor)}function L6(o){return Hw?Object(Hw.call(o)):{}}function M6(o,i){var t=i?hg(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.length)}function I6(o,i){var t=-1,r=o.length;for(i||(i=Array(r));++t<r;)i[t]=o[t];return i}function p_(o,i,t,r){t||(t={});for(var n=-1,a=i.length;++n<a;){var s=i[n],l=r?r(t[s],o[s],s,t,o):void 0;d_(t,s,l===void 0?o[s]:l)}return t}function q6(o,i){return p_(o,h_(o),i)}function R6(o){return _6(o,mg,h_)}function Ah(o,i){var t=o.__data__;return H6(i)?t[typeof i=="string"?"string":"hash"]:t.map}function yl(o,i){var t=NE(o,i);return k6(t)?t:void 0}var h_=Nw?pg(Nw,Object):K6,cs=z6;(ig&&cs(new ig(new ArrayBuffer(1)))!=Ch||Zc&&cs(new Zc)!=kh||ng&&cs(ng.resolve())!=Aw||og&&cs(new og)!=Sh||ag&&cs(new ag)!=rg)&&(cs=function(o){var i=Th.call(o),t=i==dg?o.constructor:void 0,r=t?ps(t):void 0;if(r)switch(r){case KE:return Ch;case YE:return kh;case XE:return Aw;case QE:return Sh;case JE:return rg}return i});function D6(o){var i=o.length,t=o.constructor(i);return i&&typeof o[0]=="string"&&da.call(o,"index")&&(t.index=o.index,t.input=o.input),t}function O6(o){return typeof o.constructor=="function"&&!u_(o)?w6(BE(o)):{}}function N6(o,i,t,r){var n=o.constructor;switch(i){case Xw:return hg(o);case Vw:case Uw:return new n(+o);case Ch:return E6(o,r);case Qw:case Jw:case Zw:case e_:case t_:case r_:case i_:case n_:case o_:return M6(o,r);case kh:return T6(o,r,t);case Gw:case Kw:return new n(o);case Ww:return $6(o);case Sh:return A6(o,r,t);case Yw:return L6(o)}}function P6(o,i){return i=i??Bw,!!i&&(typeof o=="number"||$E.test(o))&&o>-1&&o%1==0&&o<i}function H6(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}function F6(o){return!!qw&&qw in o}function u_(o){var i=o&&o.constructor,t=typeof i=="function"&&i.prototype||Eh;return o===t}function ps(o){if(o!=null){try{return c_.call(o)}catch{}try{return o+""}catch{}}return""}function B6(o){return sg(o,!0,!0)}function m_(o,i){return o===i||o!==o&&i!==i}function V6(o){return U6(o)&&da.call(o,"callee")&&(!UE.call(o,"callee")||Th.call(o)==lg)}var ug=Array.isArray;function f_(o){return o!=null&&G6(o.length)&&!g_(o)}function U6(o){return W6(o)&&f_(o)}var j6=GE||Y6;function g_(o){var i=Lh(o)?Th.call(o):"";return i==cg||i==jw}function G6(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Bw}function Lh(o){var i=typeof o;return!!o&&(i=="object"||i=="function")}function W6(o){return!!o&&typeof o=="object"}function mg(o){return f_(o)?y6(o):S6(o)}function K6(){return[]}function Y6(){return!1}gl.exports=B6});var Eg=bo((td,wl)=>{var X6=200,Cg="__lodash_hash_undefined__",Ph=1,T_=2,$_=9007199254740991,Mh="[object Arguments]",yg="[object Array]",Q6="[object AsyncFunction]",A_="[object Boolean]",L_="[object Date]",M_="[object Error]",I_="[object Function]",J6="[object GeneratorFunction]",Ih="[object Map]",q_="[object Number]",Z6="[object Null]",xl="[object Object]",b_="[object Promise]",e7="[object Proxy]",R_="[object RegExp]",qh="[object Set]",D_="[object String]",t7="[object Symbol]",r7="[object Undefined]",xg="[object WeakMap]",O_="[object ArrayBuffer]",Rh="[object DataView]",i7="[object Float32Array]",n7="[object Float64Array]",o7="[object Int8Array]",a7="[object Int16Array]",s7="[object Int32Array]",l7="[object Uint8Array]",c7="[object Uint8ClampedArray]",d7="[object Uint16Array]",p7="[object Uint32Array]",h7=/[\\^$.*+?()[\]{}|]/g,u7=/^\[object .+?Constructor\]$/,m7=/^(?:0|[1-9]\d*)$/,wt={};wt[i7]=wt[n7]=wt[o7]=wt[a7]=wt[s7]=wt[l7]=wt[c7]=wt[d7]=wt[p7]=!0;wt[Mh]=wt[yg]=wt[O_]=wt[A_]=wt[Rh]=wt[L_]=wt[M_]=wt[I_]=wt[Ih]=wt[q_]=wt[xl]=wt[R_]=wt[qh]=wt[D_]=wt[xg]=!1;var N_=typeof global=="object"&&global&&global.Object===Object&&global,f7=typeof self=="object"&&self&&self.Object===Object&&self,Eo=N_||f7||Function("return this")(),P_=typeof td=="object"&&td&&!td.nodeType&&td,v_=P_&&typeof wl=="object"&&wl&&!wl.nodeType&&wl,H_=v_&&v_.exports===P_,gg=H_&&N_.process,y_=(function(){try{return gg&&gg.binding&&gg.binding("util")}catch{}})(),x_=y_&&y_.isTypedArray;function g7(o,i){for(var t=-1,r=o==null?0:o.length,n=0,a=[];++t<r;){var s=o[t];i(s,t,o)&&(a[n++]=s)}return a}function b7(o,i){for(var t=-1,r=i.length,n=o.length;++t<r;)o[n+t]=i[t];return o}function v7(o,i){for(var t=-1,r=o==null?0:o.length;++t<r;)if(i(o[t],t,o))return!0;return!1}function y7(o,i){for(var t=-1,r=Array(o);++t<o;)r[t]=i(t);return r}function x7(o){return function(i){return o(i)}}function w7(o,i){return o.has(i)}function _7(o,i){return o?.[i]}function z7(o){var i=-1,t=Array(o.size);return o.forEach(function(r,n){t[++i]=[n,r]}),t}function k7(o,i){return function(t){return o(i(t))}}function S7(o){var i=-1,t=Array(o.size);return o.forEach(function(r){t[++i]=r}),t}var C7=Array.prototype,E7=Function.prototype,Hh=Object.prototype,bg=Eo["__core-js_shared__"],F_=E7.toString,no=Hh.hasOwnProperty,w_=(function(){var o=/[^.]+$/.exec(bg&&bg.keys&&bg.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),B_=Hh.toString,T7=RegExp("^"+F_.call(no).replace(h7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),__=H_?Eo.Buffer:void 0,Dh=Eo.Symbol,z_=Eo.Uint8Array,V_=Hh.propertyIsEnumerable,$7=C7.splice,hs=Dh?Dh.toStringTag:void 0,k_=Object.getOwnPropertySymbols,A7=__?__.isBuffer:void 0,L7=k7(Object.keys,Object),wg=_l(Eo,"DataView"),rd=_l(Eo,"Map"),_g=_l(Eo,"Promise"),zg=_l(Eo,"Set"),kg=_l(Eo,"WeakMap"),id=_l(Object,"create"),M7=fs(wg),I7=fs(rd),q7=fs(_g),R7=fs(zg),D7=fs(kg),S_=Dh?Dh.prototype:void 0,vg=S_?S_.valueOf:void 0;function us(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function O7(){this.__data__=id?id(null):{},this.size=0}function N7(o){var i=this.has(o)&&delete this.__data__[o];return this.size-=i?1:0,i}function P7(o){var i=this.__data__;if(id){var t=i[o];return t===Cg?void 0:t}return no.call(i,o)?i[o]:void 0}function H7(o){var i=this.__data__;return id?i[o]!==void 0:no.call(i,o)}function F7(o,i){var t=this.__data__;return this.size+=this.has(o)?0:1,t[o]=id&&i===void 0?Cg:i,this}us.prototype.clear=O7;us.prototype.delete=N7;us.prototype.get=P7;us.prototype.has=H7;us.prototype.set=F7;function To(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function B7(){this.__data__=[],this.size=0}function V7(o){var i=this.__data__,t=Fh(i,o);if(t<0)return!1;var r=i.length-1;return t==r?i.pop():$7.call(i,t,1),--this.size,!0}function U7(o){var i=this.__data__,t=Fh(i,o);return t<0?void 0:i[t][1]}function j7(o){return Fh(this.__data__,o)>-1}function G7(o,i){var t=this.__data__,r=Fh(t,o);return r<0?(++this.size,t.push([o,i])):t[r][1]=i,this}To.prototype.clear=B7;To.prototype.delete=V7;To.prototype.get=U7;To.prototype.has=j7;To.prototype.set=G7;function ms(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function W7(){this.size=0,this.__data__={hash:new us,map:new(rd||To),string:new us}}function K7(o){var i=Bh(this,o).delete(o);return this.size-=i?1:0,i}function Y7(o){return Bh(this,o).get(o)}function X7(o){return Bh(this,o).has(o)}function Q7(o,i){var t=Bh(this,o),r=t.size;return t.set(o,i),this.size+=t.size==r?0:1,this}ms.prototype.clear=W7;ms.prototype.delete=K7;ms.prototype.get=Y7;ms.prototype.has=X7;ms.prototype.set=Q7;function Oh(o){var i=-1,t=o==null?0:o.length;for(this.__data__=new ms;++i<t;)this.add(o[i])}function J7(o){return this.__data__.set(o,Cg),this}function Z7(o){return this.__data__.has(o)}Oh.prototype.add=Oh.prototype.push=J7;Oh.prototype.has=Z7;function ha(o){var i=this.__data__=new To(o);this.size=i.size}function eT(){this.__data__=new To,this.size=0}function tT(o){var i=this.__data__,t=i.delete(o);return this.size=i.size,t}function rT(o){return this.__data__.get(o)}function iT(o){return this.__data__.has(o)}function nT(o,i){var t=this.__data__;if(t instanceof To){var r=t.__data__;if(!rd||r.length<X6-1)return r.push([o,i]),this.size=++t.size,this;t=this.__data__=new ms(r)}return t.set(o,i),this.size=t.size,this}ha.prototype.clear=eT;ha.prototype.delete=tT;ha.prototype.get=rT;ha.prototype.has=iT;ha.prototype.set=nT;function oT(o,i){var t=Nh(o),r=!t&&xT(o),n=!t&&!r&&Sg(o),a=!t&&!r&&!n&&X_(o),s=t||r||n||a,l=s?y7(o.length,String):[],d=l.length;for(var h in o)(i||no.call(o,h))&&!(s&&(h=="length"||n&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||fT(h,d)))&&l.push(h);return l}function Fh(o,i){for(var t=o.length;t--;)if(G_(o[t][0],i))return t;return-1}function aT(o,i,t){var r=i(o);return Nh(o)?r:b7(r,t(o))}function od(o){return o==null?o===void 0?r7:Z6:hs&&hs in Object(o)?uT(o):yT(o)}function C_(o){return nd(o)&&od(o)==Mh}function U_(o,i,t,r,n){return o===i?!0:o==null||i==null||!nd(o)&&!nd(i)?o!==o&&i!==i:sT(o,i,t,r,U_,n)}function sT(o,i,t,r,n,a){var s=Nh(o),l=Nh(i),d=s?yg:pa(o),h=l?yg:pa(i);d=d==Mh?xl:d,h=h==Mh?xl:h;var m=d==xl,f=h==xl,b=d==h;if(b&&Sg(o)){if(!Sg(i))return!1;s=!0,m=!1}if(b&&!m)return a||(a=new ha),s||X_(o)?j_(o,i,t,r,n,a):pT(o,i,d,t,r,n,a);if(!(t&Ph)){var g=m&&no.call(o,"__wrapped__"),v=f&&no.call(i,"__wrapped__");if(g||v){var y=g?o.value():o,_=v?i.value():i;return a||(a=new ha),n(y,_,t,r,a)}}return b?(a||(a=new ha),hT(o,i,t,r,n,a)):!1}function lT(o){if(!Y_(o)||bT(o))return!1;var i=W_(o)?T7:u7;return i.test(fs(o))}function cT(o){return nd(o)&&K_(o.length)&&!!wt[od(o)]}function dT(o){if(!vT(o))return L7(o);var i=[];for(var t in Object(o))no.call(o,t)&&t!="constructor"&&i.push(t);return i}function j_(o,i,t,r,n,a){var s=t&Ph,l=o.length,d=i.length;if(l!=d&&!(s&&d>l))return!1;var h=a.get(o);if(h&&a.get(i))return h==i;var m=-1,f=!0,b=t&T_?new Oh:void 0;for(a.set(o,i),a.set(i,o);++m<l;){var g=o[m],v=i[m];if(r)var y=s?r(v,g,m,i,o,a):r(g,v,m,o,i,a);if(y!==void 0){if(y)continue;f=!1;break}if(b){if(!v7(i,function(_,E){if(!w7(b,E)&&(g===_||n(g,_,t,r,a)))return b.push(E)})){f=!1;break}}else if(!(g===v||n(g,v,t,r,a))){f=!1;break}}return a.delete(o),a.delete(i),f}function pT(o,i,t,r,n,a,s){switch(t){case Rh:if(o.byteLength!=i.byteLength||o.byteOffset!=i.byteOffset)return!1;o=o.buffer,i=i.buffer;case O_:return!(o.byteLength!=i.byteLength||!a(new z_(o),new z_(i)));case A_:case L_:case q_:return G_(+o,+i);case M_:return o.name==i.name&&o.message==i.message;case R_:case D_:return o==i+"";case Ih:var l=z7;case qh:var d=r&Ph;if(l||(l=S7),o.size!=i.size&&!d)return!1;var h=s.get(o);if(h)return h==i;r|=T_,s.set(o,i);var m=j_(l(o),l(i),r,n,a,s);return s.delete(o),m;case t7:if(vg)return vg.call(o)==vg.call(i)}return!1}function hT(o,i,t,r,n,a){var s=t&Ph,l=E_(o),d=l.length,h=E_(i),m=h.length;if(d!=m&&!s)return!1;for(var f=d;f--;){var b=l[f];if(!(s?b in i:no.call(i,b)))return!1}var g=a.get(o);if(g&&a.get(i))return g==i;var v=!0;a.set(o,i),a.set(i,o);for(var y=s;++f<d;){b=l[f];var _=o[b],E=i[b];if(r)var N=s?r(E,_,b,i,o,a):r(_,E,b,o,i,a);if(!(N===void 0?_===E||n(_,E,t,r,a):N)){v=!1;break}y||(y=b=="constructor")}if(v&&!y){var G=o.constructor,R=i.constructor;G!=R&&"constructor"in o&&"constructor"in i&&!(typeof G=="function"&&G instanceof G&&typeof R=="function"&&R instanceof R)&&(v=!1)}return a.delete(o),a.delete(i),v}function E_(o){return aT(o,zT,mT)}function Bh(o,i){var t=o.__data__;return gT(i)?t[typeof i=="string"?"string":"hash"]:t.map}function _l(o,i){var t=_7(o,i);return lT(t)?t:void 0}function uT(o){var i=no.call(o,hs),t=o[hs];try{o[hs]=void 0;var r=!0}catch{}var n=B_.call(o);return r&&(i?o[hs]=t:delete o[hs]),n}var mT=k_?function(o){return o==null?[]:(o=Object(o),g7(k_(o),function(i){return V_.call(o,i)}))}:kT,pa=od;(wg&&pa(new wg(new ArrayBuffer(1)))!=Rh||rd&&pa(new rd)!=Ih||_g&&pa(_g.resolve())!=b_||zg&&pa(new zg)!=qh||kg&&pa(new kg)!=xg)&&(pa=function(o){var i=od(o),t=i==xl?o.constructor:void 0,r=t?fs(t):"";if(r)switch(r){case M7:return Rh;case I7:return Ih;case q7:return b_;case R7:return qh;case D7:return xg}return i});function fT(o,i){return i=i??$_,!!i&&(typeof o=="number"||m7.test(o))&&o>-1&&o%1==0&&o<i}function gT(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}function bT(o){return!!w_&&w_ in o}function vT(o){var i=o&&o.constructor,t=typeof i=="function"&&i.prototype||Hh;return o===t}function yT(o){return B_.call(o)}function fs(o){if(o!=null){try{return F_.call(o)}catch{}try{return o+""}catch{}}return""}function G_(o,i){return o===i||o!==o&&i!==i}var xT=C_((function(){return arguments})())?C_:function(o){return nd(o)&&no.call(o,"callee")&&!V_.call(o,"callee")},Nh=Array.isArray;function wT(o){return o!=null&&K_(o.length)&&!W_(o)}var Sg=A7||ST;function _T(o,i){return U_(o,i)}function W_(o){if(!Y_(o))return!1;var i=od(o);return i==I_||i==J6||i==Q6||i==e7}function K_(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=$_}function Y_(o){var i=typeof o;return o!=null&&(i=="object"||i=="function")}function nd(o){return o!=null&&typeof o=="object"}var X_=x_?x7(x_):cT;function zT(o){return wT(o)?oT(o):dT(o)}function kT(){return[]}function ST(){return!1}wl.exports=_T});var Q_=bo($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});var CT=fg(),ET=Eg(),Tg;(function(o){function i(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let d=CT(s);l||(d=Object.keys(d).reduce((h,m)=>(d[m]!=null&&(h[m]=d[m]),h),{}));for(let h in a)a[h]!==void 0&&s[h]===void 0&&(d[h]=a[h]);return Object.keys(d).length>0?d:void 0}o.compose=i;function t(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let l=Object.keys(a).concat(Object.keys(s)).reduce((d,h)=>(ET(a[h],s[h])||(d[h]=s[h]===void 0?null:s[h]),d),{});return Object.keys(l).length>0?l:void 0}o.diff=t;function r(a={},s={}){a=a||{};let l=Object.keys(s).reduce((d,h)=>(s[h]!==a[h]&&a[h]!==void 0&&(d[h]=s[h]),d),{});return Object.keys(a).reduce((d,h)=>(a[h]!==s[h]&&s[h]===void 0&&(d[h]=null),d),l)}o.invert=r;function n(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;let d=Object.keys(s).reduce((h,m)=>(a[m]===void 0&&(h[m]=s[m]),h),{});return Object.keys(d).length>0?d:void 0}o.transform=n})(Tg||(Tg={}));$g.default=Tg});var Mg=bo(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var Ag;(function(o){function i(t){return typeof t.delete=="number"?t.delete:typeof t.retain=="number"?t.retain:typeof t.retain=="object"&&t.retain!==null?1:typeof t.insert=="string"?t.insert.length:1}o.length=i})(Ag||(Ag={}));Lg.default=Ag});var Z_=bo(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});var J_=Mg(),Ig=class{constructor(i){this.ops=i,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(i){i||(i=1/0);let t=this.ops[this.index];if(t){let r=this.offset,n=J_.default.length(t);if(i>=n-r?(i=n-r,this.index+=1,this.offset=0):this.offset+=i,typeof t.delete=="number")return{delete:i};{let a={};return t.attributes&&(a.attributes=t.attributes),typeof t.retain=="number"?a.retain=i:typeof t.retain=="object"&&t.retain!==null?a.retain=t.retain:typeof t.insert=="string"?a.insert=t.insert.substr(r,i):a.insert=t.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?J_.default.length(this.ops[this.index])-this.offset:1/0}peekType(){let i=this.ops[this.index];return i?typeof i.delete=="number"?"delete":typeof i.retain=="number"||typeof i.retain=="object"&&i.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{let i=this.offset,t=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=i,this.index=t,[r].concat(n)}}else return[]}};qg.default=Ig});var zi=bo((Ao,Uh)=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.AttributeMap=Ao.OpIterator=Ao.Op=void 0;var Vh=$w(),TT=fg(),Rg=Eg(),gs=Q_();Ao.AttributeMap=gs.default;var $o=Mg();Ao.Op=$o.default;var mn=Z_();Ao.OpIterator=mn.default;var $T="\0",ez=(o,i)=>{if(typeof o!="object"||o===null)throw new Error(`cannot retain a ${typeof o}`);if(typeof i!="object"||i===null)throw new Error(`cannot retain a ${typeof i}`);let t=Object.keys(o)[0];if(!t||t!==Object.keys(i)[0])throw new Error(`embed types not matched: ${t} != ${Object.keys(i)[0]}`);return[t,o[t],i[t]]},Lo=class o{constructor(i){Array.isArray(i)?this.ops=i:i!=null&&Array.isArray(i.ops)?this.ops=i.ops:this.ops=[]}static registerEmbed(i,t){this.handlers[i]=t}static unregisterEmbed(i){delete this.handlers[i]}static getHandler(i){let t=this.handlers[i];if(!t)throw new Error(`no handlers for embed type "${i}"`);return t}insert(i,t){let r={};return typeof i=="string"&&i.length===0?this:(r.insert=i,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(r.attributes=t),this.push(r))}delete(i){return i<=0?this:this.push({delete:i})}retain(i,t){if(typeof i=="number"&&i<=0)return this;let r={retain:i};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(r.attributes=t),this.push(r)}push(i){let t=this.ops.length,r=this.ops[t-1];if(i=TT(i),typeof r=="object"){if(typeof i.delete=="number"&&typeof r.delete=="number")return this.ops[t-1]={delete:r.delete+i.delete},this;if(typeof r.delete=="number"&&i.insert!=null&&(t-=1,r=this.ops[t-1],typeof r!="object"))return this.ops.unshift(i),this;if(Rg(i.attributes,r.attributes)){if(typeof i.insert=="string"&&typeof r.insert=="string")return this.ops[t-1]={insert:r.insert+i.insert},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this;if(typeof i.retain=="number"&&typeof r.retain=="number")return this.ops[t-1]={retain:r.retain+i.retain},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this}}return t===this.ops.length?this.ops.push(i):this.ops.splice(t,0,i),this}chop(){let i=this.ops[this.ops.length-1];return i&&typeof i.retain=="number"&&!i.attributes&&this.ops.pop(),this}filter(i){return this.ops.filter(i)}forEach(i){this.ops.forEach(i)}map(i){return this.ops.map(i)}partition(i){let t=[],r=[];return this.forEach(n=>{(i(n)?t:r).push(n)}),[t,r]}reduce(i,t){return this.ops.reduce(i,t)}changeLength(){return this.reduce((i,t)=>t.insert?i+$o.default.length(t):t.delete?i-t.delete:i,0)}length(){return this.reduce((i,t)=>i+$o.default.length(t),0)}slice(i=0,t=1/0){let r=[],n=new mn.default(this.ops),a=0;for(;a<t&&n.hasNext();){let s;a<i?s=n.next(i-a):(s=n.next(t-a),r.push(s)),a+=$o.default.length(s)}return new o(r)}compose(i){let t=new mn.default(this.ops),r=new mn.default(i.ops),n=[],a=r.peek();if(a!=null&&typeof a.retain=="number"&&a.attributes==null){let l=a.retain;for(;t.peekType()==="insert"&&t.peekLength()<=l;)l-=t.peekLength(),n.push(t.next());a.retain-l>0&&r.next(a.retain-l)}let s=new o(n);for(;t.hasNext()||r.hasNext();)if(r.peekType()==="insert")s.push(r.next());else if(t.peekType()==="delete")s.push(t.next());else{let l=Math.min(t.peekLength(),r.peekLength()),d=t.next(l),h=r.next(l);if(h.retain){let m={};if(typeof d.retain=="number")m.retain=typeof h.retain=="number"?l:h.retain;else if(typeof h.retain=="number")d.retain==null?m.insert=d.insert:m.retain=d.retain;else{let b=d.retain==null?"insert":"retain",[g,v,y]=ez(d[b],h.retain),_=o.getHandler(g);m[b]={[g]:_.compose(v,y,b==="retain")}}let f=gs.default.compose(d.attributes,h.attributes,typeof d.retain=="number");if(f&&(m.attributes=f),s.push(m),!r.hasNext()&&Rg(s.ops[s.ops.length-1],m)){let b=new o(t.rest());return s.concat(b).chop()}}else typeof h.delete=="number"&&(typeof d.retain=="number"||typeof d.retain=="object"&&d.retain!==null)&&s.push(h)}return s.chop()}concat(i){let t=new o(this.ops.slice());return i.ops.length>0&&(t.push(i.ops[0]),t.ops=t.ops.concat(i.ops.slice(1))),t}diff(i,t){if(this.ops===i.ops)return new o;let r=[this,i].map(d=>d.map(h=>{if(h.insert!=null)return typeof h.insert=="string"?h.insert:$T;let m=d===i?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")),n=new o,a=Vh(r[0],r[1],t,!0),s=new mn.default(this.ops),l=new mn.default(i.ops);return a.forEach(d=>{let h=d[1].length;for(;h>0;){let m=0;switch(d[0]){case Vh.INSERT:m=Math.min(l.peekLength(),h),n.push(l.next(m));break;case Vh.DELETE:m=Math.min(h,s.peekLength()),s.next(m),n.delete(m);break;case Vh.EQUAL:m=Math.min(s.peekLength(),l.peekLength(),h);let f=s.next(m),b=l.next(m);Rg(f.insert,b.insert)?n.retain(m,gs.default.diff(f.attributes,b.attributes)):n.push(b).delete(m);break}h-=m}}),n.chop()}eachLine(i,t=`
2
- `){let r=new mn.default(this.ops),n=new o,a=0;for(;r.hasNext();){if(r.peekType()!=="insert")return;let s=r.peek(),l=$o.default.length(s)-r.peekLength(),d=typeof s.insert=="string"?s.insert.indexOf(t,l)-l:-1;if(d<0)n.push(r.next());else if(d>0)n.push(r.next(d));else{if(i(n,r.next(1).attributes||{},a)===!1)return;a+=1,n=new o}}n.length()>0&&i(n,{},a)}invert(i){let t=new o;return this.reduce((r,n)=>{if(n.insert)t.delete($o.default.length(n));else{if(typeof n.retain=="number"&&n.attributes==null)return t.retain(n.retain),r+n.retain;if(n.delete||typeof n.retain=="number"){let a=n.delete||n.retain;return i.slice(r,r+a).forEach(l=>{n.delete?t.push(l):n.retain&&n.attributes&&t.retain($o.default.length(l),gs.default.invert(n.attributes,l.attributes))}),r+a}else if(typeof n.retain=="object"&&n.retain!==null){let a=i.slice(r,r+1),s=new mn.default(a.ops).next(),[l,d,h]=ez(n.retain,s.insert),m=o.getHandler(l);return t.retain({[l]:m.invert(d,h)},gs.default.invert(n.attributes,s.attributes)),r+1}}return r},0),t.chop()}transform(i,t=!1){if(t=!!t,typeof i=="number")return this.transformPosition(i,t);let r=i,n=new mn.default(this.ops),a=new mn.default(r.ops),s=new o;for(;n.hasNext()||a.hasNext();)if(n.peekType()==="insert"&&(t||a.peekType()!=="insert"))s.retain($o.default.length(n.next()));else if(a.peekType()==="insert")s.push(a.next());else{let l=Math.min(n.peekLength(),a.peekLength()),d=n.next(l),h=a.next(l);if(d.delete)continue;if(h.delete)s.push(h);else{let m=d.retain,f=h.retain,b=typeof f=="object"&&f!==null?f:l;if(typeof m=="object"&&m!==null&&typeof f=="object"&&f!==null){let g=Object.keys(m)[0];if(g===Object.keys(f)[0]){let v=o.getHandler(g);v&&(b={[g]:v.transform(m[g],f[g],t)})}}s.retain(b,gs.default.transform(d.attributes,h.attributes,t))}}return s.chop()}transformPosition(i,t=!1){t=!!t;let r=new mn.default(this.ops),n=0;for(;r.hasNext()&&n<=i;){let a=r.peekLength(),s=r.peekType();if(r.next(),s==="delete"){i-=Math.min(a,i-n);continue}else s==="insert"&&(n<i||!t)&&(i+=a);n+=a}return i}};Lo.Op=$o.default;Lo.OpIterator=mn.default;Lo.AttributeMap=gs.default;Lo.handlers={};Ao.default=Lo;typeof Uh=="object"&&(Uh.exports=Lo,Uh.exports.default=Lo)});var gk=bo((_ge,eb)=>{"use strict";var pq=Object.prototype.hasOwnProperty,hi="~";function gd(){}Object.create&&(gd.prototype=Object.create(null),new gd().__proto__||(hi=!1));function hq(o,i,t){this.fn=o,this.context=i,this.once=t||!1}function fk(o,i,t,r,n){if(typeof t!="function")throw new TypeError("The listener must be a function");var a=new hq(t,r||o,n),s=hi?hi+i:i;return o._events[s]?o._events[s].fn?o._events[s]=[o._events[s],a]:o._events[s].push(a):(o._events[s]=a,o._eventsCount++),o}function bu(o,i){--o._eventsCount===0?o._events=new gd:delete o._events[i]}function ti(){this._events=new gd,this._eventsCount=0}ti.prototype.eventNames=function(){var i=[],t,r;if(this._eventsCount===0)return i;for(r in t=this._events)pq.call(t,r)&&i.push(hi?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i};ti.prototype.listeners=function(i){var t=hi?hi+i:i,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,s=new Array(a);n<a;n++)s[n]=r[n].fn;return s};ti.prototype.listenerCount=function(i){var t=hi?hi+i:i,r=this._events[t];return r?r.fn?1:r.length:0};ti.prototype.emit=function(i,t,r,n,a,s){var l=hi?hi+i:i;if(!this._events[l])return!1;var d=this._events[l],h=arguments.length,m,f;if(d.fn){switch(d.once&&this.removeListener(i,d.fn,void 0,!0),h){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,n),!0;case 5:return d.fn.call(d.context,t,r,n,a),!0;case 6:return d.fn.call(d.context,t,r,n,a,s),!0}for(f=1,m=new Array(h-1);f<h;f++)m[f-1]=arguments[f];d.fn.apply(d.context,m)}else{var b=d.length,g;for(f=0;f<b;f++)switch(d[f].once&&this.removeListener(i,d[f].fn,void 0,!0),h){case 1:d[f].fn.call(d[f].context);break;case 2:d[f].fn.call(d[f].context,t);break;case 3:d[f].fn.call(d[f].context,t,r);break;case 4:d[f].fn.call(d[f].context,t,r,n);break;default:if(!m)for(g=1,m=new Array(h-1);g<h;g++)m[g-1]=arguments[g];d[f].fn.apply(d[f].context,m)}}return!0};ti.prototype.on=function(i,t,r){return fk(this,i,t,r,!1)};ti.prototype.once=function(i,t,r){return fk(this,i,t,r,!0)};ti.prototype.removeListener=function(i,t,r,n){var a=hi?hi+i:i;if(!this._events[a])return this;if(!t)return bu(this,a),this;var s=this._events[a];if(s.fn)s.fn===t&&(!n||s.once)&&(!r||s.context===r)&&bu(this,a);else{for(var l=0,d=[],h=s.length;l<h;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[a]=d.length===1?d[0]:d:bu(this,a)}return this};ti.prototype.removeAllListeners=function(i){var t;return i?(t=hi?hi+i:i,this._events[t]&&bu(this,t)):(this._events=new gd,this._eventsCount=0),this};ti.prototype.off=ti.prototype.removeListener;ti.prototype.addListener=ti.prototype.on;ti.prefixed=hi;ti.EventEmitter=ti;typeof eb<"u"&&(eb.exports=ti)});var bc=globalThis,v0=o=>o,yp=bc.trustedTypes,y0=yp?yp.createPolicy("lit-html",{createHTML:o=>o}):void 0,Cm="$lit$",vo=`lit$${Math.random().toFixed(9).slice(2)}$`,Em="?"+vo,L8=`<${Em}>`,ja=document,vc=()=>ja.createComment(""),yc=o=>o===null||typeof o!="object"&&typeof o!="function",Tm=Array.isArray,S0=o=>Tm(o)||typeof o?.[Symbol.iterator]=="function",Sm=`[
1
+ import{a as bo,b as A8,c as Vr,d as c,e as W}from"./chunks/zn.UBLZO6CI.js";var Rf=bo((Wc,qf)=>{(function(o,i){typeof Wc=="object"&&typeof qf=="object"?qf.exports=i():typeof define=="function"&&define.amd?define([],i):typeof Wc=="object"?Wc.AirDatepicker=i():o.AirDatepicker=i()})(Wc,(function(){return(function(){"use strict";var o={d:function(H,x){for(var A in x)o.o(x,A)&&!o.o(H,A)&&Object.defineProperty(H,A,{enumerable:!0,get:x[A]})},o:function(H,x){return Object.prototype.hasOwnProperty.call(H,x)}},i={};o.d(i,{default:function(){return pe}});var t={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},r={classes:"",inline:!1,locale:{days:["\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435","\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041F\u044F\u0442\u043D\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043E\u0442\u0430"],daysShort:["\u0412\u043E\u0441","\u041F\u043E\u043D","\u0412\u0442\u043E","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041F\u044F\u0442","\u0421\u0443\u0431"],daysMin:["\u0412\u0441","\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431"],months:["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],monthsShort:["\u042F\u043D\u0432","\u0424\u0435\u0432","\u041C\u0430\u0440","\u0410\u043F\u0440","\u041C\u0430\u0439","\u0418\u044E\u043D","\u0418\u044E\u043B","\u0410\u0432\u0433","\u0421\u0435\u043D","\u041E\u043A\u0442","\u041D\u043E\u044F","\u0414\u0435\u043A"],today:"\u0421\u0435\u0433\u043E\u0434\u043D\u044F",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:t.days,minView:t.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function n(H){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;return typeof H=="string"?x.querySelector(H):H}function a(){let{tagName:H="div",className:x="",innerHtml:A="",id:w="",attrs:O={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=document.createElement(H);return x&&I.classList.add(...x.split(" ")),w&&(I.id=w),A&&(I.innerHTML=A),O&&s(I,O),I}function s(H,x){for(let[A,w]of Object.entries(x))w!==void 0&&H.setAttribute(A,w);return H}function l(H){return new Date(H.getFullYear(),H.getMonth()+1,0).getDate()}function d(H){let x=H.getHours(),{hours:A,dayPeriod:w}=h(x);return{year:H.getFullYear(),month:H.getMonth(),fullMonth:H.getMonth()+1<10?"0"+(H.getMonth()+1):H.getMonth()+1,date:H.getDate(),fullDate:H.getDate()<10?"0"+H.getDate():H.getDate(),day:H.getDay(),hours:x,fullHours:m(x),hours12:A,dayPeriod:w,fullHours12:m(A),minutes:H.getMinutes(),fullMinutes:H.getMinutes()<10?"0"+H.getMinutes():H.getMinutes()}}function h(H){return{dayPeriod:H>11?"pm":"am",hours:H%12==0?12:H%12}}function m(H){return H<10?"0"+H:H}function f(H){let x=10*Math.floor(H.getFullYear()/10);return[x,x+9]}function b(){let H=[];for(var x=arguments.length,A=new Array(x),w=0;w<x;w++)A[w]=arguments[w];return A.forEach((O=>{if(typeof O=="object")for(let I in O)O[I]&&H.push(I);else O&&H.push(O)})),H.join(" ")}function g(H,x){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.days;if(!H||!x)return!1;let w=d(H),O=d(x);return{[t.days]:w.date===O.date&&w.month===O.month&&w.year===O.year,[t.months]:w.month===O.month&&w.year===O.year,[t.years]:w.year===O.year}[A]}function v(H,x,A){let w=_(H,!1).getTime(),O=_(x,!1).getTime();return A?w>=O:w>O}function y(H,x){return!v(H,x,!0)}function _(H){let x=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=new Date(H.getTime());return typeof x!="boolean"||x||(function(w){w.setHours(0,0,0,0)})(A),A}function E(H,x,A){H.length?H.forEach((w=>{w.addEventListener(x,A)})):H.addEventListener(x,A)}function N(H,x){return!(!H||H===document||H instanceof DocumentFragment)&&(H.matches(x)?H:N(H.parentNode,x))}function G(H,x,A){return H>A?A:H<x?x:H}function R(H){for(var x=arguments.length,A=new Array(x>1?x-1:0),w=1;w<x;w++)A[w-1]=arguments[w];return A.filter((O=>O)).forEach((O=>{for(let[I,$]of Object.entries(O))if($!==void 0&&$.toString()==="[object Object]"){let B=H[I]!==void 0?H[I].toString():void 0,j=$.toString(),ee=Array.isArray($)?[]:{};H[I]=H[I]?B!==j?ee:H[I]:ee,R(H[I],$)}else H[I]=$})),H}function C(H){let x=H;return H instanceof Date||(typeof H=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(H)&&(H+="T00:00:00"),x=new Date(H)),isNaN(x.getTime())&&(console.log(`Unable to convert value "${H}" to Date object`),x=!1),x}function L(H){let x="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+x+")("+H+")($|<|"+x+")","g")}function M(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Y{constructor(){let{type:x,date:A,dp:w,opts:O,body:I}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,"focus",(()=>{this.$cell.classList.add("-focus-"),this.focused=!0})),M(this,"removeFocus",(()=>{this.$cell.classList.remove("-focus-"),this.focused=!1})),M(this,"select",(()=>{this.$cell.classList.add("-selected-"),this.selected=!0})),M(this,"removeSelect",(()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1})),M(this,"onChangeSelectedDate",(()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())})),M(this,"onChangeFocusDate",($=>{if(!$)return void(this.focused&&this.removeFocus());let B=g($,this.date,this.type);B?this.focus():!B&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()})),M(this,"render",(()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell))),this.type=x,this.singleType=this.type.slice(0,-1),this.date=A,this.dp=w,this.opts=O,this.body=I,this.customData=!1,this.init()}init(){var x,A;let{onRenderCell:w}=this.opts;w&&(this.customData=w({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),(x=this.customData)!==null&&x!==void 0&&x.disabled?this.dp.disableDate(this.date):((A=this.customData)===null||A===void 0?void 0:A.disabled)===!1&&this.dp.enableDate(this.date)}_bindDatepickerEvents(){this.dp.on(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(t.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(t.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var x;let{year:A,month:w,fullMonth:O,date:I,fullDate:$}=d(this.date),B=((x=this.customData)===null||x===void 0?void 0:x.attrs)||{};this.$cell=a({attrs:{"data-year":A,"data-month":w,"data-date":I,"data-iso-date":`${A}-${O}-${$}`,...B}}),this.$cell.adpCell=this}_getClassName(){var x;let A=new Date,{selectOtherMonths:w,selectOtherYears:O}=this.opts,{minDate:I,maxDate:$,isDateDisabled:B}=this.dp,{day:j}=d(this.date),ee=this._isOutOfMinMaxRange(),ne=B(this.date),ae=b("air-datepicker-cell",`-${this.singleType}-`,{"-current-":g(A,this.date,this.type),"-min-date-":I&&g(I,this.date,this.type),"-max-date-":$&&g($,this.date,this.type)}),de="";switch(this.type){case t.days:de=b({"-weekend-":this.dp.isWeekend(j),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!w||ee||ne});break;case t.months:de=b({"-disabled-":ee});break;case t.years:de=b({"-other-decade-":this.isOtherDecade,"-disabled-":ee||this.isOtherDecade&&!O})}return b(ae,de,(x=this.customData)===null||x===void 0?void 0:x.classes).split(" ")}_getHtml(){var x;let{year:A,month:w,date:O}=d(this.date),{showOtherMonths:I,showOtherYears:$}=this.opts;if((x=this.customData)!==null&&x!==void 0&&x.html)return this.customData.html;switch(this.type){case t.days:return!I&&this.isOtherMonth?"":O;case t.months:return this.dp.locale[this.opts.monthsField][w];case t.years:return!$&&this.isOtherDecade?"":A}}_isOutOfMinMaxRange(){let{minDate:x,maxDate:A}=this.dp,{type:w,date:O}=this,{month:I,year:$,date:B}=d(O),j=w===t.days,ee=w===t.years,ne=!!x&&new Date($,ee?x.getMonth():I,j?B:x.getDate()),ae=!!A&&new Date($,ee?A.getMonth():I,j?B:A.getDate());return x&&A?y(ne,x)||v(ae,A):x?y(ne,x):A?v(ae,A):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){let{selectedDates:x,focusDate:A,rangeDateTo:w,rangeDateFrom:O}=this.dp,I=x.length;if(this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),!I)return;let $=O,B=w;if(I===1&&A){let de=v(A,x[0]);$=de?x[0]:A,B=de?A:x[0]}let j=b({"-in-range-":$&&B&&(ee=this.date,ne=$,ae=B,v(ee,ne)&&y(ee,ae)),"-range-from-":$&&g(this.date,$,this.type),"-range-to-":B&&g(this.date,B,this.type)});var ee,ne,ae;j&&this.$cell.classList.add(...j.split(" "))}_handleSelectedStatus(){let x=this.dp._checkIfDateIsSelected(this.date,this.type);x?this.select():!x&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){g(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function ie(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}let ye={[t.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${t.days}-"></div>`,[t.months]:`<div class="air-datepicker-body--cells -${t.months}-"></div>`,[t.years]:`<div class="air-datepicker-body--cells -${t.years}-"></div>`},Ie=".air-datepicker-cell";class Ve{constructor(x){let{dp:A,type:w,opts:O}=x;ie(this,"handleClick",(I=>{let $=I.target.closest(Ie).adpCell;if($.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let B=this.dp._checkIfDateIsSelected($.date,$.type);B?this.dp._handleAlreadySelectedDates(B,$.date):this.dp.selectDate($.date)})),ie(this,"handleDayNameClick",(I=>{let $=I.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number($),datepicker:this.dp})})),ie(this,"onChangeCurrentView",(I=>{I!==this.type?this.hide():(this.show(),this.render())})),ie(this,"onMouseOverCell",(I=>{let $=N(I.target,Ie);this.dp.setFocusDate(!!$&&$.adpCell.date)})),ie(this,"onMouseOutCell",(()=>{this.dp.setFocusDate(!1)})),ie(this,"onClickBody",(I=>{let{onClickDayName:$}=this.opts,B=I.target;B.closest(Ie)&&this.handleClick(I),$&&B.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(I)})),ie(this,"onMouseDown",(I=>{this.pressed=!0;let $=N(I.target,Ie),B=$&&$.adpCell;g(B.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),g(B.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)})),ie(this,"onMouseMove",(I=>{if(!this.pressed||!this.dp.isMinViewReached)return;I.preventDefault();let $=N(I.target,Ie),B=$&&$.adpCell,{selectedDates:j,rangeDateTo:ee,rangeDateFrom:ne}=this.dp;if(!B||B.isDisabled)return;let{date:ae}=B;if(j.length===2){if(this.rangeFromFocused&&!v(ae,ee)){let{hours:de,minutes:Xe}=d(ne);ae.setHours(de),ae.setMinutes(Xe),this.dp.rangeDateFrom=ae,this.dp.replaceDate(ne,ae)}if(this.rangeToFocused&&!y(ae,ne)){let{hours:de,minutes:Xe}=d(ee);ae.setHours(de),ae.setMinutes(Xe),this.dp.rangeDateTo=ae,this.dp.replaceDate(ee,ae)}}})),ie(this,"onMouseUp",(()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1})),ie(this,"onChangeViewDate",((I,$)=>{if(!this.isVisible)return;let B=f(I),j=f($);switch(this.dp.currentView){case t.days:if(g(I,$,t.months))return;break;case t.months:if(g(I,$,t.years))return;break;case t.years:if(B[0]===j[0]&&B[1]===j[1])return}this.render()})),ie(this,"render",(()=>{this.destroyCells(),this._generateCells(),this.cells.forEach((I=>{this.$cells.appendChild(I.render())}))})),this.dp=A,this.type=w,this.opts=O,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===t.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:x,dynamicRange:A}=this.opts;E(this.$el,"mouseover",this.onMouseOverCell),E(this.$el,"mouseout",this.onMouseOutCell),E(this.$el,"click",this.onClickBody),x&&A&&(E(this.$el,"mousedown",this.onMouseDown),E(this.$el,"mousemove",this.onMouseMove),E(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(t.eventChangeViewDate,this.onChangeViewDate),this.dp.on(t.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=a({className:`air-datepicker-body -${this.type}-`,innerHtml:ye[this.type]}),this.$names=n(".air-datepicker-body--day-names",this.$el),this.$cells=n(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.dp.locale.firstDay,A="",w=this.dp.isWeekend,{onClickDayName:O}=this.opts,I=x,$=0;for(;$<7;){let B=I%7;A+=`<div class="${b("air-datepicker-body--day-name",{[t.cssClassWeekend]:w(B),"-clickable-":!!O})}" data-day-index='${B}'>${this.dp.locale.daysMin[B]}</div>`,$++,I++}return A}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(x){let{type:A,dp:w,opts:O}=this;return new Y({type:A,dp:w,opts:O,date:x,body:this})}_generateCells(){Ve.getDatesFunction(this.type)(this.dp,(x=>{this.cells.push(this._generateCell(x))}))}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach((x=>x.destroy())),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(t.eventChangeViewDate,this.onChangeViewDate),this.dp.off(t.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(x,A){let{viewDate:w,opts:{fixedHeight:O},locale:{firstDay:I}}=x,$=l(w),{year:B,month:j}=d(w),ee=new Date(B,j,1),ne=new Date(B,j,$),ae=ee.getDay()-I,de=6-ne.getDay()+I;ae=ae<0?ae+7:ae,de=de>6?de-7:de;let Xe=(function(si,Fa){let{year:go,month:Ms,date:uc}=d(si);return new Date(go,Ms,uc-Fa)})(ee,ae),Tr=$+ae+de,tr=Xe.getDate(),{year:Hi,month:jo}=d(Xe),Br=0;O&&(Tr=42);let ai=[];for(;Br<Tr;){let si=new Date(Hi,jo,tr+Br);A&&A(si),ai.push(si),Br++}return ai}static getMonthsDates(x,A){let{year:w}=x.parsedViewDate,O=0,I=[];for(;O<12;){let $=new Date(w,O);I.push($),A&&A($),O++}return I}static getYearsDates(x,A){let w=f(x.viewDate),O=w[0]-1,I=w[1]+1,$=O,B=[];for(;$<=I;){let j=new Date($,0);B.push(j),A&&A(j),$++}return B}static getDatesFunction(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.days;return{[t.days]:Ve.getDaysDates,[t.months]:Ve.getMonthsDates,[t.years]:Ve.getYearsDates}[x]}}function Ye(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Wt{constructor(x){let{dp:A,opts:w}=x;Ye(this,"onClickNav",(O=>{let I=N(O.target,".air-datepicker-nav--action");if(!I)return;let $=I.dataset.action;this.dp[$]()})),Ye(this,"onChangeViewDate",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),Ye(this,"onChangeCurrentView",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),Ye(this,"onClickNavTitle",(()=>{this.dp.isFinalView||this.dp.up()})),Ye(this,"update",(()=>{let{prevHtml:O,nextHtml:I}=this.opts;this.$prev.innerHTML=O,this.$next.innerHTML=I,this._resetNavStatus(),this.render(),this.handleNavStatus()})),Ye(this,"renderDelay",(()=>{setTimeout(this.render)})),Ye(this,"render",(()=>{this.$title.innerHTML=this._getTitle(),(function(O,I){for(let $ in I)I[$]?O.classList.add($):O.classList.remove($)})(this.$title,{"-disabled-":this.dp.isFinalView})})),this.dp=A,this.opts=w,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=n(".air-datepicker-nav--title",this.$el),this.$prev=n('[data-action="prev"]',this.$el),this.$next=n('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(t.eventChangeViewDate,this.onChangeViewDate),this.dp.on(t.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(t.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(t.eventChangeTime,this.render))}destroy(){this.dp.off(t.eventChangeViewDate,this.onChangeViewDate),this.dp.off(t.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(t.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(t.eventChangeTime,this.render))}_createElement(){this.$el=a({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:x,opts:A}=this,w=A.navTitles[x.currentView];return typeof w=="function"?w(x):x.formatDate(x.viewDate,w)}handleNavStatus(){let{disableNavWhenOutOfRange:x}=this.opts,{minDate:A,maxDate:w}=this.dp;if(!A&&!w||!x)return;let{year:O,month:I}=this.dp.parsedViewDate,$=!!A&&d(A),B=!!w&&d(w);switch(this.dp.currentView){case t.days:A&&$.month>=I&&$.year>=O&&this._disableNav("prev"),w&&B.month<=I&&B.year<=O&&this._disableNav("next");break;case t.months:A&&$.year>=O&&this._disableNav("prev"),w&&B.year<=O&&this._disableNav("next");break;case t.years:{let j=f(this.dp.viewDate);A&&$.year>=j[0]&&this._disableNav("prev"),w&&B.year<=j[1]&&this._disableNav("next");break}}}_disableNav(x){n('[data-action="'+x+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){(function(x){for(var A=arguments.length,w=new Array(A>1?A-1:0),O=1;O<A;O++)w[O-1]=arguments[O];x.length?x.forEach((I=>{I.classList.remove(...w)})):x.classList.remove(...w)})(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:x,nextHtml:A}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${x}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${A}</div>`}get isNavIsFunction(){let{navTitles:x}=this.opts;return Object.keys(x).find((A=>typeof x[A]=="function"))}}var Nt={today:{content:H=>H.locale.today,onClick:H=>H.setViewDate(new Date)},clear:{content:H=>H.locale.clear,onClick:H=>H.clear()}};class yr{constructor(x){let{dp:A,opts:w}=x;this.dp=A,this.opts=w,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=a({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:x}=this.opts;Array.isArray(x)||(x=[x]),x.forEach((A=>{let w=A;typeof A=="string"&&Nt[A]&&(w=Nt[A]);let O=this.createButton(w);w.onClick&&this.attachEventToButton(O,w.onClick),this.$el.appendChild(O)}))}attachEventToButton(x,A){x.addEventListener("click",(()=>{A(this.dp)}))}createButton(x){let{content:A,className:w,tagName:O="button",attrs:I={}}=x;return a({tagName:O,innerHtml:`<span tabindex='-1'>${typeof A=="function"?A(this.dp):A}</span>`,className:b("air-datepicker-button",w),attrs:I})}render(){this.generateButtons()}}function Pt(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class At{constructor(){let{opts:x,dp:A}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pt(this,"toggleTimepickerIsActive",(O=>{this.dp.timepickerIsActive=O})),Pt(this,"onChangeSelectedDate",(O=>{let{date:I,updateTime:$=!1}=O;I&&(this.setMinMaxTime(I),this.setCurrentTime(!!$&&I),this.addTimeToDate(I))})),Pt(this,"onChangeLastSelectedDate",(O=>{O&&(this.setTime(O),this.render())})),Pt(this,"onChangeInputRange",(O=>{let I=O.target;this[I.getAttribute("name")]=I.value,this.updateText(),this.dp.trigger(t.eventChangeTime,{hours:this.hours,minutes:this.minutes})})),Pt(this,"onMouseEnterLeave",(O=>{let I=O.target.getAttribute("name"),$=this.$minutesText;I==="hours"&&($=this.$hoursText),$.classList.toggle("-focus-")})),Pt(this,"onFocus",(()=>{this.toggleTimepickerIsActive(!0)})),Pt(this,"onBlur",(()=>{this.toggleTimepickerIsActive(!1)})),this.opts=x,this.dp=A;let{timeFormat:w}=this.dp.locale;w&&(w.match(L("h"))||w.match(L("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(t.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let x="input";navigator.userAgent.match(/trident/gi)&&(x="change"),E(this.$ranges,x,this.onChangeInputRange),E(this.$ranges,"mouseenter",this.onMouseEnterLeave),E(this.$ranges,"mouseleave",this.onMouseEnterLeave),E(this.$ranges,"focus",this.onFocus),E(this.$ranges,"mousedown",this.onFocus),E(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=a({className:b("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(t.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(t.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:x,hours:A,displayHours:w,minutes:O,minHours:I,minMinutes:$,maxHours:B,maxMinutes:j,dayPeriod:ee,opts:{hoursStep:ne,minutesStep:ae}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${m(w)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${m(O)}</span> `+(x?`<span class='air-datepicker-time--current-ampm'>${ee}</span>`:"")+`</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row"> <input type="range" name="hours" value="${A}" min="${I}" max="${B}" step="${ne}"/> </div> <div class="air-datepicker-time--row"> <input type="range" name="minutes" value="${O}" min="${$}" max="${j}" step="${ae}"/> </div></div>`}defineDOM(){let x=A=>n(A,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=x('[name="hours"]'),this.$minutes=x('[name="minutes"]'),this.$hoursText=x(".air-datepicker-time--current-hours"),this.$minutesText=x(".air-datepicker-time--current-minutes"),this.$ampm=x(".air-datepicker-time--current-ampm")}setTime(x){this.setMinMaxTime(x),this.setCurrentTime(x)}addTimeToDate(x){x&&(x.setHours(this.hours),x.setMinutes(this.minutes))}setMinMaxTime(x){if(this.setMinMaxTimeFromOptions(),x){let{minDate:A,maxDate:w}=this.dp;A&&g(x,A)&&this.setMinTimeFromMinDate(A),w&&g(x,w)&&this.setMaxTimeFromMaxDate(w)}}setCurrentTime(x){let{hours:A,minutes:w}=x?d(x):this;this.hours=G(A,this.minHours,this.maxHours),this.minutes=G(w,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:x,minMinutes:A,maxHours:w,maxMinutes:O}=this.opts;this.minHours=G(x,0,23),this.minMinutes=G(A,0,59),this.maxHours=G(w,0,23),this.maxMinutes=G(O,0,59)}setMinTimeFromMinDate(x){let{lastSelectedDate:A}=this.dp;this.minHours=x.getHours(),A&&A.getHours()>x.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=x.getMinutes()}setMaxTimeFromMaxDate(x){let{lastSelectedDate:A}=this.dp;this.maxHours=x.getHours(),A&&A.getHours()<x.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=x.getMinutes()}updateSliders(){s(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,s(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=m(this.displayHours),this.$minutesText.innerHTML=m(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(x){this._hours=x;let{hours:A,dayPeriod:w}=h(x);this.displayHours=this.ampm?A:x,this.dayPeriod=w}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function vt(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}class Cn{constructor(x){let{dp:A,opts:w}=x;vt(this,"pressedKeys",new Set),vt(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],O=>O.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],O=>O.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],O=>O.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],O=>O.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],O=>O.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],O=>O.year-=10],[["Control","Shift","ArrowUp"],(O,I)=>I.up()]])),vt(this,"handleHotKey",(O=>{let I=this.hotKeys.get(O),$=d(this.getInitialFocusDate());I($,this.dp);let{year:B,month:j,date:ee}=$,ne=l(new Date(B,j));ne<ee&&(ee=ne);let ae=this.dp.getClampedDate(new Date(B,j,ee));this.dp.setFocusDate(ae,{viewDateTransition:!0})})),vt(this,"isHotKeyPressed",(()=>{let O=!1,I=this.pressedKeys.size,$=B=>this.pressedKeys.has(B);for(let[B]of this.hotKeys){if(O)break;if(Array.isArray(B[0]))B.forEach((j=>{O||I!==j.length||(O=j.every($)&&B)}));else{if(I!==B.length)continue;O=B.every($)&&B}}return O})),vt(this,"isArrow",(O=>O>=37&&O<=40)),vt(this,"onKeyDown",(O=>{if(!this.dp.visible&&!this.dp.treatAsInline)return;let{key:I,which:$}=O,{dp:B,dp:{focusDate:j},opts:ee}=this;this.registerKey(I);let ne=this.isHotKeyPressed();if(ne)return O.preventDefault(),void this.handleHotKey(ne);if(this.isArrow($))return O.preventDefault(),void this.focusNextCell(I);if(I==="Enter"){if(B.currentView!==ee.minView)return void B.down();if(j){let ae=B._checkIfDateIsSelected(j);return void(ae?B._handleAlreadySelectedDates(ae,j):B.selectDate(j))}}I==="Escape"&&this.dp.hide()})),vt(this,"onKeyUp",(O=>{this.removeKey(O.key)})),this.dp=A,this.opts=w,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:x}=this.dp;x.addEventListener("keydown",this.onKeyDown),x.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:x}=this.dp;x.removeEventListener("keydown",this.onKeyDown),x.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:x,currentView:A,selectedDates:w,parsedViewDate:{year:O,month:I}}=this.dp,$=x||w[w.length-1];if(!$)switch(A){case t.days:$=new Date(O,I,new Date().getDate());break;case t.months:$=new Date(O,I,1);break;case t.years:$=new Date(O,0,1)}return $}focusNextCell(x){let A=this.getInitialFocusDate(),{currentView:w}=this.dp,{days:O,months:I,years:$}=t,B=d(A),j=B.year,ee=B.month,ne=B.date;switch(x){case"ArrowLeft":w===O&&(ne-=1),w===I&&(ee-=1),w===$&&(j-=1);break;case"ArrowUp":w===O&&(ne-=7),w===I&&(ee-=3),w===$&&(j-=4);break;case"ArrowRight":w===O&&(ne+=1),w===I&&(ee+=1),w===$&&(j+=1);break;case"ArrowDown":w===O&&(ne+=7),w===I&&(ee+=3),w===$&&(j+=4)}let ae=this.dp.getClampedDate(new Date(j,ee,ne));this.dp.setFocusDate(ae,{viewDateTransition:!0})}registerKey(x){this.pressedKeys.add(x)}removeKey(x){this.pressedKeys.delete(x)}}let Uo={on(H,x){this.__events||(this.__events={}),this.__events[H]?this.__events[H].push(x):this.__events[H]=[x]},off(H,x){this.__events&&this.__events[H]&&(this.__events[H]=this.__events[H].filter((A=>A!==x)))},removeAllEvents(){this.__events={}},trigger(H){for(var x=arguments.length,A=new Array(x>1?x-1:0),w=1;w<x;w++)A[w-1]=arguments[w];this.__events&&this.__events[H]&&this.__events[H].forEach((O=>{O(...A)}))}};function xe(H,x,A){return(x=(function(w){var O=(function(I,$){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var j=B.call(I,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)})(w);return typeof O=="symbol"?O:String(O)})(x))in H?Object.defineProperty(H,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):H[x]=A,H}let Pi="",Me="",ve=!1;class pe{static buildGlobalContainer(x){ve=!0,Pi=a({className:x,id:x}),n("body").appendChild(Pi)}constructor(x,A){var w=this;if(xe(this,"viewIndexes",[t.days,t.months,t.years]),xe(this,"next",(()=>{let{year:$,month:B}=this.parsedViewDate;switch(this.currentView){case t.days:this.setViewDate(new Date($,B+1,1));break;case t.months:this.setViewDate(new Date($+1,B,1));break;case t.years:this.setViewDate(new Date($+10,0,1))}})),xe(this,"prev",(()=>{let{year:$,month:B}=this.parsedViewDate;switch(this.currentView){case t.days:this.setViewDate(new Date($,B-1,1));break;case t.months:this.setViewDate(new Date($-1,B,1));break;case t.years:this.setViewDate(new Date($-10,0,1))}})),xe(this,"_finishHide",(()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)})),xe(this,"setPosition",(function($){let B=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof($=$||w.opts.position)=="function")return void(w.customHide=$({$datepicker:w.$datepicker,$target:w.$el,$pointer:w.$pointer,isViewChange:B,done:w._finishHide}));let j,ee,{isMobile:ne}=w.opts,ae=w.$el.getBoundingClientRect(),de=w.$el.getBoundingClientRect(),Xe=w.$datepicker.offsetParent,Tr=w.$el.offsetParent,tr=w.$datepicker.getBoundingClientRect(),Hi=$.split(" "),jo=window.scrollY,Br=window.scrollX,ai=w.opts.offset,si=Hi[0],Fa=Hi[1];if(ne)w.$datepicker.style.cssText="left: 50%; top: 50%";else{if(Xe===Tr&&Xe!==document.body&&(de={top:w.$el.offsetTop,left:w.$el.offsetLeft,width:ae.width,height:w.$el.offsetHeight},jo=0,Br=0),Xe!==Tr&&Xe!==document.body){let go=Xe.getBoundingClientRect();de={top:ae.top-go.top,left:ae.left-go.left,width:ae.width,height:ae.height},jo=0,Br=0}switch(si){case"top":j=de.top-tr.height-ai;break;case"right":ee=de.left+de.width+ai;break;case"bottom":j=de.top+de.height+ai;break;case"left":ee=de.left-tr.width-ai}switch(Fa){case"top":j=de.top;break;case"right":ee=de.left+de.width-tr.width;break;case"bottom":j=de.top+de.height-tr.height;break;case"left":ee=de.left;break;case"center":/left|right/.test(si)?j=de.top+de.height/2-tr.height/2:ee=de.left+de.width/2-tr.width/2}w.$datepicker.style.cssText=`left: ${ee+Br}px; top: ${j+jo}px`}})),xe(this,"_setInputValue",(()=>{let{opts:$,$altField:B,locale:{dateFormat:j}}=this,{altFieldDateFormat:ee,altField:ne}=$;ne&&B&&(B.value=this._getInputValue(ee)),this.$el.value=this._getInputValue(j),this.$el.dispatchEvent(new Event("change"))})),xe(this,"_getInputValue",($=>{let{selectedDates:B,opts:j}=this,{multipleDates:ee,multipleDatesSeparator:ne}=j;if(!B.length)return"";let ae=typeof $=="function",de=ae?$(ee?B:B[0]):B.map((Xe=>this.formatDate(Xe,$)));return de=ae?de:de.join(ne),de})),xe(this,"_checkIfDateIsSelected",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.days,j=!1;return w.selectedDates.some((ee=>{let ne=g($,ee,B);return j=ne&&ee,ne})),j})),xe(this,"_scheduleCallAfterTransition",($=>{this._cancelScheduledCall(),$&&$(!1),this._onTransitionEnd=()=>{$&&$(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})})),xe(this,"_cancelScheduledCall",(()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)})),xe(this,"setViewDate",($=>{if(!(($=C($))instanceof Date)||g($,this.viewDate))return;let B=this.viewDate;this.viewDate=$;let{onChangeViewDate:j}=this.opts;if(j){let{month:ee,year:ne}=this.parsedViewDate;j({month:ee,year:ne,decade:this.curDecade})}this.trigger(t.eventChangeViewDate,$,B)})),xe(this,"setFocusDate",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!$||($=C($))instanceof Date)&&(w.focusDate=$,w.trigger(t.eventChangeFocusDate,$,B))})),xe(this,"setCurrentView",(function($){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(w.viewIndexes.includes($)){if(w.currentView=$,w.elIsInput&&w.visible&&w.setPosition(void 0,!0),w.trigger(t.eventChangeCurrentView,$),!w.views[$]){let j=w.views[$]=new Ve({dp:w,opts:w.opts,type:$});w.shouldUpdateDOM&&w.$content.appendChild(j.$el)}w.opts.onChangeView&&!B.silent&&w.opts.onChangeView($)}})),xe(this,"_updateLastSelectedDate",($=>{this.lastSelectedDate=$,this.trigger(t.eventChangeLastSelectedDate,$)})),xe(this,"destroy",(()=>{if(this.isDestroyed)return;let{showEvent:$,isMobile:B}=this.opts,j=this.$datepicker.parentNode;j&&j.removeChild(this.$datepicker),this.$el.removeEventListener($,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),B&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0})),xe(this,"update",(function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=R({},w.opts),{silent:ee}=B;R(w.opts,$);let{timepicker:ne,buttons:ae,range:de,selectedDates:Xe,isMobile:Tr}=w.opts,tr=w.visible||w.treatAsInline;w._createMinMaxDates(),w._limitViewDateByMaxMinDates(),w._handleLocale(),Xe&&(w.selectedDates=[],w.selectDate(Xe,{silent:ee})),$.view&&w.setCurrentView($.view,{silent:ee}),w._setInputValue(),j.range&&!de?(w.rangeDateTo=!1,w.rangeDateFrom=!1):!j.range&&de&&w.selectedDates.length&&(w.rangeDateFrom=w.selectedDates[0],w.rangeDateTo=w.selectedDates[1]),j.timepicker&&!ne?(tr&&w.timepicker.destroy(),w.timepicker=!1,w.$timepicker.parentNode.removeChild(w.$timepicker)):!j.timepicker&&ne&&w._addTimepicker(),!j.buttons&&ae?w._addButtons():j.buttons&&!ae?(w.buttons.destroy(),w.$buttons.parentNode.removeChild(w.$buttons)):tr&&j.buttons&&ae&&w.buttons.clearHtml().render(),!j.isMobile&&Tr?(w.treatAsInline||Me||w._createMobileOverlay(),w._addMobileAttributes(),w.visible&&w._showMobileOverlay()):j.isMobile&&!Tr&&(w._removeMobileAttributes(),w.visible&&(Me.classList.remove("-active-"),typeof w.opts.position!="function"&&w.setPosition())),tr&&(w.nav.update(),w.views[w.currentView].render(),w.currentView===t.days&&w.views[w.currentView].renderDayNames())})),xe(this,"disableDate",(($,B)=>{(Array.isArray($)?$:[$]).forEach((j=>{let ee=C(j);if(!ee)return;let ne=B?"delete":"add";this.disabledDates[ne](this.formatDate(ee,"yyyy-MM-dd"));let ae=this.getCell(ee,this.currentViewSingular);ae&&ae.adpCell.render()}),[])})),xe(this,"enableDate",($=>{this.disableDate($,!0)})),xe(this,"isDateDisabled",($=>{let B=C($);return this.disabledDates.has(this.formatDate(B,"yyyy-MM-dd"))})),xe(this,"isOtherMonth",($=>{let{month:B}=d($);return B!==this.parsedViewDate.month})),xe(this,"isOtherYear",($=>{let{year:B}=d($);return B!==this.parsedViewDate.year})),xe(this,"isOtherDecade",($=>{let{year:B}=d($),[j,ee]=f(this.viewDate);return B<j||B>ee})),xe(this,"_onChangeSelectedDate",($=>{let{silent:B}=$;setTimeout((()=>{this._setInputValue(),this.opts.onSelect&&!B&&this._triggerOnSelect()}))})),xe(this,"_onChangeFocusedDate",(function($){let{viewDateTransition:B}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!$)return;let j=!1;B&&(j=w.isOtherMonth($)||w.isOtherYear($)||w.isOtherDecade($)),j&&w.setViewDate($),w.opts.onFocus&&w.opts.onFocus({datepicker:w,date:$})})),xe(this,"_onChangeTime",($=>{let{hours:B,minutes:j}=$,ee=new Date,{lastSelectedDate:ne,opts:{onSelect:ae}}=this,de=ne;ne||(de=ee);let Xe=this.getCell(de,this.currentViewSingular),Tr=Xe&&Xe.adpCell;Tr&&Tr.isDisabled||(de.setHours(B),de.setMinutes(j),ne?(this._setInputValue(),ae&&this._triggerOnSelect()):this.selectDate(de))})),xe(this,"_onFocus",($=>{this.visible||this.show()})),xe(this,"_onBlur",($=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()})),xe(this,"_onMouseDown",($=>{this.inFocus=!0})),xe(this,"_onMouseUp",($=>{this.inFocus=!1,this.$el.focus()})),xe(this,"_onResize",(()=>{this.visible&&typeof this.opts.position!="function"&&this.setPosition()})),xe(this,"_onClickOverlay",(()=>{this.visible&&this.hide()})),xe(this,"getViewDates",(function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.days;return Ve.getDatesFunction($)(w)})),xe(this,"isWeekend",($=>this.opts.weekends.includes($))),xe(this,"getClampedDate",($=>{let{minDate:B,maxDate:j}=this,ee=$;return j&&v($,j)?ee=j:B&&y($,B)&&(ee=B),ee})),this.$el=n(x),!this.$el)return;this.$datepicker=a({className:"air-datepicker"}),this.opts=R({},r,A),this.$customContainer=!!this.opts.container&&n(this.opts.container),this.$altField=n(this.opts.altField||!1);let{view:O,startDate:I}=this.opts;I||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=C(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=O,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:x,treatAsInline:A,opts:{inline:w,isMobile:O,selectedDates:I,keyboardNav:$,onlyTimepicker:B}}=this,j=n("body");(!ve||ve&&Pi&&!j.contains(Pi))&&!w&&this.elIsInput&&!this.$customContainer&&pe.buildGlobalContainer(pe.defaultGlobalContainerId),!O||Me||A||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(w||this._bindEvents(),$&&!B&&(this.keyboardNav=new Cn({dp:this,opts:x}))),I&&this.selectDate(I,{silent:!0}),this.opts.visible&&!A&&this.show(),O&&!A&&this.$el.setAttribute("readonly",!0),A&&this._createComponents()}_createMobileOverlay(){Me=a({className:"air-datepicker-overlay"}),Pi.appendChild(Me)}_createComponents(){let{opts:x,treatAsInline:A,opts:{inline:w,buttons:O,timepicker:I,position:$,classes:B,onlyTimepicker:j,isMobile:ee}}=this;this._buildBaseHtml(),this.elIsInput&&(w||this._setPositionClasses($)),!w&&this.elIsInput||this.$datepicker.classList.add("-inline-"),B&&this.$datepicker.classList.add(...B.split(" ")),j&&this.$datepicker.classList.add("-only-timepicker-"),ee&&!A&&this._addMobileAttributes(),this.views[this.currentView]=new Ve({dp:this,type:this.currentView,opts:x}),this.nav=new Wt({dp:this,opts:x}),I&&this._addTimepicker(),O&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let x in this.views)this.views[x].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){Me.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){Me.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||this.initialReadonly===""||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:x,maxDate:A}=this.opts;this.minDate=!!x&&C(x),this.maxDate=!!A&&C(A)}_addTimepicker(){this.$timepicker=a({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new At({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=a({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new yr({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(t.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(t.eventChangeFocusDate,this._onChangeFocusedDate),this.on(t.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:x}=this.opts;var A,w;this.elIsInput?x?(A=this.$datepicker,(w=this.$el).parentNode.insertBefore(A,w.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=n(".air-datepicker--content",this.$datepicker),this.$pointer=n(".air-datepicker--pointer",this.$datepicker),this.$nav=n(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:x,dateFormat:A,firstDay:w,timepicker:O,onlyTimepicker:I,timeFormat:$,dateTimeSeparator:B}=this.opts;var j;this.locale=(j=x,JSON.parse(JSON.stringify(j))),A&&(this.locale.dateFormat=A),$!==void 0&&$!==""&&(this.locale.timeFormat=$);let{timeFormat:ee}=this.locale;if(w!==""&&(this.locale.firstDay=w),O&&typeof A!="function"){let ne=ee?B:"";this.locale.dateFormat=[this.locale.dateFormat,ee||""].join(ne)}I&&typeof A!="function"&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(x){if(typeof x=="function")return void this.$datepicker.classList.add("-custom-position-");let A=(x=x.split(" "))[0],w=`air-datepicker -${A}-${x[1]}- -from-${A}-`;this.$datepicker.classList.add(...w.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:x,minDate:A,maxDate:w}=this;w&&v(x,w)&&this.setViewDate(w),A&&y(x,A)&&this.setViewDate(A)}formatDate(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.viewDate,A=arguments.length>1?arguments[1]:void 0;if(x=C(x),!(x instanceof Date))return;let w=A,O=this.locale,I=d(x),$=I.dayPeriod,B=f(x),j=pe.replacer,ee={T:x.getTime(),m:I.minutes,mm:I.fullMinutes,h:I.hours12,hh:I.fullHours12,H:I.hours,HH:I.fullHours,aa:$,AA:$.toUpperCase(),E:O.daysShort[I.day],EEEE:O.days[I.day],d:I.date,dd:I.fullDate,M:I.month+1,MM:I.fullMonth,MMM:O.monthsShort[I.month],MMMM:O.months[I.month],yy:I.year.toString().slice(-2),yyyy:I.year,yyyy1:B[0],yyyy2:B[1]};for(let[ne,ae]of Object.entries(ee))w=j(w,L(ne),ae);return w}down(x){this._handleUpDownActions(x,"down")}up(x){this._handleUpDownActions(x,"up")}selectDate(x){let A,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{currentView:O,parsedViewDate:I,selectedDates:$}=this,{updateTime:B,silent:j}=w,{moveToOtherMonthsOnSelect:ee,moveToOtherYearsOnSelect:ne,multipleDates:ae,range:de,autoClose:Xe,onBeforeSelect:Tr}=this.opts,tr=$.length;if(Array.isArray(x))return x.forEach((Hi=>{this.selectDate(Hi,w)})),new Promise((Hi=>{setTimeout(Hi)}));if((x=C(x))instanceof Date){if(Tr&&!j&&!Tr({date:x,datepicker:this}))return Promise.resolve();if(O===t.days&&x.getMonth()!==I.month&&ee&&(A=new Date(x.getFullYear(),x.getMonth(),1)),O===t.years&&x.getFullYear()!==I.year&&ne&&(A=new Date(x.getFullYear(),0,1)),A&&this.setViewDate(A),ae&&!de){if(tr===ae)return;this._checkIfDateIsSelected(x)||$.push(x)}else if(de)switch(tr){case 1:$.push(x),this.rangeDateTo||(this.rangeDateTo=x),v(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=x),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[x],this.rangeDateFrom=x,this.rangeDateTo="";break;default:this.selectedDates=[x],this.rangeDateFrom=x}else this.selectedDates=[x];return this.trigger(t.eventChangeSelectedDate,{action:t.actionSelectDate,silent:w?.silent,date:x,updateTime:B}),this._updateLastSelectedDate(x),Xe&&!this.timepickerIsActive&&this.visible&&(ae||de?de&&tr===1&&this.hide():this.hide()),new Promise((Hi=>{setTimeout(Hi)}))}}unselectDate(x){let A=this.selectedDates,w=this;if((x=C(x))instanceof Date)return A.some(((O,I)=>{if(g(O,x))return A.splice(I,1),w.selectedDates.length?(w.rangeDateTo="",w.rangeDateFrom=A[0],w._updateLastSelectedDate(w.selectedDates[w.selectedDates.length-1])):(w.rangeDateFrom="",w.rangeDateTo="",w._updateLastSelectedDate(!1)),this.trigger(t.eventChangeSelectedDate,{action:t.actionUnselectDate,date:x}),!0}))}replaceDate(x,A){let w=this.selectedDates.find((I=>g(I,x,this.currentView))),O=this.selectedDates.indexOf(w);O<0||g(this.selectedDates[O],A,this.currentView)||(this.selectedDates[O]=A,this.trigger(t.eventChangeSelectedDate,{action:t.actionSelectDate,date:A,updateTime:!0}),this._updateLastSelectedDate(A))}clear(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(t.eventChangeSelectedDate,{action:t.actionUnselectDate,silent:x.silent}),new Promise((A=>{setTimeout(A)}))}show(){let{onShow:x,isMobile:A}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,x&&this._scheduleCallAfterTransition(x),A&&this._showMobileOverlay()}hide(){let{onHide:x,isMobile:A}=this.opts,w=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition((O=>{!this.customHide&&(O&&w||!O&&!w)&&this._finishHide(),x&&x(O)})),A&&Me.classList.remove("-active-")}_triggerOnSelect(){let x=[],A=[],{selectedDates:w,locale:O,opts:{onSelect:I,multipleDates:$,range:B}}=this,j=$||B,ee=typeof O.dateFormat=="function";w.length&&(x=w.map(_),A=ee?$?O.dateFormat(x):x.map((ne=>O.dateFormat(ne))):x.map((ne=>this.formatDate(ne,O.dateFormat)))),I({date:j?x:x[0],formattedDate:j?A:A[0],datepicker:this})}_handleAlreadySelectedDates(x,A){let{selectedDates:w,rangeDateFrom:O,rangeDateTo:I}=this,{range:$,toggleSelected:B}=this.opts,j=w.length,ee=typeof B=="function"?B({datepicker:this,date:A}):B,ne=!!($&&j===1&&x),ae=ne?_(A):A;$&&!ee&&(j!==2&&this.selectDate(ae),j===2&&g(O,I))||(ee?this.unselectDate(ae):this._updateLastSelectedDate(ne?ae:x))}_handleUpDownActions(x,A){if(!((x=C(x||this.focusDate||this.viewDate))instanceof Date))return;let w=A==="up"?this.viewIndex+1:this.viewIndex-1;w>2&&(w=2),w<0&&(w=0),this.setViewDate(new Date(x.getFullYear(),x.getMonth(),1)),this.setCurrentView(this.viewIndexes[w])}getCell(x){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.day;if(!((x=C(x))instanceof Date))return;let{year:w,month:O,date:I}=d(x),$=`[data-year="${w}"]`,B=`[data-month="${O}"]`,j={[t.day]:`${$}${B}[data-date="${I}"]`,[t.month]:`${$}${B}`,[t.year]:`${$}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(j[A]):void 0}_showMobileOverlay(){Me.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce(((x,A)=>parseFloat(A)+x),0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return d(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return f(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===t.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===t.days}get $container(){return this.$customContainer||Pi}static replacer(x,A,w){return x.replace(A,(function(O,I,$,B){return I+w+B}))}}var Te;return xe(pe,"defaults",r),xe(pe,"version","3.6.0"),xe(pe,"defaultGlobalContainerId","air-datepicker-global-container"),Te=pe.prototype,Object.assign(Te,Uo),i.default})()}))});var $w=bo((Sle,Tw)=>{var Yi=-1,di=1,fr=0;function Qc(o,i,t,r,n){if(o===i)return o?[[fr,o]]:[];if(t!=null){var a=_E(o,i,t);if(a)return a}var s=Zf(o,i),l=o.substring(0,s);o=o.substring(s),i=i.substring(s),s=_h(o,i);var d=o.substring(o.length-s);o=o.substring(0,o.length-s),i=i.substring(0,i.length-s);var h=mE(o,i);return l&&h.unshift([fr,l]),d&&h.push([fr,d]),eg(h,n),r&&bE(h),h}function mE(o,i){var t;if(!o)return[[di,i]];if(!i)return[[Yi,o]];var r=o.length>i.length?o:i,n=o.length>i.length?i:o,a=r.indexOf(n);if(a!==-1)return t=[[di,r.substring(0,a)],[fr,n],[di,r.substring(a+n.length)]],o.length>i.length&&(t[0][0]=t[2][0]=Yi),t;if(n.length===1)return[[Yi,o],[di,i]];var s=gE(o,i);if(s){var l=s[0],d=s[1],h=s[2],m=s[3],f=s[4],b=Qc(l,h),g=Qc(d,m);return b.concat([[fr,f]],g)}return fE(o,i)}function fE(o,i){for(var t=o.length,r=i.length,n=Math.ceil((t+r)/2),a=n,s=2*n,l=new Array(s),d=new Array(s),h=0;h<s;h++)l[h]=-1,d[h]=-1;l[a+1]=0,d[a+1]=0;for(var m=t-r,f=m%2!==0,b=0,g=0,v=0,y=0,_=0;_<n;_++){for(var E=-_+b;E<=_-g;E+=2){var N=a+E,G;E===-_||E!==_&&l[N-1]<l[N+1]?G=l[N+1]:G=l[N-1]+1;for(var R=G-E;G<t&&R<r&&o.charAt(G)===i.charAt(R);)G++,R++;if(l[N]=G,G>t)g+=2;else if(R>r)b+=2;else if(f){var C=a+m-E;if(C>=0&&C<s&&d[C]!==-1){var L=t-d[C];if(G>=L)return yw(o,i,G,R)}}}for(var M=-_+v;M<=_-y;M+=2){var C=a+M,L;M===-_||M!==_&&d[C-1]<d[C+1]?L=d[C+1]:L=d[C-1]+1;for(var Y=L-M;L<t&&Y<r&&o.charAt(t-L-1)===i.charAt(r-Y-1);)L++,Y++;if(d[C]=L,L>t)y+=2;else if(Y>r)v+=2;else if(!f){var N=a+m-M;if(N>=0&&N<s&&l[N]!==-1){var G=l[N],R=a+G-N;if(L=t-L,G>=L)return yw(o,i,G,R)}}}}return[[Yi,o],[di,i]]}function yw(o,i,t,r){var n=o.substring(0,t),a=i.substring(0,r),s=o.substring(t),l=i.substring(r),d=Qc(n,a),h=Qc(s,l);return d.concat(h)}function Zf(o,i){if(!o||!i||o.charAt(0)!==i.charAt(0))return 0;for(var t=0,r=Math.min(o.length,i.length),n=r,a=0;t<n;)o.substring(a,n)==i.substring(a,n)?(t=n,a=t):r=n,n=Math.floor((r-t)/2+t);return kw(o.charCodeAt(n-1))&&n--,n}function xw(o,i){var t=o.length,r=i.length;if(t==0||r==0)return 0;t>r?o=o.substring(t-r):t<r&&(i=i.substring(0,t));var n=Math.min(t,r);if(o==i)return n;for(var a=0,s=1;;){var l=o.substring(n-s),d=i.indexOf(l);if(d==-1)return a;s+=d,(d==0||o.substring(n-s)==i.substring(0,s))&&(a=s,s++)}}function _h(o,i){if(!o||!i||o.slice(-1)!==i.slice(-1))return 0;for(var t=0,r=Math.min(o.length,i.length),n=r,a=0;t<n;)o.substring(o.length-n,o.length-a)==i.substring(i.length-n,i.length-a)?(t=n,a=t):r=n,n=Math.floor((r-t)/2+t);return Sw(o.charCodeAt(o.length-n))&&n--,n}function gE(o,i){var t=o.length>i.length?o:i,r=o.length>i.length?i:o;if(t.length<4||r.length*2<t.length)return null;function n(g,v,y){for(var _=g.substring(y,y+Math.floor(g.length/4)),E=-1,N="",G,R,C,L;(E=v.indexOf(_,E+1))!==-1;){var M=Zf(g.substring(y),v.substring(E)),Y=_h(g.substring(0,y),v.substring(0,E));N.length<Y+M&&(N=v.substring(E-Y,E)+v.substring(E,E+M),G=g.substring(0,y-Y),R=g.substring(y+M),C=v.substring(0,E-Y),L=v.substring(E+M))}return N.length*2>=g.length?[G,R,C,L,N]:null}var a=n(t,r,Math.ceil(t.length/4)),s=n(t,r,Math.ceil(t.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var d,h,m,f;o.length>i.length?(d=l[0],h=l[1],m=l[2],f=l[3]):(m=l[0],f=l[1],d=l[2],h=l[3]);var b=l[4];return[d,h,m,f,b]}function bE(o){for(var i=!1,t=[],r=0,n=null,a=0,s=0,l=0,d=0,h=0;a<o.length;)o[a][0]==fr?(t[r++]=a,s=d,l=h,d=0,h=0,n=o[a][1]):(o[a][0]==di?d+=o[a][1].length:h+=o[a][1].length,n&&n.length<=Math.max(s,l)&&n.length<=Math.max(d,h)&&(o.splice(t[r-1],0,[Yi,n]),o[t[r-1]+1][0]=di,r--,r--,a=r>0?t[r-1]:-1,s=0,l=0,d=0,h=0,n=null,i=!0)),a++;for(i&&eg(o),xE(o),a=1;a<o.length;){if(o[a-1][0]==Yi&&o[a][0]==di){var m=o[a-1][1],f=o[a][1],b=xw(m,f),g=xw(f,m);b>=g?(b>=m.length/2||b>=f.length/2)&&(o.splice(a,0,[fr,f.substring(0,b)]),o[a-1][1]=m.substring(0,m.length-b),o[a+1][1]=f.substring(b),a++):(g>=m.length/2||g>=f.length/2)&&(o.splice(a,0,[fr,m.substring(0,g)]),o[a-1][0]=di,o[a-1][1]=f.substring(0,f.length-g),o[a+1][0]=Yi,o[a+1][1]=m.substring(g),a++),a++}a++}}var ww=/[^a-zA-Z0-9]/,_w=/\s/,zw=/[\r\n]/,vE=/\n\r?\n$/,yE=/^\r?\n\r?\n/;function xE(o){function i(g,v){if(!g||!v)return 6;var y=g.charAt(g.length-1),_=v.charAt(0),E=y.match(ww),N=_.match(ww),G=E&&y.match(_w),R=N&&_.match(_w),C=G&&y.match(zw),L=R&&_.match(zw),M=C&&g.match(vE),Y=L&&v.match(yE);return M||Y?5:C||L?4:E&&!G&&R?3:G||R?2:E||N?1:0}for(var t=1;t<o.length-1;){if(o[t-1][0]==fr&&o[t+1][0]==fr){var r=o[t-1][1],n=o[t][1],a=o[t+1][1],s=_h(r,n);if(s){var l=n.substring(n.length-s);r=r.substring(0,r.length-s),n=l+n.substring(0,n.length-s),a=l+a}for(var d=r,h=n,m=a,f=i(r,n)+i(n,a);n.charAt(0)===a.charAt(0);){r+=n.charAt(0),n=n.substring(1)+a.charAt(0),a=a.substring(1);var b=i(r,n)+i(n,a);b>=f&&(f=b,d=r,h=n,m=a)}o[t-1][1]!=d&&(d?o[t-1][1]=d:(o.splice(t-1,1),t--),o[t][1]=h,m?o[t+1][1]=m:(o.splice(t+1,1),t--))}t++}}function eg(o,i){o.push([fr,""]);for(var t=0,r=0,n=0,a="",s="",l;t<o.length;){if(t<o.length-1&&!o[t][1]){o.splice(t,1);continue}switch(o[t][0]){case di:n++,s+=o[t][1],t++;break;case Yi:r++,a+=o[t][1],t++;break;case fr:var d=t-n-r-1;if(i){if(d>=0&&Ew(o[d][1])){var h=o[d][1].slice(-1);if(o[d][1]=o[d][1].slice(0,-1),a=h+a,s=h+s,!o[d][1]){o.splice(d,1),t--;var m=d-1;o[m]&&o[m][0]===di&&(n++,s=o[m][1]+s,m--),o[m]&&o[m][0]===Yi&&(r++,a=o[m][1]+a,m--),d=m}}if(Cw(o[t][1])){var h=o[t][1].charAt(0);o[t][1]=o[t][1].slice(1),a+=h,s+=h}}if(t<o.length-1&&!o[t][1]){o.splice(t,1);break}if(a.length>0||s.length>0){a.length>0&&s.length>0&&(l=Zf(s,a),l!==0&&(d>=0?o[d][1]+=s.substring(0,l):(o.splice(0,0,[fr,s.substring(0,l)]),t++),s=s.substring(l),a=a.substring(l)),l=_h(s,a),l!==0&&(o[t][1]=s.substring(s.length-l)+o[t][1],s=s.substring(0,s.length-l),a=a.substring(0,a.length-l)));var f=n+r;a.length===0&&s.length===0?(o.splice(t-f,f),t=t-f):a.length===0?(o.splice(t-f,f,[di,s]),t=t-f+1):s.length===0?(o.splice(t-f,f,[Yi,a]),t=t-f+1):(o.splice(t-f,f,[Yi,a],[di,s]),t=t-f+2)}t!==0&&o[t-1][0]===fr?(o[t-1][1]+=o[t][1],o.splice(t,1)):t++,n=0,r=0,a="",s="";break}}o[o.length-1][1]===""&&o.pop();var b=!1;for(t=1;t<o.length-1;)o[t-1][0]===fr&&o[t+1][0]===fr&&(o[t][1].substring(o[t][1].length-o[t-1][1].length)===o[t-1][1]?(o[t][1]=o[t-1][1]+o[t][1].substring(0,o[t][1].length-o[t-1][1].length),o[t+1][1]=o[t-1][1]+o[t+1][1],o.splice(t-1,1),b=!0):o[t][1].substring(0,o[t+1][1].length)==o[t+1][1]&&(o[t-1][1]+=o[t+1][1],o[t][1]=o[t][1].substring(o[t+1][1].length)+o[t+1][1],o.splice(t+1,1),b=!0)),t++;b&&eg(o,i)}function kw(o){return o>=55296&&o<=56319}function Sw(o){return o>=56320&&o<=57343}function Cw(o){return Sw(o.charCodeAt(0))}function Ew(o){return kw(o.charCodeAt(o.length-1))}function wE(o){for(var i=[],t=0;t<o.length;t++)o[t][1].length>0&&i.push(o[t]);return i}function Jf(o,i,t,r){return Ew(o)||Cw(r)?null:wE([[fr,o],[Yi,i],[di,t],[fr,r]])}function _E(o,i,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,n=typeof t=="number"?null:t.newRange,a=o.length,s=i.length;if(r.length===0&&(n===null||n.length===0)){var l=r.index,d=o.slice(0,l),h=o.slice(l),m=n?n.index:null;e:{var f=l+s-a;if(m!==null&&m!==f||f<0||f>s)break e;var b=i.slice(0,f),g=i.slice(f);if(g!==h)break e;var v=Math.min(l,f),y=d.slice(0,v),_=b.slice(0,v);if(y!==_)break e;var E=d.slice(v),N=b.slice(v);return Jf(y,E,N,h)}e:{if(m!==null&&m!==l)break e;var G=l,b=i.slice(0,G),g=i.slice(G);if(b!==d)break e;var R=Math.min(a-G,s-G),C=h.slice(h.length-R),L=g.slice(g.length-R);if(C!==L)break e;var E=h.slice(0,h.length-R),N=g.slice(0,g.length-R);return Jf(d,E,N,C)}}if(r.length>0&&n&&n.length===0)e:{var y=o.slice(0,r.index),C=o.slice(r.index+r.length),v=y.length,R=C.length;if(s<v+R)break e;var _=i.slice(0,v),L=i.slice(s-R);if(y!==_||C!==L)break e;var E=o.slice(v,a-R),N=i.slice(v,s-R);return Jf(y,E,N,C)}return null}function zh(o,i,t,r){return Qc(o,i,t,r,!0)}zh.INSERT=di;zh.DELETE=Yi;zh.EQUAL=fr;Tw.exports=zh});var fg=bo((Jc,gl)=>{var zE=200,Fw="__lodash_hash_undefined__",Bw=9007199254740991,lg="[object Arguments]",kE="[object Array]",Vw="[object Boolean]",Uw="[object Date]",SE="[object Error]",cg="[object Function]",jw="[object GeneratorFunction]",kh="[object Map]",Gw="[object Number]",dg="[object Object]",Aw="[object Promise]",Ww="[object RegExp]",Sh="[object Set]",Kw="[object String]",Yw="[object Symbol]",rg="[object WeakMap]",Xw="[object ArrayBuffer]",Ch="[object DataView]",Qw="[object Float32Array]",Jw="[object Float64Array]",Zw="[object Int8Array]",e_="[object Int16Array]",t_="[object Int32Array]",r_="[object Uint8Array]",i_="[object Uint8ClampedArray]",n_="[object Uint16Array]",o_="[object Uint32Array]",CE=/[\\^$.*+?()[\]{}|]/g,EE=/\w*$/,TE=/^\[object .+?Constructor\]$/,$E=/^(?:0|[1-9]\d*)$/,gt={};gt[lg]=gt[kE]=gt[Xw]=gt[Ch]=gt[Vw]=gt[Uw]=gt[Qw]=gt[Jw]=gt[Zw]=gt[e_]=gt[t_]=gt[kh]=gt[Gw]=gt[dg]=gt[Ww]=gt[Sh]=gt[Kw]=gt[Yw]=gt[r_]=gt[i_]=gt[n_]=gt[o_]=!0;gt[SE]=gt[cg]=gt[rg]=!1;var AE=typeof global=="object"&&global&&global.Object===Object&&global,LE=typeof self=="object"&&self&&self.Object===Object&&self,So=AE||LE||Function("return this")(),a_=typeof Jc=="object"&&Jc&&!Jc.nodeType&&Jc,Lw=a_&&typeof gl=="object"&&gl&&!gl.nodeType&&gl,ME=Lw&&Lw.exports===a_;function IE(o,i){return o.set(i[0],i[1]),o}function qE(o,i){return o.add(i),o}function RE(o,i){for(var t=-1,r=o?o.length:0;++t<r&&i(o[t],t,o)!==!1;);return o}function DE(o,i){for(var t=-1,r=i.length,n=o.length;++t<r;)o[n+t]=i[t];return o}function s_(o,i,t,r){var n=-1,a=o?o.length:0;for(r&&a&&(t=o[++n]);++n<a;)t=i(t,o[n],n,o);return t}function OE(o,i){for(var t=-1,r=Array(o);++t<o;)r[t]=i(t);return r}function NE(o,i){return o?.[i]}function l_(o){var i=!1;if(o!=null&&typeof o.toString!="function")try{i=!!(o+"")}catch{}return i}function Mw(o){var i=-1,t=Array(o.size);return o.forEach(function(r,n){t[++i]=[n,r]}),t}function pg(o,i){return function(t){return o(i(t))}}function Iw(o){var i=-1,t=Array(o.size);return o.forEach(function(r){t[++i]=r}),t}var PE=Array.prototype,HE=Function.prototype,Eh=Object.prototype,tg=So["__core-js_shared__"],qw=(function(){var o=/[^.]+$/.exec(tg&&tg.keys&&tg.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),c_=HE.toString,da=Eh.hasOwnProperty,Th=Eh.toString,FE=RegExp("^"+c_.call(da).replace(CE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rw=ME?So.Buffer:void 0,Dw=So.Symbol,Ow=So.Uint8Array,BE=pg(Object.getPrototypeOf,Object),VE=Object.create,UE=Eh.propertyIsEnumerable,jE=PE.splice,Nw=Object.getOwnPropertySymbols,GE=Rw?Rw.isBuffer:void 0,WE=pg(Object.keys,Object),ig=yl(So,"DataView"),Zc=yl(So,"Map"),ng=yl(So,"Promise"),og=yl(So,"Set"),ag=yl(So,"WeakMap"),ed=yl(Object,"create"),KE=ps(ig),YE=ps(Zc),XE=ps(ng),QE=ps(og),JE=ps(ag),Pw=Dw?Dw.prototype:void 0,Hw=Pw?Pw.valueOf:void 0;function ds(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function ZE(){this.__data__=ed?ed(null):{}}function e6(o){return this.has(o)&&delete this.__data__[o]}function t6(o){var i=this.__data__;if(ed){var t=i[o];return t===Fw?void 0:t}return da.call(i,o)?i[o]:void 0}function r6(o){var i=this.__data__;return ed?i[o]!==void 0:da.call(i,o)}function i6(o,i){var t=this.__data__;return t[o]=ed&&i===void 0?Fw:i,this}ds.prototype.clear=ZE;ds.prototype.delete=e6;ds.prototype.get=t6;ds.prototype.has=r6;ds.prototype.set=i6;function Co(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function n6(){this.__data__=[]}function o6(o){var i=this.__data__,t=$h(i,o);if(t<0)return!1;var r=i.length-1;return t==r?i.pop():jE.call(i,t,1),!0}function a6(o){var i=this.__data__,t=$h(i,o);return t<0?void 0:i[t][1]}function s6(o){return $h(this.__data__,o)>-1}function l6(o,i){var t=this.__data__,r=$h(t,o);return r<0?t.push([o,i]):t[r][1]=i,this}Co.prototype.clear=n6;Co.prototype.delete=o6;Co.prototype.get=a6;Co.prototype.has=s6;Co.prototype.set=l6;function bl(o){var i=-1,t=o?o.length:0;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function c6(){this.__data__={hash:new ds,map:new(Zc||Co),string:new ds}}function d6(o){return Ah(this,o).delete(o)}function p6(o){return Ah(this,o).get(o)}function h6(o){return Ah(this,o).has(o)}function u6(o,i){return Ah(this,o).set(o,i),this}bl.prototype.clear=c6;bl.prototype.delete=d6;bl.prototype.get=p6;bl.prototype.has=h6;bl.prototype.set=u6;function vl(o){this.__data__=new Co(o)}function m6(){this.__data__=new Co}function f6(o){return this.__data__.delete(o)}function g6(o){return this.__data__.get(o)}function b6(o){return this.__data__.has(o)}function v6(o,i){var t=this.__data__;if(t instanceof Co){var r=t.__data__;if(!Zc||r.length<zE-1)return r.push([o,i]),this;t=this.__data__=new bl(r)}return t.set(o,i),this}vl.prototype.clear=m6;vl.prototype.delete=f6;vl.prototype.get=g6;vl.prototype.has=b6;vl.prototype.set=v6;function y6(o,i){var t=ug(o)||V6(o)?OE(o.length,String):[],r=t.length,n=!!r;for(var a in o)(i||da.call(o,a))&&!(n&&(a=="length"||P6(a,r)))&&t.push(a);return t}function d_(o,i,t){var r=o[i];(!(da.call(o,i)&&m_(r,t))||t===void 0&&!(i in o))&&(o[i]=t)}function $h(o,i){for(var t=o.length;t--;)if(m_(o[t][0],i))return t;return-1}function x6(o,i){return o&&p_(i,mg(i),o)}function sg(o,i,t,r,n,a,s){var l;if(r&&(l=a?r(o,n,a,s):r(o)),l!==void 0)return l;if(!Lh(o))return o;var d=ug(o);if(d){if(l=D6(o),!i)return I6(o,l)}else{var h=cs(o),m=h==cg||h==jw;if(j6(o))return C6(o,i);if(h==dg||h==lg||m&&!a){if(l_(o))return a?o:{};if(l=O6(m?{}:o),!i)return q6(o,x6(l,o))}else{if(!gt[h])return a?o:{};l=N6(o,h,sg,i)}}s||(s=new vl);var f=s.get(o);if(f)return f;if(s.set(o,l),!d)var b=t?R6(o):mg(o);return RE(b||o,function(g,v){b&&(v=g,g=o[v]),d_(l,v,sg(g,i,t,r,v,o,s))}),l}function w6(o){return Lh(o)?VE(o):{}}function _6(o,i,t){var r=i(o);return ug(o)?r:DE(r,t(o))}function z6(o){return Th.call(o)}function k6(o){if(!Lh(o)||F6(o))return!1;var i=g_(o)||l_(o)?FE:TE;return i.test(ps(o))}function S6(o){if(!u_(o))return WE(o);var i=[];for(var t in Object(o))da.call(o,t)&&t!="constructor"&&i.push(t);return i}function C6(o,i){if(i)return o.slice();var t=new o.constructor(o.length);return o.copy(t),t}function hg(o){var i=new o.constructor(o.byteLength);return new Ow(i).set(new Ow(o)),i}function E6(o,i){var t=i?hg(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.byteLength)}function T6(o,i,t){var r=i?t(Mw(o),!0):Mw(o);return s_(r,IE,new o.constructor)}function $6(o){var i=new o.constructor(o.source,EE.exec(o));return i.lastIndex=o.lastIndex,i}function A6(o,i,t){var r=i?t(Iw(o),!0):Iw(o);return s_(r,qE,new o.constructor)}function L6(o){return Hw?Object(Hw.call(o)):{}}function M6(o,i){var t=i?hg(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.length)}function I6(o,i){var t=-1,r=o.length;for(i||(i=Array(r));++t<r;)i[t]=o[t];return i}function p_(o,i,t,r){t||(t={});for(var n=-1,a=i.length;++n<a;){var s=i[n],l=r?r(t[s],o[s],s,t,o):void 0;d_(t,s,l===void 0?o[s]:l)}return t}function q6(o,i){return p_(o,h_(o),i)}function R6(o){return _6(o,mg,h_)}function Ah(o,i){var t=o.__data__;return H6(i)?t[typeof i=="string"?"string":"hash"]:t.map}function yl(o,i){var t=NE(o,i);return k6(t)?t:void 0}var h_=Nw?pg(Nw,Object):K6,cs=z6;(ig&&cs(new ig(new ArrayBuffer(1)))!=Ch||Zc&&cs(new Zc)!=kh||ng&&cs(ng.resolve())!=Aw||og&&cs(new og)!=Sh||ag&&cs(new ag)!=rg)&&(cs=function(o){var i=Th.call(o),t=i==dg?o.constructor:void 0,r=t?ps(t):void 0;if(r)switch(r){case KE:return Ch;case YE:return kh;case XE:return Aw;case QE:return Sh;case JE:return rg}return i});function D6(o){var i=o.length,t=o.constructor(i);return i&&typeof o[0]=="string"&&da.call(o,"index")&&(t.index=o.index,t.input=o.input),t}function O6(o){return typeof o.constructor=="function"&&!u_(o)?w6(BE(o)):{}}function N6(o,i,t,r){var n=o.constructor;switch(i){case Xw:return hg(o);case Vw:case Uw:return new n(+o);case Ch:return E6(o,r);case Qw:case Jw:case Zw:case e_:case t_:case r_:case i_:case n_:case o_:return M6(o,r);case kh:return T6(o,r,t);case Gw:case Kw:return new n(o);case Ww:return $6(o);case Sh:return A6(o,r,t);case Yw:return L6(o)}}function P6(o,i){return i=i??Bw,!!i&&(typeof o=="number"||$E.test(o))&&o>-1&&o%1==0&&o<i}function H6(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}function F6(o){return!!qw&&qw in o}function u_(o){var i=o&&o.constructor,t=typeof i=="function"&&i.prototype||Eh;return o===t}function ps(o){if(o!=null){try{return c_.call(o)}catch{}try{return o+""}catch{}}return""}function B6(o){return sg(o,!0,!0)}function m_(o,i){return o===i||o!==o&&i!==i}function V6(o){return U6(o)&&da.call(o,"callee")&&(!UE.call(o,"callee")||Th.call(o)==lg)}var ug=Array.isArray;function f_(o){return o!=null&&G6(o.length)&&!g_(o)}function U6(o){return W6(o)&&f_(o)}var j6=GE||Y6;function g_(o){var i=Lh(o)?Th.call(o):"";return i==cg||i==jw}function G6(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Bw}function Lh(o){var i=typeof o;return!!o&&(i=="object"||i=="function")}function W6(o){return!!o&&typeof o=="object"}function mg(o){return f_(o)?y6(o):S6(o)}function K6(){return[]}function Y6(){return!1}gl.exports=B6});var Eg=bo((td,wl)=>{var X6=200,Cg="__lodash_hash_undefined__",Ph=1,T_=2,$_=9007199254740991,Mh="[object Arguments]",yg="[object Array]",Q6="[object AsyncFunction]",A_="[object Boolean]",L_="[object Date]",M_="[object Error]",I_="[object Function]",J6="[object GeneratorFunction]",Ih="[object Map]",q_="[object Number]",Z6="[object Null]",xl="[object Object]",b_="[object Promise]",e7="[object Proxy]",R_="[object RegExp]",qh="[object Set]",D_="[object String]",t7="[object Symbol]",r7="[object Undefined]",xg="[object WeakMap]",O_="[object ArrayBuffer]",Rh="[object DataView]",i7="[object Float32Array]",n7="[object Float64Array]",o7="[object Int8Array]",a7="[object Int16Array]",s7="[object Int32Array]",l7="[object Uint8Array]",c7="[object Uint8ClampedArray]",d7="[object Uint16Array]",p7="[object Uint32Array]",h7=/[\\^$.*+?()[\]{}|]/g,u7=/^\[object .+?Constructor\]$/,m7=/^(?:0|[1-9]\d*)$/,wt={};wt[i7]=wt[n7]=wt[o7]=wt[a7]=wt[s7]=wt[l7]=wt[c7]=wt[d7]=wt[p7]=!0;wt[Mh]=wt[yg]=wt[O_]=wt[A_]=wt[Rh]=wt[L_]=wt[M_]=wt[I_]=wt[Ih]=wt[q_]=wt[xl]=wt[R_]=wt[qh]=wt[D_]=wt[xg]=!1;var N_=typeof global=="object"&&global&&global.Object===Object&&global,f7=typeof self=="object"&&self&&self.Object===Object&&self,Eo=N_||f7||Function("return this")(),P_=typeof td=="object"&&td&&!td.nodeType&&td,v_=P_&&typeof wl=="object"&&wl&&!wl.nodeType&&wl,H_=v_&&v_.exports===P_,gg=H_&&N_.process,y_=(function(){try{return gg&&gg.binding&&gg.binding("util")}catch{}})(),x_=y_&&y_.isTypedArray;function g7(o,i){for(var t=-1,r=o==null?0:o.length,n=0,a=[];++t<r;){var s=o[t];i(s,t,o)&&(a[n++]=s)}return a}function b7(o,i){for(var t=-1,r=i.length,n=o.length;++t<r;)o[n+t]=i[t];return o}function v7(o,i){for(var t=-1,r=o==null?0:o.length;++t<r;)if(i(o[t],t,o))return!0;return!1}function y7(o,i){for(var t=-1,r=Array(o);++t<o;)r[t]=i(t);return r}function x7(o){return function(i){return o(i)}}function w7(o,i){return o.has(i)}function _7(o,i){return o?.[i]}function z7(o){var i=-1,t=Array(o.size);return o.forEach(function(r,n){t[++i]=[n,r]}),t}function k7(o,i){return function(t){return o(i(t))}}function S7(o){var i=-1,t=Array(o.size);return o.forEach(function(r){t[++i]=r}),t}var C7=Array.prototype,E7=Function.prototype,Hh=Object.prototype,bg=Eo["__core-js_shared__"],F_=E7.toString,no=Hh.hasOwnProperty,w_=(function(){var o=/[^.]+$/.exec(bg&&bg.keys&&bg.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),B_=Hh.toString,T7=RegExp("^"+F_.call(no).replace(h7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),__=H_?Eo.Buffer:void 0,Dh=Eo.Symbol,z_=Eo.Uint8Array,V_=Hh.propertyIsEnumerable,$7=C7.splice,hs=Dh?Dh.toStringTag:void 0,k_=Object.getOwnPropertySymbols,A7=__?__.isBuffer:void 0,L7=k7(Object.keys,Object),wg=_l(Eo,"DataView"),rd=_l(Eo,"Map"),_g=_l(Eo,"Promise"),zg=_l(Eo,"Set"),kg=_l(Eo,"WeakMap"),id=_l(Object,"create"),M7=fs(wg),I7=fs(rd),q7=fs(_g),R7=fs(zg),D7=fs(kg),S_=Dh?Dh.prototype:void 0,vg=S_?S_.valueOf:void 0;function us(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function O7(){this.__data__=id?id(null):{},this.size=0}function N7(o){var i=this.has(o)&&delete this.__data__[o];return this.size-=i?1:0,i}function P7(o){var i=this.__data__;if(id){var t=i[o];return t===Cg?void 0:t}return no.call(i,o)?i[o]:void 0}function H7(o){var i=this.__data__;return id?i[o]!==void 0:no.call(i,o)}function F7(o,i){var t=this.__data__;return this.size+=this.has(o)?0:1,t[o]=id&&i===void 0?Cg:i,this}us.prototype.clear=O7;us.prototype.delete=N7;us.prototype.get=P7;us.prototype.has=H7;us.prototype.set=F7;function To(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function B7(){this.__data__=[],this.size=0}function V7(o){var i=this.__data__,t=Fh(i,o);if(t<0)return!1;var r=i.length-1;return t==r?i.pop():$7.call(i,t,1),--this.size,!0}function U7(o){var i=this.__data__,t=Fh(i,o);return t<0?void 0:i[t][1]}function j7(o){return Fh(this.__data__,o)>-1}function G7(o,i){var t=this.__data__,r=Fh(t,o);return r<0?(++this.size,t.push([o,i])):t[r][1]=i,this}To.prototype.clear=B7;To.prototype.delete=V7;To.prototype.get=U7;To.prototype.has=j7;To.prototype.set=G7;function ms(o){var i=-1,t=o==null?0:o.length;for(this.clear();++i<t;){var r=o[i];this.set(r[0],r[1])}}function W7(){this.size=0,this.__data__={hash:new us,map:new(rd||To),string:new us}}function K7(o){var i=Bh(this,o).delete(o);return this.size-=i?1:0,i}function Y7(o){return Bh(this,o).get(o)}function X7(o){return Bh(this,o).has(o)}function Q7(o,i){var t=Bh(this,o),r=t.size;return t.set(o,i),this.size+=t.size==r?0:1,this}ms.prototype.clear=W7;ms.prototype.delete=K7;ms.prototype.get=Y7;ms.prototype.has=X7;ms.prototype.set=Q7;function Oh(o){var i=-1,t=o==null?0:o.length;for(this.__data__=new ms;++i<t;)this.add(o[i])}function J7(o){return this.__data__.set(o,Cg),this}function Z7(o){return this.__data__.has(o)}Oh.prototype.add=Oh.prototype.push=J7;Oh.prototype.has=Z7;function ha(o){var i=this.__data__=new To(o);this.size=i.size}function eT(){this.__data__=new To,this.size=0}function tT(o){var i=this.__data__,t=i.delete(o);return this.size=i.size,t}function rT(o){return this.__data__.get(o)}function iT(o){return this.__data__.has(o)}function nT(o,i){var t=this.__data__;if(t instanceof To){var r=t.__data__;if(!rd||r.length<X6-1)return r.push([o,i]),this.size=++t.size,this;t=this.__data__=new ms(r)}return t.set(o,i),this.size=t.size,this}ha.prototype.clear=eT;ha.prototype.delete=tT;ha.prototype.get=rT;ha.prototype.has=iT;ha.prototype.set=nT;function oT(o,i){var t=Nh(o),r=!t&&xT(o),n=!t&&!r&&Sg(o),a=!t&&!r&&!n&&X_(o),s=t||r||n||a,l=s?y7(o.length,String):[],d=l.length;for(var h in o)(i||no.call(o,h))&&!(s&&(h=="length"||n&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||fT(h,d)))&&l.push(h);return l}function Fh(o,i){for(var t=o.length;t--;)if(G_(o[t][0],i))return t;return-1}function aT(o,i,t){var r=i(o);return Nh(o)?r:b7(r,t(o))}function od(o){return o==null?o===void 0?r7:Z6:hs&&hs in Object(o)?uT(o):yT(o)}function C_(o){return nd(o)&&od(o)==Mh}function U_(o,i,t,r,n){return o===i?!0:o==null||i==null||!nd(o)&&!nd(i)?o!==o&&i!==i:sT(o,i,t,r,U_,n)}function sT(o,i,t,r,n,a){var s=Nh(o),l=Nh(i),d=s?yg:pa(o),h=l?yg:pa(i);d=d==Mh?xl:d,h=h==Mh?xl:h;var m=d==xl,f=h==xl,b=d==h;if(b&&Sg(o)){if(!Sg(i))return!1;s=!0,m=!1}if(b&&!m)return a||(a=new ha),s||X_(o)?j_(o,i,t,r,n,a):pT(o,i,d,t,r,n,a);if(!(t&Ph)){var g=m&&no.call(o,"__wrapped__"),v=f&&no.call(i,"__wrapped__");if(g||v){var y=g?o.value():o,_=v?i.value():i;return a||(a=new ha),n(y,_,t,r,a)}}return b?(a||(a=new ha),hT(o,i,t,r,n,a)):!1}function lT(o){if(!Y_(o)||bT(o))return!1;var i=W_(o)?T7:u7;return i.test(fs(o))}function cT(o){return nd(o)&&K_(o.length)&&!!wt[od(o)]}function dT(o){if(!vT(o))return L7(o);var i=[];for(var t in Object(o))no.call(o,t)&&t!="constructor"&&i.push(t);return i}function j_(o,i,t,r,n,a){var s=t&Ph,l=o.length,d=i.length;if(l!=d&&!(s&&d>l))return!1;var h=a.get(o);if(h&&a.get(i))return h==i;var m=-1,f=!0,b=t&T_?new Oh:void 0;for(a.set(o,i),a.set(i,o);++m<l;){var g=o[m],v=i[m];if(r)var y=s?r(v,g,m,i,o,a):r(g,v,m,o,i,a);if(y!==void 0){if(y)continue;f=!1;break}if(b){if(!v7(i,function(_,E){if(!w7(b,E)&&(g===_||n(g,_,t,r,a)))return b.push(E)})){f=!1;break}}else if(!(g===v||n(g,v,t,r,a))){f=!1;break}}return a.delete(o),a.delete(i),f}function pT(o,i,t,r,n,a,s){switch(t){case Rh:if(o.byteLength!=i.byteLength||o.byteOffset!=i.byteOffset)return!1;o=o.buffer,i=i.buffer;case O_:return!(o.byteLength!=i.byteLength||!a(new z_(o),new z_(i)));case A_:case L_:case q_:return G_(+o,+i);case M_:return o.name==i.name&&o.message==i.message;case R_:case D_:return o==i+"";case Ih:var l=z7;case qh:var d=r&Ph;if(l||(l=S7),o.size!=i.size&&!d)return!1;var h=s.get(o);if(h)return h==i;r|=T_,s.set(o,i);var m=j_(l(o),l(i),r,n,a,s);return s.delete(o),m;case t7:if(vg)return vg.call(o)==vg.call(i)}return!1}function hT(o,i,t,r,n,a){var s=t&Ph,l=E_(o),d=l.length,h=E_(i),m=h.length;if(d!=m&&!s)return!1;for(var f=d;f--;){var b=l[f];if(!(s?b in i:no.call(i,b)))return!1}var g=a.get(o);if(g&&a.get(i))return g==i;var v=!0;a.set(o,i),a.set(i,o);for(var y=s;++f<d;){b=l[f];var _=o[b],E=i[b];if(r)var N=s?r(E,_,b,i,o,a):r(_,E,b,o,i,a);if(!(N===void 0?_===E||n(_,E,t,r,a):N)){v=!1;break}y||(y=b=="constructor")}if(v&&!y){var G=o.constructor,R=i.constructor;G!=R&&"constructor"in o&&"constructor"in i&&!(typeof G=="function"&&G instanceof G&&typeof R=="function"&&R instanceof R)&&(v=!1)}return a.delete(o),a.delete(i),v}function E_(o){return aT(o,zT,mT)}function Bh(o,i){var t=o.__data__;return gT(i)?t[typeof i=="string"?"string":"hash"]:t.map}function _l(o,i){var t=_7(o,i);return lT(t)?t:void 0}function uT(o){var i=no.call(o,hs),t=o[hs];try{o[hs]=void 0;var r=!0}catch{}var n=B_.call(o);return r&&(i?o[hs]=t:delete o[hs]),n}var mT=k_?function(o){return o==null?[]:(o=Object(o),g7(k_(o),function(i){return V_.call(o,i)}))}:kT,pa=od;(wg&&pa(new wg(new ArrayBuffer(1)))!=Rh||rd&&pa(new rd)!=Ih||_g&&pa(_g.resolve())!=b_||zg&&pa(new zg)!=qh||kg&&pa(new kg)!=xg)&&(pa=function(o){var i=od(o),t=i==xl?o.constructor:void 0,r=t?fs(t):"";if(r)switch(r){case M7:return Rh;case I7:return Ih;case q7:return b_;case R7:return qh;case D7:return xg}return i});function fT(o,i){return i=i??$_,!!i&&(typeof o=="number"||m7.test(o))&&o>-1&&o%1==0&&o<i}function gT(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}function bT(o){return!!w_&&w_ in o}function vT(o){var i=o&&o.constructor,t=typeof i=="function"&&i.prototype||Hh;return o===t}function yT(o){return B_.call(o)}function fs(o){if(o!=null){try{return F_.call(o)}catch{}try{return o+""}catch{}}return""}function G_(o,i){return o===i||o!==o&&i!==i}var xT=C_((function(){return arguments})())?C_:function(o){return nd(o)&&no.call(o,"callee")&&!V_.call(o,"callee")},Nh=Array.isArray;function wT(o){return o!=null&&K_(o.length)&&!W_(o)}var Sg=A7||ST;function _T(o,i){return U_(o,i)}function W_(o){if(!Y_(o))return!1;var i=od(o);return i==I_||i==J6||i==Q6||i==e7}function K_(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=$_}function Y_(o){var i=typeof o;return o!=null&&(i=="object"||i=="function")}function nd(o){return o!=null&&typeof o=="object"}var X_=x_?x7(x_):cT;function zT(o){return wT(o)?oT(o):dT(o)}function kT(){return[]}function ST(){return!1}wl.exports=_T});var Q_=bo($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});var CT=fg(),ET=Eg(),Tg;(function(o){function i(a={},s={},l=!1){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let d=CT(s);l||(d=Object.keys(d).reduce((h,m)=>(d[m]!=null&&(h[m]=d[m]),h),{}));for(let h in a)a[h]!==void 0&&s[h]===void 0&&(d[h]=a[h]);return Object.keys(d).length>0?d:void 0}o.compose=i;function t(a={},s={}){typeof a!="object"&&(a={}),typeof s!="object"&&(s={});let l=Object.keys(a).concat(Object.keys(s)).reduce((d,h)=>(ET(a[h],s[h])||(d[h]=s[h]===void 0?null:s[h]),d),{});return Object.keys(l).length>0?l:void 0}o.diff=t;function r(a={},s={}){a=a||{};let l=Object.keys(s).reduce((d,h)=>(s[h]!==a[h]&&a[h]!==void 0&&(d[h]=s[h]),d),{});return Object.keys(a).reduce((d,h)=>(a[h]!==s[h]&&s[h]===void 0&&(d[h]=null),d),l)}o.invert=r;function n(a,s,l=!1){if(typeof a!="object")return s;if(typeof s!="object")return;if(!l)return s;let d=Object.keys(s).reduce((h,m)=>(a[m]===void 0&&(h[m]=s[m]),h),{});return Object.keys(d).length>0?d:void 0}o.transform=n})(Tg||(Tg={}));$g.default=Tg});var Mg=bo(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var Ag;(function(o){function i(t){return typeof t.delete=="number"?t.delete:typeof t.retain=="number"?t.retain:typeof t.retain=="object"&&t.retain!==null?1:typeof t.insert=="string"?t.insert.length:1}o.length=i})(Ag||(Ag={}));Lg.default=Ag});var Z_=bo(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});var J_=Mg(),Ig=class{constructor(i){this.ops=i,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(i){i||(i=1/0);let t=this.ops[this.index];if(t){let r=this.offset,n=J_.default.length(t);if(i>=n-r?(i=n-r,this.index+=1,this.offset=0):this.offset+=i,typeof t.delete=="number")return{delete:i};{let a={};return t.attributes&&(a.attributes=t.attributes),typeof t.retain=="number"?a.retain=i:typeof t.retain=="object"&&t.retain!==null?a.retain=t.retain:typeof t.insert=="string"?a.insert=t.insert.substr(r,i):a.insert=t.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?J_.default.length(this.ops[this.index])-this.offset:1/0}peekType(){let i=this.ops[this.index];return i?typeof i.delete=="number"?"delete":typeof i.retain=="number"||typeof i.retain=="object"&&i.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{let i=this.offset,t=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=i,this.index=t,[r].concat(n)}}else return[]}};qg.default=Ig});var zi=bo((Ao,Uh)=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.AttributeMap=Ao.OpIterator=Ao.Op=void 0;var Vh=$w(),TT=fg(),Rg=Eg(),gs=Q_();Ao.AttributeMap=gs.default;var $o=Mg();Ao.Op=$o.default;var mn=Z_();Ao.OpIterator=mn.default;var $T="\0",ez=(o,i)=>{if(typeof o!="object"||o===null)throw new Error(`cannot retain a ${typeof o}`);if(typeof i!="object"||i===null)throw new Error(`cannot retain a ${typeof i}`);let t=Object.keys(o)[0];if(!t||t!==Object.keys(i)[0])throw new Error(`embed types not matched: ${t} != ${Object.keys(i)[0]}`);return[t,o[t],i[t]]},Lo=class o{constructor(i){Array.isArray(i)?this.ops=i:i!=null&&Array.isArray(i.ops)?this.ops=i.ops:this.ops=[]}static registerEmbed(i,t){this.handlers[i]=t}static unregisterEmbed(i){delete this.handlers[i]}static getHandler(i){let t=this.handlers[i];if(!t)throw new Error(`no handlers for embed type "${i}"`);return t}insert(i,t){let r={};return typeof i=="string"&&i.length===0?this:(r.insert=i,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(r.attributes=t),this.push(r))}delete(i){return i<=0?this:this.push({delete:i})}retain(i,t){if(typeof i=="number"&&i<=0)return this;let r={retain:i};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(r.attributes=t),this.push(r)}push(i){let t=this.ops.length,r=this.ops[t-1];if(i=TT(i),typeof r=="object"){if(typeof i.delete=="number"&&typeof r.delete=="number")return this.ops[t-1]={delete:r.delete+i.delete},this;if(typeof r.delete=="number"&&i.insert!=null&&(t-=1,r=this.ops[t-1],typeof r!="object"))return this.ops.unshift(i),this;if(Rg(i.attributes,r.attributes)){if(typeof i.insert=="string"&&typeof r.insert=="string")return this.ops[t-1]={insert:r.insert+i.insert},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this;if(typeof i.retain=="number"&&typeof r.retain=="number")return this.ops[t-1]={retain:r.retain+i.retain},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this}}return t===this.ops.length?this.ops.push(i):this.ops.splice(t,0,i),this}chop(){let i=this.ops[this.ops.length-1];return i&&typeof i.retain=="number"&&!i.attributes&&this.ops.pop(),this}filter(i){return this.ops.filter(i)}forEach(i){this.ops.forEach(i)}map(i){return this.ops.map(i)}partition(i){let t=[],r=[];return this.forEach(n=>{(i(n)?t:r).push(n)}),[t,r]}reduce(i,t){return this.ops.reduce(i,t)}changeLength(){return this.reduce((i,t)=>t.insert?i+$o.default.length(t):t.delete?i-t.delete:i,0)}length(){return this.reduce((i,t)=>i+$o.default.length(t),0)}slice(i=0,t=1/0){let r=[],n=new mn.default(this.ops),a=0;for(;a<t&&n.hasNext();){let s;a<i?s=n.next(i-a):(s=n.next(t-a),r.push(s)),a+=$o.default.length(s)}return new o(r)}compose(i){let t=new mn.default(this.ops),r=new mn.default(i.ops),n=[],a=r.peek();if(a!=null&&typeof a.retain=="number"&&a.attributes==null){let l=a.retain;for(;t.peekType()==="insert"&&t.peekLength()<=l;)l-=t.peekLength(),n.push(t.next());a.retain-l>0&&r.next(a.retain-l)}let s=new o(n);for(;t.hasNext()||r.hasNext();)if(r.peekType()==="insert")s.push(r.next());else if(t.peekType()==="delete")s.push(t.next());else{let l=Math.min(t.peekLength(),r.peekLength()),d=t.next(l),h=r.next(l);if(h.retain){let m={};if(typeof d.retain=="number")m.retain=typeof h.retain=="number"?l:h.retain;else if(typeof h.retain=="number")d.retain==null?m.insert=d.insert:m.retain=d.retain;else{let b=d.retain==null?"insert":"retain",[g,v,y]=ez(d[b],h.retain),_=o.getHandler(g);m[b]={[g]:_.compose(v,y,b==="retain")}}let f=gs.default.compose(d.attributes,h.attributes,typeof d.retain=="number");if(f&&(m.attributes=f),s.push(m),!r.hasNext()&&Rg(s.ops[s.ops.length-1],m)){let b=new o(t.rest());return s.concat(b).chop()}}else typeof h.delete=="number"&&(typeof d.retain=="number"||typeof d.retain=="object"&&d.retain!==null)&&s.push(h)}return s.chop()}concat(i){let t=new o(this.ops.slice());return i.ops.length>0&&(t.push(i.ops[0]),t.ops=t.ops.concat(i.ops.slice(1))),t}diff(i,t){if(this.ops===i.ops)return new o;let r=[this,i].map(d=>d.map(h=>{if(h.insert!=null)return typeof h.insert=="string"?h.insert:$T;let m=d===i?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")),n=new o,a=Vh(r[0],r[1],t,!0),s=new mn.default(this.ops),l=new mn.default(i.ops);return a.forEach(d=>{let h=d[1].length;for(;h>0;){let m=0;switch(d[0]){case Vh.INSERT:m=Math.min(l.peekLength(),h),n.push(l.next(m));break;case Vh.DELETE:m=Math.min(h,s.peekLength()),s.next(m),n.delete(m);break;case Vh.EQUAL:m=Math.min(s.peekLength(),l.peekLength(),h);let f=s.next(m),b=l.next(m);Rg(f.insert,b.insert)?n.retain(m,gs.default.diff(f.attributes,b.attributes)):n.push(b).delete(m);break}h-=m}}),n.chop()}eachLine(i,t=`
2
+ `){let r=new mn.default(this.ops),n=new o,a=0;for(;r.hasNext();){if(r.peekType()!=="insert")return;let s=r.peek(),l=$o.default.length(s)-r.peekLength(),d=typeof s.insert=="string"?s.insert.indexOf(t,l)-l:-1;if(d<0)n.push(r.next());else if(d>0)n.push(r.next(d));else{if(i(n,r.next(1).attributes||{},a)===!1)return;a+=1,n=new o}}n.length()>0&&i(n,{},a)}invert(i){let t=new o;return this.reduce((r,n)=>{if(n.insert)t.delete($o.default.length(n));else{if(typeof n.retain=="number"&&n.attributes==null)return t.retain(n.retain),r+n.retain;if(n.delete||typeof n.retain=="number"){let a=n.delete||n.retain;return i.slice(r,r+a).forEach(l=>{n.delete?t.push(l):n.retain&&n.attributes&&t.retain($o.default.length(l),gs.default.invert(n.attributes,l.attributes))}),r+a}else if(typeof n.retain=="object"&&n.retain!==null){let a=i.slice(r,r+1),s=new mn.default(a.ops).next(),[l,d,h]=ez(n.retain,s.insert),m=o.getHandler(l);return t.retain({[l]:m.invert(d,h)},gs.default.invert(n.attributes,s.attributes)),r+1}}return r},0),t.chop()}transform(i,t=!1){if(t=!!t,typeof i=="number")return this.transformPosition(i,t);let r=i,n=new mn.default(this.ops),a=new mn.default(r.ops),s=new o;for(;n.hasNext()||a.hasNext();)if(n.peekType()==="insert"&&(t||a.peekType()!=="insert"))s.retain($o.default.length(n.next()));else if(a.peekType()==="insert")s.push(a.next());else{let l=Math.min(n.peekLength(),a.peekLength()),d=n.next(l),h=a.next(l);if(d.delete)continue;if(h.delete)s.push(h);else{let m=d.retain,f=h.retain,b=typeof f=="object"&&f!==null?f:l;if(typeof m=="object"&&m!==null&&typeof f=="object"&&f!==null){let g=Object.keys(m)[0];if(g===Object.keys(f)[0]){let v=o.getHandler(g);v&&(b={[g]:v.transform(m[g],f[g],t)})}}s.retain(b,gs.default.transform(d.attributes,h.attributes,t))}}return s.chop()}transformPosition(i,t=!1){t=!!t;let r=new mn.default(this.ops),n=0;for(;r.hasNext()&&n<=i;){let a=r.peekLength(),s=r.peekType();if(r.next(),s==="delete"){i-=Math.min(a,i-n);continue}else s==="insert"&&(n<i||!t)&&(i+=a);n+=a}return i}};Lo.Op=$o.default;Lo.OpIterator=mn.default;Lo.AttributeMap=gs.default;Lo.handlers={};Ao.default=Lo;typeof Uh=="object"&&(Uh.exports=Lo,Uh.exports.default=Lo)});var gk=bo((kge,eb)=>{"use strict";var pq=Object.prototype.hasOwnProperty,hi="~";function gd(){}Object.create&&(gd.prototype=Object.create(null),new gd().__proto__||(hi=!1));function hq(o,i,t){this.fn=o,this.context=i,this.once=t||!1}function fk(o,i,t,r,n){if(typeof t!="function")throw new TypeError("The listener must be a function");var a=new hq(t,r||o,n),s=hi?hi+i:i;return o._events[s]?o._events[s].fn?o._events[s]=[o._events[s],a]:o._events[s].push(a):(o._events[s]=a,o._eventsCount++),o}function bu(o,i){--o._eventsCount===0?o._events=new gd:delete o._events[i]}function ti(){this._events=new gd,this._eventsCount=0}ti.prototype.eventNames=function(){var i=[],t,r;if(this._eventsCount===0)return i;for(r in t=this._events)pq.call(t,r)&&i.push(hi?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i};ti.prototype.listeners=function(i){var t=hi?hi+i:i,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,s=new Array(a);n<a;n++)s[n]=r[n].fn;return s};ti.prototype.listenerCount=function(i){var t=hi?hi+i:i,r=this._events[t];return r?r.fn?1:r.length:0};ti.prototype.emit=function(i,t,r,n,a,s){var l=hi?hi+i:i;if(!this._events[l])return!1;var d=this._events[l],h=arguments.length,m,f;if(d.fn){switch(d.once&&this.removeListener(i,d.fn,void 0,!0),h){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,n),!0;case 5:return d.fn.call(d.context,t,r,n,a),!0;case 6:return d.fn.call(d.context,t,r,n,a,s),!0}for(f=1,m=new Array(h-1);f<h;f++)m[f-1]=arguments[f];d.fn.apply(d.context,m)}else{var b=d.length,g;for(f=0;f<b;f++)switch(d[f].once&&this.removeListener(i,d[f].fn,void 0,!0),h){case 1:d[f].fn.call(d[f].context);break;case 2:d[f].fn.call(d[f].context,t);break;case 3:d[f].fn.call(d[f].context,t,r);break;case 4:d[f].fn.call(d[f].context,t,r,n);break;default:if(!m)for(g=1,m=new Array(h-1);g<h;g++)m[g-1]=arguments[g];d[f].fn.apply(d[f].context,m)}}return!0};ti.prototype.on=function(i,t,r){return fk(this,i,t,r,!1)};ti.prototype.once=function(i,t,r){return fk(this,i,t,r,!0)};ti.prototype.removeListener=function(i,t,r,n){var a=hi?hi+i:i;if(!this._events[a])return this;if(!t)return bu(this,a),this;var s=this._events[a];if(s.fn)s.fn===t&&(!n||s.once)&&(!r||s.context===r)&&bu(this,a);else{for(var l=0,d=[],h=s.length;l<h;l++)(s[l].fn!==t||n&&!s[l].once||r&&s[l].context!==r)&&d.push(s[l]);d.length?this._events[a]=d.length===1?d[0]:d:bu(this,a)}return this};ti.prototype.removeAllListeners=function(i){var t;return i?(t=hi?hi+i:i,this._events[t]&&bu(this,t)):(this._events=new gd,this._eventsCount=0),this};ti.prototype.off=ti.prototype.removeListener;ti.prototype.addListener=ti.prototype.on;ti.prefixed=hi;ti.EventEmitter=ti;typeof eb<"u"&&(eb.exports=ti)});var bc=globalThis,v0=o=>o,yp=bc.trustedTypes,y0=yp?yp.createPolicy("lit-html",{createHTML:o=>o}):void 0,Cm="$lit$",vo=`lit$${Math.random().toFixed(9).slice(2)}$`,Em="?"+vo,L8=`<${Em}>`,ja=document,vc=()=>ja.createComment(""),yc=o=>o===null||typeof o!="object"&&typeof o!="function",Tm=Array.isArray,S0=o=>Tm(o)||typeof o?.[Symbol.iterator]=="function",Sm=`[
3
3
  \f\r]`,gc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x0=/-->/g,w0=/>/g,Va=RegExp(`>|${Sm}(?:([^\\s"'>=/]+)(${Sm}*=${Sm}*(?:[^
4
4
  \f\r"'\`<>=]|("|')|))|$)`,"g"),_0=/'/g,z0=/"/g,C0=/^(?:script|style|textarea|title)$/i,$m=o=>(i,...t)=>({_$litType$:o,strings:i,values:t}),u=$m(1),En=$m(2),E0=$m(3),Lt=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),k0=new WeakMap,Ua=ja.createTreeWalker(ja,129);function T0(o,i){if(!Tm(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return y0!==void 0?y0.createHTML(i):i}var $0=(o,i)=>{let t=o.length-1,r=[],n,a=i===2?"<svg>":i===3?"<math>":"",s=gc;for(let l=0;l<t;l++){let d=o[l],h,m,f=-1,b=0;for(;b<d.length&&(s.lastIndex=b,m=s.exec(d),m!==null);)b=s.lastIndex,s===gc?m[1]==="!--"?s=x0:m[1]!==void 0?s=w0:m[2]!==void 0?(C0.test(m[2])&&(n=RegExp("</"+m[2],"g")),s=Va):m[3]!==void 0&&(s=Va):s===Va?m[0]===">"?(s=n??gc,f=-1):m[1]===void 0?f=-2:(f=s.lastIndex-m[2].length,h=m[1],s=m[3]===void 0?Va:m[3]==='"'?z0:_0):s===z0||s===_0?s=Va:s===x0||s===w0?s=gc:(s=Va,n=void 0);let g=s===Va&&o[l+1].startsWith("/>")?" ":"";a+=s===gc?d+L8:f>=0?(r.push(h),d.slice(0,f)+Cm+d.slice(f)+vo+g):d+vo+(f===-2?l:g)}return[T0(o,a+(o[t]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),r]},xc=class o{constructor({strings:i,_$litType$:t},r){let n;this.parts=[];let a=0,s=0,l=i.length-1,d=this.parts,[h,m]=$0(i,t);if(this.el=o.createElement(h,r),Ua.currentNode=this.el.content,t===2||t===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(n=Ua.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let f of n.getAttributeNames())if(f.endsWith(Cm)){let b=m[s++],g=n.getAttribute(f).split(vo),v=/([.?@])?(.*)/.exec(b);d.push({type:1,index:a,name:v[2],strings:g,ctor:v[1]==="."?wp:v[1]==="?"?_p:v[1]==="@"?zp:Wa}),n.removeAttribute(f)}else f.startsWith(vo)&&(d.push({type:6,index:a}),n.removeAttribute(f));if(C0.test(n.tagName)){let f=n.textContent.split(vo),b=f.length-1;if(b>0){n.textContent=yp?yp.emptyScript:"";for(let g=0;g<b;g++)n.append(f[g],vc()),Ua.nextNode(),d.push({type:2,index:++a});n.append(f[b],vc())}}}else if(n.nodeType===8)if(n.data===Em)d.push({type:2,index:a});else{let f=-1;for(;(f=n.data.indexOf(vo,f+1))!==-1;)d.push({type:7,index:a}),f+=vo.length-1}a++}}static createElement(i,t){let r=ja.createElement("template");return r.innerHTML=i,r}};function Ga(o,i,t=o,r){if(i===Lt)return i;let n=r!==void 0?t._$Co?.[r]:t._$Cl,a=yc(i)?void 0:i._$litDirective$;return n?.constructor!==a&&(n?._$AO?.(!1),a===void 0?n=void 0:(n=new a(o),n._$AT(o,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(i=Ga(o,n._$AS(o,i.values),n,r)),i}var xp=class{constructor(i,t){this._$AV=[],this._$AN=void 0,this._$AD=i,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(i){let{el:{content:t},parts:r}=this._$AD,n=(i?.creationScope??ja).importNode(t,!0);Ua.currentNode=n;let a=Ua.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new Fs(a,a.nextSibling,this,i):d.type===1?h=new d.ctor(a,d.name,d.strings,this,i):d.type===6&&(h=new kp(a,this,i)),this._$AV.push(h),d=r[++l]}s!==d?.index&&(a=Ua.nextNode(),s++)}return Ua.currentNode=ja,n}p(i){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(i,r,t),t+=r.strings.length-2):r._$AI(i[t])),t++}},Fs=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(i,t,r,n){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=i,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let i=this._$AA.parentNode,t=this._$AM;return t!==void 0&&i?.nodeType===11&&(i=t.parentNode),i}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(i,t=this){i=Ga(this,i,t),yc(i)?i===V||i==null||i===""?(this._$AH!==V&&this._$AR(),this._$AH=V):i!==this._$AH&&i!==Lt&&this._(i):i._$litType$!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):S0(i)?this.k(i):this._(i)}O(i){return this._$AA.parentNode.insertBefore(i,this._$AB)}T(i){this._$AH!==i&&(this._$AR(),this._$AH=this.O(i))}_(i){this._$AH!==V&&yc(this._$AH)?this._$AA.nextSibling.data=i:this.T(ja.createTextNode(i)),this._$AH=i}$(i){let{values:t,_$litType$:r}=i,n=typeof r=="number"?this._$AC(i):(r.el===void 0&&(r.el=xc.createElement(T0(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let a=new xp(n,this),s=a.u(this.options);a.p(t),this.T(s),this._$AH=a}}_$AC(i){let t=k0.get(i.strings);return t===void 0&&k0.set(i.strings,t=new xc(i)),t}k(i){Tm(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let a of i)n===t.length?t.push(r=new o(this.O(vc()),this.O(vc()),this,this.options)):r=t[n],r._$AI(a),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(i=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);i!==this._$AB;){let r=v0(i).nextSibling;v0(i).remove(),i=r}}setConnected(i){this._$AM===void 0&&(this._$Cv=i,this._$AP?.(i))}},Wa=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(i,t,r,n,a){this.type=1,this._$AH=V,this._$AN=void 0,this.element=i,this.name=t,this._$AM=n,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(i,t=this,r,n){let a=this.strings,s=!1;if(a===void 0)i=Ga(this,i,t,0),s=!yc(i)||i!==this._$AH&&i!==Lt,s&&(this._$AH=i);else{let l=i,d,h;for(i=a[0],d=0;d<a.length-1;d++)h=Ga(this,l[r+d],t,d),h===Lt&&(h=this._$AH[d]),s||(s=!yc(h)||h!==this._$AH[d]),h===V?i=V:i!==V&&(i+=(h??"")+a[d+1]),this._$AH[d]=h}s&&!n&&this.j(i)}j(i){i===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"")}},wp=class extends Wa{constructor(){super(...arguments),this.type=3}j(i){this.element[this.name]=i===V?void 0:i}},_p=class extends Wa{constructor(){super(...arguments),this.type=4}j(i){this.element.toggleAttribute(this.name,!!i&&i!==V)}},zp=class extends Wa{constructor(i,t,r,n,a){super(i,t,r,n,a),this.type=5}_$AI(i,t=this){if((i=Ga(this,i,t,0)??V)===Lt)return;let r=this._$AH,n=i===V&&r!==V||i.capture!==r.capture||i.once!==r.once||i.passive!==r.passive,a=i!==V&&(r===V||n);n&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,i),this._$AH=i}handleEvent(i){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,i):this._$AH.handleEvent(i)}},kp=class{constructor(i,t,r){this.element=i,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(i){Ga(this,i)}},A0={M:Cm,P:vo,A:Em,C:1,L:$0,R:xp,D:S0,V:Ga,I:Fs,H:Wa,N:_p,U:zp,B:wp,F:kp},M8=bc.litHtmlPolyfillSupport;M8?.(xc,Fs),(bc.litHtmlVersions??(bc.litHtmlVersions=[])).push("3.3.3");var Bs=(o,i,t)=>{let r=t?.renderBefore??i,n=r._$litPart$;if(n===void 0){let a=t?.renderBefore??null;r._$litPart$=n=new Fs(i.insertBefore(vc(),a),a,void 0,t??{})}return n._$AI(o),n};var $r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=o=>(...i)=>({_$litDirective$:o,values:i}),xr=class{constructor(i){}get _$AU(){return this._$AM._$AU}_$AT(i,t,r){this._$Ct=i,this._$AM=t,this._$Ci=r}_$AS(i,t){return this.update(i,t)}update(i,t){return this.render(...t)}};var q=Mt(class extends xr{constructor(o){if(super(o),o.type!==$r.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(i=>o[i]).join(" ")+" "}update(o,[i]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(let r in i)i[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(i)}let t=o.element.classList;for(let r of this.st)r in i||(t.remove(r),this.st.delete(r));for(let r in i){let n=!!i[r];n===this.st.has(r)||this.nt?.has(r)||(n?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Lt}});var Sp=globalThis,Cp=Sp.ShadowRoot&&(Sp.ShadyCSS===void 0||Sp.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Am=Symbol(),L0=new WeakMap,wc=class{constructor(i,t,r){if(this._$cssResult$=!0,r!==Am)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=t}get styleSheet(){let i=this.o,t=this.t;if(Cp&&i===void 0){let r=t!==void 0&&t.length===1;r&&(i=L0.get(t)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),r&&L0.set(t,i))}return i}toString(){return this.cssText}},k=o=>new wc(typeof o=="string"?o:o+"",void 0,Am),S=(o,...i)=>{let t=o.length===1?o[0]:i.reduce((r,n,a)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[a+1],o[0]);return new wc(t,o,Am)},M0=(o,i)=>{if(Cp)o.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of i){let r=document.createElement("style"),n=Sp.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,o.appendChild(r)}},Lm=Cp?o=>o:o=>o instanceof CSSStyleSheet?(i=>{let t="";for(let r of i.cssRules)t+=r.cssText;return k(t)})(o):o;var{is:I8,defineProperty:q8,getOwnPropertyDescriptor:R8,getOwnPropertyNames:D8,getOwnPropertySymbols:O8,getPrototypeOf:N8}=Object,Wo=globalThis,I0=Wo.trustedTypes,P8=I0?I0.emptyScript:"",H8=Wo.reactiveElementPolyfillSupport,_c=(o,i)=>o,Ko={toAttribute(o,i){switch(i){case Boolean:o=o?P8:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,i){let t=o;switch(i){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},Vs=(o,i)=>!I8(o,i),q0={attribute:!0,type:String,converter:Ko,reflect:!1,useDefault:!1,hasChanged:Vs};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Wo.litPropertyMetadata??(Wo.litPropertyMetadata=new WeakMap);var yo=class extends HTMLElement{static addInitializer(i){this._$Ei(),(this.l??(this.l=[])).push(i)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(i,t=q0){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(i)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(i,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(i,r,t);n!==void 0&&q8(this.prototype,i,n)}}static getPropertyDescriptor(i,t,r){let{get:n,set:a}=R8(this.prototype,i)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n?.call(this);a?.call(this,s),this.requestUpdate(i,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(i){return this.elementProperties.get(i)??q0}static _$Ei(){if(this.hasOwnProperty(_c("elementProperties")))return;let i=N8(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties)}static finalize(){if(this.hasOwnProperty(_c("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_c("properties"))){let t=this.properties,r=[...D8(t),...O8(t)];for(let n of r)this.createProperty(n,t[n])}let i=this[Symbol.metadata];if(i!==null){let t=litPropertyMetadata.get(i);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(i){let t=[];if(Array.isArray(i)){let r=new Set(i.flat(1/0).reverse());for(let n of r)t.unshift(Lm(n))}else i!==void 0&&t.push(Lm(i));return t}static _$Eu(i,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this))}addController(i){(this._$EO??(this._$EO=new Set)).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.()}removeController(i){this._$EO?.delete(i)}_$E_(){let i=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(i.set(r,this[r]),delete this[r]);i.size>0&&(this._$Ep=i)}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return M0(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(i=>i.hostConnected?.())}enableUpdating(i){}disconnectedCallback(){this._$EO?.forEach(i=>i.hostDisconnected?.())}attributeChangedCallback(i,t,r){this._$AK(i,r)}_$ET(i,t){let r=this.constructor.elementProperties.get(i),n=this.constructor._$Eu(i,r);if(n!==void 0&&r.reflect===!0){let a=(r.converter?.toAttribute!==void 0?r.converter:Ko).toAttribute(t,r.type);this._$Em=i,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(i,t){let r=this.constructor,n=r._$Eh.get(i);if(n!==void 0&&this._$Em!==n){let a=r.getPropertyOptions(n),s=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Ko;this._$Em=n;let l=s.fromAttribute(t,a.type);this[n]=l??this._$Ej?.get(n)??l,this._$Em=null}}requestUpdate(i,t,r,n=!1,a){if(i!==void 0){let s=this.constructor;if(n===!1&&(a=this[i]),r??(r=s.getPropertyOptions(i)),!((r.hasChanged??Vs)(a,t)||r.useDefault&&r.reflect&&a===this._$Ej?.get(i)&&!this.hasAttribute(s._$Eu(i,r))))return;this.C(i,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(i,t,{useDefault:r,reflect:n,wrapped:a},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(i)&&(this._$Ej.set(i,s??t??this[i]),a!==!0||s!==void 0)||(this._$AL.has(i)||(this.hasUpdated||r||(t=void 0),this._$AL.set(i,t)),n===!0&&this._$Em!==i&&(this._$Eq??(this._$Eq=new Set)).add(i))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,a]of r){let{wrapped:s}=a,l=this[n];s!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,a,l)}}let i=!1,t=this._$AL;try{i=this.shouldUpdate(t),i?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw i=!1,this._$EM(),r}i&&this._$AE(t)}willUpdate(i){}_$AE(i){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(i)),this.updated(i)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(i){return!0}update(i){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(i){}firstUpdated(i){}};yo.elementStyles=[],yo.shadowRootOptions={mode:"open"},yo[_c("elementProperties")]=new Map,yo[_c("finalized")]=new Map,H8?.({ReactiveElement:yo}),(Wo.reactiveElementVersions??(Wo.reactiveElementVersions=[])).push("2.1.2");var zc=globalThis,Yo=class extends yo{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let i=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=i.firstChild),i}update(i){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this._$Do=Bs(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Lt}};Yo._$litElement$=!0,Yo.finalized=!0,zc.litElementHydrateSupport?.({LitElement:Yo});var F8=zc.litElementPolyfillSupport;F8?.({LitElement:Yo});(zc.litElementVersions??(zc.litElementVersions=[])).push("4.2.2");var R0=new WeakMap;function D0(o){let i=R0.get(o);return i||(i=window.getComputedStyle(o,null),R0.set(o,i)),i}function B8(o){if(typeof o.checkVisibility=="function")return o.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});let i=D0(o);return i.visibility!=="hidden"&&i.display!=="none"}function V8(o){let i=D0(o),{overflowY:t,overflowX:r}=i;return t==="scroll"||r==="scroll"?!0:t!=="auto"||r!=="auto"?!1:o.scrollHeight>o.clientHeight&&t==="auto"||o.scrollWidth>o.clientWidth&&r==="auto"}function U8(o){let i=o.tagName.toLowerCase(),t=Number(o.getAttribute("tabindex"));return o.hasAttribute("tabindex")&&(isNaN(t)||t<=-1)||o.hasAttribute("disabled")||o.closest("[inert]")||i==="input"&&o.getAttribute("type")==="radio"&&!o.hasAttribute("checked")||!B8(o)?!1:(i==="audio"||i==="video")&&o.hasAttribute("controls")||o.hasAttribute("tabindex")||o.hasAttribute("contenteditable")&&o.getAttribute("contenteditable")!=="false"||["button","input","select","textarea","a","audio","video","summary","iframe"].includes(i)?!0:V8(o)}function O0(o){let i=Mm(o),t=i[0]??null,r=i[i.length-1]??null;return{start:t,end:r}}function j8(o,i){return o.getRootNode({composed:!0})?.host!==i}function Mm(o){let i=new WeakMap,t=[];function r(n){if(n instanceof Element){if(n.hasAttribute("inert")||n.closest("[inert]")||i.has(n))return;i.set(n,!0),!t.includes(n)&&U8(n)&&t.push(n),n instanceof HTMLSlotElement&&j8(n,o)&&n.assignedElements({flatten:!0}).forEach(a=>{r(a)}),n.shadowRoot!==null&&n.shadowRoot.mode==="open"&&r(n.shadowRoot)}for(let a of n.children)r(a)}return r(o),t.sort((n,a)=>{let s=Number(n.getAttribute("tabindex"))||0;return(Number(a.getAttribute("tabindex"))||0)-s})}var N0=new WeakMap,Im=class{constructor(i){this.handleKeyDown=i=>{if(i.key==="Enter"){if(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||i.isComposing||i.defaultPrevented)return;let r=i.target;if(this.isSelectOption(r)){i.preventDefault(),setTimeout(()=>{let a=this.findParentSelect(r);a&&this.focusNextControl(a)},0);return}if(this.shouldSkipEnterKey(r)||r.hasAttribute("trigger-submit"))return;let n=this.findParentGroup(r);if(n){i.preventDefault(),this.focusNextInGroup(r,n)||this.focusNextControl(n);return}i.preventDefault(),this.areRequiredFieldsFilled()?this.submitForm():this.focusNextControl(r);return}if(i.key==="ArrowDown"){let t=i.target,r=t.tagName;if(!(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey)&&!i.defaultPrevented){let a=this.findParentGroup(t);if(a){i.preventDefault(),this.focusNextInGroup(t,a)||this.focusNextControl(a);return}(r==="ZN-CHECKBOX"||r==="ZN-TOGGLE")&&(i.preventDefault(),this.focusNextControl(t))}}if(i.key==="ArrowUp"){let t=i.target,r=t.tagName;if(!(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey)&&!i.defaultPrevented){let a=this.findParentGroup(t);if(a){i.preventDefault(),this.focusPreviousInGroup(t,a)||this.focusPreviousControl(a);return}(r==="ZN-CHECKBOX"||r==="ZN-TOGGLE")&&(i.preventDefault(),this.focusPreviousControl(t))}}};this.form=i,this.form.addEventListener("keydown",this.handleKeyDown,!0)}shouldSkipEnterKey(i){let t=i.tagName.toLowerCase();return t==="zn-textarea"||t==="textarea"||(t==="zn-input"||t==="input")&&i.getAttribute("type")==="search"?!0:t==="button"||t==="zn-button"}shouldExcludeFromNavigation(i){let t=i.tagName.toLowerCase();return t==="button"||t==="zn-button"}isSelectOption(i){return i.tagName.toLowerCase()==="zn-option"}findParentSelect(i){let t=i;for(;t;){if(t.tagName.toLowerCase()==="zn-select")return t;let r=t.getRootNode();if(r instanceof ShadowRoot)t=r.host;else if(t.parentElement)t=t.parentElement;else break}return null}findParentGroup(i){let t=i;for(;t;){let r=t.tagName;if(r==="ZN-RADIO-GROUP"||r==="ZN-CHECKBOX-GROUP")return t;let n=t.getRootNode();if(n instanceof ShadowRoot)t=n.host;else if(t.parentElement)t=t.parentElement;else break}return null}getGroupItems(i){let t=i.tagName==="ZN-RADIO-GROUP"?"ZN-RADIO":"ZN-CHECKBOX",r=[],n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tagName===t?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),a;for(;a=n.nextNode();)r.push(a);return r}focusNextInGroup(i,t){let r=this.getGroupItems(t);if(r.length===0)return!1;let n=-1;for(let a=0;a<r.length;a++)if(r[a]===i||r[a].contains(i)){n=a;break}if(n>=0&&n<r.length-1){let a=r[n+1];if(typeof a.focus=="function")return a.focus(),!0}return!1}focusPreviousInGroup(i,t){let r=this.getGroupItems(t);if(r.length===0)return!1;let n=-1;for(let a=0;a<r.length;a++)if(r[a]===i||r[a].contains(i)){n=a;break}if(n>0){let a=r[n-1];if(typeof a.focus=="function")return a.focus(),!0}return!1}areRequiredFieldsFilled(){let i=Ka.get(this.form);if(!i)return!0;for(let t of i){let r=t;if(!r.name||r.disabled)continue;let n=r.value;if(!(n!=null&&n!=="")||typeof r.checkValidity=="function"&&!r.checkValidity())return!1}return!0}getNavigableControls(){let i=Mm(this.form),t=[],r=new Set;for(let n of i){let a=n.tagName.toLowerCase();if(["zn-input","zn-select","zn-datepicker","zn-textarea","zn-file","zn-checkbox","zn-radio","zn-radio-group","zn-toggle"].includes(a)){if(a==="zn-radio"){let h=n.closest("zn-radio-group");if(h){r.has(h)||(r.add(h),this.shouldExcludeFromNavigation(h)||t.push(h));continue}}if(r.has(n)||(r.add(n),this.shouldExcludeFromNavigation(n)))continue;t.push(n);continue}let l=n.getRootNode().host;if(l&&l!==this.form){let h=l.tagName.toLowerCase();if(["zn-input","zn-select","zn-datepicker","zn-textarea","zn-file","zn-checkbox","zn-radio","zn-radio-group","zn-toggle"].includes(h)){if(h==="zn-radio"){let f=l.closest("zn-radio-group");if(f){r.has(f)||(r.add(f),this.shouldExcludeFromNavigation(f)||t.push(f));continue}}if(r.has(l)||(r.add(l),this.shouldExcludeFromNavigation(l)))continue;t.push(l);continue}}if(["input","select"].includes(a)){if(r.has(n)||(r.add(n),n.getAttribute("type")==="search"))continue;t.push(n)}}return t}findCurrentControlIndex(i,t){for(let r=0;r<t.length;r++){let n=t[r];if(n===i)return r;let a=i.getRootNode();if(a instanceof ShadowRoot&&a.host===n||n.contains(i)||i.contains(n))return r}return-1}focusNextControl(i){let t=this.getNavigableControls(),r=this.findCurrentControlIndex(i,t);if(r>=0&&r<t.length-1){let n=t[r+1];if(typeof n.focus=="function"&&(n.focus(),n.tagName.toLowerCase()==="zn-select")){let s=n;typeof s.show=="function"&&setTimeout(()=>{s.show?.()},0)}}}focusPreviousControl(i){let t=this.getNavigableControls(),r=this.findCurrentControlIndex(i,t);if(r>0){let n=t[r-1];if(typeof n.focus=="function"&&(n.focus(),n.tagName.toLowerCase()==="zn-select")){let s=n;typeof s.show=="function"&&setTimeout(()=>{s.show?.()},0)}}}submitForm(){let i=this.form.querySelector('[type="submit"]');if(i)i.click();else if(typeof this.form.requestSubmit=="function")this.form.requestSubmit();else{let t=new Event("submit",{bubbles:!0,cancelable:!0});this.form.dispatchEvent(t)}}destroy(){this.form.removeEventListener("keydown",this.handleKeyDown,!0)}};function P0(o){let i=N0.get(o);return i||(i=new Im(o),N0.set(o,i)),i}function Ar(o){return`#${CSS.escape(o.startsWith("#")?o.slice(1):o)}`}function G8(o,i=document){let t=i.querySelector(o);if(t)return t;for(let r of i.querySelectorAll("*"))if(r.shadowRoot){let n=G8(o,r.shadowRoot);if(n)return n}return null}function W8(o,i=document,t=[]){t.push(...i.querySelectorAll(o));for(let r of i.querySelectorAll("*"))r.shadowRoot&&W8(o,r.shadowRoot,t);return t}function nt(o,i,t){let r=[],n=(a,s)=>{if(!a||a.nodeType!==Node.ELEMENT_NODE||s&&t&&a.matches(t))return;a.matches(o)&&r.push(a);let l=a.children;if(l.length)for(let h of l)n(h,!0);let d=a.shadowRoot;if(d){let h=d.children;for(let m of h)n(m,!0)}};return n(i,!1),r}var Ur=class{constructor(i,t,r=0){this.storage=i,this.prefix=t,this.ttl=r*1e3,this.cleanup()}get(i){return!i||i.length<1?null:this.stripTtl(this.storage.getItem(this.prefix+i))}stripTtl(i){if(i===null)return null;let t=i.split(",");if(t.length===1)return t[0];let r=t.shift(),n=r?parseInt(r):0;return n>0&&n<Date.now()?null:t.join(",")||""}setWithTTL(i,t,r){!i||i.length<1||(r=r>0?Date.now()+r*1e3:0,this.storage.setItem(this.prefix+i,r+","+t))}set(i,t){this.setWithTTL(i,t,this.ttl)}remove(i){this.storage.removeItem(this.prefix+i)}cleanup(){for(let i=0;i<this.storage.length;i++){let t=this.storage.key(i);t!==null&&t.startsWith(this.prefix)&&this.stripTtl(this.storage.getItem(t))===null&&this.storage.removeItem(t)}}};var Ka=new WeakMap,kc=new WeakMap,Sc=new WeakMap,Ep=new WeakMap,qm=new WeakSet,Tp=new WeakMap,U0="znform:";function Rm(o=!1){try{return o?window.localStorage:window.sessionStorage}catch{return null}}function K8(o=!1,i=0){let t=Rm(o);return t?new Ur(t,U0,i):null}function H0(o){let i=o?.getAttribute("store-ttl");return i&&Number(i)||0}function F0(o){return!!o?.hasAttribute("local-storage")}function j0(o){return o?.getAttribute("store-key")||""}function Y8(o){return o.getAttribute("store-key")||""}function X8(o){return o.getAttribute("name")||("name"in o&&typeof o.name=="string"?o.name:"")}function G0(o,i){let t=Y8(o),r=j0(i);if(t)return r?`${r}:${t}`:t;let n=X8(o);return r&&n?`${r}:${n}`:""}function W0(o,i){let t=F0(o)||F0(i),r=H0(o)||H0(i);return K8(t,r)}function K0(o,i){let t=G0(o,i),n=(t?W0(o,i):null)?.get(t);if(!n)return null;try{return JSON.parse(n)}catch{return{value:n}}}function Y0(o,i,t){let r=G0(o,i),n=r?W0(o,i):null;n&&n.set(r,JSON.stringify(t))}function Q8(o){return o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement}function J8(o){return o instanceof HTMLInputElement&&(o.type==="checkbox"||o.type==="radio")?{checked:o.checked,value:o.value}:{value:o.value}}function Z8(o){o.querySelectorAll("input, textarea, select").forEach(t=>{let r=K0(t,o);if(r){if(t instanceof HTMLInputElement&&(t.type==="checkbox"||t.type==="radio")){typeof r.checked=="boolean"&&(t.checked=r.checked);return}"value"in r&&(t.value=String(r.value??""))}})}function B0(o,i){!Q8(o)||o.form!==i||Y0(o,i,J8(o))}function eS(o,i){let t={value:i};return"checked"in o&&typeof o.checked=="boolean"&&(t.checked=o.checked),"indeterminate"in o&&typeof o.indeterminate=="boolean"&&(t.indeterminate=o.indeterminate),t}function V0(o,i){let t=[],r=U0+i;for(let n=0;n<o.length;n++){let a=o.key(n);(a===r||a?.startsWith(r+":"))&&t.push(a)}t.forEach(n=>o.removeItem(n))}function Dm(o){if(typeof o.value!="string"||o.type==="password")return;let i=o.value.trim();i!==o.value&&(o.value=i);let t=o instanceof HTMLInputElement?o:o.input;o.type==="email"&&t instanceof HTMLInputElement&&(t.value=i)}function tS(o){let i=typeof o=="string"?o:j0(o);if(!i)return;let t=Rm(!0),r=Rm(!1);t&&V0(t,i),r&&r!==t&&V0(r,i)}var ce=class{constructor(i,t){this.handleFormData=i=>{let t=this.options.disabled(this.host),r=this.options.name(this.host),n=this.options.value(this.host),a=this.host.tagName.toLowerCase()==="zn-button";if(this.host.isConnected&&!t&&!a&&r.length>0&&typeof n<"u"){let s=this.host.type==="password",l=f=>{let b=f.toString();i.formData.append(r,s?b:b.trim())},d=(f,b)=>{let g=f,v=b??(typeof g.name=="string"?g.name:void 0);typeof v=="string"?i.formData.append(r,f,v):i.formData.append(r,f)},h=f=>typeof FileList<"u"&&f instanceof FileList,m=f=>typeof Blob<"u"&&f instanceof Blob;if(h(n)){if(n.length>0)for(let f=0;f<n.length;f++){let b=n.item(f);b&&d(b,b.name)}}else m(n)?d(n,n.name):Array.isArray(n)?n.forEach(f=>{if(m(f))d(f,f.name);else if(h(f)){let b=f;for(let g=0;g<b.length;g++){let v=b.item(g);v&&d(v,v.name)}}else l(f)}):(l(n),this.host.value===n&&Dm(this.host));this.host.dispatchEvent(new CustomEvent("zn-formdata",{bubbles:!0,composed:!0}))}};this.handleFormSubmit=i=>{let t=this.options.disabled(this.host),r=this.options.reportValidity;this.form&&!this.form.noValidate&&Ka.get(this.form)?.forEach(s=>{this.setUserInteracted(s,!0)});let n=this.form?.querySelector('[type="submit"]'),a=n?.innerHTML??"Submit";n&&(n.setAttribute("data-original-text",a),setTimeout(()=>{n.disabled=!0,n.innerHTML=this.form?.hasAttribute("data-no-loading-text")?a:this.form?.getAttribute("data-loading-text")||"Processing..."},20),setTimeout(()=>{n.disabled=!1,n.innerHTML=a},15e3)),this.form&&!this.form.noValidate&&!t&&!r(this.host)&&(i.preventDefault(),i.stopImmediatePropagation(),n&&(n.disabled=!1,n.innerHTML=a))};this.enableSubmit=i=>{if(i.target!==this.form)return;let r=this.form?.querySelector('[type="submit"]');if(r){let n=r.getAttribute("data-original-text")??r.innerHTML;r.disabled=!1,r.innerHTML=n}};this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Tp.set(this.host,[])};this.handleInteraction=i=>{let t=Tp.get(this.host);t.includes(i.type)||t.push(i.type),t.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0),this.persistHostValue(),this.checkFormValidity()};this.checkFormValidity=()=>{let i=this.form?.querySelector('[type="submit"]');if(this.form&&!this.form.noValidate){let t=this.form.querySelectorAll("*");for(let r of t)if(typeof r.checkValidity=="function"&&!r.checkValidity())return i?.setAttribute("disabled","disabled"),!1}return i?.removeAttribute("disabled"),!0};this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){let i=this.form.querySelectorAll("*");for(let t of i)if(typeof t.reportValidity=="function"&&!t.reportValidity())return!1}return!0};(this.host=i).addController(this),this.options={form:r=>{let n=r.form;if(n){let s=r.getRootNode().querySelector(Ar(n));if(s)return s}return r.closest("form")},name:r=>r.name,value:r=>r.value,defaultValue:r=>r.defaultValue,disabled:r=>r.disabled??!1,reportValidity:r=>typeof r.reportValidity=="function"?r.reportValidity():!0,checkValidity:r=>typeof r.checkValidity=="function"?r.checkValidity():!0,setValue:(r,n)=>r.value=n,assumeInteractionOn:["zn-input"],...t}}async hostConnected(){let i=this.options.form(this.host);i&&this.attachForm(i),Tp.set(this.host,[]),this.options.assumeInteractionOn.forEach(t=>{this.host.addEventListener(t,this.handleInteraction)}),await this.host.updateComplete,this.restorePersistedValue(),i&&this.checkFormValidity()}hostDisconnected(){this.detachForm(),Tp.delete(this.host),this.options.assumeInteractionOn.forEach(i=>{this.host.removeEventListener(i,this.handleInteraction)})}hostUpdated(){let i=this.options.form(this.host);i||this.detachForm(),i&&this.form!==i&&(this.detachForm(),this.attachForm(i)),this.host.hasUpdated&&this.setValidity(this.host.validity?.valid)}attachForm(i){if(!i){this.form=void 0;return}this.form=i,Ka.has(this.form)?Ka.get(this.form).add(this.host):Ka.set(this.form,new Set([this.host])),this.form.hasAttribute("data-enter-navigation")&&P0(this.form),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),this.form.addEventListener("complete",this.enableSubmit),this.form.addEventListener("cancelled",this.enableSubmit),this.form.addEventListener("error",this.enableSubmit),this.attachFormPersistence(this.form),kc.has(this.form)||(kc.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),Sc.has(this.form)||(Sc.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())}detachForm(){if(!this.form)return;let i=Ka.get(this.form);i&&(i.delete(this.host),i.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),this.form.removeEventListener("complete",this.enableSubmit),this.form.removeEventListener("cancelled",this.enableSubmit),this.form.removeEventListener("error",this.enableSubmit),this.detachFormPersistence(this.form),kc.has(this.form)&&(this.form.reportValidity=kc.get(this.form),kc.delete(this.form)),Sc.has(this.form)&&(this.form.checkValidity=Sc.get(this.form),Sc.delete(this.form)),this.form=void 0))}attachFormPersistence(i){if(Ep.has(i))return;let t=n=>B0(n.target,i),r=n=>B0(n.target,i);i.addEventListener("input",t),i.addEventListener("change",r),Ep.set(i,{handleInput:t,handleChange:r}),Z8(i)}detachFormPersistence(i){let t=Ep.get(i);t&&(i.removeEventListener("input",t.handleInput),i.removeEventListener("change",t.handleChange),Ep.delete(i))}restorePersistedValue(){let i=K0(this.host,this.form);i&&("checked"in this.host&&typeof i.checked=="boolean"?this.options.setValue(this.host,i.checked):"value"in i&&this.options.setValue(this.host,i.value),"indeterminate"in this.host&&typeof i.indeterminate=="boolean"&&(this.host.indeterminate=i.indeterminate))}persistHostValue(){Y0(this.host,this.form,eS(this.host,this.options.value(this.host)))}setUserInteracted(i,t){t?qm.add(i):qm.delete(i),i.requestUpdate()}doAction(i,t){if(this.form){let r=document.createElement("button");r.type=i,r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.clipPath="inset(50%)",r.style.overflow="hidden",r.style.whiteSpace="nowrap",t&&(r.name=t.name,r.value=t.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(n=>{t.hasAttribute(n)&&r.setAttribute(n,t.getAttribute(n))})),this.form.append(r),this.form instanceof HTMLFormElement&&document.dispatchEvent(new CustomEvent("zn-register-element",{detail:{element:this.form}})),r.click(),r.remove()}}getForm(){return this.form??null}reset(i){this.doAction("reset",i)}submit(i){this.doAction("submit",i)}setValidity(i){let t=this.host,r=!!qm.has(t),n=!!t.required;t.toggleAttribute("data-required",n),t.toggleAttribute("data-optional",!n),t.toggleAttribute("data-invalid",!i),t.toggleAttribute("data-valid",i),t.toggleAttribute("data-user-invalid",!i&&r),t.toggleAttribute("data-user-valid",i&&r)}updateValidity(){let i=this.host;this.setValidity(i.validity?.valid)}emitInvalidEvent(i){let t=new CustomEvent("zn-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});i||t.preventDefault(),this.host.dispatchEvent(t)||i?.preventDefault()}},ht=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),$p=Object.freeze({...ht,customError:!0,valid:!1}),Us=Object.freeze({...ht,valueMissing:!0,valid:!1});var te=class{constructor(i,...t){this.slotNames=[];this.handleSlotChange=i=>{let t=i.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()};(this.host=i).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent.trim()!=="")return!0;if(i.nodeType===i.ELEMENT_NODE){let t=i;if(t.tagName.toLowerCase()==="zn-visually-hidden")return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(i){return this.host.querySelector(`:scope > [slot="${i}"]`)!==null}test(i){return i==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(i)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}getSlot(i){return this.host.querySelector(`:scope > [slot="${i}"]`)}getDefaultSlot(){return[...this.host.childNodes].filter(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent.trim()!=="")return!0;if(i.nodeType===i.ELEMENT_NODE){let t=i;if(t.tagName.toLowerCase()==="zn-visually-hidden")return!1;if(!t.hasAttribute("slot"))return!0}return!1})}getSlots(i){return this.host.querySelectorAll(`:scope > [slot="${i}"]`)}};function X0(o){if(!o)return"";let i=o.assignedNodes({flatten:!0}),t="";return[...i].forEach(r=>{r.nodeType===Node.TEXT_NODE&&(t+=r.textContent)}),t}var J0=Symbol.for(""),rS=o=>{if(o?.r===J0)return o?._$litStatic$};var an=(o,...i)=>({_$litStatic$:i.reduce((t,r,n)=>t+(a=>{if(a._$litStatic$!==void 0)return a._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${a}. Use 'unsafeStatic' to pass non-literal values, but
5
- take care to ensure page security.`)})(r)+o[n+1],o[0]),r:J0}),Q0=new Map,Om=o=>(i,...t)=>{let r=t.length,n,a,s=[],l=[],d,h=0,m=!1;for(;h<r;){for(d=i[h];h<r&&(a=t[h],(n=rS(a))!==void 0);)d+=n+i[++h],m=!0;h!==r&&l.push(a),s.push(d),h++}if(h===r&&s.push(i[r]),m){let f=s.join("$$lit$$");(i=Q0.get(f))===void 0&&(s.raw=s,Q0.set(f,i=s)),t=l}return o(i,...t)},De=Om(u),_H=Om(En),zH=Om(E0);var P=o=>o??V;var Z0=o=>(i,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(o,i)}):customElements.define(o,i)};var iS={attribute:!0,type:String,converter:Ko,reflect:!1,hasChanged:Vs},nS=(o=iS,i,t)=>{let{kind:r,metadata:n}=t,a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),r==="setter"&&((o=Object.create(o)).wrapped=!0),a.set(t.name,o),r==="accessor"){let{name:s}=t;return{set(l){let d=i.get.call(this);i.set.call(this,l),this.requestUpdate(s,d,o,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,o,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];i.call(this,l),this.requestUpdate(s,d,o,!0,l)}}throw Error("Unsupported decorator location: "+r)};function p(o){return(i,t)=>typeof t=="object"?nS(o,i,t):((r,n,a)=>{let s=n.hasOwnProperty(a);return n.constructor.createProperty(a,r),s?Object.getOwnPropertyDescriptor(n,a):void 0})(o,i,t)}function D(o){return p({...o,state:!0,attribute:!1})}function e1(o){return(i,t)=>{let r=typeof i=="function"?i:i[t];Object.assign(r,o)}}var Yn=(o,i,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof i!="object"&&Object.defineProperty(o,i,t),t);function U(o,i){return(t,r,n)=>{let a=s=>s.renderRoot?.querySelector(o)??null;if(i){let{get:s,set:l}=typeof r=="object"?t:n??(()=>{let d=Symbol();return{get(){return this[d]},set(h){this[d]=h}}})();return Yn(t,r,{get(){let d=s.call(this);return d===void 0&&(d=a(this),(d!==null||this.hasUpdated)&&l.call(this,d)),d}})}return Yn(t,r,{get(){return a(this)}})}}var oS;function js(o){return(i,t)=>Yn(i,t,{get(){return(this.renderRoot??oS??(oS=document.createDocumentFragment())).querySelectorAll(o)}})}function t1(o){return(i,t)=>Yn(i,t,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(o)??null}})}function r1(o){return(i,t)=>{let{slot:r}=o??{},n="slot"+(r?`[name=${r}]`:":not([name])");return Yn(i,t,{get(){return this.renderRoot?.querySelector(n)?.assignedNodes(o)??[]}})}}var i1="important",aS=" !"+i1,It=Mt(class extends xr{constructor(o){if(super(o),o.type!==$r.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((i,t)=>{let r=o[t];return r==null?i:i+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(o,[i]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let r of this.ft)i[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in i){let n=i[r];if(n!=null){this.ft.add(r);let a=typeof n=="string"&&n.endsWith(aS);r.includes("-")||a?t.setProperty(r,a?n.slice(0,-11):n,a?i1:""):t[r]=n}}return Lt}});function Q(o,i){let t={waitUntilFirstUpdate:!1,...i};return(r,n)=>{let{update:a}=r,s=Array.isArray(o)?o:[o];r.update=function(l){s.forEach(d=>{let h=d;if(l.has(h)){let m=l.get(h),f=this[h];m!==f&&(!t.waitUntilFirstUpdate||this.hasUpdated)&&this[n](m,f)}}),a.call(this,l)}}}var sS=Object.defineProperty,lS=(o,i,t)=>i in o?sS(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,Nm=(o,i,t)=>(lS(o,typeof i!="symbol"?i+"":i,t),t),cS=(o,i,t)=>{if(!i.has(o))throw TypeError("Cannot "+t)},Pm=(o,i)=>{if(Object(i)!==i)throw TypeError('Cannot use the "in" operator on this value');return o.has(i)},Ap=(o,i,t)=>{if(i.has(o))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(o):i.set(o,t)},n1=(o,i,t)=>(cS(o,i,"access private method"),t);function o1(o,i){return Object.is(o,i)}var rr=null,Cc=!1,Lp=1,Mp=Symbol("SIGNAL");function Gs(o){let i=rr;return rr=o,i}function dS(){return rr}function pS(){return Cc}var Um={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ip(o){if(Cc)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(rr===null)return;rr.consumerOnSignalRead(o);let i=rr.nextProducerIndex++;if(Ws(rr),i<rr.producerNode.length&&rr.producerNode[i]!==o&&Bm(rr)){let t=rr.producerNode[i];qp(t,rr.producerIndexOfThis[i])}rr.producerNode[i]!==o&&(rr.producerNode[i]=o,rr.producerIndexOfThis[i]=Bm(rr)?l1(o,rr,i):0),rr.producerLastReadVersion[i]=o.version}function hS(){Lp++}function a1(o){if(!(!o.dirty&&o.lastCleanEpoch===Lp)){if(!o.producerMustRecompute(o)&&!bS(o)){o.dirty=!1,o.lastCleanEpoch=Lp;return}o.producerRecomputeValue(o),o.dirty=!1,o.lastCleanEpoch=Lp}}function s1(o){if(o.liveConsumerNode===void 0)return;let i=Cc;Cc=!0;try{for(let t of o.liveConsumerNode)t.dirty||mS(t)}finally{Cc=i}}function uS(){return rr?.consumerAllowSignalWrites!==!1}function mS(o){var i;o.dirty=!0,s1(o),(i=o.consumerMarkedDirty)==null||i.call(o.wrapper??o)}function fS(o){return o&&(o.nextProducerIndex=0),Gs(o)}function gS(o,i){if(Gs(i),!(!o||o.producerNode===void 0||o.producerIndexOfThis===void 0||o.producerLastReadVersion===void 0)){if(Bm(o))for(let t=o.nextProducerIndex;t<o.producerNode.length;t++)qp(o.producerNode[t],o.producerIndexOfThis[t]);for(;o.producerNode.length>o.nextProducerIndex;)o.producerNode.pop(),o.producerLastReadVersion.pop(),o.producerIndexOfThis.pop()}}function bS(o){Ws(o);for(let i=0;i<o.producerNode.length;i++){let t=o.producerNode[i],r=o.producerLastReadVersion[i];if(r!==t.version||(a1(t),r!==t.version))return!0}return!1}function l1(o,i,t){var r;if(jm(o),Ws(o),o.liveConsumerNode.length===0){(r=o.watched)==null||r.call(o.wrapper);for(let n=0;n<o.producerNode.length;n++)o.producerIndexOfThis[n]=l1(o.producerNode[n],o,n)}return o.liveConsumerIndexOfThis.push(t),o.liveConsumerNode.push(i)-1}function qp(o,i){var t;if(jm(o),Ws(o),typeof ngDevMode<"u"&&ngDevMode&&i>=o.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${i} is out of bounds of ${o.liveConsumerNode.length} consumers)`);if(o.liveConsumerNode.length===1){(t=o.unwatched)==null||t.call(o.wrapper);for(let n=0;n<o.producerNode.length;n++)qp(o.producerNode[n],o.producerIndexOfThis[n])}let r=o.liveConsumerNode.length-1;if(o.liveConsumerNode[i]=o.liveConsumerNode[r],o.liveConsumerIndexOfThis[i]=o.liveConsumerIndexOfThis[r],o.liveConsumerNode.length--,o.liveConsumerIndexOfThis.length--,i<o.liveConsumerNode.length){let n=o.liveConsumerIndexOfThis[i],a=o.liveConsumerNode[i];Ws(a),a.producerIndexOfThis[n]=i}}function Bm(o){var i;return o.consumerIsAlwaysLive||(((i=o?.liveConsumerNode)==null?void 0:i.length)??0)>0}function Ws(o){o.producerNode??(o.producerNode=[]),o.producerIndexOfThis??(o.producerIndexOfThis=[]),o.producerLastReadVersion??(o.producerLastReadVersion=[])}function jm(o){o.liveConsumerNode??(o.liveConsumerNode=[]),o.liveConsumerIndexOfThis??(o.liveConsumerIndexOfThis=[])}function c1(o){if(a1(o),Ip(o),o.value===Vm)throw o.error;return o.value}function vS(o){let i=Object.create(yS);i.computation=o;let t=()=>c1(i);return t[Mp]=i,t}var Hm=Symbol("UNSET"),Fm=Symbol("COMPUTING"),Vm=Symbol("ERRORED"),yS={...Um,value:Hm,dirty:!0,error:null,equal:o1,producerMustRecompute(o){return o.value===Hm||o.value===Fm},producerRecomputeValue(o){if(o.value===Fm)throw new Error("Detected cycle in computations.");let i=o.value;o.value=Fm;let t=fS(o),r,n=!1;try{r=o.computation.call(o.wrapper),n=i!==Hm&&i!==Vm&&o.equal.call(o.wrapper,i,r)}catch(a){r=Vm,o.error=a}finally{gS(o,t)}if(n){o.value=i;return}o.value=r,o.version++}};function xS(){throw new Error}var wS=xS;function _S(){wS()}function zS(o){let i=Object.create(CS);i.value=o;let t=()=>(Ip(i),i.value);return t[Mp]=i,t}function kS(){return Ip(this),this.value}function SS(o,i){uS()||_S(),o.equal.call(o.wrapper,o.value,i)||(o.value=i,ES(o))}var CS={...Um,equal:o1,value:void 0};function ES(o){o.version++,hS(),s1(o)}var Lr=Symbol("node"),yt;(o=>{var i,t,r,n,a,s;class l{constructor(m,f={}){Ap(this,t),Nm(this,i);let g=zS(m)[Mp];if(this[Lr]=g,g.wrapper=this,f){let v=f.equals;v&&(g.equal=v),g.watched=f[o.subtle.watched],g.unwatched=f[o.subtle.unwatched]}}get(){if(!(0,o.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return kS.call(this[Lr])}set(m){if(!(0,o.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(pS())throw new Error("Writes to signals not permitted during Watcher callback");let f=this[Lr];SS(f,m)}}i=Lr,t=new WeakSet,r=function(){},o.isState=h=>typeof h=="object"&&Pm(t,h),o.State=l;class d{constructor(m,f){Ap(this,a),Nm(this,n);let g=vS(m)[Mp];if(g.consumerAllowSignalWrites=!0,this[Lr]=g,g.wrapper=this,f){let v=f.equals;v&&(g.equal=v),g.watched=f[o.subtle.watched],g.unwatched=f[o.subtle.unwatched]}}get(){if(!(0,o.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return c1(this[Lr])}}n=Lr,a=new WeakSet,s=function(){},o.isComputed=h=>typeof h=="object"&&Pm(a,h),o.Computed=d,(h=>{var m,f,b,g,v;function y(L){let M,Y=null;try{Y=Gs(null),M=L()}finally{Gs(Y)}return M}h.untrack=y;function _(L){var M;if(!(0,o.isComputed)(L)&&!(0,o.isWatcher)(L))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((M=L[Lr].producerNode)==null?void 0:M.map(Y=>Y.wrapper))??[]}h.introspectSources=_;function E(L){var M;if(!(0,o.isComputed)(L)&&!(0,o.isState)(L))throw new TypeError("Called introspectSinks without a Signal argument");return((M=L[Lr].liveConsumerNode)==null?void 0:M.map(Y=>Y.wrapper))??[]}h.introspectSinks=E;function N(L){if(!(0,o.isComputed)(L)&&!(0,o.isState)(L))throw new TypeError("Called hasSinks without a Signal argument");let M=L[Lr].liveConsumerNode;return M?M.length>0:!1}h.hasSinks=N;function G(L){if(!(0,o.isComputed)(L)&&!(0,o.isWatcher)(L))throw new TypeError("Called hasSources without a Computed or Watcher argument");let M=L[Lr].producerNode;return M?M.length>0:!1}h.hasSources=G;class R{constructor(M){Ap(this,f),Ap(this,g),Nm(this,m);let Y=Object.create(Um);Y.wrapper=this,Y.consumerMarkedDirty=M,Y.consumerIsAlwaysLive=!0,Y.consumerAllowSignalWrites=!1,Y.producerNode=[],this[Lr]=Y}watch(...M){if(!(0,o.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");n1(this,g,v).call(this,M);let Y=this[Lr];Y.dirty=!1;let ie=Gs(Y);for(let ye of M)Ip(ye[Lr]);Gs(ie)}unwatch(...M){if(!(0,o.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");n1(this,g,v).call(this,M);let Y=this[Lr];Ws(Y);for(let ie=Y.producerNode.length-1;ie>=0;ie--)if(M.includes(Y.producerNode[ie].wrapper)){qp(Y.producerNode[ie],Y.producerIndexOfThis[ie]);let ye=Y.producerNode.length-1;if(Y.producerNode[ie]=Y.producerNode[ye],Y.producerIndexOfThis[ie]=Y.producerIndexOfThis[ye],Y.producerNode.length--,Y.producerIndexOfThis.length--,Y.nextProducerIndex--,ie<Y.producerNode.length){let Ie=Y.producerIndexOfThis[ie],Ve=Y.producerNode[ie];jm(Ve),Ve.liveConsumerIndexOfThis[Ie]=ie}}}getPending(){if(!(0,o.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[Lr].producerNode.filter(Y=>Y.dirty).map(Y=>Y.wrapper)}}m=Lr,f=new WeakSet,b=function(){},g=new WeakSet,v=function(L){for(let M of L)if(!(0,o.isComputed)(M)&&!(0,o.isState)(M))throw new TypeError("Called watch/unwatch without a Computed or State argument")},o.isWatcher=L=>Pm(f,L),h.Watcher=R;function C(){var L;return(L=dS())==null?void 0:L.wrapper}h.currentComputed=C,h.watched=Symbol("watched"),h.unwatched=Symbol("unwatched")})(o.subtle||(o.subtle={}))})(yt||(yt={}));var Gm=!1,d1=new yt.subtle.Watcher(()=>{Gm||(Gm=!0,queueMicrotask(()=>{Gm=!1;for(let o of d1.getPending())o.get();d1.watch()}))}),TS=Symbol("SignalWatcherBrand"),$S=new FinalizationRegistry(o=>{o.unwatch(...yt.subtle.introspectSources(o))}),p1=new WeakMap;function Rp(o){return o[TS]===!0?(console.warn("SignalWatcher should not be applied to the same class more than once."),o):class extends o{constructor(){super(...arguments),this._$St=new Map,this._$So=new yt.State(0),this._$Si=!1}_$Sl(){var i,t;let r=[],n=[];this._$St.forEach((s,l)=>{(s?.beforeUpdate?r:n).push(l)});let a=(i=this.h)===null||i===void 0?void 0:i.getPending().filter(s=>s!==this._$Su&&!this._$St.has(s));r.forEach(s=>s.get()),(t=this._$Su)===null||t===void 0||t.get(),a.forEach(s=>s.get()),n.forEach(s=>s.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new yt.Computed(()=>{this._$So.get(),super.performUpdate()});let i=this.h=new yt.subtle.Watcher(function(){let t=p1.get(this);t!==void 0&&(t._$Si===!1&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});p1.set(i,this),$S.register(this,i),i.watch(this._$Su),i.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(this.h===void 0)return;let i=!1;this.h.unwatch(...yt.subtle.introspectSources(this.h).filter(t=>{var r;let n=((r=this._$St.get(t))===null||r===void 0?void 0:r.manualDispose)!==!0;return n&&this._$St.delete(t),i||(i=!n),n})),i||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(i,t){var r;this._$S_();let n=new yt.Computed(()=>{i()});return this.h.watch(n),this._$St.set(n,t),(r=t?.beforeUpdate)!==null&&r!==void 0&&r?yt.subtle.untrack(()=>n.get()):this.updateComplete.then(()=>yt.subtle.untrack(()=>n.get())),()=>{this._$St.delete(n),this.h.unwatch(n),this.isConnected===!1&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected===!1&&this._$Sp()})}}}var{I:AS}=A0,h1=o=>o;var Dp=o=>o.strings===void 0,u1=()=>document.createComment(""),Ks=(o,i,t)=>{let r=o._$AA.parentNode,n=i===void 0?o._$AB:i._$AA;if(t===void 0){let a=r.insertBefore(u1(),n),s=r.insertBefore(u1(),n);t=new AS(a,s,o,o.options)}else{let a=t._$AB.nextSibling,s=t._$AM,l=s!==o;if(l){let d;t._$AQ?.(o),t._$AM=o,t._$AP!==void 0&&(d=o._$AU)!==s._$AU&&t._$AP(d)}if(a!==n||l){let d=t._$AA;for(;d!==a;){let h=h1(d).nextSibling;h1(r).insertBefore(d,n),d=h}}}return t},Xo=(o,i,t=o)=>(o._$AI(i,t),o),LS={},Ys=(o,i=LS)=>o._$AH=i,m1=o=>o._$AH,Op=o=>{o._$AR(),o._$AA.remove()};var Ec=(o,i)=>{let t=o._$AN;if(t===void 0)return!1;for(let r of t)r._$AO?.(i,!1),Ec(r,i);return!0},Np=o=>{let i,t;do{if((i=o._$AM)===void 0)break;t=i._$AN,t.delete(o),o=i}while(t?.size===0)},f1=o=>{for(let i;i=o._$AM;o=i){let t=i._$AN;if(t===void 0)i._$AN=t=new Set;else if(t.has(o))break;t.add(o),qS(i)}};function MS(o){this._$AN!==void 0?(Np(this),this._$AM=o,f1(this)):this._$AM=o}function IS(o,i=!1,t=0){let r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(i)if(Array.isArray(r))for(let a=t;a<r.length;a++)Ec(r[a],!1),Np(r[a]);else r!=null&&(Ec(r,!1),Np(r));else Ec(this,o)}var qS=o=>{o.type==$r.CHILD&&(o._$AP??(o._$AP=IS),o._$AQ??(o._$AQ=MS))},Qo=class extends xr{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,r){super._$AT(i,t,r),f1(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(Ec(this,i),Np(this))}setValue(i){if(Dp(this._$Ct))this._$Ct._$AI(i,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=i,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var Wm=!1,Km=new yt.subtle.Watcher(async()=>{Wm||(Wm=!0,queueMicrotask(()=>{Wm=!1;for(let o of Km.getPending())o.get();Km.watch()}))}),Pp=class extends Qo{_$S_(){var i,t;this._$Sm===void 0&&(this._$Sj=new yt.Computed(()=>{var r;let n=(r=this._$SW)===null||r===void 0?void 0:r.get();return this.setValue(n),n}),this._$Sm=(t=(i=this._$Sk)===null||i===void 0?void 0:i.h)!==null&&t!==void 0?t:Km,this._$Sm.watch(this._$Sj),yt.subtle.untrack(()=>{var r;return(r=this._$Sj)===null||r===void 0?void 0:r.get()}))}_$Sp(){this._$Sm!==void 0&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(i){return yt.subtle.untrack(()=>i.get())}update(i,[t]){var r,n;return(r=this._$Sk)!==null&&r!==void 0||(this._$Sk=(n=i.options)===null||n===void 0?void 0:n.host),t!==this._$SW&&this._$SW!==void 0&&this._$Sp(),this._$SW=t,this._$S_(),yt.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}},Ym=Mt(Pp);var Xm=o=>(i,...t)=>o(i,...t.map(r=>r instanceof yt.State||r instanceof yt.Computed?Ym(r):r)),RS=Xm(u),DS=Xm(En);var DF=yt.State,OF=yt.Computed,Qm=(o,i)=>new yt.State(o,i);function b1(o,i){return typeof document>"u"?i:document.documentElement.getAttribute(o)||document.body?.getAttribute(o)||i}function v1(){return b1("t","light")}function y1(){return b1("m","light")}var Hp=Qm(v1()),Fp=Qm(y1()),g1=!1;function OS(){g1||typeof window>"u"||(g1=!0,window.addEventListener("theme-change",o=>{let i=o.detail,t,r;if(typeof i=="string")t=i;else if(i&&typeof i=="object"){let n=i;typeof n.theme=="string"&&(t=n.theme),typeof n.mode=="string"&&(r=n.mode)}t===void 0&&(t=v1()),r===void 0&&(r=y1()),t!==Hp.get()&&Hp.set(t),r!==Fp.get()&&Fp.set(r)}))}OS();var NS=Rp(Yo),T=class extends NS{willUpdate(i){this.t=Hp.get(),this.m=Fp.get(),super.willUpdate(i)}static define(i,t=this,r={}){let n=customElements.get(i);if(!n){customElements.define(i,class extends t{},r);return}let a=" (unknown version)",s=a;"version"in t&&t.version&&typeof t.version=="string"&&(a=` v${t.version}`),"version"in n&&n.version&&typeof n.version=="string"&&(s=` v${n.version}`),!(a&&s&&a===s)&&console.warn(`Attempted to register <${i}>${a} but it is already registered as <${i}>${s}.`)}constructor(){super(),Object.entries(this.constructor.dependencies).forEach(([i,t])=>{this.constructor.define(i,t)})}emit(i,t){let r=new CustomEvent(i,{bubbles:!0,cancelable:!0,composed:!0,detail:{element:this},...t});return this.dispatchEvent(r),r}};T.dependencies={},c([p()],T.prototype,"dir",2),c([p()],T.prototype,"lang",2),c([p({reflect:!0})],T.prototype,"t",2),c([p({reflect:!0})],T.prototype,"m",2);var Ya=class extends xr{constructor(i){if(super(i),this.it=V,i.type!==$r.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(i){if(i===V||i==null)return this._t=void 0,this.it=i;if(i===Lt)return i;if(typeof i!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(i===this.it)return this._t;this.it=i;let t=[i];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ya.directiveName="unsafeHTML",Ya.resultType=1;var Ft=Mt(Ya);function sn(o,i){return new Promise(t=>{function r(n){n.target===o&&(o.removeEventListener(i,r),t())}o.addEventListener(i,r)})}var Jm=class{constructor(){this.openDropdowns=new Set;this.openTooltips=new Set}registerDropdown(i){this.openDropdowns.add(i)}unregisterDropdown(i){this.openDropdowns.delete(i)}isDropdownOpen(){return this.openDropdowns.size>0}registerTooltip(i){this.openTooltips.add(i)}unregisterTooltip(i){this.openTooltips.delete(i)}isTooltipOpen(){return this.openTooltips.size>0}},PS=new Jm,xo=PS;var x1=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:inline-block}.dropdown::part(popup){z-index:var(--zn-z-index-dropdown)}`;var Bt=class extends T{constructor(){super(...arguments);this.open=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.hoist=!0;this.sync=void 0;this.fetchedContent="";this.handlePanelSelect=t=>{let r=t.target;!this.stayOpenOnSelect&&r.tagName.toLowerCase()==="zn-menu"&&(this.hide().then(n=>n),this.focusOnTrigger())};this.handlePreload=()=>{this.preloadContent().then(t=>t)}}connectedCallback(){super.connectedCallback(),this.containingElement||(this.containingElement=this)}focusOnTrigger(){let t=this.trigger?.assignedElements({flatten:!0})[0];typeof t?.focus=="function"&&t.focus()}firstUpdated(t){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),super.firstUpdated(t)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide().then(t=>t)}getMenu(){return this.panel.assignedElements({flatten:!0}).find(t=>t.tagName.toLowerCase()==="zn-menu")}addOpenListeners(){this.panel.addEventListener("zn-select",this.handlePanelSelect),"CloseWatcher"in window?(this.closeWatcher?.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide().then(t=>t),this.focusOnTrigger()}):this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown.bind(this)),document.addEventListener("mousedown",this.handleDocumentMouseDown.bind(this)),this.closeWatcher?.destroy()}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("zn-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.closeWatcher?.destroy()}async preloadContent(){if(this.uri&&!this.fetchedContent){let t=await fetch(this.uri,{credentials:"same-origin",headers:{"x-kx-inline":"inline"}});this.fetchedContent=await t.text(),this.requestUpdate()}}async handleTriggerClick(){this.open?await this.hide():(await this.show(),this.focusOnTrigger())}handleKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.hide().then(r=>r),this.focusOnTrigger())}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key)){t.preventDefault(),await this.handleTriggerClick();return}let r=this.getMenu();if(r){let n=r.getAllItems(),a=n[0],s=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||(this.show().then(l=>l),await this.updateComplete),n.length>0&&this.updateComplete.then(()=>{(t.key==="ArrowDown"||t.key==="Home")&&(r.setCurrentItem(a),a.focus()),(t.key==="ArrowUp"||t.key==="End")&&(r.setCurrentItem(s),s.focus())}))}}handleTriggerKeyUp(t){t.key===" "&&t.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}handleDocumentMouseDown(t){let r=t.composedPath();this.containingElement&&!r.includes(this.containingElement)&&this.hide().then(n=>n)}handleDocumentKeyDown(t){if(t.key==="Escape"&&this.open&&!this.closeWatcher){t.stopPropagation(),this.focusOnTrigger(),this.hide().then(r=>r);return}if(t.key==="Tab"){if(this.open){this.hide().then(r=>r),this.panel?.assignedElements({flatten:!0}).some(r=>r.matches(":focus-within"))&&(t.preventDefault(),this.focusOnTrigger());return}setTimeout(()=>{let r=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;(!this.containingElement||r?.closest(this.containingElement.tagName.toLowerCase())!==this.containingElement)&&this.hide().then(n=>n)})}}async show(){if(!this.open)return this.open=!0,sn(this,"zn-after-show")}async hide(){if(this.open)return this.open=!1,sn(this,"zn-after-hide")}reposition(){this.popup.reposition()}updateAccessibleTrigger(){let r=this.trigger.assignedElements({flatten:!0}).find(a=>O0(a).start),n=null;r&&(r.tagName.toLowerCase()==="zn-button"?n=r.button:n=r),n&&(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded",this.open.toString()))}handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open)this.emit("zn-show"),xo.registerDropdown(this),this.addOpenListeners(),this.panel.hidden=!1,this.popup.active=!0,this.panel.focus(),this.emit("zn-after-show");else{this.emit("zn-hide"),xo.unregisterDropdown(this),this.removeOpenListeners();let t=this.getRootNode().activeElement;t&&this.panel.assignedElements({flatten:!0}).some(r=>r.contains(t))&&(this.focusOnTrigger(),t.blur()),this.panel.blur(),this.panel.hidden=!0,this.popup.active=!1,this.emit("zn-after-hide")}}render(){return u`
5
+ take care to ensure page security.`)})(r)+o[n+1],o[0]),r:J0}),Q0=new Map,Om=o=>(i,...t)=>{let r=t.length,n,a,s=[],l=[],d,h=0,m=!1;for(;h<r;){for(d=i[h];h<r&&(a=t[h],(n=rS(a))!==void 0);)d+=n+i[++h],m=!0;h!==r&&l.push(a),s.push(d),h++}if(h===r&&s.push(i[r]),m){let f=s.join("$$lit$$");(i=Q0.get(f))===void 0&&(s.raw=s,Q0.set(f,i=s)),t=l}return o(i,...t)},De=Om(u),kH=Om(En),SH=Om(E0);var P=o=>o??V;var Z0=o=>(i,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(o,i)}):customElements.define(o,i)};var iS={attribute:!0,type:String,converter:Ko,reflect:!1,hasChanged:Vs},nS=(o=iS,i,t)=>{let{kind:r,metadata:n}=t,a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),r==="setter"&&((o=Object.create(o)).wrapped=!0),a.set(t.name,o),r==="accessor"){let{name:s}=t;return{set(l){let d=i.get.call(this);i.set.call(this,l),this.requestUpdate(s,d,o,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,o,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];i.call(this,l),this.requestUpdate(s,d,o,!0,l)}}throw Error("Unsupported decorator location: "+r)};function p(o){return(i,t)=>typeof t=="object"?nS(o,i,t):((r,n,a)=>{let s=n.hasOwnProperty(a);return n.constructor.createProperty(a,r),s?Object.getOwnPropertyDescriptor(n,a):void 0})(o,i,t)}function D(o){return p({...o,state:!0,attribute:!1})}function e1(o){return(i,t)=>{let r=typeof i=="function"?i:i[t];Object.assign(r,o)}}var Yn=(o,i,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof i!="object"&&Object.defineProperty(o,i,t),t);function U(o,i){return(t,r,n)=>{let a=s=>s.renderRoot?.querySelector(o)??null;if(i){let{get:s,set:l}=typeof r=="object"?t:n??(()=>{let d=Symbol();return{get(){return this[d]},set(h){this[d]=h}}})();return Yn(t,r,{get(){let d=s.call(this);return d===void 0&&(d=a(this),(d!==null||this.hasUpdated)&&l.call(this,d)),d}})}return Yn(t,r,{get(){return a(this)}})}}var oS;function js(o){return(i,t)=>Yn(i,t,{get(){return(this.renderRoot??oS??(oS=document.createDocumentFragment())).querySelectorAll(o)}})}function t1(o){return(i,t)=>Yn(i,t,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(o)??null}})}function r1(o){return(i,t)=>{let{slot:r}=o??{},n="slot"+(r?`[name=${r}]`:":not([name])");return Yn(i,t,{get(){return this.renderRoot?.querySelector(n)?.assignedNodes(o)??[]}})}}var i1="important",aS=" !"+i1,It=Mt(class extends xr{constructor(o){if(super(o),o.type!==$r.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((i,t)=>{let r=o[t];return r==null?i:i+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(o,[i]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let r of this.ft)i[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in i){let n=i[r];if(n!=null){this.ft.add(r);let a=typeof n=="string"&&n.endsWith(aS);r.includes("-")||a?t.setProperty(r,a?n.slice(0,-11):n,a?i1:""):t[r]=n}}return Lt}});function Q(o,i){let t={waitUntilFirstUpdate:!1,...i};return(r,n)=>{let{update:a}=r,s=Array.isArray(o)?o:[o];r.update=function(l){s.forEach(d=>{let h=d;if(l.has(h)){let m=l.get(h),f=this[h];m!==f&&(!t.waitUntilFirstUpdate||this.hasUpdated)&&this[n](m,f)}}),a.call(this,l)}}}var sS=Object.defineProperty,lS=(o,i,t)=>i in o?sS(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,Nm=(o,i,t)=>(lS(o,typeof i!="symbol"?i+"":i,t),t),cS=(o,i,t)=>{if(!i.has(o))throw TypeError("Cannot "+t)},Pm=(o,i)=>{if(Object(i)!==i)throw TypeError('Cannot use the "in" operator on this value');return o.has(i)},Ap=(o,i,t)=>{if(i.has(o))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(o):i.set(o,t)},n1=(o,i,t)=>(cS(o,i,"access private method"),t);function o1(o,i){return Object.is(o,i)}var rr=null,Cc=!1,Lp=1,Mp=Symbol("SIGNAL");function Gs(o){let i=rr;return rr=o,i}function dS(){return rr}function pS(){return Cc}var Um={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ip(o){if(Cc)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(rr===null)return;rr.consumerOnSignalRead(o);let i=rr.nextProducerIndex++;if(Ws(rr),i<rr.producerNode.length&&rr.producerNode[i]!==o&&Bm(rr)){let t=rr.producerNode[i];qp(t,rr.producerIndexOfThis[i])}rr.producerNode[i]!==o&&(rr.producerNode[i]=o,rr.producerIndexOfThis[i]=Bm(rr)?l1(o,rr,i):0),rr.producerLastReadVersion[i]=o.version}function hS(){Lp++}function a1(o){if(!(!o.dirty&&o.lastCleanEpoch===Lp)){if(!o.producerMustRecompute(o)&&!bS(o)){o.dirty=!1,o.lastCleanEpoch=Lp;return}o.producerRecomputeValue(o),o.dirty=!1,o.lastCleanEpoch=Lp}}function s1(o){if(o.liveConsumerNode===void 0)return;let i=Cc;Cc=!0;try{for(let t of o.liveConsumerNode)t.dirty||mS(t)}finally{Cc=i}}function uS(){return rr?.consumerAllowSignalWrites!==!1}function mS(o){var i;o.dirty=!0,s1(o),(i=o.consumerMarkedDirty)==null||i.call(o.wrapper??o)}function fS(o){return o&&(o.nextProducerIndex=0),Gs(o)}function gS(o,i){if(Gs(i),!(!o||o.producerNode===void 0||o.producerIndexOfThis===void 0||o.producerLastReadVersion===void 0)){if(Bm(o))for(let t=o.nextProducerIndex;t<o.producerNode.length;t++)qp(o.producerNode[t],o.producerIndexOfThis[t]);for(;o.producerNode.length>o.nextProducerIndex;)o.producerNode.pop(),o.producerLastReadVersion.pop(),o.producerIndexOfThis.pop()}}function bS(o){Ws(o);for(let i=0;i<o.producerNode.length;i++){let t=o.producerNode[i],r=o.producerLastReadVersion[i];if(r!==t.version||(a1(t),r!==t.version))return!0}return!1}function l1(o,i,t){var r;if(jm(o),Ws(o),o.liveConsumerNode.length===0){(r=o.watched)==null||r.call(o.wrapper);for(let n=0;n<o.producerNode.length;n++)o.producerIndexOfThis[n]=l1(o.producerNode[n],o,n)}return o.liveConsumerIndexOfThis.push(t),o.liveConsumerNode.push(i)-1}function qp(o,i){var t;if(jm(o),Ws(o),typeof ngDevMode<"u"&&ngDevMode&&i>=o.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${i} is out of bounds of ${o.liveConsumerNode.length} consumers)`);if(o.liveConsumerNode.length===1){(t=o.unwatched)==null||t.call(o.wrapper);for(let n=0;n<o.producerNode.length;n++)qp(o.producerNode[n],o.producerIndexOfThis[n])}let r=o.liveConsumerNode.length-1;if(o.liveConsumerNode[i]=o.liveConsumerNode[r],o.liveConsumerIndexOfThis[i]=o.liveConsumerIndexOfThis[r],o.liveConsumerNode.length--,o.liveConsumerIndexOfThis.length--,i<o.liveConsumerNode.length){let n=o.liveConsumerIndexOfThis[i],a=o.liveConsumerNode[i];Ws(a),a.producerIndexOfThis[n]=i}}function Bm(o){var i;return o.consumerIsAlwaysLive||(((i=o?.liveConsumerNode)==null?void 0:i.length)??0)>0}function Ws(o){o.producerNode??(o.producerNode=[]),o.producerIndexOfThis??(o.producerIndexOfThis=[]),o.producerLastReadVersion??(o.producerLastReadVersion=[])}function jm(o){o.liveConsumerNode??(o.liveConsumerNode=[]),o.liveConsumerIndexOfThis??(o.liveConsumerIndexOfThis=[])}function c1(o){if(a1(o),Ip(o),o.value===Vm)throw o.error;return o.value}function vS(o){let i=Object.create(yS);i.computation=o;let t=()=>c1(i);return t[Mp]=i,t}var Hm=Symbol("UNSET"),Fm=Symbol("COMPUTING"),Vm=Symbol("ERRORED"),yS={...Um,value:Hm,dirty:!0,error:null,equal:o1,producerMustRecompute(o){return o.value===Hm||o.value===Fm},producerRecomputeValue(o){if(o.value===Fm)throw new Error("Detected cycle in computations.");let i=o.value;o.value=Fm;let t=fS(o),r,n=!1;try{r=o.computation.call(o.wrapper),n=i!==Hm&&i!==Vm&&o.equal.call(o.wrapper,i,r)}catch(a){r=Vm,o.error=a}finally{gS(o,t)}if(n){o.value=i;return}o.value=r,o.version++}};function xS(){throw new Error}var wS=xS;function _S(){wS()}function zS(o){let i=Object.create(CS);i.value=o;let t=()=>(Ip(i),i.value);return t[Mp]=i,t}function kS(){return Ip(this),this.value}function SS(o,i){uS()||_S(),o.equal.call(o.wrapper,o.value,i)||(o.value=i,ES(o))}var CS={...Um,equal:o1,value:void 0};function ES(o){o.version++,hS(),s1(o)}var Lr=Symbol("node"),yt;(o=>{var i,t,r,n,a,s;class l{constructor(m,f={}){Ap(this,t),Nm(this,i);let g=zS(m)[Mp];if(this[Lr]=g,g.wrapper=this,f){let v=f.equals;v&&(g.equal=v),g.watched=f[o.subtle.watched],g.unwatched=f[o.subtle.unwatched]}}get(){if(!(0,o.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return kS.call(this[Lr])}set(m){if(!(0,o.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(pS())throw new Error("Writes to signals not permitted during Watcher callback");let f=this[Lr];SS(f,m)}}i=Lr,t=new WeakSet,r=function(){},o.isState=h=>typeof h=="object"&&Pm(t,h),o.State=l;class d{constructor(m,f){Ap(this,a),Nm(this,n);let g=vS(m)[Mp];if(g.consumerAllowSignalWrites=!0,this[Lr]=g,g.wrapper=this,f){let v=f.equals;v&&(g.equal=v),g.watched=f[o.subtle.watched],g.unwatched=f[o.subtle.unwatched]}}get(){if(!(0,o.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return c1(this[Lr])}}n=Lr,a=new WeakSet,s=function(){},o.isComputed=h=>typeof h=="object"&&Pm(a,h),o.Computed=d,(h=>{var m,f,b,g,v;function y(L){let M,Y=null;try{Y=Gs(null),M=L()}finally{Gs(Y)}return M}h.untrack=y;function _(L){var M;if(!(0,o.isComputed)(L)&&!(0,o.isWatcher)(L))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((M=L[Lr].producerNode)==null?void 0:M.map(Y=>Y.wrapper))??[]}h.introspectSources=_;function E(L){var M;if(!(0,o.isComputed)(L)&&!(0,o.isState)(L))throw new TypeError("Called introspectSinks without a Signal argument");return((M=L[Lr].liveConsumerNode)==null?void 0:M.map(Y=>Y.wrapper))??[]}h.introspectSinks=E;function N(L){if(!(0,o.isComputed)(L)&&!(0,o.isState)(L))throw new TypeError("Called hasSinks without a Signal argument");let M=L[Lr].liveConsumerNode;return M?M.length>0:!1}h.hasSinks=N;function G(L){if(!(0,o.isComputed)(L)&&!(0,o.isWatcher)(L))throw new TypeError("Called hasSources without a Computed or Watcher argument");let M=L[Lr].producerNode;return M?M.length>0:!1}h.hasSources=G;class R{constructor(M){Ap(this,f),Ap(this,g),Nm(this,m);let Y=Object.create(Um);Y.wrapper=this,Y.consumerMarkedDirty=M,Y.consumerIsAlwaysLive=!0,Y.consumerAllowSignalWrites=!1,Y.producerNode=[],this[Lr]=Y}watch(...M){if(!(0,o.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");n1(this,g,v).call(this,M);let Y=this[Lr];Y.dirty=!1;let ie=Gs(Y);for(let ye of M)Ip(ye[Lr]);Gs(ie)}unwatch(...M){if(!(0,o.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");n1(this,g,v).call(this,M);let Y=this[Lr];Ws(Y);for(let ie=Y.producerNode.length-1;ie>=0;ie--)if(M.includes(Y.producerNode[ie].wrapper)){qp(Y.producerNode[ie],Y.producerIndexOfThis[ie]);let ye=Y.producerNode.length-1;if(Y.producerNode[ie]=Y.producerNode[ye],Y.producerIndexOfThis[ie]=Y.producerIndexOfThis[ye],Y.producerNode.length--,Y.producerIndexOfThis.length--,Y.nextProducerIndex--,ie<Y.producerNode.length){let Ie=Y.producerIndexOfThis[ie],Ve=Y.producerNode[ie];jm(Ve),Ve.liveConsumerIndexOfThis[Ie]=ie}}}getPending(){if(!(0,o.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[Lr].producerNode.filter(Y=>Y.dirty).map(Y=>Y.wrapper)}}m=Lr,f=new WeakSet,b=function(){},g=new WeakSet,v=function(L){for(let M of L)if(!(0,o.isComputed)(M)&&!(0,o.isState)(M))throw new TypeError("Called watch/unwatch without a Computed or State argument")},o.isWatcher=L=>Pm(f,L),h.Watcher=R;function C(){var L;return(L=dS())==null?void 0:L.wrapper}h.currentComputed=C,h.watched=Symbol("watched"),h.unwatched=Symbol("unwatched")})(o.subtle||(o.subtle={}))})(yt||(yt={}));var Gm=!1,d1=new yt.subtle.Watcher(()=>{Gm||(Gm=!0,queueMicrotask(()=>{Gm=!1;for(let o of d1.getPending())o.get();d1.watch()}))}),TS=Symbol("SignalWatcherBrand"),$S=new FinalizationRegistry(o=>{o.unwatch(...yt.subtle.introspectSources(o))}),p1=new WeakMap;function Rp(o){return o[TS]===!0?(console.warn("SignalWatcher should not be applied to the same class more than once."),o):class extends o{constructor(){super(...arguments),this._$St=new Map,this._$So=new yt.State(0),this._$Si=!1}_$Sl(){var i,t;let r=[],n=[];this._$St.forEach((s,l)=>{(s?.beforeUpdate?r:n).push(l)});let a=(i=this.h)===null||i===void 0?void 0:i.getPending().filter(s=>s!==this._$Su&&!this._$St.has(s));r.forEach(s=>s.get()),(t=this._$Su)===null||t===void 0||t.get(),a.forEach(s=>s.get()),n.forEach(s=>s.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new yt.Computed(()=>{this._$So.get(),super.performUpdate()});let i=this.h=new yt.subtle.Watcher(function(){let t=p1.get(this);t!==void 0&&(t._$Si===!1&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});p1.set(i,this),$S.register(this,i),i.watch(this._$Su),i.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(this.h===void 0)return;let i=!1;this.h.unwatch(...yt.subtle.introspectSources(this.h).filter(t=>{var r;let n=((r=this._$St.get(t))===null||r===void 0?void 0:r.manualDispose)!==!0;return n&&this._$St.delete(t),i||(i=!n),n})),i||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(i,t){var r;this._$S_();let n=new yt.Computed(()=>{i()});return this.h.watch(n),this._$St.set(n,t),(r=t?.beforeUpdate)!==null&&r!==void 0&&r?yt.subtle.untrack(()=>n.get()):this.updateComplete.then(()=>yt.subtle.untrack(()=>n.get())),()=>{this._$St.delete(n),this.h.unwatch(n),this.isConnected===!1&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected===!1&&this._$Sp()})}}}var{I:AS}=A0,h1=o=>o;var Dp=o=>o.strings===void 0,u1=()=>document.createComment(""),Ks=(o,i,t)=>{let r=o._$AA.parentNode,n=i===void 0?o._$AB:i._$AA;if(t===void 0){let a=r.insertBefore(u1(),n),s=r.insertBefore(u1(),n);t=new AS(a,s,o,o.options)}else{let a=t._$AB.nextSibling,s=t._$AM,l=s!==o;if(l){let d;t._$AQ?.(o),t._$AM=o,t._$AP!==void 0&&(d=o._$AU)!==s._$AU&&t._$AP(d)}if(a!==n||l){let d=t._$AA;for(;d!==a;){let h=h1(d).nextSibling;h1(r).insertBefore(d,n),d=h}}}return t},Xo=(o,i,t=o)=>(o._$AI(i,t),o),LS={},Ys=(o,i=LS)=>o._$AH=i,m1=o=>o._$AH,Op=o=>{o._$AR(),o._$AA.remove()};var Ec=(o,i)=>{let t=o._$AN;if(t===void 0)return!1;for(let r of t)r._$AO?.(i,!1),Ec(r,i);return!0},Np=o=>{let i,t;do{if((i=o._$AM)===void 0)break;t=i._$AN,t.delete(o),o=i}while(t?.size===0)},f1=o=>{for(let i;i=o._$AM;o=i){let t=i._$AN;if(t===void 0)i._$AN=t=new Set;else if(t.has(o))break;t.add(o),qS(i)}};function MS(o){this._$AN!==void 0?(Np(this),this._$AM=o,f1(this)):this._$AM=o}function IS(o,i=!1,t=0){let r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(i)if(Array.isArray(r))for(let a=t;a<r.length;a++)Ec(r[a],!1),Np(r[a]);else r!=null&&(Ec(r,!1),Np(r));else Ec(this,o)}var qS=o=>{o.type==$r.CHILD&&(o._$AP??(o._$AP=IS),o._$AQ??(o._$AQ=MS))},Qo=class extends xr{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,r){super._$AT(i,t,r),f1(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(Ec(this,i),Np(this))}setValue(i){if(Dp(this._$Ct))this._$Ct._$AI(i,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=i,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var Wm=!1,Km=new yt.subtle.Watcher(async()=>{Wm||(Wm=!0,queueMicrotask(()=>{Wm=!1;for(let o of Km.getPending())o.get();Km.watch()}))}),Pp=class extends Qo{_$S_(){var i,t;this._$Sm===void 0&&(this._$Sj=new yt.Computed(()=>{var r;let n=(r=this._$SW)===null||r===void 0?void 0:r.get();return this.setValue(n),n}),this._$Sm=(t=(i=this._$Sk)===null||i===void 0?void 0:i.h)!==null&&t!==void 0?t:Km,this._$Sm.watch(this._$Sj),yt.subtle.untrack(()=>{var r;return(r=this._$Sj)===null||r===void 0?void 0:r.get()}))}_$Sp(){this._$Sm!==void 0&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(i){return yt.subtle.untrack(()=>i.get())}update(i,[t]){var r,n;return(r=this._$Sk)!==null&&r!==void 0||(this._$Sk=(n=i.options)===null||n===void 0?void 0:n.host),t!==this._$SW&&this._$SW!==void 0&&this._$Sp(),this._$SW=t,this._$S_(),yt.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}},Ym=Mt(Pp);var Xm=o=>(i,...t)=>o(i,...t.map(r=>r instanceof yt.State||r instanceof yt.Computed?Ym(r):r)),RS=Xm(u),DS=Xm(En);var NF=yt.State,PF=yt.Computed,Qm=(o,i)=>new yt.State(o,i);function b1(o,i){return typeof document>"u"?i:document.documentElement.getAttribute(o)||document.body?.getAttribute(o)||i}function v1(){return b1("t","light")}function y1(){return b1("m","light")}var Hp=Qm(v1()),Fp=Qm(y1()),g1=!1;function OS(){g1||typeof window>"u"||(g1=!0,window.addEventListener("theme-change",o=>{let i=o.detail,t,r;if(typeof i=="string")t=i;else if(i&&typeof i=="object"){let n=i;typeof n.theme=="string"&&(t=n.theme),typeof n.mode=="string"&&(r=n.mode)}t===void 0&&(t=v1()),r===void 0&&(r=y1()),t!==Hp.get()&&Hp.set(t),r!==Fp.get()&&Fp.set(r)}))}OS();var NS=Rp(Yo),T=class extends NS{willUpdate(i){this.t=Hp.get(),this.m=Fp.get(),super.willUpdate(i)}static define(i,t=this,r={}){let n=customElements.get(i);if(!n){customElements.define(i,class extends t{},r);return}let a=" (unknown version)",s=a;"version"in t&&t.version&&typeof t.version=="string"&&(a=` v${t.version}`),"version"in n&&n.version&&typeof n.version=="string"&&(s=` v${n.version}`),!(a&&s&&a===s)&&console.warn(`Attempted to register <${i}>${a} but it is already registered as <${i}>${s}.`)}constructor(){super(),Object.entries(this.constructor.dependencies).forEach(([i,t])=>{this.constructor.define(i,t)})}emit(i,t){let r=new CustomEvent(i,{bubbles:!0,cancelable:!0,composed:!0,detail:{element:this},...t});return this.dispatchEvent(r),r}};T.dependencies={},c([p()],T.prototype,"dir",2),c([p()],T.prototype,"lang",2),c([p({reflect:!0})],T.prototype,"t",2),c([p({reflect:!0})],T.prototype,"m",2);var Ya=class extends xr{constructor(i){if(super(i),this.it=V,i.type!==$r.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(i){if(i===V||i==null)return this._t=void 0,this.it=i;if(i===Lt)return i;if(typeof i!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(i===this.it)return this._t;this.it=i;let t=[i];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ya.directiveName="unsafeHTML",Ya.resultType=1;var Ft=Mt(Ya);function sn(o,i){return new Promise(t=>{function r(n){n.target===o&&(o.removeEventListener(i,r),t())}o.addEventListener(i,r)})}var Jm=class{constructor(){this.openDropdowns=new Set;this.openTooltips=new Set}registerDropdown(i){this.openDropdowns.add(i)}unregisterDropdown(i){this.openDropdowns.delete(i)}isDropdownOpen(){return this.openDropdowns.size>0}registerTooltip(i){this.openTooltips.add(i)}unregisterTooltip(i){this.openTooltips.delete(i)}isTooltipOpen(){return this.openTooltips.size>0}},PS=new Jm,xo=PS;var x1=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:inline-block}.dropdown::part(popup){z-index:var(--zn-z-index-dropdown)}`;var Bt=class extends T{constructor(){super(...arguments);this.open=!1;this.placement="bottom-start";this.disabled=!1;this.stayOpenOnSelect=!1;this.distance=0;this.skidding=0;this.hoist=!0;this.sync=void 0;this.fetchedContent="";this.handlePanelSelect=t=>{let r=t.target;!this.stayOpenOnSelect&&r.tagName.toLowerCase()==="zn-menu"&&(this.hide().then(n=>n),this.focusOnTrigger())};this.handlePreload=()=>{this.preloadContent().then(t=>t)}}connectedCallback(){super.connectedCallback(),this.containingElement||(this.containingElement=this)}focusOnTrigger(){let t=this.trigger?.assignedElements({flatten:!0})[0];typeof t?.focus=="function"&&t.focus()}firstUpdated(t){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),super.firstUpdated(t)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide().then(t=>t)}getMenu(){return this.panel.assignedElements({flatten:!0}).find(t=>t.tagName.toLowerCase()==="zn-menu")}addOpenListeners(){this.panel.addEventListener("zn-select",this.handlePanelSelect),"CloseWatcher"in window?(this.closeWatcher?.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide().then(t=>t),this.focusOnTrigger()}):this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown.bind(this)),document.addEventListener("mousedown",this.handleDocumentMouseDown.bind(this)),this.closeWatcher?.destroy()}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("zn-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.closeWatcher?.destroy()}async preloadContent(){if(this.uri&&!this.fetchedContent){let t=await fetch(this.uri,{credentials:"same-origin",headers:{"x-kx-inline":"inline"}});this.fetchedContent=await t.text(),this.requestUpdate()}}async handleTriggerClick(){this.open?await this.hide():(await this.show(),this.focusOnTrigger())}handleKeyDown(t){this.open&&t.key==="Escape"&&(t.stopPropagation(),this.hide().then(r=>r),this.focusOnTrigger())}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key)){t.preventDefault(),await this.handleTriggerClick();return}let r=this.getMenu();if(r){let n=r.getAllItems(),a=n[0],s=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||(this.show().then(l=>l),await this.updateComplete),n.length>0&&this.updateComplete.then(()=>{(t.key==="ArrowDown"||t.key==="Home")&&(r.setCurrentItem(a),a.focus()),(t.key==="ArrowUp"||t.key==="End")&&(r.setCurrentItem(s),s.focus())}))}}handleTriggerKeyUp(t){t.key===" "&&t.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}handleDocumentMouseDown(t){let r=t.composedPath();this.containingElement&&!r.includes(this.containingElement)&&this.hide().then(n=>n)}handleDocumentKeyDown(t){if(t.key==="Escape"&&this.open&&!this.closeWatcher){t.stopPropagation(),this.focusOnTrigger(),this.hide().then(r=>r);return}if(t.key==="Tab"){if(this.open){this.hide().then(r=>r),this.panel?.assignedElements({flatten:!0}).some(r=>r.matches(":focus-within"))&&(t.preventDefault(),this.focusOnTrigger());return}setTimeout(()=>{let r=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;(!this.containingElement||r?.closest(this.containingElement.tagName.toLowerCase())!==this.containingElement)&&this.hide().then(n=>n)})}}async show(){if(!this.open)return this.open=!0,sn(this,"zn-after-show")}async hide(){if(this.open)return this.open=!1,sn(this,"zn-after-hide")}reposition(){this.popup.reposition()}updateAccessibleTrigger(){let r=this.trigger.assignedElements({flatten:!0}).find(a=>O0(a).start),n=null;r&&(r.tagName.toLowerCase()==="zn-button"?n=r.button:n=r),n&&(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded",this.open.toString()))}handleOpenChange(){if(this.disabled){this.open=!1;return}if(this.updateAccessibleTrigger(),this.open)this.emit("zn-show"),xo.registerDropdown(this),this.addOpenListeners(),this.panel.hidden=!1,this.popup.active=!0,this.panel.focus(),this.emit("zn-after-show");else{this.emit("zn-hide"),xo.unregisterDropdown(this),this.removeOpenListeners();let t=this.getRootNode().activeElement;t&&this.panel.assignedElements({flatten:!0}).some(r=>r.contains(t))&&(this.focusOnTrigger(),t.blur()),this.panel.blur(),this.panel.hidden=!0,this.popup.active=!1,this.emit("zn-after-hide")}}render(){return u`
6
6
  <zn-popup
7
7
  part="base"
8
8
  exportparts="popup:base__popup"
@@ -201,7 +201,7 @@ import{a as bo,b as A8,c as Vr,d as c,e as W}from"./chunks/zn.UBLZO6CI.js";var R
201
201
  <slot @slotchange=${this.handleSlotChange}></slot>
202
202
  </div>`}};vi.styles=k(ny),c([p({})],vi.prototype,"direction",2),c([p({type:Boolean})],vi.prototype,"grow",2),c([p({type:Boolean})],vi.prototype,"wrap",2),c([p({type:Boolean})],vi.prototype,"start",2),c([p({type:Boolean})],vi.prototype,"gap",2),c([p({type:Boolean,attribute:"panel-bg"})],vi.prototype,"panelBackground",2),c([U("slot")],vi.prototype,"defaultSlot",2);var Nc=vi;vi.define("zn-button-group");function mC(o,i){this.v=o,this.k=i}function oy(o,i){(i==null||i>o.length)&&(i=o.length);for(var t=0,r=Array(i);t<i;t++)r[t]=o[t];return r}function fC(o){if(Array.isArray(o))return o}function gC(o,i){var t=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(t!=null){var r,n,a,s,l=[],d=!0,h=!1;try{if(a=(t=t.call(o)).next,i===0){if(Object(t)!==t)return;d=!1}else for(;!(d=(r=a.call(t)).done)&&(l.push(r.value),l.length!==i);d=!0);}catch(m){h=!0,n=m}finally{try{if(!d&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(h)throw n}}return l}}function bC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
203
203
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vC(o,i){return fC(o)||gC(o,i)||yC(o,i)||bC()}function yC(o,i){if(o){if(typeof o=="string")return oy(o,i);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?oy(o,i):void 0}}function th(o){var i,t;function r(a,s){try{var l=o[a](s),d=l.value,h=d instanceof mC;Promise.resolve(h?d.v:d).then(function(m){if(h){var f=a==="return"&&d.k?a:"next";if(!d.k||m.done)return r(f,m);m=o[f](m).value}n(!!l.done,m)},function(m){r("throw",m)})}catch(m){n(2,m)}}function n(a,s){a===2?i.reject(s):i.resolve({value:s,done:a}),(i=i.next)?r(i.key,i.arg):t=null}this._invoke=function(a,s){return new Promise(function(l,d){var h={key:a,arg:s,resolve:l,reject:d,next:null};t?t=t.next=h:(i=t=h,r(a,s))})},typeof o.return!="function"&&(this.return=void 0)}th.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},th.prototype.next=function(o){return this._invoke("next",o)},th.prototype.throw=function(o){return this._invoke("throw",o)},th.prototype.return=function(o){return this._invoke("return",o)};var xy=Object.entries,ay=Object.setPrototypeOf,xC=Object.isFrozen,wC=Object.getPrototypeOf,_C=Object.getOwnPropertyDescriptor,pr=Object.freeze,wr=Object.seal,rl=Object.create,wy=typeof Reflect<"u"&&Reflect,gf=wy.apply,bf=wy.construct;pr||(pr=function(i){return i});wr||(wr=function(i){return i});gf||(gf=function(i,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];return i.apply(t,n)});bf||(bf=function(i){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new i(...r)});var is=nr(Array.prototype.forEach);Array.prototype.indexOf;var zC=nr(Array.prototype.lastIndexOf),sy=nr(Array.prototype.pop),Pc=nr(Array.prototype.push);Array.prototype.slice;var kC=nr(Array.prototype.splice),il=Array.isArray,Bc=nr(String.prototype.toLowerCase),df=nr(String.prototype.toString),ly=nr(String.prototype.match),Hc=nr(String.prototype.replace),cy=nr(String.prototype.indexOf),SC=nr(String.prototype.trim),CC=nr(Number.prototype.toString),EC=nr(Boolean.prototype.toString),dy=typeof BigInt>"u"?null:nr(BigInt.prototype.toString),py=typeof Symbol>"u"?null:nr(Symbol.prototype.toString),yi=nr(Object.prototype.hasOwnProperty),Fc=nr(Object.prototype.toString),jr=nr(RegExp.prototype.test),ta=TC(TypeError);function nr(o){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gf(o,i,r)}}function TC(o){return function(){for(var i=arguments.length,t=new Array(i),r=0;r<i;r++)t[r]=arguments[r];return bf(o,t)}}function Ue(o,i){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bc;if(ay&&ay(o,null),!il(i))return o;let r=i.length;for(;r--;){let n=i[r];if(typeof n=="string"){let a=t(n);a!==n&&(xC(i)||(i[r]=a),n=a)}o[n]=!0}return o}function $C(o){for(let i=0;i<o.length;i++)yi(o,i)||(o[i]=null);return o}function Ui(o){let i=rl(null);for(let r of xy(o)){var t=vC(r,2);let n=t[0],a=t[1];yi(o,n)&&(il(a)?i[n]=$C(a):a&&typeof a=="object"&&a.constructor===Object?i[n]=Ui(a):i[n]=a)}return i}function AC(o){switch(typeof o){case"string":return o;case"number":return CC(o);case"boolean":return EC(o);case"bigint":return dy?dy(o):"0";case"symbol":return py?py(o):"Symbol()";case"undefined":return Fc(o);case"function":case"object":{if(o===null)return Fc(o);let i=o,t=ln(i,"toString");if(typeof t=="function"){let r=t(i);return typeof r=="string"?r:Fc(r)}return Fc(o)}default:return Fc(o)}}function ln(o,i){for(;o!==null;){let r=_C(o,i);if(r){if(r.get)return nr(r.get);if(typeof r.value=="function")return nr(r.value)}o=wC(o)}function t(){return null}return t}function LC(o){try{return jr(o,""),!0}catch{return!1}}var hy=pr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pf=pr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hf=pr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),MC=pr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),uf=pr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),IC=pr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),uy=pr(["#text"]),my=pr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),mf=pr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fy=pr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rh=pr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qC=wr(/{{[\w\W]*|^[\w\W]*}}/g),RC=wr(/<%[\w\W]*|^[\w\W]*%>/g),DC=wr(/\${[\w\W]*/g),OC=wr(/^data-[\-\w.\u00B7-\uFFFF]+$/),NC=wr(/^aria-[\-\w]+$/),gy=wr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),PC=wr(/^(?:\w+script|data):/i),HC=wr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FC=wr(/^html$/i),BC=wr(/^[a-z][.\w]*(-[.\w]+)+$/i),by=wr(/<[/\w!]/g),vy=wr(/<[/\w]/g),VC=wr(/<\/no(script|embed|frames)/i),UC=wr(/\/>/i),Vi={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_y=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],jC=pr(Ue({},_y)),GC=(function(){let o={};return is(_y,i=>{o[i]=wr(new RegExp("</"+i+"(?=[\\t\\n\\f\\r />])","i"))}),pr(o)})(),WC=function(){return typeof window>"u"?null:window},KC=function(i,t){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let a="dompurify"+(r?"#"+r:"");try{return i.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},yy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ra=function(i,t,r,n){return yi(i,t)&&il(i[t])?Ue(n.base?Ui(n.base):{},i[t],n.transform):r},ff=function(i,t,r){let n=yi(i,t)?i[t]:void 0;return n&&typeof n=="object"?Ui(n):r()};function zy(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:WC(),i=J=>zy(J);if(i.version="3.4.16",i.removed=[],!o||!o.document||o.document.nodeType!==Vi.document||!o.Element)return i.isSupported=!1,i;let t=o.document,r=t,n=r.currentScript;o.DocumentFragment;let a=o.HTMLTemplateElement,s=o.Node,l=o.Element,d=o.NodeFilter;o.NamedNodeMap===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;let h=o.DOMParser,m=o.trustedTypes,f=l.prototype,b=ln(f,"cloneNode"),g=ln(f,"remove"),v=ln(f,"removeAttributeNode"),y=ln(f,"nextSibling"),_=ln(f,"childNodes"),E=ln(f,"parentNode"),N=ln(f,"shadowRoot"),G=ln(f,"attributes"),R=s&&s.prototype?ln(s.prototype,"nodeType"):null,C=s&&s.prototype?ln(s.prototype,"nodeName"):null,L=s&&s.prototype?ln(s.prototype,"ownerDocument"):null,M=function(z){return R?R(z):z.nodeType},Y=function(z){return C?C(z):z.nodeName};if(typeof a=="function"){let J=t.createElement("template");J.content&&J.content.ownerDocument&&(t=J.content.ownerDocument)}let ie,ye="",Ie,Ve=!1,Ye=0,Wt=function(){if(Ye>0)throw ta('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Nt=function(z){Wt(),Ye++;try{return ie.createHTML(z)}finally{Ye--}},yr=function(z){Wt(),Ye++;try{return ie.createScriptURL(z)}finally{Ye--}},Pt=function(){return Ve||(Ie=KC(m,n),Ve=!0),Ie},At=t,vt=At.implementation,Cn=At.createNodeIterator,Uo=At.createDocumentFragment,xe=At.getElementsByTagName,Pi=r.importNode,Me=yy();i.isSupported=typeof xy=="function"&&typeof E=="function"&&vt&&vt.createHTMLDocument!==void 0;let ve=qC,pe=RC,Te=DC,H=OC,x=NC,A=PC,w=HC,O=BC,I=gy,$=null,B=Ue({},[...hy,...pf,...hf,...uf,...uy]),j=null,ee=Ue({},[...my,...mf,...fy,...rh]),ne=Object.seal(rl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ae=null,de=null,Xe=Object.seal(rl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Tr=!0,tr=!0,Hi=!1,jo=!0,Br=!1,ai=!0,si=!1,Fa=!1,go=null,Ms=null,uc=!1,Is=!1,cp=!1,dp=!1,Yv=!0,Xv=!1,Qv="user-content-",fm=!0,gm=!1,qs={},Rs=null,Jv=Ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Zv=null,e0=Ue({},["audio","video","img","source","image","track"]),t0=null,r0=Ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pp="http://www.w3.org/1998/Math/MathML",hp="http://www.w3.org/2000/svg",Wn="http://www.w3.org/1999/xhtml",Ds=Wn,bm=!1,vm=null,m8=Ue({},[pp,hp,Wn],df),i0=pr(["mi","mo","mn","ms","mtext"]),ym=Ue({},i0),n0=pr(["annotation-xml"]),xm=Ue({},n0),f8=Ue({},["title","style","font","a","script"]),mc=null,g8=["application/xhtml+xml","text/html"],b8="text/html",Kt=null,Os=null,v8=t.createElement("form"),o0=function(z){return z instanceof RegExp||z instanceof Function},wm=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Os&&Os===z)return;(!z||typeof z!="object")&&(z={}),z=Ui(z),mc=g8.indexOf(z.PARSER_MEDIA_TYPE)===-1?b8:z.PARSER_MEDIA_TYPE,Kt=mc==="application/xhtml+xml"?df:Bc,$=ra(z,"ALLOWED_TAGS",B,{transform:Kt}),j=ra(z,"ALLOWED_ATTR",ee,{transform:Kt}),vm=ra(z,"ALLOWED_NAMESPACES",m8,{transform:df}),t0=ra(z,"ADD_URI_SAFE_ATTR",r0,{transform:Kt,base:r0}),Zv=ra(z,"ADD_DATA_URI_TAGS",e0,{transform:Kt,base:e0}),Rs=ra(z,"FORBID_CONTENTS",Jv,{transform:Kt}),ae=ra(z,"FORBID_TAGS",Ui({}),{transform:Kt}),de=ra(z,"FORBID_ATTR",Ui({}),{transform:Kt}),qs=yi(z,"USE_PROFILES")?z.USE_PROFILES&&typeof z.USE_PROFILES=="object"?Ui(z.USE_PROFILES):z.USE_PROFILES:!1,Tr=z.ALLOW_ARIA_ATTR!==!1,tr=z.ALLOW_DATA_ATTR!==!1,Hi=z.ALLOW_UNKNOWN_PROTOCOLS||!1,jo=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Br=z.SAFE_FOR_TEMPLATES||!1,ai=z.SAFE_FOR_XML!==!1,si=z.WHOLE_DOCUMENT||!1,Is=z.RETURN_DOM||!1,cp=z.RETURN_DOM_FRAGMENT||!1,dp=z.RETURN_TRUSTED_TYPE||!1,uc=z.FORCE_BODY||!1,Yv=z.SANITIZE_DOM!==!1,Xv=z.SANITIZE_NAMED_PROPS||!1,fm=z.KEEP_CONTENT!==!1,gm=z.IN_PLACE||!1,I=LC(z.ALLOWED_URI_REGEXP)?z.ALLOWED_URI_REGEXP:gy,Ds=typeof z.NAMESPACE=="string"?z.NAMESPACE:Wn,ym=ff(z,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ue({},i0)),xm=ff(z,"HTML_INTEGRATION_POINTS",()=>Ue({},n0));let F=ff(z,"CUSTOM_ELEMENT_HANDLING",()=>rl(null));if(ne=rl(null),yi(F,"tagNameCheck")&&o0(F.tagNameCheck)&&(ne.tagNameCheck=F.tagNameCheck),yi(F,"attributeNameCheck")&&o0(F.attributeNameCheck)&&(ne.attributeNameCheck=F.attributeNameCheck),yi(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),wr(ne),Br&&(tr=!1),cp&&(Is=!0),qs&&($=Ue({},uy),j=rl(null),qs.html===!0&&(Ue($,hy),Ue(j,my)),qs.svg===!0&&(Ue($,pf),Ue(j,mf),Ue(j,rh)),qs.svgFilters===!0&&(Ue($,hf),Ue(j,mf),Ue(j,rh)),qs.mathMl===!0&&(Ue($,uf),Ue(j,fy),Ue(j,rh))),Xe.tagCheck=null,Xe.attributeCheck=null,yi(z,"ADD_TAGS")&&(typeof z.ADD_TAGS=="function"?Xe.tagCheck=z.ADD_TAGS:il(z.ADD_TAGS)&&($===B&&($=Ui($)),Ue($,z.ADD_TAGS,Kt))),yi(z,"ADD_ATTR")&&(typeof z.ADD_ATTR=="function"?Xe.attributeCheck=z.ADD_ATTR:il(z.ADD_ATTR)&&(j===ee&&(j=Ui(j)),Ue(j,z.ADD_ATTR,Kt))),yi(z,"ADD_FORBID_CONTENTS")&&il(z.ADD_FORBID_CONTENTS)&&(Rs===Jv&&(Rs=Ui(Rs)),Ue(Rs,z.ADD_FORBID_CONTENTS,Kt)),fm&&($["#text"]=!0),si&&Ue($,["html","head","body"]),$.table&&(Ue($,["tbody"]),delete ae.tbody),z.TRUSTED_TYPES_POLICY){if(typeof z.TRUSTED_TYPES_POLICY.createHTML!="function")throw ta('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ta('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let X=ie;ie=z.TRUSTED_TYPES_POLICY;try{ye=Nt("")}catch(Z){throw ie=X,Z}}else z.TRUSTED_TYPES_POLICY===null?(ie=void 0,ye=""):(ie===void 0&&(ie=Pt()),ie&&typeof ye=="string"&&(ye=Nt("")));pr&&pr(z),Os=z},a0=Ue({},[...pf,...hf,...MC]),s0=Ue({},[...uf,...IC]),y8=function(z,F,X){return F.namespaceURI===Wn?z==="svg":F.namespaceURI===pp?z==="svg"&&(X==="annotation-xml"||ym[X]):!!a0[z]},x8=function(z,F,X){return F.namespaceURI===Wn?z==="math":F.namespaceURI===hp?z==="math"&&xm[X]:!!s0[z]},w8=function(z,F,X){return F.namespaceURI===hp&&!xm[X]||F.namespaceURI===pp&&!ym[X]?!1:!s0[z]&&(f8[z]||!a0[z])},_8=function(z){let F=E(z);(!F||!F.tagName)&&(F={namespaceURI:Ds,tagName:"template"});let X=Bc(z.tagName),Z=Bc(F.tagName);return vm[z.namespaceURI]?z.namespaceURI===hp?y8(X,F,Z):z.namespaceURI===pp?x8(X,F,Z):z.namespaceURI===Wn?w8(X,F,Z):!!(mc==="application/xhtml+xml"&&vm[z.namespaceURI]):!1},Go=function(z){Pc(i.removed,{element:z});try{E(z).removeChild(z)}catch{if(g(z),!E(z))throw ta("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},l0=function(z,F,X){try{v(z,F)}catch{try{z.removeAttribute(X)}catch{}}},up=function(z){mp(z);let F=_(z);if(F){let Z=[];is(F,me=>{Pc(Z,me)}),is(Z,me=>{try{g(me)}catch{}})}let X=G(z);if(X)for(let Z=X.length-1;Z>=0;--Z){let me=X[Z],$e=me&&me.name;typeof $e=="string"&&l0(z,me,$e)}},Ba=function(z,F,X){if(!X)try{X=F.getAttributeNode(z)}catch{X=null}Pc(i.removed,{attribute:X||null,from:F});try{X?v(F,X):F.removeAttribute(z)}catch{try{F.removeAttribute(z)}catch{}}if(z==="is")if(Is||cp)try{Go(F)}catch{}else try{F.setAttribute(z,"")}catch{}},z8=function(z){let F=G(z);if(F)for(let X=F.length-1;X>=0;--X){let Z=F[X],me=Z&&Z.name;typeof me!="string"||j[Kt(me)]||l0(z,Z,me)}},mp=function(z){let F=[z];for(;F.length>0;){let X=F.pop();M(X)===Vi.element&&z8(X);let Z=_(X);if(Z)for(let me=Z.length-1;me>=0;--me)F.push(Z[me])}},c0=function(z,F){return ai?z==="patchsrc"?!0:z==="for"&&F!=="label"&&F!=="output":!1},k8=function(z){if(!ai)return;let F=[z];for(;F.length>0;){let X=F.pop(),Z=M(X);if(Z===Vi.processingInstruction||Z===Vi.comment&&jr(vy,X.data)){try{g(X)}catch{}continue}if(Z===Vi.element){let $e=X,Re=Kt(Y(X));try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&c0("for",Re)&&$e.removeAttribute("for")}catch{}}let me=_(X);if(me)for(let $e=me.length-1;$e>=0;--$e)F.push(me[$e])}},d0=function(z){let F=null,X=null;if(uc)z="<remove></remove>"+z;else{let $e=ly(z,/^[\r\n\t ]+/);X=$e&&$e[0]}mc==="application/xhtml+xml"&&Ds===Wn&&(z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+z+"</body></html>");let Z=ie?Nt(z):z;if(Ds===Wn)try{F=new h().parseFromString(Z,mc)}catch{}if(!F||!F.documentElement){F=vt.createDocument(Ds,"template",null);try{F.documentElement.innerHTML=bm?ye:Z}catch{}}let me=F.body||F.documentElement;return z&&X&&me.insertBefore(t.createTextNode(X),me.childNodes[0]||null),Ds===Wn?xe.call(F,si?"html":"body")[0]:si?F.documentElement:me},p0=function(z){let F=L?L(z):z.ownerDocument;return Cn.call(F||z,z,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},fp=function(z){return z=Hc(z,ve," "),z=Hc(z,pe," "),z=Hc(z,Te," "),z},_m=function(z){var F;z.normalize();let X=L?L(z):z.ownerDocument,Z=Cn.call(X||z,z,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null),me=Z.nextNode();for(;me;)me.data=fp(me.data),me=Z.nextNode();let $e=(F=z.querySelectorAll)===null||F===void 0?void 0:F.call(z,"template");$e&&is($e,Re=>{Ns(Re.content)&&_m(Re.content)})},gp=function(z){let F=C?C(z):null;return typeof F!="string"||Kt(F)!=="form"?!1:typeof z.nodeName!="string"||typeof z.textContent!="string"||typeof z.removeChild!="function"||z.attributes!==G(z)||typeof z.removeAttribute!="function"||typeof z.removeAttributeNode!="function"||typeof z.getAttributeNode!="function"||typeof z.setAttribute!="function"||typeof z.namespaceURI!="string"||typeof z.insertBefore!="function"||typeof z.hasChildNodes!="function"||z.nodeType!==R(z)||z.childNodes!==_(z)},Ns=function(z){if(!R||typeof z!="object"||z===null)return!1;try{return R(z)===Vi.documentFragment}catch{return!1}},fc=function(z){if(!R||typeof z!="object"||z===null)return!1;try{return typeof R(z)=="number"}catch{return!1}};function Kn(J,z,F){J.length!==0&&is(J,X=>{X.call(i,z,F,Os)})}let S8=function(z,F){return!!(ai&&z.hasChildNodes()&&!fc(z.firstElementChild)&&jr(by,z.textContent)&&jr(by,z.innerHTML)||ai&&z.namespaceURI===Wn&&jC[F]&&(fc(z.firstElementChild)||typeof z.textContent=="string"&&jr(GC[F],z.textContent))||z.nodeType===Vi.processingInstruction||ai&&z.nodeType===Vi.comment&&jr(vy,z.data))},bp=function(z,F){if(z instanceof RegExp)return jr(z,F);if(z instanceof Function){for(var X=arguments.length,Z=new Array(X>2?X-2:0),me=2;me<X;me++)Z[me-2]=arguments[me];return!!z(F,...Z)}return!1},C8=function(z,F,X){if(!ae[F]&&f0(F)&&bp(ne.tagNameCheck,F))return!1;if(fm&&!Rs[F]){let Z=E(z),me=_(z);if(me&&Z){let $e=me.length;for(let Re=$e-1;Re>=0;--Re){let Ht=z===X?b(me[Re],!0):me[Re];Z.insertBefore(Ht,y(z))}}}return Go(z),!0},h0=function(z,F,X,Z){return z.length===0?F:F===X||F===Z?Ui(F):F},Ps=function(z,F){return z===F||E(z)!==null?!1:(gm&&mp(z),!0)},u0=function(z,F){if(Kn(Me.beforeSanitizeElements,z,null),Ps(z,F))return!0;if(gp(z))return Go(z),!0;let X=Kt(Y(z));if($=h0(Me.uponSanitizeElement,$,B,go),Kn(Me.uponSanitizeElement,z,{tagName:X,allowedTags:$}),Ps(z,F))return!0;if(S8(z,X))return Go(z),!0;if(ae[X]||!(Xe.tagCheck instanceof Function&&Xe.tagCheck(X))&&!$[X]){let Z=C8(z,X,F);return Z===!1&&(Kn(Me.afterSanitizeElements,z,null),Ps(z,F))?!0:Z}if(M(z)===Vi.element&&!_8(z)||(X==="noscript"||X==="noembed"||X==="noframes")&&jr(VC,z.innerHTML))return Go(z),!0;if(Br&&z.nodeType===Vi.text){let Z=fp(z.textContent);z.textContent!==Z&&(Pc(i.removed,{element:z.cloneNode()}),z.textContent=Z)}return Kn(Me.afterSanitizeElements,z,null),Ps(z,F)},m0=function(z,F,X){if(de[F]||c0(F,z)||Yv&&(F==="id"||F==="name")&&(X in t||X in v8))return!1;let Z=j[F]||Xe.attributeCheck instanceof Function&&Xe.attributeCheck(F,z);return tr&&jr(H,F)||Tr&&jr(x,F)?!0:Z?t0[F]||jr(I,Hc(X,w,""))||(F==="src"||F==="xlink:href"||F==="href")&&z!=="script"&&cy(X,"data:")===0&&Zv[z]||Hi&&!jr(A,Hc(X,w,""))?!0:!X:f0(z)&&bp(ne.tagNameCheck,z)&&bp(ne.attributeNameCheck,F,z)||F==="is"&&ne.allowCustomizedBuiltInElements&&bp(ne.tagNameCheck,X)},E8=Ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),f0=function(z){return!E8[Bc(z)]&&jr(O,z)},T8=function(z,F,X,Z){if(ie&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!X)switch(m.getAttributeType(z,F)){case"TrustedHTML":return Nt(Z);case"TrustedScriptURL":return yr(Z)}return Z},$8=function(z,F,X,Z){try{return X?z.setAttributeNS(X,F,Z):z.setAttribute(F,Z),gp(z)?(Go(z),!1):!0}catch{return Ba(F,z),!1}},g0=function(z,F){if(Kn(Me.beforeSanitizeAttributes,z,null),Ps(z,F))return;let X=z.attributes;if(!X||gp(z))return;j=h0(Me.uponSanitizeAttribute,j,ee,Ms);let Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},me=X.length,$e=Kt(z.nodeName);for(;me--;){let Re=X[me],Ht=Re.name,on=Re.namespaceURI,Fi=Re.value,Hs=Kt(Ht),km=Fi,li=Ht==="value"?km:SC(km),b0=!1;if(Z.attrName=Hs,Z.attrValue=li,Z.keepAttr=!0,Z.forceKeepAttr=void 0,Kn(Me.uponSanitizeAttribute,z,Z),li=Z.attrValue,Xv&&(Hs==="id"||Hs==="name")&&cy(li,Qv)!==0&&(Ba(Ht,z,Re),li=Qv+li,b0=!0),ai&&jr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,li)){Ba(Ht,z,Re);continue}if(Hs==="attributename"&&ly(li,"href")){Ba(Ht,z,Re);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){Ba(Ht,z,Re);continue}if(!jo&&jr(UC,li)){Ba(Ht,z,Re);continue}if(Br&&(li=fp(li)),!m0($e,Hs,li)){Ba(Ht,z,Re);continue}li=T8($e,Hs,on,li),li!==km&&$8(z,Ht,on,li)&&b0&&sy(i.removed)}}Kn(Me.afterSanitizeAttributes,z,null),Ps(z,F)},vp=function(z){let F=null,X=p0(z);for(Kn(Me.beforeSanitizeShadowDOM,z,null);F=X.nextNode();)if(Kn(Me.uponSanitizeShadowNode,F,null),u0(F,z),g0(F,z),Ns(F.content)&&vp(F.content),M(F)===Vi.element){let Z=N(F);Ns(Z)&&(zm(Z),vp(Z))}Kn(Me.afterSanitizeShadowDOM,z,null)},zm=function(z){let F=[{node:z,shadow:null}];for(;F.length>0;){let X=F.pop();if(X.shadow){vp(X.shadow);continue}let Z=X.node,me=M(Z)===Vi.element,$e=_(Z);if($e)for(let Re=$e.length-1;Re>=0;--Re)F.push({node:$e[Re],shadow:null});if(me){let Re=C?C(Z):null;if(typeof Re=="string"&&Kt(Re)==="template"){let Ht=Z.content;Ns(Ht)&&F.push({node:Ht,shadow:null})}}if(me){let Re=N(Z);Ns(Re)&&F.push({node:null,shadow:Re},{node:Re,shadow:null})}}};return i.sanitize=function(J){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,X=null,Z=null,me=null;if(bm=!J,bm&&(J="<!-->"),typeof J!="string"&&!fc(J)&&(J=AC(J),typeof J!="string"))throw ta("dirty is not a string, aborting");if(!i.isSupported)return J;Fa?($=go,j=Ms):wm(z),(Me.uponSanitizeElement.length>0||Me.uponSanitizeAttribute.length>0)&&($=Ui($)),Me.uponSanitizeAttribute.length>0&&(j=Ui(j)),i.removed=[];let $e=gm&&typeof J!="string"&&fc(J);if($e){k8(J);let on=Y(J);if(typeof on=="string"){let Fi=Kt(on);if(!$[Fi]||ae[Fi])throw up(J),ta("root node is forbidden and cannot be sanitized in-place")}if(gp(J))throw up(J),ta("root node is clobbered and cannot be sanitized in-place");try{zm(J)}catch(Fi){throw up(J),Fi}}else if(fc(J))F=d0("<!---->"),X=F.ownerDocument.importNode(J,!0),X.nodeType===Vi.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?F=X:F.appendChild(X),zm(F);else{if(!Is&&!Br&&!si&&J.indexOf("<")===-1)return ie&&dp?Nt(J):J;if(F=d0(J),!F)return Is?null:dp?ye:""}F&&uc&&Go(F.firstChild);let Re=$e?J:F;try{let on=p0(Re);for(;Z=on.nextNode();)u0(Z,Re),g0(Z,Re),Ns(Z.content)&&vp(Z.content)}catch(on){throw $e&&(up(J),is(i.removed,Fi=>{Fi.element&&mp(Fi.element)})),on}if($e){let on=!1;if(is(i.removed,Fi=>{Fi.element&&(Fi.element===J&&(on=!0),mp(Fi.element))}),on)throw ta("a node selected for removal could not be safely returned; refusing to sanitize in place");return Br&&_m(J),J}if(Is){if(Br&&_m(F),cp)for(me=Uo.call(F.ownerDocument);F.firstChild;)me.appendChild(F.firstChild);else me=F;return(j.shadowroot||j.shadowrootmode)&&(me=Pi.call(r,me,!0)),me}let Ht=si?F.outerHTML:F.innerHTML;return si&&$["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&jr(FC,F.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
204
- `+Ht),Br&&(Ht=fp(Ht)),ie&&dp?Nt(Ht):Ht},i.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wm(J),Fa=!0,go=$,Ms=j},i.clearConfig=function(){Os=null,Fa=!1,go=null,Ms=null,ie=Ie,ye=""},i.isValidAttribute=function(J,z,F){Os||wm({});let X=Kt(J),Z=Kt(z);return m0(X,Z,F)},i.addHook=function(J,z){typeof z=="function"&&yi(Me,J)&&Pc(Me[J],z)},i.removeHook=function(J,z){if(yi(Me,J)){if(z!==void 0){let F=zC(Me[J],z);return F===-1?void 0:kC(Me[J],F,1)[0]}return sy(Me[J])}},i.removeHooks=function(J){yi(Me,J)&&(Me[J]=[])},i.removeAllHooks=function(){Me=yy()},i}var ky=zy();var YC=["p","br","strong","b","em","i","u","ul","ol","li","a"],Sy=["div","h1","h2","h3","h4","h5","h6","blockquote","table","tr","center","section"],XC=["script","style","template","iframe","frame","object","embed","noscript","noembed","noframes","xmp","plaintext","title","head","meta","link","base","svg","math","img","picture","video","audio","form","input","button","select","textarea"];function nl(o,i=[]){let t=ky.sanitize(o,{ALLOWED_TAGS:[...YC,...Sy,...i],ALLOWED_ATTR:["href"],ALLOWED_URI_REGEXP:/^(?:https?|mailto):/i,FORBID_CONTENTS:XC,RETURN_DOM_FRAGMENT:!0}),r=Sy.filter(a=>!i.includes(a));t.querySelectorAll(r.join(",")).forEach(a=>{let s=document.createElement("p");s.append(...a.childNodes),a.replaceWith(s)}),t.querySelectorAll("p").forEach(a=>{a.textContent?.trim()||a.remove()}),t.querySelectorAll("a[href]").forEach(a=>{try{a.setAttribute("href",new URL(a.getAttribute("href").trim()).href),a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer")}catch{a.removeAttribute("href")}});let n=document.createElement("div");return n.append(t),n.innerHTML}var QC=/\b((https?:\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/g;function Cy(o){let i=o.replace(QC,t=>`<a href="${t.startsWith("www.")?"https://"+t:t}">${t}</a>`).replace(/\r\n|\r|\n/g,"<br>");return nl(i,["pre","code","blockquote"])}var Ey=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;padding-inline:calc(var(--zn-gutter,0) + var(--zn-base-gap,0));--message-bubble-agent:rgba(4,114,225,0.1);--message-bubble-customer:rgba(48,170,61,0.1);--message-bubble-internal:rgba(255,203,0,0.1)}.message{display:flex;gap:var(--zn-spacing-small);align-items:flex-start}.message__avatar{flex:0 0 36px;display:flex;justify-content:center}.message__body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:var(--zn-spacing-x-small)}.message__header{display:flex;align-items:center;gap:var(--zn-spacing-x-small);min-height:36px}.message__sender{font-family:var(--zn-font-sans);font-size:var(--zn-text-h1-font-size);font-weight:var(--zn-text-h1-font-weight);line-height:var(--zn-text-h1-line-height);color:var(--zn-text-h1-color);text-transform:var(--zn-text-h1-transform);letter-spacing:var(--zn-text-h1-letter-spacing,normal)}.message__time{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal)}.message__bubble{box-sizing:border-box;display:flex;align-items:flex-start;gap:var(--zn-spacing-small);padding:11px var(--zn-spacing-small);border-radius:var(--zn-border-radius);background:var(--message-bubble-agent);min-height:46px}.message__bubble--sending{border:1px dashed rgb(var(--zn-border-color));opacity:0.7;flex-direction:column}.message__main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:var(--zn-spacing-small)}.message__attachments{display:none;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--zn-spacing-small)}.message__attachments--visible{display:flex}.message__attachments ::slotted(zn-chat-message-attachment){min-width:0}.message__content{font-family:var(--zn-font-sans);font-size:var(--zn-text-chat-font-size);font-weight:var(--zn-text-chat-font-weight);line-height:var(--zn-text-chat-line-height);color:var(--zn-text-chat-color);text-transform:var(--zn-text-chat-transform);letter-spacing:var(--zn-text-chat-letter-spacing,normal);flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.message__content ::slotted(*){font-family:var(--zn-font-sans);font-size:var(--zn-text-chat-font-size);font-weight:var(--zn-text-chat-font-weight);line-height:var(--zn-text-chat-line-height);color:var(--zn-text-chat-color);text-transform:var(--zn-text-chat-transform);letter-spacing:var(--zn-text-chat-letter-spacing,normal)}.message__content p{margin:0;padding:0}.message__content pre{background-color:#23241f;border-radius:3px;margin-block:5px;padding:5px 10px;color:#f8f8f2;overflow:auto}.message__content blockquote{border-left:4px solid rgb(var(--zn-border-color));margin:5px 0;padding-left:16px}.message__content ol,.message__content ul{padding:0;margin:0}.message__content li{list-style-type:none;padding-left:1em;position:relative}.message__content ol{counter-reset:list-0 0}.message__content ol>li{counter-increment:list-0 1}.message__content ul>li::before{content:"•"}.message__content ol>li::before{content:counter(list-0) ". "}.message__content ol li::before,.message__content ul li::before{display:inline-block;margin-left:-1.5em;margin-right:0.3em;text-align:right;white-space:nowrap;width:1.2em}.message__content img{max-width:100%}.message__content a{color:rgb(var(--zn-color-info))}.message__meta{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal)}.message__actions{flex-shrink:0;display:flex;align-items:center;height:24px}:host([agent-initiated]) .message__bubble{background:var(--message-background,var(--message-bubble-agent))}:host([customer-initiated]) .message__bubble{background:var(--message-background,var(--message-bubble-customer))}:host([action-type=internal]) .message__bubble{background:var(--message-background,var(--message-bubble-internal))}:host([action-type=error]) .message__bubble{background:var(--message-background,rgba(var(--zn-color-error),0.12))}:host(.message-continued) .message{margin-top:3px}:host(.message-continued) .message__avatar{visibility:hidden}:host(.message-continued) .message__header{display:none}.message--system{margin-top:var(--zn-spacing-x-small)}.system-card{box-sizing:border-box;display:flex;align-items:center;gap:var(--zn-spacing-x-small);padding:6px 12px;border-radius:var(--zn-border-radius);border:1px solid rgb(var(--zn-border-color));font-size:12px;color:rgb(var(--zn-text-color));min-height:46px}.system-card__text{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal)}.system-card__time{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal);white-space:nowrap}`;var _r=class _r extends T{constructor(){super(...arguments);this.sender="";this.message="";this.time="";this.avatar="";this.actionType="";this.customerInitiated=!1;this.agentInitiated=!1;this.hideSender=!1;this.hasAttachments=!1}connectedCallback(){let t=!this.actionType||this.actionType==="internal",r=t&&this.agentInitiated,n=t&&this.customerInitiated,a=this.previousElementSibling,s=parseInt(this.time)-parseInt(a?.time),l=a?.getAttribute("action-type")??"",d=_r.SYSTEM_ACTION_TYPES.includes(l),h=l==="internal",m=this.actionType==="internal";a&&!d&&s<60&&h===m&&(a?.hasAttribute("agent-initiated")&&r||a?.hasAttribute("customer-initiated")&&n)&&this.classList.add("message-continued"),super.connectedCallback()}render(){if(!_r.DISPLAYED_ACTION_TYPES.includes(this.actionType))return V;if(this.isSystemMessage())return this.renderSystemCard();let t=this.actionType==="message-sending";return u`
204
+ `+Ht),Br&&(Ht=fp(Ht)),ie&&dp?Nt(Ht):Ht},i.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wm(J),Fa=!0,go=$,Ms=j},i.clearConfig=function(){Os=null,Fa=!1,go=null,Ms=null,ie=Ie,ye=""},i.isValidAttribute=function(J,z,F){Os||wm({});let X=Kt(J),Z=Kt(z);return m0(X,Z,F)},i.addHook=function(J,z){typeof z=="function"&&yi(Me,J)&&Pc(Me[J],z)},i.removeHook=function(J,z){if(yi(Me,J)){if(z!==void 0){let F=zC(Me[J],z);return F===-1?void 0:kC(Me[J],F,1)[0]}return sy(Me[J])}},i.removeHooks=function(J){yi(Me,J)&&(Me[J]=[])},i.removeAllHooks=function(){Me=yy()},i}var ky=zy();var YC=["p","br","strong","b","em","i","u","ul","ol","li","a"],Sy=["div","h1","h2","h3","h4","h5","h6","blockquote","table","tr","center","section"],XC=["script","style","template","iframe","frame","object","embed","noscript","noembed","noframes","xmp","plaintext","title","head","meta","link","base","svg","math","img","picture","video","audio","form","input","button","select","textarea"];function nl(o,i=[],t=!1){let r=ky.sanitize(o,{ALLOWED_TAGS:[...YC,...Sy,...i],ALLOWED_ATTR:t?["href","style"]:["href"],ALLOWED_URI_REGEXP:/^(?:https?|mailto):/i,FORBID_CONTENTS:XC,RETURN_DOM_FRAGMENT:!0}),n=Sy.filter(s=>!i.includes(s));r.querySelectorAll(n.join(",")).forEach(s=>{let l=document.createElement("p");l.append(...s.childNodes),s.replaceWith(l)}),r.querySelectorAll("p").forEach(s=>{s.textContent?.trim()||s.remove()}),r.querySelectorAll("[style]").forEach(s=>{let{color:l,backgroundColor:d}=s.style;s.removeAttribute("style"),s.style.color=l,s.style.backgroundColor=d,s.getAttribute("style")||s.removeAttribute("style")}),r.querySelectorAll("a[href]").forEach(s=>{try{s.setAttribute("href",new URL(s.getAttribute("href").trim()).href),s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer")}catch{s.removeAttribute("href")}});let a=document.createElement("div");return a.append(r),a.innerHTML}var QC=/\b((https?:\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/g;function Cy(o){let i=o.replace(QC,t=>`<a href="${t.startsWith("www.")?"https://"+t:t}">${t}</a>`).replace(/\r\n|\r|\n/g,"<br>");return nl(i,["pre","code","blockquote"])}var Ey=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;padding-inline:calc(var(--zn-gutter,0) + var(--zn-base-gap,0));--message-bubble-agent:rgba(4,114,225,0.1);--message-bubble-customer:rgba(48,170,61,0.1);--message-bubble-internal:rgba(255,203,0,0.1)}.message{display:flex;gap:var(--zn-spacing-small);align-items:flex-start}.message__avatar{flex:0 0 36px;display:flex;justify-content:center}.message__body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:var(--zn-spacing-x-small)}.message__header{display:flex;align-items:center;gap:var(--zn-spacing-x-small);min-height:36px}.message__sender{font-family:var(--zn-font-sans);font-size:var(--zn-text-h1-font-size);font-weight:var(--zn-text-h1-font-weight);line-height:var(--zn-text-h1-line-height);color:var(--zn-text-h1-color);text-transform:var(--zn-text-h1-transform);letter-spacing:var(--zn-text-h1-letter-spacing,normal)}.message__time{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal)}.message__bubble{box-sizing:border-box;display:flex;align-items:flex-start;gap:var(--zn-spacing-small);padding:11px var(--zn-spacing-small);border-radius:var(--zn-border-radius);background:var(--message-bubble-agent);min-height:46px}.message__bubble--sending{border:1px dashed rgb(var(--zn-border-color));opacity:0.7;flex-direction:column}.message__main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:var(--zn-spacing-small)}.message__attachments{display:none;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--zn-spacing-small)}.message__attachments--visible{display:flex}.message__attachments ::slotted(zn-chat-message-attachment){min-width:0}.message__content{font-family:var(--zn-font-sans);font-size:var(--zn-text-chat-font-size);font-weight:var(--zn-text-chat-font-weight);line-height:var(--zn-text-chat-line-height);color:var(--zn-text-chat-color);text-transform:var(--zn-text-chat-transform);letter-spacing:var(--zn-text-chat-letter-spacing,normal);flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.message__content ::slotted(*){font-family:var(--zn-font-sans);font-size:var(--zn-text-chat-font-size);font-weight:var(--zn-text-chat-font-weight);line-height:var(--zn-text-chat-line-height);color:var(--zn-text-chat-color);text-transform:var(--zn-text-chat-transform);letter-spacing:var(--zn-text-chat-letter-spacing,normal)}.message__content p{margin:0;padding:0}.message__content pre{background-color:#23241f;border-radius:3px;margin-block:5px;padding:5px 10px;color:#f8f8f2;overflow:auto}.message__content blockquote{border-left:4px solid rgb(var(--zn-border-color));margin:5px 0;padding-left:16px}.message__content ol,.message__content ul{padding:0;margin:0}.message__content li{list-style-type:none;padding-left:1em;position:relative}.message__content ol{counter-reset:list-0 0}.message__content ol>li{counter-increment:list-0 1}.message__content ul>li::before{content:"•"}.message__content ol>li::before{content:counter(list-0) ". "}.message__content ol li::before,.message__content ul li::before{display:inline-block;margin-left:-1.5em;margin-right:0.3em;text-align:right;white-space:nowrap;width:1.2em}.message__content img{max-width:100%}.message__content a{color:rgb(var(--zn-color-info))}.message__meta{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal)}.message__actions{flex-shrink:0;display:flex;align-items:center;height:24px}:host([agent-initiated]) .message__bubble{background:var(--message-background,var(--message-bubble-agent))}:host([customer-initiated]) .message__bubble{background:var(--message-background,var(--message-bubble-customer))}:host([action-type=internal]) .message__bubble{background:var(--message-background,var(--message-bubble-internal))}:host([action-type=error]) .message__bubble{background:var(--message-background,rgba(var(--zn-color-error),0.12))}:host(.message-continued) .message{margin-top:3px}:host(.message-continued) .message__avatar{visibility:hidden}:host(.message-continued) .message__header{display:none}.message--system{margin-top:var(--zn-spacing-x-small)}.system-card{box-sizing:border-box;display:flex;align-items:center;gap:var(--zn-spacing-x-small);padding:6px 12px;border-radius:var(--zn-border-radius);border:1px solid rgb(var(--zn-border-color));font-size:12px;color:rgb(var(--zn-text-color));min-height:46px}.system-card__text{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal)}.system-card__time{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-small-font-size);font-weight:var(--zn-text-subheading-small-font-weight);line-height:var(--zn-text-subheading-small-line-height);color:var(--zn-text-subheading-small-color);text-transform:var(--zn-text-subheading-small-transform);letter-spacing:var(--zn-text-subheading-small-letter-spacing,normal);white-space:nowrap}`;var _r=class _r extends T{constructor(){super(...arguments);this.sender="";this.message="";this.time="";this.avatar="";this.actionType="";this.customerInitiated=!1;this.agentInitiated=!1;this.hideSender=!1;this.hasAttachments=!1}connectedCallback(){let t=!this.actionType||this.actionType==="internal",r=t&&this.agentInitiated,n=t&&this.customerInitiated,a=this.previousElementSibling,s=parseInt(this.time)-parseInt(a?.time),l=a?.getAttribute("action-type")??"",d=_r.SYSTEM_ACTION_TYPES.includes(l),h=l==="internal",m=this.actionType==="internal";a&&!d&&s<60&&h===m&&(a?.hasAttribute("agent-initiated")&&r||a?.hasAttribute("customer-initiated")&&n)&&this.classList.add("message-continued"),super.connectedCallback()}render(){if(!_r.DISPLAYED_ACTION_TYPES.includes(this.actionType))return V;if(this.isSystemMessage())return this.renderSystemCard();let t=this.actionType==="message-sending";return u`
205
205
  <div part="base" class="message">
206
206
  <div part="avatar" class="message__avatar">
207
207
  <zn-icon library="avatar" src="${this.avatar||this.sender}" size="36" round></zn-icon>
@@ -430,7 +430,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
430
430
  <div part="footer" class="slash-menu__footer">${t} more — keep typing to narrow</div>`:""}
431
431
  </div>
432
432
  ${this.hideHints?"":this.renderHints()}
433
- </div>`}};ut.styles=k(Uy),ut.dependencies={"zn-icon":he},c([U(".slash-menu__panel")],ut.prototype,"panel",2),c([U(".slash-menu__list")],ut.prototype,"list",2),c([p({type:Boolean,reflect:!0})],ut.prototype,"open",2),c([p({type:Array})],ut.prototype,"items",2),c([p()],ut.prototype,"query",2),c([p()],ut.prototype,"heading",2),c([p({attribute:"empty-text"})],ut.prototype,"emptyText",2),c([p({attribute:"max-items",type:Number})],ut.prototype,"maxItems",2),c([p({attribute:"hide-keys",type:Boolean})],ut.prototype,"hideKeys",2),c([p({attribute:"hide-hints",type:Boolean})],ut.prototype,"hideHints",2),c([p({attribute:"recent-key"})],ut.prototype,"recentKey",2),c([p({attribute:"max-recent",type:Number})],ut.prototype,"maxRecent",2),c([p({attribute:"recent-heading"})],ut.prototype,"recentHeading",2),c([p({attribute:!1})],ut.prototype,"anchor",2),c([p()],ut.prototype,"placement",2),c([p({type:Number})],ut.prototype,"distance",2),c([D()],ut.prototype,"activeIndex",2),c([D()],ut.prototype,"recentKeys",2);var c9=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function d9(o){let i=parseFloat(o.lineHeight);if(!Number.isNaN(i))return i;let t=parseFloat(o.fontSize);return Number.isNaN(t)?16:t*1.2}function Sf(o,i){let t=o.ownerDocument,r=getComputedStyle(o),n=o.nodeName==="INPUT",a=t.createElement("div"),s=a.style,l=r;s.position="absolute",s.visibility="hidden",s.top="0",s.left="-9999px",s.whiteSpace=n?"pre":"pre-wrap",s.overflow="hidden",n||(s.wordWrap="break-word"),c9.forEach(f=>{let b=l[f];typeof b=="string"&&(s[f]=b)}),n&&(s.height="auto");let d=o.value.slice(0,i);a.textContent=n?d.replace(/\s/g,"\xA0"):d;let h=t.createElement("span");h.textContent=o.value.slice(i)||".",a.appendChild(h),t.body.appendChild(a);let m={top:h.offsetTop+(parseFloat(r.borderTopWidth)||0),left:h.offsetLeft+(parseFloat(r.borderLeftWidth)||0),height:d9(r)};return a.remove(),m}function Cf(o,{top:i,left:t,height:r}){let n=o.getBoundingClientRect(),a=Math.max(n.top,n.bottom-r),s=Math.min(Math.max(n.top+i-o.scrollTop,n.top),a),l=Math.min(Math.max(n.left+t-o.scrollLeft,n.left),n.right);return new DOMRect(l,s,1,r)}function IW(o,i){return Cf(o,Sf(o,i))}var p9=40,na=class{constructor(i,t){this.caretAnchor={getBoundingClientRect:()=>this.caretRect()};this.field=null;this.menu=null;this.triggerIndex=-1;this.query="";this.dismissedIndex=-1;this.resolveToken=0;this.inserting=!1;this.isOpen=!1;this.listening=!1;this.handleInput=()=>this.detect();this.handleCaretMove=()=>this.detect();this.handleKeyUp=i=>{this.isOpen&&(i.key==="ArrowDown"||i.key==="ArrowUp")||(i.key.startsWith("Arrow")||i.key==="Home"||i.key==="End")&&this.detect()};this.handleBlur=()=>this.close();this.handleScroll=()=>{this.isOpen&&this.menu?.reposition()};this.handleKeyDown=i=>{if(!this.isOpen||i.isComposing)return;let t=()=>{i.preventDefault(),i.stopPropagation()};switch(i.key){case"Escape":t(),this.dismissedIndex=this.triggerIndex,this.close();return;case"ArrowDown":t(),this.menu?.moveActive(1);return;case"ArrowUp":t(),this.menu?.moveActive(-1);return;case"Enter":case"Tab":{if(i.shiftKey||i.metaKey||i.ctrlKey||i.altKey)return;let r=this.menu?.activeItem;if(!r){this.close();return}t(),this.select(r)}}};this.handleItemSelect=i=>{let{item:t}=i.detail;t&&this.select(t)};this.host=i,this.options=t,i.addController(this)}get open(){return this.isOpen}hostConnected(){this.addListeners()}hostDisconnected(){this.removeListeners()}attach(i){this.field===i&&this.listening||(this.removeListeners(),this.field=i,this.caretAnchor.contextElement=i,this.addListeners())}detach(){this.removeListeners(),this.field=null}addListeners(){let i=this.field;!i||this.listening||(i.addEventListener("keydown",this.handleKeyDown,{capture:!0}),i.addEventListener("input",this.handleInput),i.addEventListener("keyup",this.handleKeyUp),i.addEventListener("click",this.handleCaretMove),i.addEventListener("blur",this.handleBlur),i.addEventListener("scroll",this.handleScroll),this.listening=!0)}removeListeners(){let i=this.field;!i||!this.listening||(this.close(),i.removeEventListener("keydown",this.handleKeyDown,{capture:!0}),i.removeEventListener("input",this.handleInput),i.removeEventListener("keyup",this.handleKeyUp),i.removeEventListener("click",this.handleCaretMove),i.removeEventListener("blur",this.handleBlur),i.removeEventListener("scroll",this.handleScroll),this.listening=!1)}close(){this.resolveToken++,this.triggerIndex=-1,this.query="",this.isOpen&&(this.isOpen=!1,this.menu?.hide(),this.field?.setAttribute("aria-expanded","false"))}requestOpen(){this.dismissedIndex=-1,this.detect()}caretRect(){let i=this.field;if(!i)return new DOMRect;let t=this.triggerIndex>=0?this.triggerIndex:i.selectionStart??0,r=i.clientWidth,n=this.measured;return(!n||n.index!==t||n.width!==r||n.value!==i.value)&&(this.measured={value:i.value,index:t,width:r,coordinates:Sf(i,t)}),Cf(i,this.measured.coordinates)}detect(){if(this.inserting)return;let i=this.field;if(!i||i.disabled||i.readOnly){this.close();return}let t=this.options.trigger?.()||"/",r=i.selectionStart;if(!t||r===null||i.selectionEnd!==r){this.close();return}let n=i.value,a=n.lastIndexOf(t,Math.max(0,r-t.length));if(a===-1||a+t.length>r){this.close();return}let s=a>0?n.charAt(a-1):"";if(s!==""&&!/\s/.test(s)){this.close();return}let l=n.slice(a+t.length,r);if(l.length>p9||/[\r\n]/.test(l)){this.close();return}if(a===this.dismissedIndex){this.close();return}this.triggerIndex=a,this.query=l,this.resolve(l)}async resolve(i){let t=++this.resolveToken,r=[];try{r=await this.options.items(i)}catch(s){console.warn("slash menu items could not be resolved",s)}if(t!==this.resolveToken)return;let n=nh(r,i);if(!n.length){this.close();return}let a=await this.options.menu();!a||t!==this.resolveToken||(a!==this.menu&&(this.menu?.removeEventListener(al,this.handleItemSelect),a.addEventListener(al,this.handleItemSelect),this.menu=a),a.anchor=this.caretAnchor,a.query=i,a.items=n,this.isOpen||(this.isOpen=!0,this.dismissedIndex=-1,a.show(),this.field?.setAttribute("aria-expanded","true"),this.field?.setAttribute("aria-haspopup","listbox")),await a.updateComplete,this.isOpen&&a.reposition())}select(i){let t=this.field,r=this.triggerIndex,n=t?.selectionStart??r,a=this.query,s=this.options.trigger?.()||"/";if(i.disabled||(this.close(),!t||r<0))return;let l=this.options.onSelect?.(i,a)===!1,d=l?"":i.value??"";t.value.slice(r,n)===s+a&&(this.replace(t,r,n,d,i),!l&&d&&this.options.onInsert?.(i,d))}replace(i,t,r,n,a){this.inserting=!0;try{i.focus({preventScroll:!0}),i.setSelectionRange(t,r);let s=!1;try{s=i.ownerDocument.execCommand("insertText",!1,n)}catch{s=!1}s||(i.setRangeText(n,t,r,"end"),i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})));let l=Math.min(Math.max(a.caretOffset??n.length,0),n.length);i.setSelectionRange(t+l,t+l)}finally{this.inserting=!1}this.host.requestUpdate()}};var ss=ut;ut.define("zn-slash-menu");var kr=Mt(class extends xr{constructor(o){if(super(o),o.type!==$r.PROPERTY&&o.type!==$r.ATTRIBUTE&&o.type!==$r.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Dp(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[i]){if(i===Lt||i===V)return i;let t=o.element,r=o.name;if(o.type===$r.PROPERTY){if(i===t[r])return Lt}else if(o.type===$r.BOOLEAN_ATTRIBUTE){if(!!i===t.hasAttribute(r))return Lt}else if(o.type===$r.ATTRIBUTE&&t.getAttribute(r)===i+"")return Lt;return Ys(o),i}});var Ef=new Set,sl=new Map,zo,Tf="ltr",$f="en",jy=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(jy){let o=new MutationObserver(Gy);Tf=document.documentElement.dir||"ltr",$f=document.documentElement.lang||navigator.language,o.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function jc(...o){o.map(i=>{let t=i.$code.toLowerCase();sl.has(t)?sl.set(t,Object.assign(Object.assign({},sl.get(t)),i)):sl.set(t,i),zo||(zo=i)}),Gy()}function Gy(){jy&&(Tf=document.documentElement.dir||"ltr",$f=document.documentElement.lang||navigator.language),[...Ef.keys()].map(o=>{typeof o.requestUpdate=="function"&&o.requestUpdate()})}var oh=class{constructor(i){this.host=i,this.host.addController(this)}hostConnected(){Ef.add(this.host)}hostDisconnected(){Ef.delete(this.host)}dir(){return`${this.host.dir||Tf}`.toLowerCase()}lang(){let i=`${this.host.lang||$f}`.toLowerCase().replace(/_/g,"-");try{return new Intl.Locale(i),i}catch{return zo?zo.$code.toLowerCase():"en"}}getTranslationData(i){var t,r;let n;try{n=new Intl.Locale(i.replace(/_/g,"-"))}catch{return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}let a=n.language.toLowerCase(),s=(r=(t=n.region)===null||t===void 0?void 0:t.toLowerCase())!==null&&r!==void 0?r:"",l=sl.get(`${a}-${s}`),d=sl.get(a);return{locale:n,language:a,region:s,primary:l,secondary:d}}exists(i,t){var r;let{primary:n,secondary:a}=this.getTranslationData((r=t.lang)!==null&&r!==void 0?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[i]||a&&a[i]||t.includeFallback&&zo&&zo[i])}term(i,...t){let{primary:r,secondary:n}=this.getTranslationData(this.lang()),a;if(r&&r[i])a=r[i];else if(n&&n[i])a=n[i];else if(zo&&zo[i])a=zo[i];else return console.error(`No translation found for: ${String(i)}`),String(i);return typeof a=="function"?a(...t):a}date(i,t){return i=new Date(i),new Intl.DateTimeFormat(this.lang(),t).format(i)}number(i,t){return i=Number(i),isNaN(i)?"":new Intl.NumberFormat(this.lang(),t).format(i)}relativeTime(i,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(i,t)}};var Wy={$code:"en",$name:"English",$dir:"ltr",onChange:"onChange",showPassword:"Show password",hidePassword:"Hide password",clearEntry:"Clear entry",numOptionsSelected:o=>o===0?"No options selected":o===1?"1 option selected":`${o} options selected`,fileButtonText:"Choose a file",fileButtonTextMultiple:"Choose files",folderButtonText:"Choose a folder",fileDragDrop:"Drop files here to upload",folderDragDrop:"Drop folder here to upload",numFilesSelected:o=>o===0?"No files selected":o===1?"1 file selected":`${o} files selected`};jc(Wy);var Ky=Wy;var or=class extends oh{};jc(Ky);var Yy=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:none}`;var Rr=class extends T{constructor(){super(...arguments);this.label="";this.disabled=!1}toSlashMenuItem(){return{label:this.label||this.insertValue,value:this.insertValue,icon:this.icon,description:this.description,keywords:this.keywords,group:this.group,order:this.order,action:this.action,caretOffset:this.caretOffset,disabled:this.disabled}}get insertValue(){return this.value??(this.textContent??"").trim()}render(){return u`
433
+ </div>`}};ut.styles=k(Uy),ut.dependencies={"zn-icon":he},c([U(".slash-menu__panel")],ut.prototype,"panel",2),c([U(".slash-menu__list")],ut.prototype,"list",2),c([p({type:Boolean,reflect:!0})],ut.prototype,"open",2),c([p({type:Array})],ut.prototype,"items",2),c([p()],ut.prototype,"query",2),c([p()],ut.prototype,"heading",2),c([p({attribute:"empty-text"})],ut.prototype,"emptyText",2),c([p({attribute:"max-items",type:Number})],ut.prototype,"maxItems",2),c([p({attribute:"hide-keys",type:Boolean})],ut.prototype,"hideKeys",2),c([p({attribute:"hide-hints",type:Boolean})],ut.prototype,"hideHints",2),c([p({attribute:"recent-key"})],ut.prototype,"recentKey",2),c([p({attribute:"max-recent",type:Number})],ut.prototype,"maxRecent",2),c([p({attribute:"recent-heading"})],ut.prototype,"recentHeading",2),c([p({attribute:!1})],ut.prototype,"anchor",2),c([p()],ut.prototype,"placement",2),c([p({type:Number})],ut.prototype,"distance",2),c([D()],ut.prototype,"activeIndex",2),c([D()],ut.prototype,"recentKeys",2);var c9=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function d9(o){let i=parseFloat(o.lineHeight);if(!Number.isNaN(i))return i;let t=parseFloat(o.fontSize);return Number.isNaN(t)?16:t*1.2}function Sf(o,i){let t=o.ownerDocument,r=getComputedStyle(o),n=o.nodeName==="INPUT",a=t.createElement("div"),s=a.style,l=r;s.position="absolute",s.visibility="hidden",s.top="0",s.left="-9999px",s.whiteSpace=n?"pre":"pre-wrap",s.overflow="hidden",n||(s.wordWrap="break-word"),c9.forEach(f=>{let b=l[f];typeof b=="string"&&(s[f]=b)}),n&&(s.height="auto");let d=o.value.slice(0,i);a.textContent=n?d.replace(/\s/g,"\xA0"):d;let h=t.createElement("span");h.textContent=o.value.slice(i)||".",a.appendChild(h),t.body.appendChild(a);let m={top:h.offsetTop+(parseFloat(r.borderTopWidth)||0),left:h.offsetLeft+(parseFloat(r.borderLeftWidth)||0),height:d9(r)};return a.remove(),m}function Cf(o,{top:i,left:t,height:r}){let n=o.getBoundingClientRect(),a=Math.max(n.top,n.bottom-r),s=Math.min(Math.max(n.top+i-o.scrollTop,n.top),a),l=Math.min(Math.max(n.left+t-o.scrollLeft,n.left),n.right);return new DOMRect(l,s,1,r)}function RW(o,i){return Cf(o,Sf(o,i))}var p9=40,na=class{constructor(i,t){this.caretAnchor={getBoundingClientRect:()=>this.caretRect()};this.field=null;this.menu=null;this.triggerIndex=-1;this.query="";this.dismissedIndex=-1;this.resolveToken=0;this.inserting=!1;this.isOpen=!1;this.listening=!1;this.handleInput=()=>this.detect();this.handleCaretMove=()=>this.detect();this.handleKeyUp=i=>{this.isOpen&&(i.key==="ArrowDown"||i.key==="ArrowUp")||(i.key.startsWith("Arrow")||i.key==="Home"||i.key==="End")&&this.detect()};this.handleBlur=()=>this.close();this.handleScroll=()=>{this.isOpen&&this.menu?.reposition()};this.handleKeyDown=i=>{if(!this.isOpen||i.isComposing)return;let t=()=>{i.preventDefault(),i.stopPropagation()};switch(i.key){case"Escape":t(),this.dismissedIndex=this.triggerIndex,this.close();return;case"ArrowDown":t(),this.menu?.moveActive(1);return;case"ArrowUp":t(),this.menu?.moveActive(-1);return;case"Enter":case"Tab":{if(i.shiftKey||i.metaKey||i.ctrlKey||i.altKey)return;let r=this.menu?.activeItem;if(!r){this.close();return}t(),this.select(r)}}};this.handleItemSelect=i=>{let{item:t}=i.detail;t&&this.select(t)};this.host=i,this.options=t,i.addController(this)}get open(){return this.isOpen}hostConnected(){this.addListeners()}hostDisconnected(){this.removeListeners()}attach(i){this.field===i&&this.listening||(this.removeListeners(),this.field=i,this.caretAnchor.contextElement=i,this.addListeners())}detach(){this.removeListeners(),this.field=null}addListeners(){let i=this.field;!i||this.listening||(i.addEventListener("keydown",this.handleKeyDown,{capture:!0}),i.addEventListener("input",this.handleInput),i.addEventListener("keyup",this.handleKeyUp),i.addEventListener("click",this.handleCaretMove),i.addEventListener("blur",this.handleBlur),i.addEventListener("scroll",this.handleScroll),this.listening=!0)}removeListeners(){let i=this.field;!i||!this.listening||(this.close(),i.removeEventListener("keydown",this.handleKeyDown,{capture:!0}),i.removeEventListener("input",this.handleInput),i.removeEventListener("keyup",this.handleKeyUp),i.removeEventListener("click",this.handleCaretMove),i.removeEventListener("blur",this.handleBlur),i.removeEventListener("scroll",this.handleScroll),this.listening=!1)}close(){this.resolveToken++,this.triggerIndex=-1,this.query="",this.isOpen&&(this.isOpen=!1,this.menu?.hide(),this.field?.setAttribute("aria-expanded","false"))}requestOpen(){this.dismissedIndex=-1,this.detect()}caretRect(){let i=this.field;if(!i)return new DOMRect;let t=this.triggerIndex>=0?this.triggerIndex:i.selectionStart??0,r=i.clientWidth,n=this.measured;return(!n||n.index!==t||n.width!==r||n.value!==i.value)&&(this.measured={value:i.value,index:t,width:r,coordinates:Sf(i,t)}),Cf(i,this.measured.coordinates)}detect(){if(this.inserting)return;let i=this.field;if(!i||i.disabled||i.readOnly){this.close();return}let t=this.options.trigger?.()||"/",r=i.selectionStart;if(!t||r===null||i.selectionEnd!==r){this.close();return}let n=i.value,a=n.lastIndexOf(t,Math.max(0,r-t.length));if(a===-1||a+t.length>r){this.close();return}let s=a>0?n.charAt(a-1):"";if(s!==""&&!/\s/.test(s)){this.close();return}let l=n.slice(a+t.length,r);if(l.length>p9||/[\r\n]/.test(l)){this.close();return}if(a===this.dismissedIndex){this.close();return}this.triggerIndex=a,this.query=l,this.resolve(l)}async resolve(i){let t=++this.resolveToken,r=[];try{r=await this.options.items(i)}catch(s){console.warn("slash menu items could not be resolved",s)}if(t!==this.resolveToken)return;let n=nh(r,i);if(!n.length){this.close();return}let a=await this.options.menu();!a||t!==this.resolveToken||(a!==this.menu&&(this.menu?.removeEventListener(al,this.handleItemSelect),a.addEventListener(al,this.handleItemSelect),this.menu=a),a.anchor=this.caretAnchor,a.query=i,a.items=n,this.isOpen||(this.isOpen=!0,this.dismissedIndex=-1,a.show(),this.field?.setAttribute("aria-expanded","true"),this.field?.setAttribute("aria-haspopup","listbox")),await a.updateComplete,this.isOpen&&a.reposition())}select(i){let t=this.field,r=this.triggerIndex,n=t?.selectionStart??r,a=this.query,s=this.options.trigger?.()||"/";if(i.disabled||(this.close(),!t||r<0))return;let l=this.options.onSelect?.(i,a)===!1,d=l?"":i.value??"";t.value.slice(r,n)===s+a&&(this.replace(t,r,n,d,i),!l&&d&&this.options.onInsert?.(i,d))}replace(i,t,r,n,a){this.inserting=!0;try{i.focus({preventScroll:!0}),i.setSelectionRange(t,r);let s=!1;try{s=i.ownerDocument.execCommand("insertText",!1,n)}catch{s=!1}s||(i.setRangeText(n,t,r,"end"),i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})));let l=Math.min(Math.max(a.caretOffset??n.length,0),n.length);i.setSelectionRange(t+l,t+l)}finally{this.inserting=!1}this.host.requestUpdate()}};var ss=ut;ut.define("zn-slash-menu");var kr=Mt(class extends xr{constructor(o){if(super(o),o.type!==$r.PROPERTY&&o.type!==$r.ATTRIBUTE&&o.type!==$r.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Dp(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[i]){if(i===Lt||i===V)return i;let t=o.element,r=o.name;if(o.type===$r.PROPERTY){if(i===t[r])return Lt}else if(o.type===$r.BOOLEAN_ATTRIBUTE){if(!!i===t.hasAttribute(r))return Lt}else if(o.type===$r.ATTRIBUTE&&t.getAttribute(r)===i+"")return Lt;return Ys(o),i}});var Ef=new Set,sl=new Map,zo,Tf="ltr",$f="en",jy=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(jy){let o=new MutationObserver(Gy);Tf=document.documentElement.dir||"ltr",$f=document.documentElement.lang||navigator.language,o.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function jc(...o){o.map(i=>{let t=i.$code.toLowerCase();sl.has(t)?sl.set(t,Object.assign(Object.assign({},sl.get(t)),i)):sl.set(t,i),zo||(zo=i)}),Gy()}function Gy(){jy&&(Tf=document.documentElement.dir||"ltr",$f=document.documentElement.lang||navigator.language),[...Ef.keys()].map(o=>{typeof o.requestUpdate=="function"&&o.requestUpdate()})}var oh=class{constructor(i){this.host=i,this.host.addController(this)}hostConnected(){Ef.add(this.host)}hostDisconnected(){Ef.delete(this.host)}dir(){return`${this.host.dir||Tf}`.toLowerCase()}lang(){let i=`${this.host.lang||$f}`.toLowerCase().replace(/_/g,"-");try{return new Intl.Locale(i),i}catch{return zo?zo.$code.toLowerCase():"en"}}getTranslationData(i){var t,r;let n;try{n=new Intl.Locale(i.replace(/_/g,"-"))}catch{return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}let a=n.language.toLowerCase(),s=(r=(t=n.region)===null||t===void 0?void 0:t.toLowerCase())!==null&&r!==void 0?r:"",l=sl.get(`${a}-${s}`),d=sl.get(a);return{locale:n,language:a,region:s,primary:l,secondary:d}}exists(i,t){var r;let{primary:n,secondary:a}=this.getTranslationData((r=t.lang)!==null&&r!==void 0?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[i]||a&&a[i]||t.includeFallback&&zo&&zo[i])}term(i,...t){let{primary:r,secondary:n}=this.getTranslationData(this.lang()),a;if(r&&r[i])a=r[i];else if(n&&n[i])a=n[i];else if(zo&&zo[i])a=zo[i];else return console.error(`No translation found for: ${String(i)}`),String(i);return typeof a=="function"?a(...t):a}date(i,t){return i=new Date(i),new Intl.DateTimeFormat(this.lang(),t).format(i)}number(i,t){return i=Number(i),isNaN(i)?"":new Intl.NumberFormat(this.lang(),t).format(i)}relativeTime(i,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(i,t)}};var Wy={$code:"en",$name:"English",$dir:"ltr",onChange:"onChange",showPassword:"Show password",hidePassword:"Hide password",clearEntry:"Clear entry",numOptionsSelected:o=>o===0?"No options selected":o===1?"1 option selected":`${o} options selected`,fileButtonText:"Choose a file",fileButtonTextMultiple:"Choose files",folderButtonText:"Choose a folder",fileDragDrop:"Drop files here to upload",folderDragDrop:"Drop folder here to upload",numFilesSelected:o=>o===0?"No files selected":o===1?"1 file selected":`${o} files selected`};jc(Wy);var Ky=Wy;var or=class extends oh{};jc(Ky);var Yy=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:none}`;var Rr=class extends T{constructor(){super(...arguments);this.label="";this.disabled=!1}toSlashMenuItem(){return{label:this.label||this.insertValue,value:this.insertValue,icon:this.icon,description:this.description,keywords:this.keywords,group:this.group,order:this.order,action:this.action,caretOffset:this.caretOffset,disabled:this.disabled}}get insertValue(){return this.value??(this.textContent??"").trim()}render(){return u`
434
434
  <slot></slot>`}};Rr.styles=k(Yy),c([p()],Rr.prototype,"label",2),c([p()],Rr.prototype,"value",2),c([p()],Rr.prototype,"icon",2),c([p()],Rr.prototype,"description",2),c([p()],Rr.prototype,"keywords",2),c([p()],Rr.prototype,"group",2),c([p({type:Number})],Rr.prototype,"order",2),c([p({attribute:"caret-offset",type:Number})],Rr.prototype,"caretOffset",2),c([p()],Rr.prototype,"action",2),c([p({type:Boolean,reflect:!0})],Rr.prototype,"disabled",2);var Gc=Rr;Rr.define("zn-slash-item");var Pe=S`.form-control-input{margin:var(--zn-spacing-2x-small) 3px 3px 0}.form-control-input--flush{margin:0}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--zn-input-label-color);font-weight:var(--zn-input-label-font-weight);line-height:var(--zn-input-label-line-height);margin-bottom:var(--zn-spacing-x-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--zn-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control__label{font-size:var(--zn-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--zn-input-required-content);margin-inline-start:var(--zn-input-required-content-offset);color:var(--zn-input-required-content-color)}.form-control--has-label.form-control--radio-group .form-control__label,.form-control--has-label.form-control--checkbox-group .form-control__label{margin-bottom:0}.form-control--has-label.form-control--has-label-tooltip .form-control__label{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--zn-input-label-font-size-small)}.form-control--label-tooltip{color:var(--zn-color-neutral-700);font-size:var(--zn-font-size-small)}.form-control--label-tooltip zn-icon{--icon-color:var(--zn-color-neutral-700);--icon-size:var(--zn-font-size-small)}.form-control--has-label.form-control--has-context-note{display:flex;justify-content:space-between;flex-wrap:wrap}.form-control__label-context-note{color:var(--zn-input-help-text-color);font-size:var(--zn-font-size-small);margin-bottom:var(--zn-spacing-2x-small)}.form-control--has-label.form-control--has-context-note .form-control-input{width:100%}.form-control--has-help-text .form-control__help-text,.radio--has-description .radio__description,.checkbox--has-description .checkbox__description{display:block;color:var(--zn-input-help-text-color);margin-top:var(--zn-spacing-x-small)}.radio--has-description .radio__description,.checkbox--has-description .checkbox__description{margin-top:0.375rem}.radio--has-selected-content .radio__selected-content,.checkbox--has-selected-content .checkbox__selected-content{display:block;margin-top:var(--zn-spacing-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--zn-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text,.radio--has-description .radio__description,.checkbox--has-description .checkbox__description{font-size:var(--zn-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--zn-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text,.form-control--has-help-text.form-control--checkbox-group .form-control__help-text{margin-top:var(--zn-spacing-medium)}.form-control--has-help-text .switch .form-control__help-text{margin-top:var(--zn-spacing-3x-small)}.form-control--checkbox-contained-wrapper,.form-control--radio-contained-wrapper{height:100%}`;var Xy=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}.input{flex:1 1 auto;display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--zn-input-font-family),sans-serif;font-weight:var(--zn-input-font-weight);letter-spacing:var(--zn-input-letter-spacing);vertical-align:middle;overflow:hidden;cursor:text;transition:var(--zn-transition-fast) color,var(--zn-transition-fast) border,var(--zn-transition-fast) background-color}.input--standard{background-color:var(--zn-input-background-color);border:solid var(--zn-input-border-width) var(--zn-input-border-color)}.input--standard:hover:not(.input--disabled,.input--filled){background-color:var(--zn-input-background-color-hover);border-color:var(--zn-input-border-color-hover)}.input--filled:hover:not(.input--disabled){background-color:var(--zn-color-neutral-50);border-color:var(--zn-input-border-color-hover)}.input--standard.input--focused:not(.input--disabled){background-color:var(--zn-input-background-color-focus);border-color:var(--zn-input-border-color-focus)}.input--standard.input--focused:not(.input--disabled):not(.input--x-small){box-shadow:0 0 0 var(--zn-focus-ring-width) var(--zn-input-focus-ring-color)}.input--standard.input--focused:not(.input--disabled).input--x-small{box-shadow:0 0 0 var(--zn-focus-ring-width-x-small) var(--zn-input-focus-ring-color)}.input--standard.input--focused:not(.input--disabled) .input__control{color:var(--zn-input-color-focus)}.input--standard.input--disabled{background-color:var(--zn-input-background-color-disabled);border-color:var(--zn-input-border-color-disabled);opacity:0.5;cursor:not-allowed}.input--standard.input--filled{background-color:rgba(var(--zn-panel),var(--zn-panel-opacity))}.input--standard.input--disabled .input__control{color:var(--zn-input-color-disabled)}.input--standard.input--disabled .input__control::-moz-placeholder{color:var(--zn-input-placeholder-color-disabled)}.input--standard.input--disabled .input__control::placeholder{color:var(--zn-input-placeholder-color-disabled)}.input__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;height:100%;color:var(--zn-input-color);border:none;background:inherit;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none;line-height:var(--zn-input-line-height)}input[type=text].input__control[data-color-input]{font-family:var(--zn-font-mono,"SFMono-Regular","Consolas","Liberation Mono","Menlo",monospace);font-size:0.9em}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--zn-input-height-large) var(--zn-input-background-color) inset !important;-webkit-text-fill-color:var(--zn-input-color);caret-color:var(--zn-input-color)}.input__control::-moz-placeholder{color:var(--zn-input-placeholder-color);-moz-user-select:none;user-select:none;-webkit-user-select:none}.input__control::placeholder{color:var(--zn-input-placeholder-color);-moz-user-select:none;user-select:none;-webkit-user-select:none}.input:hover:not(.input--disabled) .input__control{color:var(--zn-input-color-hover)}.input__control:focus{outline:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;align-self:stretch;height:100%;cursor:default;color:var(--zn-input-icon-color);font-size:var(--zn-font-size-small)}.input__prefix zn-icon,.input__suffix zn-icon{--icon-size:var(--zn-font-size-x-large);color:var(--zn-input-icon-color);font-size:var(--zn-font-size-small)}.input__prefix ::slotted(zn-icon),.input__suffix ::slotted(zn-icon){--icon-size:var(--zn-font-size-medium);font-size:var(--zn-font-size-medium);color:var(--zn-input-icon-color)}.input--x-small{border-radius:var(--zn-input-border-radius-x-small);font-size:var(--zn-input-font-size-small);height:var(--zn-input-height-x-small)}.input--x-small .input__control{height:calc(var(--zn-input-height-x-small) - var(--zn-input-border-width) * 2);padding:0 var(--zn-input-spacing-small) 0 var(--zn-spacing-small)}.input--x-small .input__clear,.input--x-small .input__password-toggle{width:calc(1em + var(--zn-input-spacing-x-small) * 2)}.input--x-small .input__prefix ::slotted(*),.input__prefix-default{margin-inline-start:var(--zn-spacing-x-small)}.input--x-small .input__suffix ::slotted(*),.input__suffix-default{margin-inline-end:var(--zn-input-spacing-x-small)}.input--x-small .input__suffix ::slotted(zn-button),.input--x-small .input__prefix ::slotted(zn-button),.input--x-small .input__suffix ::slotted(zn-checkbox),.input--x-small .input__prefix ::slotted(zn-checkbox){margin-inline-end:0;margin-inline-start:0}.input--small{border-radius:var(--zn-input-border-radius-small);font-size:var(--zn-input-font-size-small);height:var(--zn-input-height-small)}.input--small .input__control{height:calc(var(--zn-input-height-small) - var(--zn-input-border-width) * 2);padding:0 var(--zn-input-spacing-small) 0 var(--zn-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{width:calc(1em + var(--zn-input-spacing-small) * 2)}.input--small .input__prefix ::slotted(*),.input__prefix-default{margin-inline-start:var(--zn-input-spacing-small)}.input--small .input__suffix ::slotted(*),.input__suffix-default{margin-inline-end:var(--zn-input-spacing-small)}.input--small .input__suffix ::slotted(zn-button),.input--small .input__prefix ::slotted(zn-button),.input--small .input__suffix ::slotted(zn-checkbox),.input--small .input__prefix ::slotted(zn-checkbox){margin-inline-end:0;margin-inline-start:0}.input--medium{border-radius:var(--zn-input-border-radius-medium);font-size:var(--zn-input-font-size-medium);height:var(--zn-input-height-medium)}.input--medium .input__control{height:calc(var(--zn-input-height-medium) - var(--zn-input-border-width) * 2);padding:0 var(--zn-input-spacing-small) 0 var(--zn-spacing-small)}.input--medium .input__clear,.input--medium .input__password-toggle{width:calc(1em + var(--zn-input-spacing-medium) * 2)}.input--medium .input__prefix ::slotted(*),.input__prefix-default{margin-inline-start:var(--zn-spacing-small)}.input--medium .input__suffix ::slotted(*),.input__suffix-default{margin-inline-end:var(--zn-spacing-small)}.input--medium .input__suffix ::slotted(zn-button),.input--medium .input__prefix ::slotted(zn-button),.input--medium .input__suffix ::slotted(zn-checkbox),.input--medium .input__prefix ::slotted(zn-checkbox){margin-inline-end:0;margin-inline-start:0}.input__suffix ::slotted(zn-button),.input__prefix ::slotted(zn-button){--zn-button-border-color:rgb(var(--zn-color-border));--zn-button-border-width:0}.input__suffix ::slotted(zn-button){--zn-button-border-left-width:1px}.input__prefix ::slotted(zn-button){--zn-button-border-right-width:1px}.input--large{border-radius:var(--zn-input-border-radius-large);font-size:var(--zn-input-font-size-large);height:var(--zn-input-height-large)}.input--large .input__control{height:calc(var(--zn-input-height-large) - var(--zn-input-border-width) * 2);padding:0 var(--zn-input-spacing-medium) 0 var(--zn-spacing-small)}.input--large .input__clear,.input--large .input__password-toggle{width:calc(1em + var(--zn-input-spacing-large) * 2)}.input--large .input__suffix ::slotted(zn-button),.input--large .input__prefix ::slotted(zn-button),.input--large .input__suffix ::slotted(zn-checkbox),.input--large .input__prefix ::slotted(zn-checkbox){margin-inline-end:0;margin-inline-start:0}.input--pill.input--x-small{border-radius:var(--zn-input-height-small);padding:0 var(--zn-spacing-x-small)}.input--pill.input--small{border-radius:var(--zn-input-height-small);padding:0 var(--zn-spacing-x-small)}.input--pill.input--medium{border-radius:var(--zn-input-height-medium);padding:0 var(--zn-spacing-x-small)}.input--pill.input--large{border-radius:var(--zn-input-height-large);padding:0 var(--zn-spacing-x-small)}.input__clear:not(.input__clear--visible){visibility:hidden}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;justify-content:center;font-size:var(--zn-font-size-large);color:var(--zn-input-icon-color);border:none;background:none;padding:0;transition:var(--zn-transition-fast) color;cursor:pointer}.input__clear zn-icon,.input__password-toggle zn-icon{--icon-size:var(--zn-font-size-large)}.input__clear:hover,.input__password-toggle:hover{color:var(--zn-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}::-ms-reveal{display:none}.input--no-spin-buttons input[type=number]::-webkit-outer-spin-button,.input--no-spin-buttons input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}.input--no-spin-buttons input[type=number]{-moz-appearance:textfield}input[type=date]::-webkit-calendar-picker-indicator{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="14" width="12.25" viewBox="0 0 448 512"><path fill="%236d7176" d="M128 0c13.3 0 24 10.7 24 24V64H296V24c0-13.3 10.7-24 24-24s24 10.7 24 24V64h40c35.3 0 64 28.7 64 64v16 48V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192 144 128C0 92.7 28.7 64 64 64h40V24c0-13.3 10.7-24 24-24zM400 192H48V448c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V192zM112 256h96c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16H112c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16z"/></svg>')}.input__color-swatch{display:inline-flex;align-self:stretch;border:none;border-inline-start:solid var(--zn-input-border-width) var(--zn-input-border-color);border-radius:0;background-color:var(--zn-color-neutral-0);cursor:pointer;overflow:hidden;position:relative;flex-shrink:0;margin:0}.input__color-swatch:hover .input__color-swatch-inner{filter:brightness(0.95)}.input__color-swatch-inner{width:100%;height:100%;background-color:var(--color-value,#000000);transition:var(--zn-transition-fast) filter}.input--x-small .input__color-swatch{width:calc(var(--zn-input-height-x-small) * 1.2)}.input--small .input__color-swatch{width:calc(var(--zn-input-height-small) * 1.2)}.input--medium .input__color-swatch{width:calc(var(--zn-input-height-medium) * 1.2)}.input--large .input__color-swatch{width:calc(var(--zn-input-height-large) * 1.2)}:host([type=range]) .form-control--has-label .form-control__label,:host([type=range]) .form-control__label-context-note{margin-bottom:0}:host([type=range]) .form-control-input{margin-top:0}.input--standard.input--range{--zn-range-track-height:6px;--zn-range-track-color:var(--zn-color-neutral-200);--zn-range-thumb-size:18px;--zn-range-thumb-color:var(--zn-color-primary-600);--zn-range-thumb-ring-width:4px;align-items:center;height:var(--zn-range-thumb-size);padding:0;overflow:visible;cursor:pointer}.input--standard.input--range,.input--standard.input--range:hover,.input--standard.input--range.input--focused,.input--standard.input--range.input--disabled{border:none;background:none;box-shadow:none}.input--standard.input--range.input--x-small{--zn-range-track-height:4px;--zn-range-thumb-size:14px;--zn-range-thumb-ring-width:3px}.input--standard.input--range.input--small{--zn-range-track-height:5px;--zn-range-thumb-size:16px;--zn-range-thumb-ring-width:3px}.input--standard.input--range.input--large{--zn-range-track-height:7px;--zn-range-thumb-size:20px}.input--range .input__control{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:var(--zn-range-thumb-size);padding:0;margin:0;background:none;cursor:inherit}.input--range .input__control::-webkit-slider-runnable-track{height:var(--zn-range-track-height);border-radius:calc(var(--zn-range-track-height) / 2);background-color:var(--zn-range-track-color)}.input--range .input__control::-moz-range-track{height:var(--zn-range-track-height);border-radius:calc(var(--zn-range-track-height) / 2);background-color:var(--zn-range-track-color)}.input--range .input__control::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:var(--zn-range-thumb-size);height:var(--zn-range-thumb-size);margin-top:calc((var(--zn-range-track-height) - var(--zn-range-thumb-size)) / 2);border:var(--zn-range-thumb-ring-width) solid var(--zn-color-neutral-0);border-radius:50%;background-color:var(--zn-range-thumb-color);box-shadow:0 0 0 1px var(--zn-input-border-color);-webkit-transition:var(--zn-transition-fast) box-shadow,var(--zn-transition-fast) background-color;transition:var(--zn-transition-fast) box-shadow,var(--zn-transition-fast) background-color}.input--range .input__control::-moz-range-thumb{width:var(--zn-range-thumb-size);height:var(--zn-range-thumb-size);box-sizing:border-box;border:var(--zn-range-thumb-ring-width) solid var(--zn-color-neutral-0);border-radius:50%;background-color:var(--zn-range-thumb-color);box-shadow:0 0 0 1px var(--zn-input-border-color);-moz-transition:var(--zn-transition-fast) box-shadow,var(--zn-transition-fast) background-color;transition:var(--zn-transition-fast) box-shadow,var(--zn-transition-fast) background-color}.input--range:hover:not(.input--disabled) .input__control::-webkit-slider-thumb{background-color:var(--zn-color-primary-500);box-shadow:0 0 0 1px var(--zn-input-border-color-hover)}.input--range:hover:not(.input--disabled) .input__control::-moz-range-thumb{background-color:var(--zn-color-primary-500);box-shadow:0 0 0 1px var(--zn-input-border-color-hover)}.input--range .input__control:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 var(--zn-focus-ring-width) var(--zn-input-focus-ring-color)}.input--range .input__control:focus-visible::-moz-range-thumb{box-shadow:0 0 0 var(--zn-focus-ring-width) var(--zn-input-focus-ring-color)}.input__color-picker{position:absolute;opacity:0;width:0;height:0;padding:0;margin:0;pointer-events:none;border:none;visibility:hidden}`;var le=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this,{assumeInteractionOn:["zn-blur","zn-input"]});this.hasSlotController=new te(this,"help-text","label","label-tooltip");this.localize=new or(this);this.slashController=new na(this,{menu:()=>this.mountSlashMenu(),items:t=>this.resolveSlashItems(t),trigger:()=>this.slashTrigger,onSelect:(t,r)=>!this.emit("zn-slash-select",{detail:{item:t,query:r}}).defaultPrevented,onInsert:(t,r)=>this.emit("zn-slash-insert",{detail:{item:t,value:r}})});this.hasFocus=!1;this.hasSlashMenu=!1;this.isUserTyping=!1;this.title="";this.__numberInput=Object.assign(document.createElement("input"),{type:"number"});this.__dateInput=Object.assign(document.createElement("input"),{type:"date"});this.type="text";this.name="";this.value="";this.defaultValue="";this.size="medium";this.pill=!1;this.label="";this.labelTooltip="";this.contextNote="";this.helpText="";this.clearable=!1;this.optionalIcon=!1;this.disabled=!1;this.filled=!1;this.placeholder="";this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.noSpinButtons=!1;this.colorFormat="hex";this.valueSuffix="";this.required=!1;this.spellcheck=!0;this.slashItems=[];this.slashPreset="";this.slashTrigger="/";this.slashHeading="Insert";this.slashHideKeys=!1;this.slashRecentKey="";this.triggerSubmit=!1}get valueAsDate(){return this.__dateInput.type=this.type,this.__dateInput.value=this.value,this.input?.valueAsDate||this.__dateInput.valueAsDate}set valueAsDate(t){this.__dateInput.type=this.type,this.__dateInput.valueAsDate=t,this.value=this.__dateInput.value}get valueAsNumber(){return this.__numberInput.value=this.value,this.input?.valueAsNumber||this.__numberInput.valueAsNumber}set valueAsNumber(t){this.__numberInput.valueAsNumber=t,this.value=this.__numberInput.value}get validity(){return this.input?.validity}get validationMessage(){return this.input.validationMessage}validateMinMax(){this.type!=="number"&&this.type!=="date"||(typeof this.min<"u"&&parseInt(this.value)<parseInt(this.min)&&(this.value=this.min.toString()),typeof this.max<"u"&&parseInt(this.value)>parseInt(this.max)&&(this.value=this.max.toString()))}hexToRgb(t){let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!r)return"";let n=parseInt(r[1],16),a=parseInt(r[2],16),s=parseInt(r[3],16);return`rgb(${n}, ${a}, ${s})`}rgbToHex(t){let r=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!r)return"";let n=parseInt(r[1]).toString(16).padStart(2,"0"),a=parseInt(r[2]).toString(16).padStart(2,"0"),s=parseInt(r[3]).toString(16).padStart(2,"0");return`#${n}${a}${s}`}hexToOklch(t){let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!r)return"";let n=parseInt(r[1],16)/255,a=parseInt(r[2],16)/255,s=parseInt(r[3],16)/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;let l=n*.4124564+a*.3575761+s*.1804375,d=n*.2126729+a*.7151522+s*.072175,h=n*.0193339+a*.119192+s*.9503041,m=l/.95047,f=d/1,b=h/1.08883,g=m>.008856?Math.pow(m,1/3):7.787*m+16/116,v=f>.008856?Math.pow(f,1/3):7.787*f+16/116,y=b>.008856?Math.pow(b,1/3):7.787*b+16/116,_=116*v-16,E=500*(g-v),N=200*(v-y),G=Math.sqrt(E*E+N*N),R=Math.atan2(N,E)*180/Math.PI;R<0&&(R+=360);let C=(_/100).toFixed(3),L=(G/150).toFixed(3),M=R.toFixed(1);return`oklch(${C} ${L} ${M})`}oklchToHex(t){let r=t.match(/^oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)$/);if(!r)return"";let n=parseFloat(r[1])*100,a=parseFloat(r[2])*150,s=parseFloat(r[3]),l=a*Math.cos(s*Math.PI/180),d=a*Math.sin(s*Math.PI/180),h=(n+16)/116,m=l/500+h,f=h-d/200,b=m>.206897?Math.pow(m,3):(m-16/116)/7.787,g=h>.206897?Math.pow(h,3):(h-16/116)/7.787,v=f>.206897?Math.pow(f,3):(f-16/116)/7.787,y=b*.95047,_=g*1,E=v*1.08883,N=y*3.2404542+_*-1.5371385+E*-.4985314,G=y*-.969266+_*1.8760108+E*.041556,R=y*.0556434+_*-.2040259+E*1.0572252;N=N>.0031308?1.055*Math.pow(N,1/2.4)-.055:12.92*N,G=G>.0031308?1.055*Math.pow(G,1/2.4)-.055:12.92*G,R=R>.0031308?1.055*Math.pow(R,1/2.4)-.055:12.92*R,N=Math.max(0,Math.min(1,N)),G=Math.max(0,Math.min(1,G)),R=Math.max(0,Math.min(1,R));let C=Math.round(N*255).toString(16).padStart(2,"0"),L=Math.round(G*255).toString(16).padStart(2,"0"),M=Math.round(R*255).toString(16).padStart(2,"0");return`#${C}${L}${M}`}hexToHsl(t){let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!r)return"";let n=parseInt(r[1],16)/255,a=parseInt(r[2],16)/255,s=parseInt(r[3],16)/255,l=Math.max(n,a,s),d=Math.min(n,a,s),h=(l+d)/2,m=0,f=0;if(l!==d){let b=l-d;switch(f=h>.5?b/(2-l-d):b/(l+d),l){case n:m=((a-s)/b+(a<s?6:0))/6;break;case a:m=((s-n)/b+2)/6;break;case s:m=((n-a)/b+4)/6;break}}return`hsl(${Math.round(m*360)}, ${Math.round(f*100)}%, ${Math.round(h*100)}%)`}hslToHex(t){let r=t.match(/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)$/);if(!r)return"";let n=parseInt(r[1])/360,a=parseInt(r[2])/100,s=parseInt(r[3])/100,l,d,h;if(a===0)l=s,d=s,h=s;else{let g=(_,E,N)=>(N<0&&(N+=1),N>1&&(N-=1),N<.16666666666666666?_+(E-_)*6*N:N<.5?E:N<.6666666666666666?_+(E-_)*(.6666666666666666-N)*6:_),v=s<.5?s*(1+a):s+a-s*a,y=2*s-v;l=g(y,v,n+1/3),d=g(y,v,n),h=g(y,v,n-1/3)}let m=Math.round(l*255).toString(16).padStart(2,"0"),f=Math.round(d*255).toString(16).padStart(2,"0"),b=Math.round(h*255).toString(16).padStart(2,"0");return`#${m}${f}${b}`}convertToHex(t){return t?t.startsWith("#")?t:t.startsWith("rgb")?this.rgbToHex(t):t.startsWith("hsl")?this.hslToHex(t):t.startsWith("oklch")?this.oklchToHex(t):t:"#000000"}convertFromHex(t){return t?this.colorFormat==="hex"?t:this.colorFormat==="rgb"?this.hexToRgb(t):this.colorFormat==="hsl"?this.hexToHsl(t):this.colorFormat==="oklch"?this.hexToOklch(t):t:""}handleBlur(){if(this.hasFocus=!1,this.isUserTyping=!1,this.validateMinMax(),this.type==="color"&&this.value){let t=this.convertToHex(this.value);if(t){let r=this.convertFromHex(t);r!==this.value&&(this.value=r)}}this.emit("zn-blur")}handleChange(){if(this.type==="currency"&&this.input.value)this.value=parseFloat(this.input.value).toFixed(2);else if(this.type==="color"){let t=this.input.value.trim();if(t==="")this.value="";else if(this.colorFormat==="hex"){let r=t;r&&!r.startsWith("#")&&(r="#"+r),/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(r)&&(this.value=r.toLowerCase())}else this.colorFormat==="rgb"?/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(t)&&(this.value=t):this.colorFormat==="hsl"?/^hsl\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*\)$/.test(t)&&(this.value=t):this.colorFormat==="oklch"&&/^oklch\(\s*[0-9.]+\s+[0-9.]+\s+[0-9.]+\s*\)$/.test(t)&&(this.value=t)}else this.value=this.input.value,this.syncEmailDisplay();this.emit("zn-change")}handleClearClick(t){this.value="",this.emit("zn-clear"),this.emit("zn-input"),this.emit("zn-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("zn-focus")}handleInput(){this.isUserTyping=!0,this.type==="color"?this.value=this.input.value:this.value=this.input.value,this.formControlController.updateValidity(),this.emit("zn-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}syncEmailDisplay(){this.type==="email"&&(this.input.value=this.value)}handleKeyDown(t){if(this.slashController.open)return;if(t.key==="Escape"){this.input.blur(),t.stopPropagation();return}let r=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;if(t.key==="Enter"&&!r&&(this.syncEmailDisplay(),!t.defaultPrevented&&!t.isComposing)){let n=this.formControlController.getForm();if(!this.triggerSubmit&&(n?.hasAttribute("enter-navigation")||n?.hasAttribute("data-enter-navigation")))return;this.formControlController.submit()}}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleColorSwatchClick(){this.type==="color"&&this.colorPicker&&this.colorPicker.click()}handleColorPickerChange(){if(this.type==="color"&&this.colorPicker){let t=this.colorPicker.value;this.value=this.convertFromHex(t),this.emit("zn-change"),this.emit("zn-input")}}focusInput(t){if(this.hasFocus)return;let r=t.target;r.tagName==="ZN-CHECKBOX"&&(r.slot==="prefix"||r.closest('[slot="prefix"]'))||(r.classList.contains("input__prefix")||r.slot==="prefix"||r.hasAttribute("part")&&r.getAttribute("part")==="base")&&(this.handleFocus(),this.input.focus())}firstUpdated(){this.type==="range"&&this.value===""&&(this.value=this.input.value),this.slashController.attach(this.input)}async resolveSlashItems(t=""){let r=[...ih(this.slashPreset),...this.slashItems,...this.slottedSlashItems()],n=await this.slashItemsProvider?.(t);return n?[...r,...n]:r}async showSlashMenu(){this.focus();let t=this.input.selectionStart??this.input.value.length;this.input.value.slice(t-this.slashTrigger.length,t)!==this.slashTrigger&&this.setRangeText(this.slashTrigger,t,t,"end"),await this.updateComplete,this.slashController.requestOpen()}hideSlashMenu(){this.slashController.close()}slottedSlashItems(){return[...this.querySelectorAll("zn-slash-item")].map(r=>{if(typeof r.toSlashMenuItem=="function")return r.toSlashMenuItem();let n=r.getAttribute("value")??(r.textContent??"").trim(),a=r.getAttribute("order"),s=r.getAttribute("caret-offset");return{label:r.getAttribute("label")??n,value:n,icon:r.getAttribute("icon")??void 0,description:r.getAttribute("description")??void 0,keywords:r.getAttribute("keywords")??void 0,group:r.getAttribute("group")??void 0,action:r.getAttribute("action")??void 0,order:a===null?void 0:Number(a),caretOffset:s===null?void 0:Number(s),disabled:r.hasAttribute("disabled")}})}async mountSlashMenu(){let t=this.querySelector("zn-slash-menu");return t||(this.hasSlashMenu||(this.hasSlashMenu=!0,await this.updateComplete),this.slashMenuElement)}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){if(await this.updateComplete,this.type==="color"&&this.value&&!this.isUserTyping){let t=this.convertToHex(this.value);if(t){let r=this.convertFromHex(t);if(r!==this.value){this.value=r,this.emit("zn-change");return}}}this.formControlController.updateValidity(),this.type==="color"&&this.colorPicker&&(this.colorPicker.value=this.convertToHex(this.value)||"#000000")}handleColorFormatChange(){if(this.type==="color"&&this.value){let t=this.convertToHex(this.value);if(t){let r=this.convertFromHex(t);r!==this.value&&(this.value=r,this.emit("zn-change"))}}}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,r,n="none"){this.input.setSelectionRange(t,r,n)}setRangeText(t,r,n,a="preserve"){let s=r??this.input.selectionStart,l=n??this.input.selectionEnd;this.input.setRangeText(t,s,l,a),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){let t=this.hasSlotController.test("label"),r=this.hasSlotController.test("label-tooltip"),n=this.hasSlotController.test("context-note"),a=this.hasSlotController.test("help-text"),s=this.type==="range",l=this.label?!0:t,d=this.labelTooltip?!0:r,h=this.contextNote||s?!0:n,m=this.helpText?!0:a,f=this.clearable&&!this.disabled&&!this.readonly,b=this.optionalIcon,g=f&&(typeof this.value=="number"||this.value.length>0);return u`
435
435
  <div part="form-control"
436
436
  class="${q({"form-control":!0,"form-control--x-small":this.size==="x-small","form-control--small":this.size==="small","form-control--medium":this.size==="medium","form-control--large":this.size==="large","form-control--has-label":l,"form-control--has-label-tooltip":d,"form-control--has-context-note":h,"form-control--has-help-text":m})}">
@@ -4254,7 +4254,7 @@ ${xs(this.code(i,t))}
4254
4254
  <zn-button icon="keyboard_arrow_down"></zn-button>
4255
4255
  </zn-button-group>
4256
4256
  </div>
4257
- `}checkValidity(){return this._isButton()&&this.button?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this._isButton()&&this.button?this.button.reportValidity():!0}setCustomValidity(t){this._isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}get validity(){return this._isButton()&&this.button?this.button.validity:ht}get validationMessage(){return this._isButton()&&this.button?this.button.validationMessage:""}_isButton(){return this.type==="submit"||this.type==="button"||this.type==="reset"}};fi.styles=k(h5),c([p()],fi.prototype,"caption",2),c([p()],fi.prototype,"href",2),c([p()],fi.prototype,"name",2),c([p()],fi.prototype,"value",2),c([Ne()],fi.prototype,"defaultValue",2),c([p()],fi.prototype,"type",2),c([U("zn-dropdown")],fi.prototype,"dropdown",2),c([U("zn-button#trigger-btn")],fi.prototype,"button",2);var MD=fi;fi.define("zn-split-button");var ID=/<\/?(p|div|span|strong|b|em|i|u|a|img|ul|ol|li|table|tr|td|h[1-6]|blockquote|font|center)\b[^>]*>/i;function Yb(o){return ID.test(o)}function u5(o){let i=Yb(o)?nl(o):o.replace(/<br\s*\/?>/gi," ").replace(/</g,"&lt;"),t=new DOMParser().parseFromString(i,"text/html");return t.body.querySelectorAll("br, p, li").forEach(r=>r.after(" ")),(t.body.textContent??"").replace(/\s+/g," ").trim()}var m5=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.content-block{background-color:var(--zn-note-background,rgba(var(--zn-panel),var(--zn-panel-opacity)));border-bottom:1px solid rgb(var(--zn-border-color));padding-inline:calc(var(--zn-gutter,0) + var(--zn-base-gap,0))}.content-block-header{display:flex;align-items:center;gap:var(--zn-spacing-small);width:100%;max-width:100%;padding-block:var(--zn-spacing-small);position:relative}.content-block--collapsible .content-block-header{cursor:pointer}.content-block-header__icon{display:flex;align-items:center;flex-shrink:0}.content-block-header__main{display:flex;flex-direction:row;align-items:center;gap:var(--zn-spacing-small);min-width:0;flex-grow:1;overflow:hidden}.content-block-header__caption{font-weight:var(--zn-text-h1-font-weight);font-size:var(--zn-text-h1-font-size);color:rgba(var(--zn-text-panel-title),100%);line-height:var(--zn-icon-size,20px);margin:0;display:flex;align-items:center;gap:var(--zn-spacing-small);flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.content-block-header__description{flex:1 1 auto;min-width:0;font-size:var(--zn-font-size-medium);color:rgb(var(--zn-text-muted));overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:none}.content-block-header__attachments{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);font-size:var(--zn-font-size-small);color:rgb(var(--zn-text-muted));flex-shrink:0;margin-left:auto}.content-block-header__actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto;flex-shrink:0}.content-block__attachments{display:none;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--zn-spacing-small);padding-block-end:var(--zn-spacing-small)}.content-block__attachments--visible{display:flex}.content-block__attachments ::slotted(zn-chat-message-attachment){min-width:0}.content-block--short zn-sp,.content-block--short .content-block__attachments{display:none}.content-block--short .content-block-header__description{display:block}@container (max-width:599px){.content-block--short .content-block-header__description{display:none}}.text-section{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal)}.text-section a{font-size:var(--zn-font-size-small);opacity:0.8}.hidden{display:none}ol{counter-reset:list-0 0}@supports (counter-set:none){ol li,ul li{counter-set:list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0}}ol,ul{padding:0;margin:0}li[data-list=checked]>.ql-ui,li[data-list=unchecked]>.ql-ui{color:#777}li{list-style-type:none;position:relative}ul>li::before{content:"•"}ol>li{counter-increment:list-0}ol>li::before{content:counter(list-0) ". "}li[data-list=checked]::before{content:"☑"}li[data-list=unchecked]::before{content:"☐"}li[data-list=checked]::before,li[data-list=unchecked]::before{color:#777}ol li::before,ul li::before{display:inline-block;margin-left:-1.5em;margin-right:0.3em;text-align:right;white-space:nowrap;width:1.2em}li:has(>.ql-ui)::before{content:none;display:none}`;var Pr=class extends T{constructor(){super(...arguments);this.time="";this.sender="";this.avatar="";this.outbound=!1;this.noCollapse=!1;this.short=!1;this.defaultDisplay="text";this.hasSlotController=new te(this,"text","html");this.attachmentCount=0;this._textRows=[];this._footerObserver=new Ze(this,{target:null,config:{subtree:!0,childList:!0,attributes:!0,attributeFilter:["href","download","caption"]},callback:()=>this._debouncedReplace()});this._replaceDebounce=0}connectedCallback(){super.connectedCallback(),this.iframe.then(t=>{if(t.contentDocument){let r=this.htmlNodes[0];if(r){let n=r?.innerHTML??"";n=n.replace(/&nbsp;/g," "),n=n.replace(/&lt;/g,"<"),n=n.replace(/&gt;/g,">"),n=n.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");let a="<style>body,html{background-color: #ffffff}img{max-width:100%; max-height: 500px;}</style>";t.srcdoc=a+n}}t.addEventListener("load",()=>{setTimeout(()=>this._resizeIframe(t),50)})})}disconnectedCallback(){this._replaceDebounce&&(clearTimeout(this._replaceDebounce),this._replaceDebounce=0),super.disconnectedCallback()}_collapseContent(t){this.noCollapse||t.composedPath().some(n=>n instanceof HTMLElement&&n.classList.contains("content-block-header__actions"))||(this.short=!this.short,this.requestUpdate(),this.updateComplete.then(()=>{this.short||this.iframe.then(n=>{n&&!n.classList.contains("hidden")&&this._resizeIframe(n)})}))}_toggleText(){let t=this.shadowRoot?.querySelector(".text-content");this.iframe.then(r=>{t&&(r.classList.add("hidden"),t.classList.remove("hidden"))})}_toggleHtml(){let t=this.shadowRoot?.querySelector(".text-content");this.iframe.then(r=>{t&&(r.classList.remove("hidden"),t.classList.add("hidden"),setTimeout(()=>this._resizeIframe(r),0))})}_resizeIframe(t){let r=n=>{let a=n.contentDocument;if(!a)return;n.style.height="auto";let s=a.body,l=a.documentElement,d=[s?.scrollHeight??0,l?.scrollHeight??0,s?.offsetHeight??0,l?.offsetHeight??0],h=Math.max(...d);h>0&&(n.style.height=`${h}px`)};t?r(t):this.iframe.then(n=>{n?.contentDocument&&requestAnimationFrame(()=>r(n))})}handleAttachmentsSlotChange(){this.syncAttachmentCount()}syncAttachmentCount(){let t=this.shadowRoot?.querySelector('slot[name="attachments"]');this.attachmentCount=t?.assignedElements().length??0}firstUpdated(t){super.firstUpdated(t),this.syncAttachmentCount(),Promise.resolve().then(()=>this.syncAttachmentCount());let r=this.shadowRoot?.querySelectorAll(".text-section");r&&r.length>0&&r.forEach(n=>{n.innerHTML=n.innerHTML.replace(/&nbsp;/g," "),n.innerHTML=n.innerHTML.replace(/<!--[\s\S]*?-->/g,""),n.innerHTML=n.innerHTML.replace(/<\/p><br>/g,"</p>")})}render(){let t=this.getTextSections(),r=this.querySelector(':scope > [slot="footer"]')!==null,n=this.hasSlotController.test("text"),a=this.hasSlotController.test("html"),s=n&&a,l=a&&(!n||this.defaultDisplay==="html");return u`
4257
+ `}checkValidity(){return this._isButton()&&this.button?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this._isButton()&&this.button?this.button.reportValidity():!0}setCustomValidity(t){this._isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}get validity(){return this._isButton()&&this.button?this.button.validity:ht}get validationMessage(){return this._isButton()&&this.button?this.button.validationMessage:""}_isButton(){return this.type==="submit"||this.type==="button"||this.type==="reset"}};fi.styles=k(h5),c([p()],fi.prototype,"caption",2),c([p()],fi.prototype,"href",2),c([p()],fi.prototype,"name",2),c([p()],fi.prototype,"value",2),c([Ne()],fi.prototype,"defaultValue",2),c([p()],fi.prototype,"type",2),c([U("zn-dropdown")],fi.prototype,"dropdown",2),c([U("zn-button#trigger-btn")],fi.prototype,"button",2);var MD=fi;fi.define("zn-split-button");var ID=/<\/?(p|div|span|strong|b|em|i|u|a|img|ul|ol|li|table|tr|td|h[1-6]|blockquote|font|center)\b[^>]*>/i;function Yb(o){return ID.test(o)}function u5(o){let i=Yb(o)?nl(o):o.replace(/<br\s*\/?>/gi," ").replace(/</g,"&lt;"),t=new DOMParser().parseFromString(i,"text/html");return t.body.querySelectorAll("br, p, li").forEach(r=>r.after(" ")),(t.body.textContent??"").replace(/\s+/g," ").trim()}var m5=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.content-block{background-color:var(--zn-note-background,rgba(var(--zn-panel),var(--zn-panel-opacity)));border-bottom:1px solid rgb(var(--zn-border-color));padding-inline:calc(var(--zn-gutter,0) + var(--zn-base-gap,0))}.content-block-header{display:flex;align-items:center;gap:var(--zn-spacing-small);width:100%;max-width:100%;padding-block:var(--zn-spacing-small);position:relative}.content-block--collapsible .content-block-header{cursor:pointer}.content-block-header__icon{display:flex;align-items:center;flex-shrink:0}.content-block-header__main{display:flex;flex-direction:row;align-items:center;gap:var(--zn-spacing-small);min-width:0;flex-grow:1;overflow:hidden}.content-block-header__caption{font-weight:var(--zn-text-h1-font-weight);font-size:var(--zn-text-h1-font-size);color:rgba(var(--zn-text-panel-title),100%);line-height:var(--zn-icon-size,20px);margin:0;display:flex;align-items:center;gap:var(--zn-spacing-small);flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.content-block-header__description{flex:1 1 auto;min-width:0;font-size:var(--zn-font-size-medium);color:rgb(var(--zn-text-muted));overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:none}.content-block-header__attachments{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);font-size:var(--zn-font-size-small);color:rgb(var(--zn-text-muted));flex-shrink:0;margin-left:auto}.content-block-header__actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto;flex-shrink:0}.content-block__attachments{display:none;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--zn-spacing-small);padding-block-end:var(--zn-spacing-small)}.content-block__attachments--visible{display:flex}.content-block__attachments ::slotted(zn-chat-message-attachment){min-width:0}.content-block--short zn-sp,.content-block--short .content-block__attachments{display:none}.content-block--short .content-block-header__description{display:block}@container (max-width:599px){.content-block--short .content-block-header__description{display:none}}.text-section{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal)}.text-section a{font-size:var(--zn-font-size-small);opacity:0.8}.text-section p{margin:0}.text-section blockquote{border-left:4px solid rgb(var(--zn-border-color));margin:5px 0;padding-left:16px}.text-section code{background-color:#f0f0f0;border-radius:3px;font-size:85%;padding:2px 4px}.text-section pre{background-color:#23241f;border-radius:3px;margin-block:5px;padding:5px 10px;color:#f8f8f2;overflow:auto}.text-section hr{border:none;border-top:1px solid rgb(var(--zn-border-color));margin:var(--zn-spacing-small) 0}.hidden{display:none}ol{counter-reset:list-0 0}@supports (counter-set:none){ol li,ul li{counter-set:list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0}}ol,ul{padding:0;margin:0}li>ol,li>ul{padding-left:1.5em}li[data-list=checked]>.ql-ui,li[data-list=unchecked]>.ql-ui{color:#777}li{list-style-type:none;position:relative}ul>li::before{content:"•"}ol>li{counter-increment:list-0}ol>li::before{content:counter(list-0) ". "}li[data-list=checked]::before{content:"☑"}li[data-list=unchecked]::before{content:"☐"}li[data-list=checked]::before,li[data-list=unchecked]::before{color:#777}ol li::before,ul li::before{display:inline-block;margin-left:-1.5em;margin-right:0.3em;text-align:right;white-space:nowrap;width:1.2em}li:has(>.ql-ui)::before{content:none;display:none}`;var qD=["s","code","pre","blockquote","hr","span"],RD='html,body{background-color:#fff;margin:0}img{max-width:100%;max-height:500px}p{margin:0}ul,ol{margin:0;padding-left:1.5em}blockquote{border-left:4px solid #ddd;margin:5px 0;padding-left:16px}code{background-color:#f0f0f0;border-radius:3px;font-size:85%;padding:2px 4px}pre{background-color:#23241f;border-radius:3px;margin:5px 0;padding:5px 10px;color:#f8f8f2;overflow:auto}pre code{background:none;padding:0}hr{border:none;border-top:1px solid #ddd;margin:8px 0}li[data-list=checked],li[data-list=unchecked]{list-style:none}li[data-list=checked]::before{content:"\u2611";color:#777;margin:0 .3em 0 -1.5em}li[data-list=unchecked]::before{content:"\u2610";color:#777;margin:0 .3em 0 -1.5em}',Pr=class extends T{constructor(){super(...arguments);this.time="";this.sender="";this.avatar="";this.outbound=!1;this.noCollapse=!1;this.short=!1;this.defaultDisplay="text";this.hasSlotController=new te(this,"text","html");this.attachmentCount=0;this._textRows=[];this._footerObserver=new Ze(this,{target:null,config:{subtree:!0,childList:!0,attributes:!0,attributeFilter:["href","download","caption"]},callback:()=>this._debouncedReplace()});this._replaceDebounce=0}connectedCallback(){super.connectedCallback(),this.iframe.then(t=>{if(t.contentDocument){let r=this.htmlNodes[0];if(r){let n=r.children.length?r.innerHTML:r.textContent??"";n=n.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");let{fontFamily:a,fontSize:s,lineHeight:l,color:d}=getComputedStyle(this.shadowRoot?.querySelector(".text-section")??this);t.srcdoc=`<style>body{font-family:${a};font-size:${s};line-height:${l};color:${d}}${RD}</style>`+n}}t.addEventListener("load",()=>{setTimeout(()=>this._resizeIframe(t),50)})})}disconnectedCallback(){this._replaceDebounce&&(clearTimeout(this._replaceDebounce),this._replaceDebounce=0),super.disconnectedCallback()}_collapseContent(t){this.noCollapse||t.composedPath().some(n=>n instanceof HTMLElement&&n.classList.contains("content-block-header__actions"))||(this.short=!this.short,this.requestUpdate(),this.updateComplete.then(()=>{this.short||this.iframe.then(n=>{n&&!n.classList.contains("hidden")&&this._resizeIframe(n)})}))}_toggleText(){let t=this.shadowRoot?.querySelector(".text-content");this.iframe.then(r=>{t&&(r.classList.add("hidden"),t.classList.remove("hidden"))})}_toggleHtml(){let t=this.shadowRoot?.querySelector(".text-content");this.iframe.then(r=>{t&&(r.classList.remove("hidden"),t.classList.add("hidden"),setTimeout(()=>this._resizeIframe(r),0))})}_resizeIframe(t){let r=n=>{let a=n.contentDocument;if(!a)return;n.style.height="auto";let s=a.body,l=a.documentElement,d=[s?.scrollHeight??0,l?.scrollHeight??0,s?.offsetHeight??0,l?.offsetHeight??0],h=Math.max(...d);h>0&&(n.style.height=`${h}px`)};t?r(t):this.iframe.then(n=>{n?.contentDocument&&requestAnimationFrame(()=>r(n))})}handleAttachmentsSlotChange(){this.syncAttachmentCount()}syncAttachmentCount(){let t=this.shadowRoot?.querySelector('slot[name="attachments"]');this.attachmentCount=t?.assignedElements().length??0}firstUpdated(t){super.firstUpdated(t),this.syncAttachmentCount(),Promise.resolve().then(()=>this.syncAttachmentCount());let r=this.shadowRoot?.querySelectorAll(".text-section");r&&r.length>0&&r.forEach(n=>{n.innerHTML=n.innerHTML.replace(/&nbsp;/g," "),n.innerHTML=n.innerHTML.replace(/<!--[\s\S]*?-->/g,""),n.innerHTML=n.innerHTML.replace(/<\/p><br>/g,"</p>")})}render(){let t=this.getTextSections(),r=this.querySelector(':scope > [slot="footer"]')!==null,n=this.hasSlotController.test("text"),a=this.hasSlotController.test("html"),s=n&&a,l=a&&(!n||this.defaultDisplay==="html");return u`
4258
4258
  <div class="${q({"content-block":!0,"content-block--outbound":this.outbound,"content-block--short":this.short,"content-block--collapsible":!this.noCollapse})}">
4259
4259
 
4260
4260
  <div class="content-block-header" @click="${this._collapseContent}">
@@ -4321,9 +4321,9 @@ ${xs(this.code(i,t))}
4321
4321
  ${r?u`
4322
4322
  <slot slot="footer" name="footer" @slotchange="${this._handleSlotChange}"></slot>`:""}
4323
4323
  </div>
4324
- `}truncateText(){let t=this.querySelector('[slot="text"]');if(!t)return"";let r=u5(t.innerText);return r.length>32?r.substring(0,32)+"...":r}_handleSlotChange(t){let n=t.target.assignedElements({flatten:!0});!n||n.length===0||(n.forEach(a=>this._footerObserver.observe(a)),this._replaceImagePlaceholders(),setTimeout(()=>this._replaceImagePlaceholders(),50))}_debouncedReplace(){this._replaceDebounce&&clearTimeout(this._replaceDebounce),this._replaceDebounce=window.setTimeout(()=>this._replaceImagePlaceholders(),50)}_replaceImagePlaceholders(){let t=this.shadowRoot?.querySelector(".text-content");if(!t){this.updateComplete.then(()=>this._replaceImagePlaceholders());return}let r=this.querySelector(':scope > [slot="footer"]');if(!r)return;let n=nt("a[href]",r,"");if(n.length===0)return;let a=t.innerHTML,s=new Set(["png","jpg","jpeg","gif","bmp","webp","svg","heic","tiff","tif","avif"]);n.forEach(l=>{let d=new Set,h=l.querySelector("zn-tile"),m=(h?.caption??h?.getAttribute?.("caption")??"").trim();m&&d.add(m);let f=(l.getAttribute("download")||"").trim();f&&d.add(f);let b=l.getAttribute("href")||"";d.forEach(g=>{let v=(g||"").trim();if(!v)return;let y=v.includes("/")?v.split("/").pop():v,_=y.toLowerCase(),E=_.includes(".")?_.split(".").pop():"";if(E&&!s.has(E))return;let N=y.replace(/"/g,"&quot;");a=a.replace(`[image: ${y}]`,()=>`<img src="${b}" alt="${N}" style="max-height: 500px; max-width: 100%">`)})}),t.innerHTML=a}getTextSections(){let t=this.querySelector('[slot="text"]'),r=[];if(t&&Yb(t.innerText))return this._textRows=[{lines:[nl(t.innerText)],type:"text",html:!0}],this._textRows;if(t){let a=t.innerText.replace(/<br\s*\/?>/gi,`
4324
+ `}truncateText(){let t=this.querySelector('[slot="text"]');if(!t)return"";let r=u5(t.innerText);return r.length>32?r.substring(0,32)+"...":r}_handleSlotChange(t){let n=t.target.assignedElements({flatten:!0});!n||n.length===0||(n.forEach(a=>this._footerObserver.observe(a)),this._replaceImagePlaceholders(),setTimeout(()=>this._replaceImagePlaceholders(),50))}_debouncedReplace(){this._replaceDebounce&&clearTimeout(this._replaceDebounce),this._replaceDebounce=window.setTimeout(()=>this._replaceImagePlaceholders(),50)}_replaceImagePlaceholders(){let t=this.shadowRoot?.querySelector(".text-content");if(!t){this.updateComplete.then(()=>this._replaceImagePlaceholders());return}let r=this.querySelector(':scope > [slot="footer"]');if(!r)return;let n=nt("a[href]",r,"");if(n.length===0)return;let a=t.innerHTML,s=new Set(["png","jpg","jpeg","gif","bmp","webp","svg","heic","tiff","tif","avif"]);n.forEach(l=>{let d=new Set,h=l.querySelector("zn-tile"),m=(h?.caption??h?.getAttribute?.("caption")??"").trim();m&&d.add(m);let f=(l.getAttribute("download")||"").trim();f&&d.add(f);let b=l.getAttribute("href")||"";d.forEach(g=>{let v=(g||"").trim();if(!v)return;let y=v.includes("/")?v.split("/").pop():v,_=y.toLowerCase(),E=_.includes(".")?_.split(".").pop():"";if(E&&!s.has(E))return;let N=y.replace(/"/g,"&quot;");a=a.replace(`[image: ${y}]`,()=>`<img src="${b}" alt="${N}" style="max-height: 500px; max-width: 100%">`)})}),t.innerHTML=a}getTextSections(){let t=this.querySelector('[slot="text"]'),r=[];if(t&&Yb(t.innerText))return this._textRows=[{lines:[nl(t.innerText,qD,!0)],type:"text",html:!0}],this._textRows;if(t){let a=t.innerText.replace(/<br\s*\/?>/gi,`
4325
4325
  `).split(`
4326
- `),s=null,l=!1,d="text",h=a.some(m=>m.startsWith(">"));a.forEach(m=>{let f=m;if((f.startsWith("On")&&f.endsWith("wrote:")||f.startsWith("From:"))&&!h&&(l=!0),f.startsWith("--")&&(l=!1),d=l||f.startsWith(">")?"reply":"text",f.startsWith("Sent from")&&(d="reply"),f.trim()===""&&s==="reply"&&(d="reply"),d==="reply"&&f.startsWith(">")&&(f=f.substring(1).trim()),s===d){if(r.length===0){r.push({lines:[f],type:d}),s=d;return}r[r.length-1].lines.push(f)}else r.push({lines:[f],type:d}),s=d})}return this._textRows=r,this._textRows}showReply(t){let n=t.target.nextElementSibling;n&&n.classList.toggle("hidden")}};Pr.styles=k(m5),c([p()],Pr.prototype,"time",2),c([p()],Pr.prototype,"sender",2),c([p()],Pr.prototype,"avatar",2),c([p({type:Boolean,reflect:!0})],Pr.prototype,"outbound",2),c([p({type:Boolean,attribute:"no-collapse"})],Pr.prototype,"noCollapse",2),c([p({type:Boolean,reflect:!0})],Pr.prototype,"short",2),c([p({attribute:"default-display",reflect:!0})],Pr.prototype,"defaultDisplay",2),c([r1({slot:"html",flatten:!0})],Pr.prototype,"htmlNodes",2),c([t1("iframe")],Pr.prototype,"iframe",2),c([D()],Pr.prototype,"attachmentCount",2);var qD=Pr;Pr.define("zn-content-block");var f5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}.filter-wrapper__submit{margin-top:var(--zn-spacing-medium)}`;var qa=class extends T{constructor(){super(...arguments);this.button="Filter";this.hasSubmitButton=!1;this.handleSubmit=t=>{t.preventDefault();let r=this.closest("zn-data-table");if(r){let n=["zn-input","zn-select","zn-query-builder","zn-data-select","zn-datepicker","input","select","textarea"],a=Array.from(this.querySelectorAll(n.join(","))),s={};a.forEach(l=>{Dm(l),!(!l.value&&l.hasAttribute("omit-empty"))&&(s[l.name]=l.value)}),r.requestParams=s,r.refresh()}}}connectedCallback(){super.connectedCallback();let t=this.querySelector("zn-button[submit]");t&&(this.hasSubmitButton=!0,t.addEventListener("click",this.handleSubmit))}renderDefaultButton(){return u`
4326
+ `),s=null,l=!1,d="text",h=a.some(m=>m.startsWith(">"));a.forEach(m=>{let f=m;if((f.startsWith("On")&&f.endsWith("wrote:")||f.startsWith("From:"))&&!h&&(l=!0),f.startsWith("--")&&(l=!1),d=l||f.startsWith(">")?"reply":"text",f.startsWith("Sent from")&&(d="reply"),f.trim()===""&&s==="reply"&&(d="reply"),d==="reply"&&f.startsWith(">")&&(f=f.substring(1).trim()),s===d){if(r.length===0){r.push({lines:[f],type:d}),s=d;return}r[r.length-1].lines.push(f)}else r.push({lines:[f],type:d}),s=d})}return this._textRows=r,this._textRows}showReply(t){let n=t.target.nextElementSibling;n&&n.classList.toggle("hidden")}};Pr.styles=k(m5),c([p()],Pr.prototype,"time",2),c([p()],Pr.prototype,"sender",2),c([p()],Pr.prototype,"avatar",2),c([p({type:Boolean,reflect:!0})],Pr.prototype,"outbound",2),c([p({type:Boolean,attribute:"no-collapse"})],Pr.prototype,"noCollapse",2),c([p({type:Boolean,reflect:!0})],Pr.prototype,"short",2),c([p({attribute:"default-display",reflect:!0})],Pr.prototype,"defaultDisplay",2),c([r1({slot:"html",flatten:!0})],Pr.prototype,"htmlNodes",2),c([t1("iframe")],Pr.prototype,"iframe",2),c([D()],Pr.prototype,"attachmentCount",2);var DD=Pr;Pr.define("zn-content-block");var f5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}.filter-wrapper__submit{margin-top:var(--zn-spacing-medium)}`;var qa=class extends T{constructor(){super(...arguments);this.button="Filter";this.hasSubmitButton=!1;this.handleSubmit=t=>{t.preventDefault();let r=this.closest("zn-data-table");if(r){let n=["zn-input","zn-select","zn-query-builder","zn-data-select","zn-datepicker","input","select","textarea"],a=Array.from(this.querySelectorAll(n.join(","))),s={};a.forEach(l=>{Dm(l),!(!l.value&&l.hasAttribute("omit-empty"))&&(s[l.name]=l.value)}),r.requestParams=s,r.refresh()}}}connectedCallback(){super.connectedCallback();let t=this.querySelector("zn-button[submit]");t&&(this.hasSubmitButton=!0,t.addEventListener("click",this.handleSubmit))}renderDefaultButton(){return u`
4327
4327
  <zn-button part="search-button"
4328
4328
  class="filter-wrapper__submit"
4329
4329
  type="submit"
@@ -4333,7 +4333,7 @@ ${xs(this.code(i,t))}
4333
4333
  `}render(){return u`
4334
4334
  <slot></slot>
4335
4335
  ${this.hasSubmitButton?"":this.renderDefaultButton()}
4336
- `}};qa.styles=k(f5),c([p()],qa.prototype,"button",2);var RD=qa;qa.define("zn-filter-wrapper");var g5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:contents}.container{padding-bottom:50px}.container--scroll{height:100%;width:100%;overflow:hidden;position:relative}.container--scroll .scroll-content{height:100%;width:100%;overflow:auto;box-sizing:border-box}.setting-container__dropdown{z-index:10;position:absolute;border-radius:50%;width:32px;height:32px;padding:4px;background:rgba(var(--zn-panel,0.8));box-shadow:var(--zn-shadow-small);opacity:0.7;transition-duration:0.3s;transition-property:opacity}.setting-container__dropdown:hover{background:rgba(var(--zn-panel,1))}.setting-container__dropdown--top-end{top:var(--zn-base-gap);right:calc(var(--zn-base-gap) + var(--zn-gutter));bottom:auto}.setting-container__dropdown--top-start{top:var(--zn-base-gap);right:auto;left:calc(var(--zn-base-gap) + var(--zn-gutter));bottom:auto}.setting-container__dropdown--bottom-end{bottom:calc(var(--zn-base-gap) + var(--zn-scroll-footer-height,0px));right:calc(var(--zn-base-gap) + var(--zn-gutter));top:auto}.setting-container__dropdown--bottom-start{bottom:calc(var(--zn-base-gap) + var(--zn-scroll-footer-height,0px));left:calc(var(--zn-base-gap) + var(--zn-gutter));top:auto}.setting-container__dropdown[open],.setting-container__dropdown:hover{opacity:1}.setting-container__toggle-button::part(icon){rotate:0deg;transition:rotate 0.9s ease-in-out,color 0.9s ease-in-out}.setting-container__dropdown[open] .setting-container__toggle-button::part(icon),.setting-container__toggle-button:hover::part(icon){color:rgb(var(--zn-primary));cursor:pointer;rotate:380deg}zn-button{border-radius:var(--zn-border-radius)}.pull-tab{position:absolute;top:0;right:calc(var(--zn-base-gap) + var(--zn-gutter));z-index:20;display:flex;flex-direction:column;align-items:flex-end;max-height:100%}.pull-tab__panel{display:grid;grid-template-rows:0fr;min-height:0;overflow:hidden;background-color:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-top:none;border-bottom-width:0;border-radius:0 0 0 var(--zn-border-radius);transition:grid-template-rows 0.22s ease,border-bottom-width 0s linear 0.22s}.pull-tab--open .pull-tab__panel{grid-template-rows:1fr;border-bottom-width:1px;transition:grid-template-rows 0.22s ease,border-bottom-width 0s linear 0s}.pull-tab__panel-content{min-height:0;overflow:hidden}.pull-tab__panel-content .settings-container__dropdown-content{border:none;box-shadow:none;border-radius:0;margin-bottom:0;max-width:none;width:auto}.pull-tab--expanded .pull-tab__panel-content{overflow-y:auto}.pull-tab__tab{flex-shrink:0;background-color:rgb(var(--zn-panel));color:rgb(var(--zn-text-heading));border:1px solid rgb(var(--zn-border-color));border-top:none;border-radius:0 0 10px 10px;padding:var(--zn-spacing-x-small);cursor:pointer;display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);max-height:36px;overflow:hidden;margin-top:-1px}.pull-tab__tab:hover{background-color:rgb(var(--zn-shadow))}.pull-tab__tab:focus-visible{outline:2px solid rgb(var(--zn-primary));outline-offset:-2px}.settings-container__dropdown-content{display:flex;flex-direction:column;gap:var(--zn-spacing-small);background-color:rgb(var(--zn-panel));padding:var(--zn-spacing-small);box-shadow:var(--zn-shadow-small);border-radius:var(--zn-border-radius);max-width:var(--zn-size-mpanel);width:-moz-fit-content;width:fit-content;z-index:20;border:1px solid rgb(var(--zn-border-color));margin-bottom:10px}`;var Ii=class extends T{constructor(){super(...arguments);this.filters=[];this.position="bottom-start";this.pullTab=!1;this.open=!1;this.panelExpanded=!1;this._mutationObserver=new Ze(this,{target:null,config:{childList:!0,subtree:!0,attributes:!0},callback:t=>{for(let r of t)if(!(r.type==="attributes"&&(r.attributeName==="hidden"||this.filters.some(n=>n.toggleAttribute===r.attributeName)))){this.scheduleUpdateFilters();break}}});this._updateFiltersScheduled=!1;this._hiddenElements=new Set;this.handleDocumentMouseDown=t=>{if(!this.open)return;let r=this.shadowRoot?.querySelector(".pull-tab");r&&t.composedPath().includes(r)||this.hidePullTab()};this.togglePullTab=()=>{this.open?this.hidePullTab():(this.open=!0,document.addEventListener("mousedown",this.handleDocumentMouseDown,!0),this.emit("zn-show"))};this.handlePanelTransitionEnd=t=>{t.propertyName==="grid-template-rows"&&(this.panelExpanded=this.open)};this.handleContentSlotChange=()=>{this.updateFilters()};this.handleFiltersSlotChange=()=>{this.recomputeFiltersFromSlot(),this.updateFilters()}}connectedCallback(){if(super.connectedCallback(),this._store=new Ur(window.sessionStorage,this.storeKey),this.recomputeFiltersFromSlot(),this.storeKey){let t=this._store.get("filters");if(t){let r=JSON.parse(t);this.filters=this.filters.map(n=>({...n,checked:Object.prototype.hasOwnProperty.call(r,n.attribute)?r[n.attribute]:n.checked}))}}this.updateFilters(),this._mutationObserver.observe(this)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown,!0),super.disconnectedCallback()}hidePullTab(){this.open=!1,this.panelExpanded=!1,document.removeEventListener("mousedown",this.handleDocumentMouseDown,!0),this.emit("zn-hide")}scheduleUpdateFilters(){this._updateFiltersScheduled||(this._updateFiltersScheduled=!0,Promise.resolve().then(()=>{this._updateFiltersScheduled=!1,this.updateFilters()}))}recomputeFiltersFromSlot(){let t=new Map(this.filters.map(a=>[a.attribute,a.checked])),r=this.querySelectorAll('[slot="filter"]'),n=[];r.forEach(a=>{let s=a.getAttribute("attribute");if(!s)return;let l=a.getAttribute("default")==="true",d=t.has(s)?!!t.get(s):l,h=a.textContent||"Unnamed Filter",m=a.getAttribute("item-selector")||"*",f=a.getAttribute("toggle-attribute")||void 0;n.push({attribute:s,checked:d,label:h,itemSelector:m,toggleAttribute:f})}),this.filters=n}updateSingleFilter(t,r){let n,a=t.attribute==="*"?"":`[${t.attribute}]`;t.itemSelector&&t.itemSelector.startsWith(">")?n=nt(t.itemSelector.substring(1)+a,this,""):n=this.querySelectorAll(t.itemSelector+a),n.forEach(s=>{if(t.toggleAttribute){r?s.removeAttribute(t.toggleAttribute):s.setAttribute(t.toggleAttribute,"true");return}r?this.filters.some(d=>{if(d.attribute===t.attribute||d.checked||d.toggleAttribute)return!1;let h=d.attribute==="*"?"":`[${d.attribute}]`,m;return d.itemSelector&&d.itemSelector.startsWith(">")?m=nt(d.itemSelector.substring(1)+h,this,""):m=this.querySelectorAll(d.itemSelector+h),Array.from(m).includes(s)})||(s.removeAttribute("hidden"),this._hiddenElements.delete(s)):(s.setAttribute("hidden","true"),this._hiddenElements.add(s))})}updateFilters(){this._hiddenElements.forEach(t=>t.removeAttribute("hidden")),this._hiddenElements.clear(),this.filters.forEach(t=>{this.updateSingleFilter(t,t.checked)})}updateFilter(t){let r=t.target.getAttribute("data-attribute"),n=t.target.isChecked,a=this.filters.find(s=>s.attribute===r);if(a){if(this.filters=this.filters.map(s=>s.attribute===r?{...s,checked:n}:s),this.storeKey){let s=this.filters.reduce((l,d)=>(l[d.attribute]=d.checked,l),{});this._store.set("filters",JSON.stringify(s))}this.updateSingleFilter(a,n)}}render(){let t="top-start";switch(this.position){case"top-end":t="bottom-end";break;case"top-start":t="bottom-start";break;case"bottom-end":t="top-end";break;case"bottom-start":t="top-start";break}return u`
4336
+ `}};qa.styles=k(f5),c([p()],qa.prototype,"button",2);var OD=qa;qa.define("zn-filter-wrapper");var g5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:contents}.container{padding-bottom:50px}.container--scroll{height:100%;width:100%;overflow:hidden;position:relative}.container--scroll .scroll-content{height:100%;width:100%;overflow:auto;box-sizing:border-box}.setting-container__dropdown{z-index:10;position:absolute;border-radius:50%;width:32px;height:32px;padding:4px;background:rgba(var(--zn-panel,0.8));box-shadow:var(--zn-shadow-small);opacity:0.7;transition-duration:0.3s;transition-property:opacity}.setting-container__dropdown:hover{background:rgba(var(--zn-panel,1))}.setting-container__dropdown--top-end{top:var(--zn-base-gap);right:calc(var(--zn-base-gap) + var(--zn-gutter));bottom:auto}.setting-container__dropdown--top-start{top:var(--zn-base-gap);right:auto;left:calc(var(--zn-base-gap) + var(--zn-gutter));bottom:auto}.setting-container__dropdown--bottom-end{bottom:calc(var(--zn-base-gap) + var(--zn-scroll-footer-height,0px));right:calc(var(--zn-base-gap) + var(--zn-gutter));top:auto}.setting-container__dropdown--bottom-start{bottom:calc(var(--zn-base-gap) + var(--zn-scroll-footer-height,0px));left:calc(var(--zn-base-gap) + var(--zn-gutter));top:auto}.setting-container__dropdown[open],.setting-container__dropdown:hover{opacity:1}.setting-container__toggle-button::part(icon){rotate:0deg;transition:rotate 0.9s ease-in-out,color 0.9s ease-in-out}.setting-container__dropdown[open] .setting-container__toggle-button::part(icon),.setting-container__toggle-button:hover::part(icon){color:rgb(var(--zn-primary));cursor:pointer;rotate:380deg}zn-button{border-radius:var(--zn-border-radius)}.pull-tab{position:absolute;top:0;right:calc(var(--zn-base-gap) + var(--zn-gutter));z-index:20;display:flex;flex-direction:column;align-items:flex-end;max-height:100%}.pull-tab__panel{display:grid;grid-template-rows:0fr;min-height:0;overflow:hidden;background-color:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-top:none;border-bottom-width:0;border-radius:0 0 0 var(--zn-border-radius);transition:grid-template-rows 0.22s ease,border-bottom-width 0s linear 0.22s}.pull-tab--open .pull-tab__panel{grid-template-rows:1fr;border-bottom-width:1px;transition:grid-template-rows 0.22s ease,border-bottom-width 0s linear 0s}.pull-tab__panel-content{min-height:0;overflow:hidden}.pull-tab__panel-content .settings-container__dropdown-content{border:none;box-shadow:none;border-radius:0;margin-bottom:0;max-width:none;width:auto}.pull-tab--expanded .pull-tab__panel-content{overflow-y:auto}.pull-tab__tab{flex-shrink:0;background-color:rgb(var(--zn-panel));color:rgb(var(--zn-text-heading));border:1px solid rgb(var(--zn-border-color));border-top:none;border-radius:0 0 10px 10px;padding:var(--zn-spacing-x-small);cursor:pointer;display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);max-height:36px;overflow:hidden;margin-top:-1px}.pull-tab__tab:hover{background-color:rgb(var(--zn-shadow))}.pull-tab__tab:focus-visible{outline:2px solid rgb(var(--zn-primary));outline-offset:-2px}.settings-container__dropdown-content{display:flex;flex-direction:column;gap:var(--zn-spacing-small);background-color:rgb(var(--zn-panel));padding:var(--zn-spacing-small);box-shadow:var(--zn-shadow-small);border-radius:var(--zn-border-radius);max-width:var(--zn-size-mpanel);width:-moz-fit-content;width:fit-content;z-index:20;border:1px solid rgb(var(--zn-border-color));margin-bottom:10px}`;var Ii=class extends T{constructor(){super(...arguments);this.filters=[];this.position="bottom-start";this.pullTab=!1;this.open=!1;this.panelExpanded=!1;this._mutationObserver=new Ze(this,{target:null,config:{childList:!0,subtree:!0,attributes:!0},callback:t=>{for(let r of t)if(!(r.type==="attributes"&&(r.attributeName==="hidden"||this.filters.some(n=>n.toggleAttribute===r.attributeName)))){this.scheduleUpdateFilters();break}}});this._updateFiltersScheduled=!1;this._hiddenElements=new Set;this.handleDocumentMouseDown=t=>{if(!this.open)return;let r=this.shadowRoot?.querySelector(".pull-tab");r&&t.composedPath().includes(r)||this.hidePullTab()};this.togglePullTab=()=>{this.open?this.hidePullTab():(this.open=!0,document.addEventListener("mousedown",this.handleDocumentMouseDown,!0),this.emit("zn-show"))};this.handlePanelTransitionEnd=t=>{t.propertyName==="grid-template-rows"&&(this.panelExpanded=this.open)};this.handleContentSlotChange=()=>{this.updateFilters()};this.handleFiltersSlotChange=()=>{this.recomputeFiltersFromSlot(),this.updateFilters()}}connectedCallback(){if(super.connectedCallback(),this._store=new Ur(window.sessionStorage,this.storeKey),this.recomputeFiltersFromSlot(),this.storeKey){let t=this._store.get("filters");if(t){let r=JSON.parse(t);this.filters=this.filters.map(n=>({...n,checked:Object.prototype.hasOwnProperty.call(r,n.attribute)?r[n.attribute]:n.checked}))}}this.updateFilters(),this._mutationObserver.observe(this)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown,!0),super.disconnectedCallback()}hidePullTab(){this.open=!1,this.panelExpanded=!1,document.removeEventListener("mousedown",this.handleDocumentMouseDown,!0),this.emit("zn-hide")}scheduleUpdateFilters(){this._updateFiltersScheduled||(this._updateFiltersScheduled=!0,Promise.resolve().then(()=>{this._updateFiltersScheduled=!1,this.updateFilters()}))}recomputeFiltersFromSlot(){let t=new Map(this.filters.map(a=>[a.attribute,a.checked])),r=this.querySelectorAll('[slot="filter"]'),n=[];r.forEach(a=>{let s=a.getAttribute("attribute");if(!s)return;let l=a.getAttribute("default")==="true",d=t.has(s)?!!t.get(s):l,h=a.textContent||"Unnamed Filter",m=a.getAttribute("item-selector")||"*",f=a.getAttribute("toggle-attribute")||void 0;n.push({attribute:s,checked:d,label:h,itemSelector:m,toggleAttribute:f})}),this.filters=n}updateSingleFilter(t,r){let n,a=t.attribute==="*"?"":`[${t.attribute}]`;t.itemSelector&&t.itemSelector.startsWith(">")?n=nt(t.itemSelector.substring(1)+a,this,""):n=this.querySelectorAll(t.itemSelector+a),n.forEach(s=>{if(t.toggleAttribute){r?s.removeAttribute(t.toggleAttribute):s.setAttribute(t.toggleAttribute,"true");return}r?this.filters.some(d=>{if(d.attribute===t.attribute||d.checked||d.toggleAttribute)return!1;let h=d.attribute==="*"?"":`[${d.attribute}]`,m;return d.itemSelector&&d.itemSelector.startsWith(">")?m=nt(d.itemSelector.substring(1)+h,this,""):m=this.querySelectorAll(d.itemSelector+h),Array.from(m).includes(s)})||(s.removeAttribute("hidden"),this._hiddenElements.delete(s)):(s.setAttribute("hidden","true"),this._hiddenElements.add(s))})}updateFilters(){this._hiddenElements.forEach(t=>t.removeAttribute("hidden")),this._hiddenElements.clear(),this.filters.forEach(t=>{this.updateSingleFilter(t,t.checked)})}updateFilter(t){let r=t.target.getAttribute("data-attribute"),n=t.target.isChecked,a=this.filters.find(s=>s.attribute===r);if(a){if(this.filters=this.filters.map(s=>s.attribute===r?{...s,checked:n}:s),this.storeKey){let s=this.filters.reduce((l,d)=>(l[d.attribute]=d.checked,l),{});this._store.set("filters",JSON.stringify(s))}this.updateSingleFilter(a,n)}}render(){let t="top-start";switch(this.position){case"top-end":t="bottom-end";break;case"top-start":t="bottom-start";break;case"bottom-end":t="top-end";break;case"bottom-start":t="top-start";break}return u`
4337
4337
  <div class="${q({container:!0,"container--scroll":!this.noScroll})}">
4338
4338
  <div class="scroll-content">
4339
4339
  <slot @slotchange="${this.handleContentSlotChange}"></slot>
@@ -4370,12 +4370,12 @@ ${xs(this.code(i,t))}
4370
4370
  @zn-change=${this.updateFilter}>
4371
4371
  ${r.label}
4372
4372
  </zn-checkbox>`)}
4373
- </div>`}};Ii.styles=k(g5),c([D()],Ii.prototype,"filters",2),c([p()],Ii.prototype,"position",2),c([p({attribute:"store-key"})],Ii.prototype,"storeKey",2),c([p({attribute:"no-scroll"})],Ii.prototype,"noScroll",2),c([p({attribute:"pull-tab",type:Boolean,reflect:!0})],Ii.prototype,"pullTab",2),c([p({type:Boolean,reflect:!0})],Ii.prototype,"open",2),c([D()],Ii.prototype,"panelExpanded",2);var DD=Ii;Ii.define("zn-settings-container");var b5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}`;var Ra=class extends T{constructor(){super(...arguments);this.attr="filter";this._filterFrame=0}handleSearchChange(t){let r=t.target.value.trim().toLowerCase();cancelAnimationFrame(this._filterFrame),this._filterFrame=requestAnimationFrame(()=>this.applyFilter(r))}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this._filterFrame)}applyFilter(t){let r=`data-${this.attr}`,n=this.querySelectorAll(`[${r}]`),a=new Map,s=new Map,l=!1;n.forEach(h=>{let m=t===""||(h.getAttribute(r)?.toLowerCase()||"").includes(t);Xb(h,m),m&&(l=!0);let f=h.closest("zn-panel");f&&a.set(f,(a.get(f)??!1)||m);let b=h.closest("zn-accordion");b&&s.set(b,(s.get(b)??!1)||m)}),a.forEach((h,m)=>Xb(m,h)),s.forEach((h,m)=>{h&&Xb(m,!0)});let d=this.querySelector(".no-results-message");l?d&&(d.style.display="none"):(d||(d=document.createElement("div"),d.className="no-results-message",d.textContent="No results found",this.appendChild(d)),d.style.display="")}render(){return u`
4373
+ </div>`}};Ii.styles=k(g5),c([D()],Ii.prototype,"filters",2),c([p()],Ii.prototype,"position",2),c([p({attribute:"store-key"})],Ii.prototype,"storeKey",2),c([p({attribute:"no-scroll"})],Ii.prototype,"noScroll",2),c([p({attribute:"pull-tab",type:Boolean,reflect:!0})],Ii.prototype,"pullTab",2),c([p({type:Boolean,reflect:!0})],Ii.prototype,"open",2),c([D()],Ii.prototype,"panelExpanded",2);var ND=Ii;Ii.define("zn-settings-container");var b5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}`;var Ra=class extends T{constructor(){super(...arguments);this.attr="filter";this._filterFrame=0}handleSearchChange(t){let r=t.target.value.trim().toLowerCase();cancelAnimationFrame(this._filterFrame),this._filterFrame=requestAnimationFrame(()=>this.applyFilter(r))}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this._filterFrame)}applyFilter(t){let r=`data-${this.attr}`,n=this.querySelectorAll(`[${r}]`),a=new Map,s=new Map,l=!1;n.forEach(h=>{let m=t===""||(h.getAttribute(r)?.toLowerCase()||"").includes(t);Xb(h,m),m&&(l=!0);let f=h.closest("zn-panel");f&&a.set(f,(a.get(f)??!1)||m);let b=h.closest("zn-accordion");b&&s.set(b,(s.get(b)??!1)||m)}),a.forEach((h,m)=>Xb(m,h)),s.forEach((h,m)=>{h&&Xb(m,!0)});let d=this.querySelector(".no-results-message");l?d&&(d.style.display="none"):(d||(d=document.createElement("div"),d.className="no-results-message",d.textContent="No results found",this.appendChild(d)),d.style.display="")}render(){return u`
4374
4374
  <zn-input placeholder="Filter" clearable type="search" @zn-input=${this.handleSearchChange}
4375
4375
  style="margin-bottom: var(--zn-spacing-small)">
4376
4376
  <zn-icon src="search" slot="prefix"></zn-icon>
4377
4377
  </zn-input>
4378
- <slot></slot> `}};Ra.styles=k(b5),c([p()],Ra.prototype,"attr",2);function Xb(o,i){let t=i?"":"none";o.style.display!==t&&(o.style.display=t)}var OD=Ra;Ra.define("zn-filter-container");var v5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:inline-block}.reveal{display:inline-grid;grid-template-areas:"stack";align-items:center;overflow:hidden}.reveal--clickable{cursor:pointer}.reveal--static{cursor:auto}.reveal__text{grid-area:stack;line-height:inherit;transition:opacity 0.2s ease,transform 0.2s ease;will-change:opacity,transform}.reveal__text--initial{opacity:1;transform:translateY(0)}.reveal__text--revealed{opacity:0;transform:translateY(0.5em)}.reveal--revealed .reveal__text--initial{opacity:0;transform:translateY(-0.5em)}.reveal--revealed .reveal__text--revealed{opacity:1;transform:translateY(0)}`;var zn=class extends T{constructor(){super(...arguments);this.duration=2e3;this.initial="";this.revealed="";this.hideDelay=150;this.noToggle=!1;this._isRevealed=!1;this._isToggled=!1}get _isMasked(){return this.revealed!==""&&this.revealed!==this.initial}disconnectedCallback(){super.disconnectedCallback(),this._clearHideTimer()}_clearHideTimer(){this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}handleToggleReveal(){this.noToggle||(this._clearHideTimer(),this.duration?(this._isRevealed=!0,this._isToggled=!0,this.requestUpdate(),setTimeout(()=>{this._isRevealed=!1,this._isToggled=!1,this.requestUpdate()},this.duration)):(this._isRevealed=!this._isRevealed,this._isToggled=!this._isToggled,this.requestUpdate()))}handleMouseEnter(){this._clearHideTimer(),this._isRevealed=!0,this.requestUpdate()}handleMouseLeave(){this._isToggled||(this._clearHideTimer(),this._hideTimer=setTimeout(()=>{this._hideTimer=void 0,this._isRevealed=!1,this.requestUpdate()},this.hideDelay))}render(){return this._isMasked?u`
4378
+ <slot></slot> `}};Ra.styles=k(b5),c([p()],Ra.prototype,"attr",2);function Xb(o,i){let t=i?"":"none";o.style.display!==t&&(o.style.display=t)}var PD=Ra;Ra.define("zn-filter-container");var v5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:inline-block}.reveal{display:inline-grid;grid-template-areas:"stack";align-items:center;overflow:hidden}.reveal--clickable{cursor:pointer}.reveal--static{cursor:auto}.reveal__text{grid-area:stack;line-height:inherit;transition:opacity 0.2s ease,transform 0.2s ease;will-change:opacity,transform}.reveal__text--initial{opacity:1;transform:translateY(0)}.reveal__text--revealed{opacity:0;transform:translateY(0.5em)}.reveal--revealed .reveal__text--initial{opacity:0;transform:translateY(-0.5em)}.reveal--revealed .reveal__text--revealed{opacity:1;transform:translateY(0)}`;var zn=class extends T{constructor(){super(...arguments);this.duration=2e3;this.initial="";this.revealed="";this.hideDelay=150;this.noToggle=!1;this._isRevealed=!1;this._isToggled=!1}get _isMasked(){return this.revealed!==""&&this.revealed!==this.initial}disconnectedCallback(){super.disconnectedCallback(),this._clearHideTimer()}_clearHideTimer(){this._hideTimer&&(clearTimeout(this._hideTimer),this._hideTimer=void 0)}handleToggleReveal(){this.noToggle||(this._clearHideTimer(),this.duration?(this._isRevealed=!0,this._isToggled=!0,this.requestUpdate(),setTimeout(()=>{this._isRevealed=!1,this._isToggled=!1,this.requestUpdate()},this.duration)):(this._isRevealed=!this._isRevealed,this._isToggled=!this._isToggled,this.requestUpdate()))}handleMouseEnter(){this._clearHideTimer(),this._isRevealed=!0,this.requestUpdate()}handleMouseLeave(){this._isToggled||(this._clearHideTimer(),this._hideTimer=setTimeout(()=>{this._hideTimer=void 0,this._isRevealed=!1,this.requestUpdate()},this.hideDelay))}render(){return this._isMasked?u`
4379
4379
  <div part="base"
4380
4380
  class=${q({reveal:!0,"reveal--clickable":!this.noToggle,"reveal--revealed":this._isRevealed,"reveal--toggled":this._isToggled})}
4381
4381
  @click="${this.handleToggleReveal}"
@@ -4388,7 +4388,7 @@ ${xs(this.code(i,t))}
4388
4388
  <div part="base" class="reveal reveal--static">
4389
4389
  <span class="reveal__text">${this.initial||this.revealed}</span>
4390
4390
  </div>
4391
- `}};zn.styles=k(v5),c([p({type:Number})],zn.prototype,"duration",2),c([p()],zn.prototype,"initial",2),c([p()],zn.prototype,"revealed",2),c([p({type:Number,attribute:"hide-delay"})],zn.prototype,"hideDelay",2),c([p({type:Boolean,attribute:"no-toggle"})],zn.prototype,"noToggle",2);var ND=zn;zn.define("zn-reveal");var y5=S`:host{display:block;width:100%}`;var kn=class extends T{constructor(){super();this._isPlaying=!1;this.value="";this.label="";this.placeholder="";this.files=[];this._audio=new Audio,this._audio.addEventListener("ended",()=>{this._isPlaying=!1,this._audio.currentTime=0})}disconnectedCallback(){super.disconnectedCallback(),this.stopAudio()}updated(t){super.updated(t),t.has("value")&&(this.stopAudio(),this.value&&(this._audio.src=this.value))}stopAudio(){this._audio&&(this._audio.pause(),this._audio.currentTime=0),this._isPlaying=!1}handleSelectChange(t){t.target===t.currentTarget&&(this.value=t.target.value)}togglePreview(t){if(t.stopPropagation(),!this.value){t.preventDefault(),this._isPlaying=!1,this.requestUpdate();return}this._isPlaying?(this._audio.pause(),this._isPlaying=!1):this._audio.play().then(()=>{this._isPlaying=!0}).catch(r=>{console.error("Audio playback failed:",r),this._isPlaying=!1,this.requestUpdate()})}render(){return u`
4391
+ `}};zn.styles=k(v5),c([p({type:Number})],zn.prototype,"duration",2),c([p()],zn.prototype,"initial",2),c([p()],zn.prototype,"revealed",2),c([p({type:Number,attribute:"hide-delay"})],zn.prototype,"hideDelay",2),c([p({type:Boolean,attribute:"no-toggle"})],zn.prototype,"noToggle",2);var HD=zn;zn.define("zn-reveal");var y5=S`:host{display:block;width:100%}`;var kn=class extends T{constructor(){super();this._isPlaying=!1;this.value="";this.label="";this.placeholder="";this.files=[];this._audio=new Audio,this._audio.addEventListener("ended",()=>{this._isPlaying=!1,this._audio.currentTime=0})}disconnectedCallback(){super.disconnectedCallback(),this.stopAudio()}updated(t){super.updated(t),t.has("value")&&(this.stopAudio(),this.value&&(this._audio.src=this.value))}stopAudio(){this._audio&&(this._audio.pause(),this._audio.currentTime=0),this._isPlaying=!1}handleSelectChange(t){t.target===t.currentTarget&&(this.value=t.target.value)}togglePreview(t){if(t.stopPropagation(),!this.value){t.preventDefault(),this._isPlaying=!1,this.requestUpdate();return}this._isPlaying?(this._audio.pause(),this._isPlaying=!1):this._audio.play().then(()=>{this._isPlaying=!0}).catch(r=>{console.error("Audio playback failed:",r),this._isPlaying=!1,this.requestUpdate()})}render(){return u`
4392
4392
  <zn-select
4393
4393
  label="${this.label}"
4394
4394
  value="${this.value}"
@@ -4408,7 +4408,7 @@ ${xs(this.code(i,t))}
4408
4408
  <zn-option value="${t.url}">${t.name}</zn-option>
4409
4409
  `)}
4410
4410
  </zn-select>
4411
- `}};kn.styles=k(y5),c([D()],kn.prototype,"_isPlaying",2),c([p()],kn.prototype,"value",2),c([p()],kn.prototype,"label",2),c([p()],kn.prototype,"placeholder",2),c([p({type:Object})],kn.prototype,"files",2);var PD=kn;kn.define("zn-audio-select");var x5=Mt(class extends xr{constructor(){super(...arguments),this.key=V}render(o,i){return this.key=o,i}update(o,[i,t]){return i!==this.key&&(Ys(o),this.key=i),t}});var Qb=[{id:"text",label:"Text"},{id:"inline",label:"Inline"},{id:"lists",label:"Lists"},{id:"admonitions",label:"Alerts"},{id:"blocks",label:"Blocks"},{id:"structured",label:"Structured"},{id:"media",label:"Media"},{id:"objects",label:"Objects"},{id:"breaks",label:"Breaks"},{id:"logic",label:"Logic"}],Uu=[{key:"text",label:"Text",icon:"text@lu",group:"text",prefix:""},{key:"paragraphs",label:"Paragraph",icon:"pilcrow@lu",group:"text",prefix:""},{key:"heading",label:"Heading 1",icon:"heading-1@lu",group:"text",prefix:"# "},{key:"h2",label:"Heading 2",icon:"heading-2@lu",group:"text",prefix:"## "},{key:"h3",label:"Heading 3",icon:"heading-3@lu",group:"text",prefix:"### "},{key:"asciidoc-section",label:"Section",icon:"section@lu",group:"text",prefix:"== "},{key:"attributes-title",label:"Title",icon:"captions@lu",group:"text",prefix:"."},{key:"unordered-list",label:"Bullet list",icon:"list@lu",group:"lists",prefix:"- ",keywords:["bullet","ul"]},{key:"ordered-list",label:"Numbered list",icon:"list-ordered@lu",group:"lists",prefix:"1. ",keywords:["ol"]},{key:"checkboxes",label:"Checklist",icon:"list-todo@lu",group:"lists",prefix:"- [ ] ",keywords:["task","todo"]},{key:"definition-list",label:"Definition list",icon:"book-a@lu",group:"lists",prefix:"Term:: Definition"},{key:"admonition",label:"Note",icon:"info@lu",group:"admonitions",prefix:"NOTE: "},{key:"tip",label:"Tip",icon:"lightbulb@lu",group:"admonitions",prefix:"TIP: "},{key:"warning",label:"Warning",icon:"triangle-alert@lu",group:"admonitions",prefix:"WARNING: "},{key:"important",label:"Important",icon:"circle-alert@lu",group:"admonitions",prefix:"IMPORTANT: "},{key:"caution",label:"Caution",icon:"shield-alert@lu",group:"admonitions",prefix:"CAUTION: "},{key:"danger",label:"Danger",icon:"octagon-alert@lu",group:"admonitions",prefix:"DANGER: "},{key:"success",label:"Success",icon:"circle-check@lu",group:"admonitions",prefix:"SUCCESS: "},{key:"notice",label:"Notice",icon:"megaphone@lu",group:"admonitions",prefix:"NOTICE: "},{key:"code-fence",label:"Code",icon:"code@lu",group:"blocks",prefix:"```\n\n```",caretOffset:4},{key:"blockquotes",label:"Quote",icon:"quote@lu",group:"blocks",prefix:`____
4411
+ `}};kn.styles=k(y5),c([D()],kn.prototype,"_isPlaying",2),c([p()],kn.prototype,"value",2),c([p()],kn.prototype,"label",2),c([p()],kn.prototype,"placeholder",2),c([p({type:Object})],kn.prototype,"files",2);var FD=kn;kn.define("zn-audio-select");var x5=Mt(class extends xr{constructor(){super(...arguments),this.key=V}render(o,i){return this.key=o,i}update(o,[i,t]){return i!==this.key&&(Ys(o),this.key=i),t}});var Qb=[{id:"text",label:"Text"},{id:"inline",label:"Inline"},{id:"lists",label:"Lists"},{id:"admonitions",label:"Alerts"},{id:"blocks",label:"Blocks"},{id:"structured",label:"Structured"},{id:"media",label:"Media"},{id:"objects",label:"Objects"},{id:"breaks",label:"Breaks"},{id:"logic",label:"Logic"}],Uu=[{key:"text",label:"Text",icon:"text@lu",group:"text",prefix:""},{key:"paragraphs",label:"Paragraph",icon:"pilcrow@lu",group:"text",prefix:""},{key:"heading",label:"Heading 1",icon:"heading-1@lu",group:"text",prefix:"# "},{key:"h2",label:"Heading 2",icon:"heading-2@lu",group:"text",prefix:"## "},{key:"h3",label:"Heading 3",icon:"heading-3@lu",group:"text",prefix:"### "},{key:"asciidoc-section",label:"Section",icon:"section@lu",group:"text",prefix:"== "},{key:"attributes-title",label:"Title",icon:"captions@lu",group:"text",prefix:"."},{key:"unordered-list",label:"Bullet list",icon:"list@lu",group:"lists",prefix:"- ",keywords:["bullet","ul"]},{key:"ordered-list",label:"Numbered list",icon:"list-ordered@lu",group:"lists",prefix:"1. ",keywords:["ol"]},{key:"checkboxes",label:"Checklist",icon:"list-todo@lu",group:"lists",prefix:"- [ ] ",keywords:["task","todo"]},{key:"definition-list",label:"Definition list",icon:"book-a@lu",group:"lists",prefix:"Term:: Definition"},{key:"admonition",label:"Note",icon:"info@lu",group:"admonitions",prefix:"NOTE: "},{key:"tip",label:"Tip",icon:"lightbulb@lu",group:"admonitions",prefix:"TIP: "},{key:"warning",label:"Warning",icon:"triangle-alert@lu",group:"admonitions",prefix:"WARNING: "},{key:"important",label:"Important",icon:"circle-alert@lu",group:"admonitions",prefix:"IMPORTANT: "},{key:"caution",label:"Caution",icon:"shield-alert@lu",group:"admonitions",prefix:"CAUTION: "},{key:"danger",label:"Danger",icon:"octagon-alert@lu",group:"admonitions",prefix:"DANGER: "},{key:"success",label:"Success",icon:"circle-check@lu",group:"admonitions",prefix:"SUCCESS: "},{key:"notice",label:"Notice",icon:"megaphone@lu",group:"admonitions",prefix:"NOTICE: "},{key:"code-fence",label:"Code",icon:"code@lu",group:"blocks",prefix:"```\n\n```",caretOffset:4},{key:"blockquotes",label:"Quote",icon:"quote@lu",group:"blocks",prefix:`____
4412
4412
 
4413
4413
  ____`,caretOffset:5},{key:"verse",label:"Verse",icon:"feather@lu",group:"blocks",prefix:`[verse]
4414
4414
  ____
@@ -4432,62 +4432,62 @@ endif::[]`,caretOffset:7},{key:"ifndef",label:"If not defined",icon:"git-branch-
4432
4432
 
4433
4433
  endif::[]`,caretOffset:8},{key:"iftrue",label:"If true",icon:"toggle-right@lu",group:"logic",prefix:"iftrue::flag[Shown]",caretOffset:8},{key:"iffalse",label:"If false",icon:"toggle-left@lu",group:"logic",prefix:"iffalse::flag[Shown]",caretOffset:9},{key:"ifempty",label:"If empty",icon:"square@lu",group:"logic",prefix:"ifempty::flag[Shown]",caretOffset:9},{key:"ifnempty",label:"If not empty",icon:"square-check@lu",group:"logic",prefix:"ifnempty::flag[Shown]",caretOffset:10},{key:"ifeval",label:"If expression",icon:"equal@lu",group:"logic",prefix:`ifeval::[1 > 0]
4434
4434
 
4435
- endif::[]`,caretOffset:9},{key:"inline-formatting",label:"Strong",icon:"bold@lu",group:"inline",keywords:["bold"],inline:{before:"**",placeholder:"text"},shortcut:{key:"b"}},{key:"emphasis",label:"Emphasis",icon:"italic@lu",group:"inline",keywords:["italic"],inline:{before:"__",placeholder:"text"},shortcut:{key:"i"}},{key:"inline-code",label:"Code",icon:"square-code@lu",group:"inline",inline:{before:"`",placeholder:"code"},shortcut:{key:"e"}},{key:"underline",label:"Underline",icon:"underline@lu",group:"inline",inline:{before:"___",placeholder:"text"},shortcut:{key:"u"}},{key:"strike",label:"Strikethrough",icon:"strikethrough@lu",group:"inline",keywords:["delete"],inline:{before:"~~",placeholder:"text"},shortcut:{key:"x",shift:!0}},{key:"subscript",label:"Subscript",icon:"subscript@lu",group:"inline",inline:{before:"~",placeholder:"2"},shortcut:{key:","}},{key:"superscript",label:"Superscript",icon:"superscript@lu",group:"inline",inline:{before:"^",placeholder:"2"},shortcut:{key:"."}},{key:"keyboard",label:"Keyboard",icon:"keyboard@lu",group:"inline",keywords:["kbd","shortcut"],inline:{before:"kbd:[",after:"]",placeholder:"Ctrl+C"}},{key:"footnote",label:"Footnote",icon:"asterisk@lu",group:"inline",inline:{before:"footnote:[",after:"]",placeholder:"Note"}},{key:"tooltip",label:"Tooltip",icon:"message-circle-question-mark@lu",group:"inline",keywords:["term"],inline:{before:"{",after:"}(Explanation)",placeholder:"Term"}},{key:"cross-reference",label:"Cross reference",icon:"link-2@lu",group:"inline",keywords:["xref"],inline:{before:"<<",after:">>",placeholder:"section,Label"}},{key:"links-and-images",label:"Link",icon:"link@lu",group:"inline",inline:{before:"[",after:"](https://)",placeholder:"Label"},shortcut:{key:"k"}},{key:"document-link",label:"Link to article",icon:"file-symlink@lu",group:"inline",keywords:["article","document","kb"],opens:"link",shortcut:{key:"k",shift:!0}},{key:"passthrough",label:"Passthrough",icon:"shield@lu",group:"inline",keywords:["raw","literal"],inline:{before:"pass:[",after:"]",placeholder:"raw"}},{key:"curly-bang-passthrough",label:"Literal braces",icon:"braces@lu",group:"inline",inline:{before:"{!",after:"!}",placeholder:"raw"}}];function w5(){let o=navigator.userAgentData?.platform??navigator.userAgent;return/mac|iphone|ipad|ipod/i.test(o)}function _5(o,i){return(w5()?o.metaKey&&!o.ctrlKey:o.ctrlKey&&!o.metaKey)&&!o.altKey&&o.shiftKey===!!i.shift&&o.key.toLowerCase()===i.key}function Jb(o){let i=o.key.toUpperCase();return w5()?`\u2318${o.shift?"\u21E7":""}${i}`:`Ctrl+${o.shift?"Shift+":""}${i}`}function z5(o){let i=t=>Qb.find(r=>r.id===t)?.label;return o.map(t=>{if(t.opens)return{label:t.label,icon:t.icon,action:t.opens,group:i(t.group),keywords:t.keywords};let{before:r,after:n=r,placeholder:a=""}=t.inline??{before:t.prefix??""};return{label:t.label,icon:t.icon,group:i(t.group),keywords:t.keywords,value:t.inline?r+a+n:r,caretOffset:t.inline?r.length:t.caretOffset}})}var jd=/^(-+|\*+|((?:\d+\.)+)) (\[[ xX_*]\] )?/,k5=/^(?:\d+\.)+(?= )/,HD=/^[^:\s][^\n]*?::(?: |$)/,FD=/^(?:`{3,}|-{4,} *$|\.{4,} *$)/;function S5(o){return o.split(`
4436
- `).filter(i=>FD.test(i)).length%2===1}function BD(o){return o==="[_] "||o==="[*] "?"[_] ":"[ ] "}function Zb(o){if(o.trim()==="::")return!0;let i=jd.exec(o);return!!i&&o.slice(i[0].length).trim()===""}function ev(o,i,t){if(i!==t)return null;let r=o.lastIndexOf(`
4435
+ endif::[]`,caretOffset:9},{key:"inline-formatting",label:"Strong",icon:"bold@lu",group:"inline",keywords:["bold"],inline:{before:"**",placeholder:"text"},shortcut:{key:"b"}},{key:"emphasis",label:"Emphasis",icon:"italic@lu",group:"inline",keywords:["italic"],inline:{before:"__",placeholder:"text"},shortcut:{key:"i"}},{key:"inline-code",label:"Code",icon:"square-code@lu",group:"inline",inline:{before:"`",placeholder:"code"},shortcut:{key:"e"}},{key:"underline",label:"Underline",icon:"underline@lu",group:"inline",inline:{before:"___",placeholder:"text"},shortcut:{key:"u"}},{key:"strike",label:"Strikethrough",icon:"strikethrough@lu",group:"inline",keywords:["delete"],inline:{before:"~~",placeholder:"text"},shortcut:{key:"x",shift:!0}},{key:"subscript",label:"Subscript",icon:"subscript@lu",group:"inline",inline:{before:"~",placeholder:"2"},shortcut:{key:","}},{key:"superscript",label:"Superscript",icon:"superscript@lu",group:"inline",inline:{before:"^",placeholder:"2"},shortcut:{key:"."}},{key:"keyboard",label:"Keyboard",icon:"keyboard@lu",group:"inline",keywords:["kbd","shortcut"],inline:{before:"kbd:[",after:"]",placeholder:"Ctrl+C"}},{key:"footnote",label:"Footnote",icon:"asterisk@lu",group:"inline",inline:{before:"footnote:[",after:"]",placeholder:"Note"}},{key:"tooltip",label:"Tooltip",icon:"message-circle-question-mark@lu",group:"inline",keywords:["term"],inline:{before:"{",after:"}(Explanation)",placeholder:"Term"}},{key:"cross-reference",label:"Cross reference",icon:"link-2@lu",group:"inline",keywords:["xref"],inline:{before:"<<",after:">>",placeholder:"section,Label"}},{key:"links-and-images",label:"Link",icon:"link@lu",group:"inline",inline:{before:"[",after:"](https://)",placeholder:"Label"},shortcut:{key:"k"}},{key:"document-link",label:"Link to article",icon:"file-symlink@lu",group:"inline",keywords:["article","document","kb"],opens:"link",shortcut:{key:"k",shift:!0}},{key:"passthrough",label:"Passthrough",icon:"shield@lu",group:"inline",keywords:["raw","literal"],inline:{before:"pass:[",after:"]",placeholder:"raw"}},{key:"curly-bang-passthrough",label:"Literal braces",icon:"braces@lu",group:"inline",inline:{before:"{!",after:"!}",placeholder:"raw"}}];function w5(){let o=navigator.userAgentData?.platform??navigator.userAgent;return/mac|iphone|ipad|ipod/i.test(o)}function _5(o,i){return(w5()?o.metaKey&&!o.ctrlKey:o.ctrlKey&&!o.metaKey)&&!o.altKey&&o.shiftKey===!!i.shift&&o.key.toLowerCase()===i.key}function Jb(o){let i=o.key.toUpperCase();return w5()?`\u2318${o.shift?"\u21E7":""}${i}`:`Ctrl+${o.shift?"Shift+":""}${i}`}function z5(o){let i=t=>Qb.find(r=>r.id===t)?.label;return o.map(t=>{if(t.opens)return{label:t.label,icon:t.icon,action:t.opens,group:i(t.group),keywords:t.keywords};let{before:r,after:n=r,placeholder:a=""}=t.inline??{before:t.prefix??""};return{label:t.label,icon:t.icon,group:i(t.group),keywords:t.keywords,value:t.inline?r+a+n:r,caretOffset:t.inline?r.length:t.caretOffset}})}var jd=/^(-+|\*+|((?:\d+\.)+)) (\[[ xX_*]\] )?/,k5=/^(?:\d+\.)+(?= )/,BD=/^[^:\s][^\n]*?::(?: |$)/,VD=/^(?:`{3,}|-{4,} *$|\.{4,} *$)/;function S5(o){return o.split(`
4436
+ `).filter(i=>VD.test(i)).length%2===1}function UD(o){return o==="[_] "||o==="[*] "?"[_] ":"[ ] "}function Zb(o){if(o.trim()==="::")return!0;let i=jd.exec(o);return!!i&&o.slice(i[0].length).trim()===""}function ev(o,i,t){if(i!==t)return null;let r=o.lastIndexOf(`
4437
4437
  `,i-1)+1,n=o.indexOf(`
4438
- `,i),a=n===-1?o.length:n,s=o.slice(r,a);if(S5(o.slice(0,r)))return null;if(Zb(s))return{value:o.slice(0,r)+o.slice(a),caret:r};let l=jd.exec(s),d=l?null:HD.exec(s),h=l?.[0]??d?.[0];if(!h||i-r<h.length)return null;if(d)return{value:`${o.slice(0,i)}
4439
- :: ${o.slice(i).replace(/^ +/,"")}`,caret:i+1};let[,m,f,b]=l,g=f?ju(f):null,v=g&&C5(g,g.length),y=(v?tv(v):m)+" "+(b?BD(b):""),_=`${o.slice(0,i)}
4438
+ `,i),a=n===-1?o.length:n,s=o.slice(r,a);if(S5(o.slice(0,r)))return null;if(Zb(s))return{value:o.slice(0,r)+o.slice(a),caret:r};let l=jd.exec(s),d=l?null:BD.exec(s),h=l?.[0]??d?.[0];if(!h||i-r<h.length)return null;if(d)return{value:`${o.slice(0,i)}
4439
+ :: ${o.slice(i).replace(/^ +/,"")}`,caret:i+1};let[,m,f,b]=l,g=f?ju(f):null,v=g&&C5(g,g.length),y=(v?tv(v):m)+" "+(b?UD(b):""),_=`${o.slice(0,i)}
4440
4440
  ${y}`,E=_+o.slice(i).replace(/^ +/,"");if(!v)return{value:E,caret:_.length};let N=E.split(`
4441
4441
  `);return T5(N,_.split(`
4442
4442
  `).length),{value:N.join(`
4443
- `),caret:_.length}}function ju(o){return o.split(".").filter(Boolean).map(Number)}function tv(o){return o.map(i=>`${i}.`).join("")}function C5(o,i){return i<=o.length?[...o.slice(0,i-1),o[i-1]+1]:[...o,...Array(i-o.length).fill(1)]}function E5(o,i){for(let t=i-1;t>=0;t--){let r=jd.exec(o[t]);if(!r)return null;if(r[2])return ju(r[2])}return null}function T5(o,i){let t=E5(o,i);for(let r=i;r<o.length;r++){let n=jd.exec(o[r]);if(!n)break;if(!n[2])continue;let a=ju(n[2]);t=t?C5(t,a.length):a,o[r]=o[r].replace(k5,tv(t))}}var VD=10;function rv(o,i,t,r){let n=o.lastIndexOf(`
4443
+ `),caret:_.length}}function ju(o){return o.split(".").filter(Boolean).map(Number)}function tv(o){return o.map(i=>`${i}.`).join("")}function C5(o,i){return i<=o.length?[...o.slice(0,i-1),o[i-1]+1]:[...o,...Array(i-o.length).fill(1)]}function E5(o,i){for(let t=i-1;t>=0;t--){let r=jd.exec(o[t]);if(!r)return null;if(r[2])return ju(r[2])}return null}function T5(o,i){let t=E5(o,i);for(let r=i;r<o.length;r++){let n=jd.exec(o[r]);if(!n)break;if(!n[2])continue;let a=ju(n[2]);t=t?C5(t,a.length):a,o[r]=o[r].replace(k5,tv(t))}}var jD=10;function rv(o,i,t,r){let n=o.lastIndexOf(`
4444
4444
  `,i-1)+1;if(S5(o.slice(0,n)))return null;let a=t>i&&o[t-1]===`
4445
4445
  `?t-1:t,s=o.split(`
4446
4446
  `),l=[...s],d=o.slice(0,n).split(`
4447
4447
  `).length-1,h=o.slice(0,a).split(`
4448
- `).length-1,m=!1,f=-1;for(let g=d;g<=h;g++){let v=jd.exec(l[g]);if(!v)continue;m=!0;let[,y,_]=v;if(_){let E=ju(_),N=(E5(l,g)?.length??0)+1;if(r?E.length===1:E.length>=N)continue;l[g]=l[g].replace(k5,tv(r?E.slice(0,-1):[...E,1])),f===-1&&(f=g)}else(r?y.length>1:y.length<VD)&&(l[g]=r?l[g].slice(1):y[0]+l[g])}if(!m)return null;f!==-1&&T5(l,f);let b=g=>{let v=0,y=0;for(let _=0;_<s.length;_++){let E=v+s[_].length;if(g<=E){let N=l[_].length-s[_].length;return g>v?Math.max(y,g+(y-v)+N):y}v=E+1,y+=l[_].length+1}return g};return{value:l.join(`
4449
- `),start:b(i),end:b(t)}}var iv=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DD","DIV","DL","DT","FIGCAPTION","FIGURE","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","UL"]),L5=new Set(["HEAD","META","LINK","SCRIPT","STYLE","TEMPLATE","TITLE","NOSCRIPT"]),UD='ul, ol, h1, h2, h3, h4, h5, h6, table, blockquote, pre, hr, b, strong, i, em, u, s, strike, del, code, a[href], [style*="font-weight"], [style*="italic"], [style*="line-through"], [style*="mso-list"]',jD=/mso-list:\s*l\d+\s+level(\d+)/i,M5='span[style*="mso-list:Ignore" i], span[style*="mso-list: Ignore" i]',GD=/^\s*(\d+|[a-z]{1,4})[.)]/i,$5=/^([ \t]*)[•◦▪▫●○■□·‣⁃]\s+/,WD={strong:"**",emphasis:"__",underline:"___",strike:"~~",code:"`"};function I5(o){if(!o||o.types.includes("vscode-editor-data"))return null;let i=o.getData("text/html");return(i?KD(i):null)??YD(o.getData("text/plain"))}function KD(o){let i=new DOMParser().parseFromString(o,"text/html").body;return i.querySelector(UD)&&XD(ov(i).join(`
4448
+ `).length-1,m=!1,f=-1;for(let g=d;g<=h;g++){let v=jd.exec(l[g]);if(!v)continue;m=!0;let[,y,_]=v;if(_){let E=ju(_),N=(E5(l,g)?.length??0)+1;if(r?E.length===1:E.length>=N)continue;l[g]=l[g].replace(k5,tv(r?E.slice(0,-1):[...E,1])),f===-1&&(f=g)}else(r?y.length>1:y.length<jD)&&(l[g]=r?l[g].slice(1):y[0]+l[g])}if(!m)return null;f!==-1&&T5(l,f);let b=g=>{let v=0,y=0;for(let _=0;_<s.length;_++){let E=v+s[_].length;if(g<=E){let N=l[_].length-s[_].length;return g>v?Math.max(y,g+(y-v)+N):y}v=E+1,y+=l[_].length+1}return g};return{value:l.join(`
4449
+ `),start:b(i),end:b(t)}}var iv=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DD","DIV","DL","DT","FIGCAPTION","FIGURE","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","UL"]),L5=new Set(["HEAD","META","LINK","SCRIPT","STYLE","TEMPLATE","TITLE","NOSCRIPT"]),GD='ul, ol, h1, h2, h3, h4, h5, h6, table, blockquote, pre, hr, b, strong, i, em, u, s, strike, del, code, a[href], [style*="font-weight"], [style*="italic"], [style*="line-through"], [style*="mso-list"]',WD=/mso-list:\s*l\d+\s+level(\d+)/i,M5='span[style*="mso-list:Ignore" i], span[style*="mso-list: Ignore" i]',KD=/^\s*(\d+|[a-z]{1,4})[.)]/i,$5=/^([ \t]*)[•◦▪▫●○■□·‣⁃]\s+/,YD={strong:"**",emphasis:"__",underline:"___",strike:"~~",code:"`"};function I5(o){if(!o||o.types.includes("vscode-editor-data"))return null;let i=o.getData("text/html");return(i?XD(i):null)??QD(o.getData("text/plain"))}function XD(o){let i=new DOMParser().parseFromString(o,"text/html").body;return i.querySelector(GD)&&JD(ov(i).join(`
4450
4450
 
4451
- `))||null}function YD(o){return!o||!o.split(`
4451
+ `))||null}function QD(o){return!o||!o.split(`
4452
4452
  `).some(i=>$5.test(i))?null:o.replace(/\r\n?/g,`
4453
4453
  `).split(`
4454
4454
  `).map(i=>i.replace($5,(t,r)=>"-".repeat(1+Math.min(9,Math.floor(r.replace(/\t/g," ").length/2)))+" ")).join(`
4455
- `)}function XD(o){return o.replace(/[ \t]+$/gm,"").replace(/\n{3,}/g,`
4455
+ `)}function JD(o){return o.replace(/[ \t]+$/gm,"").replace(/\n{3,}/g,`
4456
4456
 
4457
- `).trim()}function QD(o){return o instanceof HTMLElement&&(iv.has(o.tagName)||!!o.querySelector([...iv].join(",")))}function nv(o){let i=jD.exec(o.getAttribute("style")??"");return i?Number(i[1]):null}function ov(o){let i=[],t=[],r=()=>{let a=ZD(t);a&&i.push(a),t=[]},n=Array.from(o.childNodes);for(let a=0;a<n.length;a++){let s=n[a];if(!(s instanceof Element&&L5.has(s.tagName))){if(s instanceof Element&&nv(s)!==null){r();let l=[];for(;a<n.length;){let d=n[a];if(d instanceof Element&&nv(d)!==null)l.push(d);else if(!(d.nodeType===Node.TEXT_NODE&&!d.textContent.trim()))break;a++}a--,i.push(tO(l));continue}if(!QD(s)){t.push(s);continue}r(),i.push(...JD(s))}}return r(),i.filter(Boolean)}function JD(o){let i=o.tagName;if(/^H[1-6]$/.test(i)){let t=Wu(Zl(o,new Set(["strong"])));return t?[`${"#".repeat(Number(i[1]))} ${t}`]:[]}if(i==="UL"||i==="OL")return[av(o,0,[]).join(`
4457
+ `).trim()}function ZD(o){return o instanceof HTMLElement&&(iv.has(o.tagName)||!!o.querySelector([...iv].join(",")))}function nv(o){let i=WD.exec(o.getAttribute("style")??"");return i?Number(i[1]):null}function ov(o){let i=[],t=[],r=()=>{let a=tO(t);a&&i.push(a),t=[]},n=Array.from(o.childNodes);for(let a=0;a<n.length;a++){let s=n[a];if(!(s instanceof Element&&L5.has(s.tagName))){if(s instanceof Element&&nv(s)!==null){r();let l=[];for(;a<n.length;){let d=n[a];if(d instanceof Element&&nv(d)!==null)l.push(d);else if(!(d.nodeType===Node.TEXT_NODE&&!d.textContent.trim()))break;a++}a--,i.push(iO(l));continue}if(!ZD(s)){t.push(s);continue}r(),i.push(...eO(s))}}return r(),i.filter(Boolean)}function eO(o){let i=o.tagName;if(/^H[1-6]$/.test(i)){let t=Wu(Zl(o,new Set(["strong"])));return t?[`${"#".repeat(Number(i[1]))} ${t}`]:[]}if(i==="UL"||i==="OL")return[av(o,0,[]).join(`
4458
4458
  `)];if(i==="HR")return["---"];if(i==="PRE"){let t=(o.textContent??"").replace(/\n$/,"");return t.trim()?["```\n"+t+"\n```"]:[]}if(i==="BLOCKQUOTE"){let t=ov(o);return t.length?[`____
4459
4459
  ${t.join(`
4460
4460
 
4461
4461
  `)}
4462
- ____`]:[]}return i==="TABLE"?[rO(o)]:ov(o)}function ZD(o){return o.map(i=>Zl(i)).join("").split(`
4462
+ ____`]:[]}return i==="TABLE"?[nO(o)]:ov(o)}function tO(o){return o.map(i=>Zl(i)).join("").split(`
4463
4463
  `).map(i=>i.replace(/\s+/g," ").trim()).filter(Boolean).join(`
4464
- `)}function Wu(o){return o.replace(/\s+/g," ").trim()}function eO(o){let i=[],t=o.tagName,r=o.style.fontWeight,n=o.style.textDecorationLine||o.style.textDecoration,a=r==="normal"||Number(r)>0&&Number(r)<600;return((t==="B"||t==="STRONG")&&!a||r==="bold"||Number(r)>=600)&&i.push("strong"),((t==="I"||t==="EM")&&o.style.fontStyle!=="normal"||o.style.fontStyle==="italic")&&i.push("emphasis"),(t==="U"||n.includes("underline"))&&i.push("underline"),(t==="S"||t==="STRIKE"||t==="DEL"||n.includes("line-through"))&&i.push("strike"),(t==="CODE"||t==="KBD"||t==="TT"||t==="SAMP")&&i.push("code"),i}function Gu(o,i,t=i){let[,r,n,a]=/^(\s*)([\s\S]*?)(\s*)$/.exec(o);return n?`${r}${i}${n}${t}${a}`:o}function A5(o){return o&&/^(https?:|mailto:|tel:)/i.test(o)?o:null}function Zl(o,i=new Set){if(o.nodeType===Node.TEXT_NODE)return(o.textContent??"").replace(/[ \t\r\n\f]+/g," ");if(!(o instanceof HTMLElement)||L5.has(o.tagName)||o.matches(M5))return"";if(o.tagName==="BR")return`
4465
- `;if(o.tagName==="IMG"){let s=A5(o.getAttribute("src"));return s?`![${o.getAttribute("alt")??""}](${s})`:""}if(o.tagName==="INPUT"&&o.type==="checkbox")return o.checked?"[x] ":"[ ] ";let t=eO(o).filter(s=>!i.has(s)),r=t.includes("code")?(o.textContent??"").replace(/\s+/g," "):Array.from(o.childNodes).map(s=>Zl(s,new Set([...i,...t]))).join(""),n=iv.has(o.tagName)?` ${r} `:r;for(let s of t)n=Gu(n,WD[s]);o.tagName==="SUP"&&(n=Gu(n,"^")),o.tagName==="SUB"&&(n=Gu(n,"~"));let a=o.tagName==="A"?A5(o.getAttribute("href")):null;return a&&n.trim()?Gu(n.replace(/\n/g," "),"[",`](${a})`):n}function av(o,i,t){let r=o.tagName==="OL",n=r?i:i+1,a=[],s=r?Number(o.getAttribute("start")??1)-1:0;for(let l of Array.from(o.children)){if(l.tagName==="UL"||l.tagName==="OL"){a.push(...av(l,n,r?[...t,Math.max(s,1)]:t));continue}if(l.tagName!=="LI")continue;s++;let d=r?[...t,s]:t,h=Array.from(l.children).filter(f=>f.tagName==="UL"||f.tagName==="OL"),m=Wu(Array.from(l.childNodes).filter(f=>!h.includes(f)).map(f=>Zl(f)).join(""));if(m){let f=r?d.map(b=>`${b}.`).join(""):"-".repeat(Math.min(n,10));a.push(`${f} ${m}`)}for(let f of h)a.push(...av(f,n,d))}return a}function tO(o){let i=[];return o.map(t=>{let r=nv(t),n=GD.test(t.querySelector(M5)?.textContent??"");i.length=r,i[r-1]=(i[r-1]??0)+1;for(let s=0;s<r-1;s++)i[s]??(i[s]=1);return`${n?i.map(s=>`${s}.`).join(""):"-".repeat(Math.min(r,10))} ${Wu(Zl(t))}`}).filter(t=>!/^\S+ $/.test(t)).join(`
4466
- `)}function rO(o){return`|===
4464
+ `)}function Wu(o){return o.replace(/\s+/g," ").trim()}function rO(o){let i=[],t=o.tagName,r=o.style.fontWeight,n=o.style.textDecorationLine||o.style.textDecoration,a=r==="normal"||Number(r)>0&&Number(r)<600;return((t==="B"||t==="STRONG")&&!a||r==="bold"||Number(r)>=600)&&i.push("strong"),((t==="I"||t==="EM")&&o.style.fontStyle!=="normal"||o.style.fontStyle==="italic")&&i.push("emphasis"),(t==="U"||n.includes("underline"))&&i.push("underline"),(t==="S"||t==="STRIKE"||t==="DEL"||n.includes("line-through"))&&i.push("strike"),(t==="CODE"||t==="KBD"||t==="TT"||t==="SAMP")&&i.push("code"),i}function Gu(o,i,t=i){let[,r,n,a]=/^(\s*)([\s\S]*?)(\s*)$/.exec(o);return n?`${r}${i}${n}${t}${a}`:o}function A5(o){return o&&/^(https?:|mailto:|tel:)/i.test(o)?o:null}function Zl(o,i=new Set){if(o.nodeType===Node.TEXT_NODE)return(o.textContent??"").replace(/[ \t\r\n\f]+/g," ");if(!(o instanceof HTMLElement)||L5.has(o.tagName)||o.matches(M5))return"";if(o.tagName==="BR")return`
4465
+ `;if(o.tagName==="IMG"){let s=A5(o.getAttribute("src"));return s?`![${o.getAttribute("alt")??""}](${s})`:""}if(o.tagName==="INPUT"&&o.type==="checkbox")return o.checked?"[x] ":"[ ] ";let t=rO(o).filter(s=>!i.has(s)),r=t.includes("code")?(o.textContent??"").replace(/\s+/g," "):Array.from(o.childNodes).map(s=>Zl(s,new Set([...i,...t]))).join(""),n=iv.has(o.tagName)?` ${r} `:r;for(let s of t)n=Gu(n,YD[s]);o.tagName==="SUP"&&(n=Gu(n,"^")),o.tagName==="SUB"&&(n=Gu(n,"~"));let a=o.tagName==="A"?A5(o.getAttribute("href")):null;return a&&n.trim()?Gu(n.replace(/\n/g," "),"[",`](${a})`):n}function av(o,i,t){let r=o.tagName==="OL",n=r?i:i+1,a=[],s=r?Number(o.getAttribute("start")??1)-1:0;for(let l of Array.from(o.children)){if(l.tagName==="UL"||l.tagName==="OL"){a.push(...av(l,n,r?[...t,Math.max(s,1)]:t));continue}if(l.tagName!=="LI")continue;s++;let d=r?[...t,s]:t,h=Array.from(l.children).filter(f=>f.tagName==="UL"||f.tagName==="OL"),m=Wu(Array.from(l.childNodes).filter(f=>!h.includes(f)).map(f=>Zl(f)).join(""));if(m){let f=r?d.map(b=>`${b}.`).join(""):"-".repeat(Math.min(n,10));a.push(`${f} ${m}`)}for(let f of h)a.push(...av(f,n,d))}return a}function iO(o){let i=[];return o.map(t=>{let r=nv(t),n=KD.test(t.querySelector(M5)?.textContent??"");i.length=r,i[r-1]=(i[r-1]??0)+1;for(let s=0;s<r-1;s++)i[s]??(i[s]=1);return`${n?i.map(s=>`${s}.`).join(""):"-".repeat(Math.min(r,10))} ${Wu(Zl(t))}`}).filter(t=>!/^\S+ $/.test(t)).join(`
4466
+ `)}function nO(o){return`|===
4467
4467
  ${Array.from(o.querySelectorAll("tr")).filter(t=>t.closest("table")===o).map(t=>Array.from(t.children).filter(r=>r.tagName==="TD"||r.tagName==="TH").map(r=>Wu(Zl(r))||" ")).filter(t=>t.length).map(t=>t.map(r=>`|${r}`).join(" ")).join(`
4468
4468
 
4469
4469
  `)}
4470
- |===`}function q5(o,i=!1,t={}){return new R5(o,i,t).parse()}function sv(o){let i=o.match(/^((\d*\.)+) (.*)/);if(i)return[{ordered:!0,depth:i[1].split(".").length-1},i[3]];let t=o.match(/^((\*|-){1,10}) (.*)/);return t?[{ordered:!1,depth:t[1].length},t[3]]:null}function iO(o,i){return i.some(t=>o.ordered===t.ordered&&o.depth<=t.depth)}var R5=class D5{constructor(i,t,r={}){W(this,"lines");W(this,"index",0);W(this,"attrs",{plus:"+"});W(this,"references",[]);W(this,"conditions",[]);this.detectHeaders=t,this.options=r,this.lines=N5(O5(i),r)}parse(){return this.detectHeaders&&this.processDocumentHeader(),this.wrapDocument(this.parseBlocks())}processDocumentHeader(){for(;this.index<this.lines.length;){let i=this.lines[this.index]??"";if(i.trim()===""||i.startsWith("// ")){this.index++;continue}break}if((this.lines[this.index]??"").startsWith("= ")){this.index++;let i=0;for(;this.index<this.lines.length;){let t=this.lines[this.index]??"";if(t.trim()===""){this.index++;break}if(t.startsWith("// ")){this.index++;continue}if(/^:!?[\w.-]+!?:/.test(t)){this.addDocumentAttr(t),this.index++;continue}if(i<2){i++,this.index++;continue}break}}}wrapDocument(i){let t=i.indexOf('<div class="remarkd-section section--level1');if(t===0)return i;if(t>0){let r=i.slice(0,t);return`<div class="remarkd-section section--level0 section--${r?"with-content":"empty"}">${r}</div>${i.slice(t)}`}return`<div class="remarkd-section section--level0 section--${i?"with-content":"empty"}">${i}</div>`}parseBlocks(i,t){let r=[],n=null,a=null;for(;this.index<this.lines.length;){let s=this.replaceAttrs(this.lines[this.index]??""),l=s.match(/^(={2,6}) (.*)$/);if(l&&t!==void 0&&l[1].length-1<=t)break;if(i&&s===i){this.index++;break}let d=this.parseConditional(s);if(d.handled)if(d.inline)s=this.replaceAttrs(d.inline);else continue;if(this.conditions.includes(!1)){this.index++;continue}if(s.trim()===""){this.index++;continue}if(/^:!?[\w.-]+!?:/.test(s)){this.addDocumentAttr(s),this.index++;continue}if(s.startsWith("// ")){this.index++;continue}if(s==="////"){for(this.index++;this.index<this.lines.length&&this.lines[this.index]!=="////";)this.index++;this.index<this.lines.length&&this.index++;continue}if(s.startsWith(".")&&!s.startsWith("..")&&s!=="."){n=s.slice(1),this.index++;continue}if(/^\[[^\]]*]$/.test(s)){a=ec(s),this.index++;continue}let h=this.parseBlock(s,n,a);n=null,a=null,r.push(h)}return r.join("")}parseBlock(i,t,r){if(i.startsWith("_|_#"))return this.parseTabs();if(i.startsWith("_-_#"))return this.parseAccordion();if(i.startsWith("_|- "))return this.parseSteps();if(i==="|===")return this.parseTable(t,r);if(i==="____")return this.parseDelimited(r);if(i==="```")return this.parseVerbatim("```","code");if(i==="....")return this.parseVerbatim("....","code");if(/^!{4,10}$/.test(i))return this.parseVerbatim(i,"code");if(/^-{4,10}$/.test(i))return this.parseListing(i);if(/^={4,10}$/.test(i))return this.parseCompound(i,"example-block");if(/^\*{4,10}$/.test(i))return this.parseCompound(i,"sidebar-block");if(/^!![\w-]+!!$/.test(i))return this.parseId(i);if(/^include::[^\[]+\[.*]\s*$/.test(i))return this.parseInclude(i);if(/^[^:]+:: .+/.test(i))return this.parseDefinitions(i);if(/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])/.test(i))return this.parseAdmonition(i);if(/^<(\d+|\d+\.\d+|\w|[^>])> /.test(i))return this.parseCalloutBlock(i);if(/^(#{1,6}) /.test(i)){let[,n,a]=i.match(/^(#{1,6}) (.*)$/)??[];return this.index++,`<h${n.length}>${this.inline(a)}</h${n.length}>`}return/^(={2,6}) /.test(i)?this.parseSection(i,r):i.trim()==="<<<"?(this.index++,'<p><div style="break-after:page"></div></p>'):/^-{3}$/.test(i.trim())?(this.index++,"<p><hr /></p>"):sv(i)?this.parseList():/^{{/.test(i)||/{{ref\b/.test(i)||/{{reflist\b/.test(i)?(this.index++,this.inline(i)):this.parseParagraph(i,t,r)}parseInclude(i){this.index++;let r=i.match(/^include::([^\[]+)\[.*]\s*$/)?.[1]?.trim()??"",n=P5(this.options,r);if(n===null)return`<!-- unable to include ${r}-->`;let a=new D5(n,!1,this.options);a.attrs=this.attrs,a.references=this.references;let s=a.parse();return this.references=a.references,s}parseParagraph(i,t,r){let n=!!r?.pos.includes("%hardbreaks"),a=[i.trim().replace(/ \+$/,"")];for(this.index++;this.index<this.lines.length;){let h=this.replaceAttrs(this.lines[this.index]??"");if(h.trim()===""||this.isBlockStart(h))break;a.push(h.trim()==="+"?"":h.trim().replace(/ \+$/,"")),this.index++}let s=r?.pos[0]?.startsWith(".")?` class="${r.pos[0].slice(1)}"`:"",l=n||i.endsWith(" +")||a.includes("")?`
4470
+ |===`}function q5(o,i=!1,t={}){return new R5(o,i,t).parse()}function sv(o){let i=o.match(/^((\d*\.)+) (.*)/);if(i)return[{ordered:!0,depth:i[1].split(".").length-1},i[3]];let t=o.match(/^((\*|-){1,10}) (.*)/);return t?[{ordered:!1,depth:t[1].length},t[3]]:null}function oO(o,i){return i.some(t=>o.ordered===t.ordered&&o.depth<=t.depth)}var R5=class D5{constructor(i,t,r={}){W(this,"lines");W(this,"index",0);W(this,"attrs",{plus:"+"});W(this,"references",[]);W(this,"conditions",[]);this.detectHeaders=t,this.options=r,this.lines=N5(O5(i),r)}parse(){return this.detectHeaders&&this.processDocumentHeader(),this.wrapDocument(this.parseBlocks())}processDocumentHeader(){for(;this.index<this.lines.length;){let i=this.lines[this.index]??"";if(i.trim()===""||i.startsWith("// ")){this.index++;continue}break}if((this.lines[this.index]??"").startsWith("= ")){this.index++;let i=0;for(;this.index<this.lines.length;){let t=this.lines[this.index]??"";if(t.trim()===""){this.index++;break}if(t.startsWith("// ")){this.index++;continue}if(/^:!?[\w.-]+!?:/.test(t)){this.addDocumentAttr(t),this.index++;continue}if(i<2){i++,this.index++;continue}break}}}wrapDocument(i){let t=i.indexOf('<div class="remarkd-section section--level1');if(t===0)return i;if(t>0){let r=i.slice(0,t);return`<div class="remarkd-section section--level0 section--${r?"with-content":"empty"}">${r}</div>${i.slice(t)}`}return`<div class="remarkd-section section--level0 section--${i?"with-content":"empty"}">${i}</div>`}parseBlocks(i,t){let r=[],n=null,a=null;for(;this.index<this.lines.length;){let s=this.replaceAttrs(this.lines[this.index]??""),l=s.match(/^(={2,6}) (.*)$/);if(l&&t!==void 0&&l[1].length-1<=t)break;if(i&&s===i){this.index++;break}let d=this.parseConditional(s);if(d.handled)if(d.inline)s=this.replaceAttrs(d.inline);else continue;if(this.conditions.includes(!1)){this.index++;continue}if(s.trim()===""){this.index++;continue}if(/^:!?[\w.-]+!?:/.test(s)){this.addDocumentAttr(s),this.index++;continue}if(s.startsWith("// ")){this.index++;continue}if(s==="////"){for(this.index++;this.index<this.lines.length&&this.lines[this.index]!=="////";)this.index++;this.index<this.lines.length&&this.index++;continue}if(s.startsWith(".")&&!s.startsWith("..")&&s!=="."){n=s.slice(1),this.index++;continue}if(/^\[[^\]]*]$/.test(s)){a=ec(s),this.index++;continue}let h=this.parseBlock(s,n,a);n=null,a=null,r.push(h)}return r.join("")}parseBlock(i,t,r){if(i.startsWith("_|_#"))return this.parseTabs();if(i.startsWith("_-_#"))return this.parseAccordion();if(i.startsWith("_|- "))return this.parseSteps();if(i==="|===")return this.parseTable(t,r);if(i==="____")return this.parseDelimited(r);if(i==="```")return this.parseVerbatim("```","code");if(i==="....")return this.parseVerbatim("....","code");if(/^!{4,10}$/.test(i))return this.parseVerbatim(i,"code");if(/^-{4,10}$/.test(i))return this.parseListing(i);if(/^={4,10}$/.test(i))return this.parseCompound(i,"example-block");if(/^\*{4,10}$/.test(i))return this.parseCompound(i,"sidebar-block");if(/^!![\w-]+!!$/.test(i))return this.parseId(i);if(/^include::[^\[]+\[.*]\s*$/.test(i))return this.parseInclude(i);if(/^[^:]+:: .+/.test(i))return this.parseDefinitions(i);if(/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])/.test(i))return this.parseAdmonition(i);if(/^<(\d+|\d+\.\d+|\w|[^>])> /.test(i))return this.parseCalloutBlock(i);if(/^(#{1,6}) /.test(i)){let[,n,a]=i.match(/^(#{1,6}) (.*)$/)??[];return this.index++,`<h${n.length}>${this.inline(a)}</h${n.length}>`}return/^(={2,6}) /.test(i)?this.parseSection(i,r):i.trim()==="<<<"?(this.index++,'<p><div style="break-after:page"></div></p>'):/^-{3}$/.test(i.trim())?(this.index++,"<p><hr /></p>"):sv(i)?this.parseList():/^{{/.test(i)||/{{ref\b/.test(i)||/{{reflist\b/.test(i)?(this.index++,this.inline(i)):this.parseParagraph(i,t,r)}parseInclude(i){this.index++;let r=i.match(/^include::([^\[]+)\[.*]\s*$/)?.[1]?.trim()??"",n=P5(this.options,r);if(n===null)return`<!-- unable to include ${r}-->`;let a=new D5(n,!1,this.options);a.attrs=this.attrs,a.references=this.references;let s=a.parse();return this.references=a.references,s}parseParagraph(i,t,r){let n=!!r?.pos.includes("%hardbreaks"),a=[i.trim().replace(/ \+$/,"")];for(this.index++;this.index<this.lines.length;){let h=this.replaceAttrs(this.lines[this.index]??"");if(h.trim()===""||this.isBlockStart(h))break;a.push(h.trim()==="+"?"":h.trim().replace(/ \+$/,"")),this.index++}let s=r?.pos[0]?.startsWith(".")?` class="${r.pos[0].slice(1)}"`:"",l=n||i.endsWith(" +")||a.includes("")?`
4471
4471
  <br />
4472
4472
  `:`
4473
- `,d=`${t?`<span class="title">${t}</span>`:""}${this.inline(a.join(l))}`;return`<p${s}>${d}</p>`}parseSection(i,t){let[,r,n]=i.match(/^(={2,6}) (.*)$/)??[],a=r.length-1,s=t?.pos.find(d=>d.startsWith("#"))?.slice(1)||dO(n);this.index++;let l=this.parseBlocks(void 0,a);return`<div class="remarkd-section section--level${a} section--${l?"with-content":"empty"}" id="${s}"><h${a+1}>${this.inline(n)}</h${a+1}>${l}</div>`}parseVerbatim(i,t){this.index++;let r=[];for(;this.index<this.lines.length&&this.lines[this.index]!==i;)r.push(Wd(this.lines[this.index]??"")),this.index++;return this.index<this.lines.length&&this.index++,`<${t}>${r.join(`
4473
+ `,d=`${t?`<span class="title">${t}</span>`:""}${this.inline(a.join(l))}`;return`<p${s}>${d}</p>`}parseSection(i,t){let[,r,n]=i.match(/^(={2,6}) (.*)$/)??[],a=r.length-1,s=t?.pos.find(d=>d.startsWith("#"))?.slice(1)||hO(n);this.index++;let l=this.parseBlocks(void 0,a);return`<div class="remarkd-section section--level${a} section--${l?"with-content":"empty"}" id="${s}"><h${a+1}>${this.inline(n)}</h${a+1}>${l}</div>`}parseVerbatim(i,t){this.index++;let r=[];for(;this.index<this.lines.length&&this.lines[this.index]!==i;)r.push(Wd(this.lines[this.index]??"")),this.index++;return this.index<this.lines.length&&this.index++,`<${t}>${r.join(`
4474
4474
  `)}</${t}>`}parseListing(i){this.index++;let t=[];for(;this.index<this.lines.length&&this.lines[this.index]!==i;)t.push(Wd(this.lines[this.index]??"")),this.index++;return this.index<this.lines.length&&this.index++,`<div class="listing-block"><div class="content">${t.join(`
4475
4475
  `)}</div></div>`}parseCompound(i,t){this.index++;let r=this.parseBlocks(i);return`<div class="${t}"><div class="content">${r}</div></div>`}parseDelimited(i){this.index++;let t=[];for(;this.index<this.lines.length&&this.lines[this.index]!=="____";)t.push(this.lines[this.index]??""),this.index++;return this.index<this.lines.length&&this.index++,i?.pos[0]==="verse"?`<pre class="verse-block">${t.join(`
4476
4476
  `)}</pre>`:`<blockquote><p>${t.map(r=>r.trim()).join(" ").trim()}</p></blockquote>`}parseDefinitions(i){let t=[],r=i;for(;this.index<this.lines.length&&/^([^:]+):: /.test(r);){let[,n,a]=r.match(/^([^:]+):: (.*)$/)??[];t.push([n,a]),this.index++,r=this.lines[this.index]??""}return`<dl>${t.map(([n,a])=>`<dt>${n}</dt><dd>${a}</dd>`).join("")}</dl>`}parseAdmonition(i){let[,t,r]=i.match(/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])\s?(.*)$/)??[],n=[RegExp.$3||i.replace(/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])\s?/,"")];for(this.index++;this.index<this.lines.length&&(this.lines[this.index]??"").trim()!=="";)n.push(this.lines[this.index]??""),this.index++;let a=r===":"?`<strong class="hint-caption">${t}: </strong> `:"";return`<div class="hint-${t.toLowerCase()}">${a}${n.map(s=>this.inline(s)).join(`
4477
4477
  `)}</div>`}parseCalloutBlock(i){let[,t,r]=i.match(/^<([^>]+)> (.*)$/)??[];return this.index++,`<li class="callout" data-marker="${t}">${this.inline(r)}</li>`}parseId(i){let t=i.slice(2,-2);this.index++;let r=[];for(;this.index<this.lines.length;)r.push(this.lines[this.index]??""),this.index++;return`<div id="${t}"><p>${this.inline(r.join(`
4478
- `))}</p></div>`}parseList(i=[]){let[t]=sv(this.lines[this.index]??""),r=[...i,t],n=[];for(;this.index<this.lines.length;){let s=sv(this.lines[this.index]??"");if(!s||iO(s[0],i))break;let[l,d]=s;if(l.ordered===t.ordered&&l.depth<=t.depth){n.push(`<li><p>${this.inline(d)}</p>`),this.index++;continue}n[n.length-1]+=`
4478
+ `))}</p></div>`}parseList(i=[]){let[t]=sv(this.lines[this.index]??""),r=[...i,t],n=[];for(;this.index<this.lines.length;){let s=sv(this.lines[this.index]??"");if(!s||oO(s[0],i))break;let[l,d]=s;if(l.ordered===t.ordered&&l.depth<=t.depth){n.push(`<li><p>${this.inline(d)}</p>`),this.index++;continue}n[n.length-1]+=`
4479
4479
  ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4480
- `)}</li></${a}>`}parseTable(i,t){this.index++;let r=[],n=[];for(;this.index<this.lines.length&&this.lines[this.index]!=="|===";){let y=this.lines[this.index]??"";y===""?(n.length&&r.push(n),n=[]):y.startsWith("|")&&n.push(...y.replace(/^\|/,"").split(/\s+\|/).map(_=>this.inline(_.trim())).filter(Boolean)),this.index++}n.length&&r.push(n),this.index<this.lines.length&&this.index++;let a=r[0]??[],s=r.slice(1),l=sO(t),d=["remarkd-table"];Cs(t,"striped",!1)&&d.push("remarkd-table--striped"),l&&(d.push("pros-cons-table"),Cs(t,"background-colour",!0)&&Cs(t,"background-color",!0)&&d.push("pros-cons-table--background"),Cs(t,"text-colour",!0)&&Cs(t,"text-color",!0)&&d.push("pros-cons-table--text-color"),Cs(t,"header-icons",!0)&&d.push("pros-cons-table--header-icons"));let h=y=>y===0?"pros-cons-cell--con":"pros-cons-cell--pro",m=y=>l?` class="pros-cons-cell ${h(y)}"`:"",f=(y,_)=>{let E=l&&Cs(t,"header-icons",!0)?`${lO(t,_)} ${y}`:y;return`<th${m(_)}>${E}</th>`},b=(y,_)=>`<td${m(_)}>${y}</td>`,g=`<table class="${d.join(" ")}"><thead><tr>${a.map(f).join("")}</tr></thead><tbody>${s.map(y=>`<tr>${y.map(b).join("")}</tr>`).join("")}</tbody></table>`;return i?`<div class="${l?"table-block pros-cons-block":"table-block"}"><div class="title">${i}</div>${g}</div>`:g}parseTabs(){let i=[];for(;this.index<this.lines.length&&(this.lines[this.index]??"").startsWith("_|_#");){let n=this.lines[this.index]??"",[,a,s]=n.match(/^_\|_#([\w-]+)\s*(.*)$/)??[];this.index++;let l=[];for(;this.index<this.lines.length&&!(this.lines[this.index]??"").startsWith("_|_#");)l.push(this.lines[this.index]??""),this.index++;i.push({id:a,name:ec(s).named.name||Gd(a),content:lv(l.join(`
4480
+ `)}</li></${a}>`}parseTable(i,t){this.index++;let r=[],n=[];for(;this.index<this.lines.length&&this.lines[this.index]!=="|===";){let y=this.lines[this.index]??"";y===""?(n.length&&r.push(n),n=[]):y.startsWith("|")&&n.push(...y.replace(/^\|/,"").split(/\s+\|/).map(_=>this.inline(_.trim())).filter(Boolean)),this.index++}n.length&&r.push(n),this.index<this.lines.length&&this.index++;let a=r[0]??[],s=r.slice(1),l=cO(t),d=["remarkd-table"];Cs(t,"striped",!1)&&d.push("remarkd-table--striped"),l&&(d.push("pros-cons-table"),Cs(t,"background-colour",!0)&&Cs(t,"background-color",!0)&&d.push("pros-cons-table--background"),Cs(t,"text-colour",!0)&&Cs(t,"text-color",!0)&&d.push("pros-cons-table--text-color"),Cs(t,"header-icons",!0)&&d.push("pros-cons-table--header-icons"));let h=y=>y===0?"pros-cons-cell--con":"pros-cons-cell--pro",m=y=>l?` class="pros-cons-cell ${h(y)}"`:"",f=(y,_)=>{let E=l&&Cs(t,"header-icons",!0)?`${dO(t,_)} ${y}`:y;return`<th${m(_)}>${E}</th>`},b=(y,_)=>`<td${m(_)}>${y}</td>`,g=`<table class="${d.join(" ")}"><thead><tr>${a.map(f).join("")}</tr></thead><tbody>${s.map(y=>`<tr>${y.map(b).join("")}</tr>`).join("")}</tbody></table>`;return i?`<div class="${l?"table-block pros-cons-block":"table-block"}"><div class="title">${i}</div>${g}</div>`:g}parseTabs(){let i=[];for(;this.index<this.lines.length&&(this.lines[this.index]??"").startsWith("_|_#");){let n=this.lines[this.index]??"",[,a,s]=n.match(/^_\|_#([\w-]+)\s*(.*)$/)??[];this.index++;let l=[];for(;this.index<this.lines.length&&!(this.lines[this.index]??"").startsWith("_|_#");)l.push(this.lines[this.index]??""),this.index++;i.push({id:a,name:ec(s).named.name||Gd(a),content:lv(l.join(`
4481
4481
  `),this)})}let t=i.map((n,a)=>`<li><a href="#" data-tab-focus-key="${n.id}"${a===0?' class="active"':""}>${n.name}</a></li>`).join(""),r=i.map(n=>`<div class="tab" data-tab-key="${n.id}"><div class="content">${n.content}</div></div>`).join(`
4482
4482
  `);return`<div class="tab-group"><ul class="tab-header">${t}</ul><div class="tabs">${r}</div></div>`}parseAccordion(){let i=[];for(;this.index<this.lines.length&&(this.lines[this.index]??"").startsWith("_-_#");){let t=this.lines[this.index]??"",[,r,n]=t.match(/^_-_#([\w-]+)\s*(.*)$/)??[];this.index++;let a=[];for(;this.index<this.lines.length&&!(this.lines[this.index]??"").startsWith("_-_#");)a.push(this.lines[this.index]??""),this.index++;i.push({name:ec(n).named.name||Gd(r),content:lv(a.join(`
4483
4483
  `),this)})}return`<div class="accordion-container">${i.map(t=>`<button class="accordion">${t.name}</button><div class="panel">${t.content}</div>`).join(`
4484
4484
  `)}</div>`}parseSteps(){let i=[];for(;this.index<this.lines.length&&(this.lines[this.index]??"").startsWith("_|- ");){let n=(this.lines[this.index]??"").match(/^_\|- (.*?)(\[.*\])?\s*$/);this.index++;let a=[];for(;this.index<this.lines.length&&!(this.lines[this.index]??"").startsWith("_|- ");)a.push(this.lines[this.index]??""),this.index++;let s=ec(n?.[2]??"");i.push({title:n?.[1]??"",img:s.named.img,content:lv(a.join(`
4485
4485
  `),this)})}return`<div class="steps-container"><div class="content">${i.map(r=>`<div class="step"><div class="step-content"><h3>${r.title}</h3>${r.content}</div>${r.img?`<div class="step-image"><img src="${r.img}" alt="" /></div>`:""}</div>`).join(`
4486
- `)}</div></div>`}inline(i){let t=i,r=[],n=a=>{let s=`RMDPASS${r.length}`;return r.push(a),s};return t=t.replace(/\bpass:\[([^\]]*)]/gs,(a,s)=>n(s)).replace(/\+\+\+(.+?)\+\+\+/gs,(a,s)=>n(s)),t=t.replace(/{{([^}: ]+)(?::([^ }]+))?([^}]*)}}/g,(a,s,l="",d="")=>this.renderObject(s,l,ec(d))),t=t.replace(/"`([^`]+)`"/g,"&ldquo;$1&rdquo;"),t=t.replace(/``([^`]+)``/g,(a,s)=>`<span class="monospace">${Wd(s)}</span>`),t=t.replace(/`([^`\n]+)`/g,(a,s)=>`<span class="monospace">${Wd(s)}</span>`),t=t.replace(/___(.+?)___/g,"<u>$1</u>"),t=t.replace(/\(c\)|\(C\)/g,"\xA9").replace(/\(r\)|\(R\)/g,"\xAE").replace(/\(tm\)|\(TM\)/g,"\u2122").replace(/\(p\)|\(P\)/g,"\xA7").replace(/\(\+-\)/g,"\xB1").replace(/-\.-/g,"&#8226;"),t=t.replace(/:(\S+):/g,(a,s)=>cO[s.replaceAll("-","_")]||a),t=t.replace(/kbd:\[([^\]]+)]/g,"<kbd>$1</kbd>"),t=t.replace(/[^#&]#([^#]+)#/g,'<mark class="highlight">$1</mark>'),t=t.replace(/{(.*?)}\((.*?)\)/g,'<span class="tooltip" title="$2">$1</span>'),t=t.replace(/!\[([^\]]*)]\((.*?)\s*"([^"]+)"\s*\)/g,(a,s,l,d)=>`<img src="${n(l)}" alt="${n(s)}" title="${n(d)}"/>`),t=t.replace(/!\[([^\]]*)]\(([^)]*)\)/g,(a,s,l)=>s?`<img src="${n(l)}" alt="${n(s)}"/>`:`<img src="${n(l)}"/>`),t=t.replace(/image::([^\[]+)\[([^\]]*)]/g,(a,s,l)=>{let[d,h,m]=l.split(",").map(f=>f.trim());return`<img class="block" src="${n(s)}"${d?` alt="${n(d)}"`:""}${h?` width="${h}"`:""}${m?` height="${m}"`:""}/>`}),t=t.replace(/\[([^\]]*)]\(([^)]*)\)/g,(a,s,l)=>`<a href="${n(l)}">${s}</a>`),t=t.replace(/([^="(])((?:http|ftp|https|mailto):\/\/[\w_-]+(?:(?:\.[\w_-]+)+)[\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])(?:\[([^\]\n]+)])?/g,(a,s,l,d)=>`${s}<a href="${n(l)}">${d||n(l)}</a>`),t=t.replace(/<<([\w\-_]+)(,([^>]+))?>>/g,(a,s,l,d)=>`<a href="#${s.replace(/^_/,"").replace(/_/g,"-")}">${d||Gd(s)}</a>`),t=t.replace(/footnote:\[([^\]]+)]/g,'<sup class="footnote">$1</sup>'),t=t.replace(/\*\*([^*]+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/__([^_]+?)__/g,"<em>$1</em>"),t=t.replace(/([^\\w])\*([^*]+)\*/g,"$1<strong>$2</strong>"),t=t.replace(/(\s|^)_([^_]+)_/g,"$1<em>$2</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/~([^~]+?)~/g,"<sub>$1</sub>"),t=t.replace(/\^([^^]+?)\^/g,"<sup>$1</sup>"),t=t.replace(/\[( |x|_|\*)]/g,(a,s)=>s===" "?'<input type="checkbox" readonly="readonly">':s==="x"?'<input type="checkbox" readonly="readonly" checked>':s==="_"?'<input type="checkbox">':'<input type="checkbox" checked>'),t=t.replace(/(\[[^\]]+])##([^#]+)##/g,(a,s,l)=>`<span class="${ec(s).pos[0]}">${l}</span>`),t=t.replace(/<(\d+|\d+\.\d+)>/g,'<i class="conum" data-value="$1"></i>'),r.reduce((a,s,l)=>a.replaceAll(`RMDPASS${l}`,s),t)}renderObject(i,t,r){switch(i){case"link":{let n=r.named.text||Gd(t),a=r.named.target?` target="${r.named.target}"`:"",s=r.named.hreflang?` hreflang="${r.named.hreflang}"`:"";return`<a href="${r.named.href||t}"${a}${s}>${n}</a>`}case"button":{let n=r.named.text||Gd(t),a=r.named.color||"gray",s=r.named.target?` target="${r.named.target}"`:"";return`<a href="${r.named.href||`#${t}`}" class="btn btn--${a}"${s}>${n}</a>`}case"br":return"<br>";case"anchor":return r.named.name?`<a name="${r.named.name}"></a>`:"[ANCHOR MISSING NAME]";case"meter":{let n=r.named.id||"remarkd-meter-150";return`${r.named.label?`<label for="${n}" class="remarkd-meter-label">${r.named.label}</label>`:""}<meter id="${n}" class="remarkd-meter" min="${r.named.min||"0"}" max="${r.named.max||"100"}" value="${r.named.value||"0"}"">${r.named.text||""}</meter>`}case"video":{let n=r.named.aspect==="4:3"?"75":r.named.aspect==="1:1"?"100":r.named.aspect==="3:2"?"66.66":r.named.aspect==="8:5"?"62.5":"56.25";if(r.named.source==="self")return`<div class="video-container" style="padding-top: ${n}%"><video controls><source src="${t}" type="${r.named.type||"video/mp4"}"></video></div>`;let a=["rel=0"];return r.named.end&&a.unshift(`end=${r.named.end}`),r.named.start&&a.unshift(`start=${r.named.start}`),`<div class="video-container" style="padding-top: ${n}%"><iframe src="https://www.youtube.com/embed/${t}?${a.join(";")}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>`}case"ref":{let n={num:this.references.length+1,code:r.named.code||`${this.references.length+1}RM`,content:r.named.content||""};return this.references.push(n),`<sup class="reference"><a id="rmdref-bdy-${n.code}" href="#rmdref-ft-${n.code}">[${n.num}]</a></sup>`}case"reflist":return this.references.length?`<ol class="reference">${this.references.map(n=>`<li id="rmdref-ft-${n.code}"><a href="#rmdref-bdy-${n.code}" class="reference-tobody">^</a> ${this.inline(n.content)}</li>`).join("")}</ol>`:"";case"img":{let n=`display: ${r.named.display||"inline-block"};max-width: ${r.named["max-width"]||"100%"};`;r.named.float&&(n+=`float: ${r.named.float};`);let a=r.pos.filter(s=>s.startsWith(".")).map(s=>s.slice(1));return`<img src="${r.named.src||""}"${r.named.alt?` alt="${r.named.alt}"`:""} style="${n}"${a.length?` class="${a.join(" ")}"`:""} />`}default:return""}}replaceAttrs(i){for(let[t,r]of Object.entries(this.attrs))i=i.replaceAll(`{${t}}`,String(r));return i}addDocumentAttr(i){let t=i.match(/^:(!?[\w.-]+)(!)?:(.*)?$/);t&&(this.attrs[t[1]]=t[3]?.trim()||!t[2])}parseConditional(i){let t=i.match(/^(end)?if(def|ndef|eval|nempty|empty|true|false)?::([^\[]*)\[([^]*)]$/);if(!t)return{handled:!1};if(this.index++,t[1]==="end")return this.conditions.pop(),{handled:!0};let n=!this.conditions.includes(!1)&&this.validateCondition(t[2]||"def",t[3],t[4]);return t[2]!=="eval"&&t[4]?{handled:!0,inline:n?t[4]:void 0}:(this.conditions.push(n),{handled:!0})}validateCondition(i,t,r){return i==="eval"?pO(r):t.split(",").some(a=>a.split("+").every(s=>{let l=this.attrs[s];return i==="def"?l!==void 0:i==="ndef"?l===void 0:i==="true"?l===!0||l==="true"||l==="1":i==="false"?l===!1||l==="false"||l==="0":i==="empty"?l===void 0||l==="":i==="nempty"?l!==void 0&&l!=="":!1}))}isBlockStart(i){return i==="```"||i==="____"||i==="|==="||/^[-=*.!]{4,10}$/.test(i)||/^#{1,6} /.test(i)||/^={2,6} /.test(i)||i.trim()==="<<<"||/^((\d*\.)+) /.test(i)||/^((\*|-){1,10}) /.test(i)||/^(end)?if(def|ndef|eval|nempty|empty|true|false)?::/.test(i)||/^!![\w-]+!!$/.test(i)||/^include::[^\[]+\[.*]\s*$/.test(i)||i.startsWith("_|_#")||i.startsWith("_-_#")||i.startsWith("_|- ")||/^[^:]+:: .+/.test(i)||/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])/.test(i)||/^<(\d+|\d+\.\d+|\w|[^>])> /.test(i)||/^-{3}$/.test(i.trim())}};function O5(o){let i=[];for(let t of o.replace(/\r\n?/g,`
4486
+ `)}</div></div>`}inline(i){let t=i,r=[],n=a=>{let s=`RMDPASS${r.length}`;return r.push(a),s};return t=t.replace(/\bpass:\[([^\]]*)]/gs,(a,s)=>n(s)).replace(/\+\+\+(.+?)\+\+\+/gs,(a,s)=>n(s)),t=t.replace(/{{([^}: ]+)(?::([^ }]+))?([^}]*)}}/g,(a,s,l="",d="")=>this.renderObject(s,l,ec(d))),t=t.replace(/"`([^`]+)`"/g,"&ldquo;$1&rdquo;"),t=t.replace(/``([^`]+)``/g,(a,s)=>`<span class="monospace">${Wd(s)}</span>`),t=t.replace(/`([^`\n]+)`/g,(a,s)=>`<span class="monospace">${Wd(s)}</span>`),t=t.replace(/___(.+?)___/g,"<u>$1</u>"),t=t.replace(/\(c\)|\(C\)/g,"\xA9").replace(/\(r\)|\(R\)/g,"\xAE").replace(/\(tm\)|\(TM\)/g,"\u2122").replace(/\(p\)|\(P\)/g,"\xA7").replace(/\(\+-\)/g,"\xB1").replace(/-\.-/g,"&#8226;"),t=t.replace(/:(\S+):/g,(a,s)=>pO[s.replaceAll("-","_")]||a),t=t.replace(/kbd:\[([^\]]+)]/g,"<kbd>$1</kbd>"),t=t.replace(/[^#&]#([^#]+)#/g,'<mark class="highlight">$1</mark>'),t=t.replace(/{(.*?)}\((.*?)\)/g,'<span class="tooltip" title="$2">$1</span>'),t=t.replace(/!\[([^\]]*)]\((.*?)\s*"([^"]+)"\s*\)/g,(a,s,l,d)=>`<img src="${n(l)}" alt="${n(s)}" title="${n(d)}"/>`),t=t.replace(/!\[([^\]]*)]\(([^)]*)\)/g,(a,s,l)=>s?`<img src="${n(l)}" alt="${n(s)}"/>`:`<img src="${n(l)}"/>`),t=t.replace(/image::([^\[]+)\[([^\]]*)]/g,(a,s,l)=>{let[d,h,m]=l.split(",").map(f=>f.trim());return`<img class="block" src="${n(s)}"${d?` alt="${n(d)}"`:""}${h?` width="${h}"`:""}${m?` height="${m}"`:""}/>`}),t=t.replace(/\[([^\]]*)]\(([^)]*)\)/g,(a,s,l)=>`<a href="${n(l)}">${s}</a>`),t=t.replace(/([^="(])((?:http|ftp|https|mailto):\/\/[\w_-]+(?:(?:\.[\w_-]+)+)[\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])(?:\[([^\]\n]+)])?/g,(a,s,l,d)=>`${s}<a href="${n(l)}">${d||n(l)}</a>`),t=t.replace(/<<([\w\-_]+)(,([^>]+))?>>/g,(a,s,l,d)=>`<a href="#${s.replace(/^_/,"").replace(/_/g,"-")}">${d||Gd(s)}</a>`),t=t.replace(/footnote:\[([^\]]+)]/g,'<sup class="footnote">$1</sup>'),t=t.replace(/\*\*([^*]+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/__([^_]+?)__/g,"<em>$1</em>"),t=t.replace(/([^\\w])\*([^*]+)\*/g,"$1<strong>$2</strong>"),t=t.replace(/(\s|^)_([^_]+)_/g,"$1<em>$2</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/~([^~]+?)~/g,"<sub>$1</sub>"),t=t.replace(/\^([^^]+?)\^/g,"<sup>$1</sup>"),t=t.replace(/\[( |x|_|\*)]/g,(a,s)=>s===" "?'<input type="checkbox" readonly="readonly">':s==="x"?'<input type="checkbox" readonly="readonly" checked>':s==="_"?'<input type="checkbox">':'<input type="checkbox" checked>'),t=t.replace(/(\[[^\]]+])##([^#]+)##/g,(a,s,l)=>`<span class="${ec(s).pos[0]}">${l}</span>`),t=t.replace(/<(\d+|\d+\.\d+)>/g,'<i class="conum" data-value="$1"></i>'),r.reduce((a,s,l)=>a.replaceAll(`RMDPASS${l}`,s),t)}renderObject(i,t,r){switch(i){case"link":{let n=r.named.text||Gd(t),a=r.named.target?` target="${r.named.target}"`:"",s=r.named.hreflang?` hreflang="${r.named.hreflang}"`:"";return`<a href="${r.named.href||t}"${a}${s}>${n}</a>`}case"button":{let n=r.named.text||Gd(t),a=r.named.color||"gray",s=r.named.target?` target="${r.named.target}"`:"";return`<a href="${r.named.href||`#${t}`}" class="btn btn--${a}"${s}>${n}</a>`}case"br":return"<br>";case"anchor":return r.named.name?`<a name="${r.named.name}"></a>`:"[ANCHOR MISSING NAME]";case"meter":{let n=r.named.id||"remarkd-meter-150";return`${r.named.label?`<label for="${n}" class="remarkd-meter-label">${r.named.label}</label>`:""}<meter id="${n}" class="remarkd-meter" min="${r.named.min||"0"}" max="${r.named.max||"100"}" value="${r.named.value||"0"}"">${r.named.text||""}</meter>`}case"video":{let n=r.named.aspect==="4:3"?"75":r.named.aspect==="1:1"?"100":r.named.aspect==="3:2"?"66.66":r.named.aspect==="8:5"?"62.5":"56.25";if(r.named.source==="self")return`<div class="video-container" style="padding-top: ${n}%"><video controls><source src="${t}" type="${r.named.type||"video/mp4"}"></video></div>`;let a=["rel=0"];return r.named.end&&a.unshift(`end=${r.named.end}`),r.named.start&&a.unshift(`start=${r.named.start}`),`<div class="video-container" style="padding-top: ${n}%"><iframe src="https://www.youtube.com/embed/${t}?${a.join(";")}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>`}case"ref":{let n={num:this.references.length+1,code:r.named.code||`${this.references.length+1}RM`,content:r.named.content||""};return this.references.push(n),`<sup class="reference"><a id="rmdref-bdy-${n.code}" href="#rmdref-ft-${n.code}">[${n.num}]</a></sup>`}case"reflist":return this.references.length?`<ol class="reference">${this.references.map(n=>`<li id="rmdref-ft-${n.code}"><a href="#rmdref-bdy-${n.code}" class="reference-tobody">^</a> ${this.inline(n.content)}</li>`).join("")}</ol>`:"";case"img":{let n=`display: ${r.named.display||"inline-block"};max-width: ${r.named["max-width"]||"100%"};`;r.named.float&&(n+=`float: ${r.named.float};`);let a=r.pos.filter(s=>s.startsWith(".")).map(s=>s.slice(1));return`<img src="${r.named.src||""}"${r.named.alt?` alt="${r.named.alt}"`:""} style="${n}"${a.length?` class="${a.join(" ")}"`:""} />`}default:return""}}replaceAttrs(i){for(let[t,r]of Object.entries(this.attrs))i=i.replaceAll(`{${t}}`,String(r));return i}addDocumentAttr(i){let t=i.match(/^:(!?[\w.-]+)(!)?:(.*)?$/);t&&(this.attrs[t[1]]=t[3]?.trim()||!t[2])}parseConditional(i){let t=i.match(/^(end)?if(def|ndef|eval|nempty|empty|true|false)?::([^\[]*)\[([^]*)]$/);if(!t)return{handled:!1};if(this.index++,t[1]==="end")return this.conditions.pop(),{handled:!0};let n=!this.conditions.includes(!1)&&this.validateCondition(t[2]||"def",t[3],t[4]);return t[2]!=="eval"&&t[4]?{handled:!0,inline:n?t[4]:void 0}:(this.conditions.push(n),{handled:!0})}validateCondition(i,t,r){return i==="eval"?uO(r):t.split(",").some(a=>a.split("+").every(s=>{let l=this.attrs[s];return i==="def"?l!==void 0:i==="ndef"?l===void 0:i==="true"?l===!0||l==="true"||l==="1":i==="false"?l===!1||l==="false"||l==="0":i==="empty"?l===void 0||l==="":i==="nempty"?l!==void 0&&l!=="":!1}))}isBlockStart(i){return i==="```"||i==="____"||i==="|==="||/^[-=*.!]{4,10}$/.test(i)||/^#{1,6} /.test(i)||/^={2,6} /.test(i)||i.trim()==="<<<"||/^((\d*\.)+) /.test(i)||/^((\*|-){1,10}) /.test(i)||/^(end)?if(def|ndef|eval|nempty|empty|true|false)?::/.test(i)||/^!![\w-]+!!$/.test(i)||/^include::[^\[]+\[.*]\s*$/.test(i)||i.startsWith("_|_#")||i.startsWith("_-_#")||i.startsWith("_|- ")||/^[^:]+:: .+/.test(i)||/^(SUCCESS|WARNING|CAUTION|NOTE|NOTICE|IMPORTANT|DANGER|TIP)([:|)])/.test(i)||/^<(\d+|\d+\.\d+|\w|[^>])> /.test(i)||/^-{3}$/.test(i.trim())}};function O5(o){let i=[];for(let t of o.replace(/\r\n?/g,`
4487
4487
  `).replace(/\n$/,"").split(`
4488
4488
  `)){let r=t.replace(/{!(.*)!}/g,"$1");i.length&&i[i.length-1].endsWith("\\")?i[i.length-1]=i[i.length-1].replace(/[\\ ]+$/,"")+`
4489
- `+r:i.push(r)}return i}function lv(o,i){let t=new R5(o,!1,i.options);return t.attrs=i.attrs,t.parse().replace(/^<div class="remarkd-section section--level0 section--with-content">/,"").replace(/<\/div>$/,"")}function N5(o,i,t=0){if(t>10)return o;let r=[];for(let n of o){let a=n.match(/^t::partial::(.*)$/);if(!a){r.push(n);continue}let[s,l]=nO(a[1]??""),d=P5(i,s);if(d===null){r.push(`File not found: ${s}`);continue}let h=O5(d);for(oO(l,"strip-title")&&(h[0]??"").startsWith("=")&&(h=h.slice(1));h.length&&h[h.length-1].trim()==="";)h.pop();let m=Number.parseInt(l["drop-last"]??"0",10);m>0&&h.splice(-m),r.push(...N5(h,i,t+1))}return r}function nO(o){let i=o.trim(),t={},r=i.match(/^(.*?)\[([^\]]*)]$/);if(r){i=r[1].trim();for(let n of r[2].split(",")){let a=n.trim();if(!a)continue;let s=a.indexOf("=");s===-1?t[a]="true":t[a.slice(0,s).trim()]=a.slice(s+1).trim().replace(/^["']|["']$/g,"")}}return[i,t]}function oO(o,i){return i in o?!["0","false","no"].includes(o[i].toLowerCase()):!1}function P5(o,i){if(o.partials&&Object.prototype.hasOwnProperty.call(o.partials,i))return o.partials[i];let t=globalThis.process,r=t?.getBuiltinModule?.("node:fs");if(!r?.existsSync||!r?.readFileSync)return null;let n=aO(o.projectRoot||t?.cwd?.()||"",i);return r.existsSync(n)?r.readFileSync(n,"utf8"):null}function aO(o,i){return/^(\/|[A-Za-z]:[\\/])/.test(i)||!o?i:`${o.replace(/[\\/]+$/,"")}/${i.replace(/^[\\/]+/,"")}`}function ec(o){let i=o.trim().replace(/^\[/,"").replace(/]$/,""),t=[],r={},n=/(^|[\s,]+)([^, =}]+)(=(("([^"]*)")|([^\s,}]*)))?/g,a;for(;a=n.exec(i);){let s=a[2],l=a[6]||a[7]||"";t.push(s),r[s]=l}return{raw:i,pos:t,named:r}}function sO(o){return!!o&&(o.pos[0]==="pros-cons"||o.pos[0]==="proscons"||"pros-cons"in o.named||"proscons"in o.named)}function Cs(o,i,t){return!o||!(i in o.named)?t:!["0","false","no","off"].includes((o.named[i]||"").toLowerCase())}function lO(o,i){let t=i===0?o?.named["con-icon"]||"\u274C":o?.named["pro-icon"]||"\u2705";return`<span class="pros-cons-icon">${Wd(t)}</span>`}var cO={"+1":"\u{1F44D}",thumbsup:"\u{1F44D}","-1":"\u{1F44E}",thumbsdown:"\u{1F44E}",eyes:"\u{1F440}",grinning:"\u{1F600}",grin:"\u{1F601}",joy:"\u{1F602}",smiley:"\u{1F603}",smile:"\u{1F604}",sweat_smile:"\u{1F605}",satisfied:"\u{1F606}",laughing:"\u{1F606}",innocent:"\u{1F607}",smiling_imp:"\u{1F608}",wink:"\u{1F609}",blush:"\u{1F60A}",yum:"\u{1F60B}",relieved:"\u{1F60C}",heart_eyes:"\u{1F60D}",sunglasses:"\u{1F60E}",smirk:"\u{1F60F}",neutral_face:"\u{1F610}",expressionless:"\u{1F611}",unamused:"\u{1F612}",sweat:"\u{1F613}",pensive:"\u{1F614}",confused:"\u{1F615}",confounded:"\u{1F616}",kissing:"\u{1F617}",kissing_heart:"\u{1F618}",kissing_smiling_eyes:"\u{1F619}",kissing_closed_eyes:"\u{1F61A}",stuck_out_tongue:"\u{1F61B}",stuck_out_tongue_winking_eye:"\u{1F61C}",stuck_out_tongue_closed_eyes:"\u{1F61D}",disappointed:"\u{1F61E}",worried:"\u{1F61F}",angry:"\u{1F620}",rage:"\u{1F621}",cry:"\u{1F622}",persevere:"\u{1F623}",triumph:"\u{1F624}",disappointed_relieved:"\u{1F625}",frowning:"\u{1F626}",anguished:"\u{1F627}",fearful:"\u{1F628}",weary:"\u{1F629}",sleepy:"\u{1F62A}",tired_face:"\u{1F62B}"};function Gd(o){return o.replace(/[-_]+/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function dO(o){return o.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function pO(o){let i=o.trim().match(/^(.+?)\s*(===|==|!=|<=|<|>=|>|in|nin)\s*(.+)$/);if(!i)return!1;let t=i[1].trim(),r=i[2],n=i[3].trim();switch(r){case"===":return t===n;case"==":return t==n;case"!=":return t!=n;case"<=":return t<=n;case"<":return t<n;case">=":return t>=n;case">":return t>n;case"in":return n.split(",").map(a=>a.trim()).includes(t);case"nin":return!n.split(",").map(a=>a.trim()).includes(t);default:return!1}}function Wd(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var Ku=class{constructor(i,t){this.visibleCount=1/0;this.resizeRafId=0;this.host=i,this.options=t,i.addController(this),new St(i,{callback:()=>{this.resizeRafId||(this.resizeRafId=requestAnimationFrame(()=>{this.resizeRafId=0,this.measure()}))}})}hostUpdated(){this.measure()}measure(){let i=this.options.groups(),t=this.options.container();if(!i.length||!t)return;let r=getComputedStyle(t),n=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=[...t.children].filter(m=>!m.classList.contains("toolbar__group")).reduce((m,f)=>m+f.getBoundingClientRect().width,0),s=t.clientWidth-n-a;if(s<=0)return;i.forEach(m=>m.style.display="");let l=i.map(m=>m.getBoundingClientRect().width),h=l.reduce((m,f)=>m+f,0)<=s?i.length:this.countThatFit(l,s-(this.options.reserve??44));i.forEach((m,f)=>m.style.display=f<h?"":"none"),h!==this.visibleCount&&(this.visibleCount=h,this.host.requestUpdate())}countThatFit(i,t){let r=0,n=0;for(let a of i){if(r+a>t)break;r+=a,n++}return n}};var H5=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.remarkd-rendered{--rmd-accent:#2367c8;--rmd-border:#d9dee7;--rmd-muted:#5f6d80;--rmd-soft:#eef5ff;--rmd-code-bg:#0f1626;--rmd-code-text:#f5f8ff;color:#18202f;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;word-wrap:break-word}.remarkd-rendered>.remarkd-section>:first-child,.remarkd-rendered>:first-child{margin-top:0}.remarkd-rendered p{margin:0 0 12px}.remarkd-rendered h1,.remarkd-rendered h2,.remarkd-rendered h3,.remarkd-rendered h4{line-height:1.2;margin:18px 0 10px}.remarkd-rendered h1{font-size:26px}.remarkd-rendered h2{font-size:21px}.remarkd-rendered h3{font-size:17px}.remarkd-rendered a{color:var(--rmd-accent)}.remarkd-rendered .btn{align-items:center;background:#f4f6f8;border:1px solid #cfd6df;border-radius:6px;color:#263241;cursor:pointer;display:inline-flex;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:2px 4px 2px 0;min-height:36px;padding:8px 14px;text-align:center;text-decoration:none;transition:background-color 160ms ease,border-color 160ms ease,box-shadow 160ms ease,color 160ms ease;vertical-align:middle}.remarkd-rendered .btn:hover,.remarkd-rendered .btn:focus{background:#e9edf2;border-color:#b9c3cf;color:#182230;text-decoration:none}.remarkd-rendered .btn:focus{box-shadow:0 0 0 3px rgba(35,103,200,0.22);outline:none}.remarkd-rendered .btn--primary{background:#2367c8;border-color:#2367c8;color:#fff}.remarkd-rendered .btn--primary:hover,.remarkd-rendered .btn--primary:focus{background:#1d58ad;border-color:#1d58ad;color:#fff}.remarkd-rendered .btn--secondary{background:#263241;border-color:#263241;color:#fff}.remarkd-rendered .btn--secondary:hover,.remarkd-rendered .btn--secondary:focus{background:#1a2430;border-color:#1a2430;color:#fff}.remarkd-rendered .btn--success{background:#177245;border-color:#177245;color:#fff}.remarkd-rendered .btn--success:hover,.remarkd-rendered .btn--success:focus{background:#105d37;border-color:#105d37;color:#fff}.remarkd-rendered .btn--danger{background:#b42318;border-color:#b42318;color:#fff}.remarkd-rendered .btn--danger:hover,.remarkd-rendered .btn--danger:focus{background:#971b12;border-color:#971b12;color:#fff}.remarkd-rendered .monospace,.remarkd-rendered kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.9em}.remarkd-rendered .monospace{background:#eef2f7;border-radius:4px;padding:1px 5px}.remarkd-rendered kbd{background:#f6f8fb;border:1px solid var(--rmd-border);border-bottom-width:2px;border-radius:5px;padding:1px 6px}.remarkd-rendered mark.highlight{background:#fff3bf;border-radius:3px;padding:0 3px}.remarkd-rendered .tooltip{border-bottom:1px dotted var(--rmd-muted);cursor:help}.remarkd-rendered sup.footnote,.remarkd-rendered sup.reference{color:var(--rmd-accent);font-size:0.75em}.remarkd-rendered ul,.remarkd-rendered ol{margin:0 0 12px;padding-left:24px}.remarkd-rendered li>p{margin:0 0 4px}.remarkd-rendered ul,.remarkd-rendered ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul{list-style-type:disc}.remarkd-rendered ul ul,.remarkd-rendered ul ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul ul{list-style-type:circle}.remarkd-rendered ul ul ul,.remarkd-rendered ul ul ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul ul ul{list-style-type:square}.remarkd-rendered ol:not(.reference){counter-reset:remarkd-item}.remarkd-rendered ol:not(.reference)>li{counter-increment:remarkd-item}.remarkd-rendered ol:not(.reference)>li::marker{content:counters(remarkd-item,".") ". "}.remarkd-rendered input[type=checkbox]{margin-right:4px;vertical-align:middle}.remarkd-rendered dl{margin:0 0 12px}.remarkd-rendered dt{font-weight:700}.remarkd-rendered dd{margin:0 0 8px 18px;color:var(--rmd-muted)}.remarkd-rendered blockquote{margin:0 0 12px;padding:4px 16px;border-left:4px solid var(--rmd-border);color:var(--rmd-muted)}.remarkd-rendered .hint-note{margin:0 0 12px;padding:12px 14px;border-left:4px solid var(--rmd-accent);background:var(--rmd-soft);border-radius:0 6px 6px 0}.remarkd-rendered .hint-caption{color:var(--rmd-accent)}.remarkd-rendered .hint-tip,.remarkd-rendered .hint-warning,.remarkd-rendered .hint-important,.remarkd-rendered .hint-caution,.remarkd-rendered .hint-danger,.remarkd-rendered .hint-success,.remarkd-rendered .hint-notice{margin:0 0 12px;padding:12px 14px;border-left:4px solid var(--rmd-accent);background:#f6f8fb;border-radius:0 6px 6px 0}.remarkd-rendered .hint-tip,.remarkd-rendered .hint-success{border-left-color:#1f9d57;background:#eafaf1}.remarkd-rendered .hint-tip .hint-caption,.remarkd-rendered .hint-success .hint-caption{color:#1f7a47}.remarkd-rendered .hint-warning,.remarkd-rendered .hint-caution{border-left-color:#b7791f;background:#fdf6e3}.remarkd-rendered .hint-warning .hint-caption,.remarkd-rendered .hint-caution .hint-caption{color:#8a5a07}.remarkd-rendered .hint-danger{border-left-color:#c0392b;background:#fdecea}.remarkd-rendered .hint-danger .hint-caption{color:#a02b1f}.remarkd-rendered .verse-block{margin:0 0 12px;padding:12px 14px;background:#f6f8fb;border-radius:6px;font-family:inherit;white-space:pre-wrap}.remarkd-rendered code{display:block;margin:0 0 12px;padding:14px 16px;border-radius:8px;background:var(--rmd-code-bg);color:var(--rmd-code-text);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.5;white-space:pre;overflow-x:auto}.remarkd-rendered .listing-block{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered .listing-block .content{padding:14px 16px;background:#f6f8fb;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;white-space:pre-wrap}.remarkd-rendered .callout{list-style:none;margin:0 0 6px;padding-left:28px;position:relative;color:var(--rmd-muted)}.remarkd-rendered .callout::before{content:attr(data-marker);position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--rmd-accent);color:#fff;font-size:12px;font-weight:700}.remarkd-rendered .example-block,.remarkd-rendered .sidebar-block{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px}.remarkd-rendered .example-block .content,.remarkd-rendered .sidebar-block .content{padding:14px 16px}.remarkd-rendered .sidebar-block{background:#f6f8fb}.remarkd-rendered .title{display:block;font-weight:700;color:var(--rmd-muted);margin-bottom:6px}.remarkd-rendered .accordion-container{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered button.accordion{display:block;width:100%;text-align:left;padding:11px 14px;border:0;border-top:1px solid var(--rmd-border);background:#f6f8fb;font:inherit;font-weight:650;cursor:pointer}.remarkd-rendered button.accordion:first-child{border-top:0}.remarkd-rendered .accordion-container .panel{padding:12px 14px}.remarkd-rendered .tab-group{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered .tab-header{display:flex;flex-wrap:wrap;gap:4px;margin:0;padding:6px 6px 0;list-style:none;background:#f6f8fb;border-bottom:1px solid var(--rmd-border)}.remarkd-rendered .tab-header a{display:block;padding:7px 12px;border-radius:6px 6px 0 0;text-decoration:none;color:var(--rmd-muted);font-weight:650}.remarkd-rendered .tab-header a.active{background:#fff;color:var(--rmd-accent)}.remarkd-rendered .tabs .tab{padding:14px}.remarkd-rendered .tabs .tab+.tab{border-top:1px dashed var(--rmd-border)}.remarkd-rendered .steps-container{margin:0 0 12px;counter-reset:rmd-step}.remarkd-rendered .step{display:flex;gap:14px;padding:12px 0;border-top:1px solid var(--rmd-border)}.remarkd-rendered .step:first-child{border-top:0}.remarkd-rendered .step-content{flex:1}.remarkd-rendered .step-content h3{margin:0 0 6px;counter-increment:rmd-step}.remarkd-rendered .step-content h3::before{content:counter(rmd-step) ". ";color:var(--rmd-accent)}.remarkd-rendered .step-image img{max-width:120px;border-radius:6px}.remarkd-rendered .table-block{margin:0 0 12px}.remarkd-rendered .remarkd-table{border-collapse:collapse;width:100%}.remarkd-rendered .remarkd-table th,.remarkd-rendered .remarkd-table td{border:1px solid var(--rmd-border);padding:8px 10px;text-align:left}.remarkd-rendered .remarkd-table th{background:#eef2f7}.remarkd-rendered .remarkd-table--striped tbody tr:nth-child(even) td{background:#f8fafc}.remarkd-rendered .pros-cons-table th{background:#2367a6;color:#fff;font-size:1rem}.remarkd-rendered .pros-cons-table{table-layout:fixed}.remarkd-rendered .pros-cons-table .pros-cons-cell{width:50%}.remarkd-rendered .pros-cons-table--background .pros-cons-cell--con{background:#fae9e7}.remarkd-rendered .pros-cons-table--background .pros-cons-cell--pro{background:#e8f4ec}.remarkd-rendered .pros-cons-table--background.remarkd-table--striped tbody tr:nth-child(even) .pros-cons-cell--con{background:#f5d8d5}.remarkd-rendered .pros-cons-table--background.remarkd-table--striped tbody tr:nth-child(even) .pros-cons-cell--pro{background:#d4eadb}.remarkd-rendered .pros-cons-table--text-color .pros-cons-cell--con{color:#a62b25}.remarkd-rendered .pros-cons-table--text-color .pros-cons-cell--pro{color:#155d30}.remarkd-rendered .pros-cons-table .pros-cons-icon{display:inline-block;margin-right:8px}.remarkd-rendered img{max-width:100%}.remarkd-rendered img.block{display:block;margin:0 0 12px}.remarkd-rendered .align-center{text-align:center}.remarkd-rendered .align-right{text-align:right}.remarkd-rendered .align-center img.block{margin-left:auto;margin-right:auto}.remarkd-rendered .align-right img.block{margin-left:auto}.remarkd-rendered .video-container{position:relative;width:100%;margin:0 0 12px;background:#000;border-radius:8px;overflow:hidden}.remarkd-rendered .video-container iframe,.remarkd-rendered .video-container video{position:absolute;inset:0;width:100%;height:100%;border:0}.remarkd-rendered ol.reference{font-size:0.9em;color:var(--rmd-muted)}.remarkd-rendered .reference-tobody{text-decoration:none;margin-right:4px}.remarkd-rendered .remarkd-meter-label{display:block;font-size:0.85em;color:var(--rmd-muted)}.remarkd-rendered .remarkd-meter{width:180px;max-width:100%}.remarkd-rendered hr{border:0;border-top:1px solid var(--rmd-border);margin:18px 0}:host{display:block;overflow:hidden}.remarkd-editor{position:relative;display:flex;flex-direction:column;max-height:var(--remarkd-editor-max-height,100dvh);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background-color:rgba(var(--zn-panel),var(--zn-panel-opacity))}.remarkd-editor__toolbar{display:flex;flex:none;gap:2px;flex-wrap:nowrap;padding:var(--zn-spacing-x-small);border-bottom:1px solid rgb(var(--zn-border-color))}.toolbar__group{display:flex;flex-shrink:0;gap:2px;align-items:center}.toolbar__group+.toolbar__group::before{content:"";align-self:stretch;margin-inline:4px;border-left:1px solid rgb(var(--zn-border-color))}.remarkd-editor__toolbar-more zn-menu{--zn-menu-max-height:var(--auto-size-available-height,60dvh)}.remarkd-editor__body{padding:var(--zn-spacing-large) var(--zn-spacing-large) var(--zn-spacing-large) 52px;min-height:var(--remarkd-editor-min-height,10rem);overflow-y:auto}.remarkd-editor__body--raw{display:flex;padding-left:var(--zn-spacing-large)}.remarkd-editor__raw-toggle{margin-left:auto}.remarkd-editor__raw{flex:1;min-height:var(--remarkd-editor-min-height,10rem);resize:vertical;border:0;background:transparent;color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.875rem;line-height:1.5;padding:0;outline:none}.remarkd-editor--disabled{opacity:0.6;pointer-events:none}.remarkd-editor__block{position:relative;border-radius:var(--zn-border-radius)}.remarkd-editor__actions{position:absolute;left:-40px;top:4px;display:flex;flex-direction:column;align-items:center;gap:2px;opacity:0;transition:opacity 0.15s ease}.remarkd-editor__block:hover .remarkd-editor__actions,.remarkd-editor__actions:focus-within{opacity:1}.remarkd-editor__delete{position:absolute;top:2px;right:2px;z-index:5;opacity:0;transition:opacity 0.15s ease}.remarkd-editor__block:hover .remarkd-editor__delete,.remarkd-editor__delete:focus-within{opacity:1}.remarkd-editor__drag-handle{display:inline-flex;align-items:center;padding:2px;color:var(--zn-color-neutral-400,#9aa4b2);cursor:grab;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.remarkd-editor__drag-handle:active{cursor:grabbing}.remarkd-editor__ghost{position:fixed;top:0;left:0;z-index:20;pointer-events:none;opacity:0.9;background:var(--zn-color-neutral-0,white);border-radius:var(--zn-border-radius);box-shadow:0 8px 24px rgba(0,0,0,0.15);max-width:50%;max-height:160px;overflow:hidden}.remarkd-editor__block--dragging{opacity:0.4}.remarkd-editor__block--drop-before::before,.remarkd-editor__block--drop-after::after{content:"";position:absolute;left:0;right:0;height:6px;border-radius:3px;background:rgba(var(--zn-primary),0.6);pointer-events:none}.remarkd-editor__block--drop-before::before{top:-4px}.remarkd-editor__block--drop-after::after{bottom:-4px}.remarkd-editor__rendered{padding:var(--zn-spacing-x-small);border-radius:var(--zn-border-radius);cursor:text}.remarkd-editor__rendered:hover{background:var(--zn-color-neutral-100)}.remarkd-editor__edit-shell{border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);padding:var(--zn-spacing-x-small)}.remarkd-editor__edit-shell:focus-within{border-top-color:rgb(var(--zn-primary));border-right-color:rgb(var(--zn-primary));border-bottom-color:rgb(var(--zn-primary))}.remarkd-editor__edit-shell:not([class*=hint-]):focus-within{border-left-color:rgb(var(--zn-primary))}.remarkd-editor__input{display:block;width:100%;resize:none;overflow:hidden;border:0;background:transparent;color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.875rem;line-height:1.5;padding:0;outline:none}.remarkd-editor__edit-shell[class*=hint-] .remarkd-editor__input{font:inherit}.remarkd-editor__edit-shell--h1 .remarkd-editor__input,.remarkd-editor__edit-shell--h2 .remarkd-editor__input,.remarkd-editor__edit-shell--h3 .remarkd-editor__input{font-family:inherit;font-weight:700;line-height:1.2}.remarkd-editor__edit-shell--h1 .remarkd-editor__input{font-size:26px}.remarkd-editor__edit-shell--h2 .remarkd-editor__input{font-size:21px}.remarkd-editor__edit-shell--h3 .remarkd-editor__input{font-size:17px}.remarkd-editor__edit-shell--code{background:var(--rmd-code-bg,#0f1626)}.remarkd-editor__edit-shell--code .remarkd-editor__input{color:var(--rmd-code-text,#f5f8ff)}.remarkd-editor__include{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small);border:1px dashed rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__include-title{font-weight:600}.remarkd-editor__include-meta{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__include--missing{border-style:solid;border-color:rgb(var(--zn-color-error))}.remarkd-editor__include-scope{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__include-link{margin-left:auto;font-size:var(--zn-font-size-small)}.remarkd-editor__conditional{border-left:3px solid rgba(var(--zn-primary),0.5);padding-left:var(--zn-spacing-small)}.remarkd-editor__conditional-label{display:inline-flex;align-items:center;gap:4px;margin-bottom:var(--zn-spacing-x-small);color:rgb(var(--zn-primary));font-size:0.75rem;text-transform:uppercase;letter-spacing:0.04em}.remarkd-editor__meta{display:flex;flex-wrap:wrap;gap:var(--zn-spacing-x-small)}.remarkd-editor__variable{display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);padding:2px var(--zn-spacing-x-small);border:1px dashed rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);font-size:0.875rem}.remarkd-editor__variable-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.remarkd-editor__variable-state{color:rgb(var(--zn-text-body));font-style:italic}.remarkd-editor__var{padding:0 2px;border-radius:3px;background:rgba(var(--zn-primary),0.12);color:rgb(var(--zn-primary));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.remarkd-editor__include-picker{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-small);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__include-picker-head{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__include-filter{flex:1 1 auto}.remarkd-editor__include-option{display:flex;justify-content:space-between;gap:var(--zn-spacing-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-small);border:0;border-radius:var(--zn-border-radius);background:none;cursor:pointer;text-align:left}.remarkd-editor__include-option:hover:not(:disabled){background:var(--zn-color-neutral-100)}.remarkd-editor__include-option:disabled{cursor:default;opacity:0.6}.remarkd-editor__include-option-meta,.remarkd-editor__include-picker-empty{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__image-controls{display:flex;flex-direction:column;gap:var(--zn-spacing-small);border:1px solid rgb(var(--zn-primary));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);padding:var(--zn-spacing-small)}.remarkd-editor__image-controls-preview{text-align:left}.remarkd-editor__image-controls-preview--center{text-align:center}.remarkd-editor__image-controls-preview--right{text-align:right}.remarkd-editor__image-controls-preview img{max-width:100%;max-height:240px}.remarkd-editor__image-row{display:flex;align-items:flex-end;gap:var(--zn-spacing-small);flex-wrap:wrap}.remarkd-editor__image-field{display:flex;flex-direction:column;gap:2px}.remarkd-editor__image-field span{font-size:var(--zn-input-label-font-size-small);color:var(--zn-input-label-color);font-weight:var(--zn-font-weight-semibold)}.remarkd-editor__image-field input{border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);color:inherit;font:inherit;font-size:0.875rem;padding:4px 8px;outline:none}.remarkd-editor__image-field input:focus{border-color:rgb(var(--zn-primary))}.remarkd-editor__image-field:first-child input{width:100%}.remarkd-editor__image-buttons{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__image-buttons-spacer{margin-left:auto}.remarkd-editor__image-picker{display:flex;align-items:flex-start;gap:var(--zn-spacing-x-small);margin:var(--zn-spacing-x-small) 0}.remarkd-editor__image-picker zn-file{flex:1}.remarkd-editor__add{padding:var(--zn-spacing-x-small);min-height:1.8em;color:var(--zn-color-neutral-400,#9aa4b2);cursor:text}.remarkd-editor__edit-wrap{position:relative}.remarkd-editor__validation{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}.remarkd-editor__link-picker{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);margin-top:var(--zn-spacing-x-small);padding:var(--zn-spacing-small);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__link-picker-head{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__link-filter{flex:1 1 auto}.remarkd-editor__link-option{display:flex;justify-content:space-between;gap:var(--zn-spacing-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-small);border:0;border-radius:var(--zn-border-radius);background:none;cursor:pointer;text-align:left}.remarkd-editor__link-option:hover{background:var(--zn-color-neutral-100)}.remarkd-editor__link-option-meta,.remarkd-editor__link-picker-empty{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__link--missing{text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(var(--zn-color-error))}.remarkd-editor__shortcut{color:rgb(var(--zn-text-muted));font-size:var(--zn-font-size-x-small)}`;var F5=/^include::([^[]+)\[(.*)]\s*$/,U5="kb:(?:document|category|page)\\/[A-Za-z0-9_-]+",hO=new RegExp(`^${U5}$`),uO=new RegExp(U5,"g"),mO=/^:([A-Za-z0-9_-]+)(!)?:\s*(.*)$/,fO=/^\.([^.\s].*)$/,gO=/^\[.+]$/;function bO(o){let i=mO.exec(o);if(i)return{kind:"attribute",name:i[1],value:i[3],unset:!!i[2]};let t=fO.exec(o);return t?{kind:"title",text:t[1]}:gO.test(o)?{kind:"bracket",text:o}:null}function vO(o){let i=o.split(`
4490
- `).map(r=>r.trim()).filter(r=>r!=="");if(!i.length)return null;let t=[];for(let r of i){let n=bO(r);if(!n)return null;t.push(n)}return t}var B5="|===",V5=/^\|={3,}$/,Kd=/^(?:ifdef|ifndef)::[^[]*\[]$/,tc=/^ifeval::\[[^\]]*]$/,j5=/^endif::\[]$/,yO=/^(ifdef|ifndef|iftrue|iffalse|ifempty|ifnempty)::([^[]+)\[([^\]]+)]\s*$/;function xO(o,i){let t=i.replace(/[\r\n]+/g," ").replace(/\[/g,"(").replace(/]/g,")").trim();return`include::${o}[${t}]`}function wO(o,i){return`[${i.replace(/[\r\n]/g," ").replace(/\[/g,"(").replace(/]/g,")").trim()}](${o})`}var _O=z5(Uu),zO=200;function kO(o){let i=o.indexOf("(");if(i===-1||!o.endsWith(")"))return null;let t=o.slice(0,i).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t}\\([^)]*\\)`)}function cv(o){try{return q5(o)}catch{return`<pre class="remarkd-editor__unparsed">${o.replace(/[&<>]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[i])}</pre>`}}function G5(o,i){let t=1;for(let r=i;r<o.length;r++){let n=o[r].trimEnd();if(Kd.test(n)||tc.test(n))t++;else if(j5.test(n)&&--t===0)return r}return-1}var W5={ifdef:"is defined",ifndef:"is not defined",iftrue:"is true",iffalse:"is false",ifempty:"is empty",ifnempty:"is not empty"};function K5(o){if(tc.test(o))return`shown when ${o.slice(9,-1)}`;let i=o.slice(0,o.indexOf("::"));return`shown when ${o.slice(o.indexOf("::")+2,o.indexOf("["))} ${W5[i]??"is defined"}`}function SO(o,i){return`shown when ${i} ${W5[o]??"is defined"}`}function Y5(o){let i=[],t=[],r=()=>{t.length&&i.push({kind:"content",lines:t}),t=[]};for(let n=0;n<o.length;n++){let a=o[n].trimEnd();if(Kd.test(a)||tc.test(a)){r();let s=G5(o,n+1),l=o.slice(n+1,s===-1?void 0:s);i.push({kind:"nested",label:K5(a),parts:Y5(l)}),n=s===-1?o.length:s;continue}t.push(o[n])}return r(),i}function CO(o){let i=o.length===1&&o[0].kind==="content"?o[0]:void 0;if(o.length===0||i){let t=i?.lines.join(`
4489
+ `+r:i.push(r)}return i}function lv(o,i){let t=new R5(o,!1,i.options);return t.attrs=i.attrs,t.parse().replace(/^<div class="remarkd-section section--level0 section--with-content">/,"").replace(/<\/div>$/,"")}function N5(o,i,t=0){if(t>10)return o;let r=[];for(let n of o){let a=n.match(/^t::partial::(.*)$/);if(!a){r.push(n);continue}let[s,l]=aO(a[1]??""),d=P5(i,s);if(d===null){r.push(`File not found: ${s}`);continue}let h=O5(d);for(sO(l,"strip-title")&&(h[0]??"").startsWith("=")&&(h=h.slice(1));h.length&&h[h.length-1].trim()==="";)h.pop();let m=Number.parseInt(l["drop-last"]??"0",10);m>0&&h.splice(-m),r.push(...N5(h,i,t+1))}return r}function aO(o){let i=o.trim(),t={},r=i.match(/^(.*?)\[([^\]]*)]$/);if(r){i=r[1].trim();for(let n of r[2].split(",")){let a=n.trim();if(!a)continue;let s=a.indexOf("=");s===-1?t[a]="true":t[a.slice(0,s).trim()]=a.slice(s+1).trim().replace(/^["']|["']$/g,"")}}return[i,t]}function sO(o,i){return i in o?!["0","false","no"].includes(o[i].toLowerCase()):!1}function P5(o,i){if(o.partials&&Object.prototype.hasOwnProperty.call(o.partials,i))return o.partials[i];let t=globalThis.process,r=t?.getBuiltinModule?.("node:fs");if(!r?.existsSync||!r?.readFileSync)return null;let n=lO(o.projectRoot||t?.cwd?.()||"",i);return r.existsSync(n)?r.readFileSync(n,"utf8"):null}function lO(o,i){return/^(\/|[A-Za-z]:[\\/])/.test(i)||!o?i:`${o.replace(/[\\/]+$/,"")}/${i.replace(/^[\\/]+/,"")}`}function ec(o){let i=o.trim().replace(/^\[/,"").replace(/]$/,""),t=[],r={},n=/(^|[\s,]+)([^, =}]+)(=(("([^"]*)")|([^\s,}]*)))?/g,a;for(;a=n.exec(i);){let s=a[2],l=a[6]||a[7]||"";t.push(s),r[s]=l}return{raw:i,pos:t,named:r}}function cO(o){return!!o&&(o.pos[0]==="pros-cons"||o.pos[0]==="proscons"||"pros-cons"in o.named||"proscons"in o.named)}function Cs(o,i,t){return!o||!(i in o.named)?t:!["0","false","no","off"].includes((o.named[i]||"").toLowerCase())}function dO(o,i){let t=i===0?o?.named["con-icon"]||"\u274C":o?.named["pro-icon"]||"\u2705";return`<span class="pros-cons-icon">${Wd(t)}</span>`}var pO={"+1":"\u{1F44D}",thumbsup:"\u{1F44D}","-1":"\u{1F44E}",thumbsdown:"\u{1F44E}",eyes:"\u{1F440}",grinning:"\u{1F600}",grin:"\u{1F601}",joy:"\u{1F602}",smiley:"\u{1F603}",smile:"\u{1F604}",sweat_smile:"\u{1F605}",satisfied:"\u{1F606}",laughing:"\u{1F606}",innocent:"\u{1F607}",smiling_imp:"\u{1F608}",wink:"\u{1F609}",blush:"\u{1F60A}",yum:"\u{1F60B}",relieved:"\u{1F60C}",heart_eyes:"\u{1F60D}",sunglasses:"\u{1F60E}",smirk:"\u{1F60F}",neutral_face:"\u{1F610}",expressionless:"\u{1F611}",unamused:"\u{1F612}",sweat:"\u{1F613}",pensive:"\u{1F614}",confused:"\u{1F615}",confounded:"\u{1F616}",kissing:"\u{1F617}",kissing_heart:"\u{1F618}",kissing_smiling_eyes:"\u{1F619}",kissing_closed_eyes:"\u{1F61A}",stuck_out_tongue:"\u{1F61B}",stuck_out_tongue_winking_eye:"\u{1F61C}",stuck_out_tongue_closed_eyes:"\u{1F61D}",disappointed:"\u{1F61E}",worried:"\u{1F61F}",angry:"\u{1F620}",rage:"\u{1F621}",cry:"\u{1F622}",persevere:"\u{1F623}",triumph:"\u{1F624}",disappointed_relieved:"\u{1F625}",frowning:"\u{1F626}",anguished:"\u{1F627}",fearful:"\u{1F628}",weary:"\u{1F629}",sleepy:"\u{1F62A}",tired_face:"\u{1F62B}"};function Gd(o){return o.replace(/[-_]+/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function hO(o){return o.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function uO(o){let i=o.trim().match(/^(.+?)\s*(===|==|!=|<=|<|>=|>|in|nin)\s*(.+)$/);if(!i)return!1;let t=i[1].trim(),r=i[2],n=i[3].trim();switch(r){case"===":return t===n;case"==":return t==n;case"!=":return t!=n;case"<=":return t<=n;case"<":return t<n;case">=":return t>=n;case">":return t>n;case"in":return n.split(",").map(a=>a.trim()).includes(t);case"nin":return!n.split(",").map(a=>a.trim()).includes(t);default:return!1}}function Wd(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var Ku=class{constructor(i,t){this.visibleCount=1/0;this.resizeRafId=0;this.host=i,this.options=t,i.addController(this),new St(i,{callback:()=>{this.resizeRafId||(this.resizeRafId=requestAnimationFrame(()=>{this.resizeRafId=0,this.measure()}))}})}hostUpdated(){this.measure()}measure(){let i=this.options.groups(),t=this.options.container();if(!i.length||!t)return;let r=getComputedStyle(t),n=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=[...t.children].filter(m=>!m.classList.contains("toolbar__group")).reduce((m,f)=>m+f.getBoundingClientRect().width,0),s=t.clientWidth-n-a;if(s<=0)return;i.forEach(m=>m.style.display="");let l=i.map(m=>m.getBoundingClientRect().width),h=l.reduce((m,f)=>m+f,0)<=s?i.length:this.countThatFit(l,s-(this.options.reserve??44));i.forEach((m,f)=>m.style.display=f<h?"":"none"),h!==this.visibleCount&&(this.visibleCount=h,this.host.requestUpdate())}countThatFit(i,t){let r=0,n=0;for(let a of i){if(r+a>t)break;r+=a,n++}return n}};var H5=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.remarkd-rendered{--rmd-accent:#2367c8;--rmd-border:#d9dee7;--rmd-muted:#5f6d80;--rmd-soft:#eef5ff;--rmd-code-bg:#0f1626;--rmd-code-text:#f5f8ff;color:#18202f;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;word-wrap:break-word}.remarkd-rendered>.remarkd-section>:first-child,.remarkd-rendered>:first-child{margin-top:0}.remarkd-rendered p{margin:0 0 12px}.remarkd-rendered h1,.remarkd-rendered h2,.remarkd-rendered h3,.remarkd-rendered h4{line-height:1.2;margin:18px 0 10px}.remarkd-rendered h1{font-size:26px}.remarkd-rendered h2{font-size:21px}.remarkd-rendered h3{font-size:17px}.remarkd-rendered a{color:var(--rmd-accent)}.remarkd-rendered .btn{align-items:center;background:#f4f6f8;border:1px solid #cfd6df;border-radius:6px;color:#263241;cursor:pointer;display:inline-flex;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:2px 4px 2px 0;min-height:36px;padding:8px 14px;text-align:center;text-decoration:none;transition:background-color 160ms ease,border-color 160ms ease,box-shadow 160ms ease,color 160ms ease;vertical-align:middle}.remarkd-rendered .btn:hover,.remarkd-rendered .btn:focus{background:#e9edf2;border-color:#b9c3cf;color:#182230;text-decoration:none}.remarkd-rendered .btn:focus{box-shadow:0 0 0 3px rgba(35,103,200,0.22);outline:none}.remarkd-rendered .btn--primary{background:#2367c8;border-color:#2367c8;color:#fff}.remarkd-rendered .btn--primary:hover,.remarkd-rendered .btn--primary:focus{background:#1d58ad;border-color:#1d58ad;color:#fff}.remarkd-rendered .btn--secondary{background:#263241;border-color:#263241;color:#fff}.remarkd-rendered .btn--secondary:hover,.remarkd-rendered .btn--secondary:focus{background:#1a2430;border-color:#1a2430;color:#fff}.remarkd-rendered .btn--success{background:#177245;border-color:#177245;color:#fff}.remarkd-rendered .btn--success:hover,.remarkd-rendered .btn--success:focus{background:#105d37;border-color:#105d37;color:#fff}.remarkd-rendered .btn--danger{background:#b42318;border-color:#b42318;color:#fff}.remarkd-rendered .btn--danger:hover,.remarkd-rendered .btn--danger:focus{background:#971b12;border-color:#971b12;color:#fff}.remarkd-rendered .monospace,.remarkd-rendered kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.9em}.remarkd-rendered .monospace{background:#eef2f7;border-radius:4px;padding:1px 5px}.remarkd-rendered kbd{background:#f6f8fb;border:1px solid var(--rmd-border);border-bottom-width:2px;border-radius:5px;padding:1px 6px}.remarkd-rendered mark.highlight{background:#fff3bf;border-radius:3px;padding:0 3px}.remarkd-rendered .tooltip{border-bottom:1px dotted var(--rmd-muted);cursor:help}.remarkd-rendered sup.footnote,.remarkd-rendered sup.reference{color:var(--rmd-accent);font-size:0.75em}.remarkd-rendered ul,.remarkd-rendered ol{margin:0 0 12px;padding-left:24px}.remarkd-rendered li>p{margin:0 0 4px}.remarkd-rendered ul,.remarkd-rendered ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul{list-style-type:disc}.remarkd-rendered ul ul,.remarkd-rendered ul ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul ul{list-style-type:circle}.remarkd-rendered ul ul ul,.remarkd-rendered ul ul ul ul ul ul,.remarkd-rendered ul ul ul ul ul ul ul ul ul{list-style-type:square}.remarkd-rendered ol:not(.reference){counter-reset:remarkd-item}.remarkd-rendered ol:not(.reference)>li{counter-increment:remarkd-item}.remarkd-rendered ol:not(.reference)>li::marker{content:counters(remarkd-item,".") ". "}.remarkd-rendered input[type=checkbox]{margin-right:4px;vertical-align:middle}.remarkd-rendered dl{margin:0 0 12px}.remarkd-rendered dt{font-weight:700}.remarkd-rendered dd{margin:0 0 8px 18px;color:var(--rmd-muted)}.remarkd-rendered blockquote{margin:0 0 12px;padding:4px 16px;border-left:4px solid var(--rmd-border);color:var(--rmd-muted)}.remarkd-rendered .hint-note{margin:0 0 12px;padding:12px 14px;border-left:4px solid var(--rmd-accent);background:var(--rmd-soft);border-radius:0 6px 6px 0}.remarkd-rendered .hint-caption{color:var(--rmd-accent)}.remarkd-rendered .hint-tip,.remarkd-rendered .hint-warning,.remarkd-rendered .hint-important,.remarkd-rendered .hint-caution,.remarkd-rendered .hint-danger,.remarkd-rendered .hint-success,.remarkd-rendered .hint-notice{margin:0 0 12px;padding:12px 14px;border-left:4px solid var(--rmd-accent);background:#f6f8fb;border-radius:0 6px 6px 0}.remarkd-rendered .hint-tip,.remarkd-rendered .hint-success{border-left-color:#1f9d57;background:#eafaf1}.remarkd-rendered .hint-tip .hint-caption,.remarkd-rendered .hint-success .hint-caption{color:#1f7a47}.remarkd-rendered .hint-warning,.remarkd-rendered .hint-caution{border-left-color:#b7791f;background:#fdf6e3}.remarkd-rendered .hint-warning .hint-caption,.remarkd-rendered .hint-caution .hint-caption{color:#8a5a07}.remarkd-rendered .hint-danger{border-left-color:#c0392b;background:#fdecea}.remarkd-rendered .hint-danger .hint-caption{color:#a02b1f}.remarkd-rendered .verse-block{margin:0 0 12px;padding:12px 14px;background:#f6f8fb;border-radius:6px;font-family:inherit;white-space:pre-wrap}.remarkd-rendered code{display:block;margin:0 0 12px;padding:14px 16px;border-radius:8px;background:var(--rmd-code-bg);color:var(--rmd-code-text);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.5;white-space:pre;overflow-x:auto}.remarkd-rendered .listing-block{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered .listing-block .content{padding:14px 16px;background:#f6f8fb;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;white-space:pre-wrap}.remarkd-rendered .callout{list-style:none;margin:0 0 6px;padding-left:28px;position:relative;color:var(--rmd-muted)}.remarkd-rendered .callout::before{content:attr(data-marker);position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--rmd-accent);color:#fff;font-size:12px;font-weight:700}.remarkd-rendered .example-block,.remarkd-rendered .sidebar-block{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px}.remarkd-rendered .example-block .content,.remarkd-rendered .sidebar-block .content{padding:14px 16px}.remarkd-rendered .sidebar-block{background:#f6f8fb}.remarkd-rendered .title{display:block;font-weight:700;color:var(--rmd-muted);margin-bottom:6px}.remarkd-rendered .accordion-container{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered button.accordion{display:block;width:100%;text-align:left;padding:11px 14px;border:0;border-top:1px solid var(--rmd-border);background:#f6f8fb;font:inherit;font-weight:650;cursor:pointer}.remarkd-rendered button.accordion:first-child{border-top:0}.remarkd-rendered .accordion-container .panel{padding:12px 14px}.remarkd-rendered .tab-group{margin:0 0 12px;border:1px solid var(--rmd-border);border-radius:8px;overflow:hidden}.remarkd-rendered .tab-header{display:flex;flex-wrap:wrap;gap:4px;margin:0;padding:6px 6px 0;list-style:none;background:#f6f8fb;border-bottom:1px solid var(--rmd-border)}.remarkd-rendered .tab-header a{display:block;padding:7px 12px;border-radius:6px 6px 0 0;text-decoration:none;color:var(--rmd-muted);font-weight:650}.remarkd-rendered .tab-header a.active{background:#fff;color:var(--rmd-accent)}.remarkd-rendered .tabs .tab{padding:14px}.remarkd-rendered .tabs .tab+.tab{border-top:1px dashed var(--rmd-border)}.remarkd-rendered .steps-container{margin:0 0 12px;counter-reset:rmd-step}.remarkd-rendered .step{display:flex;gap:14px;padding:12px 0;border-top:1px solid var(--rmd-border)}.remarkd-rendered .step:first-child{border-top:0}.remarkd-rendered .step-content{flex:1}.remarkd-rendered .step-content h3{margin:0 0 6px;counter-increment:rmd-step}.remarkd-rendered .step-content h3::before{content:counter(rmd-step) ". ";color:var(--rmd-accent)}.remarkd-rendered .step-image img{max-width:120px;border-radius:6px}.remarkd-rendered .table-block{margin:0 0 12px}.remarkd-rendered .remarkd-table{border-collapse:collapse;width:100%}.remarkd-rendered .remarkd-table th,.remarkd-rendered .remarkd-table td{border:1px solid var(--rmd-border);padding:8px 10px;text-align:left}.remarkd-rendered .remarkd-table th{background:#eef2f7}.remarkd-rendered .remarkd-table--striped tbody tr:nth-child(even) td{background:#f8fafc}.remarkd-rendered .pros-cons-table th{background:#2367a6;color:#fff;font-size:1rem}.remarkd-rendered .pros-cons-table{table-layout:fixed}.remarkd-rendered .pros-cons-table .pros-cons-cell{width:50%}.remarkd-rendered .pros-cons-table--background .pros-cons-cell--con{background:#fae9e7}.remarkd-rendered .pros-cons-table--background .pros-cons-cell--pro{background:#e8f4ec}.remarkd-rendered .pros-cons-table--background.remarkd-table--striped tbody tr:nth-child(even) .pros-cons-cell--con{background:#f5d8d5}.remarkd-rendered .pros-cons-table--background.remarkd-table--striped tbody tr:nth-child(even) .pros-cons-cell--pro{background:#d4eadb}.remarkd-rendered .pros-cons-table--text-color .pros-cons-cell--con{color:#a62b25}.remarkd-rendered .pros-cons-table--text-color .pros-cons-cell--pro{color:#155d30}.remarkd-rendered .pros-cons-table .pros-cons-icon{display:inline-block;margin-right:8px}.remarkd-rendered img{max-width:100%}.remarkd-rendered img.block{display:block;margin:0 0 12px}.remarkd-rendered .align-center{text-align:center}.remarkd-rendered .align-right{text-align:right}.remarkd-rendered .align-center img.block{margin-left:auto;margin-right:auto}.remarkd-rendered .align-right img.block{margin-left:auto}.remarkd-rendered .video-container{position:relative;width:100%;margin:0 0 12px;background:#000;border-radius:8px;overflow:hidden}.remarkd-rendered .video-container iframe,.remarkd-rendered .video-container video{position:absolute;inset:0;width:100%;height:100%;border:0}.remarkd-rendered ol.reference{font-size:0.9em;color:var(--rmd-muted)}.remarkd-rendered .reference-tobody{text-decoration:none;margin-right:4px}.remarkd-rendered .remarkd-meter-label{display:block;font-size:0.85em;color:var(--rmd-muted)}.remarkd-rendered .remarkd-meter{width:180px;max-width:100%}.remarkd-rendered hr{border:0;border-top:1px solid var(--rmd-border);margin:18px 0}:host{display:block;overflow:hidden}.remarkd-editor{position:relative;display:flex;flex-direction:column;max-height:var(--remarkd-editor-max-height,100dvh);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background-color:rgba(var(--zn-panel),var(--zn-panel-opacity))}.remarkd-editor__toolbar{display:flex;flex:none;gap:2px;flex-wrap:nowrap;padding:var(--zn-spacing-x-small);border-bottom:1px solid rgb(var(--zn-border-color))}.toolbar__group{display:flex;flex-shrink:0;gap:2px;align-items:center}.toolbar__group+.toolbar__group::before{content:"";align-self:stretch;margin-inline:4px;border-left:1px solid rgb(var(--zn-border-color))}.remarkd-editor__toolbar-more zn-menu{--zn-menu-max-height:var(--auto-size-available-height,60dvh)}.remarkd-editor__body{padding:var(--zn-spacing-large) var(--zn-spacing-large) var(--zn-spacing-large) 52px;min-height:var(--remarkd-editor-min-height,10rem);overflow-y:auto}.remarkd-editor__body--raw{display:flex;padding-left:var(--zn-spacing-large)}.remarkd-editor__raw-toggle{margin-left:auto}.remarkd-editor__raw{flex:1;min-height:var(--remarkd-editor-min-height,10rem);resize:vertical;border:0;background:transparent;color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.875rem;line-height:1.5;padding:0;outline:none}.remarkd-editor--disabled{opacity:0.6;pointer-events:none}.remarkd-editor__block{position:relative;border-radius:var(--zn-border-radius)}.remarkd-editor__actions{position:absolute;left:-40px;top:4px;display:flex;flex-direction:column;align-items:center;gap:2px;opacity:0;transition:opacity 0.15s ease}.remarkd-editor__block:hover .remarkd-editor__actions,.remarkd-editor__actions:focus-within{opacity:1}.remarkd-editor__delete{position:absolute;top:2px;right:2px;z-index:5;opacity:0;transition:opacity 0.15s ease}.remarkd-editor__block:hover .remarkd-editor__delete,.remarkd-editor__delete:focus-within{opacity:1}.remarkd-editor__drag-handle{display:inline-flex;align-items:center;padding:2px;color:var(--zn-color-neutral-400,#9aa4b2);cursor:grab;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.remarkd-editor__drag-handle:active{cursor:grabbing}.remarkd-editor__ghost{position:fixed;top:0;left:0;z-index:20;pointer-events:none;opacity:0.9;background:var(--zn-color-neutral-0,white);border-radius:var(--zn-border-radius);box-shadow:0 8px 24px rgba(0,0,0,0.15);max-width:50%;max-height:160px;overflow:hidden}.remarkd-editor__block--dragging{opacity:0.4}.remarkd-editor__block--drop-before::before,.remarkd-editor__block--drop-after::after{content:"";position:absolute;left:0;right:0;height:6px;border-radius:3px;background:rgba(var(--zn-primary),0.6);pointer-events:none}.remarkd-editor__block--drop-before::before{top:-4px}.remarkd-editor__block--drop-after::after{bottom:-4px}.remarkd-editor__rendered{padding:var(--zn-spacing-x-small);border-radius:var(--zn-border-radius);cursor:text}.remarkd-editor__rendered:hover{background:var(--zn-color-neutral-100)}.remarkd-editor__edit-shell{border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);padding:var(--zn-spacing-x-small)}.remarkd-editor__edit-shell:focus-within{border-top-color:rgb(var(--zn-primary));border-right-color:rgb(var(--zn-primary));border-bottom-color:rgb(var(--zn-primary))}.remarkd-editor__edit-shell:not([class*=hint-]):focus-within{border-left-color:rgb(var(--zn-primary))}.remarkd-editor__input{display:block;width:100%;resize:none;overflow:hidden;border:0;background:transparent;color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.875rem;line-height:1.5;padding:0;outline:none}.remarkd-editor__edit-shell[class*=hint-] .remarkd-editor__input{font:inherit}.remarkd-editor__edit-shell--h1 .remarkd-editor__input,.remarkd-editor__edit-shell--h2 .remarkd-editor__input,.remarkd-editor__edit-shell--h3 .remarkd-editor__input{font-family:inherit;font-weight:700;line-height:1.2}.remarkd-editor__edit-shell--h1 .remarkd-editor__input{font-size:26px}.remarkd-editor__edit-shell--h2 .remarkd-editor__input{font-size:21px}.remarkd-editor__edit-shell--h3 .remarkd-editor__input{font-size:17px}.remarkd-editor__edit-shell--code{background:var(--rmd-code-bg,#0f1626)}.remarkd-editor__edit-shell--code .remarkd-editor__input{color:var(--rmd-code-text,#f5f8ff)}.remarkd-editor__include{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small);border:1px dashed rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__include-title{font-weight:600}.remarkd-editor__include-meta{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__include--missing{border-style:solid;border-color:rgb(var(--zn-color-error))}.remarkd-editor__include-scope{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__include-link{margin-left:auto;font-size:var(--zn-font-size-small)}.remarkd-editor__conditional{border-left:3px solid rgba(var(--zn-primary),0.5);padding-left:var(--zn-spacing-small)}.remarkd-editor__conditional-label{display:inline-flex;align-items:center;gap:4px;margin-bottom:var(--zn-spacing-x-small);color:rgb(var(--zn-primary));font-size:0.75rem;text-transform:uppercase;letter-spacing:0.04em}.remarkd-editor__meta{display:flex;flex-wrap:wrap;gap:var(--zn-spacing-x-small)}.remarkd-editor__variable{display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);padding:2px var(--zn-spacing-x-small);border:1px dashed rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);font-size:0.875rem}.remarkd-editor__variable-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.remarkd-editor__variable-state{color:rgb(var(--zn-text-body));font-style:italic}.remarkd-editor__var{padding:0 2px;border-radius:3px;background:rgba(var(--zn-primary),0.12);color:rgb(var(--zn-primary));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.remarkd-editor__include-picker{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-small);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__include-picker-head{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__include-filter{flex:1 1 auto}.remarkd-editor__include-option{display:flex;justify-content:space-between;gap:var(--zn-spacing-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-small);border:0;border-radius:var(--zn-border-radius);background:none;cursor:pointer;text-align:left}.remarkd-editor__include-option:hover:not(:disabled){background:var(--zn-color-neutral-100)}.remarkd-editor__include-option:disabled{cursor:default;opacity:0.6}.remarkd-editor__include-option-meta,.remarkd-editor__include-picker-empty{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__image-controls{display:flex;flex-direction:column;gap:var(--zn-spacing-small);border:1px solid rgb(var(--zn-primary));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);padding:var(--zn-spacing-small)}.remarkd-editor__image-controls-preview{text-align:left}.remarkd-editor__image-controls-preview--center{text-align:center}.remarkd-editor__image-controls-preview--right{text-align:right}.remarkd-editor__image-controls-preview img{max-width:100%;max-height:240px}.remarkd-editor__image-row{display:flex;align-items:flex-end;gap:var(--zn-spacing-small);flex-wrap:wrap}.remarkd-editor__image-field{display:flex;flex-direction:column;gap:2px}.remarkd-editor__image-field span{font-size:var(--zn-input-label-font-size-small);color:var(--zn-input-label-color);font-weight:var(--zn-font-weight-semibold)}.remarkd-editor__image-field input{border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white);color:inherit;font:inherit;font-size:0.875rem;padding:4px 8px;outline:none}.remarkd-editor__image-field input:focus{border-color:rgb(var(--zn-primary))}.remarkd-editor__image-field:first-child input{width:100%}.remarkd-editor__image-buttons{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__image-buttons-spacer{margin-left:auto}.remarkd-editor__image-picker{display:flex;align-items:flex-start;gap:var(--zn-spacing-x-small);margin:var(--zn-spacing-x-small) 0}.remarkd-editor__image-picker zn-file{flex:1}.remarkd-editor__add{padding:var(--zn-spacing-x-small);min-height:1.8em;color:var(--zn-color-neutral-400,#9aa4b2);cursor:text}.remarkd-editor__edit-wrap{position:relative}.remarkd-editor__validation{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}.remarkd-editor__link-picker{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);margin-top:var(--zn-spacing-x-small);padding:var(--zn-spacing-small);border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);background:var(--zn-color-neutral-0,white)}.remarkd-editor__link-picker-head{display:flex;align-items:center;gap:var(--zn-spacing-x-small)}.remarkd-editor__link-filter{flex:1 1 auto}.remarkd-editor__link-option{display:flex;justify-content:space-between;gap:var(--zn-spacing-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-small);border:0;border-radius:var(--zn-border-radius);background:none;cursor:pointer;text-align:left}.remarkd-editor__link-option:hover{background:var(--zn-color-neutral-100)}.remarkd-editor__link-option-meta,.remarkd-editor__link-picker-empty{color:var(--zn-color-neutral-400,#9aa4b2);font-size:var(--zn-font-size-small)}.remarkd-editor__link--missing{text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(var(--zn-color-error))}.remarkd-editor__shortcut{color:rgb(var(--zn-text-muted));font-size:var(--zn-font-size-x-small)}`;var F5=/^include::([^[]+)\[(.*)]\s*$/,U5="kb:(?:document|category|page)\\/[A-Za-z0-9_-]+",mO=new RegExp(`^${U5}$`),fO=new RegExp(U5,"g"),gO=/^:([A-Za-z0-9_-]+)(!)?:\s*(.*)$/,bO=/^\.([^.\s].*)$/,vO=/^\[.+]$/;function yO(o){let i=gO.exec(o);if(i)return{kind:"attribute",name:i[1],value:i[3],unset:!!i[2]};let t=bO.exec(o);return t?{kind:"title",text:t[1]}:vO.test(o)?{kind:"bracket",text:o}:null}function xO(o){let i=o.split(`
4490
+ `).map(r=>r.trim()).filter(r=>r!=="");if(!i.length)return null;let t=[];for(let r of i){let n=yO(r);if(!n)return null;t.push(n)}return t}var B5="|===",V5=/^\|={3,}$/,Kd=/^(?:ifdef|ifndef)::[^[]*\[]$/,tc=/^ifeval::\[[^\]]*]$/,j5=/^endif::\[]$/,wO=/^(ifdef|ifndef|iftrue|iffalse|ifempty|ifnempty)::([^[]+)\[([^\]]+)]\s*$/;function _O(o,i){let t=i.replace(/[\r\n]+/g," ").replace(/\[/g,"(").replace(/]/g,")").trim();return`include::${o}[${t}]`}function zO(o,i){return`[${i.replace(/[\r\n]/g," ").replace(/\[/g,"(").replace(/]/g,")").trim()}](${o})`}var kO=z5(Uu),SO=200;function CO(o){let i=o.indexOf("(");if(i===-1||!o.endsWith(")"))return null;let t=o.slice(0,i).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t}\\([^)]*\\)`)}function cv(o){try{return q5(o)}catch{return`<pre class="remarkd-editor__unparsed">${o.replace(/[&<>]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[i])}</pre>`}}function G5(o,i){let t=1;for(let r=i;r<o.length;r++){let n=o[r].trimEnd();if(Kd.test(n)||tc.test(n))t++;else if(j5.test(n)&&--t===0)return r}return-1}var W5={ifdef:"is defined",ifndef:"is not defined",iftrue:"is true",iffalse:"is false",ifempty:"is empty",ifnempty:"is not empty"};function K5(o){if(tc.test(o))return`shown when ${o.slice(9,-1)}`;let i=o.slice(0,o.indexOf("::"));return`shown when ${o.slice(o.indexOf("::")+2,o.indexOf("["))} ${W5[i]??"is defined"}`}function EO(o,i){return`shown when ${i} ${W5[o]??"is defined"}`}function Y5(o){let i=[],t=[],r=()=>{t.length&&i.push({kind:"content",lines:t}),t=[]};for(let n=0;n<o.length;n++){let a=o[n].trimEnd();if(Kd.test(a)||tc.test(a)){r();let s=G5(o,n+1),l=o.slice(n+1,s===-1?void 0:s);i.push({kind:"nested",label:K5(a),parts:Y5(l)}),n=s===-1?o.length:s;continue}t.push(o[n])}return r(),i}function TO(o){let i=o.length===1&&o[0].kind==="content"?o[0]:void 0;if(o.length===0||i){let t=i?.lines.join(`
4491
4491
  `).trim()??"";return u`
4492
4492
  <div class="remarkd-editor__conditional-body remarkd-rendered remarkd-editor__rendered--parsed">
4493
4493
  ${t?Ft(cv(t)):""}
@@ -4501,9 +4501,9 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4501
4501
  <span class="remarkd-editor__conditional-label">
4502
4502
  <zn-icon src="git-branch@lu" size="14"></zn-icon>${o}
4503
4503
  </span>
4504
- ${CO(i)}
4505
- </div>`}function EO(o){let i=o.trim();if(i.includes(`
4506
- `))return null;let t=yO.exec(i);if(!t)return null;let[,r,n,a]=t;return dv(SO(r,n),[{kind:"content",lines:[a]}])}var we=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this,{assumeInteractionOn:["zn-input","zn-change"]});this.slashController=new na(this,{menu:()=>this.mountSlashMenu(),items:()=>this.isSlashBlock()?_O.filter(t=>this.slashItemAvailable(t)):[],onSelect:t=>this.handleSlashSelect(t)});this.toolbarOverflow=new Ku(this,{groups:()=>[...this.shadowRoot?.querySelectorAll(".toolbar__group")??[]],container:()=>this.shadowRoot?.querySelector(".remarkd-editor__toolbar")});this.editingDraft="";this.includeRequest=null;this.rawEntryValue="";this.suppressValueSync=!1;this.suppressBlurCommit=!1;this.blocks=[];this.editingIndex=null;this.slashRecentKey="";this.hasSlashMenu=!1;this.imagePickerIndex=null;this.imageEdit=null;this.dropIndicator=null;this.dragIndex=null;this.editShell="";this.rawMode=!1;this.includeOptions=null;this.includeLoadFailed=!1;this.includePickerIndex=null;this.includeQuery="";this.linkPickerOpen=!1;this.linkQuery="";this.linkResults=null;this.linkSearchFailed=!1;this.linkSelection=null;this.linkSearchToken=0;this.linkRefs=new Map;this.linkRefsPending=!1;this.pendingDragHandle=null;this.dragStartX=0;this.dragStartY=0;this.dragGhost=null;this.dragPointerY=0;this.autoScrollFrame=null;this.name="";this.value="";this.defaultValue="";this.placeholder="Type something\u2026";this.attachmentUrl="";this.includeUrl="";this.linkUrl="";this.allowRaw=!1;this.required=!1;this.readonly=!1;this.disabled=!1;this.saveImageEdit=()=>{if(this.editingIndex===null||!this.imageEdit)return;let t=[...this.blocks];t[this.editingIndex]=this.serializeImageBlock(this.imageEdit),this.closeImageEdit(),this.updateBlocks(t)};this.closeImageEdit=()=>{this.editingIndex=null,this.imageEdit=null};this.deleteImageBlock=()=>{if(this.editingIndex===null)return;let t=[...this.blocks];t.splice(this.editingIndex,1),this.closeImageEdit(),this.updateBlocks(t)};this.editImageSource=()=>{if(this.editingIndex===null)return;let t=this.editingIndex;this.imageEdit=null,this.startEdit(t)};this.handleImageControlsKeydown=t=>{t.key==="Escape"?(t.preventDefault(),this.closeImageEdit()):t.key==="Enter"&&t.target.tagName==="INPUT"&&(t.preventDefault(),this.saveImageEdit())};this.handleEditBlur=()=>{this.suppressBlurCommit||this.commitEdit()};this.commitEdit=()=>{if(this.imageEdit){let a=this.editingIndex??this.blocks.length;return this.closeImageEdit(),a+1}if(this.slashController.close(),this.editingIndex===null)return this.blocks.length;let t=this.editingIndex,r=this.splitBlocks(this.editingDraft),n=[...this.blocks];return n.splice(t,1,...r),this.editingIndex=null,this.updateBlocks(n),t+r.length};this.handleDraftInput=t=>{let r=t.target;this.editingDraft=r.value,this.autosize(r);let n=this.computeEditShell(r.value);n!==this.editShell&&(this.editShell=n,this.updateComplete.then(()=>this.autosize(r))),this.emit("zn-input")};this.handleEditKeydown=t=>{let r=t.target;if(this.slashController.open)return;let n=Uu.find(a=>a.shortcut&&_5(t,a.shortcut)&&this.actionAvailable(a));if(n)t.preventDefault(),this.activateAction(n);else if(this.isPlainEnter(t)){let a=this.finishedDraft(r.value,r.selectionStart,r.selectionEnd);if(a!==null){t.preventDefault(),this.editingDraft=a,this.suppressBlurCommit=!0,this.insertDraftBlock(this.commitEdit());return}let s=ev(r.value,r.selectionStart,r.selectionEnd);if(!s)return;t.preventDefault(),this.applyDraftEdit(r,s.value,s.caret,s.caret)}else if(this.isListTab(t)){let a=rv(r.value,r.selectionStart,r.selectionEnd,t.shiftKey);if(!a)return;t.preventDefault(),this.applyDraftEdit(r,a.value,a.start,a.end)}else if(t.key==="Enter"&&t.shiftKey){t.preventDefault(),this.suppressBlurCommit=!0;let a=this.commitEdit();this.insertDraftBlock(a)}else(t.key==="Escape"||t.key==="Enter"&&(t.metaKey||t.ctrlKey)||t.key==="Backspace"&&r.value==="")&&(t.preventDefault(),r.blur())};this.handleRawKeydown=t=>{let r=t.target,n=null;if(this.isPlainEnter(t)){let a=ev(r.value,r.selectionStart,r.selectionEnd);n=a&&{value:a.value,start:a.caret,end:a.caret}}else this.isListTab(t)&&(n=rv(r.value,r.selectionStart,r.selectionEnd,t.shiftKey));n&&(t.preventDefault(),r.value=n.value,r.setSelectionRange(n.start,n.end),this.handleRawInput(t))};this.handleEditPaste=t=>{let r=Array.from(t.clipboardData?.files??[]).find(a=>a.type.startsWith("image/"));if(!r){this.pasteFormatted(t);return}t.preventDefault();let n=this.editingIndex??this.blocks.length;this.insertImage(r,n+1)};this.pasteFormatted=t=>{let r=I5(t.clipboardData);if(r===null)return;t.preventDefault();let n=t.target;document.execCommand("insertText",!1,r)||(n.setRangeText(r,n.selectionStart,n.selectionEnd,"end"),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};this.handleDragOver=t=>{this.rawMode||t.dataTransfer?.types.includes("Files")&&t.preventDefault()};this.handleDrop=t=>{if(this.rawMode)return;let r=Array.from(t.dataTransfer?.files??[]).find(n=>n.type.startsWith("image/"));r&&(t.preventDefault(),this.insertImage(r,this.blocks.length))};this.handleHandlePointerDown=t=>{t.button===0&&(t.preventDefault(),this.editingIndex!==null&&this.commitEdit(),this.pendingDragHandle=t.currentTarget,this.dragStartX=t.clientX,this.dragStartY=t.clientY,document.addEventListener("pointermove",this.handleDragPointerMove),document.addEventListener("pointerup",this.handleDragPointerUp),document.addEventListener("pointercancel",this.cancelDrag))};this.handleDragPointerMove=t=>{if(this.pendingDragHandle){if(t.buttons%2===0){this.cancelDrag();return}if(this.dragIndex===null){if(Math.abs(t.clientX-this.dragStartX)+Math.abs(t.clientY-this.dragStartY)<4)return;let n=this.pendingDragHandle.closest(".remarkd-editor__block"),a=Array.from(this.shadowRoot?.querySelectorAll(".remarkd-editor__block")??[]),s=n?a.indexOf(n):-1;if(s<0){this.cancelDrag();return}this.dragIndex=s,this.createDragGhost(s),document.body.style.cursor="grabbing"}this.dragPointerY=t.clientY,this.moveDragGhost(t.clientX,t.clientY),this.dropIndicator=this.insertionIndexFromY(t.clientY),this.autoScrollFrame??(this.autoScrollFrame=requestAnimationFrame(this.stepAutoScroll))}};this.stepAutoScroll=()=>{this.autoScrollFrame=null,!(this.dragIndex===null||!this.autoScroll())&&(this.dropIndicator=this.insertionIndexFromY(this.dragPointerY),this.autoScrollFrame=requestAnimationFrame(this.stepAutoScroll))};this.handleDragPointerUp=t=>{let r=this.dragIndex,n=r!==null?this.dropIndicator??this.insertionIndexFromY(t.clientY):null;if(this.cancelDrag(),r===null||n===null||n===r||n===r+1)return;let a=[...this.blocks],[s]=a.splice(r,1);n>r&&n--,a.splice(n,0,s),this.updateBlocks(a)};this.cancelDrag=()=>{this.pendingDragHandle=null,this.autoScrollFrame!==null&&cancelAnimationFrame(this.autoScrollFrame),this.autoScrollFrame=null,document.removeEventListener("pointermove",this.handleDragPointerMove),document.removeEventListener("pointerup",this.handleDragPointerUp),document.removeEventListener("pointercancel",this.cancelDrag),this.dragIndex=null,this.dropIndicator=null,this.dragGhost?.remove(),this.dragGhost=null,document.body.style.cursor=""};this.closeLinkPicker=()=>{this.linkPickerOpen=!1,this.linkSelection=null,this.suppressBlurCommit=!1,clearTimeout(this.linkSearchTimer),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".remarkd-editor__input")?.focus({preventScroll:!0})})};this.closeIncludePicker=()=>{this.includePickerIndex=null};this.closeImagePicker=()=>{this.imagePickerIndex=null};this.handleImagePicked=t=>{let r=t.target.files?.[0];if(!r)return;let n=this.imagePickerIndex??this.blocks.length;this.imagePickerIndex=null,this.insertImage(r,n)};this.toggleRawMode=()=>{if(this.rawMode){this.commitRaw(),this.rawMode=!1;return}this.editingIndex!==null&&this.commitEdit(),this.slashController.detach(),this.rawEntryValue=this.value,this.rawMode=!0,this.focusRaw()};this.handleRawInput=t=>{let r=t.target;r.value!==this.value&&(this.suppressValueSync=!0,this.value=r.value,this.formControlController.updateValidity(),this.emit("zn-input"))};this.commitRaw=()=>{let t=this.splitBlocks(this.value||""),r=t.join(`
4504
+ ${TO(i)}
4505
+ </div>`}function $O(o){let i=o.trim();if(i.includes(`
4506
+ `))return null;let t=wO.exec(i);if(!t)return null;let[,r,n,a]=t;return dv(EO(r,n),[{kind:"content",lines:[a]}])}var we=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this,{assumeInteractionOn:["zn-input","zn-change"]});this.slashController=new na(this,{menu:()=>this.mountSlashMenu(),items:()=>this.isSlashBlock()?kO.filter(t=>this.slashItemAvailable(t)):[],onSelect:t=>this.handleSlashSelect(t)});this.toolbarOverflow=new Ku(this,{groups:()=>[...this.shadowRoot?.querySelectorAll(".toolbar__group")??[]],container:()=>this.shadowRoot?.querySelector(".remarkd-editor__toolbar")});this.editingDraft="";this.includeRequest=null;this.rawEntryValue="";this.suppressValueSync=!1;this.suppressBlurCommit=!1;this.blocks=[];this.editingIndex=null;this.slashRecentKey="";this.hasSlashMenu=!1;this.imagePickerIndex=null;this.imageEdit=null;this.dropIndicator=null;this.dragIndex=null;this.editShell="";this.rawMode=!1;this.includeOptions=null;this.includeLoadFailed=!1;this.includePickerIndex=null;this.includeQuery="";this.linkPickerOpen=!1;this.linkQuery="";this.linkResults=null;this.linkSearchFailed=!1;this.linkSelection=null;this.linkSearchToken=0;this.linkRefs=new Map;this.linkRefsPending=!1;this.pendingDragHandle=null;this.dragStartX=0;this.dragStartY=0;this.dragGhost=null;this.dragPointerY=0;this.autoScrollFrame=null;this.name="";this.value="";this.defaultValue="";this.placeholder="Type something\u2026";this.attachmentUrl="";this.includeUrl="";this.linkUrl="";this.allowRaw=!1;this.required=!1;this.readonly=!1;this.disabled=!1;this.saveImageEdit=()=>{if(this.editingIndex===null||!this.imageEdit)return;let t=[...this.blocks];t[this.editingIndex]=this.serializeImageBlock(this.imageEdit),this.closeImageEdit(),this.updateBlocks(t)};this.closeImageEdit=()=>{this.editingIndex=null,this.imageEdit=null};this.deleteImageBlock=()=>{if(this.editingIndex===null)return;let t=[...this.blocks];t.splice(this.editingIndex,1),this.closeImageEdit(),this.updateBlocks(t)};this.editImageSource=()=>{if(this.editingIndex===null)return;let t=this.editingIndex;this.imageEdit=null,this.startEdit(t)};this.handleImageControlsKeydown=t=>{t.key==="Escape"?(t.preventDefault(),this.closeImageEdit()):t.key==="Enter"&&t.target.tagName==="INPUT"&&(t.preventDefault(),this.saveImageEdit())};this.handleEditBlur=()=>{this.suppressBlurCommit||this.commitEdit()};this.commitEdit=()=>{if(this.imageEdit){let a=this.editingIndex??this.blocks.length;return this.closeImageEdit(),a+1}if(this.slashController.close(),this.editingIndex===null)return this.blocks.length;let t=this.editingIndex,r=this.splitBlocks(this.editingDraft),n=[...this.blocks];return n.splice(t,1,...r),this.editingIndex=null,this.updateBlocks(n),t+r.length};this.handleDraftInput=t=>{let r=t.target;this.editingDraft=r.value,this.autosize(r);let n=this.computeEditShell(r.value);n!==this.editShell&&(this.editShell=n,this.updateComplete.then(()=>this.autosize(r))),this.emit("zn-input")};this.handleEditKeydown=t=>{let r=t.target;if(this.slashController.open)return;let n=Uu.find(a=>a.shortcut&&_5(t,a.shortcut)&&this.actionAvailable(a));if(n)t.preventDefault(),this.activateAction(n);else if(this.isPlainEnter(t)){let a=this.finishedDraft(r.value,r.selectionStart,r.selectionEnd);if(a!==null){t.preventDefault(),this.editingDraft=a,this.suppressBlurCommit=!0,this.insertDraftBlock(this.commitEdit());return}let s=ev(r.value,r.selectionStart,r.selectionEnd);if(!s)return;t.preventDefault(),this.applyDraftEdit(r,s.value,s.caret,s.caret)}else if(this.isListTab(t)){let a=rv(r.value,r.selectionStart,r.selectionEnd,t.shiftKey);if(!a)return;t.preventDefault(),this.applyDraftEdit(r,a.value,a.start,a.end)}else if(t.key==="Enter"&&t.shiftKey){t.preventDefault(),this.suppressBlurCommit=!0;let a=this.commitEdit();this.insertDraftBlock(a)}else(t.key==="Escape"||t.key==="Enter"&&(t.metaKey||t.ctrlKey)||t.key==="Backspace"&&r.value==="")&&(t.preventDefault(),r.blur())};this.handleRawKeydown=t=>{let r=t.target,n=null;if(this.isPlainEnter(t)){let a=ev(r.value,r.selectionStart,r.selectionEnd);n=a&&{value:a.value,start:a.caret,end:a.caret}}else this.isListTab(t)&&(n=rv(r.value,r.selectionStart,r.selectionEnd,t.shiftKey));n&&(t.preventDefault(),r.value=n.value,r.setSelectionRange(n.start,n.end),this.handleRawInput(t))};this.handleEditPaste=t=>{let r=Array.from(t.clipboardData?.files??[]).find(a=>a.type.startsWith("image/"));if(!r){this.pasteFormatted(t);return}t.preventDefault();let n=this.editingIndex??this.blocks.length;this.insertImage(r,n+1)};this.pasteFormatted=t=>{let r=I5(t.clipboardData);if(r===null)return;t.preventDefault();let n=t.target;document.execCommand("insertText",!1,r)||(n.setRangeText(r,n.selectionStart,n.selectionEnd,"end"),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};this.handleDragOver=t=>{this.rawMode||t.dataTransfer?.types.includes("Files")&&t.preventDefault()};this.handleDrop=t=>{if(this.rawMode)return;let r=Array.from(t.dataTransfer?.files??[]).find(n=>n.type.startsWith("image/"));r&&(t.preventDefault(),this.insertImage(r,this.blocks.length))};this.handleHandlePointerDown=t=>{t.button===0&&(t.preventDefault(),this.editingIndex!==null&&this.commitEdit(),this.pendingDragHandle=t.currentTarget,this.dragStartX=t.clientX,this.dragStartY=t.clientY,document.addEventListener("pointermove",this.handleDragPointerMove),document.addEventListener("pointerup",this.handleDragPointerUp),document.addEventListener("pointercancel",this.cancelDrag))};this.handleDragPointerMove=t=>{if(this.pendingDragHandle){if(t.buttons%2===0){this.cancelDrag();return}if(this.dragIndex===null){if(Math.abs(t.clientX-this.dragStartX)+Math.abs(t.clientY-this.dragStartY)<4)return;let n=this.pendingDragHandle.closest(".remarkd-editor__block"),a=Array.from(this.shadowRoot?.querySelectorAll(".remarkd-editor__block")??[]),s=n?a.indexOf(n):-1;if(s<0){this.cancelDrag();return}this.dragIndex=s,this.createDragGhost(s),document.body.style.cursor="grabbing"}this.dragPointerY=t.clientY,this.moveDragGhost(t.clientX,t.clientY),this.dropIndicator=this.insertionIndexFromY(t.clientY),this.autoScrollFrame??(this.autoScrollFrame=requestAnimationFrame(this.stepAutoScroll))}};this.stepAutoScroll=()=>{this.autoScrollFrame=null,!(this.dragIndex===null||!this.autoScroll())&&(this.dropIndicator=this.insertionIndexFromY(this.dragPointerY),this.autoScrollFrame=requestAnimationFrame(this.stepAutoScroll))};this.handleDragPointerUp=t=>{let r=this.dragIndex,n=r!==null?this.dropIndicator??this.insertionIndexFromY(t.clientY):null;if(this.cancelDrag(),r===null||n===null||n===r||n===r+1)return;let a=[...this.blocks],[s]=a.splice(r,1);n>r&&n--,a.splice(n,0,s),this.updateBlocks(a)};this.cancelDrag=()=>{this.pendingDragHandle=null,this.autoScrollFrame!==null&&cancelAnimationFrame(this.autoScrollFrame),this.autoScrollFrame=null,document.removeEventListener("pointermove",this.handleDragPointerMove),document.removeEventListener("pointerup",this.handleDragPointerUp),document.removeEventListener("pointercancel",this.cancelDrag),this.dragIndex=null,this.dropIndicator=null,this.dragGhost?.remove(),this.dragGhost=null,document.body.style.cursor=""};this.closeLinkPicker=()=>{this.linkPickerOpen=!1,this.linkSelection=null,this.suppressBlurCommit=!1,clearTimeout(this.linkSearchTimer),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".remarkd-editor__input")?.focus({preventScroll:!0})})};this.closeIncludePicker=()=>{this.includePickerIndex=null};this.closeImagePicker=()=>{this.imagePickerIndex=null};this.handleImagePicked=t=>{let r=t.target.files?.[0];if(!r)return;let n=this.imagePickerIndex??this.blocks.length;this.imagePickerIndex=null,this.insertImage(r,n)};this.toggleRawMode=()=>{if(this.rawMode){this.commitRaw(),this.rawMode=!1;return}this.editingIndex!==null&&this.commitEdit(),this.slashController.detach(),this.rawEntryValue=this.value,this.rawMode=!0,this.focusRaw()};this.handleRawInput=t=>{let r=t.target;r.value!==this.value&&(this.suppressValueSync=!0,this.value=r.value,this.formControlController.updateValidity(),this.emit("zn-input"))};this.commitRaw=()=>{let t=this.splitBlocks(this.value||""),r=t.join(`
4507
4507
 
4508
4508
  `);this.blocks=t,r!==this.value&&(this.suppressValueSync=!0,this.value=r),this.value!==this.rawEntryValue&&(this.rawEntryValue=this.value,this.formControlController.updateValidity(),this.emit("zn-change"))}}get validity(){return this.validationInput?.validity}get validationMessage(){return this.validationInput?.validationMessage??""}checkValidity(){return this.validationInput?.checkValidity()??!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.validationInput?.reportValidity()??!0}setCustomValidity(t){this.validationInput?.setCustomValidity(t),this.formControlController.updateValidity()}focus(){if(this.rawMode){this.shadowRoot?.querySelector(".remarkd-editor__raw")?.focus();return}this.blocks.length?this.startEdit(0):this.insertDraftBlock(0)}blur(){let t=this.rawMode?".remarkd-editor__raw":".remarkd-editor__input";this.shadowRoot?.querySelector(t)?.blur()}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this.hasIncludeBlock()&&this.loadIncludeOptions(),this.resolveContentLinks()}updated(t){super.updated(t),this.shadowRoot?.querySelectorAll(".remarkd-editor__rendered--parsed").forEach(r=>this.markVariables(r)),this.shadowRoot?.querySelectorAll(".remarkd-editor__rendered--parsed").forEach(r=>this.markContentLinks(r))}disconnectedCallback(){super.disconnectedCallback(),this.cancelDrag()}handleValueChange(){if(this.suppressValueSync){this.suppressValueSync=!1;return}this.blocks=this.splitBlocks(this.value||""),this.hasUpdated&&this.hasIncludeBlock()&&this.loadIncludeOptions(),this.hasUpdated&&this.resolveContentLinks()}handleIncludeUrlChange(){this.includeRequest=null,this.includeOptions=null,this.includeLoadFailed=!1,this.hasIncludeBlock()&&this.loadIncludeOptions()}handleLinkUrlChange(){this.linkRefs.clear(),this.linkRefsPending=!1,this.resolveContentLinks()}splitBlocks(t){return this.scanBlocks(t).blocks}scanBlocks(t){let r=t.replace(/\r\n/g,`
4509
4509
  `).split(`
@@ -4515,7 +4515,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4515
4515
  `)}toggleCheckbox(t,r){let n=r.closest(".remarkd-editor__rendered"),a=Array.from(n?.querySelectorAll('input[type="checkbox"]')??[]).indexOf(r);if(a<0)return;let s=-1,l=this.blocks[t].replace(/^(\s*(?:[-*+]|\d+\.)\s+)\[( |x|X)\]/gm,(h,m,f)=>(s++,s!==a?h:`${m}[${f===" "?"x":" "}]`));if(l===this.blocks[t])return;let d=[...this.blocks];d[t]=l,this.updateBlocks(d)}startEdit(t,r,n="nearest",a){this.disabled||this.readonly||(this.editingDraft=r??this.blocks[t]??"",this.editingIndex=t,this.imageEdit=null,this.linkPickerOpen=!1,this.linkSelection=null,this.editShell=this.computeEditShell(this.editingDraft),this.slashController.close(),this.focusInput(n,a))}updateImageEdit(t){this.imageEdit&&(this.imageEdit={...this.imageEdit,...t})}computeEditShell(t){let r=(t.split(`
4516
4516
  `,1)[0]??"").trimStart(),n=/^(NOTE|TIP|WARNING|IMPORTANT|CAUTION|DANGER|SUCCESS|NOTICE):\s/.exec(r);return n?`hint-${n[1].toLowerCase()}`:r.startsWith("### ")?"remarkd-editor__edit-shell--h3":r.startsWith("## ")?"remarkd-editor__edit-shell--h2":r.startsWith("# ")?"remarkd-editor__edit-shell--h1":r.startsWith("```")?"remarkd-editor__edit-shell--code":""}async focusInput(t="nearest",r){await this.updateComplete;let n=this.shadowRoot?.querySelector(".remarkd-editor__input");if(n){this.slashController.attach(n),this.autosize(n),n.focus({preventScroll:!0});let a=r===void 0?n.value.length:Math.min(Math.max(r,0),n.value.length);n.setSelectionRange(a,a),this.reveal(n,t)}this.suppressBlurCommit=!1}reveal(t,r="nearest"){let n=this.shadowRoot?.querySelector(".remarkd-editor__body");if(!t||!n)return;let a=t.getBoundingClientRect(),s=n.getBoundingClientRect();r==="center"?n.scrollTop+=a.height>s.height?a.top-s.top:a.top+a.height/2-(s.top+s.height/2):a.top<s.top?n.scrollTop+=a.top-s.top:a.bottom>s.bottom&&(n.scrollTop+=a.bottom-s.bottom)}async revealAfterUpdate(t,r="nearest"){await this.updateComplete,this.reveal(this.shadowRoot?.querySelector(t),r)}async revealBlock(t){await this.updateComplete;let r=()=>this.shadowRoot?.querySelectorAll(".remarkd-editor__block")[t],n=r();if(!n)return;this.reveal(n,"center");let a=[...n.querySelectorAll("img")].filter(s=>!s.complete);a.length&&(await Promise.all(a.map(s=>new Promise(l=>{s.addEventListener("load",()=>l(),{once:!0}),s.addEventListener("error",()=>l(),{once:!0})}))),await new Promise(requestAnimationFrame),this.reveal(r(),"center"))}addBlockAt(t,r){if(this.disabled||this.readonly)return;let n=[...this.blocks];n.splice(t,0,r),this.updateBlocks(n),this.revealBlock(t)}deleteBlock(t){if(this.disabled||this.readonly)return;let r=[...this.blocks];r.splice(t,1),this.updateBlocks(r)}insertDraftBlock(t,r="",n){if(this.disabled||this.readonly)return;let a=[...this.blocks];a.splice(t,0,""),this.blocks=a,this.startEdit(t,r,"center",n)}finishedDraft(t,r,n){if(r!==n||t.slice(r).trim()!=="")return null;let a=t.lastIndexOf(`
4517
4517
  `,r-1)+1,s=t.slice(a);if(s.trim()!==""&&!Zb(s))return null;let l=t.slice(0,a);return l.trim()===""||this.scanBlocks(l).open?null:l.trimEnd()}isPlainEnter(t){return t.key==="Enter"&&!t.isComposing&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&!t.altKey}isListTab(t){return t.key==="Tab"&&!t.isComposing&&!t.metaKey&&!t.ctrlKey&&!t.altKey}isSlashBlock(){let t=this.shadowRoot?.querySelector(".remarkd-editor__input")?.value??"";return t.startsWith("/")&&!t.includes(`
4518
- `)}async mountSlashMenu(){return this.hasSlashMenu||(this.hasSlashMenu=!0,await this.updateComplete),this.slashMenuElement}handleSlashSelect(t){if(t.action==="link")return this.updateComplete.then(()=>this.pickLink()),!1;if(t.action!=="image"&&t.action!=="include")return!0;let r=this.editingIndex??this.blocks.length;return this.updateComplete.then(()=>{this.blur(),t.action==="image"?this.pickImage(r):this.pickInclude(r)}),!1}insertionIndexFromY(t){let r=Array.from(this.shadowRoot?.querySelectorAll(".remarkd-editor__block")??[]);for(let n=0;n<r.length;n++){let a=r[n].getBoundingClientRect();if(t<a.top+a.height/2)return n}return r.length}autoScroll(){let t=this.shadowRoot?.querySelector(".remarkd-editor__body");if(t){let{top:a,bottom:s}=t.getBoundingClientRect(),l=this.edgeScrollDelta(a,s),d=t.scrollTop;if(l&&(t.scrollTop+=l,t.scrollTop!==d))return!0}let r=this.edgeScrollDelta(0,window.innerHeight);if(!r)return!1;let n=window.scrollY;return window.scrollBy(0,r),window.scrollY!==n}edgeScrollDelta(t,r){let s=l=>Math.ceil(Math.min(l,56)/56*18);return this.dragPointerY<t+56?-s(t+56-this.dragPointerY):this.dragPointerY>r-56?s(this.dragPointerY-(r-56)):0}createDragGhost(t){let n=this.shadowRoot?.querySelectorAll(".remarkd-editor__block")?.[t]?.querySelector(".remarkd-editor__rendered");if(!n)return;let a=n.cloneNode(!0);a.classList.add("remarkd-editor__ghost"),a.style.width=`${n.offsetWidth}px`,this.shadowRoot?.querySelector(".remarkd-editor")?.appendChild(a),this.dragGhost=a}moveDragGhost(t,r){this.dragGhost&&(this.dragGhost.style.transform=`translate(${t+10}px, ${r+10}px)`)}pickImage(t){this.disabled||this.readonly||(this.includePickerIndex=null,this.imagePickerIndex=t,this.revealAfterUpdate(".remarkd-editor__image-picker","center"))}pickInclude(t){this.disabled||this.readonly||!this.includeUrl||(this.imagePickerIndex=null,this.includeQuery="",this.includePickerIndex=t,this.loadIncludeOptions(),this.revealAfterUpdate(".remarkd-editor__include-picker","center"))}pickLink(){if(this.disabled||this.readonly||!this.linkUrl||this.editingIndex===null)return;let t=this.shadowRoot?.querySelector(".remarkd-editor__input");t&&(this.linkSelection=[t.selectionStart,t.selectionEnd],this.linkQuery=t.value.slice(t.selectionStart,t.selectionEnd).trim(),this.linkResults=null,this.linkSearchFailed=!1,this.linkPickerOpen=!0,this.suppressBlurCommit=!0,this.searchLinks(this.linkQuery),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".remarkd-editor__link-filter")?.focus()}))}searchLinks(t){clearTimeout(this.linkSearchTimer);let r=++this.linkSearchToken;this.linkSearchTimer=setTimeout(()=>{let n=`${this.linkUrl}${this.linkUrl.includes("?")?"&":"?"}q=${encodeURIComponent(t.trim())}`;fetch(n,{headers:{Accept:"application/json"}}).then(a=>{if(!a.ok)throw new Error(`link search failed: ${a.status}`);return a.json()}).then(a=>{r===this.linkSearchToken&&(this.linkResults=a.items??[],this.linkSearchFailed=!1)}).catch(a=>{console.error("[zn-remarkd-editor] link search failed",a),r===this.linkSearchToken&&(this.linkResults=null,this.linkSearchFailed=!0)})},zO)}insertInclude(t){let r=this.includePickerIndex??this.blocks.length;this.includePickerIndex=null,this.addBlockAt(r,xO(t.id,t.title))}async insertImage(t,r){try{let n=await this.uploadImage(t),a=t.name.replace(/[[\],]/g,"");this.addBlockAt(r,`image::${n}[${a}]`)}catch(n){console.error("[zn-remarkd-editor] image upload failed",n)}}async uploadImage(t){if(!this.attachmentUrl)throw new Error("No attachment-url configured");let r=new FormData;r.append("filename",t.name),r.append("size",t.size.toString()),r.append("mimeType",t.type);let n=await fetch(this.attachmentUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload request failed: ${n.status}`);let a=await n.json(),s=new URL(a.uploadUrl,new URL(this.attachmentUrl,window.location.href)).toString(),l=await fetch(s,{method:"PUT",headers:{"Content-Type":t.type},body:t});if(!l.ok)throw new Error(`Upload failed: ${l.status}`);return a.uploadPath}appPath(t){let r=this.getAttribute("gaid")??"",n=t.replace(/^\/+/,"");return!r||n.startsWith(r)?t:`/${r}/${n}`}hasIncludeBlock(){return this.blocks.some(t=>this.parseIncludeBlock(t)!==null)}loadIncludeOptions(){return this.includeUrl?(this.includeRequest||(this.includeRequest=fetch(this.includeUrl,{headers:{Accept:"application/json"}}).then(t=>{if(!t.ok)throw new Error(`include list request failed: ${t.status}`);return t.json()}).then(t=>{let r=t.items??[];return this.includeOptions=r,this.includeLoadFailed=!1,r}).catch(t=>(console.error("[zn-remarkd-editor] include list failed",t),this.includeOptions=null,this.includeLoadFailed=!0,this.includeRequest=null,[]))),this.includeRequest):Promise.resolve([])}resolveContentLinks(){if(!this.linkUrl||this.linkRefsPending)return;let t=[...new Set((this.value||"").match(uO)??[])].filter(n=>!this.linkRefs.has(n));if(!t.length)return;this.linkRefsPending=!0;let r=`${this.linkUrl}${this.linkUrl.includes("?")?"&":"?"}refs=${encodeURIComponent(t.join(","))}`;fetch(r,{headers:{Accept:"application/json"}}).then(n=>{if(!n.ok)throw new Error(`link resolve failed: ${n.status}`);return n.json()}).then(n=>{let a=new Map((n.items??[]).map(s=>[s.ref,s]));for(let s of t)this.linkRefs.set(s,a.get(s)??null);this.requestUpdate()}).catch(n=>{console.error("[zn-remarkd-editor] link resolve failed",n)}).finally(()=>{this.linkRefsPending=!1})}markContentLinks(t){t.querySelectorAll('a[href^="kb:"]').forEach(r=>{let n=hO.exec(r.getAttribute("href")??""),a=!!n&&this.linkRefs.get(n[0])===null;r.classList.toggle("remarkd-editor__link--missing",a),a?r.title="This article is no longer available":r.removeAttribute("title")})}autosize(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}applyInline(t){let r=this.shadowRoot?.querySelector(".remarkd-editor__input");if(!r)return;let n=t.after??t.before,{selectionStart:a,selectionEnd:s,value:l}=r,d=l.slice(a,s),h=n===t.before,m=h&&t.before.length>0&&t.before===t.before[0].repeat(t.before.length),f=l.slice(a-t.before.length,a)===t.before,b=h?null:kO(n),g=b?.exec(l.slice(s))??null,v=g?g[0].length:n.length,y=b?!!g:l.slice(s,s+n.length)===n,_=l[a-t.before.length-1],E=l[s+v],N=f&&y&&!(m&&(_===t.before[0]||E===n[n.length-1])),G,R;if(N)G=l.slice(0,a-t.before.length)+d+l.slice(s+v),R=[a-t.before.length,a-t.before.length+d.length];else{if(b&&f)return;{let C=d||t.placeholder||"";G=l.slice(0,a)+t.before+C+n+l.slice(s),R=[a+t.before.length,a+t.before.length+C.length]}}this.applyDraftEdit(r,G,R[0],R[1])}applyDraftEdit(t,r,n,a){this.editingDraft=r,t.value=r,t.setSelectionRange(n,a),this.editShell=this.computeEditShell(r),this.autosize(t),t.focus({preventScroll:!0}),this.emit("zn-input")}async focusRaw(){await this.updateComplete;let t=this.shadowRoot?.querySelector(".remarkd-editor__raw");t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length))}handleToolbarInsert(t){this.editingIndex!==null&&(this.suppressBlurCommit=!0);let r=this.editingIndex!==null?this.commitEdit():this.blocks.length;t.opens==="image"?this.pickImage(r):t.opens==="include"?this.pickInclude(r):t.opens||this.insertDraftBlock(r,t.prefix??"",t.caretOffset)}renderImageControls(){let t=this.imageEdit;if(!t)return"";let r=[{value:"",icon:"align-left@lu",label:"Align left"},{value:"center",icon:"align-center@lu",label:"Align center"},{value:"right",icon:"align-right@lu",label:"Align right"}];return u`
4518
+ `)}async mountSlashMenu(){return this.hasSlashMenu||(this.hasSlashMenu=!0,await this.updateComplete),this.slashMenuElement}handleSlashSelect(t){if(t.action==="link")return this.updateComplete.then(()=>this.pickLink()),!1;if(t.action!=="image"&&t.action!=="include")return!0;let r=this.editingIndex??this.blocks.length;return this.updateComplete.then(()=>{this.blur(),t.action==="image"?this.pickImage(r):this.pickInclude(r)}),!1}insertionIndexFromY(t){let r=Array.from(this.shadowRoot?.querySelectorAll(".remarkd-editor__block")??[]);for(let n=0;n<r.length;n++){let a=r[n].getBoundingClientRect();if(t<a.top+a.height/2)return n}return r.length}autoScroll(){let t=this.shadowRoot?.querySelector(".remarkd-editor__body");if(t){let{top:a,bottom:s}=t.getBoundingClientRect(),l=this.edgeScrollDelta(a,s),d=t.scrollTop;if(l&&(t.scrollTop+=l,t.scrollTop!==d))return!0}let r=this.edgeScrollDelta(0,window.innerHeight);if(!r)return!1;let n=window.scrollY;return window.scrollBy(0,r),window.scrollY!==n}edgeScrollDelta(t,r){let s=l=>Math.ceil(Math.min(l,56)/56*18);return this.dragPointerY<t+56?-s(t+56-this.dragPointerY):this.dragPointerY>r-56?s(this.dragPointerY-(r-56)):0}createDragGhost(t){let n=this.shadowRoot?.querySelectorAll(".remarkd-editor__block")?.[t]?.querySelector(".remarkd-editor__rendered");if(!n)return;let a=n.cloneNode(!0);a.classList.add("remarkd-editor__ghost"),a.style.width=`${n.offsetWidth}px`,this.shadowRoot?.querySelector(".remarkd-editor")?.appendChild(a),this.dragGhost=a}moveDragGhost(t,r){this.dragGhost&&(this.dragGhost.style.transform=`translate(${t+10}px, ${r+10}px)`)}pickImage(t){this.disabled||this.readonly||(this.includePickerIndex=null,this.imagePickerIndex=t,this.revealAfterUpdate(".remarkd-editor__image-picker","center"))}pickInclude(t){this.disabled||this.readonly||!this.includeUrl||(this.imagePickerIndex=null,this.includeQuery="",this.includePickerIndex=t,this.loadIncludeOptions(),this.revealAfterUpdate(".remarkd-editor__include-picker","center"))}pickLink(){if(this.disabled||this.readonly||!this.linkUrl||this.editingIndex===null)return;let t=this.shadowRoot?.querySelector(".remarkd-editor__input");t&&(this.linkSelection=[t.selectionStart,t.selectionEnd],this.linkQuery=t.value.slice(t.selectionStart,t.selectionEnd).trim(),this.linkResults=null,this.linkSearchFailed=!1,this.linkPickerOpen=!0,this.suppressBlurCommit=!0,this.searchLinks(this.linkQuery),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".remarkd-editor__link-filter")?.focus()}))}searchLinks(t){clearTimeout(this.linkSearchTimer);let r=++this.linkSearchToken;this.linkSearchTimer=setTimeout(()=>{let n=`${this.linkUrl}${this.linkUrl.includes("?")?"&":"?"}q=${encodeURIComponent(t.trim())}`;fetch(n,{headers:{Accept:"application/json"}}).then(a=>{if(!a.ok)throw new Error(`link search failed: ${a.status}`);return a.json()}).then(a=>{r===this.linkSearchToken&&(this.linkResults=a.items??[],this.linkSearchFailed=!1)}).catch(a=>{console.error("[zn-remarkd-editor] link search failed",a),r===this.linkSearchToken&&(this.linkResults=null,this.linkSearchFailed=!0)})},SO)}insertInclude(t){let r=this.includePickerIndex??this.blocks.length;this.includePickerIndex=null,this.addBlockAt(r,_O(t.id,t.title))}async insertImage(t,r){try{let n=await this.uploadImage(t),a=t.name.replace(/[[\],]/g,"");this.addBlockAt(r,`image::${n}[${a}]`)}catch(n){console.error("[zn-remarkd-editor] image upload failed",n)}}async uploadImage(t){if(!this.attachmentUrl)throw new Error("No attachment-url configured");let r=new FormData;r.append("filename",t.name),r.append("size",t.size.toString()),r.append("mimeType",t.type);let n=await fetch(this.attachmentUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload request failed: ${n.status}`);let a=await n.json(),s=new URL(a.uploadUrl,new URL(this.attachmentUrl,window.location.href)).toString(),l=await fetch(s,{method:"PUT",headers:{"Content-Type":t.type},body:t});if(!l.ok)throw new Error(`Upload failed: ${l.status}`);return a.uploadPath}appPath(t){let r=this.getAttribute("gaid")??"",n=t.replace(/^\/+/,"");return!r||n.startsWith(r)?t:`/${r}/${n}`}hasIncludeBlock(){return this.blocks.some(t=>this.parseIncludeBlock(t)!==null)}loadIncludeOptions(){return this.includeUrl?(this.includeRequest||(this.includeRequest=fetch(this.includeUrl,{headers:{Accept:"application/json"}}).then(t=>{if(!t.ok)throw new Error(`include list request failed: ${t.status}`);return t.json()}).then(t=>{let r=t.items??[];return this.includeOptions=r,this.includeLoadFailed=!1,r}).catch(t=>(console.error("[zn-remarkd-editor] include list failed",t),this.includeOptions=null,this.includeLoadFailed=!0,this.includeRequest=null,[]))),this.includeRequest):Promise.resolve([])}resolveContentLinks(){if(!this.linkUrl||this.linkRefsPending)return;let t=[...new Set((this.value||"").match(fO)??[])].filter(n=>!this.linkRefs.has(n));if(!t.length)return;this.linkRefsPending=!0;let r=`${this.linkUrl}${this.linkUrl.includes("?")?"&":"?"}refs=${encodeURIComponent(t.join(","))}`;fetch(r,{headers:{Accept:"application/json"}}).then(n=>{if(!n.ok)throw new Error(`link resolve failed: ${n.status}`);return n.json()}).then(n=>{let a=new Map((n.items??[]).map(s=>[s.ref,s]));for(let s of t)this.linkRefs.set(s,a.get(s)??null);this.requestUpdate()}).catch(n=>{console.error("[zn-remarkd-editor] link resolve failed",n)}).finally(()=>{this.linkRefsPending=!1})}markContentLinks(t){t.querySelectorAll('a[href^="kb:"]').forEach(r=>{let n=mO.exec(r.getAttribute("href")??""),a=!!n&&this.linkRefs.get(n[0])===null;r.classList.toggle("remarkd-editor__link--missing",a),a?r.title="This article is no longer available":r.removeAttribute("title")})}autosize(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}applyInline(t){let r=this.shadowRoot?.querySelector(".remarkd-editor__input");if(!r)return;let n=t.after??t.before,{selectionStart:a,selectionEnd:s,value:l}=r,d=l.slice(a,s),h=n===t.before,m=h&&t.before.length>0&&t.before===t.before[0].repeat(t.before.length),f=l.slice(a-t.before.length,a)===t.before,b=h?null:CO(n),g=b?.exec(l.slice(s))??null,v=g?g[0].length:n.length,y=b?!!g:l.slice(s,s+n.length)===n,_=l[a-t.before.length-1],E=l[s+v],N=f&&y&&!(m&&(_===t.before[0]||E===n[n.length-1])),G,R;if(N)G=l.slice(0,a-t.before.length)+d+l.slice(s+v),R=[a-t.before.length,a-t.before.length+d.length];else{if(b&&f)return;{let C=d||t.placeholder||"";G=l.slice(0,a)+t.before+C+n+l.slice(s),R=[a+t.before.length,a+t.before.length+C.length]}}this.applyDraftEdit(r,G,R[0],R[1])}applyDraftEdit(t,r,n,a){this.editingDraft=r,t.value=r,t.setSelectionRange(n,a),this.editShell=this.computeEditShell(r),this.autosize(t),t.focus({preventScroll:!0}),this.emit("zn-input")}async focusRaw(){await this.updateComplete;let t=this.shadowRoot?.querySelector(".remarkd-editor__raw");t&&(t.focus(),t.setSelectionRange(t.value.length,t.value.length))}handleToolbarInsert(t){this.editingIndex!==null&&(this.suppressBlurCommit=!0);let r=this.editingIndex!==null?this.commitEdit():this.blocks.length;t.opens==="image"?this.pickImage(r):t.opens==="include"?this.pickInclude(r):t.opens||this.insertDraftBlock(r,t.prefix??"",t.caretOffset)}renderImageControls(){let t=this.imageEdit;if(!t)return"";let r=[{value:"",icon:"align-left@lu",label:"Align left"},{value:"center",icon:"align-center@lu",label:"Align center"},{value:"right",icon:"align-right@lu",label:"Align right"}];return u`
4519
4519
  <div part="image-controls" class="remarkd-editor__image-controls"
4520
4520
  @keydown=${this.handleImageControlsKeydown}>
4521
4521
  ${t.src?u`
@@ -4605,7 +4605,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4605
4605
  @blur=${this.handleEditBlur}></textarea>
4606
4606
  </div>
4607
4607
  ${this.linkPickerOpen?this.renderLinkPicker():""}
4608
- </div>`;let n=this.parseIncludeBlock(t),a=n?null:this.renderConditional(t)??EO(t),s=n||a?null:vO(t.trim());return u`
4608
+ </div>`;let n=this.parseIncludeBlock(t),a=n?null:this.renderConditional(t)??$O(t),s=n||a?null:xO(t.trim());return u`
4609
4609
  <div part="block"
4610
4610
  class=${q({"remarkd-editor__block":!0,"remarkd-editor__block--dragging":this.dragIndex===r,"remarkd-editor__block--drop-before":this.dropIndicator===r,"remarkd-editor__block--drop-after":this.dropIndicator===r+1&&r===this.blocks.length-1})}>
4611
4611
  ${this.disabled||this.readonly?"":u`
@@ -4766,7 +4766,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4766
4766
  <span class="remarkd-editor__link-option-meta">${[t[r.kind]??r.kind,r.context,r.status==="published"?"":r.status].filter(Boolean).join(" \xB7 ")}</span>
4767
4767
  </button>`):u`
4768
4768
  <div class="remarkd-editor__link-picker-empty">No articles found</div>`}
4769
- </div>`}insertLink(t){let r=this.shadowRoot?.querySelector(".remarkd-editor__input"),n=this.linkSelection;if(this.linkPickerOpen=!1,this.linkSelection=null,this.suppressBlurCommit=!1,!r||!n)return;let[a,s]=n,l=r.value.slice(a,s).trim(),d=wO(t.ref,l||t.title),h=r.value.slice(0,a)+d+r.value.slice(s);this.editingDraft=h,r.value=h,r.setSelectionRange(a+d.length,a+d.length),this.editShell=this.computeEditShell(h),this.autosize(r),r.focus({preventScroll:!0}),this.emit("zn-input")}renderImagePicker(){return u`
4769
+ </div>`}insertLink(t){let r=this.shadowRoot?.querySelector(".remarkd-editor__input"),n=this.linkSelection;if(this.linkPickerOpen=!1,this.linkSelection=null,this.suppressBlurCommit=!1,!r||!n)return;let[a,s]=n,l=r.value.slice(a,s).trim(),d=zO(t.ref,l||t.title),h=r.value.slice(0,a)+d+r.value.slice(s);this.editingDraft=h,r.value=h,r.setSelectionRange(a+d.length,a+d.length),this.editShell=this.computeEditShell(h),this.autosize(r),r.focus({preventScroll:!0}),this.emit("zn-input")}renderImagePicker(){return u`
4770
4770
  <div class="remarkd-editor__image-picker">
4771
4771
  <zn-file class="remarkd-editor__image-file"
4772
4772
  label="Image"
@@ -4886,7 +4886,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4886
4886
  </div>
4887
4887
  `:V}
4888
4888
  </div>
4889
- `}};Be.styles=[k(Pe),k(X5)],Be.dependencies={"zn-chip":_o,"zn-inline-edit":xh,"zn-input":xt,"zn-option":at,"zn-remarkd-editor":Yu,"zn-select":Je,"zn-textarea":Ma},c([p()],Be.prototype,"name",2),c([p()],Be.prototype,"value",2),c([p()],Be.prototype,"label",2),c([p({attribute:"help-text"})],Be.prototype,"helpText",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"required",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"flush",2),c([p({attribute:"input-type"})],Be.prototype,"inputType",2),c([p({attribute:"textarea-rows",type:Number})],Be.prototype,"textareaRows",2),c([p({type:Boolean,attribute:"allow-raw"})],Be.prototype,"allowRaw",2),c([p({attribute:"attachment-url"})],Be.prototype,"attachmentUrl",2),c([p({attribute:"include-url"})],Be.prototype,"includeUrl",2),c([p({attribute:"link-url"})],Be.prototype,"linkUrl",2),c([p({type:Boolean,reflect:!0,attribute:"inline-edit"})],Be.prototype,"inlineEdit",2),c([p({attribute:"slash-items",converter:{fromAttribute:t=>ia(t),toAttribute:t=>JSON.stringify(t)}})],Be.prototype,"slashItems",2),c([p({attribute:"slash-preset"})],Be.prototype,"slashPreset",2),c([p({attribute:"slash-trigger"})],Be.prototype,"slashTrigger",2),c([p({attribute:"slash-heading"})],Be.prototype,"slashHeading",2),c([p({attribute:"slash-hide-keys",type:Boolean})],Be.prototype,"slashHideKeys",2),c([p({attribute:"slash-recent-key"})],Be.prototype,"slashRecentKey",2),c([p({attribute:!1})],Be.prototype,"slashItemsProvider",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"grouped",2),c([p({type:Object})],Be.prototype,"languages",2),c([p({type:Object})],Be.prototype,"values",2),c([Ne()],Be.prototype,"defaultValue",2),c([D()],Be.prototype,"_activeLanguage",2);var TO=Be;Be.define("zn-translations");var Q5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}.key{cursor:pointer;display:flex;flex-direction:row;gap:var(--zn-spacing-medium);align-items:center;text-align:left}.key__description{font-size:var(--zn-font-size-small);color:rgb(var(--zn-text-body));opacity:0.7;line-height:var(--zn-line-height-normal);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([active]) .key__label{color:rgb(var(--zn-text-heading));font-weight:600}:host(:not([active])) .key__description{opacity:0.6}:host(:not([active])) zn-chip{--zn-chip-color:rgb(var(--zn-text-body));opacity:0.5}`;var tn=class extends T{constructor(){super(...arguments);this.icon="";this.attribute="";this.value="";this.color="primary";this.active=!1;this.iconSize=24}_handleClick(){this.active=!this.active,this.emit("zn-change")}render(){let t=this.active?this.color:"transparent";return u`
4889
+ `}};Be.styles=[k(Pe),k(X5)],Be.dependencies={"zn-chip":_o,"zn-inline-edit":xh,"zn-input":xt,"zn-option":at,"zn-remarkd-editor":Yu,"zn-select":Je,"zn-textarea":Ma},c([p()],Be.prototype,"name",2),c([p()],Be.prototype,"value",2),c([p()],Be.prototype,"label",2),c([p({attribute:"help-text"})],Be.prototype,"helpText",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"required",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"flush",2),c([p({attribute:"input-type"})],Be.prototype,"inputType",2),c([p({attribute:"textarea-rows",type:Number})],Be.prototype,"textareaRows",2),c([p({type:Boolean,attribute:"allow-raw"})],Be.prototype,"allowRaw",2),c([p({attribute:"attachment-url"})],Be.prototype,"attachmentUrl",2),c([p({attribute:"include-url"})],Be.prototype,"includeUrl",2),c([p({attribute:"link-url"})],Be.prototype,"linkUrl",2),c([p({type:Boolean,reflect:!0,attribute:"inline-edit"})],Be.prototype,"inlineEdit",2),c([p({attribute:"slash-items",converter:{fromAttribute:t=>ia(t),toAttribute:t=>JSON.stringify(t)}})],Be.prototype,"slashItems",2),c([p({attribute:"slash-preset"})],Be.prototype,"slashPreset",2),c([p({attribute:"slash-trigger"})],Be.prototype,"slashTrigger",2),c([p({attribute:"slash-heading"})],Be.prototype,"slashHeading",2),c([p({attribute:"slash-hide-keys",type:Boolean})],Be.prototype,"slashHideKeys",2),c([p({attribute:"slash-recent-key"})],Be.prototype,"slashRecentKey",2),c([p({attribute:!1})],Be.prototype,"slashItemsProvider",2),c([p({type:Boolean,reflect:!0})],Be.prototype,"grouped",2),c([p({type:Object})],Be.prototype,"languages",2),c([p({type:Object})],Be.prototype,"values",2),c([Ne()],Be.prototype,"defaultValue",2),c([D()],Be.prototype,"_activeLanguage",2);var AO=Be;Be.define("zn-translations");var Q5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block}.key{cursor:pointer;display:flex;flex-direction:row;gap:var(--zn-spacing-medium);align-items:center;text-align:left}.key__description{font-size:var(--zn-font-size-small);color:rgb(var(--zn-text-body));opacity:0.7;line-height:var(--zn-line-height-normal);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([active]) .key__label{color:rgb(var(--zn-text-heading));font-weight:600}:host(:not([active])) .key__description{opacity:0.6}:host(:not([active])) zn-chip{--zn-chip-color:rgb(var(--zn-text-body));opacity:0.5}`;var tn=class extends T{constructor(){super(...arguments);this.icon="";this.attribute="";this.value="";this.color="primary";this.active=!1;this.iconSize=24}_handleClick(){this.active=!this.active,this.emit("zn-change")}render(){let t=this.active?this.color:"transparent";return u`
4890
4890
  <div class="key" @click="${this._handleClick}">
4891
4891
  <zn-chip
4892
4892
  .icon="${this.icon}"
@@ -4898,7 +4898,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4898
4898
  <slot></slot>
4899
4899
  </div>
4900
4900
  </div>
4901
- `}};tn.styles=k(Q5),c([p()],tn.prototype,"icon",2),c([p()],tn.prototype,"attribute",2),c([p()],tn.prototype,"value",2),c([p()],tn.prototype,"color",2),c([p({type:Boolean,reflect:!0})],tn.prototype,"active",2),c([p({attribute:"icon-size",type:Number})],tn.prototype,"iconSize",2);var $O=tn;tn.define("zn-key");var J5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:contents}.key-container--scroll{height:100%;width:100%;overflow:hidden;position:relative}.key-container__content{height:100%;width:100%;overflow:auto;box-sizing:border-box}.key-container__keys{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}::slotted(zn-key){flex:0 0 auto}::slotted([hidden]){display:none !important}`;var qi=class extends T{constructor(){super(...arguments);this.position="bottom-start";this.target="";this.itemSelector="[data-type]";this.filterAttribute="";this.noScroll=!1;this._hiddenElements=new Set;this._targetElement=null}connectedCallback(){super.connectedCallback(),this.updateFilters()}firstUpdated(){if(this.target){let t=this.getRootNode();this._targetElement=t.getElementById?t.getElementById(this.target):document.getElementById(this.target)}this.updateFilters()}_handleKeyChange(){this.updateFilters(),this.emit("zn-change")}getKeys(){let t=[];return this.keysSlot&&t.push(...this.keysSlot.assignedElements({flatten:!0})),this.defaultSlot&&t.push(...this.defaultSlot.assignedElements({flatten:!0})),t.filter(r=>r.tagName.toLowerCase()==="zn-key")}updateFilters(){let t=this.getKeys();if(!t||t.length===0)return;if(this._hiddenElements.forEach(s=>s.removeAttribute("hidden")),this._hiddenElements.clear(),this.target&&!this._targetElement){let s=this.getRootNode();this._targetElement=s.getElementById?.(this.target)??document.getElementById(this.target)}let r=this._targetElement??null;if(r||(r=(this.defaultSlot?.assignedElements({flatten:!0})??[]).some(l=>l.tagName!=="ZN-KEY")?this:this.parentElement??this.parentNode),!r)return;let n=this.filterAttribute?`[${this.filterAttribute}]`:this.itemSelector;nt(n,r,"").forEach(s=>{if(s===this)return;t.some(d=>!d.active&&this.itemMatchesKey(s,d))&&(s.setAttribute("hidden",""),this._hiddenElements.add(s))})}itemMatchesKey(t,r){if(this.filterAttribute){let n=t.getAttribute(this.filterAttribute);if(!n)return!1;let a=r.attribute;return a?n.split(/\s+/).includes(a):!1}if(r.attribute&&r.value){let n=t.getAttribute(r.attribute);return n?n.split(/\s+/).includes(r.value):!1}return r.attribute?t.hasAttribute(r.attribute):!1}render(){return u`
4901
+ `}};tn.styles=k(Q5),c([p()],tn.prototype,"icon",2),c([p()],tn.prototype,"attribute",2),c([p()],tn.prototype,"value",2),c([p()],tn.prototype,"color",2),c([p({type:Boolean,reflect:!0})],tn.prototype,"active",2),c([p({attribute:"icon-size",type:Number})],tn.prototype,"iconSize",2);var LO=tn;tn.define("zn-key");var J5=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:contents}.key-container--scroll{height:100%;width:100%;overflow:hidden;position:relative}.key-container__content{height:100%;width:100%;overflow:auto;box-sizing:border-box}.key-container__keys{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}::slotted(zn-key){flex:0 0 auto}::slotted([hidden]){display:none !important}`;var qi=class extends T{constructor(){super(...arguments);this.position="bottom-start";this.target="";this.itemSelector="[data-type]";this.filterAttribute="";this.noScroll=!1;this._hiddenElements=new Set;this._targetElement=null}connectedCallback(){super.connectedCallback(),this.updateFilters()}firstUpdated(){if(this.target){let t=this.getRootNode();this._targetElement=t.getElementById?t.getElementById(this.target):document.getElementById(this.target)}this.updateFilters()}_handleKeyChange(){this.updateFilters(),this.emit("zn-change")}getKeys(){let t=[];return this.keysSlot&&t.push(...this.keysSlot.assignedElements({flatten:!0})),this.defaultSlot&&t.push(...this.defaultSlot.assignedElements({flatten:!0})),t.filter(r=>r.tagName.toLowerCase()==="zn-key")}updateFilters(){let t=this.getKeys();if(!t||t.length===0)return;if(this._hiddenElements.forEach(s=>s.removeAttribute("hidden")),this._hiddenElements.clear(),this.target&&!this._targetElement){let s=this.getRootNode();this._targetElement=s.getElementById?.(this.target)??document.getElementById(this.target)}let r=this._targetElement??null;if(r||(r=(this.defaultSlot?.assignedElements({flatten:!0})??[]).some(l=>l.tagName!=="ZN-KEY")?this:this.parentElement??this.parentNode),!r)return;let n=this.filterAttribute?`[${this.filterAttribute}]`:this.itemSelector;nt(n,r,"").forEach(s=>{if(s===this)return;t.some(d=>!d.active&&this.itemMatchesKey(s,d))&&(s.setAttribute("hidden",""),this._hiddenElements.add(s))})}itemMatchesKey(t,r){if(this.filterAttribute){let n=t.getAttribute(this.filterAttribute);if(!n)return!1;let a=r.attribute;return a?n.split(/\s+/).includes(a):!1}if(r.attribute&&r.value){let n=t.getAttribute(r.attribute);return n?n.split(/\s+/).includes(r.value):!1}return r.attribute?t.hasAttribute(r.attribute):!1}render(){return u`
4902
4902
  <div class="${q({"key-container":!0,"key-container--scroll":!this.noScroll})}" @zn-change="${this._handleKeyChange}">
4903
4903
  ${this.target?"":u`
4904
4904
  <div class="key-container__content">
@@ -4906,7 +4906,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4906
4906
  </div>
4907
4907
  `}
4908
4908
  </div>
4909
- `}};qi.styles=k(J5),c([U('slot[name="keys"]')],qi.prototype,"keysSlot",2),c([U("slot:not([name])")],qi.prototype,"defaultSlot",2),c([p()],qi.prototype,"position",2),c([p()],qi.prototype,"target",2),c([p({attribute:"item-selector"})],qi.prototype,"itemSelector",2),c([p({attribute:"filter-attribute"})],qi.prototype,"filterAttribute",2),c([p({attribute:"no-scroll",type:Boolean})],qi.prototype,"noScroll",2);var AO=qi;qi.define("zn-key-container");var Z5=S`:host{display:inline-block;cursor:pointer}:host([disabled]){cursor:wait}.animated-button{border-radius:var(--zn-button-border-radius,var(--zn-border-radius));display:inline-flex;align-items:center;justify-content:center;padding:var(--zn-base-px);margin:auto;width:-moz-fit-content;width:fit-content;background-color:rgb(var(--zn-primary));color:rgba(var(--zn-color-on-primary,255,255,255),0.9);font-size:var(--zn-text-button-label-font-size);font-weight:var(--zn-text-button-label-font-weight);line-height:var(--zn-text-button-label-line-height);text-transform:var(--zn-text-button-label-transform);cursor:pointer;vertical-align:middle;border-color:transparent;white-space:nowrap;max-height:36px;height:36px;min-height:36px}.animated-button:hover:not([disabled]){background-color:rgba(var(--zn-primary),0.8)}.animated-button{position:relative;overflow:hidden;min-width:150px;min-height:40px;gap:8px;transition:transform var(--zn-transition-fast) ease,opacity var(--zn-transition-fast) ease;border:none;font-size:1rem;font-family:inherit;cursor:pointer}.animated-button:hover:not(:disabled){opacity:0.9}.animated-button:active:not(:disabled){transform:scale(0.98)}.animated-button:disabled{cursor:wait}.animated-button:focus-visible{outline:2px solid rgb(var(--zn-primary));outline-offset:2px}.animated-button__content{display:inline-flex;align-items:center;justify-content:center;gap:8px;position:relative;z-index:1}.animated-button__text{font-weight:600;line-height:1}.animated-button__icon{display:inline-flex;flex-shrink:0}.animated-button__spinner{display:inline-flex;flex-shrink:0;animation:spin 1s linear infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animated-button__shimmer{position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%);animation:shimmer 1.5s infinite}@keyframes shimmer{0%{left:-100%}100%{left:100%}}.animated-button--idle{background-color:rgb(var(--zn-primary)) !important}.animated-button--processing{background-color:rgb(var(--zn-primary)) !important;cursor:wait}.animated-button--success{background-color:rgb(var(--zn-primary)) !important;cursor:default}.animated-button--success::before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgb(var(--zn-color-success));animation:successFill var(--zn-transition-slow) ease-out forwards;z-index:0}.animated-button--success .animated-button__content{z-index:1}.animated-button--success .animated-button__icon--success{opacity:0;animation:iconFadeIn 0.3s ease-out 0.4s forwards}.animated-button--success .animated-button__tick{stroke-dasharray:30;stroke-dashoffset:30;animation:tickSwoosh 0.5s ease-out 0.4s forwards}@keyframes successFill{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes iconFadeIn{to{opacity:1}}@keyframes tickSwoosh{0%{stroke-dashoffset:30}100%{stroke-dashoffset:0}}.animated-button--failure{background-color:rgb(var(--zn-color-error)) !important;cursor:not-allowed}.animated-button--failure .animated-button__icon--failure{animation:failureShake var(--zn-transition-medium) ease-out}@keyframes failureShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}@media (prefers-reduced-motion:reduce){.animated-button{transition:none}.animated-button--success::before{animation:none;transform:translateY(0)}.animated-button__shimmer{animation:none;display:none}.animated-button__spinner{animation:none}.animated-button__icon--success{animation:none;opacity:1}.animated-button__tick{animation:none;stroke-dashoffset:0}.animated-button__icon--failure{animation:none}}`;var dr=class extends T{constructor(){super(...arguments);this.currentState="idle";this.errorMessage="";this.idleText="Purchase";this.processingText="Purchasing";this.successText="Success";this.failureText="Failed";this.redirectUrl="";this.redirectDelay=1500;this.failureResetDelay=2e3;this.disabled=!1;this.name="";this.value=""}disconnectedCallback(){super.disconnectedCallback(),this.clearTimeouts()}clearTimeouts(){this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=void 0),this.redirectTimeout&&(clearTimeout(this.redirectTimeout),this.redirectTimeout=void 0)}purchase(){this.currentState!=="idle"||this.disabled||this.handlePurchase()}setSuccess(){this.clearTimeouts(),this.currentState="success",this.scheduleRedirect()}setFailure(t=""){this.clearTimeouts(),this.errorMessage=t,this.currentState="failure",this.scheduleReset()}reset(){this.clearTimeouts(),this.currentState="idle",this.errorMessage=""}handlePurchase(){this.clearTimeouts(),this.currentState="processing",this.emit("zn-purchase",{cancelable:!0,detail:{value:this.value,setSuccess:()=>this.setSuccess(),setFailure:r=>this.setFailure(r)}}).defaultPrevented&&(this.currentState="idle")}scheduleRedirect(){this.redirectTimeout=window.setTimeout(()=>{this.redirectUrl&&(window.location.href=this.redirectUrl),this.emit("zn-redirect",{detail:{url:this.redirectUrl}})},this.redirectDelay)}scheduleReset(){this.resetTimeout=window.setTimeout(()=>{this.reset()},this.failureResetDelay)}handleClick(){this.currentState==="idle"&&!this.disabled&&this.handlePurchase()}render(){let t=this.disabled||this.currentState!=="idle",r=this.currentState==="processing",n=this.currentState==="success",a=this.currentState==="failure",s={"animated-button":!0,"animated-button--idle":this.currentState==="idle","animated-button--processing":this.currentState==="processing","animated-button--success":this.currentState==="success","animated-button--failure":this.currentState==="failure"},l=this.idleText;return this.currentState==="processing"&&(l=this.processingText),this.currentState==="success"&&(l=this.successText),this.currentState==="failure"&&(l=this.failureText),u`
4909
+ `}};qi.styles=k(J5),c([U('slot[name="keys"]')],qi.prototype,"keysSlot",2),c([U("slot:not([name])")],qi.prototype,"defaultSlot",2),c([p()],qi.prototype,"position",2),c([p()],qi.prototype,"target",2),c([p({attribute:"item-selector"})],qi.prototype,"itemSelector",2),c([p({attribute:"filter-attribute"})],qi.prototype,"filterAttribute",2),c([p({attribute:"no-scroll",type:Boolean})],qi.prototype,"noScroll",2);var MO=qi;qi.define("zn-key-container");var Z5=S`:host{display:inline-block;cursor:pointer}:host([disabled]){cursor:wait}.animated-button{border-radius:var(--zn-button-border-radius,var(--zn-border-radius));display:inline-flex;align-items:center;justify-content:center;padding:var(--zn-base-px);margin:auto;width:-moz-fit-content;width:fit-content;background-color:rgb(var(--zn-primary));color:rgba(var(--zn-color-on-primary,255,255,255),0.9);font-size:var(--zn-text-button-label-font-size);font-weight:var(--zn-text-button-label-font-weight);line-height:var(--zn-text-button-label-line-height);text-transform:var(--zn-text-button-label-transform);cursor:pointer;vertical-align:middle;border-color:transparent;white-space:nowrap;max-height:36px;height:36px;min-height:36px}.animated-button:hover:not([disabled]){background-color:rgba(var(--zn-primary),0.8)}.animated-button{position:relative;overflow:hidden;min-width:150px;min-height:40px;gap:8px;transition:transform var(--zn-transition-fast) ease,opacity var(--zn-transition-fast) ease;border:none;font-size:1rem;font-family:inherit;cursor:pointer}.animated-button:hover:not(:disabled){opacity:0.9}.animated-button:active:not(:disabled){transform:scale(0.98)}.animated-button:disabled{cursor:wait}.animated-button:focus-visible{outline:2px solid rgb(var(--zn-primary));outline-offset:2px}.animated-button__content{display:inline-flex;align-items:center;justify-content:center;gap:8px;position:relative;z-index:1}.animated-button__text{font-weight:600;line-height:1}.animated-button__icon{display:inline-flex;flex-shrink:0}.animated-button__spinner{display:inline-flex;flex-shrink:0;animation:spin 1s linear infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animated-button__shimmer{position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%);animation:shimmer 1.5s infinite}@keyframes shimmer{0%{left:-100%}100%{left:100%}}.animated-button--idle{background-color:rgb(var(--zn-primary)) !important}.animated-button--processing{background-color:rgb(var(--zn-primary)) !important;cursor:wait}.animated-button--success{background-color:rgb(var(--zn-primary)) !important;cursor:default}.animated-button--success::before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgb(var(--zn-color-success));animation:successFill var(--zn-transition-slow) ease-out forwards;z-index:0}.animated-button--success .animated-button__content{z-index:1}.animated-button--success .animated-button__icon--success{opacity:0;animation:iconFadeIn 0.3s ease-out 0.4s forwards}.animated-button--success .animated-button__tick{stroke-dasharray:30;stroke-dashoffset:30;animation:tickSwoosh 0.5s ease-out 0.4s forwards}@keyframes successFill{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes iconFadeIn{to{opacity:1}}@keyframes tickSwoosh{0%{stroke-dashoffset:30}100%{stroke-dashoffset:0}}.animated-button--failure{background-color:rgb(var(--zn-color-error)) !important;cursor:not-allowed}.animated-button--failure .animated-button__icon--failure{animation:failureShake var(--zn-transition-medium) ease-out}@keyframes failureShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}@media (prefers-reduced-motion:reduce){.animated-button{transition:none}.animated-button--success::before{animation:none;transform:translateY(0)}.animated-button__shimmer{animation:none;display:none}.animated-button__spinner{animation:none}.animated-button__icon--success{animation:none;opacity:1}.animated-button__tick{animation:none;stroke-dashoffset:0}.animated-button__icon--failure{animation:none}}`;var dr=class extends T{constructor(){super(...arguments);this.currentState="idle";this.errorMessage="";this.idleText="Purchase";this.processingText="Purchasing";this.successText="Success";this.failureText="Failed";this.redirectUrl="";this.redirectDelay=1500;this.failureResetDelay=2e3;this.disabled=!1;this.name="";this.value=""}disconnectedCallback(){super.disconnectedCallback(),this.clearTimeouts()}clearTimeouts(){this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=void 0),this.redirectTimeout&&(clearTimeout(this.redirectTimeout),this.redirectTimeout=void 0)}purchase(){this.currentState!=="idle"||this.disabled||this.handlePurchase()}setSuccess(){this.clearTimeouts(),this.currentState="success",this.scheduleRedirect()}setFailure(t=""){this.clearTimeouts(),this.errorMessage=t,this.currentState="failure",this.scheduleReset()}reset(){this.clearTimeouts(),this.currentState="idle",this.errorMessage=""}handlePurchase(){this.clearTimeouts(),this.currentState="processing",this.emit("zn-purchase",{cancelable:!0,detail:{value:this.value,setSuccess:()=>this.setSuccess(),setFailure:r=>this.setFailure(r)}}).defaultPrevented&&(this.currentState="idle")}scheduleRedirect(){this.redirectTimeout=window.setTimeout(()=>{this.redirectUrl&&(window.location.href=this.redirectUrl),this.emit("zn-redirect",{detail:{url:this.redirectUrl}})},this.redirectDelay)}scheduleReset(){this.resetTimeout=window.setTimeout(()=>{this.reset()},this.failureResetDelay)}handleClick(){this.currentState==="idle"&&!this.disabled&&this.handlePurchase()}render(){let t=this.disabled||this.currentState!=="idle",r=this.currentState==="processing",n=this.currentState==="success",a=this.currentState==="failure",s={"animated-button":!0,"animated-button--idle":this.currentState==="idle","animated-button--processing":this.currentState==="processing","animated-button--success":this.currentState==="success","animated-button--failure":this.currentState==="failure"},l=this.idleText;return this.currentState==="processing"&&(l=this.processingText),this.currentState==="success"&&(l=this.successText),this.currentState==="failure"&&(l=this.failureText),u`
4910
4910
  <button
4911
4911
  class=${q(s)}
4912
4912
  ?disabled=${t}
@@ -4965,7 +4965,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
4965
4965
  </span>
4966
4966
  `}
4967
4967
  </button>
4968
- `}};dr.styles=[k(Bp),k(Z5)],dr.dependencies={"zn-icon":Jo},c([D()],dr.prototype,"currentState",2),c([D()],dr.prototype,"errorMessage",2),c([p({attribute:"idle-text"})],dr.prototype,"idleText",2),c([p({attribute:"processing-text"})],dr.prototype,"processingText",2),c([p({attribute:"success-text"})],dr.prototype,"successText",2),c([p({attribute:"failure-text"})],dr.prototype,"failureText",2),c([p({attribute:"redirect-url"})],dr.prototype,"redirectUrl",2),c([p({type:Number,attribute:"redirect-delay"})],dr.prototype,"redirectDelay",2),c([p({type:Number,attribute:"failure-reset-delay"})],dr.prototype,"failureResetDelay",2),c([p({type:Boolean,reflect:!0})],dr.prototype,"disabled",2),c([p()],dr.prototype,"name",2),c([p()],dr.prototype,"value",2);var LO=dr;dr.define("zn-animated-button");var e4=S`:host{display:block}.panel__body{gap:var(--zn-spacing-medium)}::slotted(:not([slot])){grid-column:1/-1}.translation-group__language-select::part(form-control-label){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.translation-group__actions{display:flex;align-items:center;gap:var(--zn-spacing-small);max-width:var(--zn-container-lg)}.translation-group__actions-spacer{order:1;flex:1 1 auto}::slotted([slot=actions]){order:2}::slotted([slot=actions][align=start]){order:0}.panel--has-actions .panel__body>.translation-group__actions{border:0}.translation-group--inline .panel__inner,.translation-group--inline .panel__content,.translation-group--inline .panel__body{overflow:visible}`;var Ri=class extends mt{constructor(){super(...arguments);this._slotController=new te(this,"actions","footer");this.label="";this.helpText="";this.inline=!1;this.languageLabel="Edit Languages";this.languages={en:"EN"};this._activeLanguage="en";this._form=null;this.handleSlotChange=()=>{this.syncChildren()};this.handleLanguageSelect=t=>{t.stopPropagation();let r=t.target.value;typeof r=="string"&&r&&r!==this._activeLanguage&&this.switchLanguage(r)};this.handleLanguageInput=t=>{t.stopPropagation()};this.handleChildChange=()=>{this.requestUpdate()};this.handleFormReset=()=>{requestAnimationFrame(()=>this.requestUpdate())}}connectedCallback(){super.connectedCallback(),this._form=this.closest("form"),this._form?.addEventListener("reset",this.handleFormReset)}disconnectedCallback(){super.disconnectedCallback(),this._form?.removeEventListener("reset",this.handleFormReset),this._form=null}firstUpdated(t){super.firstUpdated(t),this.syncChildren()}updated(t){super.updated(t),t.has("languages")&&this.syncChildLanguages()}getAllTranslations(){return[...this.querySelectorAll("zn-translations")]}syncChildren(){this.getAllTranslations().forEach(t=>{t.grouped=!0,t.languages=this.languages,t.setActiveLanguage(this._activeLanguage)})}languageState(t){let r=this.getAllTranslations(),n=r.filter(a=>a.hasTranslation(t)).length;return r.length>0&&n===r.length?{type:"success",label:"Translated"}:n>0?{type:"warning",label:"Partial"}:{type:"error",label:t==="en"?"Empty":"English"}}displayName(t){return this.languages[t]??t.toUpperCase()}syncChildLanguages(){this.getAllTranslations().forEach(t=>{t.languages=this.languages})}switchLanguage(t){this._activeLanguage=t,this.getAllTranslations().forEach(r=>r.setActiveLanguage(t)),this.emit("zn-language-change",{detail:{language:t}})}render(){let t=this._slotController.test("actions"),r=this._slotController.test("footer"),n=this.caption||this.label,a=new Set;this.getAllTranslations().forEach(m=>m.getValueLanguages().filter(f=>!Object.prototype.hasOwnProperty.call(this.languages,f)).forEach(f=>a.add(f)));let s=[...Object.keys(this.languages),...a],l=s.length>1,d=s.filter(m=>this.languageState(m).type==="success").length,h={label:`${d}/${s.length}`,type:d===s.length?"success":d>0?"warning":"error"};return u`
4968
+ `}};dr.styles=[k(Bp),k(Z5)],dr.dependencies={"zn-icon":Jo},c([D()],dr.prototype,"currentState",2),c([D()],dr.prototype,"errorMessage",2),c([p({attribute:"idle-text"})],dr.prototype,"idleText",2),c([p({attribute:"processing-text"})],dr.prototype,"processingText",2),c([p({attribute:"success-text"})],dr.prototype,"successText",2),c([p({attribute:"failure-text"})],dr.prototype,"failureText",2),c([p({attribute:"redirect-url"})],dr.prototype,"redirectUrl",2),c([p({type:Number,attribute:"redirect-delay"})],dr.prototype,"redirectDelay",2),c([p({type:Number,attribute:"failure-reset-delay"})],dr.prototype,"failureResetDelay",2),c([p({type:Boolean,reflect:!0})],dr.prototype,"disabled",2),c([p()],dr.prototype,"name",2),c([p()],dr.prototype,"value",2);var IO=dr;dr.define("zn-animated-button");var e4=S`:host{display:block}.panel__body{gap:var(--zn-spacing-medium)}::slotted(:not([slot])){grid-column:1/-1}.translation-group__language-select::part(form-control-label){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.translation-group__actions{display:flex;align-items:center;gap:var(--zn-spacing-small);max-width:var(--zn-container-lg)}.translation-group__actions-spacer{order:1;flex:1 1 auto}::slotted([slot=actions]){order:2}::slotted([slot=actions][align=start]){order:0}.panel--has-actions .panel__body>.translation-group__actions{border:0}.translation-group--inline .panel__inner,.translation-group--inline .panel__content,.translation-group--inline .panel__body{overflow:visible}`;var Ri=class extends mt{constructor(){super(...arguments);this._slotController=new te(this,"actions","footer");this.label="";this.helpText="";this.inline=!1;this.languageLabel="Edit Languages";this.languages={en:"EN"};this._activeLanguage="en";this._form=null;this.handleSlotChange=()=>{this.syncChildren()};this.handleLanguageSelect=t=>{t.stopPropagation();let r=t.target.value;typeof r=="string"&&r&&r!==this._activeLanguage&&this.switchLanguage(r)};this.handleLanguageInput=t=>{t.stopPropagation()};this.handleChildChange=()=>{this.requestUpdate()};this.handleFormReset=()=>{requestAnimationFrame(()=>this.requestUpdate())}}connectedCallback(){super.connectedCallback(),this._form=this.closest("form"),this._form?.addEventListener("reset",this.handleFormReset)}disconnectedCallback(){super.disconnectedCallback(),this._form?.removeEventListener("reset",this.handleFormReset),this._form=null}firstUpdated(t){super.firstUpdated(t),this.syncChildren()}updated(t){super.updated(t),t.has("languages")&&this.syncChildLanguages()}getAllTranslations(){return[...this.querySelectorAll("zn-translations")]}syncChildren(){this.getAllTranslations().forEach(t=>{t.grouped=!0,t.languages=this.languages,t.setActiveLanguage(this._activeLanguage)})}languageState(t){let r=this.getAllTranslations(),n=r.filter(a=>a.hasTranslation(t)).length;return r.length>0&&n===r.length?{type:"success",label:"Translated"}:n>0?{type:"warning",label:"Partial"}:{type:"error",label:t==="en"?"Empty":"English"}}displayName(t){return this.languages[t]??t.toUpperCase()}syncChildLanguages(){this.getAllTranslations().forEach(t=>{t.languages=this.languages})}switchLanguage(t){this._activeLanguage=t,this.getAllTranslations().forEach(r=>r.setActiveLanguage(t)),this.emit("zn-language-change",{detail:{language:t}})}render(){let t=this._slotController.test("actions"),r=this._slotController.test("footer"),n=this.caption||this.label,a=new Set;this.getAllTranslations().forEach(m=>m.getValueLanguages().filter(f=>!Object.prototype.hasOwnProperty.call(this.languages,f)).forEach(f=>a.add(f)));let s=[...Object.keys(this.languages),...a],l=s.length>1,d=s.filter(m=>this.languageState(m).type==="success").length,h={label:`${d}/${s.length}`,type:d===s.length?"success":d>0?"warning":"error"};return u`
4969
4969
  <div part="base" class="${q({panel:!0,"panel--flush":this.flush||this.inline,"panel--transparent":this.transparent||this.inline,"translation-group--inline":this.inline,"panel--has-actions":t,"panel--has-footer":r})}">
4970
4970
 
4971
4971
  <div class="panel__inner">
@@ -5013,7 +5013,7 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
5013
5013
  ${r?u`
5014
5014
  <slot name="footer" class="panel__footer"></slot>`:null}
5015
5015
  </div>
5016
- </div>`}};Ri.styles=[mt.styles,k(e4)],Ri.dependencies={"zn-chip":_o,"zn-form-group":Wb,"zn-option":at,"zn-select":Je},c([p()],Ri.prototype,"label",2),c([p({attribute:"help-text"})],Ri.prototype,"helpText",2),c([p({type:Boolean,reflect:!0})],Ri.prototype,"inline",2),c([p({attribute:"language-label"})],Ri.prototype,"languageLabel",2),c([p({type:Object})],Ri.prototype,"languages",2),c([D()],Ri.prototype,"_activeLanguage",2);var MO=Ri;Ri.define("zn-translation-group");var t4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;line-height:var(--zn-line-height-dense);--zn-priority-list-item-gap:var(--zn-spacing-2x-small);--zn-priority-list-item-padding:var(--zn-spacing-small) var(--zn-spacing-medium);--zn-priority-list-actions-gap:var(--zn-spacing-small);--zn-priority-list-handle-color:var(--zn-color-neutral-400);--zn-priority-list-priority-color:var(--zn-color-neutral-600)}.form-control{position:relative;border:none;padding:0;margin:0}.form-control__label{padding:0}.priority-list{display:flex;flex-direction:column;gap:var(--zn-priority-list-item-gap)}.priority-list--disabled{opacity:0.5;pointer-events:none}.priority-list--drag-active .priority-list__item{transition:transform 200ms ease,opacity 200ms ease,box-shadow 200ms ease}.priority-list__item{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-priority-list-item-padding);background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:element;position:relative}.priority-list__item:hover{background:rgb(var(--zn-panel-hover,var(--zn-panel)));border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:hover .priority-list__handle{color:rgb(var(--zn-color-primary-500))}.priority-list__item:focus-visible{outline:2px solid rgb(var(--zn-color-primary-500));outline-offset:-1px;border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:active{cursor:grabbing}.priority-list__item--dragging{opacity:0.3;border-style:dashed;border-color:rgb(var(--zn-color-primary-400));background:rgb(var(--zn-color-primary-50,var(--zn-panel)));box-shadow:none}.priority-list__item--disabled{cursor:not-allowed;opacity:0.6}.priority-list__item--disabled:hover{background:rgb(var(--zn-panel));border-color:rgb(var(--zn-border-color))}.priority-list__handle{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--zn-priority-list-handle-color);cursor:grab;transition:color 150ms ease}.priority-list__handle:active{cursor:grabbing}.priority-list__priority{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-width:1.5em;font-size:var(--zn-font-size-small);font-weight:var(--zn-font-weight-semibold);color:var(--zn-priority-list-priority-color)}.priority-list__content{flex:1;min-width:0;overflow:hidden;pointer-events:none}.priority-list__content ::slotted(*){pointer-events:none;-webkit-user-drag:none}.priority-list__actions{display:flex;align-items:center;gap:var(--zn-priority-list-actions-gap);flex-shrink:0;pointer-events:auto}.priority-list__actions ::slotted(*){pointer-events:auto;-webkit-user-drag:none}:host([size=small]) .priority-list__item{padding:var(--zn-spacing-2x-small) var(--zn-spacing-small);font-size:var(--zn-font-size-small)}:host([size=small]) .priority-list__priority{font-size:var(--zn-font-size-x-small);min-width:1.25em}:host([size=large]) .priority-list__item{padding:var(--zn-spacing-medium) var(--zn-spacing-large);font-size:var(--zn-font-size-medium)}:host([size=large]) .priority-list__priority{font-size:var(--zn-font-size-medium);min-width:1.75em}.priority-list__collector{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}.priority-list__hidden-inputs{display:none}`;function IO(o){try{return JSON.parse(o)}catch{return}}var Tt=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this,{value:t=>JSON.stringify(t.getPriorityMap()),defaultValue:t=>t.defaultValue,setValue:(t,r)=>{if(!r||Array.isArray(r)&&r.length===0)return;let n=Array.isArray(r)?r:IO(r);Array.isArray(n)&&n.every(a=>typeof a=="string")&&(t.value=n)}});this.hasSlotController=new te(this,"help-text","label");this.name="";this._value=[];this.defaultValue=[];this.label="";this.labelTooltip="";this.helpText="";this.form="";this.size="medium";this.disabled=!1;this.required=!1;this.priorityStart=1;this.order="";this.draggedKey=null;this.isDragging=!1;this.dragOverKey=null}get value(){return this._value}set value(t){let r=this._value;this._value=[...t],this._assignSlotNames(),this.requestUpdate("value",r)}get validity(){return ht}get validationMessage(){return""}connectedCallback(){super.connectedCallback(),this.defaultValue=[...this._value]}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this._initializeOrderFromSlot()}_initializeOrderFromSlot(){if(this._value.length===0){let r=this._getSlottedItems().map(n=>n.getAttribute("value")||"").filter(n=>n!=="");if(this.order){let n=this.order.split(",").map(h=>h.trim()).filter(h=>h!==""),a=new Set(r),s=n.filter(h=>a.has(h)),l=new Set(s),d=r.filter(h=>!l.has(h));this._value=[...s,...d]}else this._value=r}this.defaultValue=[...this._value],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate()}_getSlottedItems(){let t=["label","label-tooltip","help-text"];return[...this.querySelectorAll(":scope > [value]")].filter(r=>{let n=r.getAttribute("slot");return!n||n.startsWith("_item-")||!t.includes(n)})}_assignSlotNames(){[...this.querySelectorAll(":scope > [value]")].forEach(r=>{let n=r.getAttribute("value");n&&!["label","label-tooltip","help-text"].includes(n)&&r.setAttribute("slot",`_item-${n}`)})}getPriorityMap(){return this._value.map((t,r)=>({key:t,priority:this.priorityStart+r}))}_syncHiddenInputs(){this.hiddenInputsContainer&&(this.hiddenInputsContainer.innerHTML="",this.name&&this._value.forEach((t,r)=>{let n=document.createElement("input");n.type="hidden",n.name=`${this.name}[${t}]`,n.value=String(this.priorityStart+r),this.hiddenInputsContainer.appendChild(n)}))}_moveItem(t,r){if(t===r||t<0||r<0||t>=this._value.length||r>=this._value.length)return;let n=[...this._value],[a]=n.splice(t,1);n.splice(r,0,a),this._value=n,this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()}_submitForm(){if(this.formAction===void 0||this.formAction===null)return;if(this.getForm()){let r=document.createElement("input");r.type="submit",this.formAction&&r.setAttribute("formaction",this.formAction),this.formControlController.submit(r)}else if(this.formAction){let r=document.createElement("form");r.method="post",r.action=this.formAction,r.hidden=!0,this._value.forEach((n,a)=>{if(this.name){let s=document.createElement("input");s.type="hidden",s.name=`${this.name}[${n}]`,s.value=String(this.priorityStart+a),r.appendChild(s)}}),document.body.appendChild(r),r.requestSubmit(),r.remove()}}_handleDragStart(t,r){if(this.disabled){t.preventDefault();return}this.draggedKey=r,this.isDragging=!0,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",r))}_handleDragEnd(){this.isDragging&&(this._syncHiddenInputs(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()),this.draggedKey=null,this.dragOverKey=null,this.isDragging=!1}_handleDragOver(t,r){if(t.preventDefault(),!this.draggedKey||this.draggedKey===r)return;t.dataTransfer&&(t.dataTransfer.dropEffect="move");let n=this._value.indexOf(this.draggedKey),a=this._value.indexOf(r);if(n===-1||a===-1||n===a)return;let s=[...this._value],[l]=s.splice(n,1);s.splice(a,0,l),this._value=s,this._assignSlotNames(),this.requestUpdate(),this.dragOverKey=r}_handleDragLeave(t,r){let n=t.relatedTarget,a=t.currentTarget;n&&a.contains(n)||this.dragOverKey===r&&(this.dragOverKey=null)}_handleDrop(t){t.preventDefault()}_handleKeyDown(t,r){if(this.disabled)return;let n=this._value.indexOf(r);if(n===-1)return;let a=null;switch(t.key){case"ArrowUp":n>0&&(a=n-1);break;case"ArrowDown":n<this._value.length-1&&(a=n+1);break;case"Home":n>0&&(a=0);break;case"End":n<this._value.length-1&&(a=this._value.length-1);break;default:return}a!==null&&(t.preventDefault(),this._moveItem(n,a),this.updateComplete.then(()=>{this.shadowRoot?.querySelectorAll(".priority-list__item")?.[a]?.focus()}))}_handleSlotChange(){let t=[...this.querySelectorAll(":scope > [value]")],r=["label","label-tooltip","help-text"],n=t.filter(h=>{let m=h.getAttribute("slot");return!m||m.startsWith("_item-")||!r.includes(m)}).map(h=>h.getAttribute("value")||"").filter(h=>h!=="");if(n.length===0&&this._value.length>0)return;let a=new Set(this._value),s=new Set(n),l=n.filter(h=>!a.has(h)),d=this._value.filter(h=>s.has(h));(l.length>0||d.length!==this._value.length)&&(this._value=[...d,...l],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate())}checkValidity(){return!0}getForm(){return this.formControlController.getForm()}reportValidity(){return!0}setCustomValidity(t=""){}updated(t){super.updated(t),(t.has("value")||t.has("name")||t.has("priorityStart"))&&this._syncHiddenInputs()}render(){let t=this.hasSlotController.test("label"),r=this.hasSlotController.test("label-tooltip"),n=this.hasSlotController.test("help-text"),a=this.label?!0:t,s=this.labelTooltip?!0:r,l=this.helpText?!0:n;return u`
5016
+ </div>`}};Ri.styles=[mt.styles,k(e4)],Ri.dependencies={"zn-chip":_o,"zn-form-group":Wb,"zn-option":at,"zn-select":Je},c([p()],Ri.prototype,"label",2),c([p({attribute:"help-text"})],Ri.prototype,"helpText",2),c([p({type:Boolean,reflect:!0})],Ri.prototype,"inline",2),c([p({attribute:"language-label"})],Ri.prototype,"languageLabel",2),c([p({type:Object})],Ri.prototype,"languages",2),c([D()],Ri.prototype,"_activeLanguage",2);var qO=Ri;Ri.define("zn-translation-group");var t4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;line-height:var(--zn-line-height-dense);--zn-priority-list-item-gap:var(--zn-spacing-2x-small);--zn-priority-list-item-padding:var(--zn-spacing-small) var(--zn-spacing-medium);--zn-priority-list-actions-gap:var(--zn-spacing-small);--zn-priority-list-handle-color:var(--zn-color-neutral-400);--zn-priority-list-priority-color:var(--zn-color-neutral-600)}.form-control{position:relative;border:none;padding:0;margin:0}.form-control__label{padding:0}.priority-list{display:flex;flex-direction:column;gap:var(--zn-priority-list-item-gap)}.priority-list--disabled{opacity:0.5;pointer-events:none}.priority-list--drag-active .priority-list__item{transition:transform 200ms ease,opacity 200ms ease,box-shadow 200ms ease}.priority-list__item{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-priority-list-item-padding);background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:element;position:relative}.priority-list__item:hover{background:rgb(var(--zn-panel-hover,var(--zn-panel)));border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:hover .priority-list__handle{color:rgb(var(--zn-color-primary-500))}.priority-list__item:focus-visible{outline:2px solid rgb(var(--zn-color-primary-500));outline-offset:-1px;border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:active{cursor:grabbing}.priority-list__item--dragging{opacity:0.3;border-style:dashed;border-color:rgb(var(--zn-color-primary-400));background:rgb(var(--zn-color-primary-50,var(--zn-panel)));box-shadow:none}.priority-list__item--disabled{cursor:not-allowed;opacity:0.6}.priority-list__item--disabled:hover{background:rgb(var(--zn-panel));border-color:rgb(var(--zn-border-color))}.priority-list__handle{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--zn-priority-list-handle-color);cursor:grab;transition:color 150ms ease}.priority-list__handle:active{cursor:grabbing}.priority-list__priority{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-width:1.5em;font-size:var(--zn-font-size-small);font-weight:var(--zn-font-weight-semibold);color:var(--zn-priority-list-priority-color)}.priority-list__content{flex:1;min-width:0;overflow:hidden;pointer-events:none}.priority-list__content ::slotted(*){pointer-events:none;-webkit-user-drag:none}.priority-list__actions{display:flex;align-items:center;gap:var(--zn-priority-list-actions-gap);flex-shrink:0;pointer-events:auto}.priority-list__actions ::slotted(*){pointer-events:auto;-webkit-user-drag:none}:host([size=small]) .priority-list__item{padding:var(--zn-spacing-2x-small) var(--zn-spacing-small);font-size:var(--zn-font-size-small)}:host([size=small]) .priority-list__priority{font-size:var(--zn-font-size-x-small);min-width:1.25em}:host([size=large]) .priority-list__item{padding:var(--zn-spacing-medium) var(--zn-spacing-large);font-size:var(--zn-font-size-medium)}:host([size=large]) .priority-list__priority{font-size:var(--zn-font-size-medium);min-width:1.75em}.priority-list__collector{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}.priority-list__hidden-inputs{display:none}`;function RO(o){try{return JSON.parse(o)}catch{return}}var Tt=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this,{value:t=>JSON.stringify(t.getPriorityMap()),defaultValue:t=>t.defaultValue,setValue:(t,r)=>{if(!r||Array.isArray(r)&&r.length===0)return;let n=Array.isArray(r)?r:RO(r);Array.isArray(n)&&n.every(a=>typeof a=="string")&&(t.value=n)}});this.hasSlotController=new te(this,"help-text","label");this.name="";this._value=[];this.defaultValue=[];this.label="";this.labelTooltip="";this.helpText="";this.form="";this.size="medium";this.disabled=!1;this.required=!1;this.priorityStart=1;this.order="";this.draggedKey=null;this.isDragging=!1;this.dragOverKey=null}get value(){return this._value}set value(t){let r=this._value;this._value=[...t],this._assignSlotNames(),this.requestUpdate("value",r)}get validity(){return ht}get validationMessage(){return""}connectedCallback(){super.connectedCallback(),this.defaultValue=[...this._value]}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this._initializeOrderFromSlot()}_initializeOrderFromSlot(){if(this._value.length===0){let r=this._getSlottedItems().map(n=>n.getAttribute("value")||"").filter(n=>n!=="");if(this.order){let n=this.order.split(",").map(h=>h.trim()).filter(h=>h!==""),a=new Set(r),s=n.filter(h=>a.has(h)),l=new Set(s),d=r.filter(h=>!l.has(h));this._value=[...s,...d]}else this._value=r}this.defaultValue=[...this._value],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate()}_getSlottedItems(){let t=["label","label-tooltip","help-text"];return[...this.querySelectorAll(":scope > [value]")].filter(r=>{let n=r.getAttribute("slot");return!n||n.startsWith("_item-")||!t.includes(n)})}_assignSlotNames(){[...this.querySelectorAll(":scope > [value]")].forEach(r=>{let n=r.getAttribute("value");n&&!["label","label-tooltip","help-text"].includes(n)&&r.setAttribute("slot",`_item-${n}`)})}getPriorityMap(){return this._value.map((t,r)=>({key:t,priority:this.priorityStart+r}))}_syncHiddenInputs(){this.hiddenInputsContainer&&(this.hiddenInputsContainer.innerHTML="",this.name&&this._value.forEach((t,r)=>{let n=document.createElement("input");n.type="hidden",n.name=`${this.name}[${t}]`,n.value=String(this.priorityStart+r),this.hiddenInputsContainer.appendChild(n)}))}_moveItem(t,r){if(t===r||t<0||r<0||t>=this._value.length||r>=this._value.length)return;let n=[...this._value],[a]=n.splice(t,1);n.splice(r,0,a),this._value=n,this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()}_submitForm(){if(this.formAction===void 0||this.formAction===null)return;if(this.getForm()){let r=document.createElement("input");r.type="submit",this.formAction&&r.setAttribute("formaction",this.formAction),this.formControlController.submit(r)}else if(this.formAction){let r=document.createElement("form");r.method="post",r.action=this.formAction,r.hidden=!0,this._value.forEach((n,a)=>{if(this.name){let s=document.createElement("input");s.type="hidden",s.name=`${this.name}[${n}]`,s.value=String(this.priorityStart+a),r.appendChild(s)}}),document.body.appendChild(r),r.requestSubmit(),r.remove()}}_handleDragStart(t,r){if(this.disabled){t.preventDefault();return}this.draggedKey=r,this.isDragging=!0,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",r))}_handleDragEnd(){this.isDragging&&(this._syncHiddenInputs(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()),this.draggedKey=null,this.dragOverKey=null,this.isDragging=!1}_handleDragOver(t,r){if(t.preventDefault(),!this.draggedKey||this.draggedKey===r)return;t.dataTransfer&&(t.dataTransfer.dropEffect="move");let n=this._value.indexOf(this.draggedKey),a=this._value.indexOf(r);if(n===-1||a===-1||n===a)return;let s=[...this._value],[l]=s.splice(n,1);s.splice(a,0,l),this._value=s,this._assignSlotNames(),this.requestUpdate(),this.dragOverKey=r}_handleDragLeave(t,r){let n=t.relatedTarget,a=t.currentTarget;n&&a.contains(n)||this.dragOverKey===r&&(this.dragOverKey=null)}_handleDrop(t){t.preventDefault()}_handleKeyDown(t,r){if(this.disabled)return;let n=this._value.indexOf(r);if(n===-1)return;let a=null;switch(t.key){case"ArrowUp":n>0&&(a=n-1);break;case"ArrowDown":n<this._value.length-1&&(a=n+1);break;case"Home":n>0&&(a=0);break;case"End":n<this._value.length-1&&(a=this._value.length-1);break;default:return}a!==null&&(t.preventDefault(),this._moveItem(n,a),this.updateComplete.then(()=>{this.shadowRoot?.querySelectorAll(".priority-list__item")?.[a]?.focus()}))}_handleSlotChange(){let t=[...this.querySelectorAll(":scope > [value]")],r=["label","label-tooltip","help-text"],n=t.filter(h=>{let m=h.getAttribute("slot");return!m||m.startsWith("_item-")||!r.includes(m)}).map(h=>h.getAttribute("value")||"").filter(h=>h!=="");if(n.length===0&&this._value.length>0)return;let a=new Set(this._value),s=new Set(n),l=n.filter(h=>!a.has(h)),d=this._value.filter(h=>s.has(h));(l.length>0||d.length!==this._value.length)&&(this._value=[...d,...l],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate())}checkValidity(){return!0}getForm(){return this.formControlController.getForm()}reportValidity(){return!0}setCustomValidity(t=""){}updated(t){super.updated(t),(t.has("value")||t.has("name")||t.has("priorityStart"))&&this._syncHiddenInputs()}render(){let t=this.hasSlotController.test("label"),r=this.hasSlotController.test("label-tooltip"),n=this.hasSlotController.test("help-text"),a=this.label?!0:t,s=this.labelTooltip?!0:r,l=this.helpText?!0:n;return u`
5017
5017
  <fieldset
5018
5018
  part="form-control"
5019
5019
  class=${q({"form-control":!0,"form-control--small":this.size==="small","form-control--medium":this.size==="medium","form-control--large":this.size==="large","form-control--has-label":a,"form-control--has-label-tooltip":s,"form-control--has-help-text":l})}
@@ -5087,12 +5087,12 @@ ${this.parseList(r)}`}let a=t.ordered?"ol":"ul";return`<${a}>${n.join(`</li>
5087
5087
  <slot name="help-text">${this.helpText}</slot>
5088
5088
  </div>
5089
5089
  </fieldset>
5090
- `}};Tt.dependencies={"zn-icon":he},Tt.styles=[k(Pe),k(t4)],c([U(".priority-list__hidden-inputs")],Tt.prototype,"hiddenInputsContainer",2),c([p()],Tt.prototype,"name",2),c([p({type:Array})],Tt.prototype,"value",1),c([D()],Tt.prototype,"defaultValue",2),c([p()],Tt.prototype,"label",2),c([p({attribute:"label-tooltip"})],Tt.prototype,"labelTooltip",2),c([p({attribute:"help-text"})],Tt.prototype,"helpText",2),c([p({reflect:!0})],Tt.prototype,"form",2),c([p({reflect:!0})],Tt.prototype,"size",2),c([p({type:Boolean,reflect:!0})],Tt.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Tt.prototype,"required",2),c([p({type:Number,attribute:"priority-start"})],Tt.prototype,"priorityStart",2),c([p({attribute:"formaction"})],Tt.prototype,"formAction",2),c([p()],Tt.prototype,"order",2),c([D()],Tt.prototype,"draggedKey",2),c([D()],Tt.prototype,"isDragging",2);var qO=Tt;Tt.define("zn-priority-list");function mv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $s=mv();function h4(o){$s=o}var Es={exec:()=>null};function rc(o){let i=[];return t=>{let r=Math.max(0,Math.min(3,t-1)),n=i[r];return n||(n=o(r),i[r]=n),n}}function _e(o,i=""){let t=typeof o=="string"?o:o.source,r={replace:(n,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Hr.caret,"$1"),t=t.replace(n,s),r},getRegex:()=>new RegExp(t,i)};return r}var RO=((o="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+o)}catch{return!1}})(),Hr={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:rc(o=>new RegExp(`^ {0,${o}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:rc(o=>new RegExp(`^ {0,${o}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:rc(o=>new RegExp(`^ {0,${o}}(?:\`\`\`|~~~)`)),headingBeginRegex:rc(o=>new RegExp(`^ {0,${o}}#`)),htmlBeginRegex:rc(o=>new RegExp(`^ {0,${o}}(?:</?(?:${Jd})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:rc(o=>new RegExp(`^ {0,${o}}>`))},DO=/^(?:[ \t]*(?:\n|$))+/,OO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,NO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,PO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,u4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,m4=_e(u4).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),HO=_e(u4).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),gv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,FO=/^[^\n]+/,bv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,BO=_e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),VO=_e(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,fv).getRegex(),Jd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,UO=_e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vv).replace("tag",Jd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f4=o=>_e(gv).replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",o).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex(),jO=f4(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),GO=f4(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),WO=_e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",GO).getRegex(),yv={blockquote:WO,code:OO,def:BO,fences:NO,heading:PO,hr:Qd,html:UO,lheading:m4,list:VO,newline:DO,paragraph:jO,table:Es,text:FO},r4=_e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex(),KO={...yv,lheading:HO,table:r4,paragraph:_e(gv).replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",r4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex()},YO={...yv,html:_e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Es,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_e(gv).replace("hr",Qd).replace("heading",` *#{1,6} *[^
5091
- ]`).replace("lheading",m4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},XO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,QO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,g4=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,JO=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vo=/[\p{P}\p{S}]/u,ic=/[\s\p{P}\p{S}]/u,Zd=/[^\s\p{P}\p{S}]/u,ZO=_e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ic).getRegex(),eN=/[\p{Pi}\p{Ps}"']/u,b4=/(?!~)[\p{P}\p{S}]/u,tN=/(?!~)[\s\p{P}\p{S}]/u,rN=/(?:[^\s\p{P}\p{S}]|~)/u,iN=_e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",RO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),v4=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nN=_e(v4,"u").replace(/punct/g,Vo).getRegex(),oN=_e(v4,"u").replace(/punct/g,b4).getRegex(),aN=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,sN=_e(aN,"u").replace(/openQuote/g,eN).replace(/punct/g,Vo).getRegex(),y4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lN=_e(y4,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),cN=_e(y4,"gu").replace(/notPunctSpace/g,rN).replace(/punctSpace/g,tN).replace(/punct/g,b4).getRegex(),dN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",pN=_e(dN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),hN=_e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),uN="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",mN=_e(uN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),fN=_e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Vo).getRegex(),gN="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bN=_e(gN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),vN=_e(/\\(punct)/,"gu").replace(/punct/g,Vo).getRegex(),yN=_e(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xN=_e(vv).replace("(?:-->|$)","-->").getRegex(),wN=_e("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),x4=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ju=_e(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",x4).getRegex(),_N=_e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ju).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zN=_e(/^!?\[(label)\]\[(ref)\]/).replace("label",Ju).replace("ref",bv).getRegex(),kN=_e(/^!?\[(ref)\](?:\[\])?/).replace("ref",bv).getRegex(),i4=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,SN=_e(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",x4).getRegex(),CN=_e("reflink|nolink(?!\\()","g").replace("reflink",_e(/^!?\[(label)\]\[(ref)\]/).replace("label",SN).replace("ref",i4).getRegex()).replace("nolink",_e(/^!?\[(ref)\](?:\[\])?/).replace("ref",i4).getRegex()).getRegex(),n4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,EN=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,TN=_e(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,EN).getRegex(),xv={_backpedal:Es,anyPunctuation:vN,autolink:yN,blockSkip:iN,br:g4,code:QO,del:Es,delLDelim:Es,delRDelim:Es,emStrongLDelim:nN,emStrongRDelimAst:lN,emStrongRDelimUnd:hN,escape:XO,link:_N,nolink:kN,punctuation:ZO,reflink:zN,reflinkSearch:CN,tag:wN,text:JO,url:Es},$N={...xv,emStrongLDelim:sN,emStrongRDelimAst:pN,emStrongRDelimUnd:mN,link:_e(/^!?\[(label)\]\((.*?)\)/).replace("label",Ju).getRegex(),reflink:_e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ju).getRegex()},pv={...xv,emStrongRDelimAst:cN,emStrongLDelim:oN,delLDelim:fN,delRDelim:bN,url:_e(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",TN).replace("protocol",n4).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_e(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",n4).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},AN={...pv,br:_e(g4).replace("{2,}","*").getRegex(),text:_e(pv.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xu={normal:yv,gfm:KO,pedantic:YO},Yd={normal:xv,gfm:pv,breaks:AN,pedantic:$N},LN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o4=o=>LN[o];function rn(o,i){if(i){if(Hr.escapeTest.test(o))return o.replace(Hr.escapeReplace,o4)}else if(Hr.escapeTestNoEncode.test(o))return o.replace(Hr.escapeReplaceNoEncode,o4);return o}function MN(o){return o.replace(Hr.numericCharacterReference,(i,t,r)=>{let n=t===void 0?Number.parseInt(r,16):Number.parseInt(t,10);return n===0||n>1114111||n>=55296&&n<=57343?"\uFFFD":String.fromCodePoint(n)})}function a4(o){try{o=encodeURI(o).replace(Hr.percentDecode,"%")}catch{return null}return o}function s4(o,i){let t=o.replace(Hr.findPipe,(a,s,l)=>{let d=!1,h=s;for(;--h>=0&&l[h]==="\\";)d=!d;return d?"|":" |"}),r=t.split(Hr.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),i)if(r.length>i)r.splice(i);else for(;r.length<i;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(Hr.slashPipe,"|");return r}function Da(o,i,t){let r=o.length;if(r===0)return"";let n=0;for(;n<r;){let a=o.charAt(r-n-1);if(a===i&&!t)n++;else if(a!==i&&t)n++;else break}return o.slice(0,r-n)}function l4(o){let i=o.split(`
5090
+ `}};Tt.dependencies={"zn-icon":he},Tt.styles=[k(Pe),k(t4)],c([U(".priority-list__hidden-inputs")],Tt.prototype,"hiddenInputsContainer",2),c([p()],Tt.prototype,"name",2),c([p({type:Array})],Tt.prototype,"value",1),c([D()],Tt.prototype,"defaultValue",2),c([p()],Tt.prototype,"label",2),c([p({attribute:"label-tooltip"})],Tt.prototype,"labelTooltip",2),c([p({attribute:"help-text"})],Tt.prototype,"helpText",2),c([p({reflect:!0})],Tt.prototype,"form",2),c([p({reflect:!0})],Tt.prototype,"size",2),c([p({type:Boolean,reflect:!0})],Tt.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Tt.prototype,"required",2),c([p({type:Number,attribute:"priority-start"})],Tt.prototype,"priorityStart",2),c([p({attribute:"formaction"})],Tt.prototype,"formAction",2),c([p()],Tt.prototype,"order",2),c([D()],Tt.prototype,"draggedKey",2),c([D()],Tt.prototype,"isDragging",2);var DO=Tt;Tt.define("zn-priority-list");function mv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $s=mv();function h4(o){$s=o}var Es={exec:()=>null};function rc(o){let i=[];return t=>{let r=Math.max(0,Math.min(3,t-1)),n=i[r];return n||(n=o(r),i[r]=n),n}}function _e(o,i=""){let t=typeof o=="string"?o:o.source,r={replace:(n,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Hr.caret,"$1"),t=t.replace(n,s),r},getRegex:()=>new RegExp(t,i)};return r}var OO=((o="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+o)}catch{return!1}})(),Hr={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:rc(o=>new RegExp(`^ {0,${o}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:rc(o=>new RegExp(`^ {0,${o}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:rc(o=>new RegExp(`^ {0,${o}}(?:\`\`\`|~~~)`)),headingBeginRegex:rc(o=>new RegExp(`^ {0,${o}}#`)),htmlBeginRegex:rc(o=>new RegExp(`^ {0,${o}}(?:</?(?:${Jd})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:rc(o=>new RegExp(`^ {0,${o}}>`))},NO=/^(?:[ \t]*(?:\n|$))+/,PO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,HO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,FO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,u4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,m4=_e(u4).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),BO=_e(u4).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),gv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,VO=/^[^\n]+/,bv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,UO=_e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jO=_e(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,fv).getRegex(),Jd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,GO=_e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vv).replace("tag",Jd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f4=o=>_e(gv).replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",o).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex(),WO=f4(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),KO=f4(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),YO=_e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",KO).getRegex(),yv={blockquote:YO,code:PO,def:UO,fences:HO,heading:FO,hr:Qd,html:GO,lheading:m4,list:jO,newline:NO,paragraph:WO,table:Es,text:VO},r4=_e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex(),XO={...yv,lheading:BO,table:r4,paragraph:_e(gv).replace("hr",Qd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",r4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jd).getRegex()},QO={...yv,html:_e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Es,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_e(gv).replace("hr",Qd).replace("heading",` *#{1,6} *[^
5091
+ ]`).replace("lheading",m4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},JO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ZO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,g4=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,eN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vo=/[\p{P}\p{S}]/u,ic=/[\s\p{P}\p{S}]/u,Zd=/[^\s\p{P}\p{S}]/u,tN=_e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ic).getRegex(),rN=/[\p{Pi}\p{Ps}"']/u,b4=/(?!~)[\p{P}\p{S}]/u,iN=/(?!~)[\s\p{P}\p{S}]/u,nN=/(?:[^\s\p{P}\p{S}]|~)/u,oN=_e(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",OO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),v4=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,aN=_e(v4,"u").replace(/punct/g,Vo).getRegex(),sN=_e(v4,"u").replace(/punct/g,b4).getRegex(),lN=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,cN=_e(lN,"u").replace(/openQuote/g,rN).replace(/punct/g,Vo).getRegex(),y4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dN=_e(y4,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),pN=_e(y4,"gu").replace(/notPunctSpace/g,nN).replace(/punctSpace/g,iN).replace(/punct/g,b4).getRegex(),hN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",uN=_e(hN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),mN=_e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),fN="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",gN=_e(fN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),bN=_e(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Vo).getRegex(),vN="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",yN=_e(vN,"gu").replace(/notPunctSpace/g,Zd).replace(/punctSpace/g,ic).replace(/punct/g,Vo).getRegex(),xN=_e(/\\(punct)/,"gu").replace(/punct/g,Vo).getRegex(),wN=_e(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_N=_e(vv).replace("(?:-->|$)","-->").getRegex(),zN=_e("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_N).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),x4=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ju=_e(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",x4).getRegex(),kN=_e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ju).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),SN=_e(/^!?\[(label)\]\[(ref)\]/).replace("label",Ju).replace("ref",bv).getRegex(),CN=_e(/^!?\[(ref)\](?:\[\])?/).replace("ref",bv).getRegex(),i4=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,EN=_e(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",x4).getRegex(),TN=_e("reflink|nolink(?!\\()","g").replace("reflink",_e(/^!?\[(label)\]\[(ref)\]/).replace("label",EN).replace("ref",i4).getRegex()).replace("nolink",_e(/^!?\[(ref)\](?:\[\])?/).replace("ref",i4).getRegex()).getRegex(),n4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$N=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,AN=_e(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,$N).getRegex(),xv={_backpedal:Es,anyPunctuation:xN,autolink:wN,blockSkip:oN,br:g4,code:ZO,del:Es,delLDelim:Es,delRDelim:Es,emStrongLDelim:aN,emStrongRDelimAst:dN,emStrongRDelimUnd:mN,escape:JO,link:kN,nolink:CN,punctuation:tN,reflink:SN,reflinkSearch:TN,tag:zN,text:eN,url:Es},LN={...xv,emStrongLDelim:cN,emStrongRDelimAst:uN,emStrongRDelimUnd:gN,link:_e(/^!?\[(label)\]\((.*?)\)/).replace("label",Ju).getRegex(),reflink:_e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ju).getRegex()},pv={...xv,emStrongRDelimAst:pN,emStrongLDelim:sN,delLDelim:bN,delRDelim:yN,url:_e(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",AN).replace("protocol",n4).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_e(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",n4).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},MN={...pv,br:_e(g4).replace("{2,}","*").getRegex(),text:_e(pv.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xu={normal:yv,gfm:XO,pedantic:QO},Yd={normal:xv,gfm:pv,breaks:MN,pedantic:LN},IN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o4=o=>IN[o];function rn(o,i){if(i){if(Hr.escapeTest.test(o))return o.replace(Hr.escapeReplace,o4)}else if(Hr.escapeTestNoEncode.test(o))return o.replace(Hr.escapeReplaceNoEncode,o4);return o}function qN(o){return o.replace(Hr.numericCharacterReference,(i,t,r)=>{let n=t===void 0?Number.parseInt(r,16):Number.parseInt(t,10);return n===0||n>1114111||n>=55296&&n<=57343?"\uFFFD":String.fromCodePoint(n)})}function a4(o){try{o=encodeURI(o).replace(Hr.percentDecode,"%")}catch{return null}return o}function s4(o,i){let t=o.replace(Hr.findPipe,(a,s,l)=>{let d=!1,h=s;for(;--h>=0&&l[h]==="\\";)d=!d;return d?"|":" |"}),r=t.split(Hr.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),i)if(r.length>i)r.splice(i);else for(;r.length<i;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(Hr.slashPipe,"|");return r}function Da(o,i,t){let r=o.length;if(r===0)return"";let n=0;for(;n<r;){let a=o.charAt(r-n-1);if(a===i&&!t)n++;else if(a!==i&&t)n++;else break}return o.slice(0,r-n)}function l4(o){let i=o.split(`
5092
5092
  `),t=i.length-1;for(;t>=0&&Hr.blankLine.test(i[t]);)t--;return i.length-t<=2?o:i.slice(0,t+1).join(`
5093
- `)}function Zu(o){return o.trim().toLowerCase().toUpperCase().toLowerCase()}function IN(o,i){if(o.indexOf(i[1])===-1)return-1;let t=0;for(let r=0;r<o.length;r++)if(o[r]==="\\")r++;else if(o[r]===i[0])t++;else if(o[r]===i[1]&&(t--,t<0))return r;return t>0?-2:-1}function c4(o,i=0){let t=i,r="";for(let n of o)if(n===" "){let a=4-t%4;r+=" ".repeat(a),t+=a}else r+=n,t++;return r}function d4(o,i,t,r,n){let a=i.href,s=i.title||null,l=o[1].replace(n.other.outputLinkReplace,"$1"),d=o[0].charAt(0)==="!";r.state.inLink=!0;let h=r.state.linkEmitted,m=r.state.inRawBlock;r.state.linkEmitted=!1;let f=r.inlineTokens(l),b=r.state.linkEmitted;if(r.state.linkEmitted=h,r.state.inLink=!1,!d){if(b){r.state.inRawBlock=m;return}r.state.linkEmitted=!0}return{type:d?"image":"link",raw:t,href:a,title:s,text:l,tokens:f}}function qN(o,i,t){let r=o.match(t.other.indentCodeCompensation);if(r===null)return i;let n=r[1];return i.split(`
5093
+ `)}function Zu(o){return o.trim().toLowerCase().toUpperCase().toLowerCase()}function RN(o,i){if(o.indexOf(i[1])===-1)return-1;let t=0;for(let r=0;r<o.length;r++)if(o[r]==="\\")r++;else if(o[r]===i[0])t++;else if(o[r]===i[1]&&(t--,t<0))return r;return t>0?-2:-1}function c4(o,i=0){let t=i,r="";for(let n of o)if(n===" "){let a=4-t%4;r+=" ".repeat(a),t+=a}else r+=n,t++;return r}function d4(o,i,t,r,n){let a=i.href,s=i.title||null,l=o[1].replace(n.other.outputLinkReplace,"$1"),d=o[0].charAt(0)==="!";r.state.inLink=!0;let h=r.state.linkEmitted,m=r.state.inRawBlock;r.state.linkEmitted=!1;let f=r.inlineTokens(l),b=r.state.linkEmitted;if(r.state.linkEmitted=h,r.state.inLink=!1,!d){if(b){r.state.inRawBlock=m;return}r.state.linkEmitted=!0}return{type:d?"image":"link",raw:t,href:a,title:s,text:l,tokens:f}}function DN(o,i,t){let r=o.match(t.other.indentCodeCompensation);if(r===null)return i;let n=r[1];return i.split(`
5094
5094
  `).map(a=>{let s=a.match(t.other.beginningSpace);if(s===null)return a;let[l]=s;return a.slice(Math.min(l.length,n.length))}).join(`
5095
- `)}function p4(o,i,t,r){if(!i.includes("<"))return!1;for(let n=0;n<i.length;n++){if(i[n]==="\\"){n++;continue}if(i[n]==="`"){let l=r.inline.code.exec(i.slice(n));if(l){n+=l[0].length-1;continue}}if(i[n]!=="<")continue;let a=o.slice(t+n),s=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(s){if(s[0].length>i.length-n)return!0;n+=s[0].length-1}}return!1}var em=class{constructor(o){W(this,"options");W(this,"rules");W(this,"lexer");this.options=o||$s}space(o){let i=this.rules.block.newline.exec(o);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(o){let i=this.rules.block.code.exec(o);if(i){let t=this.options.pedantic?i[0]:l4(i[0]),r=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:r}}}fences(o){let i=this.rules.block.fences.exec(o);if(i){let t=i[0],r=qN(t,i[3]||"",this.rules);return{type:"code",raw:t,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:r}}}heading(o){let i=this.rules.block.heading.exec(o);if(i){let t=i[2].trim();if(this.rules.other.endingHash.test(t)){let r=Da(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(t=r.trim())}return{type:"heading",raw:Da(i[0],`
5095
+ `)}function p4(o,i,t,r){if(!i.includes("<"))return!1;for(let n=0;n<i.length;n++){if(i[n]==="\\"){n++;continue}if(i[n]==="`"){let l=r.inline.code.exec(i.slice(n));if(l){n+=l[0].length-1;continue}}if(i[n]!=="<")continue;let a=o.slice(t+n),s=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(s){if(s[0].length>i.length-n)return!0;n+=s[0].length-1}}return!1}var em=class{constructor(o){W(this,"options");W(this,"rules");W(this,"lexer");this.options=o||$s}space(o){let i=this.rules.block.newline.exec(o);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(o){let i=this.rules.block.code.exec(o);if(i){let t=this.options.pedantic?i[0]:l4(i[0]),r=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:r}}}fences(o){let i=this.rules.block.fences.exec(o);if(i){let t=i[0],r=DN(t,i[3]||"",this.rules);return{type:"code",raw:t,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:r}}}heading(o){let i=this.rules.block.heading.exec(o);if(i){let t=i[2].trim();if(this.rules.other.endingHash.test(t)){let r=Da(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(t=r.trim())}return{type:"heading",raw:Da(i[0],`
5096
5096
  `),depth:i[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(o){let i=this.rules.block.hr.exec(o);if(i)return{type:"hr",raw:Da(i[0],`
5097
5097
  `)}}blockquote(o){let i=this.rules.block.blockquote.exec(o);if(i){let t=Da(i[0],`
5098
5098
  `).split(`
@@ -5120,7 +5120,7 @@ ${G.join(`
5120
5120
  `):[],a={type:"table",raw:Da(i[0],`
5121
5121
  `),header:[],align:[],rows:[]};if(t.length===r.length){for(let s of r)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<t.length;s++)a.header.push({text:t[s],tokens:this.lexer.inline(t[s]),header:!0,align:a.align[s]});for(let s of n)a.rows.push(s4(s,a.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[d]})));return a}}lheading(o){let i=this.rules.block.lheading.exec(o);if(i){let t=i[1].trim();return{type:"heading",raw:Da(i[0],`
5122
5122
  `),depth:i[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(o){let i=this.rules.block.paragraph.exec(o);if(i){let t=i[1].charAt(i[1].length-1)===`
5123
- `?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:t,tokens:this.lexer.inline(t)}}}text(o){let i=this.rules.block.text.exec(o);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(o){let i=this.rules.inline.escape.exec(o);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(o){let i=this.rules.inline.tag.exec(o);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(o){let i=this.rules.inline.link.exec(o);if(i){let t=i[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&p4(o,i[1],t,this.rules))return;let r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let s=Da(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{let s=IN(i[2],"()");if(s===-2)return;if(s>-1){let l=(i[0].indexOf("!")===0?5:4)+i[1].length+s;i[2]=i[2].substring(0,s),i[0]=i[0].substring(0,l).trim(),i[3]=""}}let n=i[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],a=s[3])}else a=i[3]?i[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),d4(i,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(o,i){let t;if((t=this.rules.inline.reflink.exec(o))||(t=this.rules.inline.nolink.exec(o))){let r=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&p4(o,t[1],r,this.rules))return;let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=i[Zu(n)];if(!a){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return d4(t,a,t[0],this.lexer,this.rules)}}emStrong(o,i,t=""){let r=this.rules.inline.emStrongLDelim.exec(o);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,a,s,l=n,d=0,h=r[0][0],m=t===h,f=h==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,i=i.slice(-1*o.length+n);(r=f.exec(i))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(s=[...a].length,r[3]||r[4]){l+=s;continue}else if(r[5]||r[6]){if(n%3&&!((n+s)%3)){d+=s;continue}if(m)break}if(l-=s,l>0)continue;s=Math.min(s,s+l+d);let b=[...r[0]][0].length,g=o.slice(0,n+r.index+b+s);if(Math.min(n,s)%2){let y=g.slice(1,-1);return{type:"em",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}let v=g.slice(2,-2);return{type:"strong",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(o){let i=this.rules.inline.code.exec(o);if(i){let t=i[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:i[0],text:t}}}br(o){let i=this.rules.inline.br.exec(o);if(i)return{type:"br",raw:i[0]}}del(o,i,t=""){let r=this.rules.inline.delLDelim.exec(o);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,a,s,l=n,d=this.rules.inline.delRDelim;for(d.lastIndex=0,i=i.slice(-1*o.length+n);(r=d.exec(i))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(s=[...a].length,s!==n))continue;if(r[3]||r[4]){l+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l);let h=[...r[0]][0].length,m=o.slice(0,n+r.index+h+s),f=m.slice(n,-n);return{type:"del",raw:m,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(o){let i=this.rules.inline.autolink.exec(o);if(i){let t,r;return i[2]==="@"?(t=i[1],r="mailto:"+t):(t=i[1],r=t),{type:"link",raw:i[0],text:t,href:r,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}url(o){let i;if(i=this.rules.inline.url.exec(o)){let t,r;if(i[2]==="@")t=i[0],r="mailto:"+t;else{let n;do n=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(n!==i[0]);t=i[0],i[1]==="www."?r="http://"+i[0]:r=i[0]}return{type:"link",raw:i[0],text:t,href:r,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(o){let i=this.rules.inline.text.exec(o);if(i){let t=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:t?i[0]:MN(i[0]),escaped:t}}}},Un=class hv{constructor(i){W(this,"tokens");W(this,"options");W(this,"state");W(this,"inlineQueue");W(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||$s,this.options.tokenizer=this.options.tokenizer||new em,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Hr,block:Xu.normal,inline:Yd.normal};this.options.pedantic?(t.block=Xu.pedantic,t.inline=Yd.pedantic):this.options.gfm&&(t.block=Xu.gfm,this.options.breaks?t.inline=Yd.breaks:t.inline=Yd.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xu,inline:Yd}}static lex(i,t){return new hv(t).lex(i)}static lexInline(i,t){return new hv(t).inlineTokens(i)}lex(i){i=i.replace(Hr.carriageReturn,`
5123
+ `?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:t,tokens:this.lexer.inline(t)}}}text(o){let i=this.rules.block.text.exec(o);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(o){let i=this.rules.inline.escape.exec(o);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(o){let i=this.rules.inline.tag.exec(o);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(o){let i=this.rules.inline.link.exec(o);if(i){let t=i[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&p4(o,i[1],t,this.rules))return;let r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let s=Da(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{let s=RN(i[2],"()");if(s===-2)return;if(s>-1){let l=(i[0].indexOf("!")===0?5:4)+i[1].length+s;i[2]=i[2].substring(0,s),i[0]=i[0].substring(0,l).trim(),i[3]=""}}let n=i[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],a=s[3])}else a=i[3]?i[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),d4(i,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(o,i){let t;if((t=this.rules.inline.reflink.exec(o))||(t=this.rules.inline.nolink.exec(o))){let r=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&p4(o,t[1],r,this.rules))return;let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=i[Zu(n)];if(!a){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return d4(t,a,t[0],this.lexer,this.rules)}}emStrong(o,i,t=""){let r=this.rules.inline.emStrongLDelim.exec(o);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,a,s,l=n,d=0,h=r[0][0],m=t===h,f=h==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,i=i.slice(-1*o.length+n);(r=f.exec(i))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(s=[...a].length,r[3]||r[4]){l+=s;continue}else if(r[5]||r[6]){if(n%3&&!((n+s)%3)){d+=s;continue}if(m)break}if(l-=s,l>0)continue;s=Math.min(s,s+l+d);let b=[...r[0]][0].length,g=o.slice(0,n+r.index+b+s);if(Math.min(n,s)%2){let y=g.slice(1,-1);return{type:"em",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}let v=g.slice(2,-2);return{type:"strong",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(o){let i=this.rules.inline.code.exec(o);if(i){let t=i[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:i[0],text:t}}}br(o){let i=this.rules.inline.br.exec(o);if(i)return{type:"br",raw:i[0]}}del(o,i,t=""){let r=this.rules.inline.delLDelim.exec(o);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,a,s,l=n,d=this.rules.inline.delRDelim;for(d.lastIndex=0,i=i.slice(-1*o.length+n);(r=d.exec(i))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(s=[...a].length,s!==n))continue;if(r[3]||r[4]){l+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l);let h=[...r[0]][0].length,m=o.slice(0,n+r.index+h+s),f=m.slice(n,-n);return{type:"del",raw:m,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(o){let i=this.rules.inline.autolink.exec(o);if(i){let t,r;return i[2]==="@"?(t=i[1],r="mailto:"+t):(t=i[1],r=t),{type:"link",raw:i[0],text:t,href:r,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}url(o){let i;if(i=this.rules.inline.url.exec(o)){let t,r;if(i[2]==="@")t=i[0],r="mailto:"+t;else{let n;do n=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(n!==i[0]);t=i[0],i[1]==="www."?r="http://"+i[0]:r=i[0]}return{type:"link",raw:i[0],text:t,href:r,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(o){let i=this.rules.inline.text.exec(o);if(i){let t=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:t?i[0]:qN(i[0]),escaped:t}}}},Un=class hv{constructor(i){W(this,"tokens");W(this,"options");W(this,"state");W(this,"inlineQueue");W(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||$s,this.options.tokenizer=this.options.tokenizer||new em,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Hr,block:Xu.normal,inline:Yd.normal};this.options.pedantic?(t.block=Xu.pedantic,t.inline=Yd.pedantic):this.options.gfm&&(t.block=Xu.gfm,this.options.breaks?t.inline=Yd.breaks:t.inline=Yd.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xu,inline:Yd}}static lex(i,t){return new hv(t).lex(i)}static lexInline(i,t){return new hv(t).inlineTokens(i)}lex(i){i=i.replace(Hr.carriageReturn,`
5124
5124
  `),this.blockTokens(i,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,t=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(i=i.replace(Hr.tabCharGlobal," ").replace(Hr.spaceLine,""));let n=1/0;for(;i;){if(i.length<n)n=i.length;else{this.infiniteLoopError(i.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(l=>(a=l.call({lexer:this},i,t))?(i=i.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(i)){i=i.substring(a.raw.length);let l=t.at(-1);a.raw.length===1&&l!==void 0?l.raw+=`
5125
5125
  `:t.push(a);continue}if(a=this.tokenizer.code(i)){i=i.substring(a.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
5126
5126
  `)?"":`
@@ -5152,8 +5152,8 @@ ${this.parser.parse(o)}</blockquote>
5152
5152
  `}tablerow({text:o}){return`<tr>
5153
5153
  ${o}</tr>
5154
5154
  `}tablecell(o){let i=this.parser.parseInline(o.tokens),t=o.header?"th":"td";return(o.align?`<${t} align="${o.align}">`:`<${t}>`)+i+`</${t}>
5155
- `}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${rn(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:i,text:t,tokens:r,autolink:n}){let a=n?rn(t,!0):this.parser.parseInline(r),s=a4(o);if(s===null)return a;o=rn(s,n);let l='<a href="'+o+'"';return i&&(l+=' title="'+rn(i)+'"'),l+=">"+a+"</a>",l}image({href:o,title:i,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let n=a4(o);if(n===null)return rn(t);o=n;let a=`<img src="${rn(o)}" alt="${rn(t)}"`;return i&&(a+=` title="${rn(i)}"`),a+=">",a}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:rn(o.text)}},wv=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}checkbox({raw:o}){return o}},jn=class uv{constructor(i){W(this,"options");W(this,"renderer");W(this,"textRenderer");this.options=i||$s,this.options.renderer=this.options.renderer||new tm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wv}static parse(i,t){return new uv(t).parse(i)}static parseInline(i,t){return new uv(t).parseInline(i)}parse(i){this.renderer.parser=this;let t="";for(let r=0;r<i.length;r++){let n=i[r];if(this.options.extensions?.renderers?.[n.type]){let s=n,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){t+=l||"";continue}}let a=n;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(i,t=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<i.length;n++){let a=i[n];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){r+=l||"";continue}}let s=a;switch(s.type){case"escape":{r+=t.text(s);break}case"html":{r+=t.html(s);break}case"link":{r+=t.link(s);break}case"image":{r+=t.image(s);break}case"checkbox":{r+=t.checkbox(s);break}case"strong":{r+=t.strong(s);break}case"em":{r+=t.em(s);break}case"codespan":{r+=t.codespan(s);break}case"br":{r+=t.br(s);break}case"del":{r+=t.del(s);break}case"text":{r+=t.text(s);break}default:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},Qu,Xd=(Qu=class{constructor(o){W(this,"options");W(this,"block");this.options=o||$s}preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}emStrongMask(o){return o}provideLexer(o=this.block){return o?Un.lex:Un.lexInline}provideParser(o=this.block){return o?jn.parse:jn.parseInline}},W(Qu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),W(Qu,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qu),RN=class{constructor(...o){W(this,"defaults",mv());W(this,"options",this.setOptions);W(this,"parse",this.parseMarkdown(!0));W(this,"parseInline",this.parseMarkdown(!1));W(this,"Parser",jn);W(this,"Renderer",tm);W(this,"TextRenderer",wv);W(this,"Lexer",Un);W(this,"Tokenizer",em);W(this,"Hooks",Xd);this.use(...o)}walkTokens(o,i){let t=[];for(let r of o)switch(t=t.concat(i.call(this,r)),r.type){case"table":{let n=r;for(let a of n.header)t=t.concat(this.walkTokens(a.tokens,i));for(let a of n.rows)for(let s of a)t=t.concat(this.walkTokens(s.tokens,i));break}case"list":{let n=r;t=t.concat(this.walkTokens(n.items,i));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let s=n[a].flat(1/0);t=t.concat(this.walkTokens(s,i))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,i)))}}return t}use(...o){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=i.renderers[n.name];a?i.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:i.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=i[n.level];a?a.unshift(n.tokenizer):i[n.level]=[n.tokenizer],n.start&&(n.level==="block"?i.startBlock?i.startBlock.push(n.start):i.startBlock=[n.start]:n.level==="inline"&&(i.startInline?i.startInline.push(n.start):i.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(i.childTokens[n.name]=n.childTokens)}),r.extensions=i),t.renderer){let n=this.defaults.renderer||new tm(this.defaults);for(let a in t.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=t.renderer[s],d=n[s];n[s]=(...h)=>{let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m||""}}r.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new em(this.defaults);for(let a in t.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=t.tokenizer[s],d=n[s];n[s]=(...h)=>{let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m}}r.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new Xd;for(let a in t.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=t.hooks[s],d=n[s];Xd.passThroughHooks.has(a)?n[s]=h=>{if(this.defaults.async&&Xd.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(n,h);return d.call(n,f)})();let m=l.call(n,h);return d.call(n,m)}:n[s]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(n,h);return f===!1&&(f=await d.apply(n,h)),f})();let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m}}r.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,a=t.walkTokens;r.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),n&&(l=l.concat(n.call(this,s))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,i){return Un.lex(o,i??this.defaults)}parser(o,i){return jn.parse(o,i??this.defaults)}parseMarkdown(o){return(i,t)=>{let r={...t},n={...this.defaults,...r},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=o),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(i):i,l=await(n.hooks?await n.hooks.provideLexer(o):o?Un.lex:Un.lexInline)(s,n),d=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(d,n.walkTokens));let h=await(n.hooks?await n.hooks.provideParser(o):o?jn.parse:jn.parseInline)(d,n);return n.hooks?await n.hooks.postprocess(h):h})().catch(a);try{n.hooks&&(i=n.hooks.preprocess(i));let s=(n.hooks?n.hooks.provideLexer(o):o?Un.lex:Un.lexInline)(i,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(o):o?jn.parse:jn.parseInline)(s,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(s){return a(s)}}}onError(o,i){return t=>{if(t.message+=`
5156
- Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error occurred:</p><pre>"+rn(t.message+"",!0)+"</pre>";return i?Promise.resolve(r):r}if(i)return Promise.reject(t);throw t}}},Ts=new RN;function tt(o,i){return Ts.parse(o,i)}tt.options=tt.setOptions=function(o){return Ts.setOptions(o),tt.defaults=Ts.defaults,h4(tt.defaults),tt};tt.getDefaults=mv;tt.defaults=$s;function DN(...o){return Ts.use(...o),tt.defaults=Ts.defaults,h4(tt.defaults),tt}tt.use=DN;tt.walkTokens=function(o,i){return Ts.walkTokens(o,i)};tt.parseInline=Ts.parseInline;tt.Parser=jn;tt.parser=jn.parse;tt.Renderer=tm;tt.TextRenderer=wv;tt.Lexer=Un;tt.lexer=Un.lex;tt.Tokenizer=em;tt.Hooks=Xd;tt.parse=tt;var O9e=tt.options,N9e=tt.setOptions,P9e=tt.walkTokens,H9e=tt.parseInline;var F9e=jn.parse,B9e=Un.lex;var w4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.panel{border:1px solid rgb(var(--zn-border-color));background-color:rgba(var(--zn-panel),var(--zn-panel-opacity));border-radius:var(--zn-border-radius)}.markdown-editor{display:flex;flex-direction:column;gap:var(--zn-spacing-small);width:100%;height:100%;min-height:0}:host([expanded]){position:absolute;top:10px;bottom:10px;left:var(--zn-sp-padding);right:var(--zn-sp-padding);z-index:var(--zn-z-index-editor-action,1000000)}:host([expanded]) .panel,:host([expanded]) .panel__inner,:host([expanded]) .panel__content,:host([expanded]) .panel__body{height:100%;max-height:100%}:host([expanded]) .markdown-editor{height:100%}.markdown-editor__label{font-size:var(--zn-input-label-font-size-medium);color:var(--zn-input-label-color);font-weight:var(--zn-font-weight-semibold)}.markdown-editor__toolbar{display:flex;align-items:end;gap:var(--zn-spacing-small);justify-content:flex-end;flex-wrap:wrap}.markdown-editor__markdown-link{display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);margin-right:auto;font-size:var(--zn-input-label-font-size-small);line-height:1;color:var(--zn-color-neutral-500,#656d76);text-decoration:none;cursor:pointer;transition:color 0.15s ease;padding-left:var(--zn-spacing-x-small)}.markdown-editor__markdown-link:hover{color:var(--zn-color-primary-600,#0969da)}.markdown-editor__markdown-link span{white-space:nowrap}.markdown-editor__view-toggle{display:inline-flex}.markdown-editor__body{display:flex;flex:1;min-height:0;gap:var(--zn-spacing-medium)}.markdown-editor__editor,.markdown-editor__preview-wrapper{flex:1;min-width:0;min-height:0;display:flex}.markdown-editor__editor[hidden],.markdown-editor__preview-wrapper[hidden]{display:none}.markdown-editor__editor zn-textarea{flex:1;width:100%}.markdown-editor__preview-wrapper{overflow:hidden}.markdown-editor__preview{flex:1;background:var(--zn-color-neutral-0,white);border:1px solid var(--zn-color-neutral-200);border-radius:var(--zn-border-radius);padding:var(--zn-spacing-x-large);overflow-y:auto;font-family:inherit;line-height:1.7;color:var(--zn-color-text,#222)}.markdown-editor__preview h1{font-size:1.8em;margin:0.8em 0 0.4em;border-bottom:1px solid var(--zn-color-neutral-200);padding-bottom:0.3em}.markdown-editor__preview h2{font-size:1.5em;margin:0.8em 0 0.4em;border-bottom:1px solid var(--zn-color-neutral-200);padding-bottom:0.2em}.markdown-editor__preview h3{font-size:1.25em;margin:0.7em 0 0.3em}.markdown-editor__preview h4,.markdown-editor__preview h5,.markdown-editor__preview h6{font-size:1.1em;margin:0.6em 0 0.3em}.markdown-editor__preview p{margin:0.6em 0}.markdown-editor__preview ul,.markdown-editor__preview ol{margin:0.6em 0;padding-left:2em;display:block}.markdown-editor__preview ul{list-style-type:disc}.markdown-editor__preview ol{list-style-type:decimal}.markdown-editor__preview ul ul{list-style-type:circle}.markdown-editor__preview ul ul ul{list-style-type:square}.markdown-editor__preview li{margin:0.2em 0;display:list-item}.markdown-editor__preview blockquote{border-left:4px solid var(--zn-color-neutral-300);margin:0.8em 0;padding:0.4em 1em;color:var(--zn-color-neutral-600,#555)}.markdown-editor__preview table{border-collapse:collapse;width:100%;margin:0.8em 0}.markdown-editor__preview th,.markdown-editor__preview td{border:1px solid var(--zn-color-neutral-300);padding:0.4em 0.8em;text-align:left}.markdown-editor__preview th{background:var(--zn-color-neutral-100);font-weight:bold}.markdown-editor__preview code{background:var(--zn-color-neutral-100);padding:0.15em 0.4em;border-radius:3px;font-size:0.9em}.markdown-editor__preview pre{background:var(--zn-color-neutral-100);padding:1em;border-radius:4px;overflow-x:auto}.markdown-editor__preview pre code{background:none;padding:0}.markdown-editor__preview hr{border:none;border-top:1px solid var(--zn-color-neutral-300);margin:1.5em 0}.markdown-editor__preview a{color:var(--zn-color-primary-600)}.markdown-editor__help-text{font-size:var(--zn-input-help-text-font-size-medium);color:var(--zn-input-help-text-color)}`;var ON=[{mode:"editor",icon:"edit_note",label:"Editor"},{mode:"split",icon:"vertical_split",label:"Split"},{mode:"preview",icon:"visibility",label:"Preview"}],kt=class extends mt{constructor(){super(...arguments);this.formControlController=new ce(this,{assumeInteractionOn:["zn-input","zn-change"]});this.markdownSlotController=new te(this,"label","help-text","actions","footer");this.debounceTimer=null;this.name="";this.value="";this.defaultValue="";this.label="";this.helpText="";this.placeholder="Enter markdown content...";this.rows=20;this.viewMode="editor";this.storageKey="zn-markdown-editor-view-mode";this.required=!1;this.readonly=!1;this.disabled=!1;this.expanded=!1;this.handleInput=()=>{this.value=this.textarea.value,this.emit("zn-input"),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.renderPreview(),150)};this.handleChange=()=>{this.value=this.textarea.value,this.emit("zn-change"),this.renderPreview()};this.handleViewToggle=t=>{let n=t.target.closest("[data-mode]")?.dataset.mode;!n||n===this.viewMode||(this.viewMode=n)};this.handleExpandToggle=()=>{this.expanded=!this.expanded}}get validity(){return this.textarea?.validity}get validationMessage(){return this.textarea?.validationMessage??""}checkValidity(){return this.textarea?.checkValidity()??!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.textarea?.reportValidity()??!0}setCustomValidity(t){this.textarea?.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.textarea?.focus(t)}blur(){this.textarea?.blur()}connectedCallback(){if(super.connectedCallback(),!this.hasAttribute("value")&&!this.value){let r=Array.from(this.childNodes).filter(s=>s.nodeType===Node.TEXT_NODE),a=r.map(s=>s.textContent??"").join("").replace(/\r\n/g,`
5155
+ `}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${rn(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:i,text:t,tokens:r,autolink:n}){let a=n?rn(t,!0):this.parser.parseInline(r),s=a4(o);if(s===null)return a;o=rn(s,n);let l='<a href="'+o+'"';return i&&(l+=' title="'+rn(i)+'"'),l+=">"+a+"</a>",l}image({href:o,title:i,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let n=a4(o);if(n===null)return rn(t);o=n;let a=`<img src="${rn(o)}" alt="${rn(t)}"`;return i&&(a+=` title="${rn(i)}"`),a+=">",a}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:rn(o.text)}},wv=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}checkbox({raw:o}){return o}},jn=class uv{constructor(i){W(this,"options");W(this,"renderer");W(this,"textRenderer");this.options=i||$s,this.options.renderer=this.options.renderer||new tm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wv}static parse(i,t){return new uv(t).parse(i)}static parseInline(i,t){return new uv(t).parseInline(i)}parse(i){this.renderer.parser=this;let t="";for(let r=0;r<i.length;r++){let n=i[r];if(this.options.extensions?.renderers?.[n.type]){let s=n,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){t+=l||"";continue}}let a=n;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(i,t=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<i.length;n++){let a=i[n];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){r+=l||"";continue}}let s=a;switch(s.type){case"escape":{r+=t.text(s);break}case"html":{r+=t.html(s);break}case"link":{r+=t.link(s);break}case"image":{r+=t.image(s);break}case"checkbox":{r+=t.checkbox(s);break}case"strong":{r+=t.strong(s);break}case"em":{r+=t.em(s);break}case"codespan":{r+=t.codespan(s);break}case"br":{r+=t.br(s);break}case"del":{r+=t.del(s);break}case"text":{r+=t.text(s);break}default:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},Qu,Xd=(Qu=class{constructor(o){W(this,"options");W(this,"block");this.options=o||$s}preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}emStrongMask(o){return o}provideLexer(o=this.block){return o?Un.lex:Un.lexInline}provideParser(o=this.block){return o?jn.parse:jn.parseInline}},W(Qu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),W(Qu,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qu),ON=class{constructor(...o){W(this,"defaults",mv());W(this,"options",this.setOptions);W(this,"parse",this.parseMarkdown(!0));W(this,"parseInline",this.parseMarkdown(!1));W(this,"Parser",jn);W(this,"Renderer",tm);W(this,"TextRenderer",wv);W(this,"Lexer",Un);W(this,"Tokenizer",em);W(this,"Hooks",Xd);this.use(...o)}walkTokens(o,i){let t=[];for(let r of o)switch(t=t.concat(i.call(this,r)),r.type){case"table":{let n=r;for(let a of n.header)t=t.concat(this.walkTokens(a.tokens,i));for(let a of n.rows)for(let s of a)t=t.concat(this.walkTokens(s.tokens,i));break}case"list":{let n=r;t=t.concat(this.walkTokens(n.items,i));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let s=n[a].flat(1/0);t=t.concat(this.walkTokens(s,i))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,i)))}}return t}use(...o){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=i.renderers[n.name];a?i.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:i.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=i[n.level];a?a.unshift(n.tokenizer):i[n.level]=[n.tokenizer],n.start&&(n.level==="block"?i.startBlock?i.startBlock.push(n.start):i.startBlock=[n.start]:n.level==="inline"&&(i.startInline?i.startInline.push(n.start):i.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(i.childTokens[n.name]=n.childTokens)}),r.extensions=i),t.renderer){let n=this.defaults.renderer||new tm(this.defaults);for(let a in t.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=t.renderer[s],d=n[s];n[s]=(...h)=>{let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m||""}}r.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new em(this.defaults);for(let a in t.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=t.tokenizer[s],d=n[s];n[s]=(...h)=>{let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m}}r.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new Xd;for(let a in t.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=t.hooks[s],d=n[s];Xd.passThroughHooks.has(a)?n[s]=h=>{if(this.defaults.async&&Xd.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(n,h);return d.call(n,f)})();let m=l.call(n,h);return d.call(n,m)}:n[s]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(n,h);return f===!1&&(f=await d.apply(n,h)),f})();let m=l.apply(n,h);return m===!1&&(m=d.apply(n,h)),m}}r.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,a=t.walkTokens;r.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),n&&(l=l.concat(n.call(this,s))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,i){return Un.lex(o,i??this.defaults)}parser(o,i){return jn.parse(o,i??this.defaults)}parseMarkdown(o){return(i,t)=>{let r={...t},n={...this.defaults,...r},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=o),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(i):i,l=await(n.hooks?await n.hooks.provideLexer(o):o?Un.lex:Un.lexInline)(s,n),d=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(d,n.walkTokens));let h=await(n.hooks?await n.hooks.provideParser(o):o?jn.parse:jn.parseInline)(d,n);return n.hooks?await n.hooks.postprocess(h):h})().catch(a);try{n.hooks&&(i=n.hooks.preprocess(i));let s=(n.hooks?n.hooks.provideLexer(o):o?Un.lex:Un.lexInline)(i,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(o):o?jn.parse:jn.parseInline)(s,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(s){return a(s)}}}onError(o,i){return t=>{if(t.message+=`
5156
+ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error occurred:</p><pre>"+rn(t.message+"",!0)+"</pre>";return i?Promise.resolve(r):r}if(i)return Promise.reject(t);throw t}}},Ts=new ON;function tt(o,i){return Ts.parse(o,i)}tt.options=tt.setOptions=function(o){return Ts.setOptions(o),tt.defaults=Ts.defaults,h4(tt.defaults),tt};tt.getDefaults=mv;tt.defaults=$s;function NN(...o){return Ts.use(...o),tt.defaults=Ts.defaults,h4(tt.defaults),tt}tt.use=NN;tt.walkTokens=function(o,i){return Ts.walkTokens(o,i)};tt.parseInline=Ts.parseInline;tt.Parser=jn;tt.parser=jn.parse;tt.Renderer=tm;tt.TextRenderer=wv;tt.Lexer=Un;tt.lexer=Un.lex;tt.Tokenizer=em;tt.Hooks=Xd;tt.parse=tt;var P9e=tt.options,H9e=tt.setOptions,F9e=tt.walkTokens,B9e=tt.parseInline;var V9e=jn.parse,U9e=Un.lex;var w4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}.panel{border:1px solid rgb(var(--zn-border-color));background-color:rgba(var(--zn-panel),var(--zn-panel-opacity));border-radius:var(--zn-border-radius)}.markdown-editor{display:flex;flex-direction:column;gap:var(--zn-spacing-small);width:100%;height:100%;min-height:0}:host([expanded]){position:absolute;top:10px;bottom:10px;left:var(--zn-sp-padding);right:var(--zn-sp-padding);z-index:var(--zn-z-index-editor-action,1000000)}:host([expanded]) .panel,:host([expanded]) .panel__inner,:host([expanded]) .panel__content,:host([expanded]) .panel__body{height:100%;max-height:100%}:host([expanded]) .markdown-editor{height:100%}.markdown-editor__label{font-size:var(--zn-input-label-font-size-medium);color:var(--zn-input-label-color);font-weight:var(--zn-font-weight-semibold)}.markdown-editor__toolbar{display:flex;align-items:end;gap:var(--zn-spacing-small);justify-content:flex-end;flex-wrap:wrap}.markdown-editor__markdown-link{display:inline-flex;align-items:center;gap:var(--zn-spacing-x-small);margin-right:auto;font-size:var(--zn-input-label-font-size-small);line-height:1;color:var(--zn-color-neutral-500,#656d76);text-decoration:none;cursor:pointer;transition:color 0.15s ease;padding-left:var(--zn-spacing-x-small)}.markdown-editor__markdown-link:hover{color:var(--zn-color-primary-600,#0969da)}.markdown-editor__markdown-link span{white-space:nowrap}.markdown-editor__view-toggle{display:inline-flex}.markdown-editor__body{display:flex;flex:1;min-height:0;gap:var(--zn-spacing-medium)}.markdown-editor__editor,.markdown-editor__preview-wrapper{flex:1;min-width:0;min-height:0;display:flex}.markdown-editor__editor[hidden],.markdown-editor__preview-wrapper[hidden]{display:none}.markdown-editor__editor zn-textarea{flex:1;width:100%}.markdown-editor__preview-wrapper{overflow:hidden}.markdown-editor__preview{flex:1;background:var(--zn-color-neutral-0,white);border:1px solid var(--zn-color-neutral-200);border-radius:var(--zn-border-radius);padding:var(--zn-spacing-x-large);overflow-y:auto;font-family:inherit;line-height:1.7;color:var(--zn-color-text,#222)}.markdown-editor__preview h1{font-size:1.8em;margin:0.8em 0 0.4em;border-bottom:1px solid var(--zn-color-neutral-200);padding-bottom:0.3em}.markdown-editor__preview h2{font-size:1.5em;margin:0.8em 0 0.4em;border-bottom:1px solid var(--zn-color-neutral-200);padding-bottom:0.2em}.markdown-editor__preview h3{font-size:1.25em;margin:0.7em 0 0.3em}.markdown-editor__preview h4,.markdown-editor__preview h5,.markdown-editor__preview h6{font-size:1.1em;margin:0.6em 0 0.3em}.markdown-editor__preview p{margin:0.6em 0}.markdown-editor__preview ul,.markdown-editor__preview ol{margin:0.6em 0;padding-left:2em;display:block}.markdown-editor__preview ul{list-style-type:disc}.markdown-editor__preview ol{list-style-type:decimal}.markdown-editor__preview ul ul{list-style-type:circle}.markdown-editor__preview ul ul ul{list-style-type:square}.markdown-editor__preview li{margin:0.2em 0;display:list-item}.markdown-editor__preview blockquote{border-left:4px solid var(--zn-color-neutral-300);margin:0.8em 0;padding:0.4em 1em;color:var(--zn-color-neutral-600,#555)}.markdown-editor__preview table{border-collapse:collapse;width:100%;margin:0.8em 0}.markdown-editor__preview th,.markdown-editor__preview td{border:1px solid var(--zn-color-neutral-300);padding:0.4em 0.8em;text-align:left}.markdown-editor__preview th{background:var(--zn-color-neutral-100);font-weight:bold}.markdown-editor__preview code{background:var(--zn-color-neutral-100);padding:0.15em 0.4em;border-radius:3px;font-size:0.9em}.markdown-editor__preview pre{background:var(--zn-color-neutral-100);padding:1em;border-radius:4px;overflow-x:auto}.markdown-editor__preview pre code{background:none;padding:0}.markdown-editor__preview hr{border:none;border-top:1px solid var(--zn-color-neutral-300);margin:1.5em 0}.markdown-editor__preview a{color:var(--zn-color-primary-600)}.markdown-editor__help-text{font-size:var(--zn-input-help-text-font-size-medium);color:var(--zn-input-help-text-color)}`;var PN=[{mode:"editor",icon:"edit_note",label:"Editor"},{mode:"split",icon:"vertical_split",label:"Split"},{mode:"preview",icon:"visibility",label:"Preview"}],kt=class extends mt{constructor(){super(...arguments);this.formControlController=new ce(this,{assumeInteractionOn:["zn-input","zn-change"]});this.markdownSlotController=new te(this,"label","help-text","actions","footer");this.debounceTimer=null;this.name="";this.value="";this.defaultValue="";this.label="";this.helpText="";this.placeholder="Enter markdown content...";this.rows=20;this.viewMode="editor";this.storageKey="zn-markdown-editor-view-mode";this.required=!1;this.readonly=!1;this.disabled=!1;this.expanded=!1;this.handleInput=()=>{this.value=this.textarea.value,this.emit("zn-input"),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.renderPreview(),150)};this.handleChange=()=>{this.value=this.textarea.value,this.emit("zn-change"),this.renderPreview()};this.handleViewToggle=t=>{let n=t.target.closest("[data-mode]")?.dataset.mode;!n||n===this.viewMode||(this.viewMode=n)};this.handleExpandToggle=()=>{this.expanded=!this.expanded}}get validity(){return this.textarea?.validity}get validationMessage(){return this.textarea?.validationMessage??""}checkValidity(){return this.textarea?.checkValidity()??!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.textarea?.reportValidity()??!0}setCustomValidity(t){this.textarea?.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.textarea?.focus(t)}blur(){this.textarea?.blur()}connectedCallback(){if(super.connectedCallback(),!this.hasAttribute("value")&&!this.value){let r=Array.from(this.childNodes).filter(s=>s.nodeType===Node.TEXT_NODE),a=r.map(s=>s.textContent??"").join("").replace(/\r\n/g,`
5157
5157
  `).trim();a.length>0&&(this.value=a,this.defaultValue=a,r.forEach(s=>{(s.textContent??"").trim().length>0&&s.parentNode?.removeChild(s)}))}let t=this.readStoredViewMode();t&&(this.viewMode=t),this.addEventListener("toggle",this.handleExpandToggle)}disconnectedCallback(){super.disconnectedCallback(),this.debounceTimer&&clearTimeout(this.debounceTimer),this.removeEventListener("toggle",this.handleExpandToggle)}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this.viewMode!=="editor"&&this.renderPreview()}readStoredViewMode(){if(!this.storageKey)return null;try{let t=localStorage.getItem(this.storageKey);if(t==="editor"||t==="split"||t==="preview")return t}catch{}return null}writeStoredViewMode(t){if(this.storageKey)try{localStorage.setItem(this.storageKey,t)}catch{}}renderPreview(){if(this.viewMode==="editor"||!this.previewEl)return;let t=tt.parse(this.value||"",{async:!1});this.previewEl.innerHTML=typeof t=="string"?t:""}async handleViewModeChange(){await this.updateComplete,this.writeStoredViewMode(this.viewMode),this.renderPreview(),this.dispatchEvent(new CustomEvent("zn-view-mode-change",{bubbles:!0,composed:!0,detail:{mode:this.viewMode}}))}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.renderPreview()}handleMarkedReady(){this.renderPreview()}render(){let t=this.markdownSlotController.test("label"),r=this.markdownSlotController.test("help-text"),n=this.markdownSlotController.test("actions"),a=this.markdownSlotController.test("footer"),s=!!this.label||t,l=!!this.helpText||r,d=!!this.caption||n,h=this.viewMode==="editor"||this.viewMode==="split",m=this.viewMode==="preview"||this.viewMode==="split";return u`
5158
5158
  <div part="base" class=${q({panel:!0,"panel--flush":this.flush||this.tabbed,"panel--flush-x":this.flushX,"panel--flush-y":this.flushY,"panel--flush-footer":this.flushFooter,"panel--tabbed":this.tabbed,"panel--transparent":this.transparent,"panel--has-actions":n,"panel--has-footer":a,"panel--has-header":d,"panel--cosmic":this.cosmic,"panel--shadow":this.shadow})}>
5159
5159
 
@@ -5179,7 +5179,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5179
5179
  <div part="toolbar" class="markdown-editor__toolbar">
5180
5180
  ${this.markdownHelperBtn()}
5181
5181
  <zn-button-group class="markdown-editor__view-toggle" @click=${this.handleViewToggle}>
5182
- ${ON.map(f=>this.renderViewButton(f.mode,f.icon,f.label))}
5182
+ ${PN.map(f=>this.renderViewButton(f.mode,f.icon,f.label))}
5183
5183
  </zn-button-group>
5184
5184
  <zn-button
5185
5185
  class="markdown-editor__expand-btn"
@@ -5252,7 +5252,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5252
5252
  tooltip=${n}
5253
5253
  aria-pressed=${a?"true":"false"}
5254
5254
  ></zn-button>
5255
- `}};kt.styles=[mt.styles,k(w4)],c([U("zn-textarea")],kt.prototype,"textarea",2),c([U(".markdown-editor__preview")],kt.prototype,"previewEl",2),c([p()],kt.prototype,"name",2),c([p()],kt.prototype,"value",2),c([Ne()],kt.prototype,"defaultValue",2),c([p()],kt.prototype,"label",2),c([p({attribute:"help-text"})],kt.prototype,"helpText",2),c([p()],kt.prototype,"placeholder",2),c([p({type:Number})],kt.prototype,"rows",2),c([p({reflect:!0,attribute:"view-mode"})],kt.prototype,"viewMode",2),c([p({attribute:"storage-key"})],kt.prototype,"storageKey",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"required",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"readonly",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"expanded",2),c([Q("viewMode",{waitUntilFirstUpdate:!0})],kt.prototype,"handleViewModeChange",1),c([Q("value",{waitUntilFirstUpdate:!0})],kt.prototype,"handleValueChange",1),c([Q("markedReady",{waitUntilFirstUpdate:!0})],kt.prototype,"handleMarkedReady",1);var NN=kt;kt.define("zn-markdown-editor");var PN={},_v=Mt(class extends xr{constructor(){super(...arguments),this.ot=PN}render(o,i){return i()}update(o,[i,t]){if(Array.isArray(i)){if(Array.isArray(this.ot)&&this.ot.length===i.length&&i.every((r,n)=>r===this.ot[n]))return Lt}else if(this.ot===i)return Lt;return this.ot=Array.isArray(i)?Array.from(i):i,this.render(i,t)}});var HN={eq:"Is Equal To",neq:"Is Not Equal To",gt:"Greater Than",gte:"Greater Than or Equal To",lt:"Less Than",lte:"Less Than or Equal To",is:"Is","is-not":"Is Not",in:"Is One Of","not-in":"Is Not One Of",contains:"Contains","not-contains":"Does Not Contain","starts-with":"Starts With","ends-with":"Ends With",empty:"Is Empty","not-empty":"Is Not Empty",within:"Within the Last",before:"Before the Last",between:"Between",matches:"Matches"};function zv(o){return o.label??HN[o.value]??o.value}var FN=[];function S4(o){let i=o.data?.conditions;return Array.isArray(i)?i:FN}var _4={id:"in"},im={id:"out"},tp="__new__",nc="application/x-zn-flow-type",rm;function nm(){return rm||(rm=new Image,rm.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),rm}var $t=240,Cr=60,kv=$t+80,BN=kv-$t,VN=40,UN=20,Sv=40,jN=40,GN=40,z4=240,WN=20,KN=20,YN=20,XN=240;function Cv(o,i,t,r=!1){let n=o.y+Cr,a=n+Sv;if(t&&t.y>=n){if(t.y-n>XN)return a;let s=r?n+YN:a,l=Math.round((n+t.y)/2-i/2);return Math.max(s,Math.min(l,t.y-KN-i))}return a+jN}function om(o){let i=o.length*7.2,t=Math.max(1,Math.ceil(i/(z4-36)));return{w:Math.min(z4,Math.round(36+i)),h:GN+(t-1)*WN}}var br=20;function ii(o){return Math.round(o/br)*br}var C4=10,QN=4,JN=20;function Ev(o,i){let t=o.m+i.m;return o.x<i.x+i.w+t&&i.x<o.x+o.w+t&&o.y<i.y+i.h+t&&i.y<o.y+o.h+t}function k4(o,i){return i?$t/2:o.label?om(o.label).w/2:UN}function rp(o,i,t=[]){let r=vr(o,i(o.type)),n=o.x+$t/2;if(r.length<2)return r.map(()=>n);let a=r.map(m=>t.some(f=>f.source.node===o.id&&f.source.port===m.id)),s=[0];for(let m=1;m<r.length;m++){let f=a[m-1]&&a[m]?BN:VN,b=k4(r[m-1],a[m-1])+k4(r[m],a[m])+f;s.push(s[m-1]+ii(b))}let l=s.filter((m,f)=>a[f]),d=l.length?l:s,h=(Math.min(...d)+Math.max(...d))/2;return s.map(m=>Math.round(n+m-h))}function ep(o,i,t,r){let n=[{x:o.x,y:o.y,w:$t,h:Cr,m:C4}],a=vr(o,i(o.type)),s=rp(o,i,r);return a.forEach((l,d)=>{if(!l.label)return;let h=om(l.label),m=r.find(b=>b.source.node===o.id&&b.source.port===l.id),f=m?t.find(b=>b.id===m.target.node):void 0;n.push({x:s[d]-h.w/2,y:Cv(o,h.h,f,a.length===1),w:h.w,h:h.h+JN,m:QN})}),n}function E4(o,i,t,r,n){let a=ep(o,t,r,n);return ep(i,t,r,n).some(s=>a.some(l=>Ev(l,s)))}function am(o,i,t,r){let n=ep(o,i,t,r).slice(1);return n.length?t.some(a=>a.id!==o.id&&ep(a,i,t,r).some(s=>n.some(l=>Ev(l,s)))):!1}function T4(o,i,t,r,n){let a={x:o.x,y:o.y,w:$t,h:Cr,m:C4};return ep(i,t,r,n).some(s=>Ev(a,s))}var Tv=200,$v=120,$4=120,A4=80;function L4(o,i,t,r){return{x:o.x+$t*(t+1)/(r+1),y:o.y+(i==="in"?0:Cr)}}function M4(){return{nodes:[],connections:[],notes:[]}}function sm(o){return o?o.inputs??[_4]:[_4]}function Av(o){return o?o.outputs??[im]:[im]}function Oa(o,i){return o.inputs??sm(i)}function vr(o,i){return o.outputs??Av(i)}function ip(o,i){return Oa(o,i)[0]?.id??null}function I4(o,i){let t=new Set,r=n=>{for(let a of o.connections)a.source.node===n&&!t.has(a.target.node)&&(t.add(a.target.node),r(a.target.node))};return r(i),t}function Na(o,i){let t=new Set(o.map(h=>h.id)),r=new Map(o.map(h=>[h.id,[]])),n=new Set;for(let h of i)!t.has(h.source.node)||!t.has(h.target.node)||(r.get(h.source.node).push(h),n.add(h.target.node));let a=new Set,s=new Set,l=new Set,d=h=>{s.add(h),l.add(h);for(let m of r.get(h)??[])l.has(m.target.node)?a.add(m):s.has(m.target.node)||d(m.target.node);l.delete(h)};return o.filter(h=>!n.has(h.id)).forEach(h=>d(h.id)),o.forEach(h=>{s.has(h.id)||d(h.id)}),a}var q4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;font-size:0.8125rem}.editor{display:flex;flex-direction:column;gap:14px}.picker{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid rgb(var(--zn-border-color));border-radius:8px;background:rgb(var(--zn-panel))}.picker__head{display:flex;align-items:center;justify-content:space-between;font-weight:600}.picker__back{flex:0 0 auto}.picker__list{display:flex;flex-direction:column}.picker__item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:10px 12px;margin-top:-1px;border:1px solid rgb(var(--zn-border-color));background:rgb(var(--zn-panel));color:rgb(var(--zn-text));font-size:0.8125rem;text-align:left;cursor:pointer}.picker__item:first-child{margin-top:0;border-top-left-radius:8px;border-top-right-radius:8px}.picker__item:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.picker__item:hover{background:rgb(var(--zn-color-tab))}.picker__item-text{display:flex;flex-direction:column;gap:2px;min-width:0}.picker__item-label{font-weight:500}.picker__item-description{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.picker__empty{margin:0;padding:10px 2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.conditions{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.group{display:flex;flex-direction:column;align-items:flex-start;gap:12px;width:100%;padding:14px;border:1px solid rgb(var(--zn-border-color));border-radius:8px;background:rgb(var(--zn-panel))}.and-rule{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal);display:flex;align-items:center;gap:10px;width:100%;color:rgb(var(--zn-color-success))}.and-rule::after{content:"";flex:1;height:1px;background:color-mix(in srgb,rgb(var(--zn-color-success)) 50%,transparent)}.or-label{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal);margin:2px 0;color:rgb(var(--zn-color-error))}.condition{display:flex;flex-direction:column;gap:10px;width:100%}.condition__head{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%}.condition__name{font-family:var(--zn-font-sans);font-size:var(--zn-text-heading-section-font-size);font-weight:var(--zn-text-heading-section-font-weight);line-height:var(--zn-text-heading-section-line-height);color:var(--zn-text-heading-section-color);text-transform:var(--zn-text-heading-section-transform);letter-spacing:var(--zn-text-heading-section-letter-spacing,normal)}.condition__remove{flex:0 0 auto}.condition__row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.condition__row-label,.condition__suffix{font-size:0.75rem;color:rgb(var(--zn-color-muted-text));white-space:nowrap}.control{min-width:0}.control--operator{flex:1 1 0;min-width:120px}.control--number{flex:0 0 auto;width:80px}.control--unit{flex:1 1 0}.control--value{flex:1 1 0;min-width:100px}zn-select.control::part(display-input){text-overflow:ellipsis}.actions{display:flex;align-items:center;gap:8px;margin-top:2px;padding-top:16px;border-top:1px solid rgb(var(--zn-border-color))}`;var Sn=class Sn extends T{constructor(){super(...arguments);this.filters=[];this.value=[];this._draft=[];this._picker=null;this._search="";this._valueJson="";this._save=()=>{this._emit("flow-conditions-save",{conditions:JSON.parse(JSON.stringify(this._draft))})};this._cancel=()=>{this._emit("flow-conditions-cancel")}}willUpdate(t){if(super.willUpdate(t),t.has("value")){let r=JSON.stringify(this.value??[]);r!==this._valueJson&&(this._valueJson=r,this._draft=JSON.parse(r),this._picker=null,this._search="")}}_emit(t,r){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:r}))}_cloneDraft(){return this._draft.map(t=>t.map(r=>({...r,values:{...r.values}})))}_addCondition(t){let r={};t.fields.forEach(s=>{r[s.id]={...s.operators?.length?{operator:s.operators[0].value}:{},...s.value!==void 0?{value:s.value}:{},...s.units?.length?{unit:s.units[0].value}:{}}});let n=this._cloneDraft(),a=Math.min(this._picker??0,n.length);a===n.length&&n.push([]),n[a].push({filter:t.id,values:r}),this._draft=n,this._picker=null,this._search=""}_removeCondition(t,r){let n=this._cloneDraft();n[t].splice(r,1),this._draft=n.filter(a=>a.length)}_setField(t,r,n,a){let s=this._cloneDraft(),l=s[t][r];l.values[n]={...l.values[n],...a},this._draft=s}_renderPicker(){let t=this._search.trim().toLowerCase(),r=this.filters.filter(n=>!t||n.label.toLowerCase().includes(t));return u`
5255
+ `}};kt.styles=[mt.styles,k(w4)],c([U("zn-textarea")],kt.prototype,"textarea",2),c([U(".markdown-editor__preview")],kt.prototype,"previewEl",2),c([p()],kt.prototype,"name",2),c([p()],kt.prototype,"value",2),c([Ne()],kt.prototype,"defaultValue",2),c([p()],kt.prototype,"label",2),c([p({attribute:"help-text"})],kt.prototype,"helpText",2),c([p()],kt.prototype,"placeholder",2),c([p({type:Number})],kt.prototype,"rows",2),c([p({reflect:!0,attribute:"view-mode"})],kt.prototype,"viewMode",2),c([p({attribute:"storage-key"})],kt.prototype,"storageKey",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"required",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"readonly",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],kt.prototype,"expanded",2),c([Q("viewMode",{waitUntilFirstUpdate:!0})],kt.prototype,"handleViewModeChange",1),c([Q("value",{waitUntilFirstUpdate:!0})],kt.prototype,"handleValueChange",1),c([Q("markedReady",{waitUntilFirstUpdate:!0})],kt.prototype,"handleMarkedReady",1);var HN=kt;kt.define("zn-markdown-editor");var FN={},_v=Mt(class extends xr{constructor(){super(...arguments),this.ot=FN}render(o,i){return i()}update(o,[i,t]){if(Array.isArray(i)){if(Array.isArray(this.ot)&&this.ot.length===i.length&&i.every((r,n)=>r===this.ot[n]))return Lt}else if(this.ot===i)return Lt;return this.ot=Array.isArray(i)?Array.from(i):i,this.render(i,t)}});var BN={eq:"Is Equal To",neq:"Is Not Equal To",gt:"Greater Than",gte:"Greater Than or Equal To",lt:"Less Than",lte:"Less Than or Equal To",is:"Is","is-not":"Is Not",in:"Is One Of","not-in":"Is Not One Of",contains:"Contains","not-contains":"Does Not Contain","starts-with":"Starts With","ends-with":"Ends With",empty:"Is Empty","not-empty":"Is Not Empty",within:"Within the Last",before:"Before the Last",between:"Between",matches:"Matches"};function zv(o){return o.label??BN[o.value]??o.value}var VN=[];function S4(o){let i=o.data?.conditions;return Array.isArray(i)?i:VN}var _4={id:"in"},im={id:"out"},tp="__new__",nc="application/x-zn-flow-type",rm;function nm(){return rm||(rm=new Image,rm.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),rm}var $t=240,Cr=60,kv=$t+80,UN=kv-$t,jN=40,GN=20,Sv=40,WN=40,KN=40,z4=240,YN=20,XN=20,QN=20,JN=240;function Cv(o,i,t,r=!1){let n=o.y+Cr,a=n+Sv;if(t&&t.y>=n){if(t.y-n>JN)return a;let s=r?n+QN:a,l=Math.round((n+t.y)/2-i/2);return Math.max(s,Math.min(l,t.y-XN-i))}return a+WN}function om(o){let i=o.length*7.2,t=Math.max(1,Math.ceil(i/(z4-36)));return{w:Math.min(z4,Math.round(36+i)),h:KN+(t-1)*YN}}var br=20;function ii(o){return Math.round(o/br)*br}var C4=10,ZN=4,eP=20;function Ev(o,i){let t=o.m+i.m;return o.x<i.x+i.w+t&&i.x<o.x+o.w+t&&o.y<i.y+i.h+t&&i.y<o.y+o.h+t}function k4(o,i){return i?$t/2:o.label?om(o.label).w/2:GN}function rp(o,i,t=[]){let r=vr(o,i(o.type)),n=o.x+$t/2;if(r.length<2)return r.map(()=>n);let a=r.map(m=>t.some(f=>f.source.node===o.id&&f.source.port===m.id)),s=[0];for(let m=1;m<r.length;m++){let f=a[m-1]&&a[m]?UN:jN,b=k4(r[m-1],a[m-1])+k4(r[m],a[m])+f;s.push(s[m-1]+ii(b))}let l=s.filter((m,f)=>a[f]),d=l.length?l:s,h=(Math.min(...d)+Math.max(...d))/2;return s.map(m=>Math.round(n+m-h))}function ep(o,i,t,r){let n=[{x:o.x,y:o.y,w:$t,h:Cr,m:C4}],a=vr(o,i(o.type)),s=rp(o,i,r);return a.forEach((l,d)=>{if(!l.label)return;let h=om(l.label),m=r.find(b=>b.source.node===o.id&&b.source.port===l.id),f=m?t.find(b=>b.id===m.target.node):void 0;n.push({x:s[d]-h.w/2,y:Cv(o,h.h,f,a.length===1),w:h.w,h:h.h+eP,m:ZN})}),n}function E4(o,i,t,r,n){let a=ep(o,t,r,n);return ep(i,t,r,n).some(s=>a.some(l=>Ev(l,s)))}function am(o,i,t,r){let n=ep(o,i,t,r).slice(1);return n.length?t.some(a=>a.id!==o.id&&ep(a,i,t,r).some(s=>n.some(l=>Ev(l,s)))):!1}function T4(o,i,t,r,n){let a={x:o.x,y:o.y,w:$t,h:Cr,m:C4};return ep(i,t,r,n).some(s=>Ev(a,s))}var Tv=200,$v=120,$4=120,A4=80;function L4(o,i,t,r){return{x:o.x+$t*(t+1)/(r+1),y:o.y+(i==="in"?0:Cr)}}function M4(){return{nodes:[],connections:[],notes:[]}}function sm(o){return o?o.inputs??[_4]:[_4]}function Av(o){return o?o.outputs??[im]:[im]}function Oa(o,i){return o.inputs??sm(i)}function vr(o,i){return o.outputs??Av(i)}function ip(o,i){return Oa(o,i)[0]?.id??null}function I4(o,i){let t=new Set,r=n=>{for(let a of o.connections)a.source.node===n&&!t.has(a.target.node)&&(t.add(a.target.node),r(a.target.node))};return r(i),t}function Na(o,i){let t=new Set(o.map(h=>h.id)),r=new Map(o.map(h=>[h.id,[]])),n=new Set;for(let h of i)!t.has(h.source.node)||!t.has(h.target.node)||(r.get(h.source.node).push(h),n.add(h.target.node));let a=new Set,s=new Set,l=new Set,d=h=>{s.add(h),l.add(h);for(let m of r.get(h)??[])l.has(m.target.node)?a.add(m):s.has(m.target.node)||d(m.target.node);l.delete(h)};return o.filter(h=>!n.has(h.id)).forEach(h=>d(h.id)),o.forEach(h=>{s.has(h.id)||d(h.id)}),a}var q4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;font-size:0.8125rem}.editor{display:flex;flex-direction:column;gap:14px}.picker{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid rgb(var(--zn-border-color));border-radius:8px;background:rgb(var(--zn-panel))}.picker__head{display:flex;align-items:center;justify-content:space-between;font-weight:600}.picker__back{flex:0 0 auto}.picker__list{display:flex;flex-direction:column}.picker__item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:10px 12px;margin-top:-1px;border:1px solid rgb(var(--zn-border-color));background:rgb(var(--zn-panel));color:rgb(var(--zn-text));font-size:0.8125rem;text-align:left;cursor:pointer}.picker__item:first-child{margin-top:0;border-top-left-radius:8px;border-top-right-radius:8px}.picker__item:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.picker__item:hover{background:rgb(var(--zn-color-tab))}.picker__item-text{display:flex;flex-direction:column;gap:2px;min-width:0}.picker__item-label{font-weight:500}.picker__item-description{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.picker__empty{margin:0;padding:10px 2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.conditions{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.group{display:flex;flex-direction:column;align-items:flex-start;gap:12px;width:100%;padding:14px;border:1px solid rgb(var(--zn-border-color));border-radius:8px;background:rgb(var(--zn-panel))}.and-rule{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal);display:flex;align-items:center;gap:10px;width:100%;color:rgb(var(--zn-color-success))}.and-rule::after{content:"";flex:1;height:1px;background:color-mix(in srgb,rgb(var(--zn-color-success)) 50%,transparent)}.or-label{font-family:var(--zn-font-sans);font-size:var(--zn-text-paragraph-font-size);font-weight:var(--zn-text-paragraph-font-weight);line-height:var(--zn-text-paragraph-line-height);color:var(--zn-text-paragraph-color);text-transform:var(--zn-text-paragraph-transform);letter-spacing:var(--zn-text-paragraph-letter-spacing,normal);margin:2px 0;color:rgb(var(--zn-color-error))}.condition{display:flex;flex-direction:column;gap:10px;width:100%}.condition__head{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%}.condition__name{font-family:var(--zn-font-sans);font-size:var(--zn-text-heading-section-font-size);font-weight:var(--zn-text-heading-section-font-weight);line-height:var(--zn-text-heading-section-line-height);color:var(--zn-text-heading-section-color);text-transform:var(--zn-text-heading-section-transform);letter-spacing:var(--zn-text-heading-section-letter-spacing,normal)}.condition__remove{flex:0 0 auto}.condition__row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.condition__row-label,.condition__suffix{font-size:0.75rem;color:rgb(var(--zn-color-muted-text));white-space:nowrap}.control{min-width:0}.control--operator{flex:1 1 0;min-width:120px}.control--number{flex:0 0 auto;width:80px}.control--unit{flex:1 1 0}.control--value{flex:1 1 0;min-width:100px}zn-select.control::part(display-input){text-overflow:ellipsis}.actions{display:flex;align-items:center;gap:8px;margin-top:2px;padding-top:16px;border-top:1px solid rgb(var(--zn-border-color))}`;var Sn=class Sn extends T{constructor(){super(...arguments);this.filters=[];this.value=[];this._draft=[];this._picker=null;this._search="";this._valueJson="";this._save=()=>{this._emit("flow-conditions-save",{conditions:JSON.parse(JSON.stringify(this._draft))})};this._cancel=()=>{this._emit("flow-conditions-cancel")}}willUpdate(t){if(super.willUpdate(t),t.has("value")){let r=JSON.stringify(this.value??[]);r!==this._valueJson&&(this._valueJson=r,this._draft=JSON.parse(r),this._picker=null,this._search="")}}_emit(t,r){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:r}))}_cloneDraft(){return this._draft.map(t=>t.map(r=>({...r,values:{...r.values}})))}_addCondition(t){let r={};t.fields.forEach(s=>{r[s.id]={...s.operators?.length?{operator:s.operators[0].value}:{},...s.value!==void 0?{value:s.value}:{},...s.units?.length?{unit:s.units[0].value}:{}}});let n=this._cloneDraft(),a=Math.min(this._picker??0,n.length);a===n.length&&n.push([]),n[a].push({filter:t.id,values:r}),this._draft=n,this._picker=null,this._search=""}_removeCondition(t,r){let n=this._cloneDraft();n[t].splice(r,1),this._draft=n.filter(a=>a.length)}_setField(t,r,n,a){let s=this._cloneDraft(),l=s[t][r];l.values[n]={...l.values[n],...a},this._draft=s}_renderPicker(){let t=this._search.trim().toLowerCase(),r=this.filters.filter(n=>!t||n.label.toLowerCase().includes(t));return u`
5256
5256
  <div part="picker" class="picker">
5257
5257
  <div class="picker__head">
5258
5258
  <span>Add Filters</span>
@@ -5420,7 +5420,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5420
5420
  </div>
5421
5421
  </div>`:""}
5422
5422
  </div>
5423
- `}};Di.styles=k(R4),Di.dependencies={"zn-icon":he,"zn-button":Oe,"zn-dropdown":Mr,"zn-menu":In,"zn-menu-item":Wi},c([p({attribute:!1})],Di.prototype,"node",2),c([p({attribute:!1})],Di.prototype,"type",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"error",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"dragging",2),c([p({type:Boolean,reflect:!0,attribute:"link-target"})],Di.prototype,"linkTarget",2);var D4=Di;Di.define("zn-flow-node");var O4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;position:relative;width:100%;height:100%;overflow:hidden}.viewport{position:absolute;inset:0;overflow:hidden;background-color:rgb(var(--zn-color-body));background-image:radial-gradient(rgb(var(--zn-color-border)) 1px,transparent 1px);background-size:20px 20px;cursor:grab;touch-action:none}.viewport.grabbing,.viewport.grabbing *{cursor:grabbing !important}.viewport.connecting,.viewport.connecting *{cursor:crosshair !important}.viewport.resizing,.viewport.resizing *{cursor:nwse-resize !important}.viewport.linking{cursor:crosshair}.viewport.step-dragging .add-point{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid;box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 22%,transparent)}.connections{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.connections .wire{fill:none;stroke:rgb(var(--zn-color-primary));stroke-width:2}.connections .wire--stub{stroke:rgb(var(--zn-color-border-active));stroke-dasharray:4 4}.connections .wire--preview{stroke-dasharray:6 4}.connections .wire--loop{stroke:rgb(var(--zn-color-warning))}.connections marker path{fill:rgb(var(--zn-color-primary))}.connections marker#flow-arrow-loop path{fill:rgb(var(--zn-color-warning))}.add-point{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-12px;padding:0;border-radius:50%;color:rgb(var(--zn-color-primary));background:rgb(var(--zn-panel));border:1px dashed rgb(var(--zn-color-border-active));cursor:pointer;transition:background 0.12s ease,color 0.12s ease}.add-point:hover{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid}.add-point--target{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid;box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 25%,transparent)}.add-point--wire{width:20px;height:20px;margin:-10px}.layer{position:absolute;top:0;left:0;transform-origin:0 0;width:0;height:0}.node-pos{position:absolute;top:0;left:0}.branch-pill{display:flex;align-items:center;justify-content:center;width:-moz-max-content;width:max-content;max-width:240px;box-sizing:border-box;text-align:center;overflow-wrap:anywhere;overflow:hidden;padding:0 18px;border-radius:10px;font:inherit;font-size:0.8125rem;font-weight:600;line-height:20px;color:rgb(var(--zn-text));background:color-mix(in srgb,rgb(var(--zn-color-primary)) 8%,rgb(var(--zn-panel)));border:1px solid color-mix(in srgb,rgb(var(--zn-color-primary)) 45%,transparent);cursor:pointer;transition:border-color 0.12s ease,box-shadow 0.12s ease}.branch-pill:hover{border-color:rgb(var(--zn-color-primary));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}.branch-pill--selected{border-color:rgb(var(--zn-color-primary));background:color-mix(in srgb,rgb(var(--zn-color-primary)) 16%,rgb(var(--zn-panel)))}.branch-pill--loop{background:color-mix(in srgb,rgb(var(--zn-color-warning)) 10%,rgb(var(--zn-panel)));border-color:color-mix(in srgb,rgb(var(--zn-color-warning)) 55%,transparent)}.branch-pill--loop:hover{border-color:rgb(var(--zn-color-warning))}.branch-pill--loop.branch-pill--selected{border-color:rgb(var(--zn-color-warning));background:color-mix(in srgb,rgb(var(--zn-color-warning)) 18%,rgb(var(--zn-panel)))}.branch-pill-wrap{position:absolute;top:0;left:0;transform:translateX(-50%);display:flex;align-items:stretch}.branch-pill-wrap::after{content:"";position:absolute;left:100%;top:0;width:40px;height:100%}.branch-pill-wrap:hover .branch-pill-delete{opacity:1;transform:translate(0,-50%);pointer-events:auto;transition-delay:0.15s}.branch-pill-port{position:absolute;z-index:1;left:50%;bottom:0;transform:translate(-50%,50%);width:11px;height:11px;box-sizing:border-box;border-radius:50%;background:rgb(var(--zn-panel));border:2px solid rgb(var(--zn-color-primary));cursor:pointer;transition:transform 0.12s ease,box-shadow 0.12s ease}.branch-pill-port:hover{transform:translate(-50%,50%) scale(1.35);box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 20%,transparent)}.branch-pill-delete{position:absolute;z-index:1;left:calc(100% + 8px);top:50%;transform:translate(-10px,-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:rgb(var(--zn-color-error));color:white;cursor:pointer;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease}.branch-pill-delete:hover{filter:brightness(1.1)}.drop-ghost{position:absolute;top:0;left:0;display:flex;align-items:center;gap:10px;padding:0 12px;border:2px dashed rgb(var(--zn-color-primary));border-radius:10px;background:color-mix(in srgb,rgb(var(--zn-color-primary)) 10%,rgb(var(--zn-panel)));opacity:0.9;pointer-events:none}.drop-ghost__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:8px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 16%,rgb(var(--zn-panel)))}.drop-ghost__label{font-size:0.8125rem;font-weight:600;color:rgb(var(--zn-text));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.toolbar{position:absolute;top:16px;display:flex;align-items:center;gap:2px;padding:3px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);z-index:2}.toolbar--history{left:16px}.toolbar--zoom{right:16px}.bin{position:absolute;right:16px;bottom:16px;z-index:2;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:12px;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px dashed rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);transition:background 0.12s ease,color 0.12s ease,transform 0.12s ease}.bin--over{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-error));border-style:solid;border-color:rgb(var(--zn-color-error));transform:scale(1.12)}.note{position:absolute;display:flex;flex-direction:column;background:#fef9c3;border:1px solid #fde68a;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,0.12)}.note__resize{position:absolute;right:0;bottom:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 0 50%,#d9c64a 50% 60%,transparent 60% 70%,#d9c64a 70% 80%,transparent 80%)}.note__bar{display:flex;justify-content:flex-end;height:20px;cursor:grab}.note__close{width:20px;height:20px;padding:0;font-size:14px;line-height:1;color:#92400e;background:transparent;cursor:pointer}.note__text{flex:1;margin:0;padding:0 10px 10px;resize:none;border:none;outline:none;background:transparent;font:inherit;font-size:0.8125rem;color:#713f12}`;var Mv=.25,N4=2,P4=.15,Iv=40,ZN=20,eP=48,qv=20,H4=10,tP=8,F4=40,rP=20,np=nc,Ot=class Ot extends T{constructor(){super(...arguments);this.nodes=[];this.connections=[];this.notes=[];this.selectedNodeId=null;this.errorNodes=new Set;this.movingNodeId=null;this.dragType=null;this.selectedBranch=null;this.zoom=1;this.panX=0;this.panY=0;this.drag=null;this._overBin=!1;this._dropGhost=null;this._linking=null;this._linkPos=null;this._linkTarget=null;this._linkClient=null;this._linkScrollRaf=null;this._dragMoved=!1;this._viewInitialised=!1;this._onWheel=t=>{if(t.composedPath().some(d=>d instanceof HTMLTextAreaElement))return;t.preventDefault(),this._viewInitialised=!0;let r=t.deltaMode===1?16:t.deltaMode===2?100:1,n=t.deltaX*r,a=t.deltaY*r;if(t.ctrlKey||t.metaKey){let d=Math.min(N4,Math.max(Mv,this.zoom*Math.exp(-a*.0015)));if(d===this.zoom)return;let h=this.getBoundingClientRect(),m=t.clientX-h.left,f=t.clientY-h.top,b=(m-this.panX)/this.zoom,g=(f-this.panY)/this.zoom;this.zoom=+d.toFixed(3),this.panX=Math.round(m-b*this.zoom),this.panY=Math.round(f-g*this.zoom);return}let s=t.shiftKey&&!n?a:n,l=t.shiftKey&&!n?0:a;this.panX-=Math.round(s),this.panY-=Math.round(l)};this._onBackgroundPointerDown=t=>{if(t.button===1){t.preventDefault(),this._viewInitialised=!0,this.drag={kind:"pan",ox:t.clientX,oy:t.clientY,px:this.panX,py:this.panY},this._setupWindow("grabbing");return}if(t.button===0){if(this._viewInitialised=!0,this._linking){let r=this._linking,n=this._linkTarget;if(this._cancelLink(),n){this._emit("flow-link-assign",{nodeId:r.nodeId,port:r.port,targetId:n});return}}this._emit("flow-node-select",{nodeId:null}),this.drag={kind:"pan",ox:t.clientX,oy:t.clientY,px:this.panX,py:this.panY},this._setupWindow("grabbing")}};this._onNodeGrab=t=>{if(this._linking){let a=this._linking;this._cancelLink(),a.nodeId!==t.detail.nodeId&&this._emit("flow-link-assign",{nodeId:a.nodeId,port:a.port,targetId:t.detail.nodeId});return}let r=this.nodes.find(a=>a.id===t.detail.nodeId);if(!r)return;let n=this.screenToCanvas(t.detail.clientX,t.detail.clientY);this.drag={kind:"node",id:r.id,offX:n.x-r.x,offY:n.y-r.y,startX:r.x,startY:r.y},this._dragMoved=!1,this._setupWindow("grabbing")};this._onNodeSelect=t=>{this._linking&&t.detail.nodeId&&t.stopPropagation()};this._onPortClick=t=>{let{nodeId:r}=t.detail;if(this._linking&&this._linking.nodeId!==r){let s=this._linking;this._cancelLink(),this._emit("flow-link-assign",{nodeId:s.nodeId,port:s.port,targetId:r});return}let n=this.nodes.find(s=>s.id===r);if(!n)return;let a=vr(n,this._typeFor(n)).find(s=>!this.connections.some(l=>l.source.node===r&&l.source.port===s.id));!a&&this._typeFor(n)?.fixedOutputs||this._startLink(r,a?.id??tp)};this._onLinkPointerMove=t=>{this._linkClient={x:t.clientX,y:t.clientY},this._updateLinkFromClient(t.clientX,t.clientY)};this._linkEdgeScroll=()=>{if(this._linkScrollRaf=null,!!this._linking){if(this._linkClient){let t=this.getBoundingClientRect(),r=48,n=14,a=m=>Math.min(n,Math.ceil((r-m)/r*n)),{x:s,y:l}=this._linkClient,d=0,h=0;s<t.left+r?d=a(s-t.left):s>t.right-r&&(d=-a(t.right-s)),l<t.top+r?h=a(l-t.top):l>t.bottom-r&&(h=-a(t.bottom-l)),(d||h)&&(this.panX+=d,this.panY+=h,this._updateLinkFromClient(s,l))}this._linkScrollRaf=requestAnimationFrame(this._linkEdgeScroll)}};this._onLinkKeyDown=t=>{t.key==="Escape"&&this._cancelLink()};this._cancelLink=()=>{this._linking&&(this._linking=null,this._linkPos=null,this._linkTarget=null,this._linkClient=null,this._linkScrollRaf!==null&&(cancelAnimationFrame(this._linkScrollRaf),this._linkScrollRaf=null),window.removeEventListener("pointermove",this._onLinkPointerMove),window.removeEventListener("keydown",this._onLinkKeyDown),window.removeEventListener("blur",this._cancelLink))};this._onPointerMove=t=>{if(!this.drag)return;if(this.drag.kind==="pan"){this.panX=this.drag.px+(t.clientX-this.drag.ox),this.panY=this.drag.py+(t.clientY-this.drag.oy);return}let r=this.screenToCanvas(t.clientX,t.clientY);if(this.drag.kind==="node"){this._overBin=this._binHit(t.clientX,t.clientY);let n=this.nodes.find(a=>a.id===this.drag.id);if(n){let a={x:ii(r.x-this.drag.offX),y:ii(r.y-this.drag.offY)},s=new Set(this.connections.filter(h=>h.target.node===n.id&&h.source.node!==n.id).map(h=>h.source.node)),l=h=>{let m={...n,...h},f=this.nodes.map(g=>g.id===n.id?m:g),b=g=>this.registry?.get(g);return f.some(g=>g!==m&&E4(m,g,b,f,this.connections))?!1:![...s].some(g=>{let v=f.find(y=>y.id===g);return!!v&&am(v,b,f,this.connections)})},d=l(a)?a:l({x:a.x,y:n.y})?{x:a.x,y:n.y}:l({x:n.x,y:a.y})?{x:n.x,y:a.y}:null;d&&(d.x!==n.x||d.y!==n.y)&&(this._dragMoved||this._beginMove(),n.x=d.x,n.y=d.y,this.requestUpdate())}}else if(this.drag.kind==="note"){let n=this.notes.find(a=>a.id===this.drag.id);n&&(this._dragMoved||this._beginMove(),n.x=ii(r.x-this.drag.offX),n.y=ii(r.y-this.drag.offY),this.requestUpdate())}else if(this.drag.kind==="note-resize"){let n=this.notes.find(a=>a.id===this.drag.id);n&&(this._dragMoved||this._beginMove(),n.width=Math.max($4,ii(r.x-n.x)),n.height=Math.max(A4,ii(r.y-n.y)),this.requestUpdate())}};this._onPointerUp=()=>{let t=this.drag,r=this._overBin;if(this.drag=null,this._overBin=!1,this._teardownWindow(),!!t){if(t.kind==="node"&&this._dragMoved&&r){let n=this.nodes.find(a=>a.id===t.id);n&&(n.x=t.startX,n.y=t.startY),this._emit("flow-node-action",{nodeId:t.id,action:"delete"});return}(t.kind==="node"||t.kind==="note"||t.kind==="note-resize")&&this._dragMoved&&this._emit("flow-change-commit")}};this._onViewportDragOver=t=>{if(!t.dataTransfer?.types.includes(np))return;this._viewInitialised=!0,t.preventDefault();let r=t.composedPath().some(a=>a instanceof Element&&a.classList.contains("add-point"));t.dataTransfer.dropEffect=r?"copy":"move";let n=this.screenToCanvas(t.clientX,t.clientY);this._dropGhost={x:ii(n.x-$t/2),y:ii(n.y-Cr/2)}};this._onViewportDragLeave=t=>{let r=this.getBoundingClientRect();(t.clientX<r.left||t.clientX>r.right||t.clientY<r.top||t.clientY>r.bottom)&&(this._dropGhost=null)};this._clearDropGhost=()=>{this._dropGhost=null};this._onAddPointDragOver=t=>{t.dataTransfer?.types.includes(np)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")};this._onBinDragOver=t=>{t.dataTransfer?.types.includes(np)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="move",this._overBin=!0,this._dropGhost=null)};this._onBinDragLeave=()=>{this._overBin=!1};this._onBinDrop=t=>{t.preventDefault(),t.stopPropagation(),this._overBin=!1,this._dropGhost=null}}connectedCallback(){super.connectedCallback(),this.addEventListener("flow-node-grab",this._onNodeGrab),this.addEventListener("flow-node-select",this._onNodeSelect),this.addEventListener("flow-port-click",this._onPortClick),this.addEventListener("wheel",this._onWheel,{passive:!1})}disconnectedCallback(){this.removeEventListener("flow-node-grab",this._onNodeGrab),this.removeEventListener("flow-node-select",this._onNodeSelect),this.removeEventListener("flow-port-click",this._onPortClick),this.removeEventListener("wheel",this._onWheel),this._cancelLink(),this._teardownWindow(),super.disconnectedCallback()}updated(t){if(super.updated(t),this.style.setProperty("--flow-zoom",String(this.zoom)),t.has("dragType")&&!this.dragType&&(this._dropGhost=null),!this._viewInitialised&&this.nodes.length){let r=this.getBoundingClientRect();r.width&&r.height&&(this._viewInitialised=!0,this._resetView())}}_emit(t,r){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:r}))}screenToCanvas(t,r){let n=this.getBoundingClientRect();return{x:(t-n.left-this.panX)/this.zoom,y:(r-n.top-this.panY)/this.zoom}}_typeFor(t){return this.registry?.get(t.type)}_setupWindow(t=""){window.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp),t&&(document.body.style.cursor=t)}_teardownWindow(){window.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),document.body.style.cursor=""}_onBranchPortClick(t,r){if(this._linking){let n=this._linking;this._cancelLink(),n.nodeId!==t&&this._emit("flow-link-assign",{nodeId:n.nodeId,port:n.port,targetId:t});return}this._startLink(t,r)}_startLink(t,r){this._linking={nodeId:t,port:r},this._linkPos=null,this._linkClient=null,window.addEventListener("pointermove",this._onLinkPointerMove),window.addEventListener("keydown",this._onLinkKeyDown),window.addEventListener("blur",this._cancelLink),this._linkScrollRaf=requestAnimationFrame(this._linkEdgeScroll)}_updateLinkFromClient(t,r){let n=this.screenToCanvas(t,r);this._linkPos=n;let a=this._linking;if(!a)return;let s=12,l=this.nodes.find(d=>d.id!==a.nodeId&&n.x>=d.x-s&&n.x<=d.x+$t+s&&n.y>=d.y-s&&n.y<=d.y+Cr+s&&Oa(d,this._typeFor(d)).length>0);this._linkTarget=l?.id??null}_binHit(t,r){let n=this.shadowRoot?.querySelector(".bin")?.getBoundingClientRect();return!!n&&t>=n.left&&t<=n.right&&r>=n.top&&r<=n.bottom}_beginMove(){this._dragMoved=!0,this._emit("flow-interaction-start")}_outputLayout(t){let r=vr(t,this._typeFor(t)),n=t.x+$t/2,a=t.y+Cr,s=a+Sv,l=rp(t,h=>this.registry?.get(h),this.connections),d=r.map((h,m)=>{let f=this.connections.find(E=>E.source.node===t.id&&E.source.port===h.id),b=f?this.nodes.find(E=>E.id===f.target.node):void 0,g=l[m],v=h.label?om(h.label).h:0,y=h.label?Cv(t,v,b,r.length===1):null,_=y===null?s:y+v;return{port:h,conn:f,child:b,x:g,pillTop:y,pillH:v,exitY:_}});return{cx:n,by:a,busY:s,branches:d}}_inputAnchor(t,r){let n=Oa(t,this._typeFor(t)),a=Math.max(n.findIndex(s=>s.id===r),0);return{x:L4(t,"in",a,n.length).x,y:t.y}}_elbowMidOffsets(){let t=new Map;for(let n of this.nodes){let{branches:a}=this._outputLayout(n);for(let s of a){if(!s.conn||!s.child)continue;let{x:l,y:d}=this._inputAnchor(s.child,s.conn.target.port);if(l===s.x||d-qv<s.exitY)continue;let h=ii((s.exitY+d)/2),m=`${s.conn.target.node}:${s.conn.target.port}`,f=t.get(h)??new Map;t.set(h,f),f.set(m,[...f.get(m)??[],s.conn.id])}}let r=new Map;for(let n of t.values()){if(n.size<2)continue;let a=[...n.keys()].sort();a.forEach((s,l)=>{let d=(l-Math.floor((a.length-1)/2))*rP;n.get(s).forEach(h=>r.set(h,d))})}return r}_segmentBlocked(t,r,n,a=!0){let l=a?eP:8,d=Math.min(t.x,r.x),h=Math.max(t.x,r.x),m=Math.min(t.y,r.y),f=Math.max(t.y,r.y);return this.nodes.some(b=>!n.has(b.id)&&d<b.x+$t+8&&h>b.x-8&&m<b.y+Cr+8&&f>b.y-l)}_routeClear(t,r,n=!0){for(let a=0;a<t.length-1;a++)if(this._segmentBlocked(t[a],t[a+1],r,n))return!1;return!0}_routePoints(t,r,n,a=0,s,l=!1){let{x:d,y:h}=this._inputAnchor(r,n),m=new Set(s?[r.id,s]:[r.id]),f=h-qv>=t.y?this._forwardRoutes(t,d,h,a,m):this._aroundRoutes(t,d,h,m,l);for(let b of[!0,!1])for(let g of f)if(this._routeClear(g,m,b))return g;return f[0]}_forwardRoutes(t,r,n,a,s){let l=[],d=Math.round((t.y+n)/2)+a,h=n-t.y,m=Math.min(n-12,Math.ceil((t.y+h/4)/br)*br),f=Math.max(m,Math.floor((n-h/4)/br)*br),b=y=>Math.max(m,Math.min(f,y));if(r===t.x)l.push([t,{x:r,y:n}]);else for(let y=0;y<=20;y++)for(let _ of y===0?[d]:[d+y*br,d-y*br]){let E=b(_);E!==_&&y>0||l.push([t,{x:t.x,y:E},{x:r,y:E},{x:r,y:n}])}l.push(...this._aroundRoutes(t,r,n,s,!1));let g=Math.floor(h/2/10)*10,v=Math.max(10,Math.round(h/4/10)*10);for(let y=0;y<=12;y++)for(let _ of y===0?[v]:[v+y*10,v-y*10]){if(_<10||_>g)continue;let E=t.y+_,N=n-_;if(!(N<E))for(let G=1;G<=14;G++)for(let R of[1,-1]){let C=t.x+R*G*br;l.push([t,{x:t.x,y:E},{x:C,y:E},{x:C,y:N},{x:r,y:N},{x:r,y:n}])}}return l}_aroundRoutes(t,r,n,a,s){let l=t.y+ZN,d=n-qv,h=this.nodes.filter(y=>!a.has(y.id)&&y.y+Cr>Math.min(l,d)-br&&y.y<Math.max(l,d)+br);if(!h.length)return[];let m=Math.max(...h.map(y=>y.x+$t))+F4,f=Math.min(...h.map(y=>y.x))-F4,b=y=>Math.abs(y-t.x)+Math.abs(y-r),g=s?b(m)<=b(f):r>=(f+m)/2,v=[];for(let y of g?[1,-1]:[-1,1]){let _=y>0?m:f;for(let E=0;E<=20;E++){let N=_+y*E*br;v.push([t,{x:t.x,y:l},{x:N,y:l},{x:N,y:d},{x:r,y:d},{x:r,y:n}])}}return v}static _pathFrom(t){return t.map((r,n)=>`${n===0?"M":"L"} ${r.x} ${r.y}`).join(" ")}_addPoints(){if(!this.movingNodeId&&!this.dragType)return[];let t=[];for(let r of this.nodes){let{branches:n}=this._outputLayout(r);n.forEach(a=>{a.conn||t.push({nodeId:r.id,port:a.port.id,px:a.x,py:a.exitY+Iv})})}return t}_wirePoints(){if(this.movingNodeId)return[];let t=this._elbowMidOffsets(),r=Na(this.nodes,this.connections),n=[];for(let d of this.nodes){let{branches:h}=this._outputLayout(d);h.forEach(m=>{if(!m.conn||!m.child)return;let f=t.get(m.conn.id)??0,b=this._routePoints({x:m.x,y:m.exitY},m.child,m.conn.target.port,f,d.id,r.has(m.conn)),g=0,v=-1;for(let L=0;L<b.length-1;L++){let M=Math.abs(b[L+1].x-b[L].x)+Math.abs(b[L+1].y-b[L].y);M>v&&(v=M,g=L)}let y=b[g],_=b[g+1],E=Math.abs(_.x-y.x)+Math.abs(_.y-y.y),N=Math.sign(_.x-y.x),G=Math.sign(_.y-y.y),R=L=>({px:y.x+N*L,py:y.y+G*L}),C=Math.max(0,(g===b.length-2?E-tP:E)/2);n.push({connectionId:m.conn.id,at:R,d:C,len:E})})}let a=H4,s=(d,h)=>this.nodes.some(m=>d>m.x-a&&d<m.x+$t+a&&h>m.y-a&&h<m.y+Cr+a),l=[];for(let d of n){let h=f=>s(f.px,f.py)||l.some(b=>Math.hypot(b.px-f.px,b.py-f.py)<H4*2+6),m=d.at(d.d);if(h(m))e:for(let f=br/2;f<=d.len;f+=br/2)for(let b of[d.d-f,d.d+f]){if(b<0||b>d.len)continue;let g=d.at(b);if(!h(g)){m=g;break e}}l.push({connectionId:d.connectionId,...m})}return l}_screenFromCanvas(t,r){let n=this.getBoundingClientRect();return{clientX:n.left+this.panX+t*this.zoom,clientY:n.top+this.panY+r*this.zoom}}_onAddClick(t,r,n){if(t.stopPropagation(),this.movingNodeId){this._emit("flow-output-move-target",{nodeId:r,port:n});return}this._startLink(r,n)}_onWireAddClick(t,r,n,a){t.stopPropagation(),this._emit("flow-wire-pick",{connectionId:r,...this._screenFromCanvas(n,a)})}_onAddDrop(t,r,n){let a=t.dataTransfer?.getData(np);a&&(t.preventDefault(),t.stopPropagation(),this._emit("flow-output-assign",{nodeId:r,port:n,type:a}))}_onWireDrop(t,r){let n=t.dataTransfer?.getData(np);n&&(t.preventDefault(),t.stopPropagation(),this._emit("flow-wire-assign",{connectionId:r,type:n}))}_zoomBy(t){this._viewInitialised=!0,this.zoom=Math.min(N4,Math.max(Mv,+(this.zoom+t).toFixed(2)))}_contentBounds(){if(!this.nodes.length&&!this.notes.length)return null;let t=1/0,r=1/0,n=-1/0,a=-1/0;for(let s of this.nodes){t=Math.min(t,s.x),n=Math.max(n,s.x+$t),r=Math.min(r,s.y),a=Math.max(a,s.y+Cr);for(let l of this._outputLayout(s).branches)t=Math.min(t,l.x-70),n=Math.max(n,l.x+70),a=Math.max(a,l.exitY+Iv+14)}for(let s of this.notes)t=Math.min(t,s.x),n=Math.max(n,s.x+(s.width??Tv)),r=Math.min(r,s.y),a=Math.max(a,s.y+(s.height??$v));return{x:t,y:r,width:n-t,height:a-r}}_resetView(){let t=this.getBoundingClientRect(),r=this._contentBounds();if(!r||!t.width||!t.height){this.zoom=1,this.panX=0,this.panY=0;return}let n=60,a=Math.min(1,(t.width-n*2)/r.width,(t.height-n*2)/r.height);this.zoom=Math.max(Mv,+a.toFixed(2)),this.panX=Math.round((t.width-r.width*this.zoom)/2-r.x*this.zoom),this.panY=Math.round((t.height-r.height*this.zoom)/2-r.y*this.zoom)}_viewportCursorClass(){return this.drag?this.drag.kind==="note-resize"?"resizing":"grabbing":""}_renderConnections(){let t=`translate(${this.panX} ${this.panY}) scale(${this.zoom})`,r=this._elbowMidOffsets(),n=Na(this.nodes,this.connections),a=[],s=!!(this.movingNodeId||this.dragType);for(let l of this.nodes){let{cx:d,by:h,busY:m,branches:f}=this._outputLayout(l),b=f.filter(_=>_.conn&&_.child||_.pillTop!==null||s);if(!b.length)continue;a.push(En`<path class="wire" d="M ${d} ${h} L ${d} ${m}"></path>`);let g=[d,...b.map(_=>_.x)],v=Math.min(...g),y=Math.max(...g);y-v>.5&&a.push(En`<path class="wire" d="M ${v} ${m} L ${y} ${m}"></path>`),b.forEach(_=>{if(_.pillTop!==null&&a.push(En`<path class="wire" d="M ${_.x} ${Math.min(m,_.pillTop-10)} L ${_.x} ${_.pillTop}" marker-end="url(#flow-arrow)"></path>`),_.conn&&_.child){let E=r.get(_.conn.id)??0,N=n.has(_.conn),G=this._routePoints({x:_.x,y:_.exitY},_.child,_.conn.target.port,E,l.id,N);a.push(En`<path
5423
+ `}};Di.styles=k(R4),Di.dependencies={"zn-icon":he,"zn-button":Oe,"zn-dropdown":Mr,"zn-menu":In,"zn-menu-item":Wi},c([p({attribute:!1})],Di.prototype,"node",2),c([p({attribute:!1})],Di.prototype,"type",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"error",2),c([p({type:Boolean,reflect:!0})],Di.prototype,"dragging",2),c([p({type:Boolean,reflect:!0,attribute:"link-target"})],Di.prototype,"linkTarget",2);var D4=Di;Di.define("zn-flow-node");var O4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;position:relative;width:100%;height:100%;overflow:hidden}.viewport{position:absolute;inset:0;overflow:hidden;background-color:rgb(var(--zn-color-body));background-image:radial-gradient(rgb(var(--zn-color-border)) 1px,transparent 1px);background-size:20px 20px;cursor:grab;touch-action:none}.viewport.grabbing,.viewport.grabbing *{cursor:grabbing !important}.viewport.connecting,.viewport.connecting *{cursor:crosshair !important}.viewport.resizing,.viewport.resizing *{cursor:nwse-resize !important}.viewport.linking{cursor:crosshair}.viewport.step-dragging .add-point{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid;box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 22%,transparent)}.connections{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.connections .wire{fill:none;stroke:rgb(var(--zn-color-primary));stroke-width:2}.connections .wire--stub{stroke:rgb(var(--zn-color-border-active));stroke-dasharray:4 4}.connections .wire--preview{stroke-dasharray:6 4}.connections .wire--loop{stroke:rgb(var(--zn-color-warning))}.connections marker path{fill:rgb(var(--zn-color-primary))}.connections marker#flow-arrow-loop path{fill:rgb(var(--zn-color-warning))}.add-point{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-12px;padding:0;border-radius:50%;color:rgb(var(--zn-color-primary));background:rgb(var(--zn-panel));border:1px dashed rgb(var(--zn-color-border-active));cursor:pointer;transition:background 0.12s ease,color 0.12s ease}.add-point:hover{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid}.add-point--target{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-style:solid;box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 25%,transparent)}.add-point--wire{width:20px;height:20px;margin:-10px}.layer{position:absolute;top:0;left:0;transform-origin:0 0;width:0;height:0}.node-pos{position:absolute;top:0;left:0}.branch-pill{display:flex;align-items:center;justify-content:center;width:-moz-max-content;width:max-content;max-width:240px;box-sizing:border-box;text-align:center;overflow-wrap:anywhere;overflow:hidden;padding:0 18px;border-radius:10px;font:inherit;font-size:0.8125rem;font-weight:600;line-height:20px;color:rgb(var(--zn-text));background:color-mix(in srgb,rgb(var(--zn-color-primary)) 8%,rgb(var(--zn-panel)));border:1px solid color-mix(in srgb,rgb(var(--zn-color-primary)) 45%,transparent);cursor:pointer;transition:border-color 0.12s ease,box-shadow 0.12s ease}.branch-pill:hover{border-color:rgb(var(--zn-color-primary));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}.branch-pill--selected{border-color:rgb(var(--zn-color-primary));background:color-mix(in srgb,rgb(var(--zn-color-primary)) 16%,rgb(var(--zn-panel)))}.branch-pill--loop{background:color-mix(in srgb,rgb(var(--zn-color-warning)) 10%,rgb(var(--zn-panel)));border-color:color-mix(in srgb,rgb(var(--zn-color-warning)) 55%,transparent)}.branch-pill--loop:hover{border-color:rgb(var(--zn-color-warning))}.branch-pill--loop.branch-pill--selected{border-color:rgb(var(--zn-color-warning));background:color-mix(in srgb,rgb(var(--zn-color-warning)) 18%,rgb(var(--zn-panel)))}.branch-pill-wrap{position:absolute;top:0;left:0;transform:translateX(-50%);display:flex;align-items:stretch}.branch-pill-wrap::after{content:"";position:absolute;left:100%;top:0;width:40px;height:100%}.branch-pill-wrap:hover .branch-pill-delete{opacity:1;transform:translate(0,-50%);pointer-events:auto;transition-delay:0.15s}.branch-pill-port{position:absolute;z-index:1;left:50%;bottom:0;transform:translate(-50%,50%);width:11px;height:11px;box-sizing:border-box;border-radius:50%;background:rgb(var(--zn-panel));border:2px solid rgb(var(--zn-color-primary));cursor:pointer;transition:transform 0.12s ease,box-shadow 0.12s ease}.branch-pill-port:hover{transform:translate(-50%,50%) scale(1.35);box-shadow:0 0 0 4px color-mix(in srgb,rgb(var(--zn-color-primary)) 20%,transparent)}.branch-pill-delete{position:absolute;z-index:1;left:calc(100% + 8px);top:50%;transform:translate(-10px,-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:rgb(var(--zn-color-error));color:white;cursor:pointer;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease}.branch-pill-delete:hover{filter:brightness(1.1)}.drop-ghost{position:absolute;top:0;left:0;display:flex;align-items:center;gap:10px;padding:0 12px;border:2px dashed rgb(var(--zn-color-primary));border-radius:10px;background:color-mix(in srgb,rgb(var(--zn-color-primary)) 10%,rgb(var(--zn-panel)));opacity:0.9;pointer-events:none}.drop-ghost__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:8px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 16%,rgb(var(--zn-panel)))}.drop-ghost__label{font-size:0.8125rem;font-weight:600;color:rgb(var(--zn-text));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.toolbar{position:absolute;top:16px;display:flex;align-items:center;gap:2px;padding:3px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);z-index:2}.toolbar--history{left:16px}.toolbar--zoom{right:16px}.bin{position:absolute;right:16px;bottom:16px;z-index:2;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:12px;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px dashed rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);transition:background 0.12s ease,color 0.12s ease,transform 0.12s ease}.bin--over{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-error));border-style:solid;border-color:rgb(var(--zn-color-error));transform:scale(1.12)}.note{position:absolute;display:flex;flex-direction:column;background:#fef9c3;border:1px solid #fde68a;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,0.12)}.note__resize{position:absolute;right:0;bottom:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 0 50%,#d9c64a 50% 60%,transparent 60% 70%,#d9c64a 70% 80%,transparent 80%)}.note__bar{display:flex;justify-content:flex-end;height:20px;cursor:grab}.note__close{width:20px;height:20px;padding:0;font-size:14px;line-height:1;color:#92400e;background:transparent;cursor:pointer}.note__text{flex:1;margin:0;padding:0 10px 10px;resize:none;border:none;outline:none;background:transparent;font:inherit;font-size:0.8125rem;color:#713f12}`;var Mv=.25,N4=2,P4=.15,Iv=40,tP=20,rP=48,qv=20,H4=10,iP=8,F4=40,nP=20,np=nc,Ot=class Ot extends T{constructor(){super(...arguments);this.nodes=[];this.connections=[];this.notes=[];this.selectedNodeId=null;this.errorNodes=new Set;this.movingNodeId=null;this.dragType=null;this.selectedBranch=null;this.zoom=1;this.panX=0;this.panY=0;this.drag=null;this._overBin=!1;this._dropGhost=null;this._linking=null;this._linkPos=null;this._linkTarget=null;this._linkClient=null;this._linkScrollRaf=null;this._dragMoved=!1;this._viewInitialised=!1;this._onWheel=t=>{if(t.composedPath().some(d=>d instanceof HTMLTextAreaElement))return;t.preventDefault(),this._viewInitialised=!0;let r=t.deltaMode===1?16:t.deltaMode===2?100:1,n=t.deltaX*r,a=t.deltaY*r;if(t.ctrlKey||t.metaKey){let d=Math.min(N4,Math.max(Mv,this.zoom*Math.exp(-a*.0015)));if(d===this.zoom)return;let h=this.getBoundingClientRect(),m=t.clientX-h.left,f=t.clientY-h.top,b=(m-this.panX)/this.zoom,g=(f-this.panY)/this.zoom;this.zoom=+d.toFixed(3),this.panX=Math.round(m-b*this.zoom),this.panY=Math.round(f-g*this.zoom);return}let s=t.shiftKey&&!n?a:n,l=t.shiftKey&&!n?0:a;this.panX-=Math.round(s),this.panY-=Math.round(l)};this._onBackgroundPointerDown=t=>{if(t.button===1){t.preventDefault(),this._viewInitialised=!0,this.drag={kind:"pan",ox:t.clientX,oy:t.clientY,px:this.panX,py:this.panY},this._setupWindow("grabbing");return}if(t.button===0){if(this._viewInitialised=!0,this._linking){let r=this._linking,n=this._linkTarget;if(this._cancelLink(),n){this._emit("flow-link-assign",{nodeId:r.nodeId,port:r.port,targetId:n});return}}this._emit("flow-node-select",{nodeId:null}),this.drag={kind:"pan",ox:t.clientX,oy:t.clientY,px:this.panX,py:this.panY},this._setupWindow("grabbing")}};this._onNodeGrab=t=>{if(this._linking){let a=this._linking;this._cancelLink(),a.nodeId!==t.detail.nodeId&&this._emit("flow-link-assign",{nodeId:a.nodeId,port:a.port,targetId:t.detail.nodeId});return}let r=this.nodes.find(a=>a.id===t.detail.nodeId);if(!r)return;let n=this.screenToCanvas(t.detail.clientX,t.detail.clientY);this.drag={kind:"node",id:r.id,offX:n.x-r.x,offY:n.y-r.y,startX:r.x,startY:r.y},this._dragMoved=!1,this._setupWindow("grabbing")};this._onNodeSelect=t=>{this._linking&&t.detail.nodeId&&t.stopPropagation()};this._onPortClick=t=>{let{nodeId:r}=t.detail;if(this._linking&&this._linking.nodeId!==r){let s=this._linking;this._cancelLink(),this._emit("flow-link-assign",{nodeId:s.nodeId,port:s.port,targetId:r});return}let n=this.nodes.find(s=>s.id===r);if(!n)return;let a=vr(n,this._typeFor(n)).find(s=>!this.connections.some(l=>l.source.node===r&&l.source.port===s.id));!a&&this._typeFor(n)?.fixedOutputs||this._startLink(r,a?.id??tp)};this._onLinkPointerMove=t=>{this._linkClient={x:t.clientX,y:t.clientY},this._updateLinkFromClient(t.clientX,t.clientY)};this._linkEdgeScroll=()=>{if(this._linkScrollRaf=null,!!this._linking){if(this._linkClient){let t=this.getBoundingClientRect(),r=48,n=14,a=m=>Math.min(n,Math.ceil((r-m)/r*n)),{x:s,y:l}=this._linkClient,d=0,h=0;s<t.left+r?d=a(s-t.left):s>t.right-r&&(d=-a(t.right-s)),l<t.top+r?h=a(l-t.top):l>t.bottom-r&&(h=-a(t.bottom-l)),(d||h)&&(this.panX+=d,this.panY+=h,this._updateLinkFromClient(s,l))}this._linkScrollRaf=requestAnimationFrame(this._linkEdgeScroll)}};this._onLinkKeyDown=t=>{t.key==="Escape"&&this._cancelLink()};this._cancelLink=()=>{this._linking&&(this._linking=null,this._linkPos=null,this._linkTarget=null,this._linkClient=null,this._linkScrollRaf!==null&&(cancelAnimationFrame(this._linkScrollRaf),this._linkScrollRaf=null),window.removeEventListener("pointermove",this._onLinkPointerMove),window.removeEventListener("keydown",this._onLinkKeyDown),window.removeEventListener("blur",this._cancelLink))};this._onPointerMove=t=>{if(!this.drag)return;if(this.drag.kind==="pan"){this.panX=this.drag.px+(t.clientX-this.drag.ox),this.panY=this.drag.py+(t.clientY-this.drag.oy);return}let r=this.screenToCanvas(t.clientX,t.clientY);if(this.drag.kind==="node"){this._overBin=this._binHit(t.clientX,t.clientY);let n=this.nodes.find(a=>a.id===this.drag.id);if(n){let a={x:ii(r.x-this.drag.offX),y:ii(r.y-this.drag.offY)},s=new Set(this.connections.filter(h=>h.target.node===n.id&&h.source.node!==n.id).map(h=>h.source.node)),l=h=>{let m={...n,...h},f=this.nodes.map(g=>g.id===n.id?m:g),b=g=>this.registry?.get(g);return f.some(g=>g!==m&&E4(m,g,b,f,this.connections))?!1:![...s].some(g=>{let v=f.find(y=>y.id===g);return!!v&&am(v,b,f,this.connections)})},d=l(a)?a:l({x:a.x,y:n.y})?{x:a.x,y:n.y}:l({x:n.x,y:a.y})?{x:n.x,y:a.y}:null;d&&(d.x!==n.x||d.y!==n.y)&&(this._dragMoved||this._beginMove(),n.x=d.x,n.y=d.y,this.requestUpdate())}}else if(this.drag.kind==="note"){let n=this.notes.find(a=>a.id===this.drag.id);n&&(this._dragMoved||this._beginMove(),n.x=ii(r.x-this.drag.offX),n.y=ii(r.y-this.drag.offY),this.requestUpdate())}else if(this.drag.kind==="note-resize"){let n=this.notes.find(a=>a.id===this.drag.id);n&&(this._dragMoved||this._beginMove(),n.width=Math.max($4,ii(r.x-n.x)),n.height=Math.max(A4,ii(r.y-n.y)),this.requestUpdate())}};this._onPointerUp=()=>{let t=this.drag,r=this._overBin;if(this.drag=null,this._overBin=!1,this._teardownWindow(),!!t){if(t.kind==="node"&&this._dragMoved&&r){let n=this.nodes.find(a=>a.id===t.id);n&&(n.x=t.startX,n.y=t.startY),this._emit("flow-node-action",{nodeId:t.id,action:"delete"});return}(t.kind==="node"||t.kind==="note"||t.kind==="note-resize")&&this._dragMoved&&this._emit("flow-change-commit")}};this._onViewportDragOver=t=>{if(!t.dataTransfer?.types.includes(np))return;this._viewInitialised=!0,t.preventDefault();let r=t.composedPath().some(a=>a instanceof Element&&a.classList.contains("add-point"));t.dataTransfer.dropEffect=r?"copy":"move";let n=this.screenToCanvas(t.clientX,t.clientY);this._dropGhost={x:ii(n.x-$t/2),y:ii(n.y-Cr/2)}};this._onViewportDragLeave=t=>{let r=this.getBoundingClientRect();(t.clientX<r.left||t.clientX>r.right||t.clientY<r.top||t.clientY>r.bottom)&&(this._dropGhost=null)};this._clearDropGhost=()=>{this._dropGhost=null};this._onAddPointDragOver=t=>{t.dataTransfer?.types.includes(np)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")};this._onBinDragOver=t=>{t.dataTransfer?.types.includes(np)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="move",this._overBin=!0,this._dropGhost=null)};this._onBinDragLeave=()=>{this._overBin=!1};this._onBinDrop=t=>{t.preventDefault(),t.stopPropagation(),this._overBin=!1,this._dropGhost=null}}connectedCallback(){super.connectedCallback(),this.addEventListener("flow-node-grab",this._onNodeGrab),this.addEventListener("flow-node-select",this._onNodeSelect),this.addEventListener("flow-port-click",this._onPortClick),this.addEventListener("wheel",this._onWheel,{passive:!1})}disconnectedCallback(){this.removeEventListener("flow-node-grab",this._onNodeGrab),this.removeEventListener("flow-node-select",this._onNodeSelect),this.removeEventListener("flow-port-click",this._onPortClick),this.removeEventListener("wheel",this._onWheel),this._cancelLink(),this._teardownWindow(),super.disconnectedCallback()}updated(t){if(super.updated(t),this.style.setProperty("--flow-zoom",String(this.zoom)),t.has("dragType")&&!this.dragType&&(this._dropGhost=null),!this._viewInitialised&&this.nodes.length){let r=this.getBoundingClientRect();r.width&&r.height&&(this._viewInitialised=!0,this._resetView())}}_emit(t,r){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:r}))}screenToCanvas(t,r){let n=this.getBoundingClientRect();return{x:(t-n.left-this.panX)/this.zoom,y:(r-n.top-this.panY)/this.zoom}}_typeFor(t){return this.registry?.get(t.type)}_setupWindow(t=""){window.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp),t&&(document.body.style.cursor=t)}_teardownWindow(){window.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),document.body.style.cursor=""}_onBranchPortClick(t,r){if(this._linking){let n=this._linking;this._cancelLink(),n.nodeId!==t&&this._emit("flow-link-assign",{nodeId:n.nodeId,port:n.port,targetId:t});return}this._startLink(t,r)}_startLink(t,r){this._linking={nodeId:t,port:r},this._linkPos=null,this._linkClient=null,window.addEventListener("pointermove",this._onLinkPointerMove),window.addEventListener("keydown",this._onLinkKeyDown),window.addEventListener("blur",this._cancelLink),this._linkScrollRaf=requestAnimationFrame(this._linkEdgeScroll)}_updateLinkFromClient(t,r){let n=this.screenToCanvas(t,r);this._linkPos=n;let a=this._linking;if(!a)return;let s=12,l=this.nodes.find(d=>d.id!==a.nodeId&&n.x>=d.x-s&&n.x<=d.x+$t+s&&n.y>=d.y-s&&n.y<=d.y+Cr+s&&Oa(d,this._typeFor(d)).length>0);this._linkTarget=l?.id??null}_binHit(t,r){let n=this.shadowRoot?.querySelector(".bin")?.getBoundingClientRect();return!!n&&t>=n.left&&t<=n.right&&r>=n.top&&r<=n.bottom}_beginMove(){this._dragMoved=!0,this._emit("flow-interaction-start")}_outputLayout(t){let r=vr(t,this._typeFor(t)),n=t.x+$t/2,a=t.y+Cr,s=a+Sv,l=rp(t,h=>this.registry?.get(h),this.connections),d=r.map((h,m)=>{let f=this.connections.find(E=>E.source.node===t.id&&E.source.port===h.id),b=f?this.nodes.find(E=>E.id===f.target.node):void 0,g=l[m],v=h.label?om(h.label).h:0,y=h.label?Cv(t,v,b,r.length===1):null,_=y===null?s:y+v;return{port:h,conn:f,child:b,x:g,pillTop:y,pillH:v,exitY:_}});return{cx:n,by:a,busY:s,branches:d}}_inputAnchor(t,r){let n=Oa(t,this._typeFor(t)),a=Math.max(n.findIndex(s=>s.id===r),0);return{x:L4(t,"in",a,n.length).x,y:t.y}}_elbowMidOffsets(){let t=new Map;for(let n of this.nodes){let{branches:a}=this._outputLayout(n);for(let s of a){if(!s.conn||!s.child)continue;let{x:l,y:d}=this._inputAnchor(s.child,s.conn.target.port);if(l===s.x||d-qv<s.exitY)continue;let h=ii((s.exitY+d)/2),m=`${s.conn.target.node}:${s.conn.target.port}`,f=t.get(h)??new Map;t.set(h,f),f.set(m,[...f.get(m)??[],s.conn.id])}}let r=new Map;for(let n of t.values()){if(n.size<2)continue;let a=[...n.keys()].sort();a.forEach((s,l)=>{let d=(l-Math.floor((a.length-1)/2))*nP;n.get(s).forEach(h=>r.set(h,d))})}return r}_segmentBlocked(t,r,n,a=!0){let l=a?rP:8,d=Math.min(t.x,r.x),h=Math.max(t.x,r.x),m=Math.min(t.y,r.y),f=Math.max(t.y,r.y);return this.nodes.some(b=>!n.has(b.id)&&d<b.x+$t+8&&h>b.x-8&&m<b.y+Cr+8&&f>b.y-l)}_routeClear(t,r,n=!0){for(let a=0;a<t.length-1;a++)if(this._segmentBlocked(t[a],t[a+1],r,n))return!1;return!0}_routePoints(t,r,n,a=0,s,l=!1){let{x:d,y:h}=this._inputAnchor(r,n),m=new Set(s?[r.id,s]:[r.id]),f=h-qv>=t.y?this._forwardRoutes(t,d,h,a,m):this._aroundRoutes(t,d,h,m,l);for(let b of[!0,!1])for(let g of f)if(this._routeClear(g,m,b))return g;return f[0]}_forwardRoutes(t,r,n,a,s){let l=[],d=Math.round((t.y+n)/2)+a,h=n-t.y,m=Math.min(n-12,Math.ceil((t.y+h/4)/br)*br),f=Math.max(m,Math.floor((n-h/4)/br)*br),b=y=>Math.max(m,Math.min(f,y));if(r===t.x)l.push([t,{x:r,y:n}]);else for(let y=0;y<=20;y++)for(let _ of y===0?[d]:[d+y*br,d-y*br]){let E=b(_);E!==_&&y>0||l.push([t,{x:t.x,y:E},{x:r,y:E},{x:r,y:n}])}l.push(...this._aroundRoutes(t,r,n,s,!1));let g=Math.floor(h/2/10)*10,v=Math.max(10,Math.round(h/4/10)*10);for(let y=0;y<=12;y++)for(let _ of y===0?[v]:[v+y*10,v-y*10]){if(_<10||_>g)continue;let E=t.y+_,N=n-_;if(!(N<E))for(let G=1;G<=14;G++)for(let R of[1,-1]){let C=t.x+R*G*br;l.push([t,{x:t.x,y:E},{x:C,y:E},{x:C,y:N},{x:r,y:N},{x:r,y:n}])}}return l}_aroundRoutes(t,r,n,a,s){let l=t.y+tP,d=n-qv,h=this.nodes.filter(y=>!a.has(y.id)&&y.y+Cr>Math.min(l,d)-br&&y.y<Math.max(l,d)+br);if(!h.length)return[];let m=Math.max(...h.map(y=>y.x+$t))+F4,f=Math.min(...h.map(y=>y.x))-F4,b=y=>Math.abs(y-t.x)+Math.abs(y-r),g=s?b(m)<=b(f):r>=(f+m)/2,v=[];for(let y of g?[1,-1]:[-1,1]){let _=y>0?m:f;for(let E=0;E<=20;E++){let N=_+y*E*br;v.push([t,{x:t.x,y:l},{x:N,y:l},{x:N,y:d},{x:r,y:d},{x:r,y:n}])}}return v}static _pathFrom(t){return t.map((r,n)=>`${n===0?"M":"L"} ${r.x} ${r.y}`).join(" ")}_addPoints(){if(!this.movingNodeId&&!this.dragType)return[];let t=[];for(let r of this.nodes){let{branches:n}=this._outputLayout(r);n.forEach(a=>{a.conn||t.push({nodeId:r.id,port:a.port.id,px:a.x,py:a.exitY+Iv})})}return t}_wirePoints(){if(this.movingNodeId)return[];let t=this._elbowMidOffsets(),r=Na(this.nodes,this.connections),n=[];for(let d of this.nodes){let{branches:h}=this._outputLayout(d);h.forEach(m=>{if(!m.conn||!m.child)return;let f=t.get(m.conn.id)??0,b=this._routePoints({x:m.x,y:m.exitY},m.child,m.conn.target.port,f,d.id,r.has(m.conn)),g=0,v=-1;for(let L=0;L<b.length-1;L++){let M=Math.abs(b[L+1].x-b[L].x)+Math.abs(b[L+1].y-b[L].y);M>v&&(v=M,g=L)}let y=b[g],_=b[g+1],E=Math.abs(_.x-y.x)+Math.abs(_.y-y.y),N=Math.sign(_.x-y.x),G=Math.sign(_.y-y.y),R=L=>({px:y.x+N*L,py:y.y+G*L}),C=Math.max(0,(g===b.length-2?E-iP:E)/2);n.push({connectionId:m.conn.id,at:R,d:C,len:E})})}let a=H4,s=(d,h)=>this.nodes.some(m=>d>m.x-a&&d<m.x+$t+a&&h>m.y-a&&h<m.y+Cr+a),l=[];for(let d of n){let h=f=>s(f.px,f.py)||l.some(b=>Math.hypot(b.px-f.px,b.py-f.py)<H4*2+6),m=d.at(d.d);if(h(m))e:for(let f=br/2;f<=d.len;f+=br/2)for(let b of[d.d-f,d.d+f]){if(b<0||b>d.len)continue;let g=d.at(b);if(!h(g)){m=g;break e}}l.push({connectionId:d.connectionId,...m})}return l}_screenFromCanvas(t,r){let n=this.getBoundingClientRect();return{clientX:n.left+this.panX+t*this.zoom,clientY:n.top+this.panY+r*this.zoom}}_onAddClick(t,r,n){if(t.stopPropagation(),this.movingNodeId){this._emit("flow-output-move-target",{nodeId:r,port:n});return}this._startLink(r,n)}_onWireAddClick(t,r,n,a){t.stopPropagation(),this._emit("flow-wire-pick",{connectionId:r,...this._screenFromCanvas(n,a)})}_onAddDrop(t,r,n){let a=t.dataTransfer?.getData(np);a&&(t.preventDefault(),t.stopPropagation(),this._emit("flow-output-assign",{nodeId:r,port:n,type:a}))}_onWireDrop(t,r){let n=t.dataTransfer?.getData(np);n&&(t.preventDefault(),t.stopPropagation(),this._emit("flow-wire-assign",{connectionId:r,type:n}))}_zoomBy(t){this._viewInitialised=!0,this.zoom=Math.min(N4,Math.max(Mv,+(this.zoom+t).toFixed(2)))}_contentBounds(){if(!this.nodes.length&&!this.notes.length)return null;let t=1/0,r=1/0,n=-1/0,a=-1/0;for(let s of this.nodes){t=Math.min(t,s.x),n=Math.max(n,s.x+$t),r=Math.min(r,s.y),a=Math.max(a,s.y+Cr);for(let l of this._outputLayout(s).branches)t=Math.min(t,l.x-70),n=Math.max(n,l.x+70),a=Math.max(a,l.exitY+Iv+14)}for(let s of this.notes)t=Math.min(t,s.x),n=Math.max(n,s.x+(s.width??Tv)),r=Math.min(r,s.y),a=Math.max(a,s.y+(s.height??$v));return{x:t,y:r,width:n-t,height:a-r}}_resetView(){let t=this.getBoundingClientRect(),r=this._contentBounds();if(!r||!t.width||!t.height){this.zoom=1,this.panX=0,this.panY=0;return}let n=60,a=Math.min(1,(t.width-n*2)/r.width,(t.height-n*2)/r.height);this.zoom=Math.max(Mv,+a.toFixed(2)),this.panX=Math.round((t.width-r.width*this.zoom)/2-r.x*this.zoom),this.panY=Math.round((t.height-r.height*this.zoom)/2-r.y*this.zoom)}_viewportCursorClass(){return this.drag?this.drag.kind==="note-resize"?"resizing":"grabbing":""}_renderConnections(){let t=`translate(${this.panX} ${this.panY}) scale(${this.zoom})`,r=this._elbowMidOffsets(),n=Na(this.nodes,this.connections),a=[],s=!!(this.movingNodeId||this.dragType);for(let l of this.nodes){let{cx:d,by:h,busY:m,branches:f}=this._outputLayout(l),b=f.filter(_=>_.conn&&_.child||_.pillTop!==null||s);if(!b.length)continue;a.push(En`<path class="wire" d="M ${d} ${h} L ${d} ${m}"></path>`);let g=[d,...b.map(_=>_.x)],v=Math.min(...g),y=Math.max(...g);y-v>.5&&a.push(En`<path class="wire" d="M ${v} ${m} L ${y} ${m}"></path>`),b.forEach(_=>{if(_.pillTop!==null&&a.push(En`<path class="wire" d="M ${_.x} ${Math.min(m,_.pillTop-10)} L ${_.x} ${_.pillTop}" marker-end="url(#flow-arrow)"></path>`),_.conn&&_.child){let E=r.get(_.conn.id)??0,N=n.has(_.conn),G=this._routePoints({x:_.x,y:_.exitY},_.child,_.conn.target.port,E,l.id,N);a.push(En`<path
5424
5424
  class="wire wire--link ${N?"wire--loop":""}"
5425
5425
  d="${Ot._pathFrom(G)}"
5426
5426
  marker-end="url(#${N?"flow-arrow-loop":"flow-arrow"})"
@@ -5588,7 +5588,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5588
5588
  <zn-collapsible caption="${this.caption??""}" default="${this.collapsed?"closed":"open"}">
5589
5589
  <slot></slot>
5590
5590
  </zn-collapsible>
5591
- `}};fo.styles=k(V4),fo.dependencies={"zn-collapsible":rs},c([p()],fo.prototype,"caption",2),c([p({type:Boolean,reflect:!0})],fo.prototype,"collapsed",2);var Rv=fo;fo.define("zn-flow-step-group");var lm=class{constructor(){this.types=new Map}register(i){return this.types.set(i.type,i),this}registerAll(i){return i.forEach(t=>this.register(t)),this}get(i){return this.types.get(i)}has(i){return this.types.has(i)}all(){return Array.from(this.types.values())}byGroup(i){return this.all().filter(t=>t.group===i)}categories(i){let t=new Map;for(let r of this.byGroup(i)){let n=r.category??"",a=t.get(n)??[];a.push(r),t.set(n,a)}return t}clear(){this.types.clear()}};var U4=$t+80,cm=220,Dv=40,op=o=>o.reduce((i,t)=>i+t,0)/o.length;function j4(o,i){let t=new Map,r=o.nodes;if(!r.length)return t;let n=new Map(r.map(C=>[C.id,C])),a=new Map(r.map(C=>[C.id,[]])),s=new Map(r.map(C=>[C.id,[]]));for(let C of o.connections)!n.has(C.source.node)||!n.has(C.target.node)||(a.get(C.target.node).push(C),s.get(C.source.node).push(C));let l=Na(r,o.connections),d=new Map,h=C=>{let L=d.get(C);if(L!==void 0)return L;let M=a.get(C).filter(ie=>!l.has(ie)),Y=M.length?Math.max(...M.map(ie=>h(ie.source.node)))+1:0;return d.set(C,Y),Y};r.forEach(C=>h(C.id)),r.forEach(C=>{if(a.get(C.id).some(Y=>!l.has(Y)))return;let L=s.get(C.id).filter(Y=>!l.has(Y));if(!L.length)return;let M=Math.min(...L.map(Y=>d.get(Y.target.node)))-1;M>d.get(C.id)&&d.set(C.id,M)});let m=Array.from({length:Math.max(...d.values())+1},()=>[]);r.forEach(C=>m[d.get(C.id)].push(C));let f=C=>{let L=n.get(C.source.node),M=vr(L,i(L.type)),Y=Math.max(M.length,1),ie=Math.max(M.findIndex(ye=>ye.id===C.source.port),0);return Y===1?0:(ie-(Y-1)/2)*kv},b=new Map,g=C=>{let L=a.get(C.id).filter(M=>!l.has(M)&&b.has(M.source.node));return L.length?op(L.map(M=>{let Y=n.get(M.source.node),ie=vr(Y,i(Y.type)),ye=Math.max(ie.length,1),Ie=Math.max(ie.findIndex(Ve=>Ve.id===M.source.port),0);return b.get(Y.id)+(Ie+1)/(ye+1)-.5})):null},v=C=>{let L=s.get(C.id).filter(M=>!l.has(M)&&b.has(M.target.node));return L.length?op(L.map(M=>b.get(M.target.node))):null};m[0].sort((C,L)=>C.x-L.x).forEach((C,L)=>b.set(C.id,L));for(let C=1;C<m.length;C++)m[C].sort((L,M)=>(g(L)??0)-(g(M)??0)).forEach((L,M)=>b.set(L.id,M));for(let C=1;C<m.length;C++){let L=M=>g(M)??v(M)??0;m[C].sort((M,Y)=>L(M)-L(Y)).forEach((M,Y)=>b.set(M.id,Y))}let y=new Map,_=(C,L)=>{let M=C.map(Ie=>L(Ie)??y.get(Ie.id)??0),Y=-1/0,ie=M.map(Ie=>Y=Math.max(Ie,Y+U4)),ye=op(ie.map((Ie,Ve)=>Ie-M[Ve]));C.forEach((Ie,Ve)=>y.set(Ie.id,ie[Ve]-ye))},E=C=>{let L=a.get(C.id).filter(M=>!l.has(M)&&y.has(M.source.node));return L.length?op(L.map(M=>y.get(M.source.node)+f(M))):null},N=C=>{let L=s.get(C.id).filter(M=>!l.has(M)&&y.has(M.target.node));return L.length?op(L.map(M=>y.get(M.target.node)-f(M))):null};m[0].forEach((C,L)=>y.set(C.id,L*U4));for(let C=1;C<m.length;C++)_(m[C],E);for(let C=m.length-2;C>=0;C--)_(m[C],N);for(let C=1;C<m.length;C++)_(m[C],E);let G=[...y.values()].filter(Number.isFinite),R=G.length?Math.min(...G):0;return r.forEach(C=>{let L=y.get(C.id);t.set(C.id,{x:ii(Number.isFinite(L)?L-R+Dv:Dv),y:Dv+d.get(C.id)*cm})}),t}var G4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;width:100%;height:100%;min-height:480px;color:rgb(var(--zn-text))}.builder{--steps-width:343px;--side-width:500px;display:grid;grid-template-columns:var(--steps-width) minmax(0,1fr) var(--side-width);grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;transition:grid-template-columns 0.2s ease}.builder--steps-collapsed{--steps-width:0px}.builder--steps-collapsed .steps{border-right:none}.builder--side-collapsed{--side-width:0px}.builder--side-collapsed .sidebar,.builder--side-collapsed .inspector{padding:0;border-left:none}.header{grid-row:1;grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid rgb(var(--zn-border-color));background:rgb(var(--zn-panel))}.header[hidden]{display:none}.header__group{display:flex;align-items:center;gap:8px}.steps,.inspector,.sidebar{grid-row:2;display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;background:rgb(var(--zn-panel))}.canvas-cell{grid-row:2;position:relative;min-width:0;min-height:0}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.panel-toggle--right{right:-12px}.panel-toggle--right.panel-toggle--tucked{right:8px}.steps{--zn-active-nav-background:var(--zn-panel);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;border-right:1px solid rgb(var(--zn-border-color))}.steps-content{flex:1;min-height:0;display:flex;flex-direction:column}.steps-panel{display:flex;flex-direction:column;min-height:0;height:100%}.steps-hint{margin:0;padding:12px var(--zn-base-gap);font-size:0.8125rem;line-height:1.4;color:rgb(var(--zn-color-muted-text))}.steps-scroll ::-webkit-scrollbar{width:5px;height:5px}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-track{background:transparent}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.steps-scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:16px}.steps-scroll zn-flow-step-group{display:block;border-top:1px solid rgb(var(--zn-border-color))}.steps-uncategorized{padding:8px var(--zn-base-gap)}.steps-empty{padding:16px var(--zn-base-gap);font-size:0.8125rem;color:rgb(var(--zn-color-muted-text))}.declarations{display:none}.title-block{padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.title-block .heading{font-size:0.9375rem;font-weight:600}.title-block .subheading{margin-top:2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.search{padding:12px 12px 8px}.step{display:flex;align-items:center;gap:10px;padding:8px 10px;margin-bottom:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;font-size:0.8125rem;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease}.step:hover{border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}.step:active{cursor:grabbing}.step__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.step__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector{border-left:1px solid rgb(var(--zn-border-color));animation:inspector-in 0.18s ease}.inspector-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;height:100%;padding:24px;text-align:center;color:rgb(var(--zn-color-muted-text));font-size:0.8125rem}.inspector-head{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.inspector-head__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:8px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.inspector-head__text{flex:1;min-width:0}.inspector-head__title-row{display:flex;align-items:center;gap:6px;min-width:0}.inspector-head__title-row .inspector-head__title{min-width:0}.inspector-head__title{font-size:0.875rem;font-weight:600}.inspector-head__title,.inspector-head__type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector-head__type{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-body ::-webkit-scrollbar{width:5px;height:5px}.inspector-body{}.inspector-body ::-webkit-scrollbar-track{background:transparent}.inspector-body{}.inspector-body ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.inspector-body{}.inspector-body ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.inspector-body{display:flex;flex-direction:column;gap:14px;flex:1;min-height:0;overflow-y:auto;padding:16px}.inspector-hint{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-loop-tag{display:inline-flex;align-items:center;flex:0 0 auto;gap:3px;padding:2px 8px;border-radius:999px;font-size:0.6875rem;font-weight:600;line-height:1;color:rgb(var(--zn-color-warning));background:color-mix(in srgb,rgb(var(--zn-color-warning)) 14%,transparent)}.inspector-close{display:flex;align-items:center;justify-content:center;flex:0 0 auto;margin-left:auto;width:28px;height:28px;padding:0;border-radius:6px;color:rgb(var(--zn-color-muted-text));background:transparent;cursor:pointer}.inspector-close:hover{background:rgb(var(--zn-color-tab));color:rgb(var(--zn-text))}@keyframes inspector-in{from{transform:translateX(32px);opacity:0.3}to{transform:translateX(0);opacity:1}}.sidebar ::-webkit-scrollbar{width:5px;height:5px}.sidebar{}.sidebar ::-webkit-scrollbar-track{background:transparent}.sidebar{}.sidebar ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.sidebar{}.sidebar ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.sidebar{border-left:1px solid rgb(var(--zn-border-color));overflow-y:auto;padding:16px}.sidebar-section__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:0.8125rem;font-weight:600}.sidebar-count{min-width:20px;padding:0 6px;font-size:0.75rem;line-height:18px;text-align:center;border-radius:9px;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-color-tab))}.sidebar-empty{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.sidebar-error{display:flex;align-items:center;gap:8px;width:100%;margin-bottom:6px;padding:8px 10px;font-size:0.8125rem;text-align:left;color:rgb(var(--zn-color-error));background:color-mix(in srgb,rgb(var(--zn-color-error)) 7%,transparent);border:1px solid color-mix(in srgb,rgb(var(--zn-color-error)) 25%,transparent);border-radius:8px;cursor:pointer}.picker{position:fixed;z-index:21;width:220px;max-height:320px;overflow-y:auto;padding:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 6px 24px rgba(var(--zn-shadow),0.5)}.picker ::-webkit-scrollbar{width:5px;height:5px}.picker{}.picker ::-webkit-scrollbar-track{background:transparent}.picker{}.picker ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.picker{}.picker ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.picker-backdrop{position:fixed;inset:0;z-index:20}.picker-group{padding:8px 8px 4px;font-size:0.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;color:rgb(var(--zn-color-muted-text))}.picker-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;font-size:0.8125rem;text-align:left;background:transparent;border-radius:6px;cursor:pointer}.picker-item:hover{background:rgb(var(--zn-color-tab))}.picker-item__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:26px;height:26px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.picker-empty{margin:0;padding:10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.save-status{position:absolute;left:16px;bottom:16px;z-index:5;display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);pointer-events:none;transition:color 0.15s ease,border-color 0.15s ease}.save-status--saved{color:rgb(var(--zn-color-success));border-color:color-mix(in srgb,rgb(var(--zn-color-success)) 45%,transparent)}.restore-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;flex-wrap:wrap;justify-content:center;gap:8px;width:-moz-max-content;width:max-content;max-width:calc(100% - 32px);padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.restore-banner span{flex:1 1 auto;min-width:min(160px,100%)}.restore-banner button{flex:0 0 auto;padding:3px 10px;font-size:0.75rem;font-weight:600;border-radius:6px;cursor:pointer}.restore-banner__restore{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary))}.restore-banner__restore:hover{filter:brightness(1.1)}.restore-banner__dismiss{color:rgb(var(--zn-color-muted-text));background:transparent}.restore-banner__dismiss:hover{background:rgb(var(--zn-color-tab))}.move-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.move-banner button{padding:2px 8px;font-size:0.75rem;font-weight:600;color:rgb(var(--zn-panel));background:rgba(255,255,255,0.2);border-radius:6px;cursor:pointer}`;var iP=50,W4=nc,nP=5,oP=1440*60*1e3;function K4(o){let i=Math.floor(o/1e3);if(i<10)return"just now";if(i<60)return`${i}s ago`;let t=Math.floor(i/60);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var Y4=[{group:"entrypoint",label:"Entrypoint"},{group:"trigger",label:"Triggers"},{group:"action",label:"Actions"},{group:"rule",label:"Rules"}],Ae=class Ae extends T{constructor(){super(...arguments);this.nodeTypes=[];this.heading="";this.subheading="";this.errorNodes=[];this.autoSave=null;this.entrypointsHint="";this.triggersHint="";this.actionsHint="";this.rulesHint="";this.registry=new lm;this._state=M4();this._selectedNodeId=null;this._selectedBranch=null;this._search="";this._activeGroup=null;this._hasSlot=new te(this,"header-left","header-right");this._stepsCollapsed=!1;this._sideCollapsed=!1;this._movingNodeId=null;this._picker=null;this._draggingType=null;this._history=[];this._redo=[];this._seq=0;this._untangleRaf=null;this._untangleSettle=null;this._configRevision=0;this._autoSaveTimer=null;this._statusTimer=null;this._justSavedTimer=null;this._restoring=!1;this._lastSavedAt=null;this._justSaved=!1;this._statusNow=Date.now();this._restorePrompt=null;this._autoSaveTick=()=>{if(this._restorePrompt)return;let t=this.getState();if(!(!t.nodes.length&&!t.connections.length&&!t.notes.length))try{localStorage.setItem(this._autoSaveKey,JSON.stringify({savedAt:Date.now(),state:t})),this._lastSavedAt=Date.now(),this._justSaved=!0,this._justSavedTimer!==null&&clearTimeout(this._justSavedTimer),this._justSavedTimer=window.setTimeout(()=>this._justSaved=!1,2500)}catch{}};this._onKeyDown=t=>{t.key==="Escape"&&(this._movingNodeId||this._picker||this._selectedBranch)&&(this._movingNodeId=null,this._picker=null,this._selectedBranch=null)};this._registerSlottedTypes=()=>{let t=!1;this.querySelectorAll("zn-flow-step").forEach(r=>{let n=this._typeFromStep(r);n&&!this.registry.has(n.type)&&(this.registry.register(n),t=!0)}),t&&this.requestUpdate()};this.undo=()=>{let t=this._history.pop();t&&(this._cancelUntangle(),this._redo.push(this._clone(this._state)),this._state=t,this._configRevision++,this._syncSelection(),this._commit())};this.redo=()=>{let t=this._redo.pop();t&&(this._cancelUntangle(),this._history.push(this._clone(this._state)),this._state=t,this._configRevision++,this._syncSelection(),this._commit())};this.untangle=()=>{if(!this._state.nodes.length)return;this._cancelUntangle(),this._pushHistory();let t=j4(this._state,f=>this.registry.get(f)),r=this._state.nodes.map(f=>({n:f,from:{x:f.x,y:f.y},to:t.get(f.id)})).filter(f=>!!f.to),n=()=>{r.forEach(({n:f,to:b})=>{f.x=b.x,f.y=b.y})},a=()=>{this._untangleSettle=null,n(),this._commit()};if(this._untangleSettle=n,window.matchMedia("(prefers-reduced-motion: reduce)").matches){a();return}let s=500,l=f=>f<.5?4*f*f*f:1-Math.pow(-2*f+2,3)/2,d=this.shadowRoot?.querySelector("zn-flow-canvas"),h=performance.now(),m=f=>{let b=Math.min(1,(f-h)/s);if(b>=1){this._untangleRaf=null,a();return}let g=l(b);r.forEach(({n:v,from:y,to:_})=>{v.x=Math.round(y.x+(_.x-y.x)*g),v.y=Math.round(y.y+(_.y-y.y)*g)}),d?.requestUpdate(),this._untangleRaf=requestAnimationFrame(m)};this._untangleRaf=requestAnimationFrame(m)};this._commit=()=>{this._pruneConnections(),this._state={nodes:[...this._state.nodes],connections:[...this._state.connections],notes:[...this._state.notes]},this._restorePrompt=null,this.emit("zn-flow-change",{detail:{state:this.getState()}})};this._onBranchPick=t=>{this._select(null),this._sideCollapsed=!1,this._selectedBranch={nodeId:t.detail.nodeId,port:t.detail.port}};this._onBranchDelete=t=>{let r=this._state.nodes.find(a=>a.id===t.detail.nodeId);if(!r||this.registry.get(r.type)?.fixedOutputs)return;this._pushHistory();let n=vr(r,this.registry.get(r.type)).filter(a=>a.id!==t.detail.port);r.outputs=n.length?n:[{...im}],this._state.connections=this._state.connections.filter(a=>!(a.source.node===r.id&&a.source.port===t.detail.port)),this._selectedBranch?.nodeId===t.detail.nodeId&&this._selectedBranch.port===t.detail.port&&(this._selectedBranch=null),this._commit()};this._onSelect=t=>{if(t.detail.nodeId===null&&this._movingNodeId){this._movingNodeId=null;return}this._select(t.detail.nodeId)};this._onNodeAction=t=>{let{nodeId:r,action:n}=t.detail;n==="delete"?this._deleteNode(r):n==="duplicate"?this._duplicateNode(r):n==="move"&&(this._movingNodeId=r)};this._onInteractionStart=()=>{this._pushHistory()};this._onOutputAssign=t=>{this._addNodeAtOutput(t.detail.nodeId,t.detail.port,t.detail.type)};this._onLinkAssign=t=>{this._linkNodeAtOutput(t.detail.nodeId,t.detail.port,t.detail.targetId)};this._onWirePick=t=>{this._picker={x:t.detail.clientX,y:t.detail.clientY,target:{kind:"wire",connectionId:t.detail.connectionId}}};this._onWireAssign=t=>{this._insertNodeOnWire(t.detail.connectionId,t.detail.type)};this._onOutputMoveTarget=t=>{let r=this._movingNodeId;if(this._movingNodeId=null,!r)return;let n=t.detail.nodeId;if(n===r)return;let a=this._state.nodes.find(b=>b.id===n),s=this._state.nodes.find(b=>b.id===r);if(!a||!s)return;let l=ip(s,this.registry.get(s.type));if(l===null||this._refusesBranch(a,t.detail.port))return;this._pushHistory();let d=this._ensureOutput(a,t.detail.port);this._ensureBranchLabel(a,d),this._state.connections=this._state.connections.filter(b=>b.target.node!==r);let h={id:this._id("conn"),source:{node:n,port:d},target:{node:r,port:l}};this._state.connections.push(h);let m=this._positionBelowOutput(a,d),f=this._freePosition(m.x,m.y,r);s.x=f.x,s.y=f.y,this.emit("zn-flow-connect",{detail:{connection:h}}),this._commit()};this._onAddNote=()=>{this._pushHistory(),this._state.notes.push({id:this._id("note"),x:80,y:80,text:""}),this._commit()};this._onNoteChange=t=>{let r=this._state.notes.find(n=>n.id===t.detail.noteId);r&&(r.text=t.detail.text,this._commit())};this._onNoteDelete=t=>{this._pushHistory(),this._state.notes=this._state.notes.filter(r=>r.id!==t.detail.noteId),this._commit()};this._onDragEnd=()=>{this._draggingType=null};this._onStepDrag=t=>{this._draggingType=t.detail.type};this._onCanvasDragOver=t=>{t.preventDefault()};this._onCanvasDrop=t=>{let r=t.dataTransfer?.getData(W4);if(!r)return;t.preventDefault();let a=this.shadowRoot?.querySelector("zn-flow-canvas")?.screenToCanvas(t.clientX,t.clientY)??{x:t.clientX,y:t.clientY};this._addNode(r,a.x-$t/2,a.y-Cr/2)}}get _listeners(){return[["flow-node-select",this._onSelect],["flow-node-action",this._onNodeAction],["flow-interaction-start",this._onInteractionStart],["flow-change-commit",this._commit],["flow-output-assign",this._onOutputAssign],["flow-link-assign",this._onLinkAssign],["flow-output-move-target",this._onOutputMoveTarget],["flow-wire-pick",this._onWirePick],["flow-wire-assign",this._onWireAssign],["flow-branch-pick",this._onBranchPick],["flow-branch-delete",this._onBranchDelete],["flow-step-drag",this._onStepDrag],["flow-step-drag-end",this._onDragEnd],["flow-undo",this.undo],["flow-redo",this.redo],["flow-untangle",this.untangle],["flow-add-note",this._onAddNote],["flow-note-change",this._onNoteChange],["flow-note-delete",this._onNoteDelete]]}connectedCallback(){super.connectedCallback(),this._listeners.forEach(([t,r])=>this.addEventListener(t,r)),document.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){this._listeners.forEach(([t,r])=>this.removeEventListener(t,r)),document.removeEventListener("keydown",this._onKeyDown),this._cancelUntangle(),this._stopAutoSave(),this._justSavedTimer!==null&&(clearTimeout(this._justSavedTimer),this._justSavedTimer=null),super.disconnectedCallback()}get _autoSaveKey(){return`zn-flow-builder:${this.id||this.heading||"flow"}`}_stopAutoSave(){this._autoSaveTimer!==null&&(clearInterval(this._autoSaveTimer),this._autoSaveTimer=null),this._statusTimer!==null&&(clearInterval(this._statusTimer),this._statusTimer=null)}_restartAutoSave(){if(this._stopAutoSave(),this.autoSave===null)return;let t=this._readAutoSave();t&&(this._lastSavedAt=t.savedAt),this._autoSaveTimer=window.setInterval(this._autoSaveTick,this.autoSave*6e4),this._statusTimer=window.setInterval(()=>this._statusNow=Date.now(),3e4)}_readAutoSave(){try{let t=localStorage.getItem(this._autoSaveKey);if(!t)return null;let r=JSON.parse(t);return!r.state||Date.now()-r.savedAt>oP?(localStorage.removeItem(this._autoSaveKey),null):r}catch{return null}}restoreAutoSave(){let t=this._readAutoSave();if(!t)return!1;this._restoring=!0;try{this.setState(t.state)}finally{this._restoring=!1}return this._restorePrompt=null,!0}_offerRestoreIfNewer(){if(this.autoSave===null||this._restoring)return;let t=this._readAutoSave();this._restorePrompt=t&&JSON.stringify(t.state)!==JSON.stringify(this._state)?{savedAt:t.savedAt}:null}willUpdate(t){t.has("nodeTypes")&&this.nodeTypes?.length&&this.registry.registerAll(this.nodeTypes),t.has("autoSave")&&this._restartAutoSave(),super.willUpdate(t)}firstUpdated(t){super.firstUpdated(t),this._registerSlottedTypes()}static _parsePorts(t){if(t===null)return;let r=t.trim();if(r==="")return[];try{let n=JSON.parse(r);return Array.isArray(n)?n.map(a=>typeof a=="string"?{id:a}:a):void 0}catch{return}}static _parseFilterOptions(t){if(t===null)return;let r=t.trim();if(r!==""){if(r.startsWith("["))try{let n=JSON.parse(r);return Array.isArray(n)?n.map(a=>typeof a=="string"?{value:a}:a):void 0}catch{return}return r.split(",").map(n=>n.trim()).filter(Boolean).map(n=>({value:n}))}}static _nestedFilterOptions(t,r){let n=Array.from(t.querySelectorAll(`:scope > ${r}`));if(n.length)return n.map(a=>{let s=a.textContent?.trim()??"",l=a.getAttribute("value");return l!==null&&s?{value:l,label:s}:{value:l??s}})}static _filterFieldFromEl(t){let r=t.getAttribute("id");if(!r)return null;let n=t.getAttribute("value"),a=t.getAttribute("type");return{id:r,label:t.getAttribute("label")??void 0,type:a??void 0,operators:Ae._nestedFilterOptions(t,"zn-flow-operator")??Ae._parseFilterOptions(t.getAttribute("operators")),options:Ae._nestedFilterOptions(t,"zn-flow-option")??Ae._parseFilterOptions(t.getAttribute("options")),units:Ae._nestedFilterOptions(t,"zn-flow-unit")??Ae._parseFilterOptions(t.getAttribute("units")),suffix:t.getAttribute("suffix")??void 0,placeholder:t.getAttribute("placeholder")??void 0,value:n===null?void 0:a==="number"?Number(n):n}}static _parseBranchFilters(t){let r=s=>s?.map(l=>typeof l=="string"?{value:l}:l),n=t.getAttribute("branch-filters");if(n)try{let s=JSON.parse(n);if(Array.isArray(s))return s.map(l=>({...l,fields:(l.fields??[]).map(d=>({...d,...d.operators?{operators:r(d.operators)}:{},...d.options?{options:r(d.options)}:{},...d.units?{units:r(d.units)}:{}}))}))}catch{}let a=Array.from(t.querySelectorAll(":scope > zn-flow-filter")).map(s=>{let l=s.getAttribute("id")??s.getAttribute("label");return l?{id:l,label:s.getAttribute("label")??l,description:s.getAttribute("description")??void 0,fields:Array.from(s.querySelectorAll(":scope > zn-flow-filter-field")).map(d=>Ae._filterFieldFromEl(d)).filter(d=>!!d)}:null}).filter(s=>!!s);return a.length?a:void 0}_typeFromStep(t){let r=t.getAttribute("type");if(!r)return null;let n=Array.from(t.childNodes).filter(a=>a.nodeType===Node.TEXT_NODE).map(a=>a.textContent??"").join("").trim();return{type:r,label:t.getAttribute("label")??(n||r),group:t.getAttribute("group")??"action",category:t.getAttribute("category")??void 0,icon:t.getAttribute("icon")??void 0,iconLibrary:t.getAttribute("icon-library")??void 0,color:t.getAttribute("color")??void 0,description:t.getAttribute("description")??void 0,inputs:Ae._parsePorts(t.getAttribute("inputs")),outputs:Ae._parsePorts(t.getAttribute("outputs")),fixedOutputs:t.hasAttribute("fixed-outputs"),branchFilters:Ae._parseBranchFilters(t)}}registerNodeType(t){return this.registry.register(t),this.requestUpdate(),this}registerNodeTypes(t){return this.registry.registerAll(t),this.requestUpdate(),this}getState(){return this._clone(this._state)}setState(t){this._cancelUntangle(),this._state=t,this._history=[],this._redo=[],this._selectedNodeId=null,this._configRevision++,this._offerRestoreIfNewer()}get value(){return JSON.stringify(this._state)}set value(t){try{let r=JSON.parse(t);this.setState({nodes:r.nodes??[],connections:r.connections??[],notes:r.notes??[]})}catch{}}toJSON(){return this.getState()}_cancelUntangle(){this._untangleRaf!==null&&(cancelAnimationFrame(this._untangleRaf),this._untangleRaf=null),this._untangleSettle?.(),this._untangleSettle=null}_clone(t){return JSON.parse(JSON.stringify(t))}_pushHistory(){this._history.push(this._clone(this._state)),this._history.length>iP&&this._history.shift(),this._redo=[]}_pruneConnections(){let t=new Map(this._state.nodes.map(r=>[r.id,r]));this._state.connections=this._state.connections.filter(r=>{let n=t.get(r.source.node),a=t.get(r.target.node);if(!n||!a)return!1;let s=vr(n,this.registry.get(n.type)).some(d=>d.id===r.source.port),l=Oa(a,this.registry.get(a.type)).some(d=>d.id===r.target.port);return s&&l})}_syncSelection(){this._selectedNodeId&&!this._state.nodes.some(t=>t.id===this._selectedNodeId)&&(this._selectedNodeId=null),this._selectedBranch&&!this._branchSelection()&&(this._selectedBranch=null)}_branchSelection(){if(!this._selectedBranch)return null;let t=this._state.nodes.find(n=>n.id===this._selectedBranch.nodeId);if(!t)return null;let r=vr(t,this.registry.get(t.type)).find(n=>n.id===this._selectedBranch.port);return r?{node:t,port:r}:null}_id(t){return`${t}-${Date.now().toString(36)}-${++this._seq}`}_freePosition(t,r,n){let a=new Set(this._state.connections.filter(d=>n&&d.target.node===n&&d.source.node!==n).map(d=>d.source.node)),s=(d,h)=>{let m=n?this._state.nodes.map(b=>b.id===n?{...b,x:d,y:h}:b):this._state.nodes,f=b=>this.registry.get(b);return m.some(b=>b.id!==n&&T4({x:d,y:h},b,f,m,this._state.connections))?!0:[...a].some(b=>{let g=m.find(v=>v.id===b);return!!g&&am(g,f,m,this._state.connections)})};if(t=ii(t),r=ii(r),!s(t,r))return{x:t,y:r};let l=br*2;for(let d=1;d<40;d++)for(let h=-d;h<=d;h++)for(let m=-d;m<=d;m++)if(Math.max(Math.abs(m),Math.abs(h))===d&&!s(t+m*l,r+h*l))return{x:t+m*l,y:r+h*l};return{x:t,y:r}}_addNode(t,r,n){let a=this.registry.get(t);if(!a)return;this._pushHistory();let s=this._freePosition(r,n),l={id:this._id("node"),type:t,x:s.x,y:s.y,data:{...a.defaultData??{}}};this._state.nodes.push(l),this._select(l.id),this._commit()}_deleteNode(t){this._pushHistory(),this._state.nodes=this._state.nodes.filter(r=>r.id!==t),this._state.connections=this._state.connections.filter(r=>r.source.node!==t&&r.target.node!==t),this._selectedNodeId===t&&this._select(null),this._commit()}_duplicateNode(t){let r=this._state.nodes.find(s=>s.id===t);if(!r)return;this._pushHistory();let n=this._freePosition(r.x+br*2,r.y+br*2),a={...this._clone({nodes:[r],connections:[],notes:[]}).nodes[0],id:this._id("node"),x:n.x,y:n.y};this._state.nodes.push(a),this._select(a.id),this._commit()}_positionBelowOutput(t,r){let n=vr(t,this.registry.get(t.type)),a=Math.max(n.findIndex(l=>l.id===r),0),s=rp(t,l=>this.registry.get(l),this._state.connections)[a];return{x:Math.round(s-$t/2),y:t.y+cm}}_refusesBranch(t,r){return r===tp&&!!this.registry.get(t.type)?.fixedOutputs}_ensureOutput(t,r){if(r!==tp)return r;let n=vr(t,this.registry.get(t.type)).map(s=>({...s})),a=this._id("branch");return n.push({id:a,label:"Branch"}),t.outputs=n,a}_ensureBranchLabel(t,r){let n=vr(t,this.registry.get(t.type)).map(s=>({...s})),a=n.find(s=>s.id===r);a&&!a.label&&(a.label="Branch",t.outputs=n)}_addNodeAtOutput(t,r,n){let a=this._state.nodes.find(b=>b.id===t),s=this.registry.get(n);if(!a||!s)return;let l=sm(s)[0]?.id;if(!l||this._refusesBranch(a,r))return;this._pushHistory(),r=this._ensureOutput(a,r),this._ensureBranchLabel(a,r);let d=this._positionBelowOutput(a,r),h=this._freePosition(d.x,d.y),m={id:this._id("node"),type:n,x:h.x,y:h.y,data:{...s.defaultData??{}}},f={id:this._id("conn"),source:{node:t,port:r},target:{node:m.id,port:l}};this._state.nodes.push(m),this._state.connections.push(f),this.emit("zn-flow-connect",{detail:{connection:f}}),this._select(m.id),this._commit()}_linkNodeAtOutput(t,r,n){let a=this._state.nodes.find(h=>h.id===t),s=this._state.nodes.find(h=>h.id===n);if(!a||!s||t===n)return;let l=ip(s,this.registry.get(s.type));if(l===null||this._refusesBranch(a,r))return;this._pushHistory(),r=this._ensureOutput(a,r),this._ensureBranchLabel(a,r);let d={id:this._id("conn"),source:{node:t,port:r},target:{node:n,port:l}};this._state.connections.push(d),this.emit("zn-flow-connect",{detail:{connection:d}}),this._select(null),this._selectedBranch={nodeId:t,port:r},this._commit()}_insertNodeOnWire(t,r){let n=this._state.connections.find(_=>_.id===t),a=this.registry.get(r);if(!n||!a)return;let s=this._state.nodes.find(_=>_.id===n.source.node),l=this._state.nodes.find(_=>_.id===n.target.node);if(!s||!l)return;let d=sm(a)[0]?.id;if(!d)return;this._pushHistory();let h=Av(a).map(_=>({..._}));h.length||h.push({id:this._id("branch")}),h[0].label||(h[0].label="Branch");let m=this._positionBelowOutput(s,n.source.port),f=m.y+cm;if(l.y<f){let _=f-l.y,E=I4(this._state,l.id);E.add(l.id),this._state.nodes.forEach(N=>{E.has(N.id)&&(N.y+=_)})}let b=this._freePosition(m.x,m.y),g={id:this._id("node"),type:r,x:b.x,y:b.y,outputs:h,data:{...a.defaultData??{}}},v=n.target.port;n.target={node:g.id,port:d};let y={id:this._id("conn"),source:{node:g.id,port:h[0].id},target:{node:l.id,port:v}};this._state.nodes.push(g),this._state.connections.push(y),this.emit("zn-flow-connect",{detail:{connection:y}}),this._select(g.id),this._commit()}_select(t){this._selectedBranch=null,t&&(this._sideCollapsed=!1),this._selectedNodeId!==t&&(this._selectedNodeId=t,this.emit("zn-flow-selection-change",{detail:{nodeId:t}}))}_onDragStart(t,r){t.dataTransfer&&(this._draggingType=r,t.dataTransfer.setData(W4,r),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(nm(),0,0))}_renderSteps(){return u`
5591
+ `}};fo.styles=k(V4),fo.dependencies={"zn-collapsible":rs},c([p()],fo.prototype,"caption",2),c([p({type:Boolean,reflect:!0})],fo.prototype,"collapsed",2);var Rv=fo;fo.define("zn-flow-step-group");var lm=class{constructor(){this.types=new Map}register(i){return this.types.set(i.type,i),this}registerAll(i){return i.forEach(t=>this.register(t)),this}get(i){return this.types.get(i)}has(i){return this.types.has(i)}all(){return Array.from(this.types.values())}byGroup(i){return this.all().filter(t=>t.group===i)}categories(i){let t=new Map;for(let r of this.byGroup(i)){let n=r.category??"",a=t.get(n)??[];a.push(r),t.set(n,a)}return t}clear(){this.types.clear()}};var U4=$t+80,cm=220,Dv=40,op=o=>o.reduce((i,t)=>i+t,0)/o.length;function j4(o,i){let t=new Map,r=o.nodes;if(!r.length)return t;let n=new Map(r.map(C=>[C.id,C])),a=new Map(r.map(C=>[C.id,[]])),s=new Map(r.map(C=>[C.id,[]]));for(let C of o.connections)!n.has(C.source.node)||!n.has(C.target.node)||(a.get(C.target.node).push(C),s.get(C.source.node).push(C));let l=Na(r,o.connections),d=new Map,h=C=>{let L=d.get(C);if(L!==void 0)return L;let M=a.get(C).filter(ie=>!l.has(ie)),Y=M.length?Math.max(...M.map(ie=>h(ie.source.node)))+1:0;return d.set(C,Y),Y};r.forEach(C=>h(C.id)),r.forEach(C=>{if(a.get(C.id).some(Y=>!l.has(Y)))return;let L=s.get(C.id).filter(Y=>!l.has(Y));if(!L.length)return;let M=Math.min(...L.map(Y=>d.get(Y.target.node)))-1;M>d.get(C.id)&&d.set(C.id,M)});let m=Array.from({length:Math.max(...d.values())+1},()=>[]);r.forEach(C=>m[d.get(C.id)].push(C));let f=C=>{let L=n.get(C.source.node),M=vr(L,i(L.type)),Y=Math.max(M.length,1),ie=Math.max(M.findIndex(ye=>ye.id===C.source.port),0);return Y===1?0:(ie-(Y-1)/2)*kv},b=new Map,g=C=>{let L=a.get(C.id).filter(M=>!l.has(M)&&b.has(M.source.node));return L.length?op(L.map(M=>{let Y=n.get(M.source.node),ie=vr(Y,i(Y.type)),ye=Math.max(ie.length,1),Ie=Math.max(ie.findIndex(Ve=>Ve.id===M.source.port),0);return b.get(Y.id)+(Ie+1)/(ye+1)-.5})):null},v=C=>{let L=s.get(C.id).filter(M=>!l.has(M)&&b.has(M.target.node));return L.length?op(L.map(M=>b.get(M.target.node))):null};m[0].sort((C,L)=>C.x-L.x).forEach((C,L)=>b.set(C.id,L));for(let C=1;C<m.length;C++)m[C].sort((L,M)=>(g(L)??0)-(g(M)??0)).forEach((L,M)=>b.set(L.id,M));for(let C=1;C<m.length;C++){let L=M=>g(M)??v(M)??0;m[C].sort((M,Y)=>L(M)-L(Y)).forEach((M,Y)=>b.set(M.id,Y))}let y=new Map,_=(C,L)=>{let M=C.map(Ie=>L(Ie)??y.get(Ie.id)??0),Y=-1/0,ie=M.map(Ie=>Y=Math.max(Ie,Y+U4)),ye=op(ie.map((Ie,Ve)=>Ie-M[Ve]));C.forEach((Ie,Ve)=>y.set(Ie.id,ie[Ve]-ye))},E=C=>{let L=a.get(C.id).filter(M=>!l.has(M)&&y.has(M.source.node));return L.length?op(L.map(M=>y.get(M.source.node)+f(M))):null},N=C=>{let L=s.get(C.id).filter(M=>!l.has(M)&&y.has(M.target.node));return L.length?op(L.map(M=>y.get(M.target.node)-f(M))):null};m[0].forEach((C,L)=>y.set(C.id,L*U4));for(let C=1;C<m.length;C++)_(m[C],E);for(let C=m.length-2;C>=0;C--)_(m[C],N);for(let C=1;C<m.length;C++)_(m[C],E);let G=[...y.values()].filter(Number.isFinite),R=G.length?Math.min(...G):0;return r.forEach(C=>{let L=y.get(C.id);t.set(C.id,{x:ii(Number.isFinite(L)?L-R+Dv:Dv),y:Dv+d.get(C.id)*cm})}),t}var G4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;width:100%;height:100%;min-height:480px;color:rgb(var(--zn-text))}.builder{--steps-width:343px;--side-width:500px;display:grid;grid-template-columns:var(--steps-width) minmax(0,1fr) var(--side-width);grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;transition:grid-template-columns 0.2s ease}.builder--steps-collapsed{--steps-width:0px}.builder--steps-collapsed .steps{border-right:none}.builder--side-collapsed{--side-width:0px}.builder--side-collapsed .sidebar,.builder--side-collapsed .inspector{padding:0;border-left:none}.header{grid-row:1;grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid rgb(var(--zn-border-color));background:rgb(var(--zn-panel))}.header[hidden]{display:none}.header__group{display:flex;align-items:center;gap:8px}.steps,.inspector,.sidebar{grid-row:2;display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;background:rgb(var(--zn-panel))}.canvas-cell{grid-row:2;position:relative;min-width:0;min-height:0}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.panel-toggle--right{right:-12px}.panel-toggle--right.panel-toggle--tucked{right:8px}.steps{--zn-active-nav-background:var(--zn-panel);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;border-right:1px solid rgb(var(--zn-border-color))}.steps-content{flex:1;min-height:0;display:flex;flex-direction:column}.steps-panel{display:flex;flex-direction:column;min-height:0;height:100%}.steps-hint{margin:0;padding:12px var(--zn-base-gap);font-size:0.8125rem;line-height:1.4;color:rgb(var(--zn-color-muted-text))}.steps-scroll ::-webkit-scrollbar{width:5px;height:5px}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-track{background:transparent}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.steps-scroll{}.steps-scroll ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.steps-scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:16px}.steps-scroll zn-flow-step-group{display:block;border-top:1px solid rgb(var(--zn-border-color))}.steps-uncategorized{padding:8px var(--zn-base-gap)}.steps-empty{padding:16px var(--zn-base-gap);font-size:0.8125rem;color:rgb(var(--zn-color-muted-text))}.declarations{display:none}.title-block{padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.title-block .heading{font-size:0.9375rem;font-weight:600}.title-block .subheading{margin-top:2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.search{padding:12px 12px 8px}.step{display:flex;align-items:center;gap:10px;padding:8px 10px;margin-bottom:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;font-size:0.8125rem;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease}.step:hover{border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}.step:active{cursor:grabbing}.step__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.step__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector{border-left:1px solid rgb(var(--zn-border-color));animation:inspector-in 0.18s ease}.inspector-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;height:100%;padding:24px;text-align:center;color:rgb(var(--zn-color-muted-text));font-size:0.8125rem}.inspector-head{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.inspector-head__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:8px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.inspector-head__text{flex:1;min-width:0}.inspector-head__title-row{display:flex;align-items:center;gap:6px;min-width:0}.inspector-head__title-row .inspector-head__title{min-width:0}.inspector-head__title{font-size:0.875rem;font-weight:600}.inspector-head__title,.inspector-head__type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector-head__type{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-body ::-webkit-scrollbar{width:5px;height:5px}.inspector-body{}.inspector-body ::-webkit-scrollbar-track{background:transparent}.inspector-body{}.inspector-body ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.inspector-body{}.inspector-body ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.inspector-body{display:flex;flex-direction:column;gap:14px;flex:1;min-height:0;overflow-y:auto;padding:16px}.inspector-hint{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-loop-tag{display:inline-flex;align-items:center;flex:0 0 auto;gap:3px;padding:2px 8px;border-radius:999px;font-size:0.6875rem;font-weight:600;line-height:1;color:rgb(var(--zn-color-warning));background:color-mix(in srgb,rgb(var(--zn-color-warning)) 14%,transparent)}.inspector-close{display:flex;align-items:center;justify-content:center;flex:0 0 auto;margin-left:auto;width:28px;height:28px;padding:0;border-radius:6px;color:rgb(var(--zn-color-muted-text));background:transparent;cursor:pointer}.inspector-close:hover{background:rgb(var(--zn-color-tab));color:rgb(var(--zn-text))}@keyframes inspector-in{from{transform:translateX(32px);opacity:0.3}to{transform:translateX(0);opacity:1}}.sidebar ::-webkit-scrollbar{width:5px;height:5px}.sidebar{}.sidebar ::-webkit-scrollbar-track{background:transparent}.sidebar{}.sidebar ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.sidebar{}.sidebar ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.sidebar{border-left:1px solid rgb(var(--zn-border-color));overflow-y:auto;padding:16px}.sidebar-section__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:0.8125rem;font-weight:600}.sidebar-count{min-width:20px;padding:0 6px;font-size:0.75rem;line-height:18px;text-align:center;border-radius:9px;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-color-tab))}.sidebar-empty{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.sidebar-error{display:flex;align-items:center;gap:8px;width:100%;margin-bottom:6px;padding:8px 10px;font-size:0.8125rem;text-align:left;color:rgb(var(--zn-color-error));background:color-mix(in srgb,rgb(var(--zn-color-error)) 7%,transparent);border:1px solid color-mix(in srgb,rgb(var(--zn-color-error)) 25%,transparent);border-radius:8px;cursor:pointer}.picker{position:fixed;z-index:21;width:220px;max-height:320px;overflow-y:auto;padding:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 6px 24px rgba(var(--zn-shadow),0.5)}.picker ::-webkit-scrollbar{width:5px;height:5px}.picker{}.picker ::-webkit-scrollbar-track{background:transparent}.picker{}.picker ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}.picker{}.picker ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}.picker-backdrop{position:fixed;inset:0;z-index:20}.picker-group{padding:8px 8px 4px;font-size:0.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;color:rgb(var(--zn-color-muted-text))}.picker-item{display:flex;align-items:center;gap:10px;width:100%;padding:7px 8px;font-size:0.8125rem;text-align:left;background:transparent;border-radius:6px;cursor:pointer}.picker-item:hover{background:rgb(var(--zn-color-tab))}.picker-item__icon{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:26px;height:26px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.picker-empty{margin:0;padding:10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.save-status{position:absolute;left:16px;bottom:16px;z-index:5;display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);pointer-events:none;transition:color 0.15s ease,border-color 0.15s ease}.save-status--saved{color:rgb(var(--zn-color-success));border-color:color-mix(in srgb,rgb(var(--zn-color-success)) 45%,transparent)}.restore-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;flex-wrap:wrap;justify-content:center;gap:8px;width:-moz-max-content;width:max-content;max-width:calc(100% - 32px);padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.restore-banner span{flex:1 1 auto;min-width:min(160px,100%)}.restore-banner button{flex:0 0 auto;padding:3px 10px;font-size:0.75rem;font-weight:600;border-radius:6px;cursor:pointer}.restore-banner__restore{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary))}.restore-banner__restore:hover{filter:brightness(1.1)}.restore-banner__dismiss{color:rgb(var(--zn-color-muted-text));background:transparent}.restore-banner__dismiss:hover{background:rgb(var(--zn-color-tab))}.move-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.move-banner button{padding:2px 8px;font-size:0.75rem;font-weight:600;color:rgb(var(--zn-panel));background:rgba(255,255,255,0.2);border-radius:6px;cursor:pointer}`;var oP=50,W4=nc,aP=5,sP=1440*60*1e3;function K4(o){let i=Math.floor(o/1e3);if(i<10)return"just now";if(i<60)return`${i}s ago`;let t=Math.floor(i/60);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var Y4=[{group:"entrypoint",label:"Entrypoint"},{group:"trigger",label:"Triggers"},{group:"action",label:"Actions"},{group:"rule",label:"Rules"}],Ae=class Ae extends T{constructor(){super(...arguments);this.nodeTypes=[];this.heading="";this.subheading="";this.errorNodes=[];this.autoSave=null;this.entrypointsHint="";this.triggersHint="";this.actionsHint="";this.rulesHint="";this.registry=new lm;this._state=M4();this._selectedNodeId=null;this._selectedBranch=null;this._search="";this._activeGroup=null;this._hasSlot=new te(this,"header-left","header-right");this._stepsCollapsed=!1;this._sideCollapsed=!1;this._movingNodeId=null;this._picker=null;this._draggingType=null;this._history=[];this._redo=[];this._seq=0;this._untangleRaf=null;this._untangleSettle=null;this._configRevision=0;this._autoSaveTimer=null;this._statusTimer=null;this._justSavedTimer=null;this._restoring=!1;this._lastSavedAt=null;this._justSaved=!1;this._statusNow=Date.now();this._restorePrompt=null;this._autoSaveTick=()=>{if(this._restorePrompt)return;let t=this.getState();if(!(!t.nodes.length&&!t.connections.length&&!t.notes.length))try{localStorage.setItem(this._autoSaveKey,JSON.stringify({savedAt:Date.now(),state:t})),this._lastSavedAt=Date.now(),this._justSaved=!0,this._justSavedTimer!==null&&clearTimeout(this._justSavedTimer),this._justSavedTimer=window.setTimeout(()=>this._justSaved=!1,2500)}catch{}};this._onKeyDown=t=>{t.key==="Escape"&&(this._movingNodeId||this._picker||this._selectedBranch)&&(this._movingNodeId=null,this._picker=null,this._selectedBranch=null)};this._registerSlottedTypes=()=>{let t=!1;this.querySelectorAll("zn-flow-step").forEach(r=>{let n=this._typeFromStep(r);n&&!this.registry.has(n.type)&&(this.registry.register(n),t=!0)}),t&&this.requestUpdate()};this.undo=()=>{let t=this._history.pop();t&&(this._cancelUntangle(),this._redo.push(this._clone(this._state)),this._state=t,this._configRevision++,this._syncSelection(),this._commit())};this.redo=()=>{let t=this._redo.pop();t&&(this._cancelUntangle(),this._history.push(this._clone(this._state)),this._state=t,this._configRevision++,this._syncSelection(),this._commit())};this.untangle=()=>{if(!this._state.nodes.length)return;this._cancelUntangle(),this._pushHistory();let t=j4(this._state,f=>this.registry.get(f)),r=this._state.nodes.map(f=>({n:f,from:{x:f.x,y:f.y},to:t.get(f.id)})).filter(f=>!!f.to),n=()=>{r.forEach(({n:f,to:b})=>{f.x=b.x,f.y=b.y})},a=()=>{this._untangleSettle=null,n(),this._commit()};if(this._untangleSettle=n,window.matchMedia("(prefers-reduced-motion: reduce)").matches){a();return}let s=500,l=f=>f<.5?4*f*f*f:1-Math.pow(-2*f+2,3)/2,d=this.shadowRoot?.querySelector("zn-flow-canvas"),h=performance.now(),m=f=>{let b=Math.min(1,(f-h)/s);if(b>=1){this._untangleRaf=null,a();return}let g=l(b);r.forEach(({n:v,from:y,to:_})=>{v.x=Math.round(y.x+(_.x-y.x)*g),v.y=Math.round(y.y+(_.y-y.y)*g)}),d?.requestUpdate(),this._untangleRaf=requestAnimationFrame(m)};this._untangleRaf=requestAnimationFrame(m)};this._commit=()=>{this._pruneConnections(),this._state={nodes:[...this._state.nodes],connections:[...this._state.connections],notes:[...this._state.notes]},this._restorePrompt=null,this.emit("zn-flow-change",{detail:{state:this.getState()}})};this._onBranchPick=t=>{this._select(null),this._sideCollapsed=!1,this._selectedBranch={nodeId:t.detail.nodeId,port:t.detail.port}};this._onBranchDelete=t=>{let r=this._state.nodes.find(a=>a.id===t.detail.nodeId);if(!r||this.registry.get(r.type)?.fixedOutputs)return;this._pushHistory();let n=vr(r,this.registry.get(r.type)).filter(a=>a.id!==t.detail.port);r.outputs=n.length?n:[{...im}],this._state.connections=this._state.connections.filter(a=>!(a.source.node===r.id&&a.source.port===t.detail.port)),this._selectedBranch?.nodeId===t.detail.nodeId&&this._selectedBranch.port===t.detail.port&&(this._selectedBranch=null),this._commit()};this._onSelect=t=>{if(t.detail.nodeId===null&&this._movingNodeId){this._movingNodeId=null;return}this._select(t.detail.nodeId)};this._onNodeAction=t=>{let{nodeId:r,action:n}=t.detail;n==="delete"?this._deleteNode(r):n==="duplicate"?this._duplicateNode(r):n==="move"&&(this._movingNodeId=r)};this._onInteractionStart=()=>{this._pushHistory()};this._onOutputAssign=t=>{this._addNodeAtOutput(t.detail.nodeId,t.detail.port,t.detail.type)};this._onLinkAssign=t=>{this._linkNodeAtOutput(t.detail.nodeId,t.detail.port,t.detail.targetId)};this._onWirePick=t=>{this._picker={x:t.detail.clientX,y:t.detail.clientY,target:{kind:"wire",connectionId:t.detail.connectionId}}};this._onWireAssign=t=>{this._insertNodeOnWire(t.detail.connectionId,t.detail.type)};this._onOutputMoveTarget=t=>{let r=this._movingNodeId;if(this._movingNodeId=null,!r)return;let n=t.detail.nodeId;if(n===r)return;let a=this._state.nodes.find(b=>b.id===n),s=this._state.nodes.find(b=>b.id===r);if(!a||!s)return;let l=ip(s,this.registry.get(s.type));if(l===null||this._refusesBranch(a,t.detail.port))return;this._pushHistory();let d=this._ensureOutput(a,t.detail.port);this._ensureBranchLabel(a,d),this._state.connections=this._state.connections.filter(b=>b.target.node!==r);let h={id:this._id("conn"),source:{node:n,port:d},target:{node:r,port:l}};this._state.connections.push(h);let m=this._positionBelowOutput(a,d),f=this._freePosition(m.x,m.y,r);s.x=f.x,s.y=f.y,this.emit("zn-flow-connect",{detail:{connection:h}}),this._commit()};this._onAddNote=()=>{this._pushHistory(),this._state.notes.push({id:this._id("note"),x:80,y:80,text:""}),this._commit()};this._onNoteChange=t=>{let r=this._state.notes.find(n=>n.id===t.detail.noteId);r&&(r.text=t.detail.text,this._commit())};this._onNoteDelete=t=>{this._pushHistory(),this._state.notes=this._state.notes.filter(r=>r.id!==t.detail.noteId),this._commit()};this._onDragEnd=()=>{this._draggingType=null};this._onStepDrag=t=>{this._draggingType=t.detail.type};this._onCanvasDragOver=t=>{t.preventDefault()};this._onCanvasDrop=t=>{let r=t.dataTransfer?.getData(W4);if(!r)return;t.preventDefault();let a=this.shadowRoot?.querySelector("zn-flow-canvas")?.screenToCanvas(t.clientX,t.clientY)??{x:t.clientX,y:t.clientY};this._addNode(r,a.x-$t/2,a.y-Cr/2)}}get _listeners(){return[["flow-node-select",this._onSelect],["flow-node-action",this._onNodeAction],["flow-interaction-start",this._onInteractionStart],["flow-change-commit",this._commit],["flow-output-assign",this._onOutputAssign],["flow-link-assign",this._onLinkAssign],["flow-output-move-target",this._onOutputMoveTarget],["flow-wire-pick",this._onWirePick],["flow-wire-assign",this._onWireAssign],["flow-branch-pick",this._onBranchPick],["flow-branch-delete",this._onBranchDelete],["flow-step-drag",this._onStepDrag],["flow-step-drag-end",this._onDragEnd],["flow-undo",this.undo],["flow-redo",this.redo],["flow-untangle",this.untangle],["flow-add-note",this._onAddNote],["flow-note-change",this._onNoteChange],["flow-note-delete",this._onNoteDelete]]}connectedCallback(){super.connectedCallback(),this._listeners.forEach(([t,r])=>this.addEventListener(t,r)),document.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){this._listeners.forEach(([t,r])=>this.removeEventListener(t,r)),document.removeEventListener("keydown",this._onKeyDown),this._cancelUntangle(),this._stopAutoSave(),this._justSavedTimer!==null&&(clearTimeout(this._justSavedTimer),this._justSavedTimer=null),super.disconnectedCallback()}get _autoSaveKey(){return`zn-flow-builder:${this.id||this.heading||"flow"}`}_stopAutoSave(){this._autoSaveTimer!==null&&(clearInterval(this._autoSaveTimer),this._autoSaveTimer=null),this._statusTimer!==null&&(clearInterval(this._statusTimer),this._statusTimer=null)}_restartAutoSave(){if(this._stopAutoSave(),this.autoSave===null)return;let t=this._readAutoSave();t&&(this._lastSavedAt=t.savedAt),this._autoSaveTimer=window.setInterval(this._autoSaveTick,this.autoSave*6e4),this._statusTimer=window.setInterval(()=>this._statusNow=Date.now(),3e4)}_readAutoSave(){try{let t=localStorage.getItem(this._autoSaveKey);if(!t)return null;let r=JSON.parse(t);return!r.state||Date.now()-r.savedAt>sP?(localStorage.removeItem(this._autoSaveKey),null):r}catch{return null}}restoreAutoSave(){let t=this._readAutoSave();if(!t)return!1;this._restoring=!0;try{this.setState(t.state)}finally{this._restoring=!1}return this._restorePrompt=null,!0}_offerRestoreIfNewer(){if(this.autoSave===null||this._restoring)return;let t=this._readAutoSave();this._restorePrompt=t&&JSON.stringify(t.state)!==JSON.stringify(this._state)?{savedAt:t.savedAt}:null}willUpdate(t){t.has("nodeTypes")&&this.nodeTypes?.length&&this.registry.registerAll(this.nodeTypes),t.has("autoSave")&&this._restartAutoSave(),super.willUpdate(t)}firstUpdated(t){super.firstUpdated(t),this._registerSlottedTypes()}static _parsePorts(t){if(t===null)return;let r=t.trim();if(r==="")return[];try{let n=JSON.parse(r);return Array.isArray(n)?n.map(a=>typeof a=="string"?{id:a}:a):void 0}catch{return}}static _parseFilterOptions(t){if(t===null)return;let r=t.trim();if(r!==""){if(r.startsWith("["))try{let n=JSON.parse(r);return Array.isArray(n)?n.map(a=>typeof a=="string"?{value:a}:a):void 0}catch{return}return r.split(",").map(n=>n.trim()).filter(Boolean).map(n=>({value:n}))}}static _nestedFilterOptions(t,r){let n=Array.from(t.querySelectorAll(`:scope > ${r}`));if(n.length)return n.map(a=>{let s=a.textContent?.trim()??"",l=a.getAttribute("value");return l!==null&&s?{value:l,label:s}:{value:l??s}})}static _filterFieldFromEl(t){let r=t.getAttribute("id");if(!r)return null;let n=t.getAttribute("value"),a=t.getAttribute("type");return{id:r,label:t.getAttribute("label")??void 0,type:a??void 0,operators:Ae._nestedFilterOptions(t,"zn-flow-operator")??Ae._parseFilterOptions(t.getAttribute("operators")),options:Ae._nestedFilterOptions(t,"zn-flow-option")??Ae._parseFilterOptions(t.getAttribute("options")),units:Ae._nestedFilterOptions(t,"zn-flow-unit")??Ae._parseFilterOptions(t.getAttribute("units")),suffix:t.getAttribute("suffix")??void 0,placeholder:t.getAttribute("placeholder")??void 0,value:n===null?void 0:a==="number"?Number(n):n}}static _parseBranchFilters(t){let r=s=>s?.map(l=>typeof l=="string"?{value:l}:l),n=t.getAttribute("branch-filters");if(n)try{let s=JSON.parse(n);if(Array.isArray(s))return s.map(l=>({...l,fields:(l.fields??[]).map(d=>({...d,...d.operators?{operators:r(d.operators)}:{},...d.options?{options:r(d.options)}:{},...d.units?{units:r(d.units)}:{}}))}))}catch{}let a=Array.from(t.querySelectorAll(":scope > zn-flow-filter")).map(s=>{let l=s.getAttribute("id")??s.getAttribute("label");return l?{id:l,label:s.getAttribute("label")??l,description:s.getAttribute("description")??void 0,fields:Array.from(s.querySelectorAll(":scope > zn-flow-filter-field")).map(d=>Ae._filterFieldFromEl(d)).filter(d=>!!d)}:null}).filter(s=>!!s);return a.length?a:void 0}_typeFromStep(t){let r=t.getAttribute("type");if(!r)return null;let n=Array.from(t.childNodes).filter(a=>a.nodeType===Node.TEXT_NODE).map(a=>a.textContent??"").join("").trim();return{type:r,label:t.getAttribute("label")??(n||r),group:t.getAttribute("group")??"action",category:t.getAttribute("category")??void 0,icon:t.getAttribute("icon")??void 0,iconLibrary:t.getAttribute("icon-library")??void 0,color:t.getAttribute("color")??void 0,description:t.getAttribute("description")??void 0,inputs:Ae._parsePorts(t.getAttribute("inputs")),outputs:Ae._parsePorts(t.getAttribute("outputs")),fixedOutputs:t.hasAttribute("fixed-outputs"),branchFilters:Ae._parseBranchFilters(t)}}registerNodeType(t){return this.registry.register(t),this.requestUpdate(),this}registerNodeTypes(t){return this.registry.registerAll(t),this.requestUpdate(),this}getState(){return this._clone(this._state)}setState(t){this._cancelUntangle(),this._state=t,this._history=[],this._redo=[],this._selectedNodeId=null,this._configRevision++,this._offerRestoreIfNewer()}get value(){return JSON.stringify(this._state)}set value(t){try{let r=JSON.parse(t);this.setState({nodes:r.nodes??[],connections:r.connections??[],notes:r.notes??[]})}catch{}}toJSON(){return this.getState()}_cancelUntangle(){this._untangleRaf!==null&&(cancelAnimationFrame(this._untangleRaf),this._untangleRaf=null),this._untangleSettle?.(),this._untangleSettle=null}_clone(t){return JSON.parse(JSON.stringify(t))}_pushHistory(){this._history.push(this._clone(this._state)),this._history.length>oP&&this._history.shift(),this._redo=[]}_pruneConnections(){let t=new Map(this._state.nodes.map(r=>[r.id,r]));this._state.connections=this._state.connections.filter(r=>{let n=t.get(r.source.node),a=t.get(r.target.node);if(!n||!a)return!1;let s=vr(n,this.registry.get(n.type)).some(d=>d.id===r.source.port),l=Oa(a,this.registry.get(a.type)).some(d=>d.id===r.target.port);return s&&l})}_syncSelection(){this._selectedNodeId&&!this._state.nodes.some(t=>t.id===this._selectedNodeId)&&(this._selectedNodeId=null),this._selectedBranch&&!this._branchSelection()&&(this._selectedBranch=null)}_branchSelection(){if(!this._selectedBranch)return null;let t=this._state.nodes.find(n=>n.id===this._selectedBranch.nodeId);if(!t)return null;let r=vr(t,this.registry.get(t.type)).find(n=>n.id===this._selectedBranch.port);return r?{node:t,port:r}:null}_id(t){return`${t}-${Date.now().toString(36)}-${++this._seq}`}_freePosition(t,r,n){let a=new Set(this._state.connections.filter(d=>n&&d.target.node===n&&d.source.node!==n).map(d=>d.source.node)),s=(d,h)=>{let m=n?this._state.nodes.map(b=>b.id===n?{...b,x:d,y:h}:b):this._state.nodes,f=b=>this.registry.get(b);return m.some(b=>b.id!==n&&T4({x:d,y:h},b,f,m,this._state.connections))?!0:[...a].some(b=>{let g=m.find(v=>v.id===b);return!!g&&am(g,f,m,this._state.connections)})};if(t=ii(t),r=ii(r),!s(t,r))return{x:t,y:r};let l=br*2;for(let d=1;d<40;d++)for(let h=-d;h<=d;h++)for(let m=-d;m<=d;m++)if(Math.max(Math.abs(m),Math.abs(h))===d&&!s(t+m*l,r+h*l))return{x:t+m*l,y:r+h*l};return{x:t,y:r}}_addNode(t,r,n){let a=this.registry.get(t);if(!a)return;this._pushHistory();let s=this._freePosition(r,n),l={id:this._id("node"),type:t,x:s.x,y:s.y,data:{...a.defaultData??{}}};this._state.nodes.push(l),this._select(l.id),this._commit()}_deleteNode(t){this._pushHistory(),this._state.nodes=this._state.nodes.filter(r=>r.id!==t),this._state.connections=this._state.connections.filter(r=>r.source.node!==t&&r.target.node!==t),this._selectedNodeId===t&&this._select(null),this._commit()}_duplicateNode(t){let r=this._state.nodes.find(s=>s.id===t);if(!r)return;this._pushHistory();let n=this._freePosition(r.x+br*2,r.y+br*2),a={...this._clone({nodes:[r],connections:[],notes:[]}).nodes[0],id:this._id("node"),x:n.x,y:n.y};this._state.nodes.push(a),this._select(a.id),this._commit()}_positionBelowOutput(t,r){let n=vr(t,this.registry.get(t.type)),a=Math.max(n.findIndex(l=>l.id===r),0),s=rp(t,l=>this.registry.get(l),this._state.connections)[a];return{x:Math.round(s-$t/2),y:t.y+cm}}_refusesBranch(t,r){return r===tp&&!!this.registry.get(t.type)?.fixedOutputs}_ensureOutput(t,r){if(r!==tp)return r;let n=vr(t,this.registry.get(t.type)).map(s=>({...s})),a=this._id("branch");return n.push({id:a,label:"Branch"}),t.outputs=n,a}_ensureBranchLabel(t,r){let n=vr(t,this.registry.get(t.type)).map(s=>({...s})),a=n.find(s=>s.id===r);a&&!a.label&&(a.label="Branch",t.outputs=n)}_addNodeAtOutput(t,r,n){let a=this._state.nodes.find(b=>b.id===t),s=this.registry.get(n);if(!a||!s)return;let l=sm(s)[0]?.id;if(!l||this._refusesBranch(a,r))return;this._pushHistory(),r=this._ensureOutput(a,r),this._ensureBranchLabel(a,r);let d=this._positionBelowOutput(a,r),h=this._freePosition(d.x,d.y),m={id:this._id("node"),type:n,x:h.x,y:h.y,data:{...s.defaultData??{}}},f={id:this._id("conn"),source:{node:t,port:r},target:{node:m.id,port:l}};this._state.nodes.push(m),this._state.connections.push(f),this.emit("zn-flow-connect",{detail:{connection:f}}),this._select(m.id),this._commit()}_linkNodeAtOutput(t,r,n){let a=this._state.nodes.find(h=>h.id===t),s=this._state.nodes.find(h=>h.id===n);if(!a||!s||t===n)return;let l=ip(s,this.registry.get(s.type));if(l===null||this._refusesBranch(a,r))return;this._pushHistory(),r=this._ensureOutput(a,r),this._ensureBranchLabel(a,r);let d={id:this._id("conn"),source:{node:t,port:r},target:{node:n,port:l}};this._state.connections.push(d),this.emit("zn-flow-connect",{detail:{connection:d}}),this._select(null),this._selectedBranch={nodeId:t,port:r},this._commit()}_insertNodeOnWire(t,r){let n=this._state.connections.find(_=>_.id===t),a=this.registry.get(r);if(!n||!a)return;let s=this._state.nodes.find(_=>_.id===n.source.node),l=this._state.nodes.find(_=>_.id===n.target.node);if(!s||!l)return;let d=sm(a)[0]?.id;if(!d)return;this._pushHistory();let h=Av(a).map(_=>({..._}));h.length||h.push({id:this._id("branch")}),h[0].label||(h[0].label="Branch");let m=this._positionBelowOutput(s,n.source.port),f=m.y+cm;if(l.y<f){let _=f-l.y,E=I4(this._state,l.id);E.add(l.id),this._state.nodes.forEach(N=>{E.has(N.id)&&(N.y+=_)})}let b=this._freePosition(m.x,m.y),g={id:this._id("node"),type:r,x:b.x,y:b.y,outputs:h,data:{...a.defaultData??{}}},v=n.target.port;n.target={node:g.id,port:d};let y={id:this._id("conn"),source:{node:g.id,port:h[0].id},target:{node:l.id,port:v}};this._state.nodes.push(g),this._state.connections.push(y),this.emit("zn-flow-connect",{detail:{connection:y}}),this._select(g.id),this._commit()}_select(t){this._selectedBranch=null,t&&(this._sideCollapsed=!1),this._selectedNodeId!==t&&(this._selectedNodeId=t,this.emit("zn-flow-selection-change",{detail:{nodeId:t}}))}_onDragStart(t,r){t.dataTransfer&&(this._draggingType=r,t.dataTransfer.setData(W4,r),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(nm(),0,0))}_renderSteps(){return u`
5592
5592
  <aside part="steps" class="steps">
5593
5593
  <div class="title-block">
5594
5594
  <div class="heading">${this.heading||"Flow Builder"}</div>
@@ -5819,7 +5819,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5819
5819
  </div>
5820
5820
  ${this._renderRightPanel()}
5821
5821
  </div>
5822
- `}};Ae.styles=k(G4),Ae.dependencies={"zn-icon":he,"zn-input":xt,"zn-tabs":Dn,"zn-navbar":ls,"zn-flow-branch-conditions":Lv,"zn-flow-canvas":B4,"zn-flow-step-group":Rv},c([p({attribute:!1})],Ae.prototype,"nodeTypes",2),c([p({reflect:!0})],Ae.prototype,"heading",2),c([p({attribute:"subheading",reflect:!0})],Ae.prototype,"subheading",2),c([p({attribute:!1})],Ae.prototype,"errorNodes",2),c([p({attribute:"auto-save",converter:{fromAttribute:t=>{if(t===null)return null;let r=parseFloat(t);return Number.isFinite(r)&&r>0?r:nP},toAttribute:t=>t===null?null:String(t)}})],Ae.prototype,"autoSave",2),c([p({attribute:"entrypoints-hint"})],Ae.prototype,"entrypointsHint",2),c([p({attribute:"triggers-hint"})],Ae.prototype,"triggersHint",2),c([p({attribute:"actions-hint"})],Ae.prototype,"actionsHint",2),c([p({attribute:"rules-hint"})],Ae.prototype,"rulesHint",2),c([D()],Ae.prototype,"_state",2),c([D()],Ae.prototype,"_selectedNodeId",2),c([D()],Ae.prototype,"_selectedBranch",2),c([D()],Ae.prototype,"_search",2),c([D()],Ae.prototype,"_activeGroup",2),c([D()],Ae.prototype,"_stepsCollapsed",2),c([D()],Ae.prototype,"_sideCollapsed",2),c([D()],Ae.prototype,"_movingNodeId",2),c([D()],Ae.prototype,"_picker",2),c([D()],Ae.prototype,"_draggingType",2),c([D()],Ae.prototype,"_lastSavedAt",2),c([D()],Ae.prototype,"_justSaved",2),c([D()],Ae.prototype,"_statusNow",2),c([D()],Ae.prototype,"_restorePrompt",2);var sc=Ae;var aP=sc;sc.define("zn-flow-builder");var X4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:flex;flex-direction:column;min-height:0;height:100%;--zn-active-nav-background:var(--zn-panel)}.search{padding:12px var(--zn-base-gap) 8px}.body{display:flex;flex-direction:column;flex:1;min-height:0}`;var Gn=class extends T{constructor(){super(...arguments);this.searchable=!0;this.searchPlaceholder="Search by step name";this._search="";this._tabObserver=new MutationObserver(()=>this._applyFilter())}connectedCallback(){super.connectedCallback(),this._tabObserver.observe(this,{subtree:!0,attributeFilter:["selected"]})}disconnectedCallback(){this._tabObserver.disconnect(),super.disconnectedCallback()}updated(t){super.updated(t),this._applyFilter()}_inActiveTab(t){return!t.closest("zn-tabs")||!!t.closest("[selected]")}_applyFilter(){let t=this._search.trim().toLowerCase();this.querySelectorAll("zn-flow-step").forEach(r=>{r.hidden=t!==""&&this._inActiveTab(r)&&!(r.textContent??"").toLowerCase().includes(t)}),this.querySelectorAll("zn-flow-step-group").forEach(r=>{let n=Array.from(r.querySelectorAll("zn-flow-step"));r.hidden=t!==""&&this._inActiveTab(r)&&n.length>0&&n.every(a=>a.hidden)})}render(){return u`
5822
+ `}};Ae.styles=k(G4),Ae.dependencies={"zn-icon":he,"zn-input":xt,"zn-tabs":Dn,"zn-navbar":ls,"zn-flow-branch-conditions":Lv,"zn-flow-canvas":B4,"zn-flow-step-group":Rv},c([p({attribute:!1})],Ae.prototype,"nodeTypes",2),c([p({reflect:!0})],Ae.prototype,"heading",2),c([p({attribute:"subheading",reflect:!0})],Ae.prototype,"subheading",2),c([p({attribute:!1})],Ae.prototype,"errorNodes",2),c([p({attribute:"auto-save",converter:{fromAttribute:t=>{if(t===null)return null;let r=parseFloat(t);return Number.isFinite(r)&&r>0?r:aP},toAttribute:t=>t===null?null:String(t)}})],Ae.prototype,"autoSave",2),c([p({attribute:"entrypoints-hint"})],Ae.prototype,"entrypointsHint",2),c([p({attribute:"triggers-hint"})],Ae.prototype,"triggersHint",2),c([p({attribute:"actions-hint"})],Ae.prototype,"actionsHint",2),c([p({attribute:"rules-hint"})],Ae.prototype,"rulesHint",2),c([D()],Ae.prototype,"_state",2),c([D()],Ae.prototype,"_selectedNodeId",2),c([D()],Ae.prototype,"_selectedBranch",2),c([D()],Ae.prototype,"_search",2),c([D()],Ae.prototype,"_activeGroup",2),c([D()],Ae.prototype,"_stepsCollapsed",2),c([D()],Ae.prototype,"_sideCollapsed",2),c([D()],Ae.prototype,"_movingNodeId",2),c([D()],Ae.prototype,"_picker",2),c([D()],Ae.prototype,"_draggingType",2),c([D()],Ae.prototype,"_lastSavedAt",2),c([D()],Ae.prototype,"_justSaved",2),c([D()],Ae.prototype,"_statusNow",2),c([D()],Ae.prototype,"_restorePrompt",2);var sc=Ae;var lP=sc;sc.define("zn-flow-builder");var X4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:flex;flex-direction:column;min-height:0;height:100%;--zn-active-nav-background:var(--zn-panel)}.search{padding:12px var(--zn-base-gap) 8px}.body{display:flex;flex-direction:column;flex:1;min-height:0}`;var Gn=class extends T{constructor(){super(...arguments);this.searchable=!0;this.searchPlaceholder="Search by step name";this._search="";this._tabObserver=new MutationObserver(()=>this._applyFilter())}connectedCallback(){super.connectedCallback(),this._tabObserver.observe(this,{subtree:!0,attributeFilter:["selected"]})}disconnectedCallback(){this._tabObserver.disconnect(),super.disconnectedCallback()}updated(t){super.updated(t),this._applyFilter()}_inActiveTab(t){return!t.closest("zn-tabs")||!!t.closest("[selected]")}_applyFilter(){let t=this._search.trim().toLowerCase();this.querySelectorAll("zn-flow-step").forEach(r=>{r.hidden=t!==""&&this._inActiveTab(r)&&!(r.textContent??"").toLowerCase().includes(t)}),this.querySelectorAll("zn-flow-step-group").forEach(r=>{let n=Array.from(r.querySelectorAll("zn-flow-step"));r.hidden=t!==""&&this._inActiveTab(r)&&n.length>0&&n.every(a=>a.hidden)})}render(){return u`
5823
5823
  ${this.searchable?u`
5824
5824
  <zn-input
5825
5825
  part="search"
@@ -5834,12 +5834,12 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5834
5834
  <div class="body">
5835
5835
  <slot></slot>
5836
5836
  </div>
5837
- `}};Gn.styles=k(X4),Gn.dependencies={"zn-input":xt},c([p({type:Boolean})],Gn.prototype,"searchable",2),c([p({attribute:"search-placeholder"})],Gn.prototype,"searchPlaceholder",2),c([D()],Gn.prototype,"_search",2);var sP=Gn;Gn.define("zn-flow-steps");var Q4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;gap:10px;padding:8px 10px;margin-bottom:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease;max-height:40px}:host(:hover){border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}:host(:active){cursor:grabbing}:host([hidden]){display:none}.item__icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.item__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item__label ::slotted(*){display:none}`;var Fr=class extends T{constructor(){super(...arguments);this.fixedOutputs=!1;this._onDragStart=t=>{!t.dataTransfer||!this.type||(t.dataTransfer.setData(nc,this.type),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(nm(),0,0),this.dispatchEvent(new CustomEvent("flow-step-drag",{bubbles:!0,composed:!0,detail:{type:this.type}})))};this._onDragEnd=()=>{this.dispatchEvent(new CustomEvent("flow-step-drag-end",{bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.addEventListener("dragstart",this._onDragStart),this.addEventListener("dragend",this._onDragEnd)}disconnectedCallback(){this.removeEventListener("dragstart",this._onDragStart),this.removeEventListener("dragend",this._onDragEnd),super.disconnectedCallback()}updated(t){super.updated(t),this.style.setProperty("--node-accent",this.color??"rgb(var(--zn-color-primary))")}render(){return u`
5837
+ `}};Gn.styles=k(X4),Gn.dependencies={"zn-input":xt},c([p({type:Boolean})],Gn.prototype,"searchable",2),c([p({attribute:"search-placeholder"})],Gn.prototype,"searchPlaceholder",2),c([D()],Gn.prototype,"_search",2);var cP=Gn;Gn.define("zn-flow-steps");var Q4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--node-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;gap:10px;padding:8px 10px;margin-bottom:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease;max-height:40px}:host(:hover){border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}:host(:active){cursor:grabbing}:host([hidden]){display:none}.item__icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;color:var(--node-accent);background:color-mix(in srgb,var(--node-accent) 14%,transparent)}.item__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item__label ::slotted(*){display:none}`;var Fr=class extends T{constructor(){super(...arguments);this.fixedOutputs=!1;this._onDragStart=t=>{!t.dataTransfer||!this.type||(t.dataTransfer.setData(nc,this.type),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(nm(),0,0),this.dispatchEvent(new CustomEvent("flow-step-drag",{bubbles:!0,composed:!0,detail:{type:this.type}})))};this._onDragEnd=()=>{this.dispatchEvent(new CustomEvent("flow-step-drag-end",{bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.addEventListener("dragstart",this._onDragStart),this.addEventListener("dragend",this._onDragEnd)}disconnectedCallback(){this.removeEventListener("dragstart",this._onDragStart),this.removeEventListener("dragend",this._onDragEnd),super.disconnectedCallback()}updated(t){super.updated(t),this.style.setProperty("--node-accent",this.color??"rgb(var(--zn-color-primary))")}render(){return u`
5838
5838
  <span part="base" class="item__icon">
5839
5839
  <zn-icon src="${this.icon??"circle"}" library="${P(this.iconLibrary)}" size="16"></zn-icon>
5840
5840
  </span>
5841
5841
  <span class="item__label"><slot>${this.label??""}</slot></span>
5842
- `}};Fr.styles=k(Q4),Fr.dependencies={"zn-icon":he},c([p()],Fr.prototype,"type",2),c([p()],Fr.prototype,"label",2),c([p()],Fr.prototype,"icon",2),c([p({attribute:"icon-library"})],Fr.prototype,"iconLibrary",2),c([p()],Fr.prototype,"color",2),c([p()],Fr.prototype,"description",2),c([p()],Fr.prototype,"inputs",2),c([p()],Fr.prototype,"outputs",2),c([p({attribute:"fixed-outputs",type:Boolean})],Fr.prototype,"fixedOutputs",2);var lP=Fr;Fr.define("zn-flow-step");function Pa(o,i){let t=i.slots??0;if(i.slotsMax===void 0)return t;let r=Math.round(Number(o.columns??NaN));return Math.min(Math.max(Number.isFinite(r)?r:t,i.slotsMin??1),i.slotsMax)}function dm(o,i){let t=Pa(o,i);if(t<1)return 0;let r=o.children?.reduce((s,l,d)=>l?d+1:s,0)??0,n=Math.ceil(r/t)||1,a=o.children?.slice((n-1)*t,n*t).filter(Boolean).length===t;return Math.min(t*(a?n+1:n),Math.floor(24/t)*t)}function sp(o,i){return Array.from({length:dm(o,i)},(t,r)=>o.children?.[r]??null)}var lc="application/x-zn-page-type",lp="application/x-zn-page-section";function Ov(){return{sections:[]}}var cP=0;function Ha(){return`s-${Date.now().toString(36)}-${(cP++).toString(36)}`}function dP(o,i,t){let r=o?.configTemplate?.content.querySelector(`[name="${CSS.escape(i)}"]`),n=CSS.escape(t);return r?.querySelector(`option[value="${n}"], zn-option[value="${n}"]`)?.textContent?.trim()??""}function Nv(o,i){let t=Object.entries(o.data).filter(r=>typeof r[1]=="string"&&r[1].trim()!=="");for(let[r,n]of t){let a=dP(i,r,n);if(a)return a}return t[0]?.[1]??i?.description??""}var ap;function Pv(){return ap||(ap=new Image,ap.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ap.decode().catch(()=>{})),ap}var pm=class{constructor(){this.types=new Map}register(i){return this.types.set(i.type,i),this}registerAll(i){return i.forEach(t=>this.register(t)),this}get(i){return this.types.get(i)}has(i){return this.types.has(i)}all(){return Array.from(this.types.values())}categories(){let i=new Map;for(let t of this.all()){let r=t.category??"",n=i.get(r)??[];n.push(t),i.set(r,n)}return i}clear(){this.types.clear()}};var J4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--section-accent:rgb(var(--zn-color-primary));display:block}:host([hidden]){display:none}.item{display:flex;align-items:center;gap:10px;padding:8px 10px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease}.item:hover{border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}:host(:active) .item{cursor:grabbing}.item__icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;background:color-mix(in srgb,var(--section-accent) 15%,transparent);color:var(--section-accent)}.item__text{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.item__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.8125rem}.item__description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;font-size:0.75rem;line-height:1.3;color:rgb(var(--zn-color-muted-text))}`;var Oi=class extends T{constructor(){super(...arguments);this._onDragStart=t=>{!t.dataTransfer||!this.type||(t.dataTransfer.setData(lc,this.type),t.dataTransfer.effectAllowed="copy")}}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.addEventListener("dragstart",this._onDragStart)}disconnectedCallback(){this.removeEventListener("dragstart",this._onDragStart),super.disconnectedCallback()}updated(t){super.updated(t),this.style.setProperty("--section-accent",this.color??"rgb(var(--zn-color-primary))")}render(){return u`
5842
+ `}};Fr.styles=k(Q4),Fr.dependencies={"zn-icon":he},c([p()],Fr.prototype,"type",2),c([p()],Fr.prototype,"label",2),c([p()],Fr.prototype,"icon",2),c([p({attribute:"icon-library"})],Fr.prototype,"iconLibrary",2),c([p()],Fr.prototype,"color",2),c([p()],Fr.prototype,"description",2),c([p()],Fr.prototype,"inputs",2),c([p()],Fr.prototype,"outputs",2),c([p({attribute:"fixed-outputs",type:Boolean})],Fr.prototype,"fixedOutputs",2);var dP=Fr;Fr.define("zn-flow-step");function Pa(o,i){let t=i.slots??0;if(i.slotsMax===void 0)return t;let r=Math.round(Number(o.columns??NaN));return Math.min(Math.max(Number.isFinite(r)?r:t,i.slotsMin??1),i.slotsMax)}function dm(o,i){let t=Pa(o,i);if(t<1)return 0;let r=o.children?.reduce((s,l,d)=>l?d+1:s,0)??0,n=Math.ceil(r/t)||1,a=o.children?.slice((n-1)*t,n*t).filter(Boolean).length===t;return Math.min(t*(a?n+1:n),Math.floor(24/t)*t)}function sp(o,i){return Array.from({length:dm(o,i)},(t,r)=>o.children?.[r]??null)}var lc="application/x-zn-page-type",lp="application/x-zn-page-section";function Ov(){return{sections:[]}}var pP=0;function Ha(){return`s-${Date.now().toString(36)}-${(pP++).toString(36)}`}function hP(o,i,t){let r=o?.configTemplate?.content.querySelector(`[name="${CSS.escape(i)}"]`),n=CSS.escape(t);return r?.querySelector(`option[value="${n}"], zn-option[value="${n}"]`)?.textContent?.trim()??""}function Nv(o,i){let t=Object.entries(o.data).filter(r=>typeof r[1]=="string"&&r[1].trim()!=="");for(let[r,n]of t){let a=hP(i,r,n);if(a)return a}return t[0]?.[1]??i?.description??""}var ap;function Pv(){return ap||(ap=new Image,ap.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ap.decode().catch(()=>{})),ap}var pm=class{constructor(){this.types=new Map}register(i){return this.types.set(i.type,i),this}registerAll(i){return i.forEach(t=>this.register(t)),this}get(i){return this.types.get(i)}has(i){return this.types.has(i)}all(){return Array.from(this.types.values())}categories(){let i=new Map;for(let t of this.all()){let r=t.category??"",n=i.get(r)??[];n.push(t),i.set(r,n)}return i}clear(){this.types.clear()}};var J4=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--section-accent:rgb(var(--zn-color-primary));display:block}:host([hidden]){display:none}.item{display:flex;align-items:center;gap:10px;padding:8px 10px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden;cursor:grab;transition:border-color 0.12s ease,box-shadow 0.12s ease}.item:hover{border-color:rgb(var(--zn-color-border-active));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4)}:host(:active) .item{cursor:grabbing}.item__icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;border-radius:6px;background:color-mix(in srgb,var(--section-accent) 15%,transparent);color:var(--section-accent)}.item__text{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.item__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.8125rem}.item__description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;font-size:0.75rem;line-height:1.3;color:rgb(var(--zn-color-muted-text))}`;var Oi=class extends T{constructor(){super(...arguments);this._onDragStart=t=>{!t.dataTransfer||!this.type||(t.dataTransfer.setData(lc,this.type),t.dataTransfer.effectAllowed="copy")}}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.addEventListener("dragstart",this._onDragStart)}disconnectedCallback(){this.removeEventListener("dragstart",this._onDragStart),super.disconnectedCallback()}updated(t){super.updated(t),this.style.setProperty("--section-accent",this.color??"rgb(var(--zn-color-primary))")}render(){return u`
5843
5843
  <div part="base" class="item">
5844
5844
  <span class="item__icon">
5845
5845
  <zn-icon src="${this.icon??"widgets"}" library="${P(this.iconLibrary)}" size="16"></zn-icon>
@@ -5884,7 +5884,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
5884
5884
  @click="${t=>this._action(t,"page-card-remove")}"></zn-button>`}
5885
5885
  </span>
5886
5886
  </div>
5887
- `}};ni.styles=k(Z4),ni.dependencies={"zn-button":Oe,"zn-icon":he},c([p()],ni.prototype,"label",2),c([p()],ni.prototype,"summary",2),c([p()],ni.prototype,"icon",2),c([p({attribute:"icon-library"})],ni.prototype,"iconLibrary",2),c([p()],ni.prototype,"color",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"unknown",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"locked",2);var Fv=ni;ni.define("zn-page-section-card");var e8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{--pb-card-width:1024px;display:block;position:relative;width:100%;height:100%;min-height:480px;color:rgb(var(--zn-text));container-type:inline-size}.builder{--palette-col:343px;--inspector-col:343px;display:grid;grid-template-columns:var(--palette-col) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.builder--inspecting{grid-template-columns:var(--palette-col) minmax(0,1fr) var(--inspector-col)}.builder{transition:grid-template-columns 0.2s ease}.builder--inspector-wide{--inspector-col:520px}.builder--palette-collapsed{--palette-col:0px}.builder--palette-collapsed .palette{border-right:none}.builder--inspector-collapsed{--inspector-col:0px}.builder--inspector-collapsed .inspector{border-left:none}@container (max-width:768px){.builder:not(.builder--palette-collapsed){--palette-col:240px}.builder:not(.builder--inspector-collapsed){--inspector-col:300px}}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.panel-toggle--right{right:-12px}.panel-toggle--right.panel-toggle--tucked{right:8px}.header{grid-row:1;grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid rgb(var(--zn-border-color))}.header[hidden]{display:none}.header__group{display:flex;align-items:center;gap:8px}.palette,.canvas-cell,.inspector{grid-row:2;min-height:0;min-width:0;overflow:hidden}.canvas-cell{position:relative;overflow:visible}.palette{display:flex;flex-direction:column;border-right:1px solid rgb(var(--zn-border-color))}.palette__title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.palette__text{min-width:0}.palette__heading{font-size:0.9375rem;font-weight:600}.palette__subheading{margin-top:2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.palette__search{padding:12px 12px 8px}.palette__search::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.palette__scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:16px}.palette__category{display:block;border-top:1px solid rgb(var(--zn-border-color))}.palette__category::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.palette__category::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.palette__uncategorized{padding:8px var(--zn-base-gap)}zn-page-palette-item{margin-bottom:6px}.canvas{width:100%;height:100%;display:flex;flex-direction:column;align-items:stretch;padding:24px;overflow-y:auto;background:radial-gradient(circle,rgba(var(--zn-text),0.08) 1px,transparent 1px) 0 0/20px 20px,rgb(var(--zn-body))}.inspector{position:relative;display:flex;flex-direction:column;border-left:1px solid rgb(var(--zn-border-color));overflow:hidden;animation:inspector-in 0.18s ease}.inspector-head{display:flex;align-items:center;gap:12px;flex:0 0 auto;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.inspector-head__icon{--section-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:34px;height:34px;border-radius:8px;color:var(--section-accent);background:color-mix(in srgb,var(--section-accent) 15%,transparent)}.inspector-head__text{flex:1 1 auto;min-width:0}.inspector-head__title{font-size:0.875rem;font-weight:600}.inspector-head__type{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-head__title,.inspector-head__type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector-body{--pb-field-label-size:0.8125rem;--pb-field-note-size:0.75rem;--pb-field-gap:22px;--pb-label-gap:6px;--pb-note-gap:5px;--zn-input-label-font-size-medium:var(--pb-field-label-size);--zn-input-label-font-weight:600;--zn-input-label-line-height:1.3;--zn-input-label-color:rgb(var(--zn-text));--zn-input-help-text-font-size-medium:var(--pb-field-note-size);--zn-input-help-text-color:rgb(var(--zn-color-muted-text));--zn-toggle-margin:0;display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;container-type:inline-size;padding:18px 16px 24px;gap:var(--pb-field-gap)}.inspector-body ::part(form-control-label){margin-bottom:var(--pb-label-gap)}.inspector-body ::part(form-control-input){margin:0}.inspector-body ::part(form-control-help-text){margin-top:var(--pb-note-gap)}.inspector-body zn-toggle::part(label){font-size:var(--pb-field-label-size);font-weight:600}.inspector-body zn-toggle::part(description){font-size:var(--pb-field-note-size);margin-top:var(--pb-note-gap)}.inspector-body zn-icon-picker::part(trigger){flex:1 1 auto}.inspector-body>*,.inspector-body .inspector__form>*{margin-block:0}.inspector-body>.inspector__form{display:flex;flex-direction:column;gap:var(--pb-field-gap)}.inspector-hint{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-resize{position:absolute;top:0;bottom:0;left:-3px;z-index:5;width:7px;cursor:col-resize}.inspector-resize::after{content:"";position:absolute;inset:0 3px;background:transparent;transition:background 0.15s ease}.inspector-resize:hover::after,.inspector-resize:focus-visible::after{background:rgb(var(--zn-color-primary))}.inspector-resize:focus-visible{outline:none}.inspector-close{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;padding:0;border:none;border-radius:6px;color:rgb(var(--zn-color-muted-text));background:transparent;cursor:pointer}.inspector-close:hover{color:rgb(var(--zn-text));background:rgb(var(--zn-color-tab))}@keyframes inspector-in{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}.declarations{display:none}.canvas__empty{margin:auto auto 8px;font-size:13px;opacity:0.6}.canvas__empty[hidden]{display:none}.drop{position:relative;display:flex;align-items:center;justify-content:center;width:100%;max-width:var(--pb-card-width);margin:0 auto;min-height:28px;transition:min-height 0.12s ease}.drop--active{min-height:72px}.drop--solo{margin:0 auto auto}.drop--solo.drop--active{margin:auto;min-height:96px}.drop--active::before{content:"";position:absolute;inset:6px 0;border:2px dashed rgb(var(--zn-color-primary));border-radius:8px;background:rgba(var(--zn-color-primary),0.06)}.drop__add{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid rgb(var(--zn-border-color));border-radius:50%;background:rgb(var(--zn-panel));color:rgb(var(--zn-text));cursor:pointer;opacity:0;transition:opacity 0.12s ease}.drop:hover .drop__add,.drop--active .drop__add{opacity:1}zn-page-section-card.dragging,.container--dragging{display:none}.container{width:100%;max-width:var(--pb-card-width);margin:0 auto;display:flex;flex-direction:column;gap:8px}.slots{display:grid;grid-template-columns:repeat(var(--pb-slot-columns,3),minmax(0,1fr));gap:8px}.slot{position:relative;min-height:64px}.slot--empty{display:flex;align-items:center;justify-content:center;border:1px dashed rgb(var(--zn-border-color));border-radius:8px;color:rgba(var(--zn-text),0.4);cursor:pointer;transition:border-color 0.12s ease,background 0.12s ease}.slot--empty:hover{border-color:rgb(var(--zn-color-border-active));color:rgba(var(--zn-text),0.7)}.slot--active{border-color:rgb(var(--zn-color-primary));border-style:dashed;background:rgba(var(--zn-color-primary),0.06)}.picker{position:absolute;top:calc(100% - 2px);z-index:2;display:flex;flex-direction:column;min-width:220px;max-height:260px;overflow-y:auto;padding:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 4px 12px rgba(var(--zn-shadow),0.4)}.picker__item{display:flex;align-items:center;gap:8px;padding:7px 8px;border:none;border-radius:6px;background:transparent;color:rgb(var(--zn-text));font-size:13px;text-align:left;cursor:pointer}.picker__item:hover{background:rgba(var(--zn-text),0.08)}.save-status{position:absolute;left:16px;bottom:16px;z-index:5;display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);pointer-events:none;transition:color 0.15s ease,border-color 0.15s ease}.save-status--saved{color:rgb(var(--zn-color-success));border-color:color-mix(in srgb,rgb(var(--zn-color-success)) 45%,transparent)}.restore-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:8px;max-width:calc(100% - 32px);padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.restore-banner button{flex:0 0 auto;padding:3px 10px;font-size:0.75rem;font-weight:600;border-radius:6px;cursor:pointer}.restore-banner__restore{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border:none}.restore-banner__restore:hover{filter:brightness(1.1)}.restore-banner__dismiss{color:rgb(var(--zn-color-muted-text));background:transparent;border:none}.restore-banner__dismiss:hover{background:rgb(var(--zn-color-tab))}.drag-ghost{position:absolute;top:0;left:0;z-index:10;opacity:0.9;pointer-events:none;filter:drop-shadow(0 6px 16px rgba(var(--zn-shadow),0.35))}`;var pP=50,Bv=500,hP=768,Vv=300,uP=200,t8=20,mP=5,fP=1440*60*1e3;function r8(o){let i=Math.floor(o/1e3);if(i<10)return"just now";if(i<60)return`${i}s ago`;let t=Math.floor(i/60);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var Le=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this);this.name="";this.form="";this.config="";this.heading="";this.subheading="";this.requiredFirst="";this.sectionTypes=[];this.paletteCollapsed=!1;this.inspectorCollapsed=!1;this.autoSave=null;this.registry=new pm;this._state=Ov();this._selectedId=null;this._search="";this._pickerIndex=null;this._dragOverIndex=null;this._draggingId=null;this._dragGhost=null;this._slotDragOver=null;this._slotPicker=null;this._form=null;this._inspectorWidth=null;this._inspectorWide=!1;this._hasSlot=new te(this,"header-left","header-right");this._history=[];this._redoStack=[];this.defaultValue=JSON.stringify(Ov());this._wasNarrow=!1;this._resizeObserver=new ResizeObserver(t=>{let r=t[0]?.contentRect.width??0;if(r<=0)return;let n=r<hP;n&&!this._wasNarrow&&(this.paletteCollapsed=!0),this._wasNarrow=n});this._autoSaveTimer=null;this._statusTimer=null;this._justSavedTimer=null;this._restoring=!1;this._lastSavedAt=null;this._justSaved=!1;this._statusNow=Date.now();this._restorePrompt=null;this._autoSaveTick=()=>{if(!(!this._state.sections.length||this._restorePrompt))try{localStorage.setItem(this._autoSaveKey,JSON.stringify({savedAt:Date.now(),state:this._state})),this._lastSavedAt=Date.now(),this._justSaved=!0,this._justSavedTimer!==null&&clearTimeout(this._justSavedTimer),this._justSavedTimer=window.setTimeout(()=>this._justSaved=!1,2500)}catch{}};this.restoreAutoSave=()=>{let t=this._readAutoSave();if(!t)return!1;this._restoring=!0;try{this._applyExternalState(t.state)}finally{this._restoring=!1}return this._restorePrompt=null,!0};this._registerSlottedTemplates=()=>{let t=!1;this.querySelectorAll('template[slot="config"][type]').forEach(r=>{let n=this._typeFromTemplate(r);n&&!this.registry.has(n.type)&&(this.registry.register(n),t=!0)}),t&&this.requestUpdate()};this.undo=()=>{let t=this._history.pop();t&&(this._redoStack.push(structuredClone(this._state)),this._select(null),this._commit(t))};this.redo=()=>{let t=this._redoStack.pop();t&&(this._history.push(structuredClone(this._state)),this._select(null),this._commit(t))};this._ghostEl=null;this._ghostGrip={x:0,y:0};this._ghostOrigin={x:0,y:0};this._onGhostDragOver=t=>{t.preventDefault(),!(t.clientX===0&&t.clientY===0)&&this._moveGhost(t.clientX,t.clientY)};this._onGhostDrop=t=>t.preventDefault();this._onGhostDragLeave=t=>{t.relatedTarget===null&&this._ghostEl&&(this._ghostEl.style.visibility="hidden")};this._onCanvasDragOver=t=>{this._isPageDrag(t)&&(t.preventDefault(),this._dragOverIndex=this._state.sections.length)};this._onCanvasDrop=t=>{this._onZoneDrop(t,this._state.sections.length)};this._onInspectorInput=t=>{let r=this._selectedSection();if(!r)return;let n=t.target,a=n.getAttribute?.("name");if(!a)return;let s=this._isBooleanControl(n,r.data[a])?!!n.checked:n.value;n.getAttribute("type")==="number"&&s!==""&&s!==null&&s!==void 0&&(s=Number(s)),!(typeof s=="number"&&Number.isNaN(s))&&r.data[a]!==s&&this._updateSectionData(r.id,{[a]:s})};this._onResizeStart=t=>{t.preventDefault();let r=t.clientX,n=this._inspectorWidth??this._inspectorRect(),a=l=>{this._inspectorWidth=this._clampInspector(n+r-l.clientX)},s=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)};this._onResizeKey=t=>{let r=t.key==="ArrowLeft"?t8:t.key==="ArrowRight"?-t8:0;r&&(t.preventDefault(),this._inspectorWidth=this._clampInspector((this._inspectorWidth??this._inspectorRect())+r))}}get state(){return structuredClone(this._state)}set state(t){try{this._applyExternalState(t)}catch{console.warn("<zn-page-builder> invalid state")}}get value(){return JSON.stringify(this._state)}set value(t){if(t)try{this._applyExternalState(JSON.parse(t))}catch{console.warn("<zn-page-builder> invalid value JSON")}}get validity(){return ht}get validationMessage(){return""}checkValidity(){return!0}getForm(){return this.formControlController.getForm()}reportValidity(){return!0}setCustomValidity(t=""){}handleConfigChange(){if(this.config)try{this._applyExternalState(JSON.parse(this.config))}catch{console.warn("<zn-page-builder> invalid config JSON")}}handleRequiredFirstChange(){let t=this._requireFirst(this._state.sections);t!==this._state.sections&&(this._state={sections:t},this.defaultValue=JSON.stringify(this._state))}handleSectionTypesChange(){this.registry.registerAll(this.sectionTypes??[]),this.requestUpdate()}registerSectionType(t){return this.registry.register(t),this.requestUpdate(),this}registerSectionTypes(t){return this.registry.registerAll(t),this.requestUpdate(),this}connectedCallback(){super.connectedCallback(),Pv(),this._registerSlottedTemplates(),this._resizeObserver.observe(this)}disconnectedCallback(){this._endGhost(),this._resizeObserver.disconnect(),this._stopAutoSave(),this._justSavedTimer!==null&&(clearTimeout(this._justSavedTimer),this._justSavedTimer=null),super.disconnectedCallback()}get _autoSaveKey(){return`zn-page-builder:${this.id||this.heading||"page"}`}_stopAutoSave(){this._autoSaveTimer!==null&&(clearInterval(this._autoSaveTimer),this._autoSaveTimer=null),this._statusTimer!==null&&(clearInterval(this._statusTimer),this._statusTimer=null)}_restartAutoSave(){if(this._stopAutoSave(),this.autoSave===null)return;let t=this._readAutoSave();t&&(this._lastSavedAt=t.savedAt),this._autoSaveTimer=window.setInterval(this._autoSaveTick,this.autoSave*6e4),this._statusTimer=window.setInterval(()=>this._statusNow=Date.now(),3e4)}_readAutoSave(){try{let t=localStorage.getItem(this._autoSaveKey);if(!t)return null;let r=JSON.parse(t);return!r.state||Date.now()-r.savedAt>fP?(localStorage.removeItem(this._autoSaveKey),null):r}catch{return null}}_offerRestoreIfNewer(){if(this.autoSave===null||this._restoring)return;let t=this._readAutoSave();this._restorePrompt=t&&JSON.stringify(t.state)!==JSON.stringify(this._state)?{savedAt:t.savedAt}:null}willUpdate(t){super.willUpdate(t),t.has("_selectedId")&&this._buildInspectorForm(),t.has("autoSave")&&this._restartAutoSave()}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity()}_typeFromTemplate(t){let r=t.getAttribute("type");return r?{type:r,label:t.getAttribute("label")??r,icon:t.getAttribute("icon")??void 0,iconLibrary:t.getAttribute("icon-library")??void 0,color:t.getAttribute("color")??void 0,category:t.getAttribute("category")??void 0,description:t.getAttribute("description")??void 0,configTemplate:t,...this._slotsFromAttributes(t),accepts:t.getAttribute("accepts")?.split(",").map(n=>n.trim()).filter(Boolean)}:null}_slotsFromAttributes(t){let r=s=>{let l=parseInt(t.getAttribute(s)??"",10);return l>0&&l<=24?l:void 0},n=r("slots");if(!n)return{};let a=r("slots-max");return a===void 0||a<n?{slots:n}:{slots:n,slotsMin:Math.min(r("slots-min")??1,n),slotsMax:a}}_applyExternalState(t){let r=new Set,n=!1,a=(d,h)=>{let m=!d.id||r.has(d.id)?Ha():d.id;r.add(m),h===0&&(d.children?.length??0)>24&&(n=!0);let f=this.registry.get(d.type),b=f?.slotsMax===void 0?void 0:Pa(d,f);return{id:m,type:d.type,label:d.label,...b===void 0?{}:{columns:b},data:structuredClone(d.data??{}),...d.children&&h===0?{children:d.children.slice(0,24).map(g=>g&&typeof g.type=="string"?a(g,h+1):null)}:{}}},s=(t?.sections??[]).filter(d=>d&&typeof d.type=="string");s.length>Bv&&console.warn(`<zn-page-builder> config has ${s.length} sections; keeping the first ${Bv}`);let l=s.slice(0,Bv).map(d=>a(d,0));n&&console.warn(`<zn-page-builder> some sections had more than ${24} children; extras were dropped`),this._history=[],this._redoStack=[],this._state={sections:this._requireFirst(l)},this.defaultValue=JSON.stringify(this._state),this._selectedId=null,this._pickerIndex=null,this._offerRestoreIfNewer()}get _pinnedId(){let t=this._state.sections[0],r=this._requiredFirstTypes;return t&&r.includes(t.type)?t.id:null}get _requiredFirstTypes(){return this.requiredFirst.split(",").map(t=>t.trim()).filter(Boolean)}_isPinned(t){return this._pinnedId===t}get _canUnpin(){let t=this._requiredFirstTypes;return this._state.sections.slice(1).some(r=>t.includes(r.type))}get _firstFreeIndex(){return this._pinnedId===null?0:1}_requireFirst(t){let r=this._requiredFirstTypes;if(!r.length||r.includes(t[0]?.type))return t;let n=t.findIndex(s=>r.includes(s.type));if(n===-1)return[{id:Ha(),type:r[0],data:{}},...t];let a=[...t];return a.unshift(...a.splice(n,1)),a}_findSection(t){if(t)for(let r of this._state.sections){if(r.id===t)return r;let n=r.children?.find(a=>a?.id===t);if(n)return n}}_patchSection(t,r){return this._state.sections.map(n=>n.id===t?r(n):n.children?.some(a=>a?.id===t)?{...n,children:n.children.map(a=>a?.id===t?r(a):a)}:n)}_extract(t){let r,n=[];for(let a of this._state.sections){if(a.id===t){r=a;continue}let s=a.children?.findIndex(l=>l?.id===t)??-1;s!==-1?(r=a.children[s]??void 0,n.push({...a,children:a.children.map((l,d)=>d===s?null:l)})):n.push(a)}return[r,n]}_commit(t){this._state=t,this.emit("zn-page-change",{detail:{state:this.state}})}_selectedSection(){return this._findSection(this._selectedId)}_select(t){this._selectedId!==t&&(this._selectedId=t,this._pickerIndex=null,this._slotPicker=null,this.emit("zn-page-selection-change",{detail:{sectionId:t}}))}_pushHistory(){this._history.push(structuredClone(this._state)),this._history.length>pP&&this._history.shift(),this._redoStack=[]}addSection(t,r){if(!this.registry.has(t))return null;this._pushHistory();let n={id:Ha(),type:t,data:{}},a=[...this._state.sections];return a.splice(Math.max(r??a.length,this._firstFreeIndex),0,n),this._commit({sections:a}),this._select(n.id),n}addSectionToSlot(t,r,n){let a=this.registry.get(t),s=this._findSection(r),l=s?this.registry.get(s.type):void 0;if(!a||a.slots||!s||!l?.slots||n<0||n>=dm(s,l)||l.accepts&&!l.accepts.includes(t))return null;let d=sp(s,l);if(d[n])return null;let h={id:Ha(),type:t,data:{}};return d[n]=h,this._pushHistory(),this._commit({sections:this._patchSection(r,m=>({...m,children:d}))}),this._select(h.id),h}setSectionColumns(t,r){let n=this._findSection(t),a=n?this.registry.get(n.type):void 0;if(!n||a?.slotsMax===void 0)return;let s=Pa({...n,columns:r},a);s!==Pa(n,a)&&(this._pushHistory(),this._commit({sections:this._patchSection(t,l=>({...l,columns:s}))}))}_onColumnsEntered(t,r){let n=this.registry.get(t.type);if(n?.slotsMax===void 0)return;let a=Pa({...t,columns:Number(r.value)},n);r.value=String(a),this.setSectionColumns(t.id,a)}_removeSection(t){if(this._isPinned(t)&&!this._canUnpin)return;let[r,n]=this._extract(t);r&&(this._pushHistory(),this._blurActiveCard(),(this._selectedId===t||r.children?.some(a=>a?.id===this._selectedId))&&this._select(null),this._commit({sections:this._requireFirst(n)}))}_duplicateSection(t){let r=this._state.sections.findIndex(n=>n.id===t);if(r!==-1){this._pushHistory();let n=structuredClone(this._state.sections[r]);n.id=Ha(),n.children=n.children?.map(s=>s?{...s,id:Ha()}:null);let a=[...this._state.sections];a.splice(r+1,0,n),this._commit({sections:a}),this._select(n.id),this._focusCard(n.id);return}for(let n of this._state.sections){let a=n.children?.findIndex(m=>m?.id===t)??-1;if(a===-1)continue;let s=this.registry.get(n.type);if(!s?.slots)return;let l=sp(n,s),d=l.findIndex(m=>!m);if(d===-1)return;let h=structuredClone(l[a]);h.id=Ha(),l[d]=h,this._pushHistory(),this._commit({sections:this._patchSection(n.id,m=>({...m,children:l}))}),this._select(h.id),this._focusCard(h.id);return}}async _focusCard(t){this._blurActiveCard(),await this.updateComplete,this.shadowRoot?.querySelector(`zn-page-section-card[data-id="${t}"]`)?.focus()}_blurActiveCard(){let t=this.shadowRoot?.activeElement;if(!(t instanceof HTMLElement)||!t.closest("zn-page-section-card"))return;let r=t;for(;r.shadowRoot?.activeElement instanceof HTMLElement;)r=r.shadowRoot.activeElement;r.blur()}_moveSection(t,r){if(this._isPinned(t))return;r=Math.max(r,this._firstFreeIndex);let n=this._state.sections.findIndex(l=>l.id===t);if(n!==-1){let l=r>n?r-1:r;if(l===n)return;this._pushHistory();let d=[...this._state.sections],[h]=d.splice(n,1);d.splice(l,0,h),this._commit({sections:d});return}let[a,s]=this._extract(t);a&&(this._pushHistory(),s.splice(r,0,a),this._commit({sections:s}))}_moveToSlot(t,r,n){let a=this._findSection(t),s=this._findSection(r),l=s?this.registry.get(s.type):void 0;if(!a||!s||!l?.slots||t===r||this._isPinned(t)||this.registry.get(a.type)?.slots||l.accepts&&!l.accepts.includes(a.type)||n<0||n>=dm(s,l))return;let d=s.children?.[n]??null;if(d?.id===t)return;let h=this._state.sections.some(g=>g.id===t);if(d&&h)return;this._pushHistory();let m=structuredClone(this._state.sections),f=m.find(g=>g.id===r);f.children=sp(f,l);let b=structuredClone(a);if(h)m.splice(m.findIndex(g=>g.id===t),1);else for(let g of m){let v=g.children?.findIndex(y=>y?.id===t)??-1;if(v!==-1){g.children[v]=d?structuredClone(d):null;break}}f.children[n]=b,this._commit({sections:m})}_onCardDragStart(t,r){if(!t.dataTransfer)return;t.stopPropagation(),t.dataTransfer.setData(lp,r),t.dataTransfer.effectAllowed="move";let n=this._findSection(r);n&&this._startGhost(t,{section:n}),setTimeout(()=>this._draggingId=r)}_startGhost(t,r){if(!t.dataTransfer)return;let n=t.currentTarget.getBoundingClientRect(),a=this.getBoundingClientRect();this._ghostGrip={x:t.clientX-n.left,y:t.clientY-n.top},this._ghostOrigin={x:a.left,y:a.top},this._dragGhost=r,t.dataTransfer.setDragImage(Pv(),0,0),document.addEventListener("dragover",this._onGhostDragOver,!0),document.addEventListener("drop",this._onGhostDrop,!0),document.addEventListener("dragleave",this._onGhostDragLeave,!0),this.updateComplete.then(()=>{this._ghostEl=this.shadowRoot?.querySelector(".drag-ghost")??null,this._ghostEl&&(this._ghostEl.style.width=`${n.width}px`,this._moveGhost(t.clientX,t.clientY))})}_moveGhost(t,r){if(!this._ghostEl)return;this._ghostEl.style.visibility="";let n=t-this._ghostOrigin.x-this._ghostGrip.x,a=r-this._ghostOrigin.y-this._ghostGrip.y;this._ghostEl.style.transform=`translate(${n}px, ${a}px)`}_endGhost(){document.removeEventListener("dragover",this._onGhostDragOver,!0),document.removeEventListener("drop",this._onGhostDrop,!0),document.removeEventListener("dragleave",this._onGhostDragLeave,!0),this._ghostEl=null,this._dragGhost=null}_renderDragGhost(){let t=this._dragGhost;if(!t)return"";if("type"in t){let a=t.type;return u`
5887
+ `}};ni.styles=k(Z4),ni.dependencies={"zn-button":Oe,"zn-icon":he},c([p()],ni.prototype,"label",2),c([p()],ni.prototype,"summary",2),c([p()],ni.prototype,"icon",2),c([p({attribute:"icon-library"})],ni.prototype,"iconLibrary",2),c([p()],ni.prototype,"color",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"unknown",2),c([p({type:Boolean,reflect:!0})],ni.prototype,"locked",2);var Fv=ni;ni.define("zn-page-section-card");var e8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{--pb-card-width:1024px;display:block;position:relative;width:100%;height:100%;min-height:480px;color:rgb(var(--zn-text));container-type:inline-size}.builder{--palette-col:343px;--inspector-col:343px;display:grid;grid-template-columns:var(--palette-col) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.builder--inspecting{grid-template-columns:var(--palette-col) minmax(0,1fr) var(--inspector-col)}.builder{transition:grid-template-columns 0.2s ease}.builder--inspector-wide{--inspector-col:520px}.builder--palette-collapsed{--palette-col:0px}.builder--palette-collapsed .palette{border-right:none}.builder--inspector-collapsed{--inspector-col:0px}.builder--inspector-collapsed .inspector{border-left:none}@container (max-width:768px){.builder:not(.builder--palette-collapsed){--palette-col:240px}.builder:not(.builder--inspector-collapsed){--inspector-col:300px}}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.panel-toggle--right{right:-12px}.panel-toggle--right.panel-toggle--tucked{right:8px}.header{grid-row:1;grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid rgb(var(--zn-border-color))}.header[hidden]{display:none}.header__group{display:flex;align-items:center;gap:8px}.palette,.canvas-cell,.inspector{grid-row:2;min-height:0;min-width:0;overflow:hidden}.canvas-cell{position:relative;overflow:visible}.palette{display:flex;flex-direction:column;border-right:1px solid rgb(var(--zn-border-color))}.palette__title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.palette__text{min-width:0}.palette__heading{font-size:0.9375rem;font-weight:600}.palette__subheading{margin-top:2px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.palette__search{padding:12px 12px 8px}.palette__search::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.palette__scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:16px}.palette__category{display:block;border-top:1px solid rgb(var(--zn-border-color))}.palette__category::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.palette__category::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.palette__uncategorized{padding:8px var(--zn-base-gap)}zn-page-palette-item{margin-bottom:6px}.canvas{width:100%;height:100%;display:flex;flex-direction:column;align-items:stretch;padding:24px;overflow-y:auto;background:radial-gradient(circle,rgba(var(--zn-text),0.08) 1px,transparent 1px) 0 0/20px 20px,rgb(var(--zn-body))}.inspector{position:relative;display:flex;flex-direction:column;border-left:1px solid rgb(var(--zn-border-color));overflow:hidden;animation:inspector-in 0.18s ease}.inspector-head{display:flex;align-items:center;gap:12px;flex:0 0 auto;padding:16px;border-bottom:1px solid rgb(var(--zn-border-color))}.inspector-head__icon{--section-accent:rgb(var(--zn-color-primary));display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:34px;height:34px;border-radius:8px;color:var(--section-accent);background:color-mix(in srgb,var(--section-accent) 15%,transparent)}.inspector-head__text{flex:1 1 auto;min-width:0}.inspector-head__title{font-size:0.875rem;font-weight:600}.inspector-head__type{font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-head__title,.inspector-head__type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector-body{--pb-field-label-size:0.8125rem;--pb-field-note-size:0.75rem;--pb-field-gap:22px;--pb-label-gap:6px;--pb-note-gap:5px;--zn-input-label-font-size-medium:var(--pb-field-label-size);--zn-input-label-font-weight:600;--zn-input-label-line-height:1.3;--zn-input-label-color:rgb(var(--zn-text));--zn-input-help-text-font-size-medium:var(--pb-field-note-size);--zn-input-help-text-color:rgb(var(--zn-color-muted-text));--zn-toggle-margin:0;display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;container-type:inline-size;padding:18px 16px 24px;gap:var(--pb-field-gap)}.inspector-body ::part(form-control-label){margin-bottom:var(--pb-label-gap)}.inspector-body ::part(form-control-input){margin:0}.inspector-body ::part(form-control-help-text){margin-top:var(--pb-note-gap)}.inspector-body zn-toggle::part(label){font-size:var(--pb-field-label-size);font-weight:600}.inspector-body zn-toggle::part(description){font-size:var(--pb-field-note-size);margin-top:var(--pb-note-gap)}.inspector-body zn-icon-picker::part(trigger){flex:1 1 auto}.inspector-body>*,.inspector-body .inspector__form>*{margin-block:0}.inspector-body>.inspector__form{display:flex;flex-direction:column;gap:var(--pb-field-gap)}.inspector-hint{margin:0;font-size:0.75rem;color:rgb(var(--zn-color-muted-text))}.inspector-resize{position:absolute;top:0;bottom:0;left:-3px;z-index:5;width:7px;cursor:col-resize}.inspector-resize::after{content:"";position:absolute;inset:0 3px;background:transparent;transition:background 0.15s ease}.inspector-resize:hover::after,.inspector-resize:focus-visible::after{background:rgb(var(--zn-color-primary))}.inspector-resize:focus-visible{outline:none}.inspector-close{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;padding:0;border:none;border-radius:6px;color:rgb(var(--zn-color-muted-text));background:transparent;cursor:pointer}.inspector-close:hover{color:rgb(var(--zn-text));background:rgb(var(--zn-color-tab))}@keyframes inspector-in{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}.declarations{display:none}.canvas__empty{margin:auto auto 8px;font-size:13px;opacity:0.6}.canvas__empty[hidden]{display:none}.drop{position:relative;display:flex;align-items:center;justify-content:center;width:100%;max-width:var(--pb-card-width);margin:0 auto;min-height:28px;transition:min-height 0.12s ease}.drop--active{min-height:72px}.drop--solo{margin:0 auto auto}.drop--solo.drop--active{margin:auto;min-height:96px}.drop--active::before{content:"";position:absolute;inset:6px 0;border:2px dashed rgb(var(--zn-color-primary));border-radius:8px;background:rgba(var(--zn-color-primary),0.06)}.drop__add{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid rgb(var(--zn-border-color));border-radius:50%;background:rgb(var(--zn-panel));color:rgb(var(--zn-text));cursor:pointer;opacity:0;transition:opacity 0.12s ease}.drop:hover .drop__add,.drop--active .drop__add{opacity:1}zn-page-section-card.dragging,.container--dragging{display:none}.container{width:100%;max-width:var(--pb-card-width);margin:0 auto;display:flex;flex-direction:column;gap:8px}.slots{display:grid;grid-template-columns:repeat(var(--pb-slot-columns,3),minmax(0,1fr));gap:8px}.slot{position:relative;min-height:64px}.slot--empty{display:flex;align-items:center;justify-content:center;border:1px dashed rgb(var(--zn-border-color));border-radius:8px;color:rgba(var(--zn-text),0.4);cursor:pointer;transition:border-color 0.12s ease,background 0.12s ease}.slot--empty:hover{border-color:rgb(var(--zn-color-border-active));color:rgba(var(--zn-text),0.7)}.slot--active{border-color:rgb(var(--zn-color-primary));border-style:dashed;background:rgba(var(--zn-color-primary),0.06)}.picker{position:absolute;top:calc(100% - 2px);z-index:2;display:flex;flex-direction:column;min-width:220px;max-height:260px;overflow-y:auto;padding:6px;background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 4px 12px rgba(var(--zn-shadow),0.4)}.picker__item{display:flex;align-items:center;gap:8px;padding:7px 8px;border:none;border-radius:6px;background:transparent;color:rgb(var(--zn-text));font-size:13px;text-align:left;cursor:pointer}.picker__item:hover{background:rgba(var(--zn-text),0.08)}.save-status{position:absolute;left:16px;bottom:16px;z-index:5;display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:0.75rem;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);pointer-events:none;transition:color 0.15s ease,border-color 0.15s ease}.save-status--saved{color:rgb(var(--zn-color-success));border-color:color-mix(in srgb,rgb(var(--zn-color-success)) 45%,transparent)}.restore-banner{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:8px;max-width:calc(100% - 32px);padding:8px 12px;font-size:0.8125rem;color:rgb(var(--zn-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;box-shadow:0 2px 8px rgba(var(--zn-shadow),0.5)}.restore-banner button{flex:0 0 auto;padding:3px 10px;font-size:0.75rem;font-weight:600;border-radius:6px;cursor:pointer}.restore-banner__restore{color:rgb(var(--zn-panel));background:rgb(var(--zn-color-primary));border:none}.restore-banner__restore:hover{filter:brightness(1.1)}.restore-banner__dismiss{color:rgb(var(--zn-color-muted-text));background:transparent;border:none}.restore-banner__dismiss:hover{background:rgb(var(--zn-color-tab))}.drag-ghost{position:absolute;top:0;left:0;z-index:10;opacity:0.9;pointer-events:none;filter:drop-shadow(0 6px 16px rgba(var(--zn-shadow),0.35))}`;var uP=50,Bv=500,mP=768,Vv=300,fP=200,t8=20,gP=5,bP=1440*60*1e3;function r8(o){let i=Math.floor(o/1e3);if(i<10)return"just now";if(i<60)return`${i}s ago`;let t=Math.floor(i/60);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var Le=class extends T{constructor(){super(...arguments);this.formControlController=new ce(this);this.name="";this.form="";this.config="";this.heading="";this.subheading="";this.requiredFirst="";this.sectionTypes=[];this.paletteCollapsed=!1;this.inspectorCollapsed=!1;this.autoSave=null;this.registry=new pm;this._state=Ov();this._selectedId=null;this._search="";this._pickerIndex=null;this._dragOverIndex=null;this._draggingId=null;this._dragGhost=null;this._slotDragOver=null;this._slotPicker=null;this._form=null;this._inspectorWidth=null;this._inspectorWide=!1;this._hasSlot=new te(this,"header-left","header-right");this._history=[];this._redoStack=[];this.defaultValue=JSON.stringify(Ov());this._wasNarrow=!1;this._resizeObserver=new ResizeObserver(t=>{let r=t[0]?.contentRect.width??0;if(r<=0)return;let n=r<mP;n&&!this._wasNarrow&&(this.paletteCollapsed=!0),this._wasNarrow=n});this._autoSaveTimer=null;this._statusTimer=null;this._justSavedTimer=null;this._restoring=!1;this._lastSavedAt=null;this._justSaved=!1;this._statusNow=Date.now();this._restorePrompt=null;this._autoSaveTick=()=>{if(!(!this._state.sections.length||this._restorePrompt))try{localStorage.setItem(this._autoSaveKey,JSON.stringify({savedAt:Date.now(),state:this._state})),this._lastSavedAt=Date.now(),this._justSaved=!0,this._justSavedTimer!==null&&clearTimeout(this._justSavedTimer),this._justSavedTimer=window.setTimeout(()=>this._justSaved=!1,2500)}catch{}};this.restoreAutoSave=()=>{let t=this._readAutoSave();if(!t)return!1;this._restoring=!0;try{this._applyExternalState(t.state)}finally{this._restoring=!1}return this._restorePrompt=null,!0};this._registerSlottedTemplates=()=>{let t=!1;this.querySelectorAll('template[slot="config"][type]').forEach(r=>{let n=this._typeFromTemplate(r);n&&!this.registry.has(n.type)&&(this.registry.register(n),t=!0)}),t&&this.requestUpdate()};this.undo=()=>{let t=this._history.pop();t&&(this._redoStack.push(structuredClone(this._state)),this._select(null),this._commit(t))};this.redo=()=>{let t=this._redoStack.pop();t&&(this._history.push(structuredClone(this._state)),this._select(null),this._commit(t))};this._ghostEl=null;this._ghostGrip={x:0,y:0};this._ghostOrigin={x:0,y:0};this._onGhostDragOver=t=>{t.preventDefault(),!(t.clientX===0&&t.clientY===0)&&this._moveGhost(t.clientX,t.clientY)};this._onGhostDrop=t=>t.preventDefault();this._onGhostDragLeave=t=>{t.relatedTarget===null&&this._ghostEl&&(this._ghostEl.style.visibility="hidden")};this._onCanvasDragOver=t=>{this._isPageDrag(t)&&(t.preventDefault(),this._dragOverIndex=this._state.sections.length)};this._onCanvasDrop=t=>{this._onZoneDrop(t,this._state.sections.length)};this._onInspectorInput=t=>{let r=this._selectedSection();if(!r)return;let n=t.target,a=n.getAttribute?.("name");if(!a)return;let s=this._isBooleanControl(n,r.data[a])?!!n.checked:n.value;n.getAttribute("type")==="number"&&s!==""&&s!==null&&s!==void 0&&(s=Number(s)),!(typeof s=="number"&&Number.isNaN(s))&&r.data[a]!==s&&this._updateSectionData(r.id,{[a]:s})};this._onResizeStart=t=>{t.preventDefault();let r=t.clientX,n=this._inspectorWidth??this._inspectorRect(),a=l=>{this._inspectorWidth=this._clampInspector(n+r-l.clientX)},s=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)};this._onResizeKey=t=>{let r=t.key==="ArrowLeft"?t8:t.key==="ArrowRight"?-t8:0;r&&(t.preventDefault(),this._inspectorWidth=this._clampInspector((this._inspectorWidth??this._inspectorRect())+r))}}get state(){return structuredClone(this._state)}set state(t){try{this._applyExternalState(t)}catch{console.warn("<zn-page-builder> invalid state")}}get value(){return JSON.stringify(this._state)}set value(t){if(t)try{this._applyExternalState(JSON.parse(t))}catch{console.warn("<zn-page-builder> invalid value JSON")}}get validity(){return ht}get validationMessage(){return""}checkValidity(){return!0}getForm(){return this.formControlController.getForm()}reportValidity(){return!0}setCustomValidity(t=""){}handleConfigChange(){if(this.config)try{this._applyExternalState(JSON.parse(this.config))}catch{console.warn("<zn-page-builder> invalid config JSON")}}handleRequiredFirstChange(){let t=this._requireFirst(this._state.sections);t!==this._state.sections&&(this._state={sections:t},this.defaultValue=JSON.stringify(this._state))}handleSectionTypesChange(){this.registry.registerAll(this.sectionTypes??[]),this.requestUpdate()}registerSectionType(t){return this.registry.register(t),this.requestUpdate(),this}registerSectionTypes(t){return this.registry.registerAll(t),this.requestUpdate(),this}connectedCallback(){super.connectedCallback(),Pv(),this._registerSlottedTemplates(),this._resizeObserver.observe(this)}disconnectedCallback(){this._endGhost(),this._resizeObserver.disconnect(),this._stopAutoSave(),this._justSavedTimer!==null&&(clearTimeout(this._justSavedTimer),this._justSavedTimer=null),super.disconnectedCallback()}get _autoSaveKey(){return`zn-page-builder:${this.id||this.heading||"page"}`}_stopAutoSave(){this._autoSaveTimer!==null&&(clearInterval(this._autoSaveTimer),this._autoSaveTimer=null),this._statusTimer!==null&&(clearInterval(this._statusTimer),this._statusTimer=null)}_restartAutoSave(){if(this._stopAutoSave(),this.autoSave===null)return;let t=this._readAutoSave();t&&(this._lastSavedAt=t.savedAt),this._autoSaveTimer=window.setInterval(this._autoSaveTick,this.autoSave*6e4),this._statusTimer=window.setInterval(()=>this._statusNow=Date.now(),3e4)}_readAutoSave(){try{let t=localStorage.getItem(this._autoSaveKey);if(!t)return null;let r=JSON.parse(t);return!r.state||Date.now()-r.savedAt>bP?(localStorage.removeItem(this._autoSaveKey),null):r}catch{return null}}_offerRestoreIfNewer(){if(this.autoSave===null||this._restoring)return;let t=this._readAutoSave();this._restorePrompt=t&&JSON.stringify(t.state)!==JSON.stringify(this._state)?{savedAt:t.savedAt}:null}willUpdate(t){super.willUpdate(t),t.has("_selectedId")&&this._buildInspectorForm(),t.has("autoSave")&&this._restartAutoSave()}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity()}_typeFromTemplate(t){let r=t.getAttribute("type");return r?{type:r,label:t.getAttribute("label")??r,icon:t.getAttribute("icon")??void 0,iconLibrary:t.getAttribute("icon-library")??void 0,color:t.getAttribute("color")??void 0,category:t.getAttribute("category")??void 0,description:t.getAttribute("description")??void 0,configTemplate:t,...this._slotsFromAttributes(t),accepts:t.getAttribute("accepts")?.split(",").map(n=>n.trim()).filter(Boolean)}:null}_slotsFromAttributes(t){let r=s=>{let l=parseInt(t.getAttribute(s)??"",10);return l>0&&l<=24?l:void 0},n=r("slots");if(!n)return{};let a=r("slots-max");return a===void 0||a<n?{slots:n}:{slots:n,slotsMin:Math.min(r("slots-min")??1,n),slotsMax:a}}_applyExternalState(t){let r=new Set,n=!1,a=(d,h)=>{let m=!d.id||r.has(d.id)?Ha():d.id;r.add(m),h===0&&(d.children?.length??0)>24&&(n=!0);let f=this.registry.get(d.type),b=f?.slotsMax===void 0?void 0:Pa(d,f);return{id:m,type:d.type,label:d.label,...b===void 0?{}:{columns:b},data:structuredClone(d.data??{}),...d.children&&h===0?{children:d.children.slice(0,24).map(g=>g&&typeof g.type=="string"?a(g,h+1):null)}:{}}},s=(t?.sections??[]).filter(d=>d&&typeof d.type=="string");s.length>Bv&&console.warn(`<zn-page-builder> config has ${s.length} sections; keeping the first ${Bv}`);let l=s.slice(0,Bv).map(d=>a(d,0));n&&console.warn(`<zn-page-builder> some sections had more than ${24} children; extras were dropped`),this._history=[],this._redoStack=[],this._state={sections:this._requireFirst(l)},this.defaultValue=JSON.stringify(this._state),this._selectedId=null,this._pickerIndex=null,this._offerRestoreIfNewer()}get _pinnedId(){let t=this._state.sections[0],r=this._requiredFirstTypes;return t&&r.includes(t.type)?t.id:null}get _requiredFirstTypes(){return this.requiredFirst.split(",").map(t=>t.trim()).filter(Boolean)}_isPinned(t){return this._pinnedId===t}get _canUnpin(){let t=this._requiredFirstTypes;return this._state.sections.slice(1).some(r=>t.includes(r.type))}get _firstFreeIndex(){return this._pinnedId===null?0:1}_requireFirst(t){let r=this._requiredFirstTypes;if(!r.length||r.includes(t[0]?.type))return t;let n=t.findIndex(s=>r.includes(s.type));if(n===-1)return[{id:Ha(),type:r[0],data:{}},...t];let a=[...t];return a.unshift(...a.splice(n,1)),a}_findSection(t){if(t)for(let r of this._state.sections){if(r.id===t)return r;let n=r.children?.find(a=>a?.id===t);if(n)return n}}_patchSection(t,r){return this._state.sections.map(n=>n.id===t?r(n):n.children?.some(a=>a?.id===t)?{...n,children:n.children.map(a=>a?.id===t?r(a):a)}:n)}_extract(t){let r,n=[];for(let a of this._state.sections){if(a.id===t){r=a;continue}let s=a.children?.findIndex(l=>l?.id===t)??-1;s!==-1?(r=a.children[s]??void 0,n.push({...a,children:a.children.map((l,d)=>d===s?null:l)})):n.push(a)}return[r,n]}_commit(t){this._state=t,this.emit("zn-page-change",{detail:{state:this.state}})}_selectedSection(){return this._findSection(this._selectedId)}_select(t){this._selectedId!==t&&(this._selectedId=t,this._pickerIndex=null,this._slotPicker=null,this.emit("zn-page-selection-change",{detail:{sectionId:t}}))}_pushHistory(){this._history.push(structuredClone(this._state)),this._history.length>uP&&this._history.shift(),this._redoStack=[]}addSection(t,r){if(!this.registry.has(t))return null;this._pushHistory();let n={id:Ha(),type:t,data:{}},a=[...this._state.sections];return a.splice(Math.max(r??a.length,this._firstFreeIndex),0,n),this._commit({sections:a}),this._select(n.id),n}addSectionToSlot(t,r,n){let a=this.registry.get(t),s=this._findSection(r),l=s?this.registry.get(s.type):void 0;if(!a||a.slots||!s||!l?.slots||n<0||n>=dm(s,l)||l.accepts&&!l.accepts.includes(t))return null;let d=sp(s,l);if(d[n])return null;let h={id:Ha(),type:t,data:{}};return d[n]=h,this._pushHistory(),this._commit({sections:this._patchSection(r,m=>({...m,children:d}))}),this._select(h.id),h}setSectionColumns(t,r){let n=this._findSection(t),a=n?this.registry.get(n.type):void 0;if(!n||a?.slotsMax===void 0)return;let s=Pa({...n,columns:r},a);s!==Pa(n,a)&&(this._pushHistory(),this._commit({sections:this._patchSection(t,l=>({...l,columns:s}))}))}_onColumnsEntered(t,r){let n=this.registry.get(t.type);if(n?.slotsMax===void 0)return;let a=Pa({...t,columns:Number(r.value)},n);r.value=String(a),this.setSectionColumns(t.id,a)}_removeSection(t){if(this._isPinned(t)&&!this._canUnpin)return;let[r,n]=this._extract(t);r&&(this._pushHistory(),this._blurActiveCard(),(this._selectedId===t||r.children?.some(a=>a?.id===this._selectedId))&&this._select(null),this._commit({sections:this._requireFirst(n)}))}_duplicateSection(t){let r=this._state.sections.findIndex(n=>n.id===t);if(r!==-1){this._pushHistory();let n=structuredClone(this._state.sections[r]);n.id=Ha(),n.children=n.children?.map(s=>s?{...s,id:Ha()}:null);let a=[...this._state.sections];a.splice(r+1,0,n),this._commit({sections:a}),this._select(n.id),this._focusCard(n.id);return}for(let n of this._state.sections){let a=n.children?.findIndex(m=>m?.id===t)??-1;if(a===-1)continue;let s=this.registry.get(n.type);if(!s?.slots)return;let l=sp(n,s),d=l.findIndex(m=>!m);if(d===-1)return;let h=structuredClone(l[a]);h.id=Ha(),l[d]=h,this._pushHistory(),this._commit({sections:this._patchSection(n.id,m=>({...m,children:l}))}),this._select(h.id),this._focusCard(h.id);return}}async _focusCard(t){this._blurActiveCard(),await this.updateComplete,this.shadowRoot?.querySelector(`zn-page-section-card[data-id="${t}"]`)?.focus()}_blurActiveCard(){let t=this.shadowRoot?.activeElement;if(!(t instanceof HTMLElement)||!t.closest("zn-page-section-card"))return;let r=t;for(;r.shadowRoot?.activeElement instanceof HTMLElement;)r=r.shadowRoot.activeElement;r.blur()}_moveSection(t,r){if(this._isPinned(t))return;r=Math.max(r,this._firstFreeIndex);let n=this._state.sections.findIndex(l=>l.id===t);if(n!==-1){let l=r>n?r-1:r;if(l===n)return;this._pushHistory();let d=[...this._state.sections],[h]=d.splice(n,1);d.splice(l,0,h),this._commit({sections:d});return}let[a,s]=this._extract(t);a&&(this._pushHistory(),s.splice(r,0,a),this._commit({sections:s}))}_moveToSlot(t,r,n){let a=this._findSection(t),s=this._findSection(r),l=s?this.registry.get(s.type):void 0;if(!a||!s||!l?.slots||t===r||this._isPinned(t)||this.registry.get(a.type)?.slots||l.accepts&&!l.accepts.includes(a.type)||n<0||n>=dm(s,l))return;let d=s.children?.[n]??null;if(d?.id===t)return;let h=this._state.sections.some(g=>g.id===t);if(d&&h)return;this._pushHistory();let m=structuredClone(this._state.sections),f=m.find(g=>g.id===r);f.children=sp(f,l);let b=structuredClone(a);if(h)m.splice(m.findIndex(g=>g.id===t),1);else for(let g of m){let v=g.children?.findIndex(y=>y?.id===t)??-1;if(v!==-1){g.children[v]=d?structuredClone(d):null;break}}f.children[n]=b,this._commit({sections:m})}_onCardDragStart(t,r){if(!t.dataTransfer)return;t.stopPropagation(),t.dataTransfer.setData(lp,r),t.dataTransfer.effectAllowed="move";let n=this._findSection(r);n&&this._startGhost(t,{section:n}),setTimeout(()=>this._draggingId=r)}_startGhost(t,r){if(!t.dataTransfer)return;let n=t.currentTarget.getBoundingClientRect(),a=this.getBoundingClientRect();this._ghostGrip={x:t.clientX-n.left,y:t.clientY-n.top},this._ghostOrigin={x:a.left,y:a.top},this._dragGhost=r,t.dataTransfer.setDragImage(Pv(),0,0),document.addEventListener("dragover",this._onGhostDragOver,!0),document.addEventListener("drop",this._onGhostDrop,!0),document.addEventListener("dragleave",this._onGhostDragLeave,!0),this.updateComplete.then(()=>{this._ghostEl=this.shadowRoot?.querySelector(".drag-ghost")??null,this._ghostEl&&(this._ghostEl.style.width=`${n.width}px`,this._moveGhost(t.clientX,t.clientY))})}_moveGhost(t,r){if(!this._ghostEl)return;this._ghostEl.style.visibility="";let n=t-this._ghostOrigin.x-this._ghostGrip.x,a=r-this._ghostOrigin.y-this._ghostGrip.y;this._ghostEl.style.transform=`translate(${n}px, ${a}px)`}_endGhost(){document.removeEventListener("dragover",this._onGhostDragOver,!0),document.removeEventListener("drop",this._onGhostDrop,!0),document.removeEventListener("dragleave",this._onGhostDragLeave,!0),this._ghostEl=null,this._dragGhost=null}_renderDragGhost(){let t=this._dragGhost;if(!t)return"";if("type"in t){let a=t.type;return u`
5888
5888
  <zn-page-palette-item
5889
5889
  class="drag-ghost"
5890
5890
  type="${a.type}"
@@ -6040,7 +6040,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6040
6040
  <zn-icon src="add" size="14"></zn-icon>
6041
6041
  </button>
6042
6042
  ${this._pickerIndex===t?this._renderTypePicker(this.registry.all(),r=>this.addSection(r,t)):""}
6043
- </div>`}_buildInspectorForm(){this._form=null;let t=this._selectedSection(),r=t?this.registry.get(t.type):void 0;if(!t||!r?.configTemplate||r.renderConfig)return;let n=document.createElement("div");n.className="inspector__form",n.append(r.configTemplate.content.cloneNode(!0)),n.querySelectorAll("zn-toggle:not([label-position])").forEach(a=>{a.setAttribute("label-position","left")}),customElements.upgrade(n),n.querySelectorAll("[name]").forEach(a=>{let s=a.getAttribute("name"),l=t.data[s];this._isBooleanControl(a,l)?a.checked=!!l:Array.isArray(l)?a.value=l:l!=null&&(a.value=String(l))}),this._form=n.childElementCount?n:null,this._inspectorWide=!!this._form?.querySelector('zn-remarkd-editor, [input-type="remarkd"]')}_isBooleanControl(t,r){return typeof r=="boolean"||t.matches('zn-toggle, zn-checkbox, input[type="checkbox"]')}_updateSectionData(t,r){this._pushHistory(),this._commit({sections:this._patchSection(t,n=>({...n,data:{...n.data,...r}}))})}_swapPinnedType(t){let r=this._pinnedId,n=this._findSection(r);!r||!n||n.type===t||!this._requiredFirstTypes.includes(t)||(this._pushHistory(),this._commit({sections:this._patchSection(r,a=>({...a,type:t}))}),this._buildInspectorForm())}_renameSection(t,r){this._pushHistory(),this._commit({sections:this._patchSection(t,n=>({...n,label:r||void 0}))})}_clampInspector(t){let r=this.getBoundingClientRect().width-uP;return Math.round(Math.min(Math.max(t,Vv),Math.max(r,Vv)))}_inspectorRect(){return this.shadowRoot?.querySelector(".inspector")?.getBoundingClientRect().width??Vv}_renderSwapControl(t){let r=this._requiredFirstTypes;return r.length<2||!this._isPinned(t.id)?"":u`
6043
+ </div>`}_buildInspectorForm(){this._form=null;let t=this._selectedSection(),r=t?this.registry.get(t.type):void 0;if(!t||!r?.configTemplate||r.renderConfig)return;let n=document.createElement("div");n.className="inspector__form",n.append(r.configTemplate.content.cloneNode(!0)),n.querySelectorAll("zn-toggle:not([label-position])").forEach(a=>{a.setAttribute("label-position","left")}),customElements.upgrade(n),n.querySelectorAll("[name]").forEach(a=>{let s=a.getAttribute("name"),l=t.data[s];this._isBooleanControl(a,l)?a.checked=!!l:Array.isArray(l)?a.value=l:l!=null&&(a.value=String(l))}),this._form=n.childElementCount?n:null,this._inspectorWide=!!this._form?.querySelector('zn-remarkd-editor, [input-type="remarkd"]')}_isBooleanControl(t,r){return typeof r=="boolean"||t.matches('zn-toggle, zn-checkbox, input[type="checkbox"]')}_updateSectionData(t,r){this._pushHistory(),this._commit({sections:this._patchSection(t,n=>({...n,data:{...n.data,...r}}))})}_swapPinnedType(t){let r=this._pinnedId,n=this._findSection(r);!r||!n||n.type===t||!this._requiredFirstTypes.includes(t)||(this._pushHistory(),this._commit({sections:this._patchSection(r,a=>({...a,type:t}))}),this._buildInspectorForm())}_renameSection(t,r){this._pushHistory(),this._commit({sections:this._patchSection(t,n=>({...n,label:r||void 0}))})}_clampInspector(t){let r=this.getBoundingClientRect().width-fP;return Math.round(Math.min(Math.max(t,Vv),Math.max(r,Vv)))}_inspectorRect(){return this.shadowRoot?.querySelector(".inspector")?.getBoundingClientRect().width??Vv}_renderSwapControl(t){let r=this._requiredFirstTypes;return r.length<2||!this._isPinned(t.id)?"":u`
6044
6044
  <zn-select
6045
6045
  class="inspector__swap"
6046
6046
  label="Section type"
@@ -6127,7 +6127,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6127
6127
  <slot name="config" class="declarations" @slotchange="${this._registerSlottedTemplates}"></slot>
6128
6128
  </div>
6129
6129
  ${this._renderDragGhost()}
6130
- `}};Le.styles=k(e8),Le.dependencies={"zn-collapsible":rs,"zn-icon":he,"zn-input":xt,"zn-option":at,"zn-page-palette-item":Hv,"zn-page-section-card":Fv,"zn-select":Je},c([p()],Le.prototype,"name",2),c([p({reflect:!0})],Le.prototype,"form",2),c([p()],Le.prototype,"config",2),c([p({reflect:!0})],Le.prototype,"heading",2),c([p({reflect:!0})],Le.prototype,"subheading",2),c([p({attribute:"required-first",reflect:!0})],Le.prototype,"requiredFirst",2),c([p({attribute:!1})],Le.prototype,"sectionTypes",2),c([p({type:Boolean,reflect:!0,attribute:"palette-collapsed"})],Le.prototype,"paletteCollapsed",2),c([p({type:Boolean,reflect:!0,attribute:"inspector-collapsed"})],Le.prototype,"inspectorCollapsed",2),c([p({attribute:"auto-save",converter:{fromAttribute:t=>{if(t===null)return null;let r=parseFloat(t);return Number.isFinite(r)&&r>0?r:mP},toAttribute:t=>t===null?null:String(t)}})],Le.prototype,"autoSave",2),c([D()],Le.prototype,"_state",2),c([D()],Le.prototype,"_selectedId",2),c([D()],Le.prototype,"_search",2),c([D()],Le.prototype,"_pickerIndex",2),c([D()],Le.prototype,"_dragOverIndex",2),c([D()],Le.prototype,"_draggingId",2),c([D()],Le.prototype,"_dragGhost",2),c([D()],Le.prototype,"_slotDragOver",2),c([D()],Le.prototype,"_slotPicker",2),c([D()],Le.prototype,"_form",2),c([D()],Le.prototype,"_inspectorWidth",2),c([D()],Le.prototype,"_inspectorWide",2),c([Q("config")],Le.prototype,"handleConfigChange",1),c([Q("requiredFirst")],Le.prototype,"handleRequiredFirstChange",1),c([Q("sectionTypes")],Le.prototype,"handleSectionTypesChange",1),c([D()],Le.prototype,"_lastSavedAt",2),c([D()],Le.prototype,"_justSaved",2),c([D()],Le.prototype,"_statusNow",2),c([D()],Le.prototype,"_restorePrompt",2);var gP=Le;Le.define("zn-page-builder");var i8=S`:host{display:block}:host([fill]){flex:1 1 auto;min-height:0}.preview{position:relative;width:100%;overflow-x:hidden;overflow-y:auto;background:radial-gradient(circle,rgba(var(--zn-text),var(--zn-preview-frame-dot-opacity,0.08)) 1px,transparent 1px) 0 0/var(--zn-preview-frame-dot-spacing,20px) var(--zn-preview-frame-dot-spacing,20px),rgb(var(--zn-body))}:host([backdrop=panel]) .preview{background:rgb(var(--zn-panel))}.preview__stage{height:100%;max-width:100%;margin:0 auto;overflow:hidden}iframe{display:block;width:100%;border:0;pointer-events:none;background:rgb(var(--zn-body))}:host([interactive]) iframe{pointer-events:auto}.preview__error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;text-align:center;background:rgba(0,0,0,0.65);color:#fff}`;var n8={desktop:"100%",tablet:"768px",mobile:"390px"},jt=class extends T{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.watch="form[data-auto-save]";this.refreshOn="form";this.debounce=400;this.zoom=1;this.minHeight=480;this.fill=!1;this.device="desktop";this.backdrop="dots";this.interactive=!1;this.error="";this._contentHeight=0;this._generation=0;this._watchedForms=new Set;this._debounceTimers=new Map;this._shellSaveRoots=[];this._formObserver=new Ze(this,{target:null,config:{subtree:!0,childList:!0},callback:()=>this._attachForms()});this._onMessage=t=>{if(t.origin!==this.frameOrigin||!this.frame||t.source!==this.frame.contentWindow)return;let r=t.data;switch(r?.type){case"hp-preview:ready":this._sendConfig().then(()=>this._postTheme());break;case"hp-preview:rendered":this.error="",this._applyContentHeight(r.height);break;case"hp-preview:height":this._applyContentHeight(r.height);break;case"hp-preview:error":this._fail(String(r.message??"Preview failed to render"));break}};this._onFrameLoad=()=>{this._contentObserver?.disconnect(),this._contentObserver=void 0;let t;try{t=this.frame?.contentDocument?.documentElement}catch{return}if(!t)return;let r=()=>{let n=t.getBoundingClientRect().height;n>(this.frame?.clientHeight??0)&&this._applyContentHeight(n)};r(),this._contentObserver=new ResizeObserver(r),this._contentObserver.observe(t)};this._onShellSave=t=>{if(t===this._lastShellSave||(this._lastShellSave=t,!this.refreshOn))return;let r=t.composedPath()[0];!(r instanceof HTMLFormElement)||!r.matches(this.refreshOn)||this._watchedForms.has(r)||this._sendConfig()};this._onChange=t=>{let r=t.currentTarget,n=this._debounceTimers.get(r);n&&window.clearTimeout(n),this._debounceTimers.set(r,window.setTimeout(()=>{this._debounceTimers.delete(r),r.isConnected&&r.requestSubmit()},this.debounce))};this._onSubmit=t=>{t.preventDefault(),t.stopImmediatePropagation(),this._save(t.currentTarget)}}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this._onMessage),this._attachForms();let t=this.getRootNode();this._shellSaveRoots=t instanceof ShadowRoot?[document,t]:[document],this._shellSaveRoots.forEach(r=>r.addEventListener("complete",this._onShellSave)),t instanceof Document?this._formObserver.observe(t.body):t instanceof ShadowRoot&&this._formObserver.observe(t)}willUpdate(t){t.has("src")&&this._resetContentHeight()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this._onMessage),this._contentObserver?.disconnect(),this._contentObserver=void 0,this._watchedForms.forEach(t=>this._detachForm(t)),this._watchedForms.clear(),this._shellSaveRoots.forEach(t=>t.removeEventListener("complete",this._onShellSave)),this._shellSaveRoots=[]}_applyContentHeight(t){let r=Math.round(Number(t));!Number.isFinite(r)||r<=0||(this._contentHeight=r)}_resetContentHeight(){this._contentHeight=0,this._contentObserver?.disconnect(),this._contentObserver=void 0}refresh(){return this._sendConfig()}setTheme(t){this._theme=t,this._postTheme()}_postTheme(){!this._theme||!this.frameOrigin||this.frame?.contentWindow?.postMessage({type:"hp-preview:theme",...this._theme},this.frameOrigin)}async _sendConfig(){if(!this.dataUri||!this.frameOrigin)return;let t=++this._generation;try{let r=await fetch(this.dataUri,{credentials:"same-origin",headers:{"x-kx-fetch-style":"download"}});if(!r.ok)throw new Error(await r.text()||r.statusText);let n=await r.json();if(t!==this._generation)return;this.frame?.contentWindow?.postMessage({type:"hp-preview:config",...n},this.frameOrigin)}catch(r){t===this._generation&&this._fail(r instanceof Error?r.message:String(r))}}_attachForms(){let t=this.getRootNode(),r=new Set;t.querySelectorAll(this.watch).forEach(n=>{n instanceof HTMLFormElement&&r.add(n)}),this._watchedForms.forEach(n=>{r.has(n)||(this._detachForm(n),this._watchedForms.delete(n))}),r.forEach(n=>{this._watchedForms.has(n)||(this._watchedForms.add(n),n.addEventListener("submit",this._onSubmit,{capture:!0}),n.addEventListener("zn-change",this._onChange),n.addEventListener("zn-input",this._onChange),n.addEventListener("change",this._onChange))})}_detachForm(t){t.removeEventListener("submit",this._onSubmit,{capture:!0}),t.removeEventListener("zn-change",this._onChange),t.removeEventListener("zn-input",this._onChange),t.removeEventListener("change",this._onChange);let r=this._debounceTimers.get(t);r&&window.clearTimeout(r),this._debounceTimers.delete(t)}async _save(t){try{let r=await fetch(t.getAttribute("action")||"",{method:"POST",credentials:"same-origin",headers:{"x-kx-fetch-style":"download"},body:new FormData(t)}),n=r.headers.get("x-kubex-alert-danger");if(n)throw new Error(n);if(!r.ok)throw new Error(await r.text()||r.statusText);await this._sendConfig()}catch(r){this._fail(r instanceof Error?r.message:String(r))}}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}render(){let t=this.zoom>0&&this.zoom<=1?this.zoom:1,r=this.error||this.interactive?0:this._contentHeight,n=this.fill?{width:"100%",height:r?`max(${r}px, 100%)`:"100%"}:{width:`${100/t}%`,height:`${Math.max(r,this.minHeight/t)}px`,transform:`scale(${t})`,transformOrigin:"0 0"},a=this.fill?{height:"100%",minHeight:`${this.minHeight}px`}:{height:`${this.minHeight}px`},s={width:n8[this.device]??n8.desktop};return r&&(s.height=this.fill?`max(${r}px, 100%)`:`${Math.max(r*t,this.minHeight)}px`),u`
6130
+ `}};Le.styles=k(e8),Le.dependencies={"zn-collapsible":rs,"zn-icon":he,"zn-input":xt,"zn-option":at,"zn-page-palette-item":Hv,"zn-page-section-card":Fv,"zn-select":Je},c([p()],Le.prototype,"name",2),c([p({reflect:!0})],Le.prototype,"form",2),c([p()],Le.prototype,"config",2),c([p({reflect:!0})],Le.prototype,"heading",2),c([p({reflect:!0})],Le.prototype,"subheading",2),c([p({attribute:"required-first",reflect:!0})],Le.prototype,"requiredFirst",2),c([p({attribute:!1})],Le.prototype,"sectionTypes",2),c([p({type:Boolean,reflect:!0,attribute:"palette-collapsed"})],Le.prototype,"paletteCollapsed",2),c([p({type:Boolean,reflect:!0,attribute:"inspector-collapsed"})],Le.prototype,"inspectorCollapsed",2),c([p({attribute:"auto-save",converter:{fromAttribute:t=>{if(t===null)return null;let r=parseFloat(t);return Number.isFinite(r)&&r>0?r:gP},toAttribute:t=>t===null?null:String(t)}})],Le.prototype,"autoSave",2),c([D()],Le.prototype,"_state",2),c([D()],Le.prototype,"_selectedId",2),c([D()],Le.prototype,"_search",2),c([D()],Le.prototype,"_pickerIndex",2),c([D()],Le.prototype,"_dragOverIndex",2),c([D()],Le.prototype,"_draggingId",2),c([D()],Le.prototype,"_dragGhost",2),c([D()],Le.prototype,"_slotDragOver",2),c([D()],Le.prototype,"_slotPicker",2),c([D()],Le.prototype,"_form",2),c([D()],Le.prototype,"_inspectorWidth",2),c([D()],Le.prototype,"_inspectorWide",2),c([Q("config")],Le.prototype,"handleConfigChange",1),c([Q("requiredFirst")],Le.prototype,"handleRequiredFirstChange",1),c([Q("sectionTypes")],Le.prototype,"handleSectionTypesChange",1),c([D()],Le.prototype,"_lastSavedAt",2),c([D()],Le.prototype,"_justSaved",2),c([D()],Le.prototype,"_statusNow",2),c([D()],Le.prototype,"_restorePrompt",2);var vP=Le;Le.define("zn-page-builder");var i8=S`:host{display:block}:host([fill]){flex:1 1 auto;min-height:0}.preview{position:relative;width:100%;overflow-x:hidden;overflow-y:auto;background:radial-gradient(circle,rgba(var(--zn-text),var(--zn-preview-frame-dot-opacity,0.08)) 1px,transparent 1px) 0 0/var(--zn-preview-frame-dot-spacing,20px) var(--zn-preview-frame-dot-spacing,20px),rgb(var(--zn-body))}:host([backdrop=panel]) .preview{background:rgb(var(--zn-panel))}.preview__stage{height:100%;max-width:100%;margin:0 auto;overflow:hidden}iframe{display:block;width:100%;border:0;pointer-events:none;background:rgb(var(--zn-body))}:host([interactive]) iframe{pointer-events:auto}.preview__error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;text-align:center;background:rgba(0,0,0,0.65);color:#fff}`;var n8={desktop:"100%",tablet:"768px",mobile:"390px"},jt=class extends T{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.watch="form[data-auto-save]";this.refreshOn="form";this.debounce=400;this.zoom=1;this.minHeight=480;this.fill=!1;this.device="desktop";this.backdrop="dots";this.interactive=!1;this.error="";this._contentHeight=0;this._generation=0;this._watchedForms=new Set;this._debounceTimers=new Map;this._shellSaveRoots=[];this._formObserver=new Ze(this,{target:null,config:{subtree:!0,childList:!0},callback:()=>this._attachForms()});this._onMessage=t=>{if(t.origin!==this.frameOrigin||!this.frame||t.source!==this.frame.contentWindow)return;let r=t.data;switch(r?.type){case"hp-preview:ready":this._sendConfig().then(()=>this._postTheme());break;case"hp-preview:rendered":this.error="",this._applyContentHeight(r.height);break;case"hp-preview:height":this._applyContentHeight(r.height);break;case"hp-preview:error":this._fail(String(r.message??"Preview failed to render"));break}};this._onFrameLoad=()=>{this._contentObserver?.disconnect(),this._contentObserver=void 0;let t;try{t=this.frame?.contentDocument?.documentElement}catch{return}if(!t)return;let r=()=>{let n=t.getBoundingClientRect().height;n>(this.frame?.clientHeight??0)&&this._applyContentHeight(n)};r(),this._contentObserver=new ResizeObserver(r),this._contentObserver.observe(t)};this._onShellSave=t=>{if(t===this._lastShellSave||(this._lastShellSave=t,!this.refreshOn))return;let r=t.composedPath()[0];!(r instanceof HTMLFormElement)||!r.matches(this.refreshOn)||this._watchedForms.has(r)||this._sendConfig()};this._onChange=t=>{let r=t.currentTarget,n=this._debounceTimers.get(r);n&&window.clearTimeout(n),this._debounceTimers.set(r,window.setTimeout(()=>{this._debounceTimers.delete(r),r.isConnected&&r.requestSubmit()},this.debounce))};this._onSubmit=t=>{t.preventDefault(),t.stopImmediatePropagation(),this._save(t.currentTarget)}}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this._onMessage),this._attachForms();let t=this.getRootNode();this._shellSaveRoots=t instanceof ShadowRoot?[document,t]:[document],this._shellSaveRoots.forEach(r=>r.addEventListener("complete",this._onShellSave)),t instanceof Document?this._formObserver.observe(t.body):t instanceof ShadowRoot&&this._formObserver.observe(t)}willUpdate(t){t.has("src")&&this._resetContentHeight()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this._onMessage),this._contentObserver?.disconnect(),this._contentObserver=void 0,this._watchedForms.forEach(t=>this._detachForm(t)),this._watchedForms.clear(),this._shellSaveRoots.forEach(t=>t.removeEventListener("complete",this._onShellSave)),this._shellSaveRoots=[]}_applyContentHeight(t){let r=Math.round(Number(t));!Number.isFinite(r)||r<=0||(this._contentHeight=r)}_resetContentHeight(){this._contentHeight=0,this._contentObserver?.disconnect(),this._contentObserver=void 0}refresh(){return this._sendConfig()}setTheme(t){this._theme=t,this._postTheme()}_postTheme(){!this._theme||!this.frameOrigin||this.frame?.contentWindow?.postMessage({type:"hp-preview:theme",...this._theme},this.frameOrigin)}async _sendConfig(){if(!this.dataUri||!this.frameOrigin)return;let t=++this._generation;try{let r=await fetch(this.dataUri,{credentials:"same-origin",headers:{"x-kx-fetch-style":"download"}});if(!r.ok)throw new Error(await r.text()||r.statusText);let n=await r.json();if(t!==this._generation)return;this.frame?.contentWindow?.postMessage({type:"hp-preview:config",...n},this.frameOrigin)}catch(r){t===this._generation&&this._fail(r instanceof Error?r.message:String(r))}}_attachForms(){let t=this.getRootNode(),r=new Set;t.querySelectorAll(this.watch).forEach(n=>{n instanceof HTMLFormElement&&r.add(n)}),this._watchedForms.forEach(n=>{r.has(n)||(this._detachForm(n),this._watchedForms.delete(n))}),r.forEach(n=>{this._watchedForms.has(n)||(this._watchedForms.add(n),n.addEventListener("submit",this._onSubmit,{capture:!0}),n.addEventListener("zn-change",this._onChange),n.addEventListener("zn-input",this._onChange),n.addEventListener("change",this._onChange))})}_detachForm(t){t.removeEventListener("submit",this._onSubmit,{capture:!0}),t.removeEventListener("zn-change",this._onChange),t.removeEventListener("zn-input",this._onChange),t.removeEventListener("change",this._onChange);let r=this._debounceTimers.get(t);r&&window.clearTimeout(r),this._debounceTimers.delete(t)}async _save(t){try{let r=await fetch(t.getAttribute("action")||"",{method:"POST",credentials:"same-origin",headers:{"x-kx-fetch-style":"download"},body:new FormData(t)}),n=r.headers.get("x-kubex-alert-danger");if(n)throw new Error(n);if(!r.ok)throw new Error(await r.text()||r.statusText);await this._sendConfig()}catch(r){this._fail(r instanceof Error?r.message:String(r))}}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}render(){let t=this.zoom>0&&this.zoom<=1?this.zoom:1,r=this.error||this.interactive?0:this._contentHeight,n=this.fill?{width:"100%",height:r?`max(${r}px, 100%)`:"100%"}:{width:`${100/t}%`,height:`${Math.max(r,this.minHeight/t)}px`,transform:`scale(${t})`,transformOrigin:"0 0"},a=this.fill?{height:"100%",minHeight:`${this.minHeight}px`}:{height:`${this.minHeight}px`},s={width:n8[this.device]??n8.desktop};return r&&(s.height=this.fill?`max(${r}px, 100%)`:`${Math.max(r*t,this.minHeight)}px`),u`
6131
6131
  <div part="base" class="preview" style="${It(a)}">
6132
6132
  <div part="stage" class="preview__stage" style="${It(s)}">
6133
6133
  <iframe part="iframe"
@@ -6139,7 +6139,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6139
6139
  </div>
6140
6140
  ${this.error?u`
6141
6141
  <div part="error" class="preview__error">${this.error}</div>`:""}
6142
- </div>`}};jt.styles=k(i8),c([p()],jt.prototype,"src",2),c([p({attribute:"frame-origin"})],jt.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],jt.prototype,"dataUri",2),c([p()],jt.prototype,"watch",2),c([p({attribute:"refresh-on"})],jt.prototype,"refreshOn",2),c([p({type:Number})],jt.prototype,"debounce",2),c([p({type:Number})],jt.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],jt.prototype,"minHeight",2),c([p({type:Boolean})],jt.prototype,"fill",2),c([p({reflect:!0})],jt.prototype,"device",2),c([p({reflect:!0})],jt.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],jt.prototype,"interactive",2),c([U("iframe")],jt.prototype,"frame",2),c([D()],jt.prototype,"error",2),c([D()],jt.prototype,"_contentHeight",2);var Uv=jt;jt.define("zn-preview-frame");var o8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;--zn-theme-editor-controls-width:343px;height:100%}.editor{--controls-col:var(--zn-theme-editor-controls-width);display:flex;align-items:stretch;height:100%}.editor--controls-collapsed{--controls-col:0px}.editor--controls-collapsed .editor__controls{border-right:none}.editor--controls-collapsed .editor__controls-header,.editor--controls-collapsed .editor__controls-body{padding:0}:host([standalone]) .editor{background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.editor__toolbar{display:flex;align-items:center;flex:0 0 auto;min-height:44px;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small) var(--zn-spacing-medium);border-bottom:1px solid rgb(var(--zn-border-color))}.editor__toolbar-actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto}.editor__caption{font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__controls{--zn-active-nav-background:var(--zn-panel);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;position:relative;display:flex;flex-direction:column;flex:0 0 var(--controls-col);min-width:0;max-width:100%;background:rgb(var(--zn-panel));border-right:1px solid rgb(var(--zn-border-color));overflow:hidden;transition:flex-basis 0.2s ease}.editor__controls-inner{position:absolute;inset:0;display:flex;flex-direction:column}.editor__controls-header{display:flex;align-items:center;flex:0 0 auto;min-height:44px;padding:var(--zn-spacing-small) var(--zn-spacing-medium)}.editor__controls-body{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0}.editor__main{position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.editor__fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0;overflow-y:auto}::slotted(zn-collapsible){width:100%}.editor__fields--sections-only .editor__section:first-of-type{border-top:none}.editor__section{display:block;border-top:1px solid rgba(var(--zn-border-color),0.5)}.editor__section::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.editor__section::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__section-fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}.editor__tabs{display:block}.editor__section-slot{padding-top:var(--zn-spacing-sm)}.editor__tab-panel{display:flex;flex-direction:column}.editor__footer{display:flex;flex:0 0 auto;gap:var(--zn-spacing-small);padding-top:var(--zn-spacing-small);border-top:1px solid rgb(var(--zn-border-color));margin-top:auto}.editor__preview{overflow:hidden;flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.editor__device[aria-pressed=true]{--zn-button-border-color:rgb(var(--zn-primary))}.editor__device[aria-pressed=true]::part(base){background:rgb(var(--zn-primary)) !important;color:white !important}.editor__mode{margin-left:auto}.editor__sources{width:auto}.editor__sources::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.editor__error{padding:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-small);border-radius:4px;background:rgba(var(--zn-color-error),0.1);border:1px solid rgb(var(--zn-color-error));color:rgb(var(--zn-color-error));font-size:0.8125rem}@media (max-width:768px){:host{height:auto}.editor{flex-direction:column;height:auto}.editor__fields,.editor__preview{overflow:visible}.editor__controls{flex-basis:auto;width:100%;border-right:none;border-bottom:1px solid rgb(var(--zn-border-color))}.editor__controls-inner{position:static}.editor--controls-collapsed .editor__controls{display:none}.editor__main{width:100%;padding-top:var(--zn-spacing-medium)}.panel-toggle{top:-12px;transform:translateX(-50%);transition:top 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle--left{left:50%}.panel-toggle--left.panel-toggle--tucked{top:8px;left:50%}}`;var bP=new Set(["zn-checkbox","zn-toggle"]),vP="(max-width: 768px)",yP=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function xP(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Ke=class extends T{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.mode="light";this.device="desktop";this.minHeight=480;this.debounce=150;this.action="";this.saveDebounce=1e3;this.sections=[];this.sectionLayout="collapsible";this.sources=[];this.controlsCollapsed=!1;this.standalone=!1;this.controlsCaption="";this.previewCaption="";this.submitLabel="";this.manual=!1;this.error="";this._submitting=!1;this._sourceIndex=0;this.hasSlotController=new te(this,"footer","[default]");this._saving=!1;this._saveQueued=!1;this._saveWaiters=[];this._narrowQuery=window.matchMedia(vP);this._wasNarrow=!1;this._mounted=!1;this._lastControls=[];this._controlsObserverConfig={childList:!0,subtree:!0};this._controlsObserver=new Ze(this,{target:null,config:this._controlsObserverConfig,callback:()=>this._pushIfControlsChanged()});this._modeValues={light:{},dark:{}};this._suppressDepth=0;this._openedInitialCollapsible=!1;this._onNarrowChange=t=>{t.matches&&!this._wasNarrow&&(this.controlsCollapsed=!0),this._wasNarrow=t.matches};this._onSubmit=()=>{if(!this._submitting){if(this._flushPendingEdit(),this._saveTimer&&(window.clearTimeout(this._saveTimer),this._saveTimer=void 0),!this.action){this.emit("zn-theme-submit",{detail:{values:this.values}});return}this._submitting=!0,this._awaitSave().then(t=>{t&&this.emit("zn-theme-submit",{detail:{values:this.values}})}).finally(()=>{this._submitting=!1})}};this._onControlChange=()=>{this._suppressDepth>0||(this._pushTimer&&window.clearTimeout(this._pushTimer),this._pushTimer=window.setTimeout(()=>{this._pushTimer=void 0,this._harvestInto(this.mode),this._push(),this._queueSave()},this.debounce))};this._onSlotChange=()=>{this._pushIfControlsChanged()};this._setDevice=t=>{this.device!==t&&(this.device=t,this._announce())};this._toggleMode=()=>{this._flushPendingEdit(),this.mode=this.mode==="dark"?"light":"dark",this._writeBack(),this._push()};this._onFrameError=t=>{this.error=t.detail.message??"Preview failed to render"};this._onSourceChange=t=>{let r=Number(t.target.value);Number.isNaN(r)||(this._sourceIndex=r)}}get values(){return{light:{...this._modeValues.light},dark:{...this._modeValues.dark}}}get activeValues(){return{...this._modeValues[this.mode]}}_controlSlots(){return[this.controlsSlot,...Array.from(this.sectionSlots??[])].filter(t=>!!t)}_harvestNamed(){let t=[];for(let r of this._controlSlots()){let n=r.assignedElements({flatten:!0});for(let a of n){let s=[a,...Array.from(a.querySelectorAll("[name]"))];for(let l of s){let d=l;!d.getAttribute?.("name")||d.disabled||t.push({name:d.getAttribute("name"),control:d})}}}return t}_hasAssignedControls(t){return Array.from(this.children).some(r=>r.getAttribute("slot")===t)}_isBooleanControl(t){return bP.has(t.tagName.toLowerCase())||t.type==="checkbox"}_readControlValue(t){return this._isBooleanControl(t)?!!t.checked:t.value}_seed(){for(let{name:t,control:r}of this._harvestNamed()){if(t in this._modeValues.light)continue;let n=this._readControlValue(r);this._modeValues.light[t]=n;let a=r.getAttribute("dark-value");this._modeValues.dark[t]=a===null?n:this._isBooleanControl(r)?a==="1"||a==="true":a}}_writeBack(t=this.mode){let r=!1;for(let{name:n,control:a}of this._harvestNamed()){if(!(n in this._modeValues[t]))continue;let s=this._modeValues[t][n],l=this._isBooleanControl(a),d=l?!!a.checked:a.value;(l?d===s:String(d)===String(s))||(r=!0,l?a.checked=!!s:a.value=s)}r&&(this._suppressDepth++,window.setTimeout(()=>{this._suppressDepth--},0))}_harvestInto(t){for(let{name:r,control:n}of this._harvestNamed())this._modeValues[t][r]=this._readControlValue(n)}connectedCallback(){super.connectedCallback(),this._controlsObserver.observe(this),this._narrowQuery.addEventListener("change",this._onNarrowChange),this._onNarrowChange(this._narrowQuery)}disconnectedCallback(){this._pushTimer&&window.clearTimeout(this._pushTimer),this._saveTimer&&window.clearTimeout(this._saveTimer),this._narrowQuery.removeEventListener("change",this._onNarrowChange),super.disconnectedCallback()}firstUpdated(){this._pushIfControlsChanged()}_push(){this.error="",this.frame?.setTheme({mode:this.mode,values:this.activeValues}),this._announce()}_queueSave(){!this.action||this.manual||(this._saveTimer&&window.clearTimeout(this._saveTimer),this._saveTimer=window.setTimeout(()=>{this._saveTimer=void 0,this._save()},this.saveDebounce))}async _save(){if(this._saving){this._saveQueued=!0;return}this._saving=!0;let t=!1;try{let r=new FormData;for(let a of["light","dark"])for(let[s,l]of Object.entries(this._modeValues[a]))r.append(`${a}[${s}]`,typeof l=="boolean"?l?"1":"":String(l??""));let n=await fetch(this.action,{method:"POST",credentials:"same-origin",body:r});if(!n.ok)throw new Error(await n.text()||n.statusText);this.error="",t=!0}catch(r){this._fail(r instanceof Error?r.message:String(r))}finally{if(this._saving=!1,this._saveQueued)this._saveQueued=!1,this._save();else{let r=this._saveWaiters;this._saveWaiters=[],r.forEach(n=>n(t))}}}_awaitSave(){return new Promise(t=>{this._saveWaiters.push(t),this._save()})}_pushIfControlsChanged(){this.requestUpdate();let t=this._harvestNamed().map(({control:n})=>n);(!this._mounted||t.length!==this._lastControls.length||t.some((n,a)=>n!==this._lastControls[a]))&&(this._flushPendingEdit(),this._mounted=!0,this._lastControls=t,this._seed(),this._writeBack(),this._push())}_flushPendingEdit(){this._pushTimer&&(window.clearTimeout(this._pushTimer),this._pushTimer=void 0,this._harvestInto(this.mode),this._queueSave())}_announce(){this.emit("zn-theme-change",{detail:{values:this.values,mode:this.mode,device:this.device}})}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}_sourcesSafe(){return Array.isArray(this.sources)?this.sources:[]}_frameSrc(){let t=this._sourcesSafe();return t.length>0?(t[this._sourceIndex]??t[0]).src:this.src}_sectionsSafe(){return Array.isArray(this.sections)?this.sections:[]}_groupsFor(t){return Array.isArray(t?.groups)?t.groups:[]}_hasStructureAttributes(){return Array.from(this.children).some(t=>t.hasAttribute("group")||t.hasAttribute("category"))}_usesDerivedSections(){return this._sectionsSafe().length===0&&this._hasStructureAttributes()}_derive(){let t=new Set,r=l=>{let d=xP(l)||"group",h=d;for(let m=2;t.has(h);m++)h=`${d}-${m}`;return t.add(h),h},n=new Map,a=new Map,s=new Map;for(let l of Array.from(this.children)){let d=l.getAttribute("group")?.trim()??"",h=l.getAttribute("category")?.trim()??"";if(!d&&!h)continue;let m=d||h,f=n.get(m);if(f||(f={name:r(m),caption:m,groups:[]},n.set(m,f)),!d||!h){s.set(l,f.name);continue}let b=`${m}\0${h}`,g=a.get(b);g||(g=r(`${m}-${h}`),a.set(b,g),f.groups.push({name:g,caption:h})),s.set(l,g)}return{sections:Array.from(n.values()),assignments:s}}_effectiveSections(){return this._usesDerivedSections()?this._derive().sections:this._sectionsSafe()}_assignDerivedSlots(){if(this._usesDerivedSections())for(let[t,r]of this._derive().assignments)t.getAttribute("slot")!==r&&t.setAttribute("slot",r)}willUpdate(t){super.willUpdate(t),this._assignDerivedSlots()}_hasNestedGroups(){return this._effectiveSections().some(t=>this._groupsFor(t).length>0)}_visibleGroups(t){return this._groupsFor(t).filter(r=>this._hasAssignedControls(r.name))}_visibleSections(){let t=this._effectiveSections();return this._hasNestedGroups()?t.filter(r=>this._visibleGroups(r).length>0):t.filter(r=>this._hasAssignedControls(r.name))}_renderSections(){return this._visibleSections().map(t=>u`
6142
+ </div>`}};jt.styles=k(i8),c([p()],jt.prototype,"src",2),c([p({attribute:"frame-origin"})],jt.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],jt.prototype,"dataUri",2),c([p()],jt.prototype,"watch",2),c([p({attribute:"refresh-on"})],jt.prototype,"refreshOn",2),c([p({type:Number})],jt.prototype,"debounce",2),c([p({type:Number})],jt.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],jt.prototype,"minHeight",2),c([p({type:Boolean})],jt.prototype,"fill",2),c([p({reflect:!0})],jt.prototype,"device",2),c([p({reflect:!0})],jt.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],jt.prototype,"interactive",2),c([U("iframe")],jt.prototype,"frame",2),c([D()],jt.prototype,"error",2),c([D()],jt.prototype,"_contentHeight",2);var Uv=jt;jt.define("zn-preview-frame");var o8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;--zn-theme-editor-controls-width:343px;height:100%}.editor{--controls-col:var(--zn-theme-editor-controls-width);display:flex;align-items:stretch;height:100%}.editor--controls-collapsed{--controls-col:0px}.editor--controls-collapsed .editor__controls{border-right:none}.editor--controls-collapsed .editor__controls-header,.editor--controls-collapsed .editor__controls-body{padding:0}:host([standalone]) .editor{background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.editor__toolbar{display:flex;align-items:center;flex:0 0 auto;min-height:44px;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small) var(--zn-spacing-medium);border-bottom:1px solid rgb(var(--zn-border-color))}.editor__toolbar-actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto}.editor__caption{font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__controls{--zn-active-nav-background:var(--zn-panel);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;position:relative;display:flex;flex-direction:column;flex:0 0 var(--controls-col);min-width:0;max-width:100%;background:rgb(var(--zn-panel));border-right:1px solid rgb(var(--zn-border-color));overflow:hidden;transition:flex-basis 0.2s ease}.editor__controls-inner{position:absolute;inset:0;display:flex;flex-direction:column}.editor__controls-header{display:flex;align-items:center;flex:0 0 auto;min-height:44px;padding:var(--zn-spacing-small) var(--zn-spacing-medium)}.editor__controls-body{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0}.editor__main{position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.editor__fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0;overflow-y:auto}::slotted(zn-collapsible){width:100%}.editor__fields--sections-only .editor__section:first-of-type{border-top:none}.editor__section{display:block;border-top:1px solid rgba(var(--zn-border-color),0.5)}.editor__section::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.editor__section::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__section-fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}.editor__tabs{display:block}.editor__section-slot{padding-top:var(--zn-spacing-sm)}.editor__tab-panel{display:flex;flex-direction:column}.editor__footer{display:flex;flex:0 0 auto;gap:var(--zn-spacing-small);padding-top:var(--zn-spacing-small);border-top:1px solid rgb(var(--zn-border-color));margin-top:auto}.editor__preview{overflow:hidden;flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.editor__device[aria-pressed=true]{--zn-button-border-color:rgb(var(--zn-primary))}.editor__device[aria-pressed=true]::part(base){background:rgb(var(--zn-primary)) !important;color:white !important}.editor__mode{margin-left:auto}.editor__sources{width:auto}.editor__sources::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.editor__error{padding:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-small);border-radius:4px;background:rgba(var(--zn-color-error),0.1);border:1px solid rgb(var(--zn-color-error));color:rgb(var(--zn-color-error));font-size:0.8125rem}@media (max-width:768px){:host{height:auto}.editor{flex-direction:column;height:auto}.editor__fields,.editor__preview{overflow:visible}.editor__controls{flex-basis:auto;width:100%;border-right:none;border-bottom:1px solid rgb(var(--zn-border-color))}.editor__controls-inner{position:static}.editor--controls-collapsed .editor__controls{display:none}.editor__main{width:100%;padding-top:var(--zn-spacing-medium)}.panel-toggle{top:-12px;transform:translateX(-50%);transition:top 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle--left{left:50%}.panel-toggle--left.panel-toggle--tucked{top:8px;left:50%}}`;var yP=new Set(["zn-checkbox","zn-toggle"]),xP="(max-width: 768px)",wP=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function _P(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Ke=class extends T{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.mode="light";this.device="desktop";this.minHeight=480;this.debounce=150;this.action="";this.saveDebounce=1e3;this.sections=[];this.sectionLayout="collapsible";this.sources=[];this.controlsCollapsed=!1;this.standalone=!1;this.controlsCaption="";this.previewCaption="";this.submitLabel="";this.manual=!1;this.error="";this._submitting=!1;this._sourceIndex=0;this.hasSlotController=new te(this,"footer","[default]");this._saving=!1;this._saveQueued=!1;this._saveWaiters=[];this._narrowQuery=window.matchMedia(xP);this._wasNarrow=!1;this._mounted=!1;this._lastControls=[];this._controlsObserverConfig={childList:!0,subtree:!0};this._controlsObserver=new Ze(this,{target:null,config:this._controlsObserverConfig,callback:()=>this._pushIfControlsChanged()});this._modeValues={light:{},dark:{}};this._suppressDepth=0;this._openedInitialCollapsible=!1;this._onNarrowChange=t=>{t.matches&&!this._wasNarrow&&(this.controlsCollapsed=!0),this._wasNarrow=t.matches};this._onSubmit=()=>{if(!this._submitting){if(this._flushPendingEdit(),this._saveTimer&&(window.clearTimeout(this._saveTimer),this._saveTimer=void 0),!this.action){this.emit("zn-theme-submit",{detail:{values:this.values}});return}this._submitting=!0,this._awaitSave().then(t=>{t&&this.emit("zn-theme-submit",{detail:{values:this.values}})}).finally(()=>{this._submitting=!1})}};this._onControlChange=()=>{this._suppressDepth>0||(this._pushTimer&&window.clearTimeout(this._pushTimer),this._pushTimer=window.setTimeout(()=>{this._pushTimer=void 0,this._harvestInto(this.mode),this._push(),this._queueSave()},this.debounce))};this._onSlotChange=()=>{this._pushIfControlsChanged()};this._setDevice=t=>{this.device!==t&&(this.device=t,this._announce())};this._toggleMode=()=>{this._flushPendingEdit(),this.mode=this.mode==="dark"?"light":"dark",this._writeBack(),this._push()};this._onFrameError=t=>{this.error=t.detail.message??"Preview failed to render"};this._onSourceChange=t=>{let r=Number(t.target.value);Number.isNaN(r)||(this._sourceIndex=r)}}get values(){return{light:{...this._modeValues.light},dark:{...this._modeValues.dark}}}get activeValues(){return{...this._modeValues[this.mode]}}_controlSlots(){return[this.controlsSlot,...Array.from(this.sectionSlots??[])].filter(t=>!!t)}_harvestNamed(){let t=[];for(let r of this._controlSlots()){let n=r.assignedElements({flatten:!0});for(let a of n){let s=[a,...Array.from(a.querySelectorAll("[name]"))];for(let l of s){let d=l;!d.getAttribute?.("name")||d.disabled||t.push({name:d.getAttribute("name"),control:d})}}}return t}_hasAssignedControls(t){return Array.from(this.children).some(r=>r.getAttribute("slot")===t)}_isBooleanControl(t){return yP.has(t.tagName.toLowerCase())||t.type==="checkbox"}_readControlValue(t){return this._isBooleanControl(t)?!!t.checked:t.value}_seed(){for(let{name:t,control:r}of this._harvestNamed()){if(t in this._modeValues.light)continue;let n=this._readControlValue(r);this._modeValues.light[t]=n;let a=r.getAttribute("dark-value");this._modeValues.dark[t]=a===null?n:this._isBooleanControl(r)?a==="1"||a==="true":a}}_writeBack(t=this.mode){let r=!1;for(let{name:n,control:a}of this._harvestNamed()){if(!(n in this._modeValues[t]))continue;let s=this._modeValues[t][n],l=this._isBooleanControl(a),d=l?!!a.checked:a.value;(l?d===s:String(d)===String(s))||(r=!0,l?a.checked=!!s:a.value=s)}r&&(this._suppressDepth++,window.setTimeout(()=>{this._suppressDepth--},0))}_harvestInto(t){for(let{name:r,control:n}of this._harvestNamed())this._modeValues[t][r]=this._readControlValue(n)}connectedCallback(){super.connectedCallback(),this._controlsObserver.observe(this),this._narrowQuery.addEventListener("change",this._onNarrowChange),this._onNarrowChange(this._narrowQuery)}disconnectedCallback(){this._pushTimer&&window.clearTimeout(this._pushTimer),this._saveTimer&&window.clearTimeout(this._saveTimer),this._narrowQuery.removeEventListener("change",this._onNarrowChange),super.disconnectedCallback()}firstUpdated(){this._pushIfControlsChanged()}_push(){this.error="",this.frame?.setTheme({mode:this.mode,values:this.activeValues}),this._announce()}_queueSave(){!this.action||this.manual||(this._saveTimer&&window.clearTimeout(this._saveTimer),this._saveTimer=window.setTimeout(()=>{this._saveTimer=void 0,this._save()},this.saveDebounce))}async _save(){if(this._saving){this._saveQueued=!0;return}this._saving=!0;let t=!1;try{let r=new FormData;for(let a of["light","dark"])for(let[s,l]of Object.entries(this._modeValues[a]))r.append(`${a}[${s}]`,typeof l=="boolean"?l?"1":"":String(l??""));let n=await fetch(this.action,{method:"POST",credentials:"same-origin",body:r});if(!n.ok)throw new Error(await n.text()||n.statusText);this.error="",t=!0}catch(r){this._fail(r instanceof Error?r.message:String(r))}finally{if(this._saving=!1,this._saveQueued)this._saveQueued=!1,this._save();else{let r=this._saveWaiters;this._saveWaiters=[],r.forEach(n=>n(t))}}}_awaitSave(){return new Promise(t=>{this._saveWaiters.push(t),this._save()})}_pushIfControlsChanged(){this.requestUpdate();let t=this._harvestNamed().map(({control:n})=>n);(!this._mounted||t.length!==this._lastControls.length||t.some((n,a)=>n!==this._lastControls[a]))&&(this._flushPendingEdit(),this._mounted=!0,this._lastControls=t,this._seed(),this._writeBack(),this._push())}_flushPendingEdit(){this._pushTimer&&(window.clearTimeout(this._pushTimer),this._pushTimer=void 0,this._harvestInto(this.mode),this._queueSave())}_announce(){this.emit("zn-theme-change",{detail:{values:this.values,mode:this.mode,device:this.device}})}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}_sourcesSafe(){return Array.isArray(this.sources)?this.sources:[]}_frameSrc(){let t=this._sourcesSafe();return t.length>0?(t[this._sourceIndex]??t[0]).src:this.src}_sectionsSafe(){return Array.isArray(this.sections)?this.sections:[]}_groupsFor(t){return Array.isArray(t?.groups)?t.groups:[]}_hasStructureAttributes(){return Array.from(this.children).some(t=>t.hasAttribute("group")||t.hasAttribute("category"))}_usesDerivedSections(){return this._sectionsSafe().length===0&&this._hasStructureAttributes()}_derive(){let t=new Set,r=l=>{let d=_P(l)||"group",h=d;for(let m=2;t.has(h);m++)h=`${d}-${m}`;return t.add(h),h},n=new Map,a=new Map,s=new Map;for(let l of Array.from(this.children)){let d=l.getAttribute("group")?.trim()??"",h=l.getAttribute("category")?.trim()??"";if(!d&&!h)continue;let m=d||h,f=n.get(m);if(f||(f={name:r(m),caption:m,groups:[]},n.set(m,f)),!d||!h){s.set(l,f.name);continue}let b=`${m}\0${h}`,g=a.get(b);g||(g=r(`${m}-${h}`),a.set(b,g),f.groups.push({name:g,caption:h})),s.set(l,g)}return{sections:Array.from(n.values()),assignments:s}}_effectiveSections(){return this._usesDerivedSections()?this._derive().sections:this._sectionsSafe()}_assignDerivedSlots(){if(this._usesDerivedSections())for(let[t,r]of this._derive().assignments)t.getAttribute("slot")!==r&&t.setAttribute("slot",r)}willUpdate(t){super.willUpdate(t),this._assignDerivedSlots()}_hasNestedGroups(){return this._effectiveSections().some(t=>this._groupsFor(t).length>0)}_visibleGroups(t){return this._groupsFor(t).filter(r=>this._hasAssignedControls(r.name))}_visibleSections(){let t=this._effectiveSections();return this._hasNestedGroups()?t.filter(r=>this._visibleGroups(r).length>0):t.filter(r=>this._hasAssignedControls(r.name))}_renderSections(){return this._visibleSections().map(t=>u`
6143
6143
  <zn-collapsible
6144
6144
  class="editor__section"
6145
6145
  part="section"
@@ -6220,7 +6220,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6220
6220
  ${this.previewCaption?u`<span class="editor__caption">${this.previewCaption}</span>`:V}
6221
6221
  <div class="editor__toolbar-actions">
6222
6222
  <zn-button-group class="editor__devices" aria-label="Preview width">
6223
- ${yP.map(t=>u`
6223
+ ${wP.map(t=>u`
6224
6224
  <zn-button class="editor__device"
6225
6225
  icon-button="small"
6226
6226
  icon-size="20"
@@ -6267,7 +6267,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6267
6267
  @zn-error="${this._onFrameError}"></zn-preview-frame>
6268
6268
  </div>
6269
6269
  </div>
6270
- </div>`}};Ke.styles=k(o8),Ke.dependencies={"zn-collapsible":rs,"zn-preview-frame":Uv,"zn-icon":he,"zn-button":Oe,"zn-button-group":Nc,"zn-tabs":Dn,"zn-navbar":ls,"zn-select":Je,"zn-option":at},c([p()],Ke.prototype,"src",2),c([p({attribute:"frame-origin"})],Ke.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],Ke.prototype,"dataUri",2),c([p({reflect:!0})],Ke.prototype,"mode",2),c([p({reflect:!0})],Ke.prototype,"device",2),c([p({type:Number,attribute:"min-height"})],Ke.prototype,"minHeight",2),c([p({type:Number})],Ke.prototype,"debounce",2),c([p()],Ke.prototype,"action",2),c([p({type:Number,attribute:"save-debounce"})],Ke.prototype,"saveDebounce",2),c([p({type:Array})],Ke.prototype,"sections",2),c([p({attribute:"section-layout"})],Ke.prototype,"sectionLayout",2),c([p({type:Array})],Ke.prototype,"sources",2),c([p({type:Boolean,reflect:!0,attribute:"controls-collapsed"})],Ke.prototype,"controlsCollapsed",2),c([p({type:Boolean,reflect:!0})],Ke.prototype,"standalone",2),c([p({attribute:"controls-caption"})],Ke.prototype,"controlsCaption",2),c([p({attribute:"preview-caption"})],Ke.prototype,"previewCaption",2),c([p({attribute:"submit-label"})],Ke.prototype,"submitLabel",2),c([p({type:Boolean})],Ke.prototype,"manual",2),c([U("zn-preview-frame")],Ke.prototype,"frame",2),c([U("slot:not([name])")],Ke.prototype,"controlsSlot",2),c([js(".editor__section-slot")],Ke.prototype,"sectionSlots",2),c([D()],Ke.prototype,"error",2),c([D()],Ke.prototype,"_submitting",2),c([D()],Ke.prototype,"_sourceIndex",2);var wP=Ke;Ke.define("zn-theme-editor");var a8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--slot-height:18px;--gutter-width:64px;--open-color:rgb(var(--zn-primary));--reduced-color:rgba(var(--zn-primary),0.3);--closed-color:var(--zn-color-neutral-0);--grid-line-color:rgb(var(--zn-border-color));display:block}.schedule-builder{color:rgb(var(--zn-text));font-size:var(--zn-font-size-small)}.schedule-builder--disabled{opacity:0.6;pointer-events:none}.schedule-builder__toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-x-small)}.schedule-builder__hint{flex:1 1 240px;margin:0;color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-small)}.legend{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-small);margin:0;padding:0;list-style:none}.legend__item{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);color:var(--zn-color-neutral-600);font-size:var(--zn-font-size-x-small);white-space:nowrap}.legend__swatch{width:14px;height:14px;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius-small);background-color:var(--closed-color)}.legend__swatch--open{border-color:transparent;background-color:var(--open-color)}.timezone{flex:0 1 auto;width:260px;max-width:100%}.view-toggle{display:inline-flex;overflow:hidden;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius)}.view-toggle__button{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border:none;background:none;color:var(--zn-color-neutral-500);cursor:pointer}.view-toggle__button:not(:first-child){border-left:1px solid var(--grid-line-color)}.view-toggle__button:hover{background-color:var(--zn-color-neutral-100)}.view-toggle__button:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:-2px}.view-toggle__button--active{background-color:var(--zn-color-primary-100);color:var(--zn-color-primary-700)}.view-toggle__button--active:hover{background-color:var(--zn-color-primary-100)}.schedule-builder__calendar{display:flex;align-items:flex-start;gap:var(--zn-spacing-medium)}.calendar{flex:1 1 auto;min-width:0;overflow:hidden;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius);background-color:var(--zn-panel-background-color)}.calendar__head,.calendar__body{display:grid;grid-template-columns:var(--gutter-width) repeat(var(--columns),minmax(0,1fr))}.calendar__head{border-bottom:1px solid var(--grid-line-color);background-color:var(--zn-color-neutral-50)}.calendar__head-cell{display:flex;flex-direction:column;gap:2px;padding:var(--zn-spacing-x-small);border-left:1px solid var(--grid-line-color);overflow:hidden}.calendar__head-day{font-weight:var(--zn-font-weight-semibold,600);white-space:nowrap}.calendar__head-hours{color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar__head-cell--closed .calendar__head-day,.calendar__head-cell--closed .calendar__head-hours{color:var(--zn-color-neutral-400)}.calendar__body{padding-top:var(--zn-spacing-x-small);padding-bottom:var(--zn-spacing-x-small)}.calendar__gutter{display:grid;grid-auto-rows:calc(var(--slot-height) * var(--slots-per-hour))}.calendar__hour{position:relative}.calendar__hour span{position:absolute;top:0;right:var(--zn-spacing-x-small);transform:translateY(-50%);color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);font-variant-numeric:tabular-nums;white-space:nowrap}.calendar__canvas{display:grid;grid-column:span var(--columns);grid-template-columns:repeat(var(--columns),minmax(0,1fr));touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calendar__col{display:grid;grid-auto-rows:var(--slot-height);border-left:1px solid var(--grid-line-color)}.calendar__slot{border-bottom:1px dotted rgba(var(--zn-border-color),0.6);background-color:var(--closed-color)}.calendar__slot--hour{border-top:1px solid rgba(var(--zn-border-color),0.6)}.calendar__slot--open{background-color:var(--open-color);border-bottom-color:rgba(255,255,255,0.25)}.calendar__slot--reduced{background-color:var(--reduced-color);border-bottom-color:rgba(255,255,255,0.4)}.schedule-builder:not(.schedule-builder--readonly):not(.schedule-builder--disabled) .calendar__canvas{cursor:crosshair}.summary{flex:0 0 260px;max-width:260px}.summary__title{margin:0 0 var(--zn-spacing-x-small);color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);font-weight:var(--zn-font-weight-semibold,600);letter-spacing:0.06em;text-transform:uppercase}.summary__list{margin:0}.summary__row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-x-small) 0;border-bottom:1px solid var(--grid-line-color)}.summary__row dt{font-weight:var(--zn-font-weight-semibold,600)}.summary__row dd{margin:0;font-variant-numeric:tabular-nums;text-align:right}.summary__closed{color:var(--zn-color-neutral-400)}.summary__row--total{border-bottom:none}.summary__row--total dd{font-weight:var(--zn-font-weight-semibold,600)}.list{display:flex;flex-direction:column}.list__row{display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-2x-small);border-bottom:1px solid var(--grid-line-color)}.list__row--editing{border-radius:var(--zn-border-radius);background-color:var(--zn-color-primary-50)}.list__day{font-weight:var(--zn-font-weight-semibold,600)}.list__day--closed{color:var(--zn-color-neutral-400)}.list__ranges{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-x-small);min-height:32px}.list__closed{color:var(--zn-color-neutral-400)}.list__note{color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small)}.list__chip{padding:6px 10px;border:none;border-radius:var(--zn-border-radius);background-color:var(--zn-color-primary-100);color:var(--zn-color-primary-700);font-family:inherit;font-size:var(--zn-font-size-small);font-variant-numeric:tabular-nums;cursor:pointer}.list__chip:hover:not([disabled]){background-color:var(--zn-color-primary-200)}.list__chip[disabled]{cursor:default}.list__chip:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:1px}.list__chip--reduced{background-color:var(--zn-color-warning-50);color:var(--zn-color-warning-600)}.list__chip--reduced:hover:not([disabled]){background-color:var(--zn-color-warning-50)}.list__editor{display:flex;align-items:center;gap:var(--zn-spacing-2x-small)}.list__editor zn-input{width:130px}.list__editor-separator{color:var(--zn-color-neutral-500)}.list__remove{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;border-radius:var(--zn-border-radius);background:none;color:var(--zn-color-neutral-500);cursor:pointer}.list__remove:hover{background-color:var(--zn-color-neutral-100);color:rgb(var(--zn-text))}.list__add{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);padding:4px var(--zn-spacing-x-small);border:none;border-radius:var(--zn-border-radius);background:none;color:rgb(var(--zn-text));font-family:inherit;font-size:var(--zn-font-size-x-small);font-weight:var(--zn-font-weight-semibold,600);letter-spacing:0.04em;text-transform:uppercase;white-space:nowrap;cursor:pointer}.list__add:hover{background-color:var(--zn-color-neutral-100)}.list__add:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:-2px}@media (max-width:900px){.schedule-builder__calendar{flex-direction:column}.summary{flex:1 1 auto;max-width:none;width:100%}}`;var Er=["mon","tue","wed","thu","fri","sat","sun"],cc={mon:{short:"Mon",long:"Monday"},tue:{short:"Tue",long:"Tuesday"},wed:{short:"Wed",long:"Wednesday"},thu:{short:"Thu",long:"Thursday"},fri:{short:"Fri",long:"Friday"},sat:{short:"Sat",long:"Saturday"},sun:{short:"Sun",long:"Sunday"}},nn=1440;function dc(){return{mon:[],tue:[],wed:[],thu:[],fri:[],sat:[],sun:[]}}function Ni(o){if(typeof o=="number"&&Number.isFinite(o))return Math.min(Math.max(Math.round(o),0),nn);if(typeof o!="string")return null;let i=/^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(o.trim());if(!i)return null;let t=Number(i[1]),r=Number(i[2]);if(t>24||r>59)return null;let n=t*60+r;return n>nn?null:n}function gi(o){let i=Math.min(Math.max(Math.round(o),0),nn),t=Math.floor(i/60),r=i%60;return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function pc(o){let i=[];o.forEach(r=>{let n=Ni(r?.start),a=Ni(r?.end);n===null||a===null||a<=n||i.push([n,a])}),i.sort((r,n)=>r[0]-n[0]);let t=[];return i.forEach(r=>{let n=t[t.length-1];if(n&&r[0]<=n[1]){n[1]=Math.max(n[1],r[1]);return}t.push([r[0],r[1]])}),t.map(([r,n])=>({start:gi(r),end:gi(n)}))}function um(o){if(!Array.isArray(o))return[];let i=[];return o.forEach(t=>{if(typeof t=="string"){let[r,n]=t.split(/\s*[-–—]\s*/);r&&n&&i.push({start:r,end:n});return}if(t&&typeof t=="object"){let r=t;r.start&&r.end&&i.push({start:String(r.start),end:String(r.end)})}}),pc(i)}function _P(o,i,t){return pc([...o,{start:gi(i),end:gi(t)}])}function zP(o,i,t){let r=[];return o.forEach(n=>{let a=Ni(n.start),s=Ni(n.end);if(!(a===null||s===null)){if(s<=i||a>=t){r.push(n);return}a<i&&r.push({start:gi(a),end:gi(i)}),s>t&&r.push({start:gi(t),end:gi(s)})}}),pc(r)}function kP(o){return o.reduce((i,t)=>{let r=Ni(t.start),n=Ni(t.end);return r===null||n===null?i:i+(n-r)},0)}function mm(o){if(!o)return null;let i=/^(\d{4})-(\d{2})-(\d{2})/.exec(o.trim());if(!i)return null;let t=new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));return Number.isNaN(t.getTime())?null:t}function SP(o){return mm(o.date??o.from)}function CP(o){return mm(o.to??o.date??o.from)}function s8(o){if(o.days?.length)return o.days.filter(s=>Er.includes(s));let i=SP(o),t=CP(o);if(!i||!t)return[];let r=Date.UTC(i.getFullYear(),i.getMonth(),i.getDate()),n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((n-r)/864e5)>=Er.length-1?[...Er]:[]}function jv(o){return o.closed?[]:o.ranges?um(o.ranges):null}var As=7*nn;function hc(o){let i=o.filter(([r,n])=>n>r).sort((r,n)=>r[0]-n[0]),t=[];return i.forEach(r=>{let n=t[t.length-1];if(n&&r[0]<=n[1]){n[1]=Math.max(n[1],r[1]);return}t.push([r[0],r[1]])}),t}function Kv(o){let i=[];return Er.forEach((t,r)=>{let n=r*nn;o[t].forEach(a=>{let s=Ni(a.start),l=Ni(a.end);s===null||l===null||l<=s||i.push([n+s,n+l])})}),hc(i)}function EP(o){let i=dc();return hc(o).forEach(([t,r])=>{let n=t;for(;n<r;){let a=Math.min(Math.floor(n/nn),Er.length-1),s=a*nn,l=Math.min(r,s+nn);i[Er[a]].push({start:gi(n-s),end:gi(l-s)}),n=l}}),Er.forEach(t=>{i[t]=pc(i[t])}),i}function c8(o,i){if(!i)return o.map(r=>[r[0],r[1]]);let t=[];return o.forEach(([r,n])=>{let a=Math.min(n-r,As),s=((r+i)%As+As)%As,l=s+a;if(l<=As){t.push([s,l]);return}t.push([s,As]),t.push([0,l-As])}),hc(t)}function Gv(o,i){return i?EP(c8(Kv(o),i)):o}function TP(o,i){let t=hc(o);return hc(i).forEach(([r,n])=>{let a=[];t.forEach(([s,l])=>{if(l<=r||s>=n){a.push([s,l]);return}s<r&&a.push([s,r]),l>n&&a.push([n,l])}),t=a}),t}function Wv(o,i){return o.some(([t,r])=>i>=t&&i<r)}function Ls(o,i){if(!o)return 0;try{let t=new Intl.DateTimeFormat("en-US",{timeZone:o,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(i),r=s=>Number(t.find(l=>l.type===s)?.value),n=r("hour")%24,a=Date.UTC(r("year"),r("month")-1,r("day"),n,r("minute"),r("second"));return Math.round((a-i.getTime())/6e4)}catch{return 0}}function $P(o){let i=o<0?"-":"+",t=Math.abs(o);return`UTC${i}${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function AP(o,i){return!o.label&&o.zone==="UTC"?"UTC":`${o.label??o.zone.replace(/_/g," ")} (${$P(Ls(o.zone,i))})`}function l8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}var LP=[{zone:"America/New_York",label:"US Eastern"},{zone:"America/Chicago",label:"US Central"},{zone:"America/Denver",label:"US Mountain"},{zone:"America/Los_Angeles",label:"US Pacific"},{zone:"Europe/London",label:"UK"},{zone:"Australia/Sydney",label:"Australia"}],MP=["UTC","Pacific/Auckland","Australia/Sydney","Australia/Brisbane","Australia/Adelaide","Australia/Perth","Asia/Tokyo","Asia/Seoul","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Bangkok","Asia/Jakarta","Asia/Kolkata","Asia/Karachi","Asia/Dubai","Europe/Moscow","Africa/Nairobi","Europe/Istanbul","Europe/Athens","Africa/Johannesburg","Europe/Berlin","Europe/Paris","Europe/Madrid","Europe/Amsterdam","Europe/Dublin","Europe/London","Europe/Lisbon","Atlantic/Reykjavik","America/Sao_Paulo","America/Argentina/Buenos_Aires","America/Halifax","America/New_York","America/Toronto","America/Chicago","America/Mexico_City","America/Denver","America/Phoenix","America/Los_Angeles","America/Vancouver","America/Anchorage","Pacific/Honolulu"],d8=["Pacific/Midway","Pacific/Honolulu","Pacific/Marquesas","America/Anchorage","America/Los_Angeles","America/Vancouver","America/Tijuana","America/Denver","America/Phoenix","America/Edmonton","America/Chicago","America/Mexico_City","America/Winnipeg","America/Guatemala","America/New_York","America/Toronto","America/Bogota","America/Lima","America/Panama","America/Halifax","America/Puerto_Rico","America/Santiago","America/St_Johns","America/Sao_Paulo","America/Argentina/Buenos_Aires","America/Montevideo","America/Noronha","America/Nuuk","Atlantic/Azores","Atlantic/Cape_Verde","UTC","Europe/London","Europe/Dublin","Europe/Lisbon","Atlantic/Reykjavik","Africa/Abidjan","Africa/Casablanca","Africa/Lagos","Africa/Algiers","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Rome","Europe/Amsterdam","Europe/Brussels","Europe/Zurich","Europe/Vienna","Europe/Prague","Europe/Warsaw","Europe/Stockholm","Europe/Oslo","Europe/Copenhagen","Europe/Budapest","Europe/Athens","Europe/Helsinki","Europe/Bucharest","Europe/Kyiv","Africa/Cairo","Africa/Johannesburg","Asia/Jerusalem","Europe/Istanbul","Europe/Moscow","Africa/Nairobi","Asia/Riyadh","Asia/Baghdad","Asia/Tehran","Asia/Dubai","Asia/Baku","Asia/Tbilisi","Asia/Kabul","Asia/Karachi","Asia/Tashkent","Asia/Kolkata","Asia/Colombo","Asia/Kathmandu","Asia/Dhaka","Asia/Almaty","Asia/Yangon","Asia/Bangkok","Asia/Jakarta","Asia/Ho_Chi_Minh","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Kuala_Lumpur","Asia/Taipei","Asia/Manila","Asia/Tokyo","Asia/Seoul","Australia/Perth","Australia/Eucla","Australia/Darwin","Australia/Adelaide","Australia/Brisbane","Australia/Sydney","Australia/Melbourne","Australia/Hobart","Pacific/Guam","Pacific/Noumea","Pacific/Auckland","Pacific/Fiji","Pacific/Chatham","Pacific/Tongatapu","Pacific/Kiritimati"];function IP(){return typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):d8}function qP(o){switch(o.toLowerCase()){case"en":return LP;case"offsets":return MP.map(i=>({zone:i}));case"common":return d8.map(i=>({zone:i}));case"all":return IP().map(i=>({zone:i}));default:return[{zone:o}]}}var Ce=class extends T{constructor(){super();this.formControlController=new ce(this,{assumeInteractionOn:["zn-change"]});this.hasSlotController=new te(this,"help-text","label");this.localize=new or(this);this._days=dc();this._exceptions=[];this._dragPreview=null;this._editing=null;this._dragMode="open";this._dragAnchor=null;this._dragPointerId=null;this.value="";this.defaultValue="";this.label="";this.helpText="";this.view="calendar";this.openLabel="Available";this.closedLabel="Closed";this.noToggle=!1;this.hideSummary=!1;this.startHour=6;this.endHour=22;this.interval=30;this.weekStart="mon";this.timeFormat="24";this.displayTimezone="";this.saveTimezone="";this.showTimezone=!1;this.timezones=[];this.referenceDate="";this.disabled=!1;this.readonly=!1;this.required=!1;this._customValidity="";this._handleCanvasPointerDown=t=>{if(!this._isEditable||t.button!==0)return;let r=this._pointerPosition(t);if(!r)return;let n=this._orderedDays[r.col],a=Kv(this._storedAsShown);this._dragMode=Wv(a,this._slotMinute(n,r.row))?"close":"open",this._dragAnchor=r,this._dragPointerId=t.pointerId,this._dragPreview=this._buildDragPreview(r),this.canvas.setPointerCapture(t.pointerId),t.preventDefault()};this._handleCanvasPointerMove=t=>{if(!this._dragAnchor||t.pointerId!==this._dragPointerId)return;let r=this._pointerPosition(t);r&&(this._dragPreview=this._buildDragPreview(r))};this._handleCanvasPointerUp=t=>{if(!this._dragAnchor||t.pointerId!==this._dragPointerId)return;let r=this._pointerPosition(t)??this._dragAnchor,n=this._buildDragPreview(r);this._dragAnchor=null,this._dragPointerId=null,this._dragPreview=null,this.canvas.hasPointerCapture(t.pointerId)&&this.canvas.releasePointerCapture(t.pointerId),this._commitShownDays(n)};this._handleCanvasPointerCancel=()=>{this._dragAnchor=null,this._dragPointerId=null,this._dragPreview=null};this.internals=typeof this.attachInternals=="function"?this.attachInternals():null}get schedule(){return{...this._saveZone?{timezone:this._saveZone}:{},days:this._cloneDays(this._days),exceptions:this._exceptions}}set schedule(t){this._applySchedule(t),this._commit(!1)}get exceptions(){return this._exceptions}set exceptions(t){this._exceptions=Array.isArray(t)?t:[],this._commit(!1)}get validity(){return this.internals?.validity??ht}get validationMessage(){return this.internals?.validationMessage??""}get _isZoned(){return!!(this.saveTimezone||this.displayTimezone||this.showTimezone)}get _saveZone(){return this.saveTimezone?this.saveTimezone:this._isZoned?"UTC":""}get _displayZone(){return this.displayTimezone==="auto"?l8():this.displayTimezone||this._saveZone}get _reference(){return mm(this.referenceDate)??new Date}get _offsetDelta(){let t=this._saveZone,r=this._displayZone;if(!t||!r||t===r)return 0;let n=this._reference;return Ls(r,n)-Ls(t,n)}get _orderedDays(){let t=Math.max(Er.indexOf(this.weekStart),0);return[...Er.slice(t),...Er.slice(0,t)]}get _interval(){let t=Math.round(this.interval);return[5,10,15,20,30,60].includes(t)?t:30}get _startMinute(){return Math.min(Math.max(Math.round(this.startHour),0),23)*60}get _endMinute(){let t=Math.min(Math.max(Math.round(this.endHour),1),24)*60;return t<=this._startMinute?Math.min(this._startMinute+60,nn):t}get _slotCount(){return Math.ceil((this._endMinute-this._startMinute)/this._interval)}get _slotsPerHour(){return Math.max(Math.round(60/this._interval),1)}get _isEditable(){return!this.disabled&&!this.readonly}get _hasHours(){return Er.some(t=>this._days[t].length>0)}connectedCallback(){super.connectedCallback(),this.value&&this._applySchedule(this.value),this._syncFormValue()}firstUpdated(){this._commit(!1)}handleValueChange(){this.value!==this._serialise()&&(this._applySchedule(this.value),this._syncFormValue())}handleValidationStateChange(){this._syncFormValue()}checkValidity(){return this.internals?.checkValidity()??!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.internals?.reportValidity()??!0}setCustomValidity(t){this._customValidity=t,this._syncFormValue(),this.formControlController.updateValidity()}setDay(t,r){Er.includes(t)&&(this._days={...this._days,[t]:um(r)},this._commit())}getDay(t){return this._days[t]??[]}get displayedDays(){return this._cloneDays(this._storedAsShown)}setDisplayDay(t,r){Er.includes(t)&&this._commitShownDays({...this._storedAsShown,[t]:um(r)})}formResetCallback(){this._applySchedule(this.defaultValue),this._commit(!1)}formStateRestoreCallback(t){this._applySchedule(t),this._commit(!1)}_cloneDays(t){let r=dc();return Er.forEach(n=>{r[n]=t[n].map(a=>({...a}))}),r}_serialise(){return JSON.stringify(this.schedule)}_applySchedule(t){let r=t;if(typeof t=="string"){let d=t.trim();if(!d){this._days=dc(),this._exceptions=[];return}try{r=JSON.parse(d)}catch{return}}if(!r||typeof r!="object"){this._days=dc(),this._exceptions=[];return}let n=r,a=n.days??n,s=dc();Er.forEach(d=>{s[d]=um(a?.[d])});let l=typeof n.timezone=="string"?n.timezone:"";if(l&&!this.saveTimezone)this.saveTimezone=l;else if(l&&l!==this.saveTimezone){let d=this._reference,h=Ls(this.saveTimezone,d)-Ls(l,d);this._days=Gv(s,h),this._exceptions=Array.isArray(n.exceptions)?n.exceptions:[];return}this._days=s,this._exceptions=Array.isArray(n.exceptions)?n.exceptions:[]}_syncFormValue(){if(!this.internals)return;this.internals.setFormValue(this.value);let t=this.shadowRoot?.querySelector(".schedule-builder")??void 0;if(this._customValidity){this.internals.setValidity({customError:!0},this._customValidity,t);return}if(this.required&&!this._hasHours){this.internals.setValidity({valueMissing:!0},"Please open at least one period.",t);return}this.internals.setValidity({})}_commit(t=!0){let r=this._serialise();r!==this.value&&(this.value=r),this._syncFormValue(),this.formControlController.updateValidity(),t&&this.emit("zn-change")}_formatTime(t){let r=Ni(t);if(r===null)return t;if(this.timeFormat==="24")return gi(r);let n=Math.floor(r/60)%24,a=r%60,s=n<12?"am":"pm",l=n%12===0?12:n%12;return a===0?`${l}${s}`:`${l}:${String(a).padStart(2,"0")}${s}`}_formatRange(t){return`${this._formatTime(t.start)}\u2013${this._formatTime(t.end)}`}_formatDate(t){let r=mm(t);return r?this.localize.date(r,{day:"numeric",month:"short"}):""}_summariseDay(t,r){let n=r[t];return n.length?n.map(a=>this._formatRange(a)).join(", "):this.closedLabel}get _storedAsShown(){return Gv(this._days,this._offsetDelta)}get _shownDays(){return this._dragPreview??this._storedAsShown}_commitShownDays(t){this._days=Gv(t,-this._offsetDelta),this._commit()}_exceptionsForDay(t){return this._exceptions.filter(r=>s8(r).includes(t))}get _shownReductionSpans(){let t=[];return this._exceptions.forEach(r=>{let n=jv(r);n!==null&&s8(r).forEach(a=>{let s=Er.indexOf(a)*nn;t.push(...TP([[s,s+nn]],n.reduce((l,d)=>{let h=Ni(d.start),m=Ni(d.end);return h!==null&&m!==null&&l.push([s+h,s+m]),l},[])))})}),c8(hc(t),this._offsetDelta)}_slotMinute(t,r){return Er.indexOf(t)*nn+this._startMinute+r*this._interval+this._interval/2}_slotState(t,r,n,a){let s=this._slotMinute(t,r);return Wv(n,s)?Wv(a,s)?"reduced":"open":"closed"}_pointerPosition(t){if(!this.canvas)return null;let r=this.canvas.getBoundingClientRect();if(!r.width||!r.height)return null;let n=this._orderedDays.length,a=Math.floor((t.clientX-r.left)/r.width*n),s=Math.floor((t.clientY-r.top)/r.height*this._slotCount);return{col:Math.min(Math.max(a,0),n-1),row:Math.min(Math.max(s,0),this._slotCount-1)}}_buildDragPreview(t){let r=this._dragAnchor,n=this._cloneDays(this._storedAsShown),a=Math.min(r.col,t.col),s=Math.max(r.col,t.col),l=Math.min(r.row,t.row),d=Math.max(r.row,t.row),h=this._startMinute+l*this._interval,m=Math.min(this._startMinute+(d+1)*this._interval,this._endMinute);return this._orderedDays.slice(a,s+1).forEach(b=>{n[b]=this._dragMode==="open"?_P(n[b],h,m):zP(n[b],h,m)}),n}_handleViewToggle(t){this.view!==t&&(this._editing=null,this.view=t)}_nextFreeRange(t){if(!t.length)return{start:"09:00",end:"17:00"};let r=this._startMinute;for(let a of t){let s=Ni(a.start)??0,l=Ni(a.end)??0;if(s-r>=60)break;r=Math.max(r,l)}let n=Math.min(r,nn-60);return{start:gi(n),end:gi(n+60)}}_handleAddRange(t){if(!this._isEditable)return;let r=this._storedAsShown,n=this._nextFreeRange(r[t]),a=pc([...r[t],n]);this._commitShownDays({...r,[t]:a}),this._editing={day:t,index:Math.max(a.findIndex(s=>s.start===n.start),0)}}_handleRemoveRange(t,r){if(!this._isEditable)return;let n=this._storedAsShown;this._editing=null,this._commitShownDays({...n,[t]:n[t].filter((a,s)=>s!==r)})}_handleRangeEdit(t,r,n,a){let s=Ni(a);if(s===null)return;let l=this._storedAsShown,d=pc(l[t].map((h,m)=>m===r?{...h,[n]:gi(s)}:h));this._editing&&this._editing.day===t&&this._editing.index>=d.length&&(this._editing=d.length?{day:t,index:d.length-1}:null),this._commitShownDays({...l,[t]:d})}_handleEditorKeyDown(t){(t.key==="Enter"||t.key==="Escape")&&(t.preventDefault(),t.stopPropagation(),this._editing=null)}_handleEditorFocusOut(t){let r=t.currentTarget,n=t.relatedTarget;n&&r.contains(n)||(this._editing=null)}_renderToolbar(){let t=!this.noToggle,r=this.view==="calendar";return!t&&!r&&!this.showTimezone?V:u`
6270
+ </div>`}};Ke.styles=k(o8),Ke.dependencies={"zn-collapsible":rs,"zn-preview-frame":Uv,"zn-icon":he,"zn-button":Oe,"zn-button-group":Nc,"zn-tabs":Dn,"zn-navbar":ls,"zn-select":Je,"zn-option":at},c([p()],Ke.prototype,"src",2),c([p({attribute:"frame-origin"})],Ke.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],Ke.prototype,"dataUri",2),c([p({reflect:!0})],Ke.prototype,"mode",2),c([p({reflect:!0})],Ke.prototype,"device",2),c([p({type:Number,attribute:"min-height"})],Ke.prototype,"minHeight",2),c([p({type:Number})],Ke.prototype,"debounce",2),c([p()],Ke.prototype,"action",2),c([p({type:Number,attribute:"save-debounce"})],Ke.prototype,"saveDebounce",2),c([p({type:Array})],Ke.prototype,"sections",2),c([p({attribute:"section-layout"})],Ke.prototype,"sectionLayout",2),c([p({type:Array})],Ke.prototype,"sources",2),c([p({type:Boolean,reflect:!0,attribute:"controls-collapsed"})],Ke.prototype,"controlsCollapsed",2),c([p({type:Boolean,reflect:!0})],Ke.prototype,"standalone",2),c([p({attribute:"controls-caption"})],Ke.prototype,"controlsCaption",2),c([p({attribute:"preview-caption"})],Ke.prototype,"previewCaption",2),c([p({attribute:"submit-label"})],Ke.prototype,"submitLabel",2),c([p({type:Boolean})],Ke.prototype,"manual",2),c([U("zn-preview-frame")],Ke.prototype,"frame",2),c([U("slot:not([name])")],Ke.prototype,"controlsSlot",2),c([js(".editor__section-slot")],Ke.prototype,"sectionSlots",2),c([D()],Ke.prototype,"error",2),c([D()],Ke.prototype,"_submitting",2),c([D()],Ke.prototype,"_sourceIndex",2);var zP=Ke;Ke.define("zn-theme-editor");var a8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--slot-height:18px;--gutter-width:64px;--open-color:rgb(var(--zn-primary));--reduced-color:rgba(var(--zn-primary),0.3);--closed-color:var(--zn-color-neutral-0);--grid-line-color:rgb(var(--zn-border-color));display:block}.schedule-builder{color:rgb(var(--zn-text));font-size:var(--zn-font-size-small)}.schedule-builder--disabled{opacity:0.6;pointer-events:none}.schedule-builder__toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-x-small)}.schedule-builder__hint{flex:1 1 240px;margin:0;color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-small)}.legend{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-small);margin:0;padding:0;list-style:none}.legend__item{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);color:var(--zn-color-neutral-600);font-size:var(--zn-font-size-x-small);white-space:nowrap}.legend__swatch{width:14px;height:14px;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius-small);background-color:var(--closed-color)}.legend__swatch--open{border-color:transparent;background-color:var(--open-color)}.timezone{flex:0 1 auto;width:260px;max-width:100%}.view-toggle{display:inline-flex;overflow:hidden;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius)}.view-toggle__button{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border:none;background:none;color:var(--zn-color-neutral-500);cursor:pointer}.view-toggle__button:not(:first-child){border-left:1px solid var(--grid-line-color)}.view-toggle__button:hover{background-color:var(--zn-color-neutral-100)}.view-toggle__button:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:-2px}.view-toggle__button--active{background-color:var(--zn-color-primary-100);color:var(--zn-color-primary-700)}.view-toggle__button--active:hover{background-color:var(--zn-color-primary-100)}.schedule-builder__calendar{display:flex;align-items:flex-start;gap:var(--zn-spacing-medium)}.calendar{flex:1 1 auto;min-width:0;overflow:hidden;border:1px solid var(--grid-line-color);border-radius:var(--zn-border-radius);background-color:var(--zn-panel-background-color)}.calendar__head,.calendar__body{display:grid;grid-template-columns:var(--gutter-width) repeat(var(--columns),minmax(0,1fr))}.calendar__head{border-bottom:1px solid var(--grid-line-color);background-color:var(--zn-color-neutral-50)}.calendar__head-cell{display:flex;flex-direction:column;gap:2px;padding:var(--zn-spacing-x-small);border-left:1px solid var(--grid-line-color);overflow:hidden}.calendar__head-day{font-weight:var(--zn-font-weight-semibold,600);white-space:nowrap}.calendar__head-hours{color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar__head-cell--closed .calendar__head-day,.calendar__head-cell--closed .calendar__head-hours{color:var(--zn-color-neutral-400)}.calendar__body{padding-top:var(--zn-spacing-x-small);padding-bottom:var(--zn-spacing-x-small)}.calendar__gutter{display:grid;grid-auto-rows:calc(var(--slot-height) * var(--slots-per-hour))}.calendar__hour{position:relative}.calendar__hour span{position:absolute;top:0;right:var(--zn-spacing-x-small);transform:translateY(-50%);color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);font-variant-numeric:tabular-nums;white-space:nowrap}.calendar__canvas{display:grid;grid-column:span var(--columns);grid-template-columns:repeat(var(--columns),minmax(0,1fr));touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calendar__col{display:grid;grid-auto-rows:var(--slot-height);border-left:1px solid var(--grid-line-color)}.calendar__slot{border-bottom:1px dotted rgba(var(--zn-border-color),0.6);background-color:var(--closed-color)}.calendar__slot--hour{border-top:1px solid rgba(var(--zn-border-color),0.6)}.calendar__slot--open{background-color:var(--open-color);border-bottom-color:rgba(255,255,255,0.25)}.calendar__slot--reduced{background-color:var(--reduced-color);border-bottom-color:rgba(255,255,255,0.4)}.schedule-builder:not(.schedule-builder--readonly):not(.schedule-builder--disabled) .calendar__canvas{cursor:crosshair}.summary{flex:0 0 260px;max-width:260px}.summary__title{margin:0 0 var(--zn-spacing-x-small);color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small);font-weight:var(--zn-font-weight-semibold,600);letter-spacing:0.06em;text-transform:uppercase}.summary__list{margin:0}.summary__row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-x-small) 0;border-bottom:1px solid var(--grid-line-color)}.summary__row dt{font-weight:var(--zn-font-weight-semibold,600)}.summary__row dd{margin:0;font-variant-numeric:tabular-nums;text-align:right}.summary__closed{color:var(--zn-color-neutral-400)}.summary__row--total{border-bottom:none}.summary__row--total dd{font-weight:var(--zn-font-weight-semibold,600)}.list{display:flex;flex-direction:column}.list__row{display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:var(--zn-spacing-x-small);padding:var(--zn-spacing-x-small) var(--zn-spacing-2x-small);border-bottom:1px solid var(--grid-line-color)}.list__row--editing{border-radius:var(--zn-border-radius);background-color:var(--zn-color-primary-50)}.list__day{font-weight:var(--zn-font-weight-semibold,600)}.list__day--closed{color:var(--zn-color-neutral-400)}.list__ranges{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zn-spacing-x-small);min-height:32px}.list__closed{color:var(--zn-color-neutral-400)}.list__note{color:var(--zn-color-neutral-500);font-size:var(--zn-font-size-x-small)}.list__chip{padding:6px 10px;border:none;border-radius:var(--zn-border-radius);background-color:var(--zn-color-primary-100);color:var(--zn-color-primary-700);font-family:inherit;font-size:var(--zn-font-size-small);font-variant-numeric:tabular-nums;cursor:pointer}.list__chip:hover:not([disabled]){background-color:var(--zn-color-primary-200)}.list__chip[disabled]{cursor:default}.list__chip:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:1px}.list__chip--reduced{background-color:var(--zn-color-warning-50);color:var(--zn-color-warning-600)}.list__chip--reduced:hover:not([disabled]){background-color:var(--zn-color-warning-50)}.list__editor{display:flex;align-items:center;gap:var(--zn-spacing-2x-small)}.list__editor zn-input{width:130px}.list__editor-separator{color:var(--zn-color-neutral-500)}.list__remove{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;border-radius:var(--zn-border-radius);background:none;color:var(--zn-color-neutral-500);cursor:pointer}.list__remove:hover{background-color:var(--zn-color-neutral-100);color:rgb(var(--zn-text))}.list__add{display:inline-flex;align-items:center;gap:var(--zn-spacing-2x-small);padding:4px var(--zn-spacing-x-small);border:none;border-radius:var(--zn-border-radius);background:none;color:rgb(var(--zn-text));font-family:inherit;font-size:var(--zn-font-size-x-small);font-weight:var(--zn-font-weight-semibold,600);letter-spacing:0.04em;text-transform:uppercase;white-space:nowrap;cursor:pointer}.list__add:hover{background-color:var(--zn-color-neutral-100)}.list__add:focus-visible{outline:2px solid var(--zn-focus-ring-color);outline-offset:-2px}@media (max-width:900px){.schedule-builder__calendar{flex-direction:column}.summary{flex:1 1 auto;max-width:none;width:100%}}`;var Er=["mon","tue","wed","thu","fri","sat","sun"],cc={mon:{short:"Mon",long:"Monday"},tue:{short:"Tue",long:"Tuesday"},wed:{short:"Wed",long:"Wednesday"},thu:{short:"Thu",long:"Thursday"},fri:{short:"Fri",long:"Friday"},sat:{short:"Sat",long:"Saturday"},sun:{short:"Sun",long:"Sunday"}},nn=1440;function dc(){return{mon:[],tue:[],wed:[],thu:[],fri:[],sat:[],sun:[]}}function Ni(o){if(typeof o=="number"&&Number.isFinite(o))return Math.min(Math.max(Math.round(o),0),nn);if(typeof o!="string")return null;let i=/^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(o.trim());if(!i)return null;let t=Number(i[1]),r=Number(i[2]);if(t>24||r>59)return null;let n=t*60+r;return n>nn?null:n}function gi(o){let i=Math.min(Math.max(Math.round(o),0),nn),t=Math.floor(i/60),r=i%60;return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function pc(o){let i=[];o.forEach(r=>{let n=Ni(r?.start),a=Ni(r?.end);n===null||a===null||a<=n||i.push([n,a])}),i.sort((r,n)=>r[0]-n[0]);let t=[];return i.forEach(r=>{let n=t[t.length-1];if(n&&r[0]<=n[1]){n[1]=Math.max(n[1],r[1]);return}t.push([r[0],r[1]])}),t.map(([r,n])=>({start:gi(r),end:gi(n)}))}function um(o){if(!Array.isArray(o))return[];let i=[];return o.forEach(t=>{if(typeof t=="string"){let[r,n]=t.split(/\s*[-–—]\s*/);r&&n&&i.push({start:r,end:n});return}if(t&&typeof t=="object"){let r=t;r.start&&r.end&&i.push({start:String(r.start),end:String(r.end)})}}),pc(i)}function kP(o,i,t){return pc([...o,{start:gi(i),end:gi(t)}])}function SP(o,i,t){let r=[];return o.forEach(n=>{let a=Ni(n.start),s=Ni(n.end);if(!(a===null||s===null)){if(s<=i||a>=t){r.push(n);return}a<i&&r.push({start:gi(a),end:gi(i)}),s>t&&r.push({start:gi(t),end:gi(s)})}}),pc(r)}function CP(o){return o.reduce((i,t)=>{let r=Ni(t.start),n=Ni(t.end);return r===null||n===null?i:i+(n-r)},0)}function mm(o){if(!o)return null;let i=/^(\d{4})-(\d{2})-(\d{2})/.exec(o.trim());if(!i)return null;let t=new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));return Number.isNaN(t.getTime())?null:t}function EP(o){return mm(o.date??o.from)}function TP(o){return mm(o.to??o.date??o.from)}function s8(o){if(o.days?.length)return o.days.filter(s=>Er.includes(s));let i=EP(o),t=TP(o);if(!i||!t)return[];let r=Date.UTC(i.getFullYear(),i.getMonth(),i.getDate()),n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((n-r)/864e5)>=Er.length-1?[...Er]:[]}function jv(o){return o.closed?[]:o.ranges?um(o.ranges):null}var As=7*nn;function hc(o){let i=o.filter(([r,n])=>n>r).sort((r,n)=>r[0]-n[0]),t=[];return i.forEach(r=>{let n=t[t.length-1];if(n&&r[0]<=n[1]){n[1]=Math.max(n[1],r[1]);return}t.push([r[0],r[1]])}),t}function Kv(o){let i=[];return Er.forEach((t,r)=>{let n=r*nn;o[t].forEach(a=>{let s=Ni(a.start),l=Ni(a.end);s===null||l===null||l<=s||i.push([n+s,n+l])})}),hc(i)}function $P(o){let i=dc();return hc(o).forEach(([t,r])=>{let n=t;for(;n<r;){let a=Math.min(Math.floor(n/nn),Er.length-1),s=a*nn,l=Math.min(r,s+nn);i[Er[a]].push({start:gi(n-s),end:gi(l-s)}),n=l}}),Er.forEach(t=>{i[t]=pc(i[t])}),i}function c8(o,i){if(!i)return o.map(r=>[r[0],r[1]]);let t=[];return o.forEach(([r,n])=>{let a=Math.min(n-r,As),s=((r+i)%As+As)%As,l=s+a;if(l<=As){t.push([s,l]);return}t.push([s,As]),t.push([0,l-As])}),hc(t)}function Gv(o,i){return i?$P(c8(Kv(o),i)):o}function AP(o,i){let t=hc(o);return hc(i).forEach(([r,n])=>{let a=[];t.forEach(([s,l])=>{if(l<=r||s>=n){a.push([s,l]);return}s<r&&a.push([s,r]),l>n&&a.push([n,l])}),t=a}),t}function Wv(o,i){return o.some(([t,r])=>i>=t&&i<r)}function Ls(o,i){if(!o)return 0;try{let t=new Intl.DateTimeFormat("en-US",{timeZone:o,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(i),r=s=>Number(t.find(l=>l.type===s)?.value),n=r("hour")%24,a=Date.UTC(r("year"),r("month")-1,r("day"),n,r("minute"),r("second"));return Math.round((a-i.getTime())/6e4)}catch{return 0}}function LP(o){let i=o<0?"-":"+",t=Math.abs(o);return`UTC${i}${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function MP(o,i){return!o.label&&o.zone==="UTC"?"UTC":`${o.label??o.zone.replace(/_/g," ")} (${LP(Ls(o.zone,i))})`}function l8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}var IP=[{zone:"America/New_York",label:"US Eastern"},{zone:"America/Chicago",label:"US Central"},{zone:"America/Denver",label:"US Mountain"},{zone:"America/Los_Angeles",label:"US Pacific"},{zone:"Europe/London",label:"UK"},{zone:"Australia/Sydney",label:"Australia"}],qP=["UTC","Pacific/Auckland","Australia/Sydney","Australia/Brisbane","Australia/Adelaide","Australia/Perth","Asia/Tokyo","Asia/Seoul","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Bangkok","Asia/Jakarta","Asia/Kolkata","Asia/Karachi","Asia/Dubai","Europe/Moscow","Africa/Nairobi","Europe/Istanbul","Europe/Athens","Africa/Johannesburg","Europe/Berlin","Europe/Paris","Europe/Madrid","Europe/Amsterdam","Europe/Dublin","Europe/London","Europe/Lisbon","Atlantic/Reykjavik","America/Sao_Paulo","America/Argentina/Buenos_Aires","America/Halifax","America/New_York","America/Toronto","America/Chicago","America/Mexico_City","America/Denver","America/Phoenix","America/Los_Angeles","America/Vancouver","America/Anchorage","Pacific/Honolulu"],d8=["Pacific/Midway","Pacific/Honolulu","Pacific/Marquesas","America/Anchorage","America/Los_Angeles","America/Vancouver","America/Tijuana","America/Denver","America/Phoenix","America/Edmonton","America/Chicago","America/Mexico_City","America/Winnipeg","America/Guatemala","America/New_York","America/Toronto","America/Bogota","America/Lima","America/Panama","America/Halifax","America/Puerto_Rico","America/Santiago","America/St_Johns","America/Sao_Paulo","America/Argentina/Buenos_Aires","America/Montevideo","America/Noronha","America/Nuuk","Atlantic/Azores","Atlantic/Cape_Verde","UTC","Europe/London","Europe/Dublin","Europe/Lisbon","Atlantic/Reykjavik","Africa/Abidjan","Africa/Casablanca","Africa/Lagos","Africa/Algiers","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Rome","Europe/Amsterdam","Europe/Brussels","Europe/Zurich","Europe/Vienna","Europe/Prague","Europe/Warsaw","Europe/Stockholm","Europe/Oslo","Europe/Copenhagen","Europe/Budapest","Europe/Athens","Europe/Helsinki","Europe/Bucharest","Europe/Kyiv","Africa/Cairo","Africa/Johannesburg","Asia/Jerusalem","Europe/Istanbul","Europe/Moscow","Africa/Nairobi","Asia/Riyadh","Asia/Baghdad","Asia/Tehran","Asia/Dubai","Asia/Baku","Asia/Tbilisi","Asia/Kabul","Asia/Karachi","Asia/Tashkent","Asia/Kolkata","Asia/Colombo","Asia/Kathmandu","Asia/Dhaka","Asia/Almaty","Asia/Yangon","Asia/Bangkok","Asia/Jakarta","Asia/Ho_Chi_Minh","Asia/Shanghai","Asia/Hong_Kong","Asia/Singapore","Asia/Kuala_Lumpur","Asia/Taipei","Asia/Manila","Asia/Tokyo","Asia/Seoul","Australia/Perth","Australia/Eucla","Australia/Darwin","Australia/Adelaide","Australia/Brisbane","Australia/Sydney","Australia/Melbourne","Australia/Hobart","Pacific/Guam","Pacific/Noumea","Pacific/Auckland","Pacific/Fiji","Pacific/Chatham","Pacific/Tongatapu","Pacific/Kiritimati"];function RP(){return typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):d8}function DP(o){switch(o.toLowerCase()){case"en":return IP;case"offsets":return qP.map(i=>({zone:i}));case"common":return d8.map(i=>({zone:i}));case"all":return RP().map(i=>({zone:i}));default:return[{zone:o}]}}var Ce=class extends T{constructor(){super();this.formControlController=new ce(this,{assumeInteractionOn:["zn-change"]});this.hasSlotController=new te(this,"help-text","label");this.localize=new or(this);this._days=dc();this._exceptions=[];this._dragPreview=null;this._editing=null;this._dragMode="open";this._dragAnchor=null;this._dragPointerId=null;this.value="";this.defaultValue="";this.label="";this.helpText="";this.view="calendar";this.openLabel="Available";this.closedLabel="Closed";this.noToggle=!1;this.hideSummary=!1;this.startHour=6;this.endHour=22;this.interval=30;this.weekStart="mon";this.timeFormat="24";this.displayTimezone="";this.saveTimezone="";this.showTimezone=!1;this.timezones=[];this.referenceDate="";this.disabled=!1;this.readonly=!1;this.required=!1;this._customValidity="";this._handleCanvasPointerDown=t=>{if(!this._isEditable||t.button!==0)return;let r=this._pointerPosition(t);if(!r)return;let n=this._orderedDays[r.col],a=Kv(this._storedAsShown);this._dragMode=Wv(a,this._slotMinute(n,r.row))?"close":"open",this._dragAnchor=r,this._dragPointerId=t.pointerId,this._dragPreview=this._buildDragPreview(r),this.canvas.setPointerCapture(t.pointerId),t.preventDefault()};this._handleCanvasPointerMove=t=>{if(!this._dragAnchor||t.pointerId!==this._dragPointerId)return;let r=this._pointerPosition(t);r&&(this._dragPreview=this._buildDragPreview(r))};this._handleCanvasPointerUp=t=>{if(!this._dragAnchor||t.pointerId!==this._dragPointerId)return;let r=this._pointerPosition(t)??this._dragAnchor,n=this._buildDragPreview(r);this._dragAnchor=null,this._dragPointerId=null,this._dragPreview=null,this.canvas.hasPointerCapture(t.pointerId)&&this.canvas.releasePointerCapture(t.pointerId),this._commitShownDays(n)};this._handleCanvasPointerCancel=()=>{this._dragAnchor=null,this._dragPointerId=null,this._dragPreview=null};this.internals=typeof this.attachInternals=="function"?this.attachInternals():null}get schedule(){return{...this._saveZone?{timezone:this._saveZone}:{},days:this._cloneDays(this._days),exceptions:this._exceptions}}set schedule(t){this._applySchedule(t),this._commit(!1)}get exceptions(){return this._exceptions}set exceptions(t){this._exceptions=Array.isArray(t)?t:[],this._commit(!1)}get validity(){return this.internals?.validity??ht}get validationMessage(){return this.internals?.validationMessage??""}get _isZoned(){return!!(this.saveTimezone||this.displayTimezone||this.showTimezone)}get _saveZone(){return this.saveTimezone?this.saveTimezone:this._isZoned?"UTC":""}get _displayZone(){return this.displayTimezone==="auto"?l8():this.displayTimezone||this._saveZone}get _reference(){return mm(this.referenceDate)??new Date}get _offsetDelta(){let t=this._saveZone,r=this._displayZone;if(!t||!r||t===r)return 0;let n=this._reference;return Ls(r,n)-Ls(t,n)}get _orderedDays(){let t=Math.max(Er.indexOf(this.weekStart),0);return[...Er.slice(t),...Er.slice(0,t)]}get _interval(){let t=Math.round(this.interval);return[5,10,15,20,30,60].includes(t)?t:30}get _startMinute(){return Math.min(Math.max(Math.round(this.startHour),0),23)*60}get _endMinute(){let t=Math.min(Math.max(Math.round(this.endHour),1),24)*60;return t<=this._startMinute?Math.min(this._startMinute+60,nn):t}get _slotCount(){return Math.ceil((this._endMinute-this._startMinute)/this._interval)}get _slotsPerHour(){return Math.max(Math.round(60/this._interval),1)}get _isEditable(){return!this.disabled&&!this.readonly}get _hasHours(){return Er.some(t=>this._days[t].length>0)}connectedCallback(){super.connectedCallback(),this.value&&this._applySchedule(this.value),this._syncFormValue()}firstUpdated(){this._commit(!1)}handleValueChange(){this.value!==this._serialise()&&(this._applySchedule(this.value),this._syncFormValue())}handleValidationStateChange(){this._syncFormValue()}checkValidity(){return this.internals?.checkValidity()??!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.internals?.reportValidity()??!0}setCustomValidity(t){this._customValidity=t,this._syncFormValue(),this.formControlController.updateValidity()}setDay(t,r){Er.includes(t)&&(this._days={...this._days,[t]:um(r)},this._commit())}getDay(t){return this._days[t]??[]}get displayedDays(){return this._cloneDays(this._storedAsShown)}setDisplayDay(t,r){Er.includes(t)&&this._commitShownDays({...this._storedAsShown,[t]:um(r)})}formResetCallback(){this._applySchedule(this.defaultValue),this._commit(!1)}formStateRestoreCallback(t){this._applySchedule(t),this._commit(!1)}_cloneDays(t){let r=dc();return Er.forEach(n=>{r[n]=t[n].map(a=>({...a}))}),r}_serialise(){return JSON.stringify(this.schedule)}_applySchedule(t){let r=t;if(typeof t=="string"){let d=t.trim();if(!d){this._days=dc(),this._exceptions=[];return}try{r=JSON.parse(d)}catch{return}}if(!r||typeof r!="object"){this._days=dc(),this._exceptions=[];return}let n=r,a=n.days??n,s=dc();Er.forEach(d=>{s[d]=um(a?.[d])});let l=typeof n.timezone=="string"?n.timezone:"";if(l&&!this.saveTimezone)this.saveTimezone=l;else if(l&&l!==this.saveTimezone){let d=this._reference,h=Ls(this.saveTimezone,d)-Ls(l,d);this._days=Gv(s,h),this._exceptions=Array.isArray(n.exceptions)?n.exceptions:[];return}this._days=s,this._exceptions=Array.isArray(n.exceptions)?n.exceptions:[]}_syncFormValue(){if(!this.internals)return;this.internals.setFormValue(this.value);let t=this.shadowRoot?.querySelector(".schedule-builder")??void 0;if(this._customValidity){this.internals.setValidity({customError:!0},this._customValidity,t);return}if(this.required&&!this._hasHours){this.internals.setValidity({valueMissing:!0},"Please open at least one period.",t);return}this.internals.setValidity({})}_commit(t=!0){let r=this._serialise();r!==this.value&&(this.value=r),this._syncFormValue(),this.formControlController.updateValidity(),t&&this.emit("zn-change")}_formatTime(t){let r=Ni(t);if(r===null)return t;if(this.timeFormat==="24")return gi(r);let n=Math.floor(r/60)%24,a=r%60,s=n<12?"am":"pm",l=n%12===0?12:n%12;return a===0?`${l}${s}`:`${l}:${String(a).padStart(2,"0")}${s}`}_formatRange(t){return`${this._formatTime(t.start)}\u2013${this._formatTime(t.end)}`}_formatDate(t){let r=mm(t);return r?this.localize.date(r,{day:"numeric",month:"short"}):""}_summariseDay(t,r){let n=r[t];return n.length?n.map(a=>this._formatRange(a)).join(", "):this.closedLabel}get _storedAsShown(){return Gv(this._days,this._offsetDelta)}get _shownDays(){return this._dragPreview??this._storedAsShown}_commitShownDays(t){this._days=Gv(t,-this._offsetDelta),this._commit()}_exceptionsForDay(t){return this._exceptions.filter(r=>s8(r).includes(t))}get _shownReductionSpans(){let t=[];return this._exceptions.forEach(r=>{let n=jv(r);n!==null&&s8(r).forEach(a=>{let s=Er.indexOf(a)*nn;t.push(...AP([[s,s+nn]],n.reduce((l,d)=>{let h=Ni(d.start),m=Ni(d.end);return h!==null&&m!==null&&l.push([s+h,s+m]),l},[])))})}),c8(hc(t),this._offsetDelta)}_slotMinute(t,r){return Er.indexOf(t)*nn+this._startMinute+r*this._interval+this._interval/2}_slotState(t,r,n,a){let s=this._slotMinute(t,r);return Wv(n,s)?Wv(a,s)?"reduced":"open":"closed"}_pointerPosition(t){if(!this.canvas)return null;let r=this.canvas.getBoundingClientRect();if(!r.width||!r.height)return null;let n=this._orderedDays.length,a=Math.floor((t.clientX-r.left)/r.width*n),s=Math.floor((t.clientY-r.top)/r.height*this._slotCount);return{col:Math.min(Math.max(a,0),n-1),row:Math.min(Math.max(s,0),this._slotCount-1)}}_buildDragPreview(t){let r=this._dragAnchor,n=this._cloneDays(this._storedAsShown),a=Math.min(r.col,t.col),s=Math.max(r.col,t.col),l=Math.min(r.row,t.row),d=Math.max(r.row,t.row),h=this._startMinute+l*this._interval,m=Math.min(this._startMinute+(d+1)*this._interval,this._endMinute);return this._orderedDays.slice(a,s+1).forEach(b=>{n[b]=this._dragMode==="open"?kP(n[b],h,m):SP(n[b],h,m)}),n}_handleViewToggle(t){this.view!==t&&(this._editing=null,this.view=t)}_nextFreeRange(t){if(!t.length)return{start:"09:00",end:"17:00"};let r=this._startMinute;for(let a of t){let s=Ni(a.start)??0,l=Ni(a.end)??0;if(s-r>=60)break;r=Math.max(r,l)}let n=Math.min(r,nn-60);return{start:gi(n),end:gi(n+60)}}_handleAddRange(t){if(!this._isEditable)return;let r=this._storedAsShown,n=this._nextFreeRange(r[t]),a=pc([...r[t],n]);this._commitShownDays({...r,[t]:a}),this._editing={day:t,index:Math.max(a.findIndex(s=>s.start===n.start),0)}}_handleRemoveRange(t,r){if(!this._isEditable)return;let n=this._storedAsShown;this._editing=null,this._commitShownDays({...n,[t]:n[t].filter((a,s)=>s!==r)})}_handleRangeEdit(t,r,n,a){let s=Ni(a);if(s===null)return;let l=this._storedAsShown,d=pc(l[t].map((h,m)=>m===r?{...h,[n]:gi(s)}:h));this._editing&&this._editing.day===t&&this._editing.index>=d.length&&(this._editing=d.length?{day:t,index:d.length-1}:null),this._commitShownDays({...l,[t]:d})}_handleEditorKeyDown(t){(t.key==="Enter"||t.key==="Escape")&&(t.preventDefault(),t.stopPropagation(),this._editing=null)}_handleEditorFocusOut(t){let r=t.currentTarget,n=t.relatedTarget;n&&r.contains(n)||(this._editing=null)}_renderToolbar(){let t=!this.noToggle,r=this.view==="calendar";return!t&&!r&&!this.showTimezone?V:u`
6271
6271
  <div class="schedule-builder__toolbar" part="toolbar">
6272
6272
  ${this.view==="calendar"&&this._isEditable?u`<p class="schedule-builder__hint">
6273
6273
  Drag across the grid to open hours; drag over open hours to close them.
@@ -6299,7 +6299,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6299
6299
  </button>
6300
6300
  </div>`:V}
6301
6301
  </div>
6302
- `}get _timezoneOptions(){let t=this.timezones.length?this.timezones:["offsets"],r=new Map;t.flatMap(a=>qP(a)).forEach(a=>{r.has(a.zone)||r.set(a.zone,a)}),[this._saveZone,this._displayZone,l8()].forEach(a=>{a&&!r.has(a)&&r.set(a,{zone:a})});let n=this._reference;return[...r.values()].sort((a,s)=>Ls(a.zone,n)-Ls(s.zone,n)||a.zone.localeCompare(s.zone))}_handleTimezoneChange(t){t.stopPropagation();let r=t.target.value;typeof r=="string"&&r&&(this.displayTimezone=r)}_renderTimezonePicker(){let t=this._reference;return u`
6302
+ `}get _timezoneOptions(){let t=this.timezones.length?this.timezones:["offsets"],r=new Map;t.flatMap(a=>DP(a)).forEach(a=>{r.has(a.zone)||r.set(a.zone,a)}),[this._saveZone,this._displayZone,l8()].forEach(a=>{a&&!r.has(a)&&r.set(a,{zone:a})});let n=this._reference;return[...r.values()].sort((a,s)=>Ls(a.zone,n)-Ls(s.zone,n)||a.zone.localeCompare(s.zone))}_handleTimezoneChange(t){t.stopPropagation();let r=t.target.value;typeof r=="string"&&r&&(this.displayTimezone=r)}_renderTimezonePicker(){let t=this._reference;return u`
6303
6303
  <zn-select class="timezone"
6304
6304
  size="small"
6305
6305
  search
@@ -6310,7 +6310,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6310
6310
  @zn-change=${this._handleTimezoneChange}
6311
6311
  @zn-input=${r=>r.stopPropagation()}>
6312
6312
  ${this._timezoneOptions.map(r=>u`
6313
- <zn-option value=${r.zone}>${AP(r,t)}</zn-option>`)}
6313
+ <zn-option value=${r.zone}>${MP(r,t)}</zn-option>`)}
6314
6314
  </zn-select>`}_renderCalendar(){let t=this._shownDays,r=Kv(t),n=this._shownReductionSpans,a=[];for(let s=this._startMinute;s<this._endMinute;s+=60)a.push(s);return u`
6315
6315
  <div class="schedule-builder__calendar" part="calendar">
6316
6316
  <div class="calendar">
@@ -6347,7 +6347,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6347
6347
  </div>
6348
6348
  `}_renderCalendarColumn(t,r,n){let a=[];for(let s=0;s<this._slotCount;s++){let l=this._slotState(t,s,r,n);a.push(u`
6349
6349
  <div class=${q({calendar__slot:!0,"calendar__slot--open":l==="open","calendar__slot--reduced":l==="reduced","calendar__slot--hour":s%this._slotsPerHour===0})}></div>`)}return u`
6350
- <div class="calendar__col" role="row" aria-label=${cc[t].long}>${a}</div>`}_renderSummary(t){let r=Er.reduce((n,a)=>n+kP(t[a]),0)/60;return u`
6350
+ <div class="calendar__col" role="row" aria-label=${cc[t].long}>${a}</div>`}_renderSummary(t){let r=Er.reduce((n,a)=>n+CP(t[a]),0)/60;return u`
6351
6351
  <aside class="summary" part="summary">
6352
6352
  <h4 class="summary__title">Hours by day</h4>
6353
6353
  <dl class="summary__list">
@@ -6436,7 +6436,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6436
6436
  <slot name="help-text">${this.helpText}</slot>
6437
6437
  </div>
6438
6438
  </div>
6439
- `}};Ce.styles=[k(Pe),k(a8)],Ce.formAssociated=!0,Ce.dependencies={"zn-icon":he,"zn-input":xt,"zn-option":at,"zn-select":Je},c([U(".schedule-builder__canvas")],Ce.prototype,"canvas",2),c([D()],Ce.prototype,"_days",2),c([D()],Ce.prototype,"_exceptions",2),c([D()],Ce.prototype,"_dragPreview",2),c([D()],Ce.prototype,"_editing",2),c([p({reflect:!0})],Ce.prototype,"name",2),c([p()],Ce.prototype,"value",2),c([Ne()],Ce.prototype,"defaultValue",2),c([p()],Ce.prototype,"label",2),c([p({attribute:"help-text"})],Ce.prototype,"helpText",2),c([p({reflect:!0})],Ce.prototype,"view",2),c([p({attribute:"open-label"})],Ce.prototype,"openLabel",2),c([p({attribute:"closed-label"})],Ce.prototype,"closedLabel",2),c([p({attribute:"no-toggle",type:Boolean})],Ce.prototype,"noToggle",2),c([p({attribute:"hide-summary",type:Boolean})],Ce.prototype,"hideSummary",2),c([p({attribute:"start-hour",type:Number})],Ce.prototype,"startHour",2),c([p({attribute:"end-hour",type:Number})],Ce.prototype,"endHour",2),c([p({type:Number})],Ce.prototype,"interval",2),c([p({attribute:"week-start"})],Ce.prototype,"weekStart",2),c([p({attribute:"time-format"})],Ce.prototype,"timeFormat",2),c([p({attribute:"display-timezone"})],Ce.prototype,"displayTimezone",2),c([p({attribute:"save-timezone"})],Ce.prototype,"saveTimezone",2),c([p({attribute:"show-timezone",type:Boolean})],Ce.prototype,"showTimezone",2),c([p({attribute:"timezones",converter:{fromAttribute:t=>t.split(/[,\s]+/).filter(Boolean),toAttribute:t=>t.join(" ")}})],Ce.prototype,"timezones",2),c([p({attribute:"reference-date"})],Ce.prototype,"referenceDate",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"readonly",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"required",2),c([p({reflect:!0})],Ce.prototype,"form",2),c([Q("value")],Ce.prototype,"handleValueChange",1),c([Q(["required","disabled"])],Ce.prototype,"handleValidationStateChange",1);var RP=Ce;Ce.define("zn-schedule-builder");var p8=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;min-width:0}.thumbnail{position:relative;min-width:0}.thumbnail__link{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);min-width:0;color:inherit;text-decoration:none;outline:none}.thumbnail--interactive .thumbnail__link{cursor:pointer}.thumbnail__media{position:relative;aspect-ratio:var(--zn-thumbnail-aspect-ratio,16/9);width:100%;overflow:hidden;border-radius:var(--zn-thumbnail-radius,var(--zn-border-radius));background-color:rgb(var(--zn-panel));--thumbnail-ring-color:rgb(var(--zn-border-color));--thumbnail-ring-width:1px;--thumbnail-ring-gap:0px}.thumbnail__media::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 var(--thumbnail-ring-width) var(--thumbnail-ring-color),inset 0 0 0 calc(var(--thumbnail-ring-width) + var(--thumbnail-ring-gap)) rgb(var(--zn-body));transition:box-shadow var(--zn-transition-fast) ease-in-out}.thumbnail__image{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.thumbnail__slotted-media{display:grid;place-items:center;width:100%;height:100%}.thumbnail__slotted-media::slotted(img),.thumbnail__slotted-media::slotted(video),.thumbnail__slotted-media::slotted(canvas),.thumbnail__slotted-media::slotted(picture),.thumbnail__slotted-media::slotted(div){width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.thumbnail__caption{font-family:var(--zn-font-sans);font-size:var(--zn-text-table-content-font-size);font-weight:var(--zn-text-table-content-font-weight);line-height:var(--zn-text-table-content-line-height);color:var(--zn-text-table-content-color);text-transform:var(--zn-text-table-content-transform);letter-spacing:var(--zn-text-table-content-letter-spacing,normal);min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.thumbnail__overlay{position:absolute;top:0;left:0;right:0;aspect-ratio:var(--zn-thumbnail-aspect-ratio,16/9);border-radius:var(--zn-thumbnail-radius,var(--zn-border-radius));overflow:hidden;pointer-events:none}.thumbnail__badge,.thumbnail__actions,.thumbnail__preview-button{position:absolute;display:flex;align-items:center;gap:var(--zn-thumbnail-chip-gap,var(--zn-spacing-2x-small))}.thumbnail__badge{bottom:var(--zn-spacing-2x-small);left:var(--zn-spacing-2x-small);pointer-events:none}.thumbnail__actions,.thumbnail__preview-button{pointer-events:auto}.thumbnail__actions{bottom:var(--zn-spacing-2x-small);right:var(--zn-spacing-2x-small)}.thumbnail__preview-button{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__preview-button:hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail__preview-button{top:var(--zn-spacing-2x-small);right:var(--zn-spacing-2x-small)}.thumbnail__badge-items,.thumbnail__action-items{display:contents}.thumbnail__badge-icon,.thumbnail__badge-items::slotted(*){display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:default;opacity:var(--zn-thumbnail-badge-opacity,0.65)}.thumbnail__action-items::slotted(*){display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__action-items::slotted(*):hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail:hover:not(.thumbnail--disabled):not(.thumbnail--selected):not(.thumbnail--active) .thumbnail__media{--thumbnail-ring-color:rgb(var(--zn-primary))}.thumbnail--selected .thumbnail__media{--thumbnail-ring-color:var(--zn-thumbnail-selected-color,rgb(var(--zn-primary)));--thumbnail-ring-width:2px;--thumbnail-ring-gap:1px}.thumbnail--active .thumbnail__media{--thumbnail-ring-color:var(--zn-thumbnail-active-color,rgb(var(--zn-color-success)));--thumbnail-ring-width:2px;--thumbnail-ring-gap:1px}.thumbnail__link:focus-visible .thumbnail__media{outline:var(--zn-focus-ring);outline-offset:calc(-1 * var(--zn-focus-ring-width))}.thumbnail__preview-button:focus-visible,.thumbnail__action-items::slotted(*:focus-visible){outline:var(--zn-focus-ring);outline-offset:1px}.thumbnail--disabled .thumbnail__link{cursor:not-allowed}.thumbnail--disabled .thumbnail__media,.thumbnail--disabled .thumbnail__caption{opacity:0.5}.thumbnail__preview{position:fixed;inset:0;display:none;width:100%;max-width:none;height:100%;max-height:none;padding:0;border:none;background:transparent;overflow:hidden}.thumbnail__preview[open]{display:grid;place-items:center}.thumbnail__preview::backdrop{background:transparent}.thumbnail__preview-backdrop{position:fixed;inset:0;background:var(--zn-overlay-background-color)}.thumbnail__preview-frame{--preview-max-width:var(--zn-thumbnail-preview-max-width,70vw);--preview-max-height:var(--zn-thumbnail-preview-max-height,70vh);--preview-ratio:var(--zn-thumbnail-preview-aspect-ratio,var(--zn-thumbnail-preview-measured-ratio,var(--zn-thumbnail-aspect-ratio,16/9)));position:relative;width:min(var(--preview-max-width),var(--preview-max-height) * (var(--preview-ratio)));max-width:var(--preview-max-width);max-height:var(--preview-max-height);aspect-ratio:var(--preview-ratio);overflow:hidden;border-radius:var(--zn-thumbnail-preview-radius,var(--zn-border-radius));background-color:rgb(var(--zn-panel));box-shadow:var(--zn-shadow-x-large);transform-origin:center center}.thumbnail__preview-image,.thumbnail__preview-placeholder{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.thumbnail__preview-placeholder{position:absolute;inset:0;-o-object-fit:cover;object-fit:cover;filter:blur(12px);transform:scale(1.05)}.thumbnail__preview-media::slotted(*){position:relative;display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.thumbnail__preview-image{position:relative}.thumbnail__preview-close{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__preview-close:hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail__preview-close{position:absolute;top:var(--zn-spacing-x-small);right:var(--zn-spacing-x-small);min-width:28px;min-height:28px}.thumbnail__preview-close:focus-visible{outline:var(--zn-focus-ring);outline-offset:1px}`;var DP=260,OP="cubic-bezier(0.2, 0, 0.2, 1)",Ge=class extends T{constructor(){super(...arguments);this.hasSlotController=new te(this,"[default]","image","caption","badge","actions","preview");this.caption="";this.aspectRatio="";this.fullUri="";this.previewTrigger="click";this.previewLabel="Preview";this.value="";this.selected=!1;this.active=!1;this.selectable=!1;this.disabled=!1;this.icon="";this.hideCaption=!1;this._previewOpen=!1;this._previewRatio=0;this._origin=null;this._animating=!1;this._handleClick=t=>{let r=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;this._activate(t,!r)};this._handleKeyDown=t=>{t.key!=="Enter"&&t.key!==" "||this._isLink()&&t.key==="Enter"||(t.preventDefault(),this._activate(t,!0))};this._handlePreviewButtonClick=t=>{t.preventDefault(),t.stopPropagation(),this.showPreview()};this._handlePreviewCancel=t=>{t.preventDefault(),this.hidePreview()};this._handleBackdropClick=()=>{this.hidePreview()};this._handlePreviewImageLoad=t=>{let r=t.target;if(!r.naturalWidth||!r.naturalHeight)return;let n=r.naturalWidth/r.naturalHeight;this._previewRatio&&Math.abs(n-this._previewRatio)/this._previewRatio<.01||(this._previewRatio=n)}}disconnectedCallback(){super.disconnectedCallback(),this._previewOpen&&(this._preview?.close(),this._previewOpen=!1),ns(this)}_isLink(){return!!this.href&&!this.disabled}get _previewable(){return(!!this.fullUri||this.hasSlotController.test("preview"))&&!this.disabled}get _previewOnActivate(){return this._previewable&&this.previewTrigger==="click"}_resolveRatio(){let t=[this._previewImage,this._image];for(let n of t)if(n?.naturalWidth&&n.naturalHeight)return n.naturalWidth/n.naturalHeight;let r=this._media?.getBoundingClientRect();return r?.width&&r.height?r.width/r.height:0}async showPreview(){!this._previewable||this._previewOpen||this._animating||(this._origin=this._media?.getBoundingClientRect()??null,this._previewRatio=this._resolveRatio(),this.emit("zn-show"),this._previewOpen=!0,await this.updateComplete,this._preview&&(this._preview.showModal(),Dy(this),await this._animatePreview("in"),this._previewClose?.focus()))}async hidePreview(){!this._previewOpen||this._animating||(await this._animatePreview("out"),this._preview?.close(),this._previewOpen=!1,ns(this),this.emit("zn-close"))}async _animatePreview(t){let r=this._previewFrame,n=this._previewBackdrop;if(!r||!n)return;this._animating=!0;let a=t==="in"?this._origin:this._media?.getBoundingClientRect()??this._origin,s=[{transform:this._collapsedTransform(a,r.getBoundingClientRect()),opacity:"0.4"},{transform:"none",opacity:"1"}],l=[{opacity:"0"},{opacity:"1"}],d={duration:DP,easing:OP},h=t==="in"?s:[...s].reverse(),m=t==="in"?l:[...l].reverse();await Promise.all([Gi(r,h,d),Gi(n,m,d)]),this._animating=!1}_collapsedTransform(t,r){if(!t||!r.width||!r.height||Af())return"scale(0.94)";let n=Math.max(t.width/r.width,.01),a=Math.max(t.height/r.height,.01),s=t.left+t.width/2-(r.left+r.width/2),l=t.top+t.height/2-(r.top+r.height/2);return`translate(${s}px, ${l}px) scale(${n}, ${a})`}_activate(t,r){if(this.disabled){t.preventDefault(),t.stopPropagation();return}if(this.emit("zn-select",{detail:{item:this}}).defaultPrevented){t.preventDefault();return}r&&this._previewOnActivate&&(t.preventDefault(),this.showPreview())}render(){let t=this._isLink(),r=this._previewable,n=r&&this.previewTrigger==="button",a=t||this.selectable||this._previewOnActivate,s=t?an`a`:an`div`,l=this.hasSlotController.test("image"),d=this.hasSlotController.test("badge")||!!this.icon,h=this.hasSlotController.test("actions"),m=d||h||n,f=!this.hideCaption&&(!!this.caption||this.hasSlotController.test("caption"));return De`
6439
+ `}};Ce.styles=[k(Pe),k(a8)],Ce.formAssociated=!0,Ce.dependencies={"zn-icon":he,"zn-input":xt,"zn-option":at,"zn-select":Je},c([U(".schedule-builder__canvas")],Ce.prototype,"canvas",2),c([D()],Ce.prototype,"_days",2),c([D()],Ce.prototype,"_exceptions",2),c([D()],Ce.prototype,"_dragPreview",2),c([D()],Ce.prototype,"_editing",2),c([p({reflect:!0})],Ce.prototype,"name",2),c([p()],Ce.prototype,"value",2),c([Ne()],Ce.prototype,"defaultValue",2),c([p()],Ce.prototype,"label",2),c([p({attribute:"help-text"})],Ce.prototype,"helpText",2),c([p({reflect:!0})],Ce.prototype,"view",2),c([p({attribute:"open-label"})],Ce.prototype,"openLabel",2),c([p({attribute:"closed-label"})],Ce.prototype,"closedLabel",2),c([p({attribute:"no-toggle",type:Boolean})],Ce.prototype,"noToggle",2),c([p({attribute:"hide-summary",type:Boolean})],Ce.prototype,"hideSummary",2),c([p({attribute:"start-hour",type:Number})],Ce.prototype,"startHour",2),c([p({attribute:"end-hour",type:Number})],Ce.prototype,"endHour",2),c([p({type:Number})],Ce.prototype,"interval",2),c([p({attribute:"week-start"})],Ce.prototype,"weekStart",2),c([p({attribute:"time-format"})],Ce.prototype,"timeFormat",2),c([p({attribute:"display-timezone"})],Ce.prototype,"displayTimezone",2),c([p({attribute:"save-timezone"})],Ce.prototype,"saveTimezone",2),c([p({attribute:"show-timezone",type:Boolean})],Ce.prototype,"showTimezone",2),c([p({attribute:"timezones",converter:{fromAttribute:t=>t.split(/[,\s]+/).filter(Boolean),toAttribute:t=>t.join(" ")}})],Ce.prototype,"timezones",2),c([p({attribute:"reference-date"})],Ce.prototype,"referenceDate",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"readonly",2),c([p({type:Boolean,reflect:!0})],Ce.prototype,"required",2),c([p({reflect:!0})],Ce.prototype,"form",2),c([Q("value")],Ce.prototype,"handleValueChange",1),c([Q(["required","disabled"])],Ce.prototype,"handleValidationStateChange",1);var OP=Ce;Ce.define("zn-schedule-builder");var p8=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;min-width:0}.thumbnail{position:relative;min-width:0}.thumbnail__link{display:flex;flex-direction:column;gap:var(--zn-spacing-x-small);min-width:0;color:inherit;text-decoration:none;outline:none}.thumbnail--interactive .thumbnail__link{cursor:pointer}.thumbnail__media{position:relative;aspect-ratio:var(--zn-thumbnail-aspect-ratio,16/9);width:100%;overflow:hidden;border-radius:var(--zn-thumbnail-radius,var(--zn-border-radius));background-color:rgb(var(--zn-panel));--thumbnail-ring-color:rgb(var(--zn-border-color));--thumbnail-ring-width:1px;--thumbnail-ring-gap:0px}.thumbnail__media::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 var(--thumbnail-ring-width) var(--thumbnail-ring-color),inset 0 0 0 calc(var(--thumbnail-ring-width) + var(--thumbnail-ring-gap)) rgb(var(--zn-body));transition:box-shadow var(--zn-transition-fast) ease-in-out}.thumbnail__image{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.thumbnail__slotted-media{display:grid;place-items:center;width:100%;height:100%}.thumbnail__slotted-media::slotted(img),.thumbnail__slotted-media::slotted(video),.thumbnail__slotted-media::slotted(canvas),.thumbnail__slotted-media::slotted(picture),.thumbnail__slotted-media::slotted(div){width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.thumbnail__caption{font-family:var(--zn-font-sans);font-size:var(--zn-text-table-content-font-size);font-weight:var(--zn-text-table-content-font-weight);line-height:var(--zn-text-table-content-line-height);color:var(--zn-text-table-content-color);text-transform:var(--zn-text-table-content-transform);letter-spacing:var(--zn-text-table-content-letter-spacing,normal);min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.thumbnail__overlay{position:absolute;top:0;left:0;right:0;aspect-ratio:var(--zn-thumbnail-aspect-ratio,16/9);border-radius:var(--zn-thumbnail-radius,var(--zn-border-radius));overflow:hidden;pointer-events:none}.thumbnail__badge,.thumbnail__actions,.thumbnail__preview-button{position:absolute;display:flex;align-items:center;gap:var(--zn-thumbnail-chip-gap,var(--zn-spacing-2x-small))}.thumbnail__badge{bottom:var(--zn-spacing-2x-small);left:var(--zn-spacing-2x-small);pointer-events:none}.thumbnail__actions,.thumbnail__preview-button{pointer-events:auto}.thumbnail__actions{bottom:var(--zn-spacing-2x-small);right:var(--zn-spacing-2x-small)}.thumbnail__preview-button{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__preview-button:hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail__preview-button{top:var(--zn-spacing-2x-small);right:var(--zn-spacing-2x-small)}.thumbnail__badge-items,.thumbnail__action-items{display:contents}.thumbnail__badge-icon,.thumbnail__badge-items::slotted(*){display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:default;opacity:var(--zn-thumbnail-badge-opacity,0.65)}.thumbnail__action-items::slotted(*){display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__action-items::slotted(*):hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail:hover:not(.thumbnail--disabled):not(.thumbnail--selected):not(.thumbnail--active) .thumbnail__media{--thumbnail-ring-color:rgb(var(--zn-primary))}.thumbnail--selected .thumbnail__media{--thumbnail-ring-color:var(--zn-thumbnail-selected-color,rgb(var(--zn-primary)));--thumbnail-ring-width:2px;--thumbnail-ring-gap:1px}.thumbnail--active .thumbnail__media{--thumbnail-ring-color:var(--zn-thumbnail-active-color,rgb(var(--zn-color-success)));--thumbnail-ring-width:2px;--thumbnail-ring-gap:1px}.thumbnail__link:focus-visible .thumbnail__media{outline:var(--zn-focus-ring);outline-offset:calc(-1 * var(--zn-focus-ring-width))}.thumbnail__preview-button:focus-visible,.thumbnail__action-items::slotted(*:focus-visible){outline:var(--zn-focus-ring);outline-offset:1px}.thumbnail--disabled .thumbnail__link{cursor:not-allowed}.thumbnail--disabled .thumbnail__media,.thumbnail--disabled .thumbnail__caption{opacity:0.5}.thumbnail__preview{position:fixed;inset:0;display:none;width:100%;max-width:none;height:100%;max-height:none;padding:0;border:none;background:transparent;overflow:hidden}.thumbnail__preview[open]{display:grid;place-items:center}.thumbnail__preview::backdrop{background:transparent}.thumbnail__preview-backdrop{position:fixed;inset:0;background:var(--zn-overlay-background-color)}.thumbnail__preview-frame{--preview-max-width:var(--zn-thumbnail-preview-max-width,70vw);--preview-max-height:var(--zn-thumbnail-preview-max-height,70vh);--preview-ratio:var(--zn-thumbnail-preview-aspect-ratio,var(--zn-thumbnail-preview-measured-ratio,var(--zn-thumbnail-aspect-ratio,16/9)));position:relative;width:min(var(--preview-max-width),var(--preview-max-height) * (var(--preview-ratio)));max-width:var(--preview-max-width);max-height:var(--preview-max-height);aspect-ratio:var(--preview-ratio);overflow:hidden;border-radius:var(--zn-thumbnail-preview-radius,var(--zn-border-radius));background-color:rgb(var(--zn-panel));box-shadow:var(--zn-shadow-x-large);transform-origin:center center}.thumbnail__preview-image,.thumbnail__preview-placeholder{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.thumbnail__preview-placeholder{position:absolute;inset:0;-o-object-fit:cover;object-fit:cover;filter:blur(12px);transform:scale(1.05)}.thumbnail__preview-media::slotted(*){position:relative;display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.thumbnail__preview-image{position:relative}.thumbnail__preview-close{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:2px;border:none;border-radius:var(--zn-thumbnail-chip-radius,var(--zn-border-radius));background-color:var(--zn-thumbnail-chip-background,rgba(0,0,0,0.6));color:var(--zn-thumbnail-chip-color,#fff);line-height:0;transition:background-color var(--zn-transition-fast) ease-in-out;cursor:pointer}.thumbnail__preview-close:hover{background-color:var(--zn-thumbnail-chip-background-hover,rgba(0,0,0,0.8))}.thumbnail__preview-close{position:absolute;top:var(--zn-spacing-x-small);right:var(--zn-spacing-x-small);min-width:28px;min-height:28px}.thumbnail__preview-close:focus-visible{outline:var(--zn-focus-ring);outline-offset:1px}`;var NP=260,PP="cubic-bezier(0.2, 0, 0.2, 1)",Ge=class extends T{constructor(){super(...arguments);this.hasSlotController=new te(this,"[default]","image","caption","badge","actions","preview");this.caption="";this.aspectRatio="";this.fullUri="";this.previewTrigger="click";this.previewLabel="Preview";this.value="";this.selected=!1;this.active=!1;this.selectable=!1;this.disabled=!1;this.icon="";this.hideCaption=!1;this._previewOpen=!1;this._previewRatio=0;this._origin=null;this._animating=!1;this._handleClick=t=>{let r=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;this._activate(t,!r)};this._handleKeyDown=t=>{t.key!=="Enter"&&t.key!==" "||this._isLink()&&t.key==="Enter"||(t.preventDefault(),this._activate(t,!0))};this._handlePreviewButtonClick=t=>{t.preventDefault(),t.stopPropagation(),this.showPreview()};this._handlePreviewCancel=t=>{t.preventDefault(),this.hidePreview()};this._handleBackdropClick=()=>{this.hidePreview()};this._handlePreviewImageLoad=t=>{let r=t.target;if(!r.naturalWidth||!r.naturalHeight)return;let n=r.naturalWidth/r.naturalHeight;this._previewRatio&&Math.abs(n-this._previewRatio)/this._previewRatio<.01||(this._previewRatio=n)}}disconnectedCallback(){super.disconnectedCallback(),this._previewOpen&&(this._preview?.close(),this._previewOpen=!1),ns(this)}_isLink(){return!!this.href&&!this.disabled}get _previewable(){return(!!this.fullUri||this.hasSlotController.test("preview"))&&!this.disabled}get _previewOnActivate(){return this._previewable&&this.previewTrigger==="click"}_resolveRatio(){let t=[this._previewImage,this._image];for(let n of t)if(n?.naturalWidth&&n.naturalHeight)return n.naturalWidth/n.naturalHeight;let r=this._media?.getBoundingClientRect();return r?.width&&r.height?r.width/r.height:0}async showPreview(){!this._previewable||this._previewOpen||this._animating||(this._origin=this._media?.getBoundingClientRect()??null,this._previewRatio=this._resolveRatio(),this.emit("zn-show"),this._previewOpen=!0,await this.updateComplete,this._preview&&(this._preview.showModal(),Dy(this),await this._animatePreview("in"),this._previewClose?.focus()))}async hidePreview(){!this._previewOpen||this._animating||(await this._animatePreview("out"),this._preview?.close(),this._previewOpen=!1,ns(this),this.emit("zn-close"))}async _animatePreview(t){let r=this._previewFrame,n=this._previewBackdrop;if(!r||!n)return;this._animating=!0;let a=t==="in"?this._origin:this._media?.getBoundingClientRect()??this._origin,s=[{transform:this._collapsedTransform(a,r.getBoundingClientRect()),opacity:"0.4"},{transform:"none",opacity:"1"}],l=[{opacity:"0"},{opacity:"1"}],d={duration:NP,easing:PP},h=t==="in"?s:[...s].reverse(),m=t==="in"?l:[...l].reverse();await Promise.all([Gi(r,h,d),Gi(n,m,d)]),this._animating=!1}_collapsedTransform(t,r){if(!t||!r.width||!r.height||Af())return"scale(0.94)";let n=Math.max(t.width/r.width,.01),a=Math.max(t.height/r.height,.01),s=t.left+t.width/2-(r.left+r.width/2),l=t.top+t.height/2-(r.top+r.height/2);return`translate(${s}px, ${l}px) scale(${n}, ${a})`}_activate(t,r){if(this.disabled){t.preventDefault(),t.stopPropagation();return}if(this.emit("zn-select",{detail:{item:this}}).defaultPrevented){t.preventDefault();return}r&&this._previewOnActivate&&(t.preventDefault(),this.showPreview())}render(){let t=this._isLink(),r=this._previewable,n=r&&this.previewTrigger==="button",a=t||this.selectable||this._previewOnActivate,s=t?an`a`:an`div`,l=this.hasSlotController.test("image"),d=this.hasSlotController.test("badge")||!!this.icon,h=this.hasSlotController.test("actions"),m=d||h||n,f=!this.hideCaption&&(!!this.caption||this.hasSlotController.test("caption"));return De`
6440
6440
  <div
6441
6441
  part="base"
6442
6442
  style="${It({"--zn-thumbnail-aspect-ratio":this.aspectRatio||null})}"
@@ -6531,7 +6531,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6531
6531
  </button>
6532
6532
  </div>
6533
6533
  </dialog>`:""}
6534
- </div>`}};Ge.styles=k(p8),Ge.dependencies={"zn-icon":he},c([p()],Ge.prototype,"src",2),c([p()],Ge.prototype,"alt",2),c([p()],Ge.prototype,"caption",2),c([p({attribute:"aspect-ratio",reflect:!0})],Ge.prototype,"aspectRatio",2),c([p()],Ge.prototype,"href",2),c([p()],Ge.prototype,"target",2),c([p({attribute:"full-uri"})],Ge.prototype,"fullUri",2),c([p({attribute:"preview-trigger"})],Ge.prototype,"previewTrigger",2),c([p({attribute:"preview-label"})],Ge.prototype,"previewLabel",2),c([p()],Ge.prototype,"value",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"active",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"selectable",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"disabled",2),c([p()],Ge.prototype,"icon",2),c([p({type:Boolean,attribute:"hide-caption"})],Ge.prototype,"hideCaption",2),c([D()],Ge.prototype,"_previewOpen",2),c([D()],Ge.prototype,"_previewRatio",2),c([U(".thumbnail__media")],Ge.prototype,"_media",2),c([U(".thumbnail__image")],Ge.prototype,"_image",2),c([U(".thumbnail__preview-image")],Ge.prototype,"_previewImage",2),c([U(".thumbnail__preview")],Ge.prototype,"_preview",2),c([U(".thumbnail__preview-frame")],Ge.prototype,"_previewFrame",2),c([U(".thumbnail__preview-backdrop")],Ge.prototype,"_previewBackdrop",2),c([U(".thumbnail__preview-close")],Ge.prototype,"_previewClose",2);var NP=Ge;Ge.define("zn-thumbnail");var h8=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;width:100%}.thumbnail-group__header{display:flex;align-items:center;justify-content:space-between;gap:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-x-small)}.thumbnail-group__caption{font-family:var(--zn-font-sans);font-size:var(--zn-text-h1-font-size);font-weight:var(--zn-text-h1-font-weight);line-height:var(--zn-text-h1-line-height);color:var(--zn-text-h1-color);text-transform:var(--zn-text-h1-transform);letter-spacing:var(--zn-text-h1-letter-spacing,normal);min-width:0;text-overflow:ellipsis;white-space:nowrap}.thumbnail-group__header-actions{display:flex;align-items:center;flex:0 0 auto;gap:var(--zn-spacing-x-small)}.thumbnail-group__toggle{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-font-size);font-weight:var(--zn-text-subheading-font-weight);line-height:var(--zn-text-subheading-line-height);color:var(--zn-text-subheading-color);text-transform:var(--zn-text-subheading-transform);letter-spacing:var(--zn-text-subheading-letter-spacing,normal);padding:0;background:none;border:none;cursor:pointer;white-space:nowrap}.thumbnail-group__toggle:hover{color:rgb(var(--zn-text))}.thumbnail-group__toggle:focus-visible{outline:var(--zn-focus-ring);outline-offset:var(--zn-focus-ring-offset);border-radius:var(--zn-border-radius-small)}.thumbnail-group__items{display:grid;gap:var(--zn-thumbnail-gap,var(--zn-spacing-small));grid-auto-flow:column;grid-auto-columns:var(--zn-thumbnail-width,180px);overflow-x:auto;overflow-y:hidden;padding-bottom:var(--zn-spacing-2x-small);scroll-snap-type:x proximity;overscroll-behavior-x:contain}.thumbnail-group--expanded .thumbnail-group__items{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:repeat(auto-fill,minmax(var(--zn-thumbnail-width,180px),1fr));overflow:visible;padding-bottom:0}slot{display:contents}::slotted(*){scroll-snap-align:start;min-width:0}`;var Gt=class extends T{constructor(){super(...arguments);this.caption="";this.expanded=!1;this.total=0;this.showAllLabel="Show All";this.showLessLabel="Show Less";this.hideToggle=!1;this.alwaysToggle=!1;this.selectable=!1;this.aspectRatio="";this.thumbnailWidth="";this.gap="";this.value="";this._overflowing=!1;this._count=0;this._resizeObserver=null;this._handleSlotChange=()=>{this._sync(),this._measure()};this._handleSelect=t=>{if(!this.selectable)return;let r=t.detail.item;if(r.parentElement===this){for(let n of this._thumbnails)n.selected=n===r;this.value=r.value,this.emit("zn-change")}};this._handleToggle=()=>{this.expanded?this.hide():this.show()}}connectedCallback(){super.connectedCallback(),this._observe()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null}firstUpdated(t){super.firstUpdated(t),this._observe(),this._sync()}_observe(){this._items&&(this._resizeObserver??(this._resizeObserver=new ResizeObserver(()=>this._measure())),this._resizeObserver.observe(this._items))}updated(t){super.updated(t),t.has("expanded")&&this._measure(),(t.has("selectable")||t.has("value"))&&this._sync(),this._syncCustomProperties(t)}_syncCustomProperties(t){let r=[["aspectRatio","--zn-thumbnail-aspect-ratio",this.aspectRatio],["thumbnailWidth","--zn-thumbnail-width",this.thumbnailWidth],["gap","--zn-thumbnail-gap",this.gap]];for(let[n,a,s]of r)t.has(n)&&(s?this.style.setProperty(a,s):t.get(n)&&this.style.removeProperty(a))}show(){this.expanded||(this.expanded=!0,this.emit("zn-expand"))}hide(){this.expanded&&(this.expanded=!1,this.emit("zn-collapse"))}get _thumbnails(){return Array.from(this.querySelectorAll(":scope > zn-thumbnail"))}_sync(){let t=this._thumbnails;if(this._count=t.length,!!this.selectable){this.value||(this.value=t.find(r=>r.selected)?.value??"");for(let r of t)r.selectable=!0,this.value&&(r.selected=r.value===this.value)}}_measure(){this.expanded||!this._items||(this._overflowing=this._items.scrollWidth-this._items.clientWidth>1)}render(){let t=this.total||this._count,r=!this.hideToggle&&(this.expanded||this.alwaysToggle||this._overflowing||t>this._count),n=!!this.caption||r;return u`
6534
+ </div>`}};Ge.styles=k(p8),Ge.dependencies={"zn-icon":he},c([p()],Ge.prototype,"src",2),c([p()],Ge.prototype,"alt",2),c([p()],Ge.prototype,"caption",2),c([p({attribute:"aspect-ratio",reflect:!0})],Ge.prototype,"aspectRatio",2),c([p()],Ge.prototype,"href",2),c([p()],Ge.prototype,"target",2),c([p({attribute:"full-uri"})],Ge.prototype,"fullUri",2),c([p({attribute:"preview-trigger"})],Ge.prototype,"previewTrigger",2),c([p({attribute:"preview-label"})],Ge.prototype,"previewLabel",2),c([p()],Ge.prototype,"value",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"selected",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"active",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"selectable",2),c([p({type:Boolean,reflect:!0})],Ge.prototype,"disabled",2),c([p()],Ge.prototype,"icon",2),c([p({type:Boolean,attribute:"hide-caption"})],Ge.prototype,"hideCaption",2),c([D()],Ge.prototype,"_previewOpen",2),c([D()],Ge.prototype,"_previewRatio",2),c([U(".thumbnail__media")],Ge.prototype,"_media",2),c([U(".thumbnail__image")],Ge.prototype,"_image",2),c([U(".thumbnail__preview-image")],Ge.prototype,"_previewImage",2),c([U(".thumbnail__preview")],Ge.prototype,"_preview",2),c([U(".thumbnail__preview-frame")],Ge.prototype,"_previewFrame",2),c([U(".thumbnail__preview-backdrop")],Ge.prototype,"_previewBackdrop",2),c([U(".thumbnail__preview-close")],Ge.prototype,"_previewClose",2);var HP=Ge;Ge.define("zn-thumbnail");var h8=S`@charset "UTF-8";@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;width:100%}.thumbnail-group__header{display:flex;align-items:center;justify-content:space-between;gap:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-x-small)}.thumbnail-group__caption{font-family:var(--zn-font-sans);font-size:var(--zn-text-h1-font-size);font-weight:var(--zn-text-h1-font-weight);line-height:var(--zn-text-h1-line-height);color:var(--zn-text-h1-color);text-transform:var(--zn-text-h1-transform);letter-spacing:var(--zn-text-h1-letter-spacing,normal);min-width:0;text-overflow:ellipsis;white-space:nowrap}.thumbnail-group__header-actions{display:flex;align-items:center;flex:0 0 auto;gap:var(--zn-spacing-x-small)}.thumbnail-group__toggle{font-family:var(--zn-font-sans);font-size:var(--zn-text-subheading-font-size);font-weight:var(--zn-text-subheading-font-weight);line-height:var(--zn-text-subheading-line-height);color:var(--zn-text-subheading-color);text-transform:var(--zn-text-subheading-transform);letter-spacing:var(--zn-text-subheading-letter-spacing,normal);padding:0;background:none;border:none;cursor:pointer;white-space:nowrap}.thumbnail-group__toggle:hover{color:rgb(var(--zn-text))}.thumbnail-group__toggle:focus-visible{outline:var(--zn-focus-ring);outline-offset:var(--zn-focus-ring-offset);border-radius:var(--zn-border-radius-small)}.thumbnail-group__items{display:grid;gap:var(--zn-thumbnail-gap,var(--zn-spacing-small));grid-auto-flow:column;grid-auto-columns:var(--zn-thumbnail-width,180px);overflow-x:auto;overflow-y:hidden;padding-bottom:var(--zn-spacing-2x-small);scroll-snap-type:x proximity;overscroll-behavior-x:contain}.thumbnail-group--expanded .thumbnail-group__items{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:repeat(auto-fill,minmax(var(--zn-thumbnail-width,180px),1fr));overflow:visible;padding-bottom:0}slot{display:contents}::slotted(*){scroll-snap-align:start;min-width:0}`;var Gt=class extends T{constructor(){super(...arguments);this.caption="";this.expanded=!1;this.total=0;this.showAllLabel="Show All";this.showLessLabel="Show Less";this.hideToggle=!1;this.alwaysToggle=!1;this.selectable=!1;this.aspectRatio="";this.thumbnailWidth="";this.gap="";this.value="";this._overflowing=!1;this._count=0;this._resizeObserver=null;this._handleSlotChange=()=>{this._sync(),this._measure()};this._handleSelect=t=>{if(!this.selectable)return;let r=t.detail.item;if(r.parentElement===this){for(let n of this._thumbnails)n.selected=n===r;this.value=r.value,this.emit("zn-change")}};this._handleToggle=()=>{this.expanded?this.hide():this.show()}}connectedCallback(){super.connectedCallback(),this._observe()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null}firstUpdated(t){super.firstUpdated(t),this._observe(),this._sync()}_observe(){this._items&&(this._resizeObserver??(this._resizeObserver=new ResizeObserver(()=>this._measure())),this._resizeObserver.observe(this._items))}updated(t){super.updated(t),t.has("expanded")&&this._measure(),(t.has("selectable")||t.has("value"))&&this._sync(),this._syncCustomProperties(t)}_syncCustomProperties(t){let r=[["aspectRatio","--zn-thumbnail-aspect-ratio",this.aspectRatio],["thumbnailWidth","--zn-thumbnail-width",this.thumbnailWidth],["gap","--zn-thumbnail-gap",this.gap]];for(let[n,a,s]of r)t.has(n)&&(s?this.style.setProperty(a,s):t.get(n)&&this.style.removeProperty(a))}show(){this.expanded||(this.expanded=!0,this.emit("zn-expand"))}hide(){this.expanded&&(this.expanded=!1,this.emit("zn-collapse"))}get _thumbnails(){return Array.from(this.querySelectorAll(":scope > zn-thumbnail"))}_sync(){let t=this._thumbnails;if(this._count=t.length,!!this.selectable){this.value||(this.value=t.find(r=>r.selected)?.value??"");for(let r of t)r.selectable=!0,this.value&&(r.selected=r.value===this.value)}}_measure(){this.expanded||!this._items||(this._overflowing=this._items.scrollWidth-this._items.clientWidth>1)}render(){let t=this.total||this._count,r=!this.hideToggle&&(this.expanded||this.alwaysToggle||this._overflowing||t>this._count),n=!!this.caption||r;return u`
6535
6535
  <div
6536
6536
  part="base"
6537
6537
  class="${q({"thumbnail-group":!0,"thumbnail-group--expanded":this.expanded})}">
@@ -6556,7 +6556,7 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6556
6556
  <div part="items" class="thumbnail-group__items">
6557
6557
  <slot @slotchange="${this._handleSlotChange}" @zn-select="${this._handleSelect}"></slot>
6558
6558
  </div>
6559
- </div>`}};Gt.styles=k(h8),c([p()],Gt.prototype,"caption",2),c([p({type:Boolean,reflect:!0})],Gt.prototype,"expanded",2),c([p({type:Number})],Gt.prototype,"total",2),c([p({attribute:"show-all-label"})],Gt.prototype,"showAllLabel",2),c([p({attribute:"show-less-label"})],Gt.prototype,"showLessLabel",2),c([p({type:Boolean,attribute:"hide-toggle"})],Gt.prototype,"hideToggle",2),c([p({type:Boolean,attribute:"always-toggle"})],Gt.prototype,"alwaysToggle",2),c([p({type:Boolean,reflect:!0})],Gt.prototype,"selectable",2),c([p({attribute:"aspect-ratio",reflect:!0})],Gt.prototype,"aspectRatio",2),c([p({attribute:"thumbnail-width",reflect:!0})],Gt.prototype,"thumbnailWidth",2),c([p({reflect:!0})],Gt.prototype,"gap",2),c([p()],Gt.prototype,"value",2),c([D()],Gt.prototype,"_overflowing",2),c([D()],Gt.prototype,"_count",2),c([U(".thumbnail-group__items")],Gt.prototype,"_items",2);var PP=Gt;Gt.define("zn-thumbnail-group");var u8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;position:relative;min-width:0;min-height:0;overflow:hidden;isolation:isolate}.background{position:relative;box-sizing:border-box;width:100%;height:100%;min-height:inherit;overflow:hidden;background-color:var(--_zn-background-color,var(--zn-background-color,transparent))}.background__image,.background__overlay,.background__floating-icons{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.background__image{width:108%;height:108%;max-width:none;inset:-4%;-o-object-fit:cover;object-fit:cover;-o-object-position:var(--zn-background-image-position,center);object-position:var(--zn-background-image-position,center);opacity:1}:host([image-strength=soft]) .background__image{opacity:0.3}:host([image-strength=medium]) .background__image{opacity:0.62}.background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(255,255,255,0.18),rgba(255,255,255,0.04))}:host([overlay=none]) .background__overlay{display:none}:host([overlay=strong]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(255,255,255,0.48),rgba(255,255,255,0.18))}:host([overlay-tone=dark]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(4,12,32,0.28),rgba(4,12,32,0.06))}:host([overlay-tone=dark][overlay=strong]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(4,12,32,0.62),rgba(4,12,32,0.28))}:host([motion=drift]) .background__image{animation:zn-background-drift 28s ease-in-out infinite alternate}:host([motion=breathe]) .background__image{animation:zn-background-breathe 18s ease-in-out infinite}:host([paused]) .background__image{animation-play-state:paused}.background__floating-icons{overflow:hidden;color:var(--zn-background-floating-icon-color,currentColor)}.background__floating-icon{--_zn-background-icon-opacity-min:0.01;--_zn-background-icon-opacity-max:0.18;position:absolute;left:8%;top:13%;opacity:var(--_zn-background-icon-opacity-min);animation:zn-background-icon-float 11s ease-in-out infinite alternate both}.background__floating-icon:nth-child(2){--_zn-background-icon-opacity-min:0.08;--_zn-background-icon-opacity-max:0.34;left:auto;right:9%;top:9%;animation-delay:-4s;animation-duration:14s}.background__floating-icon:nth-child(3){--_zn-background-icon-opacity-min:0.03;--_zn-background-icon-opacity-max:0.5;left:2%;top:47%;animation-delay:-7s;animation-duration:13s}.background__floating-icon:nth-child(4){--_zn-background-icon-opacity-min:0.12;--_zn-background-icon-opacity-max:0.38;left:auto;right:12%;top:45%;animation-delay:-2s;animation-duration:10s}.background__floating-icon:nth-child(5){--_zn-background-icon-opacity-min:0.05;--_zn-background-icon-opacity-max:0.29;left:21%;top:auto;bottom:4%;animation-delay:-5s;animation-duration:15s}.background__floating-icon:nth-child(6){--_zn-background-icon-opacity-min:0.01;--_zn-background-icon-opacity-max:0.42;left:auto;right:4%;top:auto;bottom:3%;animation-delay:-9s;animation-duration:12s}.background__floating-icon:nth-child(7){--_zn-background-icon-opacity-min:0.09;--_zn-background-icon-opacity-max:0.31;left:42%;top:7%;animation-delay:-6s;animation-duration:16s}.background__floating-icon:nth-child(8){--_zn-background-icon-opacity-min:0.04;--_zn-background-icon-opacity-max:0.46;left:54%;top:auto;bottom:8%;animation-delay:-11s;animation-duration:17s}:host([paused]) .background__floating-icon{animation-play-state:paused}.background__content{position:relative;z-index:1;box-sizing:border-box;width:100%;height:100%;min-height:inherit}@keyframes zn-background-drift{from{transform:scale(1.04) translate3d(-1.2%,-0.6%,0)}to{transform:scale(1.04) translate3d(1.2%,0.6%,0)}}@keyframes zn-background-breathe{0%,100%{transform:scale(1.02)}50%{transform:scale(1.07)}}@keyframes zn-background-icon-float{from{opacity:var(--_zn-background-icon-opacity-min);transform:translate3d(-8%,-12%,0) scale(0.88) rotate(-8deg)}to{opacity:var(--_zn-background-icon-opacity-max);transform:translate3d(8%,12%,0) scale(1.06) rotate(8deg)}}@media (prefers-reduced-motion:reduce){.background__image,.background__floating-icon{animation:none}.background__floating-icon{opacity:var(--_zn-background-icon-opacity-max)}}`;var oi=class extends T{constructor(){super(...arguments);this.resizeObserver=new St(this,{callback:t=>{let r=t[0]?.contentRect.width??this.offsetWidth;return Math.max(1,Math.min(r*.05,150))}});this.image="";this.color="";this.imageStrength="full";this.motion="none";this.overlay="soft";this.overlayTone="light";this.floatingIcons="";this.paused=!1}render(){let t=this.floatingIcons.split(",").map(n=>n.trim()).filter(Boolean).slice(0,8),r=this.resizeObserver.value??1;return u`
6559
+ </div>`}};Gt.styles=k(h8),c([p()],Gt.prototype,"caption",2),c([p({type:Boolean,reflect:!0})],Gt.prototype,"expanded",2),c([p({type:Number})],Gt.prototype,"total",2),c([p({attribute:"show-all-label"})],Gt.prototype,"showAllLabel",2),c([p({attribute:"show-less-label"})],Gt.prototype,"showLessLabel",2),c([p({type:Boolean,attribute:"hide-toggle"})],Gt.prototype,"hideToggle",2),c([p({type:Boolean,attribute:"always-toggle"})],Gt.prototype,"alwaysToggle",2),c([p({type:Boolean,reflect:!0})],Gt.prototype,"selectable",2),c([p({attribute:"aspect-ratio",reflect:!0})],Gt.prototype,"aspectRatio",2),c([p({attribute:"thumbnail-width",reflect:!0})],Gt.prototype,"thumbnailWidth",2),c([p({reflect:!0})],Gt.prototype,"gap",2),c([p()],Gt.prototype,"value",2),c([D()],Gt.prototype,"_overflowing",2),c([D()],Gt.prototype,"_count",2),c([U(".thumbnail-group__items")],Gt.prototype,"_items",2);var FP=Gt;Gt.define("zn-thumbnail-group");var u8=S`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;position:relative;min-width:0;min-height:0;overflow:hidden;isolation:isolate}.background{position:relative;box-sizing:border-box;width:100%;height:100%;min-height:inherit;overflow:hidden;background-color:var(--_zn-background-color,var(--zn-background-color,transparent))}.background__image,.background__overlay,.background__floating-icons{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.background__image{width:108%;height:108%;max-width:none;inset:-4%;-o-object-fit:cover;object-fit:cover;-o-object-position:var(--zn-background-image-position,center);object-position:var(--zn-background-image-position,center);opacity:1}:host([image-strength=soft]) .background__image{opacity:0.3}:host([image-strength=medium]) .background__image{opacity:0.62}.background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(255,255,255,0.18),rgba(255,255,255,0.04))}:host([overlay=none]) .background__overlay{display:none}:host([overlay=strong]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(255,255,255,0.48),rgba(255,255,255,0.18))}:host([overlay-tone=dark]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(4,12,32,0.28),rgba(4,12,32,0.06))}:host([overlay-tone=dark][overlay=strong]) .background__overlay{background:linear-gradient(var(--zn-background-overlay-angle,110deg),rgba(4,12,32,0.62),rgba(4,12,32,0.28))}:host([motion=drift]) .background__image{animation:zn-background-drift 28s ease-in-out infinite alternate}:host([motion=breathe]) .background__image{animation:zn-background-breathe 18s ease-in-out infinite}:host([paused]) .background__image{animation-play-state:paused}.background__floating-icons{overflow:hidden;color:var(--zn-background-floating-icon-color,currentColor)}.background__floating-icon{--_zn-background-icon-opacity-min:0.01;--_zn-background-icon-opacity-max:0.18;position:absolute;left:8%;top:13%;opacity:var(--_zn-background-icon-opacity-min);animation:zn-background-icon-float 11s ease-in-out infinite alternate both}.background__floating-icon:nth-child(2){--_zn-background-icon-opacity-min:0.08;--_zn-background-icon-opacity-max:0.34;left:auto;right:9%;top:9%;animation-delay:-4s;animation-duration:14s}.background__floating-icon:nth-child(3){--_zn-background-icon-opacity-min:0.03;--_zn-background-icon-opacity-max:0.5;left:2%;top:47%;animation-delay:-7s;animation-duration:13s}.background__floating-icon:nth-child(4){--_zn-background-icon-opacity-min:0.12;--_zn-background-icon-opacity-max:0.38;left:auto;right:12%;top:45%;animation-delay:-2s;animation-duration:10s}.background__floating-icon:nth-child(5){--_zn-background-icon-opacity-min:0.05;--_zn-background-icon-opacity-max:0.29;left:21%;top:auto;bottom:4%;animation-delay:-5s;animation-duration:15s}.background__floating-icon:nth-child(6){--_zn-background-icon-opacity-min:0.01;--_zn-background-icon-opacity-max:0.42;left:auto;right:4%;top:auto;bottom:3%;animation-delay:-9s;animation-duration:12s}.background__floating-icon:nth-child(7){--_zn-background-icon-opacity-min:0.09;--_zn-background-icon-opacity-max:0.31;left:42%;top:7%;animation-delay:-6s;animation-duration:16s}.background__floating-icon:nth-child(8){--_zn-background-icon-opacity-min:0.04;--_zn-background-icon-opacity-max:0.46;left:54%;top:auto;bottom:8%;animation-delay:-11s;animation-duration:17s}:host([paused]) .background__floating-icon{animation-play-state:paused}.background__content{position:relative;z-index:1;box-sizing:border-box;width:100%;height:100%;min-height:inherit}@keyframes zn-background-drift{from{transform:scale(1.04) translate3d(-1.2%,-0.6%,0)}to{transform:scale(1.04) translate3d(1.2%,0.6%,0)}}@keyframes zn-background-breathe{0%,100%{transform:scale(1.02)}50%{transform:scale(1.07)}}@keyframes zn-background-icon-float{from{opacity:var(--_zn-background-icon-opacity-min);transform:translate3d(-8%,-12%,0) scale(0.88) rotate(-8deg)}to{opacity:var(--_zn-background-icon-opacity-max);transform:translate3d(8%,12%,0) scale(1.06) rotate(8deg)}}@media (prefers-reduced-motion:reduce){.background__image,.background__floating-icon{animation:none}.background__floating-icon{opacity:var(--_zn-background-icon-opacity-max)}}`;var oi=class extends T{constructor(){super(...arguments);this.resizeObserver=new St(this,{callback:t=>{let r=t[0]?.contentRect.width??this.offsetWidth;return Math.max(1,Math.min(r*.05,150))}});this.image="";this.color="";this.imageStrength="full";this.motion="none";this.overlay="soft";this.overlayTone="light";this.floatingIcons="";this.paused=!1}render(){let t=this.floatingIcons.split(",").map(n=>n.trim()).filter(Boolean).slice(0,8),r=this.resizeObserver.value??1;return u`
6560
6560
  <div
6561
6561
  part="base"
6562
6562
  class="background"
@@ -6584,4 +6584,4 @@ Please report this to https://github.com/markedjs/marked.`,o){let r="<p>An error
6584
6584
  `:""}
6585
6585
  <div part="content" class="background__content"><slot></slot></div>
6586
6586
  </div>
6587
- `}};oi.styles=k(u8),oi.dependencies={"zn-icon":he},c([p()],oi.prototype,"image",2),c([p()],oi.prototype,"color",2),c([p({attribute:"image-strength",reflect:!0})],oi.prototype,"imageStrength",2),c([p({reflect:!0})],oi.prototype,"motion",2),c([p({reflect:!0})],oi.prototype,"overlay",2),c([p({attribute:"overlay-tone",reflect:!0})],oi.prototype,"overlayTone",2),c([p({attribute:"floating-icons"})],oi.prototype,"floatingIcons",2),c([p({type:Boolean,reflect:!0})],oi.prototype,"paused",2);var HP=oi;oi.define("zn-background");export{HS as AbsoluteContainer,$D as ActionBar,cf as Alert,LO as AnimatedButton,PD as AudioSelect,HP as Background,hE as BulkActions,Oe as Button,Nc as ButtonGroup,CD as ButtonMenu,I9 as ChannelTile,N9 as Chart,JC as ChatMessage,ZC as ChatMessageAttachment,nD as Checkbox,hD as CheckboxGroup,_o as Chip,rs as Collapsible,SD as ColorSelect,E9 as Cols,as as Confirm,qD as ContentBlock,vf as CopyButton,kD as DataSelect,S9 as DataTable,lh as DataTableFilter,Of as DataTableSearch,TD as DataTableSort,Df as Datepicker,T9 as DefinedLabel,os as Dialog,Mr as Dropdown,rD as Editor,_n as EditorDialog,Nb as EditorQuickAction,Bd as EditorTool,Nf as EmptyState,Xf as ExpandingAction,pD as File,OD as FilterContainer,RD as FilterWrapper,Lv as FlowBranchConditions,aP as FlowBuilder,lP as FlowStep,Rv as FlowStepGroup,sP as FlowSteps,oD as FormActions,Wb as FormGroup,B9 as Header,Pf as HoverContainer,he as Icon,Y9 as IconPicker,xh as InlineEdit,xt as Input,aD as InputGroup,uD as Item,$O as Key,AO as KeyContainer,sD as LinkedSelect,NN as MarkdownEditor,In as Menu,Wi as MenuItem,ls as Navbar,$9 as Note,Mf as OptGroup,at as Option,pE as OrderTable,K9 as Page,gP as PageBuilder,AD as PageNav,Hv as PagePaletteItem,Fv as PageSectionCard,X9 as Pagination,eE as Pane,Hf as Panel,Oc as Popup,Uv as PreviewFrame,qO as PriorityList,dE as ProgressBar,cE as ProgressTile,m9 as QueryBuilder,lD as Radio,dD as RadioGroup,cD as Rating,Yu as RemarkdEditor,ND as Reveal,RP as ScheduleBuilder,lE as ScrollContainer,Je as Select,DD as SettingsContainer,iE as Sidebar,F9 as SimpleChart,Ff as Skeleton,Gc as SlashItem,ss as SlashMenu,ED as Slideout,oE as Sp,MD as SplitButton,rE as SplitPane,sE as Stat,LD as StatusIndicator,aE as Stepper,Bf as Style,Qf as Tab,Z9 as Table,Dn as Tabs,Ma as Textarea,wP as ThemeEditor,NP as Thumbnail,PP as ThumbnailGroup,A9 as Tile,L9 as TileGroup,M9 as TileProperty,J9 as Timer,iD as Toggle,Bi as Tooltip,MO as TranslationGroup,TO as Translations,Q9 as VerticalStepper,e9 as Well,T as ZincElement,Cf as caretRectFrom,tS as clearFormStoreValues,G8 as deepQuery,W8 as deepQueryAll,nt as deepQuerySelectorAll,Sf as getCaretCoordinates,IW as getCaretRect,Ar as idSelector,Xt as litToHTML,wh as on};
6587
+ `}};oi.styles=k(u8),oi.dependencies={"zn-icon":he},c([p()],oi.prototype,"image",2),c([p()],oi.prototype,"color",2),c([p({attribute:"image-strength",reflect:!0})],oi.prototype,"imageStrength",2),c([p({reflect:!0})],oi.prototype,"motion",2),c([p({reflect:!0})],oi.prototype,"overlay",2),c([p({attribute:"overlay-tone",reflect:!0})],oi.prototype,"overlayTone",2),c([p({attribute:"floating-icons"})],oi.prototype,"floatingIcons",2),c([p({type:Boolean,reflect:!0})],oi.prototype,"paused",2);var BP=oi;oi.define("zn-background");export{HS as AbsoluteContainer,$D as ActionBar,cf as Alert,IO as AnimatedButton,FD as AudioSelect,BP as Background,hE as BulkActions,Oe as Button,Nc as ButtonGroup,CD as ButtonMenu,I9 as ChannelTile,N9 as Chart,JC as ChatMessage,ZC as ChatMessageAttachment,nD as Checkbox,hD as CheckboxGroup,_o as Chip,rs as Collapsible,SD as ColorSelect,E9 as Cols,as as Confirm,DD as ContentBlock,vf as CopyButton,kD as DataSelect,S9 as DataTable,lh as DataTableFilter,Of as DataTableSearch,TD as DataTableSort,Df as Datepicker,T9 as DefinedLabel,os as Dialog,Mr as Dropdown,rD as Editor,_n as EditorDialog,Nb as EditorQuickAction,Bd as EditorTool,Nf as EmptyState,Xf as ExpandingAction,pD as File,PD as FilterContainer,OD as FilterWrapper,Lv as FlowBranchConditions,lP as FlowBuilder,dP as FlowStep,Rv as FlowStepGroup,cP as FlowSteps,oD as FormActions,Wb as FormGroup,B9 as Header,Pf as HoverContainer,he as Icon,Y9 as IconPicker,xh as InlineEdit,xt as Input,aD as InputGroup,uD as Item,LO as Key,MO as KeyContainer,sD as LinkedSelect,HN as MarkdownEditor,In as Menu,Wi as MenuItem,ls as Navbar,$9 as Note,Mf as OptGroup,at as Option,pE as OrderTable,K9 as Page,vP as PageBuilder,AD as PageNav,Hv as PagePaletteItem,Fv as PageSectionCard,X9 as Pagination,eE as Pane,Hf as Panel,Oc as Popup,Uv as PreviewFrame,DO as PriorityList,dE as ProgressBar,cE as ProgressTile,m9 as QueryBuilder,lD as Radio,dD as RadioGroup,cD as Rating,Yu as RemarkdEditor,HD as Reveal,OP as ScheduleBuilder,lE as ScrollContainer,Je as Select,ND as SettingsContainer,iE as Sidebar,F9 as SimpleChart,Ff as Skeleton,Gc as SlashItem,ss as SlashMenu,ED as Slideout,oE as Sp,MD as SplitButton,rE as SplitPane,sE as Stat,LD as StatusIndicator,aE as Stepper,Bf as Style,Qf as Tab,Z9 as Table,Dn as Tabs,Ma as Textarea,zP as ThemeEditor,HP as Thumbnail,FP as ThumbnailGroup,A9 as Tile,L9 as TileGroup,M9 as TileProperty,J9 as Timer,iD as Toggle,Bi as Tooltip,qO as TranslationGroup,AO as Translations,Q9 as VerticalStepper,e9 as Well,T as ZincElement,Cf as caretRectFrom,tS as clearFormStoreValues,G8 as deepQuery,W8 as deepQueryAll,nt as deepQuerySelectorAll,Sf as getCaretCoordinates,RW as getCaretRect,Ar as idSelector,Xt as litToHTML,wh as on};