@kvass/widgets 1.7.9 → 1.7.13
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/_plugin-vue_export-helper.js +8 -8
- package/dist/chart-builder.js +2 -2
- package/dist/contact.js +2 -2
- package/dist/directories.js +1 -1
- package/dist/finn.css +1 -0
- package/dist/finn.js +13 -0
- package/dist/flatfinder.js +51 -48
- package/dist/font-selector.js +1 -1
- package/dist/icon-selector.js +1 -1
- package/dist/img-comparison-slider.js +1 -1
- package/dist/index.es.js +111 -109
- package/dist/index.es2.js +102 -6
- package/dist/index.js +15 -2
- package/dist/index2.js +1 -1
- package/dist/index3.js +11 -11
- package/dist/knips.js +2 -2
- package/dist/loan-calculator.js +1 -1
- package/dist/location-selector.js +1 -1
- package/dist/map.js +24 -24
- package/dist/nabolagsprofil.js +1 -1
- package/dist/project-portal.js +1 -1
- package/dist/residential-expenses.js +2 -2
- package/dist/table-builder.js +1 -1
- package/dist/vimeo.js +1 -1
- package/dist/youtube.js +1 -1
- package/package.json +12 -4
package/dist/index.es2.js
CHANGED
|
@@ -1,14 +1,110 @@
|
|
|
1
|
-
import{H as Ji,r as ne,q as oe,b as U,E as Ce,o as A,e as ue,w as ve,z as zo,a as ee,c as P,f as z,j as Ne,v as re,d as W,C as $e,t as de,A as Ho,m as te,g as kt,$ as Vl,n as Oe,u as Bl,M as qo,i as At,y as St,a8 as Ll,F as rt,k as nn,l as Uo,a1 as Nl,B as Wo,a3 as jl,a0 as Go,O as Xo,s as Ia,K as ye,L as Ie,S as $l,U as Yo,V as zl,J as Hl,D as Qr,N as Ko,Q as ql,R as $n,P as Ul,a2 as Wl,Y as Gl,Z as Xl,W as Zo}from"./_plugin-vue_export-helper.js";function Qo(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Qo(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function Yl(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=Qo(e))&&(i&&(i+=" "),i+=t);return i}const Fa=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Da=Yl,Jr=(e,t)=>n=>{var i;if(t?.variants==null)return Da(e,n?.class,n?.className);const{variants:r,defaultVariants:a}=t,o=Object.keys(r).map(u=>{const c=n?.[u],d=a?.[u];if(c===null)return null;const h=Fa(c)||Fa(d);return r[u][h]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((u,c)=>{let{class:d,className:h,...p}=c;return Object.entries(p).every(f=>{let[g,m]=f;return Array.isArray(m)?m.includes({...a,...s}[g]):{...a,...s}[g]===m})?[...u,d,h]:u},[]);return Da(e,o,l,n?.class,n?.className)},bn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ri=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const s=r.pop(),l=r.pop(),u={provider:r.length>0?r[0]:i,prefix:l,name:s};return t&&!ni(u)?null:u}const a=r[0],o=a.split("-");if(o.length>1){const s={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!ni(s)?null:s}if(n&&i===""){const s={provider:i,prefix:"",name:a};return t&&!ni(s,n)?null:s}return null},ni=(e,t)=>e?!!((e.provider===""||e.provider.match(bn))&&(t&&e.prefix===""||e.prefix.match(bn))&&e.name.match(bn)):!1,Jo=Object.freeze({left:0,top:0,width:16,height:16}),gi=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Mi=Object.freeze({...Jo,...gi}),kr=Object.freeze({...Mi,body:"",hidden:!1});function Kl(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function Oa(e,t){const n=Kl(e,t);for(const i in kr)i in gi?i in e&&!(i in n)&&(n[i]=gi[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function Zl(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function a(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const s=i[o]&&i[o].parent,l=s&&a(s);l&&(r[o]=[s].concat(l))}return r[o]}return Object.keys(n).concat(Object.keys(i)).forEach(a),r}function Ql(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let a={};function o(s){a=Oa(i[s]||r[s],a)}return o(t),n.forEach(o),Oa(e,a)}function es(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=Zl(e);for(const r in i){const a=i[r];a&&(t(r,Ql(e,r,a)),n.push(r))}return n}const Jl={provider:"",aliases:{},not_found:{},...Jo};function er(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ts(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!er(e,Jl))return null;const n=t.icons;for(const r in n){const a=n[r];if(!r.match(bn)||typeof a.body!="string"||!er(a,kr))return null}const i=t.aliases||Object.create(null);for(const r in i){const a=i[r],o=a.parent;if(!r.match(bn)||typeof o!="string"||!n[o]&&!i[o]||!er(a,kr))return null}return t}const Pa=Object.create(null);function eu(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Lt(e,t){const n=Pa[e]||(Pa[e]=Object.create(null));return n[t]||(n[t]=eu(e,t))}function ea(e,t){return ts(t)?es(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function tu(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let An=!1;function ns(e){return typeof e=="boolean"&&(An=e),An}function nu(e){const t=typeof e=="string"?Ri(e,!0,An):e;if(t){const n=Lt(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function iu(e,t){const n=Ri(e,!0,An);if(!n)return!1;const i=Lt(n.provider,n.prefix);return tu(i,n.name,t)}function ru(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),An&&!t&&!e.prefix){let r=!1;return ts(e)&&(e.prefix="",es(e,(a,o)=>{o&&iu(a,o)&&(r=!0)})),r}const n=e.prefix;if(!ni({provider:t,prefix:n,name:"a"}))return!1;const i=Lt(t,n);return!!ea(i,e)}const is=Object.freeze({width:null,height:null}),rs=Object.freeze({...is,...gi}),au=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ou=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ra(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(au);if(i===null||!i.length)return e;const r=[];let a=i.shift(),o=ou.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?r.push(a):r.push(Math.ceil(s*t*n)/n)}else r.push(a);if(a=i.shift(),a===void 0)return r.join("");o=!o}}function su(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),a=e.indexOf("</"+t);if(r===-1||a===-1)break;const o=e.indexOf(">",a);if(o===-1)break;n+=e.slice(r+1,a).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function lu(e,t){return e?"<defs>"+e+"</defs>"+t:t}function uu(e,t,n){const i=su(e);return lu(i.defs,t+i.content+n)}const cu=e=>e==="unset"||e==="undefined"||e==="none";function du(e,t){const n={...Mi,...e},i={...rs,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,i].forEach(g=>{const m=[],b=g.hFlip,v=g.vFlip;let E=g.rotate;b?v?E+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):v&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let T;switch(E<0&&(E-=Math.floor(E/4)*4),E=E%4,E){case 1:T=r.height/2+r.top,m.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:T=r.width/2+r.left,m.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}E%2===1&&(r.left!==r.top&&(T=r.left,r.left=r.top,r.top=T),r.width!==r.height&&(T=r.width,r.width=r.height,r.height=T)),m.length&&(a=uu(a,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=i.width,s=i.height,l=r.width,u=r.height;let c,d;o===null?(d=s===null?"1em":s==="auto"?u:s,c=Ra(d,l/u)):(c=o==="auto"?l:o,d=s===null?Ra(c,u/l):s==="auto"?u:s);const h={},p=(g,m)=>{cu(m)||(h[g]=m.toString())};p("width",c),p("height",d);const f=[r.left,r.top,l,u];return h.viewBox=f.join(" "),{attributes:h,viewBox:f,body:a}}const hu=/\sid="(\S+)"/g,pu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let fu=0;function gu(e,t=pu){const n=[];let i;for(;i=hu.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(a=>{const o=typeof t=="function"?t(a):t+(fu++).toString(),s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const Er=Object.create(null);function mu(e,t){Er[e]=t}function _r(e){return Er[e]||Er[""]}function ta(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const na=Object.create(null),zn=["https://api.simplesvg.com","https://api.unisvg.com"],wr=[];for(;zn.length>0;)zn.length===1||Math.random()>.5?wr.push(zn.shift()):wr.push(zn.pop());na[""]=ta({resources:["https://api.iconify.design"].concat(wr)});function as(e,t){const n=ta(t);return n===null?!1:(na[e]=n,!0)}function ia(e){return na[e]}const vu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Ma=vu();function bu(e,t){const n=ia(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const a=t+".json?icons=";i=n.maxURL-r-n.path.length-a.length}return i}function yu(e){return e===404}const xu=(e,t,n)=>{const i=[],r=bu(e,t),a="icons";let o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((l,u)=>{s+=l.length+1,s>=r&&u>0&&(i.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=l.length),o.icons.push(l)}),i.push(o),i};function ku(e){if(typeof e=="string"){const t=ia(e);if(t)return t.path}return"/"}const Eu=(e,t,n)=>{if(!Ma){n("abort",424);return}let i=ku(t.provider);switch(t.type){case"icons":{const a=t.prefix,o=t.icons.join(","),s=new URLSearchParams({icons:o});i+=a+".json?"+s.toString();break}case"custom":{const a=t.uri;i+=a.slice(0,1)==="/"?a.slice(1):a;break}default:n("abort",400);return}let r=503;Ma(e+i).then(a=>{const o=a.status;if(o!==200){setTimeout(()=>{n(yu(o)?"abort":"next",o)});return}return r=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?n("abort",a):n("next",r)});return}setTimeout(()=>{n("success",a)})}).catch(()=>{n("next",r)})},_u={prepare:xu,send:Eu};function wu(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,a)=>r.provider!==a.provider?r.provider.localeCompare(a.provider):r.prefix!==a.prefix?r.prefix.localeCompare(a.prefix):r.name.localeCompare(a.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const a=r.provider,o=r.prefix,s=r.name,l=n[a]||(n[a]=Object.create(null)),u=l[o]||(l[o]=Lt(a,o));let c;s in u.icons?c=t.loaded:o===""||u.missing.has(s)?c=t.missing:c=t.pending;const d={provider:a,prefix:o,name:s};c.push(d)}),t}function os(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function Cu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(a=>{const o=a.icons,s=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==r)return!0;const u=l.name;if(e.icons[u])o.loaded.push({provider:i,prefix:r,name:u});else if(e.missing.has(u))o.missing.push({provider:i,prefix:r,name:u});else return n=!0,!0;return!1}),o.pending.length!==s&&(n||os([e],a.id),a.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),a.abort))})}))}let Au=0;function Su(e,t,n){const i=Au++,r=os.bind(null,n,i);if(!t.pending.length)return r;const a={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(a)}),r}function Tu(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const a=typeof r=="string"?Ri(r,t,n):r;a&&i.push(a)}),i}var Iu={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Fu(e,t,n,i){const r=e.resources.length,a=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let S=e.resources.slice(0);for(o=[];S.length>1;){const X=Math.floor(Math.random()*S.length);o.push(S[X]),S=S.slice(0,X).concat(S.slice(X+1))}o=o.concat(S)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));const s=Date.now();let l="pending",u=0,c,d=null,h=[],p=[];typeof i=="function"&&p.push(i);function f(){d&&(clearTimeout(d),d=null)}function g(){l==="pending"&&(l="aborted"),f(),h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function m(S,X){X&&(p=[]),typeof S=="function"&&p.push(S)}function b(){return{startTime:s,payload:t,status:l,queriesSent:u,queriesPending:h.length,subscribe:m,abort:g}}function v(){l="failed",p.forEach(S=>{S(void 0,c)})}function E(){h.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),h=[]}function T(S,X,D){const C=X!=="success";switch(h=h.filter(k=>k!==S),l){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(X==="abort"){c=D,v();return}if(C){c=D,h.length||(o.length?_():v());return}if(f(),E(),!e.random){const k=e.resources.indexOf(S.resource);k!==-1&&k!==e.index&&(e.index=k)}l="completed",p.forEach(k=>{k(D)})}function _(){if(l!=="pending")return;f();const S=o.shift();if(S===void 0){if(h.length){d=setTimeout(()=>{f(),l==="pending"&&(E(),v())},e.timeout);return}v();return}const X={status:"pending",resource:S,callback:(D,C)=>{T(X,D,C)}};h.push(X),u++,d=setTimeout(_,e.rotate),n(S,t,X.callback)}return setTimeout(_),b}function ss(e){const t={...Iu,...e};let n=[];function i(){n=n.filter(o=>o().status==="pending")}function r(o,s,l){const u=Fu(t,o,s,(c,d)=>{i(),l&&l(c,d)});return n.push(u),u}function a(o){return n.find(s=>o(s))||null}return{query:r,find:a,setIndex:o=>{t.index=o},getIndex:()=>t.index,cleanup:i}}function Va(){}const tr=Object.create(null);function Du(e){if(!tr[e]){const t=ia(e);if(!t)return;const n=ss(t),i={config:t,redundancy:n};tr[e]=i}return tr[e]}function Ou(e,t,n){let i,r;if(typeof e=="string"){const a=_r(e);if(!a)return n(void 0,424),Va;r=a.send;const o=Du(e);o&&(i=o.redundancy)}else{const a=ta(e);if(a){i=ss(a);const o=e.resources?e.resources[0]:"",s=_r(o);s&&(r=s.send)}}return!i||!r?(n(void 0,424),Va):i.query(t,r,n)().abort}const Ba="iconify2",Sn="iconify",ls=Sn+"-count",La=Sn+"-version",us=36e5,Pu=168,Ru=50;function Cr(e,t){try{return e.getItem(t)}catch{}}function ra(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Na(e,t){try{e.removeItem(t)}catch{}}function Ar(e,t){return ra(e,ls,t.toString())}function Sr(e){return parseInt(Cr(e,ls))||0}const Vi={local:!0,session:!0},cs={local:new Set,session:new Set};let aa=!1;function Mu(e){aa=e}let Hn=typeof window>"u"?{}:window;function ds(e){const t=e+"Storage";try{if(Hn&&Hn[t]&&typeof Hn[t].length=="number")return Hn[t]}catch{}Vi[e]=!1}function hs(e,t){const n=ds(e);if(!n)return;const i=Cr(n,La);if(i!==Ba){if(i){const s=Sr(n);for(let l=0;l<s;l++)Na(n,Sn+l.toString())}ra(n,La,Ba),Ar(n,0);return}const r=Math.floor(Date.now()/us)-Pu,a=s=>{const l=Sn+s.toString(),u=Cr(n,l);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,s))return!0}catch{}Na(n,l)}};let o=Sr(n);for(let s=o-1;s>=0;s--)a(s)||(s===o-1?(o--,Ar(n,o)):cs[e].add(s))}function ps(){if(!aa){Mu(!0);for(const e in Vi)hs(e,t=>{const n=t.data,i=t.provider,r=n.prefix,a=Lt(i,r);if(!ea(a,n).length)return!1;const o=n.lastModified||-1;return a.lastModifiedCached=a.lastModifiedCached?Math.min(a.lastModifiedCached,o):o,!0})}}function Vu(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in Vi)hs(i,r=>{const a=r.data;return r.provider!==e.provider||a.prefix!==e.prefix||a.lastModified===t});return!0}function Bu(e,t){aa||ps();function n(i){let r;if(!Vi[i]||!(r=ds(i)))return;const a=cs[i];let o;if(a.size)a.delete(o=Array.from(a).shift());else if(o=Sr(r),o>=Ru||!Ar(r,o+1))return;const s={cached:Math.floor(Date.now()/us),provider:e.provider,data:t};return ra(r,Sn+o.toString(),JSON.stringify(s))}t.lastModified&&!Vu(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function ja(){}function Lu(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Cu(e)}))}function Nu(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let a;!r||!(a=_r(n))||a.prepare(n,i,r).forEach(o=>{Ou(n,o,s=>{if(typeof s!="object")o.icons.forEach(l=>{e.missing.add(l)});else try{const l=ea(e,s);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(c=>{u.delete(c)}),Bu(e,s)}catch(l){console.error(l)}Lu(e)})})}))}const ju=(e,t)=>{const n=Tu(e,!0,ns()),i=wu(n);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,ja)}),()=>{l=!1}}const r=Object.create(null),a=[];let o,s;return i.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===s&&u===o)return;o=u,s=c,a.push(Lt(u,c));const d=r[u]||(r[u]=Object.create(null));d[c]||(d[c]=[])}),i.pending.forEach(l=>{const{provider:u,prefix:c,name:d}=l,h=Lt(u,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(d)||(p.add(d),r[u][c].push(d))}),a.forEach(l=>{const{provider:u,prefix:c}=l;r[u][c].length&&Nu(l,r[u][c])}),t?Su(t,i,a):ja};function $u(e,t){const n={...e};for(const i in t){const r=t[i],a=typeof r;i in is?(r===null||r&&(a==="string"||a==="number"))&&(n[i]=r):a===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const zu=/[\s,]+/;function Hu(e,t){t.split(zu).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function qu(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let a=parseFloat(e.slice(0,e.length-n.length));return isNaN(a)?0:(a=a/r,a%1===0?i(a):0)}}return t}function Uu(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Wu(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Gu(e){return"data:image/svg+xml,"+Wu(e)}function Xu(e){return'url("'+Gu(e)+'")'}const $a={...rs,inline:!1},Yu={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ku={display:"inline-block"},Tr={backgroundColor:"currentColor"},fs={backgroundColor:"transparent"},za={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ha={webkitMask:Tr,mask:Tr,background:fs};for(const e in Ha){const t=Ha[e];for(const n in za)t[e+n]=za[n]}const ii={};["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";ii[e+"-flip"]=t,ii[e.slice(0,1)+"-flip"]=t,ii[e+"Flip"]=t});function qa(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Ua=(e,t)=>{const n=$u($a,t),i={...Yu},r=t.mode||"svg",a={},o=t.style,s=typeof o=="object"&&!(o instanceof Array)?o:{};for(let g in t){const m=t[g];if(m!==void 0)switch(g){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[g]=m===!0||m==="true"||m===1;break;case"flip":typeof m=="string"&&Hu(n,m);break;case"color":a.color=m;break;case"rotate":typeof m=="string"?n[g]=qu(m):typeof m=="number"&&(n[g]=m);break;case"ariaHidden":case"aria-hidden":m!==!0&&m!=="true"&&delete i["aria-hidden"];break;default:{const b=ii[g];b?(m===!0||m==="true"||m===1)&&(n[b]=!0):$a[g]===void 0&&(i[g]=m)}}}const l=du(e,n),u=l.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),r==="svg"){i.style={...a,...s},Object.assign(i,u);let g=0,m=t.id;return typeof m=="string"&&(m=m.replace(/-/g,"_")),i.innerHTML=gu(l.body,m?()=>m+"ID"+g++:"iconifyVue"),Ia("svg",i)}const{body:c,width:d,height:h}=e,p=r==="mask"||(r==="bg"?!1:c.indexOf("currentColor")!==-1),f=Uu(c,{...u,width:d+"",height:h+""});return i.style={...a,"--svg":Xu(f),width:qa(u.width),height:qa(u.height),...Ku,...p?Tr:fs,...s},Ia("span",i)};ns(!0);mu("",_u);if(typeof document<"u"&&typeof window<"u"){ps();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!ru(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;as(n,r)||console.error(i)}catch{console.error(i)}}}}const Zu={...Mi,body:""},Bt=oe({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=Ri(e,!1,!0))===null)return this.abortLoading(),null;const i=nu(n);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:e,abort:ju([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:i,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad):null;if(!t)return Ua(Zu,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),Ua({...Mi,...t.data},n)}});as("",{resources:["https://icons.ui.kvass.no"]});function Qu(e){return!e||typeof e!="object"?!1:typeof e.then=="function"&&typeof e.catch=="function"}const Ju=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],ec=(e,t)=>t==="default"?`var(--k-ui-${e})`:`var(--k-ui-${e}-${t})`,mi=e=>{switch(e){case"start":case"end":return`flex-${e}`;default:return e}},oa=(e,t="spacing")=>e.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&Ju.includes(n)?ec(t,n):n).join(" ");function tc(){var e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var i=Math.random()*16;return e>0?(i=(e+i)%16|0,e=Math.floor(e/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),(n==="x"?i:i&3|8).toString(16)})}const gs=(e,t)=>Object.fromEntries(Object.entries(t).map(([n,i])=>[`--k-${e}-${n}`,i])),ms=oe({__name:"Spinner",props:{size:{default:"medium"}},setup(e){return(t,n)=>(A(),P("span",{class:Oe(`k-spinner k-spinner--size-${t.size}`)},null,2))}}),nc={class:"k-button__content"},ic={key:0,class:"k-button__icon k-button__icon--left"},rc={key:1,class:"k-button__icon k-button__icon--right"},ac={key:2,class:"k-button__confirm-label"},Nt=oe({__name:"Button",props:{variant:{default:"secondary"},size:{default:"medium"},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{default:"button"},stateTimeout:{default:1e3},confirmLabel:{default:"Are you sure?"},label:{},icon:{},iconLeft:{},iconRight:{}},emits:["idle","loading","success","error","confirm","click"],setup(e,{emit:t}){const n=e,i=t,r={success:"success",confirm:"warning",error:"danger",loading:null,idle:null},a=U(()=>!h.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":r[u.value]||n.variant),o=U(()=>n.loading||u.value==="loading"),s=ne(),l=U(()=>{if(u.value)return["error","success"].includes(u.value)||o.value}),u=ne("idle"),c=ne(),d=ne(),h=U(()=>u.value||o.value),p=U(()=>["error","success"].includes(u.value)),f=U(()=>u.value==="success"?"fa-pro-regular:check":"fa-pro-regular:exclamation-circle");function g(_){if(!_)return;m(),d.value=_,s.value=setTimeout(()=>u.value="loading",100);let S=X=>{m(),n.stateTimeout?(u.value=X,c.value=setTimeout(()=>{m(),i(X)},n.stateTimeout)):i(X)};d.value.then(()=>S("success")).catch(()=>S("error"))}function m(){s.value&&clearTimeout(s.value),c.value&&clearTimeout(c.value),d.value=null,u.value="idle"}Ce(()=>n.promise,_=>{_&&Qu(_)&&g(_)});const b=ne(),v=U(()=>u.value==="confirm");function E(_){if(n.confirm&&u.value!=="confirm")return u.value="confirm";m(),i("click",_)}const T=Jr("k-button",{variants:{variant:{primary:"k-button--variant-primary",secondary:"k-button--variant-secondary",tertiary:"k-button--variant-tertiary",danger:"k-button--variant-danger",warning:"k-button--variant-warning",success:"k-button--variant-success"},size:{small:"k-button--size-small",medium:"k-button--size-medium",large:"k-button--size-large"},isLoading:{true:"k-button--loading"},isBusy:{true:"k-button--busy"}}});return(_,S)=>(A(),ue(kt(_.is),te({type:"button",class:re(T)({variant:a.value,size:_.size,isLoading:o.value,isBusy:l.value}),"aria-busy":l.value,inert:l.value},_.$attrs,{onClick:E,ref_key:"rootElement",ref:b}),{default:ve(()=>[zo(ee("span",nc,[_.icon||_.iconLeft||_.$slots.icon||_.$slots["icon-left"]?(A(),P("span",ic,[z(_.$slots,"icon-left",{},()=>[z(_.$slots,"icon",{},()=>[Ne(re(Bt),{icon:_.icon||_.iconLeft},null,8,["icon"])])])])):W("",!0),z(_.$slots,"default",{},()=>[$e(de(_.label),1)]),_.iconRight||_.$slots["icon-right"]?(A(),P("span",rc,[z(_.$slots,"icon-right",{},()=>[Ne(re(Bt),{icon:_.iconRight},null,8,["icon"])])])):W("",!0)],512),[[Ho,!v.value]]),o.value?(A(),ue(ms,{key:0})):W("",!0),p.value?(A(),ue(re(Bt),{key:1,class:"k-button__state-indicator",icon:f.value},null,8,["icon"])):W("",!0),v.value?(A(),P("span",ac,de(_.confirmLabel),1)):W("",!0)]),_:3},16,["class","aria-busy","inert"]))}}),oc={class:"k-alert__content"},sc={key:0,class:"k-alert__title"},lc={class:"k-alert__icon"},Em=oe({__name:"Alert",props:{variant:{default:"neutral"},icon:{},title:{},content:{},action:{}},emits:["action"],setup(e,{emit:t}){const n=e,i=t,r=Jr("k-alert",{variants:{variant:{success:"k-alert--success",neutral:"k-alert--neutral",info:"k-alert--info",danger:"k-alert--danger",warning:"k-alert--warning",primary:"k-alert--primary"}}}),a={success:"fa-pro-light:circle-check",info:"fa-pro-light:circle-question",warning:"fa-pro-light:exclamation-triangle",danger:"fa-pro-light:exclamation-circle"};return(o,s)=>(A(),P("div",{role:"alert",class:Oe(re(r)({...n}))},[ee("div",oc,[o.title||o.$slots.title?(A(),P("div",sc,[z(o.$slots,"title",{},()=>[ee("strong",null,de(o.title),1)])])):W("",!0),z(o.$slots,"default",{},()=>[ee("span",null,de(o.content),1)]),o.action?(A(),ue(Nt,{key:1,label:o.action,size:"small",class:"k-alert__action",onClick:s[0]||(s[0]=l=>i("action",{event:l,name:o.action}))},null,8,["label"])):W("",!0)]),ee("div",lc,[z(o.$slots,"icon",{},()=>[o.icon||a[o.variant]?(A(),ue(re(Bt),{key:0,icon:o.icon||a[o.variant]},null,8,["icon"])):W("",!0)])])],2))}});var mt=(e,t=[])=>({parts:(...n)=>{if(uc(t))return mt(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>mt(e,[...t,...n]),rename:n=>mt(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,i)=>Object.assign(n,{[i]:{selector:[`&[data-scope="${Wt(e)}"][data-part="${Wt(i)}"]`,`& [data-scope="${Wt(e)}"][data-part="${Wt(i)}"]`].join(", "),attrs:{"data-scope":Wt(e),"data-part":Wt(i)}}}),{})}),Wt=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),uc=e=>e.length===0,R=e=>e?"":void 0,cc=e=>e?"true":void 0,dc=1,hc=9,pc=11,Bi=e=>typeof e=="object"&&e!==null,Xe=e=>Bi(e)&&e.nodeType===dc&&typeof e.nodeName=="string",vs=e=>Bi(e)&&e.nodeType===hc,fc=e=>Bi(e)&&e===e.window,bs=e=>Xe(e)?e.localName||"":"#document";function gc(e){return["html","body","#document"].includes(bs(e))}var mc=e=>Bi(e)&&e.nodeType!==void 0,Ir=e=>mc(e)&&e.nodeType===pc&&"host"in e;function Tn(e,t){return!e||!t||!Xe(e)||!Xe(t)?!1:e===t||e.contains(t)}function Ze(e){return vs(e)?e:fc(e)?e.document:e?.ownerDocument??document}function vc(e){return Ze(e).documentElement}function ot(e){var t;return Ir(e)?ot(e.host):vs(e)?e.defaultView??window:Xe(e)?((t=e.ownerDocument)==null?void 0:t.defaultView)??window:window}function bc(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}var yc=()=>typeof document<"u";function xc(){const e=navigator.userAgentData;return e?.platform??navigator.platform}var ys=e=>yc()&&e.test(xc()),xs=()=>ys(/^Mac/),sa=()=>ys(/iP(hone|ad|od)|iOS/);function kc(e){var t,n,i;return((t=e.composedPath)==null?void 0:t.call(e))??((i=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:i.call(n))}function st(e){const t=kc(e);return t?.[0]??e.target}function Ec(e){if(bs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ir(e)&&e.host||vc(e);return Ir(t)?t.host:t}var _c=e=>typeof e=="object"&&e!==null&&e.nodeType===1;function wc(e){return _c(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}var Cc="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function ks(e){return!e||e.closest("[inert]")?!1:e.matches(Cc)&&wc(e)}var Ac=/auto|scroll|overlay|hidden|clip/;function Sc(e){const t=ot(e),{overflow:n,overflowX:i,overflowY:r,display:a}=t.getComputedStyle(e);return Ac.test(n+r+i)&&!["inline","contents"].includes(a)}function la(e){const t=new Set;function n(i){const r=globalThis.requestAnimationFrame(i);t.add(()=>globalThis.cancelAnimationFrame(r))}return n(()=>n(e)),function(){t.forEach(i=>i())}}function Et(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function Es(e){const t=Ec(e);return gc(t)?Ze(t).body:Xe(t)&&Sc(t)?t:Es(t)}function _s(e,t){return Array.from(e?.querySelectorAll(t)??[])}function Rn(e){const t={getRootNode:n=>{var i;return((i=n.getRootNode)==null?void 0:i.call(n))??document},getDoc:n=>Ze(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>bc(t.getRootNode(n)),isActiveElement:(n,i)=>i===t.getActiveElement(n),getById:(n,i)=>t.getRootNode(n).getElementById(i),setValue:(n,i)=>{if(n==null||i==null)return;const r=i.toString();n.value!==r&&(n.value=i.toString())}};return{...t,...e}}var nr=new WeakMap;function Tc(e,t,n){nr.has(e)||nr.set(e,new Map);const i=nr.get(e),r=i.get(t);if(!r)return i.set(t,n()),()=>{var s;(s=i.get(t))==null||s(),i.delete(t)};const a=n(),o=()=>{a(),r(),i.delete(t)};return i.set(t,o),()=>{i.get(t)===o&&(a(),i.set(t,r))}}function Ic(e,t){return e?Tc(e,"style",()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}var ua={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Fc=1e3/60;function Dc(e,t){const n=e();if(Xe(n)&&n.isConnected)return t(n),()=>{};{const i=setInterval(()=>{const r=e();Xe(r)&&r.isConnected&&(t(r),clearInterval(i))},Fc);return()=>clearInterval(i)}}function Oc(e,t){const n=[];return e?.forEach(i=>{const r=Dc(i,t);n.push(r)}),()=>{n.forEach(i=>i())}}function Pc(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Rc(e){return!(e.metaKey||!xs()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Mc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Vc(e,t,n){const i=n?st(n):null,r=ot(i);return e=e||i instanceof r.HTMLInputElement&&!Mc.has(i?.type)||i instanceof r.HTMLTextAreaElement||i instanceof r.HTMLElement&&i.isContentEditable,!(e&&t==="keyboard"&&n instanceof r.KeyboardEvent&&!Reflect.has(Bc,n.key))}var Ht=null,Fr=new Set,yn=new Map,jt=!1,Dr=!1,Bc={Tab:!0,Escape:!0};function Li(e,t){for(let n of Fr)n(e,t)}function vi(e){jt=!0,Rc(e)&&(Ht="keyboard",Li("keyboard",e))}function Me(e){Ht="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(jt=!0,Li("pointer",e))}function ws(e){Pc(e)&&(jt=!0,Ht="virtual")}function Cs(e){const t=st(e);t===ot(t)||t===Ze(t)||(!jt&&!Dr&&(Ht="virtual",Li("virtual",e)),jt=!1,Dr=!1)}function As(){jt=!1,Dr=!0}function Lc(e){if(typeof window>"u"||yn.get(ot(e)))return;const t=ot(e),n=Ze(e);let i=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ht="virtual",Li("virtual",null),jt=!0,i.apply(this,arguments)},n.addEventListener("keydown",vi,!0),n.addEventListener("keyup",vi,!0),n.addEventListener("click",ws,!0),t.addEventListener("focus",Cs,!0),t.addEventListener("blur",As,!1),typeof t.PointerEvent<"u"?(n.addEventListener("pointerdown",Me,!0),n.addEventListener("pointermove",Me,!0),n.addEventListener("pointerup",Me,!0)):(n.addEventListener("mousedown",Me,!0),n.addEventListener("mousemove",Me,!0),n.addEventListener("mouseup",Me,!0)),t.addEventListener("beforeunload",()=>{Nc(e)},{once:!0}),yn.set(t,{focus:i})}var Nc=(e,t)=>{const n=ot(e),i=Ze(e);yn.has(n)&&(n.HTMLElement.prototype.focus=yn.get(n).focus,i.removeEventListener("keydown",vi,!0),i.removeEventListener("keyup",vi,!0),i.removeEventListener("click",ws,!0),n.removeEventListener("focus",Cs,!0),n.removeEventListener("blur",As,!1),typeof n.PointerEvent<"u"?(i.removeEventListener("pointerdown",Me,!0),i.removeEventListener("pointermove",Me,!0),i.removeEventListener("pointerup",Me,!0)):(i.removeEventListener("mousedown",Me,!0),i.removeEventListener("mousemove",Me,!0),i.removeEventListener("mouseup",Me,!0)),yn.delete(n))};function In(){return Ht==="keyboard"}function ca(e={}){const{isTextInput:t,autoFocus:n,onChange:i,root:r}=e;Lc(r),i?.({isFocusVisible:n||In(),modality:Ht});const a=(o,s)=>{Vc(!!t,o,s)&&i?.({isFocusVisible:In(),modality:o})};return Fr.add(a),()=>{Fr.delete(a)}}const jc=Symbol(),Wa=Object.getPrototypeOf,Or=new WeakMap,$c=e=>e&&(Or.has(e)?Or.get(e):Wa(e)===Object.prototype||Wa(e)===Array.prototype),zc=e=>$c(e)&&e[jc]||null,Ga=(e,t=!0)=>{Or.set(e,t)};function Hc(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Ss(e,t){const n=Hc();return n?(n[e]||(n[e]=t()),n[e]):t()}var ir=e=>typeof e=="object"&&e!==null,Pt=Ss("__zag__proxyStateMap",()=>new WeakMap),fn=Ss("__zag__refSet",()=>new WeakSet),qc=e=>typeof e=="object"&&e!==null&&"$$typeof"in e,Uc=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Wc=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",Gc=e=>qc(e)||Uc(e)||Wc(e),Xc=(e=Object.is,t=(u,c)=>new Proxy(u,c),n=u=>ir(u)&&!fn.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!Gc(u)&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),i=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},r=new WeakMap,a=(u,c,d=i)=>{const h=r.get(u);if(h?.[0]===c)return h[1];const p=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return Ga(p,!0),r.set(u,[c,p]),Reflect.ownKeys(u).forEach(f=>{const g=Reflect.get(u,f);fn.has(g)?(Ga(g,!1),p[f]=g):g instanceof Promise?Object.defineProperty(p,f,{get(){return d(g)}}):Pt.has(g)?p[f]=Mt(g,d):p[f]=g}),Object.freeze(p)},o=new WeakMap,s=[1,1],l=u=>{if(!ir(u))throw new Error("object required");const c=o.get(u);if(c)return c;let d=s[0];const h=new Set,p=(D,C=++s[0])=>{d!==C&&(d=C,h.forEach(k=>k(D,C)))};let f=s[1];const g=(D=++s[1])=>(f!==D&&!h.size&&(f=D,b.forEach(([C])=>{const k=C[1](D);k>d&&(d=k)})),d),m=D=>(C,k)=>{const y=[...C];y[1]=[D,...y[1]],p(y,k)},b=new Map,v=(D,C)=>{if(h.size){const k=C[3](m(D));b.set(D,[C,k])}else b.set(D,[C])},E=D=>{var C;const k=b.get(D);k&&(b.delete(D),(C=k[1])==null||C.call(k))},T=D=>(h.add(D),h.size===1&&b.forEach(([C,k],y)=>{const x=C[3](m(y));b.set(y,[C,x])}),()=>{h.delete(D),h.size===0&&b.forEach(([C,k],y)=>{k&&(k(),b.set(y,[C]))})}),_=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),S=t(_,{deleteProperty(D,C){const k=Reflect.get(D,C);E(C);const y=Reflect.deleteProperty(D,C);return y&&p(["delete",[C],k]),y},set(D,C,k,y){var x;const I=Reflect.has(D,C),B=Reflect.get(D,C,y);if(I&&(e(B,k)||o.has(k)&&e(B,o.get(k))))return!0;E(C),ir(k)&&(k=zc(k)||k);let L=k;if(!((x=Object.getOwnPropertyDescriptor(D,C))!=null&&x.set))if(k instanceof Promise)k.then(N=>{Object.assign(k,{status:"fulfilled",value:N}),p(["resolve",[C],N])}).catch(N=>{Object.assign(k,{status:"rejected",reason:N}),p(["reject",[C],N])});else{!Pt.has(k)&&n(k)&&(L=da(k));const N=!fn.has(L)&&Pt.get(L);N&&v(C,N)}return Reflect.set(D,C,L,y),p(["set",[C],k,B]),!0}});o.set(u,S);const X=[_,g,a,T];return Pt.set(S,X),Reflect.ownKeys(u).forEach(D=>{const C=Object.getOwnPropertyDescriptor(u,D);C.get||C.set?Object.defineProperty(_,D,C):S[D]=u[D]}),S})=>[l,Pt,fn,e,t,n,i,r,a,o,s],[Yc]=Xc();function da(e={}){return Yc(e)}function Pr(e,t,n){const i=Pt.get(e);let r;const a=[],o=i[3];let s=!1;const l=o(u=>{if(a.push(u),n){t(a.splice(0));return}r||(r=Promise.resolve().then(()=>{r=void 0,s&&t(a.splice(0))}))});return s=!0,()=>{s=!1,l()}}function Mt(e,t){const n=Pt.get(e),[i,r,a]=n;return a(i,r(),t)}function Xa(e){return fn.add(e),e}function Kc(e,t){Object.keys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(e,i))throw new Error("object property already defined");const r=t[i],{get:a,set:o}=typeof r=="function"?{get:r}:r,s={};s.get=()=>a(Mt(n)),o&&(s.set=l=>o(n,l)),Object.defineProperty(e,i,s)});const n=da(e);return n}function Zc(e){for(;e.length>0;)e.pop();return e}var Ya=e=>e?.constructor.name==="Array",Qc=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vt(e[n],t[n]))return!1;return!0},vt=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ya(e)&&Ya(t))return Qc(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),i=n.length;for(let r=0;r<i;r++)if(!Reflect.has(e,n[r]))return!1;for(let r=0;r<i;r++){const a=n[r];if(!vt(e[a],t[a]))return!1}return!0},Ka=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,nt=e=>e,Jc=()=>{},Za=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},Qa=(()=>{let e=0;return()=>(e++,e.toString(36))})(),bi=e=>Array.isArray(e),Ts=e=>e!=null&&typeof e=="object",ri=e=>Ts(e)&&!bi(e),ed=e=>typeof e=="number"&&!Number.isNaN(e),je=e=>typeof e=="string",Fn=e=>typeof e=="function",Is=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),td=e=>Object.prototype.toString.call(e),Fs=Function.prototype.toString,nd=Fs.call(Object),id=e=>{if(!Ts(e)||td(e)!="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Is(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Fs.call(n)==nd};function lt(e){if(!rd(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(i=>typeof i=="string"),n={};for(const i of t){const r=e[i];r!==void 0&&(n[i]=lt(r))}return n}var rd=e=>e&&typeof e=="object"&&e.constructor===Object;function ai(...e){e.length===1?e[0]:e[1],e.length!==2||e[0]}function oi(...e){const t=e.length===1?e[0]:e[1];e.length!==2||e[0]}function Ja(e,t,n){typeof n.value=="object"&&(n.value=Jt(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Jt(e){if(typeof e!="object")return e;var t=0,n,i,r,a=Object.prototype.toString.call(e);if(a==="[object Object]"?r=Object.create(e.__proto__||null):a==="[object Array]"?r=Array(e.length):a==="[object Set]"?(r=new Set,e.forEach(function(o){r.add(Jt(o))})):a==="[object Map]"?(r=new Map,e.forEach(function(o,s){r.set(Jt(s),Jt(o))})):a==="[object Date]"?r=new Date(+e):a==="[object RegExp]"?r=new RegExp(e.source,e.flags):a==="[object DataView]"?r=new e.constructor(Jt(e.buffer)):a==="[object ArrayBuffer]"?r=e.slice(0):a.slice(-6)==="Array]"&&(r=new e.constructor(e)),r){for(i=Object.getOwnPropertySymbols(e);t<i.length;t++)Ja(r,i[t],Object.getOwnPropertyDescriptor(e,i[t]));for(t=0,i=Object.getOwnPropertyNames(e);t<i.length;t++)Object.hasOwnProperty.call(r,n=i[t])&&r[n]===e[n]||Ja(r,n,Object.getOwnPropertyDescriptor(e,n))}return r||e}var ad=Object.defineProperty,od=(e,t,n)=>t in e?ad(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t,n)=>od(e,typeof t!="symbol"?t+"":t,n);function Ds(e,...t){for(const n of t){const i=lt(n);for(const r in i)id(n[r])?(e[r]||(e[r]={}),Ds(e[r],n[r])):e[r]=n[r]}return e}function eo(e){return Jt(e)}function Ve(e){return je(e)?{type:e}:e}function ht(e){return e?bi(e)?e.slice():[e]:[]}function Os(e){return ri(e)&&e.predicate!=null}var sd=()=>!0;function ha(e,t,n,i){return r=>{var a;return je(r)?!!((a=e[r])!=null&&a.call(e,t,n,i)):Fn(r)?r(t,n,i):r.predicate(e)(t,n,i)}}function ld(...e){return{predicate:t=>(n,i,r)=>e.map(ha(t,n,i,r)).some(Boolean)}}function ud(...e){return{predicate:t=>(n,i,r)=>e.map(ha(t,n,i,r)).every(Boolean)}}function cd(e){return{predicate:t=>(n,i,r)=>!ha(t,n,i,r)(e)}}function dd(...e){return(t,n,i)=>i.state.matches(...e)}var pa={or:ld,and:ud,not:cd,stateIn:dd};function Ps(e,t){return e=e??sd,(n,i,r)=>{if(je(e)){const a=t[e];return Fn(a)?a(n,i,r):a}return Os(e)?e.predicate(t)(n,i,r):e?.(n,i,r)}}function rr(e,t){return(n,i,r)=>Os(e)?e.predicate(t)(n,i,r):e}function hd(e){var t,n;const i=e.computed??nt({}),r=e.context??nt({}),a=e.initial?(n=(t=e.states)==null?void 0:t[e.initial])==null?void 0:n.tags:[],o=da({value:e.initial??"",previousValue:"",event:nt({}),previousEvent:nt({}),context:Kc(r,i),done:!1,tags:a??[],hasTag(s){return this.tags.includes(s)},matches(...s){return s.includes(this.value)},can(s){return nt(this).nextEvents.includes(s)},get nextEvents(){var s,l;const u=((l=(s=e.states)==null?void 0:s[this.value])==null?void 0:l.on)??{},c=e?.on??{};return Object.keys({...u,...c})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return nt(o)}function hn(e,t){return(n,i)=>{if(ed(e))return e;if(Fn(e))return e(n,i);if(je(e)){const r=Number.parseFloat(e);if(!Number.isNaN(r))return r;if(t){const a=t?.[e];return oi(a==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Fn(a)?a(n,i):a}}}}function pd(e){return je(e)?{target:e}:e}function fd(e,t){return(n,i,r)=>ht(e).map(pd).find(a=>Ps(a.guard,t)(n,i,r)??a.target??a.actions)}var gd=class{constructor(e,t){var n,i,r,a,o;F(this,"status","Not Started"),F(this,"state"),F(this,"initialState"),F(this,"initialContext"),F(this,"id"),F(this,"type","machine"),F(this,"activityEvents",new Map),F(this,"delayedEvents",new Map),F(this,"stateListeners",new Set),F(this,"doneListeners",new Set),F(this,"contextWatchers",new Set),F(this,"removeStateListener",Jc),F(this,"parent"),F(this,"children",new Map),F(this,"guardMap"),F(this,"actionMap"),F(this,"delayMap"),F(this,"activityMap"),F(this,"sync"),F(this,"options"),F(this,"config"),F(this,"_created",()=>{var s;const l=Ve("machine.created");this.executeActions((s=this.config)==null?void 0:s.created,l)}),F(this,"start",s=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Pr(this.state,()=>{this.stateListeners.forEach(p=>{p(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Ve("machine.start"),ht(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Ve("machine.start"));const l=Ve("machine.init"),u=ri(s)?s.value:s,c=ri(s)?s.context:void 0;c&&this.setContext(c);const d={target:u??this.config.initial},h=this.getNextStateInfo(d,l);return this.initialState=h,this.performStateChangeEffects(this.state.value,h,l),this}),F(this,"setupContextWatchers",()=>{const{watch:s}=this.config;if(!s)return;let l=Mt(this.state.context);const u=Pr(this.state.context,()=>{var c;const d=Mt(this.state.context);for(const[h,p]of Object.entries(s))(((c=this.options.compareFns)==null?void 0:c[h])??Object.is)(l[h],d[h])||this.executeActions(p,this.state.event);l=d});this.contextWatchers.add(u)}),F(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Ve("machine.stop")),this.executeActions(this.config.exit,Ve("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),F(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),F(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(s=>s()),this.contextWatchers.clear()}),F(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(s=>{s.forEach(l=>l())}),this.delayedEvents.clear()}),F(this,"stopActivities",s=>{var l,u;s?((l=this.activityEvents.get(s))==null||l.forEach(c=>c()),(u=this.activityEvents.get(s))==null||u.clear(),this.activityEvents.delete(s)):(this.activityEvents.forEach(c=>{c.forEach(d=>d()),c.clear()}),this.activityEvents.clear())}),F(this,"sendChild",(s,l)=>{const u=Ve(s),c=Ka(l,this.contextSnapshot),d=this.children.get(c);d||oi(`[@zag-js/core] Cannot send '${u.type}' event to unknown child`),d.send(u)}),F(this,"stopChild",s=>{this.children.has(s)||oi(`[@zag-js/core > stop-child] Cannot stop unknown child ${s}`),this.children.get(s).stop(),this.children.delete(s)}),F(this,"removeChild",s=>{this.children.delete(s)}),F(this,"stopChildren",()=>{this.children.forEach(s=>s.stop()),this.children.clear()}),F(this,"setParent",s=>{this.parent=s}),F(this,"spawn",(s,l)=>{const u=Ka(s);return l&&(u.id=l),u.type="machine.actor",u.setParent(this),this.children.set(u.id,nt(u)),u.onDone(()=>{this.removeChild(u.id)}).start(),nt(Xa(u))}),F(this,"stopActivity",s=>{var l;if(!this.state.value)return;const u=this.activityEvents.get(this.state.value);(l=u?.get(s))==null||l(),u?.delete(s)}),F(this,"addActivityCleanup",(s,l,u)=>{var c;s&&(this.activityEvents.has(s)?(c=this.activityEvents.get(s))==null||c.set(l,u):this.activityEvents.set(s,new Map([[l,u]])))}),F(this,"setState",s=>{this.state.previousValue=this.state.value,this.state.value=s;const l=this.getStateNode(s);s==null?Zc(this.state.tags):this.state.tags=ht(l?.tags)}),F(this,"setContext",s=>{s&&Ds(this.state.context,lt(s))}),F(this,"setOptions",s=>{const l=lt(s);this.actionMap={...this.actionMap,...l.actions},this.delayMap={...this.delayMap,...l.delays},this.activityMap={...this.activityMap,...l.activities},this.guardMap={...this.guardMap,...l.guards}}),F(this,"getStateNode",s=>{var l;if(s)return(l=this.config.states)==null?void 0:l[s]}),F(this,"getNextStateInfo",(s,l)=>{const u=this.determineTransition(s,l),c=!(u!=null&&u.target),d=u?.target??this.state.value,h=this.state.value!==d,p=this.getStateNode(d),f={reenter:!c&&!h&&!(u!=null&&u.internal),transition:u,stateNode:p,target:d,changed:h};return this.log("NextState:",`[${l.type}]`,this.state.value,"---->",f.target),f}),F(this,"getAfterActions",(s,l)=>{let u;const c=this.state.value;return{entry:()=>{u=globalThis.setTimeout(()=>{const d=this.getNextStateInfo(s,this.state.event);this.performStateChangeEffects(c,d,this.state.event)},l)},exit:()=>{globalThis.clearTimeout(u)}}}),F(this,"getDelayedEventActions",s=>{const l=this.getStateNode(s),u=this.state.event;if(!l||!l.after)return;const c=[],d=[];if(bi(l.after)){const h=this.determineTransition(l.after,u);if(!h)return;if(!Is(h,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(h)}`);const p=hn(h.delay,this.delayMap)(this.contextSnapshot,u),f=this.getAfterActions(h,p);return c.push(f.entry),d.push(f.exit),{entries:c,exits:d}}if(ri(l.after))for(const h in l.after){const p=l.after[h],f=hn(h,this.delayMap)(this.contextSnapshot,u),g=this.getAfterActions(p,f);c.push(g.entry),d.push(g.exit)}return{entries:c,exits:d}}),F(this,"executeActions",(s,l)=>{var u;const c=rr(s,this.guardMap)(this.contextSnapshot,l,this.guardMeta);for(const d of ht(c)){const h=je(d)?(u=this.actionMap)==null?void 0:u[d]:d;ai(je(d)&&!h,`[@zag-js/core > execute-actions] No implementation found for action: \`${d}\``),h?.(this.state.context,l,this.meta)}}),F(this,"executeActivities",(s,l,u)=>{var c;for(const d of l){const h=je(d)?(c=this.activityMap)==null?void 0:c[d]:d;if(!h){ai(`[@zag-js/core > execute-activity] No implementation found for activity: \`${d}\``);continue}const p=h(this.state.context,s,this.meta);if(p){const f=je(d)?d:d.name||Qa();this.addActivityCleanup(u??this.state.value,f,p)}}}),F(this,"createEveryActivities",(s,l)=>{if(s)if(bi(s)){const u=ht(s).find(d=>{const h=d.delay,p=hn(h,this.delayMap)(this.contextSnapshot,this.state.event);return Ps(d.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??p!=null});if(!u)return;const c=hn(u.delay,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const d=globalThis.setInterval(()=>{this.executeActions(u.actions,this.state.event)},c);return()=>{globalThis.clearInterval(d)}})}else for(const u in s){const c=s?.[u],d=hn(u,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const h=globalThis.setInterval(()=>{this.executeActions(c,this.state.event)},d);return()=>{globalThis.clearInterval(h)}})}}),F(this,"setEvent",s=>{this.state.previousEvent=this.state.event,this.state.event=Xa(Ve(s))}),F(this,"performExitEffects",(s,l)=>{const u=this.state.value;if(u==="")return;const c=s?this.getStateNode(s):void 0;this.stopActivities(u);const d=rr(c?.exit,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=ht(d),p=this.delayedEvents.get(u);p&&h.push(...p),this.executeActions(h,l),this.delayedEvents.delete(u)}),F(this,"performEntryEffects",(s,l)=>{const u=this.getStateNode(s),c=ht(u?.activities);this.createEveryActivities(u?.every,f=>{c.unshift(f)}),c.length>0&&this.executeActivities(l,c);const d=rr(u?.entry,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=ht(d),p=this.getDelayedEventActions(s);u!=null&&u.after&&p&&(this.delayedEvents.set(s,p?.exits),h.push(...p.entries)),this.executeActions(h,l),u?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(f=>{f(this.stateSnapshot)}),this.stop())}),F(this,"performTransitionEffects",(s,l)=>{const u=this.determineTransition(s,l);this.executeActions(u?.actions,l)}),F(this,"performStateChangeEffects",(s,l,u)=>{this.setEvent(u);const c=l.changed||l.reenter;c&&this.performExitEffects(s,u),this.performTransitionEffects(l.transition,u),this.setState(l.target),c&&this.performEntryEffects(l.target,u)}),F(this,"determineTransition",(s,l)=>{const u=fd(s,this.guardMap);return u?.(this.contextSnapshot,l,this.guardMeta)}),F(this,"sendParent",s=>{var l;this.parent||oi("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const u=Ve(s);(l=this.parent)==null||l.send(u)}),F(this,"log",(...s)=>{}),F(this,"send",s=>{const l=Ve(s);this.transition(this.state.value,l)}),F(this,"transition",(s,l)=>{var u,c;const d=je(s)?this.getStateNode(s):s?.stateNode,h=Ve(l);if(!d&&!this.config.on){const g=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${s}, \`event\`: ${h.type}`;ai(g);return}const p=((u=d?.on)==null?void 0:u[h.type])??((c=this.config.on)==null?void 0:c[h.type]),f=this.getNextStateInfo(p,h);return this.performStateChangeEffects(this.state.value,f,h),f.stateNode}),F(this,"subscribe",s=>(this.stateListeners.add(s),this.status==="Running"&&s(this.stateSnapshot),()=>{this.stateListeners.delete(s)})),F(this,"onDone",s=>(this.doneListeners.add(s),this)),F(this,"onTransition",s=>(this.stateListeners.add(s),this.status==="Running"&&s(this.stateSnapshot),this)),this.config=eo(e),this.options=eo(t??{}),this.id=this.config.id??`machine-${Qa()}`,this.guardMap=((n=this.options)==null?void 0:n.guards)??{},this.actionMap=((i=this.options)==null?void 0:i.actions)??{},this.delayMap=((r=this.options)==null?void 0:r.delays)??{},this.activityMap=((a=this.options)==null?void 0:a.activities)??{},this.sync=((o=this.options)==null?void 0:o.sync)??!1,this.state=hd(this.config),this.initialContext=Mt(this.state.context)}get stateSnapshot(){return nt(Mt(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var t;return((t=e.initialState)==null?void 0:t.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:t=>this.actionMap[t],getGuard:t=>this.guardMap[t]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},Mn=(e,t)=>new gd(e,t),en="default",Rr="",si=new WeakMap;function md(e={}){const{target:t,doc:n}=e,i=n??document,r=i.documentElement;return sa()?(en==="default"&&(Rr=r.style.webkitUserSelect,r.style.webkitUserSelect="none"),en="disabled"):t&&(si.set(t,t.style.userSelect),t.style.userSelect="none"),()=>vd({target:t,doc:i})}function vd(e={}){const{target:t,doc:n}=e,i=(n??document).documentElement;if(sa()){if(en!=="disabled")return;en="restoring",setTimeout(()=>{la(()=>{en==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=Rr||""),Rr="",en="default")})},300)}else if(t&&si.has(t)){const r=si.get(t);t.style.userSelect==="none"&&(t.style.userSelect=r??""),t.getAttribute("style")===""&&t.removeAttribute("style"),si.delete(t)}}function bd(e={}){const{defer:t,target:n,...i}=e,r=t?Et:o=>o(),a=[];return a.push(r(()=>{const o=typeof n=="function"?n():n;a.push(md({...i,target:o}))})),()=>{a.forEach(o=>o?.())}}var _e=(e,t,n,i)=>{const r=typeof e=="function"?e():e;return r?.addEventListener(t,n,i),()=>{r?.removeEventListener(t,n,i)}},yd=e=>e.button===0,xd=e=>e.button===2||xs()&&e.ctrlKey&&e.button===0,kd=e=>e.ctrlKey||e.altKey||e.metaKey;function to(e,t,n){if(!e)return;const i=e.ownerDocument.defaultView||window,r=new i.CustomEvent(t,n);return e.dispatchEvent(r)}var Ed={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},no={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function _d(e,t={}){const{dir:n="ltr",orientation:i="horizontal"}=t;let{key:r}=e;return r=Ed[r]??r,n==="rtl"&&i==="horizontal"&&r in no&&(r=no[r]),r}function wd(e,t="client"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Cd(e,t="client"){return{x:e[`${t}X`],y:e[`${t}Y`]}}var Ad=e=>"touches"in e&&e.touches.length>0;function fa(e,t="client"){return Ad(e)?wd(e,t):Cd(e,t)}var Sd=new Set(["PageUp","PageDown"]),Td=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Id(e){return e.ctrlKey||e.metaKey?.1:Sd.has(e.key)||e.shiftKey&&Td.has(e.key)?10:1}function io(e){return Math.max(0,Math.min(1,e))}function Fd(e,t){const{left:n,top:i,width:r,height:a}=t.getBoundingClientRect(),o={x:e.x-n,y:e.y-i},s={x:io(o.x/r),y:io(o.y/a)};function l(u={}){const{dir:c="ltr",orientation:d="horizontal",inverted:h}=u,p=typeof h=="object"?h.x:h,f=typeof h=="object"?h.y:h;return d==="horizontal"?c==="rtl"||p?1-s.x:s.x:f?1-s.y:s.y}return{offset:o,percent:s,getPercentValue:l}}function Dd(e,t){const{onPointerMove:n,onPointerUp:i}=t,r=[],a=[_e(e,"pointermove",o=>{const s=fa(o);r.push({...s,timestamp:performance.now()});const l=Math.sqrt(s.x**2+s.y**2),u=o.pointerType==="touch"?10:5;if(!(l<u)){if(o.pointerType==="mouse"&&o.button===0){i();return}n({point:s,event:o,velocity:Md(r,.1)})}},!1),_e(e,"pointerup",i,!1),_e(e,"pointercancel",i,!1),_e(e,"contextmenu",i,!1),bd({doc:e})];return()=>{a.forEach(o=>o()),r.length=0}}function Od(e){return e[e.length-1]}function Pd(e){return e*1e3}function Rd(e){return e/1e3}function Md(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=Od(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Pd(t)));)n--;if(!i)return{x:0,y:0};const a=Rd(r.timestamp-i.timestamp);if(a===0)return{x:0,y:0};const o={x:(r.x-i.x)/a,y:(r.y-i.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),{x:Math.abs(o.x),y:Math.abs(o.y)}}var ar=(...e)=>t=>e.reduce((n,i)=>i(n),t),qn=()=>{};function Rs(e){const{pointerNode:t,keyboardNode:n=t,onPress:i,onPressStart:r,onPressEnd:a,isValidKey:o=v=>v.key==="Enter"}=e;if(!t)return qn;const s=ot(t),l=Ze(t);let u=qn,c=qn,d=qn;const h=v=>({point:fa(v),event:v});function p(v){r?.(h(v))}function f(v){a?.(h(v))}const g=_e(t,"pointerdown",v=>{c();const E=_e(s,"pointerup",_=>{const S=st(_);Tn(t,S)?i?.(h(_)):a?.(h(_))},{passive:!i}),T=_e(s,"pointercancel",f,{passive:!a});c=ar(E,T),l.activeElement===n&&v.pointerType==="mouse"&&v.preventDefault(),p(v)},{passive:!r}),m=_e(n,"focus",b);u=ar(g,m);function b(){const v=S=>{if(!o(S))return;const X=C=>{if(!o(C))return;const k=new s.PointerEvent("pointerup"),y=h(k);i?.(y),a?.(y)};c(),c=_e(n,"keyup",X);const D=new s.PointerEvent("pointerdown");p(D)},E=()=>{const S=new s.PointerEvent("pointercancel");f(S)},T=_e(n,"keydown",v),_=_e(n,"blur",E);d=ar(T,_)}return function(){u(),c(),d()}}var ga=e=>e.ownerDocument.defaultView||window;function Ms(e,t){const{type:n="HTMLInputElement",property:i="value"}=t,r=ga(e)[n].prototype;return Object.getOwnPropertyDescriptor(r,i)??{}}function Vd(e,t,n={}){var i;(i=Ms(e,n).set)==null||i.call(e,t),e.setAttribute("value",t)}function Vs(e,t){var n;(n=Ms(e,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked")}function Bd(e,t){const{value:n,bubbles:i=!0}=t;if(!e)return;const r=ga(e);e instanceof r.HTMLInputElement&&(Vd(e,`${n}`),e.dispatchEvent(new r.Event("input",{bubbles:i})))}function ma(e,t){const{checked:n,bubbles:i=!0}=t;if(!e)return;const r=ga(e);e instanceof r.HTMLInputElement&&(Vs(e,n),e.dispatchEvent(new r.Event("click",{bubbles:i})))}function Ld(e){return Nd(e)?e.form:e.closest("form")}function Nd(e){return e.matches("textarea, input, select, button")}function jd(e,t){if(!e)return;const n=Ld(e);return n?.addEventListener("reset",t,{passive:!0}),()=>{n?.removeEventListener("reset",t)}}function $d(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const i=n.ownerDocument.defaultView||window,r=new i.MutationObserver(()=>t(n.disabled));return r.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>r.disconnect()}function Ni(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:i}=t,r=[jd(e,i),$d(e,n)];return()=>{r.forEach(a=>a?.())}}function zd(e){return new Proxy({},{get(){return e}})}var qt=()=>e=>Array.from(new Set(e)),Hd=mt("checkbox").parts("root","label","control","indicator"),Un=Hd.build(),me=Rn({getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`checkbox:${e.id}`},getLabelId:e=>{var t;return((t=e.ids)==null?void 0:t.label)??`checkbox:${e.id}:label`},getControlId:e=>{var t;return((t=e.ids)==null?void 0:t.control)??`checkbox:${e.id}:control`},getHiddenInputId:e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`checkbox:${e.id}:input`},getRootEl:e=>me.getById(e,me.getRootId(e)),getHiddenInputEl:e=>me.getById(e,me.getHiddenInputId(e))});function qd(e,t,n){const i=e.context.isDisabled,r=e.context.readOnly,a=!i&&e.context.focused,o=!i&&e.context.focusVisible,s=e.context.isChecked,l=e.context.isIndeterminate,u={"data-active":R(e.context.active),"data-focus":R(a),"data-focus-visible":R(o),"data-readonly":R(r),"data-hover":R(e.context.hovered),"data-disabled":R(i),"data-state":l?"indeterminate":e.context.checked?"checked":"unchecked","data-invalid":R(e.context.invalid)};return{checked:s,disabled:i,indeterminate:l,focused:a,checkedState:e.context.checked,setChecked(c){t({type:"CHECKED.SET",checked:c,isTrusted:!1})},toggleChecked(){t({type:"CHECKED.TOGGLE",checked:s,isTrusted:!1})},getRootProps(){return n.label({...Un.root.attrs,...u,dir:e.context.dir,id:me.getRootId(e.context),htmlFor:me.getHiddenInputId(e.context),onPointerMove(){i||t({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||t({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(c){st(c)===me.getHiddenInputEl(e.context)&&c.stopPropagation()}})},getLabelProps(){return n.element({...Un.label.attrs,...u,dir:e.context.dir,id:me.getLabelId(e.context)})},getControlProps(){return n.element({...Un.control.attrs,...u,dir:e.context.dir,id:me.getControlId(e.context),"aria-hidden":!0})},getIndicatorProps(){return n.element({...Un.indicator.attrs,...u,dir:e.context.dir,hidden:!l&&!e.context.checked})},getHiddenInputProps(){return n.input({id:me.getHiddenInputId(e.context),type:"checkbox",required:e.context.required,defaultChecked:s,disabled:i,"aria-labelledby":me.getLabelId(e.context),"aria-invalid":e.context.invalid,name:e.context.name,form:e.context.form,value:e.context.value,style:ua,onFocus(){const c=In();t({type:"CONTEXT.SET",context:{focused:!0,focusVisible:c}})},onBlur(){t({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(c){if(r){c.preventDefault();return}const d=c.currentTarget.checked;t({type:"CHECKED.SET",checked:d,isTrusted:!0})}})}}}var{not:ro}=pa;function Ud(e){const t=lt(e);return Mn({id:"checkbox",initial:"ready",context:{checked:!1,value:"on",disabled:!1,...t,fieldsetDisabled:!1,focusVisible:!1},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:ro("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:ro("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{isIndeterminate:n=>Mr(n.checked),isChecked:n=>ao(n.checked),isDisabled:n=>!!n.disabled||n.fieldsetDisabled},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackPressEvent(n){if(!n.isDisabled)return Rs({pointerNode:me.getRootEl(n),keyboardNode:me.getHiddenInputEl(n),isValidKey:i=>i.key===" ",onPress:()=>n.active=!1,onPressStart:()=>n.active=!0,onPressEnd:()=>n.active=!1})},trackFocusVisible(n){if(!n.isDisabled)return ca({root:me.getRootNode(n)})},trackFormControlState(n,i,{send:r,initialContext:a}){return Ni(me.getHiddenInputEl(n),{onFieldsetDisabledChange(o){n.fieldsetDisabled=o},onFormReset(){r({type:"CHECKED.SET",checked:!!a.checked})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=me.getHiddenInputEl(n);i&&(Vs(i,n.isChecked),i.indeterminate=n.isIndeterminate)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1,n.focusVisible=!1)},setChecked(n,i){oo.checked(n,i.checked)},toggleChecked(n){const i=Mr(n.checked)?!0:!n.checked;oo.checked(n,i)},dispatchChangeEvent(n){const i=me.getHiddenInputEl(n);ma(i,{checked:ao(n.checked)})}}})}function Mr(e){return e==="indeterminate"}function ao(e){return Mr(e)?!1:!!e}var Wd={change:e=>{var t;(t=e.onCheckedChange)==null||t.call(e,{checked:e.checked})}},oo={checked:(e,t)=>{vt(e.checked,t)||(e.checked=t,Wd.change(e))}};qt()(["checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);function Gd(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}var so={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"};function Xd(e){return e in so?so[e]:e.startsWith("on")?`on${Gd(e.substr(2))}`:e.toLowerCase()}var Vn=zd(e=>{const t={};for(const n in e){const i=e[n];n==="children"?typeof i=="string"&&(t.innerHTML=i):t[Xd(n)]=e[n]}return t});function Yd(e,t){const{actions:n,context:i}=t??{},r=ql(e.state),a=Pr(e.state,()=>{r.value=Mt(e.state)});return Yo(()=>{a?.()}),Ko(()=>{e.setOptions({actions:n})}),i&&Ce(i,o=>{e.setContext(re(o))},{deep:!0}),r}function Kd(e,t){const{state:n,context:i}=t??{},r=typeof e=="function"?e():e;return i&&r.setContext(re(i)),r._created(),At(()=>{r.start(n),Qr(()=>{r.stop()})}),r}function Bn(e,t){const n=Kd(e,t);return[Yd(n,t),n.send,n]}function _t(e={}){const{prefix:t}=e,n=tc();return t?`${t}-${n}`:n}const Zd={key:0,class:"k-checkbox__help"},lo=oe({__name:"Checkbox",props:{modelValue:{type:[Boolean,Array]},value:{},label:{},disabled:{type:Boolean},required:{type:Boolean},help:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e;if(n.modelValue instanceof Array&&!n.value)throw new Error("props.value is required if props.modelValue is an array");const i=t,r=()=>{const{modelValue:c,value:d}=n;return c instanceof Array?c.some(h=>$n(h)===$n(d)):!!c};function a(c){const{modelValue:d,value:h}=n;if(!(d instanceof Array))return i("update:modelValue",typeof c=="boolean"?c:void 0);if(!(typeof c!="boolean"||!h))return c?i("update:modelValue",[...d,h]):i("update:modelValue",d.filter(p=>$n(p)!==$n(h)))}const o={id:_t(),checked:r(),onCheckedChange:({checked:c})=>{if(r()!==c)return a(c)}},[s,l]=Bn(Ud(o),{context:U(()=>({disabled:n.disabled,required:n.required}))}),u=U(()=>qd(s.value,l,Vn));return Ce(()=>n.modelValue,()=>{const c=r();if(u.value.checked!==c)return u.value.setChecked(c)}),(c,d)=>(A(),P("label",te({class:"k-checkbox"},u.value.getRootProps()),[ee("div",ye(Ie(u.value.getControlProps())),[u.value.checked?(A(),ue(re(Bt),{key:0,icon:"fa-pro-solid:check"})):W("",!0)],16),ee("span",ye(Ie(u.value.getLabelProps())),[ee("span",{class:Oe(["k-checkbox__label",{"k-checkbox__label-required":c.required}])},[z(c.$slots,"default",{},()=>[$e(de(c.label),1)])],2),c.$slots.help||c.help?(A(),P("span",Zd,[z(c.$slots,"help",{},()=>[$e(de(c.help),1)])])):W("",!0)],16),ee("input",ye(Ie(u.value.getHiddenInputProps())),null,16)],16))}}),va=Symbol("form-control"),Qd={class:"k-formcontrol"},Jd=["for"],eh={key:1,class:"k-formcontrol__error"},th={key:2,class:"k-formcontrol__help"},_m=oe({__name:"FormControl",props:{label:{},help:{},error:{},required:{type:Boolean}},emits:["blur","focus"],setup(e,{emit:t}){const n=e,i=t,r=_t({prefix:"k-formcontrol"}),a=U(()=>`${r}_label`),o=U(()=>`${r}_help`),s={onBlur:()=>i("blur"),onFocus:()=>i("focus")};return Vl(va,U(()=>({...n,id:r,labelId:a.value,helpId:o.value,invalid:!!n.error,required:n.required,events:s}))),(l,u)=>(A(),P("div",Qd,[l.$slots.label||l.label?(A(),P("label",{key:0,class:Oe(["k-formcontrol__label",{"k-formcontrol__label-required":l.required}]),for:re(r)},[z(l.$slots,"label",{},()=>[$e(de(l.label),1)])],10,Jd)):W("",!0),z(l.$slots,"default",{id:re(r)}),l.$slots.error||l.error?(A(),P("span",eh,[z(l.$slots,"error",{},()=>[$e(de(l.error),1)])])):W("",!0),l.$slots.help||l.help?(A(),P("span",th,[z(l.$slots,"help",{},()=>[$e(de(l.help),1)])])):W("",!0)]))}});function bt(e){return typeof e=="string"||e instanceof String}function uo(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function Bs(e,t){return Array.isArray(t)?Bs(e,(n,i)=>t.includes(i)):Object.entries(e).reduce((n,i)=>{let[r,a]=i;return t(a,r)&&(n[r]=a),n},{})}const O={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function nh(e){switch(e){case O.LEFT:return O.FORCE_LEFT;case O.RIGHT:return O.FORCE_RIGHT;default:return e}}function or(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function yi(e,t){if(t===e)return!0;const n=Array.isArray(t),i=Array.isArray(e);let r;if(n&&i){if(t.length!=e.length)return!1;for(r=0;r<t.length;r++)if(!yi(t[r],e[r]))return!1;return!0}if(n!=i)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const a=t instanceof Date,o=e instanceof Date;if(a&&o)return t.getTime()==e.getTime();if(a!=o)return!1;const s=t instanceof RegExp,l=e instanceof RegExp;if(s&&l)return t.toString()==e.toString();if(s!=l)return!1;const u=Object.keys(t);for(r=0;r<u.length;r++)if(!Object.prototype.hasOwnProperty.call(e,u[r]))return!1;for(r=0;r<u.length;r++)if(!yi(e[u[r]],t[u[r]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}class ih{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?O.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?O.RIGHT:O.LEFT}}function j(e,t){return new j.InputMask(e,t)}function Ls(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?j.MaskedRegExp:bt(e)?j.MaskedPattern:e===Date?j.MaskedDate:e===Number?j.MaskedNumber:Array.isArray(e)||e===Array?j.MaskedDynamic:j.Masked&&e.prototype instanceof j.Masked?e:j.Masked&&e instanceof j.Masked?e.constructor:e instanceof Function?j.MaskedFunction:(console.warn("Mask not found for mask",e),j.Masked)}function Dn(e){if(!e)throw new Error("Options in not defined");if(j.Masked){if(e.prototype instanceof j.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof j.Masked?{mask:e}:uo(e)&&e.mask instanceof j.Masked?e:{};if(t){const i=t.mask;return{...Bs(t,(r,a)=>!a.startsWith("_")),mask:t.constructor,_mask:i,...n}}}return uo(e)?{...e}:{mask:e}}function ut(e){if(j.Masked&&e instanceof j.Masked)return e;const t=Dn(e),n=Ls(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}j.createMask=ut;class ba{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch{}}get isActive(){return!1}}j.MaskElement=ba;const co=90,rh=89;class ji extends ba{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,i;return(t=(n=(i=this.input).getRootNode)==null?void 0:n.call(i))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===co&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===rh&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===co&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}j.HTMLMaskElement=ji;class ah extends ji{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}j.HTMLMaskElement=ji;class Ns extends ji{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),i=n&&n.anchorOffset,r=n&&n.focusOffset;return r==null||i==null||i<r?i:r}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),i=n&&n.anchorOffset,r=n&&n.focusOffset;return r==null||i==null||i>r?i:r}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,n);const r=this.rootElement,a=r.getSelection&&r.getSelection();a&&(a.removeAllRanges(),a.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}j.HTMLContenteditableMaskElement=Ns;class $i{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>$i.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}$i.MAX_LENGTH=100;class oh{constructor(t,n){this.el=t instanceof ba?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Ns(t):new ah(t),this.masked=ut(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new $i,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof j.Masked)&&this.masked.constructor===Ls(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof j.Masked?t:ut({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const i=this._listeners[t];i&&i.forEach(r=>r(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,i=this.masked.value,r=this.masked.rawInputValue,a=this.displayValue,o=this.unmaskedValue!==n||this.value!==i||this._rawInputValue!==r;this._unmaskedValue=n,this._value=i,this._rawInputValue=r,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...i}=t,r=!this.maskEquals(n),a=this.masked.optionsIsChanged(i);r&&(this.mask=n),a&&this.masked.updateOptions(i),(r||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,O.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(n);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new ih({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,r=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=i===this.masked.rawInputValue?n.removeDirection:O.NONE;let o=this.masked.nearestInputPos(n.startChangePos+r,a);a!==O.NONE&&(o=this.masked.nearestInputPos(o,O.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}j.InputMask=oh;class q{static normalize(t){return Array.isArray(t)?t:[t,new q]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}j.ChangeDetails=q;class We{constructor(t,n,i){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class xe{constructor(t){this._value="",this._update({...xe.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,i){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new We(this.extractInput(t,n),t)}appendTail(t){return bt(t)&&(t=new We(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new q({inserted:t,rawInserted:t})):new q}_appendChar(t,n,i){n===void 0&&(n={});const r=this.state;let a;if([t,a]=this.doPrepareChar(t,n),t&&(a=a.aggregate(this._appendCharRaw(t,n)),!a.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=r;let s=this.pad(n);const l=this._appendCharRaw(t,n);s=s.aggregate(l),l.rawInserted||s.equals(a)?a=s:this.state=o}if(a.inserted){let o,s=this.doValidate(n)!==!1;if(s&&i!=null){const l=this.state;if(this.overwrite===!0){o=i.state;for(let c=0;c<a.rawInserted.length;++c)i.unshift(this.displayValue.length-a.tailShift)}let u=this.appendTail(i);if(s=u.rawInserted.length===i.toString().length,!(s&&u.inserted)&&this.overwrite==="shift"){this.state=l,o=i.state;for(let c=0;c<a.rawInserted.length;++c)i.shift();u=this.appendTail(i),s=u.rawInserted.length===i.toString().length}s&&u.inserted&&(this.state=l)}s||(a=new q,this.state=r,i&&o&&(i.state=o))}return a}_appendPlaceholder(){return new q}_appendEager(){return new q}append(t,n,i){if(!bt(t))throw new Error("value should be string");const r=bt(i)?new We(String(i)):i;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,n);for(let o=0;o<t.length;++o){const s=this._appendChar(t[o],n,r);if(!s.rawInserted&&!this.doSkipInvalid(t[o],n,r))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&a.aggregate(this._appendEager()),r!=null&&(a.tailShift+=this.appendTail(r).tailShift),a}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new q}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,i=this.value,r=t();return this.rawInputValue=n,this.value&&this.value!==i&&i.indexOf(this.value)===0&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,i=t(this);return this.state=n,delete this._isolated,i}doSkipInvalid(t,n,i){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),q.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),q.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,i,r,a){i===void 0&&(i=""),r===void 0&&(r=O.NONE),a===void 0&&(a={input:!0});const o=t+n,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let u;l&&(r=nh(r),u=this.extractInput(0,o,{raw:!0}));let c=t;const d=new q;if(r!==O.NONE&&(c=this.nearestInputPos(t,n>1&&t!==0&&!l?O.NONE:r),d.tailShift=c-t),d.aggregate(this.remove(c)),l&&r!==O.NONE&&u===this.rawInputValue)if(r===O.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new q({tailShift:-1})).aggregate(this.remove(h-1))}else r===O.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(i,a,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!yi(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||xe.EMPTY_VALUES.includes(t)&&xe.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new q}}xe.DEFAULTS={skipInvalid:!0};xe.EMPTY_VALUES=[void 0,null,""];j.Masked=xe;class Vt{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=bt(t)?new We(String(t)):t;const n=this.chunks[this.chunks.length-1],i=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof We)i?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Vt){if(t.stop==null){let r;for(;t.chunks.length&&t.chunks[0].stop==null;)r=t.chunks.shift(),r.from+=t.from,this.extend(r)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof j.MaskedPattern))return new We(this.toString()).appendTo(t);const n=new q;for(let i=0;i<this.chunks.length;++i){const r=this.chunks[i],a=t._mapPosToBlock(t.displayValue.length),o=r.stop;let s;if(o!=null&&(!a||a.index<=o)&&((r instanceof Vt||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),s=r instanceof Vt&&t._blocks[o]),s){const l=s.appendTail(r);n.aggregate(l);const u=r.toString().slice(l.rawInserted.length);u&&n.aggregate(t.append(u,{tail:!0}))}else n.aggregate(t.append(r.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...i}=t;Object.assign(this,i),this.chunks=n.map(r=>{const a="chunks"in r?new Vt:new We;return a.state=r,a})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let i=0;for(;i<this.chunks.length;){const r=this.chunks[i],a=r.unshift(n);if(r.toString()){if(!a)break;++i}else this.chunks.splice(i,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],i=n.shift();if(n.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class sh{constructor(t,n){this.masked=t,this._log=[];const{offset:i,index:r}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,O.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,O.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,O.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,O.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,O.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,O.NONE),!0})}}class js{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new q}nearestInputPos(t,n){n===void 0&&(n=O.NONE);const i=0,r=this._value.length;switch(n){case O.LEFT:case O.FORCE_LEFT:return i;case O.NONE:case O.RIGHT:case O.FORCE_RIGHT:default:return r}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,i){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),i===void 0&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new q;const i=this.eager===!0||this.eager==="append",r=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!i)&&!n.tail,a=new q({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(n.raw||n.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new q;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new We("")}appendTail(t){return bt(t)&&(t=new We(String(t))),t.appendTo(this)}append(t,n,i){const r=this._appendChar(t[0],n);return i!=null&&(r.tailShift+=this.appendTail(i).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class xi{constructor(t){const{parent:n,isOptional:i,placeholderChar:r,displayChar:a,lazy:o,eager:s,...l}=t;this.masked=ut(l),Object.assign(this,{parent:n,isOptional:i,placeholderChar:r,displayChar:a,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new q}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new q;const i=this.masked.state;let r=this.masked._appendChar(t,this.currentMaskFlags(n));return r.inserted&&this.doValidate(n)===!1&&(r=new q,this.masked.state=i),!r.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(t,n,i){return this.masked.append(t,this.currentMaskFlags(n),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new q:(this.isFilled=!0,new q({inserted:this.placeholderChar}))}_appendEager(){return new q}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,i){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,i)}nearestInputPos(t,n){n===void 0&&(n=O.NONE);const i=0,r=this.value.length,a=Math.min(Math.max(t,i),r);switch(n){case O.LEFT:case O.FORCE_LEFT:return this.isComplete?a:i;case O.RIGHT:case O.FORCE_RIGHT:return this.isComplete?a:r;case O.NONE:default:return a}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||t?._beforeTailState}}pad(t){return new q}}xi.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class lh extends xe{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=i=>i.search(n)>=0),super._update(t)}}j.MaskedRegExp=lh;class ke extends xe{constructor(t){super({...ke.DEFAULTS,...t,definitions:Object.assign({},xi.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let i=!1,r=!1;for(let a=0;a<n.length;++a){if(this.blocks){const u=n.slice(a),c=Object.keys(this.blocks).filter(h=>u.indexOf(h)===0);c.sort((h,p)=>p.length-h.length);const d=c[0];if(d){const{expose:h,repeat:p,...f}=Dn(this.blocks[d]),g={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...f,repeat:p,parent:this},m=p!=null?new j.RepeatBlock(g):ut(g);m&&(this._blocks.push(m),h&&(this.exposeBlock=m),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),a+=d.length-1;continue}}let o=n[a],s=o in t;if(o===ke.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){i=!i;continue}if(o==="["||o==="]"){r=!r;continue}if(o===ke.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}const l=s?new xi({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Dn(t[o]),parent:this}):new js({char:o,eager:this.eager,isUnmasking:i});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...i}=t;this._blocks.forEach((r,a)=>r.state=n[a]),super.state=i}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new q;let i=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(i==null)return n;this._blocks[i].isFilled&&++i;for(let r=i;r<this._blocks.length;++r){const a=this._blocks[r]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const i=this._mapPosToBlock(this.displayValue.length),r=new q;if(!i)return r;for(let o=i.index,s;s=this._blocks[o];++o){var a;const l=s._appendChar(t,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]});if(r.aggregate(l),l.consumed)break}return r}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const i=new Vt;return t===n||this._forEachBlocksInRange(t,n,(r,a,o,s)=>{const l=r.extractTail(o,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof Vt&&(l.blockIndex=a),i.extend(l)}),i}extractInput(t,n,i){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),i===void 0&&(i={}),t===n)return"";let r="";return this._forEachBlocksInRange(t,n,(a,o,s,l)=>{r+=a.extractInput(s,l,i)}),r}_findStopBefore(t){let n;for(let i=0;i<this._stops.length;++i){const r=this._stops[i];if(r<=t)n=r;else break}return n}_appendPlaceholder(t){const n=new q;if(this.lazy&&t==null)return n;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return n;const r=i.index,a=t??this._blocks.length;return this._blocks.slice(r,a).forEach(o=>{if(!o.lazy||t!=null){var s;n.aggregate(o._appendPlaceholder((s=o._blocks)==null?void 0:s.length))}}),n}_mapPosToBlock(t){let n="";for(let i=0;i<this._blocks.length;++i){const r=this._blocks[i],a=n.length;if(n+=r.displayValue,t<=n.length)return{index:i,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,i)=>n+=i.displayValue.length,0)}_forEachBlocksInRange(t,n,i){n===void 0&&(n=this.displayValue.length);const r=this._mapPosToBlock(t);if(r){const a=this._mapPosToBlock(n),o=a&&r.index===a.index,s=r.offset,l=a&&o?a.offset:this._blocks[r.index].displayValue.length;if(i(this._blocks[r.index],r.index,s,l),a&&!o){for(let u=r.index+1;u<a.index;++u)i(this._blocks[u],u,0,this._blocks[u].displayValue.length);i(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const i=super.remove(t,n);return this._forEachBlocksInRange(t,n,(r,a,o,s)=>{i.aggregate(r.remove(o,s))}),i}nearestInputPos(t,n){if(n===void 0&&(n=O.NONE),!this._blocks.length)return 0;const i=new sh(this,t);if(n===O.NONE)return i.pushRightBeforeInput()||(i.popState(),i.pushLeftBeforeInput())?i.pos:this.displayValue.length;if(n===O.LEFT||n===O.FORCE_LEFT){if(n===O.LEFT){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),n===O.LEFT){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t||(i.popState(),i.ok&&i.pos<=t))return i.pos;i.popState()}return i.ok?i.pos:n===O.FORCE_LEFT?0:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:0)}return n===O.RIGHT||n===O.FORCE_RIGHT?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:n===O.FORCE_RIGHT?this.displayValue.length:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:this.nearestInputPos(t,O.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,n,(r,a,o,s)=>{i+=r.totalInputPositions(o,s)}),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(i=>this._blocks[i]):[]}pad(t){const n=new q;return this._forEachBlocksInRange(0,this.displayValue.length,i=>n.aggregate(i.pad(t))),n}}ke.DEFAULTS={...xe.DEFAULTS,lazy:!0,placeholderChar:"_"};ke.STOP_CHAR="`";ke.ESCAPE_CHAR="\\";ke.InputDefinition=xi;ke.FixedDefinition=js;j.MaskedPattern=ke;class li extends ke{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:i=this.from||0,maxLength:r=this.maxLength||0,autofix:a=this.autofix,...o}=t;this.to=n,this.from=i,this.maxLength=Math.max(String(n).length,r),this.autofix=a;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<l.length&&l[u]===s[u];)++u;o.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",i="";const[,r,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(r.length)+a,i="9".repeat(r.length)+a),n=n.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[n,i]}doPrepareChar(t,n){n===void 0&&(n={});let i;return[t,i]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const i=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[a,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(i[this.value.length],n):Number(a)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(r[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,r]=this.boundaries(n);return this.from<=Number(r)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new q;if(this.value.length===this.maxLength)return n;const i=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let a=0;a<r;++a)n.aggregate(super._appendCharRaw("0",t));i.split("").forEach(a=>this._appendCharRaw(a))}return n}}j.MaskedRange=li;const uh="d{.}`m{.}`Y";class it extends ke{static extractPatternOptions(t){const{mask:n,pattern:i,...r}=t;return{...r,mask:bt(n)?n:i}}constructor(t){super(it.extractPatternOptions({...it.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:i,blocks:r,...a}={...it.DEFAULTS,...t},o=Object.assign({},it.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,r),super._update({...a,mask:bt(n)?n:i,blocks:o})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(it.extractPatternOptions(t))}}it.GET_DEFAULT_BLOCKS=()=>({d:{mask:li,from:1,to:31,maxLength:2},m:{mask:li,from:1,to:12,maxLength:2},Y:{mask:li,from:1900,to:9999}});it.DEFAULTS={...ke.DEFAULTS,mask:Date,pattern:uh,format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return[n,i,r].join(".")},parse:(e,t)=>{const[n,i,r]=e.split(".").map(Number);return new Date(r,i-1,n)}};j.MaskedDate=it;class zi extends xe{constructor(t){super({...zi.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:i,...r}=Dn(n),a=ut({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return i&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const i=this._applyDispatch(t,n);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),i}_applyDispatch(t,n,i){t===void 0&&(t=""),n===void 0&&(n={}),i===void 0&&(i="");const r=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,s=a.slice(o.length),l=this.currentMask,u=new q,c=l?.state;return this.currentMask=this.doDispatch(t,{...n},i),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),u.tailShift=this.currentMask.value.length-r.length),s&&(u.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new q;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,i;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((i=t._beforeTailState)==null?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,n,i){return n===void 0&&(n={}),i===void 0&&(i=""),this.dispatch(t,this,n,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[i,r]=super.doPrepare(t,n);if(this.currentMask){let a;[i,a]=super.doPrepare(i,this.currentMaskFlags(n)),r=r.aggregate(a)}return[i,r]}doPrepareChar(t,n){n===void 0&&(n={});let[i,r]=super.doPrepareChar(t,n);if(this.currentMask){let a;[i,a]=super.doPrepareChar(i,this.currentMaskFlags(n)),r=r.aggregate(a)}return[i,r]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const i=new q;return this.currentMask&&i.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:i,currentMask:r,...a}=t;n&&this.compiledMasks.forEach((o,s)=>o.state=n[s]),i!=null&&(this.currentMask=i,this.currentMask.state=r),super.state=a}extractInput(t,n,i){return this.currentMask?this.currentMask.extractInput(t,n,i):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,i)=>{if(!t[i])return;const{mask:r,...a}=t[i];return yi(n,a)&&n.maskEquals(r)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}zi.DEFAULTS={...xe.DEFAULTS,dispatch:(e,t,n,i)=>{if(!t.compiledMasks.length)return;const r=t.rawInputValue,a=t.compiledMasks.map((o,s)=>{const l=t.currentMask===o,u=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,O.FORCE_LEFT);return o.rawInputValue!==r?(o.reset(),o.append(r,{raw:!0})):l||o.remove(u),o.append(e,t.currentMaskFlags(n)),o.appendTail(i),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(u,o.nearestInputPos(o.displayValue.length,O.FORCE_LEFT)))}});return a.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),t.compiledMasks[a[0].index]}};j.MaskedDynamic=zi;class Hi extends ke{constructor(t){super({...Hi.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...i}=t;if(n){const r=n.map(s=>s.length),a=Math.min(...r),o=Math.max(...r)-a;i.mask="*".repeat(a),o&&(i.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(i)}_appendCharRaw(t,n){n===void 0&&(n={});const i=Math.min(this.nearestInputPos(0,O.FORCE_RIGHT),this.value.length),r=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,i));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,s)=>{const l=r[0][s];s>=this.value.length||l===o.value||(o.reset(),o._appendChar(l,n))});const a=super._appendCharRaw(r[0][this.value.length],n);return r.length===1&&r[0].slice(this.unmaskedValue.length).split("").forEach(o=>a.aggregate(super._appendCharRaw(o))),a}return new q({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new We("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new q;const i=Math.min(super.nearestInputPos(0,O.FORCE_RIGHT),this.value.length);let r;for(r=t;r>=0&&!(this.enum.filter(o=>this.matchValue(o,this.value.slice(i,r),i)).length>1);--r);const a=super.remove(r,n);return a.tailShift+=r-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}Hi.DEFAULTS={...ke.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};j.MaskedEnum=Hi;class ch extends xe{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}j.MaskedFunction=ch;var $s;class Te extends xe{constructor(t){super({...Te.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",i=(this.scale?"("+or(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+i),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(or).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(or(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[i,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!i&&(r.skip=!0),i&&!this.allowPositive&&!this.value&&i!=="-"&&r.aggregate(this._appendChar("-")),[i,r]}_separatorsCount(t,n){n===void 0&&(n=!1);let i=0;for(let r=0;r<t;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++i,n&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,i){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,i))}_appendCharRaw(t,n){n===void 0&&(n={});const i=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const o=this.number;let s=!isNaN(o),l=!1;if(s){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(Te.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!n.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let u;s?u=new q({inserted:this._value.slice(a.length),rawInserted:l?"":t,skip:l}):(this._value=a,u=new q),this._value=this._insertThousandsSeparators(this._value);const c=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return u.tailShift+=(d-r)*this.thousandsSeparator.length,u}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,n);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,n){const i=this._findSeparatorAround(t);i>=0&&(t=i);const r=this._findSeparatorAround(n);return r>=0&&(n=r+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const i=this.value.slice(0,t),r=this.value.slice(n),a=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+r));const o=this._separatorsCountFromSlice(i);return new q({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case O.NONE:case O.LEFT:case O.FORCE_LEFT:{const i=this._findSeparatorAround(t-1);if(i>=0){const r=i+this.thousandsSeparator.length;if(t<r||this.value.length<=r||n===O.FORCE_LEFT)return i}break}case O.RIGHT:case O.FORCE_RIGHT:{const i=this._findSeparatorAround(t);if(i>=0)return i+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(i,r,a,o)=>r+o),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,i){n===void 0&&(n={});const r=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===Te.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,i)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Te.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(Te.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||Te.EMPTY_VALUES.includes(t)&&Te.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}$s=Te;Te.UNMASKED_RADIX=".";Te.EMPTY_VALUES=[...xe.EMPTY_VALUES,0];Te.DEFAULTS={...xe.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[$s.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};j.MaskedNumber=Te;const Vr={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function zs(e,t,n){t===void 0&&(t=Vr.MASKED),n===void 0&&(n=Vr.MASKED);const i=ut(e);return r=>i.runIsolated(a=>(a[t]=r,a[n]))}function dh(e,t,n,i){return zs(t,n,i)(e)}j.PIPE_TYPE=Vr;j.createPipe=zs;j.pipe=dh;class hh extends ke{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,i,r;const{repeat:a,...o}=Dn(t);this._blockOpts=Object.assign({},this._blockOpts,o);const s=ut(this._blockOpts);this.repeat=(n=(i=a??s.repeat)!=null?i:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((r=this._blocks)==null?void 0:r.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(ut(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const i=new q;for(let l=(r=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?r:Math.max(this._blocks.length-1,0),u,c;u=(o=this._blocks[l])!=null?o:c=!c&&this._allocateBlock(l);++l){var r,a,o,s;const d=u._appendChar(t,{...n,_beforeTailState:(s=n._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]});if(d.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(d),d.consumed)break}return i}_trimEmptyTail(t,n){var i,r;t===void 0&&(t=0);const a=Math.max(((i=this._mapPosToBlock(t))==null?void 0:i.index)||0,this.repeatFrom,0);let o;n!=null&&(o=(r=this._mapPosToBlock(n))==null?void 0:r.index),o==null&&(o=this._blocks.length-1);let s=0;for(let l=o;a<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(o-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const i=super.remove(t,n);return this._trimEmptyTail(t,n),i}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}j.RepeatBlock=hh;try{globalThis.IMask=j}catch{}function ph(e,t){let{emit:n,onAccept:i,onComplete:r,defaultValue:a,defaultUnmaskedValue:o,defaultTypedValue:s}=t===void 0?{}:t;const l=$l(e)?e:ne(e),u=ne(),c=ne(),d=ne(""),h=ne(""),p=ne();let f,g=d.value,m=h.value,b=p.value;function v(){b=p.value=c.value.typedValue,m=h.value=c.value.unmaskedValue,g=d.value=c.value.value}function E(k){v(),n&&(n("accept",d.value,k),n("accept:masked",d.value,k),n("accept:typed",p.value,k),n("accept:unmasked",h.value,k)),i?.(k)}function T(k){n&&(n("complete",c.value.value,k),n("complete:masked",c.value.value,k),n("complete:typed",c.value.typedValue,k),n("complete:unmasked",c.value.unmaskedValue,k)),r?.(k)}const _=()=>{!c.value||h.value===void 0||(m!==h.value&&(c.value.unmaskedValue=h.value,c.value.unmaskedValue!==h.value&&E()),m=void 0)};Ce(h,_);const S=()=>{!c.value||d.value===void 0||(g!==d.value&&(c.value.value=d.value,c.value.value!==d.value&&E()),g=void 0)};Ce(d,S);const X=()=>{!c.value||p.value===void 0||(b!==p.value&&(c.value.typedValue=p.value,c.value.masked.typedValueEquals(p.value)||E()),b=void 0)};Ce(p,X);function D(){f=u.value;const k=l.value;!f||!(k!=null&&k.mask)||(c.value=j(f,k),a!==void 0&&(d.value=a),o!==void 0&&(h.value=o),s!==void 0&&(p.value=s),_(),S(),X(),v(),c.value.on("accept",E).on("complete",T))}function C(){var k;(k=c.value)==null||k.destroy(),c.value=void 0}return At(D),Yo(C),Ce([u,l],()=>{const k=u.value,y=l.value;(!(y!=null&&y.mask)||k!==f)&&C(),k&&(c.value?c.value.updateOptions(y):D())}),{el:u,mask:zl(c),masked:d,unmasked:h,typed:p}}const fh={key:0,class:"k-input__prefix"},gh=["id","aria-labelledby","aria-describedby","required","type"],mh={key:1,class:"k-input__suffix"},wm=oe({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Bl(),i=e,r=t;function a(p){i.mask||r("update:modelValue",p.target.value)}const o=Jr("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),s=qo(va,U(()=>({id:i.id,invalid:i.invalid,required:!1,events:{onBlur:()=>{},onFocus:()=>{}}}))),l=p=>{var f;(f=s.value.events)==null||f.onFocus(p),n.onFocus&&n.onFocus(p)},u=p=>{var f;(f=s.value.events)==null||f.onBlur(p),n.onBlur&&n.onBlur(p)},{unmasked:c,masked:d,el:h}=ph(i.mask,{defaultValue:String(i.modelValue),onAccept:()=>{var p,f;if((p=i.mask)!=null&&p.pattern)return;const g=((f=i.mask)==null?void 0:f.mask)===Number?parseFloat(c.value):d.value;g!==i.modelValue&&r("update:modelValue",g)},onCompleted:()=>{var p;(p=i.mask)!=null&&p.pattern&&r("update:modelValue",i.mask.unmask?c.value:d.value)}});return At(()=>{Ce(()=>i.modelValue,p=>{i.mask&&c.value!==String(p)&&(c.value=String(p)),i.mask||(h.value.value=p)},{immediate:!0})}),(p,f)=>(A(),P("div",{class:Oe(re(o)({invalid:re(s).invalid,align:p.align}))},[p.$slots.prefix||p.prefix?(A(),P("span",fh,[z(p.$slots,"prefix",{},()=>[$e(de(p.prefix),1)])])):W("",!0),ee("input",te({class:"k-input__input",id:re(s).id,"aria-labelledby":re(s).labelId,"aria-describedby":re(s).helpId,required:re(s).required,onInput:a,onBlur:u,onFocus:l,ref_key:"el",ref:h,type:i.type},{...re(s).events,...p.$attrs}),null,16,gh),p.$slots.suffix||p.suffix?(A(),P("span",mh,[z(p.$slots,"suffix",{},()=>[$e(de(p.suffix),1)])])):W("",!0)],2))}}),vh=["src","alt"],bh=oe({__name:"Image",props:{src:{},preview:{},alt:{},caption:{},captionVisibility:{default:"hover"},captionTheme:{default:"dark"},size:{default:"cover"},position:{default:"center"},width:{},height:{},aspectRatio:{}},emits:["loaded","error"],setup(e,{emit:t}){const n=e,i=t,r=ne(),a=ne(!1),o=ne(!1),s=ne(),l=U(()=>({"--k-image-size":n.size,"--k-image-preview":n.preview||"","--k-image-position":n.position,"--k-image-width":n.width||"initial","--k-image-height":n.height||"initial","--k-image-aspectratio":(n.aspectRatio==="natural"?s.value:n.aspectRatio)||"initial"}));function u(){a.value=!0;const{naturalWidth:d=0,naturalHeight:h=0}=r.value||{};s.value=`${d}/${h}`,i("loaded")}function c(){a.value=!0,o.value=!0,i("error")}return At(()=>{var d;return((d=r.value)==null?void 0:d.complete)&&u()}),(d,h)=>(A(),P("figure",{class:Oe(["k-image",[`k-image--size-${d.size}`,{"k-image--loaded":a.value,"k-image--loading":!a.value}]]),style:St(l.value)},[a.value?W("",!0):(A(),ue(ms,{key:0,size:"small"})),zo(ee("img",{src:d.src,alt:d.alt||d.caption,onLoad:u,onError:c,ref_key:"image",ref:r},null,40,vh),[[Ho,!o.value]]),d.$slots.caption||d.caption?(A(),P("figcaption",{key:1,class:Oe(`k-image__caption k-image__caption--visibility-${d.captionVisibility} k-image__caption--theme-${!a.value||o.value?"light":d.captionTheme}`)},[z(d.$slots,"caption",{},()=>[$e(de(d.caption),1)])],2)):W("",!0)],6))}}),yh={key:1,class:"k-card__content"},xh={key:0,class:"k-card__title"},kh={key:2,class:"k-card__footer"},Eh=oe({inheritAttrs:!1,__name:"Card",props:{is:{default:"div"},title:{},variant:{default:"border"},thumbnail:{},thumbnailSize:{default:"cover"},headerMinHeight:{}},setup(e){return(t,n)=>(A(),ue(kt(t.is),te({class:`k-card k-card--variant-${t.variant}`,style:`--k-header-min-height: ${t.headerMinHeight||""}`},t.$attrs),{default:ve(()=>[t.$slots.header||t.thumbnail?(A(),P("div",{key:0,class:Oe(["k-card__header",[{"k-card__header--has-thumbnail":!t.$slots.header&&t.thumbnail},`k-card__header--thumbnail-size-${t.thumbnailSize}`]])},[z(t.$slots,"header",{},()=>[t.thumbnail?(A(),ue(bh,{key:0,class:"k-card__thumbnail",src:t.thumbnail,size:t.thumbnailSize},null,8,["src","size"])):W("",!0)])],2)):W("",!0),t.$slots.default||t.title?(A(),P("div",yh,[t.title?(A(),P("div",xh,de(t.title),1)):W("",!0),z(t.$slots,"default")])):W("",!0),t.$slots.footer?(A(),P("div",kh,[z(t.$slots,"footer")])):W("",!0)]),_:3},16,["class","style"]))}}),Cm=oe({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(e){const t=()=>e.rounding?e.rounding==="full"?"9999px":oa(e.rounding,"rounding"):"initial",n=U(()=>({"--aspect-ratio":!e.aspectRatio||e.width&&e.height?"initial":e.aspectRatio,"--width":e.width||"initial","--height":e.height||"initial","--border-radius":t()}));return(i,r)=>(A(),P("span",{class:Oe(["k-skeleton",`k-skeleton--variant-${i.variant}`]),style:St(n.value)},[z(i.$slots,"default")],6))}});function _h(e,t,n){return e===0?n:t[e-1]}function wh(e,t,n){return e===t.length-1?n:t[e+1]}function Ch(e,t,n){return Math.round((e-t)/n)*n+t}function qi(e,t,n){return Math.min(Math.max(e,t),n)}function ya(e,t,n){return(e-t)/(n-t)}function Hs(e,t,n,i){const r=e*(n-t)+t,a=Ch(r,t,i);return qi(a,t,n)}function Wn(e,t){let n=e,i=t.toString(),r=i.indexOf("."),a=r>=0?i.length-r:0;if(a>0){let o=Math.pow(10,a);n=Math.round(n*o)/o}return n}function qs(e,t,n,i){t=Number(t),n=Number(n);let r=(e-(isNaN(t)?0:t))%i,a=Wn(Math.abs(r)*2>=i?e+Math.sign(r)*(i-Math.abs(r)):e-r,i);return isNaN(t)?!isNaN(n)&&a>n&&(a=Math.floor(Wn(n/i,i))*i):a<t?a=t:!isNaN(n)&&a>n&&(a=t+Math.floor(Wn((n-t)/i,i))*i),a=Wn(a,i),a}function Ah(e,t,n){return e[t]===n?e:[...e.slice(0,t),n,...e.slice(t+1)]}function Us(e,t){const n=_h(e,t.values,t.min),i=wh(e,t.values,t.max);let r=t.values.slice();return function(a){let o=qs(a,n,i,t.step);return r=Ah(r,e,a),r[e]=o,r}}function Sh(e,t){const n=t.values[e]+t.step;return Us(e,t)(n)}function Th(e,t){const n=t.values[e]-t.step;return Us(e,t)(n)}function Ih(e,t){let n=e.findIndex(a=>t-a<0);if(n===0)return n;if(n===-1)return e.length-1;let i=e[n-1],r=e[n];return Math.abs(i-t)<Math.abs(r-t)?n-1:n}function Fh(e,t,n,i){return e.map((r,a)=>{const o=a===0?t:e[a-1]+i,s=a===e.length-1?n:e[a+1]-i;return{min:o,max:s,value:r}})}function Br(e,t){const n={min:e[0],max:e[1]},i={min:t[0],max:t[1]};return function(r){if(n.min===n.max||i.min===i.max)return i.min;const a=(i.max-i.min)/(n.max-n.min);return i.min+a*(r-n.min)}}function Dh(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,i=new n.ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const[a]=r;let o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=e.offsetWidth,s=e.offsetHeight;t({width:o,height:s})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}function Oh(e){const{getNodes:t,observeMutation:n=!0,callback:i}=e,r=[];let a=null;function o(){const s=t();a=s[0];const l=s.map((u,c)=>Dh(u,d=>{i(d,c)}));r.push(...l)}if(o(),n){const s=Ph(a,o);r.push(s)}return()=>{r.forEach(s=>{s?.()})}}function Ph(e,t){var n;if(!e||!e.parentElement)return;const i=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,r=new i.MutationObserver(()=>{t()});return r.observe(e.parentElement,{childList:!0}),()=>{r.disconnect()}}var Rh=mt("slider").parts("root","label","thumb","valueText","track","range","control","markerGroup","marker"),et=Rh.build();function Mh(e){const t=e[0],n=e[e.length-1];return[t,n]}function Vh(e){const[t,n]=Mh(e.valuePercent);if(e.valuePercent.length===1){if(e.origin==="center"){const i=e.valuePercent[0]<50,r=i?`${e.valuePercent[0]}%`:"50%",a=i?"50%":`${100-e.valuePercent[0]}%`;return{start:r,end:a}}return{start:"0%",end:`${100-n}%`}}return{start:`${t}%`,end:`${100-n}%`}}function Bh(e){return e.isVertical?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[e.isRtl?"right":"left"]:"var(--slider-range-start)",[e.isRtl?"left":"right"]:"var(--slider-range-end)"}}function Lh(e){const{height:t=0}=e.thumbSize??{},n=Br([e.min,e.max],[-t/2,t/2]);return parseFloat(n(e.value).toFixed(2))}function Nh(e){const{width:t=0}=e.thumbSize??{};if(e.isRtl){const i=Br([e.max,e.min],[-t/2,t/2]);return-1*parseFloat(i(e.value).toFixed(2))}const n=Br([e.min,e.max],[-t/2,t/2]);return parseFloat(n(e.value).toFixed(2))}function jh(e,t){if(e.thumbAlignment==="center")return`${t}%`;const n=e.isVertical?Lh(e):Nh(e);return`calc(${t}% - ${n}px)`}function Ws(e){let t=ya(e.value,e.min,e.max)*100;return jh(e,t)}function Gs(e){let t="visible";return e.thumbAlignment==="contain"&&!e.hasMeasuredThumbSize&&(t="hidden"),t}function $h(e,t){const n=e.isVertical?"bottom":"insetInlineStart";return{visibility:Gs(e),position:"absolute",transform:"var(--slider-thumb-transform)",[n]:`var(--slider-thumb-offset-${t})`}}function zh(){return{touchAction:"none",userSelect:"none",WebkitUserSelect:"none",position:"relative"}}function Hh(e){const t=Vh(e);return{...e.value.reduce((n,i,r)=>{const a=Ws({...e,value:i});return{...n,[`--slider-thumb-offset-${r}`]:a}},{}),"--slider-thumb-transform":e.isVertical?"translateY(50%)":e.isRtl?"translateX(50%)":"translateX(-50%)","--slider-range-start":t.start,"--slider-range-end":t.end}}function qh(e,t){return{visibility:Gs(e),position:"absolute",pointerEvents:"none",[e.isHorizontal?"insetInlineStart":"bottom"]:Ws({...e,value:t}),translate:"var(--tx) var(--ty)","--tx":e.isHorizontal?e.isRtl?"50%":"-50%":"0%","--ty":e.isHorizontal?"0%":"50%"}}function Uh(){return{userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none",position:"relative"}}var Wh={getRootStyle:Hh,getControlStyle:zh,getThumbStyle:$h,getRangeStyle:Bh,getMarkerStyle:qh,getMarkerGroupStyle:Uh},H=Rn({...Wh,getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`slider:${e.id}`},getThumbId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.thumb)==null?void 0:i.call(n,t))??`slider:${e.id}:thumb:${t}`},getHiddenInputId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.hiddenInput)==null?void 0:i.call(n,t))??`slider:${e.id}:input:${t}`},getControlId:e=>{var t;return((t=e.ids)==null?void 0:t.control)??`slider:${e.id}:control`},getTrackId:e=>{var t;return((t=e.ids)==null?void 0:t.track)??`slider:${e.id}:track`},getRangeId:e=>{var t;return((t=e.ids)==null?void 0:t.range)??`slider:${e.id}:range`},getLabelId:e=>{var t;return((t=e.ids)==null?void 0:t.label)??`slider:${e.id}:label`},getValueTextId:e=>{var t;return((t=e.ids)==null?void 0:t.valueText)??`slider:${e.id}:value-text`},getMarkerId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.marker)==null?void 0:i.call(n,t))??`slider:${e.id}:marker:${t}`},getRootEl:e=>H.getById(e,H.getRootId(e)),getThumbEl:(e,t)=>H.getById(e,H.getThumbId(e,t)),getHiddenInputEl:(e,t)=>H.getById(e,H.getHiddenInputId(e,t)),getControlEl:e=>H.getById(e,H.getControlId(e)),getElements:e=>_s(H.getControlEl(e),"[role=slider]"),getFirstEl:e=>H.getElements(e)[0],getRangeEl:e=>H.getById(e,H.getRangeId(e)),getValueFromPoint(e,t){const n=H.getControlEl(e);if(!n)return;const i=Fd(t,n).getPercentValue({orientation:e.orientation,dir:e.dir,inverted:{y:!0}});return Hs(i,e.min,e.max,e.step)},dispatchChangeEvent(e){Array.from(e.value).forEach((t,n)=>{const i=H.getHiddenInputEl(e,n);i&&Bd(i,{value:t})})}});function ho(e,t){return t.map((n,i,r)=>Lr({...e,value:r},n,i))}function yt(e,t){return Fh(e.value,e.min,e.max,e.minStepsBetweenThumbs)[t]}function Lr(e,t,n){const i=yt(e,n),r=qs(t,e.min,e.max,e.step);return qi(r,i.min,i.max)}function Gh(e,t,n){const i=t??e.focusedIndex,r=yt(e,i),a=Th(i,{...r,step:n??e.step,values:e.value});return a[i]=qi(a[i],r.min,r.max),a}function Xh(e,t,n){const i=t??e.focusedIndex,r=yt(e,i),a=Sh(i,{...r,step:n??e.step,values:e.value});return a[i]=qi(a[i],r.min,r.max),a}function Yh(e,t){return Ih(e.value,t)}function Kh(e,t){for(let n=0;n<t.length;n++){const i=t[n];e[n]=i}}function Zh(e,t,n){const i=e.context["aria-label"],r=e.context["aria-labelledby"],a=e.context.value,o=e.matches("focus"),s=e.matches("dragging"),l=e.context.isDisabled,u=e.context.invalid,c=e.context.isInteractive,d=e.context.orientation==="horizontal",h=e.context.orientation==="vertical";function p(g){return ya(g,e.context.min,e.context.max)}function f(g){return Hs(g,e.context.min,e.context.max,e.context.step)}return{value:e.context.value,dragging:s,focused:o,setValue(g){t({type:"SET_VALUE",value:g})},getThumbValue(g){return a[g]},setThumbValue(g,m){t({type:"SET_VALUE",index:g,value:m})},getValuePercent:p,getPercentValue:f,getThumbPercent(g){return p(a[g])},setThumbPercent(g,m){const b=f(m);t({type:"SET_VALUE",index:g,value:b})},getThumbMin(g){return yt(e.context,g).min},getThumbMax(g){return yt(e.context,g).max},increment(g){t({type:"INCREMENT",index:g})},decrement(g){t({type:"DECREMENT",index:g})},focus(){c&&t({type:"FOCUS",index:0})},getLabelProps(){return n.label({...et.label.attrs,dir:e.context.dir,"data-disabled":R(l),"data-orientation":e.context.orientation,"data-invalid":R(u),"data-dragging":R(s),"data-focus":R(o),id:H.getLabelId(e.context),htmlFor:H.getHiddenInputId(e.context,0),onClick(g){var m;c&&(g.preventDefault(),(m=H.getFirstEl(e.context))==null||m.focus())},style:{userSelect:"none",WebkitUserSelect:"none"}})},getRootProps(){return n.element({...et.root.attrs,"data-disabled":R(l),"data-orientation":e.context.orientation,"data-dragging":R(s),"data-invalid":R(u),"data-focus":R(o),id:H.getRootId(e.context),dir:e.context.dir,style:H.getRootStyle(e.context)})},getValueTextProps(){return n.element({...et.valueText.attrs,dir:e.context.dir,"data-disabled":R(l),"data-orientation":e.context.orientation,"data-invalid":R(u),"data-focus":R(o),id:H.getValueTextId(e.context)})},getTrackProps(){return n.element({...et.track.attrs,dir:e.context.dir,id:H.getTrackId(e.context),"data-disabled":R(l),"data-invalid":R(u),"data-dragging":R(s),"data-orientation":e.context.orientation,"data-focus":R(o),style:{position:"relative"}})},getThumbProps(g){var m,b;const{index:v=0,name:E}=g,T=a[v],_=yt(e.context,v),S=(b=(m=e.context).getAriaValueText)==null?void 0:b.call(m,{value:T,index:v}),X=Array.isArray(i)?i[v]:i,D=Array.isArray(r)?r[v]:r;return n.element({...et.thumb.attrs,dir:e.context.dir,"data-index":v,"data-name":E,id:H.getThumbId(e.context,v),"data-disabled":R(l),"data-orientation":e.context.orientation,"data-focus":R(o&&e.context.focusedIndex===v),"data-dragging":R(s&&e.context.focusedIndex===v),draggable:!1,"aria-disabled":cc(l),"aria-label":X,"aria-labelledby":D??H.getLabelId(e.context),"aria-orientation":e.context.orientation,"aria-valuemax":_.max,"aria-valuemin":_.min,"aria-valuenow":a[v],"aria-valuetext":S,role:"slider",tabIndex:l?void 0:0,style:H.getThumbStyle(e.context,v),onPointerDown(C){c&&(t({type:"THUMB_POINTER_DOWN",index:v}),C.stopPropagation())},onBlur(){c&&t("BLUR")},onFocus(){c&&t({type:"FOCUS",index:v})},onKeyDown(C){if(C.defaultPrevented||!c)return;const k=Id(C)*e.context.step,y={ArrowUp(){d||t({type:"ARROW_INC",step:k,src:"ArrowUp"})},ArrowDown(){d||t({type:"ARROW_DEC",step:k,src:"ArrowDown"})},ArrowLeft(){h||t({type:"ARROW_DEC",step:k,src:"ArrowLeft"})},ArrowRight(){h||t({type:"ARROW_INC",step:k,src:"ArrowRight"})},PageUp(){t({type:"ARROW_INC",step:k,src:"PageUp"})},PageDown(){t({type:"ARROW_DEC",step:k,src:"PageDown"})},Home(){t("HOME")},End(){t("END")}},x=_d(C,e.context),I=y[x];I&&(I(C),C.preventDefault(),C.stopPropagation())}})},getHiddenInputProps(g){const{index:m=0,name:b}=g;return n.input({name:b??(e.context.name?e.context.name+(e.context.value.length>1?"[]":""):void 0),form:e.context.form,type:"text",hidden:!0,defaultValue:e.context.value[m],id:H.getHiddenInputId(e.context,m)})},getRangeProps(){return n.element({id:H.getRangeId(e.context),...et.range.attrs,dir:e.context.dir,"data-dragging":R(s),"data-focus":R(o),"data-invalid":R(u),"data-disabled":R(l),"data-orientation":e.context.orientation,style:H.getRangeStyle(e.context)})},getControlProps(){return n.element({...et.control.attrs,dir:e.context.dir,id:H.getControlId(e.context),"data-dragging":R(s),"data-disabled":R(l),"data-orientation":e.context.orientation,"data-invalid":R(u),"data-focus":R(o),style:H.getControlStyle(),onPointerDown(g){if(!c||!yd(g)||kd(g))return;const m=fa(g);t({type:"POINTER_DOWN",point:m}),g.preventDefault(),g.stopPropagation()}})},getMarkerGroupProps(){return n.element({...et.markerGroup.attrs,role:"presentation",dir:e.context.dir,"aria-hidden":!0,"data-orientation":e.context.orientation,style:H.getMarkerGroupStyle()})},getMarkerProps(g){const m=H.getMarkerStyle(e.context,g.value);let b;const v=e.context.value[0],E=e.context.value[e.context.value.length-1];return g.value<v?b="under-value":g.value>E?b="over-value":b="at-value",n.element({...et.marker.attrs,id:H.getMarkerId(e.context,g.value),role:"presentation",dir:e.context.dir,"data-orientation":e.context.orientation,"data-value":g.value,"data-disabled":R(l),"data-state":b,style:m})}}}var Qh=(e,t)=>e?.width===t?.width&&e?.height===t?.height;function Jh(e){const t=lt(e);return Mn({id:"slider",initial:"idle",context:{thumbSize:null,thumbAlignment:"contain",min:0,max:100,step:1,value:[0],origin:"start",orientation:"horizontal",dir:"ltr",minStepsBetweenThumbs:0,disabled:!1,readOnly:!1,...t,focusedIndex:-1,fieldsetDisabled:!1},computed:{isHorizontal:n=>n.orientation==="horizontal",isVertical:n=>n.orientation==="vertical",isRtl:n=>n.orientation==="horizontal"&&n.dir==="rtl",isDisabled:n=>!!n.disabled||n.fieldsetDisabled,isInteractive:n=>!(n.readOnly||n.isDisabled),hasMeasuredThumbSize:n=>n.thumbSize!=null,valuePercent(n){return n.value.map(i=>100*ya(i,n.min,n.max))}},watch:{value:["syncInputElements"]},entry:["coarseValue"],activities:["trackFormControlState","trackThumbsSize"],on:{SET_VALUE:[{guard:"hasIndex",actions:"setValueAtIndex"},{actions:"setValue"}],INCREMENT:{actions:"incrementThumbAtIndex"},DECREMENT:{actions:"decrementThumbAtIndex"}},states:{idle:{on:{POINTER_DOWN:{target:"dragging",actions:["setClosestThumbIndex","setPointerValue","focusActiveThumb"]},FOCUS:{target:"focus",actions:"setFocusedIndex"},THUMB_POINTER_DOWN:{target:"dragging",actions:["setFocusedIndex","focusActiveThumb"]}}},focus:{entry:"focusActiveThumb",on:{POINTER_DOWN:{target:"dragging",actions:["setClosestThumbIndex","setPointerValue","focusActiveThumb"]},THUMB_POINTER_DOWN:{target:"dragging",actions:["setFocusedIndex","focusActiveThumb"]},ARROW_DEC:{actions:["decrementThumbAtIndex","invokeOnChangeEnd"]},ARROW_INC:{actions:["incrementThumbAtIndex","invokeOnChangeEnd"]},HOME:{actions:["setFocusedThumbToMin","invokeOnChangeEnd"]},END:{actions:["setFocusedThumbToMax","invokeOnChangeEnd"]},BLUR:{target:"idle",actions:"clearFocusedIndex"}}},dragging:{entry:"focusActiveThumb",activities:"trackPointerMove",on:{POINTER_UP:{target:"focus",actions:"invokeOnChangeEnd"},POINTER_MOVE:{actions:"setPointerValue"}}}}},{guards:{hasIndex:(n,i)=>i.index!=null},activities:{trackFormControlState(n,i,{initialContext:r}){return Ni(H.getRootEl(n),{onFieldsetDisabledChange(a){n.fieldsetDisabled=a},onFormReset(){Pe.value(n,r.value)}})},trackPointerMove(n,i,{send:r}){return Dd(H.getDoc(n),{onPointerMove(a){r({type:"POINTER_MOVE",point:a.point})},onPointerUp(){r("POINTER_UP")}})},trackThumbsSize(n){if(!(n.thumbAlignment!=="contain"||n.thumbSize))return Oh({getNodes:()=>H.getElements(n),observeMutation:!0,callback(i){!i||Qh(n.thumbSize,i)||(n.thumbSize=i)}})}},actions:{syncInputElements(n){n.value.forEach((i,r)=>{const a=H.getHiddenInputEl(n,r);H.setValue(a,i)})},invokeOnChangeEnd(n){ui.valueChangeEnd(n)},setClosestThumbIndex(n,i){const r=H.getValueFromPoint(n,i.point);if(r==null)return;const a=Yh(n,r);Pe.focusedIndex(n,a)},setFocusedIndex(n,i){Pe.focusedIndex(n,i.index)},clearFocusedIndex(n){Pe.focusedIndex(n,-1)},setPointerValue(n,i){const r=H.getValueFromPoint(n,i.point);if(r==null)return;const a=Lr(n,r,n.focusedIndex);Pe.valueAtIndex(n,n.focusedIndex,a)},focusActiveThumb(n){Et(()=>{const i=H.getThumbEl(n,n.focusedIndex);i?.focus({preventScroll:!0})})},decrementThumbAtIndex(n,i){const r=Gh(n,i.index,i.step);Pe.value(n,r)},incrementThumbAtIndex(n,i){const r=Xh(n,i.index,i.step);Pe.value(n,r)},setFocusedThumbToMin(n){const{min:i}=yt(n,n.focusedIndex);Pe.valueAtIndex(n,n.focusedIndex,i)},setFocusedThumbToMax(n){const{max:i}=yt(n,n.focusedIndex);Pe.valueAtIndex(n,n.focusedIndex,i)},coarseValue(n){const i=ho(n,n.value);Pe.value(n,i)},setValueAtIndex(n,i){const r=Lr(n,i.value,i.index);Pe.valueAtIndex(n,i.index,r)},setValue(n,i){const r=ho(n,i.value);Pe.value(n,r)}}})}var ui={valueChange(e){var t;(t=e.onValueChange)==null||t.call(e,{value:Array.from(e.value)}),H.dispatchChangeEvent(e)},valueChangeEnd(e){var t;(t=e.onValueChangeEnd)==null||t.call(e,{value:Array.from(e.value)})},focusChange(e){var t;(t=e.onFocusChange)==null||t.call(e,{value:Array.from(e.value),focusedIndex:e.focusedIndex})}},Pe={valueAtIndex:(e,t,n)=>{vt(e.value[t],n)||(e.value[t]=n,ui.valueChange(e))},value:(e,t)=>{vt(e.value,t)||(Kh(e.value,t),ui.valueChange(e))},focusedIndex:(e,t)=>{vt(e.focusedIndex,t)||(e.focusedIndex=t,ui.focusChange(e))}};qt()(["aria-label","aria-labelledby","dir","disabled","form","getAriaValueText","getRootNode","id","ids","invalid","max","min","minStepsBetweenThumbs","name","onFocusChange","onValueChange","onValueChangeEnd","orientation","origin","readOnly","step","thumbAlignment","thumbAlignment","thumbSize","value"]);qt()(["index","name"]);const ep=["data-value"],Am=oe({__name:"Slider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},marker:{},format:{type:Function,default:()=>e=>e},markerFormat:{},markerHighlight:{type:Boolean,default:!1},getRootNode:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r={id:_t(),...n,value:[n.modelValue],onValueChange:({value:c})=>{i("update:modelValue",c[0])},getRootNode:n.getRootNode},[a,o]=Bn(Jh(r),{context:U(()=>n)}),s=U(()=>Zh(a.value,o,Vn)),l=c=>s.value.setValue([Math.max(n.min||c,Math.min(n.max||c,c))]),u=U(()=>{const c=h=>n.markerFormat?n.markerFormat(h):n.format(h);if(!n.marker)return[];if(n.marker instanceof Array)return n.marker.map(h=>({value:h,label:c(h)}));const d=Math.floor((n.max-n.min)/n.marker)+1;return Array(d).fill(void 0).map((h,p)=>{const f=n.min+n.marker*p;return{value:f,label:c(f)}})});return Ce(()=>n.modelValue,l,{deep:!0}),(c,d)=>(A(),P("div",te(s.value.getRootProps(),{class:["k-slider",{"k-slider--marker-highlight":c.markerHighlight}]}),[ee("div",ye(Ie(s.value.getControlProps())),[ee("div",ye(Ie(s.value.getTrackProps())),[ee("div",ye(Ie(s.value.getRangeProps())),null,16)],16),ee("div",ye(Ie(s.value.getThumbProps({index:0}))),[ee("input",ye(Ie(s.value.getHiddenInputProps({index:0}))),null,16)],16),ee("output",ye(Ie(s.value.getValueTextProps())),[z(c.$slots,"value",{value:s.value.value},()=>[$e(de(c.format(s.value.value.at(0))),1)])],16)],16),u.value.length?(A(),P("div",ye(te({key:0},s.value.getMarkerGroupProps())),[(A(!0),P(rt,null,nn(u.value,h=>(A(),P("span",te({ref_for:!0},s.value.getMarkerProps({value:h.value}),{"data-value":h.label}),null,16,ep))),256))],16)):W("",!0)],16))}}),Nr=Math.min,rn=Math.max,ki=Math.round,Gn=Math.floor,wt=e=>({x:e,y:e}),tp={left:"right",right:"left",bottom:"top",top:"bottom"},np={start:"end",end:"start"};function xa(e,t){return typeof e=="function"?e(t):e}function sn(e){return e.split("-")[0]}function Ui(e){return e.split("-")[1]}function ip(e){return e==="x"?"y":"x"}function Xs(e){return e==="y"?"height":"width"}function On(e){return["top","bottom"].includes(sn(e))?"y":"x"}function Ys(e){return ip(On(e))}function rp(e,t,n){n===void 0&&(n=!1);const i=Ui(e),r=Ys(e),a=Xs(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Ei(o)),[o,Ei(o)]}function ap(e){const t=Ei(e);return[jr(e),t,jr(t)]}function jr(e){return e.replace(/start|end/g,t=>np[t])}function op(e,t,n){const i=["left","right"],r=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:i:t?i:r;case"left":case"right":return t?a:o;default:return[]}}function sp(e,t,n,i){const r=Ui(e);let a=op(sn(e),n==="start",i);return r&&(a=a.map(o=>o+"-"+r),t&&(a=a.concat(a.map(jr)))),a}function Ei(e){return e.replace(/left|right|bottom|top/g,t=>tp[t])}function lp(e){return{top:0,right:0,bottom:0,left:0,...e}}function up(e){return typeof e!="number"?lp(e):{top:e,right:e,bottom:e,left:e}}function _i(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function po(e,t,n){let{reference:i,floating:r}=e;const a=On(t),o=Ys(t),s=Xs(o),l=sn(t),u=a==="y",c=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let p;switch(l){case"top":p={x:c,y:i.y-r.height};break;case"bottom":p={x:c,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-r.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Ui(t)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const cp=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:d}=po(u,i,l),h=i,p={},f=0;for(let g=0;g<s.length;g++){const{name:m,fn:b}=s[g],{x:v,y:E,data:T,reset:_}=await b({x:c,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=E??d,p={...p,[m]:{...p[m],...T}},_&&f<=50&&(f++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(u=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:c,y:d}=po(u,h,l)),g=-1)}return{x:c,y:d,placement:h,strategy:r,middlewareData:p}};async function dp(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=xa(t,e),f=up(p),g=s[h?d==="floating"?"reference":"floating":d],m=_i(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(v))?await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1}:{x:1,y:1},T=_i(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:l}):b);return{top:(m.top-T.top+f.top)/E.y,bottom:(T.bottom-m.bottom+f.bottom)/E.y,left:(m.left-T.left+f.left)/E.x,right:(T.right-m.right+f.right)/E.x}}const hp=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:r,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=xa(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=sn(r),v=On(s),E=sn(s)===s,T=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(E||!g?[Ei(s)]:ap(s)),S=f!=="none";!h&&S&&_.push(...sp(s,g,f,T));const X=[s,..._],D=await dp(t,m),C=[];let k=((i=a.flip)==null?void 0:i.overflows)||[];if(c&&C.push(D[b]),d){const B=rp(r,o,T);C.push(D[B[0]],D[B[1]])}if(k=[...k,{placement:r,overflows:C}],!C.every(B=>B<=0)){var y,x;const B=(((y=a.flip)==null?void 0:y.index)||0)+1,L=X[B];if(L)return{data:{index:B,overflows:k},reset:{placement:L}};let N=(x=k.filter(Z=>Z.overflows[0]<=0).sort((Z,ie)=>Z.overflows[1]-ie.overflows[1])[0])==null?void 0:x.placement;if(!N)switch(p){case"bestFit":{var I;const Z=(I=k.filter(ie=>{if(S){const Q=On(ie.placement);return Q===v||Q==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(Q=>Q>0).reduce((Q,qe)=>Q+qe,0)]).sort((ie,Q)=>ie[1]-Q[1])[0])==null?void 0:I[0];Z&&(N=Z);break}case"initialPlacement":N=s;break}if(r!==N)return{reset:{placement:N}}}return{}}}};async function pp(e,t){const{placement:n,platform:i,elements:r}=e,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=sn(n),s=Ui(n),l=On(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=xa(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof f=="number"&&(p=s==="end"?f*-1:f),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const fp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:a,placement:o,middlewareData:s}=t,l=await pp(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:o}}}}};function Wi(){return typeof window<"u"}function cn(e){return Ks(e)?(e.nodeName||"").toLowerCase():"#document"}function De(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(Ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ks(e){return Wi()?e instanceof Node||e instanceof De(e).Node:!1}function ze(e){return Wi()?e instanceof Element||e instanceof De(e).Element:!1}function Ye(e){return Wi()?e instanceof HTMLElement||e instanceof De(e).HTMLElement:!1}function fo(e){return!Wi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof De(e).ShadowRoot}function Ln(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function gp(e){return["table","td","th"].includes(cn(e))}function Gi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ka(e){const t=Ea(),n=ze(e)?He(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function mp(e){let t=Ct(e);for(;Ye(t)&&!ln(t);){if(ka(t))return t;if(Gi(t))return null;t=Ct(t)}return null}function Ea(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ln(e){return["html","body","#document"].includes(cn(e))}function He(e){return De(e).getComputedStyle(e)}function Xi(e){return ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fo(e)&&e.host||Qe(e);return fo(t)?t.host:t}function Zs(e){const t=Ct(e);return ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Ln(t)?t:Zs(t)}function Pn(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Zs(e),a=r===((i=e.ownerDocument)==null?void 0:i.body),o=De(r);if(a){const s=$r(o);return t.concat(o,o.visualViewport||[],Ln(r)?r:[],s&&n?Pn(s):[])}return t.concat(r,Pn(r,[],n))}function $r(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qs(e){const t=He(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Ye(e),a=r?e.offsetWidth:n,o=r?e.offsetHeight:i,s=ki(n)!==a||ki(i)!==o;return s&&(n=a,i=o),{width:n,height:i,$:s}}function _a(e){return ze(e)?e:e.contextElement}function an(e){const t=_a(e);if(!Ye(t))return wt(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:a}=Qs(t);let o=(a?ki(n.width):n.width)/i,s=(a?ki(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const vp=wt(0);function Js(e){const t=De(e);return!Ea()||!t.visualViewport?vp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==De(e)?!1:t}function $t(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=_a(e);let o=wt(1);t&&(i?ze(i)&&(o=an(i)):o=an(e));const s=bp(a,n,i)?Js(a):wt(0);let l=(r.left+s.x)/o.x,u=(r.top+s.y)/o.y,c=r.width/o.x,d=r.height/o.y;if(a){const h=De(a),p=i&&ze(i)?De(i):i;let f=h,g=$r(f);for(;g&&i&&p!==f;){const m=an(g),b=g.getBoundingClientRect(),v=He(g),E=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,T=b.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=E,u+=T,f=De(g),g=$r(f)}}return _i({width:c,height:d,x:l,y:u})}function yp(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const a=r==="fixed",o=Qe(i),s=t?Gi(t.floating):!1;if(i===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=wt(1);const c=wt(0),d=Ye(i);if((d||!d&&!a)&&((cn(i)!=="body"||Ln(o))&&(l=Xi(i)),Ye(i))){const h=$t(i);u=an(i),c.x=h.x+i.clientLeft,c.y=h.y+i.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function xp(e){return Array.from(e.getClientRects())}function zr(e,t){const n=Xi(e).scrollLeft;return t?t.left+n:$t(Qe(e)).left+n}function kp(e){const t=Qe(e),n=Xi(e),i=e.ownerDocument.body,r=rn(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),a=rn(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+zr(e);const s=-n.scrollTop;return He(i).direction==="rtl"&&(o+=rn(t.clientWidth,i.clientWidth)-r),{width:r,height:a,x:o,y:s}}function Ep(e,t){const n=De(e),i=Qe(e),r=n.visualViewport;let a=i.clientWidth,o=i.clientHeight,s=0,l=0;if(r){a=r.width,o=r.height;const u=Ea();(!u||u&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:a,height:o,x:s,y:l}}function _p(e,t){const n=$t(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,a=Ye(e)?an(e):wt(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=r*a.x,u=i*a.y;return{width:o,height:s,x:l,y:u}}function go(e,t,n){let i;if(t==="viewport")i=Ep(e,n);else if(t==="document")i=kp(Qe(e));else if(ze(t))i=_p(t,n);else{const r=Js(e);i={...t,x:t.x-r.x,y:t.y-r.y}}return _i(i)}function el(e,t){const n=Ct(e);return n===t||!ze(n)||ln(n)?!1:He(n).position==="fixed"||el(n,t)}function wp(e,t){const n=t.get(e);if(n)return n;let i=Pn(e,[],!1).filter(s=>ze(s)&&cn(s)!=="body"),r=null;const a=He(e).position==="fixed";let o=a?Ct(e):e;for(;ze(o)&&!ln(o);){const s=He(o),l=ka(o);!l&&s.position==="fixed"&&(r=null),(a?!l&&!r:!l&&s.position==="static"&&r&&["absolute","fixed"].includes(r.position)||Ln(o)&&!l&&el(e,o))?i=i.filter(u=>u!==o):r=s,o=Ct(o)}return t.set(e,i),i}function Cp(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?Gi(t)?[]:wp(t,this._c):[].concat(n),i],o=a[0],s=a.reduce((l,u)=>{const c=go(t,u,r);return l.top=rn(c.top,l.top),l.right=Nr(c.right,l.right),l.bottom=Nr(c.bottom,l.bottom),l.left=rn(c.left,l.left),l},go(t,o,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ap(e){const{width:t,height:n}=Qs(e);return{width:t,height:n}}function Sp(e,t,n){const i=Ye(t),r=Qe(t),a=n==="fixed",o=$t(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=wt(0);if(i||!i&&!a)if((cn(t)!=="body"||Ln(r))&&(s=Xi(t)),i){const p=$t(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else r&&(l.x=zr(r));let u=0,c=0;if(r&&!i&&!a){const p=r.getBoundingClientRect();c=p.top+s.scrollTop,u=p.left+s.scrollLeft-zr(r,p)}const d=o.left+s.scrollLeft-l.x-u,h=o.top+s.scrollTop-l.y-c;return{x:d,y:h,width:o.width,height:o.height}}function sr(e){return He(e).position==="static"}function mo(e,t){if(!Ye(e)||He(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function tl(e,t){const n=De(e);if(Gi(e))return n;if(!Ye(e)){let r=Ct(e);for(;r&&!ln(r);){if(ze(r)&&!sr(r))return r;r=Ct(r)}return n}let i=mo(e,t);for(;i&&gp(i)&&sr(i);)i=mo(i,t);return i&&ln(i)&&sr(i)&&!ka(i)?n:i||mp(e)||n}const Tp=async function(e){const t=this.getOffsetParent||tl,n=this.getDimensions,i=await n(e.floating);return{reference:Sp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ip(e){return He(e).direction==="rtl"}const Hr={convertOffsetParentRelativeRectToViewportRelativeRect:yp,getDocumentElement:Qe,getClippingRect:Cp,getOffsetParent:tl,getElementRects:Tp,getClientRects:xp,getDimensions:Ap,getScale:an,isElement:ze,isRTL:Ip};function Fp(e,t){let n=null,i;const r=Qe(e);function a(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const p=Gn(c),f=Gn(r.clientWidth-(u+d)),g=Gn(r.clientHeight-(c+h)),m=Gn(u),b={rootMargin:-p+"px "+-f+"px "+-g+"px "+-m+"px",threshold:rn(0,Nr(1,l))||1};let v=!0;function E(T){const _=T[0].intersectionRatio;if(_!==l){if(!v)return o();_?o(!1,_):i=setTimeout(()=>{o(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(E,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return o(!0),a}function Dp(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=_a(e),c=r||a?[...u?Pn(u):[],...Pn(t)]:[];c.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&s?Fp(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let f,g=l?$t(e):null;l&&m();function m(){const b=$t(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&n(),g=b,f=requestAnimationFrame(m)}return n(),()=>{var b;c.forEach(v=>{r&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Op=fp,Pp=hp,Rp=(e,t,n)=>{const i=new Map,r={platform:Hr,...n},a={...r.platform,_c:i};return cp(e,t,{...r,platform:a})};function Mp(e,t){let n,i,r;const a=ne(!0),o=()=>{a.value=!0,r()};Ce(e,o,{flush:"sync"});const s=typeof t=="function"?t:t.get,l=typeof t=="function"?void 0:t.set,u=Ul((c,d)=>(i=c,r=d,{get(){return a.value&&(n=s(),a.value=!1),i(),n},set(h){l?.(h)}}));return Object.isExtensible(u)&&(u.trigger=o),u}function nl(e){return Gl()?(Xl(e),!0):!1}function wa(e){return typeof e=="function"?e():re(e)}const Vp=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Bp=e=>e!=null,Lp=Object.prototype.toString,Np=e=>Lp.call(e)==="[object Object]",jp=()=>{};function il(e){var t;const n=wa(e);return(t=n?.$el)!=null?t:n}const rl=Vp?window:void 0;function $p(...e){let t,n,i,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,i,r]=e,t=rl):[t,n,i,r]=e,!t)return jp;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const a=[],o=()=>{a.forEach(c=>c()),a.length=0},s=(c,d,h,p)=>(c.addEventListener(d,h,p),()=>c.removeEventListener(d,h,p)),l=Ce(()=>[il(t),wa(r)],([c,d])=>{if(o(),!c)return;const h=Np(d)?{...d}:d;a.push(...n.flatMap(p=>i.map(f=>s(c,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return nl(u),u}function zp(){const e=ne(!1),t=Zo();return t&&At(()=>{e.value=!0},t),e}function Hp(e){const t=zp();return U(()=>(t.value,!!e()))}function qp(e,t,n={}){const{window:i=rl,...r}=n;let a;const o=Hp(()=>i&&"MutationObserver"in i),s=()=>{a&&(a.disconnect(),a=void 0)},l=U(()=>{const h=wa(e),p=(Array.isArray(h)?h:[h]).map(il).filter(Bp);return new Set(p)}),u=Ce(()=>l.value,h=>{s(),o.value&&h.size&&(a=new MutationObserver(t),h.forEach(p=>a.observe(p,r)))},{immediate:!0,flush:"post"}),c=()=>a?.takeRecords(),d=()=>{s(),u()};return nl(d),{isSupported:o,stop:d,takeRecords:c}}function al(e){const t=Zo(),n=Mp(()=>null,()=>t.proxy.$el);return Hl(n.trigger),At(n.trigger),n}function Up(e){return Wp(e)}function lr(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function Wp(e){for(let t=e;t;t=lr(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=lr(e);t;t=lr(t)){if(!(t instanceof Element))continue;const n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||t.tagName==="BODY"))return t}return null}const Gp=oe({inheritAttrs:!1,__name:"Dropdown",props:{items:{},placement:{default:"bottom-start"},teleport:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},theme:{default:"border"},teleportTo:{default:"body"},offset:{default:8},variant:{},size:{},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{},stateTimeout:{},confirmLabel:{},label:{},icon:{},iconLeft:{},iconRight:{default:"fa-pro-regular:angle-down"}},setup(e,{expose:t}){const n=e,i=U(()=>{const{items:v,placement:E,teleport:T,keepOpen:_,...S}=n;return S}),r=ne(!1),a=al(),o=ne(),s=ne(),l=ne({top:"",left:"",position:""});let u=()=>{};function c(){!o.value||!s.value||(u=Dp(o.value.$el,s.value,()=>{!o.value||!s.value||Rp(o.value.$el,s.value,{placement:n.placement,middleware:[Op(n.offset),Pp()],platform:{...Hr,getOffsetParent:v=>Hr.getOffsetParent(v,Up)}}).then(({x:v,y:E})=>{l.value={top:`${E}px`,left:`${v}px`,position:"absolute"}})}))}Qr(u),Ko(()=>{if(r.value)return c();u()});const d=({target:v},E="dom")=>{if(v instanceof Element&&!(!o.value||!s.value)){if(E==="dom")return[o.value.$el,s.value].some(T=>T&&(v===T||T.contains(v)))?void 0:p(!1);if(E==="shadow-dom"){const T=a.value.getRootNode();return v.shadowRoot===T?void 0:p(!1)}}},h=({key:v})=>v==="Escape"&&p(!1),p=(v=!r.value)=>(v?m():b(),r.value=v,!0),f=U(()=>a.value.getRootNode()),g=U(()=>f.value instanceof ShadowRoot);function m(){window.addEventListener("keydown",h),g.value?(f.value.addEventListener("click",v=>d(v)),window.addEventListener("click",v=>d(v,"shadow-dom"))):window.addEventListener("click",d)}function b(){window.removeEventListener("keydown",h),g.value?(f.value.removeEventListener("click",v=>d(v)),window.removeEventListener("click",v=>d(v,"shadow-dom"))):window.removeEventListener("click",d)}return t({isOpen:r}),(v,E)=>(A(),P(rt,null,[Ne(Nt,te({...i.value,...v.$attrs},{onClick:E[0]||(E[0]=Uo(()=>p(),["stop"])),ref_key:"trigger",ref:o,class:["k-dropdown-trigger",{"k-dropdown-trigger--open":!!r.value}]}),Go({_:2},[v.$slots["icon-left"]?{name:"icon-left",fn:ve(()=>[z(v.$slots,"icon-left")]),key:"0"}:void 0,v.$slots.trigger?{name:"default",fn:ve(()=>[z(v.$slots,"trigger")]),key:"1"}:void 0,v.$slots["icon-right"]?{name:"icon-right",fn:ve(()=>[z(v.$slots,"icon-right")]),key:"2"}:void 0]),1040,["class"]),(A(),ue(Xo,{to:v.teleportTo,disabled:!v.teleport},[Ne(Wo,{name:"k-dropdown"},{default:ve(()=>[r.value?(A(),P("div",{key:0,class:Oe(`k-dropdown k-dropdown--theme-${v.theme}`),style:St(l.value),ref_key:"content",ref:s,onClick:E[1]||(E[1]=()=>!v.keepOpen&&p(!1))},[z(v.$slots,"default",{close:p.bind(null,!1)},()=>[(A(!0),P(rt,null,nn(v.items,({action:T,icon:_,...S})=>(A(),ue(Nt,te({ref_for:!0},S,{variant:"tertiary","icon-right":S.iconRight||_,onClick:()=>T()}),null,16,["icon-right","onClick"]))),256))])],6)):W("",!0)]),_:3})],8,["to","disabled"]))],64))}}),Xp={key:0,class:"k-datatable__row"},Yp={key:0,class:"k-datatable__cell k-datatable__cell-select"},Kp=["data-col-id","onClick"],Zp=["innerHTML"],Qp={key:1,class:"k-datatable__cell k-datatable__cell-actions"},Jp={key:0,class:"k-datatable__cell k-datatable__cell-select"},ef={key:1,class:"k-datatable__cell k-datatable__cell-actions"},tf={key:0,class:"k-datatable__footer"},Sm=oe({__name:"DataTable",props:{items:{},selected:{},theme:{default:"default"},header:{type:Boolean,default:!0},sticky:{type:[Boolean,String]},sortBy:{},sortableBy:{default:()=>[]},isDisabled:{type:Function,default:()=>!1},columns:{},labels:{default:()=>({selection:"Valgt",resetSelection:"Tilbakestill valg"})},cellWrapper:{type:Function,default:()=>({component:"div"})},rowWrapper:{type:Function,default:()=>({component:"div"})}},emits:["update:selected","update:sortBy"],setup(e,{emit:t}){const n=e,i=Ll(),r=t,a=ne([-1]),o=U(()=>n.items.filter(f=>!n.isDisabled(f))),s=U(()=>!!n.selected),l=U(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=U(()=>!!i.rowActions),c=U({get:()=>!!(o.value.length&&o.value.every(f=>n.selected&&n.selected.includes(f))),set:f=>r("update:selected",f?[...o.value]:[])}),d=U(()=>[s.value?"2.5rem":!1,...n.columns.filter(({disabled:f})=>!f).map(f=>f.size||"auto"),u.value?"0px":!1].filter(Boolean).join(" "));function h(f){var g;if(!l.value||!n.sortableBy.includes(f))return;let m=((g=n.sortBy)==null?void 0:g[f])||-1;r("update:sortBy",{[f]:m*-1})}function p(f,g){if(!f.isTrusted||!(f.target instanceof HTMLInputElement))return;let m=a.value.slice(-1).pop()||-1,b=[];if(f.shiftKey){let v=m>g,E=m+(v?-1:1);for(;v?E>g:E<g;){let T=n.items[E];!(n.selected||[]).includes(T)&&!n.isDisabled(T)&&b.push(T),v?E--:E++}}f.target.checked?a.value.push(g):m===g&&a.value.pop(),r("update:selected",[...n.selected||[],...b])}return(f,g)=>(A(),P("div",{class:Oe([`k-datatable k-datatable--${f.theme}`,{"k-datatable--sticky":!!f.sticky,"k-datatable--no-header":!f.header}]),style:St(`--k-datatable-layout: ${d.value}; --k-datatable-sticky-top: ${typeof f.sticky=="string"?f.sticky:"0"}`)},[f.header?(A(),P("div",Xp,[s.value?(A(),P("div",Yp,[Ne(lo,{class:"k-datatable__checkbox",modelValue:c.value,"onUpdate:modelValue":g[0]||(g[0]=m=>c.value=m),disabled:!f.items.length},null,8,["modelValue","disabled"])])):W("",!0),(A(!0),P(rt,null,nn(f.columns.filter(({disabled:m})=>!m),m=>(A(),P("div",{class:Oe(["k-datatable__cell",`k-datatable__cell--text-align-${m.align||"start"}`,{"k-datatable__cell-sort":l.value&&f.sortableBy.includes(m.id),"k-datatable__cell-sort--active":m.id in(f.sortBy||{})}]),key:m.id,"data-col-id":m.id,onClick:b=>h(m.id)},[z(f.$slots,`${m.id}-label`,{item:m},()=>[ee("span",{innerHTML:m.label},null,8,Zp)]),Ne(re(Bt),{class:"k-datatable__cell-sort-icon",icon:(f.sortBy||{})[m.id]<0?"fa-pro-solid:caret-up":"fa-pro-solid:caret-down"},null,8,["icon"])],10,Kp))),128)),u.value?(A(),P("div",Qp)):W("",!0)])):W("",!0),(A(!0),P(rt,null,nn(f.items,(m,b)=>(A(),P("div",{class:"k-datatable__row",key:b},[s.value?(A(),P("div",Jp,[Ne(lo,{class:"k-datatable__checkbox","model-value":f.selected||[],"onUpdate:modelValue":g[1]||(g[1]=v=>r("update:selected",v)),value:m,onMousedown:g[2]||(g[2]=Uo(()=>{},["prevent"])),onClick:v=>p(v,b),disabled:f.isDisabled(m)},null,8,["model-value","value","onClick","disabled"])])):W("",!0),(A(),ue(kt(f.rowWrapper(m).component),te({class:"k-datatable__row-wrapper",ref_for:!0},f.rowWrapper(m).bind,Nl(f.rowWrapper(m).listeners)),{default:ve(()=>[(A(!0),P(rt,null,nn(f.columns.filter(({disabled:v})=>!v),(v,E)=>(A(),ue(kt(f.cellWrapper(m,v).component),te({ref_for:!0},f.cellWrapper(m,v).bind,{class:`k-datatable__cell k-datatable__cell--text-align-${v.align||"start"}`,key:`col-${v.id}`,"data-cell-id":v.id}),{default:ve(()=>[z(f.$slots,v.id,{item:m,column:v,rowIndex:b,colIndex:E})]),_:2},1040,["class","data-cell-id"]))),128))]),_:2},1040)),f.$slots["row-actions"]?(A(),P("div",ef,[z(f.$slots,"row-actions",{item:m})])):W("",!0)]))),128)),Ne(Wo,{name:"k-datatable-footer"},{default:ve(()=>{var m,b;return[f.$slots.footer||(m=f.selected)!=null&&m.length?(A(),P("div",tf,[(b=f.selected)!=null&&b.length?(A(),ue(Gp,{key:0,label:`${f.labels.selection} (${f.selected.length})`,teleport:""},{default:ve(()=>[z(f.$slots,"select-actions"),Ne(Nt,{label:f.labels.resetSelection,"icon-right":"fa-pro-light:times-square",variant:"tertiary",onClick:g[3]||(g[3]=v=>r("update:selected",[]))},null,8,["label"])]),_:3},8,["label"])):W("",!0),z(f.$slots,"footer")])):W("",!0)]}),_:3})],6))}});var qr,Dt=new Map,nf=e=>e.getBoundingClientRect();function rf(e,t){const{scope:n="rect",getRect:i=nf,onChange:r}=t,a=af({scope:n,getRect:i}),o=Dt.get(e);return o?(o.callbacks.push(r),r(i(e))):(Dt.set(e,{rect:{},callbacks:[r]}),Dt.size===1&&(qr=requestAnimationFrame(a))),function(){const s=Dt.get(e);if(!s)return;const l=s.callbacks.indexOf(r);l>-1&&s.callbacks.splice(l,1),s.callbacks.length===0&&(Dt.delete(e),Dt.size===0&&cancelAnimationFrame(qr))}}function af(e){const{scope:t,getRect:n}=e,i=sf(t);return function r(){const a=[];Dt.forEach((o,s)=>{const l=n(s);i(o.rect,l)||(o.rect=l,a.push(o))}),a.forEach(o=>{o.callbacks.forEach(s=>s(o.rect))}),qr=requestAnimationFrame(r)}}var ol=(e,t)=>e.width===t.width&&e.height===t.height,sl=(e,t)=>e.top===t.top&&e.left===t.left,of=(e,t)=>ol(e,t)&&sl(e,t);function sf(e){return e==="size"?ol:e==="position"?sl:of}var lf=mt("radio-group").parts("root","label","item","itemText","itemControl","indicator"),Gt=lf.build(),Y=Rn({getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`radio-group:${e.id}`},getLabelId:e=>{var t;return((t=e.ids)==null?void 0:t.label)??`radio-group:${e.id}:label`},getItemId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.item)==null?void 0:i.call(n,t))??`radio-group:${e.id}:radio:${t}`},getItemHiddenInputId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.itemHiddenInput)==null?void 0:i.call(n,t))??`radio-group:${e.id}:radio:input:${t}`},getItemControlId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.itemControl)==null?void 0:i.call(n,t))??`radio-group:${e.id}:radio:control:${t}`},getItemLabelId:(e,t)=>{var n,i;return((i=(n=e.ids)==null?void 0:n.itemLabel)==null?void 0:i.call(n,t))??`radio-group:${e.id}:radio:label:${t}`},getIndicatorId:e=>{var t;return((t=e.ids)==null?void 0:t.indicator)??`radio-group:${e.id}:indicator`},getRootEl:e=>Y.getById(e,Y.getRootId(e)),getItemHiddenInputEl:(e,t)=>Y.getById(e,Y.getItemHiddenInputId(e,t)),getIndicatorEl:e=>Y.getById(e,Y.getIndicatorId(e)),getFirstEnabledInputEl:e=>{var t;return(t=Y.getRootEl(e))==null?void 0:t.querySelector("input:not(:disabled)")},getFirstEnabledAndCheckedInputEl:e=>{var t;return(t=Y.getRootEl(e))==null?void 0:t.querySelector("input:not(:disabled):checked")},getInputEls:e=>{const t=`input[type=radio][data-ownedby='${CSS.escape(Y.getRootId(e))}']:not([disabled])`;return _s(Y.getRootEl(e),t)},getActiveRadioEl:e=>{if(e.value)return Y.getById(e,Y.getItemId(e,e.value))},getOffsetRect:e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),getRectById:(e,t)=>{const n=Y.getById(e,Y.getItemId(e,t));if(n)return Y.resolveRect(Y.getOffsetRect(n))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function uf(e,t,n){const i=e.context.isDisabled,r=e.context.readOnly;function a(l){return{invalid:!!l.invalid,disabled:!!l.disabled||i,checked:e.context.value===l.value,focused:e.context.focusedValue===l.value,hovered:e.context.hoveredValue===l.value,active:e.context.activeValue===l.value}}function o(l){const u=a(l);return{"data-focus":R(u.focused),"data-focus-visible":R(u.focused&&e.context.focusVisible),"data-disabled":R(u.disabled),"data-readonly":R(r),"data-state":u.checked?"checked":"unchecked","data-hover":R(u.hovered),"data-invalid":R(u.invalid),"data-orientation":e.context.orientation,"data-ssr":R(e.context.ssr)}}const s=()=>{const l=Y.getFirstEnabledAndCheckedInputEl(e.context);if(l){l.focus();return}const u=Y.getFirstEnabledInputEl(e.context);u?.focus()};return{focus:s,value:e.context.value,setValue(l){t({type:"SET_VALUE",value:l,isTrusted:!1})},clearValue(){t({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return n.element({...Gt.root.attrs,role:"radiogroup",id:Y.getRootId(e.context),"aria-labelledby":Y.getLabelId(e.context),"data-orientation":e.context.orientation,"data-disabled":R(i),"aria-orientation":e.context.orientation,dir:e.context.dir,style:{position:"relative"}})},getLabelProps(){return n.element({...Gt.label.attrs,dir:e.context.dir,"data-orientation":e.context.orientation,"data-disabled":R(i),id:Y.getLabelId(e.context),onClick:s})},getItemState:a,getItemProps(l){const u=a(l);return n.label({...Gt.item.attrs,dir:e.context.dir,id:Y.getItemId(e.context,l.value),htmlFor:Y.getItemHiddenInputId(e.context,l.value),...o(l),onPointerMove(){u.disabled||u.hovered||t({type:"SET_HOVERED",value:l.value,hovered:!0})},onPointerLeave(){u.disabled||t({type:"SET_HOVERED",value:null})},onPointerDown(c){u.disabled||(u.focused&&c.pointerType==="mouse"&&c.preventDefault(),t({type:"SET_ACTIVE",value:l.value,active:!0}))},onPointerUp(){u.disabled||t({type:"SET_ACTIVE",value:null})}})},getItemTextProps(l){return n.element({...Gt.itemText.attrs,dir:e.context.dir,id:Y.getItemLabelId(e.context,l.value),...o(l)})},getItemControlProps(l){const u=a(l);return n.element({...Gt.itemControl.attrs,dir:e.context.dir,id:Y.getItemControlId(e.context,l.value),"data-active":R(u.active),"aria-hidden":!0,...o(l)})},getItemHiddenInputProps(l){const u=a(l);return n.input({"data-ownedby":Y.getRootId(e.context),id:Y.getItemHiddenInputId(e.context,l.value),type:"radio",name:e.context.name||e.context.id,form:e.context.form,value:l.value,onClick(c){if(r){c.preventDefault();return}c.currentTarget.checked&&t({type:"SET_VALUE",value:l.value,isTrusted:!0})},onBlur(){t({type:"SET_FOCUSED",value:null,focused:!1,focusVisible:!1})},onFocus(){const c=In();t({type:"SET_FOCUSED",value:l.value,focused:!0,focusVisible:c})},onKeyDown(c){c.defaultPrevented||c.key===" "&&t({type:"SET_ACTIVE",value:l.value,active:!0})},onKeyUp(c){c.defaultPrevented||c.key===" "&&t({type:"SET_ACTIVE",value:null})},disabled:u.disabled,defaultChecked:u.checked,style:ua})},getIndicatorProps(){var l,u,c,d;return n.element({id:Y.getIndicatorId(e.context),...Gt.indicator.attrs,dir:e.context.dir,hidden:e.context.value==null,"data-disabled":R(i),"data-orientation":e.context.orientation,style:{"--transition-property":"left, top, width, height","--left":(l=e.context.indicatorRect)==null?void 0:l.left,"--top":(u=e.context.indicatorRect)==null?void 0:u.top,"--width":(c=e.context.indicatorRect)==null?void 0:c.width,"--height":(d=e.context.indicatorRect)==null?void 0:d.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:e.context.canIndicatorTransition?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[e.context.orientation==="horizontal"?"left":"top"]:e.context.orientation==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:cf}=pa;function df(e){const t=lt(e);return Mn({id:"radio",initial:"idle",context:{value:null,activeValue:null,focusedValue:null,hoveredValue:null,disabled:!1,orientation:"vertical",...t,indicatorRect:{},canIndicatorTransition:!1,fieldsetDisabled:!1,focusVisible:!1,ssr:!0},computed:{isDisabled:n=>!!n.disabled||n.fieldsetDisabled},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],activities:["trackFormControlState","trackFocusVisible"],watch:{value:["setIndicatorTransition","syncIndicatorRect","syncInputElements"]},on:{SET_VALUE:[{guard:cf("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:"setHovered"},SET_ACTIVE:{actions:"setActive"},SET_FOCUSED:{actions:"setFocused"}},states:{idle:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:r,initialContext:a}){return Ni(Y.getRootEl(n),{onFieldsetDisabledChange(o){n.fieldsetDisabled=o},onFormReset(){r({type:"SET_VALUE",value:a.value})}})},trackFocusVisible(n){return ca({root:Y.getRootNode(n)})}},actions:{setValue(n,i){pf.value(n,i.value)},setHovered(n,i){n.hoveredValue=i.value},setActive(n,i){n.activeValue=i.value},setFocused(n,i){n.focusedValue=i.value,n.focusVisible=i.focusVisible},syncInputElements(n){Y.getInputEls(n).forEach(i=>{i.checked=i.value===n.value})},setIndicatorTransition(n){n.canIndicatorTransition=je(n.value)},cleanupObserver(n){var i;(i=n.indicatorCleanup)==null||i.call(n)},syncSsr(n){n.ssr=!1},syncIndicatorRect(n){var i;if((i=n.indicatorCleanup)==null||i.call(n),!Y.getIndicatorEl(n))return;const r=n.value,a=Y.getActiveRadioEl(n);if(r==null||!a){n.indicatorRect={};return}n.indicatorCleanup=rf(a,{getRect(o){return Y.getOffsetRect(o)},onChange(o){n.indicatorRect=Y.resolveRect(o),la(()=>{n.canIndicatorTransition=!1})}})},dispatchChangeEvent(n){Y.getInputEls(n).forEach(i=>{const r=i.value===n.value;r!==i.checked&&ma(i,{checked:r})})}}})}var hf={change:e=>{var t;e.value!=null&&((t=e.onValueChange)==null||t.call(e,{value:e.value}))}},pf={value:(e,t)=>{vt(e.value,t)||(e.value=t,hf.change(e))}};qt()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value"]);qt()(["value","disabled","invalid"]);const ff=["aria-describedby"],Tm=oe({__name:"RadioGroup",props:{label:{},modelValue:{},items:{},variant:{default:"radio"},direction:{default:"vertical"},disabled:{type:Boolean},getRootNode:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=qo(va,U(()=>({label:""}))),i=e,r=t,a={id:_t(),name:_t(),...i,value:i.modelValue,onValueChange:({value:u})=>r("update:modelValue",u),getRootNode:i.getRootNode},[o,s]=Bn(df(a),{context:U(()=>i)}),l=U(()=>uf(o.value,s,Vn));return Ce(()=>i.modelValue,u=>l.value.setValue(u)),(u,c)=>(A(),P("div",te({class:["k-radiogroup",`k-radiogroup--variant-${u.variant} k-radiogroup--direction-${u.direction}`]},l.value.getRootProps(),{"aria-describedby":re(n).helpId}),[u.variant==="radio"&&(re(n).label||u.label)?(A(),P("span",ye(te({key:0},l.value.getLabelProps())),de(re(n).label||u.label),17)):W("",!0),u.variant==="segment"?(A(),P("div",ye(te({key:1},l.value.getIndicatorProps())),null,16)):W("",!0),(A(!0),P(rt,null,nn(u.items,d=>(A(),P("label",te({ref_for:!0},l.value.getItemProps({value:d.id})),[ee("span",te({ref_for:!0},l.value.getItemTextProps({value:d.id})),de(d.label),17),ee("input",te({ref_for:!0},l.value.getItemHiddenInputProps({value:d.id})),null,16),ee("div",te({ref_for:!0},l.value.getItemControlProps({value:d.id})),null,16)],16))),256))],16,ff))}}),Im=oe({__name:"Grid",props:{is:{default:"div"},columns:{default:1},align:{},rows:{},gap:{default:"default"},areas:{}},setup(e){const t=e,n=(a,o)=>a?typeof a=="number"||typeof a=="string"&&a.match(/^\d+$/)?`repeat(${a}, 1fr)`:a.match(/^(\d+\s?)+$/)?a.split(" ").map(s=>`${s}fr`).join(" "):a:o,i=a=>{if(a)return Array.isArray(a)?a.map(o=>`"${o}"`).join(`
|
|
2
|
-
`):
|
|
3
|
-
`)},r=U(()=>gs("grid",{columns:n(t.columns,"1fr"),align:mi(t.align)||"initial",rows:n(t.rows,"auto"),gap:oa(t.gap),areas:i(t.areas)||"unset"}));return(a,o)=>(A(),ue(kt(a.is),{class:"k-grid",style:St(r.value)},{default:ve(()=>[z(a.$slots,"default")]),_:3},8,["style"]))}});function ll(e){return e?e.flatMap(t=>{const{type:n,children:i}=t;return n===rt?ll(i):[t]}):[]}const Fm=oe({props:{area:String,align:String},inheritAttrs:!1,setup({area:e,align:t},{slots:n}){return()=>{if(!n.default)return null;const[i]=ll(n.default());if(!i)return null;const r=te({style:{"--k-grid-item-area":e,"--k-grid-item-align-self":mi(t)||"initial"}},i.props??{});return jl(i,r)}}}),Dm=oe({__name:"Flex",props:{is:{default:"div"},gap:{default:"default"},justify:{},align:{},direction:{default:"row"},nowrap:{type:Boolean}},setup(e){const t=e,n=U(()=>gs("flex",{justify:mi(t.justify)||"initial",align:mi(t.align)||"initial",wrap:t.nowrap?"nowrap":"wrap",gap:oa(t.gap),direction:t.direction}));return(i,r)=>(A(),ue(kt(i.is),{class:"k-flex",style:St(n.value)},{default:ve(()=>[z(i.$slots,"default")]),_:3},8,["style"]))}}),gf={key:0,class:"k-scroller__indicator"},Om=oe({__name:"Scroller",props:{is:{default:"div"},appearance:{default:"default"},treshhold:{default:80}},setup(e){const t=_t({prefix:"k-scroller-"}),n=e,i=ne({top:!1,right:!1,left:!1,bottom:!1}),r=U(()=>Object.entries(i.value).filter(([,o])=>o).map(([o])=>o)),a=o=>{const{scrollWidth:s,scrollHeight:l,clientWidth:u,clientHeight:c,scrollTop:d,scrollLeft:h}=o,p=s-u>=n.treshhold,f=l-c>=n.treshhold;i.value={top:f&&d<=n.treshhold,left:p&&h<=n.treshhold,bottom:f&&d>=l-c-n.treshhold,right:p&&h>=s-u-n.treshhold}};return At(()=>{const o=document.getElementById(t);o&&($p(o,"scroll",()=>a(o)),qp(o,()=>a(o),{childList:!0,subtree:!0}))}),(o,s)=>(A(),ue(kt(o.is),{id:re(t),class:Oe([`k-scroller k-scroller--appearance-${o.appearance}`,...r.value.map(l=>`k-scroller--scrolled-to-${l}`)])},{default:ve(()=>[o.appearance==="indicator"?(A(),P("div",gf,[z(o.$slots,"indicator",{},()=>[Ne(re(Bt),{icon:"fa-pro-thin:arrow-right"})])])):W("",!0),z(o.$slots,"default")]),_:3},8,["id","class"]))}});var mf=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xt=new WeakMap,Xn=new WeakMap,Yn={},ur=0,ul=function(e){return e&&(e.host||ul(e.parentNode))},vf=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=ul(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},bf=function(e,t,n,i){var r=vf(t,Array.isArray(e)?e:[e]);Yn[n]||(Yn[n]=new WeakMap);var a=Yn[n],o=[],s=new Set,l=new Set(r),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};r.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))c(h);else try{var p=h.getAttribute(i),f=p!==null&&p!=="false",g=(Xt.get(h)||0)+1,m=(a.get(h)||0)+1;Xt.set(h,g),a.set(h,m),o.push(h),g===1&&f&&Xn.set(h,!0),m===1&&h.setAttribute(n,"true"),f||h.setAttribute(i,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return c(t),s.clear(),ur++,function(){o.forEach(function(d){var h=Xt.get(d)-1,p=a.get(d)-1;Xt.set(d,h),a.set(d,p),h||(Xn.has(d)||d.removeAttribute(i),Xn.delete(d)),p||d.removeAttribute(n)}),ur--,ur||(Xt=new WeakMap,Xt=new WeakMap,Xn=new WeakMap,Yn={})}},yf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=mf(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),bf(i,r,n,"aria-hidden")):function(){return null}},xf=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function kf(e,t={}){const{defer:n=!0}=t,i=n?xf:a=>a(),r=[];return r.push(i(()=>{const a=(typeof e=="function"?e():e).filter(Boolean);r.push(yf(a))})),()=>{r.forEach(a=>a?.())}}function Ef(e){const t={each(n){var i;for(let r=0;r<((i=e.frames)==null?void 0:i.length);r+=1){const a=e.frames[r];a&&n(a)}},addEventListener(n,i,r){return t.each(a=>{try{a.document.addEventListener(n,i,r)}catch{}}),()=>{try{t.removeEventListener(n,i,r)}catch{}}},removeEventListener(n,i,r){t.each(a=>{try{a.document.removeEventListener(n,i,r)}catch{}})}};return t}function _f(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,i,r)=>{try{t?.addEventListener(n,i,r)}catch{}return()=>{try{t?.removeEventListener(n,i,r)}catch{}}},removeEventListener:(n,i,r)=>{try{t?.removeEventListener(n,i,r)}catch{}}}}var vo="pointerdown.outside",bo="focus.outside";function wf(e){for(const t of e)if(Xe(t)&&ks(t))return!0;return!1}var cl=e=>"clientY"in e;function Cf(e,t){if(!cl(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function yo(e,t){if(!t||!cl(e))return!1;const n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||i}function Af(e,t){const{exclude:n,onFocusOutside:i,onPointerDownOutside:r,onInteractOutside:a,defer:o}=t;if(!e)return;const s=Ze(e),l=ot(e),u=Ef(l),c=_f(l);function d(b){const v=st(b);if(!Xe(v)||Tn(e,v)||Cf(e,b)||yo(b,v))return!1;const E=Es(e);return yo(b,E)?!1:!(n!=null&&n(v))}const h=new Set;function p(b){function v(){var E;const T=o?Et:S=>S(),_=((E=b.composedPath)==null?void 0:E.call(b))??[b.target];T(()=>{if(!(!e||!d(b))){if(r||a){const S=Za(r,a);e.addEventListener(vo,S,{once:!0})}to(e,vo,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:xd(b),focusable:wf(_)}})}})}b.pointerType==="touch"?(h.forEach(E=>E()),h.add(_e(s,"click",v,{once:!0})),h.add(c.addEventListener("click",v,{once:!0})),h.add(u.addEventListener("click",v,{once:!0}))):v()}const f=new Set,g=setTimeout(()=>{f.add(_e(s,"pointerdown",p,!0)),f.add(c.addEventListener("pointerdown",p,!0)),f.add(u.addEventListener("pointerdown",p,!0))},0);function m(b){(o?Et:v=>v())(()=>{if(!(!e||!d(b))){if(i||a){const v=Za(i,a);e.addEventListener(bo,v,{once:!0})}to(e,bo,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:ks(st(b))}})}})}return f.add(_e(s,"focusin",m,!0)),f.add(c.addEventListener("focusin",m,!0)),f.add(u.addEventListener("focusin",m,!0)),()=>{clearTimeout(g),h.forEach(b=>b()),f.forEach(b=>b())}}function Sf(e,t){const{defer:n}=t,i=n?Et:a=>a(),r=[];return r.push(i(()=>{const a=typeof e=="function"?e():e;r.push(Af(a,t))})),()=>{r.forEach(a=>a?.())}}function Tf(e,t){const n=i=>{i.key==="Escape"&&(i.isComposing||t==null||t(i))};return _e(Ze(e),"keydown",n,{capture:!0})}var Le={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var t;const n=this.indexOf(e),i=this.topMostPointerBlockingLayer()?this.indexOf((t=this.topMostPointerBlockingLayer())==null?void 0:t.node):-1;return n<i},isTopMost(e){const t=this.layers[this.count()-1];return t?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Tn(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Tn(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>n.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){var t;(t=this.layers[this.indexOf(e)])==null||t.dismiss()},clear(){this.remove(this.layers[0].node)}},xo;function ko(){Le.layers.forEach(({node:e})=>{e.style.pointerEvents=Le.isBelowPointerBlockingLayer(e)?"none":"auto"})}function If(e){e.style.pointerEvents=""}function Ff(e,t){const n=Ze(e),i=[];if(Le.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(xo=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const r=Oc(t,a=>{i.push(Ic(a,{pointerEvents:"auto"}))});i.push(r)}return()=>{Le.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=xo,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),i.forEach(r=>r()))}}function Df(e,t){if(!e){ai("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:i,exclude:r,debug:a}=t,o={dismiss:n,node:e,pointerBlocking:i};Le.add(o),ko();function s(h){var p,f;const g=st(h.detail.originalEvent);Le.isBelowPointerBlockingLayer(e)||Le.isInBranch(g)||((p=t.onPointerDownOutside)==null||p.call(t,h),(f=t.onInteractOutside)==null||f.call(t,h),!h.defaultPrevented&&(a&&console.log("onPointerDownOutside:",h.detail.originalEvent),n?.()))}function l(h){var p,f;const g=st(h.detail.originalEvent);Le.isInBranch(g)||((p=t.onFocusOutside)==null||p.call(t,h),(f=t.onInteractOutside)==null||f.call(t,h),!h.defaultPrevented&&(a&&console.log("onFocusOutside:",h.detail.originalEvent),n?.()))}function u(h){var p;Le.isTopMost(e)&&((p=t.onEscapeKeyDown)==null||p.call(t,h),!h.defaultPrevented&&n&&(h.preventDefault(),n()))}function c(h){var p;if(!e)return!1;const f=typeof r=="function"?r():r,g=Array.isArray(f)?f:[f],m=(p=t.persistentElements)==null?void 0:p.map(b=>b()).filter(Xe);return m&&g.push(...m),g.some(b=>Tn(b,h))||Le.isInNestedLayer(e,h)}const d=[i?Ff(e,t.persistentElements):void 0,Tf(e,u),Sf(e,{exclude:c,onFocusOutside:l,onPointerDownOutside:s,defer:t.defer})];return()=>{Le.remove(e),ko(),If(e),d.forEach(h=>h?.())}}function Of(e,t){const{defer:n}=t,i=n?Et:a=>a(),r=[];return r.push(i(()=>{const a=Fn(e)?e():e;r.push(Df(a,t))})),()=>{r.forEach(a=>a?.())}}var cr="data-scroll-lock";function Eo(e,t){if(!e)return;const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Pf(e,t,n){if(!e)return;const i=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{i?e.style.setProperty(t,i):e.style.removeProperty(t)}}function Rf(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function Mf(e){const t=e??document,n=t.defaultView??window,{documentElement:i,body:r}=t;if(r.hasAttribute(cr))return;r.setAttribute(cr,"");const a=n.innerWidth-i.clientWidth,o=()=>Pf(i,"--scrollbar-width",`${a}px`),s=Rf(i),l=()=>Eo(r,{overflow:"hidden",[s]:`${a}px`}),u=()=>{const{scrollX:d,scrollY:h,visualViewport:p}=n,f=p?.offsetLeft??0,g=p?.offsetTop??0,m=Eo(r,{position:"fixed",overflow:"hidden",top:`${-(h-Math.floor(g))}px`,left:`${-(d-Math.floor(f))}px`,right:"0",[s]:`${a}px`});return()=>{m?.(),n.scrollTo({left:d,top:h,behavior:"instant"})}},c=[o(),sa()?u():l()];return()=>{c.forEach(d=>d?.()),r.removeAttribute(cr)}}/*!
|
|
1
|
+
import{G as Wa,q as ie,r as Q,b as P,c as I,o as E,y as In,e as U,E as Fe,w as te,z as ml,d as F,a as W,g as B,j as ke,v as z,C as ct,t as ce,A as bv,m as se,f as Ye,H as md,I as kv,n as Me,P as sx,i as or,J as Se,K as _e,F as Le,l as Ft,D as Mo,M as Dh,N as Us,k as ws,B as Rh,O as xv,a0 as ax,s as Es,R as wv,S as Nh,X as Ev,W as Cv,a2 as lx,u as Sv,Q as Tv,U as ux,V as cx,Z as Ph,a3 as dx,a4 as hx,$ as Fh,a9 as Ov,a1 as vi,L as ga,h as Av,ag as px,Y as fx,T as mx}from"./_plugin-vue_export-helper.js";var gx=Object.defineProperty,vx=(t,e,n)=>e in t?gx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,sn=(t,e,n)=>(vx(t,typeof e!="symbol"?e+"":e,n),n);function Mv(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Mv(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function yx(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Mv(t))&&(r&&(r+=" "),r+=e);return r}const of=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,sf=yx,Dn=(t,e)=>n=>{var r;if(e?.variants==null)return sf(t,n?.class,n?.className);const{variants:i,defaultVariants:o}=e,s=Object.keys(i).map(u=>{const c=n?.[u],d=o?.[u];if(c===null)return null;const h=of(c)||of(d);return i[u][h]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:h,...p}=c;return Object.entries(p).every(f=>{let[m,g]=f;return Array.isArray(g)?g.includes({...o,...a}[m]):{...o,...a}[m]===g})?[...u,d,h]:u},[]);return sf(t,s,l,n?.class,n?.className)},_v=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ou=(t,e,n,r="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:r,prefix:l,name:a};return e&&!Ua(u)?null:u}const o=i[0],s=o.split("-");if(s.length>1){const a={provider:r,prefix:s.shift(),name:s.join("-")};return e&&!Ua(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:o};return e&&!Ua(a,n)?null:a}return null},Ua=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,Iv=Object.freeze({left:0,top:0,width:16,height:16}),gl=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Au=Object.freeze({...Iv,...gl}),gd=Object.freeze({...Au,body:"",hidden:!1});function bx(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const r=((t.rotate||0)+(e.rotate||0))%4;return r&&(n.rotate=r),n}function af(t,e){const n=bx(t,e);for(const r in gd)r in gl?r in t&&!(r in n)&&(n[r]=gl[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function kx(t,e){const n=t.icons,r=t.aliases||Object.create(null),i=Object.create(null);function o(s){if(n[s])return i[s]=[];if(!(s in i)){i[s]=null;const a=r[s]&&r[s].parent,l=a&&o(a);l&&(i[s]=[a].concat(l))}return i[s]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function xx(t,e,n){const r=t.icons,i=t.aliases||Object.create(null);let o={};function s(a){o=af(r[a]||i[a],o)}return s(e),n.forEach(s),af(t,o)}function Dv(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(i=>{e(i,null),n.push(i)});const r=kx(t);for(const i in r){const o=r[i];o&&(e(i,xx(t,i,o)),n.push(i))}return n}const wx={provider:"",aliases:{},not_found:{},...Iv};function pc(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Rv(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!pc(t,wx))return null;const n=e.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!pc(o,gd))return null}const r=e.aliases||Object.create(null);for(const i in r){const o=r[i],s=o.parent;if(!i||typeof s!="string"||!n[s]&&!r[s]||!pc(o,gd))return null}return e}const lf=Object.create(null);function Ex(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function ho(t,e){const n=lf[t]||(lf[t]=Object.create(null));return n[e]||(n[e]=Ex(t,e))}function Nv(t,e){return Rv(e)?Dv(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function Cx(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let Cs=!1;function Pv(t){return typeof t=="boolean"&&(Cs=t),Cs}function Sx(t){const e=typeof t=="string"?Ou(t,!0,Cs):t;if(e){const n=ho(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Tx(t,e){const n=Ou(t,!0,Cs);if(!n)return!1;const r=ho(n.provider,n.prefix);return e?Cx(r,n.name,e):(r.missing.add(n.name),!0)}function Ox(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Cs&&!e&&!t.prefix){let i=!1;return Rv(t)&&(t.prefix="",Dv(t,(o,s)=>{Tx(o,s)&&(i=!0)})),i}const n=t.prefix;if(!Ua({prefix:n,name:"a"}))return!1;const r=ho(e,n);return!!Nv(r,t)}const Fv=Object.freeze({width:null,height:null}),Lv=Object.freeze({...Fv,...gl}),Ax=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Mx=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function uf(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const r=t.split(Ax);if(r===null||!r.length)return t;const i=[];let o=r.shift(),s=Mx.test(o);for(;;){if(s){const a=parseFloat(o);isNaN(a)?i.push(o):i.push(Math.ceil(a*e*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");s=!s}}function _x(t,e="defs"){let n="";const r=t.indexOf("<"+e);for(;r>=0;){const i=t.indexOf(">",r),o=t.indexOf("</"+e);if(i===-1||o===-1)break;const s=t.indexOf(">",o);if(s===-1)break;n+=t.slice(i+1,o).trim(),t=t.slice(0,r).trim()+t.slice(s+1)}return{defs:n,content:t}}function Ix(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Dx(t,e,n){const r=_x(t);return Ix(r.defs,e+r.content+n)}const Rx=t=>t==="unset"||t==="undefined"||t==="none";function Nx(t,e){const n={...Au,...t},r={...Lv,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(m=>{const g=[],y=m.hFlip,b=m.vFlip;let k=m.rotate;y?b?k+=2:(g.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),g.push("scale(-1 1)"),i.top=i.left=0):b&&(g.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),g.push("scale(1 -1)"),i.top=i.left=0);let v;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:v=i.height/2+i.top,g.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:g.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:v=i.width/2+i.left,g.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}k%2===1&&(i.left!==i.top&&(v=i.left,i.left=i.top,i.top=v),i.width!==i.height&&(v=i.width,i.width=i.height,i.height=v)),g.length&&(o=Dx(o,'<g transform="'+g.join(" ")+'">',"</g>"))});const s=r.width,a=r.height,l=i.width,u=i.height;let c,d;s===null?(d=a===null?"1em":a==="auto"?u:a,c=uf(d,l/u)):(c=s==="auto"?l:s,d=a===null?uf(c,u/l):a==="auto"?u:a);const h={},p=(m,g)=>{Rx(g)||(h[m]=g.toString())};p("width",c),p("height",d);const f=[i.left,i.top,l,u];return h.viewBox=f.join(" "),{attributes:h,viewBox:f,body:o}}const Px=/\sid="(\S+)"/g,Fx="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Lx=0;function Bx(t,e=Fx){const n=[];let r;for(;r=Px.exec(t);)n.push(r[1]);if(!n.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const s=typeof e=="function"?e(o):e+(Lx++).toString(),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const vd=Object.create(null);function Vx(t,e){vd[t]=e}function yd(t){return vd[t]||vd[""]}function Lh(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const Bh=Object.create(null),va=["https://api.simplesvg.com","https://api.unisvg.com"],bd=[];for(;va.length>0;)va.length===1||Math.random()>.5?bd.push(va.shift()):bd.push(va.pop());Bh[""]=Lh({resources:["https://api.iconify.design"].concat(bd)});function Bv(t,e){const n=Lh(e);return n===null?!1:(Bh[t]=n,!0)}function Vh(t){return Bh[t]}const $x=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let cf=$x();function jx(t,e){const n=Vh(t);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const o=e+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function zx(t){return t===404}const Hx=(t,e,n)=>{const r=[],i=jx(t,e),o="icons";let s={type:o,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,u)=>{a+=l.length+1,a>=i&&u>0&&(r.push(s),s={type:o,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),r.push(s),r};function qx(t){if(typeof t=="string"){const e=Vh(t);if(e)return e.path}return"/"}const Wx=(t,e,n)=>{if(!cf){n("abort",424);return}let r=qx(e.provider);switch(e.type){case"icons":{const o=e.prefix,s=e.icons.join(","),a=new URLSearchParams({icons:s});r+=o+".json?"+a.toString();break}case"custom":{const o=e.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;cf(t+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(zx(s)?"abort":"next",s)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},Ux={prepare:Hx,send:Wx};function Kx(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return t.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,s=i.prefix,a=i.name,l=n[o]||(n[o]=Object.create(null)),u=l[s]||(l[s]=ho(o,s));let c;a in u.icons?c=e.loaded:s===""||u.missing.has(a)?c=e.missing:c=e.pending;const d={provider:o,prefix:s,name:a};c.push(d)}),e}function Vv(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==e))})}function Gx(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const r=t.provider,i=t.prefix;e.forEach(o=>{const s=o.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==i)return!0;const u=l.name;if(t.icons[u])s.loaded.push({provider:r,prefix:i,name:u});else if(t.missing.has(u))s.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||Vv([t],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let Jx=0;function Yx(t,e,n){const r=Jx++,i=Vv.bind(null,n,r);if(!e.pending.length)return i;const o={id:r,icons:e,callback:t,abort:i};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(o)}),i}function Xx(t,e=!0,n=!1){const r=[];return t.forEach(i=>{const o=typeof i=="string"?Ou(i,e,n):i;o&&r.push(o)}),r}var Zx={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Qx(t,e,n,r){const i=t.resources.length,o=t.random?Math.floor(Math.random()*i):t.index;let s;if(t.random){let x=t.resources.slice(0);for(s=[];x.length>1;){const _=Math.floor(Math.random()*x.length);s.push(x[_]),x=x.slice(0,_).concat(x.slice(_+1))}s=s.concat(x)}else s=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let l="pending",u=0,c,d=null,h=[],p=[];typeof r=="function"&&p.push(r);function f(){d&&(clearTimeout(d),d=null)}function m(){l==="pending"&&(l="aborted"),f(),h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function g(x,_){_&&(p=[]),typeof x=="function"&&p.push(x)}function y(){return{startTime:a,payload:e,status:l,queriesSent:u,queriesPending:h.length,subscribe:g,abort:m}}function b(){l="failed",p.forEach(x=>{x(void 0,c)})}function k(){h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function v(x,_,A){const S=_!=="success";switch(h=h.filter(O=>O!==x),l){case"pending":break;case"failed":if(S||!t.dataAfterTimeout)return;break;default:return}if(_==="abort"){c=A,b();return}if(S){c=A,h.length||(s.length?w():b());return}if(f(),k(),!t.random){const O=t.resources.indexOf(x.resource);O!==-1&&O!==t.index&&(t.index=O)}l="completed",p.forEach(O=>{O(A)})}function w(){if(l!=="pending")return;f();const x=s.shift();if(x===void 0){if(h.length){d=setTimeout(()=>{f(),l==="pending"&&(k(),b())},t.timeout);return}b();return}const _={status:"pending",resource:x,callback:(A,S)=>{v(_,A,S)}};h.push(_),u++,d=setTimeout(w,t.rotate),n(x,e,_.callback)}return setTimeout(w),y}function $v(t){const e={...Zx,...t};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,a,l){const u=Qx(e,s,a,(c,d)=>{r(),l&&l(c,d)});return n.push(u),u}function o(s){return n.find(a=>s(a))||null}return{query:i,find:o,setIndex:s=>{e.index=s},getIndex:()=>e.index,cleanup:r}}function df(){}const fc=Object.create(null);function ew(t){if(!fc[t]){const e=Vh(t);if(!e)return;const n=$v(e),r={config:e,redundancy:n};fc[t]=r}return fc[t]}function tw(t,e,n){let r,i;if(typeof t=="string"){const o=yd(t);if(!o)return n(void 0,424),df;i=o.send;const s=ew(t);s&&(r=s.redundancy)}else{const o=Lh(t);if(o){r=$v(o);const s=t.resources?t.resources[0]:"",a=yd(s);a&&(i=a.send)}}return!r||!i?(n(void 0,424),df):r.query(e,i,n)().abort}function hf(){}function nw(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Gx(t)}))}function rw(t){const e=[],n=[];return t.forEach(r=>{(r.match(_v)?e:n).push(r)}),{valid:e,invalid:n}}function Bo(t,e,n){function r(){const i=t.pendingIcons;e.forEach(o=>{i&&i.delete(o),t.icons[o]||t.missing.add(o)})}if(n&&typeof n=="object")try{if(!Nv(t,n).length){r();return}}catch(i){console.error(i)}r(),nw(t)}function pf(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function iw(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:r}=t,i=t.iconsToLoad;if(delete t.iconsToLoad,!i||!i.length)return;const o=t.loadIcon;if(t.loadIcons&&(i.length>1||!o)){pf(t.loadIcons(i,r,n),u=>{Bo(t,i,u)});return}if(o){i.forEach(u=>{const c=o(u,r,n);pf(c,d=>{const h=d?{prefix:r,icons:{[u]:d}}:null;Bo(t,[u],h)})});return}const{valid:s,invalid:a}=rw(i);if(a.length&&Bo(t,a,null),!s.length)return;const l=r.match(_v)?yd(n):null;if(!l){Bo(t,s,null);return}l.prepare(n,r,s).forEach(u=>{tw(n,u,c=>{Bo(t,u.icons,c)})})}))}const ow=(t,e)=>{const n=Xx(t,!0,Pv()),r=Kx(n);if(!r.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(r.loaded,r.missing,r.pending,hf)}),()=>{l=!1}}const i=Object.create(null),o=[];let s,a;return r.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===a&&u===s)return;s=u,a=c,o.push(ho(u,c));const d=i[u]||(i[u]=Object.create(null));d[c]||(d[c]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:c,name:d}=l,h=ho(u,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(d)||(p.add(d),i[u][c].push(d))}),o.forEach(l=>{const u=i[l.provider][l.prefix];u.length&&iw(l,u)}),e?Yx(e,r,o):hf};function sw(t,e){const n={...t};for(const r in e){const i=e[r],o=typeof i;r in Fv?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const aw=/[\s,]+/;function lw(t,e){e.split(aw).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function uw(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(t);return isNaN(i)?0:r(i)}else if(n!==t){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(t.slice(0,t.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return e}function cw(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in e)n+=" "+r+'="'+e[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function dw(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function hw(t){return"data:image/svg+xml,"+dw(t)}function pw(t){return'url("'+hw(t)+'")'}const ff={...Lv,inline:!1},fw={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},mw={display:"inline-block"},kd={backgroundColor:"currentColor"},jv={backgroundColor:"transparent"},mf={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},gf={webkitMask:kd,mask:kd,background:jv};for(const t in gf){const e=gf[t];for(const n in mf)e[t+n]=mf[n]}const Ka={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Ka[t+"-flip"]=e,Ka[t.slice(0,1)+"-flip"]=e,Ka[t+"Flip"]=e});function vf(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const yf=(t,e)=>{const n=sw(ff,e),r={...fw},i=e.mode||"svg",o={},s=e.style,a=typeof s=="object"&&!(s instanceof Array)?s:{};for(let m in e){const g=e[m];if(g!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[m]=g===!0||g==="true"||g===1;break;case"flip":typeof g=="string"&&lw(n,g);break;case"color":o.color=g;break;case"rotate":typeof g=="string"?n[m]=uw(g):typeof g=="number"&&(n[m]=g);break;case"ariaHidden":case"aria-hidden":g!==!0&&g!=="true"&&delete r["aria-hidden"];break;default:{const y=Ka[m];y?(g===!0||g==="true"||g===1)&&(n[y]=!0):ff[m]===void 0&&(r[m]=g)}}}const l=Nx(t,n),u=l.attributes;if(n.inline&&(o.verticalAlign="-0.125em"),i==="svg"){r.style={...o,...a},Object.assign(r,u);let m=0,g=e.id;return typeof g=="string"&&(g=g.replace(/-/g,"_")),r.innerHTML=Bx(l.body,g?()=>g+"ID"+m++:"iconifyVue"),Es("svg",r)}const{body:c,width:d,height:h}=t,p=i==="mask"||(i==="bg"?!1:c.indexOf("currentColor")!==-1),f=cw(c,{...u,width:d+"",height:h+""});return r.style={...o,"--svg":pw(f),width:vf(u.width),height:vf(u.height),...mw,...p?kd:jv,...a},Es("span",r)};Pv(!0);Vx("",Ux);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Ox(r))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const r="IconifyProviders["+n+"] is invalid.";try{const i=e[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Bv(n,i)||console.error(r)}catch{console.error(r)}}}}const gw={...Au,body:""},We=ie({inheritAttrs:!1,data(){return{_name:"",_loadingIcon:null,iconMounted:!1,counter:0}},mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(t,e,n){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let r;if(typeof t!="string"||(r=Ou(t,!1,!0))===null)return this.abortLoading(),null;let i=Sx(r);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==t)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:t,abort:ow([r],()=>{this.counter++})})),null;if(this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t)),n){i=Object.assign({},i);const s=n(i.body,r.name,r.prefix,r.provider);typeof s=="string"&&(i.body=s)}const o=["iconify"];return r.prefix!==""&&o.push("iconify--"+r.prefix),r.provider!==""&&o.push("iconify--"+r.provider),{data:i,classes:o}}},render(){this.counter;const t=this.$attrs,e=this.iconMounted||t.ssr?this.getIcon(t.icon,t.onLoad,t.customise):null;if(!e)return yf(gw,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),yf({...Au,...e.data},n)}});Bv("",{resources:["https://icons.ui.kvass.no"]});function vw(t){return!t||typeof t!="object"?!1:typeof t.then=="function"&&typeof t.catch=="function"}const yw=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],bw=(t,e)=>e==="default"?`var(--k-ui-${t})`:`var(--k-ui-${t}-${e})`,vl=t=>{switch(t){case"start":case"end":return`flex-${t}`;default:return t}},$h=(t,e="spacing")=>t.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&yw.includes(n)?bw(e,n):n).join(" ");function kw(){var t=new Date().getTime(),e=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=Math.random()*16;return t>0?(r=(t+r)%16|0,t=Math.floor(t/16)):(r=(e+r)%16|0,e=Math.floor(e/16)),(n==="x"?r:r&3|8).toString(16)})}const zv=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,r])=>[`--k-${t}-${n}`,r])),xw=function(t){return Object.prototype.toString.call(t)==="[object Object]"};function ww(t){return Array.isArray(t)}const Hv=ie({__name:"Spinner",props:{size:{default:"medium"}},setup(t){return(e,n)=>(E(),I("span",{class:Me(`k-spinner k-spinner--size-${e.size}`)},null,2))}}),Ew={class:"k-button__content"},Cw={key:0,class:"k-button__icon k-button__icon--left"},Sw={key:1,class:"k-button__icon k-button__icon--right"},Tw={key:2,class:"k-button__confirm-label"},yt=ie({__name:"Button",props:{variant:{default:"secondary"},size:{default:"medium"},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{default:"button"},stateTimeout:{default:1e3},confirmLabel:{default:"Are you sure?"},label:{},icon:{},iconLeft:{},iconRight:{}},emits:["idle","loading","success","error","confirm","click"],setup(t,{emit:e}){const n=t,r=e,i={success:"success",confirm:"warning",error:"danger",loading:null,idle:null},o=P(()=>!h.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":i[u.value]||n.variant),s=P(()=>n.loading||u.value==="loading"),a=Q(),l=P(()=>{if(u.value)return["error","success"].includes(u.value)||s.value}),u=Q("idle"),c=Q(),d=Q(),h=P(()=>u.value||s.value),p=P(()=>["error","success"].includes(u.value)),f=P(()=>u.value==="success"?"fa-pro-regular:check":"fa-pro-regular:exclamation-circle");function m(w){if(!w)return;g(),d.value=w,a.value=setTimeout(()=>u.value="loading",100);let x=_=>{g(),n.stateTimeout?(u.value=_,c.value=setTimeout(()=>{g(),r(_)},n.stateTimeout)):r(_)};d.value.then(()=>x("success")).catch(()=>x("error"))}function g(){a.value&&clearTimeout(a.value),c.value&&clearTimeout(c.value),d.value=null,u.value="idle"}Fe(()=>n.promise,w=>{w&&vw(w)&&m(w)});const y=Q(),b=P(()=>u.value==="confirm");function k(w){if(n.confirm&&u.value!=="confirm")return u.value="confirm";g(),r("click",w)}const v=Dn("k-button",{variants:{variant:{primary:"k-button--variant-primary",secondary:"k-button--variant-secondary",tertiary:"k-button--variant-tertiary",danger:"k-button--variant-danger",warning:"k-button--variant-warning",success:"k-button--variant-success"},size:{small:"k-button--size-small",medium:"k-button--size-medium",large:"k-button--size-large"},isLoading:{true:"k-button--loading"},isBusy:{true:"k-button--busy"}}});return(w,x)=>(E(),U(Ye(w.is),se({type:"button",class:z(v)({variant:o.value,size:w.size,isLoading:s.value,isBusy:l.value}),"aria-busy":l.value,inert:l.value},w.$attrs,{onClick:k,ref_key:"rootElement",ref:y}),{default:te(()=>[ml(W("span",Ew,[w.icon||w.iconLeft||w.$slots.icon||w.$slots["icon-left"]?(E(),I("span",Cw,[B(w.$slots,"icon-left",{},()=>[B(w.$slots,"icon",{},()=>[ke(z(We),{icon:w.icon||w.iconLeft},null,8,["icon"])])])])):F("",!0),B(w.$slots,"default",{},()=>[ct(ce(w.label),1)]),w.iconRight||w.$slots["icon-right"]?(E(),I("span",Sw,[B(w.$slots,"icon-right",{},()=>[ke(z(We),{icon:w.iconRight},null,8,["icon"])])])):F("",!0)],512),[[bv,!b.value]]),s.value?(E(),U(Hv,{key:0})):F("",!0),p.value?(E(),U(z(We),{key:1,class:"k-button__state-indicator",icon:f.value},null,8,["icon"])):F("",!0),b.value?(E(),I("span",Tw,ce(w.confirmLabel),1)):F("",!0)]),_:3},16,["class","aria-busy","inert"]))}}),Ow={class:"k-alert__content"},Aw={key:0,class:"k-alert__title"},Mw={class:"k-alert__icon"},iV=ie({__name:"Alert",props:{variant:{default:"neutral"},icon:{},title:{},content:{},action:{}},emits:["action"],setup(t,{emit:e}){const n=t,r=e,i=Dn("k-alert",{variants:{variant:{success:"k-alert--success",neutral:"k-alert--neutral",info:"k-alert--info",danger:"k-alert--danger",warning:"k-alert--warning",primary:"k-alert--primary"}}}),o={success:"fa-pro-light:circle-check",info:"fa-pro-light:circle-question",warning:"fa-pro-light:exclamation-triangle",danger:"fa-pro-light:exclamation-circle"};return(s,a)=>(E(),I("div",{role:"alert",class:Me(z(i)({...n}))},[W("div",Ow,[s.title||s.$slots.title?(E(),I("div",Aw,[B(s.$slots,"title",{},()=>[W("strong",null,ce(s.title),1)])])):F("",!0),B(s.$slots,"default",{},()=>[W("span",null,ce(s.content),1)]),s.action?(E(),U(yt,{key:1,label:s.action,size:"small",class:"k-alert__action",onClick:a[0]||(a[0]=l=>r("action",{event:l,name:s.action}))},null,8,["label"])):F("",!0)]),W("div",Mw,[B(s.$slots,"icon",{},()=>[s.icon||o[s.variant]?(E(),U(z(We),{key:0,icon:s.icon||o[s.variant]},null,8,["icon"])):F("",!0)])])],2))}}),_w={class:"k-badge__label"},oV=ie({__name:"Badge",props:{variant:{default:"neutral"},appearance:{default:"solid"},icon:{},dismissable:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},label:{}},emits:["dismiss"],setup(t,{emit:e}){const n=t,r=e,i={task:"fa-pro-solid:circle",dot:"fa-pro-solid:circle"},o=Dn("k-badge",{variants:{variant:{neutral:"k-badge--variant-neutral",info:"k-badge--variant-info",warning:"k-badge--variant-warning",success:"k-badge--variant-success",danger:"k-badge--variant-danger",primary:"k-badge--variant-primary"},appearance:{solid:"k-badge--appearance-solid",outline:"k-badge--appearance-outline",filled:"k-badge--appearance-filled",task:"k-badge--appearance-task",dot:"k-badge--appearance-dot"},rounded:{true:"k-badge--rounded",false:""}}}),s=Q(!1);function a(){s.value=!0,r("dismiss",n)}return(l,u)=>s.value?F("",!0):(E(),I("span",{key:0,class:Me(z(o)({appearance:l.appearance,variant:l.variant,rounded:l.rounded}))},[B(l.$slots,"icon",{},()=>[l.icon||i[l.appearance]?(E(),U(z(We),{key:0,icon:l.icon||i[l.appearance],class:"k-badge__icon"},null,8,["icon"])):F("",!0)]),B(l.$slots,"default",{},()=>[W("span",_w,ce(l.label),1)]),l.dismissable?(E(),I("button",{key:0,class:"k-badge__dismiss",onClick:a},[ke(z(We),{icon:"fa-pro-light:times"})])):F("",!0)],2))}});var Tr=(t,e=[])=>({parts:(...n)=>{if(Iw(e))return Tr(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Tr(t,[...e,...n]),rename:n=>Tr(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Bi(t)}"][data-part="${Bi(r)}"]`,`& [data-scope="${Bi(t)}"][data-part="${Bi(r)}"]`].join(", "),attrs:{"data-scope":Bi(t),"data-part":Bi(r)}}}),{})}),Bi=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Iw=t=>t.length===0,Z=t=>t?"":void 0,Dw=t=>t?"true":void 0,Rw=1,Nw=9,Pw=11,Mu=t=>typeof t=="object"&&t!==null,Cn=t=>Mu(t)&&t.nodeType===Rw&&typeof t.nodeName=="string",qv=t=>Mu(t)&&t.nodeType===Nw,Fw=t=>Mu(t)&&t===t.window,Wv=t=>Cn(t)?t.localName||"":"#document";function Lw(t){return["html","body","#document"].includes(Wv(t))}var Bw=t=>Mu(t)&&t.nodeType!==void 0,xd=t=>Bw(t)&&t.nodeType===Pw&&"host"in t;function Ss(t,e){return!t||!e||!Cn(t)||!Cn(e)?!1:t===e||t.contains(e)}function Rn(t){return qv(t)?t:Fw(t)?t.document:t?.ownerDocument??document}function Vw(t){return Rn(t).documentElement}function Zn(t){var e;return xd(t)?Zn(t.host):qv(t)?t.defaultView??window:Cn(t)?((e=t.ownerDocument)==null?void 0:e.defaultView)??window:window}function $w(t){let e=t.activeElement;for(;e!=null&&e.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}var jw=()=>typeof document<"u";function zw(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var Uv=t=>jw()&&t.test(zw()),Kv=()=>Uv(/^Mac/),jh=()=>Uv(/iP(hone|ad|od)|iOS/);function Hw(t){var e,n,r;return((e=t.composedPath)==null?void 0:e.call(t))??((r=(n=t.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n))}function Qn(t){const e=Hw(t);return e?.[0]??t.target}function qw(t){if(Wv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xd(t)&&t.host||Vw(t);return xd(e)?e.host:e}var Ww=t=>typeof t=="object"&&t!==null&&t.nodeType===1;function Uw(t){return Ww(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1}var Kw="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Gv(t){return!t||t.closest("[inert]")?!1:t.matches(Kw)&&Uw(t)}var Gw=/auto|scroll|overlay|hidden|clip/;function Jw(t){const e=Zn(t),{overflow:n,overflowX:r,overflowY:i,display:o}=e.getComputedStyle(t);return Gw.test(n+i+r)&&!["inline","contents"].includes(o)}function zh(t){const e=new Set;function n(r){const i=globalThis.requestAnimationFrame(r);e.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(t)),function(){e.forEach(r=>r())}}function Fr(t){const e=globalThis.requestAnimationFrame(t);return()=>{globalThis.cancelAnimationFrame(e)}}function Jv(t){const e=qw(t);return Lw(e)?Rn(e).body:Cn(e)&&Jw(e)?e:Jv(e)}function Yv(t,e){return Array.from(t?.querySelectorAll(e)??[])}function Ks(t){const e={getRootNode:n=>{var r;return((r=n.getRootNode)==null?void 0:r.call(n))??document},getDoc:n=>Rn(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>$w(e.getRootNode(n)),isActiveElement:(n,r)=>r===e.getActiveElement(n),getById:(n,r)=>e.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;const i=r.toString();n.value!==i&&(n.value=r.toString())}};return{...e,...t}}var mc=new WeakMap;function Yw(t,e,n){mc.has(t)||mc.set(t,new Map);const r=mc.get(t),i=r.get(e);if(!i)return r.set(e,n()),()=>{var a;(a=r.get(e))==null||a(),r.delete(e)};const o=n(),s=()=>{o(),i(),r.delete(e)};return r.set(e,s),()=>{r.get(e)===s&&(o(),r.set(e,i))}}function Xw(t,e){return t?Yw(t,"style",()=>{const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}):()=>{}}var Hh={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Zw=1e3/60;function Qw(t,e){const n=t();if(Cn(n)&&n.isConnected)return e(n),()=>{};{const r=setInterval(()=>{const i=t();Cn(i)&&i.isConnected&&(e(i),clearInterval(r))},Zw);return()=>clearInterval(r)}}function e1(t,e){const n=[];return t?.forEach(r=>{const i=Qw(r,e);n.push(i)}),()=>{n.forEach(r=>r())}}function t1(t){return t.mozInputSource===0&&t.isTrusted?!0:t.detail===0&&!t.pointerType}function n1(t){return!(t.metaKey||!Kv()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var r1=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function i1(t,e,n){const r=n?Qn(n):null,i=Zn(r);return t=t||r instanceof i.HTMLInputElement&&!r1.has(r?.type)||r instanceof i.HTMLTextAreaElement||r instanceof i.HTMLElement&&r.isContentEditable,!(t&&e==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(o1,n.key))}var Ai=null,wd=new Set,es=new Map,yi=!1,Ed=!1,o1={Tab:!0,Escape:!0};function _u(t,e){for(let n of wd)n(t,e)}function yl(t){yi=!0,n1(t)&&(Ai="keyboard",_u("keyboard",t))}function Ut(t){Ai="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(yi=!0,_u("pointer",t))}function Xv(t){t1(t)&&(yi=!0,Ai="virtual")}function Zv(t){const e=Qn(t);e===Zn(e)||e===Rn(e)||(!yi&&!Ed&&(Ai="virtual",_u("virtual",t)),yi=!1,Ed=!1)}function Qv(){yi=!1,Ed=!0}function s1(t){if(typeof window>"u"||es.get(Zn(t)))return;const e=Zn(t),n=Rn(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Ai="virtual",_u("virtual",null),yi=!0,r.apply(this,arguments)},n.addEventListener("keydown",yl,!0),n.addEventListener("keyup",yl,!0),n.addEventListener("click",Xv,!0),e.addEventListener("focus",Zv,!0),e.addEventListener("blur",Qv,!1),typeof e.PointerEvent<"u"?(n.addEventListener("pointerdown",Ut,!0),n.addEventListener("pointermove",Ut,!0),n.addEventListener("pointerup",Ut,!0)):(n.addEventListener("mousedown",Ut,!0),n.addEventListener("mousemove",Ut,!0),n.addEventListener("mouseup",Ut,!0)),e.addEventListener("beforeunload",()=>{a1(t)},{once:!0}),es.set(e,{focus:r})}var a1=(t,e)=>{const n=Zn(t),r=Rn(t);es.has(n)&&(n.HTMLElement.prototype.focus=es.get(n).focus,r.removeEventListener("keydown",yl,!0),r.removeEventListener("keyup",yl,!0),r.removeEventListener("click",Xv,!0),n.removeEventListener("focus",Zv,!0),n.removeEventListener("blur",Qv,!1),typeof n.PointerEvent<"u"?(r.removeEventListener("pointerdown",Ut,!0),r.removeEventListener("pointermove",Ut,!0),r.removeEventListener("pointerup",Ut,!0)):(r.removeEventListener("mousedown",Ut,!0),r.removeEventListener("mousemove",Ut,!0),r.removeEventListener("mouseup",Ut,!0)),es.delete(n))};function Ts(){return Ai==="keyboard"}function qh(t={}){const{isTextInput:e,autoFocus:n,onChange:r,root:i}=t;s1(i),r?.({isFocusVisible:n||Ts(),modality:Ai});const o=(s,a)=>{i1(!!e,s,a)&&r?.({isFocusVisible:Ts(),modality:s})};return wd.add(o),()=>{wd.delete(o)}}const l1=Symbol(),bf=Object.getPrototypeOf,Cd=new WeakMap,u1=t=>t&&(Cd.has(t)?Cd.get(t):bf(t)===Object.prototype||bf(t)===Array.prototype),c1=t=>u1(t)&&t[l1]||null,kf=(t,e=!0)=>{Cd.set(t,e)};function d1(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function ey(t,e){const n=d1();return n?(n[t]||(n[t]=e()),n[t]):e()}var gc=t=>typeof t=="object"&&t!==null,ei=ey("__zag__proxyStateMap",()=>new WeakMap),Wo=ey("__zag__refSet",()=>new WeakSet),h1=t=>typeof t=="object"&&t!==null&&"$$typeof"in t,p1=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,f1=t=>typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeName=="string",m1=t=>h1(t)||p1(t)||f1(t),g1=(t=Object.is,e=(u,c)=>new Proxy(u,c),n=u=>gc(u)&&!Wo.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!m1(u)&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),r=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,o=(u,c,d=r)=>{const h=i.get(u);if(h?.[0]===c)return h[1];const p=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return kf(p,!0),i.set(u,[c,p]),Reflect.ownKeys(u).forEach(f=>{const m=Reflect.get(u,f);Wo.has(m)?(kf(m,!1),p[f]=m):m instanceof Promise?Object.defineProperty(p,f,{get(){return d(m)}}):ei.has(m)?p[f]=oi(m,d):p[f]=m}),Object.freeze(p)},s=new WeakMap,a=[1,1],l=u=>{if(!gc(u))throw new Error("object required");const c=s.get(u);if(c)return c;let d=a[0];const h=new Set,p=(A,S=++a[0])=>{d!==S&&(d=S,h.forEach(O=>O(A,S)))};let f=a[1];const m=(A=++a[1])=>(f!==A&&!h.size&&(f=A,y.forEach(([S])=>{const O=S[1](A);O>d&&(d=O)})),d),g=A=>(S,O)=>{const C=[...S];C[1]=[A,...C[1]],p(C,O)},y=new Map,b=(A,S)=>{if(h.size){const O=S[3](g(A));y.set(A,[S,O])}else y.set(A,[S])},k=A=>{var S;const O=y.get(A);O&&(y.delete(A),(S=O[1])==null||S.call(O))},v=A=>(h.add(A),h.size===1&&y.forEach(([S,O],C)=>{const T=S[3](g(C));y.set(C,[S,T])}),()=>{h.delete(A),h.size===0&&y.forEach(([S,O],C)=>{O&&(O(),y.set(C,[S]))})}),w=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),x=e(w,{deleteProperty(A,S){const O=Reflect.get(A,S);k(S);const C=Reflect.deleteProperty(A,S);return C&&p(["delete",[S],O]),C},set(A,S,O,C){var T;const R=Reflect.has(A,S),j=Reflect.get(A,S,C);if(R&&(t(j,O)||s.has(O)&&t(j,s.get(O))))return!0;k(S),gc(O)&&(O=c1(O)||O);let H=O;if(!((T=Object.getOwnPropertyDescriptor(A,S))!=null&&T.set))if(O instanceof Promise)O.then($=>{Object.assign(O,{status:"fulfilled",value:$}),p(["resolve",[S],$])}).catch($=>{Object.assign(O,{status:"rejected",reason:$}),p(["reject",[S],$])});else{!ei.has(O)&&n(O)&&(H=Wh(O));const $=!Wo.has(H)&&ei.get(H);$&&b(S,$)}return Reflect.set(A,S,H,C),p(["set",[S],O,j]),!0}});s.set(u,x);const _=[w,m,o,v];return ei.set(x,_),Reflect.ownKeys(u).forEach(A=>{const S=Object.getOwnPropertyDescriptor(u,A);S.get||S.set?Object.defineProperty(w,A,S):x[A]=u[A]}),x})=>[l,ei,Wo,t,e,n,r,i,o,s,a],[v1]=g1();function Wh(t={}){return v1(t)}function Sd(t,e,n){const r=ei.get(t);let i;const o=[],s=r[3];let a=!1;const l=s(u=>{if(o.push(u),n){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,l()}}function oi(t,e){const n=ei.get(t),[r,i,o]=n;return o(r,i(),e)}function xf(t){return Wo.add(t),t}function y1(t,e){Object.keys(e).forEach(r=>{if(Object.getOwnPropertyDescriptor(t,r))throw new Error("object property already defined");const i=e[r],{get:o,set:s}=typeof i=="function"?{get:i}:i,a={};a.get=()=>o(oi(n)),s&&(a.set=l=>s(n,l)),Object.defineProperty(t,r,a)});const n=Wh(t);return n}function b1(t){for(;t.length>0;)t.pop();return t}var wf=t=>t?.constructor.name==="Array",k1=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Or(t[n],e[n]))return!1;return!0},Or=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(wf(t)&&wf(e))return k1(Array.from(t),Array.from(e));if(typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(e??Object.create(null)),r=n.length;for(let i=0;i<r;i++)if(!Reflect.has(t,n[i]))return!1;for(let i=0;i<r;i++){const o=n[i];if(!Or(t[o],e[o]))return!1}return!0},Ef=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,qn=t=>t,x1=()=>{},Cf=(...t)=>(...e)=>{t.forEach(function(n){n?.(...e)})},Sf=(()=>{let t=0;return()=>(t++,t.toString(36))})(),bl=t=>Array.isArray(t),ty=t=>t!=null&&typeof t=="object",Ga=t=>ty(t)&&!bl(t),w1=t=>typeof t=="number"&&!Number.isNaN(t),rn=t=>typeof t=="string",Os=t=>typeof t=="function",ny=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),E1=t=>Object.prototype.toString.call(t),ry=Function.prototype.toString,C1=ry.call(Object),S1=t=>{if(!ty(t)||E1(t)!="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=ny(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ry.call(n)==C1};function er(t){if(!T1(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(r=>typeof r=="string"),n={};for(const r of e){const i=t[r];i!==void 0&&(n[r]=er(i))}return n}var T1=t=>t&&typeof t=="object"&&t.constructor===Object;function Ja(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function Ya(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function Tf(t,e,n){typeof n.value=="object"&&(n.value=Zi(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function Zi(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(Zi(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(Zi(a),Zi(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(Zi(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)Tf(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||Tf(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}var O1=Object.defineProperty,A1=(t,e,n)=>e in t?O1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,G=(t,e,n)=>A1(t,typeof e!="symbol"?e+"":e,n);function iy(t,...e){for(const n of e){const r=er(n);for(const i in r)S1(n[i])?(t[i]||(t[i]={}),iy(t[i],n[i])):t[i]=n[i]}return t}function Of(t){return Zi(t)}function Qt(t){return rn(t)?{type:t}:t}function dr(t){return t?bl(t)?t.slice():[t]:[]}function oy(t){return Ga(t)&&t.predicate!=null}var M1=()=>!0;function _1(t,e,n,r){return i=>{var o;return rn(i)?!!((o=t[i])!=null&&o.call(t,e,n,r)):Os(i)?i(e,n,r):i.predicate(t)(e,n,r)}}function I1(t){return{predicate:e=>(n,r,i)=>!_1(e,n,r,i)(t)}}var Uh={not:I1};function sy(t,e){return t=t??M1,(n,r,i)=>{if(rn(t)){const o=e[t];return Os(o)?o(n,r,i):o}return oy(t)?t.predicate(e)(n,r,i):t?.(n,r,i)}}function vc(t,e){return(n,r,i)=>oy(t)?t.predicate(e)(n,r,i):t}function D1(t){var e,n;const r=t.computed??qn({}),i=t.context??qn({}),o=t.initial?(n=(e=t.states)==null?void 0:e[t.initial])==null?void 0:n.tags:[],s=Wh({value:t.initial??"",previousValue:"",event:qn({}),previousEvent:qn({}),context:y1(i,r),done:!1,tags:o??[],hasTag(a){return this.tags.includes(a)},matches(...a){return a.includes(this.value)},can(a){return qn(this).nextEvents.includes(a)},get nextEvents(){var a,l;const u=((l=(a=t.states)==null?void 0:a[this.value])==null?void 0:l.on)??{},c=t?.on??{};return Object.keys({...u,...c})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return qn(s)}function Vo(t,e){return(n,r)=>{if(w1(t))return t;if(Os(t))return t(n,r);if(rn(t)){const i=Number.parseFloat(t);if(!Number.isNaN(i))return i;if(e){const o=e?.[t];return Ya(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),Os(o)?o(n,r):o}}}}function R1(t){return rn(t)?{target:t}:t}function N1(t,e){return(n,r,i)=>dr(t).map(R1).find(o=>sy(o.guard,e)(n,r,i)??o.target??o.actions)}var P1=class{constructor(t,e){var n,r,i,o,s;G(this,"status","Not Started"),G(this,"state"),G(this,"initialState"),G(this,"initialContext"),G(this,"id"),G(this,"type","machine"),G(this,"activityEvents",new Map),G(this,"delayedEvents",new Map),G(this,"stateListeners",new Set),G(this,"doneListeners",new Set),G(this,"contextWatchers",new Set),G(this,"removeStateListener",x1),G(this,"parent"),G(this,"children",new Map),G(this,"guardMap"),G(this,"actionMap"),G(this,"delayMap"),G(this,"activityMap"),G(this,"sync"),G(this,"options"),G(this,"config"),G(this,"_created",()=>{var a;const l=Qt("machine.created");this.executeActions((a=this.config)==null?void 0:a.created,l)}),G(this,"start",a=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Sd(this.state,()=>{this.stateListeners.forEach(p=>{p(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Qt("machine.start"),dr(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Qt("machine.start"));const l=Qt("machine.init"),u=Ga(a)?a.value:a,c=Ga(a)?a.context:void 0;c&&this.setContext(c);const d={target:u??this.config.initial},h=this.getNextStateInfo(d,l);return this.initialState=h,this.performStateChangeEffects(this.state.value,h,l),this}),G(this,"setupContextWatchers",()=>{const{watch:a}=this.config;if(!a)return;let l=oi(this.state.context);const u=Sd(this.state.context,()=>{var c;const d=oi(this.state.context);for(const[h,p]of Object.entries(a))(((c=this.options.compareFns)==null?void 0:c[h])??Object.is)(l[h],d[h])||this.executeActions(p,this.state.event);l=d});this.contextWatchers.add(u)}),G(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Qt("machine.stop")),this.executeActions(this.config.exit,Qt("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),G(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),G(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(a=>a()),this.contextWatchers.clear()}),G(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(a=>{a.forEach(l=>l())}),this.delayedEvents.clear()}),G(this,"stopActivities",a=>{var l,u;a?((l=this.activityEvents.get(a))==null||l.forEach(c=>c()),(u=this.activityEvents.get(a))==null||u.clear(),this.activityEvents.delete(a)):(this.activityEvents.forEach(c=>{c.forEach(d=>d()),c.clear()}),this.activityEvents.clear())}),G(this,"sendChild",(a,l)=>{const u=Qt(a),c=Ef(l,this.contextSnapshot),d=this.children.get(c);d||Ya(`[@zag-js/core] Cannot send '${u.type}' event to unknown child`),d.send(u)}),G(this,"stopChild",a=>{this.children.has(a)||Ya(`[@zag-js/core > stop-child] Cannot stop unknown child ${a}`),this.children.get(a).stop(),this.children.delete(a)}),G(this,"removeChild",a=>{this.children.delete(a)}),G(this,"stopChildren",()=>{this.children.forEach(a=>a.stop()),this.children.clear()}),G(this,"setParent",a=>{this.parent=a}),G(this,"spawn",(a,l)=>{const u=Ef(a);return l&&(u.id=l),u.type="machine.actor",u.setParent(this),this.children.set(u.id,qn(u)),u.onDone(()=>{this.removeChild(u.id)}).start(),qn(xf(u))}),G(this,"stopActivity",a=>{var l;if(!this.state.value)return;const u=this.activityEvents.get(this.state.value);(l=u?.get(a))==null||l(),u?.delete(a)}),G(this,"addActivityCleanup",(a,l,u)=>{var c;a&&(this.activityEvents.has(a)?(c=this.activityEvents.get(a))==null||c.set(l,u):this.activityEvents.set(a,new Map([[l,u]])))}),G(this,"setState",a=>{this.state.previousValue=this.state.value,this.state.value=a;const l=this.getStateNode(a);a==null?b1(this.state.tags):this.state.tags=dr(l?.tags)}),G(this,"setContext",a=>{a&&iy(this.state.context,er(a))}),G(this,"setOptions",a=>{const l=er(a);this.actionMap={...this.actionMap,...l.actions},this.delayMap={...this.delayMap,...l.delays},this.activityMap={...this.activityMap,...l.activities},this.guardMap={...this.guardMap,...l.guards}}),G(this,"getStateNode",a=>{var l;if(a)return(l=this.config.states)==null?void 0:l[a]}),G(this,"getNextStateInfo",(a,l)=>{const u=this.determineTransition(a,l),c=!(u!=null&&u.target),d=u?.target??this.state.value,h=this.state.value!==d,p=this.getStateNode(d),f={reenter:!c&&!h&&!(u!=null&&u.internal),transition:u,stateNode:p,target:d,changed:h};return this.log("NextState:",`[${l.type}]`,this.state.value,"---->",f.target),f}),G(this,"getAfterActions",(a,l)=>{let u;const c=this.state.value;return{entry:()=>{u=globalThis.setTimeout(()=>{const d=this.getNextStateInfo(a,this.state.event);this.performStateChangeEffects(c,d,this.state.event)},l)},exit:()=>{globalThis.clearTimeout(u)}}}),G(this,"getDelayedEventActions",a=>{const l=this.getStateNode(a),u=this.state.event;if(!l||!l.after)return;const c=[],d=[];if(bl(l.after)){const h=this.determineTransition(l.after,u);if(!h)return;if(!ny(h,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(h)}`);const p=Vo(h.delay,this.delayMap)(this.contextSnapshot,u),f=this.getAfterActions(h,p);return c.push(f.entry),d.push(f.exit),{entries:c,exits:d}}if(Ga(l.after))for(const h in l.after){const p=l.after[h],f=Vo(h,this.delayMap)(this.contextSnapshot,u),m=this.getAfterActions(p,f);c.push(m.entry),d.push(m.exit)}return{entries:c,exits:d}}),G(this,"executeActions",(a,l)=>{var u;const c=vc(a,this.guardMap)(this.contextSnapshot,l,this.guardMeta);for(const d of dr(c)){const h=rn(d)?(u=this.actionMap)==null?void 0:u[d]:d;Ja(rn(d)&&!h,`[@zag-js/core > execute-actions] No implementation found for action: \`${d}\``),h?.(this.state.context,l,this.meta)}}),G(this,"executeActivities",(a,l,u)=>{var c;for(const d of l){const h=rn(d)?(c=this.activityMap)==null?void 0:c[d]:d;if(!h){Ja(`[@zag-js/core > execute-activity] No implementation found for activity: \`${d}\``);continue}const p=h(this.state.context,a,this.meta);if(p){const f=rn(d)?d:d.name||Sf();this.addActivityCleanup(u??this.state.value,f,p)}}}),G(this,"createEveryActivities",(a,l)=>{if(a)if(bl(a)){const u=dr(a).find(d=>{const h=d.delay,p=Vo(h,this.delayMap)(this.contextSnapshot,this.state.event);return sy(d.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??p!=null});if(!u)return;const c=Vo(u.delay,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const d=globalThis.setInterval(()=>{this.executeActions(u.actions,this.state.event)},c);return()=>{globalThis.clearInterval(d)}})}else for(const u in a){const c=a?.[u],d=Vo(u,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const h=globalThis.setInterval(()=>{this.executeActions(c,this.state.event)},d);return()=>{globalThis.clearInterval(h)}})}}),G(this,"setEvent",a=>{this.state.previousEvent=this.state.event,this.state.event=xf(Qt(a))}),G(this,"performExitEffects",(a,l)=>{const u=this.state.value;if(u==="")return;const c=a?this.getStateNode(a):void 0;this.stopActivities(u);const d=vc(c?.exit,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=dr(d),p=this.delayedEvents.get(u);p&&h.push(...p),this.executeActions(h,l),this.delayedEvents.delete(u)}),G(this,"performEntryEffects",(a,l)=>{const u=this.getStateNode(a),c=dr(u?.activities);this.createEveryActivities(u?.every,f=>{c.unshift(f)}),c.length>0&&this.executeActivities(l,c);const d=vc(u?.entry,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=dr(d),p=this.getDelayedEventActions(a);u!=null&&u.after&&p&&(this.delayedEvents.set(a,p?.exits),h.push(...p.entries)),this.executeActions(h,l),u?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(f=>{f(this.stateSnapshot)}),this.stop())}),G(this,"performTransitionEffects",(a,l)=>{const u=this.determineTransition(a,l);this.executeActions(u?.actions,l)}),G(this,"performStateChangeEffects",(a,l,u)=>{this.setEvent(u);const c=l.changed||l.reenter;c&&this.performExitEffects(a,u),this.performTransitionEffects(l.transition,u),this.setState(l.target),c&&this.performEntryEffects(l.target,u)}),G(this,"determineTransition",(a,l)=>{const u=N1(a,this.guardMap);return u?.(this.contextSnapshot,l,this.guardMeta)}),G(this,"sendParent",a=>{var l;this.parent||Ya("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const u=Qt(a);(l=this.parent)==null||l.send(u)}),G(this,"log",(...a)=>{}),G(this,"send",a=>{const l=Qt(a);this.transition(this.state.value,l)}),G(this,"transition",(a,l)=>{var u,c;const d=rn(a)?this.getStateNode(a):a?.stateNode,h=Qt(l);if(!d&&!this.config.on){const m=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${a}, \`event\`: ${h.type}`;Ja(m);return}const p=((u=d?.on)==null?void 0:u[h.type])??((c=this.config.on)==null?void 0:c[h.type]),f=this.getNextStateInfo(p,h);return this.performStateChangeEffects(this.state.value,f,h),f.stateNode}),G(this,"subscribe",a=>(this.stateListeners.add(a),this.status==="Running"&&a(this.stateSnapshot),()=>{this.stateListeners.delete(a)})),G(this,"onDone",a=>(this.doneListeners.add(a),this)),G(this,"onTransition",a=>(this.stateListeners.add(a),this.status==="Running"&&a(this.stateSnapshot),this)),this.config=Of(t),this.options=Of(e??{}),this.id=this.config.id??`machine-${Sf()}`,this.guardMap=((n=this.options)==null?void 0:n.guards)??{},this.actionMap=((r=this.options)==null?void 0:r.actions)??{},this.delayMap=((i=this.options)==null?void 0:i.delays)??{},this.activityMap=((o=this.options)==null?void 0:o.activities)??{},this.sync=((s=this.options)==null?void 0:s.sync)??!1,this.state=D1(this.config),this.initialContext=oi(this.state.context)}get stateSnapshot(){return qn(oi(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const t=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return t.stateSnapshot},get initialContext(){return t.initialContext},get initialState(){var e;return((e=t.initialState)==null?void 0:e.target)??""}}}get meta(){var t;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((t=this.initialState)==null?void 0:t.target)??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const t=this.getState();return{value:t.value,tags:t.tags}}},Gs=(t,e)=>new P1(t,e),Qi="default",Td="",Xa=new WeakMap;function F1(t={}){const{target:e,doc:n}=t,r=n??document,i=r.documentElement;return jh()?(Qi==="default"&&(Td=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),Qi="disabled"):e&&(Xa.set(e,e.style.userSelect),e.style.userSelect="none"),()=>L1({target:e,doc:r})}function L1(t={}){const{target:e,doc:n}=t,r=(n??document).documentElement;if(jh()){if(Qi!=="disabled")return;Qi="restoring",setTimeout(()=>{zh(()=>{Qi==="restoring"&&(r.style.webkitUserSelect==="none"&&(r.style.webkitUserSelect=Td||""),Td="",Qi="default")})},300)}else if(e&&Xa.has(e)){const i=Xa.get(e);e.style.userSelect==="none"&&(e.style.userSelect=i??""),e.getAttribute("style")===""&&e.removeAttribute("style"),Xa.delete(e)}}function B1(t={}){const{defer:e,target:n,...r}=t,i=e?Fr:s=>s(),o=[];return o.push(i(()=>{const s=typeof n=="function"?n():n;o.push(F1({...r,target:s}))})),()=>{o.forEach(s=>s?.())}}var vt=(t,e,n,r)=>{const i=typeof t=="function"?t():t;return i?.addEventListener(e,n,r),()=>{i?.removeEventListener(e,n,r)}},V1=t=>t.button===0,$1=t=>t.button===2||Kv()&&t.ctrlKey&&t.button===0,j1=t=>t.ctrlKey||t.altKey||t.metaKey;function Af(t,e,n){if(!t)return;const r=t.ownerDocument.defaultView||window,i=new r.CustomEvent(e,n);return t.dispatchEvent(i)}var z1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Mf={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function H1(t,e={}){const{dir:n="ltr",orientation:r="horizontal"}=e;let{key:i}=t;return i=z1[i]??i,n==="rtl"&&r==="horizontal"&&i in Mf&&(i=Mf[i]),i}function q1(t,e="client"){const n=t.touches[0]||t.changedTouches[0];return{x:n[`${e}X`],y:n[`${e}Y`]}}function W1(t,e="client"){return{x:t[`${e}X`],y:t[`${e}Y`]}}var U1=t=>"touches"in t&&t.touches.length>0;function Kh(t,e="client"){return U1(t)?q1(t,e):W1(t,e)}var K1=new Set(["PageUp","PageDown"]),G1=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function J1(t){return t.ctrlKey||t.metaKey?.1:K1.has(t.key)||t.shiftKey&&G1.has(t.key)?10:1}function _f(t){return Math.max(0,Math.min(1,t))}function Y1(t,e){const{left:n,top:r,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-n,y:t.y-r},a={x:_f(s.x/i),y:_f(s.y/o)};function l(u={}){const{dir:c="ltr",orientation:d="horizontal",inverted:h}=u,p=typeof h=="object"?h.x:h,f=typeof h=="object"?h.y:h;return d==="horizontal"?c==="rtl"||p?1-a.x:a.x:f?1-a.y:a.y}return{offset:s,percent:a,getPercentValue:l}}function X1(t,e){const{onPointerMove:n,onPointerUp:r}=e,i=[],o=[vt(t,"pointermove",s=>{const a=Kh(s);i.push({...a,timestamp:performance.now()});const l=Math.sqrt(a.x**2+a.y**2),u=s.pointerType==="touch"?10:5;if(!(l<u)){if(s.pointerType==="mouse"&&s.button===0){r();return}n({point:a,event:s,velocity:tE(i,.1)})}},!1),vt(t,"pointerup",r,!1),vt(t,"pointercancel",r,!1),vt(t,"contextmenu",r,!1),B1({doc:t})];return()=>{o.forEach(s=>s()),i.length=0}}function Z1(t){return t[t.length-1]}function Q1(t){return t*1e3}function eE(t){return t/1e3}function tE(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Z1(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Q1(e)));)n--;if(!r)return{x:0,y:0};const o=eE(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),{x:Math.abs(s.x),y:Math.abs(s.y)}}var yc=(...t)=>e=>t.reduce((n,r)=>r(n),e),ya=()=>{};function ay(t){const{pointerNode:e,keyboardNode:n=e,onPress:r,onPressStart:i,onPressEnd:o,isValidKey:s=b=>b.key==="Enter"}=t;if(!e)return ya;const a=Zn(e),l=Rn(e);let u=ya,c=ya,d=ya;const h=b=>({point:Kh(b),event:b});function p(b){i?.(h(b))}function f(b){o?.(h(b))}const m=vt(e,"pointerdown",b=>{c();const k=vt(a,"pointerup",w=>{const x=Qn(w);Ss(e,x)?r?.(h(w)):o?.(h(w))},{passive:!r}),v=vt(a,"pointercancel",f,{passive:!o});c=yc(k,v),l.activeElement===n&&b.pointerType==="mouse"&&b.preventDefault(),p(b)},{passive:!i}),g=vt(n,"focus",y);u=yc(m,g);function y(){const b=x=>{if(!s(x))return;const _=S=>{if(!s(S))return;const O=new a.PointerEvent("pointerup"),C=h(O);r?.(C),o?.(C)};c(),c=vt(n,"keyup",_);const A=new a.PointerEvent("pointerdown");p(A)},k=()=>{const x=new a.PointerEvent("pointercancel");f(x)},v=vt(n,"keydown",b),w=vt(n,"blur",k);d=yc(v,w)}return function(){u(),c(),d()}}var Gh=t=>t.ownerDocument.defaultView||window;function ly(t,e){const{type:n="HTMLInputElement",property:r="value"}=e,i=Gh(t)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function nE(t,e,n={}){var r;(r=ly(t,n).set)==null||r.call(t,e),t.setAttribute("value",e)}function uy(t,e){var n;(n=ly(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e),e?t.setAttribute("checked",""):t.removeAttribute("checked")}function rE(t,e){const{value:n,bubbles:r=!0}=e;if(!t)return;const i=Gh(t);t instanceof i.HTMLInputElement&&(nE(t,`${n}`),t.dispatchEvent(new i.Event("input",{bubbles:r})))}function Jh(t,e){const{checked:n,bubbles:r=!0}=e;if(!t)return;const i=Gh(t);t instanceof i.HTMLInputElement&&(uy(t,n),t.dispatchEvent(new i.Event("click",{bubbles:r})))}function iE(t){return oE(t)?t.form:t.closest("form")}function oE(t){return t.matches("textarea, input, select, button")}function sE(t,e){if(!t)return;const n=iE(t);return n?.addEventListener("reset",e,{passive:!0}),()=>{n?.removeEventListener("reset",e)}}function aE(t,e){const n=t?.closest("fieldset");if(!n)return;e(n.disabled);const r=n.ownerDocument.defaultView||window,i=new r.MutationObserver(()=>e(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function Iu(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:r}=e,i=[sE(t,r),aE(t,n)];return()=>{i.forEach(o=>o?.())}}function lE(t){return new Proxy({},{get(){return t}})}var Mi=()=>t=>Array.from(new Set(t)),uE=Tr("checkbox").parts("root","label","control","indicator"),ba=uE.build(),tt=Ks({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`checkbox:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`checkbox:${t.id}:label`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`checkbox:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`checkbox:${t.id}:input`},getRootEl:t=>tt.getById(t,tt.getRootId(t)),getHiddenInputEl:t=>tt.getById(t,tt.getHiddenInputId(t))});function cE(t,e,n){const r=t.context.isDisabled,i=t.context.readOnly,o=!r&&t.context.focused,s=!r&&t.context.focusVisible,a=t.context.isChecked,l=t.context.isIndeterminate,u={"data-active":Z(t.context.active),"data-focus":Z(o),"data-focus-visible":Z(s),"data-readonly":Z(i),"data-hover":Z(t.context.hovered),"data-disabled":Z(r),"data-state":l?"indeterminate":t.context.checked?"checked":"unchecked","data-invalid":Z(t.context.invalid)};return{checked:a,disabled:r,indeterminate:l,focused:o,checkedState:t.context.checked,setChecked(c){e({type:"CHECKED.SET",checked:c,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:a,isTrusted:!1})},getRootProps(){return n.label({...ba.root.attrs,...u,dir:t.context.dir,id:tt.getRootId(t.context),htmlFor:tt.getHiddenInputId(t.context),onPointerMove(){r||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){r||e({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(c){Qn(c)===tt.getHiddenInputEl(t.context)&&c.stopPropagation()}})},getLabelProps(){return n.element({...ba.label.attrs,...u,dir:t.context.dir,id:tt.getLabelId(t.context)})},getControlProps(){return n.element({...ba.control.attrs,...u,dir:t.context.dir,id:tt.getControlId(t.context),"aria-hidden":!0})},getIndicatorProps(){return n.element({...ba.indicator.attrs,...u,dir:t.context.dir,hidden:!l&&!t.context.checked})},getHiddenInputProps(){return n.input({id:tt.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:a,disabled:r,"aria-labelledby":tt.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:Hh,onFocus(){const c=Ts();e({type:"CONTEXT.SET",context:{focused:!0,focusVisible:c}})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(c){if(i){c.preventDefault();return}const d=c.currentTarget.checked;e({type:"CHECKED.SET",checked:d,isTrusted:!0})}})}}}var{not:If}=Uh;function dE(t){const e=er(t);return Gs({id:"checkbox",initial:"ready",context:{checked:!1,value:"on",disabled:!1,...e,fieldsetDisabled:!1,focusVisible:!1},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:If("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:If("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{isIndeterminate:n=>Od(n.checked),isChecked:n=>Df(n.checked),isDisabled:n=>!!n.disabled||n.fieldsetDisabled},states:{ready:{}}},{guards:{isTrusted:(n,r)=>!!r.isTrusted},activities:{trackPressEvent(n){if(!n.isDisabled)return ay({pointerNode:tt.getRootEl(n),keyboardNode:tt.getHiddenInputEl(n),isValidKey:r=>r.key===" ",onPress:()=>n.active=!1,onPressStart:()=>n.active=!0,onPressEnd:()=>n.active=!1})},trackFocusVisible(n){if(!n.isDisabled)return qh({root:tt.getRootNode(n)})},trackFormControlState(n,r,{send:i,initialContext:o}){return Iu(tt.getHiddenInputEl(n),{onFieldsetDisabledChange(s){n.fieldsetDisabled=s},onFormReset(){i({type:"CHECKED.SET",checked:!!o.checked})}})}},actions:{setContext(n,r){Object.assign(n,r.context)},syncInputElement(n){const r=tt.getHiddenInputEl(n);r&&(uy(r,n.isChecked),r.indeterminate=n.isIndeterminate)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1,n.focusVisible=!1)},setChecked(n,r){Rf.checked(n,r.checked)},toggleChecked(n){const r=Od(n.checked)?!0:!n.checked;Rf.checked(n,r)},dispatchChangeEvent(n){const r=tt.getHiddenInputEl(n);Jh(r,{checked:Df(n.checked)})}}})}function Od(t){return t==="indeterminate"}function Df(t){return Od(t)?!1:!!t}var hE={change:t=>{var e;(e=t.onCheckedChange)==null||e.call(t,{checked:t.checked})}},Rf={checked:(t,e)=>{Or(t.checked,e)||(t.checked=e,hE.change(t))}};Mi()(["checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);function pE(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}var Nf={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"};function fE(t){return t in Nf?Nf[t]:t.startsWith("on")?`on${pE(t.substr(2))}`:t.toLowerCase()}var _i=lE(t=>{const e={};for(const n in t){const r=t[n];n==="children"?typeof r=="string"&&(e.innerHTML=r):e[fE(n)]=t[n]}return e});function mE(t,e){const{actions:n,context:r}=e??{},i=Ev(t.state),o=Sd(t.state,()=>{i.value=oi(t.state)});return Cv(()=>{o?.()}),Dh(()=>{t.setOptions({actions:n})}),r&&Fe(r,s=>{t.setContext(z(s))},{deep:!0}),i}function gE(t,e){const{state:n,context:r}=e??{},i=typeof t=="function"?t():t;return r&&i.setContext(z(r)),i._created(),or(()=>{i.start(n),Mo(()=>{i.stop()})}),i}function Ii(t,e){const n=gE(t,e);return[mE(n,e),n.send,n]}function Sn(t={}){const{prefix:e}=t,n=kw();return e?`${e}-${n}`:n}const vE={key:0,class:"k-checkbox__help"},Pf=ie({__name:"Checkbox",props:{modelValue:{type:[Boolean,Array]},value:{},label:{},disabled:{type:Boolean},required:{type:Boolean},help:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;if(n.modelValue instanceof Array&&!n.value)throw new Error("props.value is required if props.modelValue is an array");const r=e,i=()=>{const{modelValue:c,value:d}=n;return c instanceof Array?c.some(h=>ga(h)===ga(d)):!!c};function o(c){const{modelValue:d,value:h}=n;if(!(d instanceof Array))return r("update:modelValue",typeof c=="boolean"?c:void 0);if(!(typeof c!="boolean"||!h))return c?r("update:modelValue",[...d,h]):r("update:modelValue",d.filter(p=>ga(p)!==ga(h)))}const s={id:Sn(),checked:i(),onCheckedChange:({checked:c})=>{if(i()!==c)return o(c)}},[a,l]=Ii(dE(s),{context:P(()=>({disabled:n.disabled,required:n.required}))}),u=P(()=>cE(a.value,l,_i));return Fe(()=>n.modelValue,()=>{const c=i();if(u.value.checked!==c)return u.value.setChecked(c)}),(c,d)=>(E(),I("label",se({class:"k-checkbox"},u.value.getRootProps()),[W("div",Se(_e(u.value.getControlProps())),[u.value.checked?(E(),U(z(We),{key:0,icon:"fa-pro-solid:check"})):F("",!0)],16),W("span",Se(_e(u.value.getLabelProps())),[W("span",{class:Me(["k-checkbox__label",{"k-checkbox__label-required":c.required}])},[B(c.$slots,"default",{},()=>[ct(ce(c.label),1)])],2),c.$slots.help||c.help?(E(),I("span",vE,[B(c.$slots,"help",{},()=>[ct(ce(c.help),1)])])):F("",!0)],16),W("input",Se(_e(u.value.getHiddenInputProps())),null,16)],16))}}),Yh=Symbol("form-control"),yE={class:"k-formcontrol"},bE=["for"],kE={key:1,class:"k-formcontrol__error"},xE={key:2,class:"k-formcontrol__help"},wE=ie({__name:"FormControl",props:{label:{},help:{},error:{},required:{type:Boolean}},emits:["blur","focus"],setup(t,{emit:e}){const n=t,r=e,i=Sn({prefix:"k-formcontrol"}),o=P(()=>`${i}_label`),s=P(()=>`${i}_help`),a={onBlur:()=>r("blur"),onFocus:()=>r("focus")};return ax(Yh,P(()=>({...n,id:i,labelId:o.value,helpId:s.value,invalid:!!n.error,required:n.required,events:a}))),(l,u)=>(E(),I("div",yE,[l.$slots.label||l.label?(E(),I("label",{key:0,class:Me(["k-formcontrol__label",{"k-formcontrol__label-required":l.required}]),for:z(i)},[B(l.$slots,"label",{},()=>[ct(ce(l.label),1)])],10,bE)):F("",!0),B(l.$slots,"default",{id:z(i)}),l.$slots.error||l.error?(E(),I("span",kE,[B(l.$slots,"error",{},()=>[ct(ce(l.error),1)])])):F("",!0),l.$slots.help||l.help?(E(),I("span",xE,[B(l.$slots,"help",{},()=>[ct(ce(l.help),1)])])):F("",!0)]))}}),EE={class:"k-filter-type-dropdown"},CE=ie({__name:"Dropdown",props:md({label:{},items:{}},{modelValue:{default:""},modelModifiers:{}}),emits:md(["disable"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=kv(t,"modelValue"),i=P(()=>{var a,l;return`${(r.value?[r.value]:[(l=(a=n.items)==null?void 0:a[0])==null?void 0:l.value]).map(u=>{var c;return(c=n.items.find(d=>d.value===u))==null?void 0:c.label}).join(", ")}`}),o=P(()=>n.items.map(a=>({...a,action:()=>s.value=a.value}))),s=P({get(){return r.value},set(a){r.value=a}});return(a,l)=>(E(),I("div",EE,[ke(z(wE),{label:a.label},{default:te(()=>[ke(z(ju),{placement:"bottom-start",label:i.value,modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=u=>s.value=u),items:o.value},null,8,["label","modelValue","items"])]),_:1},8,["label"])]))}}),SE=Object.freeze(Object.defineProperty({__proto__:null,default:CE},Symbol.toStringTag,{value:"Module"}));function TE(t,e){let n,r,i;const o=Q(!0),s=()=>{o.value=!0,i()};Fe(t,s,{flush:"sync"});const a=typeof e=="function"?e:e.get,l=typeof e=="function"?void 0:e.set,u=wv((c,d)=>(r=c,i=d,{get(){return o.value&&(n=a(),o.value=!1),r(),n},set(h){l?.(h)}}));return Object.isExtensible(u)&&(u.trigger=s),u}function cy(t){return dx()?(hx(t),!0):!1}function Xh(t){return typeof t=="function"?t():z(t)}const OE=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const AE=t=>t!=null,ME=Object.prototype.toString,_E=t=>ME.call(t)==="[object Object]",IE=()=>{};function dy(t){var e;const n=Xh(t);return(e=n?.$el)!=null?e:n}const hy=OE?window:void 0;function DE(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=hy):[e,n,r,i]=t,!e)return IE;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,d,h,p)=>(c.addEventListener(d,h,p),()=>c.removeEventListener(d,h,p)),l=Fe(()=>[dy(e),Xh(i)],([c,d])=>{if(s(),!c)return;const h=_E(d)?{...d}:d;o.push(...n.flatMap(p=>r.map(f=>a(c,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return cy(u),u}function RE(){const t=Q(!1),e=Nh();return e&&or(()=>{t.value=!0},e),t}function NE(t){const e=RE();return P(()=>(e.value,!!t()))}function PE(t,e,n={}){const{window:r=hy,...i}=n;let o;const s=NE(()=>r&&"MutationObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},l=P(()=>{const h=Xh(t),p=(Array.isArray(h)?h:[h]).map(dy).filter(AE);return new Set(p)}),u=Fe(()=>l.value,h=>{a(),s.value&&h.size&&(o=new MutationObserver(e),h.forEach(p=>o.observe(p,i)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),d=()=>{a(),u()};return cy(d),{isSupported:s,stop:d,takeRecords:c}}function Zh(t){const e=Nh(),n=TE(()=>null,()=>e.proxy.$el);return sx(n.trigger),or(n.trigger),n}const FE={class:"k-filter-type-range"},LE={class:"k-filter-type-range__header"},BE={class:"k-filter-type-range__header-label"},VE={class:"k-filter-type-range__value"},$E={class:"k-filter-type-range__value-display"},jE=ie({__name:"RangeSlider",props:md({min:{},max:{},label:{},suffix:{},step:{},type:{}},{modelValue:{default:[0,1e3]},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=kv(t,"modelValue"),n=Zh();function r(){return!n.value||!("getRootNode"in n.value)?document:n.value.getRootNode()}const i=t;function o(s){return[s,i.suffix].filter(Boolean).join(" ")}return(s,a)=>(E(),I("div",FE,[W("div",LE,[W("label",BE,[W("span",null,ce(s.label),1),ke(z(We),{icon:s.$attrs.icon},null,8,["icon"])]),B(s.$slots,"remove")]),W("div",VE,[ke(z(QC),se({modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l)},i,{"min-steps-between-thumbs":1,"get-root-node":r}),null,16,["modelValue"]),W("div",$E,[W("span",null,ce(o(e.value[0])),1),W("span",null,ce(o(e.value[1])),1)])])]))}}),zE=Object.freeze(Object.defineProperty({__proto__:null,default:jE},Symbol.toStringTag,{value:"Module"})),Ff=Object.assign({"./Dropdown.vue":SE,"./RangeSlider.vue":zE});for(const t in Ff)t.replace(/(\.\/|\.vue)/g,""),Ff[t].default;function Ar(t){return typeof t=="string"||t instanceof String}function Lf(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function py(t,e){return Array.isArray(e)?py(t,(n,r)=>e.includes(r)):Object.entries(t).reduce((n,r)=>{let[i,o]=r;return e(o,i)&&(n[i]=o),n},{})}const Y={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function HE(t){switch(t){case Y.LEFT:return Y.FORCE_LEFT;case Y.RIGHT:return Y.FORCE_RIGHT;default:return t}}function bc(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function kl(t,e){if(e===t)return!0;const n=Array.isArray(e),r=Array.isArray(t);let i;if(n&&r){if(e.length!=t.length)return!1;for(i=0;i<e.length;i++)if(!kl(e[i],t[i]))return!1;return!0}if(n!=r)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const o=e instanceof Date,s=t instanceof Date;if(o&&s)return e.getTime()==t.getTime();if(o!=s)return!1;const a=e instanceof RegExp,l=t instanceof RegExp;if(a&&l)return e.toString()==t.toString();if(a!=l)return!1;const u=Object.keys(e);for(i=0;i<u.length;i++)if(!Object.prototype.hasOwnProperty.call(t,u[i]))return!1;for(i=0;i<u.length;i++)if(!kl(t[u[i]],e[u[i]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class qE{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Y.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Y.RIGHT:Y.LEFT}}function ae(t,e){return new ae.InputMask(t,e)}function fy(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?ae.MaskedRegExp:Ar(t)?ae.MaskedPattern:t===Date?ae.MaskedDate:t===Number?ae.MaskedNumber:Array.isArray(t)||t===Array?ae.MaskedDynamic:ae.Masked&&t.prototype instanceof ae.Masked?t:ae.Masked&&t instanceof ae.Masked?t.constructor:t instanceof Function?ae.MaskedFunction:(console.warn("Mask not found for mask",t),ae.Masked)}function As(t){if(!t)throw new Error("Options in not defined");if(ae.Masked){if(t.prototype instanceof ae.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof ae.Masked?{mask:t}:Lf(t)&&t.mask instanceof ae.Masked?t:{};if(e){const r=e.mask;return{...py(e,(i,o)=>!o.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return Lf(t)?{...t}:{mask:t}}function tr(t){if(ae.Masked&&t instanceof ae.Masked)return t;const e=As(t),n=fy(e.mask);if(!n)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}ae.createMask=tr;class Qh{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}ae.MaskElement=Qh;const Bf=90,WE=89;class Du extends Qh{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,n,r;return(e=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===Bf&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===WE&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===Bf&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ae.HTMLMaskElement=Du;class UE extends Du{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}ae.HTMLMaskElement=Du;class my extends Du{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,o=i.getSelection&&i.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}ae.HTMLContenteditableMaskElement=my;class Ru{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Ru.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Ru.MAX_LENGTH=100;class KE{constructor(e,n){this.el=e instanceof Qh?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new my(e):new UE(e),this.masked=tr(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Ru,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof ae.Masked)&&this.masked.constructor===fy(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof ae.Masked?e:tr({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const r=this._listeners[e];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const n=this.masked.unmaskedValue,r=this.masked.value,i=this.masked.rawInputValue,o=this.displayValue,s=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==o&&(this.el.value=o),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:n,...r}=e,i=!this.maskEquals(n),o=this.masked.optionsIsChanged(r);i&&(this.mask=n),o&&this.masked.updateOptions(r),(i||o)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Y.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(n);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const n=new qE({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?n.removeDirection:Y.NONE;let s=this.masked.nearestInputPos(n.startChangePos+i,o);o!==Y.NONE&&(s=this.masked.nearestInputPos(s,Y.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ae.InputMask=KE;class ge{static normalize(e){return Array.isArray(e)?e:[e,new ge]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}ae.ChangeDetails=ge;class bn{constructor(e,n,r){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class dt{constructor(e){this._value="",this._update({...dt.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new bn(this.extractInput(e,n),e)}appendTail(e){return Ar(e)&&(e=new bn(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new ge({inserted:e,rawInserted:e})):new ge}_appendChar(e,n,r){n===void 0&&(n={});const i=this.state;let o;if([e,o]=this.doPrepareChar(e,n),e&&(o=o.aggregate(this._appendCharRaw(e,n)),!o.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=i;let a=this.pad(n);const l=this._appendCharRaw(e,n);a=a.aggregate(l),l.rawInserted||a.equals(o)?o=a:this.state=s}if(o.inserted){let s,a=this.doValidate(n)!==!1;if(a&&r!=null){const l=this.state;if(this.overwrite===!0){s=r.state;for(let c=0;c<o.rawInserted.length;++c)r.unshift(this.displayValue.length-o.tailShift)}let u=this.appendTail(r);if(a=u.rawInserted.length===r.toString().length,!(a&&u.inserted)&&this.overwrite==="shift"){this.state=l,s=r.state;for(let c=0;c<o.rawInserted.length;++c)r.shift();u=this.appendTail(r),a=u.rawInserted.length===r.toString().length}a&&u.inserted&&(this.state=l)}a||(o=new ge,this.state=i,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new ge}_appendEager(){return new ge}append(e,n,r){if(!Ar(e))throw new Error("value should be string");const i=Ar(r)?new bn(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let o;[e,o]=this.doPrepare(e,n);for(let s=0;s<e.length;++s){const a=this._appendChar(e[s],n,i);if(!a.rawInserted&&!this.doSkipInvalid(e[s],n,i))break;o.aggregate(a)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&o.aggregate(this._appendEager()),i!=null&&(o.tailShift+=this.appendTail(i).tailShift),o}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new ge}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=e();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,r=e(this);return this.state=n,delete this._isolated,r}doSkipInvalid(e,n,r){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),ge.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),ge.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,r,i,o){r===void 0&&(r=""),i===void 0&&(i=Y.NONE),o===void 0&&(o={input:!0});const s=e+n,a=this.extractTail(s),l=this.eager===!0||this.eager==="remove";let u;l&&(i=HE(i),u=this.extractInput(0,s,{raw:!0}));let c=e;const d=new ge;if(i!==Y.NONE&&(c=this.nearestInputPos(e,n>1&&e!==0&&!l?Y.NONE:i),d.tailShift=c-e),d.aggregate(this.remove(c)),l&&i!==Y.NONE&&u===this.rawInputValue)if(i===Y.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new ge({tailShift:-1})).aggregate(this.remove(h-1))}else i===Y.FORCE_RIGHT&&a.unshift();return d.aggregate(this.append(r,o,a))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!kl(this,e)}typedValueEquals(e){const n=this.typedValue;return e===n||dt.EMPTY_VALUES.includes(e)&&dt.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new ge}}dt.DEFAULTS={skipInvalid:!0};dt.EMPTY_VALUES=[void 0,null,""];ae.Masked=dt;class si{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Ar(e)?new bn(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof bn)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof si){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof ae.MaskedPattern))return new bn(this.toString()).appendTo(e);const n=new ge;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],o=e._mapPosToBlock(e.displayValue.length),s=i.stop;let a;if(s!=null&&(!o||o.index<=s)&&((i instanceof si||e._stops.indexOf(s)>=0)&&n.aggregate(e._appendPlaceholder(s)),a=i instanceof si&&e._blocks[s]),a){const l=a.appendTail(i);n.aggregate(l);const u=i.toString().slice(l.rawInserted.length);u&&n.aggregate(e.append(u,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...r}=e;Object.assign(this,r),this.chunks=n.map(i=>{const o="chunks"in i?new si:new bn;return o.state=i,o})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],o=i.unshift(n);if(i.toString()){if(!o)break;++r}else this.chunks.splice(r,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],r=n.shift();if(n.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class GE{constructor(e,n){this.masked=e,this._log=[];const{offset:r,index:i}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Y.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Y.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Y.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Y.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Y.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Y.NONE),!0})}}class gy{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new ge}nearestInputPos(e,n){n===void 0&&(n=Y.NONE);const r=0,i=this._value.length;switch(n){case Y.LEFT:case Y.FORCE_LEFT:return r;case Y.NONE:case Y.RIGHT:case Y.FORCE_RIGHT:default:return i}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new ge;const r=this.eager===!0||this.eager==="append",i=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new ge({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new ge;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new bn("")}appendTail(e){return Ar(e)&&(e=new bn(String(e))),e.appendTo(this)}append(e,n,r){const i=this._appendChar(e[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class xl{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a,...l}=e;this.masked=tr(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:o,lazy:s,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new ge}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new ge;const r=this.masked.state;let i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new ge,this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,n,r){return this.masked.append(e,this.currentMaskFlags(n),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ge:(this.isFilled=!0,new ge({inserted:this.placeholderChar}))}_appendEager(){return new ge}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,r)}nearestInputPos(e,n){n===void 0&&(n=Y.NONE);const r=0,i=this.value.length,o=Math.min(Math.max(e,r),i);switch(n){case Y.LEFT:case Y.FORCE_LEFT:return this.isComplete?o:r;case Y.RIGHT:case Y.FORCE_RIGHT:return this.isComplete?o:i;case Y.NONE:default:return o}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||e?._beforeTailState}}pad(e){return new ge}}xl.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class JE extends dt{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}ae.MaskedRegExp=JE;class ht extends dt{constructor(e){super({...ht.DEFAULTS,...e,definitions:Object.assign({},xl.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let r=!1,i=!1;for(let o=0;o<n.length;++o){if(this.blocks){const u=n.slice(o),c=Object.keys(this.blocks).filter(h=>u.indexOf(h)===0);c.sort((h,p)=>p.length-h.length);const d=c[0];if(d){const{expose:h,repeat:p,...f}=As(this.blocks[d]),m={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...f,repeat:p,parent:this},g=p!=null?new ae.RepeatBlock(m):tr(m);g&&(this._blocks.push(g),h&&(this.exposeBlock=g),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),o+=d.length-1;continue}}let s=n[o],a=s in e;if(s===ht.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){i=!i;continue}if(s===ht.ESCAPE_CHAR){if(++o,s=n[o],!s)break;a=!1}const l=a?new xl({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...As(e[s]),parent:this}):new gy({char:s,eager:this.eager,isUnmasking:r});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:n,...r}=e;this._blocks.forEach((i,o)=>i.state=n[o]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new ge;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const o=this._blocks[i]._appendEager();if(!o.inserted)break;n.aggregate(o)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new ge;if(!r)return i;for(let s=r.index,a;a=this._blocks[s];++s){var o;const l=a._appendChar(e,{...n,_beforeTailState:(o=n._beforeTailState)==null||(o=o._blocks)==null?void 0:o[s]});if(i.aggregate(l),l.consumed)break}return i}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=new si;return e===n||this._forEachBlocksInRange(e,n,(i,o,s,a)=>{const l=i.extractTail(s,a);l.stop=this._findStopBefore(o),l.from=this._blockStartPos(o),l instanceof si&&(l.blockIndex=o),r.extend(l)}),r}extractInput(e,n,r){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),e===n)return"";let i="";return this._forEachBlocksInRange(e,n,(o,s,a,l)=>{i+=o.extractInput(a,l,r)}),i}_findStopBefore(e){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=e)n=i;else break}return n}_appendPlaceholder(e){const n=new ge;if(this.lazy&&e==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,o=e??this._blocks.length;return this._blocks.slice(i,o).forEach(s=>{if(!s.lazy||e!=null){var a;n.aggregate(s._appendPlaceholder((a=s._blocks)==null?void 0:a.length))}}),n}_mapPosToBlock(e){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],o=n.length;if(n+=i.displayValue,e<=n.length)return{index:r,offset:e-o}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(e,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const o=this._mapPosToBlock(n),s=o&&i.index===o.index,a=i.offset,l=o&&s?o.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,a,l),o&&!s){for(let u=i.index+1;u<o.index;++u)r(this._blocks[u],u,0,this._blocks[u].displayValue.length);r(this._blocks[o.index],o.index,0,o.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._forEachBlocksInRange(e,n,(i,o,s,a)=>{r.aggregate(i.remove(s,a))}),r}nearestInputPos(e,n){if(n===void 0&&(n=Y.NONE),!this._blocks.length)return 0;const r=new GE(this,e);if(n===Y.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Y.LEFT||n===Y.FORCE_LEFT){if(n===Y.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Y.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:n===Y.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Y.RIGHT||n===Y.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Y.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,Y.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,n,(i,o,s,a)=>{r+=i.totalInputPositions(s,a)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(r=>this._blocks[r]):[]}pad(e){const n=new ge;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(e))),n}}ht.DEFAULTS={...dt.DEFAULTS,lazy:!0,placeholderChar:"_"};ht.STOP_CHAR="`";ht.ESCAPE_CHAR="\\";ht.InputDefinition=xl;ht.FixedDefinition=gy;ae.MaskedPattern=ht;class Za extends ht{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:o=this.autofix,...s}=e;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<l.length&&l[u]===a[u];)++u;s.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",r="";const[,i,o]=e.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(n="0".repeat(i.length)+o,r="9".repeat(i.length)+o),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(e,n){n===void 0&&(n={});let r;return[e,r]=super.doPrepareChar(e.replace(/\D/g,""),n),e||(r.skip=!this.isComplete),[e,r]}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,n);const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[o,s]=this.boundaries(this.value+e);return Number(s)<this.from?super._appendCharRaw(r[this.value.length],n):Number(o)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],n).aggregate(this._appendCharRaw(e,n)):super._appendCharRaw(i[this.value.length],n):super._appendCharRaw(e,n)}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[r,i]=this.boundaries(n);return this.from<=Number(i)&&Number(r)<=this.to&&super.doValidate(e)}pad(e){const n=new ge;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let o=0;o<i;++o)n.aggregate(super._appendCharRaw("0",e));r.split("").forEach(o=>this._appendCharRaw(o))}return n}}ae.MaskedRange=Za;const YE="d{.}`m{.}`Y";class Un extends ht{static extractPatternOptions(e){const{mask:n,pattern:r,...i}=e;return{...i,mask:Ar(n)?n:r}}constructor(e){super(Un.extractPatternOptions({...Un.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...o}={...Un.DEFAULTS,...e},s=Object.assign({},Un.GET_DEFAULT_BLOCKS());e.min&&(s.Y.from=e.min.getFullYear()),e.max&&(s.Y.to=e.max.getFullYear()),e.min&&e.max&&s.Y.from===s.Y.to&&(s.m.from=e.min.getMonth()+1,s.m.to=e.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=e.min.getDate(),s.d.to=e.max.getDate())),Object.assign(s,this.blocks,i),super._update({...o,mask:Ar(n)?n:r,blocks:s})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(Un.extractPatternOptions(e))}}Un.GET_DEFAULT_BLOCKS=()=>({d:{mask:Za,from:1,to:31,maxLength:2},m:{mask:Za,from:1,to:12,maxLength:2},Y:{mask:Za,from:1900,to:9999}});Un.DEFAULTS={...ht.DEFAULTS,mask:Date,pattern:YE,format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear();return[n,r,i].join(".")},parse:(t,e)=>{const[n,r,i]=t.split(".").map(Number);return new Date(i,r-1,n)}};ae.MaskedDate=Un;class Nu extends dt{constructor(e){super({...Nu.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:r,...i}=As(n),o=tr({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=o),o}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._applyDispatch(e,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),r}_applyDispatch(e,n,r){e===void 0&&(e=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,o=this.rawInputValue,s=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:o,a=o.slice(s.length),l=this.currentMask,u=new ge,c=l?.state;return this.currentMask=this.doDispatch(e,{...n},r),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),u.tailShift=this.currentMask.value.length-i.length),a&&(u.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),u}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new ge;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,r;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(e,this,n,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[r,i]=super.doPrepare(e,n);if(this.currentMask){let o;[r,o]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(o)}return[r,i]}doPrepareChar(e,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(e,n);if(this.currentMask){let o;[r,o]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(o)}return[r,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const r=new ge;return this.currentMask&&r.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...o}=e;n&&this.compiledMasks.forEach((s,a)=>s.state=n[a]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=o}extractInput(e,n,r){return this.currentMask?this.currentMask.extractInput(e,n,r):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,r)=>{if(!e[r])return;const{mask:i,...o}=e[r];return kl(n,o)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}Nu.DEFAULTS={...dt.DEFAULTS,dispatch:(t,e,n,r)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,o=e.compiledMasks.map((s,a)=>{const l=e.currentMask===s,u=l?s.displayValue.length:s.nearestInputPos(s.displayValue.length,Y.FORCE_LEFT);return s.rawInputValue!==i?(s.reset(),s.append(i,{raw:!0})):l||s.remove(u),s.append(t,e.currentMaskFlags(n)),s.appendTail(r),{index:a,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(u,s.nearestInputPos(s.displayValue.length,Y.FORCE_LEFT)))}});return o.sort((s,a)=>a.weight-s.weight||a.totalInputPositions-s.totalInputPositions),e.compiledMasks[o[0].index]}};ae.MaskedDynamic=Nu;class Pu extends ht{constructor(e){super({...Pu.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...r}=e;if(n){const i=n.map(a=>a.length),o=Math.min(...i),s=Math.max(...i)-o;r.mask="*".repeat(o),s&&(r.mask+="["+"*".repeat(s)+"]"),this.enum=n}super._update(r)}_appendCharRaw(e,n){n===void 0&&(n={});const r=Math.min(this.nearestInputPos(0,Y.FORCE_RIGHT),this.value.length),i=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+e,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,a)=>{const l=i[0][a];a>=this.value.length||l===s.value||(s.reset(),s._appendChar(l,n))});const o=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(s=>o.aggregate(super._appendCharRaw(s))),o}return new ge({skip:!this.isComplete})}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new bn("",e)}remove(e,n){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),e===n)return new ge;const r=Math.min(super.nearestInputPos(0,Y.FORCE_RIGHT),this.value.length);let i;for(i=e;i>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(r,i),r)).length>1);--i);const o=super.remove(i,n);return o.tailShift+=i-e,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}Pu.DEFAULTS={...ht.DEFAULTS,matchValue:(t,e,n)=>t.indexOf(e,n)===n};ae.MaskedEnum=Pu;class XE extends dt{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}ae.MaskedFunction=XE;var vy;class Dt extends dt{constructor(e){super({...Dt.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+bc(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(bc).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(bc(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(e,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,r))}_appendCharRaw(e,n){n===void 0&&(n={});const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=e;const s=this.number;let a=!isNaN(s),l=!1;if(a){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(Dt.UNMASKED_RADIX,this.radix),l||(l=o===this._value&&!n.tail)):a=!1),a&&(a=!!this._value.match(this._numberRegExp))}let u;a?u=new ge({inserted:this._value.slice(o.length),rawInserted:l?"":e,skip:l}):(this._value=o,u=new ge),this._value=this._insertThousandsSeparators(this._value);const c=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return u.tailShift+=(d-i)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,n){const r=this._findSeparatorAround(e);r>=0&&(e=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const r=this.value.slice(0,e),i=this.value.slice(n),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const s=this._separatorsCountFromSlice(r);return new ge({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case Y.NONE:case Y.LEFT:case Y.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(e<i||this.value.length<=i||n===Y.FORCE_LEFT)return r}break}case Y.RIGHT:case Y.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,o,s)=>i+s),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,r){n===void 0&&(n={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Dt.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Dt.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Dt.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Dt.EMPTY_VALUES.includes(e)&&Dt.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}vy=Dt;Dt.UNMASKED_RADIX=".";Dt.EMPTY_VALUES=[...dt.EMPTY_VALUES,0];Dt.DEFAULTS={...dt.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[vy.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};ae.MaskedNumber=Dt;const Ad={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function yy(t,e,n){e===void 0&&(e=Ad.MASKED),n===void 0&&(n=Ad.MASKED);const r=tr(t);return i=>r.runIsolated(o=>(o[e]=i,o[n]))}function ZE(t,e,n,r){return yy(e,n,r)(t)}ae.PIPE_TYPE=Ad;ae.createPipe=yy;ae.pipe=ZE;class QE extends ht{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var n,r,i;const{repeat:o,...s}=As(e);this._blockOpts=Object.assign({},this._blockOpts,s);const a=tr(this._blockOpts);this.repeat=(n=(r=o??a.repeat)!=null?r:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(tr(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,n){n===void 0&&(n={});const r=new ge;for(let l=(i=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?i:Math.max(this._blocks.length-1,0),u,c;u=(s=this._blocks[l])!=null?s:c=!c&&this._allocateBlock(l);++l){var i,o,s,a;const d=u._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[l]});if(d.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(d),d.consumed)break}return r}_trimEmptyTail(e,n){var r,i;e===void 0&&(e=0);const o=Math.max(((r=this._mapPosToBlock(e))==null?void 0:r.index)||0,this.repeatFrom,0);let s;n!=null&&(s=(i=this._mapPosToBlock(n))==null?void 0:i.index),s==null&&(s=this._blocks.length-1);let a=0;for(let l=s;o<=l&&!this._blocks[l].unmaskedValue;--l,++a);a&&(this._blocks.splice(s-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._trimEmptyTail(e,n),r}totalInputPositions(e,n){return e===void 0&&(e=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,n)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}ae.RepeatBlock=QE;try{globalThis.IMask=ae}catch{}function eC(t,e){let{emit:n,onAccept:r,onComplete:i,defaultValue:o,defaultUnmaskedValue:s,defaultTypedValue:a}=e===void 0?{}:e;const l=ux(t)?t:Q(t),u=Q(),c=Q(),d=Q(""),h=Q(""),p=Q();let f,m=d.value,g=h.value,y=p.value;function b(){y=p.value=c.value.typedValue,g=h.value=c.value.unmaskedValue,m=d.value=c.value.value}function k(O){b(),n&&(n("accept",d.value,O),n("accept:masked",d.value,O),n("accept:typed",p.value,O),n("accept:unmasked",h.value,O)),r?.(O)}function v(O){n&&(n("complete",c.value.value,O),n("complete:masked",c.value.value,O),n("complete:typed",c.value.typedValue,O),n("complete:unmasked",c.value.unmaskedValue,O)),i?.(O)}const w=()=>{!c.value||h.value===void 0||(g!==h.value&&(c.value.unmaskedValue=h.value,c.value.unmaskedValue!==h.value&&k()),g=void 0)};Fe(h,w);const x=()=>{!c.value||d.value===void 0||(m!==d.value&&(c.value.value=d.value,c.value.value!==d.value&&k()),m=void 0)};Fe(d,x);const _=()=>{!c.value||p.value===void 0||(y!==p.value&&(c.value.typedValue=p.value,c.value.masked.typedValueEquals(p.value)||k()),y=void 0)};Fe(p,_);function A(){f=u.value;const O=l.value;!f||!(O!=null&&O.mask)||(c.value=ae(f,O),o!==void 0&&(d.value=o),s!==void 0&&(h.value=s),a!==void 0&&(p.value=a),w(),x(),_(),b(),c.value.on("accept",k).on("complete",v))}function S(){var O;(O=c.value)==null||O.destroy(),c.value=void 0}return or(A),Cv(S),Fe([u,l],()=>{const O=u.value,C=l.value;(!(C!=null&&C.mask)||O!==f)&&S(),O&&(c.value?c.value.updateOptions(C):A())}),{el:u,mask:cx(c),masked:d,unmasked:h,typed:p}}const tC={key:0,class:"k-input__prefix"},nC=["id","aria-labelledby","aria-describedby","required","type"],rC={key:1,class:"k-input__suffix"},iC=ie({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Sv(),r=t,i=e;function o(p){r.mask||i("update:modelValue",p.target.value)}const s=Dn("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),a=Tv(Yh,P(()=>({id:r.id,invalid:r.invalid,required:!1,events:{onBlur:()=>{},onFocus:()=>{}}}))),l=p=>{var f;(f=a.value.events)==null||f.onFocus(p),n.onFocus&&n.onFocus(p)},u=p=>{var f;(f=a.value.events)==null||f.onBlur(p),n.onBlur&&n.onBlur(p)},{unmasked:c,masked:d,el:h}=eC(r.mask,{defaultValue:String(r.modelValue),onAccept:()=>{var p,f;if((p=r.mask)!=null&&p.pattern)return;const m=((f=r.mask)==null?void 0:f.mask)===Number?parseFloat(c.value):d.value;m!==r.modelValue&&i("update:modelValue",m)}});return or(()=>{Fe(()=>r.modelValue,p=>{r.mask&&c.value!==String(p)&&(c.value=String(p)),r.mask||(h.value.value=p)},{immediate:!0})}),(p,f)=>(E(),I("div",{class:Me(z(s)({invalid:z(a).invalid,align:p.align}))},[p.$slots.prefix||p.prefix?(E(),I("span",tC,[B(p.$slots,"prefix",{},()=>[ct(ce(p.prefix),1)])])):F("",!0),W("input",se({class:"k-input__input",id:z(a).id,"aria-labelledby":z(a).labelId,"aria-describedby":z(a).helpId,required:z(a).required,onInput:o,onBlur:u,onFocus:l,ref_key:"el",ref:h,type:r.type},{...z(a).events,...p.$attrs}),null,16,nC),p.$slots.suffix||p.suffix?(E(),I("span",rC,[B(p.$slots,"suffix",{},()=>[ct(ce(p.suffix),1)])])):F("",!0)],2))}});let oC=class{constructor(t,e){sn(this,"key"),sn(this,"goto"),this.key=t,this.goto=e,this.set()}get(){return localStorage.getItem(this.key)||""}set(t=this.get()){const e=this.goto(t);this.get()!==e&&localStorage.setItem(this.key,e)}destroy(){}},sC=class{constructor(t,e){sn(this,"key"),sn(this,"goto"),sn(this,"current"),this.key=t,this.goto=e,this.set()}get(){return this.current||""}set(t=this.get()){this.current=this.goto(t)}destroy(){}};class aC{constructor(e,n){sn(this,"key"),sn(this,"goto"),this.key=e,this.goto=n,this.set()}get(){return sessionStorage.getItem(this.key)||""}set(e=this.get()){const n=this.goto(e);this.get()!==n&&sessionStorage.setItem(this.key,n)}destroy(){}}const lC=Object.freeze(Object.defineProperty({__proto__:null,localStorage:oC,none:sC,sessionStorage:aC},Symbol.toStringTag,{value:"Module"})),uC=["data-step"],cC={key:0,class:"k-stepper-breadcrumbs-wrapper"},dC={key:0,class:"k-stepper__breadcrumb-arrow"},hC=["disabled","onClick"],pC={class:"k-stepper__breadcrumb-icon"},fC={class:"k-stepper__breadcrumb-label"},mC={class:"k-stepper__component-wrapper"},gC={key:0,class:"k-stepper__navigation"},sV=ie({__name:"Stepper",props:{steps:{},stateHandler:{default:"none"},stateKey:{default:"step"},transitionPreset:{default:"slide"},transitionNext:{},transitionPrev:{},breadcrumbPlacement:{default:"top"},keepAlive:{type:Boolean},hidebreadcrumbs:{type:Boolean,default:!1}},setup(t,{expose:e}){const n=t,r=Q(),i=Q(),o=Q(n.steps[0].id);let s;const a=typeof n.stateHandler=="string"?lC[n.stateHandler]:n.stateHandler;s=new a(n.stateKey,f),Mo(()=>s.destroy());const l=P(()=>c(o.value)),u=P(()=>{const k=d(o.value);return{...k?.bind||{},step:k,onNext:h,onPrev:p}});function c(k){const v=d(k),w=n.steps.findIndex(({id:x})=>!v||x===v.id);return{prev:w>0?n.steps[w-1]:null,current:v,next:w<n.steps.length-1?n.steps[w+1]:null}}function d(k){return n.steps.find(v=>v.id===k)}const h=()=>l.value.next&&f(l.value.next.id),p=()=>l.value.prev&&f(l.value.prev.id);function f(k){var v;if(k===o.value)return o.value;const w=n.steps.find(x=>!k||x.id===k);return w!=null&&w.disabled?f((v=c(w.id).prev)==null?void 0:v.id):(o.value=(w||n.steps[0]).id,s&&s.set(o.value),o.value)}const m=Av({next:h,prev:p,goto:f});Fe(o,(k,v)=>i.value=v);const g=()=>{if(!i.value)return"next";const{steps:k}=n;return k.findIndex(v=>v.id===i.value)>k.findIndex(v=>v.id===o.value)?"prev":"next"};function y(){const{transitionNext:k,transitionPreset:v,transitionPrev:w,breadcrumbPlacement:x}=n;if(k||w)return g()==="next"?k:w;if(v==="fade")return`k-stepper-${v}`;const _=["top","bottom"].includes(x)?"h":"v";return`k-stepper-${v}-${_}-${g()}`}const b=()=>{var k;const v=(k=r.value)==null?void 0:k.getBoundingClientRect();if(!v)return;const w=v.top-20;w>0||window.scrollTo({top:w+window.scrollY,behavior:"smooth"})};return e({goto:f,next:h,prev:p,meta:l}),(k,v)=>(E(),I("div",{class:Me(`k-stepper k-stepper--breadcrumb-placement-${k.breadcrumbPlacement}`),"data-step":o.value},[k.hidebreadcrumbs?F("",!0):(E(),I("div",cC,[B(k.$slots,"before-breadcrumbs",Se(_e({meta:l.value,navigate:m}))),W("div",{class:"k-stepper__breadcrumbs",ref_key:"breadcrumb",ref:r},[(E(!0),I(Le,null,Ft(k.steps,(w,x)=>(E(),I(Le,null,[x>0?(E(),I("div",dC)):F("",!0),B(k.$slots,"breadcrumb",{step:w,isActive:w.id===o.value,index:x,select:()=>f(w.id)},()=>[W("button",{type:"button",class:Me(["k-stepper__breadcrumb",{"k-stepper__breadcrumb--default":w.isValid===void 0,"k-stepper__breadcrumb--active":w.id===o.value,"k-stepper__breadcrumb--invalid":w.isValid===!1,"k-stepper__breadcrumb--valid":w.isValid===!0}]),disabled:w.disabled,onClick:_=>f(w.id)},[W("span",pC,[B(k.$slots,"breadcrumb-icon",{step:w},()=>[w.isValid===!0?(E(),U(z(We),{key:0,icon:"heroicons-solid:check",width:12})):w.isValid===!1?(E(),U(z(We),{key:1,icon:"heroicons:exclamation-triangle",width:17})):(E(),I(Le,{key:2},[ct(ce(x+1),1)],64))])]),W("span",fC,ce(w.label),1)],10,hC)])],64))),256))],512),B(k.$slots,"after-breadcrumbs",Se(_e({meta:l.value,navigate:m})))])),B(k.$slots,"before-content",Se(_e({meta:l.value,navigate:m}))),W("div",mC,[ke(Rh,{name:y(),mode:"out-in",onAfterEnter:b},{default:te(()=>[k.keepAlive?(E(),U(px,{key:0},[(E(),U(Ye(u.value.step.component),se({key:o.value},u.value),null,16))],1024)):(E(),U(Ye(u.value.step.component),se({key:o.value},u.value),null,16))]),_:1},8,["name"]),k.$slots.navigation?(E(),I("div",gC,[B(k.$slots,"navigation",Se(_e({meta:l.value,navigate:m})))])):F("",!0)]),B(k.$slots,"after-content",Se(_e({meta:l.value,navigate:m})))],10,uC))}}),vC=["src","alt"],by=ie({__name:"Image",props:{src:{},preview:{},alt:{},caption:{},captionVisibility:{default:"hover"},captionTheme:{default:"dark"},size:{default:"cover"},position:{default:"center"},width:{},height:{},aspectRatio:{}},emits:["loaded","error"],setup(t,{emit:e}){const n=t,r=e,i=Q(),o=Q(!1),s=Q(!1),a=Q(),l=P(()=>({"--k-image-size":n.size,"--k-image-preview":n.preview||"","--k-image-position":n.position,"--k-image-width":n.width||"initial","--k-image-height":n.height||"initial","--k-image-aspectratio":(n.aspectRatio==="natural"?a.value:n.aspectRatio)||"initial"}));function u(){o.value=!0;const{naturalWidth:d=0,naturalHeight:h=0}=i.value||{};a.value=`${d}/${h}`,r("loaded")}function c(){o.value=!0,s.value=!0,r("error")}return or(()=>{var d;return((d=i.value)==null?void 0:d.complete)&&u()}),(d,h)=>(E(),I("figure",{class:Me(["k-image",[`k-image--size-${d.size}`,{"k-image--loaded":o.value,"k-image--loading":!o.value}]]),style:In(l.value)},[o.value?F("",!0):(E(),U(Hv,{key:0,size:"small"})),ml(W("img",{src:d.src,alt:d.alt||d.caption,onLoad:u,onError:c,ref_key:"image",ref:i},null,40,vC),[[bv,!s.value]]),d.$slots.caption||d.caption?(E(),I("figcaption",{key:1,class:Me(`k-image__caption k-image__caption--visibility-${d.captionVisibility} k-image__caption--theme-${!o.value||s.value?"light":d.captionTheme}`)},[B(d.$slots,"caption",{},()=>[ct(ce(d.caption),1)])],2)):F("",!0)],6))}}),bi=ie({__name:"Flex",props:{is:{default:"div"},gap:{default:"default"},justify:{},align:{},direction:{default:"row"},nowrap:{type:Boolean}},setup(t){const e=t,n=P(()=>zv("flex",{justify:vl(e.justify)||"initial",align:vl(e.align)||"initial",wrap:e.nowrap?"nowrap":"wrap",gap:$h(e.gap),direction:e.direction}));return(r,i)=>(E(),U(Ye(r.is),{class:"k-flex",style:In(n.value)},{default:te(()=>[B(r.$slots,"default")]),_:3},8,["style"]))}}),yC={key:0,class:"k-card__thumbnail"},bC={key:0,class:"k-card__title"},kC={key:1,class:"k-card__subtitle"},xC={key:2,class:"k-card__content"},wC=ie({inheritAttrs:!1,__name:"Card",props:{is:{default:"div"},title:{},subtitle:{},variant:{default:"default"},appearance:{default:"border"},thumbnail:{},thumbnailOptions:{default:()=>({size:"cover",aspectRatio:"16/9",width:"100%"})}},setup(t){const e=t,n=Ph(),r=P(()=>e.thumbnail||n.thumbnail),i=P(()=>e.title||e.subtitle||n.header),o=P(()=>n.actions),s=P(()=>n.default);return(a,l)=>(E(),U(Ye(a.is),se({class:["k-card",`k-card--variant-${a.variant}`,`k-card--appearance-${a.appearance}`,{"k-card--has-thumbnail":r.value},{"k-card--has-header":i.value},{"k-card--has-content":s.value},{"k-card--has-actions":o.value}]},a.$attrs),{default:te(()=>[r.value?(E(),I("div",yC,[B(a.$slots,"thumbnail",{},()=>[a.thumbnail?(E(),U(by,se({key:0},a.thumbnailOptions,{src:a.thumbnail}),null,16,["src"])):F("",!0)])])):F("",!0),i.value?(E(),U(bi,{key:1,is:"header",direction:"column",gap:"0rem",class:"k-card__header"},{default:te(()=>[B(a.$slots,"header",{},()=>[a.title?(E(),I("div",bC,ce(a.title),1)):F("",!0),a.subtitle?(E(),I("div",kC,ce(a.subtitle),1)):F("",!0)])]),_:3})):F("",!0),s.value?(E(),I("div",xC,[B(a.$slots,"default")])):F("",!0),o.value?(E(),U(bi,{key:3,justify:"center",align:"center",class:"k-card__actions"},{default:te(()=>[B(a.$slots,"actions")]),_:3})):F("",!0)]),_:3},16,["class"]))}}),aV=ie({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(t){const e=()=>t.rounding?t.rounding==="full"?"9999px":$h(t.rounding,"rounding"):"initial",n=P(()=>({"--aspect-ratio":!t.aspectRatio||t.width&&t.height?"initial":t.aspectRatio,"--width":t.width||"initial","--height":t.height||"initial","--border-radius":e()}));return(r,i)=>(E(),I("span",{class:Me(["k-skeleton",`k-skeleton--variant-${r.variant}`]),style:In(n.value)},[B(r.$slots,"default")],6))}});function EC(t,e,n){return t===0?n:e[t-1]}function CC(t,e,n){return t===e.length-1?n:e[t+1]}function SC(t,e,n){return Math.round((t-e)/n)*n+e}function Fu(t,e,n){return Math.min(Math.max(t,e),n)}function ep(t,e,n){return(t-e)/(n-e)}function ky(t,e,n,r){const i=t*(n-e)+e,o=SC(i,e,r);return Fu(o,e,n)}function ka(t,e){let n=t,r=e.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let s=Math.pow(10,o);n=Math.round(n*s)/s}return n}function xy(t,e,n,r){e=Number(e),n=Number(n);let i=(t-(isNaN(e)?0:e))%r,o=ka(Math.abs(i)*2>=r?t+Math.sign(i)*(r-Math.abs(i)):t-i,r);return isNaN(e)?!isNaN(n)&&o>n&&(o=Math.floor(ka(n/r,r))*r):o<e?o=e:!isNaN(n)&&o>n&&(o=e+Math.floor(ka((n-e)/r,r))*r),o=ka(o,r),o}function TC(t,e,n){return t[e]===n?t:[...t.slice(0,e),n,...t.slice(e+1)]}function wy(t,e){const n=EC(t,e.values,e.min),r=CC(t,e.values,e.max);let i=e.values.slice();return function(o){let s=xy(o,n,r,e.step);return i=TC(i,t,o),i[t]=s,i}}function OC(t,e){const n=e.values[t]+e.step;return wy(t,e)(n)}function AC(t,e){const n=e.values[t]-e.step;return wy(t,e)(n)}function MC(t,e){let n=t.findIndex(o=>e-o<0);if(n===0)return n;if(n===-1)return t.length-1;let r=t[n-1],i=t[n];return Math.abs(r-e)<Math.abs(i-e)?n-1:n}function _C(t,e,n,r){return t.map((i,o)=>{const s=o===0?e:t[o-1]+r,a=o===t.length-1?n:t[o+1]-r;return{min:s,max:a,value:i}})}function Md(t,e){const n={min:t[0],max:t[1]},r={min:e[0],max:e[1]};return function(i){if(n.min===n.max||r.min===r.max)return r.min;const o=(r.max-r.min)/(n.max-n.min);return r.min+o*(i-n.min)}}function IC(t,e){if(!t){e(void 0);return}e({width:t.offsetWidth,height:t.offsetHeight});const n=t.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=t.offsetWidth,a=t.offsetHeight;e({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}function DC(t){const{getNodes:e,observeMutation:n=!0,callback:r}=t,i=[];let o=null;function s(){const a=e();o=a[0];const l=a.map((u,c)=>IC(u,d=>{r(d,c)}));i.push(...l)}if(s(),n){const a=RC(o,s);i.push(a)}return()=>{i.forEach(a=>{a?.()})}}function RC(t,e){var n;if(!t||!t.parentElement)return;const r=((n=t.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{e()});return i.observe(t.parentElement,{childList:!0}),()=>{i.disconnect()}}var NC=Tr("slider").parts("root","label","thumb","valueText","track","range","control","markerGroup","marker"),Ln=NC.build();function PC(t){const e=t[0],n=t[t.length-1];return[e,n]}function FC(t){const[e,n]=PC(t.valuePercent);if(t.valuePercent.length===1){if(t.origin==="center"){const r=t.valuePercent[0]<50,i=r?`${t.valuePercent[0]}%`:"50%",o=r?"50%":`${100-t.valuePercent[0]}%`;return{start:i,end:o}}return{start:"0%",end:`${100-n}%`}}return{start:`${e}%`,end:`${100-n}%`}}function LC(t){return t.isVertical?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[t.isRtl?"right":"left"]:"var(--slider-range-start)",[t.isRtl?"left":"right"]:"var(--slider-range-end)"}}function BC(t){const{height:e=0}=t.thumbSize??{},n=Md([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function VC(t){const{width:e=0}=t.thumbSize??{};if(t.isRtl){const r=Md([t.max,t.min],[-e/2,e/2]);return-1*parseFloat(r(t.value).toFixed(2))}const n=Md([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function $C(t,e){if(t.thumbAlignment==="center")return`${e}%`;const n=t.isVertical?BC(t):VC(t);return`calc(${e}% - ${n}px)`}function Ey(t){let e=ep(t.value,t.min,t.max)*100;return $C(t,e)}function Cy(t){let e="visible";return t.thumbAlignment==="contain"&&!t.hasMeasuredThumbSize&&(e="hidden"),e}function jC(t,e){const n=t.isVertical?"bottom":"insetInlineStart";return{visibility:Cy(t),position:"absolute",transform:"var(--slider-thumb-transform)",[n]:`var(--slider-thumb-offset-${e})`}}function zC(){return{touchAction:"none",userSelect:"none",WebkitUserSelect:"none",position:"relative"}}function HC(t){const e=FC(t);return{...t.value.reduce((n,r,i)=>{const o=Ey({...t,value:r});return{...n,[`--slider-thumb-offset-${i}`]:o}},{}),"--slider-thumb-transform":t.isVertical?"translateY(50%)":t.isRtl?"translateX(50%)":"translateX(-50%)","--slider-range-start":e.start,"--slider-range-end":e.end}}function qC(t,e){return{visibility:Cy(t),position:"absolute",pointerEvents:"none",[t.isHorizontal?"insetInlineStart":"bottom"]:Ey({...t,value:e}),translate:"var(--tx) var(--ty)","--tx":t.isHorizontal?t.isRtl?"50%":"-50%":"0%","--ty":t.isHorizontal?"0%":"50%"}}function WC(){return{userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none",position:"relative"}}var UC={getRootStyle:HC,getControlStyle:zC,getThumbStyle:jC,getRangeStyle:LC,getMarkerStyle:qC,getMarkerGroupStyle:WC},pe=Ks({...UC,getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},getThumbId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.thumb)==null?void 0:r.call(n,e))??`slider:${t.id}:thumb:${e}`},getHiddenInputId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.hiddenInput)==null?void 0:r.call(n,e))??`slider:${t.id}:input:${e}`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},getTrackId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:track`},getRangeId:t=>{var e;return((e=t.ids)==null?void 0:e.range)??`slider:${t.id}:range`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},getValueTextId:t=>{var e;return((e=t.ids)==null?void 0:e.valueText)??`slider:${t.id}:value-text`},getMarkerId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.marker)==null?void 0:r.call(n,e))??`slider:${t.id}:marker:${e}`},getRootEl:t=>pe.getById(t,pe.getRootId(t)),getThumbEl:(t,e)=>pe.getById(t,pe.getThumbId(t,e)),getHiddenInputEl:(t,e)=>pe.getById(t,pe.getHiddenInputId(t,e)),getControlEl:t=>pe.getById(t,pe.getControlId(t)),getElements:t=>Yv(pe.getControlEl(t),"[role=slider]"),getFirstEl:t=>pe.getElements(t)[0],getRangeEl:t=>pe.getById(t,pe.getRangeId(t)),getValueFromPoint(t,e){const n=pe.getControlEl(t);if(!n)return;const r=Y1(e,n).getPercentValue({orientation:t.orientation,dir:t.dir,inverted:{y:!0}});return ky(r,t.min,t.max,t.step)},dispatchChangeEvent(t){Array.from(t.value).forEach((e,n)=>{const r=pe.getHiddenInputEl(t,n);r&&rE(r,{value:e})})}});function Vf(t,e){return e.map((n,r,i)=>_d({...t,value:i},n,r))}function Mr(t,e){return _C(t.value,t.min,t.max,t.minStepsBetweenThumbs)[e]}function _d(t,e,n){const r=Mr(t,n),i=xy(e,t.min,t.max,t.step);return Fu(i,r.min,r.max)}function KC(t,e,n){const r=e??t.focusedIndex,i=Mr(t,r),o=AC(r,{...i,step:n??t.step,values:t.value});return o[r]=Fu(o[r],i.min,i.max),o}function GC(t,e,n){const r=e??t.focusedIndex,i=Mr(t,r),o=OC(r,{...i,step:n??t.step,values:t.value});return o[r]=Fu(o[r],i.min,i.max),o}function JC(t,e){return MC(t.value,e)}function YC(t,e){for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}}function Sy(t,e,n){const r=t.context["aria-label"],i=t.context["aria-labelledby"],o=t.context.value,s=t.matches("focus"),a=t.matches("dragging"),l=t.context.isDisabled,u=t.context.invalid,c=t.context.isInteractive,d=t.context.orientation==="horizontal",h=t.context.orientation==="vertical";function p(m){return ep(m,t.context.min,t.context.max)}function f(m){return ky(m,t.context.min,t.context.max,t.context.step)}return{value:t.context.value,dragging:a,focused:s,setValue(m){e({type:"SET_VALUE",value:m})},getThumbValue(m){return o[m]},setThumbValue(m,g){e({type:"SET_VALUE",index:m,value:g})},getValuePercent:p,getPercentValue:f,getThumbPercent(m){return p(o[m])},setThumbPercent(m,g){const y=f(g);e({type:"SET_VALUE",index:m,value:y})},getThumbMin(m){return Mr(t.context,m).min},getThumbMax(m){return Mr(t.context,m).max},increment(m){e({type:"INCREMENT",index:m})},decrement(m){e({type:"DECREMENT",index:m})},focus(){c&&e({type:"FOCUS",index:0})},getLabelProps(){return n.label({...Ln.label.attrs,dir:t.context.dir,"data-disabled":Z(l),"data-orientation":t.context.orientation,"data-invalid":Z(u),"data-dragging":Z(a),"data-focus":Z(s),id:pe.getLabelId(t.context),htmlFor:pe.getHiddenInputId(t.context,0),onClick(m){var g;c&&(m.preventDefault(),(g=pe.getFirstEl(t.context))==null||g.focus())},style:{userSelect:"none",WebkitUserSelect:"none"}})},getRootProps(){return n.element({...Ln.root.attrs,"data-disabled":Z(l),"data-orientation":t.context.orientation,"data-dragging":Z(a),"data-invalid":Z(u),"data-focus":Z(s),id:pe.getRootId(t.context),dir:t.context.dir,style:pe.getRootStyle(t.context)})},getValueTextProps(){return n.element({...Ln.valueText.attrs,dir:t.context.dir,"data-disabled":Z(l),"data-orientation":t.context.orientation,"data-invalid":Z(u),"data-focus":Z(s),id:pe.getValueTextId(t.context)})},getTrackProps(){return n.element({...Ln.track.attrs,dir:t.context.dir,id:pe.getTrackId(t.context),"data-disabled":Z(l),"data-invalid":Z(u),"data-dragging":Z(a),"data-orientation":t.context.orientation,"data-focus":Z(s),style:{position:"relative"}})},getThumbProps(m){var g,y;const{index:b=0,name:k}=m,v=o[b],w=Mr(t.context,b),x=(y=(g=t.context).getAriaValueText)==null?void 0:y.call(g,{value:v,index:b}),_=Array.isArray(r)?r[b]:r,A=Array.isArray(i)?i[b]:i;return n.element({...Ln.thumb.attrs,dir:t.context.dir,"data-index":b,"data-name":k,id:pe.getThumbId(t.context,b),"data-disabled":Z(l),"data-orientation":t.context.orientation,"data-focus":Z(s&&t.context.focusedIndex===b),"data-dragging":Z(a&&t.context.focusedIndex===b),draggable:!1,"aria-disabled":Dw(l),"aria-label":_,"aria-labelledby":A??pe.getLabelId(t.context),"aria-orientation":t.context.orientation,"aria-valuemax":w.max,"aria-valuemin":w.min,"aria-valuenow":o[b],"aria-valuetext":x,role:"slider",tabIndex:l?void 0:0,style:pe.getThumbStyle(t.context,b),onPointerDown(S){c&&(e({type:"THUMB_POINTER_DOWN",index:b}),S.stopPropagation())},onBlur(){c&&e("BLUR")},onFocus(){c&&e({type:"FOCUS",index:b})},onKeyDown(S){if(S.defaultPrevented||!c)return;const O=J1(S)*t.context.step,C={ArrowUp(){d||e({type:"ARROW_INC",step:O,src:"ArrowUp"})},ArrowDown(){d||e({type:"ARROW_DEC",step:O,src:"ArrowDown"})},ArrowLeft(){h||e({type:"ARROW_DEC",step:O,src:"ArrowLeft"})},ArrowRight(){h||e({type:"ARROW_INC",step:O,src:"ArrowRight"})},PageUp(){e({type:"ARROW_INC",step:O,src:"PageUp"})},PageDown(){e({type:"ARROW_DEC",step:O,src:"PageDown"})},Home(){e("HOME")},End(){e("END")}},T=H1(S,t.context),R=C[T];R&&(R(S),S.preventDefault(),S.stopPropagation())}})},getHiddenInputProps(m){const{index:g=0,name:y}=m;return n.input({name:y??(t.context.name?t.context.name+(t.context.value.length>1?"[]":""):void 0),form:t.context.form,type:"text",hidden:!0,defaultValue:t.context.value[g],id:pe.getHiddenInputId(t.context,g)})},getRangeProps(){return n.element({id:pe.getRangeId(t.context),...Ln.range.attrs,dir:t.context.dir,"data-dragging":Z(a),"data-focus":Z(s),"data-invalid":Z(u),"data-disabled":Z(l),"data-orientation":t.context.orientation,style:pe.getRangeStyle(t.context)})},getControlProps(){return n.element({...Ln.control.attrs,dir:t.context.dir,id:pe.getControlId(t.context),"data-dragging":Z(a),"data-disabled":Z(l),"data-orientation":t.context.orientation,"data-invalid":Z(u),"data-focus":Z(s),style:pe.getControlStyle(),onPointerDown(m){if(!c||!V1(m)||j1(m))return;const g=Kh(m);e({type:"POINTER_DOWN",point:g}),m.preventDefault(),m.stopPropagation()}})},getMarkerGroupProps(){return n.element({...Ln.markerGroup.attrs,role:"presentation",dir:t.context.dir,"aria-hidden":!0,"data-orientation":t.context.orientation,style:pe.getMarkerGroupStyle()})},getMarkerProps(m){const g=pe.getMarkerStyle(t.context,m.value);let y;const b=t.context.value[0],k=t.context.value[t.context.value.length-1];return m.value<b?y="under-value":m.value>k?y="over-value":y="at-value",n.element({...Ln.marker.attrs,id:pe.getMarkerId(t.context,m.value),role:"presentation",dir:t.context.dir,"data-orientation":t.context.orientation,"data-value":m.value,"data-disabled":Z(l),"data-state":y,style:g})}}}var XC=(t,e)=>t?.width===e?.width&&t?.height===e?.height;function Ty(t){const e=er(t);return Gs({id:"slider",initial:"idle",context:{thumbSize:null,thumbAlignment:"contain",min:0,max:100,step:1,value:[0],origin:"start",orientation:"horizontal",dir:"ltr",minStepsBetweenThumbs:0,disabled:!1,readOnly:!1,...e,focusedIndex:-1,fieldsetDisabled:!1},computed:{isHorizontal:n=>n.orientation==="horizontal",isVertical:n=>n.orientation==="vertical",isRtl:n=>n.orientation==="horizontal"&&n.dir==="rtl",isDisabled:n=>!!n.disabled||n.fieldsetDisabled,isInteractive:n=>!(n.readOnly||n.isDisabled),hasMeasuredThumbSize:n=>n.thumbSize!=null,valuePercent(n){return n.value.map(r=>100*ep(r,n.min,n.max))}},watch:{value:["syncInputElements"]},entry:["coarseValue"],activities:["trackFormControlState","trackThumbsSize"],on:{SET_VALUE:[{guard:"hasIndex",actions:"setValueAtIndex"},{actions:"setValue"}],INCREMENT:{actions:"incrementThumbAtIndex"},DECREMENT:{actions:"decrementThumbAtIndex"}},states:{idle:{on:{POINTER_DOWN:{target:"dragging",actions:["setClosestThumbIndex","setPointerValue","focusActiveThumb"]},FOCUS:{target:"focus",actions:"setFocusedIndex"},THUMB_POINTER_DOWN:{target:"dragging",actions:["setFocusedIndex","focusActiveThumb"]}}},focus:{entry:"focusActiveThumb",on:{POINTER_DOWN:{target:"dragging",actions:["setClosestThumbIndex","setPointerValue","focusActiveThumb"]},THUMB_POINTER_DOWN:{target:"dragging",actions:["setFocusedIndex","focusActiveThumb"]},ARROW_DEC:{actions:["decrementThumbAtIndex","invokeOnChangeEnd"]},ARROW_INC:{actions:["incrementThumbAtIndex","invokeOnChangeEnd"]},HOME:{actions:["setFocusedThumbToMin","invokeOnChangeEnd"]},END:{actions:["setFocusedThumbToMax","invokeOnChangeEnd"]},BLUR:{target:"idle",actions:"clearFocusedIndex"}}},dragging:{entry:"focusActiveThumb",activities:"trackPointerMove",on:{POINTER_UP:{target:"focus",actions:"invokeOnChangeEnd"},POINTER_MOVE:{actions:"setPointerValue"}}}}},{guards:{hasIndex:(n,r)=>r.index!=null},activities:{trackFormControlState(n,r,{initialContext:i}){return Iu(pe.getRootEl(n),{onFieldsetDisabledChange(o){n.fieldsetDisabled=o},onFormReset(){jt.value(n,i.value)}})},trackPointerMove(n,r,{send:i}){return X1(pe.getDoc(n),{onPointerMove(o){i({type:"POINTER_MOVE",point:o.point})},onPointerUp(){i("POINTER_UP")}})},trackThumbsSize(n){if(!(n.thumbAlignment!=="contain"||n.thumbSize))return DC({getNodes:()=>pe.getElements(n),observeMutation:!0,callback(r){!r||XC(n.thumbSize,r)||(n.thumbSize=r)}})}},actions:{syncInputElements(n){n.value.forEach((r,i)=>{const o=pe.getHiddenInputEl(n,i);pe.setValue(o,r)})},invokeOnChangeEnd(n){Qa.valueChangeEnd(n)},setClosestThumbIndex(n,r){const i=pe.getValueFromPoint(n,r.point);if(i==null)return;const o=JC(n,i);jt.focusedIndex(n,o)},setFocusedIndex(n,r){jt.focusedIndex(n,r.index)},clearFocusedIndex(n){jt.focusedIndex(n,-1)},setPointerValue(n,r){const i=pe.getValueFromPoint(n,r.point);if(i==null)return;const o=_d(n,i,n.focusedIndex);jt.valueAtIndex(n,n.focusedIndex,o)},focusActiveThumb(n){Fr(()=>{const r=pe.getThumbEl(n,n.focusedIndex);r?.focus({preventScroll:!0})})},decrementThumbAtIndex(n,r){const i=KC(n,r.index,r.step);jt.value(n,i)},incrementThumbAtIndex(n,r){const i=GC(n,r.index,r.step);jt.value(n,i)},setFocusedThumbToMin(n){const{min:r}=Mr(n,n.focusedIndex);jt.valueAtIndex(n,n.focusedIndex,r)},setFocusedThumbToMax(n){const{max:r}=Mr(n,n.focusedIndex);jt.valueAtIndex(n,n.focusedIndex,r)},coarseValue(n){const r=Vf(n,n.value);jt.value(n,r)},setValueAtIndex(n,r){const i=_d(n,r.value,r.index);jt.valueAtIndex(n,r.index,i)},setValue(n,r){const i=Vf(n,r.value);jt.value(n,i)}}})}var Qa={valueChange(t){var e;(e=t.onValueChange)==null||e.call(t,{value:Array.from(t.value)}),pe.dispatchChangeEvent(t)},valueChangeEnd(t){var e;(e=t.onValueChangeEnd)==null||e.call(t,{value:Array.from(t.value)})},focusChange(t){var e;(e=t.onFocusChange)==null||e.call(t,{value:Array.from(t.value),focusedIndex:t.focusedIndex})}},jt={valueAtIndex:(t,e,n)=>{Or(t.value[e],n)||(t.value[e]=n,Qa.valueChange(t))},value:(t,e)=>{Or(t.value,e)||(YC(t.value,e),Qa.valueChange(t))},focusedIndex:(t,e)=>{Or(t.focusedIndex,e)||(t.focusedIndex=e,Qa.focusChange(t))}};Mi()(["aria-label","aria-labelledby","dir","disabled","form","getAriaValueText","getRootNode","id","ids","invalid","max","min","minStepsBetweenThumbs","name","onFocusChange","onValueChange","onValueChangeEnd","orientation","origin","readOnly","step","thumbAlignment","thumbAlignment","thumbSize","value"]);Mi()(["index","name"]);const ZC=["data-value"],QC=ie({__name:"RangeSlider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},minStepsBetweenThumbs:{},marker:{},markerFormat:{},format:{type:Function,default:()=>t=>t},getRootNode:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i={id:Sn(),...n,value:n.modelValue,onValueChangeEnd:({value:c})=>{const[d,h]=[a.value.getThumbMin(0),a.value.getThumbMax(0)],[p,f]=[a.value.getThumbMin(1),a.value.getThumbMax(1)],m=Math.max(d,Math.min(h,c[0])),g=Math.min(f,Math.max(p,c[1]));n.modelValue[0]===m&&n.modelValue[1]===g||r("update:modelValue",[m,g])},getRootNode:n.getRootNode},[o,s]=Ii(Ty(i),{context:P(()=>n)}),a=P(()=>Sy(o.value,s,_i)),l=c=>{const[d,h]=[a.value.getThumbMin(0),a.value.getThumbMax(0)],[p,f]=[a.value.getThumbMin(1),a.value.getThumbMax(1)],[m,g]=[a.value.getThumbValue(0),a.value.getThumbValue(1)],[y,b]=c;if(y===m&&b===g)return;const k=Math.max(d,Math.min(h,y)),v=Math.min(f,Math.max(p,b));return m===k&&g===v?r("update:modelValue",[k,v]):a.value.setValue([k,v])},u=P(()=>{if(!n.marker)return[];const c=Math.floor(n.max/n.marker)+1;return Array(c).fill(void 0).map((d,h)=>{const p=(n.marker||0)*h;return{value:p,label:n.markerFormat?n.markerFormat(p):n.format(p)}})});return Fe(()=>n.modelValue,l,{deep:!0}),(c,d)=>(E(),I("div",se(a.value.getRootProps(),{class:"k-rangeslider"}),[W("div",Se(_e(a.value.getControlProps())),[W("div",Se(_e(a.value.getTrackProps())),[W("div",Se(_e(a.value.getRangeProps())),null,16)],16),(E(!0),I(Le,null,Ft(a.value.value,(h,p)=>(E(),I("div",se({key:p,ref_for:!0},a.value.getThumbProps({index:p})),[W("input",se({ref_for:!0},a.value.getHiddenInputProps({index:p})),null,16)],16))),128))],16),u.value.length?(E(),I("div",Se(se({key:0},a.value.getMarkerGroupProps())),[(E(!0),I(Le,null,Ft(u.value,h=>(E(),I("span",se({ref_for:!0},a.value.getMarkerProps({value:h.value}),{"data-value":h.label}),null,16,ZC))),256))],16)):F("",!0)],16))}}),eS=["data-value"],lV=ie({__name:"Slider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},marker:{},format:{type:Function,default:()=>t=>t},markerFormat:{},markerHighlight:{type:Boolean,default:!1},getRootNode:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i={id:Sn(),...n,value:[n.modelValue],onValueChange:({value:c})=>{r("update:modelValue",c[0])},getRootNode:n.getRootNode},[o,s]=Ii(Ty(i),{context:P(()=>n)}),a=P(()=>Sy(o.value,s,_i)),l=c=>a.value.setValue([Math.max(n.min||c,Math.min(n.max||c,c))]),u=P(()=>{const c=h=>n.markerFormat?n.markerFormat(h):n.format(h);if(!n.marker)return[];if(n.marker instanceof Array)return n.marker.map(h=>({value:h,label:c(h)}));const d=Math.floor((n.max-n.min)/n.marker)+1;return Array(d).fill(void 0).map((h,p)=>{const f=n.min+n.marker*p;return{value:f,label:c(f)}})});return Fe(()=>n.modelValue,l,{deep:!0}),(c,d)=>(E(),I("div",se(a.value.getRootProps(),{class:["k-slider",{"k-slider--marker-highlight":c.markerHighlight}]}),[W("div",Se(_e(a.value.getControlProps())),[W("div",Se(_e(a.value.getTrackProps())),[W("div",Se(_e(a.value.getRangeProps())),null,16)],16),W("div",Se(_e(a.value.getThumbProps({index:0}))),[W("input",Se(_e(a.value.getHiddenInputProps({index:0}))),null,16)],16),W("output",Se(_e(a.value.getValueTextProps())),[B(c.$slots,"value",{value:a.value.value},()=>[ct(ce(c.format(a.value.value.at(0))),1)])],16)],16),u.value.length?(E(),I("div",Se(se({key:0},a.value.getMarkerGroupProps())),[(E(!0),I(Le,null,Ft(u.value,h=>(E(),I("span",se({ref_for:!0},a.value.getMarkerProps({value:h.value}),{"data-value":h.label}),null,16,eS))),256))],16)):F("",!0)],16))}}),Id=Math.min,io=Math.max,wl=Math.round,xa=Math.floor,xn=t=>({x:t,y:t}),tS={left:"right",right:"left",bottom:"top",top:"bottom"},nS={start:"end",end:"start"};function tp(t,e){return typeof t=="function"?t(e):t}function po(t){return t.split("-")[0]}function Lu(t){return t.split("-")[1]}function rS(t){return t==="x"?"y":"x"}function Oy(t){return t==="y"?"height":"width"}function Ms(t){return["top","bottom"].includes(po(t))?"y":"x"}function Ay(t){return rS(Ms(t))}function iS(t,e,n){n===void 0&&(n=!1);const r=Lu(t),i=Ay(t),o=Oy(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=El(s)),[s,El(s)]}function oS(t){const e=El(t);return[Dd(t),e,Dd(e)]}function Dd(t){return t.replace(/start|end/g,e=>nS[e])}function sS(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function aS(t,e,n,r){const i=Lu(t);let o=sS(po(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Dd)))),o}function El(t){return t.replace(/left|right|bottom|top/g,e=>tS[e])}function lS(t){return{top:0,right:0,bottom:0,left:0,...t}}function uS(t){return typeof t!="number"?lS(t):{top:t,right:t,bottom:t,left:t}}function Cl(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function $f(t,e,n){let{reference:r,floating:i}=t;const o=Ms(e),s=Ay(e),a=Oy(s),l=po(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Lu(e)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}const cS=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=$f(u,r,l),h=r,p={},f=0;for(let m=0;m<a.length;m++){const{name:g,fn:y}=a[m],{x:b,y:k,data:v,reset:w}=await y({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:u,platform:s,elements:{reference:t,floating:e}});c=b??c,d=k??d,p={...p,[g]:{...p[g],...v}},w&&f<=50&&(f++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:c,y:d}=$f(u,h,l)),m=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:p}};async function dS(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=tp(e,t),f=uS(p),m=a[h?d==="floating"?"reference":"floating":d],g=Cl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),y=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),k=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},v=Cl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-v.top+f.top)/k.y,bottom:(v.bottom-g.bottom+f.bottom)/k.y,left:(g.left-v.left+f.left)/k.x,right:(v.right-g.right+f.right)/k.x}}const hS=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=tp(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=po(i),b=Ms(a),k=po(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(k||!m?[El(a)]:oS(a)),x=f!=="none";!h&&x&&w.push(...aS(a,m,f,v));const _=[a,...w],A=await dS(e,g),S=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&S.push(A[y]),d){const j=iS(i,s,v);S.push(A[j[0]],A[j[1]])}if(O=[...O,{placement:i,overflows:S}],!S.every(j=>j<=0)){var C,T;const j=(((C=o.flip)==null?void 0:C.index)||0)+1,H=_[j];if(H)return{data:{index:j,overflows:O},reset:{placement:H}};let $=(T=O.filter(X=>X.overflows[0]<=0).sort((X,ue)=>X.overflows[1]-ue.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(p){case"bestFit":{var R;const X=(R=O.filter(ue=>{if(x){const de=Ms(ue.placement);return de===b||de==="y"}return!0}).map(ue=>[ue.placement,ue.overflows.filter(de=>de>0).reduce((de,Pe)=>de+Pe,0)]).sort((ue,de)=>ue[1]-de[1])[0])==null?void 0:R[0];X&&($=X);break}case"initialPlacement":$=a;break}if(i!==$)return{reset:{placement:$}}}return{}}}};async function pS(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=po(n),a=Lu(n),l=Ms(n)==="y",u=["left","top"].includes(s)?-1:1,c=o&&l?-1:1,d=tp(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const fS=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await pS(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}};function Bu(){return typeof window<"u"}function _o(t){return My(t)?(t.nodeName||"").toLowerCase():"#document"}function Lt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Nn(t){var e;return(e=(My(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function My(t){return Bu()?t instanceof Node||t instanceof Lt(t).Node:!1}function ln(t){return Bu()?t instanceof Element||t instanceof Lt(t).Element:!1}function Tn(t){return Bu()?t instanceof HTMLElement||t instanceof Lt(t).HTMLElement:!1}function jf(t){return!Bu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Lt(t).ShadowRoot}function Js(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=un(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function mS(t){return["table","td","th"].includes(_o(t))}function Vu(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function np(t){const e=rp(),n=ln(t)?un(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function gS(t){let e=Lr(t);for(;Tn(e)&&!fo(e);){if(np(e))return e;if(Vu(e))return null;e=Lr(e)}return null}function rp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fo(t){return["html","body","#document"].includes(_o(t))}function un(t){return Lt(t).getComputedStyle(t)}function $u(t){return ln(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Lr(t){if(_o(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jf(t)&&t.host||Nn(t);return jf(e)?e.host:e}function _y(t){const e=Lr(t);return fo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Tn(e)&&Js(e)?e:_y(e)}function _s(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=_y(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Lt(i);if(o){const a=Rd(s);return e.concat(s,s.visualViewport||[],Js(i)?i:[],a&&n?_s(a):[])}return e.concat(i,_s(i,[],n))}function Rd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Iy(t){const e=un(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Tn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=wl(n)!==o||wl(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ip(t){return ln(t)?t:t.contextElement}function oo(t){const e=ip(t);if(!Tn(e))return xn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Iy(e);let s=(o?wl(n.width):n.width)/r,a=(o?wl(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const vS=xn(0);function Dy(t){const e=Lt(t);return!rp()||!e.visualViewport?vS:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function yS(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Lt(t)?!1:e}function ki(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=ip(t);let s=xn(1);e&&(r?ln(r)&&(s=oo(r)):s=oo(t));const a=yS(o,n,r)?Dy(o):xn(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=Lt(o),p=r&&ln(r)?Lt(r):r;let f=h,m=Rd(f);for(;m&&r&&p!==f;){const g=oo(m),y=m.getBoundingClientRect(),b=un(m),k=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,v=y.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=k,u+=v,f=Lt(m),m=Rd(f)}}return Cl({width:c,height:d,x:l,y:u})}function op(t,e){const n=$u(t).scrollLeft;return e?e.left+n:ki(Nn(t)).left+n}function Ry(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:op(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function bS(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Nn(r),a=e?Vu(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=xn(1);const c=xn(0),d=Tn(r);if((d||!d&&!o)&&((_o(r)!=="body"||Js(s))&&(l=$u(r)),Tn(r))){const p=ki(r);u=oo(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=s&&!d&&!o?Ry(s,l,!0):xn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function kS(t){return Array.from(t.getClientRects())}function xS(t){const e=Nn(t),n=$u(t),r=t.ownerDocument.body,i=io(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=io(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+op(t);const a=-n.scrollTop;return un(r).direction==="rtl"&&(s+=io(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function wS(t,e){const n=Lt(t),r=Nn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=rp();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function ES(t,e){const n=ki(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Tn(t)?oo(t):xn(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function zf(t,e,n){let r;if(e==="viewport")r=wS(t,n);else if(e==="document")r=xS(Nn(t));else if(ln(e))r=ES(e,n);else{const i=Dy(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Cl(r)}function Ny(t,e){const n=Lr(t);return n===e||!ln(n)||fo(n)?!1:un(n).position==="fixed"||Ny(n,e)}function CS(t,e){const n=e.get(t);if(n)return n;let r=_s(t,[],!1).filter(a=>ln(a)&&_o(a)!=="body"),i=null;const o=un(t).position==="fixed";let s=o?Lr(t):t;for(;ln(s)&&!fo(s);){const a=un(s),l=np(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Js(s)&&!l&&Ny(t,s))?r=r.filter(u=>u!==s):i=a,s=Lr(s)}return e.set(t,r),r}function SS(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Vu(e)?[]:CS(e,this._c):[].concat(n),r],s=o[0],a=o.reduce((l,u)=>{const c=zf(e,u,i);return l.top=io(c.top,l.top),l.right=Id(c.right,l.right),l.bottom=Id(c.bottom,l.bottom),l.left=io(c.left,l.left),l},zf(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function TS(t){const{width:e,height:n}=Iy(t);return{width:e,height:n}}function OS(t,e,n){const r=Tn(e),i=Nn(e),o=n==="fixed",s=ki(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=xn(0);if(r||!r&&!o)if((_o(e)!=="body"||Js(i))&&(a=$u(e)),r){const h=ki(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=op(i));const u=i&&!r&&!o?Ry(i,a):xn(0),c=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:c,y:d,width:s.width,height:s.height}}function kc(t){return un(t).position==="static"}function Hf(t,e){if(!Tn(t)||un(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Nn(t)===n&&(n=n.ownerDocument.body),n}function Py(t,e){const n=Lt(t);if(Vu(t))return n;if(!Tn(t)){let i=Lr(t);for(;i&&!fo(i);){if(ln(i)&&!kc(i))return i;i=Lr(i)}return n}let r=Hf(t,e);for(;r&&mS(r)&&kc(r);)r=Hf(r,e);return r&&fo(r)&&kc(r)&&!np(r)?n:r||gS(t)||n}const AS=async function(t){const e=this.getOffsetParent||Py,n=this.getDimensions,r=await n(t.floating);return{reference:OS(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MS(t){return un(t).direction==="rtl"}const Nd={convertOffsetParentRelativeRectToViewportRelativeRect:bS,getDocumentElement:Nn,getClippingRect:SS,getOffsetParent:Py,getElementRects:AS,getClientRects:kS,getDimensions:TS,getScale:oo,isElement:ln,isRTL:MS};function Fy(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _S(t,e){let n=null,r;const i=Nn(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:c,top:d,width:h,height:p}=u;if(a||e(),!h||!p)return;const f=xa(d),m=xa(i.clientWidth-(c+h)),g=xa(i.clientHeight-(d+p)),y=xa(c),b={rootMargin:-f+"px "+-m+"px "+-g+"px "+-y+"px",threshold:io(0,Id(1,l))||1};let k=!0;function v(w){const x=w[0].intersectionRatio;if(x!==l){if(!k)return s();x?s(!1,x):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x===1&&!Fy(u,t.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,b)}n.observe(t)}return s(!0),o}function IS(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ip(t),c=i||o?[...u?_s(u):[],..._s(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=u&&a?_S(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(e)})),n()}),u&&!l&&p.observe(u),p.observe(e));let f,m=l?ki(t):null;l&&g();function g(){const y=ki(t);m&&!Fy(m,y)&&n(),m=y,f=requestAnimationFrame(g)}return n(),()=>{var y;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const DS=fS,RS=hS,NS=(t,e,n)=>{const r=new Map,i={platform:Nd,...n},o={...i.platform,_c:r};return cS(t,e,{...i,platform:o})};function PS(t){return FS(t)}function xc(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function FS(t){for(let e=t;e;e=xc(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=xc(t);e;e=xc(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||e.tagName==="BODY"))return e}return null}const ju=ie({inheritAttrs:!1,__name:"Dropdown",props:{items:{},placement:{default:"bottom-start"},teleport:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},theme:{default:"border"},teleportTo:{default:"body"},offset:{default:8},variant:{},size:{},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{},stateTimeout:{},confirmLabel:{},label:{},icon:{},iconLeft:{},iconRight:{default:"fa-pro-regular:angle-down"}},setup(t,{expose:e}){const n=t,r=P(()=>{const{items:b,placement:k,teleport:v,keepOpen:w,...x}=n;return x}),i=Q(!1),o=Zh(),s=Q(),a=Q(),l=Q({top:"",left:"",position:""});let u=()=>{};function c(){!s.value||!a.value||(u=IS(s.value.$el,a.value,()=>{!s.value||!a.value||NS(s.value.$el,a.value,{placement:n.placement,middleware:[DS(n.offset),RS()],platform:{...Nd,getOffsetParent:b=>Nd.getOffsetParent(b,PS)}}).then(({x:b,y:k})=>{l.value={top:`${k}px`,left:`${b}px`,position:"absolute"}})}))}Mo(u),Dh(()=>{if(i.value)return c();u()});const d=({target:b},k="dom")=>{if(b instanceof Element&&!(!s.value||!a.value)){if(k==="dom")return[s.value.$el,a.value].some(v=>v&&(b===v||v.contains(b)))?void 0:p(!1);if(k==="shadow-dom"){const v=o.value.getRootNode();return b.shadowRoot===v?void 0:p(!1)}}},h=({key:b})=>b==="Escape"&&p(!1),p=(b=!i.value)=>(b?g():y(),i.value=b,!0),f=P(()=>o.value.getRootNode()),m=P(()=>f.value instanceof ShadowRoot);function g(){window.addEventListener("keydown",h),m.value?(f.value.addEventListener("click",b=>d(b)),window.addEventListener("click",b=>d(b,"shadow-dom"))):window.addEventListener("click",d)}function y(){window.removeEventListener("keydown",h),m.value?(f.value.removeEventListener("click",b=>d(b)),window.removeEventListener("click",b=>d(b,"shadow-dom"))):window.removeEventListener("click",d)}return e({isOpen:i}),(b,k)=>(E(),I(Le,null,[ke(yt,se({...r.value,...b.$attrs},{onClick:k[0]||(k[0]=ws(()=>p(),["stop"])),ref_key:"trigger",ref:s,class:["k-dropdown-trigger",{"k-dropdown-trigger--open":!!i.value}]}),Us({_:2},[b.$slots["icon-left"]?{name:"icon-left",fn:te(()=>[B(b.$slots,"icon-left")]),key:"0"}:void 0,b.$slots.trigger?{name:"default",fn:te(()=>[B(b.$slots,"trigger")]),key:"1"}:void 0,b.$slots["icon-right"]?{name:"icon-right",fn:te(()=>[B(b.$slots,"icon-right")]),key:"2"}:void 0]),1040,["class"]),(E(),U(xv,{to:b.teleportTo,disabled:!b.teleport},[ke(Rh,{name:"k-dropdown"},{default:te(()=>[i.value?(E(),I("div",{key:0,class:Me(`k-dropdown k-dropdown--theme-${b.theme}`),style:In(l.value),ref_key:"content",ref:a,onClick:k[1]||(k[1]=()=>!b.keepOpen&&p(!1))},[B(b.$slots,"default",{close:p.bind(null,!1)},()=>[(E(!0),I(Le,null,Ft(b.items,({action:v,icon:w,...x})=>(E(),U(yt,se({ref_for:!0},x,{variant:"tertiary","icon-right":x.iconRight||w,onClick:()=>v()}),null,16,["icon-right","onClick"]))),256))])],6)):F("",!0)]),_:3})],8,["to","disabled"]))],64))}}),LS={key:0,class:"k-datatable__row"},BS={key:0,class:"k-datatable__cell k-datatable__cell-select"},VS=["data-col-id","onClick"],$S=["innerHTML"],jS={key:1,class:"k-datatable__cell k-datatable__cell-actions"},zS={key:0,class:"k-datatable__cell k-datatable__cell-select"},HS={key:1,class:"k-datatable__cell k-datatable__cell-actions"},qS={key:0,class:"k-datatable__footer"},uV=ie({__name:"DataTable",props:{items:{},selected:{},theme:{default:"default"},header:{type:Boolean,default:!0},sticky:{type:[Boolean,String]},sortBy:{},sortableBy:{default:()=>[]},isDisabled:{type:Function,default:()=>!1},columns:{},labels:{default:()=>({selection:"Valgt",resetSelection:"Tilbakestill valg"})},cellWrapper:{type:Function,default:()=>({component:"div"})},rowWrapper:{type:Function,default:()=>({component:"div"})}},emits:["update:selected","update:sortBy"],setup(t,{emit:e}){const n=t,r=Ph(),i=e,o=Q([-1]),s=P(()=>n.items.filter(f=>!n.isDisabled(f))),a=P(()=>!!n.selected),l=P(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=P(()=>!!r.rowActions),c=P({get:()=>!!(s.value.length&&s.value.every(f=>n.selected&&n.selected.includes(f))),set:f=>i("update:selected",f?[...s.value]:[])}),d=P(()=>[a.value?"2.5rem":!1,...n.columns.filter(({disabled:f})=>!f).map(f=>f.size||"auto"),u.value?"0px":!1].filter(Boolean).join(" "));function h(f){var m;if(!l.value||!n.sortableBy.includes(f))return;let g=((m=n.sortBy)==null?void 0:m[f])||-1;i("update:sortBy",{[f]:g*-1})}function p(f,m){if(!f.isTrusted||!(f.target instanceof HTMLInputElement))return;let g=o.value.slice(-1).pop()||-1,y=[];if(f.shiftKey){let b=g>m,k=g+(b?-1:1);for(;b?k>m:k<m;){let v=n.items[k];!(n.selected||[]).includes(v)&&!n.isDisabled(v)&&y.push(v),b?k--:k++}}f.target.checked?o.value.push(m):g===m&&o.value.pop(),i("update:selected",[...n.selected||[],...y])}return(f,m)=>(E(),I("div",{class:Me([`k-datatable k-datatable--${f.theme}`,{"k-datatable--sticky":!!f.sticky,"k-datatable--no-header":!f.header}]),style:In(`--k-datatable-layout: ${d.value}; --k-datatable-sticky-top: ${typeof f.sticky=="string"?f.sticky:"0"}`)},[f.header?(E(),I("div",LS,[a.value?(E(),I("div",BS,[ke(Pf,{class:"k-datatable__checkbox",modelValue:c.value,"onUpdate:modelValue":m[0]||(m[0]=g=>c.value=g),disabled:!f.items.length},null,8,["modelValue","disabled"])])):F("",!0),(E(!0),I(Le,null,Ft(f.columns.filter(({disabled:g})=>!g),g=>(E(),I("div",{class:Me(["k-datatable__cell",`k-datatable__cell--text-align-${g.align||"start"}`,{"k-datatable__cell-sort":l.value&&f.sortableBy.includes(g.id),"k-datatable__cell-sort--active":g.id in(f.sortBy||{})}]),key:g.id,"data-col-id":g.id,onClick:y=>h(g.id)},[B(f.$slots,`${g.id}-label`,{item:g},()=>[W("span",{innerHTML:g.label},null,8,$S)]),ke(z(We),{class:"k-datatable__cell-sort-icon",icon:(f.sortBy||{})[g.id]<0?"fa-pro-solid:caret-up":"fa-pro-solid:caret-down"},null,8,["icon"])],10,VS))),128)),u.value?(E(),I("div",jS)):F("",!0)])):F("",!0),(E(!0),I(Le,null,Ft(f.items,(g,y)=>(E(),I("div",{class:"k-datatable__row",key:y},[a.value?(E(),I("div",zS,[ke(Pf,{class:"k-datatable__checkbox","model-value":f.selected||[],"onUpdate:modelValue":m[1]||(m[1]=b=>i("update:selected",b)),value:g,onMousedown:m[2]||(m[2]=ws(()=>{},["prevent"])),onClick:b=>p(b,y),disabled:f.isDisabled(g)},null,8,["model-value","value","onClick","disabled"])])):F("",!0),(E(),U(Ye(f.rowWrapper(g).component),se({class:"k-datatable__row-wrapper",ref_for:!0},f.rowWrapper(g).bind,Fh(f.rowWrapper(g).listeners)),{default:te(()=>[(E(!0),I(Le,null,Ft(f.columns.filter(({disabled:b})=>!b),(b,k)=>(E(),U(Ye(f.cellWrapper(g,b).component),se({ref_for:!0},f.cellWrapper(g,b).bind,{class:`k-datatable__cell k-datatable__cell--text-align-${b.align||"start"}`,key:`col-${b.id}`,"data-cell-id":b.id}),{default:te(()=>[B(f.$slots,b.id,{item:g,column:b,rowIndex:y,colIndex:k})]),_:2},1040,["class","data-cell-id"]))),128))]),_:2},1040)),f.$slots["row-actions"]?(E(),I("div",HS,[B(f.$slots,"row-actions",{item:g})])):F("",!0)]))),128)),ke(Rh,{name:"k-datatable-footer"},{default:te(()=>{var g,y;return[f.$slots.footer||(g=f.selected)!=null&&g.length?(E(),I("div",qS,[(y=f.selected)!=null&&y.length?(E(),U(ju,{key:0,label:`${f.labels.selection} (${f.selected.length})`,teleport:!0},{default:te(()=>[B(f.$slots,"select-actions"),ke(yt,{label:f.labels.resetSelection,"icon-right":"fa-pro-light:times-square",variant:"tertiary",onClick:m[3]||(m[3]=b=>i("update:selected",[]))},null,8,["label"])]),_:3},8,["label"])):F("",!0),B(f.$slots,"footer")])):F("",!0)]}),_:3})],6))}});var Pd,Xr=new Map,WS=t=>t.getBoundingClientRect();function US(t,e){const{scope:n="rect",getRect:r=WS,onChange:i}=e,o=KS({scope:n,getRect:r}),s=Xr.get(t);return s?(s.callbacks.push(i),i(r(t))):(Xr.set(t,{rect:{},callbacks:[i]}),Xr.size===1&&(Pd=requestAnimationFrame(o))),function(){const a=Xr.get(t);if(!a)return;const l=a.callbacks.indexOf(i);l>-1&&a.callbacks.splice(l,1),a.callbacks.length===0&&(Xr.delete(t),Xr.size===0&&cancelAnimationFrame(Pd))}}function KS(t){const{scope:e,getRect:n}=t,r=JS(e);return function i(){const o=[];Xr.forEach((s,a)=>{const l=n(a);r(s.rect,l)||(s.rect=l,o.push(s))}),o.forEach(s=>{s.callbacks.forEach(a=>a(s.rect))}),Pd=requestAnimationFrame(i)}}var Ly=(t,e)=>t.width===e.width&&t.height===e.height,By=(t,e)=>t.top===e.top&&t.left===e.left,GS=(t,e)=>Ly(t,e)&&By(t,e);function JS(t){return t==="size"?Ly:t==="position"?By:GS}var YS=Tr("radio-group").parts("root","label","item","itemText","itemControl","indicator"),Vi=YS.build(),be=Ks({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`radio-group:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`radio-group:${t.id}:label`},getItemId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.item)==null?void 0:r.call(n,e))??`radio-group:${t.id}:radio:${e}`},getItemHiddenInputId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.itemHiddenInput)==null?void 0:r.call(n,e))??`radio-group:${t.id}:radio:input:${e}`},getItemControlId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.itemControl)==null?void 0:r.call(n,e))??`radio-group:${t.id}:radio:control:${e}`},getItemLabelId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.itemLabel)==null?void 0:r.call(n,e))??`radio-group:${t.id}:radio:label:${e}`},getIndicatorId:t=>{var e;return((e=t.ids)==null?void 0:e.indicator)??`radio-group:${t.id}:indicator`},getRootEl:t=>be.getById(t,be.getRootId(t)),getItemHiddenInputEl:(t,e)=>be.getById(t,be.getItemHiddenInputId(t,e)),getIndicatorEl:t=>be.getById(t,be.getIndicatorId(t)),getFirstEnabledInputEl:t=>{var e;return(e=be.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled)")},getFirstEnabledAndCheckedInputEl:t=>{var e;return(e=be.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled):checked")},getInputEls:t=>{const e=`input[type=radio][data-ownedby='${CSS.escape(be.getRootId(t))}']:not([disabled])`;return Yv(be.getRootEl(t),e)},getActiveRadioEl:t=>{if(t.value)return be.getById(t,be.getItemId(t,t.value))},getOffsetRect:t=>({left:t?.offsetLeft??0,top:t?.offsetTop??0,width:t?.offsetWidth??0,height:t?.offsetHeight??0}),getRectById:(t,e)=>{const n=be.getById(t,be.getItemId(t,e));if(n)return be.resolveRect(be.getOffsetRect(n))},resolveRect:t=>({width:`${t.width}px`,height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`})});function XS(t,e,n){const r=t.context.isDisabled,i=t.context.readOnly;function o(l){return{invalid:!!l.invalid,disabled:!!l.disabled||r,checked:t.context.value===l.value,focused:t.context.focusedValue===l.value,hovered:t.context.hoveredValue===l.value,active:t.context.activeValue===l.value}}function s(l){const u=o(l);return{"data-focus":Z(u.focused),"data-focus-visible":Z(u.focused&&t.context.focusVisible),"data-disabled":Z(u.disabled),"data-readonly":Z(i),"data-state":u.checked?"checked":"unchecked","data-hover":Z(u.hovered),"data-invalid":Z(u.invalid),"data-orientation":t.context.orientation,"data-ssr":Z(t.context.ssr)}}const a=()=>{const l=be.getFirstEnabledAndCheckedInputEl(t.context);if(l){l.focus();return}const u=be.getFirstEnabledInputEl(t.context);u?.focus()};return{focus:a,value:t.context.value,setValue(l){e({type:"SET_VALUE",value:l,isTrusted:!1})},clearValue(){e({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return n.element({...Vi.root.attrs,role:"radiogroup",id:be.getRootId(t.context),"aria-labelledby":be.getLabelId(t.context),"data-orientation":t.context.orientation,"data-disabled":Z(r),"aria-orientation":t.context.orientation,dir:t.context.dir,style:{position:"relative"}})},getLabelProps(){return n.element({...Vi.label.attrs,dir:t.context.dir,"data-orientation":t.context.orientation,"data-disabled":Z(r),id:be.getLabelId(t.context),onClick:a})},getItemState:o,getItemProps(l){const u=o(l);return n.label({...Vi.item.attrs,dir:t.context.dir,id:be.getItemId(t.context,l.value),htmlFor:be.getItemHiddenInputId(t.context,l.value),...s(l),onPointerMove(){u.disabled||u.hovered||e({type:"SET_HOVERED",value:l.value,hovered:!0})},onPointerLeave(){u.disabled||e({type:"SET_HOVERED",value:null})},onPointerDown(c){u.disabled||(u.focused&&c.pointerType==="mouse"&&c.preventDefault(),e({type:"SET_ACTIVE",value:l.value,active:!0}))},onPointerUp(){u.disabled||e({type:"SET_ACTIVE",value:null})}})},getItemTextProps(l){return n.element({...Vi.itemText.attrs,dir:t.context.dir,id:be.getItemLabelId(t.context,l.value),...s(l)})},getItemControlProps(l){const u=o(l);return n.element({...Vi.itemControl.attrs,dir:t.context.dir,id:be.getItemControlId(t.context,l.value),"data-active":Z(u.active),"aria-hidden":!0,...s(l)})},getItemHiddenInputProps(l){const u=o(l);return n.input({"data-ownedby":be.getRootId(t.context),id:be.getItemHiddenInputId(t.context,l.value),type:"radio",name:t.context.name||t.context.id,form:t.context.form,value:l.value,onClick(c){if(i){c.preventDefault();return}c.currentTarget.checked&&e({type:"SET_VALUE",value:l.value,isTrusted:!0})},onBlur(){e({type:"SET_FOCUSED",value:null,focused:!1,focusVisible:!1})},onFocus(){const c=Ts();e({type:"SET_FOCUSED",value:l.value,focused:!0,focusVisible:c})},onKeyDown(c){c.defaultPrevented||c.key===" "&&e({type:"SET_ACTIVE",value:l.value,active:!0})},onKeyUp(c){c.defaultPrevented||c.key===" "&&e({type:"SET_ACTIVE",value:null})},disabled:u.disabled,defaultChecked:u.checked,style:Hh})},getIndicatorProps(){var l,u,c,d;return n.element({id:be.getIndicatorId(t.context),...Vi.indicator.attrs,dir:t.context.dir,hidden:t.context.value==null,"data-disabled":Z(r),"data-orientation":t.context.orientation,style:{"--transition-property":"left, top, width, height","--left":(l=t.context.indicatorRect)==null?void 0:l.left,"--top":(u=t.context.indicatorRect)==null?void 0:u.top,"--width":(c=t.context.indicatorRect)==null?void 0:c.width,"--height":(d=t.context.indicatorRect)==null?void 0:d.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:t.context.canIndicatorTransition?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[t.context.orientation==="horizontal"?"left":"top"]:t.context.orientation==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:ZS}=Uh;function QS(t){const e=er(t);return Gs({id:"radio",initial:"idle",context:{value:null,activeValue:null,focusedValue:null,hoveredValue:null,disabled:!1,orientation:"vertical",...e,indicatorRect:{},canIndicatorTransition:!1,fieldsetDisabled:!1,focusVisible:!1,ssr:!0},computed:{isDisabled:n=>!!n.disabled||n.fieldsetDisabled},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],activities:["trackFormControlState","trackFocusVisible"],watch:{value:["setIndicatorTransition","syncIndicatorRect","syncInputElements"]},on:{SET_VALUE:[{guard:ZS("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:"setHovered"},SET_ACTIVE:{actions:"setActive"},SET_FOCUSED:{actions:"setFocused"}},states:{idle:{}}},{guards:{isTrusted:(n,r)=>!!r.isTrusted},activities:{trackFormControlState(n,r,{send:i,initialContext:o}){return Iu(be.getRootEl(n),{onFieldsetDisabledChange(s){n.fieldsetDisabled=s},onFormReset(){i({type:"SET_VALUE",value:o.value})}})},trackFocusVisible(n){return qh({root:be.getRootNode(n)})}},actions:{setValue(n,r){tT.value(n,r.value)},setHovered(n,r){n.hoveredValue=r.value},setActive(n,r){n.activeValue=r.value},setFocused(n,r){n.focusedValue=r.value,n.focusVisible=r.focusVisible},syncInputElements(n){be.getInputEls(n).forEach(r=>{r.checked=r.value===n.value})},setIndicatorTransition(n){n.canIndicatorTransition=rn(n.value)},cleanupObserver(n){var r;(r=n.indicatorCleanup)==null||r.call(n)},syncSsr(n){n.ssr=!1},syncIndicatorRect(n){var r;if((r=n.indicatorCleanup)==null||r.call(n),!be.getIndicatorEl(n))return;const i=n.value,o=be.getActiveRadioEl(n);if(i==null||!o){n.indicatorRect={};return}n.indicatorCleanup=US(o,{getRect(s){return be.getOffsetRect(s)},onChange(s){n.indicatorRect=be.resolveRect(s),zh(()=>{n.canIndicatorTransition=!1})}})},dispatchChangeEvent(n){be.getInputEls(n).forEach(r=>{const i=r.value===n.value;i!==r.checked&&Jh(r,{checked:i})})}}})}var eT={change:t=>{var e;t.value!=null&&((e=t.onValueChange)==null||e.call(t,{value:t.value}))}},tT={value:(t,e)=>{Or(t.value,e)||(t.value=e,eT.change(t))}};Mi()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value"]);Mi()(["value","disabled","invalid"]);const nT=["aria-describedby"],cV=ie({__name:"RadioGroup",props:{label:{},modelValue:{},items:{},variant:{default:"radio"},direction:{default:"vertical"},disabled:{type:Boolean},getRootNode:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Tv(Yh,P(()=>({label:""}))),r=t,i=e,o={id:Sn(),name:Sn(),...r,value:r.modelValue,onValueChange:({value:u})=>i("update:modelValue",u),getRootNode:r.getRootNode},[s,a]=Ii(QS(o),{context:P(()=>r)}),l=P(()=>XS(s.value,a,_i));return Fe(()=>r.modelValue,u=>l.value.setValue(u)),(u,c)=>(E(),I("div",se({class:["k-radiogroup",`k-radiogroup--variant-${u.variant} k-radiogroup--direction-${u.direction}`]},l.value.getRootProps(),{"aria-describedby":z(n).helpId}),[u.variant==="radio"&&(z(n).label||u.label)?(E(),I("span",Se(se({key:0},l.value.getLabelProps())),ce(z(n).label||u.label),17)):F("",!0),u.variant==="segment"?(E(),I("div",Se(se({key:1},l.value.getIndicatorProps())),null,16)):F("",!0),(E(!0),I(Le,null,Ft(u.items,d=>(E(),I("label",se({ref_for:!0},l.value.getItemProps({value:d.id})),[W("span",se({ref_for:!0},l.value.getItemTextProps({value:d.id})),ce(d.label),17),W("input",se({ref_for:!0},l.value.getItemHiddenInputProps({value:d.id})),null,16),W("div",se({ref_for:!0},l.value.getItemControlProps({value:d.id})),null,16)],16))),256))],16,nT))}}),dV=ie({__name:"Grid",props:{is:{default:"div"},columns:{default:1},align:{},rows:{},gap:{default:"default"},areas:{}},setup(t){const e=t,n=(o,s)=>o?typeof o=="number"||typeof o=="string"&&o.match(/^\d+$/)?`repeat(${o}, 1fr)`:o.match(/^(\d+\s?)+$/)?o.split(" ").map(a=>`${a}fr`).join(" "):o:s,r=o=>{if(o)return Array.isArray(o)?o.map(s=>`"${s}"`).join(`
|
|
2
|
+
`):o.split("|").map(s=>s.trim()).map(s=>`"${s}"`).join(`
|
|
3
|
+
`)},i=P(()=>zv("grid",{columns:n(e.columns,"1fr"),align:vl(e.align)||"initial",rows:n(e.rows,"auto"),gap:$h(e.gap),areas:r(e.areas)||"unset"}));return(o,s)=>(E(),U(Ye(o.is),{class:"k-grid",style:In(i.value)},{default:te(()=>[B(o.$slots,"default")]),_:3},8,["style"]))}});function Vy(t){return t?t.flatMap(e=>{const{type:n,children:r}=e;return n===Le?Vy(r):[e]}):[]}const hV=ie({props:{area:String,align:String},inheritAttrs:!1,setup({area:t,align:e},{slots:n}){return()=>{if(!n.default)return null;const[r]=Vy(n.default());if(!r)return null;const i=se({style:{"--k-grid-item-area":t,"--k-grid-item-align-self":vl(e)||"initial"}},r.props??{});return lx(r,i)}}}),rT={key:0,class:"k-scroller__indicator"},pV=ie({__name:"Scroller",props:{is:{default:"div"},appearance:{default:"default"},treshhold:{default:80}},setup(t){const e=Sn({prefix:"k-scroller-"}),n=t,r=Q({top:!1,right:!1,left:!1,bottom:!1}),i=P(()=>Object.entries(r.value).filter(([,s])=>s).map(([s])=>s)),o=s=>{const{scrollWidth:a,scrollHeight:l,clientWidth:u,clientHeight:c,scrollTop:d,scrollLeft:h}=s,p=a-u>=n.treshhold,f=l-c>=n.treshhold;r.value={top:f&&d<=n.treshhold,left:p&&h<=n.treshhold,bottom:f&&d>=l-c-n.treshhold,right:p&&h>=a-u-n.treshhold}};return or(()=>{const s=document.getElementById(e);s&&(DE(s,"scroll",()=>o(s)),PE(s,()=>o(s),{childList:!0,subtree:!0}))}),(s,a)=>(E(),U(Ye(s.is),{id:z(e),class:Me([`k-scroller k-scroller--appearance-${s.appearance}`,...i.value.map(l=>`k-scroller--scrolled-to-${l}`)])},{default:te(()=>[s.appearance==="indicator"?(E(),I("div",rT,[B(s.$slots,"indicator",{},()=>[ke(z(We),{icon:"fa-pro-thin:arrow-right"})])])):F("",!0),B(s.$slots,"default")]),_:3},8,["id","class"]))}});var iT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},$i=new WeakMap,wa=new WeakMap,Ea={},wc=0,$y=function(t){return t&&(t.host||$y(t.parentNode))},oT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=$y(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},sT=function(t,e,n,r){var i=oT(e,Array.isArray(t)?t:[t]);Ea[n]||(Ea[n]=new WeakMap);var o=Ea[n],s=[],a=new Set,l=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),f=p!==null&&p!=="false",m=($i.get(h)||0)+1,g=(o.get(h)||0)+1;$i.set(h,m),o.set(h,g),s.push(h),m===1&&f&&wa.set(h,!0),g===1&&h.setAttribute(n,"true"),f||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return c(e),a.clear(),wc++,function(){s.forEach(function(d){var h=$i.get(d)-1,p=o.get(d)-1;$i.set(d,h),o.set(d,p),h||(wa.has(d)||d.removeAttribute(r),wa.delete(d)),p||d.removeAttribute(n)}),wc--,wc||($i=new WeakMap,$i=new WeakMap,wa=new WeakMap,Ea={})}},aT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=iT(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),sT(r,i,n,"aria-hidden")):function(){return null}},lT=t=>{const e=requestAnimationFrame(()=>t());return()=>cancelAnimationFrame(e)};function uT(t,e={}){const{defer:n=!0}=e,r=n?lT:o=>o(),i=[];return i.push(r(()=>{const o=(typeof t=="function"?t():t).filter(Boolean);i.push(aT(o))})),()=>{i.forEach(o=>o?.())}}function cT(t){const e={each(n){var r;for(let i=0;i<((r=t.frames)==null?void 0:r.length);i+=1){const o=t.frames[i];o&&n(o)}},addEventListener(n,r,i){return e.each(o=>{try{o.document.addEventListener(n,r,i)}catch{}}),()=>{try{e.removeEventListener(n,r,i)}catch{}}},removeEventListener(n,r,i){e.each(o=>{try{o.document.removeEventListener(n,r,i)}catch{}})}};return e}function dT(t){const e=t.frameElement!=null?t.parent:null;return{addEventListener:(n,r,i)=>{try{e?.addEventListener(n,r,i)}catch{}return()=>{try{e?.removeEventListener(n,r,i)}catch{}}},removeEventListener:(n,r,i)=>{try{e?.removeEventListener(n,r,i)}catch{}}}}var qf="pointerdown.outside",Wf="focus.outside";function hT(t){for(const e of t)if(Cn(e)&&Gv(e))return!0;return!1}var jy=t=>"clientY"in t;function pT(t,e){if(!jy(e)||!t)return!1;const n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function Uf(t,e){if(!e||!jy(t))return!1;const n=e.scrollHeight>e.clientHeight&&t.clientX>e.clientWidth,r=e.scrollWidth>e.clientWidth&&t.clientY>e.clientHeight;return n||r}function fT(t,e){const{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:o,defer:s}=e;if(!t)return;const a=Rn(t),l=Zn(t),u=cT(l),c=dT(l);function d(y){const b=Qn(y);if(!Cn(b)||Ss(t,b)||pT(t,y)||Uf(y,b))return!1;const k=Jv(t);return Uf(y,k)?!1:!(n!=null&&n(b))}const h=new Set;function p(y){function b(){var k;const v=s?Fr:x=>x(),w=((k=y.composedPath)==null?void 0:k.call(y))??[y.target];v(()=>{if(!(!t||!d(y))){if(i||o){const x=Cf(i,o);t.addEventListener(qf,x,{once:!0})}Af(t,qf,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:$1(y),focusable:hT(w)}})}})}y.pointerType==="touch"?(h.forEach(k=>k()),h.add(vt(a,"click",b,{once:!0})),h.add(c.addEventListener("click",b,{once:!0})),h.add(u.addEventListener("click",b,{once:!0}))):b()}const f=new Set,m=setTimeout(()=>{f.add(vt(a,"pointerdown",p,!0)),f.add(c.addEventListener("pointerdown",p,!0)),f.add(u.addEventListener("pointerdown",p,!0))},0);function g(y){(s?Fr:b=>b())(()=>{if(!(!t||!d(y))){if(r||o){const b=Cf(r,o);t.addEventListener(Wf,b,{once:!0})}Af(t,Wf,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:Gv(Qn(y))}})}})}return f.add(vt(a,"focusin",g,!0)),f.add(c.addEventListener("focusin",g,!0)),f.add(u.addEventListener("focusin",g,!0)),()=>{clearTimeout(m),h.forEach(y=>y()),f.forEach(y=>y())}}function mT(t,e){const{defer:n}=e,r=n?Fr:o=>o(),i=[];return i.push(r(()=>{const o=typeof t=="function"?t():t;i.push(fT(o,e))})),()=>{i.forEach(o=>o?.())}}function gT(t,e){const n=r=>{r.key==="Escape"&&(r.isComposing||e==null||e(r))};return vt(Rn(t),"keydown",n,{capture:!0})}var nn={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(t=>t.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(t){var e;const n=this.indexOf(t),r=this.topMostPointerBlockingLayer()?this.indexOf((e=this.topMostPointerBlockingLayer())==null?void 0:e.node):-1;return n<r},isTopMost(t){const e=this.layers[this.count()-1];return e?.node===t},getNestedLayers(t){return Array.from(this.layers).slice(this.indexOf(t)+1)},isInNestedLayer(t,e){return this.getNestedLayers(t).some(n=>Ss(n.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>Ss(e,t))},add(t){const e=this.layers.push(t);t.node.style.setProperty("--layer-index",`${e}`)},addBranch(t){this.branches.push(t)},remove(t){const e=this.indexOf(t);e<0||(e<this.count()-1&&this.getNestedLayers(t).forEach(n=>n.dismiss()),this.layers.splice(e,1),t.style.removeProperty("--layer-index"))},removeBranch(t){const e=this.branches.indexOf(t);e>=0&&this.branches.splice(e,1)},indexOf(t){return this.layers.findIndex(e=>e.node===t)},dismiss(t){var e;(e=this.layers[this.indexOf(t)])==null||e.dismiss()},clear(){this.remove(this.layers[0].node)}},Kf;function Gf(){nn.layers.forEach(({node:t})=>{t.style.pointerEvents=nn.isBelowPointerBlockingLayer(t)?"none":"auto"})}function vT(t){t.style.pointerEvents=""}function yT(t,e){const n=Rn(t),r=[];if(nn.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Kf=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),e){const i=e1(e,o=>{r.push(Xw(o,{pointerEvents:"auto"}))});r.push(i)}return()=>{nn.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Kf,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(i=>i()))}}function bT(t,e){if(!t){Ja("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:r,exclude:i,debug:o}=e,s={dismiss:n,node:t,pointerBlocking:r};nn.add(s),Gf();function a(h){var p,f;const m=Qn(h.detail.originalEvent);nn.isBelowPointerBlockingLayer(t)||nn.isInBranch(m)||((p=e.onPointerDownOutside)==null||p.call(e,h),(f=e.onInteractOutside)==null||f.call(e,h),!h.defaultPrevented&&(o&&console.log("onPointerDownOutside:",h.detail.originalEvent),n?.()))}function l(h){var p,f;const m=Qn(h.detail.originalEvent);nn.isInBranch(m)||((p=e.onFocusOutside)==null||p.call(e,h),(f=e.onInteractOutside)==null||f.call(e,h),!h.defaultPrevented&&(o&&console.log("onFocusOutside:",h.detail.originalEvent),n?.()))}function u(h){var p;nn.isTopMost(t)&&((p=e.onEscapeKeyDown)==null||p.call(e,h),!h.defaultPrevented&&n&&(h.preventDefault(),n()))}function c(h){var p;if(!t)return!1;const f=typeof i=="function"?i():i,m=Array.isArray(f)?f:[f],g=(p=e.persistentElements)==null?void 0:p.map(y=>y()).filter(Cn);return g&&m.push(...g),m.some(y=>Ss(y,h))||nn.isInNestedLayer(t,h)}const d=[r?yT(t,e.persistentElements):void 0,gT(t,u),mT(t,{exclude:c,onFocusOutside:l,onPointerDownOutside:a,defer:e.defer})];return()=>{nn.remove(t),Gf(),vT(t),d.forEach(h=>h?.())}}function kT(t,e){const{defer:n}=e,r=n?Fr:o=>o(),i=[];return i.push(r(()=>{const o=Os(t)?t():t;i.push(bT(o,e))})),()=>{i.forEach(o=>o?.())}}var Ec="data-scroll-lock";function Jf(t,e){if(!t)return;const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function xT(t,e,n){if(!t)return;const r=t.style.getPropertyValue(e);return t.style.setProperty(e,n),()=>{r?t.style.setProperty(e,r):t.style.removeProperty(e)}}function wT(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function ET(t){const e=t??document,n=e.defaultView??window,{documentElement:r,body:i}=e;if(i.hasAttribute(Ec))return;i.setAttribute(Ec,"");const o=n.innerWidth-r.clientWidth,s=()=>xT(r,"--scrollbar-width",`${o}px`),a=wT(r),l=()=>Jf(i,{overflow:"hidden",[a]:`${o}px`}),u=()=>{const{scrollX:d,scrollY:h,visualViewport:p}=n,f=p?.offsetLeft??0,m=p?.offsetTop??0,g=Jf(i,{position:"fixed",overflow:"hidden",top:`${-(h-Math.floor(m))}px`,left:`${-(d-Math.floor(f))}px`,right:"0",[a]:`${o}px`});return()=>{g?.(),n.scrollTo({left:d,top:h,behavior:"instant"})}},c=[s(),jh()?u():l()];return()=>{c.forEach(d=>d?.()),i.removeAttribute(Ec)}}/*!
|
|
4
4
|
* tabbable 6.2.0
|
|
5
5
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
6
|
-
*/var
|
|
6
|
+
*/var zy=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Sl=zy.join(","),Hy=typeof Element>"u",xi=Hy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Tl=!Hy&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Ol=function t(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),o=i===""||i==="true",s=o||n&&e&&t(e.parentNode);return s},CT=function(t){var e,n=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return n===""||n==="true"},qy=function(t,e,n){if(Ol(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Sl));return e&&xi.call(t,Sl)&&r.unshift(t),r=r.filter(n),r},Wy=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var s=o.shift();if(!Ol(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=t(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=xi.call(s,Sl);c&&r.filter(s)&&(n||!e.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!Ol(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&h){var p=t(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:s,candidates:p})}else o.unshift.apply(o,s.children)}}return i},Uy=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ti=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||CT(t))&&!Uy(t)?0:t.tabIndex},ST=function(t,e){var n=ti(t);return n<0&&e&&!Uy(t)?0:n},TT=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},Ky=function(t){return t.tagName==="INPUT"},OT=function(t){return Ky(t)&&t.type==="hidden"},AT=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return e},MT=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]},_T=function(t){if(!t.name)return!0;var e=t.form||Tl(t),n=function(o){return e.querySelectorAll('input[type="radio"][name="'+o+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=n(window.CSS.escape(t.name));else try{r=n(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=MT(r,t.form);return!i||i===t},IT=function(t){return Ky(t)&&t.type==="radio"},DT=function(t){return IT(t)&&!_T(t)},RT=function(t){var e,n=t&&Tl(t),r=(e=n)===null||e===void 0?void 0:e.host,i=!1;if(n&&n!==t){var o,s,a;for(i=!!((o=r)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(r)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&r;){var l,u,c;n=Tl(r),r=(l=n)===null||l===void 0?void 0:l.host,i=!!((u=r)!==null&&u!==void 0&&(c=u.ownerDocument)!==null&&c!==void 0&&c.contains(r))}}return i},Yf=function(t){var e=t.getBoundingClientRect(),n=e.width,r=e.height;return n===0&&r===0},NT=function(t,e){var n=e.displayCheck,r=e.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=xi.call(t,"details>summary:first-of-type"),o=i?t.parentElement:t;if(xi.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof r=="function"){for(var s=t;t;){var a=t.parentElement,l=Tl(t);if(a&&!a.shadowRoot&&r(a)===!0)return Yf(t);t.assignedSlot?t=t.assignedSlot:!a&&l!==t.ownerDocument?t=l.host:t=a}t=s}if(RT(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Yf(t);return!1},PT=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var n=0;n<e.children.length;n++){var r=e.children.item(n);if(r.tagName==="LEGEND")return xi.call(e,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}e=e.parentElement}return!1},Al=function(t,e){return!(e.disabled||Ol(e)||OT(e)||NT(e,t)||AT(e)||PT(e))},Fd=function(t,e){return!(DT(e)||ti(e)<0||!Al(t,e))},FT=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},LT=function t(e){var n=[],r=[];return e.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=ST(a,s),u=s?t(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(TT).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},BT=function(t,e){e=e||{};var n;return e.getShadowRoot?n=Wy([t],e.includeContainer,{filter:Fd.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:FT}):n=qy(t,e.includeContainer,Fd.bind(null,e)),LT(n)},VT=function(t,e){e=e||{};var n;return e.getShadowRoot?n=Wy([t],e.includeContainer,{filter:Al.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):n=qy(t,e.includeContainer,Al.bind(null,e)),n},ji=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return xi.call(t,Sl)===!1?!1:Fd(e,t)},$T=zy.concat("iframe").join(","),Cc=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return xi.call(t,$T)===!1?!1:Al(e,t)};/*!
|
|
7
7
|
* focus-trap 7.6.0
|
|
8
8
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
9
|
-
*/function Jf(e,t,n){return(t=tg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Co(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wo(Object(n),!0).forEach(function(i){Jf(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function eg(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tg(e){var t=eg(e,"string");return typeof t=="symbol"?t:t+""}var Ao={activateTrap:function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var i=e.indexOf(t);i===-1||e.splice(i,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},ng=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ig=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},xn=function(e){return e?.key==="Tab"||e?.keyCode===9},rg=function(e){return xn(e)&&!e.shiftKey},ag=function(e){return xn(e)&&e.shiftKey},So=function(e){return setTimeout(e,0)},To=function(e,t){var n=-1;return e.every(function(i,r){return t(i)?(n=r,!1):!0}),n},pn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,n):e},Kn=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},og=[],sg=function(e,t){var n=t?.document||document,i=t?.trapStack||og,r=Co({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:rg,isKeyBackward:ag},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(y,x,I){return y&&y[x]!==void 0?y[x]:r[I||x]},l=function(y,x){var I=typeof x?.composedPath=="function"?x.composedPath():void 0;return a.containerGroups.findIndex(function(B){var L=B.container,N=B.tabbableNodes;return L.contains(y)||I?.includes(L)||N.find(function(Z){return Z===y})})},u=function(y){var x=r[y];if(typeof x=="function"){for(var I=arguments.length,B=new Array(I>1?I-1:0),L=1;L<I;L++)B[L-1]=arguments[L];x=x.apply(void 0,B)}if(x===!0&&(x=void 0),!x){if(x===void 0||x===!1)return x;throw new Error("`".concat(y,"` was specified but was not a node, or did not return a node"))}var N=x;if(typeof x=="string"&&(N=n.querySelector(x),!N))throw new Error("`".concat(y,"` as selector refers to no known node"));return N},c=function(){var y=u("initialFocus");if(y===!1)return!1;if(y===void 0||!dr(y,r.tabbableOptions))if(l(n.activeElement)>=0)y=n.activeElement;else{var x=a.tabbableGroups[0],I=x&&x.firstTabbableNode;y=I||u("fallbackFocus")}if(!y)throw new Error("Your focus-trap needs to have at least one focusable element");return y},d=function(){if(a.containerGroups=a.containers.map(function(y){var x=Kf(y,r.tabbableOptions),I=Zf(y,r.tabbableOptions),B=x.length>0?x[0]:void 0,L=x.length>0?x[x.length-1]:void 0,N=I.find(function(Q){return Yt(Q)}),Z=I.slice().reverse().find(function(Q){return Yt(Q)}),ie=!!x.find(function(Q){return Rt(Q)>0});return{container:y,tabbableNodes:x,focusableNodes:I,posTabIndexesFound:ie,firstTabbableNode:B,lastTabbableNode:L,firstDomTabbableNode:N,lastDomTabbableNode:Z,nextTabbableNode:function(Q){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,dn=x.indexOf(Q);return dn<0?qe?I.slice(I.indexOf(Q)+1).find(function(Je){return Yt(Je)}):I.slice(0,I.indexOf(Q)).reverse().find(function(Je){return Yt(Je)}):x[dn+(qe?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(y){return y.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(y){return y.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(y){var x=y.activeElement;if(x)return x.shadowRoot&&x.shadowRoot.activeElement!==null?h(x.shadowRoot):x},p=function(y){if(y!==!1&&y!==h(document)){if(!y||!y.focus){p(c());return}y.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=y,ng(y)&&y.select()}},f=function(y){var x=u("setReturnFocus",y);return x||(x===!1?!1:y)},g=function(y){var x=y.target,I=y.event,B=y.isBackward,L=B===void 0?!1:B;x=x||Kn(I),d();var N=null;if(a.tabbableGroups.length>0){var Z=l(x,I),ie=Z>=0?a.containerGroups[Z]:void 0;if(Z<0)L?N=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:N=a.tabbableGroups[0].firstTabbableNode;else if(L){var Q=To(a.tabbableGroups,function(Zi){var Qi=Zi.firstTabbableNode;return x===Qi});if(Q<0&&(ie.container===x||dr(x,r.tabbableOptions)&&!Yt(x,r.tabbableOptions)&&!ie.nextTabbableNode(x,!1))&&(Q=Z),Q>=0){var qe=Q===0?a.tabbableGroups.length-1:Q-1,dn=a.tabbableGroups[qe];N=Rt(x)>=0?dn.lastTabbableNode:dn.lastDomTabbableNode}else xn(I)||(N=ie.nextTabbableNode(x,!1))}else{var Je=To(a.tabbableGroups,function(Zi){var Qi=Zi.lastTabbableNode;return x===Qi});if(Je<0&&(ie.container===x||dr(x,r.tabbableOptions)&&!Yt(x,r.tabbableOptions)&&!ie.nextTabbableNode(x))&&(Je=Z),Je>=0){var Ml=Je===a.tabbableGroups.length-1?0:Je+1,Ta=a.tabbableGroups[Ml];N=Rt(x)>=0?Ta.firstTabbableNode:Ta.firstDomTabbableNode}else xn(I)||(N=ie.nextTabbableNode(x))}}else N=u("fallbackFocus");return N},m=function(y){var x=Kn(y);if(!(l(x,y)>=0)){if(pn(r.clickOutsideDeactivates,y)){o.deactivate({returnFocus:r.returnFocusOnDeactivate});return}pn(r.allowOutsideClick,y)||y.preventDefault()}},b=function(y){var x=Kn(y),I=l(x,y)>=0;if(I||x instanceof Document)I&&(a.mostRecentlyFocusedNode=x);else{y.stopImmediatePropagation();var B,L=!0;if(a.mostRecentlyFocusedNode)if(Rt(a.mostRecentlyFocusedNode)>0){var N=l(a.mostRecentlyFocusedNode),Z=a.containerGroups[N].tabbableNodes;if(Z.length>0){var ie=Z.findIndex(function(Q){return Q===a.mostRecentlyFocusedNode});ie>=0&&(r.isKeyForward(a.recentNavEvent)?ie+1<Z.length&&(B=Z[ie+1],L=!1):ie-1>=0&&(B=Z[ie-1],L=!1))}}else a.containerGroups.some(function(Q){return Q.tabbableNodes.some(function(qe){return Rt(qe)>0})})||(L=!1);else L=!1;L&&(B=g({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),p(B||a.mostRecentlyFocusedNode||c())}a.recentNavEvent=void 0},v=function(y){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=y;var I=g({event:y,isBackward:x});I&&(xn(y)&&y.preventDefault(),p(I))},E=function(y){(r.isKeyForward(y)||r.isKeyBackward(y))&&v(y,r.isKeyBackward(y))},T=function(y){ig(y)&&pn(r.escapeDeactivates,y)!==!1&&(y.preventDefault(),o.deactivate())},_=function(y){var x=Kn(y);l(x,y)>=0||pn(r.clickOutsideDeactivates,y)||pn(r.allowOutsideClick,y)||(y.preventDefault(),y.stopImmediatePropagation())},S=function(){if(a.active)return Ao.activateTrap(i,o),a.delayInitialFocusTimer=r.delayInitialFocus?So(function(){p(c())}):p(c()),n.addEventListener("focusin",b,!0),n.addEventListener("mousedown",m,{capture:!0,passive:!1}),n.addEventListener("touchstart",m,{capture:!0,passive:!1}),n.addEventListener("click",_,{capture:!0,passive:!1}),n.addEventListener("keydown",E,{capture:!0,passive:!1}),n.addEventListener("keydown",T),o},X=function(){if(a.active)return n.removeEventListener("focusin",b,!0),n.removeEventListener("mousedown",m,!0),n.removeEventListener("touchstart",m,!0),n.removeEventListener("click",_,!0),n.removeEventListener("keydown",E,!0),n.removeEventListener("keydown",T),o},D=function(y){var x=y.some(function(I){var B=Array.from(I.removedNodes);return B.some(function(L){return L===a.mostRecentlyFocusedNode})});x&&p(c())},C=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(D):void 0,k=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map(function(y){C.observe(y,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(y){if(a.active)return this;var x=s(y,"onActivate"),I=s(y,"onPostActivate"),B=s(y,"checkCanFocusTrap");B||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,x?.();var L=function(){B&&d(),S(),k(),I?.()};return B?(B(a.containers.concat()).then(L,L),this):(L(),this)},deactivate:function(y){if(!a.active)return this;var x=Co({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},y);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,k(),Ao.deactivateTrap(i,o);var I=s(x,"onDeactivate"),B=s(x,"onPostDeactivate"),L=s(x,"checkCanReturnFocus"),N=s(x,"returnFocus","returnFocusOnDeactivate");I?.();var Z=function(){So(function(){N&&p(f(a.nodeFocusedBeforeActivation)),B?.()})};return N&&L?(L(f(a.nodeFocusedBeforeActivation)).then(Z,Z),this):(Z(),this)},pause:function(y){if(a.paused||!a.active)return this;var x=s(y,"onPause"),I=s(y,"onPostPause");return a.paused=!0,x?.(),X(),k(),I?.(),this},unpause:function(y){if(!a.paused||!a.active)return this;var x=s(y,"onUnpause"),I=s(y,"onPostUnpause");return a.paused=!1,x?.(),d(),S(),k(),I?.(),this},updateContainerElements:function(y){var x=[].concat(y).filter(Boolean);return a.containers=x.map(function(I){return typeof I=="string"?n.querySelector(I):I}),a.active&&d(),k(),this}},o.updateContainerElements(e),o},lg=mt("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Tt=lg.build(),G=Rn({getPositionerId:e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`dialog:${e.id}:positioner`},getBackdropId:e=>{var t;return((t=e.ids)==null?void 0:t.backdrop)??`dialog:${e.id}:backdrop`},getContentId:e=>{var t;return((t=e.ids)==null?void 0:t.content)??`dialog:${e.id}:content`},getTriggerId:e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`dialog:${e.id}:trigger`},getTitleId:e=>{var t;return((t=e.ids)==null?void 0:t.title)??`dialog:${e.id}:title`},getDescriptionId:e=>{var t;return((t=e.ids)==null?void 0:t.description)??`dialog:${e.id}:description`},getCloseTriggerId:e=>{var t;return((t=e.ids)==null?void 0:t.closeTrigger)??`dialog:${e.id}:close`},getContentEl:e=>G.getById(e,G.getContentId(e)),getPositionerEl:e=>G.getById(e,G.getPositionerId(e)),getBackdropEl:e=>G.getById(e,G.getBackdropId(e)),getTriggerEl:e=>G.getById(e,G.getTriggerId(e)),getTitleEl:e=>G.getById(e,G.getTitleId(e)),getDescriptionEl:e=>G.getById(e,G.getDescriptionId(e)),getCloseTriggerEl:e=>G.getById(e,G.getCloseTriggerId(e))});function ug(e,t,n){const i=e.context["aria-label"],r=e.matches("open"),a=e.context.renderedElements;return{open:r,setOpen(o){o!==r&&t(o?"OPEN":"CLOSE")},getTriggerProps(){return n.button({...Tt.trigger.attrs,dir:e.context.dir,id:G.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":r,"data-state":r?"open":"closed","aria-controls":G.getContentId(e.context),onClick(o){o.defaultPrevented||t("TOGGLE")}})},getBackdropProps(){return n.element({...Tt.backdrop.attrs,dir:e.context.dir,hidden:!r,id:G.getBackdropId(e.context),"data-state":r?"open":"closed"})},getPositionerProps(){return n.element({...Tt.positioner.attrs,dir:e.context.dir,id:G.getPositionerId(e.context),style:{pointerEvents:r?void 0:"none"}})},getContentProps(){return n.element({...Tt.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!r,id:G.getContentId(e.context),tabIndex:-1,"data-state":r?"open":"closed","aria-modal":!0,"aria-label":i||void 0,"aria-labelledby":i||!a.title?void 0:G.getTitleId(e.context),"aria-describedby":a.description?G.getDescriptionId(e.context):void 0})},getTitleProps(){return n.element({...Tt.title.attrs,dir:e.context.dir,id:G.getTitleId(e.context)})},getDescriptionProps(){return n.element({...Tt.description.attrs,dir:e.context.dir,id:G.getDescriptionId(e.context)})},getCloseTriggerProps(){return n.button({...Tt.closeTrigger.attrs,dir:e.context.dir,id:G.getCloseTriggerId(e.context),type:"button",onClick(o){o.defaultPrevented||(o.stopPropagation(),t("CLOSE"))}})}}}function cg(e){const t=lt(e);return Mn({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:n=>!!n["open.controlled"]},activities:{trackDismissableElement(n,i,{send:r}){return Of(()=>G.getContentEl(n),{defer:!0,pointerBlocking:n.modal,exclude:[G.getTriggerEl(n)],onInteractOutside(a){var o;(o=n.onInteractOutside)==null||o.call(n,a),n.closeOnInteractOutside||a.preventDefault()},persistentElements:n.persistentElements,onFocusOutside:n.onFocusOutside,onPointerDownOutside:n.onPointerDownOutside,onEscapeKeyDown(a){var o;(o=n.onEscapeKeyDown)==null||o.call(n,a),n.closeOnEscape||a.preventDefault()},onDismiss(){r({type:"CLOSE",src:"interact-outside"})}})},preventScroll(n){if(n.preventScroll)return Mf(G.getDoc(n))},trapFocus(n){if(!n.trapFocus||!n.modal)return;let i;const r=la(()=>{var a;const o=G.getContentEl(n);if(o){i=sg(o,{document:G.getDoc(n),escapeDeactivates:!1,preventScroll:!0,fallbackFocus:o,returnFocusOnDeactivate:n.restoreFocus,allowOutsideClick:!0,initialFocus:((a=n.initialFocusEl)==null?void 0:a.call(n))??void 0,setReturnFocus(s){var l;return((l=n.finalFocusEl)==null?void 0:l.call(n))??s}});try{i.activate()}catch{}}});return()=>{i?.deactivate(),r()}},hideContentBelow(n){return n.modal?kf(()=>[G.getContentEl(n)],{defer:!0}):void 0}},actions:{setAlertDialogProps(n){n.role==="alertdialog"&&(n.initialFocusEl||(n.initialFocusEl=()=>G.getCloseTriggerEl(n)),n.closeOnInteractOutside=!1)},checkRenderedElements(n){Et(()=>{n.renderedElements.title=!!G.getTitleEl(n),n.renderedElements.description=!!G.getDescriptionEl(n)})},syncZIndex(n){Et(()=>{const i=G.getContentEl(n);if(!i)return;const r=G.getWin(n).getComputedStyle(i);[G.getPositionerEl(n),G.getBackdropEl(n)].forEach(a=>{a?.style.setProperty("--z-index",r.zIndex)})})},invokeOnClose(n){var i;(i=n.onOpenChange)==null||i.call(n,{open:!1})},invokeOnOpen(n){var i;(i=n.onOpenChange)==null||i.call(n,{open:!0})},toggleVisibility(n,i,{send:r}){r({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:i})}}})}qt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const dg=["data-id"],hg=["data-id"],pg=["data-id"],fg={class:"k-dialog__card-header"},Pm=oe({__name:"Dialog",props:{title:{},description:{},closeOnOutsideClick:{type:Boolean,default:!0},role:{default:"dialog"},alignment:{default:"top"},triggerLabel:{},showCloseTrigger:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},dialogId:{},teleport:{type:Boolean,default:!0},disabled:{type:Boolean}},emits:["open","close","clickoutside"],setup(e,{expose:t,emit:n}){var i;const r=e,a=n,o=al(),[s,l]=Bn(cg({id:_t({prefix:"dialog"}),closeOnEscape:r.closeOnEsc,modal:!0,role:r.role,onOpenChange(){if(!u.value.open)return a("open");a("close")},onPointerDownOutside(){a("clickoutside"),r.closeOnOutsideClick&&u.value.setOpen(!1)},getRootNode:(i=o.value)==null?void 0:i.getRootNode}),{context:U(()=>r)}),u=U(()=>ug(s.value,l,Vn)),c=d=>r.dialogId?`${r.dialogId}-${d}`:"";return t({open:()=>u.value.setOpen(!0),close:()=>u.value.setOpen(!1)}),(d,h)=>(A(),P("div",{class:"k-dialog","data-id":d.dialogId},[z(d.$slots,"trigger",{triggerProps:u.value.getTriggerProps()},()=>[d.triggerLabel?(A(),ue(Nt,te({key:0,class:"k-dialog__trigger",variant:"secondary"},u.value.getTriggerProps(),{disabled:d.disabled}),{default:ve(()=>[$e(de(d.triggerLabel),1)]),_:1},16,["disabled"])):W("",!0)]),(A(),ue(Xo,{to:"body",disabled:!d.teleport},[u.value.open?(A(),P(rt,{key:0},[ee("div",te({class:"k-dialog__backdrop"},u.value.getBackdropProps(),{"data-id":c("backdrop")}),null,16,hg),ee("div",te({class:`k-dialog__container k-dialog--align-${d.alignment}`},u.value.getPositionerProps(),{"data-id":c("container")}),[Ne(Eh,te({class:"k-dialog__card",variant:"shadow"},u.value.getContentProps(),{"data-id":c("dialog")}),Go({default:ve(()=>[z(d.$slots,"header",{titleProps:u.value.titleProps,descriptionProps:u.value.getDescriptionProps(),closeTriggerProps:u.value.getCloseTriggerProps()},()=>[ee("div",fg,[z(d.$slots,"title",{titleProps:u.value.getTitleProps()},()=>[d.title?(A(),P("h2",te({key:0,class:"k-dialog__title"},u.value.getTitleProps()),de(d.title),17)):W("",!0)]),z(d.$slots,"description",{descriptionProps:u.value.getDescriptionProps()},()=>[d.description?(A(),P("span",te({key:0,class:"k-dialog__description"},u.value.getDescriptionProps()),de(d.description),17)):W("",!0)]),d.showCloseTrigger?(A(),ue(Nt,te({key:0,class:"k-dialog__close-trigger",variant:"tertiary",icon:"fa-pro-light:times",size:"small"},u.value.getCloseTriggerProps()),null,16)):W("",!0)])]),z(d.$slots,"default",{descriptionProps:u.value.getDescriptionProps()})]),_:2},[d.$slots.footer?{name:"footer",fn:ve(()=>[z(d.$slots,"footer",{close:()=>u.value.setOpen(!1)})]),key:"0"}:void 0]),1040,["data-id"])],16,pg)],64)):W("",!0)],8,["disabled"]))],8,dg))}});function gg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yi(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}Yi.prototype.define=function(e,t){for(let n in e){let i=e[n].map(function(r){return r.toLowerCase()});n=n.toLowerCase();for(let r=0;r<i.length;r++){const a=i[r];if(a[0]!=="*"){if(!t&&a in this._types)throw new Error('Attempt to change mapping for "'+a+'" extension from "'+this._types[a]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+a+'" from the list of extensions for "'+n+'".');this._types[a]=n}}if(t||!this._extensions[n]){const r=i[0];this._extensions[n]=r[0]!=="*"?r:r.substr(1)}}};Yi.prototype.getType=function(e){e=String(e);let t=e.replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(n.length<t.length-1||!i)&&this._types[n]||null};Yi.prototype.getExtension=function(e){return e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1,e&&this._extensions[e.toLowerCase()]||null};var mg=Yi,vg={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let bg=mg;new bg(vg);const yg=oe({__name:"CreateTrigger",props:{label:{}},setup(e){return(t,n)=>(A(),ue(Nt,{type:"button",label:t.label,iconRight:"fa6-solid:image",size:"small",variant:"tertiary"},null,8,["label"]))}}),xg=oe({__name:"Thumbnail",props:{value:{}},setup(e){const t=e,n=U(()=>({backgroundImage:`url(${t.value.url})`}));return(i,r)=>(A(),P("div",{class:"k-media-image__thumbnail",style:St(n.value),onClick:r[0]||(r[0]=a=>i.$emit("click"))},null,4))}}),kg=oe({__name:"Preview",props:{value:{},size:{}},setup(e){const t=e,n=U(()=>({padding:t.size==="cover"?"0":"1rem",backgroundSize:t.size,backgroundImage:`url(${t.value.url})`}));return(i,r)=>(A(),P("div",{class:"k-media-image-preview",style:St(n.value)},null,4))}});Ji(yg),Ji(xg),Ji(kg);/**!
|
|
9
|
+
*/function jT(t,e,n){return(e=HT(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xf(Object(n),!0).forEach(function(r){jT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xf(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zT(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function HT(t){var e=zT(t,"string");return typeof e=="symbol"?e:e+""}var Qf={activateTrap:function(t,e){if(t.length>0){var n=t[t.length-1];n!==e&&n.pause()}var r=t.indexOf(e);r===-1||t.splice(r,1),t.push(e)},deactivateTrap:function(t,e){var n=t.indexOf(e);n!==-1&&t.splice(n,1),t.length>0&&t[t.length-1].unpause()}},qT=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},WT=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},ts=function(t){return t?.key==="Tab"||t?.keyCode===9},UT=function(t){return ts(t)&&!t.shiftKey},KT=function(t){return ts(t)&&t.shiftKey},em=function(t){return setTimeout(t,0)},tm=function(t,e){var n=-1;return t.every(function(r,i){return e(r)?(n=i,!1):!0}),n},$o=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return typeof t=="function"?t.apply(void 0,n):t},Ca=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},GT=[],JT=function(t,e){var n=e?.document||document,r=e?.trapStack||GT,i=Zf({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:UT,isKeyBackward:KT},e),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,a=function(C,T,R){return C&&C[T]!==void 0?C[T]:i[R||T]},l=function(C,T){var R=typeof T?.composedPath=="function"?T.composedPath():void 0;return o.containerGroups.findIndex(function(j){var H=j.container,$=j.tabbableNodes;return H.contains(C)||R?.includes(H)||$.find(function(X){return X===C})})},u=function(C){var T=i[C];if(typeof T=="function"){for(var R=arguments.length,j=new Array(R>1?R-1:0),H=1;H<R;H++)j[H-1]=arguments[H];T=T.apply(void 0,j)}if(T===!0&&(T=void 0),!T){if(T===void 0||T===!1)return T;throw new Error("`".concat(C,"` was specified but was not a node, or did not return a node"))}var $=T;if(typeof T=="string"&&($=n.querySelector(T),!$))throw new Error("`".concat(C,"` as selector refers to no known node"));return $},c=function(){var C=u("initialFocus");if(C===!1)return!1;if(C===void 0||!Cc(C,i.tabbableOptions))if(l(n.activeElement)>=0)C=n.activeElement;else{var T=o.tabbableGroups[0],R=T&&T.firstTabbableNode;C=R||u("fallbackFocus")}if(!C)throw new Error("Your focus-trap needs to have at least one focusable element");return C},d=function(){if(o.containerGroups=o.containers.map(function(C){var T=BT(C,i.tabbableOptions),R=VT(C,i.tabbableOptions),j=T.length>0?T[0]:void 0,H=T.length>0?T[T.length-1]:void 0,$=R.find(function(de){return ji(de)}),X=R.slice().reverse().find(function(de){return ji(de)}),ue=!!T.find(function(de){return ti(de)>0});return{container:C,tabbableNodes:T,focusableNodes:R,posTabIndexesFound:ue,firstTabbableNode:j,lastTabbableNode:H,firstDomTabbableNode:$,lastDomTabbableNode:X,nextTabbableNode:function(de){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,At=T.indexOf(de);return At<0?Pe?R.slice(R.indexOf(de)+1).find(function(Be){return ji(Be)}):R.slice(0,R.indexOf(de)).reverse().find(function(Be){return ji(Be)}):T[At+(Pe?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(C){return C.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(C){return C.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(C){var T=C.activeElement;if(T)return T.shadowRoot&&T.shadowRoot.activeElement!==null?h(T.shadowRoot):T},p=function(C){if(C!==!1&&C!==h(document)){if(!C||!C.focus){p(c());return}C.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=C,qT(C)&&C.select()}},f=function(C){var T=u("setReturnFocus",C);return T||(T===!1?!1:C)},m=function(C){var T=C.target,R=C.event,j=C.isBackward,H=j===void 0?!1:j;T=T||Ca(R),d();var $=null;if(o.tabbableGroups.length>0){var X=l(T,R),ue=X>=0?o.containerGroups[X]:void 0;if(X<0)H?$=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:$=o.tabbableGroups[0].firstTabbableNode;else if(H){var de=tm(o.tabbableGroups,function(ot){var Vt=ot.firstTabbableNode;return T===Vt});if(de<0&&(ue.container===T||Cc(T,i.tabbableOptions)&&!ji(T,i.tabbableOptions)&&!ue.nextTabbableNode(T,!1))&&(de=X),de>=0){var Pe=de===0?o.tabbableGroups.length-1:de-1,At=o.tabbableGroups[Pe];$=ti(T)>=0?At.lastTabbableNode:At.lastDomTabbableNode}else ts(R)||($=ue.nextTabbableNode(T,!1))}else{var Be=tm(o.tabbableGroups,function(ot){var Vt=ot.lastTabbableNode;return T===Vt});if(Be<0&&(ue.container===T||Cc(T,i.tabbableOptions)&&!ji(T,i.tabbableOptions)&&!ue.nextTabbableNode(T))&&(Be=X),Be>=0){var Pn=Be===o.tabbableGroups.length-1?0:Be+1,Mt=o.tabbableGroups[Pn];$=ti(T)>=0?Mt.firstTabbableNode:Mt.firstDomTabbableNode}else ts(R)||($=ue.nextTabbableNode(T))}}else $=u("fallbackFocus");return $},g=function(C){var T=Ca(C);if(!(l(T,C)>=0)){if($o(i.clickOutsideDeactivates,C)){s.deactivate({returnFocus:i.returnFocusOnDeactivate});return}$o(i.allowOutsideClick,C)||C.preventDefault()}},y=function(C){var T=Ca(C),R=l(T,C)>=0;if(R||T instanceof Document)R&&(o.mostRecentlyFocusedNode=T);else{C.stopImmediatePropagation();var j,H=!0;if(o.mostRecentlyFocusedNode)if(ti(o.mostRecentlyFocusedNode)>0){var $=l(o.mostRecentlyFocusedNode),X=o.containerGroups[$].tabbableNodes;if(X.length>0){var ue=X.findIndex(function(de){return de===o.mostRecentlyFocusedNode});ue>=0&&(i.isKeyForward(o.recentNavEvent)?ue+1<X.length&&(j=X[ue+1],H=!1):ue-1>=0&&(j=X[ue-1],H=!1))}}else o.containerGroups.some(function(de){return de.tabbableNodes.some(function(Pe){return ti(Pe)>0})})||(H=!1);else H=!1;H&&(j=m({target:o.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(o.recentNavEvent)})),p(j||o.mostRecentlyFocusedNode||c())}o.recentNavEvent=void 0},b=function(C){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=C;var R=m({event:C,isBackward:T});R&&(ts(C)&&C.preventDefault(),p(R))},k=function(C){(i.isKeyForward(C)||i.isKeyBackward(C))&&b(C,i.isKeyBackward(C))},v=function(C){WT(C)&&$o(i.escapeDeactivates,C)!==!1&&(C.preventDefault(),s.deactivate())},w=function(C){var T=Ca(C);l(T,C)>=0||$o(i.clickOutsideDeactivates,C)||$o(i.allowOutsideClick,C)||(C.preventDefault(),C.stopImmediatePropagation())},x=function(){if(o.active)return Qf.activateTrap(r,s),o.delayInitialFocusTimer=i.delayInitialFocus?em(function(){p(c())}):p(c()),n.addEventListener("focusin",y,!0),n.addEventListener("mousedown",g,{capture:!0,passive:!1}),n.addEventListener("touchstart",g,{capture:!0,passive:!1}),n.addEventListener("click",w,{capture:!0,passive:!1}),n.addEventListener("keydown",k,{capture:!0,passive:!1}),n.addEventListener("keydown",v),s},_=function(){if(o.active)return n.removeEventListener("focusin",y,!0),n.removeEventListener("mousedown",g,!0),n.removeEventListener("touchstart",g,!0),n.removeEventListener("click",w,!0),n.removeEventListener("keydown",k,!0),n.removeEventListener("keydown",v),s},A=function(C){var T=C.some(function(R){var j=Array.from(R.removedNodes);return j.some(function(H){return H===o.mostRecentlyFocusedNode})});T&&p(c())},S=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,O=function(){S&&(S.disconnect(),o.active&&!o.paused&&o.containers.map(function(C){S.observe(C,{subtree:!0,childList:!0})}))};return s={get active(){return o.active},get paused(){return o.paused},activate:function(C){if(o.active)return this;var T=a(C,"onActivate"),R=a(C,"onPostActivate"),j=a(C,"checkCanFocusTrap");j||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=n.activeElement,T?.();var H=function(){j&&d(),x(),O(),R?.()};return j?(j(o.containers.concat()).then(H,H),this):(H(),this)},deactivate:function(C){if(!o.active)return this;var T=Zf({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},C);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,_(),o.active=!1,o.paused=!1,O(),Qf.deactivateTrap(r,s);var R=a(T,"onDeactivate"),j=a(T,"onPostDeactivate"),H=a(T,"checkCanReturnFocus"),$=a(T,"returnFocus","returnFocusOnDeactivate");R?.();var X=function(){em(function(){$&&p(f(o.nodeFocusedBeforeActivation)),j?.()})};return $&&H?(H(f(o.nodeFocusedBeforeActivation)).then(X,X),this):(X(),this)},pause:function(C){if(o.paused||!o.active)return this;var T=a(C,"onPause"),R=a(C,"onPostPause");return o.paused=!0,T?.(),_(),O(),R?.(),this},unpause:function(C){if(!o.paused||!o.active)return this;var T=a(C,"onUnpause"),R=a(C,"onPostUnpause");return o.paused=!1,T?.(),d(),x(),O(),R?.(),this},updateContainerElements:function(C){var T=[].concat(C).filter(Boolean);return o.containers=T.map(function(R){return typeof R=="string"?n.querySelector(R):R}),o.active&&d(),O(),this}},s.updateContainerElements(t),s},YT=Tr("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Kr=YT.build(),ye=Ks({getPositionerId:t=>{var e;return((e=t.ids)==null?void 0:e.positioner)??`dialog:${t.id}:positioner`},getBackdropId:t=>{var e;return((e=t.ids)==null?void 0:e.backdrop)??`dialog:${t.id}:backdrop`},getContentId:t=>{var e;return((e=t.ids)==null?void 0:e.content)??`dialog:${t.id}:content`},getTriggerId:t=>{var e;return((e=t.ids)==null?void 0:e.trigger)??`dialog:${t.id}:trigger`},getTitleId:t=>{var e;return((e=t.ids)==null?void 0:e.title)??`dialog:${t.id}:title`},getDescriptionId:t=>{var e;return((e=t.ids)==null?void 0:e.description)??`dialog:${t.id}:description`},getCloseTriggerId:t=>{var e;return((e=t.ids)==null?void 0:e.closeTrigger)??`dialog:${t.id}:close`},getContentEl:t=>ye.getById(t,ye.getContentId(t)),getPositionerEl:t=>ye.getById(t,ye.getPositionerId(t)),getBackdropEl:t=>ye.getById(t,ye.getBackdropId(t)),getTriggerEl:t=>ye.getById(t,ye.getTriggerId(t)),getTitleEl:t=>ye.getById(t,ye.getTitleId(t)),getDescriptionEl:t=>ye.getById(t,ye.getDescriptionId(t)),getCloseTriggerEl:t=>ye.getById(t,ye.getCloseTriggerId(t))});function XT(t,e,n){const r=t.context["aria-label"],i=t.matches("open"),o=t.context.renderedElements;return{open:i,setOpen(s){s!==i&&e(s?"OPEN":"CLOSE")},getTriggerProps(){return n.button({...Kr.trigger.attrs,dir:t.context.dir,id:ye.getTriggerId(t.context),"aria-haspopup":"dialog",type:"button","aria-expanded":i,"data-state":i?"open":"closed","aria-controls":ye.getContentId(t.context),onClick(s){s.defaultPrevented||e("TOGGLE")}})},getBackdropProps(){return n.element({...Kr.backdrop.attrs,dir:t.context.dir,hidden:!i,id:ye.getBackdropId(t.context),"data-state":i?"open":"closed"})},getPositionerProps(){return n.element({...Kr.positioner.attrs,dir:t.context.dir,id:ye.getPositionerId(t.context),style:{pointerEvents:i?void 0:"none"}})},getContentProps(){return n.element({...Kr.content.attrs,dir:t.context.dir,role:t.context.role,hidden:!i,id:ye.getContentId(t.context),tabIndex:-1,"data-state":i?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!o.title?void 0:ye.getTitleId(t.context),"aria-describedby":o.description?ye.getDescriptionId(t.context):void 0})},getTitleProps(){return n.element({...Kr.title.attrs,dir:t.context.dir,id:ye.getTitleId(t.context)})},getDescriptionProps(){return n.element({...Kr.description.attrs,dir:t.context.dir,id:ye.getDescriptionId(t.context)})},getCloseTriggerProps(){return n.button({...Kr.closeTrigger.attrs,dir:t.context.dir,id:ye.getCloseTriggerId(t.context),type:"button",onClick(s){s.defaultPrevented||(s.stopPropagation(),e("CLOSE"))}})}}}function ZT(t){const e=er(t);return Gs({id:"dialog",initial:e.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...e},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:n=>!!n["open.controlled"]},activities:{trackDismissableElement(n,r,{send:i}){return kT(()=>ye.getContentEl(n),{defer:!0,pointerBlocking:n.modal,exclude:[ye.getTriggerEl(n)],onInteractOutside(o){var s;(s=n.onInteractOutside)==null||s.call(n,o),n.closeOnInteractOutside||o.preventDefault()},persistentElements:n.persistentElements,onFocusOutside:n.onFocusOutside,onPointerDownOutside:n.onPointerDownOutside,onEscapeKeyDown(o){var s;(s=n.onEscapeKeyDown)==null||s.call(n,o),n.closeOnEscape||o.preventDefault()},onDismiss(){i({type:"CLOSE",src:"interact-outside"})}})},preventScroll(n){if(n.preventScroll)return ET(ye.getDoc(n))},trapFocus(n){if(!n.trapFocus||!n.modal)return;let r;const i=zh(()=>{var o;const s=ye.getContentEl(n);if(s){r=JT(s,{document:ye.getDoc(n),escapeDeactivates:!1,preventScroll:!0,fallbackFocus:s,returnFocusOnDeactivate:n.restoreFocus,allowOutsideClick:!0,initialFocus:((o=n.initialFocusEl)==null?void 0:o.call(n))??void 0,setReturnFocus(a){var l;return((l=n.finalFocusEl)==null?void 0:l.call(n))??a}});try{r.activate()}catch{}}});return()=>{r?.deactivate(),i()}},hideContentBelow(n){return n.modal?uT(()=>[ye.getContentEl(n)],{defer:!0}):void 0}},actions:{setAlertDialogProps(n){n.role==="alertdialog"&&(n.initialFocusEl||(n.initialFocusEl=()=>ye.getCloseTriggerEl(n)),n.closeOnInteractOutside=!1)},checkRenderedElements(n){Fr(()=>{n.renderedElements.title=!!ye.getTitleEl(n),n.renderedElements.description=!!ye.getDescriptionEl(n)})},syncZIndex(n){Fr(()=>{const r=ye.getContentEl(n);if(!r)return;const i=ye.getWin(n).getComputedStyle(r);[ye.getPositionerEl(n),ye.getBackdropEl(n)].forEach(o=>{o?.style.setProperty("--z-index",i.zIndex)})})},invokeOnClose(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!1})},invokeOnOpen(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!0})},toggleVisibility(n,r,{send:i}){i({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}Mi()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const QT=["data-id"],eO=["data-id"],tO=["data-id"],nO=ie({__name:"Dialog",props:{title:{},subtitle:{},closeOnOutsideClick:{type:Boolean,default:!0},role:{default:"dialog"},alignment:{default:"top"},triggerLabel:{},showCloseTrigger:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},dialogId:{},teleport:{type:Boolean,default:!0},disabled:{type:Boolean},variant:{},thumbnail:{},thumbnailOptions:{}},emits:["open","close","clickoutside"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=Zh(),[s,a]=Ii(ZT({id:Sn({prefix:"dialog"}),closeOnEscape:r.closeOnEsc,modal:!0,role:r.role,closeOnInteractOutside:r.closeOnOutsideClick,onOpenChange(){if(!l.value.open)return i("open");i("close")},onPointerDownOutside(){i("clickoutside")},getRootNode:()=>{var c;return r.teleport?document:(c=o.value)==null?void 0:c.getRootNode()}}),{context:P(()=>{const{subtitle:c,...d}=r;return{description:c,...d}})}),l=P(()=>XT(s.value,a,_i)),u=c=>r.dialogId?`${r.dialogId}-${c}`:"";return e({open:()=>{l.value.setOpen(!0)},close:()=>{l.value.setOpen(!1)}}),(c,d)=>(E(),I("div",{class:"k-dialog","data-id":c.dialogId},[B(c.$slots,"trigger",{triggerProps:l.value.getTriggerProps()},()=>[c.triggerLabel?(E(),U(yt,se({key:0,class:"k-dialog__trigger",variant:"secondary"},l.value.getTriggerProps(),{disabled:c.disabled}),{default:te(()=>[ct(ce(c.triggerLabel),1)]),_:1},16,["disabled"])):F("",!0)]),(E(),U(xv,{to:"body",disabled:!c.teleport},[l.value.open?(E(),I(Le,{key:0},[W("div",se({class:"k-dialog__backdrop"},l.value.getBackdropProps(),{"data-id":u("backdrop")}),null,16,eO),W("div",se({class:`k-dialog__container k-dialog--align-${c.alignment}`},l.value.getPositionerProps(),{"data-id":u("container")}),[ke(wC,se({class:"k-dialog__card",variant:c.variant,appearance:"shadow"},l.value.getContentProps(),{"data-id":u("dialog"),thumbnail:c.thumbnail,thumbnailOptions:c.thumbnailOptions}),Us({_:2},[c.$slots.header||c.$slots.title||c.$slots.subtitle||c.title||c.subtitle||c.showCloseTrigger?{name:"header",fn:te(()=>[B(c.$slots,"header",{titleProps:l.value.getTitleProps(),descriptionProps:l.value.getDescriptionProps(),closeTriggerProps:l.value.getCloseTriggerProps()},()=>[B(c.$slots,"title",{titleProps:l.value.getTitleProps()},()=>[c.title?(E(),I("div",se({key:0,class:"k-dialog__title k-card__title"},l.value.getTitleProps()),ce(c.title),17)):F("",!0)]),B(c.$slots,"subtitle",{descriptionProps:l.value.getDescriptionProps()},()=>[c.subtitle?(E(),I("div",se({key:0,class:"k-dialog__subtitle k-card__subtitle"},l.value.getDescriptionProps()),ce(c.subtitle),17)):F("",!0)]),c.showCloseTrigger?(E(),U(yt,se({key:0,class:"k-dialog__close-trigger",variant:"tertiary",icon:"fa-pro-light:times",size:"small"},l.value.getCloseTriggerProps()),null,16)):F("",!0)])]),key:"0"}:void 0,c.$slots.default?{name:"default",fn:te(()=>[B(c.$slots,"default",{descriptionProps:l.value.getDescriptionProps()})]),key:"1"}:void 0,c.$slots.actions?{name:"actions",fn:te(()=>[B(c.$slots,"actions",{close:()=>l.value.setOpen(!1)})]),key:"2"}:void 0]),1040,["variant","data-id","thumbnail","thumbnailOptions"])],16,tO)],64)):F("",!0)],8,["disabled"]))],8,QT))}});function zu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Hu(){this._types=Object.create(null),this._extensions=Object.create(null);for(let t=0;t<arguments.length;t++)this.define(arguments[t]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}Hu.prototype.define=function(t,e){for(let n in t){let r=t[n].map(function(i){return i.toLowerCase()});n=n.toLowerCase();for(let i=0;i<r.length;i++){const o=r[i];if(o[0]!=="*"){if(!e&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+n+'".');this._types[o]=n}}if(e||!this._extensions[n]){const i=r[0];this._extensions[n]=i[0]!=="*"?i:i.substr(1)}}};Hu.prototype.getType=function(t){t=String(t);let e=t.replace(/^.*[/\\]/,"").toLowerCase(),n=e.replace(/^.*\./,"").toLowerCase(),r=e.length<t.length;return(n.length<e.length-1||!r)&&this._types[n]||null};Hu.prototype.getExtension=function(t){return t=/^\s*([^;\s]*)/.test(t)&&RegExp.$1,t&&this._extensions[t.toLowerCase()]||null};var rO=Hu,iO={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let oO=rO;var sO=new oO(iO);const sp=zu(sO);function ap(t){let e=["Bytes","KB","MB","GB","TB"];if(t==0)return"0 Byte";let n=Math.floor(Math.log(t)/Math.log(1024));return n>e.length&&(n=e.length),Math.round(t/Math.pow(1024,n))+" "+e[n]}function nm(t){return JSON.parse(JSON.stringify(t))}function lp(t,e,n={fromDirectory:!1}){const{fromDirectory:r}=n;return e==="directory"&&(r||!t.type)?!0:!t.type&&!e?!1:e?(Array.isArray(e)?e:e.split(",")).map(i=>i.trim()).some(i=>i.startsWith(".")?sp.getType(i.substring(1))===t.type:i.includes("*")?t.type.startsWith(i.replace("*","")):t.type===i):!0}const rm={counter:0,total:0,progress:0,bytes:0,result:[]};class Gy{constructor(e){sn(this,"queue"),sn(this,"upload"),sn(this,"uploadOptions"),sn(this,"accept"),this.queue=Av(nm(rm)),this.upload=e.upload,this.uploadOptions=e.uploadOptions,this.accept=e.accept,this.reset=this.reset.bind(this),this.run=this.run.bind(this)}reset(){this.queue=Object.assign(this.queue,nm(rm))}async run(e){e=Array.from(e).filter(o=>lp(o,this.accept,this.uploadOptions)),this.queue.total=e.length,this.queue.counter=0,this.queue.bytes=e.reduce((o,s)=>o+=s?.size||0,0);let n=e.map(()=>0);const r=await Promise.all(e.map((o,s)=>this.upload(o,a=>{n[s]=a,this.queue.progress=n.reduce((l,u)=>l+=u,0)/n.length},this.uploadOptions).then(a=>(this.queue.counter++,a))));if(!r||!r.length)return;let i=r.flat();return this.reset(),i}}const im={"image/*":["jpeg","png","gif"]};function aO(t){return t?(Array.isArray(t)?t:t.split(",")).map(e=>e.trim()).map(e=>e.startsWith(".")?e.substring(1):e in im?im[e]:sp.getExtension(e)).flat():[]}function Ld(t){let e=(n,r)=>{const i=document.createElement("a");i.href=n,i.setAttribute("style","display: none"),r&&(i.target=r),t.name&&(i.download=t.name.includes(".")?t.name:[t.name,sp.getExtension(t.type)].join(".")),document.body.appendChild(i),i.click(),document.body.removeChild(i)};return fetch(t.url,{headers:{"Cache-Control":"no-cache"}}).then(n=>n.blob()).then(n=>{const r=URL.createObjectURL(n);return e(r)}).catch(n=>e(t.url,"_blank"))}const lO={class:"k-media-thumbnail-actions"},Jy=ie({__name:"ThumbnailActions",props:{value:{},disabled:{type:Boolean}},emits:["delete"],setup(t,{emit:e}){const n=t,r=P(()=>n.value.type.startsWith("image/")?{component:"div",props:{},listeners:{click:()=>{Ld(n.value)}}}:{component:"a",props:{href:n.value.url,download:n.value.name,target:"_blank"},listeners:{}});return(i,o)=>(E(),I("div",lO,[i.disabled?F("",!0):(E(),I("div",{key:0,class:"k-media-thumbnail-actions__delete",onClick:o[0]||(o[0]=ws(s=>i.$emit("delete"),["stop"]))},[ke(z(We),{icon:"fa-pro-solid:trash"})])),(E(),U(Ye(r.value.component),se({class:"k-media-thumbnail-actions__download"},r.value.props,Fh(r.value.listeners)),{default:te(()=>[ke(z(We),{icon:"fa-pro-solid:arrow-alt-circle-down"})]),_:1},16))]))}}),uO=ie({__name:"Thumbnail",props:{value:{},size:{default:"4rem"},disabled:{type:Boolean}},setup(t){const e=t,n=Sv(),r=P(()=>n["data-draggable"]),i=P(()=>{let s={};for(const a in n){if(a==="data-draggable")return;s[a]=n[a]}return s}),o=P(()=>({width:e.size,height:e.size}));return(s,a)=>(E(),I("div",se({class:"k-media-thumbnail"},r.value),[(E(),U(Ye(s.value.typeConfig.components.Thumbnail),se({class:[{"k-media-thumbnail__item--selected":s.value.selected},"k-media-thumbnail__item"],value:s.value},i.value,{style:o.value}),null,16,["class","value","style"])),ke(Jy,{value:s.value,disabled:s.disabled,onDelete:a[0]||(a[0]=l=>s.$emit("delete",s.value))},null,8,["value","disabled"])],16))}}),cO={key:0,class:"k-media-type-selector"},dO={class:"k-media-type-selector__info"},hO=ie({__name:"TypeSelector",props:{value:{},upload:{type:Function},labels:{}},emits:["add","cancel","success","openFileWindow"],setup(t,{emit:e}){const n=t,r=e,i=Q(null),o=Q(),s=Q(!0),a=Q(!1),l=Q(),u=Q();Fe(a,g=>{var y,b;return g?(y=l.value)==null?void 0:y.open():(b=l.value)==null?void 0:b.close()},{immediate:!0});const c=P(()=>n.value.length===1&&n.value[0].name==="Image");function d(){s.value&&(o.value=u.value.prepareData().then(g=>{r("add",g)}))}function h(g){if(g.name==="Image")return r("openFileWindow");a.value=!0,i.value=g}function p(){a.value=!1,r("cancel")}function f(){a.value=!1,r("success")}function m(g){const y=n.labels[g];return!y||typeof y=="string"?g:y.createLabel||g}return(g,y)=>c.value?F("",!0):(E(),I("div",cO,[W("span",dO,ce(g.labels.selectMessage),1),ke(ju,{teleport:!0,label:g.labels.select,iconRight:"fa6-solid:plus",theme:"shadow",placement:"bottom-end"},{default:te(()=>[(E(!0),I(Le,null,Ft(g.value,b=>(E(),U(Ye(b.components.CreateTrigger),{key:b.name,label:m(b.name.toLowerCase()),onClick:k=>h(b)},null,8,["label","onClick"]))),128))]),_:1},8,["label"]),ke(nO,{dialogId:"k-media-type-selector",ref_key:"dialog",ref:l,title:"",teleport:!0,"close-on-outside-click":!1,"show-close-trigger":!1,"close-on-esc":!0,onClose:p},{default:te(()=>[i.value?(E(),U(Ye(i.value.components.Create),se({key:0,isValid:s.value,"onUpdate:isValid":y[0]||(y[0]=b=>s.value=b),upload:g.upload,labels:g.labels,name:i.value.name,ref_key:"creator",ref:u},g.$attrs),null,16,["isValid","upload","labels","name"])):F("",!0)]),footer:te(()=>[ke(yt,{label:g.labels.cancel,type:"button",onClick:p},null,8,["label"]),ke(yt,{variant:"primary",disabled:!s.value,promise:o.value,label:g.labels.save,stateTimeout:1e3,onClick:d,onSuccess:f},null,8,["disabled","promise","label"])]),_:1},512)]))}}),pO=ie({__name:"Description",props:{modelValue:{},placeholder:{}},emits:["update:modelValue"],setup(t,{emit:e}){return(n,r)=>(E(),U(iC,{class:"k-media-description",type:"text",placeholder:n.placeholder,modelValue:n.modelValue||"","onUpdate:modelValue":r[0]||(r[0]=i=>n.$emit("update:modelValue",i))},null,8,["placeholder","modelValue"]))}}),fO={class:"k-media-uploader"},mO={class:"k-media-uploader__bar"},gO={class:"k-media-uploader__meta"},vO={key:0},yO={key:1},bO=ie({__name:"Uploader",props:{value:{},bytes:{},current:{default:1},total:{default:1}},setup(t){const e=t,n=P(()=>e.total>1),r=P(()=>ap(e.bytes)),i=P(()=>Math.floor(e.value));return(o,s)=>(E(),I("div",fO,[W("div",null,ce(i.value)+" %",1),W("div",mO,[W("div",{class:"k-media-uploader__bar-value",style:In({width:o.value+"%"})},null,4)]),W("div",gO,[n.value?(E(),I("div",vO,ce(o.current)+" / "+ce(o.total),1)):F("",!0),o.bytes?(E(),I("div",yO,"("+ce(r.value)+")",1)):F("",!0)])]))}}),kO=["innerHTML"],xO=ie({__name:"SlotHandler",props:{value:{}},setup(t){const e=t,n=P(()=>typeof e.value=="string"?e.value:void 0),r=P(()=>typeof e.value=="string"?"div":e.value);return(i,o)=>(E(),U(Ye(r.value),Se(_e(i.$attrs)),{default:te(()=>[n.value?(E(),I("span",{key:0,innerHTML:n.value},null,8,kO)):F("",!0)]),_:1},16))}}),wO={class:"k-media-droparea__instruction"},EO=["type","accept","required","disabled","multiple"],CO=ie({__name:"DropArea",props:{value:{},multiple:{type:Boolean},upload:{},uploadOptions:{},type:{},accept:{},selected:{default:null},dropMessage:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["input","select","remove"],setup(t,{emit:e}){const n=t,r=e,i=Q(!1),o=Q(!0),s=Q(),a=P(()=>!!(!n.required||n.value)),l=P(()=>n.disabled),u=P(()=>!l.value&&!d.total),{run:c,queue:d}=new Gy(n);function h(k){return c(k).then(v=>{!v||!v.length||(r("input",n.multiple?[...n.value||[],...v]:v[0]),(!n.selected||!n.multiple)&&vi(()=>r("select")))})}function p(k){l.value||(h(k.target.files||[]),s.value&&(s.value.value=""))}function f(k){var v;if(l.value||!s.value)return;if(k.preventDefault(),!o.value)return g();g();const w=(v=k.dataTransfer)==null?void 0:v.files;w!=null&&w.length&&(s.value.files=w,s.value.dispatchEvent(new InputEvent("input")),h(w))}function m(k){l.value||k.dataTransfer&&(o.value=Array.from(k.dataTransfer.items).every(v=>lp(v,n.accept))&&n.multiple?!0:k.dataTransfer.items.length===1,i.value=!0,k.preventDefault())}function g(){o.value=!0,i.value=!1}const y=Dn("k-media-droparea",{variants:{active:{true:"k-media-droparea--active"},invalid:{true:"k-media-droparea--invalid"},selected:{true:"k-media-droparea--selected"},disabled:{true:"k-media-droparea--disabled"}}}),b=()=>{var k;return(k=s.value)==null?void 0:k.click()};return(k,v)=>(E(),I(Le,null,[W("div",{class:Me(z(y)({active:i.value,invalid:!o.value,selected:!!k.selected,disabled:l.value})),onDrop:f,onDragover:m,onDragleave:g},[B(k.$slots,"preview"),W("div",wO,[u.value?(E(),I("input",{key:0,type:k.type,accept:Array.isArray(k.accept)?k.accept.join(","):k.accept,required:a.value,ref_key:"input",ref:s,onChange:p,disabled:!u.value,multiple:k.multiple,class:"k-media-droparea__input"},null,40,EO)):F("",!0),o.value?(E(),I(Le,{key:1},[B(k.$slots,"drop-message",{},()=>[ke(xO,{value:k.dropMessage},null,8,["value"])]),B(k.$slots,"default",{openFileWindow:b})],64)):(E(),U(z(We),{key:2,icon:"fa-pro-light:ban",style:{"font-size":"2rem"}})),B(k.$slots,"custom-message")]),!k.multiple&&k.selected?(E(),U(Jy,{key:0,value:k.selected,disabled:l.value,onDelete:v[0]||(v[0]=w=>k.$emit("remove",k.selected))},null,8,["value","disabled"])):F("",!0)],34),z(d).total?(E(),U(bO,{key:0,value:z(d).progress,bytes:z(d).bytes,current:z(d).counter,total:z(d).total},null,8,["value","bytes","current","total"])):F("",!0)],64))}}),SO=ie({__name:"CreateTrigger",props:{label:{}},setup(t){return(e,n)=>(E(),U(yt,{type:"button",label:e.label,iconRight:"fa6-solid:image",size:"small",variant:"tertiary"},null,8,["label"]))}}),TO=ie({__name:"Thumbnail",props:{value:{}},setup(t){const e=t,n=P(()=>({backgroundImage:`url(${e.value.url})`}));return(r,i)=>(E(),I("div",{class:"k-media-image__thumbnail",style:In(n.value),onClick:i[0]||(i[0]=o=>r.$emit("click"))},null,4))}}),OO=ie({__name:"Preview",props:{value:{},size:{}},setup(t){const e=t,n=P(()=>({padding:e.size==="cover"?"0":"1rem",backgroundSize:e.size,backgroundImage:`url(${e.value.url})`}));return(r,i)=>(E(),I("div",{class:"k-media-image-preview",style:In(n.value)},null,4))}}),AO={name:"Image",condition:t=>/^image\/.+/i.test(t.type),components:{CreateTrigger:Wa(SO),Thumbnail:Wa(TO),Preview:Wa(OO)}},MO={Image:AO};/**!
|
|
10
10
|
* Sortable 1.14.0
|
|
11
11
|
* @author RubaXa <trash@rubaxa.org>
|
|
12
12
|
* @author owenm <owen23355@gmail.com>
|
|
13
13
|
* @license MIT
|
|
14
|
-
*/function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Io(Object(n),!0).forEach(function(i){Eg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function ci(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ci=function(t){return typeof t}:ci=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(e)}function Eg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(){return ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ct.apply(this,arguments)}function _g(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,a;for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function wg(e,t){if(e==null)return{};var n=_g(e,t),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)i=a[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Cg="1.14.0";function at(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var dt=at(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Nn=at(/Edge/i),Fo=at(/firefox/i),kn=at(/safari/i)&&!at(/chrome/i)&&!at(/android/i),vl=at(/iP(ad|od|hone)/i),Ag=at(/chrome/i)&&at(/android/i),bl={capture:!1,passive:!1};function J(e,t,n){e.addEventListener(t,n,!dt&&bl)}function K(e,t,n){e.removeEventListener(t,n,!dt&&bl)}function Ti(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Sg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ue(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ti(e,t):Ti(e,t))||i&&e===n)return e;if(e===n)break}while(e=Sg(e))}return null}var Do=/\s+/g;function Ae(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(Do," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(Do," ")}}function M(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function on(e,t){var n="";if(typeof e=="string")n=e;else do{var i=M(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function yl(e,t,n){if(e){var i=e.getElementsByTagName(t),r=0,a=i.length;if(n)for(;r<a;r++)n(i[r],r);return i}return[]}function Ge(){var e=document.scrollingElement;return e||document.documentElement}function pe(e,t,n,i,r){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,l,u,c,d;if(e!==window&&e.parentNode&&e!==Ge()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,l=a.bottom,u=a.right,c=a.height,d=a.width):(o=0,s=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(r=r||e.parentNode,!dt))do if(r&&r.getBoundingClientRect&&(M(r,"transform")!=="none"||n&&M(r,"position")!=="static")){var h=r.getBoundingClientRect();o-=h.top+parseInt(M(r,"border-top-width")),s-=h.left+parseInt(M(r,"border-left-width")),l=o+a.height,u=s+a.width;break}while(r=r.parentNode);if(i&&e!==window){var p=on(r||e),f=p&&p.a,g=p&&p.d;p&&(o/=g,s/=f,d/=f,c/=g,l=o+c,u=s+d)}return{top:o,left:s,bottom:l,right:u,width:d,height:c}}}function Oo(e,t,n){for(var i=gt(e,!0),r=pe(e)[t];i;){var a=pe(i)[n],o=void 0;if(o=r>=a,!o)return i;if(i===Ge())break;i=gt(i,!1)}return!1}function un(e,t,n,i){for(var r=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!=="none"&&o[a]!==V.ghost&&(i||o[a]!==V.dragged)&&Ue(o[a],n.draggable,e,!1)){if(r===t)return o[a];r++}a++}return null}function Ca(e,t){for(var n=e.lastElementChild;n&&(n===V.ghost||M(n,"display")==="none"||t&&!Ti(n,t));)n=n.previousElementSibling;return n||null}function Re(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==V.clone&&(!t||Ti(e,t))&&n++;return n}function Po(e){var t=0,n=0,i=Ge();if(e)do{var r=on(e),a=r.a,o=r.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==i&&(e=e.parentNode));return[t,n]}function Tg(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n)}return-1}function gt(e,t){if(!e||!e.getBoundingClientRect)return Ge();var n=e,i=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=M(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Ge();if(i||t)return n;i=!0}}while(n=n.parentNode);return Ge()}function Ig(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hr(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var En;function xl(e,t){return function(){if(!En){var n=arguments,i=this;n.length===1?e.call(i,n[0]):e.apply(i,n),En=setTimeout(function(){En=void 0},t)}}}function Fg(){clearTimeout(En),En=void 0}function kl(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function El(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Fe="Sortable"+new Date().getTime();function Dg(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(M(i,"display")==="none"||i===V.ghost)){e.push({target:i,rect:pe(i)});var r=Ke({},e[e.length-1].rect);if(i.thisAnimationDuration){var a=on(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(n){e.push(n)},removeAnimationState:function(n){e.splice(Tg(e,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var r=!1,a=0;e.forEach(function(o){var s=0,l=o.target,u=l.fromRect,c=pe(l),d=l.prevFromRect,h=l.prevToRect,p=o.rect,f=on(l,!0);f&&(c.top-=f.f,c.left-=f.e),l.toRect=c,l.thisAnimationDuration&&hr(d,c)&&!hr(u,c)&&(p.top-c.top)/(p.left-c.left)===(u.top-c.top)/(u.left-c.left)&&(s=Pg(p,d,h,i.options)),hr(c,u)||(l.prevFromRect=u,l.prevToRect=c,s||(s=i.options.animation),i.animate(l,p,c,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},s),l.thisAnimationDuration=s)}),clearTimeout(t),r?t=setTimeout(function(){typeof n=="function"&&n()},a):typeof n=="function"&&n(),e=[]},animate:function(n,i,r,a){if(a){M(n,"transition",""),M(n,"transform","");var o=on(this.el),s=o&&o.a,l=o&&o.d,u=(i.left-r.left)/(s||1),c=(i.top-r.top)/(l||1);n.animatingX=!!u,n.animatingY=!!c,M(n,"transform","translate3d("+u+"px,"+c+"px,0)"),this.forRepaintDummy=Og(n),M(n,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),M(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){M(n,"transition",""),M(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},a)}}}}function Og(e){return e.offsetWidth}function Pg(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}var Kt=[],pr={initializeByDefault:!0},jn={mount:function(e){for(var t in pr)pr.hasOwnProperty(t)&&!(t in e)&&(e[t]=pr[t]);Kt.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Kt.push(e)},pluginEvent:function(e,t,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var r=e+"Global";Kt.forEach(function(a){t[a.pluginName]&&(t[a.pluginName][r]&&t[a.pluginName][r](Ke({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](Ke({sortable:t},n)))})},initializePlugins:function(e,t,n,i){Kt.forEach(function(o){var s=o.pluginName;if(!(!e.options[s]&&!o.initializeByDefault)){var l=new o(e,t,e.options);l.sortable=e,l.options=e.options,e[s]=l,ct(n,l.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,t){var n={};return Kt.forEach(function(i){typeof i.eventProperties=="function"&&ct(n,i.eventProperties.call(t[i.pluginName],e))}),n},modifyOption:function(e,t,n){var i;return Kt.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[t]=="function"&&(i=r.optionListeners[t].call(e[r.pluginName],n))}),i}};function Rg(e){var t=e.sortable,n=e.rootEl,i=e.name,r=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[Fe],!!t){var g,m=t.options,b="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!dt&&!Nn?g=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(i,!0,!0)),g.to=o||n,g.from=s||n,g.item=r||n,g.clone=a,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var v=Ke(Ke({},f),jn.getEventProperties(i,t));for(var E in v)g[E]=v[E];n&&n.dispatchEvent(g),m[b]&&m[b].call(t,g)}}var Mg=["evt"],we=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,r=wg(n,Mg);jn.pluginEvent.bind(V)(e,t,Ke({dragEl:w,parentEl:se,ghostEl:$,rootEl:ae,nextEl:Ot,lastDownEl:di,cloneEl:le,cloneHidden:ft,dragStarted:gn,putSortable:ge,activeSortable:V.active,originalEvent:i,oldIndex:tn,oldDraggableIndex:_n,newIndex:Se,newDraggableIndex:pt,hideGhostForTarget:Al,unhideGhostForTarget:Sl,cloneNowHidden:function(){ft=!0},cloneNowShown:function(){ft=!1},dispatchSortableEvent:function(a){Ee({sortable:t,name:a,originalEvent:i})}},r))};function Ee(e){Rg(Ke({putSortable:ge,cloneEl:le,targetEl:w,rootEl:ae,oldIndex:tn,oldDraggableIndex:_n,newIndex:Se,newDraggableIndex:pt},e))}var w,se,$,ae,Ot,di,le,ft,tn,Se,_n,pt,Zn,ge,Qt=!1,Ii=!1,Fi=[],It,Be,fr,gr,Ro,Mo,gn,Zt,wn,Cn=!1,Qn=!1,hi,be,mr=[],Wr=!1,Di=[],Ki=typeof document<"u",Jn=vl,Vo=Nn||dt?"cssFloat":"float",Vg=Ki&&!Ag&&!vl&&"draggable"in document.createElement("div"),_l=function(){if(Ki){if(dt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),wl=function(e,t){var n=M(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=un(e,0,t),a=un(e,1,t),o=r&&M(r),s=a&&M(a),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+pe(r).width,u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+pe(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&o.float!=="none"){var c=o.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===c)?"vertical":"horizontal"}return r&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||l>=i&&n[Vo]==="none"||a&&n[Vo]==="none"&&l+u>i)?"vertical":"horizontal"},Bg=function(e,t,n){var i=n?e.left:e.top,r=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===o||r===s||i+a/2===o+l/2},Lg=function(e,t){var n;return Fi.some(function(i){var r=i[Fe].options.emptyInsertThreshold;if(!(!r||Ca(i))){var a=pe(i),o=e>=a.left-r&&e<=a.right+r,s=t>=a.top-r&&t<=a.bottom+r;if(o&&s)return n=i}}),n},Cl=function(e){function t(r,a){return function(o,s,l,u){var c=o.options.group.name&&s.options.group.name&&o.options.group.name===s.options.group.name;if(r==null&&(a||c))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return t(r(o,s,l,u),a)(o,s,l,u);var d=(a?o:s).options.group.name;return r===!0||typeof r=="string"&&r===d||r.join&&r.indexOf(d)>-1}}var n={},i=e.group;(!i||ci(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},Al=function(){!_l&&$&&M($,"display","none")},Sl=function(){!_l&&$&&M($,"display","")};Ki&&document.addEventListener("click",function(e){if(Ii)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ii=!1,!1},!0);var Ft=function(e){if(w){e=e.touches?e.touches[0]:e;var t=Lg(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Fe]._onDragOver(n)}}},Ng=function(e){w&&w.parentNode[Fe]._isOutsideThisEl(e.target)};function V(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=ct({},t),e[Fe]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return wl(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:V.supportPointer!==!1&&"PointerEvent"in window&&!kn,emptyInsertThreshold:5};jn.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);Cl(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:Vg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?J(e,"pointerdown",this._onTapStart):(J(e,"mousedown",this._onTapStart),J(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(J(e,"dragover",this),J(e,"dragenter",this)),Fi.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),ct(this,Dg())}V.prototype={constructor:V,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Zt=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,w):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,r=i.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,u=i.filter;if(Gg(n),!w&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&kn&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Ue(s,i.draggable,n,!1),!(s&&s.animated)&&di!==s)){if(tn=Re(s),_n=Re(s,i.draggable),typeof u=="function"){if(u.call(this,e,s,this)){Ee({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),we("filter",t,{evt:e}),r&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=Ue(l,c.trim(),n,!1),c)return Ee({sortable:t,rootEl:c,name:"filter",targetEl:s,fromEl:n,toEl:n}),we("filter",t,{evt:e}),!0}),u)){r&&e.cancelable&&e.preventDefault();return}i.handle&&!Ue(l,i.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var i=this,r=i.el,a=i.options,o=r.ownerDocument,s;if(n&&!w&&n.parentNode===r){var l=pe(n);if(ae=r,w=n,se=w.parentNode,Ot=w.nextSibling,di=n,Zn=a.group,V.dragged=w,It={target:w,clientX:(t||e).clientX,clientY:(t||e).clientY},Ro=It.clientX-l.left,Mo=It.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,w.style["will-change"]="all",s=function(){if(we("delayEnded",i,{evt:e}),V.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Fo&&i.nativeDraggable&&(w.draggable=!0),i._triggerDragStart(e,t),Ee({sortable:i,name:"choose",originalEvent:e}),Ae(w,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){yl(w,u.trim(),vr)}),J(o,"dragover",Ft),J(o,"mousemove",Ft),J(o,"touchmove",Ft),J(o,"mouseup",i._onDrop),J(o,"touchend",i._onDrop),J(o,"touchcancel",i._onDrop),Fo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,w.draggable=!0),we("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Nn||dt))){if(V.eventCanceled){this._onDrop();return}J(o,"mouseup",i._disableDelayedDrag),J(o,"touchend",i._disableDelayedDrag),J(o,"touchcancel",i._disableDelayedDrag),J(o,"mousemove",i._delayedDragTouchMoveHandler),J(o,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&J(o,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){w&&vr(w),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;K(e,"mouseup",this._disableDelayedDrag),K(e,"touchend",this._disableDelayedDrag),K(e,"touchcancel",this._disableDelayedDrag),K(e,"mousemove",this._delayedDragTouchMoveHandler),K(e,"touchmove",this._delayedDragTouchMoveHandler),K(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?J(document,"pointermove",this._onTouchMove):t?J(document,"touchmove",this._onTouchMove):J(document,"mousemove",this._onTouchMove):(J(w,"dragend",this),J(ae,"dragstart",this._onDragStart));try{document.selection?pi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Qt=!1,ae&&w){we("dragStarted",this,{evt:t}),this.nativeDraggable&&J(document,"dragover",Ng);var n=this.options;!e&&Ae(w,n.dragClass,!1),Ae(w,n.ghostClass,!0),V.active=this,e&&this._appendGhost(),Ee({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,Al();for(var e=document.elementFromPoint(Be.clientX,Be.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),e!==t);)t=e;if(w.parentNode[Fe]._isOutsideThisEl(e),t)do{if(t[Fe]){var n=void 0;if(n=t[Fe]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Sl()}},_onTouchMove:function(e){if(It){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,r=e.touches?e.touches[0]:e,a=$&&on($,!0),o=$&&a&&a.a,s=$&&a&&a.d,l=Jn&&be&&Po(be),u=(r.clientX-It.clientX+i.x)/(o||1)+(l?l[0]-mr[0]:0)/(o||1),c=(r.clientY-It.clientY+i.y)/(s||1)+(l?l[1]-mr[1]:0)/(s||1);if(!V.active&&!Qt){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if($){a?(a.e+=u-(fr||0),a.f+=c-(gr||0)):a={a:1,b:0,c:0,d:1,e:u,f:c};var d="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");M($,"webkitTransform",d),M($,"mozTransform",d),M($,"msTransform",d),M($,"transform",d),fr=u,gr=c,Be=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!$){var e=this.options.fallbackOnBody?document.body:ae,t=pe(w,!0,Jn,!0,e),n=this.options;if(Jn){for(be=e;M(be,"position")==="static"&&M(be,"transform")==="none"&&be!==document;)be=be.parentNode;be!==document.body&&be!==document.documentElement?(be===document&&(be=Ge()),t.top+=be.scrollTop,t.left+=be.scrollLeft):be=Ge(),mr=Po(be)}$=w.cloneNode(!0),Ae($,n.ghostClass,!1),Ae($,n.fallbackClass,!0),Ae($,n.dragClass,!0),M($,"transition",""),M($,"transform",""),M($,"box-sizing","border-box"),M($,"margin",0),M($,"top",t.top),M($,"left",t.left),M($,"width",t.width),M($,"height",t.height),M($,"opacity","0.8"),M($,"position",Jn?"absolute":"fixed"),M($,"zIndex","100000"),M($,"pointerEvents","none"),V.ghost=$,e.appendChild($),M($,"transform-origin",Ro/parseInt($.style.width)*100+"% "+Mo/parseInt($.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,i=e.dataTransfer,r=n.options;if(we("dragStart",this,{evt:e}),V.eventCanceled){this._onDrop();return}we("setupClone",this),V.eventCanceled||(le=El(w),le.draggable=!1,le.style["will-change"]="",this._hideClone(),Ae(le,this.options.chosenClass,!1),V.clone=le),n.cloneId=pi(function(){we("clone",n),!V.eventCanceled&&(n.options.removeCloneOnHide||ae.insertBefore(le,w),n._hideClone(),Ee({sortable:n,name:"clone"}))}),!t&&Ae(w,r.dragClass,!0),t?(Ii=!0,n._loopId=setInterval(n._emulateDragOver,50)):(K(document,"mouseup",n._onDrop),K(document,"touchend",n._onDrop),K(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(n,i,w)),J(document,"drop",n),M(w,"transform","translateZ(0)")),Qt=!0,n._dragStartId=pi(n._dragStarted.bind(n,t,e)),J(document,"selectstart",n),gn=!0,kn&&M(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,i,r,a,o=this.options,s=o.group,l=V.active,u=Zn===s,c=o.sort,d=ge||l,h,p=this,f=!1;if(Wr)return;function g(Z,ie){we(Z,p,Ke({evt:e,isOwner:u,axis:h?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:c,fromSortable:d,target:n,completed:b,onMove:function(Q,qe){return ei(ae,t,w,i,Q,pe(Q),e,qe)},changed:v},ie))}function m(){g("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function b(Z){return g("dragOverCompleted",{insertion:Z}),Z&&(u?l._hideClone():l._showClone(p),p!==d&&(Ae(w,ge?ge.options.ghostClass:l.options.ghostClass,!1),Ae(w,o.ghostClass,!0)),ge!==p&&p!==V.active?ge=p:p===V.active&&ge&&(ge=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){g("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===w&&!w.animated||n===t&&!n.animated)&&(Zt=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(w.parentNode[Fe]._isOutsideThisEl(e.target),!Z&&Ft(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function v(){Se=Re(w),pt=Re(w,o.draggable),Ee({sortable:p,name:"change",toEl:t,newIndex:Se,newDraggableIndex:pt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Ue(n,o.draggable,t,!0),g("dragOver"),V.eventCanceled)return f;if(w.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return b(!1);if(Ii=!1,l&&!o.disabled&&(u?c||(a=se!==ae):ge===this||(this.lastPutMode=Zn.checkPull(this,l,w,e))&&s.checkPut(this,l,w,e))){if(h=this._getDirection(e,n)==="vertical",i=pe(w),g("dragOverValid"),V.eventCanceled)return f;if(a)return se=ae,m(),this._hideClone(),g("revert"),V.eventCanceled||(Ot?ae.insertBefore(w,Ot):ae.appendChild(w)),b(!0);var E=Ca(t,o.draggable);if(!E||Hg(e,h,this)&&!E.animated){if(E===w)return b(!1);if(E&&t===e.target&&(n=E),n&&(r=pe(n)),ei(ae,t,w,i,n,r,e,!!n)!==!1)return m(),t.appendChild(w),se=t,v(),b(!0)}else if(E&&zg(e,h,this)){var T=un(t,0,o,!0);if(T===w)return b(!1);if(n=T,r=pe(n),ei(ae,t,w,i,n,r,e,!1)!==!1)return m(),t.insertBefore(w,T),se=t,v(),b(!0)}else if(n.parentNode===t){r=pe(n);var _=0,S,X=w.parentNode!==t,D=!Bg(w.animated&&w.toRect||i,n.animated&&n.toRect||r,h),C=h?"top":"left",k=Oo(n,"top","top")||Oo(w,"top","top"),y=k?k.scrollTop:void 0;Zt!==n&&(S=r[C],Cn=!1,Qn=!D&&o.invertSwap||X),_=qg(e,n,r,h,D?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Qn,Zt===n);var x;if(_!==0){var I=Re(w);do I-=_,x=se.children[I];while(x&&(M(x,"display")==="none"||x===$))}if(_===0||x===n)return b(!1);Zt=n,wn=_;var B=n.nextElementSibling,L=!1;L=_===1;var N=ei(ae,t,w,i,n,r,e,L);if(N!==!1)return(N===1||N===-1)&&(L=N===1),Wr=!0,setTimeout($g,30),m(),L&&!B?t.appendChild(w):n.parentNode.insertBefore(w,L?B:n),k&&kl(k,0,y-k.scrollTop),se=w.parentNode,S!==void 0&&!Qn&&(hi=Math.abs(S-pe(n)[C])),v(),b(!0)}if(t.contains(w))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){K(document,"mousemove",this._onTouchMove),K(document,"touchmove",this._onTouchMove),K(document,"pointermove",this._onTouchMove),K(document,"dragover",Ft),K(document,"mousemove",Ft),K(document,"touchmove",Ft)},_offUpEvents:function(){var e=this.el.ownerDocument;K(e,"mouseup",this._onDrop),K(e,"touchend",this._onDrop),K(e,"pointerup",this._onDrop),K(e,"touchcancel",this._onDrop),K(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Se=Re(w),pt=Re(w,n.draggable),we("drop",this,{evt:e}),se=w&&w.parentNode,Se=Re(w),pt=Re(w,n.draggable),V.eventCanceled){this._nulling();return}Qt=!1,Qn=!1,Cn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Gr(this.cloneId),Gr(this._dragStartId),this.nativeDraggable&&(K(document,"drop",this),K(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),kn&&M(document.body,"user-select",""),M(w,"transform",""),e&&(gn&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),$&&$.parentNode&&$.parentNode.removeChild($),(ae===se||ge&&ge.lastPutMode!=="clone")&&le&&le.parentNode&&le.parentNode.removeChild(le),w&&(this.nativeDraggable&&K(w,"dragend",this),vr(w),w.style["will-change"]="",gn&&!Qt&&Ae(w,ge?ge.options.ghostClass:this.options.ghostClass,!1),Ae(w,this.options.chosenClass,!1),Ee({sortable:this,name:"unchoose",toEl:se,newIndex:null,newDraggableIndex:null,originalEvent:e}),ae!==se?(Se>=0&&(Ee({rootEl:se,name:"add",toEl:se,fromEl:ae,originalEvent:e}),Ee({sortable:this,name:"remove",toEl:se,originalEvent:e}),Ee({rootEl:se,name:"sort",toEl:se,fromEl:ae,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:se,originalEvent:e})),ge&&ge.save()):Se!==tn&&Se>=0&&(Ee({sortable:this,name:"update",toEl:se,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:se,originalEvent:e})),V.active&&((Se==null||Se===-1)&&(Se=tn,pt=_n),Ee({sortable:this,name:"end",toEl:se,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){we("nulling",this),ae=w=se=$=Ot=le=di=ft=It=Be=gn=Se=pt=tn=_n=Zt=wn=ge=Zn=V.dragged=V.ghost=V.clone=V.active=null,Di.forEach(function(e){e.checked=!0}),Di.length=fr=gr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":w&&(this._onDragOver(e),jg(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,r=n.length,a=this.options;i<r;i++)t=n[i],Ue(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||Wg(t));return e},sort:function(e,t){var n={},i=this.el;this.toArray().forEach(function(r,a){var o=i.children[a];Ue(o,this.options.draggable,i,!1)&&(n[r]=o)},this),t&&this.captureAnimationState(),e.forEach(function(r){n[r]&&(i.removeChild(n[r]),i.appendChild(n[r]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ue(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var i=jn.modifyOption(this,e,t);typeof i<"u"?n[e]=i:n[e]=t,e==="group"&&Cl(n)},destroy:function(){we("destroy",this);var e=this.el;e[Fe]=null,K(e,"mousedown",this._onTapStart),K(e,"touchstart",this._onTapStart),K(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(K(e,"dragover",this),K(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fi.splice(Fi.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ft){if(we("hideClone",this),V.eventCanceled)return;M(le,"display","none"),this.options.removeCloneOnHide&&le.parentNode&&le.parentNode.removeChild(le),ft=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ft){if(we("showClone",this),V.eventCanceled)return;w.parentNode==ae&&!this.options.group.revertClone?ae.insertBefore(le,w):Ot?ae.insertBefore(le,Ot):ae.appendChild(le),this.options.group.revertClone&&this.animate(w,le),M(le,"display",""),ft=!1}}};function jg(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function ei(e,t,n,i,r,a,o,s){var l,u=e[Fe],c=u.options.onMove,d;return window.CustomEvent&&!dt&&!Nn?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=r||t,l.relatedRect=a||pe(t),l.willInsertAfter=s,l.originalEvent=o,e.dispatchEvent(l),c&&(d=c.call(u,l,o)),d}function vr(e){e.draggable=!1}function $g(){Wr=!1}function zg(e,t,n){var i=pe(un(n.el,0,n.options,!0)),r=10;return t?e.clientX<i.left-r||e.clientY<i.top&&e.clientX<i.right:e.clientY<i.top-r||e.clientY<i.bottom&&e.clientX<i.left}function Hg(e,t,n){var i=pe(Ca(n.el,n.options.draggable)),r=10;return t?e.clientX>i.right+r||e.clientX<=i.right&&e.clientY>i.bottom&&e.clientX>=i.left:e.clientX>i.right&&e.clientY>i.top||e.clientX<=i.right&&e.clientY>i.bottom+r}function qg(e,t,n,i,r,a,o,s){var l=i?e.clientY:e.clientX,u=i?n.height:n.width,c=i?n.top:n.left,d=i?n.bottom:n.right,h=!1;if(!o){if(s&&hi<u*r){if(!Cn&&(wn===1?l>c+u*a/2:l<d-u*a/2)&&(Cn=!0),Cn)h=!0;else if(wn===1?l<c+hi:l>d-hi)return-wn}else if(l>c+u*(1-r)/2&&l<d-u*(1-r)/2)return Ug(t)}return h=h||o,h&&(l<c+u*a/2||l>d-u*a/2)?l>c+u/2?1:-1:0}function Ug(e){return Re(w)<Re(e)?1:-1}function Wg(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function Gg(e){Di.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&Di.push(i)}}function pi(e){return setTimeout(e,0)}function Gr(e){return clearTimeout(e)}Ki&&J(document,"touchmove",function(e){(V.active||Qt)&&e.cancelable&&e.preventDefault()});V.utils={on:J,off:K,css:M,find:yl,is:function(e,t){return!!Ue(e,t,e,!1)},extend:Ig,throttle:xl,closest:Ue,toggleClass:Ae,clone:El,index:Re,nextTick:pi,cancelNextTick:Gr,detectDirection:wl,getChild:un};V.get=function(e){return e[Fe]};V.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(V.utils=Ke(Ke({},V.utils),i.utils)),jn.mount(i)})};V.create=function(e,t){return new V(e,t)};V.version=Cg;var ce=[],mn,Xr,Yr=!1,br,yr,Oi,vn;function Xg(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?J(document,"dragover",this._handleAutoScroll):this.options.supportPointer?J(document,"pointermove",this._handleFallbackAutoScroll):n.touches?J(document,"touchmove",this._handleFallbackAutoScroll):J(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?K(document,"dragover",this._handleAutoScroll):(K(document,"pointermove",this._handleFallbackAutoScroll),K(document,"touchmove",this._handleFallbackAutoScroll),K(document,"mousemove",this._handleFallbackAutoScroll)),Bo(),fi(),Fg()},nulling:function(){Oi=Xr=mn=Yr=vn=br=yr=null,ce.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var i=this,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,o=document.elementFromPoint(r,a);if(Oi=t,n||this.options.forceAutoScrollFallback||Nn||dt||kn){xr(t,this.options,o,n);var s=gt(o,!0);Yr&&(!vn||r!==br||a!==yr)&&(vn&&Bo(),vn=setInterval(function(){var l=gt(document.elementFromPoint(r,a),!0);l!==s&&(s=l,fi()),xr(t,i.options,l,n)},10),br=r,yr=a)}else{if(!this.options.bubbleScroll||gt(o,!0)===Ge()){fi();return}xr(t,this.options,gt(o,!1),!1)}}},ct(e,{pluginName:"scroll",initializeByDefault:!0})}function fi(){ce.forEach(function(e){clearInterval(e.pid)}),ce=[]}function Bo(){clearInterval(vn)}var xr=xl(function(e,t,n,i){if(t.scroll){var r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,l=Ge(),u=!1,c;Xr!==n&&(Xr=n,fi(),mn=t.scroll,c=t.scrollFn,mn===!0&&(mn=gt(n,!0)));var d=0,h=mn;do{var p=h,f=pe(p),g=f.top,m=f.bottom,b=f.left,v=f.right,E=f.width,T=f.height,_=void 0,S=void 0,X=p.scrollWidth,D=p.scrollHeight,C=M(p),k=p.scrollLeft,y=p.scrollTop;p===l?(_=E<X&&(C.overflowX==="auto"||C.overflowX==="scroll"||C.overflowX==="visible"),S=T<D&&(C.overflowY==="auto"||C.overflowY==="scroll"||C.overflowY==="visible")):(_=E<X&&(C.overflowX==="auto"||C.overflowX==="scroll"),S=T<D&&(C.overflowY==="auto"||C.overflowY==="scroll"));var x=_&&(Math.abs(v-r)<=o&&k+E<X)-(Math.abs(b-r)<=o&&!!k),I=S&&(Math.abs(m-a)<=o&&y+T<D)-(Math.abs(g-a)<=o&&!!y);if(!ce[d])for(var B=0;B<=d;B++)ce[B]||(ce[B]={});(ce[d].vx!=x||ce[d].vy!=I||ce[d].el!==p)&&(ce[d].el=p,ce[d].vx=x,ce[d].vy=I,clearInterval(ce[d].pid),(x!=0||I!=0)&&(u=!0,ce[d].pid=setInterval(function(){i&&this.layer===0&&V.active._onTouchMove(Oi);var L=ce[this.layer].vy?ce[this.layer].vy*s:0,N=ce[this.layer].vx?ce[this.layer].vx*s:0;typeof c=="function"&&c.call(V.dragged.parentNode[Fe],N,L,e,Oi,ce[this.layer].el)!=="continue"||kl(ce[this.layer].el,N,L)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=gt(h,!1)));Yr=u}},30),Tl=function(e){var t=e.originalEvent,n=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||r;o();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(u.clientX,u.clientY);s(),l&&!l.el.contains(c)&&(a("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Aa(){}Aa.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=un(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Tl};ct(Aa,{pluginName:"revertOnSpill"});function Sa(){}Sa.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,i=n||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Tl};ct(Sa,{pluginName:"removeOnSpill"});V.mount(new Xg);V.mount(Sa,Aa);const Yg=["Start","Add","Remove","Update","End"],Kg=["Choose","Unchoose","Sort","Filter","Clone"],Zg=["Move"],Lo={manage:Zg,manageAndEmit:Yg,emit:Kg};[...[...Lo.manageAndEmit,...Lo.emit].map(e=>e.toLowerCase())];var Qg=mt("switch").parts("root","label","control","thumb"),ti=Qg.build(),fe=Rn({getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`switch:${e.id}`},getLabelId:e=>{var t;return((t=e.ids)==null?void 0:t.label)??`switch:${e.id}:label`},getThumbId:e=>{var t;return((t=e.ids)==null?void 0:t.thumb)??`switch:${e.id}:thumb`},getControlId:e=>{var t;return((t=e.ids)==null?void 0:t.control)??`switch:${e.id}:control`},getHiddenInputId:e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`switch:${e.id}:input`},getRootEl:e=>fe.getById(e,fe.getRootId(e)),getHiddenInputEl:e=>fe.getById(e,fe.getHiddenInputId(e))});function Jg(e,t,n){const i=e.context.isDisabled,r=e.context.readOnly,a=e.context.checked,o=!i&&e.context.focused,s=!i&&e.context.focusVisible,l={"data-active":R(e.context.active),"data-focus":R(o),"data-focus-visible":R(s),"data-readonly":R(r),"data-hover":R(e.context.hovered),"data-disabled":R(i),"data-state":e.context.checked?"checked":"unchecked","data-invalid":R(e.context.invalid)};return{checked:a,disabled:i,focused:o,setChecked(u){t({type:"CHECKED.SET",checked:u,isTrusted:!1})},toggleChecked(){t({type:"CHECKED.TOGGLE",checked:a,isTrusted:!1})},getRootProps(){return n.label({...ti.root.attrs,...l,dir:e.context.dir,id:fe.getRootId(e.context),htmlFor:fe.getHiddenInputId(e.context),onPointerMove(){i||t({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||t({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(u){i||st(u)===fe.getHiddenInputEl(e.context)&&u.stopPropagation()}})},getLabelProps(){return n.element({...ti.label.attrs,...l,dir:e.context.dir,id:fe.getLabelId(e.context)})},getThumbProps(){return n.element({...ti.thumb.attrs,...l,dir:e.context.dir,id:fe.getThumbId(e.context),"aria-hidden":!0})},getControlProps(){return n.element({...ti.control.attrs,...l,dir:e.context.dir,id:fe.getControlId(e.context),"aria-hidden":!0})},getHiddenInputProps(){return n.input({id:fe.getHiddenInputId(e.context),type:"checkbox",required:e.context.required,defaultChecked:a,disabled:i,"aria-labelledby":fe.getLabelId(e.context),"aria-invalid":e.context.invalid,name:e.context.name,form:e.context.form,value:e.context.value,style:ua,onFocus(){const u=In();t({type:"CONTEXT.SET",context:{focused:!0,focusVisible:u}})},onBlur(){t({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(u){if(r){u.preventDefault();return}const c=u.currentTarget.checked;t({type:"CHECKED.SET",checked:c,isTrusted:!0})}})}}}var{not:No}=pa;function em(e){const t=lt(e);return Mn({id:"switch",initial:"ready",context:{checked:!1,label:"switch",value:"on",disabled:!1,...t,fieldsetDisabled:!1,focusVisible:!1},computed:{isDisabled:n=>n.disabled||n.fieldsetDisabled},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:No("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:No("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackPressEvent(n){if(!n.isDisabled)return Rs({pointerNode:fe.getRootEl(n),keyboardNode:fe.getHiddenInputEl(n),isValidKey:i=>i.key===" ",onPress:()=>n.active=!1,onPressStart:()=>n.active=!0,onPressEnd:()=>n.active=!1})},trackFocusVisible(n){if(!n.isDisabled)return ca({root:fe.getRootNode(n)})},trackFormControlState(n,i,{send:r,initialContext:a}){return Ni(fe.getHiddenInputEl(n),{onFieldsetDisabledChange(o){n.fieldsetDisabled=o},onFormReset(){r({type:"CHECKED.SET",checked:!!a.checked,src:"form-reset"})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=fe.getHiddenInputEl(n);i&&(i.checked=!!n.checked)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,i){jo.checked(n,i.checked)},toggleChecked(n,i){jo.checked(n,!n.checked)},dispatchChangeEvent(n){const i=fe.getHiddenInputEl(n);ma(i,{checked:n.checked})}}})}var tm={change:e=>{var t;(t=e.onCheckedChange)==null||t.call(e,{checked:e.checked})}},jo={checked:(e,t)=>{vt(e.checked,t)||(e.checked=t,tm.change(e))}};qt()(["checked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const nm={key:0,class:"k-switch__label"},Rm=oe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},labels:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r={id:_t(),checked:n.modelValue,disabled:n.disabled,onCheckedChange:({checked:l})=>i("update:modelValue",l)},[a,o]=Bn(em(r),{}),s=U(()=>Jg(a.value,o,Vn));return Ce(()=>n.modelValue,()=>{if(s.value.checked!==n.modelValue)return s.value.setChecked(n.modelValue)}),(l,u)=>(A(),P("label",te({class:"k-switch"},s.value.getRootProps),[ee("input",ye(Ie(s.value.getHiddenInputProps())),null,16),ee("span",ye(Ie(s.value.getControlProps())),[ee("span",ye(Ie(s.value.getThumbProps())),null,16)],16),ee("span",ye(Ie(s.value.getLabelProps())),[l.labels?(A(),P("span",nm,de(s.value.checked?l.labels.on:l.labels.off),1)):W("",!0)],16)],16))}}),Mm=oe({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(e,{emit:t}){const n=e,i=t,r=ne(!1);function a(u){const c=u[0];c.isIntersecting&&(r.value=!0,Wl(()=>{i("intersect",c),l()}))}const o=ne(),s=ne();At(()=>{o.value=new IntersectionObserver(a,{root:n.observerRoot,threshold:n.threshold}),o.value.observe(s.value)}),Qr(()=>{l()});function l(){o.value&&o.value.disconnect()}return(u,c)=>(A(),ue(kt(u.wrapperTag),{ref_key:"rootRef",ref:s,class:"k-lazyload"},{default:ve(()=>[r.value?z(u.$slots,"default",{key:0}):z(u.$slots,"placeholder",{key:1})]),_:3},512))}});function im(e){return e%4===0&&e%100!==0||e%400===0}function rm(e=""){if(e.length===10){let t=e.replace(".","-").replace("/","-").split("-");if(t.length===3&&t[0].length===4){let n=parseInt(t[0]),i=parseInt(t[1]),r=parseInt(t[2]);if(i===2){if(im(n)){if(r>29)return!1}else if(r>28)return!1}if((i===4||i===6||i===9||i===11)&&r>30)return!1}return!0}return!0}function tt(e){let t;if(typeof e=="number"&&(t=new Date(e),typeof t=="object"))return!0;if(t=new Date(e),typeof t=="object")return!(t.toString()==="Invalid Date"||!rm(e));var n=/^\d{4}\-\d{1,2}\-\d{1,2}$/;if(!n.test(e))return!1;var i=e.split("-"),r=parseInt(i[2],10),a=parseInt(i[1],10),o=parseInt(i[0],10);if(o<1e3||o>3e3||a==0||a>12)return!1;var s=[31,28,31,30,31,30,31,31,30,31,30,31];return(o%400==0||o%100!=0&&o%4==0)&&(s[1]=29),r>0&&r<=s[a-1]}var Pi={required:function(e){var t;return e==null?!1:(t=String(e).replace(/\s/g,""),t.length>0)},required_if:function(e,t,n){return t=this.getParameters(),this.validator._objectPath(this.validator.input,t[0])===t[1]?this.validator.getRule("required").validate(e):!0},required_unless:function(e,t,n){return t=this.getParameters(),this.validator._objectPath(this.validator.input,t[0])!==t[1]?this.validator.getRule("required").validate(e):!0},required_with:function(e,t,n){return this.validator._objectPath(this.validator.input,t)?this.validator.getRule("required").validate(e):!0},required_with_all:function(e,t,n){t=this.getParameters();for(var i=0;i<t.length;i++)if(!this.validator._objectPath(this.validator.input,t[i]))return!0;return this.validator.getRule("required").validate(e)},required_without:function(e,t,n){return this.validator._objectPath(this.validator.input,t)?!0:this.validator.getRule("required").validate(e)},required_without_all:function(e,t,n){t=this.getParameters();for(var i=0;i<t.length;i++)if(this.validator._objectPath(this.validator.input,t[i]))return!0;return this.validator.getRule("required").validate(e)},boolean:function(e){return e===!0||e===!1||e===0||e===1||e==="0"||e==="1"||e==="true"||e==="false"},size:function(e,t,n){if(e){t=parseFloat(t);var i=this.getSize();return i===t}return!0},string:function(e,t,n){return typeof e=="string"},sometimes:function(e){return!0},min:function(e,t,n){var i=this.getSize();return i>=t},max:function(e,t,n){var i=this.getSize();return i<=t},between:function(e,t,n){t=this.getParameters();var i=this.getSize(),r=parseFloat(t[0],10),a=parseFloat(t[1],10);return i>=r&&i<=a},email:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)||(t=/^((?:[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]|[^\u0000-\u007F])+@(?:[a-zA-Z0-9]|[^\u0000-\u007F])(?:(?:[a-zA-Z0-9-]|[^\u0000-\u007F]){0,61}(?:[a-zA-Z0-9]|[^\u0000-\u007F]))?(?:\.(?:[a-zA-Z0-9]|[^\u0000-\u007F])(?:(?:[a-zA-Z0-9-]|[^\u0000-\u007F]){0,61}(?:[a-zA-Z0-9]|[^\u0000-\u007F]))?)+)*$/),t.test(e)},numeric:function(e){var t;return t=Number(e),typeof t=="number"&&!isNaN(t)&&typeof e!="boolean"},array:function(e){return e instanceof Array},url:function(e){return/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_\+.~#?&/=]*)/i.test(e)},alpha:function(e){return/^[a-zA-Z]+$/.test(e)},alpha_dash:function(e){return/^[a-zA-Z0-9_\-]+$/.test(e)},alpha_num:function(e){return/^[a-zA-Z0-9]+$/.test(e)},same:function(e,t){var n=this.validator._flattenObject(this.validator.input)[t],i=e;return n===i},different:function(e,t){var n=this.validator._flattenObject(this.validator.input)[t],i=e;return n!==i},in:function(e,t){var n,i;if(e&&(n=this.getParameters()),e&&!(e instanceof Array)){var r=e;for(i=0;i<n.length;i++)if(typeof n[i]=="string"&&(r=String(e)),r===n[i])return!0;return!1}if(e&&e instanceof Array){for(i=0;i<e.length;i++)if(n.indexOf(e[i])<0)return!1}return!0},not_in:function(e,t){for(var n=this.getParameters(),i=n.length,r=!0,a=0;a<i;a++){var o=e;if(typeof n[a]=="string"&&(o=String(e)),o===n[a]){r=!1;break}}return r},accepted:function(e){return e==="on"||e==="yes"||e===1||e==="1"||e===!0},confirmed:function(e,t,n){var i=n+"_confirmation";return this.validator.input[i]===e},integer:function(e){return String(parseInt(e,10))===String(e)},digits:function(e,t){var n=this.validator.getRule("numeric");return!!(n.validate(e)&&String(e.trim()).length===parseInt(t))},digits_between:function(e){var t=this.validator.getRule("numeric"),n=this.getParameters(),i=String(e).length,r=parseFloat(n[0],10),a=parseFloat(n[1],10);return!!(t.validate(e)&&i>=r&&i<=a)},regex:function(e,t){var n=/[g|i|m]{1,3}$/,i=t.match(n);return i=i?i[0]:"",t=t.replace(n,"").slice(1,-1),t=new RegExp(t,i),!!t.test(e)},date:function(e,t){return tt(e)},present:function(e){return typeof e<"u"},after:function(e,t){var n=this.validator.input[t],i=e;return!tt(n)||!tt(i)?!1:new Date(n).getTime()<new Date(i).getTime()},after_or_equal:function(e,t){var n=this.validator.input[t],i=e;return!tt(n)||!tt(i)?!1:new Date(n).getTime()<=new Date(i).getTime()},before:function(e,t){var n=this.validator.input[t],i=e;return!tt(n)||!tt(i)?!1:new Date(n).getTime()>new Date(i).getTime()},before_or_equal:function(e,t){var n=this.validator.input[t],i=e;return!tt(n)||!tt(i)?!1:new Date(n).getTime()>=new Date(i).getTime()},hex:function(e){return/^[0-9a-f]+$/i.test(e)},ipv4:function(e,t,n){if(typeof e!="string")return!1;var i=/^[0-9]+$/;if(octets=e.split("."),octets.length!=4)return!1;for(let a=0;a<octets.length;a++){const o=octets[a];if(!i.test(o))return!1;var r=parseInt(o);if(r>=256)return!1}return!0},ipv6:function(e,t,n){if(typeof e!="string")return!1;var i=/^[0-9a-f]+$/;if(hextets=e.split(":"),colons=e.match(/::/),colons!=null&&e.match(/::/g).length>1||e[0]==":"&&(colons==null||colons!=null&&colons.index!=0)||e[e.length-1]==":"&&(colons==null||colons!=null&&colons.index!=e.length-2)||3>hextets.length)return!1;var r=hextets.length==9&&colons!=null&&(colons.index==0||colons.index==e.length-2);if(hextets.length>8&&!r||hextets.length!=8&&colons==null)return!1;for(let a=0;a<hextets.length;a++){const o=hextets[a];if(o.length!=0&&(!i.test(o)||o.length>4))return!1}return!0},ip:function(e,t,n){return Pi.ipv4(e,t,n)||Pi.ipv6(e,t,n)}},Il=function(){throw new Error("Validator `"+this.name+"` is not defined!")},Fl;function Dl(e,t,n){this.name=e,this.fn=t,this.passes=null,this._customMessage=void 0,this.async=n}Dl.prototype={validate:function(e,t,n,i){var r=this;if(this._setValidatingData(n,e,t),typeof i=="function"){this.callback=i;var a=function(o,s){r.response(o,s)};return this.async?this._apply(e,t,n,a):a(this._apply(e,t,n))}return this._apply(e,t,n)},_apply:function(e,t,n,i){var r=this.isMissed()?Il:this.fn;return r.apply(this,[e,t,n,i])},_setValidatingData:function(e,t,n){this.attribute=e,this.inputValue=t,this.ruleValue=n},getParameters:function(){var e=[];return typeof this.ruleValue=="string"&&(e=this.ruleValue.split(",")),typeof this.ruleValue=="number"&&e.push(this.ruleValue),this.ruleValue instanceof Array&&(e=this.ruleValue),e},getSize:function(){var e=this.inputValue;return e instanceof Array?e.length:typeof e=="number"?e:this.validator._hasNumericRule(this.attribute)?parseFloat(e,10):e.length},_getValueType:function(){return typeof this.inputValue=="number"||this.validator._hasNumericRule(this.attribute)?"numeric":"string"},response:function(e,t){this.passes=e===void 0||e===!0,this._customMessage=t,this.callback(this.passes,t)},setValidator:function(e){this.validator=e},isMissed:function(){return typeof this.fn!="function"},get customMessage(){return this.isMissed()?Fl:this._customMessage}};var am={asyncRules:[],implicitRules:["required","required_if","required_unless","required_with","required_with_all","required_without","required_without_all","accepted","present"],make:function(e,t){var n=this.isAsync(e),i=new Dl(e,Pi[e],n);return i.setValidator(t),i},isAsync:function(e){for(var t=0,n=this.asyncRules.length;t<n;t++)if(this.asyncRules[t]===e)return!0;return!1},isImplicit:function(e){return this.implicitRules.indexOf(e)>-1},register:function(e,t){Pi[e]=t},registerImplicit:function(e,t){this.register(e,t),this.implicitRules.push(e)},registerAsync:function(e,t){this.register(e,t),this.asyncRules.push(e)},registerAsyncImplicit:function(e,t){this.registerImplicit(e,t),this.asyncRules.push(e)},registerMissedRuleValidator:function(e,t){Il=e,Fl=t}},om=am;function sm(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var lm={between:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{min:n[0],max:n[1]})},digits_between:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{min:n[0],max:n[1]})},required_if:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{other:this._getAttributeName(n[0]),value:n[1]})},required_unless:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{other:this._getAttributeName(n[0]),value:n[1]})},required_with:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{field:this._getAttributeName(n[0])})},required_with_all:function(e,t){var n=t.getParameters(),i=this._getAttributeName.bind(this);return this._replacePlaceholders(t,e,{fields:n.map(i).join(", ")})},required_without:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{field:this._getAttributeName(n[0])})},required_without_all:function(e,t){var n=t.getParameters(),i=this._getAttributeName.bind(this);return this._replacePlaceholders(t,e,{fields:n.map(i).join(", ")})},after:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{after:this._getAttributeName(n[0])})},before:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{before:this._getAttributeName(n[0])})},after_or_equal:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{after_or_equal:this._getAttributeName(n[0])})},before_or_equal:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{before_or_equal:this._getAttributeName(n[0])})},same:function(e,t){var n=t.getParameters();return this._replacePlaceholders(t,e,{same:this._getAttributeName(n[0])})}};function um(e){return e.replace(/[_\[]/g," ").replace(/]/g,"")}var Ol={replacements:lm,formatter:um},$o=Ol,Kr=function(e,t){this.lang=e,this.messages=t,this.customMessages={},this.attributeNames={}};Kr.prototype={constructor:Kr,_setCustom:function(e){this.customMessages=e||{}},_setAttributeNames:function(e){this.attributeNames=e},_setAttributeFormatter:function(e){this.attributeFormatter=e},_getAttributeName:function(e){var t=e;return this.attributeNames.hasOwnProperty(e)?this.attributeNames[e]:(this.messages.attributes.hasOwnProperty(e)&&(t=this.messages.attributes[e]),this.attributeFormatter&&(t=this.attributeFormatter(t)),t)},all:function(){return this.messages},render:function(e){if(e.customMessage)return e.customMessage;var t=this._getTemplate(e),n;return $o.replacements[e.name]?n=$o.replacements[e.name].apply(this,[t,e]):n=this._replacePlaceholders(e,t,{}),n},_getTemplate:function(e){for(var t=this.messages,n=t.def,i=this.customMessages,r=[e.name+"."+e.attribute,e.name],a=0,o;a<r.length;a++)if(o=r[a],i.hasOwnProperty(o)){n=i[o];break}else if(t.hasOwnProperty(o)){n=t[o];break}return typeof n=="object"&&(n=n[e._getValueType()]),n},_replacePlaceholders:function(e,t,n){var i,r;if(n.attribute=this._getAttributeName(e.attribute),n[e.name]=n[e.name]||e.getParameters().join(","),typeof t=="string"&&typeof n=="object"){i=t;for(r in n)i=i.replace(new RegExp(":"+r,"g"),n[r])}return i}};var cm=Kr,dm=cm,hm=sm,pm={messages:{},_set:function(e,t){this.messages[e]=t},_setRuleMessage:function(e,t,n){this._load(e),n===void 0&&(n=this.messages[e].def),this.messages[e][t]=n},_load:function(e){if(!this.messages[e])try{var t=hm("./lang/"+e);this._set(e,t)}catch{}},_get:function(e){return this._load(e),this.messages[e]},_make:function(e){return this._load(e),new dm(e,this.messages[e])}},fm=pm,Zr=function(){this.errors={}};Zr.prototype={constructor:Zr,add:function(e,t){this.has(e)||(this.errors[e]=[]),this.errors[e].indexOf(t)===-1&&this.errors[e].push(t)},get:function(e){return this.has(e)?this.errors[e]:[]},first:function(e){return this.has(e)?this.errors[e][0]:!1},all:function(){return this.errors},has:function(e){return!!this.errors.hasOwnProperty(e)}};var gm=Zr;function Pl(e,t){this.onResolvedAll=t,this.onFailedOne=e,this.resolvers={},this.resolversCount=0,this.passed=[],this.failed=[],this.firing=!1}Pl.prototype={add:function(e){var t=this.resolversCount;return this.resolvers[t]=e,this.resolversCount++,t},resolve:function(e){var t=this.resolvers[e];t.passes===!0?this.passed.push(t):t.passes===!1&&(this.failed.push(t),this.onFailedOne(t)),this.fire()},isAllResolved:function(){return this.passed.length+this.failed.length===this.resolversCount},fire:function(){this.firing&&this.isAllResolved()&&this.onResolvedAll(this.failed.length===0)},enableFiring:function(){this.firing=!0}};var mm=Pl,xt=om,Ut=fm,vm=gm,bm=Ol,ym=mm,he=function(e,t,n){var i=he.getDefaultLang();this.input=e||{},this.messages=Ut._make(i),this.messages._setCustom(n),this.setAttributeFormatter(he.prototype.attributeFormatter),this.errors=new vm,this.errorCount=0,this.hasAsync=!1,this.rules=this._parseRules(t)};he.prototype={constructor:he,lang:"en",numericRules:["integer","numeric"],attributeFormatter:bm.formatter,check:function(){for(var e in this.rules){var t=this.rules[e],n=this._objectPath(this.input,e);if(!(this._hasRule(e,["sometimes"])&&!this._suppliedWithData(e)))for(var i=0,r=t.length,a,o,s;i<r&&(o=t[i],a=this.getRule(o.name),!(this._isValidatable(a,n)&&(s=a.validate(n,o.value,e),s||this._addFailure(a),this._shouldStopValidating(e,s))));i++);}return this.errorCount===0},checkAsync:function(e,t){var n=this;e=e||function(){},t=t||function(){};var i=function(f,g){n._addFailure(f,g)},r=function(f){f?e():t()},a=new ym(i,r),o=function(f,g,m,b){return function(){var v=a.add(b);b.validate(f,g.value,m,function(){a.resolve(v)})}};for(var s in this.rules){var l=this.rules[s],u=this._objectPath(this.input,s);if(!(this._hasRule(s,["sometimes"])&&!this._suppliedWithData(s)))for(var c=0,d=l.length,h,p;c<d;c++)p=l[c],h=this.getRule(p.name),this._isValidatable(h,u)&&o(u,p,s,h)()}a.enableFiring(),a.fire()},_addFailure:function(e){var t=this.messages.render(e);this.errors.add(e.attribute,t),this.errorCount++},_flattenObject:function(e){var t={};function n(i,r){if(!(!r&&Object.getOwnPropertyNames(i).length===0))if(Object(i)!==i||Array.isArray(i))t[r]=i;else{var a=!0;for(var o in i)a=!1,n(i[o],r?r+"."+o:o);a&&(t[r]={})}}return e&&n(e),t},_objectPath:function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];var n=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);for(var a=0,o=n.length;a<o;a++)if(typeof i=="object"&&i!==null&&Object.hasOwnProperty.call(i,n[a]))i=i[n[a]];else return;return i},_parseRules:function(e){var t={};e=this._flattenObject(e);for(var n in e){var i=e[n];this._parseRulesCheck(n,i,t)}return t},_parseRulesCheck:function(e,t,n,i){e.indexOf("*")>-1?this._parsedRulesRecurse(e,t,n,i):this._parseRulesDefault(e,t,n,i)},_parsedRulesRecurse:function(e,t,n,i){var r=e.substr(0,e.indexOf("*")-1),a=this._objectPath(this.input,r);if(a)for(var o=0;o<a.length;o++){var s=i?i.slice():[];s.push(o),this._parseRulesCheck(e.replace("*",o),t,n,s)}},_parseRulesDefault:function(e,t,n,i){var r=[];t instanceof Array&&(t=this._prepareRulesArray(t)),typeof t=="string"&&(t=t.split("|"));for(var a=0,o=t.length,s;a<o;a++)s=typeof t[a]=="string"?this._extractRuleAndRuleValue(t[a]):t[a],s.value&&(s.value=this._replaceWildCards(s.value,i),this._replaceWildCardsMessages(i)),xt.isAsync(s.name)&&(this.hasAsync=!0),r.push(s);n[e]=r},_replaceWildCards:function(e,t){if(!t)return e;var n=e;return t.forEach(function(i){Array.isArray(n)&&(n=n[0]);const r=n.indexOf("*");if(r===-1)return n;n=n.substr(0,r)+i+n.substr(r+1)}),Array.isArray(e)&&(e[0]=n,n=e),n},_replaceWildCardsMessages:function(e){var t=this.messages.customMessages,n=this;Object.keys(t).forEach(function(i){if(e){var r=n._replaceWildCards(i,e);t[r]=t[i]}}),this.messages._setCustom(t)},_prepareRulesArray:function(e){for(var t=[],n=0,i=e.length;n<i;n++)if(typeof e[n]=="object")for(var r in e[n])t.push({name:r,value:e[n][r]});else t.push(e[n]);return t},_suppliedWithData:function(e){return this.input.hasOwnProperty(e)},_extractRuleAndRuleValue:function(e){var t={},n;return t.name=e,e.indexOf(":")>=0&&(n=e.split(":"),t.name=n[0],t.value=n.slice(1).join(":")),t},_hasRule:function(e,t){for(var n=this.rules[e]||[],i=0,r=n.length;i<r;i++)if(t.indexOf(n[i].name)>-1)return!0;return!1},_hasNumericRule:function(e){return this._hasRule(e,this.numericRules)},_isValidatable:function(e,t){return Array.isArray(t)||xt.isImplicit(e.name)?!0:this.getRule("required").validate(t)},_shouldStopValidating:function(e,t){var n=this.stopOnAttributes;return typeof n>"u"||n===!1||t===!0?!1:n instanceof Array?n.indexOf(e)>-1:!0},setAttributeNames:function(e){this.messages._setAttributeNames(e)},setAttributeFormatter:function(e){this.messages._setAttributeFormatter(e)},getRule:function(e){return xt.make(e,this)},stopOnError:function(e){this.stopOnAttributes=e},passes:function(e){var t=this._checkAsync("passes",e);return t?this.checkAsync(e):this.check()},fails:function(e){var t=this._checkAsync("fails",e);return t?this.checkAsync(function(){},e):!this.check()},_checkAsync:function(e,t){var n=typeof t=="function";if(this.hasAsync&&!n)throw e+" expects a callback when async rules are being tested.";return this.hasAsync||n}};he.setMessages=function(e,t){return Ut._set(e,t),this};he.getMessages=function(e){return Ut._get(e)};he.useLang=function(e){this.prototype.lang=e};he.getDefaultLang=function(){return this.prototype.lang};he.setAttributeFormatter=function(e){this.prototype.attributeFormatter=e};he.stopOnError=function(e){this.prototype.stopOnAttributes=e};he.register=function(e,t,n,i){var r=he.getDefaultLang();xt.register(e,t),Ut._setRuleMessage(r,e,n)};he.registerImplicit=function(e,t,n,i){var r=he.getDefaultLang();xt.registerImplicit(e,t),Ut._setRuleMessage(r,e,n)};he.registerAsync=function(e,t,n,i){var r=he.getDefaultLang();xt.registerAsync(e,t),Ut._setRuleMessage(r,e,n)};he.registerAsyncImplicit=function(e,t,n){var i=he.getDefaultLang();xt.registerAsyncImplicit(e,t),Ut._setRuleMessage(i,e,n)};he.registerMissedRuleValidator=function(e,t){xt.registerMissedRuleValidator(e,t)};var xm=he;const Rl=gg(xm);ne(!1);Rl.register;Rl.registerAsync;export{Rm as A,Fm as E,Mm as I,Gp as J,Eh as L,Nt as V,wm as _,Em as a,Im as b,Sm as c,lo as d,Dm as e,Cm as h,Tm as k,Pm as t,_m as u,Am as v,Om as w,bh as x,Bt as y};
|
|
14
|
+
*/function om(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function On(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?om(Object(n),!0).forEach(function(r){_O(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):om(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function el(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?el=function(e){return typeof e}:el=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},el(t)}function _O(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nr(){return nr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nr.apply(this,arguments)}function IO(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function DO(t,e){if(t==null)return{};var n=IO(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var RO="1.14.0";function Yn(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var sr=Yn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ys=Yn(/Edge/i),sm=Yn(/firefox/i),ns=Yn(/safari/i)&&!Yn(/chrome/i)&&!Yn(/android/i),Yy=Yn(/iP(ad|od|hone)/i),NO=Yn(/chrome/i)&&Yn(/android/i),Xy={capture:!1,passive:!1};function Ee(t,e,n){t.addEventListener(e,n,!sr&&Xy)}function we(t,e,n){t.removeEventListener(e,n,!sr&&Xy)}function Ml(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function PO(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function gn(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Ml(t,e):Ml(t,e))||r&&t===n)return t;if(t===n)break}while(t=PO(t))}return null}var am=/\s+/g;function _t(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(am," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(am," ")}}function ne(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function so(t,e){var n="";if(typeof t=="string")n=t;else do{var r=ne(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Zy(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,o=r.length;if(n)for(;i<o;i++)n(r[i],i);return r}return[]}function wn(){var t=document.scrollingElement;return t||document.documentElement}function qe(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var o,s,a,l,u,c,d;if(t!==window&&t.parentNode&&t!==wn()?(o=t.getBoundingClientRect(),s=o.top,a=o.left,l=o.bottom,u=o.right,c=o.height,d=o.width):(s=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!sr))do if(i&&i.getBoundingClientRect&&(ne(i,"transform")!=="none"||n&&ne(i,"position")!=="static")){var h=i.getBoundingClientRect();s-=h.top+parseInt(ne(i,"border-top-width")),a-=h.left+parseInt(ne(i,"border-left-width")),l=s+o.height,u=a+o.width;break}while(i=i.parentNode);if(r&&t!==window){var p=so(i||t),f=p&&p.a,m=p&&p.d;p&&(s/=m,a/=f,d/=f,c/=m,l=s+c,u=a+d)}return{top:s,left:a,bottom:l,right:u,width:d,height:c}}}function lm(t,e,n){for(var r=xr(t,!0),i=qe(t)[e];r;){var o=qe(r)[n],s=void 0;if(s=i>=o,!s)return r;if(r===wn())break;r=xr(r,!1)}return!1}function mo(t,e,n,r){for(var i=0,o=0,s=t.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==re.ghost&&(r||s[o]!==re.dragged)&&gn(s[o],n.draggable,t,!1)){if(i===e)return s[o];i++}o++}return null}function up(t,e){for(var n=t.lastElementChild;n&&(n===re.ghost||ne(n,"display")==="none"||e&&!Ml(n,e));)n=n.previousElementSibling;return n||null}function qt(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==re.clone&&(!e||Ml(t,e))&&n++;return n}function um(t){var e=0,n=0,r=wn();if(t)do{var i=so(t),o=i.a,s=i.d;e+=t.scrollLeft*o,n+=t.scrollTop*s}while(t!==r&&(t=t.parentNode));return[e,n]}function FO(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function xr(t,e){if(!t||!t.getBoundingClientRect)return wn();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=ne(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return wn();if(r||e)return n;r=!0}}while(n=n.parentNode);return wn()}function LO(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Sc(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var rs;function Qy(t,e){return function(){if(!rs){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),rs=setTimeout(function(){rs=void 0},e)}}}function BO(){clearTimeout(rs),rs=void 0}function eb(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function tb(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var Rt="Sortable"+new Date().getTime();function VO(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(ne(r,"display")==="none"||r===re.ghost)){t.push({target:r,rect:qe(r)});var i=On({},t[t.length-1].rect);if(r.thisAnimationDuration){var o=so(r,!0);o&&(i.top-=o.f,i.left-=o.e)}r.fromRect=i}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice(FO(t,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var i=!1,o=0;t.forEach(function(s){var a=0,l=s.target,u=l.fromRect,c=qe(l),d=l.prevFromRect,h=l.prevToRect,p=s.rect,f=so(l,!0);f&&(c.top-=f.f,c.left-=f.e),l.toRect=c,l.thisAnimationDuration&&Sc(d,c)&&!Sc(u,c)&&(p.top-c.top)/(p.left-c.left)===(u.top-c.top)/(u.left-c.left)&&(a=jO(p,d,h,r.options)),Sc(c,u)||(l.prevFromRect=u,l.prevToRect=c,a||(a=r.options.animation),r.animate(l,p,c,a)),a&&(i=!0,o=Math.max(o,a),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},a),l.thisAnimationDuration=a)}),clearTimeout(e),i?e=setTimeout(function(){typeof n=="function"&&n()},o):typeof n=="function"&&n(),t=[]},animate:function(n,r,i,o){if(o){ne(n,"transition",""),ne(n,"transform","");var s=so(this.el),a=s&&s.a,l=s&&s.d,u=(r.left-i.left)/(a||1),c=(r.top-i.top)/(l||1);n.animatingX=!!u,n.animatingY=!!c,ne(n,"transform","translate3d("+u+"px,"+c+"px,0)"),this.forRepaintDummy=$O(n),ne(n,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),ne(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ne(n,"transition",""),ne(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},o)}}}}function $O(t){return t.offsetWidth}function jO(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var zi=[],Tc={initializeByDefault:!0},Xs={mount:function(t){for(var e in Tc)Tc.hasOwnProperty(e)&&!(e in t)&&(t[e]=Tc[e]);zi.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),zi.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=t+"Global";zi.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](On({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](On({sortable:e},n)))})},initializePlugins:function(t,e,n,r){zi.forEach(function(s){var a=s.pluginName;if(!(!t.options[a]&&!s.initializeByDefault)){var l=new s(t,e,t.options);l.sortable=t,l.options=t.options,t[a]=l,nr(n,l.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var o=this.modifyOption(t,i,t.options[i]);typeof o<"u"&&(t.options[i]=o)}},getEventProperties:function(t,e){var n={};return zi.forEach(function(r){typeof r.eventProperties=="function"&&nr(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return zi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[e]=="function"&&(r=i.optionListeners[e].call(t[i.pluginName],n))}),r}};function zO(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,o=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,u=t.newIndex,c=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[Rt],!!e){var m,g=e.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!sr&&!Ys?m=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(r,!0,!0)),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=o,m.oldIndex=l,m.newIndex=u,m.oldDraggableIndex=c,m.newDraggableIndex=d,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=On(On({},f),Xs.getEventProperties(r,e));for(var k in b)m[k]=b[k];n&&n.dispatchEvent(m),g[y]&&g[y].call(e,m)}}var HO=["evt"],wt=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=DO(n,HO);Xs.pluginEvent.bind(re)(t,e,On({dragEl:L,parentEl:De,ghostEl:he,rootEl:Ae,nextEl:Zr,lastDownEl:tl,cloneEl:Re,cloneHidden:yr,dragStarted:Uo,putSortable:Qe,activeSortable:re.active,originalEvent:r,oldIndex:eo,oldDraggableIndex:is,newIndex:It,newDraggableIndex:fr,hideGhostForTarget:ob,unhideGhostForTarget:sb,cloneNowHidden:function(){yr=!0},cloneNowShown:function(){yr=!1},dispatchSortableEvent:function(o){gt({sortable:e,name:o,originalEvent:r})}},i))};function gt(t){zO(On({putSortable:Qe,cloneEl:Re,targetEl:L,rootEl:Ae,oldIndex:eo,oldDraggableIndex:is,newIndex:It,newDraggableIndex:fr},t))}var L,De,he,Ae,Zr,tl,Re,yr,eo,It,is,fr,Sa,Qe,Ki=!1,_l=!1,Il=[],Gr,en,Oc,Ac,cm,dm,Uo,Hi,ss,as=!1,Ta=!1,nl,st,Mc=[],Bd=!1,Dl=[],qu=typeof document<"u",Oa=Yy,hm=Ys||sr?"cssFloat":"float",qO=qu&&!NO&&!Yy&&"draggable"in document.createElement("div"),nb=function(){if(qu){if(sr)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),rb=function(t,e){var n=ne(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=mo(t,0,e),o=mo(t,1,e),s=i&&ne(i),a=o&&ne(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+qe(i).width,u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qe(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var c=s.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===c)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||l>=r&&n[hm]==="none"||o&&n[hm]==="none"&&l+u>r)?"vertical":"horizontal"},WO=function(t,e,n){var r=n?t.left:t.top,i=n?t.right:t.bottom,o=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return r===s||i===a||r+o/2===s+l/2},UO=function(t,e){var n;return Il.some(function(r){var i=r[Rt].options.emptyInsertThreshold;if(!(!i||up(r))){var o=qe(r),s=t>=o.left-i&&t<=o.right+i,a=e>=o.top-i&&e<=o.bottom+i;if(s&&a)return n=r}}),n},ib=function(t){function e(i,o){return function(s,a,l,u){var c=s.options.group.name&&a.options.group.name&&s.options.group.name===a.options.group.name;if(i==null&&(o||c))return!0;if(i==null||i===!1)return!1;if(o&&i==="clone")return i;if(typeof i=="function")return e(i(s,a,l,u),o)(s,a,l,u);var d=(o?s:a).options.group.name;return i===!0||typeof i=="string"&&i===d||i.join&&i.indexOf(d)>-1}}var n={},r=t.group;(!r||el(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=e(r.pull,!0),n.checkPut=e(r.put),n.revertClone=r.revertClone,t.group=n},ob=function(){!nb&&he&&ne(he,"display","none")},sb=function(){!nb&&he&&ne(he,"display","")};qu&&document.addEventListener("click",function(t){if(_l)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),_l=!1,!1},!0);var Jr=function(t){if(L){t=t.touches?t.touches[0]:t;var e=UO(t.clientX,t.clientY);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Rt]._onDragOver(n)}}},KO=function(t){L&&L.parentNode[Rt]._isOutsideThisEl(t.target)};function re(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=nr({},e),t[Rt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return rb(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,s){o.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:re.supportPointer!==!1&&"PointerEvent"in window&&!ns,emptyInsertThreshold:5};Xs.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);ib(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:qO,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ee(t,"pointerdown",this._onTapStart):(Ee(t,"mousedown",this._onTapStart),Ee(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ee(t,"dragover",this),Ee(t,"dragenter",this)),Il.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),nr(this,VO())}re.prototype={constructor:re,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Hi=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,L):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,i=r.preventOnFilter,o=t.type,s=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,u=r.filter;if(tA(n),!L&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||r.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&ns&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=gn(a,r.draggable,n,!1),!(a&&a.animated)&&tl!==a)){if(eo=qt(a),is=qt(a,r.draggable),typeof u=="function"){if(u.call(this,t,a,this)){gt({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),wt("filter",e,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=gn(l,c.trim(),n,!1),c)return gt({sortable:e,rootEl:c,name:"filter",targetEl:a,fromEl:n,toEl:n}),wt("filter",e,{evt:t}),!0}),u)){i&&t.cancelable&&t.preventDefault();return}r.handle&&!gn(l,r.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var r=this,i=r.el,o=r.options,s=i.ownerDocument,a;if(n&&!L&&n.parentNode===i){var l=qe(n);if(Ae=i,L=n,De=L.parentNode,Zr=L.nextSibling,tl=n,Sa=o.group,re.dragged=L,Gr={target:L,clientX:(e||t).clientX,clientY:(e||t).clientY},cm=Gr.clientX-l.left,dm=Gr.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,L.style["will-change"]="all",a=function(){if(wt("delayEnded",r,{evt:t}),re.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!sm&&r.nativeDraggable&&(L.draggable=!0),r._triggerDragStart(t,e),gt({sortable:r,name:"choose",originalEvent:t}),_t(L,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){Zy(L,u.trim(),_c)}),Ee(s,"dragover",Jr),Ee(s,"mousemove",Jr),Ee(s,"touchmove",Jr),Ee(s,"mouseup",r._onDrop),Ee(s,"touchend",r._onDrop),Ee(s,"touchcancel",r._onDrop),sm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,L.draggable=!0),wt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ys||sr))){if(re.eventCanceled){this._onDrop();return}Ee(s,"mouseup",r._disableDelayedDrag),Ee(s,"touchend",r._disableDelayedDrag),Ee(s,"touchcancel",r._disableDelayedDrag),Ee(s,"mousemove",r._delayedDragTouchMoveHandler),Ee(s,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Ee(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){L&&_c(L),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;we(t,"mouseup",this._disableDelayedDrag),we(t,"touchend",this._disableDelayedDrag),we(t,"touchcancel",this._disableDelayedDrag),we(t,"mousemove",this._delayedDragTouchMoveHandler),we(t,"touchmove",this._delayedDragTouchMoveHandler),we(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Ee(document,"pointermove",this._onTouchMove):e?Ee(document,"touchmove",this._onTouchMove):Ee(document,"mousemove",this._onTouchMove):(Ee(L,"dragend",this),Ee(Ae,"dragstart",this._onDragStart));try{document.selection?rl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ki=!1,Ae&&L){wt("dragStarted",this,{evt:e}),this.nativeDraggable&&Ee(document,"dragover",KO);var n=this.options;!t&&_t(L,n.dragClass,!1),_t(L,n.ghostClass,!0),re.active=this,t&&this._appendGhost(),gt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(en){this._lastX=en.clientX,this._lastY=en.clientY,ob();for(var t=document.elementFromPoint(en.clientX,en.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(en.clientX,en.clientY),t!==e);)e=t;if(L.parentNode[Rt]._isOutsideThisEl(t),e)do{if(e[Rt]){var n=void 0;if(n=e[Rt]._onDragOver({clientX:en.clientX,clientY:en.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);sb()}},_onTouchMove:function(t){if(Gr){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,i=t.touches?t.touches[0]:t,o=he&&so(he,!0),s=he&&o&&o.a,a=he&&o&&o.d,l=Oa&&st&&um(st),u=(i.clientX-Gr.clientX+r.x)/(s||1)+(l?l[0]-Mc[0]:0)/(s||1),c=(i.clientY-Gr.clientY+r.y)/(a||1)+(l?l[1]-Mc[1]:0)/(a||1);if(!re.active&&!Ki){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(he){o?(o.e+=u-(Oc||0),o.f+=c-(Ac||0)):o={a:1,b:0,c:0,d:1,e:u,f:c};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");ne(he,"webkitTransform",d),ne(he,"mozTransform",d),ne(he,"msTransform",d),ne(he,"transform",d),Oc=u,Ac=c,en=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!he){var t=this.options.fallbackOnBody?document.body:Ae,e=qe(L,!0,Oa,!0,t),n=this.options;if(Oa){for(st=t;ne(st,"position")==="static"&&ne(st,"transform")==="none"&&st!==document;)st=st.parentNode;st!==document.body&&st!==document.documentElement?(st===document&&(st=wn()),e.top+=st.scrollTop,e.left+=st.scrollLeft):st=wn(),Mc=um(st)}he=L.cloneNode(!0),_t(he,n.ghostClass,!1),_t(he,n.fallbackClass,!0),_t(he,n.dragClass,!0),ne(he,"transition",""),ne(he,"transform",""),ne(he,"box-sizing","border-box"),ne(he,"margin",0),ne(he,"top",e.top),ne(he,"left",e.left),ne(he,"width",e.width),ne(he,"height",e.height),ne(he,"opacity","0.8"),ne(he,"position",Oa?"absolute":"fixed"),ne(he,"zIndex","100000"),ne(he,"pointerEvents","none"),re.ghost=he,t.appendChild(he),ne(he,"transform-origin",cm/parseInt(he.style.width)*100+"% "+dm/parseInt(he.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,i=n.options;if(wt("dragStart",this,{evt:t}),re.eventCanceled){this._onDrop();return}wt("setupClone",this),re.eventCanceled||(Re=tb(L),Re.draggable=!1,Re.style["will-change"]="",this._hideClone(),_t(Re,this.options.chosenClass,!1),re.clone=Re),n.cloneId=rl(function(){wt("clone",n),!re.eventCanceled&&(n.options.removeCloneOnHide||Ae.insertBefore(Re,L),n._hideClone(),gt({sortable:n,name:"clone"}))}),!e&&_t(L,i.dragClass,!0),e?(_l=!0,n._loopId=setInterval(n._emulateDragOver,50)):(we(document,"mouseup",n._onDrop),we(document,"touchend",n._onDrop),we(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,L)),Ee(document,"drop",n),ne(L,"transform","translateZ(0)")),Ki=!0,n._dragStartId=rl(n._dragStarted.bind(n,e,t)),Ee(document,"selectstart",n),Uo=!0,ns&&ne(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,r,i,o,s=this.options,a=s.group,l=re.active,u=Sa===a,c=s.sort,d=Qe||l,h,p=this,f=!1;if(Bd)return;function m(X,ue){wt(X,p,On({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:o,dragRect:r,targetRect:i,canSort:c,fromSortable:d,target:n,completed:y,onMove:function(de,Pe){return Aa(Ae,e,L,r,de,qe(de),t,Pe)},changed:b},ue))}function g(){m("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function y(X){return m("dragOverCompleted",{insertion:X}),X&&(u?l._hideClone():l._showClone(p),p!==d&&(_t(L,Qe?Qe.options.ghostClass:l.options.ghostClass,!1),_t(L,s.ghostClass,!0)),Qe!==p&&p!==re.active?Qe=p:p===re.active&&Qe&&(Qe=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){m("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===L&&!L.animated||n===e&&!n.animated)&&(Hi=null),!s.dragoverBubble&&!t.rootEl&&n!==document&&(L.parentNode[Rt]._isOutsideThisEl(t.target),!X&&Jr(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function b(){It=qt(L),fr=qt(L,s.draggable),gt({sortable:p,name:"change",toEl:e,newIndex:It,newDraggableIndex:fr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=gn(n,s.draggable,e,!0),m("dragOver"),re.eventCanceled)return f;if(L.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return y(!1);if(_l=!1,l&&!s.disabled&&(u?c||(o=De!==Ae):Qe===this||(this.lastPutMode=Sa.checkPull(this,l,L,t))&&a.checkPut(this,l,L,t))){if(h=this._getDirection(t,n)==="vertical",r=qe(L),m("dragOverValid"),re.eventCanceled)return f;if(o)return De=Ae,g(),this._hideClone(),m("revert"),re.eventCanceled||(Zr?Ae.insertBefore(L,Zr):Ae.appendChild(L)),y(!0);var k=up(e,s.draggable);if(!k||XO(t,h,this)&&!k.animated){if(k===L)return y(!1);if(k&&e===t.target&&(n=k),n&&(i=qe(n)),Aa(Ae,e,L,r,n,i,t,!!n)!==!1)return g(),e.appendChild(L),De=e,b(),y(!0)}else if(k&&YO(t,h,this)){var v=mo(e,0,s,!0);if(v===L)return y(!1);if(n=v,i=qe(n),Aa(Ae,e,L,r,n,i,t,!1)!==!1)return g(),e.insertBefore(L,v),De=e,b(),y(!0)}else if(n.parentNode===e){i=qe(n);var w=0,x,_=L.parentNode!==e,A=!WO(L.animated&&L.toRect||r,n.animated&&n.toRect||i,h),S=h?"top":"left",O=lm(n,"top","top")||lm(L,"top","top"),C=O?O.scrollTop:void 0;Hi!==n&&(x=i[S],as=!1,Ta=!A&&s.invertSwap||_),w=ZO(t,n,i,h,A?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Ta,Hi===n);var T;if(w!==0){var R=qt(L);do R-=w,T=De.children[R];while(T&&(ne(T,"display")==="none"||T===he))}if(w===0||T===n)return y(!1);Hi=n,ss=w;var j=n.nextElementSibling,H=!1;H=w===1;var $=Aa(Ae,e,L,r,n,i,t,H);if($!==!1)return($===1||$===-1)&&(H=$===1),Bd=!0,setTimeout(JO,30),g(),H&&!j?e.appendChild(L):n.parentNode.insertBefore(L,H?j:n),O&&eb(O,0,C-O.scrollTop),De=L.parentNode,x!==void 0&&!Ta&&(nl=Math.abs(x-qe(n)[S])),b(),y(!0)}if(e.contains(L))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){we(document,"mousemove",this._onTouchMove),we(document,"touchmove",this._onTouchMove),we(document,"pointermove",this._onTouchMove),we(document,"dragover",Jr),we(document,"mousemove",Jr),we(document,"touchmove",Jr)},_offUpEvents:function(){var t=this.el.ownerDocument;we(t,"mouseup",this._onDrop),we(t,"touchend",this._onDrop),we(t,"pointerup",this._onDrop),we(t,"touchcancel",this._onDrop),we(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(It=qt(L),fr=qt(L,n.draggable),wt("drop",this,{evt:t}),De=L&&L.parentNode,It=qt(L),fr=qt(L,n.draggable),re.eventCanceled){this._nulling();return}Ki=!1,Ta=!1,as=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Vd(this.cloneId),Vd(this._dragStartId),this.nativeDraggable&&(we(document,"drop",this),we(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ns&&ne(document.body,"user-select",""),ne(L,"transform",""),t&&(Uo&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),he&&he.parentNode&&he.parentNode.removeChild(he),(Ae===De||Qe&&Qe.lastPutMode!=="clone")&&Re&&Re.parentNode&&Re.parentNode.removeChild(Re),L&&(this.nativeDraggable&&we(L,"dragend",this),_c(L),L.style["will-change"]="",Uo&&!Ki&&_t(L,Qe?Qe.options.ghostClass:this.options.ghostClass,!1),_t(L,this.options.chosenClass,!1),gt({sortable:this,name:"unchoose",toEl:De,newIndex:null,newDraggableIndex:null,originalEvent:t}),Ae!==De?(It>=0&&(gt({rootEl:De,name:"add",toEl:De,fromEl:Ae,originalEvent:t}),gt({sortable:this,name:"remove",toEl:De,originalEvent:t}),gt({rootEl:De,name:"sort",toEl:De,fromEl:Ae,originalEvent:t}),gt({sortable:this,name:"sort",toEl:De,originalEvent:t})),Qe&&Qe.save()):It!==eo&&It>=0&&(gt({sortable:this,name:"update",toEl:De,originalEvent:t}),gt({sortable:this,name:"sort",toEl:De,originalEvent:t})),re.active&&((It==null||It===-1)&&(It=eo,fr=is),gt({sortable:this,name:"end",toEl:De,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){wt("nulling",this),Ae=L=De=he=Zr=Re=tl=yr=Gr=en=Uo=It=fr=eo=is=Hi=ss=Qe=Sa=re.dragged=re.ghost=re.clone=re.active=null,Dl.forEach(function(t){t.checked=!0}),Dl.length=Oc=Ac=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":L&&(this._onDragOver(t),GO(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,r=0,i=n.length,o=this.options;r<i;r++)e=n[r],gn(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||eA(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(i,o){var s=r.children[o];gn(s,this.options.draggable,r,!1)&&(n[i]=s)},this),e&&this.captureAnimationState(),t.forEach(function(i){n[i]&&(r.removeChild(n[i]),r.appendChild(n[i]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return gn(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var r=Xs.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&ib(n)},destroy:function(){wt("destroy",this);var t=this.el;t[Rt]=null,we(t,"mousedown",this._onTapStart),we(t,"touchstart",this._onTapStart),we(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(we(t,"dragover",this),we(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Il.splice(Il.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!yr){if(wt("hideClone",this),re.eventCanceled)return;ne(Re,"display","none"),this.options.removeCloneOnHide&&Re.parentNode&&Re.parentNode.removeChild(Re),yr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(yr){if(wt("showClone",this),re.eventCanceled)return;L.parentNode==Ae&&!this.options.group.revertClone?Ae.insertBefore(Re,L):Zr?Ae.insertBefore(Re,Zr):Ae.appendChild(Re),this.options.group.revertClone&&this.animate(L,Re),ne(Re,"display",""),yr=!1}}};function GO(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Aa(t,e,n,r,i,o,s,a){var l,u=t[Rt],c=u.options.onMove,d;return window.CustomEvent&&!sr&&!Ys?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=r,l.related=i||e,l.relatedRect=o||qe(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),c&&(d=c.call(u,l,s)),d}function _c(t){t.draggable=!1}function JO(){Bd=!1}function YO(t,e,n){var r=qe(mo(n.el,0,n.options,!0)),i=10;return e?t.clientX<r.left-i||t.clientY<r.top&&t.clientX<r.right:t.clientY<r.top-i||t.clientY<r.bottom&&t.clientX<r.left}function XO(t,e,n){var r=qe(up(n.el,n.options.draggable)),i=10;return e?t.clientX>r.right+i||t.clientX<=r.right&&t.clientY>r.bottom&&t.clientX>=r.left:t.clientX>r.right&&t.clientY>r.top||t.clientX<=r.right&&t.clientY>r.bottom+i}function ZO(t,e,n,r,i,o,s,a){var l=r?t.clientY:t.clientX,u=r?n.height:n.width,c=r?n.top:n.left,d=r?n.bottom:n.right,h=!1;if(!s){if(a&&nl<u*i){if(!as&&(ss===1?l>c+u*o/2:l<d-u*o/2)&&(as=!0),as)h=!0;else if(ss===1?l<c+nl:l>d-nl)return-ss}else if(l>c+u*(1-i)/2&&l<d-u*(1-i)/2)return QO(e)}return h=h||s,h&&(l<c+u*o/2||l>d-u*o/2)?l>c+u/2?1:-1:0}function QO(t){return qt(L)<qt(t)?1:-1}function eA(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function tA(t){Dl.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&Dl.push(r)}}function rl(t){return setTimeout(t,0)}function Vd(t){return clearTimeout(t)}qu&&Ee(document,"touchmove",function(t){(re.active||Ki)&&t.cancelable&&t.preventDefault()});re.utils={on:Ee,off:we,css:ne,find:Zy,is:function(t,e){return!!gn(t,e,t,!1)},extend:LO,throttle:Qy,closest:gn,toggleClass:_t,clone:tb,index:qt,nextTick:rl,cancelNextTick:Vd,detectDirection:rb,getChild:mo};re.get=function(t){return t[Rt]};re.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(re.utils=On(On({},re.utils),r.utils)),Xs.mount(r)})};re.create=function(t,e){return new re(t,e)};re.version=RO;var Ve=[],Ko,$d,jd=!1,Ic,Dc,Rl,Go;function nA(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?Ee(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ee(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Ee(document,"touchmove",this._handleFallbackAutoScroll):Ee(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?we(document,"dragover",this._handleAutoScroll):(we(document,"pointermove",this._handleFallbackAutoScroll),we(document,"touchmove",this._handleFallbackAutoScroll),we(document,"mousemove",this._handleFallbackAutoScroll)),pm(),il(),BO()},nulling:function(){Rl=$d=Ko=jd=Go=Ic=Dc=null,Ve.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var r=this,i=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(i,o);if(Rl=e,n||this.options.forceAutoScrollFallback||Ys||sr||ns){Rc(e,this.options,s,n);var a=xr(s,!0);jd&&(!Go||i!==Ic||o!==Dc)&&(Go&&pm(),Go=setInterval(function(){var l=xr(document.elementFromPoint(i,o),!0);l!==a&&(a=l,il()),Rc(e,r.options,l,n)},10),Ic=i,Dc=o)}else{if(!this.options.bubbleScroll||xr(s,!0)===wn()){il();return}Rc(e,this.options,xr(s,!1),!1)}}},nr(t,{pluginName:"scroll",initializeByDefault:!0})}function il(){Ve.forEach(function(t){clearInterval(t.pid)}),Ve=[]}function pm(){clearInterval(Go)}var Rc=Qy(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,s=e.scrollSensitivity,a=e.scrollSpeed,l=wn(),u=!1,c;$d!==n&&($d=n,il(),Ko=e.scroll,c=e.scrollFn,Ko===!0&&(Ko=xr(n,!0)));var d=0,h=Ko;do{var p=h,f=qe(p),m=f.top,g=f.bottom,y=f.left,b=f.right,k=f.width,v=f.height,w=void 0,x=void 0,_=p.scrollWidth,A=p.scrollHeight,S=ne(p),O=p.scrollLeft,C=p.scrollTop;p===l?(w=k<_&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),x=v<A&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(w=k<_&&(S.overflowX==="auto"||S.overflowX==="scroll"),x=v<A&&(S.overflowY==="auto"||S.overflowY==="scroll"));var T=w&&(Math.abs(b-i)<=s&&O+k<_)-(Math.abs(y-i)<=s&&!!O),R=x&&(Math.abs(g-o)<=s&&C+v<A)-(Math.abs(m-o)<=s&&!!C);if(!Ve[d])for(var j=0;j<=d;j++)Ve[j]||(Ve[j]={});(Ve[d].vx!=T||Ve[d].vy!=R||Ve[d].el!==p)&&(Ve[d].el=p,Ve[d].vx=T,Ve[d].vy=R,clearInterval(Ve[d].pid),(T!=0||R!=0)&&(u=!0,Ve[d].pid=setInterval(function(){r&&this.layer===0&&re.active._onTouchMove(Rl);var H=Ve[this.layer].vy?Ve[this.layer].vy*a:0,$=Ve[this.layer].vx?Ve[this.layer].vx*a:0;typeof c=="function"&&c.call(re.dragged.parentNode[Rt],$,H,t,Rl,Ve[this.layer].el)!=="continue"||eb(Ve[this.layer].el,$,H)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==l&&(h=xr(h,!1)));jd=u}},30),ab=function(t){var e=t.originalEvent,n=t.putSortable,r=t.dragEl,i=t.activeSortable,o=t.dispatchSortableEvent,s=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||i;s();var u=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,c=document.elementFromPoint(u.clientX,u.clientY);a(),l&&!l.el.contains(c)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function cp(){}cp.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=mo(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(e,r):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:ab};nr(cp,{pluginName:"revertOnSpill"});function dp(){}dp.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,r=n||this.sortable;r.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),r.animateAll()},drop:ab};nr(dp,{pluginName:"removeOnSpill"});re.mount(new nA);re.mount(dp,cp);function Nc(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function fm(t,e,n){const r=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,r)}function rA(){return typeof window<"u"?window.console:global.console}const iA=rA();function oA(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const sA=/-(\w)/g,aA=oA(t=>t.replace(sA,(e,n)=>n.toUpperCase())),lb=["Start","Add","Remove","Update","End"],ub=["Choose","Unchoose","Sort","Filter","Clone"],cb=["Move"],lA=[cb,lb,ub].flatMap(t=>t).map(t=>`on${t}`),zd={manage:cb,manageAndEmit:lb,emit:ub};function uA(t){return lA.indexOf(t)!==-1}const cA=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function dA(t){return cA.includes(t)}function hA(t){return["transition-group","TransitionGroup"].includes(t)}function db(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function hb(t){return t.reduce((e,[n,r])=>(e[n]=r,e),{})}function pA({$attrs:t,componentData:e={}}){return{...hb(Object.entries(t).filter(([n,r])=>db(n))),...e}}function fA({$attrs:t,callBackBuilder:e}){const n=hb(pb(t));Object.entries(e).forEach(([i,o])=>{zd[i].forEach(s=>{n[`on${s}`]=o(s)})});const r=`[data-draggable]${n.draggable||""}`;return{...n,draggable:r}}function pb(t){return Object.entries(t).filter(([e,n])=>!db(e)).map(([e,n])=>[aA(e),n]).filter(([e,n])=>!uA(e))}const mm=({el:t})=>t,mA=(t,e)=>t.__draggable_context=e,gm=t=>t.__draggable_context;class gA{constructor({nodes:{header:e,default:n,footer:r},root:i,realList:o}){this.defaultNodes=n,this.children=[...e,...n,...r],this.externalComponent=i.externalComponent,this.rootTransition=i.transition,this.tag=i.tag,this.realList=o}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,n){const{tag:r,children:i,_isRootComponent:o}=this;return e(r,n,o?{default:()=>i}:i)}updated(){const{defaultNodes:e,realList:n}=this;e.forEach((r,i)=>{mA(mm(r),{element:n[i],index:i})})}getUnderlyingVm(e){return gm(e)}getVmIndexFromDomIndex(e,n){const{defaultNodes:r}=this,{length:i}=r,o=n.children,s=o.item(e);if(s===null)return i;const a=gm(s);if(a)return a.index;if(i===0)return 0;const l=mm(r[0]),u=[...o].findIndex(c=>c===l);return e<u?0:i}}function vA(t,e){const n=t[e];return n?n():[]}function yA({$slots:t,realList:e,getKey:n}){const r=e||[],[i,o]=["header","footer"].map(l=>vA(t,l)),{item:s}=t;if(!s)throw new Error("draggable element must have an item slot");const a=r.flatMap((l,u)=>s({element:l,index:u}).map(c=>(c.key=n(l),c.props={...c.props||{},"data-draggable":!0},c)));if(a.length!==r.length)throw new Error("Item slot must have only one child");return{header:i,footer:o,default:a}}function bA(t){const e=hA(t),n=!dA(t)&&!e;return{transition:e,externalComponent:n,tag:n?fx(t):e?mx:t}}function kA({$slots:t,tag:e,realList:n,getKey:r}){const i=yA({$slots:t,realList:n,getKey:r}),o=bA(e);return new gA({nodes:i,root:o,realList:n})}function fb(t,e){vi(()=>this.$emit(t.toLowerCase(),e))}function mb(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function xA(t){const e=mb.call(this,t);return(n,r)=>{e.call(this,n,r),fb.call(this,t,n)}}let Pc=null;const wA={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},EA=["update:modelValue","change",...[...zd.manageAndEmit,...zd.emit].map(t=>t.toLowerCase())],gb=ie({name:"draggable",inheritAttrs:!1,props:wA,emits:EA,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:r,realList:i,getKey:o}=this,s=kA({$slots:t,tag:n,realList:i,getKey:o});this.componentStructure=s;const a=pA({$attrs:e,componentData:r});return s.render(Es,a)}catch(t){return this.error=!0,Es("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&iA.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:t,$el:e,componentStructure:n}=this;n.updated();const r=fA({$attrs:t,callBackBuilder:{manageAndEmit:o=>xA.call(this,o),emit:o=>fb.bind(this,o),manage:o=>mb.call(this,o)}}),i=e.nodeType===1?e:e.parentElement;this._sortable=new re(i,r),this.targetDomElement=i,i.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:t}=this;return t||this.modelValue},getKey(){const{itemKey:t}=this;return typeof t=="function"?t:e=>e[t]}},watch:{$attrs:{handler(t){const{_sortable:e}=this;e&&pb(t).forEach(([n,r])=>{e.option(n,r)})},deep:!0}},methods:{getUnderlyingVm(t){return this.componentStructure.getUnderlyingVm(t)||null},getUnderlyingPotencialDraggableComponent(t){return t.__draggable_component__},emitChanges(t){vi(()=>this.$emit("change",t))},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=r=>r.splice(e,0,r.splice(t,1)[0]);this.alterList(n)},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const r=n.realList,i={list:r,component:n};return t!==e&&r?{...n.getUnderlyingVm(e)||{},...i}:i},getVmIndexFromDomIndex(t){return this.componentStructure.getVmIndexFromDomIndex(t,this.targetDomElement)},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),Pc=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;Nc(t.item);const n=this.getVmIndexFromDomIndex(t.newIndex);this.spliceList(n,0,e);const r={element:e,newIndex:n};this.emitChanges({added:r})},onDragRemove(t){if(fm(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){Nc(t.clone);return}const{index:e,element:n}=this.context;this.spliceList(e,1);const r={element:n,oldIndex:e};this.emitChanges({removed:r})},onDragUpdate(t){Nc(t.item),fm(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndexFromDomIndex(t.newIndex);this.updatePosition(e,n);const r={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter(o=>o.style.display!=="none"),r=n.indexOf(e.related),i=t.component.getVmIndexFromDomIndex(r);return n.indexOf(Pc)!==-1||!e.willInsertAfter?i:i+1},onDragMove(t,e){const{move:n,realList:r}=this;if(!n||!r)return!0;const i=this.getRelatedContextFromMoveEvent(t),o=this.computeFutureIndex(i,t),s={...this.context,futureIndex:o},a={...t,relatedContext:i,draggedContext:s};return n(a,e)},onDragEnd(){Pc=null}}}),CA={key:0,class:"k-media__label-wrapper"},SA={key:1,class:"k-media__sublabel"},fV=ie({__name:"Media",props:{modelValue:{},types:{default:()=>["Image"]},label:{},sublabel:{},multiple:{type:Boolean},sortable:{type:Boolean,default:!0},upload:{type:Function,default:()=>(t,e,n)=>(console.warn("[@kvass-ui/media]: You need to setup the upload function before using this component!"),e(50),new Promise((r,i)=>{let o=new FileReader;o.onloadend=function(){r({url:o.result,type:t.type})},o.readAsDataURL(t)}))},size:{default:"cover"},placement:{default:"outside"},uploadOptions:{default:()=>({})},description:{type:Boolean,default:!0},dropMessage:{default:"Drag an image here or <b>browse</b> to upload."},type:{default:"file"},accept:{default:"image/*"},labels:{default:()=>({cancel:"Cancel",save:"Save",selectMessage:"Select a type from the menu",select:"Select",descriptionPlaceholder:"Add caption...",image:{createLabel:"Image"}})},required:{type:Boolean},disabled:{type:Boolean},thumbnailSize:{default:"4rem"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=Q(null),o=P(()=>i.value?n.modelValue instanceof Array?n.modelValue.find(p=>{var f;return p.url===((f=i.value)==null?void 0:f.url)}):n.modelValue:null),s=P({get(){return n.modelValue?(n.modelValue instanceof Array?n.modelValue:[n.modelValue]).map(p=>{var f;return{...p,selected:((f=i.value)==null?void 0:f.url)===p.url,typeConfig:a.value.find(m=>m.condition(p))}}):[]},set(p){n.multiple&&r("update:modelValue",p.map(f=>{let{selected:m,typeConfig:g,...y}=f;return y}))}}),a=P(()=>n.types.map(p=>typeof p=="string"?MO[p]:p).filter(Boolean));Fe(()=>n.modelValue,(p,f)=>{(!i.value||!s.value.find(m=>{var g;return m.url===((g=i.value)==null?void 0:g.url)}))&&l()},{immediate:!0});function l(p){return!n.modelValue||n.multiple&&!n.modelValue.length?i.value=null:p?i.value=p:i.value=s.value[0]}function u(p){var f;let{selected:m,typeConfig:g,...y}=p;r("update:modelValue",n.multiple?(n.modelValue||[]).filter(b=>b.url!==y.url):null),((f=i?.value)==null?void 0:f.url)===p.url&&vi(()=>{l()})}function c(p){r("update:modelValue",n.multiple?[...n.modelValue||[],p]:p),vi(()=>l(s.value.find(f=>f.url===p.url)))}function d(p){r("update:modelValue",p)}const h=Dn("k-media",{variants:{placement:{outside:"k-media--placement-outside",inside:"k-media--placement-inside"}}});return(p,f)=>(E(),I("div",{class:Me(z(h)({placement:p.placement}))},[p.label||p.sublabel||p.$slots.sublabel||p.$slots.label?(E(),I("div",CA,[p.label||p.$slots.label?(E(),I("label",{key:0,class:Me(["k-media__label",{"k-media__label-required":p.required}])},[B(p.$slots,"label",{},()=>[ct(ce(p.label),1)])],2)):F("",!0),p.sublabel||p.$slots.sublabel?(E(),I("span",SA,[B(p.$slots,"sublabel",{},()=>[ct(ce(p.sublabel),1)])])):F("",!0)])):F("",!0),ke(CO,{type:p.type,accept:p.accept,ref:"input",value:p.modelValue,multiple:p.multiple,required:p.required,onSelect:l,onRemove:u,onInput:d,selected:i.value,disabled:p.disabled,"upload-options":p.uploadOptions,upload:p.upload,dropMessage:p.dropMessage},Us({default:te(({openFileWindow:m})=>[ke(hO,{onOpenFileWindow:m,ref:"typeSelector",value:a.value,onAdd:c,labels:p.labels,upload:p.upload},null,8,["onOpenFileWindow","value","labels","upload"])]),"drop-message":te(()=>[B(p.$slots,"drop-message")]),"custom-message":te(()=>[B(p.$slots,"custom-message")]),_:2},[i.value?{name:"preview",fn:te(()=>[p.description&&o.value?(E(),U(pO,{key:0,modelValue:o.value.description,"onUpdate:modelValue":f[0]||(f[0]=m=>o.value.description=m),disabled:p.disabled,placeholder:p.labels.descriptionPlaceholder},null,8,["modelValue","disabled","placeholder"])):F("",!0),(E(),U(Ye(i.value.typeConfig.components.Preview),{value:i.value,size:p.size},null,8,["value","size"]))]),key:"0"}:void 0]),1032,["type","accept","value","multiple","required","selected","disabled","upload-options","upload","dropMessage"]),B(p.$slots,"bottom"),p.multiple?(E(),U(z(gb),{key:1,modelValue:s.value,"onUpdate:modelValue":f[1]||(f[1]=m=>s.value=m),sort:p.sortable&&!p.disabled,class:"k-media__thumbnails","item-key":"url",animation:200},{item:te(({element:m,index:g})=>[(E(),U(uO,{size:p.thumbnailSize,key:m.url,value:m,disabled:p.disabled,onClick:y=>i.value=m,onDelete:y=>u(m)},null,8,["size","value","disabled","onClick","onDelete"]))]),_:1},8,["modelValue","sort"])):F("",!0)],2))}});var TA=Tr("switch").parts("root","label","control","thumb"),Ma=TA.build(),Ue=Ks({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`switch:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`switch:${t.id}:label`},getThumbId:t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`switch:${t.id}:thumb`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`switch:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`switch:${t.id}:input`},getRootEl:t=>Ue.getById(t,Ue.getRootId(t)),getHiddenInputEl:t=>Ue.getById(t,Ue.getHiddenInputId(t))});function OA(t,e,n){const r=t.context.isDisabled,i=t.context.readOnly,o=t.context.checked,s=!r&&t.context.focused,a=!r&&t.context.focusVisible,l={"data-active":Z(t.context.active),"data-focus":Z(s),"data-focus-visible":Z(a),"data-readonly":Z(i),"data-hover":Z(t.context.hovered),"data-disabled":Z(r),"data-state":t.context.checked?"checked":"unchecked","data-invalid":Z(t.context.invalid)};return{checked:o,disabled:r,focused:s,setChecked(u){e({type:"CHECKED.SET",checked:u,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:o,isTrusted:!1})},getRootProps(){return n.label({...Ma.root.attrs,...l,dir:t.context.dir,id:Ue.getRootId(t.context),htmlFor:Ue.getHiddenInputId(t.context),onPointerMove(){r||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){r||e({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(u){r||Qn(u)===Ue.getHiddenInputEl(t.context)&&u.stopPropagation()}})},getLabelProps(){return n.element({...Ma.label.attrs,...l,dir:t.context.dir,id:Ue.getLabelId(t.context)})},getThumbProps(){return n.element({...Ma.thumb.attrs,...l,dir:t.context.dir,id:Ue.getThumbId(t.context),"aria-hidden":!0})},getControlProps(){return n.element({...Ma.control.attrs,...l,dir:t.context.dir,id:Ue.getControlId(t.context),"aria-hidden":!0})},getHiddenInputProps(){return n.input({id:Ue.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:o,disabled:r,"aria-labelledby":Ue.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:Hh,onFocus(){const u=Ts();e({type:"CONTEXT.SET",context:{focused:!0,focusVisible:u}})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(u){if(i){u.preventDefault();return}const c=u.currentTarget.checked;e({type:"CHECKED.SET",checked:c,isTrusted:!0})}})}}}var{not:vm}=Uh;function AA(t){const e=er(t);return Gs({id:"switch",initial:"ready",context:{checked:!1,label:"switch",value:"on",disabled:!1,...e,fieldsetDisabled:!1,focusVisible:!1},computed:{isDisabled:n=>n.disabled||n.fieldsetDisabled},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:vm("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:vm("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}}},{guards:{isTrusted:(n,r)=>!!r.isTrusted},activities:{trackPressEvent(n){if(!n.isDisabled)return ay({pointerNode:Ue.getRootEl(n),keyboardNode:Ue.getHiddenInputEl(n),isValidKey:r=>r.key===" ",onPress:()=>n.active=!1,onPressStart:()=>n.active=!0,onPressEnd:()=>n.active=!1})},trackFocusVisible(n){if(!n.isDisabled)return qh({root:Ue.getRootNode(n)})},trackFormControlState(n,r,{send:i,initialContext:o}){return Iu(Ue.getHiddenInputEl(n),{onFieldsetDisabledChange(s){n.fieldsetDisabled=s},onFormReset(){i({type:"CHECKED.SET",checked:!!o.checked,src:"form-reset"})}})}},actions:{setContext(n,r){Object.assign(n,r.context)},syncInputElement(n){const r=Ue.getHiddenInputEl(n);r&&(r.checked=!!n.checked)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,r){ym.checked(n,r.checked)},toggleChecked(n,r){ym.checked(n,!n.checked)},dispatchChangeEvent(n){const r=Ue.getHiddenInputEl(n);Jh(r,{checked:n.checked})}}})}var MA={change:t=>{var e;(e=t.onCheckedChange)==null||e.call(t,{checked:t.checked})}},ym={checked:(t,e)=>{Or(t.checked,e)||(t.checked=e,MA.change(t))}};Mi()(["checked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const _A={key:0,class:"k-switch__label"},mV=ie({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},labels:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i={id:Sn(),checked:n.modelValue,disabled:n.disabled,onCheckedChange:({checked:l})=>r("update:modelValue",l)},[o,s]=Ii(AA(i),{}),a=P(()=>OA(o.value,s,_i));return Fe(()=>n.modelValue,()=>{if(a.value.checked!==n.modelValue)return a.value.setChecked(n.modelValue)}),(l,u)=>(E(),I("label",se({class:"k-switch"},a.value.getRootProps),[W("input",Se(_e(a.value.getHiddenInputProps())),null,16),W("span",Se(_e(a.value.getControlProps())),[W("span",Se(_e(a.value.getThumbProps())),null,16)],16),W("span",Se(_e(a.value.getLabelProps())),[l.labels?(E(),I("span",_A,ce(a.value.checked?l.labels.on:l.labels.off),1)):F("",!0)],16)],16))}}),gV=ie({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(t,{emit:e}){const n=t,r=e,i=Q(!1);function o(u){const c=u[0];c.isIntersecting&&(i.value=!0,vi(()=>{r("intersect",c),l()}))}const s=Q(),a=Q();or(()=>{s.value=new IntersectionObserver(o,{root:n.observerRoot,threshold:n.threshold}),s.value.observe(a.value)}),Mo(()=>{l()});function l(){s.value&&s.value.disconnect()}return(u,c)=>(E(),U(Ye(u.wrapperTag),{ref_key:"rootRef",ref:a,class:"k-lazyload"},{default:te(()=>[i.value?B(u.$slots,"default",{key:0}):B(u.$slots,"placeholder",{key:1})]),_:3},512))}}),IA={class:"k-file-uploader__bar"},DA={class:"k-file-uploader__meta"},RA={key:0},NA={key:1},PA=ie({__name:"Uploader",props:{value:{},bytes:{},current:{default:1},total:{default:1}},setup(t){const e=t,n=P(()=>e.total>1),r=P(()=>ap(e.bytes)),i=P(()=>Math.floor(e.value));return(o,s)=>(E(),U(bi,{class:"k-file-uploader",align:"center",justify:"space-between",gap:"0rem"},{default:te(()=>[W("div",null,ce(i.value)+" %",1),W("div",IA,[W("div",{class:"k-file-uploader__bar-value",style:In({width:o.value+"%"})},null,4)]),W("div",DA,[n.value?(E(),I("div",RA,ce(o.current)+" / "+ce(o.total),1)):F("",!0),o.bytes?(E(),I("div",NA,"("+ce(r.value)+")",1)):F("",!0)])]),_:1}))}}),FA=["innerHTML"],LA=ie({__name:"SlotHandler",props:{value:{}},setup(t){const e=t,n=P(()=>typeof e.value=="string"?e.value:void 0),r=P(()=>typeof e.value=="string"?"div":e.value);return(i,o)=>(E(),U(Ye(r.value),Se(_e(i.$attrs)),{default:te(()=>[n.value?(E(),I("span",{key:0,innerHTML:n.value},null,8,FA)):F("",!0)]),_:1},16))}}),BA={class:"k-file-droparea__instruction"},VA=["accept","required","disabled","multiple"],$A=ie({__name:"DropArea",props:{value:{},multiple:{type:Boolean},upload:{},uploadOptions:{},accept:{},dropMessage:{},disabled:{type:Boolean},required:{type:Boolean},rename:{type:Boolean},labels:{}},emits:["input"],setup(t,{emit:e}){const n=t,r=e,i=Q(!1),o=Q(!0),s=Q(),a=P(()=>!!(!n.required||n.value)),l=P(()=>n.disabled),u=P(()=>!l.value&&!h.total),c=P(()=>aO(n.accept)),{run:d,queue:h}=new Gy(n);function p(k){return d(k).then(v=>{!v||!v.length||r("input",n.multiple?[...n.value||[],...v]:v[0])})}async function f(k){if(l.value)return;let v=k.target.files||[];n.uploadOptions.preTransform&&(v=await n.uploadOptions.preTransform(k)),p(v),s.value&&(s.value.value="")}async function m(k){var v;if(l.value||!s.value)return;if(k.preventDefault(),!o.value)return y();y();let w=(v=k.dataTransfer)==null?void 0:v.files;w!=null&&w.length&&(n.uploadOptions.preTransform&&(w=await n.uploadOptions.preTransform(k)),w!=null&&w.length&&(s.value.files=k.dataTransfer.files,s.value.dispatchEvent(new InputEvent("input")),p(w)))}function g(k){if(l.value||!k.dataTransfer)return;const v=Array.from(k.dataTransfer.items).every(x=>lp(x,n.accept)),w=n.multiple?!0:k.dataTransfer.items.length===1;o.value=v&&w,i.value=!0,k.preventDefault()}function y(){o.value=!0,i.value=!1}const b=Dn("k-file-droparea",{variants:{active:{true:"k-file-droparea--active"},invalid:{true:"k-file-droparea--invalid"},disabled:{true:"k-file-droparea--disabled"}}});return(k,v)=>(E(),I(Le,null,[W("div",{class:Me(z(b)({active:i.value,invalid:!o.value,disabled:l.value})),onDrop:m,onDragover:g,onDragleave:y},[B(k.$slots,"preview"),W("div",BA,[u.value?(E(),I("input",{key:0,type:"file",accept:Array.isArray(k.accept)?k.accept.join(","):k.accept,required:a.value,ref_key:"input",ref:s,onChange:f,disabled:!u.value,multiple:k.multiple,class:"k-file-droparea__input"},null,40,VA)):F("",!0),o.value?B(k.$slots,"drop-message",{key:1,extensions:c.value},()=>[ke(LA,{value:k.dropMessage,extensions:c.value},null,8,["value","extensions"])]):(E(),U(z(We),{key:2,icon:"fa-pro-light:ban",style:{"font-size":"2rem"}})),B(k.$slots,"custom-message")])],34),z(h).total?(E(),U(PA,{key:0,value:z(h).progress,bytes:z(h).bytes,current:z(h).counter,total:z(h).total},null,8,["value","bytes","current","total"])):F("",!0)],64))}});var ol=(t,e=[])=>({parts:(...n)=>{if(jA(e))return ol(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>ol(t,[...e,...n]),rename:n=>ol(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${qi(t)}"][data-part="${qi(r)}"]`,`& [data-scope="${qi(t)}"][data-part="${qi(r)}"]`].join(", "),attrs:{"data-scope":qi(t),"data-part":qi(r)}}}),{})}),qi=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),jA=t=>t.length===0,Wu=t=>typeof t=="object"&&t!==null,_a=t=>t?"":void 0,zA=1,HA=9,qA=11,Hd=t=>Wu(t)&&t.nodeType===zA&&typeof t.nodeName=="string",vb=t=>Wu(t)&&t.nodeType===HA,WA=t=>Wu(t)&&t===t.window,UA=t=>Wu(t)&&t.nodeType!==void 0,yb=t=>UA(t)&&t.nodeType===qA&&"host"in t;function KA(t,e){var n;if(!t||!e||!Hd(t)||!Hd(e))return!1;const r=(n=e.getRootNode)==null?void 0:n.call(e);if(t===e||t.contains(e))return!0;if(r&&yb(r)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function GA(t){return vb(t)?t:WA(t)?t.document:t?.ownerDocument??document}function bb(t){var e;return yb(t)?bb(t.host):vb(t)?t.defaultView??window:Hd(t)?((e=t.ownerDocument)==null?void 0:e.defaultView)??window:window}function JA(t){let e=t.activeElement;for(;e!=null&&e.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}var kb=()=>typeof document<"u";function YA(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var XA=t=>kb()&&t.test(YA()),ZA=t=>kb()&&t.test(navigator.vendor),QA=()=>eM()&&ZA(/apple/i),eM=()=>XA(/mac|iphone|ipad|ipod/i);function tM(t){var e,n,r;return((e=t.composedPath)==null?void 0:e.call(t))??((r=(n=t.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n))}function nM(t){const e=tM(t);return e?.[0]??t.target}var bm=t=>KA(t.currentTarget,nM(t)),rM={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},km={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function iM(t,e={}){const{dir:n="ltr",orientation:r="horizontal"}=e;let i=t.key;return i=rM[i]??i,n==="rtl"&&r==="horizontal"&&i in km&&(i=km[i]),i}function oM(t,e){const{type:n="HTMLInputElement",property:r="value"}=e,i=bb(t)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function sM(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function aM(t,e,n="value"){var r;const i=sM(t);i&&((r=oM(t,{type:i,property:n}).set)==null||r.call(t,e)),t.setAttribute(n,e)}function Ia(t){const e=globalThis.requestAnimationFrame(t);return()=>{globalThis.cancelAnimationFrame(e)}}function lM(t,e){return Array.from(t?.querySelectorAll(e)??[])}var xb=t=>t.id;function uM(t,e,n=xb){return t.find(r=>n(r)===e)}function wb(t,e,n=xb){const r=uM(t,e,n);return r?t.indexOf(r):-1}function cM(t,e,n=!0){let r=wb(t,e);return r=n?(r+1)%t.length:Math.min(r+1,t.length-1),t[r]}function dM(t,e,n=!0){let r=wb(t,e);return r===-1?n?t[t.length-1]:null:(r=n?(r-1+t.length)%t.length:Math.max(0,r-1),t[r])}function hM(t){const e={getRootNode:n=>{var r;return((r=n.getRootNode)==null?void 0:r.call(n))??document},getDoc:n=>GA(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>JA(e.getRootNode(n)),isActiveElement:(n,r)=>r===e.getActiveElement(n),getById:(n,r)=>e.getRootNode(n).getElementById(r),setValue:(n,r)=>{n==null||r==null||aM(n,r.toString())}};return{...e,...t}}var pM=t=>t[0],fM=t=>t[t.length-1],mM=(t,...e)=>t.concat(e),gM=(t,...e)=>t.filter(n=>!e.includes(n));function vM(t){for(;t.length>0;)t.pop();return t}var xm=t=>t?.constructor.name==="Array",yM=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Uu(t[n],e[n]))return!1;return!0},Uu=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(xm(t)&&xm(e))return yM(Array.from(t),Array.from(e));if(typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(e??Object.create(null)),r=n.length;for(let i=0;i<r;i++)if(!Reflect.has(t,n[i]))return!1;for(let i=0;i<r;i++){const o=n[i];if(!Uu(t[o],e[o]))return!1}return!0},wm=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Wn=t=>t,bM=()=>{},Em=(()=>{let t=0;return()=>(t++,t.toString(36))})(),Nl=t=>Array.isArray(t),Eb=t=>t!=null&&typeof t=="object",sl=t=>Eb(t)&&!Nl(t),kM=t=>typeof t=="number"&&!Number.isNaN(t),yn=t=>typeof t=="string",Pl=t=>typeof t=="function",Cb=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),xM=t=>Object.prototype.toString.call(t),Sb=Function.prototype.toString,wM=Sb.call(Object),Da=t=>{if(!Eb(t)||xM(t)!="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Cb(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Sb.call(n)==wM};function Ku(t){if(!EM(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(r=>typeof r=="string"),n={};for(const r of e){const i=t[r];i!==void 0&&(n[r]=Ku(i))}return n}var EM=t=>t&&typeof t=="object"&&t.constructor===Object;function Fc(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function al(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}const CM=Symbol(),Cm=Object.getPrototypeOf,qd=new WeakMap,SM=t=>t&&(qd.has(t)?qd.get(t):Cm(t)===Object.prototype||Cm(t)===Array.prototype),TM=t=>SM(t)&&t[CM]||null,Sm=(t,e=!0)=>{qd.set(t,e)};function OM(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Tb(t,e){const n=OM();return n?(n[t]||(n[t]=e()),n[t]):e()}var ls=Tb("__zag__refSet",()=>new WeakSet),AM=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&"props"in t,MM=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,_M=t=>typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeName=="string",IM=t=>AM(t)||MM(t)||_M(t),Wd=t=>t!==null&&typeof t=="object",Ud=t=>Wd(t)&&!ls.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!IM(t)&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise);function Tm(t,e,n){typeof n.value=="object"&&!Ud(n.value)&&(n.value=ai(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ai(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(Object.getPrototypeOf(t)||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ai(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(ai(a),ai(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ai(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o==="[object Blob]"?i=t.slice():o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)Tm(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||Tm(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}var ni=Tb("__zag__proxyStateMap",()=>new WeakMap),DM=(t=Object.is,e=(a,l)=>new Proxy(a,l),n=new WeakMap,r=(a,l)=>{const u=n.get(a);if(u?.[0]===l)return u[1];const c=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Sm(c,!0),n.set(a,[l,c]),Reflect.ownKeys(a).forEach(d=>{const h=Reflect.get(a,d);ls.has(h)?(Sm(h,!1),c[d]=h):ni.has(h)?c[d]=to(h):c[d]=h}),Object.freeze(c)},i=new WeakMap,o=[1,1],s=a=>{if(!Wd(a))throw new Error("object required");const l=i.get(a);if(l)return l;let u=o[0];const c=new Set,d=(x,_=++o[0])=>{u!==_&&(u=_,c.forEach(A=>A(x,_)))};let h=o[1];const p=(x=++o[1])=>(h!==x&&!c.size&&(h=x,m.forEach(([_])=>{const A=_[1](x);A>u&&(u=A)})),u),f=x=>(_,A)=>{const S=[..._];S[1]=[x,...S[1]],d(S,A)},m=new Map,g=(x,_)=>{if(c.size){const A=_[3](f(x));m.set(x,[_,A])}else m.set(x,[_])},y=x=>{var _;const A=m.get(x);A&&(m.delete(x),(_=A[1])==null||_.call(A))},b=x=>(c.add(x),c.size===1&&m.forEach(([_,A],S)=>{const O=_[3](f(S));m.set(S,[_,O])}),()=>{c.delete(x),c.size===0&&m.forEach(([_,A],S)=>{A&&(A(),m.set(S,[_]))})}),k=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),v=e(k,{deleteProperty(x,_){const A=Reflect.get(x,_);y(_);const S=Reflect.deleteProperty(x,_);return S&&d(["delete",[_],A]),S},set(x,_,A,S){var O;const C=Reflect.has(x,_),T=Reflect.get(x,_,S);if(C&&(t(T,A)||i.has(A)&&t(T,i.get(A))))return!0;y(_),Wd(A)&&(A=TM(A)||A);let R=A;if(!((O=Object.getOwnPropertyDescriptor(x,_))!=null&&O.set)){!ni.has(A)&&Ud(A)&&(R=hp(A));const j=!ls.has(R)&&ni.get(R);j&&g(_,j)}return Reflect.set(x,_,R,S),d(["set",[_],A,T]),!0}});i.set(a,v);const w=[k,p,r,b];return ni.set(v,w),Reflect.ownKeys(a).forEach(x=>{const _=Object.getOwnPropertyDescriptor(a,x);_.get||_.set?Object.defineProperty(k,x,_):v[x]=a[x]}),v})=>[s,ni,ls,t,e,Ud,n,r,i,o],[RM]=DM();function hp(t={}){return RM(t)}function Om(t,e,n){const r=ni.get(t);let i;const o=[],s=r[3];let a=!1;const l=s(u=>{if(o.push(u),n){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,l()}}function to(t){const e=ni.get(t),[n,r,i]=e;return i(n,r())}function Am(t){return ls.add(t),t}function NM(t,e){Object.keys(e).forEach(r=>{if(Object.getOwnPropertyDescriptor(t,r))throw new Error("object property already defined");const i=e[r],{get:o,set:s}=typeof i=="function"?{get:i}:i,a={};a.get=()=>o(to(n)),s&&(a.set=l=>s(n,l)),Object.defineProperty(t,r,a)});const n=hp(t);return n}var PM=Object.defineProperty,FM=(t,e,n)=>e in t?PM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J=(t,e,n)=>FM(t,typeof e!="symbol"?e+"":e,n);function Ob(t,...e){if(!Da(t))throw new TypeError("Source argument must be a plain object");for(const n of e){if(!Da(n))continue;const r=Ku(n);for(const i in r){if(!Object.prototype.hasOwnProperty.call(r,i)||i==="__proto__"||i==="constructor"||i==="prototype")continue;const o=t[i],s=n[i];Da(s)?t[i]=Da(o)?Ob(o,s):{...s}:t[i]=s}}return t}function tn(t){return yn(t)?{type:t}:t}function hr(t){return t?Nl(t)?t.slice():[t]:[]}function Ab(t){return sl(t)&&t.predicate!=null}var LM=()=>!0;function Mb(t,e,n,r){return i=>{var o;return yn(i)?!!((o=t[i])!=null&&o.call(t,e,n,r)):Pl(i)?i(e,n,r):i.predicate(t)(e,n,r)}}function BM(...t){return{predicate:e=>(n,r,i)=>t.map(Mb(e,n,r,i)).every(Boolean)}}function VM(t){return{predicate:e=>(n,r,i)=>!Mb(e,n,r,i)(t)}}var $M={and:BM,not:VM};function _b(t,e){return t=t??LM,(n,r,i)=>{if(yn(t)){const o=e[t];return Pl(o)?o(n,r,i):o}return Ab(t)?t.predicate(e)(n,r,i):t?.(n,r,i)}}function Lc(t,e){return(n,r,i)=>Ab(t)?t.predicate(e)(n,r,i):t}function jM(t){var e,n;const r=t.computed??Wn({}),i=t.context??Wn({}),o=t.initial?(n=(e=t.states)==null?void 0:e[t.initial])==null?void 0:n.tags:[],s=hp({value:t.initial??"",previousValue:"",event:Wn({}),previousEvent:Wn({}),context:NM(i,r),done:!1,tags:o??[],hasTag(a){return this.tags.includes(a)},matches(...a){return a.includes(this.value)},can(a){return Wn(this).nextEvents.includes(a)},get nextEvents(){var a,l;const u=((l=(a=t.states)==null?void 0:a[this.value])==null?void 0:l.on)??{},c=t?.on??{};return Object.keys({...u,...c})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Wn(s)}function jo(t,e){return(n,r)=>{if(kM(t))return t;if(Pl(t))return t(n,r);if(yn(t)){const i=Number.parseFloat(t);if(!Number.isNaN(i))return i;if(e){const o=e?.[t];return al(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),Pl(o)?o(n,r):o}}}}function zM(t){return yn(t)?{target:t}:t}function HM(t,e){return(n,r,i)=>hr(t).map(zM).find(o=>_b(o.guard,e)(n,r,i)??o.target??o.actions)}var qM=class{constructor(t,e){var n,r,i,o,s;J(this,"status","Not Started"),J(this,"state"),J(this,"initialState"),J(this,"initialContext"),J(this,"id"),J(this,"type","machine"),J(this,"activityEvents",new Map),J(this,"delayedEvents",new Map),J(this,"stateListeners",new Set),J(this,"doneListeners",new Set),J(this,"contextWatchers",new Set),J(this,"removeStateListener",bM),J(this,"parent"),J(this,"children",new Map),J(this,"guardMap"),J(this,"actionMap"),J(this,"delayMap"),J(this,"activityMap"),J(this,"sync"),J(this,"options"),J(this,"config"),J(this,"_created",()=>{if(!this.config.created)return;const a=tn("machine.created");this.executeActions(this.config.created,a)}),J(this,"start",a=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Om(this.state,()=>{this.stateListeners.forEach(p=>{p(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(tn("machine.start"),hr(this.config.activities),"machine.start"),this.executeActions(this.config.entry,tn("machine.start"));const l=tn("machine.init"),u=sl(a)?a.value:a,c=sl(a)?a.context:void 0;c&&this.setContext(c);const d={target:u??this.config.initial},h=this.getNextStateInfo(d,l);return this.initialState=h,this.performStateChangeEffects(this.state.value,h,l),this}),J(this,"setupContextWatchers",()=>{const{watch:a}=this.config;if(!a)return;let l=to(this.state.context);const u=Om(this.state.context,()=>{var c;const d=to(this.state.context);for(const[h,p]of Object.entries(a))(((c=this.options.compareFns)==null?void 0:c[h])??Object.is)(l[h],d[h])||this.executeActions(p,this.state.event);l=d});this.contextWatchers.add(u)}),J(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,tn("machine.stop")),this.executeActions(this.config.exit,tn("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),J(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),J(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(a=>a()),this.contextWatchers.clear()}),J(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(a=>{a.forEach(l=>l())}),this.delayedEvents.clear()}),J(this,"stopActivities",a=>{var l,u;a?((l=this.activityEvents.get(a))==null||l.forEach(c=>c()),(u=this.activityEvents.get(a))==null||u.clear(),this.activityEvents.delete(a)):(this.activityEvents.forEach(c=>{c.forEach(d=>d()),c.clear()}),this.activityEvents.clear())}),J(this,"sendChild",(a,l)=>{const u=tn(a),c=wm(l,this.contextSnapshot),d=this.children.get(c);d||al(`[@zag-js/core] Cannot send '${u.type}' event to unknown child`),d.send(u)}),J(this,"stopChild",a=>{this.children.has(a)||al(`[@zag-js/core > stop-child] Cannot stop unknown child ${a}`),this.children.get(a).stop(),this.children.delete(a)}),J(this,"removeChild",a=>{this.children.delete(a)}),J(this,"stopChildren",()=>{this.children.forEach(a=>a.stop()),this.children.clear()}),J(this,"setParent",a=>{this.parent=a}),J(this,"spawn",(a,l)=>{const u=wm(a);return l&&(u.id=l),u.type="machine.actor",u.setParent(this),this.children.set(u.id,Wn(u)),u.onDone(()=>{this.removeChild(u.id)}).start(),Wn(Am(u))}),J(this,"stopActivity",a=>{var l;if(!this.state.value)return;const u=this.activityEvents.get(this.state.value);(l=u?.get(a))==null||l(),u?.delete(a)}),J(this,"addActivityCleanup",(a,l,u)=>{var c;a&&(this.activityEvents.has(a)?(c=this.activityEvents.get(a))==null||c.set(l,u):this.activityEvents.set(a,new Map([[l,u]])))}),J(this,"setState",a=>{this.state.previousValue=this.state.value,this.state.value=a;const l=this.getStateNode(a);a==null?vM(this.state.tags):this.state.tags=hr(l?.tags)}),J(this,"setContext",a=>{a&&Ob(this.state.context,a)}),J(this,"setOptions",a=>{const l=Ku(a);this.actionMap={...this.actionMap,...l.actions},this.delayMap={...this.delayMap,...l.delays},this.activityMap={...this.activityMap,...l.activities},this.guardMap={...this.guardMap,...l.guards}}),J(this,"getStateNode",a=>{var l;if(a)return(l=this.config.states)==null?void 0:l[a]}),J(this,"getNextStateInfo",(a,l)=>{const u=this.determineTransition(a,l),c=!(u!=null&&u.target),d=u?.target??this.state.value,h=this.state.value!==d,p=this.getStateNode(d),f={reenter:!c&&!h&&!(u!=null&&u.internal),transition:u,stateNode:p,target:d,changed:h};return this.log("NextState:",`[${l.type}]`,this.state.value,"---->",f.target),f}),J(this,"getAfterActions",(a,l)=>{let u;const c=this.state.value;return{entry:()=>{u=globalThis.setTimeout(()=>{const d=this.getNextStateInfo(a,this.state.event);this.performStateChangeEffects(c,d,this.state.event)},l)},exit:()=>{globalThis.clearTimeout(u)}}}),J(this,"getDelayedEventActions",a=>{const l=this.getStateNode(a),u=this.state.event;if(!l||!l.after)return;const c=[],d=[];if(Nl(l.after)){const h=this.determineTransition(l.after,u);if(!h)return;if(!Cb(h,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(h)}`);const p=jo(h.delay,this.delayMap)(this.contextSnapshot,u),f=this.getAfterActions(h,p);return c.push(f.entry),d.push(f.exit),{entries:c,exits:d}}if(sl(l.after))for(const h in l.after){const p=l.after[h],f=jo(h,this.delayMap)(this.contextSnapshot,u),m=this.getAfterActions(p,f);c.push(m.entry),d.push(m.exit)}return{entries:c,exits:d}}),J(this,"executeActions",(a,l)=>{var u;const c=Lc(a,this.guardMap)(this.contextSnapshot,l,this.guardMeta);for(const d of hr(c)){const h=yn(d)?(u=this.actionMap)==null?void 0:u[d]:d;Fc(yn(d)&&!h,`[@zag-js/core > execute-actions] No implementation found for action: \`${d}\``),h?.(this.state.context,l,this.meta)}}),J(this,"executeActivities",(a,l,u)=>{var c;for(const d of l){const h=yn(d)?(c=this.activityMap)==null?void 0:c[d]:d;if(!h){Fc(`[@zag-js/core > execute-activity] No implementation found for activity: \`${d}\``);continue}const p=h(this.state.context,a,this.meta);if(p){const f=yn(d)?d:d.name||Em();this.addActivityCleanup(u??this.state.value,f,p)}}}),J(this,"createEveryActivities",(a,l)=>{if(a)if(Nl(a)){const u=hr(a).find(d=>{const h=d.delay,p=jo(h,this.delayMap)(this.contextSnapshot,this.state.event);return _b(d.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??p!=null});if(!u)return;const c=jo(u.delay,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const d=globalThis.setInterval(()=>{this.executeActions(u.actions,this.state.event)},c);return()=>{globalThis.clearInterval(d)}})}else for(const u in a){const c=a?.[u],d=jo(u,this.delayMap)(this.contextSnapshot,this.state.event);l(()=>{const h=globalThis.setInterval(()=>{this.executeActions(c,this.state.event)},d);return()=>{globalThis.clearInterval(h)}})}}),J(this,"setEvent",a=>{this.state.previousEvent=this.state.event,this.state.event=Am(tn(a))}),J(this,"performExitEffects",(a,l)=>{const u=this.state.value;if(u==="")return;const c=a?this.getStateNode(a):void 0;this.stopActivities(u);const d=Lc(c?.exit,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=hr(d),p=this.delayedEvents.get(u);p&&h.push(...p),this.executeActions(h,l),this.delayedEvents.delete(u)}),J(this,"performEntryEffects",(a,l)=>{const u=this.getStateNode(a),c=hr(u?.activities);this.createEveryActivities(u?.every,f=>{c.unshift(f)}),c.length>0&&this.executeActivities(l,c);const d=Lc(u?.entry,this.guardMap)(this.contextSnapshot,l,this.guardMeta),h=hr(d),p=this.getDelayedEventActions(a);u!=null&&u.after&&p&&(this.delayedEvents.set(a,p?.exits),h.push(...p.entries)),this.executeActions(h,l),u?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(f=>{f(this.stateSnapshot)}),this.stop())}),J(this,"performTransitionEffects",(a,l)=>{const u=this.determineTransition(a,l);this.executeActions(u?.actions,l)}),J(this,"performStateChangeEffects",(a,l,u)=>{this.setEvent(u);const c=l.changed||l.reenter;c&&this.performExitEffects(a,u),this.performTransitionEffects(l.transition,u),this.setState(l.target),c&&this.performEntryEffects(l.target,u)}),J(this,"determineTransition",(a,l)=>{const u=HM(a,this.guardMap);return u?.(this.contextSnapshot,l,this.guardMeta)}),J(this,"sendParent",a=>{var l;this.parent||al("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const u=tn(a);(l=this.parent)==null||l.send(u)}),J(this,"log",(...a)=>{}),J(this,"send",a=>{const l=tn(a);this.transition(this.state.value,l)}),J(this,"transition",(a,l)=>{var u,c;const d=yn(a)?this.getStateNode(a):a?.stateNode,h=tn(l);if(!d&&!this.config.on){const m=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${a}, \`event\`: ${h.type}`;Fc(m);return}const p=((u=d?.on)==null?void 0:u[h.type])??((c=this.config.on)==null?void 0:c[h.type]),f=this.getNextStateInfo(p,h);return this.performStateChangeEffects(this.state.value,f,h),f.stateNode}),J(this,"subscribe",a=>(this.stateListeners.add(a),this.status==="Running"&&a(this.stateSnapshot),()=>{this.stateListeners.delete(a)})),J(this,"onDone",a=>(this.doneListeners.add(a),this)),J(this,"onTransition",a=>(this.stateListeners.add(a),this.status==="Running"&&a(this.stateSnapshot),this)),this.config=ai(t),this.options=ai(e??{}),this.id=this.config.id??`machine-${Em()}`,this.guardMap=((n=this.options)==null?void 0:n.guards)??{},this.actionMap=((r=this.options)==null?void 0:r.actions)??{},this.delayMap=((i=this.options)==null?void 0:i.delays)??{},this.activityMap=((o=this.options)==null?void 0:o.activities)??{},this.sync=((s=this.options)==null?void 0:s.sync)??!1,this.state=jM(this.config),this.initialContext=to(this.state.context)}get stateSnapshot(){return Wn(to(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const t=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return t.stateSnapshot},get initialContext(){return t.initialContext},get initialState(){var e;return((e=t.initialState)==null?void 0:e.target)??""}}}get meta(){var t;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((t=this.initialState)==null?void 0:t.target)??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const t=this.getState();return{value:t.value,tags:t.tags}}},WM=(t,e)=>new qM(t,e),Ib=()=>t=>Array.from(new Set(t)),UM=ol("toggle-group").parts("root","item"),Mm=UM.build(),lt=hM({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`toggle-group:${t.id}`},getItemId:(t,e)=>{var n,r;return((r=(n=t.ids)==null?void 0:n.item)==null?void 0:r.call(n,e))??`toggle-group:${t.id}:${e}`},getRootEl:t=>lt.getById(t,lt.getRootId(t)),getElements:t=>{const e=`[data-ownedby='${CSS.escape(lt.getRootId(t))}']:not([data-disabled])`;return lM(lt.getRootEl(t),e)},getFirstEl:t=>pM(lt.getElements(t)),getLastEl:t=>fM(lt.getElements(t)),getNextEl:(t,e)=>cM(lt.getElements(t),e,t.currentLoopFocus),getPrevEl:(t,e)=>dM(lt.getElements(t),e,t.currentLoopFocus)});function KM(t,e,n){const r=t.context.value,i=t.context.disabled,o=!t.context.multiple,s=t.context.rovingFocus,a=t.context.orientation==="horizontal";function l(u){const c=lt.getItemId(t.context,u.value);return{id:c,disabled:!!(u.disabled||i),pressed:!!r.includes(u.value),focused:t.context.focusedId===c}}return{value:r,setValue(u){e({type:"VALUE.SET",value:u})},getRootProps(){return n.element({...Mm.root.attrs,id:lt.getRootId(t.context),dir:t.context.dir,role:o?"radiogroup":"group",tabIndex:t.context.isTabbingBackward?-1:0,"data-disabled":_a(i),"data-orientation":t.context.orientation,"data-focus":_a(t.context.focusedId!=null),style:{outline:"none"},onMouseDown(){i||e("ROOT.MOUSE_DOWN")},onFocus(u){if(i)return;const c=u.nativeEvent||u;!bm(c)||t.context.isClickFocus||t.context.isTabbingBackward||e("ROOT.FOCUS")},onBlur(){i||e("ROOT.BLUR")}})},getItemState:l,getItemProps(u){const c=l(u),d=c.focused?0:-1;return n.button({...Mm.item.attrs,id:c.id,type:"button","data-ownedby":lt.getRootId(t.context),"data-focus":_a(c.focused),disabled:c.disabled,tabIndex:s?d:void 0,role:o?"radio":void 0,"aria-checked":o?c.pressed:void 0,"aria-pressed":o?void 0:c.pressed,"data-disabled":_a(c.disabled),"data-orientation":t.context.orientation,dir:t.context.dir,"data-state":c.pressed?"on":"off",onFocus(){c.disabled||e({type:"TOGGLE.FOCUS",id:c.id})},onClick(h){c.disabled||(e({type:"TOGGLE.CLICK",id:c.id,value:u.value}),QA()&&h.currentTarget.focus({preventScroll:!0}))},onKeyDown(h){if(h.defaultPrevented||!bm(h)||c.disabled)return;const p={Tab(f){const m=f.shiftKey;e({type:"TOGGLE.SHIFT_TAB",isShiftTab:m})},ArrowLeft(){!s||!a||e("TOGGLE.FOCUS_PREV")},ArrowRight(){!s||!a||e("TOGGLE.FOCUS_NEXT")},ArrowUp(){!s||a||e("TOGGLE.FOCUS_PREV")},ArrowDown(){!s||a||e("TOGGLE.FOCUS_NEXT")},Home(){s&&e("TOGGLE.FOCUS_FIRST")},End(){s&&e("TOGGLE.FOCUS_LAST")}}[iM(h)];p&&(p(h),h.key!=="Tab"&&h.preventDefault())}})}}}var{not:GM,and:JM}=$M;function YM(t){const e=Ku(t);return WM({id:"toggle-group",initial:"idle",context:{value:[],disabled:!1,orientation:"horizontal",rovingFocus:!0,loopFocus:!0,...e,focusedId:null,isTabbingBackward:!1,isClickFocus:!1,isWithinToolbar:!1},computed:{currentLoopFocus:n=>n.loopFocus&&!n.isWithinToolbar},entry:["checkIfWithinToolbar"],on:{"VALUE.SET":{actions:["setValue"]},"TOGGLE.CLICK":{actions:["setValue"]},"ROOT.MOUSE_DOWN":{actions:["setClickFocus"]}},states:{idle:{on:{"ROOT.FOCUS":{target:"focused",guard:GM(JM("isClickFocus","isTabbingBackward")),actions:["focusFirstToggle","clearClickFocus"]},"TOGGLE.FOCUS":{target:"focused",actions:["setFocusedId"]}}},focused:{on:{"ROOT.BLUR":{target:"idle",actions:["clearIsTabbingBackward"]},"TOGGLE.FOCUS":{actions:["setFocusedId"]},"TOGGLE.FOCUS_NEXT":{actions:["focusNextToggle"]},"TOGGLE.FOCUS_PREV":{actions:["focusPrevToggle"]},"TOGGLE.FOCUS_FIRST":{actions:["focusFirstToggle"]},"TOGGLE.FOCUS_LAST":{actions:["focusLastToggle"]},"TOGGLE.SHIFT_TAB":{target:"idle",actions:["setIsTabbingBackward"]}}}}},{guards:{isClickFocus:n=>n.isClickFocus,isTabbingBackward:n=>n.isTabbingBackward},actions:{setIsTabbingBackward(n){n.isTabbingBackward=!0},clearIsTabbingBackward(n){n.isTabbingBackward=!1},setClickFocus(n){n.isClickFocus=!0},clearClickFocus(n){n.isClickFocus=!1},checkIfWithinToolbar(n){var r;const i=(r=lt.getRootEl(n))==null?void 0:r.closest("[role=toolbar]");n.isWithinToolbar=!!i},setFocusedId(n,r){n.focusedId=r.id},clearFocusedId(n){n.focusedId=null},setValue(n,r){if(!r.value)return;let i=Array.from(n.value);n.multiple?i=i.includes(r.value)?gM(i,r.value):mM(i,r.value):i=Uu(n.value,[r.value])?[]:[r.value],ZM.value(n,i)},focusNextToggle(n){Ia(()=>{var r;n.focusedId&&((r=lt.getNextEl(n,n.focusedId))==null||r.focus({preventScroll:!0}))})},focusPrevToggle(n){Ia(()=>{var r;n.focusedId&&((r=lt.getPrevEl(n,n.focusedId))==null||r.focus({preventScroll:!0}))})},focusFirstToggle(n){Ia(()=>{var r;(r=lt.getFirstEl(n))==null||r.focus({preventScroll:!0})})},focusLastToggle(n){Ia(()=>{var r;(r=lt.getLastEl(n))==null||r.focus({preventScroll:!0})})}}})}var XM={change(t){var e;(e=t.onValueChange)==null||e.call(t,{value:Array.from(t.value)})}},ZM={value(t,e){Uu(t.value,e)||(t.value=e,XM.change(t))}};Ib()(["dir","disabled","getRootNode","id","ids","loopFocus","multiple","onValueChange","orientation","rovingFocus","value"]);Ib()(["value","disabled"]);const Db=ie({__name:"ButtonGroup",props:{modelValue:{},items:{},dropdownItems:{},direction:{default:"horizontal"},multiple:{type:Boolean},disabled:{type:Boolean},getRootNode:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=(c,d)=>c.length===d.length&&c.every((h,p)=>h===d[p]),r=t,i=e,o={id:Sn(),...r,orientation:r.direction,value:r.modelValue,onValueChange:({value:c})=>{i("update:modelValue",c)},rovingFocus:!1,loopFocus:!1},[s,a]=Ii(YM(o),{context:P(()=>r)}),l=P(()=>KM(s.value,a,_i)),u=Q();return Fe(()=>{var c;return(c=u.value)==null?void 0:c.isOpen},c=>{c||!l.value.value.includes("dropdown")||l.value.setValue(l.value.value.filter(d=>d!=="dropdown"))}),Fe(()=>r.modelValue,c=>{const d=c.map(h=>h);n(l.value.value,d)||l.value.setValue(d)},{deep:!0}),(c,d)=>(E(),I("div",se({class:["k-buttongroup",`k-buttongroup--direction-${c.direction}`]},l.value.getRootProps()),[B(c.$slots,"default",{getItemProps:l.value.getItemProps},()=>[c.items?(E(!0),I(Le,{key:0},Ft(c.items,({id:h,...p})=>(E(),U(yt,se({class:"k-buttongroup__item",variant:"tertiary",ref_for:!0},{...p,...l.value.getItemProps({value:h})}),null,16))),256)):F("",!0)]),c.dropdownItems||c.$slots.dropdown?(E(),U(ju,se({key:0,ref_key:"dropdown",ref:u,keepOpen:!0,items:c.dropdownItems},l.value.getItemProps({value:"dropdown"})),{default:te(({close:h})=>[B(c.$slots,"dropdown",{close:h,getItemProps:l.value.getItemProps})]),_:3},16,["items"])):F("",!0)],16))}}),QM=["href"],e_={class:"k-file-thumbnail__info"},t_=["value","disabled"],n_={class:"k-file-thumbnail__info-footer"},r_={key:0,class:"k-file-thumbnail__size"},i_=ie({__name:"Thumbnail",props:{value:{},disabled:{type:Boolean},rename:{type:Boolean},sortable:{type:Boolean},icons:{},labels:{}},emits:["rename","delete"],setup(t,{emit:e}){const n=[{pattern:/text.*/,icon:"fa-pro-solid:file-alt"},{pattern:/image.*/,icon:"fa-pro-solid:file-image"},{pattern:/pdf/,icon:"fa-pro-solid:file-pdf"},{pattern:/word/,icon:"fa-pro-solid:file-word"},{pattern:/excel/,icon:"fa-pro-solid:file-excel"},{pattern:/powerpoint/,icon:"fa-pro-solid:file-powerpoint"},{pattern:/octet-stream|zip/,icon:"fa-pro-solid:file-archive"}],r=t,i=P(()=>{let h=[...n,...r.icons].find(p=>r.value.type.match(p.pattern));return h?.icon||"fa-pro-solid:file"}),o=P(()=>r.disabled?"a":"div"),s=P(()=>r.disabled?{click:h=>{h.preventDefault(),Ld(r.value)}}:{}),a=P(()=>r.disabled?{title:r.disabled?"Download":null}:{});function l(){r.disabled||Ld(r.value)}const u=Q(),c=Q([]);function d(){var h;(h=u.value)==null||h.blur()}return(h,p)=>(E(),U(Ye(o.value),se({class:["k-file-thumbnail",{"k-file-thumbnail--clickable":h.disabled}]},a.value,Fh(s.value)),{default:te(()=>[ke(bi,{class:"k-file-thumbnail__preview",gap:"0rem",justify:"center",align:"center"},{default:te(()=>[B(h.$slots,"icon",{},()=>[h.value.type.includes("image")?(E(),I("a",{key:0,href:h.value.url,target:"_blank"},[ke(by,{class:"k-file-thumbnail__preview-image",src:h.value.url,alt:h.value.name,size:"contain",aspectRatio:"1/1"},null,8,["src","alt"])],8,QM)):(E(),U(z(We),{key:1,icon:i.value,class:"k-file-thumbnail__preview-icon"},null,8,["icon"]))])]),_:3}),W("div",e_,[W("input",{type:"text",ref_key:"input",ref:u,class:"k-file-thumbnail__name",value:h.value.name,onKeypress:Ov(d,["enter"]),disabled:h.disabled||!h.rename,onInput:p[0]||(p[0]=f=>h.$emit("rename",f.target.value))},null,40,t_),W("div",n_,[h.value.size?(E(),I("span",r_,ce(z(ap)(h.value.size)),1)):F("",!0)])]),ke(Db,{modelValue:c.value,"onUpdate:modelValue":p[2]||(p[2]=f=>{c.value=f.filter(m=>m!=="download")}),disabled:h.disabled},{default:te(({getItemProps:f})=>[h.value.url?(E(),U(yt,se({key:0,is:"a",href:h.value.url,class:"k-file-thumbnail__download",onClick:ws(l,["prevent"]),icon:"fa-pro-light:arrow-down-to-line",variant:"tertiary"},f({value:"download"})),null,16,["href"])):F("",!0)]),dropdown:te(({close:f})=>[h.value.url?(E(),U(yt,{key:0,is:"a",href:h.value.url,class:"k-file-thumbnail__download",onClick:ws(l,["prevent"]),iconRight:"fa-pro-light:arrow-down-to-line",label:h.labels.download,variant:"tertiary"},null,8,["href","label"])):F("",!0),h.disabled?F("",!0):(E(),U(yt,{key:1,variant:"danger",label:h.labels.delete,class:"k-file-thumbnail__delete",iconRight:"fa-pro-light:times",onClick:p[1]||(p[1]=m=>h.$emit("delete"))},null,8,["label"]))]),_:1},8,["modelValue","disabled"]),h.sortable?(E(),U(z(We),{key:0,icon:"fa-pro-solid:arrows-alt-v",class:"k-file-thumbnail__handle"})):F("",!0)]),_:3},16,["class"]))}}),o_={key:0,class:"k-file__label-wrapper"},s_={key:1,class:"k-file__sublabel"},vV=ie({__name:"File",props:{modelValue:{},label:{},sublabel:{},multiple:{type:Boolean},sortable:{type:Boolean,default:!0},upload:{type:Function,default:()=>(t,e,n)=>(console.warn("[@kvass-ui/file]: You need to setup the upload function before using this component!"),e(50),new Promise((r,i)=>{let o=new FileReader;o.onloadend=function(){r({url:o.result,type:t.type})},o.readAsDataURL(t)}))},uploadOptions:{},dropMessage:{default:"Drag a file here or <b>browse</b> to upload."},rename:{type:Boolean,default:!0},accept:{},serialize:{type:Function,default:t=>t},required:{type:Boolean},disabled:{type:Boolean},icons:{default:()=>[]},labels:{default:()=>({delete:"Delete",download:"Download"})}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(u){r("update:modelValue",u)}function o(u){r("update:modelValue",n.multiple?(n.modelValue||[]).filter(c=>c!==u):null)}const s=P(()=>n.multiple||!n.modelValue),a=P({get(){return n.modelValue?n.modelValue instanceof Array?n.modelValue:[n.modelValue]:[]},set(u){n.multiple&&i(u)}}),l=Dn("k-file",{variants:{}});return(u,c)=>(E(),I("div",{class:Me(z(l)({}))},[u.label||u.sublabel||u.$slots.sublabel||u.$slots.label?(E(),I("div",o_,[u.label||u.$slots.label?(E(),I("label",{key:0,class:Me(["k-file__label",{"k-file__label-required":u.required}])},[B(u.$slots,"label",{},()=>[ct(ce(u.label),1)])],2)):F("",!0),u.sublabel||u.$slots.sublabel?(E(),I("span",s_,[B(u.$slots,"sublabel",{},()=>[ct(ce(u.sublabel),1)])])):F("",!0)])):F("",!0),ke(bi,{direction:"column"},{default:te(()=>[a.value.length?(E(),U(z(gb),{key:0,modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),disabled:!u.multiple||!u.sortable,animation:200,class:"k-file__thumbnails","item-key":"url",handle:".k-file-thumbnail__handle"},{item:te(({element:d,index:h})=>[(E(),U(i_,{key:d.url,disabled:u.disabled,sortable:!u.disabled&&u.sortable&&u.multiple&&a.value.length>1,rename:u.rename===!0,value:u.serialize(d),onRename:p=>d.name=p,onDelete:p=>o(d),icons:u.icons,labels:u.labels},Us({_:2},[Ft(u.$slots,(p,f)=>({name:f,fn:te(()=>[B(u.$slots,f,{item:d})])}))]),1032,["disabled","sortable","rename","value","onRename","onDelete","icons","labels"]))]),_:3},8,["modelValue","disabled"])):F("",!0),s.value?(E(),U($A,{key:1,accept:u.accept,ref:"input",value:u.modelValue,multiple:u.multiple,required:u.required,onInput:i,disabled:u.disabled,"upload-options":u.uploadOptions,upload:u.upload,dropMessage:u.dropMessage,rename:u.rename,labels:u.labels},{"drop-message":te(({extensions:d})=>[B(u.$slots,"drop-message",{extensions:d})]),"custom-message":te(()=>[B(u.$slots,"custom-message")]),_:3},8,["accept","value","multiple","required","disabled","upload-options","upload","dropMessage","rename","labels"])):F("",!0)]),_:3})],2))}}),Rb=new Set,Ct=new WeakMap,go=new WeakMap,wi=new WeakMap,Kd=new WeakMap,a_=new WeakMap,vo=new WeakMap,Fl=new WeakMap,Jo=new WeakSet;let Br,pp=0,fp=0;const Kn="__aa_tgt",Is="__aa_del",Ll="__aa_new",l_=t=>{const e=f_(t);e&&e.forEach(n=>m_(n))},u_=t=>{t.forEach(e=>{e.target===Br&&d_(),Ct.has(e.target)&&Di(e.target)})};function c_(t){const e=Kd.get(t);e?.disconnect();let n=Ct.get(t),r=0;const i=5;n||(n=yo(t),Ct.set(t,n));const{offsetWidth:o,offsetHeight:s}=Br,a=[n.top-i,o-(n.left+i+n.width),s-(n.top+i+n.height),n.left-i].map(u=>`${-1*Math.floor(u)}px`).join(" "),l=new IntersectionObserver(()=>{++r>1&&Di(t)},{root:Br,threshold:1,rootMargin:a});l.observe(t),Kd.set(t,l)}function Di(t){clearTimeout(Fl.get(t));const e=Gu(t),n=Ds(e)?500:e.duration;Fl.set(t,setTimeout(async()=>{const r=wi.get(t);try{await r?.finished,Ct.set(t,yo(t)),c_(t)}catch{}},n))}function d_(){clearTimeout(Fl.get(Br)),Fl.set(Br,setTimeout(()=>{Rb.forEach(t=>Lb(t,e=>Nb(()=>Di(e))))},100))}function h_(t){setTimeout(()=>{a_.set(t,setInterval(()=>Nb(Di.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function Nb(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let Gd,us;const p_=typeof window<"u"&&"ResizeObserver"in window;p_&&(Br=document.documentElement,Gd=new MutationObserver(l_),us=new ResizeObserver(u_),window.addEventListener("scroll",()=>{fp=window.scrollY,pp=window.scrollX}),us.observe(Br));function f_(t){return t.reduce((e,n)=>[...e,...Array.from(n.addedNodes),...Array.from(n.removedNodes)],[]).every(e=>e.nodeName==="#comment")?!1:t.reduce((e,n)=>{if(e===!1)return!1;if(n.target instanceof Element){if(Bc(n.target),!e.has(n.target)){e.add(n.target);for(let r=0;r<n.target.children.length;r++){const i=n.target.children.item(r);if(i){if(Is in i)return!1;Bc(n.target,i),e.add(i)}}}if(n.removedNodes.length)for(let r=0;r<n.removedNodes.length;r++){const i=n.removedNodes[r];if(Is in i)return!1;i instanceof Element&&(e.add(i),Bc(n.target,i),go.set(i,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function Bc(t,e){!e&&!(Kn in t)?Object.defineProperty(t,Kn,{value:t}):e&&!(Kn in e)&&Object.defineProperty(e,Kn,{value:t})}function m_(t){var e;const n=t.isConnected,r=Ct.has(t);n&&go.has(t)&&go.delete(t),wi.has(t)&&((e=wi.get(t))===null||e===void 0||e.cancel()),Ll in t?_m(t):r&&n?v_(t):r&&!n?y_(t):_m(t)}function hn(t){return Number(t.replace(/[^0-9.\-]/g,""))}function g_(t){let e=t.parentElement;for(;e;){if(e.scrollLeft||e.scrollTop)return{x:e.scrollLeft,y:e.scrollTop};e=e.parentElement}return{x:0,y:0}}function yo(t){const e=t.getBoundingClientRect(),{x:n,y:r}=g_(t);return{top:e.top+r,left:e.left+n,width:e.width,height:e.height}}function Pb(t,e,n){let r=e.width,i=e.height,o=n.width,s=n.height;const a=getComputedStyle(t);if(a.getPropertyValue("box-sizing")==="content-box"){const l=hn(a.paddingTop)+hn(a.paddingBottom)+hn(a.borderTopWidth)+hn(a.borderBottomWidth),u=hn(a.paddingLeft)+hn(a.paddingRight)+hn(a.borderRightWidth)+hn(a.borderLeftWidth);r-=u,o-=u,i-=l,s-=l}return[r,o,i,s].map(Math.round)}function Gu(t){return Kn in t&&vo.has(t[Kn])?vo.get(t[Kn]):{duration:250,easing:"ease-in-out"}}function Fb(t){if(Kn in t)return t[Kn]}function mp(t){const e=Fb(t);return e?Jo.has(e):!1}function Lb(t,...e){e.forEach(n=>n(t,vo.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(i=>i(r,vo.has(r)))}}function gp(t){return Array.isArray(t)?t:[t]}function Ds(t){return typeof t=="function"}function v_(t){const e=Ct.get(t),n=yo(t);if(!mp(t))return Ct.set(t,n);let r;if(!e)return;const i=Gu(t);if(typeof i!="function"){const o=e.left-n.left,s=e.top-n.top,[a,l,u,c]=Pb(t,e,n),d={transform:`translate(${o}px, ${s}px)`},h={transform:"translate(0, 0)"};a!==l&&(d.width=`${a}px`,h.width=`${l}px`),u!==c&&(d.height=`${u}px`,h.height=`${c}px`),r=t.animate([d,h],{duration:i.duration,easing:i.easing})}else{const[o]=gp(i(t,"remain",e,n));r=new Animation(o),r.play()}wi.set(t,r),Ct.set(t,n),r.addEventListener("finish",Di.bind(null,t))}function _m(t){Ll in t&&delete t[Ll];const e=yo(t);Ct.set(t,e);const n=Gu(t);if(!mp(t))return;let r;if(typeof n!="function")r=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=gp(n(t,"add",e));r=new Animation(i),r.play()}wi.set(t,r),r.addEventListener("finish",Di.bind(null,t))}function Im(t,e){var n;t.remove(),Ct.delete(t),go.delete(t),wi.delete(t),(n=Kd.get(t))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Is in t&&delete t[Is],Object.defineProperty(t,Ll,{value:!0,configurable:!0}),e&&t instanceof HTMLElement)for(const r in e)t.style[r]=""},0)}function y_(t){var e;if(!go.has(t)||!Ct.has(t))return;const[n,r]=go.get(t);Object.defineProperty(t,Is,{value:!0,configurable:!0});const i=window.scrollX,o=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(t,r):n&&n.parentNode?n.parentNode.appendChild(t):(e=Fb(t))===null||e===void 0||e.appendChild(t),!mp(t))return Im(t);const[s,a,l,u]=k_(t),c=Gu(t),d=Ct.get(t);(i!==pp||o!==fp)&&b_(t,i,o,c);let h,p={position:"absolute",top:`${s}px`,left:`${a}px`,width:`${l}px`,height:`${u}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Ds(c))Object.assign(t.style,p),h=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:c.duration,easing:"ease-out"});else{const[f,m]=gp(c(t,"remove",d));m?.styleReset!==!1&&(p=m?.styleReset||p,Object.assign(t.style,p)),h=new Animation(f),h.play()}wi.set(t,h),h.addEventListener("finish",Im.bind(null,t,p))}function b_(t,e,n,r){const i=pp-e,o=fp-n,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(Br).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+o),!t.parentElement)return;const a=t.parentElement;let l=a.clientHeight,u=a.clientWidth;const c=performance.now();function d(){requestAnimationFrame(()=>{if(!Ds(r)){const h=l-a.clientHeight,p=u-a.clientWidth;c+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-h}),l=a.clientHeight,u=a.clientWidth,d()):document.documentElement.style.scrollBehavior=s}})}d()}function k_(t){const e=Ct.get(t),[n,,r]=Pb(t,e,yo(t));let i=t.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const o=getComputedStyle(i),s=Ct.get(i)||yo(i),a=Math.round(e.top-s.top)-hn(o.borderTopWidth),l=Math.round(e.left-s.left)-hn(o.borderLeftWidth);return[a,l,n,r]}function x_(t,e={}){return Gd&&us&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Ds(e)&&!e.disrespectUserMotionPreference||(Jo.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),Lb(t,Di,h_,n=>us?.observe(n)),Ds(e)?vo.set(t,e):vo.set(t,{duration:250,easing:"ease-in-out",...e}),Gd.observe(t,{childList:!0}),Rb.add(t))),Object.freeze({parent:t,enable:()=>{Jo.add(t)},disable:()=>{Jo.delete(t)},isEnabled:()=>Jo.has(t)})}const Dm={mounted:(t,e)=>{x_(t,e.value||{})},getSSRProps:()=>({})},w_=["disabled"],E_={key:0,class:"k-expandable__title"},C_={key:1,class:"k-expandable__subtitle"},S_={key:2,class:"k-expandable__actions"},yV=ie({__name:"Expandable",props:{title:{},subtitle:{},disabled:{type:Boolean,default:!1},expandable:{type:Boolean,default:!0},expanded:{type:Boolean,default:!1},variant:{default:"border"},gap:{default:"1rem"}},setup(t){const e=t,n=Ph(),r=P(()=>n.actions),i=P(()=>n.footer),o=P(()=>n.default),s=Q(e.expanded),a=()=>{!e.expandable||!o.value||(s.value=!s.value)},l=Dn("k-expandable",{variants:{disabled:{true:"k-expandable--disabled"},expandable:{true:"k-expandable--expandable"},expanded:{true:"k-expandable--expanded",false:"k-expandable--collapsed"},variant:{shadow:"k-expandable--variant-shadow",flat:"k-expandable--variant-flat",border:"k-expandable--variant-border"}}});return(u,c)=>ml((E(),I("fieldset",{disabled:u.disabled,class:Me(z(l)({disabled:u.disabled,expandable:u.expandable,expanded:s.value,variant:u.variant}))},[ke(yt,{class:Me(["k-expandable__header",{"k-expandable__header--open":s.value}]),is:"legend",tabindex:"0",onKeydown:Ov(a,["enter"]),onClick:a,variant:"tertiary"},Us({default:te(()=>[u.title?(E(),I("span",E_,ce(u.title),1)):F("",!0),u.subtitle?(E(),I("span",C_,ce(u.subtitle),1)):F("",!0),r.value?(E(),I("span",S_,[B(u.$slots,"actions")])):F("",!0)]),_:2},[u.expandable?{name:"icon-left",fn:te(()=>[ke(z(We),{class:"k-expandable__icon",icon:s.value?"fa-pro-regular:angle-up":"fa-pro-regular:angle-down"},null,8,["icon"])]),key:"0"}:void 0]),1032,["class"]),s.value&&o.value?(E(),I(Le,{key:0},[ml((E(),U(bi,{class:"k-expandable__content",direction:"column",gap:u.gap},{default:te(()=>[B(u.$slots,"default")]),_:3},8,["gap"])),[[z(Dm)]]),i.value?(E(),U(bi,{key:0,justify:"center",align:"center",class:"k-expandable__footer"},{default:te(()=>[B(u.$slots,"footer")]),_:3})):F("",!0)],64)):F("",!0)],10,w_)),[[z(Dm)]])}});function et(t){this.content=t}et.prototype={constructor:et,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new et(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new et(n)},addToStart:function(t,e){return new et([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new et(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new et(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=et.from(t),t.size?new et(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=et.from(t),t.size?new et(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=et.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};et.from=function(t){if(t instanceof et)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new et(e)};function Bb(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Bb(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Vb(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=Vb(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class D{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new D(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new D(r,i)}cutByIndex(e,n){return e==n?D.empty:e==0&&n==this.content.length?this:new D(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new D(i,o)}addToStart(e){return new D([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new D(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Bb(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Vb(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ra(0,e);if(e==this.size)return Ra(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ra(r+1,s):Ra(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return D.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new D(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return D.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new D(n||e,r)}static from(e){if(!e)return D.empty;if(e instanceof D)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new D([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}D.empty=new D([],0);const Vc={index:0,offset:0};function Ra(t,e){return Vc.index=t,Vc.offset=e,Vc}function Bl(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Bl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Bl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Te=class Jd{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Bl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Jd.none;if(e instanceof Jd)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Te.none=[];class Vl extends Error{}class V{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=jb(this.content,e+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(e,n){return new V($b(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return V.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new V(D.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new V(e,r,i)}}V.empty=new V(D.empty,0,0);function $b(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy($b(o.content,e-i-1,n-i-1)))}function jb(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=jb(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function T_(t,e,n){if(n.openStart>t.depth)throw new Vl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Vl("Inconsistent open depths");return zb(t,e,n,0)}function zb(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=zb(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return hi(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=O_(n,t);return hi(o,qb(t,s,a,e,r))}else return hi(o,$l(t,e,r))}function Hb(t,e){if(!e.type.compatibleContent(t.type))throw new Vl("Cannot join "+e.type.name+" onto "+t.type.name)}function Yd(t,e,n){let r=t.node(n);return Hb(r,e.node(n)),r}function di(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function cs(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(di(t.nodeAfter,r),o++));for(let a=o;a<s;a++)di(i.child(a),r);e&&e.depth==n&&e.textOffset&&di(e.nodeBefore,r)}function hi(t,e){return t.type.checkContent(e),t.copy(e)}function qb(t,e,n,r,i){let o=t.depth>i&&Yd(t,e,i+1),s=r.depth>i&&Yd(n,r,i+1),a=[];return cs(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Hb(o,s),di(hi(o,qb(t,e,n,r,i+1)),a)):(o&&di(hi(o,$l(t,e,i+1)),a),cs(e,n,i,a),s&&di(hi(s,$l(n,r,i+1)),a)),cs(r,null,i,a),new D(a)}function $l(t,e,n){let r=[];if(cs(null,t,n,r),t.depth>n){let i=Yd(t,e,n+1);di(hi(i,$l(t,e,n+1)),r)}return cs(e,null,n,r),new D(r)}function O_(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)r=e.node(i).copy(D.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class Rs{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Te.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new jl(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Rs(n,r,o)}static resolveCached(e,n){let r=Rm.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Rm.set(e,r=new A_);let i=r.elts[r.i]=Rs.resolve(e,n);return r.i=(r.i+1)%M_,i}}class A_{constructor(){this.elts=[],this.i=0}}const M_=12,Rm=new WeakMap;class jl{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const __=Object.create(null);let _r=class Xd{constructor(e,n,r,i=Te.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||D.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Bl(this.attrs,n||e.defaultAttrs||__)&&Te.sameSet(this.marks,r||Te.none)}copy(e=null){return e==this.content?this:new Xd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xd(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return V.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),l=i.node(s).content.cut(i.pos-a,o.pos-a);return new V(l,i.depth-s,o.depth-s)}replace(e,n,r){return T_(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Rs.resolveCached(this,e)}resolveNoCache(e){return Rs.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Wb(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=D.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Te.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=D.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};_r.prototype.text=void 0;class zl extends _r{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Wb(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new zl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new zl(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Wb(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ei{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new I_(e,n);if(r.next==null)return Ei.empty;let i=Ub(r);r.next&&r.err("Unexpected trailing text");let o=B_(L_(i));return V_(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return D.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(c));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
15
|
+
`)}}Ei.empty=new Ei(!0);class I_{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ub(t){let e=[];do e.push(D_(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function D_(t){let e=[];do e.push(R_(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function R_(t){let e=F_(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=N_(t,e);else break;return e}function Nm(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function N_(t,e){let n=Nm(t),r=n;return t.eat(",")&&(t.next!="}"?r=Nm(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function P_(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function F_(t){if(t.eat("(")){let e=Ub(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=P_(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function L_(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let c=n();i(o(s.expr,l),c),l=c}if(s.max==-1)i(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();r(l,c),i(o(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Kb(t,e){return e-t}function Pm(t,e){let n=[];return r(e),n.sort(Kb);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function B_(t){let e=Object.create(null);return n(Pm(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<i.length;c++)i[c][0]==a&&(u=i[c][1]);Pm(t,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new Ei(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(Kb);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function V_(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Gb(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Jb(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Yb(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function Xb(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new j_(t,r,e[r]);return n}let Fm=class Zb{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Xb(e,r.attrs),this.defaultAttrs=Gb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ei.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Jb(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _r(this,this.computeAttrs(e),D.from(n),Te.setFrom(r))}createChecked(e=null,n,r){return n=D.from(n),this.checkContent(n),new _r(this,this.computeAttrs(e),n,Te.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=D.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(D.empty,!0);return o?new _r(this,e,n.append(o),Te.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Yb(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Te.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Zb(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function $_(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class j_{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?$_(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ju{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Xb(e,i.attrs),this.excluded=null;let o=Gb(this.attrs);this.instance=o?new Te(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Te(this,Jb(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Ju(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Yb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Qb{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=et.from(e.nodes),n.marks=et.from(e.marks||{}),this.nodes=Fm.compile(this.spec.nodes,this),this.marks=Ju.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ei.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Lm(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Lm(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Fm){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new zl(r,r.defaultAttrs,e,Te.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return _r.fromJSON(this,e)}markFromJSON(e){return Te.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Lm(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function z_(t){return t.tag!=null}function H_(t){return t.style!=null}class Ir{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(z_(i))this.tags.push(i);else if(H_(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Vm(this,n,!1);return r.addAll(e,Te.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Vm(this,n,!0);return r.addAll(e,Te.none,n.from,n.to),V.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(U_(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=$m(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=$m(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ir(e,Ir.schemaRules(e)))}}const e0={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},q_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},t0={ol:!0,ul:!0},Ns=1,Zd=2,ll=4;function Bm(t,e,n){return e!=null?(e?Ns:0)|(e==="full"?Zd:0):t&&t.whitespace=="pre"?Ns|Zd:n&-5}class Na{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Te.none,this.match=o||(s&ll?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(D.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ns)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=D.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(D.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!e0.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Vm{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Bm(null,n.preserveWhitespace,0)|(r?ll:0);i?o=new Na(i.type,i.attrs,Te.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Na(null,null,Te.none,!0,null,s):o=new Na(e.schema.topNodeType,null,Te.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&Zd?"full":this.localPreserveWS||(i.options&Ns)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
16
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;t0.hasOwnProperty(s)&&this.parser.normalizeLists&&W_(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:q_.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(e0.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(o),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
17
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Te.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):jm(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Bm(e,o,s.options);s.options&ll&&s.content.length==0&&(a|=ll);let l=Te.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):jm(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Na(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Ns)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function W_(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&t0.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function U_(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function $m(t){let e={};for(let n in t)e[n]=t[n];return e}function jm(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Ri{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=$c(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=ul($c(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ul($c(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ul(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ri(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=zm(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return zm(e.marks)}}function zm(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function $c(t){return t.document||window.document}const Hm=new WeakMap;function K_(t){let e=Hm.get(t);return e===void 0&&Hm.set(t,e=G_(t)),e}function G_(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ul(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=K_(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),u[d]):l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:f}=ul(t,h,n,r);if(l.appendChild(p),f){if(a)throw new RangeError("Multiple content holes");a=f}}}return{dom:l,contentDOM:a}}const n0=65535,r0=Math.pow(2,16);function J_(t,e){return t+e*r0}function qm(t){return t&n0}function Y_(t){return(t-(t&n0))/r0}const i0=1,o0=2,cl=4,s0=8;class Qd{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&s0)>0}get deletedBefore(){return(this.delInfo&(i0|cl))>0}get deletedAfter(){return(this.delInfo&(o0|cl))>0}get deletedAcross(){return(this.delInfo&cl)>0}}class Nt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Nt.empty)return Nt.empty}recover(e){let n=0,r=qm(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Y_(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=u?e==l?-1:e==d?1:n:n,p=l+i+(h<0?0:c);if(r)return p;let f=e==(n<0?l:d)?null:J_(a/3,e-l),m=e==l?o0:e==d?i0:cl;return(n<0?e!=l:e!=d)&&(m|=s0),new Qd(p,m,f)}i+=c-u}return r?e+i:new Qd(e+i,0,null)}touches(e,n){let r=0,i=qm(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+n],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}}Nt.empty=new Nt([]);class ao{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new ao(this.maps,this.mirror,e,n)}copy(){return new ao(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new ao;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Qd(e,i,null)}}const jc=Object.create(null);class pt{getMap(){return Nt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=jc[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in jc)throw new RangeError("Duplicate use of step JSON ID "+e);return jc[e]=n,n.prototype.jsonID=e,n}}class je{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new je(e,null)}static fail(e){return new je(null,e)}static fromReplace(e,n,r,i){try{return je.ok(e.replace(n,r,i))}catch(o){if(o instanceof Vl)return je.fail(o.message);throw o}}}function vp(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(vp(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return D.fromArray(r)}class wr extends pt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(vp(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return je.fromReplace(e,this.from,this.to,o)}invert(){return new kn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new wr(n.pos,r.pos,this.mark)}merge(e){return e instanceof wr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new wr(n.from,n.to,e.markFromJSON(n.mark))}}pt.jsonID("addMark",wr);class kn extends pt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new V(vp(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return je.fromReplace(e,this.from,this.to,r)}invert(){return new wr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new kn(n.pos,r.pos,this.mark)}merge(e){return e instanceof kn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new kn(n.from,n.to,e.markFromJSON(n.mark))}}pt.jsonID("removeMark",kn);class Er extends pt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return je.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return je.fromReplace(e,this.pos,this.pos+1,new V(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Er(this.pos,n.marks[i]);return new Er(this.pos,this.mark)}}return new bo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Er(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Er(n.pos,e.markFromJSON(n.mark))}}pt.jsonID("addNodeMark",Er);class bo extends pt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return je.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return je.fromReplace(e,this.pos,this.pos+1,new V(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Er(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new bo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bo(n.pos,e.markFromJSON(n.mark))}}pt.jsonID("removeNodeMark",bo);class Ke extends pt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&eh(e,this.from,this.to)?je.fail("Structure replace would overwrite content"):je.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ke(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ke(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ke)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?V.empty:new V(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ke(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?V.empty:new V(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ke(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ke(n.from,n.to,V.fromJSON(e,n.slice),!!n.structure)}}pt.jsonID("replace",Ke);class Ge extends pt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(eh(e,this.from,this.gapFrom)||eh(e,this.gapTo,this.to)))return je.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return je.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?je.fromReplace(e,this.from,this.to,r):je.fail("Content does not fit in gap")}getMap(){return new Nt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ge(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ge(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ge(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(e,n.slice),n.insert,!!n.structure)}}pt.jsonID("replaceAround",Ge);function eh(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function X_(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let h=Math.max(u,e),p=Math.min(u+l.nodeSize,n),f=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(f)||(s&&s.to==h&&s.mark.eq(d[m])?s.to=p:i.push(s=new kn(h,p,d[m])));a&&a.to==h?a.to=p:o.push(a=new wr(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function Z_(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Ju){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],h;for(let p=0;p<i.length;p++){let f=i[p];f.step==o-1&&d.eq(i[p].style)&&(h=f)}h?(h.to=u,h.step=o):i.push({style:d,from:Math.max(a,e),to:u,step:o})}}}),i.forEach(s=>t.step(new kn(s.from,s.to,s.style)))}function yp(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),c=a+u.nodeSize,d=r.matchType(u.type);if(!d)s.push(new Ke(a,c,V.empty));else{r=d;for(let h=0;h<u.marks.length;h++)n.allowsMarkType(u.marks[h].type)||t.step(new kn(a,c,u.marks[h]));if(i&&u.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,f;for(;h=p.exec(u.text);)f||(f=new V(D.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Ke(a+h.index,a+h.index+h[0].length,f))}}a=c}if(!r.validEnd){let l=r.fillBefore(D.empty,!0);t.replace(a,a,new V(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function Q_(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Io(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(n==0||r.type.spec.isolating||!Q_(r,i,o))break}return null}function eI(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=D.empty,d=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,c=D.from(r.node(f).copy(c)),d++):l--;let h=D.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=D.from(i.node(f).copy(h)),p++):u++;t.step(new Ge(l,u,s,a,new V(c.append(h),d,p),c.size-d,!0))}function bp(t,e,n=null,r=t){let i=tI(t,e),o=i&&nI(r,e);return o?i.map(Wm).concat({type:e,attrs:n}).concat(o.map(Wm)):null}function Wm(t){return{type:t,attrs:null}}function tI(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function nI(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:s}function rI(t,e,n){let r=D.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=D.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ge(i,o,i,o,new V(r,0,0),n.length,!0))}function iI(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&oI(t.doc,t.mapping.slice(o).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!f?u=!1:!p&&f&&(u=!0)}u===!1&&l0(t,s,a,o),yp(t,t.mapping.slice(o).map(a,1),r,void 0,u===null);let c=t.mapping.slice(o),d=c.map(a,1),h=c.map(a+s.nodeSize,1);return t.step(new Ge(d,h,d+1,h-1,new V(D.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&a0(t,s,a,o),!1}})}function a0(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function l0(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
18
|
+
`))}})}function oI(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function sI(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ge(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new V(D.from(s),0,0),1,!0))}function lo(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function aI(t,e,n=1,r){let i=t.doc.resolve(e),o=D.empty,s=D.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=D.from(i.node(a).copy(o));let c=r&&r[u];s=D.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new Ke(e,e,new V(o.append(s),n,n),!0))}function $r(t,e){let n=t.resolve(e),r=n.index();return u0(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function lI(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function u0(t,e){return!!(t&&e&&!t.isLeaf&&lI(t,e))}function Yu(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&u0(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function uI(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let c=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);c&&!d?r=!1:!c&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);l0(t,c.node(),c.before(),a)}s.inlineContent&&yp(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Ke(u,l.map(e+n,-1),V.empty,!0)),r===!0){let c=t.doc.resolve(u);a0(t,c.node(),c.before(),t.steps.length)}return t}function cI(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function c0(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Xu(t,e,n=e,r=V.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return d0(i,o,r)?new Ke(e,n,r):new dI(i,o,r).fit()}function d0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class dI{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=D.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=D.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new V(o,s,a);return e>-1?new Ge(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ke(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=zc(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(s?u.matchType(s.type)||(d=u.fillBefore(D.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=zc(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=zc(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new V(Yo(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Yo(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),g=d.matchType(m.type);if(!g)break;u++,(u>1||l==0||m.content.size)&&(d=g,c.push(h0(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let f=u==a.childCount;f||(p=-1),this.placed=Xo(this.placed,n,D.from(c)),this.frontier[n].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=f?e==0?V.empty:new V(Yo(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new V(Yo(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Hc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Hc(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=Hc(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Xo(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Xo(this.placed,this.depth,D.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(D.empty,!0);e.childCount&&(this.placed=Xo(this.placed,this.frontier.length,e))}}function Yo(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Yo(t.firstChild.content,e-1,n)))}function Xo(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Xo(t.lastChild.content,e-1,n)))}function zc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function h0(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,h0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(D.empty,!0)))),t.copy(r)}function Hc(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!hI(n,o.content,s)?a:null}function hI(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function pI(t){return t.spec.defining||t.spec.definingForContent}function fI(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(d0(i,o,r))return t.step(new Ke(e,n,r));let s=f0(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let f=i.node(h).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let l=s.indexOf(a),u=[],c=r.openStart;for(let h=r.content,p=0;;p++){let f=h.firstChild;if(u.push(f),p==r.openStart)break;h=f.content}for(let h=c-1;h>=0;h--){let p=u[h],f=pI(p.type);if(f&&!p.sameMarkup(i.node(Math.abs(a)-1)))c=h;else if(f||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+c+1)%(r.openStart+1),f=u[p];if(f)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],y=!0;g<0&&(y=!1,g=-g);let b=i.node(g-1),k=i.index(g-1);if(b.canReplaceWith(k,k,f.type,f.marks))return t.replace(i.before(g),y?o.after(g):n,new V(p0(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function p0(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(p0(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(D.empty,!0))}return t}function mI(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=cI(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new V(D.from(r),0,0))}function gI(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=f0(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function f0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class uo extends pt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return je.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return je.fromReplace(e,this.pos,this.pos+1,new V(D.from(i),0,n.isLeaf?0:1))}getMap(){return Nt.empty}invert(e){return new uo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new uo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new uo(n.pos,n.attr,n.value)}}pt.jsonID("attr",uo);class Ps extends pt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return je.ok(r)}getMap(){return Nt.empty}invert(e){return new Ps(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ps(n.attr,n.value)}}pt.jsonID("docAttr",Ps);let ko=class extends Error{};ko=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ko.prototype=Object.create(Error.prototype);ko.prototype.constructor=ko;ko.prototype.name="TransformError";class m0{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ao}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ko(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=V.empty){let i=Xu(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new V(D.from(r),0,0))}delete(e,n){return this.replace(e,n,V.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return fI(this,e,n,r),this}replaceRangeWith(e,n,r){return mI(this,e,n,r),this}deleteRange(e,n){return gI(this,e,n),this}lift(e,n){return eI(this,e,n),this}join(e,n=1){return uI(this,e,n),this}wrap(e,n){return rI(this,e,n),this}setBlockType(e,n=e,r,i=null){return iI(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return sI(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new uo(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ps(e,n)),this}addNodeMark(e,n){return this.step(new Er(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new bo(e,n)),this}split(e,n=1,r){return aI(this,e,n,r),this}addMark(e,n,r){return X_(this,e,n,r),this}removeMark(e,n,r){return Z_(this,e,n,r),this}clearIncompatible(e,n,r){return yp(this,e,n,r),this}}const qc=Object.create(null);class fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new vI(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=V.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?V.empty:n),a==0&&Gm(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),Gm(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new le(e):Gi(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Gi(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Gi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Gt(e.node(0))}static atStart(e){return Gi(e,e,0,0,1)||new Gt(e)}static atEnd(e){return Gi(e,e,e.content.size,e.childCount,-1)||new Gt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=qc[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qc)throw new RangeError("Duplicate use of selection JSON ID "+e);return qc[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}fe.prototype.visible=!0;class vI{constructor(e,n){this.$from=e,this.$to=n}}let Um=!1;function Km(t){!Um&&!t.parent.inlineContent&&(Um=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class le extends fe{constructor(e,n=e){Km(e),Km(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return fe.near(r);let i=e.resolve(n.map(this.anchor));return new le(i.parent.inlineContent?i:r,r)}replace(e,n=V.empty){if(super.replace(e,n),n==V.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Zu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=fe.findFrom(n,r,!0)||fe.findFrom(n,-r,!0);if(o)n=o.$head;else return fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(fe.findFrom(e,-r,!0)||fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new le(e,n)}}fe.jsonID("text",le);class Zu{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Zu(e.map(this.anchor),e.map(this.head))}resolve(e){return le.between(e.resolve(this.anchor),e.resolve(this.head))}}class ee extends fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?fe.near(o):new ee(o)}content(){return new V(D.from(this.node),0,0)}eq(e){return e instanceof ee&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new kp(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ee(e.resolve(n.anchor))}static create(e,n){return new ee(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ee.prototype.visible=!1;fe.jsonID("node",ee);class kp{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Zu(r,r):new kp(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ee.isSelectable(r)?new ee(n):fe.near(n)}}class Gt extends fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=V.empty){if(n==V.empty){e.delete(0,e.doc.content.size);let r=fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Gt(e)}map(e){return new Gt(e)}eq(e){return e instanceof Gt}getBookmark(){return yI}}fe.jsonID("all",Gt);const yI={map(){return this},resolve(t){return new Gt(t)}};function Gi(t,e,n,r,i,o=!1){if(e.inlineContent)return le.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&ee.isSelectable(a))return ee.create(t,n-(i<0?a.nodeSize:0))}else{let l=Gi(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function Gm(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ke||i instanceof Ge))return;let o=t.mapping.maps[r],s;o.forEach((a,l,u,c)=>{s==null&&(s=c)}),t.setSelection(fe.near(t.doc.resolve(s),n))}const Jm=1,Ym=2,Xm=4;class bI extends m0{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Jm)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Jm)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ym,this}ensureMarks(e){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ym)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Te.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Xm,this}get scrolledIntoView(){return(this.updated&Xm)>0}}function Zm(t,e){return!e||!t?t:t.bind(e)}class Zo{constructor(e,n,r){this.name=e,this.init=Zm(n.init,r),this.apply=Zm(n.apply,r)}}const kI=[new Zo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Zo("selection",{init(t,e){return t.selection||fe.atStart(e.doc)},apply(t){return t.selection}}),new Zo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Zo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Wc{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=kI.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Zo(r.key,r.spec.state,r))})}}class no{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new no(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new bI(this)}static create(e){let n=new Wc(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new no(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Wc(this.schema,e.plugins),r=n.fields,i=new no(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Wc(e.schema,e.plugins),o=new no(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=_r.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=fe.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function g0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=g0(i,e,{})),n[r]=i}return n}class He{constructor(e){this.spec=e,this.props={},e.props&&g0(e.props,this,this.props),this.key=e.key?e.key.key:v0("plugin")}getState(e){return e[this.key]}}const Uc=Object.create(null);function v0(t){return t in Uc?t+"$"+ ++Uc[t]:(Uc[t]=0,t+"$")}class ft{constructor(e="key"){this.key=v0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const nt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Fs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let th=null;const Hn=function(t,e,n){let r=th||(th=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},xI=function(){th=null},Ci=function(t,e,n,r){return n&&(Qm(t,e,n,r,-1)||Qm(t,e,n,r,1))},wI=/^(img|br|input|textarea|hr)$/i;function Qm(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Kt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Zs(t)||wI.test(t.nodeName)||t.contentEditable=="false")return!1;e=nt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Kt(t):0}else return!1}}function Kt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function EI(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Kt(t)}else if(t.parentNode&&!Zs(t))e=nt(t),t=t.parentNode;else return null}}function CI(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Zs(t))e=nt(t)+1,t=t.parentNode;else return null}}function SI(t,e,n){for(let r=e==0,i=e==Kt(t);r||i;){if(t==n)return!0;let o=nt(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Kt(t)}}function Zs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Qu=function(t){return t.focusNode&&Ci(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ri(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function TI(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function OI(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Kt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Kt(r.startContainer),r.startOffset)}}}const An=typeof navigator<"u"?navigator:null,eg=typeof document<"u"?document:null,jr=An&&An.userAgent||"",nh=/Edge\/(\d+)/.exec(jr),y0=/MSIE \d/.exec(jr),rh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jr),St=!!(y0||rh||nh),Dr=y0?document.documentMode:rh?+rh[1]:nh?+nh[1]:0,cn=!St&&/gecko\/(\d+)/i.test(jr);cn&&+(/Firefox\/(\d+)/.exec(jr)||[0,0])[1];const ih=!St&&/Chrome\/(\d+)/.exec(jr),ut=!!ih,b0=ih?+ih[1]:0,bt=!St&&!!An&&/Apple Computer/.test(An.vendor),xo=bt&&(/Mobile\/\w+/.test(jr)||!!An&&An.maxTouchPoints>2),Wt=xo||(An?/Mac/.test(An.platform):!1),AI=An?/Win/.test(An.platform):!1,Gn=/Android \d/.test(jr),Qs=!!eg&&"webkitFontSmoothing"in eg.documentElement.style,MI=Qs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _I(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Bn(t,e){return typeof t=="number"?t:t[e]}function II(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function tg(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Fs(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?_I(o):II(a),c=0,d=0;if(e.top<u.top+Bn(r,"top")?d=-(u.top-e.top+Bn(i,"top")):e.bottom>u.bottom-Bn(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Bn(i,"top")-u.top:e.bottom-u.bottom+Bn(i,"bottom")),e.left<u.left+Bn(r,"left")?c=-(u.left-e.left+Bn(i,"left")):e.right>u.right-Bn(r,"right")&&(c=e.right-u.right+Bn(i,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let f=a.scrollLeft-h,m=a.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function DI(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:k0(t.dom)}}function k0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Fs(r));return e}function RI({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;x0(n,r==0?0:r-e)}function x0(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Wi=null;function NI(t){if(t.setActive)return t.setActive();if(Wi)return t.focus(Wi);let e=k0(t);t.focus(Wi==null?{get preventScroll(){return Wi={preventScroll:!0},!0}}:void 0),Wi||(Wi=!1,x0(e,0))}function w0(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=Hn(c).getClientRects();else continue;for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=s&&f.bottom>=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<r){n=c,r=m,i=m&&n.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(o=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!l&&f.left<=e.left&&f.right>=e.left&&(l=c,u={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=d+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?PI(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:w0(n,i)}function PI(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=pr(r,1);if(o.top!=o.bottom&&xp(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function xp(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function FI(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function LI(t,e,n){let{node:r,offset:i}=w0(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function BI(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function E0(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(xp(e,u))return E0(s,e,u)}}if((o=(o+1)%r)==i)break}return t}function VI(t,e){let n=t.dom.ownerDocument,r,i=0,o=OI(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let u=t.dom.getBoundingClientRect();if(!xp(e,u)||(s=E0(t.dom,e,u),!s))return null}if(bt)for(let u=s;r&&u;u=Fs(u))u.draggable&&(r=void 0);if(s=FI(s,e),r){if(cn&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;Qs&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=BI(t,r,i,e))}a==null&&(a=LI(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function ng(t){return t.top<t.bottom||t.left<t.right}function pr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(ng(r))return r}return Array.prototype.find.call(n,ng)||t.getBoundingClientRect()}const $I=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function C0(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Qs||cn;if(r.nodeType==3)if(s&&($I.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=pr(Hn(r,i,i),n);if(cn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=pr(Hn(r,i-1,i-1),-1);if(l.top==a.top){let u=pr(Hn(r,i,i+1),-1);if(u.top!=a.top)return zo(u,u.left<l.left)}}return a}else{let a=i,l=i,u=n<0?1:-1;return n<0&&!i?(l++,u=-1):n>=0&&i==r.nodeValue.length?(a--,u=1):n<0?a--:l++,zo(pr(Hn(r,a,l),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Kt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Kc(a.getBoundingClientRect(),!1)}if(o==null&&i<Kt(r)){let a=r.childNodes[i];if(a.nodeType==1)return Kc(a.getBoundingClientRect(),!0)}return Kc(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Kt(r))){let a=r.childNodes[i-1],l=a.nodeType==3?Hn(a,Kt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return zo(pr(l,1),!1)}if(o==null&&i<Kt(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Hn(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return zo(pr(l,-1),!0)}return zo(pr(r.nodeType==3?Hn(r):r,-n),n>=0)}function zo(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Kc(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function S0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function jI(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return S0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=C0(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Hn(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const zI=/[\u0590-\u08ac]/;function HI(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!zI.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:S0(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),g=f&&!p.contains(f.nodeType==1?f:f.parentNode)||l==f&&u==m;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return h!=null&&(a.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let rg=null,ig=null,og=!1;function qI(t,e,n){return rg==e&&ig==n?og:(rg=e,ig=n,og=n=="up"||n=="down"?jI(t,e,n):HI(t,e,n))}const Jt=0,sg=1,li=2,Mn=3;class ea{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Jt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>nt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof O0){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof T0&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?nt(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?nt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],u=s+l.size;if(i==-1&&e<=u){let c=s+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=nt(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=nt(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,f=0;p<this.children.length;p++){let m=this.children[p],g=f+m.size;if(o>f&&s<g)return m.setSelection(e-f-m.border,n-f-m.border,r,i);f=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),c=r.domSelectionRange(),d=!1;if((cn||bt)&&e==n){let{node:p,offset:f}=a;if(p.nodeType==3){if(d=!!(f&&p.nodeValue[f-1]==`
|
|
19
|
+
`),d&&f==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:nt(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=p.childNodes[f-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(cn&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let p=c.focusNode.childNodes[c.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&bt)&&Ci(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Ci(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let f=a;a=l,l=f}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?li:sg,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Mn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?li:Mn}r=s}this.dirty=li}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?li:sg;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class T0 extends ea{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Jt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class WI extends ea{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Si extends ea{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ri.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Si(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Mn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Jt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Jt}}slice(e,n,r){let i=Si.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=sh(o,n,s,r)),e>0&&(o=sh(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Rr extends ea{constructor(e,n,r,i,o,s,a,l,u){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=Ri.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let h=c;return c=_0(c,r,n),u?l=new UI(e,n,r,i,c,d||null,h,u,o,s+1):n.isText?new ec(e,n,r,i,c,h,o):new Rr(e,n,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>D.empty)}return e}matchesNode(e,n,r){return this.dirty==Jt&&e.eq(this.node)&&Hl(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new GI(this,s&&s.node,e);XI(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Te.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{l.syncToMarks(u.marks,r,e);let p;l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==li)&&(s&&this.protectLocalComposition(e,s),A0(this.contentDOM,this.children,e),xo&&ZI(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=QI(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new WI(this,o,n,i);e.input.compositionNodes.push(s),this.children=sh(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Mn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Jt}updateOuterDeco(e){if(Hl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=M0(this.dom,this.nodeDOM,oh(this.outerDeco,this.node,n),oh(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ag(t,e,n,r,i){_0(r,e,t);let o=new Rr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ec extends Rr{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Mn||this.dirty!=Jt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Jt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Jt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ec(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Mn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class O0 extends ea{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Jt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class UI extends Rr{constructor(e,n,r,i,o,s,a,l,u,c){super(e,n,r,i,o,s,a,u,c),this.spec=l}update(e,n,r,i){if(this.dirty==Mn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function A0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=lg(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof Si){let l=r?r.previousSibling:t.lastChild;A0(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=lg(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const ds=function(t){t&&(this.nodeName=t)};ds.prototype=Object.create(null);const ui=[new ds];function oh(t,e,n){if(t.length==0)return ui;let r=n?ui[0]:new ds,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new ds(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new ds(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function M0(t,e,n,r){if(n==ui&&r==ui)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=ui[0]),i=l}KI(i,a||ui[0],s)}return i}function KI(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function _0(t,e,n){return M0(t,t,ui,oh(e,n,t.nodeType!=1))}function Hl(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function lg(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class GI{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=JI(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Jt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Si.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Mn&&s.dom==s.contentDOM&&(s.dirty=li),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Rr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c=l.dom,d,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Mn&&Hl(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=li,d.updateChildren(i,s+1),d.dirty=Jt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Hl(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Rr.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=Rr.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new T0(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Si;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ec)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((bt||ut)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new O0(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function JI(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Si)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function YI(t,e){return t.type.side-e.type.side}function XI(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);r(c,i,e.forChild(o,c),u),o+=c.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){let c,d;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(YI);for(let g=0;g<d.length;g++)n(d[g],u,!!l)}else n(c,u,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(u<t.childCount)p=u,h=t.child(u++);else break;for(let g=0;g<a.length;g++)a[g].to<=o&&a.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let g=f;s<i.length&&i[s].from<g&&(g=i[s].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<f&&(l=h.cut(g-o),h=h.cut(0,g-o),f=g,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?a.filter(g=>!g.inline):a.slice();r(h,m,e.forChild(o,h),p),o=f}}function ZI(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function QI(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let u=t.child(i++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function sh(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],u=a,c=a+=l.size;u>=n||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function wp(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,u;if(Qu(n)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&ee.isSelectable(d)&&i.parent&&!(d.isInline&&SI(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;u=new ee(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,h=s;for(let p=0;p<n.rangeCount;p++){let f=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(f.startContainer,f.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(d<0)return null;[l,s]=h==t.state.selection.anchor?[h,d]:[d,h],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let d=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;u=Ep(t,c,a,d)}return u}function I0(t){return t.editable?t.hasFocus():R0(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Xn(t,e=!1){let n=t.state.selection;if(D0(t,n),!!I0(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ut){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Ci(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)tD(t);else{let{anchor:r,head:i}=n,o,s;ug&&!(n instanceof le)&&(n.$from.parent.inlineContent||(o=cg(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=cg(t,n.to))),t.docView.setSelection(r,i,t,e),ug&&(o&&dg(o),s&&dg(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&eD(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ug=bt||ut&&b0<63;function cg(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(bt&&i&&i.contentEditable=="false")return Gc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Gc(i);if(o)return Gc(o)}}function Gc(t){return t.contentEditable="true",bt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function dg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function eD(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!I0(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function tD(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,nt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&St&&Dr<=11&&(r.disabled=!0,r.disabled=!1)}function D0(t,e){if(e instanceof ee){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(hg(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else hg(t)}function hg(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ep(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function pg(t){return t.editable&&!t.hasFocus()?!1:R0(t)}function R0(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function nD(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ci(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ah(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&fe.findFrom(o,e)}function mr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function fg(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return mr(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ah(t.state,e);return i&&i instanceof ee?mr(t,i):!1}else if(!(Wt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?ee.isSelectable(o)?mr(t,new ee(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Qs?mr(t,new le(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ee&&r.node.isInline)return mr(t,new le(e>0?r.$to:r.$from));{let i=ah(t.state,e);return i?mr(t,i):!1}}}function ql(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function hs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ui(t,e){return e<0?rD(t):iD(t)}function rD(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(cn&&n.nodeType==1&&r<ql(n)&&hs(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(hs(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(N0(n))break;{let a=n.previousSibling;for(;a&&hs(a,-1);)i=n.parentNode,o=nt(a),a=a.previousSibling;if(a)n=a,r=ql(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?lh(t,n,r):i&&lh(t,i,o)}function iD(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ql(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(hs(a,1))o=n,s=++r;else break}else{if(N0(n))break;{let a=n.nextSibling;for(;a&&hs(a,1);)o=a.parentNode,s=nt(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=ql(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&lh(t,o,s)}function N0(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function oD(t,e){for(;t&&e==t.childNodes.length&&!Zs(t);)e=nt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function sD(t,e){for(;t&&!e&&!Zs(t);)e=nt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function lh(t,e,n){if(e.nodeType!=3){let o,s;(s=oD(e,n))?(e=s,n=0):(o=sD(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Qu(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Xn(t)},50)}function mg(t,e){let n=t.state.doc.resolve(e);if(!(ut||AI)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function gg(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Wt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ah(t.state,e);if(s&&s instanceof ee)return mr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Gt?fe.near(s,e):fe.findFrom(s,e);return a?mr(t,a):!1}return!1}function vg(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function yg(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function aD(t){if(!bt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;yg(t,r,"true"),setTimeout(()=>yg(t,r,"false"),20)}return!1}function lD(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function uD(t,e){let n=e.keyCode,r=lD(e);if(n==8||Wt&&n==72&&r=="c")return vg(t,-1)||Ui(t,-1);if(n==46&&!e.shiftKey||Wt&&n==68&&r=="c")return vg(t,1)||Ui(t,1);if(n==13||n==27)return!0;if(n==37||Wt&&n==66&&r=="c"){let i=n==37?mg(t,t.state.selection.from)=="ltr"?-1:1:-1;return fg(t,i,r)||Ui(t,i)}else if(n==39||Wt&&n==70&&r=="c"){let i=n==39?mg(t,t.state.selection.from)=="ltr"?1:-1:1;return fg(t,i,r)||Ui(t,i)}else{if(n==38||Wt&&n==80&&r=="c")return gg(t,-1,r)||Ui(t,-1);if(n==40||Wt&&n==78&&r=="c")return aD(t)||gg(t,1,r)||Ui(t,1);if(r==(Wt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Cp(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Ri.fromSchema(t.state.schema),a=$0(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=V0[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let f=a.createElement(c[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
20
|
+
|
|
21
|
+
`);return{dom:l,text:h,slice:e}}function P0(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new V(D.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
22
|
+
`))),0,0):V.empty;let d=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(d)a=d;else{let h=i.marks(),{schema:p}=t.state,f=Ri.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=pD(n),Qs&&fD(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Ir.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!cD.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=mD(bg(a,+c[1],+c[2]),c[4]);else if(a=V.maxOpen(dD(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=bg(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const cD=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function dD(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(s=>{if(!o)return;let a=r.findWrapping(s.type),l;if(!a)return o=null;if(l=o.length&&i.length&&L0(a,i,s,o[o.length-1],0))o[o.length-1]=l;else{o.length&&(o[o.length-1]=B0(o[o.length-1],i.length));let u=F0(s,a);o.push(u),r=r.matchType(u.type),i=a}}),o)return D.from(o)}return t}function F0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,D.from(t));return t}function L0(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=L0(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(D.from(F0(n,t,i+1))))}}function B0(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,B0(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(D.empty,!0);return t.copy(n.append(r))}function uh(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=uh(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(D.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function bg(t,e,n){return e<t.openStart&&(t=new V(uh(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new V(uh(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const V0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let kg=null;function $0(){return kg||(kg=document.implementation.createHTMLDocument("title"))}let Jc=null;function hD(t){let e=window.trustedTypes;return e?(Jc||(Jc=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Jc.createHTML(t)):t}function pD(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=$0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&V0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=hD(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function fD(t){let e=t.querySelectorAll(ut?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function mD(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=D.from(l.create(r[a+1],i)),o++,s++}return new V(i,o,s)}const kt={},xt={},gD={touchstart:!0,touchmove:!0};class vD{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function yD(t){for(let e in kt){let n=kt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{kD(t,r)&&!Sp(t,r)&&(t.editable||!(r.type in xt))&&n(t,r)},gD[e]?{passive:!0}:void 0)}bt&&t.dom.addEventListener("input",()=>null),ch(t)}function Cr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function bD(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function ch(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Sp(t,r))})}function Sp(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function kD(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function xD(t,e){!Sp(t,e)&&kt[e.type]&&(t.editable||!(e.type in xt))&&kt[e.type](t,e)}xt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!z0(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Gn&&ut&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),xo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,ri(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||uD(t,n)?n.preventDefault():Cr(t,"key")};xt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};xt.keypress=(t,e)=>{let n=e;if(z0(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Wt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function tc(t){return{left:t.clientX,top:t.clientY}}function wD(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Tp(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function co(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function ED(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ee.isSelectable(r)?(co(t,new ee(n)),!0):!1}function CD(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ee&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ee.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(co(t,ee.create(t.state.doc,i)),!0):!1}function SD(t,e,n,r,i){return Tp(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?CD(t,n):ED(t,n))}function TD(t,e,n,r){return Tp(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function OD(t,e,n,r){return Tp(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||AD(t,n,r)}function AD(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(co(t,le.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)co(t,le.create(r,a+1,a+1+s.content.size));else if(ee.isSelectable(s))co(t,ee.create(r,a));else continue;return!0}}function Op(t){return Wl(t)}const j0=Wt?"metaKey":"ctrlKey";kt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Op(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&wD(n,t.input.lastClick)&&!n[j0]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(tc(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new MD(t,s,n,!!r)):(o=="doubleClick"?TD:OD)(t,s.pos,s.inside,n)?n.preventDefault():Cr(t,"pointer"))};class MD{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[j0],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof ee&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&cn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Cr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Xn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(tc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Cr(this.view,"pointer"):SD(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||bt&&this.mightDrag&&!this.mightDrag.node.isAtom||ut&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(co(this.view,fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Cr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}kt.touchstart=t=>{t.input.lastTouch=Date.now(),Op(t),Cr(t,"pointer")};kt.touchmove=t=>{t.input.lastTouch=Date.now(),Cr(t,"pointer")};kt.contextmenu=t=>Op(t);function z0(t,e){return t.composing?!0:bt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const _D=Gn?5e3:-1;xt.compositionstart=xt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Wl(t,!0),t.markCursor=null;else if(Wl(t,!e.selection.empty),cn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}H0(t,_D)};xt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,H0(t,20))};function H0(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Wl(t),e))}function q0(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=DD());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ID(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=EI(e.focusNode,e.focusOffset),r=CI(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function DD(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Wl(t,e=!1){if(!(Gn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),q0(t),e||t.docView&&t.docView.dirty){let n=wp(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function RD(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Ls=St&&Dr<15||xo&&MI<604;kt.copy=xt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Ls?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Cp(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):RD(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ND(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function PD(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Bs(t,r.value,null,i,e):Bs(t,r.textContent,r.innerHTML,i,e)},50)}function Bs(t,e,n,r,i){let o=P0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||V.empty)))return!0;if(!o)return!1;let s=ND(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function W0(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}xt.paste=(t,e)=>{let n=e;if(t.composing&&!Gn)return;let r=Ls?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Bs(t,W0(r),r.getData("text/html"),i,n)?n.preventDefault():PD(t,n)};class U0{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const K0=Wt?"altKey":"ctrlKey";kt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(tc(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ee?i.to-1:i.to))){if(r&&r.mightDrag)s=ee.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=ee.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=Cp(t,a);(!n.dataTransfer.files.length||!ut||b0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ls?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ls||n.dataTransfer.setData("text/plain",u),t.dragging=new U0(c,!n[K0],s)};kt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};xt.dragover=xt.dragenter=(t,e)=>e.preventDefault();xt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(tc(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",f=>{s=f(s,t)}):s=P0(t,W0(n.dataTransfer),Ls?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[K0]);if(t.someProp("handleDrop",f=>f(t,n,s||V.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?c0(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:f}=r;f?f.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(d&&ee.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ee(p));else{let f=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,g,y,b)=>f=b),u.setSelection(Ep(t,p,u.doc.resolve(f)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};kt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Xn(t)},20))};kt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};kt.beforeinput=(t,e)=>{if(ut&&Gn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ri(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in xt)kt[t]=xt[t];function Vs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ul{constructor(e,n){this.toDOM=e,this.spec=n||pi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Pt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ul&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Vs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Nr{constructor(e,n){this.attrs=e,this.spec=n||pi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Pt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Nr&&Vs(this.attrs,e.attrs)&&Vs(this.spec,e.spec)}static is(e){return e.type instanceof Nr}destroy(){}}class Ap{constructor(e,n){this.attrs=e,this.spec=n||pi}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Pt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Ap&&Vs(this.attrs,e.attrs)&&Vs(this.spec,e.spec)}destroy(){}}class Pt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Pt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Pt(e,e,new Ul(n,r))}static inline(e,n,r,i){return new Pt(e,n,new Nr(r,i))}static node(e,n,r,i){return new Pt(e,n,new Ap(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Nr}get widget(){return this.type instanceof Ul}}const Ji=[],pi={};class $e{constructor(e,n){this.local=e.length?e:Ji,this.children=n.length?n:Ji}static create(e,n){return n.length?Kl(n,e,0,pi):at}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==at||e.maps.length==0?this:this.mapInner(e,n,0,0,r||pi)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?FD(this.children,s||[],e,n,r,i,o):s?new $e(s.sort(fi),Ji):at}add(e,n){return n.length?this==at?$e.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let u=l+r,c;if(c=J0(n,a,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,c,u+1):i.splice(o,0,l,l+a.nodeSize,Kl(c,a,u+1,pi)),o+=3}});let s=G0(o?Y0(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new $e(s.length?this.local.concat(s).sort(fi):this.local,i||this.children)}remove(e){return e.length==0||this==at?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,a+1);u!=at?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new $e(i,r):at}forChild(e,n){if(this==at)return this;if(n.isLeaf)return $e.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Nr){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new $e(i.sort(fi),Ji);return r?new br([a,r]):a}return r||at}eq(e){if(this==e)return!0;if(!(e instanceof $e)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Mp(this.localsInner(e))}localsInner(e){if(this==at)return Ji;if(e.inlineContent||!this.local.some(Nr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Nr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}$e.empty=new $e([],[]);$e.removeOverlap=Mp;const at=$e.empty;class br{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,pi));return br.from(r)}forChild(e,n){if(n.isLeaf)return $e.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=at&&(o instanceof br?r=r.concat(o.members):r.push(o))}return br.from(r)}eq(e){if(!(e instanceof br)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Mp(r?n:n.sort(fi)):Ji}static from(e){switch(e.length){case 0:return at;case 1:return e[0];default:return new br(e.every(n=>n instanceof $e)?e:e.reduce((n,r)=>n.concat(r instanceof $e?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function FD(t,e,n,r,i,o,s){let a=t.slice();for(let u=0,c=o;u<n.maps.length;u++){let d=0;n.maps[u].forEach((h,p,f,m)=>{let g=m-f-(p-h);for(let y=0;y<a.length;y+=3){let b=a[y+1];if(b<0||h>b+c-d)continue;let k=a[y]+c-d;p>=k?a[y+1]=h<=k?-2:-1:h>=c&&g&&(a[y]+=g,a[y+1]+=g)}d+=g}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(t[u]+o),d=c-i;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(t[u+1]+o,-1),p=h-i,{index:f,offset:m}=r.content.findIndex(d),g=r.maybeChild(f);if(g&&m==d&&m+g.nodeSize==p){let y=a[u+2].mapInner(n,g,c+1,t[u]+o+1,s);y!=at?(a[u]=d,a[u+1]=p,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=LD(a,t,e,n,i,o,s),c=Kl(u,r,0,s);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<c.children.length;d+=3){let p=c.children[d];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,c.children[d],c.children[d+1],c.children[d+2])}}return new $e(e.sort(fi),a)}function G0(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Pt(i.from+e,i.to+e,i.type))}return n}function LD(t,e,n,r,i,o,s){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(r,i,u);d?n.push(d):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function J0(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Y0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Kl(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let u=J0(t,a,l+n);if(u){o=!0;let c=Kl(u,a,n+l+1,r);c!=at&&i.push(l,l+a.nodeSize,c)}});let s=G0(o?Y0(t):t,-n).sort(fi);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new $e(s,i):at}function fi(t,e){return t.from-e.from||t.to-e.to}function Mp(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),xg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),xg(e,i,r.copy(o.from,r.to)));break}}}return e}function xg(t,e,n){for(;e<t.length&&fi(n,t[e])>0;)e++;t.splice(e,0,n)}function Yc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=at&&e.push(r)}),t.cursorWrapper&&e.push($e.create(t.state.doc,[t.cursorWrapper.deco])),br.from(e)}const BD={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},VD=St&&Dr<=11;class $D{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class jD{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new $D,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);St&&Dr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),VD&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,BD)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(pg(this.view)){if(this.suppressingSelectionUpdates)return Xn(this.view);if(St&&Dr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ci(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Fs(o))n.add(o);for(let o=e.anchorNode;o;o=Fs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&pg(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(cn&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,h]=c;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of c){let p=h.parentNode;p&&p.nodeName=="LI"&&(!d||qD(e,d)!=p)&&h.remove()}}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Qu(r)&&(u=wp(e))&&u.eq(fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),zD(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Xn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(St&&Dr<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:h}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?nt(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?nt(o):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let wg=new WeakMap,Eg=!1;function zD(t){if(!wg.has(t)&&(wg.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=cn,Eg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Eg=!0}}function Cg(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Ci(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function HD(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Cg(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Cg(t,n):null}function qD(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function WD(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],Qu(l)||u.push({node:l.focusNode,offset:l.focusOffset})),ut&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){o=g;break}if(!b||b.size)break}let d=t.state.doc,h=t.someProp("domParser")||Ir.fromSchema(t.state.schema),p=d.resolve(s),f=null,m=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:UD,context:p});if(u&&u[0].pos!=null){let g=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=g),f={anchor:g+s,head:y+s}}return{doc:m,sel:f,from:s,to:a}}function UD(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(bt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||bt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const KD=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function GD(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=wp(t,S);if(O&&!t.state.selection.eq(O)){if(ut&&Gn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",T=>T(t,ri(13,"Enter"))))return;let C=t.state.tr.setSelection(O);S=="pointer"?C.setMeta("pointer",!0):S=="key"&&C.scrollIntoView(),o&&C.setMeta("composition",o),t.dispatch(C)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=WD(t,e,n),c=t.state.doc,d=c.slice(u.from,u.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let f=XD(d.content,u.doc.content,u.from,h,p);if(f&&t.input.domChangeCount++,(xo&&t.input.lastIOSEnter>Date.now()-225||Gn)&&i.some(S=>S.nodeType==1&&!KD.test(S.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",S=>S(t,ri(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let S=Sg(t,t.state.doc,u.sel);if(S&&!S.eq(t.state.selection)){let O=t.state.tr.setSelection(S);o&&O.setMeta("composition",o),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof le&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),St&&Dr<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)==" "&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),y=c.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA,k;if((xo&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&!m.sameParent(g)&&(k=fe.findFrom(u.doc.resolve(m.pos+1),1,!0))&&k.head==g.pos)&&t.someProp("handleKeyDown",S=>S(t,ri(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&YD(c,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",S=>S(t,ri(8,"Backspace")))){Gn&&ut&&t.domObserver.suppressSelectionUpdates();return}ut&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Gn&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,ri(13,"Enter"))})},20));let v=f.start,w=f.endA,x,_,A;if(b){if(m.pos==g.pos)St&&Dr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xn(t),20)),x=t.state.tr.delete(v,w),_=c.resolve(f.start).marksAcross(c.resolve(f.endA));else if(f.endA==f.endB&&(A=JD(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))x=t.state.tr,A.type=="add"?x.addMark(v,w,A.mark):x.removeMark(v,w,A.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let S=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",O=>O(t,v,w,S)))return;x=t.state.tr.insertText(S,v,w)}}if(x||(x=t.state.tr.replace(v,w,u.doc.slice(f.start-u.from,f.endB-u.from))),u.sel){let S=Sg(t,x.doc,u.sel);S&&!(ut&&t.composing&&S.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(S.head==v||S.head==x.mapping.map(w)-1)||St&&S.empty&&S.head==v)&&x.setSelection(S)}_&&x.ensureMarks(_),o&&x.setMeta("composition",o),t.dispatch(x.scrollIntoView())}function Sg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ep(t,e.resolve(n.anchor),e.resolve(n.head))}function JD(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<n.length;c++)o=n[c].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=c=>c.mark(a.addToSet(c.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(D.from(u).eq(t))return{mark:a,type:s}}function YD(t,e,n,r,i){if(n-e<=i.pos-r.pos||Xc(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Xc(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Xc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Xc(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function XD(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&Tg(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&Tg(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function Tg(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class ZD{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vD,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Ig),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Mg(this),Ag(this),this.nodeViews=_g(this),this.docView=ag(this.state.doc,Og(this),Yc(this),this.dom,this),this.domObserver=new jD(this,(r,i,o,s)=>GD(this,r,i,o,s)),this.domObserver.start(),yD(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ch(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ig),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(q0(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=_g(this);eR(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ch(this),this.editable=Mg(this),Ag(this);let l=Yc(this),u=Og(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(i.selection))&&(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&DI(this);if(s){this.domObserver.stop();let p=d&&(St||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&QD(i.selection,e.selection);if(d){let f=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ID(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=ag(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&nD(this))?Xn(this,p):(D0(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&RI(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ee){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&tg(this,n.getBoundingClientRect(),e)}else tg(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new U0(e.slice,e.move,i<0?void 0:ee.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(St){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NI(this.dom),Xn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return VI(this,e)}coordsAtPos(e,n=1){return C0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return qI(this,n||this.state,e)}pasteHTML(e,n){return Bs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Bs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Cp(this,e)}destroy(){this.docView&&(bD(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,xI())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return xD(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?bt&&this.root.nodeType===11&&TI(this.dom.ownerDocument)==this.dom&&HD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Og(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Pt.node(0,t.state.doc.content.size,e)]}function Ag(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Pt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Mg(t){return!t.someProp("editable",e=>e(t.state)===!1)}function QD(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function _g(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function eR(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Ig(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Vr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Gl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tR=typeof navigator<"u"&&/Mac/.test(navigator.platform),nR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)Vr[48+rt]=Vr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)Vr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)Vr[rt]=String.fromCharCode(rt+32),Gl[rt]=String.fromCharCode(rt);for(var Zc in Vr)Gl.hasOwnProperty(Zc)||(Gl[Zc]=Vr[Zc]);function rR(t){var e=tR&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||nR&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gl:Vr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const iR=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function oR(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))iR?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function sR(t){let e=Object.create(null);for(let n in t)e[oR(n)]=t[n];return e}function Qc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function aR(t){return new He({props:{handleKeyDown:X0(t)}})}function X0(t){let e=sR(t);return function(n,r){let i=rR(r),o,s=e[Qc(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Qc(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Vr[r.keyCode])&&o!=i){let a=e[Qc(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const lR=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Z0(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const uR=(t,e,n)=>{let r=Z0(t);if(!r)return!1;let i=_p(r);if(!i){let s=r.blockRange(),a=s&&Io(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(nk(t,i,e,-1))return!0;if(r.parent.content.size==0&&(wo(o,"end")||ee.isSelectable(o)))for(let s=r.depth;;s--){let a=Xu(t.doc,r.before(s),r.after(s),V.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(wo(o,"end")?fe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ee.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},cR=(t,e,n)=>{let r=Z0(t);if(!r)return!1;let i=_p(r);return i?Q0(t,i,e):!1},dR=(t,e,n)=>{let r=ek(t);if(!r)return!1;let i=Ip(r);return i?Q0(t,i,e):!1};function Q0(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Xu(t.doc,o,l,V.empty);if(!u||u.from!=o||u instanceof Ke&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(le.create(c.doc,o)),n(c.scrollIntoView())}return!0}function wo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const hR=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;o=_p(r)}let s=o&&o.nodeBefore;return!s||!ee.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ee.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function _p(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ek(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset<n.parent.content.size?null:n}const pR=(t,e,n)=>{let r=ek(t);if(!r)return!1;let i=Ip(r);if(!i)return!1;let o=i.nodeAfter;if(nk(t,i,e,1))return!0;if(r.parent.content.size==0&&(wo(o,"start")||ee.isSelectable(o))){let s=Xu(t.doc,r.before(),r.after(),V.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(wo(o,"start")?fe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ee.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},fR=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset<r.parent.content.size)return!1;o=Ip(r)}let s=o&&o.nodeAfter;return!s||!ee.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ee.create(t.doc,o.pos)).scrollIntoView()),!0)};function Ip(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const mR=(t,e)=>{let n=t.selection,r=n instanceof ee,i;if(r){if(n.node.isTextblock||!$r(t.doc,n.from))return!1;i=n.from}else if(i=Yu(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(ee.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gR=(t,e)=>{let n=t.selection,r;if(n instanceof ee){if(n.node.isTextblock||!$r(t.doc,n.to))return!1;r=n.to}else if(r=Yu(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},vR=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Io(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},yR=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
23
|
+
`).scrollIntoView()),!0)};function tk(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const bR=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=tk(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},kR=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Gt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=tk(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(le.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},xR=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(lo(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Io(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},wR=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(ee.create(t.doc,i))),!0)};function ER(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||$r(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function nk(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&ER(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,f=D.empty;for(let y=s.length-1;y>=0;y--)f=D.from(s[y].create(null,f));f=D.from(i.copy(f));let m=t.tr.step(new Ge(e.pos-1,p,e.pos,p,new V(f,1,0),s.length,!0)),g=m.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&$r(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&l?null:fe.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Io(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(u&&wo(o,"start",!0)&&wo(i,"end")){let p=i,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let y=D.empty;for(let k=f.length-1;k>=0;k--)y=D.from(f[k].copy(y));let b=t.tr.step(new Ge(e.pos-f.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new V(y,f.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function rk(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const CR=rk(-1),SR=rk(1);function TR(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&bp(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Dg(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function OR(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return AR(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function AR(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);o=new jl(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new jl(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=bp(o,n,r,e);return a?(t&&MR(t,e,a,i,n),!0):!1}function MR(t,e,n,r,i){let o=D.empty;for(let c=n.length-1;c>=0;c--)o=D.from(n[c].type.create(n[c].attrs,o));t.step(new Ge(e.start-(r?2:0),e.end,e.start,e.end,new V(o,0,0),n.length,!0));let s=0;for(let c=0;c<n.length;c++)n[c].type==i&&(s=c+1);let a=n.length-s,l=e.start+n.length-(r?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,h=!0;c<d;c++,h=!1)!h&&lo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function _R(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?IR(e,n,t,o):DR(e,n,o):!0:!1}}function IR(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ge(o-1,s,o,s,new V(D.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new jl(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Io(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return $r(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function DR(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)p-=i.child(f).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?D.empty:D.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new Ge(d-(a?1:0),h+(l?1:0),d+1,h-1,new V((a?D.empty:D.from(i.copy(D.empty))).append(l?D.empty:D.from(i.copy(D.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function RR(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=D.from(u?t.create():null),d=new V(D.from(t.create(null,D.from(a.type.create(null,c)))),u?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ge(h-(u?3:1),p,h,p,d,1,!0)).scrollIntoView())}return!0}}function nc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class rc{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const c=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...f)=>{const m=this.buildProps(u,n),g=p(...f)(m);return a.push(g),d}])),run:c};return d}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:nc({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}}class NR{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function q(t,e,n){return t.config[e]===void 0&&t.parent?q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?q(t.parent,e,n):null}):t.config[e]}function ic(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function ik(t){const e=[],{nodeExtensions:n,markExtensions:r}=ic(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=q(s,"addGlobalAttributes",a);l&&l().forEach(u=>{u.types.forEach(c=>{Object.entries(u.attributes).forEach(([d,h])=>{e.push({type:c,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=q(s,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,d])=>{const h={...o,...d};typeof h?.default=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&h?.default===void 0&&delete h.default,e.push({type:s.name,name:c,attribute:h})})}),e}function Xe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function it(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?String(o).split(" "):[],a=r[i]?r[i].split(" "):[],l=s.filter(u=>!a.includes(u));r[i]=[...a,...l].join(" ")}else if(i==="style"){const s=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],l=new Map;a.forEach(u=>{const[c,d]=u.split(":").map(h=>h.trim());l.set(c,d)}),s.forEach(u=>{const[c,d]=u.split(":").map(h=>h.trim());l.set(c,d)}),r[i]=Array.from(l.entries()).map(([u,c])=>`${u}: ${c}`).join("; ")}else r[i]=o}),r},{})}function dh(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>it(n,r),{})}function ok(t){return typeof t=="function"}function ve(t,e=void 0,...n){return ok(t)?e?t.bind(e)(...n):t(...n):t}function PR(t={}){return Object.keys(t).length===0&&t.constructor===Object}function FR(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Rg(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):FR(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function Ng(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&PR(n)?!1:n!=null))}function LR(t,e){var n;const r=ik(t),{nodeExtensions:i,markExtensions:o}=ic(t),s=(n=i.find(u=>q(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const c=r.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((y,b)=>{const k=q(b,"extendNodeSchema",d);return{...y,...k?k(u):{}}},{}),p=Ng({...h,content:ve(q(u,"content",d)),marks:ve(q(u,"marks",d)),group:ve(q(u,"group",d)),inline:ve(q(u,"inline",d)),atom:ve(q(u,"atom",d)),selectable:ve(q(u,"selectable",d)),draggable:ve(q(u,"draggable",d)),code:ve(q(u,"code",d)),whitespace:ve(q(u,"whitespace",d)),linebreakReplacement:ve(q(u,"linebreakReplacement",d)),defining:ve(q(u,"defining",d)),isolating:ve(q(u,"isolating",d)),attrs:Object.fromEntries(c.map(y=>{var b;return[y.name,{default:(b=y?.attribute)===null||b===void 0?void 0:b.default}]}))}),f=ve(q(u,"parseHTML",d));f&&(p.parseDOM=f.map(y=>Rg(y,c)));const m=q(u,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:dh(y,c)}));const g=q(u,"renderText",d);return g&&(p.toText=g),[u.name,p]})),l=Object.fromEntries(o.map(u=>{const c=r.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((g,y)=>{const b=q(y,"extendMarkSchema",d);return{...g,...b?b(u):{}}},{}),p=Ng({...h,inclusive:ve(q(u,"inclusive",d)),excludes:ve(q(u,"excludes",d)),group:ve(q(u,"group",d)),spanning:ve(q(u,"spanning",d)),code:ve(q(u,"code",d)),attrs:Object.fromEntries(c.map(g=>{var y;return[g.name,{default:(y=g?.attribute)===null||y===void 0?void 0:y.default}]}))}),f=ve(q(u,"parseHTML",d));f&&(p.parseDOM=f.map(g=>Rg(g,c)));const m=q(u,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:dh(g,c)})),[u.name,p]}));return new Qb({topNode:s,nodes:a,marks:l})}function ed(t,e){return e.nodes[t]||e.marks[t]||null}function Pg(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Dp(t,e){const n=Ri.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const BR=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function Rp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class oc{constructor(e){this.find=e.find,this.handler=e.handler}}const VR=(t,e)=>{if(Rp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Pa(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let c=!1;const d=BR(u)+o;return s.forEach(h=>{if(c)return;const p=VR(d,h.find);if(!p)return;const f=l.state.tr,m=nc({state:l.state,transaction:f}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:b,can:k}=new rc({editor:n,state:m});h.handler({state:m,range:g,match:p,commands:y,chain:b,can:k})===null||!f.steps.length||(f.setMeta(a,{transform:f,from:r,to:i,text:o}),l.dispatch(f),c=!0)}),c}function $R(t){const{editor:e,rules:n}=t,r=new He({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Dp(D.from(u),s.schema);const{from:c}=l,d=c+u.length;Pa({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Pa({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Pa({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Pa({editor:e,from:s.pos,to:s.pos,text:`
|
|
24
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function jR(t){return Object.prototype.toString.call(t).slice(8,-1)}function Fa(t){return jR(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function sc(t,e){const n={...t};return Fa(t)&&Fa(e)&&Object.keys(e).forEach(r=>{Fa(e[r])&&Fa(t[r])?n[r]=sc(t[r],e[r]):n[r]=e[r]}),n}class rr{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(q(this,"addOptions",{name:this.name}))),this.storage=ve(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new rr(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>sc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new rr(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ve(q(n,"addOptions",{name:n.name})),n.storage=ve(q(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!o.find(a=>a?.type.name===n.name))return!1;const s=o.find(a=>a?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function zR(t){return typeof t=="number"}class HR{constructor(e){this.find=e.find,this.handler=e.handler}}const qR=(t,e,n)=>{if(Rp(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function WR(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new rc({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const f=Math.max(r,p),m=Math.min(i,p+h.content.size),g=h.textBetween(f-p,m-p,void 0,"");qR(g,o.find,s).forEach(y=>{if(y.index===void 0)return;const b=f+y.index+1,k=b+y[0].length,v={from:n.tr.mapping.map(b),to:n.tr.mapping.map(k)},w=o.handler({state:n,range:v,match:y,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});d.push(w)})}),d.every(h=>h!==null)}let La=null;const UR=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function KR(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:c,to:d,rule:h,pasteEvt:p})=>{const f=u.tr,m=nc({state:u,transaction:f});if(!(!WR({editor:e,state:m,from:Math.max(c-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!f.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,f}};return n.map(u=>new He({view(c){const d=p=>{var f;r=!((f=c.dom.parentElement)===null||f===void 0)&&f.contains(p.target)?c.dom.parentElement:null,r&&(La=e)},h=()=>{La&&(La=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(c,d)=>{if(o=r===c.dom.parentElement,a=d,!o){const h=La;h&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(c,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(c,d,h)=>{const p=c[0],f=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o,g=p.getMeta("applyPasteRules"),y=!!g;if(!f&&!m&&!y)return;if(y){let{text:v}=g;typeof v=="string"?v=v:v=Dp(D.from(v),h.schema);const{from:w}=g,x=w+v.length,_=UR(v);return l({rule:u,state:h,from:w,to:{b:x},pasteEvt:_})}const b=d.doc.content.findDiffStart(h.doc.content),k=d.doc.content.findDiffEnd(h.doc.content);if(!(!zR(b)||!k||b===k.b))return l({rule:u,state:h,from:b,to:k,pasteEvt:s})}}))}function GR(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class ro{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ro.resolve(e),this.schema=LR(this.extensions,n),this.setupExtensions()}static resolve(e){const n=ro.sort(ro.flatten(e)),r=GR(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=q(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const i=q(n,"priority")||100,o=q(r,"priority")||100;return i>o?-1:i<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ed(n.name,this.schema)},i=q(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=ro.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:ed(s.name,this.schema)},l=[],u=q(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&q(s,"exitable",a)&&(c.ArrowRight=()=>rr.handleExit({editor:e,mark:s})),u){const m=Object.fromEntries(Object.entries(u()).map(([g,y])=>[g,()=>y({editor:e})]));c={...c,...m}}const d=aR(c);l.push(d);const h=q(s,"addInputRules",a);Pg(s,e.options.enableInputRules)&&h&&r.push(...h());const p=q(s,"addPasteRules",a);Pg(s,e.options.enablePasteRules)&&p&&i.push(...p());const f=q(s,"addProseMirrorPlugins",a);if(f){const m=f();l.push(...m)}return l}).flat();return[$R({editor:e,rules:r}),...KR({editor:e,rules:i}),...o]}get attributes(){return ik(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=ic(this.extensions);return Object.fromEntries(n.filter(r=>!!q(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Xe(r.name,this.schema)},s=q(r,"addNodeView",o);if(!s)return[];const a=(l,u,c,d,h)=>{const p=dh(l,i);return s()({node:l,view:u,getPos:c,decorations:d,innerDecorations:h,editor:e,extension:r,HTMLAttributes:p})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:ed(e.name,this.schema)};e.type==="mark"&&(!((n=ve(q(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=q(e,"onBeforeCreate",r),o=q(e,"onCreate",r),s=q(e,"onUpdate",r),a=q(e,"onSelectionUpdate",r),l=q(e,"onTransaction",r),u=q(e,"onFocus",r),c=q(e,"onBlur",r),d=q(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class Ze{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(q(this,"addOptions",{name:this.name}))),this.storage=ve(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ze(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>sc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ze({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ve(q(n,"addOptions",{name:n.name})),n.storage=ve(q(n,"addStorage",{name:n.name,options:n.options})),n}}function sk(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
25
|
+
|
|
26
|
+
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,d)=>{var h;l.isBlock&&u>r&&(a+=o);const p=s?.[l.type.name];if(p)return c&&(a+=p({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(h=l?.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u))}),a}function Np(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const JR=Ze.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new He({key:new ft("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=Np(n);return sk(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),YR=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),XR=(t=!1)=>({commands:e})=>e.setContent("",t),ZR=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),h=u.resolve(c.map(l+a.nodeSize)),p=d.blockRange(h);if(!p)return;const f=Io(p);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(f||f===0)&&e.lift(p,f)})}),!0},QR=t=>e=>t(e),eN=()=>({state:t,dispatch:e})=>kR(t,e),tN=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},nN=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const s=i.before(o),a=i.after(o);t.delete(s,a).scrollIntoView()}return!0}return!1},rN=t=>({tr:e,state:n,dispatch:r})=>{const i=Xe(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),l=o.after(s);e.delete(a,l).scrollIntoView()}return!0}return!1},iN=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},oN=()=>({state:t,dispatch:e})=>lR(t,e),sN=()=>({commands:t})=>t.keyboardShortcut("Enter"),aN=()=>({state:t,dispatch:e})=>bR(t,e);function Jl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Rp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function ak(t,e,n={}){return t.find(r=>r.type===e&&Jl(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Fg(t,e,n={}){return!!ak(t,e,n)}function Pp(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!ak([...i.node.marks],e,n)))return;let o=i.index,s=t.start()+i.offset,a=o+1,l=s+i.node.nodeSize;for(;o>0&&Fg([...t.parent.child(o-1).marks],e,n);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&Fg([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function zr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const lN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=zr(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const d=Pp(l,o,e);if(d&&d.from<=u&&d.to>=c){const h=le.create(s,d.from,d.to);n.setSelection(h)}}return!0},uN=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Fp(t){return t instanceof le}function Jn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function lk(t,e=null){if(!e)return null;const n=fe.atStart(t),r=fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?le.create(t,Jn(0,i,o),Jn(t.content.size,i,o)):le.create(t,Jn(e,i,o),Jn(e,i,o))}function cN(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Lp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const dN=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Lp()||cN())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Fp(n.state.selection))return s(),!0;const a=lk(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},hN=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),pN=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),uk=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&uk(r)}return t};function Ba(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return uk(n)}function Yl(t,e,n){if(t instanceof _r||t instanceof D)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return D.fromArray(t.map(s=>e.nodeFromJSON(s)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Yl("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const l=new Qb({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Ir.fromSchema(l).parseSlice(Ba(t),n.parseOptions):Ir.fromSchema(l).parse(Ba(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Ir.fromSchema(e);return n.slice?o.parseSlice(Ba(t),n.parseOptions).content:o.parse(Ba(t),n.parseOptions)}return Yl("",e,n)}function fN(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ke||i instanceof Ge))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,u,c)=>{s===0&&(s=c)}),t.setSelection(fe.near(t.doc.resolve(s),n))}const mN=t=>!("type"in t),gN=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Yl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(p){return o.emit("contentError",{editor:o,error:p,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,d=!0;if((mN(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),l===u&&d){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;if(c){if(Array.isArray(e))h=e.map(p=>p.text||"").join("");else if(e instanceof D){let p="";e.forEach(f=>{f.text&&(p+=f.text)}),h=p}else typeof e=="object"&&e&&e.text?h=e.text:h=e;r.insertText(h,l,u)}else h=a,r.replaceWith(l,u,h);n.updateSelection&&fN(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},vN=()=>({state:t,dispatch:e})=>mR(t,e),yN=()=>({state:t,dispatch:e})=>gR(t,e),bN=()=>({state:t,dispatch:e})=>uR(t,e),kN=()=>({state:t,dispatch:e})=>pR(t,e),xN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Yu(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},wN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Yu(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},EN=()=>({state:t,dispatch:e})=>cR(t,e),CN=()=>({state:t,dispatch:e})=>dR(t,e);function ck(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function SN(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Lp()||ck()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const TN=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=SN(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function $s(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Xe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(c,d)=>{if(c.isText)return;const h=Math.max(r,d),p=Math.min(i,d+c.nodeSize);a.push({node:c,from:h,to:p})});const l=i-r,u=a.filter(c=>s?s.name===c.node.type.name:!0).filter(c=>Jl(c.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}const ON=(t,e={})=>({state:n,dispatch:r})=>{const i=Xe(t,n.schema);return $s(n,i,e)?vR(n,r):!1},AN=()=>({state:t,dispatch:e})=>xR(t,e),MN=t=>({state:e,dispatch:n})=>{const r=Xe(t,e.schema);return _R(r)(e,n)},_N=()=>({state:t,dispatch:e})=>yR(t,e);function ac(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Lg(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const IN=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ac(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Xe(t,r.schema)),a==="mark"&&(s=zr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,Lg(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(d=>{s===d.type&&n.addMark(c,c+u.nodeSize,s.create(Lg(d.attrs,e)))})})}),!0):!1},DN=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),RN=()=>({tr:t,dispatch:e})=>{if(e){const n=new Gt(t.doc);t.setSelection(n)}return!0},NN=()=>({state:t,dispatch:e})=>hR(t,e),PN=()=>({state:t,dispatch:e})=>fR(t,e),FN=()=>({state:t,dispatch:e})=>wR(t,e),LN=()=>({state:t,dispatch:e})=>SR(t,e),BN=()=>({state:t,dispatch:e})=>CR(t,e);function hh(t,e,n={},r={}){return Yl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const VN=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const d=hh(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function dk(t,e){const n=zr(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function $N(t,e){const n=new m0(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function jN(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function zN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function HN(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Bp(t){return e=>HN(e.$from,t)}function hk(t,e){const n={from:0,to:t.content.size};return sk(t,n,e)}function qN(t,e){const n=Xe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function pk(t,e){const n=ac(typeof e=="string"?e:e.name,t.schema);return n==="node"?qN(t,e):n==="mark"?dk(t,e):{}}function WN(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function UN(t){const e=WN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function KN(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),c=e.slice(o).map(l),d=e.invert().map(u,-1),h=e.invert().map(c);r.push({oldRange:{from:d,to:h},newRange:{from:u,to:c}})})}),UN(r)}function Vp(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Pp(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function dl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function ph(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?zr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(c=>o?o.name===c.type.name:!0).find(c=>Jl(c.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:c,$to:d})=>{const h=c.pos,p=d.pos;t.doc.nodesBetween(h,p,(f,m)=>{if(!f.isText&&!f.marks.length)return;const g=Math.max(h,m),y=Math.min(p,m+f.nodeSize),b=y-g;s+=b,a.push(...f.marks.map(k=>({mark:k,from:g,to:y})))})}),s===0)return!1;const l=a.filter(c=>o?o.name===c.mark.type.name:!0).filter(c=>Jl(c.mark.attrs,n,{strict:!1})).reduce((c,d)=>c+d.to-d.from,0),u=a.filter(c=>o?c.mark.type!==o&&c.mark.type.excludes(o):!0).reduce((c,d)=>c+d.to-d.from,0);return(l>0?l+u:l)>=s}function GN(t,e,n={}){if(!e)return $s(t,null,n)||ph(t,null,n);const r=ac(e,t.schema);return r==="node"?$s(t,e,n):r==="mark"?ph(t,e,n):!1}function Bg(t,e){const{nodeExtensions:n}=ic(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ve(q(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function lc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(lc(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function fk(t){return t instanceof ee}function mk(t,e,n){const r=t.state.doc.content.size,i=Jn(e,0,r),o=Jn(n,0,r),s=t.coordsAtPos(i),a=t.coordsAtPos(o,-1),l=Math.min(s.top,a.top),u=Math.max(s.bottom,a.bottom),c=Math.min(s.left,a.left),d=Math.max(s.right,a.right),h=d-c,p=u-l,f={top:l,bottom:u,left:c,right:d,width:h,height:p,x:c,y:l};return{...f,toJSON:()=>f}}function JN(t,e,n){var r;const{selection:i}=e;let o=null;if(Fp(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,d,h)=>{if(u)return!1;if(c.isInline){const p=!h||h.type.allowsMarkType(n),f=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=p&&f}return!u}),u})}const YN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=zr(t,r.schema);if(i)if(s){const u=dk(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(c,d,(h,p)=>{const f=Math.max(p,c),m=Math.min(p+h.nodeSize,d);h.marks.find(g=>g.type===l)?h.marks.forEach(g=>{l===g.type&&n.addMark(f,m,l.create({...g.attrs,...e}))}):n.addMark(f,m,l.create(e))})});return JN(r,n,l)},XN=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ZN=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Xe(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>Dg(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Dg(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},QN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Jn(t,0,r.content.size),o=ee.create(r,i);e.setSelection(o)}return!0},eP=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,a=le.atEnd(r).to,l=Jn(i,s,a),u=Jn(o,s,a),c=le.create(r,l,u);e.setSelection(c)}return!0},tP=t=>({state:e,dispatch:n})=>{const r=Xe(t,e.schema);return RR(r)(e,n)};function Vg(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}const nP=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=dl(u,a.node().type.name,a.node().attrs);if(o instanceof ee&&o.node.isBlock)return!a.parentOffset||!lo(s,a.pos)?!1:(r&&(t&&Vg(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:jN(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&h?[{type:h,attrs:c}]:void 0,f=lo(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!f&&lo(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(f=!0,p=h?[{type:h,attrs:c}]:void 0),r){if(f&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Vg(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},rP=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Xe(t,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=D.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let A=l.depth-b;A>=l.depth-3;A-=1)y=D.from(l.node(A).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...dl(h,l.node().type.name,l.node().attrs),...e},w=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(v))||void 0;y=y.append(D.from(a.createAndFill(null,w)||void 0));const x=l.before(l.depth-(b-1));n.replace(x,l.after(-k),new V(y,4-b,0));let _=-1;n.doc.nodesBetween(x,n.doc.content.size,(A,S)=>{if(_>-1)return!1;A.isTextblock&&A.content.size===0&&(_=S+1)}),_>-1&&n.setSelection(le.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,f={...dl(h,d.type.name,d.attrs),...e},m={...dl(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!lo(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:b}=r,{splittableMarks:k}=o.extensionManager,v=b||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!v||!i)return!0;const w=v.filter(x=>k.includes(x.type.name));n.ensureMarks(w)}return!0},td=(t,e)=>{const n=Bp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&$r(t.doc,n.pos)&&t.join(n.pos),!0},nd=(t,e)=>{const n=Bp(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&$r(t.doc,r)&&t.join(r),!0},iP=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,p=Xe(t,s.schema),f=Xe(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,k=y.blockRange(b),v=g||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const w=Bp(x=>Bg(x.type.name,d))(m);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===p)return u.liftListItem(f);if(Bg(w.node.type.name,d)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>td(o,p)).command(()=>nd(o,p)).run()}return!n||!v||!a?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>td(o,p)).command(()=>nd(o,p)).run():l().command(()=>{const x=c().wrapInList(p,r),_=v.filter(A=>h.includes(A.type.name));return o.ensureMarks(_),x?!0:u.clearNodes()}).wrapInList(p,r).command(()=>td(o,p)).command(()=>nd(o,p)).run()},oP=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=zr(t,r.schema);return ph(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},sP=(t,e,n={})=>({state:r,commands:i})=>{const o=Xe(t,r.schema),s=Xe(e,r.schema),a=$s(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},aP=(t,e={})=>({state:n,commands:r})=>{const i=Xe(t,n.schema);return $s(n,i,e)?r.lift(i):r.wrapIn(i,e)},lP=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},uP=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},cP=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=zr(t,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:h,to:p}=a;const f=(o=u.marks().find(g=>g.type===l))===null||o===void 0?void 0:o.attrs,m=Pp(u,l,f);m&&(h=m.from,p=m.to),n.removeMark(h,p,l)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},dP=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ac(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Xe(t,r.schema)),a==="mark"&&(s=zr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;let d,h,p,f;n.selection.empty?r.doc.nodesBetween(u,c,(m,g)=>{o&&o===m.type&&(p=Math.max(g,u),f=Math.min(g+m.nodeSize,c),d=g,h=m)}):r.doc.nodesBetween(u,c,(m,g)=>{g<u&&o&&o===m.type&&(p=Math.max(g,u),f=Math.min(g+m.nodeSize,c),d=g,h=m),g>=u&&g<=c&&(o&&o===m.type&&n.setNodeMarkup(g,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(y=>{if(s===y.type){const b=Math.max(g,u),k=Math.min(g+m.nodeSize,c);n.addMark(b,k,s.create({...y.attrs,...e}))}}))}),h&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(m=>{s===m.type&&n.addMark(p,f,s.create({...m.attrs,...e}))}))}),!0):!1},hP=(t,e={})=>({state:n,dispatch:r})=>{const i=Xe(t,n.schema);return TR(i,e)(n,r)},pP=(t,e={})=>({state:n,dispatch:r})=>{const i=Xe(t,n.schema);return OR(i,e)(n,r)};var fP=Object.freeze({__proto__:null,blur:YR,clearContent:XR,clearNodes:ZR,command:QR,createParagraphNear:eN,cut:tN,deleteCurrentNode:nN,deleteNode:rN,deleteRange:iN,deleteSelection:oN,enter:sN,exitCode:aN,extendMarkRange:lN,first:uN,focus:dN,forEach:hN,insertContent:pN,insertContentAt:gN,joinBackward:bN,joinDown:yN,joinForward:kN,joinItemBackward:xN,joinItemForward:wN,joinTextblockBackward:EN,joinTextblockForward:CN,joinUp:vN,keyboardShortcut:TN,lift:ON,liftEmptyBlock:AN,liftListItem:MN,newlineInCode:_N,resetAttributes:IN,scrollIntoView:DN,selectAll:RN,selectNodeBackward:NN,selectNodeForward:PN,selectParentNode:FN,selectTextblockEnd:LN,selectTextblockStart:BN,setContent:VN,setMark:YN,setMeta:XN,setNode:ZN,setNodeSelection:QN,setTextSelection:eP,sinkListItem:tP,splitBlock:nP,splitListItem:rP,toggleList:iP,toggleMark:oP,toggleNode:sP,toggleWrap:aP,undoInputRule:lP,unsetAllMarks:uP,unsetMark:cP,updateAttributes:dP,wrapIn:hP,wrapInList:pP});const mP=Ze.create({name:"commands",addCommands(){return{...fP}}}),gP=Ze.create({name:"drop",addProseMirrorPlugins(){return[new He({key:new ft("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),vP=Ze.create({name:"editable",addProseMirrorPlugins(){return[new He({key:new ft("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yP=Ze.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new He({key:new ft("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),bP=Ze.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:s})=>{const{selection:a,doc:l}=s,{empty:u,$anchor:c}=a,{pos:d,parent:h}=c,p=c.parent.isTextblock&&d>0?s.doc.resolve(d-1):c,f=p.parent.type.spec.isolating,m=c.pos-c.parentOffset,g=f&&p.parent.childCount===1?m===c.pos:fe.atStart(l).from===d;return!u||!h.type.isTextblock||h.textContent.length||!g||g&&c.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Lp()||ck()?i:r},addProseMirrorPlugins(){return[new He({key:new ft("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;const r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),i=t.some(p=>p.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=e.selection,l=fe.atStart(e.doc).from,u=fe.atEnd(e.doc).to;if(o||!(s===l&&a===u)||!lc(n.doc))return;const c=n.tr,d=nc({state:n,transaction:c}),{commands:h}=new rc({editor:this.editor,state:d});if(h.clearNodes(),!!c.steps.length)return c}})]}}),kP=Ze.create({name:"paste",addProseMirrorPlugins(){return[new He({key:new ft("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xP=Ze.create({name:"tabindex",addProseMirrorPlugins(){return[new He({key:new ft("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ii{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new ii(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ii(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ii(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const l=new ii(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new ii(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(a=>n[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const wP=`.ProseMirror {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror {
|
|
31
|
+
word-wrap: break-word;
|
|
32
|
+
white-space: pre-wrap;
|
|
33
|
+
white-space: break-spaces;
|
|
34
|
+
-webkit-font-variant-ligatures: none;
|
|
35
|
+
font-variant-ligatures: none;
|
|
36
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ProseMirror [contenteditable="false"] {
|
|
40
|
+
white-space: normal;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ProseMirror pre {
|
|
48
|
+
white-space: pre-wrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
img.ProseMirror-separator {
|
|
52
|
+
display: inline !important;
|
|
53
|
+
border: none !important;
|
|
54
|
+
margin: 0 !important;
|
|
55
|
+
width: 0 !important;
|
|
56
|
+
height: 0 !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ProseMirror-gapcursor {
|
|
60
|
+
display: none;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
position: absolute;
|
|
63
|
+
margin: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ProseMirror-gapcursor:after {
|
|
67
|
+
content: "";
|
|
68
|
+
display: block;
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: -2px;
|
|
71
|
+
width: 20px;
|
|
72
|
+
border-top: 1px solid black;
|
|
73
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@keyframes ProseMirror-cursor-blink {
|
|
77
|
+
to {
|
|
78
|
+
visibility: hidden;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ProseMirror-hideselection *::selection {
|
|
83
|
+
background: transparent;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
87
|
+
background: transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ProseMirror-hideselection * {
|
|
91
|
+
caret-color: transparent;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
99
|
+
opacity: 0
|
|
100
|
+
}`;function EP(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let CP=class extends NR{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:n,moved:r})=>this.options.onDrop(e,n,r)),this.on("paste",({event:e,slice:n})=>this.options.onPaste(e,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=EP(wP,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=ok(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=e.filter(s=>!s.key.startsWith(o))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[vP,JR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),mP,yP,bP,xP,gP,kP].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new ro(n,this)}createCommandManager(){this.commandManager=new rc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=hh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=hh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=lk(e,this.options.autofocus);this.view=new ZD(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:no.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(o=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(o)});return}const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),i=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return pk(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return GN(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Dp(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
101
|
+
|
|
102
|
+
`,textSerializers:n={}}=t||{};return hk(this.state.doc,{blockSeparator:e,textSerializers:{...Np(this.schema),...n}})}get isEmpty(){return lc(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new ii(e,this)}get $doc(){return this.$pos(0)}};function Eo(t){return new oc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ve(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(Vp(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===t.type&&p!==h.mark.type)).filter(h=>h.to>u).length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+l,u);const d=n.from+l+s.length;o.addMark(n.from+l,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function SP(t){return new oc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ve(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=s+u;c>a?c=a:a=c+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(c,a,l)}else if(r[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function fh(t){return new oc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=ve(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function js(t){return new oc({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=ve(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&bp(a,t.type,o);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:c,storedMarks:d}=e,{splittableMarks:h}=t.editor.extensionManager,p=d||c.$to.parentOffset&&c.$from.marks();if(p){const f=p.filter(m=>h.includes(m.type.name));s.ensureMarks(f)}}if(t.keepAttributes){const c=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(c,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&$r(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let dn=class mh{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(q(this,"addOptions",{name:this.name}))),this.storage=ve(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new mh(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>sc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new mh(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ve(q(n,"addOptions",{name:n.name})),n.storage=ve(q(n,"addStorage",{name:n.name,options:n.options})),n}};function Ti(t){return new HR({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=ve(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(Vp(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(f=>f===t.type&&f!==p.mark.type)).filter(p=>p.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+c,d),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Tt="top",Xt="bottom",Zt="right",Ot="left",$p="auto",ta=[Tt,Xt,Zt,Ot],Co="start",zs="end",TP="clippingParents",gk="viewport",Ho="popper",OP="reference",$g=ta.reduce(function(t,e){return t.concat([e+"-"+Co,e+"-"+zs])},[]),vk=[].concat(ta,[$p]).reduce(function(t,e){return t.concat([e,e+"-"+Co,e+"-"+zs])},[]),AP="beforeRead",MP="read",_P="afterRead",IP="beforeMain",DP="main",RP="afterMain",NP="beforeWrite",PP="write",FP="afterWrite",LP=[AP,MP,_P,IP,DP,RP,NP,PP,FP];function _n(t){return t?(t.nodeName||"").toLowerCase():null}function Bt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Oi(t){var e=Bt(t).Element;return t instanceof e||t instanceof Element}function Yt(t){var e=Bt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jp(t){if(typeof ShadowRoot>"u")return!1;var e=Bt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function BP(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Yt(o)||!_n(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function VP(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!Yt(i)||!_n(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const yk={name:"applyStyles",enabled:!0,phase:"write",fn:BP,effect:VP,requires:["computeStyles"]};function En(t){return t.split("-")[0]}var mi=Math.max,Xl=Math.min,So=Math.round;function gh(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function bk(){return!/^((?!chrome|android).)*safari/i.test(gh())}function To(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Yt(t)&&(i=t.offsetWidth>0&&So(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&So(r.height)/t.offsetHeight||1);var s=Oi(t)?Bt(t):window,a=s.visualViewport,l=!bk()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,h=r.height/o;return{width:d,height:h,top:c,right:u+d,bottom:c+h,left:u,x:u,y:c}}function zp(t){var e=To(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function kk(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jp(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ir(t){return Bt(t).getComputedStyle(t)}function $P(t){return["table","td","th"].indexOf(_n(t))>=0}function Hr(t){return((Oi(t)?t.ownerDocument:t.document)||window.document).documentElement}function uc(t){return _n(t)==="html"?t:t.assignedSlot||t.parentNode||(jp(t)?t.host:null)||Hr(t)}function jg(t){return!Yt(t)||ir(t).position==="fixed"?null:t.offsetParent}function jP(t){var e=/firefox/i.test(gh()),n=/Trident/i.test(gh());if(n&&Yt(t)){var r=ir(t);if(r.position==="fixed")return null}var i=uc(t);for(jp(i)&&(i=i.host);Yt(i)&&["html","body"].indexOf(_n(i))<0;){var o=ir(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function na(t){for(var e=Bt(t),n=jg(t);n&&$P(n)&&ir(n).position==="static";)n=jg(n);return n&&(_n(n)==="html"||_n(n)==="body"&&ir(n).position==="static")?e:n||jP(t)||e}function Hp(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ps(t,e,n){return mi(t,Xl(e,n))}function zP(t,e,n){var r=ps(t,e,n);return r>n?n:r}function xk(){return{top:0,right:0,bottom:0,left:0}}function wk(t){return Object.assign({},xk(),t)}function Ek(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var HP=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,wk(typeof t!="number"?t:Ek(t,ta))};function qP(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=En(n.placement),l=Hp(a),u=[Ot,Zt].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=HP(i.padding,n),h=zp(o),p=l==="y"?Tt:Ot,f=l==="y"?Xt:Zt,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],g=s[l]-n.rects.reference[l],y=na(o),b=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,k=m/2-g/2,v=d[p],w=b-h[c]-d[f],x=b/2-h[c]/2+k,_=ps(v,x,w),A=l;n.modifiersData[r]=(e={},e[A]=_,e.centerOffset=_-x,e)}}function WP(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||kk(e.elements.popper,i)&&(e.elements.arrow=i))}const UP={name:"arrow",enabled:!0,phase:"main",fn:qP,effect:WP,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Oo(t){return t.split("-")[1]}var KP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function GP(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:So(n*i)/i||0,y:So(r*i)/i||0}}function zg(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,h=s.x,p=h===void 0?0:h,f=s.y,m=f===void 0?0:f,g=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),k=Ot,v=Tt,w=window;if(u){var x=na(n),_="clientHeight",A="clientWidth";if(x===Bt(n)&&(x=Hr(n),ir(x).position!=="static"&&a==="absolute"&&(_="scrollHeight",A="scrollWidth")),x=x,i===Tt||(i===Ot||i===Zt)&&o===zs){v=Xt;var S=d&&x===w&&w.visualViewport?w.visualViewport.height:x[_];m-=S-r.height,m*=l?1:-1}if(i===Ot||(i===Tt||i===Xt)&&o===zs){k=Zt;var O=d&&x===w&&w.visualViewport?w.visualViewport.width:x[A];p-=O-r.width,p*=l?1:-1}}var C=Object.assign({position:a},u&&KP),T=c===!0?GP({x:p,y:m},Bt(n)):{x:p,y:m};if(p=T.x,m=T.y,l){var R;return Object.assign({},C,(R={},R[v]=b?"0":"",R[k]=y?"0":"",R.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",R))}return Object.assign({},C,(e={},e[v]=b?m+"px":"",e[k]=y?p+"px":"",e.transform="",e))}function JP(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:En(e.placement),variation:Oo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,zg(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,zg(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const YP={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JP,data:{}};var Va={passive:!0};function XP(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Bt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,Va)}),a&&l.addEventListener("resize",n.update,Va),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Va)}),a&&l.removeEventListener("resize",n.update,Va)}}const ZP={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:XP,data:{}};var QP={left:"right",right:"left",bottom:"top",top:"bottom"};function hl(t){return t.replace(/left|right|bottom|top/g,function(e){return QP[e]})}var eF={start:"end",end:"start"};function Hg(t){return t.replace(/start|end/g,function(e){return eF[e]})}function qp(t){var e=Bt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Wp(t){return To(Hr(t)).left+qp(t).scrollLeft}function tF(t,e){var n=Bt(t),r=Hr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=bk();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Wp(t),y:l}}function nF(t){var e,n=Hr(t),r=qp(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=mi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=mi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Wp(t),l=-r.scrollTop;return ir(i||n).direction==="rtl"&&(a+=mi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Up(t){var e=ir(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ck(t){return["html","body","#document"].indexOf(_n(t))>=0?t.ownerDocument.body:Yt(t)&&Up(t)?t:Ck(uc(t))}function fs(t,e){var n;e===void 0&&(e=[]);var r=Ck(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Bt(r),s=i?[o].concat(o.visualViewport||[],Up(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(fs(uc(s)))}function vh(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function rF(t,e){var n=To(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function qg(t,e,n){return e===gk?vh(tF(t,n)):Oi(e)?rF(e,n):vh(nF(Hr(t)))}function iF(t){var e=fs(uc(t)),n=["absolute","fixed"].indexOf(ir(t).position)>=0,r=n&&Yt(t)?na(t):t;return Oi(r)?e.filter(function(i){return Oi(i)&&kk(i,r)&&_n(i)!=="body"}):[]}function oF(t,e,n,r){var i=e==="clippingParents"?iF(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=qg(t,u,r);return l.top=mi(c.top,l.top),l.right=Xl(c.right,l.right),l.bottom=Xl(c.bottom,l.bottom),l.left=mi(c.left,l.left),l},qg(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Sk(t){var e=t.reference,n=t.element,r=t.placement,i=r?En(r):null,o=r?Oo(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Tt:l={x:s,y:e.y-n.height};break;case Xt:l={x:s,y:e.y+e.height};break;case Zt:l={x:e.x+e.width,y:a};break;case Ot:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?Hp(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Co:l[u]=l[u]-(e[c]/2-n[c]/2);break;case zs:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function Hs(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?TP:a,u=n.rootBoundary,c=u===void 0?gk:u,d=n.elementContext,h=d===void 0?Ho:d,p=n.altBoundary,f=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=wk(typeof g!="number"?g:Ek(g,ta)),b=h===Ho?OP:Ho,k=t.rects.popper,v=t.elements[f?b:h],w=oF(Oi(v)?v:v.contextElement||Hr(t.elements.popper),l,c,s),x=To(t.elements.reference),_=Sk({reference:x,element:k,placement:i}),A=vh(Object.assign({},k,_)),S=h===Ho?A:x,O={top:w.top-S.top+y.top,bottom:S.bottom-w.bottom+y.bottom,left:w.left-S.left+y.left,right:S.right-w.right+y.right},C=t.modifiersData.offset;if(h===Ho&&C){var T=C[i];Object.keys(O).forEach(function(R){var j=[Zt,Xt].indexOf(R)>=0?1:-1,H=[Tt,Xt].indexOf(R)>=0?"y":"x";O[R]+=T[H]*j})}return O}function sF(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?vk:l,c=Oo(r),d=c?a?$g:$g.filter(function(f){return Oo(f)===c}):ta,h=d.filter(function(f){return u.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=Hs(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[En(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function aF(t){if(En(t)===$p)return[];var e=hl(t);return[Hg(t),e,Hg(e)]}function lF(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=p===void 0?!0:p,m=n.allowedAutoPlacements,g=e.options.placement,y=En(g),b=y===g,k=l||(b||!f?[hl(g)]:aF(g)),v=[g].concat(k).reduce(function(Mt,ot){return Mt.concat(En(ot)===$p?sF(e,{placement:ot,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):ot)},[]),w=e.rects.reference,x=e.rects.popper,_=new Map,A=!0,S=v[0],O=0;O<v.length;O++){var C=v[O],T=En(C),R=Oo(C)===Co,j=[Tt,Xt].indexOf(T)>=0,H=j?"width":"height",$=Hs(e,{placement:C,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),X=j?R?Zt:Ot:R?Xt:Tt;w[H]>x[H]&&(X=hl(X));var ue=hl(X),de=[];if(o&&de.push($[T]<=0),a&&de.push($[X]<=0,$[ue]<=0),de.every(function(Mt){return Mt})){S=C,A=!1;break}_.set(C,de)}if(A)for(var Pe=f?3:1,At=function(Mt){var ot=v.find(function(Vt){var qr=_.get(Vt);if(qr)return qr.slice(0,Mt).every(function(ar){return ar})});if(ot)return S=ot,"break"},Be=Pe;Be>0;Be--){var Pn=At(Be);if(Pn==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}const uF={name:"flip",enabled:!0,phase:"main",fn:lF,requiresIfExists:["offset"],data:{_skip:!1}};function Wg(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ug(t){return[Tt,Zt,Xt,Ot].some(function(e){return t[e]>=0})}function cF(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Hs(e,{elementContext:"reference"}),a=Hs(e,{altBoundary:!0}),l=Wg(s,r),u=Wg(a,i,o),c=Ug(l),d=Ug(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const dF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:cF};function hF(t,e,n){var r=En(t),i=[Ot,Tt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Ot,Zt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function pF(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=vk.reduce(function(c,d){return c[d]=hF(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}const fF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pF};function mF(t){var e=t.state,n=t.name;e.modifiersData[n]=Sk({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const gF={name:"popperOffsets",enabled:!0,phase:"read",fn:mF,data:{}};function vF(t){return t==="x"?"y":"x"}function yF(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,h=n.tether,p=h===void 0?!0:h,f=n.tetherOffset,m=f===void 0?0:f,g=Hs(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=En(e.placement),b=Oo(e.placement),k=!b,v=Hp(y),w=vF(v),x=e.modifiersData.popperOffsets,_=e.rects.reference,A=e.rects.popper,S=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,O=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(x){if(o){var R,j=v==="y"?Tt:Ot,H=v==="y"?Xt:Zt,$=v==="y"?"height":"width",X=x[v],ue=X+g[j],de=X-g[H],Pe=p?-A[$]/2:0,At=b===Co?_[$]:A[$],Be=b===Co?-A[$]:-_[$],Pn=e.elements.arrow,Mt=p&&Pn?zp(Pn):{width:0,height:0},ot=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xk(),Vt=ot[j],qr=ot[H],ar=ps(0,_[$],Mt[$]),ra=k?_[$]/2-Pe-ar-Vt-O.mainAxis:At-ar-Vt-O.mainAxis,lr=k?-_[$]/2+Pe+ar+qr+O.mainAxis:Be+ar+qr+O.mainAxis,Pi=e.elements.arrow&&na(e.elements.arrow),ia=Pi?v==="y"?Pi.clientTop||0:Pi.clientLeft||0:0,Ro=(R=C?.[v])!=null?R:0,oa=X+ra-Ro-ia,sa=X+lr-Ro,No=ps(p?Xl(ue,oa):ue,X,p?mi(de,sa):de);x[v]=No,T[v]=No-X}if(a){var Po,aa=v==="x"?Tt:Ot,la=v==="x"?Xt:Zt,Fn=x[w],ur=w==="y"?"height":"width",Fo=Fn+g[aa],Wr=Fn-g[la],Lo=[Tt,Ot].indexOf(y)!==-1,ua=(Po=C?.[w])!=null?Po:0,ca=Lo?Fo:Fn-_[ur]-A[ur]-ua+O.altAxis,da=Lo?Fn+_[ur]+A[ur]-ua-O.altAxis:Wr,ha=p&&Lo?zP(ca,Fn,da):ps(p?ca:Fo,Fn,p?da:Wr);x[w]=ha,T[w]=ha-Fn}e.modifiersData[r]=T}}const bF={name:"preventOverflow",enabled:!0,phase:"main",fn:yF,requiresIfExists:["offset"]};function kF(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function xF(t){return t===Bt(t)||!Yt(t)?qp(t):kF(t)}function wF(t){var e=t.getBoundingClientRect(),n=So(e.width)/t.offsetWidth||1,r=So(e.height)/t.offsetHeight||1;return n!==1||r!==1}function EF(t,e,n){n===void 0&&(n=!1);var r=Yt(e),i=Yt(e)&&wF(e),o=Hr(e),s=To(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((_n(e)!=="body"||Up(o))&&(a=xF(e)),Yt(e)?(l=To(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Wp(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function CF(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function SF(t){var e=CF(t);return LP.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function TF(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function OF(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Kg={placement:"bottom",modifiers:[],strategy:"absolute"};function Gg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function AF(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Kg:i;return function(s,a,l){l===void 0&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Kg,o),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},c=[],d=!1,h={state:u,setOptions:function(m){var g=typeof m=="function"?m(u.options):m;f(),u.options=Object.assign({},o,u.options,g),u.scrollParents={reference:Oi(s)?fs(s):s.contextElement?fs(s.contextElement):[],popper:fs(a)};var y=SF(OF([].concat(r,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),p(),h.update()},forceUpdate:function(){if(!d){var m=u.elements,g=m.reference,y=m.popper;if(Gg(g,y)){u.rects={reference:EF(g,na(y),u.options.strategy==="fixed"),popper:zp(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(A){return u.modifiersData[A.name]=Object.assign({},A.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var k=u.orderedModifiers[b],v=k.fn,w=k.options,x=w===void 0?{}:w,_=k.name;typeof v=="function"&&(u=v({state:u,options:x,name:_,instance:h})||u)}}}},update:TF(function(){return new Promise(function(m){h.forceUpdate(),m(u)})}),destroy:function(){f(),d=!0}};if(!Gg(s,a))return h;h.setOptions(l).then(function(m){!d&&l.onFirstUpdate&&l.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var g=m.name,y=m.options,b=y===void 0?{}:y,k=m.effect;if(typeof k=="function"){var v=k({state:u,name:g,instance:h,options:b}),w=function(){};c.push(v||w)}})}function f(){c.forEach(function(m){return m()}),c=[]}return h}}var MF=[ZP,gF,YP,yk,fF,uF,bF,UP,dF],_F=AF({defaultModifiers:MF}),IF="tippy-box",Tk="tippy-content",DF="tippy-backdrop",Ok="tippy-arrow",Ak="tippy-svg-arrow",Qr={passive:!0,capture:!0},Mk=function(){return document.body};function rd(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Kp(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function _k(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Jg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function RF(t){return t.split(/\s+/).filter(Boolean)}function Yi(t){return[].concat(t)}function Yg(t,e){t.indexOf(e)===-1&&t.push(e)}function NF(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function PF(t){return t.split("-")[0]}function Zl(t){return[].slice.call(t)}function Xg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ms(){return document.createElement("div")}function cc(t){return["Element","Fragment"].some(function(e){return Kp(t,e)})}function FF(t){return Kp(t,"NodeList")}function LF(t){return Kp(t,"MouseEvent")}function BF(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function VF(t){return cc(t)?[t]:FF(t)?Zl(t):Array.isArray(t)?t:Zl(document.querySelectorAll(t))}function id(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Zg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function $F(t){var e,n=Yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function jF(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=PF(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,h=u==="top"?c.bottom.y:0,p=u==="right"?c.left.x:0,f=u==="left"?c.right.x:0,m=o.top-r+d>l,g=r-o.bottom-h>l,y=o.left-n+p>l,b=n-o.right-f>l;return m||g||y||b})}function od(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Qg(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var vn={isTouch:!1},ev=0;function zF(){vn.isTouch||(vn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ik))}function Ik(){var t=performance.now();t-ev<20&&(vn.isTouch=!1,document.removeEventListener("mousemove",Ik)),ev=t}function HF(){var t=document.activeElement;if(BF(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function qF(){document.addEventListener("touchstart",zF,Qr),window.addEventListener("blur",HF)}var WF=typeof window<"u"&&typeof document<"u",UF=WF?!!window.msCrypto:!1,KF={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},GF={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},an=Object.assign({appendTo:Mk,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},KF,GF),JF=Object.keys(an),YF=function(t){var e=Object.keys(t);e.forEach(function(n){an[n]=t[n]})};function Dk(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=an[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function XF(t,e){var n=e?Object.keys(Dk(Object.assign({},an,{plugins:e}))):JF,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function tv(t,e){var n=Object.assign({},e,{content:_k(e.content,[t])},e.ignoreAttributes?{}:XF(t,e.plugins));return n.aria=Object.assign({},an.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var ZF=function(){return"innerHTML"};function yh(t,e){t[ZF()]=e}function nv(t){var e=ms();return t===!0?e.className=Ok:(e.className=Ak,cc(t)?e.appendChild(t):yh(e,t)),e}function rv(t,e){cc(e.content)?(yh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yh(t,e.content):t.textContent=e.content)}function bh(t){var e=t.firstElementChild,n=Zl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Tk)}),arrow:n.find(function(r){return r.classList.contains(Ok)||r.classList.contains(Ak)}),backdrop:n.find(function(r){return r.classList.contains(DF)})}}function Rk(t){var e=ms(),n=ms();n.className=IF,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ms();r.className=Tk,r.setAttribute("data-state","hidden"),rv(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=bh(e),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&rv(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(nv(s.arrow))):l.appendChild(nv(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}Rk.$$tippy=!0;var QF=1,$a=[],sd=[];function eL(t,e){var n=tv(t,Object.assign({},an,Dk(Xg(e)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,d,h,p=[],f=Jg(oa,n.interactiveDebounce),m,g=QF++,y=null,b=NF(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:g,reference:t,popper:ms(),popperInstance:y,props:n,state:k,plugins:b,clearDelayTimeouts:ca,setProps:da,setContent:ha,show:ex,hide:tx,hideWithInteractivity:nx,enable:Lo,disable:ua,unmount:rx,destroy:ix};if(!n.render)return v;var w=n.render(v),x=w.popper,_=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,t._tippy=v,x._tippy=v;var A=b.map(function(M){return M.fn(v)}),S=t.hasAttribute("aria-expanded");return Pi(),Pe(),X(),ue("onCreate",[v]),n.showOnCreate&&Fo(),x.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&j().addEventListener("mousemove",f)}),v;function O(){var M=v.props.touch;return Array.isArray(M)?M:[M,0]}function C(){return O()[0]==="hold"}function T(){var M;return!!((M=v.props.render)!=null&&M.$$tippy)}function R(){return m||t}function j(){var M=R().parentNode;return M?$F(M):document}function H(){return bh(x)}function $(M){return v.state.isMounted&&!v.state.isVisible||vn.isTouch||c&&c.type==="focus"?0:rd(v.props.delay,M?0:1,an.delay)}function X(M){M===void 0&&(M=!1),x.style.pointerEvents=v.props.interactive&&!M?"":"none",x.style.zIndex=""+v.props.zIndex}function ue(M,K,oe){if(oe===void 0&&(oe=!0),A.forEach(function(xe){xe[M]&&xe[M].apply(xe,K)}),oe){var Ce;(Ce=v.props)[M].apply(Ce,K)}}function de(){var M=v.props.aria;if(M.content){var K="aria-"+M.content,oe=x.id,Ce=Yi(v.props.triggerTarget||t);Ce.forEach(function(xe){var mt=xe.getAttribute(K);if(v.state.isVisible)xe.setAttribute(K,mt?mt+" "+oe:oe);else{var $t=mt&&mt.replace(oe,"").trim();$t?xe.setAttribute(K,$t):xe.removeAttribute(K)}})}}function Pe(){if(!(S||!v.props.aria.expanded)){var M=Yi(v.props.triggerTarget||t);M.forEach(function(K){v.props.interactive?K.setAttribute("aria-expanded",v.state.isVisible&&K===R()?"true":"false"):K.removeAttribute("aria-expanded")})}}function At(){j().removeEventListener("mousemove",f),$a=$a.filter(function(M){return M!==f})}function Be(M){if(!(vn.isTouch&&(l||M.type==="mousedown"))){var K=M.composedPath&&M.composedPath()[0]||M.target;if(!(v.props.interactive&&Qg(x,K))){if(Yi(v.props.triggerTarget||t).some(function(oe){return Qg(oe,K)})){if(vn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else ue("onClickOutside",[v,M]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Vt())}}}function Pn(){l=!0}function Mt(){l=!1}function ot(){var M=j();M.addEventListener("mousedown",Be,!0),M.addEventListener("touchend",Be,Qr),M.addEventListener("touchstart",Mt,Qr),M.addEventListener("touchmove",Pn,Qr)}function Vt(){var M=j();M.removeEventListener("mousedown",Be,!0),M.removeEventListener("touchend",Be,Qr),M.removeEventListener("touchstart",Mt,Qr),M.removeEventListener("touchmove",Pn,Qr)}function qr(M,K){ra(M,function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&K()})}function ar(M,K){ra(M,K)}function ra(M,K){var oe=H().box;function Ce(xe){xe.target===oe&&(od(oe,"remove",Ce),K())}if(M===0)return K();od(oe,"remove",d),od(oe,"add",Ce),d=Ce}function lr(M,K,oe){oe===void 0&&(oe=!1);var Ce=Yi(v.props.triggerTarget||t);Ce.forEach(function(xe){xe.addEventListener(M,K,oe),p.push({node:xe,eventType:M,handler:K,options:oe})})}function Pi(){C()&&(lr("touchstart",Ro,{passive:!0}),lr("touchend",sa,{passive:!0})),RF(v.props.trigger).forEach(function(M){if(M!=="manual")switch(lr(M,Ro),M){case"mouseenter":lr("mouseleave",sa);break;case"focus":lr(UF?"focusout":"blur",No);break;case"focusin":lr("focusout",No);break}})}function ia(){p.forEach(function(M){var K=M.node,oe=M.eventType,Ce=M.handler,xe=M.options;K.removeEventListener(oe,Ce,xe)}),p=[]}function Ro(M){var K,oe=!1;if(!(!v.state.isEnabled||Po(M)||a)){var Ce=((K=c)==null?void 0:K.type)==="focus";c=M,m=M.currentTarget,Pe(),!v.state.isVisible&&LF(M)&&$a.forEach(function(xe){return xe(M)}),M.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?oe=!0:Fo(M),M.type==="click"&&(s=!oe),oe&&!Ce&&Wr(M)}}function oa(M){var K=M.target,oe=R().contains(K)||x.contains(K);if(!(M.type==="mousemove"&&oe)){var Ce=ur().concat(x).map(function(xe){var mt,$t=xe._tippy,Fi=(mt=$t.popperInstance)==null?void 0:mt.state;return Fi?{popperRect:xe.getBoundingClientRect(),popperState:Fi,props:n}:null}).filter(Boolean);jF(Ce,M)&&(At(),Wr(M))}}function sa(M){var K=Po(M)||v.props.trigger.indexOf("click")>=0&&s;if(!K){if(v.props.interactive){v.hideWithInteractivity(M);return}Wr(M)}}function No(M){v.props.trigger.indexOf("focusin")<0&&M.target!==R()||v.props.interactive&&M.relatedTarget&&x.contains(M.relatedTarget)||Wr(M)}function Po(M){return vn.isTouch?C()!==M.type.indexOf("touch")>=0:!1}function aa(){la();var M=v.props,K=M.popperOptions,oe=M.placement,Ce=M.offset,xe=M.getReferenceClientRect,mt=M.moveTransition,$t=T()?bh(x).arrow:null,Fi=xe?{getBoundingClientRect:xe,contextElement:xe.contextElement||R()}:t,pa={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fa){var Li=fa.state;if(T()){var ox=H(),hc=ox.box;["placement","reference-hidden","escaped"].forEach(function(ma){ma==="placement"?hc.setAttribute("data-placement",Li.placement):Li.attributes.popper["data-popper-"+ma]?hc.setAttribute("data-"+ma,""):hc.removeAttribute("data-"+ma)}),Li.attributes.popper={}}}},Ur=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!mt}},pa];T()&&$t&&Ur.push({name:"arrow",options:{element:$t,padding:3}}),Ur.push.apply(Ur,K?.modifiers||[]),v.popperInstance=_F(Fi,x,Object.assign({},K,{placement:oe,onFirstUpdate:h,modifiers:Ur}))}function la(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Fn(){var M=v.props.appendTo,K,oe=R();v.props.interactive&&M===Mk||M==="parent"?K=oe.parentNode:K=_k(M,[oe]),K.contains(x)||K.appendChild(x),v.state.isMounted=!0,aa()}function ur(){return Zl(x.querySelectorAll("[data-tippy-root]"))}function Fo(M){v.clearDelayTimeouts(),M&&ue("onTrigger",[v,M]),ot();var K=$(!0),oe=O(),Ce=oe[0],xe=oe[1];vn.isTouch&&Ce==="hold"&&xe&&(K=xe),K?r=setTimeout(function(){v.show()},K):v.show()}function Wr(M){if(v.clearDelayTimeouts(),ue("onUntrigger",[v,M]),!v.state.isVisible){Vt();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var K=$(!1);K?i=setTimeout(function(){v.state.isVisible&&v.hide()},K):o=requestAnimationFrame(function(){v.hide()})}}function Lo(){v.state.isEnabled=!0}function ua(){v.hide(),v.state.isEnabled=!1}function ca(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function da(M){if(!v.state.isDestroyed){ue("onBeforeUpdate",[v,M]),ia();var K=v.props,oe=tv(t,Object.assign({},K,Xg(M),{ignoreAttributes:!0}));v.props=oe,Pi(),K.interactiveDebounce!==oe.interactiveDebounce&&(At(),f=Jg(oa,oe.interactiveDebounce)),K.triggerTarget&&!oe.triggerTarget?Yi(K.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):oe.triggerTarget&&t.removeAttribute("aria-expanded"),Pe(),X(),_&&_(K,oe),v.popperInstance&&(aa(),ur().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),ue("onAfterUpdate",[v,M])}}function ha(M){v.setProps({content:M})}function ex(){var M=v.state.isVisible,K=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=vn.isTouch&&!v.props.touch,xe=rd(v.props.duration,0,an.duration);if(!(M||K||oe||Ce)&&!R().hasAttribute("disabled")&&(ue("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,T()&&(x.style.visibility="visible"),X(),ot(),v.state.isMounted||(x.style.transition="none"),T()){var mt=H(),$t=mt.box,Fi=mt.content;id([$t,Fi],0)}h=function(){var pa;if(!(!v.state.isVisible||u)){if(u=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,T()&&v.props.animation){var Ur=H(),fa=Ur.box,Li=Ur.content;id([fa,Li],xe),Zg([fa,Li],"visible")}de(),Pe(),Yg(sd,v),(pa=v.popperInstance)==null||pa.forceUpdate(),ue("onMount",[v]),v.props.animation&&T()&&ar(xe,function(){v.state.isShown=!0,ue("onShown",[v])})}},Fn()}}function tx(){var M=!v.state.isVisible,K=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=rd(v.props.duration,1,an.duration);if(!(M||K||oe)&&(ue("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,u=!1,s=!1,T()&&(x.style.visibility="hidden"),At(),Vt(),X(!0),T()){var xe=H(),mt=xe.box,$t=xe.content;v.props.animation&&(id([mt,$t],Ce),Zg([mt,$t],"hidden"))}de(),Pe(),v.props.animation?T()&&qr(Ce,v.unmount):v.unmount()}}function nx(M){j().addEventListener("mousemove",f),Yg($a,f),f(M)}function rx(){v.state.isVisible&&v.hide(),v.state.isMounted&&(la(),ur().forEach(function(M){M._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),sd=sd.filter(function(M){return M!==v}),v.state.isMounted=!1,ue("onHidden",[v]))}function ix(){!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),ia(),delete t._tippy,v.state.isDestroyed=!0,ue("onDestroy",[v]))}}function Do(t,e){e===void 0&&(e={});var n=an.plugins.concat(e.plugins||[]);qF();var r=Object.assign({},e,{plugins:n}),i=VF(t),o=i.reduce(function(s,a){var l=a&&eL(a,r);return l&&s.push(l),s},[]);return cc(t)?o[0]:o}Do.defaultProps=an;Do.setDefaultProps=YF;Do.currentInput=vn;Object.assign({},yk,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});Do.setDefaultProps({render:Rk});class tL{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:u,to:c})=>{const{doc:d,selection:h}=l,{empty:p}=h,f=!d.textBetween(u,c).length&&Fp(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||p||f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget)||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const u=!(l!=null&&l.selection.eq(a.state.selection)),c=!(l!=null&&l.doc.eq(a.state.doc));!u&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,u,c,l)},this.updateDelay))},this.updateHandler=(a,l,u,c)=>{var d,h,p;const{state:f,composing:m}=a,{selection:g}=f;if(m||!l&&!u)return;this.createTooltip();const{ranges:y}=g,b=Math.min(...y.map(v=>v.$from.pos)),k=Math.max(...y.map(v=>v.$to.pos));if(!(!((d=this.shouldShow)===null||d===void 0)&&d.call(this,{editor:this.editor,element:this.element,view:a,state:f,oldState:c,from:b,to:k}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(fk(f.selection)){let v=a.nodeDOM(b);if(v){const w=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(w&&(v=w.firstChild),v)return v.getBoundingClientRect()}}return mk(a,b,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Do(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const nL=t=>new He({key:typeof t.pluginKey=="string"?new ft(t.pluginKey):t.pluginKey,view:e=>new tL({view:e,...t})});Ze.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[nL({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class rL{getTextContent(e){return hk(e,{textSerializers:Np(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:u,empty:c}=l,d=u.depth===1,h=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!s.hasFocus()||!c||!d||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget)||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Do(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:l}=s,{from:u,to:c}=l;if(!(n&&n.doc.eq(a)&&n.selection.eq(l))){if(this.createTooltip(),!(!((r=this.shouldShow)===null||r===void 0)&&r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>mk(e,u,c))}),this.show()}}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const iL=t=>new He({key:typeof t.pluginKey=="string"?new ft(t.pluginKey):t.pluginKey,view:e=>new rL({view:e,...t})});Ze.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[iL({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function iv(t){return wv((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class oL extends CP{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=iv(this.view.state),this.reactiveExtensionStorage=iv(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),Wa(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const sL=ie({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=Q(),n=Nh();return Dh(()=>{const r=t.editor;r&&r.options.element&&e.value&&vi(()=>{if(!e.value||!r.options.element.firstChild)return;const i=z(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),Mo(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return Es("div",{ref:t=>{this.rootEl=t}})}}),aL=(t={})=>{const e=Ev();return or(()=>{e.value=new oL(t)}),Mo(()=>{var n,r,i;const o=(n=e.value)===null||n===void 0?void 0:n.options.element,s=o?.cloneNode(!0);(r=o?.parentNode)===null||r===void 0||r.replaceChild(s,o),(i=e.value)===null||i===void 0||i.destroy()}),e},lL="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",uL="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ao=(t,e)=>{for(const n in e)t[n]=e[n];return t},kh="numeric",xh="ascii",wh="alpha",gs="asciinumeric",Qo="alphanumeric",Eh="domain",Nk="emoji",cL="scheme",dL="slashscheme",ad="whitespace";function hL(t,e){return t in e||(e[t]=[]),e[t]}function ci(t,e,n){e[kh]&&(e[gs]=!0,e[Qo]=!0),e[xh]&&(e[gs]=!0,e[wh]=!0),e[gs]&&(e[Qo]=!0),e[wh]&&(e[Qo]=!0),e[Qo]&&(e[Eh]=!0),e[Nk]&&(e[Eh]=!0);for(const r in e){const i=hL(r,n);i.indexOf(t)<0&&i.push(t)}}function pL(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Et(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Et.groups={};Et.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Et.groups;let i;return e&&e.j?i=e:(i=new Et(e),n&&r&&ci(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||Et.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new Et,Ao(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Et,o){if(r)if(s.t&&typeof s.t=="string"){const l=Ao(pL(s.t,r),n);ci(o,l,r)}else n&&ci(o,n,r);s.t=o}return i.j[t]=s,s}};const me=(t,e,n,r,i)=>t.ta(e,n,r,i),Ie=(t,e,n,r,i)=>t.tr(e,n,r,i),ov=(t,e,n,r,i)=>t.ts(e,n,r,i),N=(t,e,n,r,i)=>t.tt(e,n,r,i),zn="WORD",Ch="UWORD",Pk="ASCIINUMERICAL",Fk="ALPHANUMERICAL",qs="LOCALHOST",Sh="TLD",Th="UTLD",pl="SCHEME",Xi="SLASH_SCHEME",Gp="NUM",Oh="WS",Jp="NL",vs="OPENBRACE",ys="CLOSEBRACE",Ql="OPENBRACKET",eu="CLOSEBRACKET",tu="OPENPAREN",nu="CLOSEPAREN",ru="OPENANGLEBRACKET",iu="CLOSEANGLEBRACKET",ou="FULLWIDTHLEFTPAREN",su="FULLWIDTHRIGHTPAREN",au="LEFTCORNERBRACKET",lu="RIGHTCORNERBRACKET",uu="LEFTWHITECORNERBRACKET",cu="RIGHTWHITECORNERBRACKET",du="FULLWIDTHLESSTHAN",hu="FULLWIDTHGREATERTHAN",pu="AMPERSAND",Yp="APOSTROPHE",fu="ASTERISK",gr="AT",mu="BACKSLASH",gu="BACKTICK",vu="CARET",kr="COLON",Xp="COMMA",yu="DOLLAR",pn="DOT",bu="EQUALS",Zp="EXCLAMATION",Ht="HYPHEN",bs="PERCENT",ku="PIPE",xu="PLUS",wu="POUND",ks="QUERY",Qp="QUOTE",Lk="FULLWIDTHMIDDLEDOT",ef="SEMI",fn="SLASH",xs="TILDE",Eu="UNDERSCORE",Bk="EMOJI",Cu="SYM";var Vk=Object.freeze({__proto__:null,WORD:zn,UWORD:Ch,ASCIINUMERICAL:Pk,ALPHANUMERICAL:Fk,LOCALHOST:qs,TLD:Sh,UTLD:Th,SCHEME:pl,SLASH_SCHEME:Xi,NUM:Gp,WS:Oh,NL:Jp,OPENBRACE:vs,CLOSEBRACE:ys,OPENBRACKET:Ql,CLOSEBRACKET:eu,OPENPAREN:tu,CLOSEPAREN:nu,OPENANGLEBRACKET:ru,CLOSEANGLEBRACKET:iu,FULLWIDTHLEFTPAREN:ou,FULLWIDTHRIGHTPAREN:su,LEFTCORNERBRACKET:au,RIGHTCORNERBRACKET:lu,LEFTWHITECORNERBRACKET:uu,RIGHTWHITECORNERBRACKET:cu,FULLWIDTHLESSTHAN:du,FULLWIDTHGREATERTHAN:hu,AMPERSAND:pu,APOSTROPHE:Yp,ASTERISK:fu,AT:gr,BACKSLASH:mu,BACKTICK:gu,CARET:vu,COLON:kr,COMMA:Xp,DOLLAR:yu,DOT:pn,EQUALS:bu,EXCLAMATION:Zp,HYPHEN:Ht,PERCENT:bs,PIPE:ku,PLUS:xu,POUND:wu,QUERY:ks,QUOTE:Qp,FULLWIDTHMIDDLEDOT:Lk,SEMI:ef,SLASH:fn,TILDE:xs,UNDERSCORE:Eu,EMOJI:Bk,SYM:Cu});const Vn=/[a-z]/,qo=/\p{L}/u,ld=/\p{Emoji}/u,$n=/\d/,ud=/\s/,sv="\r",cd=`
|
|
103
|
+
`,fL="️",mL="",dd="";let ja=null,za=null;function gL(t=[]){const e={};Et.groups=e;const n=new Et;ja==null&&(ja=av(lL)),za==null&&(za=av(uL)),N(n,"'",Yp),N(n,"{",vs),N(n,"}",ys),N(n,"[",Ql),N(n,"]",eu),N(n,"(",tu),N(n,")",nu),N(n,"<",ru),N(n,">",iu),N(n,"(",ou),N(n,")",su),N(n,"「",au),N(n,"」",lu),N(n,"『",uu),N(n,"』",cu),N(n,"<",du),N(n,">",hu),N(n,"&",pu),N(n,"*",fu),N(n,"@",gr),N(n,"`",gu),N(n,"^",vu),N(n,":",kr),N(n,",",Xp),N(n,"$",yu),N(n,".",pn),N(n,"=",bu),N(n,"!",Zp),N(n,"-",Ht),N(n,"%",bs),N(n,"|",ku),N(n,"+",xu),N(n,"#",wu),N(n,"?",ks),N(n,'"',Qp),N(n,"/",fn),N(n,";",ef),N(n,"~",xs),N(n,"_",Eu),N(n,"\\",mu),N(n,"・",Lk);const r=Ie(n,$n,Gp,{[kh]:!0});Ie(r,$n,r);const i=Ie(r,Vn,Pk,{[gs]:!0}),o=Ie(r,qo,Fk,{[Qo]:!0}),s=Ie(n,Vn,zn,{[xh]:!0});Ie(s,$n,i),Ie(s,Vn,s),Ie(i,$n,i),Ie(i,Vn,i);const a=Ie(n,qo,Ch,{[wh]:!0});Ie(a,Vn),Ie(a,$n,o),Ie(a,qo,a),Ie(o,$n,o),Ie(o,Vn),Ie(o,qo,o);const l=N(n,cd,Jp,{[ad]:!0}),u=N(n,sv,Oh,{[ad]:!0}),c=Ie(n,ud,Oh,{[ad]:!0});N(n,dd,c),N(u,cd,l),N(u,dd,c),Ie(u,ud,c),N(c,sv),N(c,cd),Ie(c,ud,c),N(c,dd,c);const d=Ie(n,ld,Bk,{[Nk]:!0});N(d,"#"),Ie(d,ld,d),N(d,fL,d);const h=N(d,mL);N(h,"#"),Ie(h,ld,d);const p=[[Vn,s],[$n,i]],f=[[Vn,null],[qo,a],[$n,o]];for(let m=0;m<ja.length;m++)cr(n,ja[m],Sh,zn,p);for(let m=0;m<za.length;m++)cr(n,za[m],Th,Ch,f);ci(Sh,{tld:!0,ascii:!0},e),ci(Th,{utld:!0,alpha:!0},e),cr(n,"file",pl,zn,p),cr(n,"mailto",pl,zn,p),cr(n,"http",Xi,zn,p),cr(n,"https",Xi,zn,p),cr(n,"ftp",Xi,zn,p),cr(n,"ftps",Xi,zn,p),ci(pl,{scheme:!0,ascii:!0},e),ci(Xi,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){const g=t[m][0],y=t[m][1]?{[cL]:!0}:{[dL]:!0};g.indexOf("-")>=0?y[Eh]=!0:Vn.test(g)?$n.test(g)?y[gs]=!0:y[xh]=!0:y[kh]=!0,ov(n,g,g,y)}return ov(n,"localhost",qs,{ascii:!0}),n.jd=new Et(Cu),{start:n,tokens:Ao({groups:e},Vk)}}function $k(t,e){const n=vL(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=t,l=null,u=0,c=null,d=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,h=0,c=a):d>=0&&(d+=n[s].length,h++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=h,u-=d,i.push({t:c.t,v:e.slice(o-u,o),s:o-u,e:o})}return i}function vL(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function cr(t,e,n,r,i){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Et(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new Et(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function av(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Ws={defaultProtocol:"http",events:null,format:lv,formatHref:lv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tf(t,e=null){let n=Ao({},Ws);t&&(n=Ao(n,t instanceof tf?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}tf.prototype={o:Ws,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Ws[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function lv(t){return t}function jk(t,e){this.t="token",this.v=t,this.tk=e}jk.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ws.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&Ao(s,c),{tagName:i,attributes:s,content:o,eventListeners:d}}};function dc(t,e){class n extends jk{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const uv=dc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cv=dc("text"),yL=dc("nl"),Ha=dc("url",{isLink:!0,toHref(t=Ws.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==qs&&t[1].t===kr}}),zt=t=>new Et(t);function bL({groups:t}){const e=t.domain.concat([pu,fu,gr,mu,gu,vu,yu,bu,Ht,Gp,bs,ku,xu,wu,fn,Cu,xs,Eu]),n=[kr,Xp,pn,Zp,bs,ks,Qp,ef,ru,iu,vs,ys,eu,Ql,tu,nu,ou,su,au,lu,uu,cu,du,hu],r=[pu,Yp,fu,mu,gu,vu,yu,bu,Ht,vs,ys,bs,ku,xu,wu,ks,fn,Cu,xs,Eu],i=zt(),o=N(i,xs);me(o,r,o),me(o,t.domain,o);const s=zt(),a=zt(),l=zt();me(i,t.domain,s),me(i,t.scheme,a),me(i,t.slashscheme,l),me(s,r,o),me(s,t.domain,s);const u=N(s,gr);N(o,gr,u),N(a,gr,u),N(l,gr,u);const c=N(o,pn);me(c,r,o),me(c,t.domain,o);const d=zt();me(u,t.domain,d),me(d,t.domain,d);const h=N(d,pn);me(h,t.domain,d);const p=zt(uv);me(h,t.tld,p),me(h,t.utld,p),N(u,qs,p);const f=N(d,Ht);N(f,Ht,f),me(f,t.domain,d),me(p,t.domain,d),N(p,pn,h),N(p,Ht,f);const m=N(p,kr);me(m,t.numeric,uv);const g=N(s,Ht),y=N(s,pn);N(g,Ht,g),me(g,t.domain,s),me(y,r,o),me(y,t.domain,s);const b=zt(Ha);me(y,t.tld,b),me(y,t.utld,b),me(b,t.domain,s),me(b,r,o),N(b,pn,y),N(b,Ht,g),N(b,gr,u);const k=N(b,kr),v=zt(Ha);me(k,t.numeric,v);const w=zt(Ha),x=zt();me(w,e,w),me(w,n,x),me(x,e,w),me(x,n,x),N(b,fn,w),N(v,fn,w);const _=N(a,kr),A=N(l,kr),S=N(A,fn),O=N(S,fn);me(a,t.domain,s),N(a,pn,y),N(a,Ht,g),me(l,t.domain,s),N(l,pn,y),N(l,Ht,g),me(_,t.domain,w),N(_,fn,w),N(_,ks,w),me(O,t.domain,w),me(O,e,w),N(O,fn,w);const C=[[vs,ys],[Ql,eu],[tu,nu],[ru,iu],[ou,su],[au,lu],[uu,cu],[du,hu]];for(let T=0;T<C.length;T++){const[R,j]=C[T],H=N(w,R);N(x,R,H),N(H,j,w);const $=zt(Ha);me(H,e,$);const X=zt();me(H,n),me($,e,$),me($,n,X),me(X,e,$),me(X,n,X),N($,j,w),N(X,j,w)}return N(i,qs,b),N(i,Jp,yL),{start:i,tokens:Vk}}function kL(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=t,l=null,u=null,c=0,d=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(u=l||a.go(n[i].t));)l=null,a=u,a.accepts()?(h=0,d=a):h>=0&&h++,i++,c++;if(h<0)i-=c,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(hd(cv,e,s)),s=[]),i-=h,c-=h;const p=d.t,f=n.slice(i-c,i);o.push(hd(p,e,f))}}return s.length>0&&o.push(hd(cv,e,s)),o}function hd(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const xL=typeof console<"u"&&console&&console.warn||(()=>{}),wL="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Oe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function EL(){return Et.groups={},Oe.scanner=null,Oe.parser=null,Oe.tokenQueue=[],Oe.pluginQueue=[],Oe.customSchemes=[],Oe.initialized=!1,Oe}function dv(t,e=!1){if(Oe.initialized&&xL(`linkifyjs: already initialized - will not register custom scheme "${t}" ${wL}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
104
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
105
|
+
2. Cannot start or end with "-"
|
|
106
|
+
3. "-" cannot repeat`);Oe.customSchemes.push([t,e])}function CL(){Oe.scanner=gL(Oe.customSchemes);for(let t=0;t<Oe.tokenQueue.length;t++)Oe.tokenQueue[t][1]({scanner:Oe.scanner});Oe.parser=bL(Oe.scanner.tokens);for(let t=0;t<Oe.pluginQueue.length;t++)Oe.pluginQueue[t][1]({scanner:Oe.scanner,parser:Oe.parser});return Oe.initialized=!0,Oe}function nf(t){return Oe.initialized||CL(),kL(Oe.parser.start,t,$k(Oe.scanner.start,t))}nf.scan=$k;function zk(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new tf(n),i=nf(t),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}function SL(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function TL(t){return new He({key:new ft("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),o=e.some(l=>l.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=$N(n.doc,[...e]);if(KN(a).forEach(({newRange:l})=>{const u=zN(r.doc,l,h=>h.isTextblock);let c,d;if(u.length>1?(c=u[0],d=r.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(l.from,l.to," "," ").endsWith(" ")&&(c=u[0],d=r.doc.textBetween(c.pos,l.to,void 0," ")),c&&d){const h=d.split(" ").filter(g=>g!=="");if(h.length<=0)return!1;const p=h[h.length-1],f=c.pos+d.lastIndexOf(p);if(!p)return!1;const m=nf(p).map(g=>g.toObject(t.defaultProtocol));if(!SL(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:f+g.start+1,to:f+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{Vp(g.from,g.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function OL(t){return new He({key:new ft("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(h=>h.nodeName==="A"))return!1;const l=pk(e.state,t.type.name),u=r.target,c=(i=u?.href)!==null&&i!==void 0?i:l.href,d=(o=u?.target)!==null&&o!==void 0?o:l.target;return u&&c?(window.open(c,d),!0):!1}}})}function AL(t){return new He({key:new ft("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=zk(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const ML=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Yr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(ML,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const _L=rr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){dv(t);return}dv(t.scheme,t.optionalSlashes)})},onDestroy(){EL()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Yr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Yr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Yr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",it(this.options.HTMLAttributes,t),0]:["a",it(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Yr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Yr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ti({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=zk(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Yr(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(TL({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Yr(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(OL({type:this.type})),this.options.linkOnPaste&&t.push(AL({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),IL=Ze.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new He({key:new ft("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,u=!s.isLeaf&&lc(s);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const d=Pt.node(a,a+s.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),$e.create(t,i)}}})]}}),DL=/^\s*>\s$/,RL=dn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[js({find:DL,type:this.type})]}}),NL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,PL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,FL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,LL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,BL=rr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Eo({find:NL,type:this.type}),Eo({find:FL,type:this.type})]},addPasteRules(){return[Ti({find:PL,type:this.type}),Ti({find:LL,type:this.type})]}}),VL="listItem",hv="textStyle",pv=/^\s*([-+*])\s$/,$L=dn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",it(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VL,this.editor.getAttributes(hv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=js({find:pv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=js({find:pv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(hv),editor:this.editor})),[t]}}),jL=/(^|[^`])`([^`]+)`(?!`)/,zL=/(^|[^`])`([^`]+)`(?!`)/g,HL=rr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Eo({find:jL,type:this.type})]},addPasteRules(){return[Ti({find:zL,type:this.type})]}}),qL=/^```([a-z]+)?[\s\n]$/,WL=/^~~~([a-z]+)?[\s\n]$/,UL=dn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",it(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
107
|
+
|
|
108
|
+
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:a})=>(a.setSelection(fe.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[fh({find:qL,type:this.type,getAttributes:t=>({language:t[1]})}),fh({find:WL,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new He({key:new ft("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
|
109
|
+
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),KL=dn.create({name:"doc",topNode:!0,content:"block+"});function GL(t={}){return new He({view(e){return new JL(e,t)}})}class JL{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let c=u.getBoundingClientRect(),d=a?c.bottom:c.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:c.left,right:c.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=c0(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const YL=Ze.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[GL(this.options)]}});class Ne extends fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ne.valid(r)?new Ne(r):fe.near(r)}content(){return V.empty}eq(e){return e instanceof Ne&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ne(e.resolve(n.pos))}getBookmark(){return new rf(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!XL(e)||!ZL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ne.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Ne.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!ee.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Ne.valid(a))return a}return null}}}Ne.prototype.visible=!1;Ne.findFrom=Ne.findGapCursorFrom;fe.jsonID("gapcursor",Ne);class rf{constructor(e){this.pos=e}map(e){return new rf(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ne.valid(n)?new Ne(n):fe.near(n)}}function XL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function ZL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function QL(){return new He({props:{decorations:rB,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ne.valid(n)?new Ne(n):null},handleClick:tB,handleKeyDown:eB,handleDOMEvents:{beforeinput:nB}}})}const eB=X0({ArrowLeft:qa("horiz",-1),ArrowRight:qa("horiz",1),ArrowUp:qa("vert",-1),ArrowDown:qa("vert",1)});function qa(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Ne.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Ne(u))),!0):!1}}function tB(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ne.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ee.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ne(r))),!0)}function nB(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ne))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=D.empty;for(let s=r.length-1;s>=0;s--)i=D.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new V(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function rB(t){if(!(t.selection instanceof Ne))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",$e.create(t.doc,[Pt.widget(t.selection.head,e,{key:"gapcursor"})])}const iB=Ze.create({name:"gapCursor",addProseMirrorPlugins(){return[QL()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ve(q(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),oB=dn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",it(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
110
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){const d=l.filter(h=>a.includes(h.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sB=dn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,it(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>fh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Su=200,Je=function(){};Je.prototype.append=function(t){return t.length?(t=Je.from(t),!this.length&&t||t.length<Su&&this.leafAppend(t)||this.length<Su&&t.leafPrepend(this)||this.appendInner(t)):this};Je.prototype.prepend=function(t){return t.length?Je.from(t).append(this):this};Je.prototype.appendInner=function(t){return new aB(this,t)};Je.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Je.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};Je.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Je.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};Je.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(i,o){return r.push(t(i,o))},e,n),r};Je.from=function(t){return t instanceof Je?t:t&&t.length?new Hk(t):Je.empty};var Hk=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Su)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Su)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Je);Je.empty=new Hk([]);var aB=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,i,o){var s=this.left.length;if(r<s&&this.left.forEachInner(n,r,Math.min(i,s),o)===!1||i>s&&this.right.forEachInner(n,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,i,o){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(n,r-s,Math.max(i,s)-s,o+s)===!1||i<s&&this.left.forEachInvertedInner(n,Math.min(r,s),i,o)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(n,r):n>=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Je);const lB=500;class on{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,c.push(d);return}if(i){c.push(new mn(d.map));let p=d.step.map(i.slice(o)),f;p&&s.maybeStep(p).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],u.push(new mn(f,void 0,void 0,u.length+c.length))),o--,f&&i.appendMap(f,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new on(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),h=new mn(e.mapping.maps[c],d,n),p;(p=l&&l.merge(h))&&(h=p,c?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(l=h)}let u=s-r.depth;return u>cB&&(a=uB(a,u),s-=u),new on(a.append(o),s)}remapping(e,n){let r=new ao;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new on(this.items.append(e.map(n=>new mn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(l+1,p));g&&a++,r.push(new mn(f,m,g))}else r.push(new mn(f))},i);let u=[];for(let h=n;h<s;h++)u.push(new mn(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new on(c,a);return d.emptyItemCount()>lB&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let d=new mn(u.invert(),l,c),h,p=i.length-1;(h=i.length&&i[p].merge(d))?i[p]=h:i.push(d)}}else s.map&&r--},this.items.length,0),new on(Je.from(i.reverse()),o)}}on.empty=new on(Je.empty,0);function uB(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class mn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new mn(n.getMap().invert(),n,this.selection)}}}class vr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const cB=20;function dB(t,e,n,r){let i=n.getMeta(gi),o;if(i)return i.historyState;n.getMeta(fB)&&(t=new vr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(gi))return s.getMeta(gi).redo?new vr(t.done.addTransform(n,void 0,r,fl(e)),t.undone,fv(n.mapping.maps),t.prevTime,t.prevComposition):new vr(t.done,t.undone.addTransform(n,void 0,r,fl(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!hB(n,t.prevRanges)),u=s?pd(t.prevRanges,n.mapping):fv(n.mapping.maps);return new vr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,fl(e)),on.empty,u,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new vr(t.done.rebased(n,o),t.undone.rebased(n,o),pd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new vr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function hB(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function fv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function pd(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function pB(t,e,n){let r=fl(e),i=gi.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new vr(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(gi,{redo:n,historyState:l})}let fd=!1,mv=null;function fl(t){let e=t.plugins;if(mv!=e){fd=!1,mv=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){fd=!0;break}}return fd}const gi=new ft("history"),fB=new ft("closeHistory");function mB(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new He({key:gi,state:{init(){return new vr(on.empty,on.empty,null,0,-1)},apply(e,n,r){return dB(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Wk:r=="historyRedo"?Uk:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function qk(t,e){return(n,r)=>{let i=gi.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=pB(i,n,t);o&&r(o.scrollIntoView())}return!0}}const Wk=qk(!1),Uk=qk(!0),gB=Ze.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Wk(t,e),redo:()=>({state:t,dispatch:e})=>Uk(t,e)}},addProseMirrorPlugins(){return[mB(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vB=dn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",it(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):fk(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:u}=s.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(ee.create(s.doc,u.pos)):s.setSelection(le.create(s.doc,u.pos));else{const d=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(s.insert(c,d),s.setSelection(le.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[SP({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),yB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,bB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,kB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,xB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wB=rr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Eo({find:yB,type:this.type}),Eo({find:kB,type:this.type})]},addPasteRules(){return[Ti({find:bB,type:this.type}),Ti({find:xB,type:this.type})]}}),EB=dn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",it(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),CB="listItem",gv="textStyle",vv=/^(\d+)\.\s$/,SB=dn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",it(this.options.HTMLAttributes,n),0]:["ol",it(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(CB,this.editor.getAttributes(gv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=js({find:vv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=js({find:vv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(gv)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),TB=dn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,AB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MB=rr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",it(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Eo({find:OB,type:this.type})]},addPasteRules(){return[Ti({find:AB,type:this.type})]}}),_B=dn.create({name:"text",group:"inline"}),IB=Ze.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,u,c,d,h,p,f,m,g,y;const b=[];return this.options.bold!==!1&&b.push(BL.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&b.push(RL.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&b.push($L.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&b.push(HL.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(UL.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&b.push(KL.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&b.push(YL.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&b.push(iB.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&b.push(oB.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&b.push(sB.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&b.push(gB.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&b.push(vB.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&b.push(wB.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&b.push(EB.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&b.push(SB.configure((f=this.options)===null||f===void 0?void 0:f.orderedList)),this.options.paragraph!==!1&&b.push(TB.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&b.push(MB.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&b.push(_B.configure((y=this.options)===null||y===void 0?void 0:y.text)),b}}),DB={class:"k-richtext__menu"},bV=ie({__name:"RichText",props:{modelValue:{default:""},disabled:{type:Boolean},actions:{default:()=>["heading2","bold","italic","orderedList","bulletList"]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=aL({extensions:[IB,IL.configure({placeholder:"Write something..."}),_L.configure({defaultProtocol:"https",protocols:["mailto"],HTMLAttributes:{class:"",rel:"noopener noreferrer nofollow",target:"_blank"}})],editable:!n.disabled,content:n.modelValue,onUpdate:({editor:a})=>{r("update:modelValue",a.getHTML())}}),o=P(()=>!i||!i.value?[]:[{id:"heading2",icon:"fa-pro-regular:heading",action:()=>{var a;return(a=i.value)==null?void 0:a.chain().focus().toggleHeading({level:2}).run()},isActive:()=>{var a;return(a=i.value)==null?void 0:a.isActive("heading",{level:2})}},{id:"bold",icon:"fa-pro-regular:bold",action:()=>{var a;return(a=i.value)==null?void 0:a.chain().focus().toggleBold().run()},isActive:()=>{var a;return(a=i.value)==null?void 0:a.isActive("bold")}},{id:"italic",icon:"fa-pro-regular:italic",action:()=>{var a;return(a=i.value)==null?void 0:a.chain().focus().toggleItalic().run()},isActive:()=>{var a;return(a=i.value)==null?void 0:a.isActive("italic")}},{id:"orderedList",icon:"fa-pro-regular:list-ol",action:()=>{var a;return(a=i.value)==null?void 0:a.chain().focus().toggleOrderedList().run()},isActive:()=>{var a;return(a=i.value)==null?void 0:a.isActive("orderedList")}},{id:"bulletList",icon:"fa-pro-regular:list-ul",action:()=>{var a;return(a=i.value)==null?void 0:a.chain().focus().toggleBulletList().run()},isActive:()=>{var a;return(a=i.value)==null?void 0:a.isActive("bulletList")}}].filter(a=>n.actions.includes(a.id))),s=Dn("k-richtext",{variants:{disabled:{true:"k-richtext--disabled"}}});return(a,l)=>(E(),I("div",{class:Me(z(s)({disabled:a.disabled}))},[W("div",DB,[ke(Db,{class:"k-richtext__menu-group",modelValue:[],multiple:!0},{default:te(({getItemProps:u})=>[(E(!0),I(Le,null,Ft(o.value,c=>(E(),U(yt,{disabled:a.disabled,variant:"tertiary",class:"k-richtext__item","data-part":"item","data-state":`${c.isActive()?"on":"off"}`,onClick:()=>c.action(),icon:c.icon},null,8,["disabled","data-state","onClick","icon"]))),256))]),_:1})]),ke(z(sL),{editor:z(i),class:"k-richtext__editor"},null,8,["editor"])],2))}});function RB(t){return t%4===0&&t%100!==0||t%400===0}function NB(t=""){if(t.length===10){let e=t.replace(".","-").replace("/","-").split("-");if(e.length===3&&e[0].length===4){let n=parseInt(e[0]),r=parseInt(e[1]),i=parseInt(e[2]);if(r===2){if(RB(n)){if(i>29)return!1}else if(i>28)return!1}if((r===4||r===6||r===9||r===11)&&i>30)return!1}return!0}return!0}function jn(t){let e;if(typeof t=="number"&&(e=new Date(t),typeof e=="object"))return!0;if(e=new Date(t),typeof e=="object")return!(e.toString()==="Invalid Date"||!NB(t));var n=/^\d{4}\-\d{1,2}\-\d{1,2}$/;if(!n.test(t))return!1;var r=t.split("-"),i=parseInt(r[2],10),o=parseInt(r[1],10),s=parseInt(r[0],10);if(s<1e3||s>3e3||o==0||o>12)return!1;var a=[31,28,31,30,31,30,31,31,30,31,30,31];return(s%400==0||s%100!=0&&s%4==0)&&(a[1]=29),i>0&&i<=a[o-1]}var Tu={required:function(t){var e;return t==null?!1:(e=String(t).replace(/\s/g,""),e.length>0)},required_if:function(t,e,n){return e=this.getParameters(),this.validator._objectPath(this.validator.input,e[0])===e[1]?this.validator.getRule("required").validate(t):!0},required_unless:function(t,e,n){return e=this.getParameters(),this.validator._objectPath(this.validator.input,e[0])!==e[1]?this.validator.getRule("required").validate(t):!0},required_with:function(t,e,n){return this.validator._objectPath(this.validator.input,e)?this.validator.getRule("required").validate(t):!0},required_with_all:function(t,e,n){e=this.getParameters();for(var r=0;r<e.length;r++)if(!this.validator._objectPath(this.validator.input,e[r]))return!0;return this.validator.getRule("required").validate(t)},required_without:function(t,e,n){return this.validator._objectPath(this.validator.input,e)?!0:this.validator.getRule("required").validate(t)},required_without_all:function(t,e,n){e=this.getParameters();for(var r=0;r<e.length;r++)if(this.validator._objectPath(this.validator.input,e[r]))return!0;return this.validator.getRule("required").validate(t)},boolean:function(t){return t===!0||t===!1||t===0||t===1||t==="0"||t==="1"||t==="true"||t==="false"},size:function(t,e,n){if(t){e=parseFloat(e);var r=this.getSize();return r===e}return!0},string:function(t,e,n){return typeof t=="string"},sometimes:function(t){return!0},min:function(t,e,n){var r=this.getSize();return r>=e},max:function(t,e,n){var r=this.getSize();return r<=e},between:function(t,e,n){e=this.getParameters();var r=this.getSize(),i=parseFloat(e[0],10),o=parseFloat(e[1],10);return r>=i&&r<=o},email:function(t){var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(t)||(e=/^((?:[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]|[^\u0000-\u007F])+@(?:[a-zA-Z0-9]|[^\u0000-\u007F])(?:(?:[a-zA-Z0-9-]|[^\u0000-\u007F]){0,61}(?:[a-zA-Z0-9]|[^\u0000-\u007F]))?(?:\.(?:[a-zA-Z0-9]|[^\u0000-\u007F])(?:(?:[a-zA-Z0-9-]|[^\u0000-\u007F]){0,61}(?:[a-zA-Z0-9]|[^\u0000-\u007F]))?)+)*$/),e.test(t)},numeric:function(t){var e;return e=Number(t),typeof e=="number"&&!isNaN(e)&&typeof t!="boolean"},array:function(t){return t instanceof Array},url:function(t){return/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_\+.~#?&/=]*)/i.test(t)},alpha:function(t){return/^[a-zA-Z]+$/.test(t)},alpha_dash:function(t){return/^[a-zA-Z0-9_\-]+$/.test(t)},alpha_num:function(t){return/^[a-zA-Z0-9]+$/.test(t)},same:function(t,e){var n=this.validator._flattenObject(this.validator.input)[e],r=t;return n===r},different:function(t,e){var n=this.validator._flattenObject(this.validator.input)[e],r=t;return n!==r},in:function(t,e){var n,r;if(t&&(n=this.getParameters()),t&&!(t instanceof Array)){var i=t;for(r=0;r<n.length;r++)if(typeof n[r]=="string"&&(i=String(t)),i===n[r])return!0;return!1}if(t&&t instanceof Array){for(r=0;r<t.length;r++)if(n.indexOf(t[r])<0)return!1}return!0},not_in:function(t,e){for(var n=this.getParameters(),r=n.length,i=!0,o=0;o<r;o++){var s=t;if(typeof n[o]=="string"&&(s=String(t)),s===n[o]){i=!1;break}}return i},accepted:function(t){return t==="on"||t==="yes"||t===1||t==="1"||t===!0},confirmed:function(t,e,n){var r=n+"_confirmation";return this.validator.input[r]===t},integer:function(t){return String(parseInt(t,10))===String(t)},digits:function(t,e){var n=this.validator.getRule("numeric");return!!(n.validate(t)&&String(t.trim()).length===parseInt(e))},digits_between:function(t){var e=this.validator.getRule("numeric"),n=this.getParameters(),r=String(t).length,i=parseFloat(n[0],10),o=parseFloat(n[1],10);return!!(e.validate(t)&&r>=i&&r<=o)},regex:function(t,e){var n=/[g|i|m]{1,3}$/,r=e.match(n);return r=r?r[0]:"",e=e.replace(n,"").slice(1,-1),e=new RegExp(e,r),!!e.test(t)},date:function(t,e){return jn(t)},present:function(t){return typeof t<"u"},after:function(t,e){var n=this.validator.input[e],r=t;return!jn(n)||!jn(r)?!1:new Date(n).getTime()<new Date(r).getTime()},after_or_equal:function(t,e){var n=this.validator.input[e],r=t;return!jn(n)||!jn(r)?!1:new Date(n).getTime()<=new Date(r).getTime()},before:function(t,e){var n=this.validator.input[e],r=t;return!jn(n)||!jn(r)?!1:new Date(n).getTime()>new Date(r).getTime()},before_or_equal:function(t,e){var n=this.validator.input[e],r=t;return!jn(n)||!jn(r)?!1:new Date(n).getTime()>=new Date(r).getTime()},hex:function(t){return/^[0-9a-f]+$/i.test(t)},ipv4:function(t,e,n){if(typeof t!="string")return!1;var r=/^[0-9]+$/;if(octets=t.split("."),octets.length!=4)return!1;for(let o=0;o<octets.length;o++){const s=octets[o];if(!r.test(s))return!1;var i=parseInt(s);if(i>=256)return!1}return!0},ipv6:function(t,e,n){if(typeof t!="string")return!1;var r=/^[0-9a-f]+$/;if(hextets=t.split(":"),colons=t.match(/::/),colons!=null&&t.match(/::/g).length>1||t[0]==":"&&(colons==null||colons!=null&&colons.index!=0)||t[t.length-1]==":"&&(colons==null||colons!=null&&colons.index!=t.length-2)||3>hextets.length)return!1;var i=hextets.length==9&&colons!=null&&(colons.index==0||colons.index==t.length-2);if(hextets.length>8&&!i||hextets.length!=8&&colons==null)return!1;for(let o=0;o<hextets.length;o++){const s=hextets[o];if(s.length!=0&&(!r.test(s)||s.length>4))return!1}return!0},ip:function(t,e,n){return Tu.ipv4(t,e,n)||Tu.ipv6(t,e,n)}},Kk=function(){throw new Error("Validator `"+this.name+"` is not defined!")},Gk;function Jk(t,e,n){this.name=t,this.fn=e,this.passes=null,this._customMessage=void 0,this.async=n}Jk.prototype={validate:function(t,e,n,r){var i=this;if(this._setValidatingData(n,t,e),typeof r=="function"){this.callback=r;var o=function(s,a){i.response(s,a)};return this.async?this._apply(t,e,n,o):o(this._apply(t,e,n))}return this._apply(t,e,n)},_apply:function(t,e,n,r){var i=this.isMissed()?Kk:this.fn;return i.apply(this,[t,e,n,r])},_setValidatingData:function(t,e,n){this.attribute=t,this.inputValue=e,this.ruleValue=n},getParameters:function(){var t=[];return typeof this.ruleValue=="string"&&(t=this.ruleValue.split(",")),typeof this.ruleValue=="number"&&t.push(this.ruleValue),this.ruleValue instanceof Array&&(t=this.ruleValue),t},getSize:function(){var t=this.inputValue;return t instanceof Array?t.length:typeof t=="number"?t:this.validator._hasNumericRule(this.attribute)?parseFloat(t,10):t.length},_getValueType:function(){return typeof this.inputValue=="number"||this.validator._hasNumericRule(this.attribute)?"numeric":"string"},response:function(t,e){this.passes=t===void 0||t===!0,this._customMessage=e,this.callback(this.passes,e)},setValidator:function(t){this.validator=t},isMissed:function(){return typeof this.fn!="function"},get customMessage(){return this.isMissed()?Gk:this._customMessage}};var PB={asyncRules:[],implicitRules:["required","required_if","required_unless","required_with","required_with_all","required_without","required_without_all","accepted","present"],make:function(t,e){var n=this.isAsync(t),r=new Jk(t,Tu[t],n);return r.setValidator(e),r},isAsync:function(t){for(var e=0,n=this.asyncRules.length;e<n;e++)if(this.asyncRules[e]===t)return!0;return!1},isImplicit:function(t){return this.implicitRules.indexOf(t)>-1},register:function(t,e){Tu[t]=e},registerImplicit:function(t,e){this.register(t,e),this.implicitRules.push(t)},registerAsync:function(t,e){this.register(t,e),this.asyncRules.push(t)},registerAsyncImplicit:function(t,e){this.registerImplicit(t,e),this.asyncRules.push(t)},registerMissedRuleValidator:function(t,e){Kk=t,Gk=e}},FB=PB;function LB(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var BB={between:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{min:n[0],max:n[1]})},digits_between:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{min:n[0],max:n[1]})},required_if:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{other:this._getAttributeName(n[0]),value:n[1]})},required_unless:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{other:this._getAttributeName(n[0]),value:n[1]})},required_with:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{field:this._getAttributeName(n[0])})},required_with_all:function(t,e){var n=e.getParameters(),r=this._getAttributeName.bind(this);return this._replacePlaceholders(e,t,{fields:n.map(r).join(", ")})},required_without:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{field:this._getAttributeName(n[0])})},required_without_all:function(t,e){var n=e.getParameters(),r=this._getAttributeName.bind(this);return this._replacePlaceholders(e,t,{fields:n.map(r).join(", ")})},after:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{after:this._getAttributeName(n[0])})},before:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{before:this._getAttributeName(n[0])})},after_or_equal:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{after_or_equal:this._getAttributeName(n[0])})},before_or_equal:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{before_or_equal:this._getAttributeName(n[0])})},same:function(t,e){var n=e.getParameters();return this._replacePlaceholders(e,t,{same:this._getAttributeName(n[0])})}};function VB(t){return t.replace(/[_\[]/g," ").replace(/]/g,"")}var Yk={replacements:BB,formatter:VB},yv=Yk,Ah=function(t,e){this.lang=t,this.messages=e,this.customMessages={},this.attributeNames={}};Ah.prototype={constructor:Ah,_setCustom:function(t){this.customMessages=t||{}},_setAttributeNames:function(t){this.attributeNames=t},_setAttributeFormatter:function(t){this.attributeFormatter=t},_getAttributeName:function(t){var e=t;return this.attributeNames.hasOwnProperty(t)?this.attributeNames[t]:(this.messages.attributes.hasOwnProperty(t)&&(e=this.messages.attributes[t]),this.attributeFormatter&&(e=this.attributeFormatter(e)),e)},all:function(){return this.messages},render:function(t){if(t.customMessage)return t.customMessage;var e=this._getTemplate(t),n;return yv.replacements[t.name]?n=yv.replacements[t.name].apply(this,[e,t]):n=this._replacePlaceholders(t,e,{}),n},_getTemplate:function(t){for(var e=this.messages,n=e.def,r=this.customMessages,i=[t.name+"."+t.attribute,t.name],o=0,s;o<i.length;o++)if(s=i[o],r.hasOwnProperty(s)){n=r[s];break}else if(e.hasOwnProperty(s)){n=e[s];break}return typeof n=="object"&&(n=n[t._getValueType()]),n},_replacePlaceholders:function(t,e,n){var r,i;if(n.attribute=this._getAttributeName(t.attribute),n[t.name]=n[t.name]||t.getParameters().join(","),typeof e=="string"&&typeof n=="object"){r=e;for(i in n)r=r.replace(new RegExp(":"+i,"g"),n[i])}return r}};var $B=Ah,jB={accepted:"The :attribute must be accepted.",after:"The :attribute must be after :after.",after_or_equal:"The :attribute must be equal or after :after_or_equal.",alpha:"The :attribute field must contain only alphabetic characters.",alpha_dash:"The :attribute field may only contain alpha-numeric characters, as well as dashes and underscores.",alpha_num:"The :attribute field must be alphanumeric.",before:"The :attribute must be before :before.",before_or_equal:"The :attribute must be equal or before :before_or_equal.",between:{numeric:"The :attribute field must be between :min and :max.",string:"The :attribute field must be between :min and :max characters."},confirmed:"The :attribute confirmation does not match.",email:"The :attribute format is invalid.",date:"The :attribute is not a valid date format.",def:"The :attribute attribute has errors.",digits:"The :attribute must be :digits digits.",digits_between:"The :attribute field must be between :min and :max digits.",different:"The :attribute and :different must be different.",in:"The selected :attribute is invalid.",integer:"The :attribute must be an integer.",hex:"The :attribute field should have hexadecimal format",min:{numeric:"The :attribute must be at least :min.",string:"The :attribute must be at least :min characters."},max:{numeric:"The :attribute may not be greater than :max.",string:"The :attribute may not be greater than :max characters."},not_in:"The selected :attribute is invalid.",numeric:"The :attribute must be a number.",present:"The :attribute field must be present (but can be empty).",required:"The :attribute field is required.",required_if:"The :attribute field is required when :other is :value.",required_unless:"The :attribute field is required when :other is not :value.",required_with:"The :attribute field is required when :field is not empty.",required_with_all:"The :attribute field is required when :fields are not empty.",required_without:"The :attribute field is required when :field is empty.",required_without_all:"The :attribute field is required when :fields are empty.",same:"The :attribute and :same fields must match.",size:{numeric:"The :attribute must be :size.",string:"The :attribute must be :size characters."},string:"The :attribute must be a string.",url:"The :attribute format is invalid.",regex:"The :attribute format is invalid.",attributes:{}};const zB=zu(jB);var HB=$B,qB=LB,WB={messages:{},_set:function(t,e){this.messages[t]=e},_setRuleMessage:function(t,e,n){this._load(t),n===void 0&&(n=this.messages[t].def),this.messages[t][e]=n},_load:function(t){if(!this.messages[t])try{var e=qB("./lang/"+t);this._set(t,e)}catch{}},_get:function(t){return this._load(t),this.messages[t]},_make:function(t){return this._load(t),new HB(t,this.messages[t])}},Xk=WB;const Zk=zu(Xk);var Mh=function(){this.errors={}};Mh.prototype={constructor:Mh,add:function(t,e){this.has(t)||(this.errors[t]=[]),this.errors[t].indexOf(e)===-1&&this.errors[t].push(e)},get:function(t){return this.has(t)?this.errors[t]:[]},first:function(t){return this.has(t)?this.errors[t][0]:!1},all:function(){return this.errors},has:function(t){return!!this.errors.hasOwnProperty(t)}};var UB=Mh;function Qk(t,e){this.onResolvedAll=e,this.onFailedOne=t,this.resolvers={},this.resolversCount=0,this.passed=[],this.failed=[],this.firing=!1}Qk.prototype={add:function(t){var e=this.resolversCount;return this.resolvers[e]=t,this.resolversCount++,e},resolve:function(t){var e=this.resolvers[t];e.passes===!0?this.passed.push(e):e.passes===!1&&(this.failed.push(e),this.onFailedOne(e)),this.fire()},isAllResolved:function(){return this.passed.length+this.failed.length===this.resolversCount},fire:function(){this.firing&&this.isAllResolved()&&this.onResolvedAll(this.failed.length===0)},enableFiring:function(){this.firing=!0}};var KB=Qk,Pr=FB,Ni=Xk,GB=UB,JB=Yk,YB=KB,ze=function(t,e,n){var r=ze.getDefaultLang();this.input=t||{},this.messages=Ni._make(r),this.messages._setCustom(n),this.setAttributeFormatter(ze.prototype.attributeFormatter),this.errors=new GB,this.errorCount=0,this.hasAsync=!1,this.rules=this._parseRules(e)};ze.prototype={constructor:ze,lang:"en",numericRules:["integer","numeric"],attributeFormatter:JB.formatter,check:function(){for(var t in this.rules){var e=this.rules[t],n=this._objectPath(this.input,t);if(!(this._hasRule(t,["sometimes"])&&!this._suppliedWithData(t)))for(var r=0,i=e.length,o,s,a;r<i&&(s=e[r],o=this.getRule(s.name),!(this._isValidatable(o,n)&&(a=o.validate(n,s.value,t),a||this._addFailure(o),this._shouldStopValidating(t,a))));r++);}return this.errorCount===0},checkAsync:function(t,e){var n=this;t=t||function(){},e=e||function(){};var r=function(f,m){n._addFailure(f,m)},i=function(f){f?t():e()},o=new YB(r,i),s=function(f,m,g,y){return function(){var b=o.add(y);y.validate(f,m.value,g,function(){o.resolve(b)})}};for(var a in this.rules){var l=this.rules[a],u=this._objectPath(this.input,a);if(!(this._hasRule(a,["sometimes"])&&!this._suppliedWithData(a)))for(var c=0,d=l.length,h,p;c<d;c++)p=l[c],h=this.getRule(p.name),this._isValidatable(h,u)&&s(u,p,a,h)()}o.enableFiring(),o.fire()},_addFailure:function(t){var e=this.messages.render(t);this.errors.add(t.attribute,e),this.errorCount++},_flattenObject:function(t){var e={};function n(r,i){if(!(!i&&Object.getOwnPropertyNames(r).length===0))if(Object(r)!==r||Array.isArray(r))e[i]=r;else{var o=!0;for(var s in r)o=!1,n(r[s],i?i+"."+s:s);o&&(e[i]={})}}return t&&n(t),e},_objectPath:function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];var n=e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);for(var o=0,s=n.length;o<s;o++)if(typeof r=="object"&&r!==null&&Object.hasOwnProperty.call(r,n[o]))r=r[n[o]];else return;return r},_parseRules:function(t){var e={};t=this._flattenObject(t);for(var n in t){var r=t[n];this._parseRulesCheck(n,r,e)}return e},_parseRulesCheck:function(t,e,n,r){t.indexOf("*")>-1?this._parsedRulesRecurse(t,e,n,r):this._parseRulesDefault(t,e,n,r)},_parsedRulesRecurse:function(t,e,n,r){var i=t.substr(0,t.indexOf("*")-1),o=this._objectPath(this.input,i);if(o)for(var s=0;s<o.length;s++){var a=r?r.slice():[];a.push(s),this._parseRulesCheck(t.replace("*",s),e,n,a)}},_parseRulesDefault:function(t,e,n,r){var i=[];e instanceof Array&&(e=this._prepareRulesArray(e)),typeof e=="string"&&(e=e.split("|"));for(var o=0,s=e.length,a;o<s;o++)a=typeof e[o]=="string"?this._extractRuleAndRuleValue(e[o]):e[o],a.value&&(a.value=this._replaceWildCards(a.value,r),this._replaceWildCardsMessages(r)),Pr.isAsync(a.name)&&(this.hasAsync=!0),i.push(a);n[t]=i},_replaceWildCards:function(t,e){if(!e)return t;var n=t;return e.forEach(function(r){Array.isArray(n)&&(n=n[0]);const i=n.indexOf("*");if(i===-1)return n;n=n.substr(0,i)+r+n.substr(i+1)}),Array.isArray(t)&&(t[0]=n,n=t),n},_replaceWildCardsMessages:function(t){var e=this.messages.customMessages,n=this;Object.keys(e).forEach(function(r){if(t){var i=n._replaceWildCards(r,t);e[i]=e[r]}}),this.messages._setCustom(e)},_prepareRulesArray:function(t){for(var e=[],n=0,r=t.length;n<r;n++)if(typeof t[n]=="object")for(var i in t[n])e.push({name:i,value:t[n][i]});else e.push(t[n]);return e},_suppliedWithData:function(t){return this.input.hasOwnProperty(t)},_extractRuleAndRuleValue:function(t){var e={},n;return e.name=t,t.indexOf(":")>=0&&(n=t.split(":"),e.name=n[0],e.value=n.slice(1).join(":")),e},_hasRule:function(t,e){for(var n=this.rules[t]||[],r=0,i=n.length;r<i;r++)if(e.indexOf(n[r].name)>-1)return!0;return!1},_hasNumericRule:function(t){return this._hasRule(t,this.numericRules)},_isValidatable:function(t,e){return Array.isArray(e)||Pr.isImplicit(t.name)?!0:this.getRule("required").validate(e)},_shouldStopValidating:function(t,e){var n=this.stopOnAttributes;return typeof n>"u"||n===!1||e===!0?!1:n instanceof Array?n.indexOf(t)>-1:!0},setAttributeNames:function(t){this.messages._setAttributeNames(t)},setAttributeFormatter:function(t){this.messages._setAttributeFormatter(t)},getRule:function(t){return Pr.make(t,this)},stopOnError:function(t){this.stopOnAttributes=t},passes:function(t){var e=this._checkAsync("passes",t);return e?this.checkAsync(t):this.check()},fails:function(t){var e=this._checkAsync("fails",t);return e?this.checkAsync(function(){},t):!this.check()},_checkAsync:function(t,e){var n=typeof e=="function";if(this.hasAsync&&!n)throw t+" expects a callback when async rules are being tested.";return this.hasAsync||n}};ze.setMessages=function(t,e){return Ni._set(t,e),this};ze.getMessages=function(t){return Ni._get(t)};ze.useLang=function(t){this.prototype.lang=t};ze.getDefaultLang=function(){return this.prototype.lang};ze.setAttributeFormatter=function(t){this.prototype.attributeFormatter=t};ze.stopOnError=function(t){this.prototype.stopOnAttributes=t};ze.register=function(t,e,n,r){var i=ze.getDefaultLang();Pr.register(t,e),Ni._setRuleMessage(i,t,n)};ze.registerImplicit=function(t,e,n,r){var i=ze.getDefaultLang();Pr.registerImplicit(t,e),Ni._setRuleMessage(i,t,n)};ze.registerAsync=function(t,e,n,r){var i=ze.getDefaultLang();Pr.registerAsync(t,e),Ni._setRuleMessage(i,t,n)};ze.registerAsyncImplicit=function(t,e,n){var r=ze.getDefaultLang();Pr.registerAsyncImplicit(t,e),Ni._setRuleMessage(r,t,n)};ze.registerMissedRuleValidator=function(t,e){Pr.registerMissedRuleValidator(t,e)};var XB=ze;const Sr=zu(XB);Zk._set("en",zB);Sr.useLang("en");const _h=Q(!1),ZB=t=>{_h.value=!_h.value,Zk._set("default",t),Sr.useLang("default")},QB=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{const i=n.split(".").pop();return[n,e(i)]})),Ih=(t,e={})=>{const{rule:n="required",prefix:r=""}=e;let i={};return Object.entries(t).forEach(([o,s])=>{const a=r+o;if(ww(s)){s.map((l,u)=>{i=Object.assign(i,Ih(l,{rule:n,prefix:`${a}.${u}.`}))});return}if(xw(s)){i=Object.assign(i,Ih(s,{rule:n,prefix:`${a}.`}));return}i[a]=n}),i},eV=Sr.register,tV=Sr.registerAsync;function nV(t={}){const{rules:e,labels:n,data:r,customMessages:i,visitImmediate:o=!1}=t;if(i){let m=Sr.getMessages("default");Object.entries(i.value).forEach(([g,y])=>m[g]=y),Sr.setMessages("default",m)}let s=new Sr({},{}),a=()=>Object.fromEntries(Object.keys(e.value).map(m=>[m,{rule:e.value[m],valid:!c.value.get(m).length,error:c.value.first(m)||void 0,visited:l.value[m]}])),l=Q(o?Object.fromEntries(Object.keys(e.value).map(m=>[m,!0])):{}),u=Q(!0),c=Q(s.errors),d=P(()=>a());function h(m){var g;let y=(g=d.value)==null?void 0:g[m];const b={valid:!0,error:void 0};return!y||!y.visited?b:y}let p=()=>{let m=new Sr(r.value,e.value);n&&m.setAttributeNames(n.value);const g=()=>{c.value=s.errors,u.value=!0},y=()=>{u.value=!1,c.value=m.errors};m.checkAsync(g,y)};Fe([r,_h],p,{deep:!0,immediate:!0});const f=m=>{if(!m)return!1;const g=typeof m=="string"?m.split("|"):Array.isArray(m)?m:[],y={required:()=>!0,required_if:(b,k)=>r.value[b]===k,required_unless:(b,k)=>r.value[b]!==k,required_with:b=>b.some(k=>k in r.value),required_with_all:b=>b.every(k=>k in r.value),required_without:b=>b.some(k=>!(k in r.value)),required_without_all:b=>b.every(k=>!(k in r.value))};for(const b of g){if(typeof b=="string"){if(b==="required")return y.required;const[k,...v]=b.split(":");if(y[k]){const w=v.map(x=>["true",!0,"false",!1].includes(x)?JSON.parse(x):x);return y[k](...w)}}if(typeof b=="object"){for(const[k,v]of Object.entries(b))if(y[k])return Array.isArray(v)?y[k](...v):y[k](v)}}return!1};return{onChange:p,errors:c,passes:u,fields:d,bind:m=>({onBlur:()=>l.value[m]=!0,error:h(m).error,required:f(e.value[m])})}}const kV=Object.freeze(Object.defineProperty({__proto__:null,default:nV,generateLabels:QB,generateRules:Ih,register:eV,registerAsync:tV,setLabels:ZB},Symbol.toStringTag,{value:"Module"}));export{yt as B,kV as C,yV as E,wE as G,nV as J,nO as T,We as V,iV as Z,aV as a,iC as b,uV as c,mV as d,Pf as e,cV as f,by as g,dV as h,oV as i,Hv as j,gV as k,pV as m,sV as o,hV as p,ju as s,wC as t,lV as u,fV as v,vV as w,bV as x,bi as z};
|